summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe/Mem/Page.c
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@linux.microsoft.com>2024-03-09 11:06:03 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-03-14 16:29:22 +0000
commit68461c2c37afe11c7dda2769efc10bf20d2a7b23 (patch)
tree7258e96ccd1081c2275e3c2fbae7737718351624 /MdeModulePkg/Core/Dxe/Mem/Page.c
parentbf8f16f771d48c7cb4c0dfa548d296972513efe2 (diff)
downloadedk2-68461c2c37afe11c7dda2769efc10bf20d2a7b23.tar.gz
edk2-68461c2c37afe11c7dda2769efc10bf20d2a7b23.tar.bz2
edk2-68461c2c37afe11c7dda2769efc10bf20d2a7b23.zip
MdeModulePkg: DxeCore: Correct Runtime Granularity Memory Type
Per the UEFI spec 2.10, section 2.3.6 (for the AARCH64 arch, other architectures in section two confirm the same) the memory types that need runtime page allocation granularity are EfiReservedMemoryType, EfiACPIMemoryNVS, EfiRuntimeServicesCode, and EfiRuntimeServicesData. However, legacy code was setting runtime page allocation granularity for EfiACPIReclaimMemory and not EfiReservedMemoryType. This patch fixes that error. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com> Suggested-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Mem/Page.c')
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Page.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c
index dd558696ba..cd201d36a3 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Page.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
@@ -1403,7 +1403,7 @@ CoreInternalAllocatePages (
Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
- if ((MemoryType == EfiACPIReclaimMemory) ||
+ if ((MemoryType == EfiReservedMemoryType) ||
(MemoryType == EfiACPIMemoryNVS) ||
(MemoryType == EfiRuntimeServicesCode) ||
(MemoryType == EfiRuntimeServicesData))
@@ -1666,7 +1666,7 @@ CoreInternalFreePages (
Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
- if ((Entry->Type == EfiACPIReclaimMemory) ||
+ if ((Entry->Type == EfiReservedMemoryType) ||
(Entry->Type == EfiACPIMemoryNVS) ||
(Entry->Type == EfiRuntimeServicesCode) ||
(Entry->Type == EfiRuntimeServicesData))