x86/boot/compressed/64: Do not corrupt EDX on EFER.LME=1 setting
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 6 Feb 2019 11:52:53 +0000 (14:52 +0300)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Feb 2019 17:56:18 +0000 (18:56 +0100)
commit45b13b424faafb81c8c44541f093a682fdabdefc
treebfe1aa77e018ab73e84ef5e0eeb560d4e4d05adc
parentd28af26faa0b1daf3c692603d46bc4687c16f19e
x86/boot/compressed/64: Do not corrupt EDX on EFER.LME=1 setting

RDMSR in the trampoline code overwrites EDX but that register is used
to indicate whether 5-level paging has to be enabled and if clobbered,
leads to failure to boot on a 5-level paging machine.

Preserve EDX on the stack while we are dealing with EFER.

Fixes: b677dfae5aa1 ("x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline before returning to long mode")
Reported-by: Kyle D Pelton <kyle.d.pelton@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: dave.hansen@linux.intel.com
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wei Huang <wei@redhat.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190206115253.1907-1-kirill.shutemov@linux.intel.com
arch/x86/boot/compressed/head_64.S