From 4d4f56992460c039d0cfe48c394c2e07aecf1d22 Mon Sep 17 00:00:00 2001 From: Dhaval Date: Tue, 18 Jun 2024 21:19:05 +0530 Subject: MdeModulePkg: Avoid efi memory allocation for SP memory HBM/CXL memory systems are treated as special purpose memories. In many cases it is desirable not to use special purpose memory for regular edk2 usages as these memories (HBm/CXL) are either meant for special purposes or are less reliable to be used. Until such memory systems evolve and we have better clarity from UEFI spec, avoid using them for edk2 boot memory purposes. Cc: Liming Gao Cc: Michael Kinney Cc: Oliver Smith-Denny Signed-off-by: Dhaval Sharma Co-authored-by: Tim Wawrzynczak --- MdeModulePkg/Core/Dxe/Mem/Page.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 5a51d9d..e4daa74 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1183,6 +1183,13 @@ CoreFindFreePagesI ( continue; } + // + // Don't allocate out of Special-Purpose memory. + // + if ((Entry->Attribute & EFI_MEMORY_SP) != 0) { + continue; + } + DescStart = Entry->Start; DescEnd = Entry->End; -- cgit v1.1