* [PATCH] UefiCpuPkg: Solve that stack top address is not mapped in pagetable
@ 2023-03-21 7:29 Yuanhao Xie
2023-03-23 3:26 ` Ni, Ray
0 siblings, 1 reply; 2+ messages in thread
From: Yuanhao Xie @ 2023-03-21 7:29 UTC (permalink / raw)
To: devel; +Cc: Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Ted Kuo
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>
---
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 1 +
1 file changed, 1 insertion(+)
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
--
2.39.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] UefiCpuPkg: Solve that stack top address is not mapped in pagetable
2023-03-21 7:29 [PATCH] UefiCpuPkg: Solve that stack top address is not mapped in pagetable Yuanhao Xie
@ 2023-03-23 3:26 ` Ni, Ray
0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ray @ 2023-03-23 3:26 UTC (permalink / raw)
To: Xie, Yuanhao, devel@edk2.groups.io
Cc: Dong, Guo, Rhodes, Sean, Lu, James, Guo, Gua, Kuo, Ted
Reviewed-by: Ray Ni <ray.ni@intel.com>
> -----Original Message-----
> From: Xie, Yuanhao <yuanhao.xie@intel.com>
> Sent: Tuesday, March 21, 2023 3:30 PM
> To: devel@edk2.groups.io
> Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes,
> Sean <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua
> <gua.guo@intel.com>; Kuo, Ted <ted.kuo@intel.com>
> Subject: [PATCH] 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>
> ---
> UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 1 +
> 1 file changed, 1 insertion(+)
>
> 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
> --
> 2.39.1.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-23 3:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21 7:29 [PATCH] UefiCpuPkg: Solve that stack top address is not mapped in pagetable Yuanhao Xie
2023-03-23 3:26 ` Ni, Ray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox