summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorDhaval <dhaval@rivosinc.com>2024-06-18 21:19:05 +0530
committerLiming Gao <gaoliming@byosoft.com.cn>2024-06-19 13:12:40 +0800
commit4d4f56992460c039d0cfe48c394c2e07aecf1d22 (patch)
treed9eb7acac00b397c03ab82ca740f2b0f0b61a9c3 /MdeModulePkg
parent26a30abdd0f7fe5a9d2421cba6efe9397185ad98 (diff)
downloadedk2-4d4f56992460c039d0cfe48c394c2e07aecf1d22.tar.gz
edk2-4d4f56992460c039d0cfe48c394c2e07aecf1d22.tar.bz2
edk2-4d4f56992460c039d0cfe48c394c2e07aecf1d22.zip
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Page.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c
index 5a51d9df1a..e4daa741b9 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;