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 7E0C2AC1718 for ; Thu, 16 May 2024 20:20:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dxyw02kO6nPBTm6lr7BX1sqvw2vQhYOeFS/jqgw3eV4=; 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=1715890819; v=1; b=gqu6is6twadXimDl1XlnbVn9rD4cBlqsQ1B5u9wvg9HFA3TqBYRBQspMXpqi+hwbtyatW6WK OoVFBEEopunI6fb0clzMgPq5uHEqBMk3Ksm166vXbI9uv2s2DcBQGykba/rtRA3sJ0mEh69bL9Y ko2izE5aKsae+LkSgCml1nnspsHI8I/GvkTOg3IuD+7JLDnTQDLz+X7Z/A5RYjDbs5AafCfSG2v Zi2/UytxPMykgwFNCN5YnAkiTvB6vXUHEzjUc+NdXZzkbM2kh7cqBrR/svWUeyPRo4eVALCbNpu 8RyDVPwka63SuXZjczQ70HM9U/o7x58yexQquhEz9358w== X-Received: by 127.0.0.2 with SMTP id yfJfYY7687511xY6darGdbnQ; Thu, 16 May 2024 13:20:19 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.24546.1715890819112814068 for ; Thu, 16 May 2024 13:20:19 -0700 X-Received: from localhost.localdomain (unknown [47.201.241.198]) by linux.microsoft.com (Postfix) with ESMTPSA id 3A2FD2037CD8; Thu, 16 May 2024 13:20:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3A2FD2037CD8 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Liming Gao , Michael D Kinney Subject: [edk2-devel] [PATCH v1 1/1] Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE attribute. Date: Thu, 16 May 2024 16:19:52 -0400 Message-ID: <20240516201952.1625-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: Thu, 16 May 2024 13:20:19 -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: UDRUfnoybJM7qZsga3Egu5jRx7686176AA= 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=gqu6is6t; 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). Also adds GCD code that marks the SPM with the EFI_MEMORY_SP bit and sets the GCD memory type to EfiGcdMemoryTypeSystemMemory. Cc: Liming Gao Cc: Michael D Kinney Signed-off-by: Patrick Payne --- 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..c941fe941276 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 @@ -2660,6 +2666,10 @@ CoreInitializeGcdServices ( GcdMemoryType =3D EfiGcdMemoryTypePersistent; } =20 + if ((ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_S= PECIAL_PURPOSE) =3D=3D EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE) { + GcdMemoryType =3D EfiGcdMemoryTypeSystemMemory; + } + break; case EFI_RESOURCE_MEMORY_MAPPED_IO: case EFI_RESOURCE_FIRMWARE_DEVICE: --=20 2.45.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118972): https://edk2.groups.io/g/devel/message/118972 Mute This Topic: https://groups.io/mt/106142180/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-