• Baoquan He's avatar
    x86/boot: Add xloadflags bits to check for 5-level paging support · f2d08c5d
    Baoquan He authored
    The current kernel supports 5-level paging mode, and supports dynamically
    choosing the paging mode during bootup depending on the kernel image,
    hardware and kernel parameter settings. This flexibility brings several
    issues to kexec/kdump:
    
    1) Dynamic switching between paging modes requires support in the target
       kernel. This means kexec from a 5-level paging kernel into a kernel
       which does not support mode switching is not possible. So the loader
       needs to be able to analyze the supported paging modes of the kexec
       target kernel.
    
    2) If running on a 5-level paging kernel and the kexec target kernel is a
       4-level paging kernel, the target immage cannot be loaded above the 64TB
       address space limit. But the kexec loader searches for a load area from
       top to bottom which would eventually put the target kernel above 64TB
       when the machine has large enough RAM size. So the loader needs to be
       able to analyze the paging mode of the target kernel to load it at a
       suitable spot in the address space.
    
    Solution:
    
    Add two bits XLF_5LEVEL and XLF_5LEVEL_ENABLED:
    
     - Bit XLF_5LEVEL indicates whether 5-level paging mode switching support
       is available. (Issue #1)
    
     - Bit XLF_5LEVEL_ENABLED indicates whether the kernel was compiled with
       full 5-level paging support (CONFIG_X86_5LEVEL=y). (Issue #2)
    
    The loader will use these bits to verify whether the target kernel is
    suitable to be kexec'ed to from a 5-level paging kernel and to determine
    the constraints of the target kernel load address.
    
    The flags will be used by the kernel kexec subsystem and the userspace
    kexec tools.
    
    [ tglx: Massaged changelog ]
    Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Cc: bp@alien8.de
    Cc: hpa@zytor.com
    Cc: dyoung@redhat.com
    Link: https://lkml.kernel.org/r/20190524073810.24298-2-bhe@redhat.com
    f2d08c5d
bootparam.h 7.57 KB