All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/boot/compressed/64: Do not corrupt EDX on EFER.LME=1 setting
@ 2019-02-06 11:52 Kirill A. Shutemov
  2019-02-06 15:21 ` Borislav Petkov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kirill A. Shutemov @ 2019-02-06 11:52 UTC (permalink / raw)
  To: tglx, mingo, bp, hpa, dave.hansen
  Cc: x86, linux-kernel, Kirill A. Shutemov, Kyle D Pelton, Wei Huang

RDMSR in the trampoline code overrides EDX, but we use the register to
indicate if 5-level paging has to enabled. It leads to failure to boot
on a 5-level paging machine.

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

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
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>
Cc: Wei Huang <wei@redhat.com>
---
 arch/x86/boot/compressed/head_64.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index f105ae8651c9..f62e347862cc 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -602,10 +602,12 @@ ENTRY(trampoline_32bit_src)
 3:
 	/* Set EFER.LME=1 as a precaution in case hypervsior pulls the rug */
 	pushl	%ecx
+	pushl	%edx
 	movl	$MSR_EFER, %ecx
 	rdmsr
 	btsl	$_EFER_LME, %eax
 	wrmsr
+	popl	%edx
 	popl	%ecx
 
 	/* Enable PAE and LA57 (if required) paging modes */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-06 19:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 11:52 [PATCH] x86/boot/compressed/64: Do not corrupt EDX on EFER.LME=1 setting Kirill A. Shutemov
2019-02-06 15:21 ` Borislav Petkov
2019-02-06 15:47   ` Kirill A. Shutemov
2019-02-06 18:11     ` Borislav Petkov
2019-02-06 18:13     ` [tip:x86/cleanups] x86/boot/compressed/64: Explain paging_prepare()'s return value tip-bot for Kirill A. Shutemov
2019-02-06 18:04 ` [tip:x86/urgent] x86/boot/compressed/64: Do not corrupt EDX on EFER.LME=1 setting tip-bot for Kirill A. Shutemov
2019-02-06 19:50 ` [PATCH] " Wei Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.