From 9256e51f48550c83f5425550b8feee9fc2b7366c Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Tue, 25 Aug 2020 20:41:11 +0200 Subject: cpu/x86/smm/smmhandler: Fix x86_64 assembly exit Fix an issue the assembler didn't warn about to fix a crash on real hardware. qemu didn't catch this issue either. The linker uses the same address for variables in BSS if they aren't initialized in the code. This results in %edx being set to the value of %eax, which causes an exception restoring IA32_EFER on real hardware. Tested on qemu with KVM enabled. Change-Id: Ie36a88a2a11a6d755f06eff9b119e5b9398c6dec Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/44780 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/cpu/x86/smm/smmhandler.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/x86/smm/smmhandler.S') diff --git a/src/cpu/x86/smm/smmhandler.S b/src/cpu/x86/smm/smmhandler.S index 340840f685..1cff23afe6 100644 --- a/src/cpu/x86/smm/smmhandler.S +++ b/src/cpu/x86/smm/smmhandler.S @@ -46,9 +46,9 @@ #if defined(__x86_64__) .bss ia32efer_backup_eax: -.long +.long 0 ia32efer_backup_edx: -.long +.long 0 #endif /* initially SMM is some sort of real mode. Let gcc know -- cgit v1.2.3