diff mbox

[edk2,FIXUP,2/2] UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm: add 0x67 prefixes to far jumps

Message ID 1466465780-21614-3-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek June 20, 2016, 11:36 p.m. UTC
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.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.3.1

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

Patch

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: