From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5A917AC0ADD for ; Tue, 11 Jun 2024 04:09:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=rCu8RMNAZbe14E4wMnZLOq6cU8m2lW1lj4I8gHbqef8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1718078961; v=1; b=JNdZU/llV8EWZPtP7HIb0k9S214C4OH4DBSo6SMHOC8mXxuu3HDFOLE4RSSffW9bdajQaX7M oGi5RM2oR7hTJJw/qLTw99Ep6I3VD8b5h4esyCltMJzwFktTbM52ni/gLHfuNSmaR5RD5Jgrd9K JysFylsKv5WmrpfxyKr5AL/tfhZ6JGPsraSKUApIBcbBhtM47bze/Y9uO3fVtrAG11LsGICKLq7 RU/tms9tF7p9wspgi6mEtyOT159JE9Kum9bzVcojvONQbJNvPh2CtfUT5kWYGTTMKKQmRp+b4BJ th19NljIUsghge7hyyFe0BAoXsKU6sbxVNRh8Wleq+uHg== X-Received: by 127.0.0.2 with SMTP id Mv7xYY7687511xgW0of4LNei; Mon, 10 Jun 2024 21:09:19 -0700 X-Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web11.1769.1718078959302465384 for ; Mon, 10 Jun 2024 21:09:19 -0700 X-Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1f4c7b022f8so47555825ad.1 for ; Mon, 10 Jun 2024 21:09:19 -0700 (PDT) X-Gm-Message-State: GIP8yZMmfTQNXqcNn5AkqvYUx7686176AA= X-Google-Smtp-Source: AGHT+IEDmDe+rWJkewCQoil+qxgUZw+mPqpSYMkBj0haMUg0t41nCmxhGNTQQgWLJ63ui6cSkpLS2A== X-Received: by 2002:a17:902:c951:b0:1f6:7cc9:fb31 with SMTP id d9443c01a7336-1f6d02c054dmr146685665ad.5.1718078957829; Mon, 10 Jun 2024 21:09:17 -0700 (PDT) X-Received: from dhaval.blr.rivosinc.com ([49.249.129.34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f70ee8bc9csm32789645ad.250.2024.06.10.21.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 21:09:17 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Liming Gao Subject: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Avoid efi memory allocation for SP type Date: Tue, 11 Jun 2024 09:39:10 +0530 Message-Id: <20240611040910.93238-2-dhaval@rivosinc.com> In-Reply-To: <20240611040910.93238-1-dhaval@rivosinc.com> References: <20240611040910.93238-1-dhaval@rivosinc.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 10 Jun 2024 21:09:19 -0700 Resent-From: dhaval@rivosinc.com Reply-To: devel@edk2.groups.io,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="JNdZU/ll"; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io 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 Signed-off-by: Dhaval Sharma --- 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/P= age.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;=0D }=0D =0D + //=0D + // Don't allocate out of Special-Purpose memory.=0D + //=0D + if ((Entry->Attribute & EFI_MEMORY_SP) !=3D 0) {=0D + continue;=0D + }=0D +=0D DescStart =3D Entry->Start;=0D DescEnd =3D Entry->End;=0D =0D --=20 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] -=-=-=-=-=-=-=-=-=-=-=-