mirror of https://github.com/acidanthera/audk.git
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
|
@ -663,6 +663,11 @@ PlatformAddressWidthFromCpuid (
|
||||||
PhysBits = 40;
|
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->PhysMemAddressWidth = PhysBits;
|
||||||
PlatformInfoHob->FirstNonAddress = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth);
|
PlatformInfoHob->FirstNonAddress = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
|
||||||
|
|
||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
|
||||||
|
|
Loading…
Reference in New Issue