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 <gaoliming@byosoft.com.cn>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Oliver Smith-Denny <osde@linux.microsoft.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Co-authored-by: Tim Wawrzynczak <tim@rivosinc.com>
This commit is contained in:
Dhaval 2024-06-18 21:19:05 +05:30 committed by Liming Gao
parent 26a30abdd0
commit 4d4f569924

View File

@ -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;