UefiCpuPkg/CpuDxe: Fix boot error

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>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: James Bottomley <jejb@linux.ibm.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Guo Dong 2021-01-07 11:10:45 +08:00 committed by mergify[bot]
parent edd74ad3ad
commit ebfe2d3eb5

View File

@ -20,13 +20,11 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
global ASM_PFX(SetCodeSelector) global ASM_PFX(SetCodeSelector)
ASM_PFX(SetCodeSelector): ASM_PFX(SetCodeSelector):
sub rsp, 0x10 push rcx
lea rax, [setCodeSelectorLongJump] lea rax, [setCodeSelectorLongJump]
mov [rsp], rax push rax
mov [rsp+4], cx o64 retf
jmp dword far [rsp]
setCodeSelectorLongJump: setCodeSelectorLongJump:
add rsp, 0x10
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------