Without the a32 modifier under FLAT32_JUMP, and the a16 modifier under
LONG_JUMP, nasm doesn't generate the 0x67 prefixes, and the far jumps
don't work. (For the former, KVM returns an emulation failure. For the
latter, KVM performs a triple fault (guest reboot).) By forcing the 0x67
prefixes we end up with the same machine code as the one open-coded in
"MpFuncs.asm".

This bug breaks S3 resume in the Ia32X64 + SMM_REQUIRE build of OVMF.

Cc: Liming Gao <liming....@intel.com>
Cc: Jordan Justen <jordan.l.jus...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm 
b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm
index 3efc4c3642b9..702233d6e49d 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm
@@ -83,7 +83,7 @@ o32     lidt       [cs:si]
 
 FLAT32_JUMP:
 
-        jmp   dword 0x20:0x0
+a32     jmp   dword 0x20:0x0
 
 BITS 32
 PMODE_ENTRY:                         ; protected mode entry point
@@ -114,7 +114,7 @@ o16     mov        ss,  ax                     ; Flat mode 
setup.
 
 LONG_JUMP:
 
-        jmp   dword 0x38:0x0
+a16     jmp   dword 0x38:0x0
 
 BITS 64
 LongModeStart:
-- 
1.8.3.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to