Skip to content

Commit 45b13b4

Browse files
kirylsuryasaimadhu
authored andcommitted
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: b677dfa ("x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline before returning to long mode") Reported-by: Kyle D Pelton <[email protected]> Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: [email protected] Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Wei Huang <[email protected]> Cc: x86-ml <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent d28af26 commit 45b13b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/boot/compressed/head_64.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,12 @@ ENTRY(trampoline_32bit_src)
602602
3:
603603
/* Set EFER.LME=1 as a precaution in case hypervsior pulls the rug */
604604
pushl %ecx
605+
pushl %edx
605606
movl $MSR_EFER, %ecx
606607
rdmsr
607608
btsl $_EFER_LME, %eax
608609
wrmsr
610+
popl %edx
609611
popl %ecx
610612

611613
/* Enable PAE and LA57 (if required) paging modes */

0 commit comments

Comments
 (0)