From: "Dhaval Sharma" <dhaval@rivosinc.com>
To: devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Subject: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Avoid efi memory allocation for SP type
Date: Tue, 11 Jun 2024 09:39:10 +0530 [thread overview]
Message-ID: <20240611040910.93238-2-dhaval@rivosinc.com> (raw)
In-Reply-To: <20240611040910.93238-1-dhaval@rivosinc.com>
Most of the times it is desirable not to use special purpose
memory for regular edk2 usages. That memory (HBm/CXL) are
either meant for special purposes or are less reliable to
be used. So avoid using them as long as possible. We could
also introduce PCD for this control.
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
---
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 5a51d9df1a29..e4daa741b971 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;
--
2.40.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119545): https://edk2.groups.io/g/devel/message/119545
Mute This Topic: https://groups.io/mt/106607739/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-06-11 4:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 4:09 [edk2-devel] [PATCH v1 0/1] Avoid EFI memory alloc from SP_MEMORY Dhaval Sharma
2024-06-11 4:09 ` Dhaval Sharma [this message]
2024-06-15 3:04 ` 回复: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Avoid efi memory allocation for SP type gaoliming via groups.io
2024-06-15 4:54 ` Michael D Kinney
2024-06-18 10:55 ` Dhaval Sharma
2024-06-11 17:08 ` [edk2-devel] [PATCH v1 0/1] Avoid EFI memory alloc from SP_MEMORY Oliver Smith-Denny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240611040910.93238-2-dhaval@rivosinc.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox