mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
OvmfPkg/PlatformInitLib: check PcdUse1GPageTable
If PcdUse1GPageTable is not enabled restrict the physical address space used to 1TB, to limit the amount of memory needed for identity mapping page tables. The same already happens in case the processor has no support for gigabyte pages. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
27727338b2
commit
d4d24001f7
2 changed files with 6 additions and 0 deletions
|
|
@ -663,6 +663,11 @@ PlatformAddressWidthFromCpuid (
|
|||
PhysBits = 40;
|
||||
}
|
||||
|
||||
if (!FixedPcdGetBool (PcdUse1GPageTable) && (PhysBits > 40)) {
|
||||
DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 40 (PcdUse1GPageTable is false)\n", __func__));
|
||||
PhysBits = 40;
|
||||
}
|
||||
|
||||
PlatformInfoHob->PhysMemAddressWidth = PhysBits;
|
||||
PlatformInfoHob->FirstNonAddress = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
|
||||
|
||||
[FixedPcd]
|
||||
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue