audk/UefiPayloadPkg/UefiPayloadEntry
Liu, Zhiguang e8034b534a UefiPayloadPkg: Always split page table entry to 4K if it covers stack.
We observed page fault in the following situation:
1.PayloadEntry uses 2M entry in page table to cover DXE stack range.
2.In DXE phase, image protection code needs to mark some sub-range in
this 2M entry as readonly. So the the 2M page table entry is split to
512 4K entries, and some of the entries are marked as readonly.
(the entries covering stack still remain R/W)
3.Page fault exception happens when trying to access stack.

Always split the page table entry to 4K if it covers stack to avoid this
issue.
More discussion about this issue can be seen at below link
https://edk2.groups.io/g/devel/topic/91446026

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2022-06-20 04:53:17 +00:00
..
Ia32 UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X64 UefiPayloadPkg: Always split page table entry to 4K if it covers stack. 2022-06-20 04:53:17 +00:00
AcpiTable.c UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LoadDxeCore.c UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MemoryAllocation.c UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PrintHob.c UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UefiPayloadEntry.c UefiPayloadPkg: Add build option for Above 4G Memory 2022-03-04 22:17:49 +00:00
UefiPayloadEntry.h UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib. 2022-05-06 07:48:15 +00:00
UefiPayloadEntry.inf UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib. 2022-05-06 07:48:15 +00:00
UniversalPayloadEntry.c UefiPayloadPkg: Skip ModuleInfo HOB in Payload 2021-12-08 04:08:21 +00:00
UniversalPayloadEntry.inf UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib. 2022-05-06 07:48:15 +00:00