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 <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44780
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Patrick Rudolph 2020-08-25 20:41:11 +02:00
parent 2e29c3b0d5
commit 9256e51f48
1 changed files with 2 additions and 2 deletions

View File

@ -46,9 +46,9 @@
#if defined(__x86_64__) #if defined(__x86_64__)
.bss .bss
ia32efer_backup_eax: ia32efer_backup_eax:
.long .long 0
ia32efer_backup_edx: ia32efer_backup_edx:
.long .long 0
#endif #endif
/* initially SMM is some sort of real mode. Let gcc know /* initially SMM is some sort of real mode. Let gcc know