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 1FE73740034 for ; Sat, 18 May 2024 00:58:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1DxmdP233whpOX5aOJtiTlTeEA6aOeXDrQPhdnZm2kY=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:From:To:Cc:Subject:Date:Message-ID: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=1715993900; v=1; b=PoXqgIU1XOUhdumEXe+uniorWZ0iXn6yyorMJzjphiQioRfuo/KhtlShyMCoIkQgyqwIdxSx pJD1gUa9r0+iQxt2oftHlqTe1uwTB73Ba93Tw4wsaC+Jd51QQGTBollEmC/6/38q2EEbjBbBIo2 snAe1sv+c6o4uDiPQAGhunfO0J0R+PcSqAJobcCrsR+wt0CCz9R+ypjWz/g8+HWLozBDAuqAl/m OCwi2Qq5HwaPV/K/KT9SeL3s6Y5MLPk6C+IMPXpxj9PMizaJit58+j0bMzEAwKELEC/nJMUhG3z fXWSYCGXKBSCki1Y5eQb+OijRuiIBEf0Vgbc8hp9V5IaQ== X-Received: by 127.0.0.2 with SMTP id hnFiYY7687511xP1pRuSIKyu; Fri, 17 May 2024 17:58:20 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.10706.1715993898295889087 for ; Fri, 17 May 2024 17:58:18 -0700 X-Received: from localhost.localdomain (unknown [47.201.241.198]) by linux.microsoft.com (Postfix) with ESMTPSA id 012D920446C7; Fri, 17 May 2024 17:58:16 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 012D920446C7 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Liming Gao , Michael D Kinney Subject: [edk2-devel] [PATCH v3 1/1] MdeModulePkg: Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE attribute Date: Fri, 17 May 2024 20:57:57 -0400 Message-ID: <20240518005757.1639-1-mikuback@linux.microsoft.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: Fri, 17 May 2024 17:58:18 -0700 Resent-From: mikuback@linux.microsoft.com Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: cfLEj9WWqShqsGNL2HOG90Fdx7686176AA= 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=PoXqgIU1; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=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 From: Patrick Payne Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE resource attribute as per the PI 1.8 spec. This flag is used to indicate that the memory should be treated as special purpose memory (SPM). Cc: Liming Gao Cc: Michael D Kinney Signed-off-by: Michael Kubacki --- Notes: V3: Assign the GCD memory type for resource HOBs with the SPECIAL_PURPOSE attribute set prior to assigning the GCD memory type for the PERSISTENT attribute. =20 Assign the GCD memory type EfiGcdMemoryTypeReserved instead of EfiGcdMemoryTypeSystemMemory for resource HOBs with the SPECIAL_PURPOSE attribute set. =20 V2: Adds package name to commit subject and updates Signed-off-by. MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/= Gcd.c index fe1bbd6974b7..4cc0940c0a7d 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -26,7 +26,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_RESOURCE_ATTRIBUTE_16_BIT_IO = | \ EFI_RESOURCE_ATTRIBUTE_32_BIT_IO = | \ EFI_RESOURCE_ATTRIBUTE_64_BIT_IO = | \ - EFI_RESOURCE_ATTRIBUTE_PERSISTENT= ) + EFI_RESOURCE_ATTRIBUTE_PERSISTENT= | \ + EFI_RESOURCE_ATTRIBUTE_SPECIAL_PU= RPOSE ) =20 #define TESTED_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT | = \ EFI_RESOURCE_ATTRIBUTE_INITIALIZE= D | \ @@ -92,6 +93,7 @@ GCD_ATTRIBUTE_CONVERSION_ENTRY mAttributeConversionTab= le[] =3D { { EFI_RESOURCE_ATTRIBUTE_TESTED, EFI_MEMORY_TESTED, = FALSE }, { EFI_RESOURCE_ATTRIBUTE_PERSISTABLE, EFI_MEMORY_NV, = TRUE }, { EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE, EFI_MEMORY_MORE_RELI= ABLE, TRUE }, + { EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE, EFI_MEMORY_SP, = TRUE }, { 0, 0, = FALSE } }; =20 @@ -691,6 +693,10 @@ ConverToCpuArchAttributes ( CpuArchAttributes |=3D EFI_MEMORY_WP; } =20 + if ((Attributes & EFI_MEMORY_SP) =3D=3D EFI_MEMORY_SP) { + CpuArchAttributes |=3D EFI_MEMORY_SP; + } + return CpuArchAttributes; } =20 @@ -2656,6 +2662,10 @@ CoreInitializeGcdServices ( GcdMemoryType =3D EfiGcdMemoryTypeReserved; } =20 + if ((ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_S= PECIAL_PURPOSE) =3D=3D EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE) { + GcdMemoryType =3D EfiGcdMemoryTypeReserved; + } + if ((ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_P= ERSISTENT) =3D=3D EFI_RESOURCE_ATTRIBUTE_PERSISTENT) { GcdMemoryType =3D EfiGcdMemoryTypePersistent; } --=20 2.45.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119065): https://edk2.groups.io/g/devel/message/119065 Mute This Topic: https://groups.io/mt/106165072/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-