summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXie, Yuanhao <yuanhao.xie@intel.com>2023-03-21 15:29:59 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-27 05:08:15 +0000
commitb1db09657546f4983a1ec18336b36212b5875c3f (patch)
tree524f0d2614579e0db9121f77b048af3cf673b3d1
parent1bfc89414dbc2b4e620e06231ae98d714914fc46 (diff)
downloadedk2-b1db09657546f4983a1ec18336b36212b5875c3f.tar.gz
edk2-b1db09657546f4983a1ec18336b36212b5875c3f.tar.bz2
edk2-b1db09657546f4983a1ec18336b36212b5875c3f.zip
UefiCpuPkg: Solve that stack top address is not mapped in pagetable
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>
-rw-r--r--UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm1
1 files changed, 1 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
index 9ebe31795b..5bcdf7726b 100644
--- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
+++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
@@ -315,6 +315,7 @@ MwaitCheckGeneric:
MwaitLoopGeneric:
cli
mov rax, rsp ; Set Monitor Address
+ sub eax, 8 ; To ensure the monitor address is in the page table
xor ecx, ecx ; ecx = 0
xor edx, edx ; edx = 0
monitor