UefiCpuPkg/SecCore: Migrate page table to permanent memory

Background:
For arch X64, system will enable the page table in SPI to cover 0-512G
range via CR4.PAE & MSR.LME & CR0.PG & CR3 setting (see ResetVector code).
Existing code doesn't cover the higher address access above 512G before
memory-discovered callback. That will be potential problem if system
access the higher address after the transition from temporary RAM to
permanent MEM RAM.

Solution:
This patch is to migrate page table to permanent memory to map entire physical
address space if CR0.PG is set during temporary RAM Done.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Jiaxin Wu
2023-04-06 20:29:24 +08:00
committed by mergify[bot]
parent 0f9283429d
commit b4d3b77973
4 changed files with 153 additions and 0 deletions

View File

@@ -52,6 +52,7 @@
PeiServicesLib
PeiServicesTablePointerLib
HobLib
CpuPageTableLib
[Ppis]
## SOMETIMES_CONSUMES