public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH V2] UefiCpuPkg/CpuDxe: Fix boot error
@ 2021-01-07  3:10 Guo Dong
  2021-01-07 11:56 ` Laszlo Ersek
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Guo Dong @ 2021-01-07  3:10 UTC (permalink / raw)
  To: devel; +Cc: eric.dong, ray.ni, lersek, rahul1.kumar

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3084

When DXE drivers are dispatched above 4GB memory in 64bit
mode, the address setCodeSelectorLongJump in stack will
be override by parameter. Jump to Qword is not supported
by some processors. So use "o64 retf" instead.

Signed-off-by: Guo Dong <guo.dong@intel.com>
---
 UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm b/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm
index c3489bcc3e..a8216cd56f 100644
--- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm
+++ b/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm
@@ -20,13 +20,11 @@
 ;------------------------------------------------------------------------------
 global ASM_PFX(SetCodeSelector)
 ASM_PFX(SetCodeSelector):
-    sub     rsp, 0x10
+    push    rcx,
     lea     rax, [setCodeSelectorLongJump]
-    mov     [rsp], rax
-    mov     [rsp+4], cx
-    jmp     dword far [rsp]
+    push    rax
+    o64 retf
 setCodeSelectorLongJump:
-    add     rsp, 0x10
     ret
 
 ;------------------------------------------------------------------------------
-- 
2.16.2.windows.1


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

end of thread, other threads:[~2021-01-09  2:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07  3:10 [edk2-devel] [PATCH V2] UefiCpuPkg/CpuDxe: Fix boot error Guo Dong
2021-01-07 11:56 ` Laszlo Ersek
2021-01-07 22:25   ` James Bottomley
2021-01-09  2:30     ` Ni, Ray
2021-01-07 15:01 ` Lendacky, Thomas
2021-01-07 16:14   ` Guo Dong
2021-01-07 17:32     ` Laszlo Ersek
2021-01-07 18:22 ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox