]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/kexec: Make kexec (mostly) work in 5-level paging mode
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Mon, 29 Jan 2018 11:08:45 +0000 (14:08 +0300)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 23 Feb 2018 14:26:43 +0000 (08:26 -0600)
commit0f4d9c7eed45eb1661da7d9e19308eac15b407a2
tree91901ecc776cab66a7e735e886022bec810c9ee9
parent3b95301d396ac45e57e7a02d90273e8b78d7b661
x86/kexec: Make kexec (mostly) work in 5-level paging mode

BugLink: http://bugs.launchpad.net/bugs/1751131
commit 5bf30316991d5bcda046343ee77d823cf16fdd03 upstream.

Currently kexec() will crash when switching into a 5-level paging
enabled kernel.

I missed that we need to change relocate_kernel() to set CR4.LA57
flag if the kernel has 5-level paging enabled.

I avoided using #ifdef CONFIG_X86_5LEVEL here and inferred if we need to
enable 5-level paging from previous CR4 value. This way the code is
ready for boot-time switching between paging modes.

With this patch applied, in addition to kexec 4-to-4 which always worked,
we can kexec 4-to-5 and 5-to-5 - while 5-to-4 will need more work.

Reported-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tested-by: Baoquan He <bhe@redhat.com>
Cc: <stable@vger.kernel.org> # v4.14+
Cc: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Fixes: 77ef56e4f0fb ("x86: Enable 5-level paging support via CONFIG_X86_5LEVEL=y")
Link: http://lkml.kernel.org/r/20180129110845.26633-1-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/x86/kernel/relocate_kernel_64.S