From nobody Tue Nov 26 00:26:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61311+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61311+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1592257574; cv=none; d=zohomail.com; s=zohoarc; b=lXaEoGkaxxfFmNk9/u/r5QyhAS5QCJjZQhwcDnVfPWqNNjP1ne5QJ2DBPWX2hgcMAeGcR/NOMIog/fHf5Hz/Tnhow08/zJRogortdVoQZmUtLs3+yYpe1hp0E3iLrhG+9r8DaHPWt9TTbwUq5RqEUC/GSg8kF527WijZ4FMl5Ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592257574; h=Content-Type:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=Yj2B8gWVY8p+inAvb8Z0QCE3RgcCc/lYkRR4COTU4A0=; b=kXFEGcBBtR1dpcqmLpqA9uMwpaAVfkV2KmMqY9ghXhnhd+2puSn0cVzAFmVdek7218Xfx+r/WvcUjnWwQ32shHZ6WO+2cwsN/6AdHlWsl2muhwoFwRQOzj3ucqik6X7UE1LxEDdLdJxaIFmvxsRS/SfgCWn2eLzE6kkcUafNoYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61311+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1592257574051466.18731611972294; Mon, 15 Jun 2020 14:46:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fRP7YY1788612xkjXzsFbvVx; Mon, 15 Jun 2020 14:46:13 -0700 X-Received: from atlmailgw2.ami.com (atlmailgw2.ami.com [63.147.10.42]) by mx.groups.io with SMTP id smtpd.web11.175.1592257572634963925 for ; Mon, 15 Jun 2020 14:46:12 -0700 X-AuditID: ac10606f-4dbff70000003ed3-b2-5ee7ec2104ce X-Received: from atlms1.us.megatrends.com (atlms1.us.megatrends.com [172.16.96.144]) (using TLS with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by atlmailgw2.ami.com (Symantec Messaging Gateway) with SMTP id 72.2B.16083.12CE7EE5; Mon, 15 Jun 2020 17:46:09 -0400 (EDT) X-Received: from Oleksiy77.us.megatrends.com (172.16.97.158) by atlms1.us.megatrends.com (172.16.96.144) with Microsoft SMTP Server id 14.3.468.0; Mon, 15 Jun 2020 17:44:40 -0400 From: "Oleksiy Yakovlev" To: CC: , , , Subject: [edk2-devel] [PATCH] MdeModulePkg: Add New Memory Attributes Date: Mon, 15 Jun 2020 17:44:40 -0400 Message-ID: <20200615214440.49464-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOIsWRmVeSWpSXmKPExsWyRiBhgq7im+dxBp2n1C22blO3aJ8wm81i xb0N7A7MHtu/X2D0WLznJVMAU1QDo01iXl5+SWJJqkJKanGyrVJAUWZZYnKlkkJmiq2SoZJC QU5icmpual6JrVJiQUFqXoqSHZcCBrABKsvMU0jNS85PycxLt1XyDPbXtbAwtdQ1VLILyUhV yMxLyy/KTSzJzM9TSM7PKwGqTk0BiiokdHNmtGxbwlQwQ6Vi54N3TA2MR6S7GDk5JARMJFZc OcbWxcjFISSwi0ni1bLzzBDOFkaJMw+2M4FUsQloShw4NoURxBYRkJKYcmAmWJxZIFLi/tS5 7CC2sICFRPezB2wgNouAqsTTWf9ZQWxeAVOJBYffMEJs05CYtuYuE0RcUOLkzCcsEHMkJA6+ eMEMYgsJyEq0HX/OPoGRdxaSsllIyhYwMq1iFEosyclNzMxJLzfSS8zN1EvOz93ECImV/B2M Hz+aH2Jk4mA8xCjBwawkwntI/nmcEG9KYmVValF+fFFpTmrxIUYnoEMnMktxg0IKGPTxxgYG UqIwjqGJmYm5kbmhpYm5sbGSOO+ktWvihATSgVGYnZpakFoEM4SJg1OqgXFVzNIY09TiW35d MRVzg5s1DYx5NjsqNL+J9b8vutKkuKxD7Pja4+LLOed8PN+/WeCVk+iLY7nne5fnditK2Kxq 3n7z05/Ff2ao2HokL2X6xtp/ef9v80NMFb8DriW+1a4+9J8j6XbJ+W8pFgu0jLb8LA3d254V fpJHplOizD0oYs5DG+ewpUosxRmJhlrMRcWJAGKdyI+qAgAA Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,oleksiyy@ami.com X-Gm-Message-State: dF9USK52NpGoMSPf0x0mKBWQx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592257573; bh=WUnOWYjHfWg7LM9vfuKKNvL1wVy5FXQHzSzg66v4uBs=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jkYOeVqyJ508W5Y1rP3rxWDf8HHzPAL7DuSzzRs755SIEVyxYsFQwVqa7gYmvARcp3w 1wWCWq3fG/HF7jwuZe1yCIGhYcrCbPpgY93BjLYBDrGzFBTWxew7hEDpSKaYDn6KuN6Fm QeQRHLI3D3nUkryualFgQYh47cgrn9tupQ0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add usage of EFI_MEMORY_SP and EFI_MEMORY_CPU_CRYPTO attributes introduced in UEFI 2.8 (UEFI 2.8, mantis 1919 and 1872) Signed-off-by: Oleksiy Yakovlev --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 3 ++- MdeModulePkg/Core/Dxe/Mem/Page.c | 6 +++--- MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 2 +- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gc= d.c index 74f3b1b..d7a65ef 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -40,7 +40,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_MEMORY_WP | EFI_MEMORY_UCE) =20 #define NONEXCLUSIVE_MEMORY_ATTRIBUTES (EFI_MEMORY_XP | EFI_MEMORY_RP | \ - EFI_MEMORY_RO) + EFI_MEMORY_RO | EFI_MEMORY_SP | \ + EFI_MEMORY_CPU_CRYPTO) =20 // // Module Variables diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/P= age.c index 1f0e3d9..13876a6 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1858,7 +1858,7 @@ CoreGetMemoryMap ( MemoryMap->NumberOfPages =3D RShiftU64 ((MergeGcdMapEntry.EndAddress= - MergeGcdMapEntry.BaseAddress + 1), EFI_PAGE_SHIFT); MemoryMap->Attribute =3D (MergeGcdMapEntry.Attributes & ~EFI_MEM= ORY_PORT_IO) | (MergeGcdMapEntry.Capabilities & (EFI_MEMO= RY_RP | EFI_MEMORY_WP | EFI_MEMORY_XP | EFI_MEMORY_RO | - EFI_MEMORY_UC | EFI_MEMORY_UCE | EFI_MEMOR= Y_WC | EFI_MEMORY_WT | EFI_MEMORY_WB)); + EFI_MEMORY_UC | EFI_MEMORY_UCE | EFI_MEMOR= Y_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPT= O)); =20 if (MergeGcdMapEntry.GcdMemoryType =3D=3D EfiGcdMemoryTypeReserved) { MemoryMap->Type =3D EfiReservedMemoryType; @@ -1893,7 +1893,7 @@ CoreGetMemoryMap ( MemoryMap->NumberOfPages =3D RShiftU64 ((MergeGcdMapEntry.EndAddress= - MergeGcdMapEntry.BaseAddress + 1), EFI_PAGE_SHIFT); MemoryMap->Attribute =3D MergeGcdMapEntry.Attributes | EFI_MEMOR= Y_NV | (MergeGcdMapEntry.Capabilities & (EFI_MEMO= RY_RP | EFI_MEMORY_WP | EFI_MEMORY_XP | EFI_MEMORY_RO | - EFI_MEMORY_UC | EFI_MEMORY_UCE | EFI_MEMOR= Y_WC | EFI_MEMORY_WT | EFI_MEMORY_WB)); + EFI_MEMORY_UC | EFI_MEMORY_UCE | EFI_MEMOR= Y_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPT= O)); MemoryMap->Type =3D EfiPersistentMemory; =20 // @@ -1936,7 +1936,7 @@ CoreGetMemoryMap ( MemoryMap =3D MemoryMapStart; while (MemoryMap < MemoryMapEnd) { MemoryMap->Attribute &=3D ~(UINT64)(EFI_MEMORY_RP | EFI_MEMORY_RO | - EFI_MEMORY_XP); + EFI_MEMORY_XP | EFI_MEMORY_SP | EFI_= MEMORY_CPU_CRYPTO); MemoryMap =3D NEXT_MEMORY_DESCRIPTOR (MemoryMap, Size); } MergeMemoryMap (MemoryMapStart, &BufferSize, Size); diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/C= ore/Dxe/Misc/MemoryProtection.c index 92a442f..51bc999 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -43,7 +43,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "Mem/HeapGuard.h" =20 #define CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY= _WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP) -#define MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY= _RO) +#define MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY= _RO | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO) =20 // // Image type definitions diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiS= mmCore/PiSmmIpl.c index 0385f1d..59a7c03 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -43,7 +43,7 @@ EFI_MEMORY_WT | EFI_MEMORY_WB | \ EFI_MEMORY_WP | EFI_MEMORY_UCE) =20 -#define MEMORY_PAGE_ATTRIBUTES (EFI_MEMORY_XP | EFI_MEMORY_RP | EFI_MEMOR= Y_RO) +#define MEMORY_PAGE_ATTRIBUTES (EFI_MEMORY_XP | EFI_MEMORY_RP | EFI_MEMOR= Y_RO | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO) =20 // // Function prototypes from produced protocols --=20 2.9.0.windows.1 Please consider the environment before printing this email. The information contained in this message may be confidential and proprieta= ry to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephon= e at 770-246-8600, and then delete or destroy all copies of the transmissio= n. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61311): https://edk2.groups.io/g/devel/message/61311 Mute This Topic: https://groups.io/mt/74904923/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-