UefiCpuPkg/ResetVector: Support 1G page tables beyond 512GB
The 1G page table built into the Vtf0 reset vector only identity maps
the first 512GB: one PDPT referenced by PML4E 0. This is not enough for
platforms with memory or MMIO above 512GB.
Add the PAGE_TABLE_SIZE_X_512GB build option, used together with
PAGE_TABLE_1G, to select the number of 512GB regions to identity map.
Each region needs one PDPT, which holds 512 1GB entries, and one PML4E,
so the value ranges from 1 to 512 (up to 256TB). It defaults to 1, so
existing builds produce the same page tables.
For N regions, emit N PDPTs (Pdp0 to Pdp(N-1)), where each PdpK maps
512GB with 1GB pages, and point PML4E K to PdpK. Each region adds one
4KB page to the reset vector image.
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2 files changed