]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: Fix a hang in above 4GB case
authorGuo Dong <guo.dong@intel.com>
Wed, 6 Jan 2021 23:53:23 +0000 (07:53 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 12 Jan 2021 06:35:30 +0000 (06:35 +0000)
This patch fixed the hang in UEFICpuPkg when it is dispatched above 4GB.
In UEFI BIOS case CpuInfoInHob is provided to DXE under 4GB from PEI.
When using UEFI payload and bootloaders, CpuInfoInHob will be allocated
above 4GB since it is not provided from bootloader. so we need update
the code to make sure this hob could be accessed correctly in this case.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm

index 5532a1d391bc78f0931bac3d8971a4287e35d8a7..aecfd07bc077160a47e7e18a3346769b2fb8b6d1 100644 (file)
@@ -303,17 +303,17 @@ GetProcessorNumber:
     ;\r
     xor         ebx, ebx\r
     lea         eax, [esi + CpuInfoLocation]\r
-    mov         edi, [eax]\r
+    mov         rdi, [eax]\r
 \r
 GetNextProcNumber:\r
-    cmp         dword [edi], edx                      ; APIC ID match?\r
+    cmp         dword [rdi], edx                      ; APIC ID match?\r
     jz          ProgramStack\r
-    add         edi, 20\r
+    add         rdi, 20\r
     inc         ebx\r
     jmp         GetNextProcNumber\r
 \r
 ProgramStack:\r
-    mov         rsp, qword [edi + 12]\r
+    mov         rsp, qword [rdi + 12]\r
 \r
 CProcedureInvoke:\r
     push       rbp               ; Push BIST data at top of AP stack\r