32696fd8dd
- edk2-ArmVirt-add-VirtioSerialDxe-to-ArmVirtQemu-builds.patch [RHEL-643] - edk2-ArmVirt-PlatformBootManagerLib-factor-out-IsVirtio.patch [RHEL-643] - edk2-ArmVirt-PlatformBootManagerLib-factor-out-IsVirtioPc.patch [RHEL-643] - edk2-ArmVirt-PlatformBootManagerLib-set-up-virtio-serial-.patch [RHEL-643] - edk2-OvmfPkg-VirtioSerialDxe-use-TPL_NOTIFY.patch [RHEL-643] - edk2-OvmfPkg-VirtioSerialDxe-Remove-noisy-debug-print-on-.patch [RHEL-643] - edk2-OvmfPkg-PlatformInitLib-limit-phys-bits-to-46.patch [bz#2174749] - edk2-Revert-OvmfPkg-disable-dynamic-mmio-window-rhel-only.patch [bz#2174749] - edk2-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch [bz#2124143] - edk2-OvmfPkg-PlatformInitLib-check-PcdUse1GPageTable.patch [RHEL-644] - edk2-OvmfPkg-OvmfPkgIa32X64-enable-1G-pages.patch [RHEL-644] - edk2-OvmfPkg-MicrovmX64-enable-1G-pages.patch [RHEL-644] - Resolves: RHEL-643 (add virtio serial support to armvirt) - Resolves: bz#2174749 ([edk2] re-enable dynamic mmio window) - Resolves: bz#2124143 (ovmf must consider max cpu count not boot cpu count for apic mode [rhel-9]) - Resolves: RHEL-644 (enable gigabyte pages)
58 lines
2.1 KiB
Diff
58 lines
2.1 KiB
Diff
From f24768ae482651073db9050fdaad49afe930b127 Mon Sep 17 00:00:00 2001
|
|
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Date: Wed, 17 May 2023 12:24:47 +0200
|
|
Subject: [PATCH 10/12] OvmfPkg/PlatformInitLib: check PcdUse1GPageTable
|
|
|
|
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
|
RH-MergeRequest: 40: enable use of gigabyte pages
|
|
RH-Jira: RHEL-644
|
|
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
RH-Commit: [1/3] 5d8b87d3b6a6b8af4d1a4aabedd8f69c512bf01c (kraxel/centos-edk2)
|
|
|
|
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>
|
|
(cherry picked from commit d4d24001f78bcee965d8854fba6f08f48b4ec446)
|
|
---
|
|
OvmfPkg/Library/PlatformInitLib/MemDetect.c | 5 +++++
|
|
OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 +
|
|
2 files changed, 6 insertions(+)
|
|
|
|
diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
|
|
index 0482d8906d..662e7e85bb 100644
|
|
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
|
|
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
|
|
@@ -666,6 +666,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);
|
|
}
|
|
diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
|
|
index 86a82ad3e0..5a79d95b68 100644
|
|
--- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
|
|
+++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
|
|
@@ -58,6 +58,7 @@
|
|
|
|
[Pcd]
|
|
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
|
+ gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
|
|
|
|
[FixedPcd]
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
|
|
--
|
|
2.39.3
|
|
|