]> xenbits.xensource.com Git - ovmf.git/commitdiff
UefiCpuPkg: Solve that stack top address is not mapped in pagetable
authorXie, Yuanhao <yuanhao.xie@intel.com>
Tue, 21 Mar 2023 07:29:59 +0000 (15:29 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 27 Mar 2023 05:08:15 +0000 (05:08 +0000)
For the case CPU logic index is 0, RSP points to the very top of all AP
stacks. That address is not mapped in page table.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm

index 9ebe31795b00c85dbe2b119eb381b6c90e15433b..5bcdf7726ba6080bdb91f4b3dafb6bb485792bbe 100644 (file)
@@ -315,6 +315,7 @@ MwaitCheckGeneric:
 MwaitLoopGeneric:\r
     cli\r
     mov        rax, rsp           ; Set Monitor Address\r
+    sub        eax, 8             ; To ensure the monitor address is in the page table\r
     xor        ecx, ecx           ; ecx = 0\r
     xor        edx, edx           ; edx = 0\r
     monitor\r