From nobody Thu May 2 11:52:34 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+61993+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+61993+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1593723129; cv=none; d=zohomail.com; s=zohoarc; b=WzET5m/phtVd8AAji5GhEiXGvUzeQ8jZ3nMPg6PuV217YgqspaYptW3vQNlCaNnQJNsEAHGMSHIUe9iH0G20B2Vbn5z2a/pWDbOIMyzAASrc1woF0jWX6JKh63rcBWP5a16MQSs+aL8+Z3/+JNP0ySaBgZosZHOV3H0D/dTeUQE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593723129; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=aBnPlLEuD8s42GgbEEivcz9UjbqU5yxpRXgGRDEtNlM=; b=cLN6DmOXxjwaONBOWN5HWYhUK6iDfQDfhbe+vawm5qbHSq+6m0xnn4TEB0iIcNTDoB2TZgu39UtWsSVsZ0LMr8xSI8RoTCnPpNYTOUn6otgM/AlPUkDJcyXdG70+mj6s+8UNdcpYlq6UVNc6d1+eqN96UM5QSaTuoHUJBZi98Xc= 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+61993+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593723129384973.2878528683559; Thu, 2 Jul 2020 13:52:09 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id H8MEYY1788612xbGr36V7oQX; Thu, 02 Jul 2020 13:52:09 -0700 X-Received: from atlmailgw1.ami.com (atlmailgw1.ami.com [63.147.10.40]) by mx.groups.io with SMTP id smtpd.web10.6115.1593723127624974290 for ; Thu, 02 Jul 2020 13:52:07 -0700 X-AuditID: ac1060b2-ebbff70000003d78-25-5efe48f6b94e 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 atlmailgw1.ami.com (Symantec Messaging Gateway) with SMTP id ED.C2.15736.6F84EFE5; Thu, 2 Jul 2020 16:52:06 -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; Thu, 2 Jul 2020 16:50:43 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , , , , Subject: [edk2-devel] [PATCH V3 1/4] MdePkg: Add New Memory Attributes Date: Thu, 2 Jul 2020 16:50:36 -0400 Message-ID: <20200702205039.52400-2-oleksiyy@ami.com> In-Reply-To: <20200702205039.52400-1-oleksiyy@ami.com> References: <20200702205039.52400-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsWyRiBhgu43j39xBgsemVhs3aZu0T5hNpvF smM7WCxW3NvAbtHR8Y/JYvp2F4svq98zOrB7bP9+gdFj8Z6XTB7v911lC2COamC0SczLyy9J LElVSEktTrZVCijKLEtMrlRSyEyxVTJUUijISUxOzU3NK7FVSiwoSM1LUbLjUsAANkBlmXkK qXnJ+SmZeem2Sp7B/roWFqaWuoZKdiEZqQqZeWn5RbmJJZn5eQrJ+XklQNWpKUBRhYRuzoxZ K68yFyzgrZi1oZ+tgbGRu4uRk0NCwETiwc1nTF2MXBxCAruYJL4e/8ACkhAS2Mwosf5UEojN JqApceDYFEYQW0RASmLKgZlgDcwCexglel6fYgVJCAtYSizeOYkJxGYRUJG4+7sbrIFXwFRi ysop7BDbNCSmrbkLVsMpYCbRu6CVEWKZqcSh/QdZIeoFJU7OfAJ2BLOAhMTBFy+YIWpkJdqO P2efwMg/C0nZLCRlCxiZVjEKJZbk5CZm5qSXG+ol5mbqJefnbmKExOKmHYwtF80PMTJxMB5i lOBgVhLhTVD9FyfEm5JYWZValB9fVJqTWnyI0QnogYnMUtygEARGSbyxgYGUKIxjaGJmYm5k bmhpYm5srCTOO3ntmjghgXRg1GanphakFsEMYeLglGpgvNN+zafaK/FkXcyLP3uWWm2IOfLs LmdDp8WSDl6O4w1SjxvLrea6b5wRWLJOJ1lUbENfze+rrx8y6rb2FyW6XuGROStv9cpZeUbS E079vSkfLRIudgo9uhheJryrSKrw7Lc7MyRP+3sqqOy+EHNxTn+Wir3/AZtNa1ufL9i1jzWr +aZU3yIbJZbijERDLeai4kQAY29uUtoCAAA= 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: lc0rPKuxTtb3oNpgKA49MnPpx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593723129; bh=f/45gJfZ59xvNRrQdmf+JEgqG+RqSzjVhs+u4VAD/lY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=WzD3rx9Fx+xnMw9UXNK3ZFfWSkDss+kXb125aoKg9+zjyRmhPnlwJXoZyIpSgK6Sty4 glQHOQqkyaF6pWX8GTUFBMx3j4Q7MhXBMhLSaHpeGORN34dlaryXfLFIkjkgDGXPE9f97 5xUv5KyVCk/d8/3PwMhB63cNU4qvu4sonpw= 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) Fix typos in EFI_MEMORY_CPU_CRYPTO description. Add attributes bitmasks, grouped by type. Signed-off-by: Oleksiy Yakovlev Reviewed-by: Laszlo Ersek Reviewed-by: Liming Gao Tested-by: Laszlo Ersek --- MdePkg/Include/Uefi/UefiSpec.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h index 558e1bc..05b82e0 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -96,9 +96,9 @@ typedef enum { #define EFI_MEMORY_SP 0x0000000000040000ULL // // If this flag is set, the memory region is capable of being -// protected with the CPU?s memory cryptographic +// protected with the CPU's memory cryptographic // capabilities. If this flag is clear, the memory region is not -// capable of being protected with the CPU?s memory +// capable of being protected with the CPU's memory // cryptographic capabilities or the CPU does not support CPU // memory cryptographic capabilities. // @@ -109,6 +109,12 @@ typedef enum { // #define EFI_MEMORY_RUNTIME 0x8000000000000000ULL =20 +// +// Attributes bitmasks, grouped by type +// +#define EFI_CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMO= RY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP) +#define EFI_MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEM= ORY_RO | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO) + /// /// Memory descriptor version number. /// --=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 (#61993): https://edk2.groups.io/g/devel/message/61993 Mute This Topic: https://groups.io/mt/75267364/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- From nobody Thu May 2 11:52:34 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+61994+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+61994+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1593723129; cv=none; d=zohomail.com; s=zohoarc; b=B4jAf5/oMZQmBDrbPULE9H6jyhxG7quXNorlc03gDRinLXX7SMmMJup2QyTn+1Zlj5JX+qrxp1kFtO5ktG+upEd8EhW52WLVvWrTum9ZSAyLlbdpZIuBuu6v6rsKukppWUoIUaC8M3Kt71bI4o3KWm1NX/aN7FqtH2v6IYxvNt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593723129; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=/73wBOGbHERUMDEWA1hYmRfjU7lKcmdOqCzOcVTycmU=; b=kqgu236McXB92M6zySeu6JbL5zuBjeZ4yglDrFBd79b5zKKbLig69lyZGDA0tuDGcann2TET2xvxczQbcovV1uK1GH7YSdJhWEzbwuye7yD9hfFG/IcuybJufToSSDf2V7c6qfM1KUtvEHTj6u1xAsyvjg9f1vowIwpx/Md7DFU= 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+61994+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593723128880465.5221391771604; Thu, 2 Jul 2020 13:52:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id a0tnYY1788612xof3SnBH7Kc; Thu, 02 Jul 2020 13:52:08 -0700 X-Received: from atlmailgw2.ami.com (atlmailgw2.ami.com []) by mx.groups.io with SMTP id smtpd.web10.6114.1593723126518679449 for ; Thu, 02 Jul 2020 13:52:08 -0700 X-AuditID: ac10606f-4dbff70000003ed3-00-5efe48f487c4 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 7A.C1.16083.4F84EFE5; Thu, 2 Jul 2020 16:52:04 -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; Thu, 2 Jul 2020 16:50:44 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , , , , Subject: [edk2-devel] [PATCH V3 2/4] MdeModulePkg: Add New Memory Attributes Date: Thu, 2 Jul 2020 16:50:37 -0400 Message-ID: <20200702205039.52400-3-oleksiyy@ami.com> In-Reply-To: <20200702205039.52400-1-oleksiyy@ami.com> References: <20200702205039.52400-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBIsWRmVeSWpSXmKPExsWyRiBhgu4Xj39xBjOPKVls3aZu0T5hNpvF smM7WCxW3NvAbtHR8Y/JYvp2F4svq98zOrB7bP9+gdFj8Z6XTB7v911lC2COamC0SczLyy9J LElVSEktTrZVCijKLEtMrlRSyEyxVTJUUijISUxOzU3NK7FVSiwoSM1LUbLjUsAANkBlmXkK qXnJ+SmZeem2Sp7B/roWFqaWuoZKdiEZqQqZeWn5RbmJJZn5eQrJ+XklQNWpKUBRhYRuzoyZ J5+zFHy3rFg1dztjA+MTnS5GTg4JAROJeR2zGbsYuTiEBHYxSZw5uYsdwtnMKDHt/hpGkCo2 AU2JA8emgNkiAlISUw7MZAIpYhbYwyjR8/oUK0hCWMBeYuODj2A2i4CKxL9V25hBbF4BU4ln t1+yQazTkJi25i4TiM0pYCbRu6AVbKgQUM2h/QdZIeoFJU7OfMICYjMLSEgcfPGCGaJGVqLt +HP2CYz8s5CUzUJStoCRaRWjUGJJTm5iZk56uZFeYm6mXnJ+7iZGSDTm72D8+NH8ECMTB+Mh RgkOZiUR3gTVf3FCvCmJlVWpRfnxRaU5qcWHGJ2AHpjILMUNCkJgnMQbGxhIicI4hiZmJuZG 5oaWJubGxkrivJPWrokTEkgHxm12ampBahHMECYOTqkGxjVPmAVPLFcwM9f4bfX+lVv7tbvA GOddfPUrc/Oqgg3HinW7t2lqyPzbsuzzJyP3mRZHNpp9fBLOcW6zlaN31sS4zmnGgmVNRW3u WrXlm56/9YtvXs8Sa5F4LWAON5+Lxmz26gerH/8Rd2VO6bwjvtCDralw34oj+ySv/olVkHBZ YGae+kBJiaU4I9FQi7moOBEAPQCSRdsCAAA= 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: ozVUXryTDqXZXGva1XBbuq74x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593723128; bh=z2y/rjePp1c0rLRs5nctmZ7m8vkBuVU1ob6QLH8hP4I=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=F+JwSw85MS6eTDlWqSi/HWWKw/cgFydKkVX2HP0BW+QjLYEXyCVZYoCnBjb7CD8MM9F lYk33wwAwctv0Ecb+UBbxO5jeStBQU/OPhwO8cSNLLEJkiqMJ+S515sBNPWguz0TC28f7 yxyq7RDXg1k8VF6JEu+FT+gM3dtfYI/V0RY= 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) Use attributes bitmasks, defined in MdePkg. Signed-off-by: Oleksiy Yakovlev Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 11 ++--------- MdeModulePkg/Core/Dxe/Mem/Page.c | 9 +++------ MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 7 ++----- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 10 ++-------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gc= d.c index 74f3b1b..2d8c076 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -35,13 +35,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #define PRESENT_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT) =20 -#define EXCLUSIVE_MEMORY_ATTRIBUTES (EFI_MEMORY_UC | EFI_MEMORY_WC | \ - EFI_MEMORY_WT | EFI_MEMORY_WB | \ - EFI_MEMORY_WP | EFI_MEMORY_UCE) - -#define NONEXCLUSIVE_MEMORY_ATTRIBUTES (EFI_MEMORY_XP | EFI_MEMORY_RP | \ - EFI_MEMORY_RO) - // // Module Variables // @@ -665,7 +658,7 @@ ConverToCpuArchAttributes ( { UINT64 CpuArchAttributes; =20 - CpuArchAttributes =3D Attributes & NONEXCLUSIVE_MEMORY_ATTRIBUTES; + CpuArchAttributes =3D Attributes & EFI_MEMORY_ATTRIBUTE_MASK; =20 if ( (Attributes & EFI_MEMORY_UC) =3D=3D EFI_MEMORY_UC) { CpuArchAttributes |=3D EFI_MEMORY_UC; @@ -951,7 +944,7 @@ CoreConvertSpace ( // Keep original CPU arch attributes when caller just calls // SetMemorySpaceAttributes() with none CPU arch attributes (for e= xample, RUNTIME). // - Attributes |=3D (Entry->Attributes & (EXCLUSIVE_MEMORY_ATTRIBUTES = | NONEXCLUSIVE_MEMORY_ATTRIBUTES)); + Attributes |=3D (Entry->Attributes & (EFI_CACHE_ATTRIBUTE_MASK | E= FI_MEMORY_ATTRIBUTE_MASK)); } Entry->Attributes =3D Attributes; break; diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/P= age.c index 1f0e3d9..2c2c9cd 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1857,8 +1857,7 @@ CoreGetMemoryMap ( MemoryMap->VirtualStart =3D 0; 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)); + (MergeGcdMapEntry.Capabilities & (EFI_CACH= E_ATTRIBUTE_MASK | EFI_MEMORY_ATTRIBUTE_MASK)); =20 if (MergeGcdMapEntry.GcdMemoryType =3D=3D EfiGcdMemoryTypeReserved) { MemoryMap->Type =3D EfiReservedMemoryType; @@ -1892,8 +1891,7 @@ CoreGetMemoryMap ( MemoryMap->VirtualStart =3D 0; 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)); + (MergeGcdMapEntry.Capabilities & (EFI_CACH= E_ATTRIBUTE_MASK | EFI_MEMORY_ATTRIBUTE_MASK)); MemoryMap->Type =3D EfiPersistentMemory; =20 // @@ -1935,8 +1933,7 @@ CoreGetMemoryMap ( MemoryMapEnd =3D MemoryMap; MemoryMap =3D MemoryMapStart; while (MemoryMap < MemoryMapEnd) { - MemoryMap->Attribute &=3D ~(UINT64)(EFI_MEMORY_RP | EFI_MEMORY_RO | - EFI_MEMORY_XP); + MemoryMap->Attribute &=3D ~(UINT64)EFI_MEMORY_ATTRIBUTE_MASK; 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..7d1daf0 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -42,9 +42,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "DxeMain.h" #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) - // // Image type definitions // @@ -221,7 +218,7 @@ SetUefiImageMemoryAttributes ( Status =3D CoreGetMemorySpaceDescriptor(BaseAddress, &Descriptor); ASSERT_EFI_ERROR(Status); =20 - FinalAttributes =3D (Descriptor.Attributes & CACHE_ATTRIBUTE_MASK) | (At= tributes & MEMORY_ATTRIBUTE_MASK); + FinalAttributes =3D (Descriptor.Attributes & EFI_CACHE_ATTRIBUTE_MASK) |= (Attributes & EFI_MEMORY_ATTRIBUTE_MASK); =20 DEBUG ((DEBUG_INFO, "SetUefiImageMemoryAttributes - 0x%016lx - 0x%016lx = (0x%016lx)\n", BaseAddress, Length, FinalAttributes)); =20 @@ -924,7 +921,7 @@ InitializeDxeNxMemoryProtectionPolicy ( (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED)) { =20 Attributes =3D GetPermissionAttributeForMemoryType (EfiConventiona= lMemory) | - (Entry->Attributes & CACHE_ATTRIBUTE_MASK); + (Entry->Attributes & EFI_CACHE_ATTRIBUTE_MASK); =20 DEBUG ((DEBUG_INFO, "Untested GCD memory space region: - 0x%016lx - 0x%016lx (0x%016= lx)\n", diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiS= mmCore/PiSmmIpl.c index 0385f1d..599a0cd 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -39,12 +39,6 @@ =20 #define SMRAM_CAPABILITIES (EFI_MEMORY_WB | EFI_MEMORY_UC) =20 -#define MEMORY_CACHE_ATTRIBUTES (EFI_MEMORY_UC | EFI_MEMORY_WC | \ - EFI_MEMORY_WT | EFI_MEMORY_WB | \ - EFI_MEMORY_WP | EFI_MEMORY_UCE) - -#define MEMORY_PAGE_ATTRIBUTES (EFI_MEMORY_XP | EFI_MEMORY_RP | EFI_MEMOR= Y_RO) - // // Function prototypes from produced protocols // @@ -1710,7 +1704,7 @@ SmmIplEntry ( CpuArch =3D NULL; Status =3D gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID = **)&CpuArch); if (!EFI_ERROR (Status)) { - MemDesc.Attributes &=3D ~(MEMORY_CACHE_ATTRIBUTES | MEMORY_PAGE_ATTR= IBUTES); + MemDesc.Attributes &=3D ~(EFI_CACHE_ATTRIBUTE_MASK | EFI_MEMORY_ATTR= IBUTE_MASK); MemDesc.Attributes |=3D EFI_MEMORY_WB; Status =3D gDS->SetMemorySpaceAttributes ( mSmramCacheBase, @@ -1727,7 +1721,7 @@ SmmIplEntry ( &MemDesc ); DEBUG ((DEBUG_INFO, "SMRAM attributes: %016lx\n", MemDesc.Attribut= es)); - ASSERT ((MemDesc.Attributes & MEMORY_PAGE_ATTRIBUTES) =3D=3D 0); + ASSERT ((MemDesc.Attributes & EFI_MEMORY_ATTRIBUTE_MASK) =3D=3D 0); ); } // --=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 (#61994): https://edk2.groups.io/g/devel/message/61994 Mute This Topic: https://groups.io/mt/75267365/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- From nobody Thu May 2 11:52:34 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+61995+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+61995+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1593723130; cv=none; d=zohomail.com; s=zohoarc; b=Gf5zzLhGf//C0SyLrlkKmGc47ry6K0tt5QgCgkSeXoOaPPunctwU0DG/TkKe8q18FBzmIJ8EcIXs7hS3pt1igr9oWDrEnVuDf8KaxClxRwBu/iRaIPHHqgAo6ZbMFUI59R4yVKl9PFZSIJG49OGK5pVzLi1qkCgRlMXXRI2DOFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593723130; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5W1+lELrr0yPgLvawS0fVlUAObS8efDh+uVnIbJLh6k=; b=UXOkCxWJoIHL23FtGdbFcBEDvhAWdeSdUse6Xnzd4+T+Dj90Bxmj3NWstO0/EJvhEPTV2zshlb5H2yfXAWGX1iIasSyq/P6BBPdPYLHVBEIW6ZVU4tKyLCdJtAywt3vHLE6ZUmuIt1d1vv6wHR0MwsA2h7ekjw58xNBbmZs2d+s= 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+61995+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593723130202391.7336987357263; Thu, 2 Jul 2020 13:52:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iPw3YY1788612xsQRWCpQxEi; Thu, 02 Jul 2020 13:52:09 -0700 X-Received: from atlmailgw1.ami.com (atlmailgw1.ami.com []) by mx.groups.io with SMTP id smtpd.web10.6115.1593723127624974290 for ; Thu, 02 Jul 2020 13:52:09 -0700 X-AuditID: ac1060b2-ebbff70000003d78-27-5efe48f87629 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 atlmailgw1.ami.com (Symantec Messaging Gateway) with SMTP id 7E.C2.15736.8F84EFE5; Thu, 2 Jul 2020 16:52:08 -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; Thu, 2 Jul 2020 16:50:45 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , , , , Subject: [edk2-devel] [PATCH V3 3/4] UefiCpuPkg: Update EFI_MEMORY_CACHETYPE_MASK definition Date: Thu, 2 Jul 2020 16:50:38 -0400 Message-ID: <20200702205039.52400-4-oleksiyy@ami.com> In-Reply-To: <20200702205039.52400-1-oleksiyy@ami.com> References: <20200702205039.52400-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsWyRiBhgu4Pj39xBo8XmVls3aZu0T5hNpvF smM7WCxW3NvAbtHR8Y/JYvp2F4svq98zOrB7bP9+gdFj8Z6XTB7v911lC2COamC0SczLyy9J LElVSEktTrZVCijKLEtMrlRSyEyxVTJUUijISUxOzU3NK7FVSiwoSM1LUbLjUsAANkBlmXkK qXnJ+SmZeem2Sp7B/roWFqaWuoZKdiEZqQqZeWn5RbmJJZn5eQrJ+XklQNWpKUBRhYRuzoz/ r5YzFzSwV7zvPMzUwPiPuYuRk0NCwETix9OpjF2MXBxCAruYJH52PWaBcDYzSuz7NpsdpIpN QFPiwLEpjCC2iICUxJQDM5lAipgF9jBK9Lw+xdrFyMEhLBAo8aolHKSGRUBF4kr7EyaQMK+A qcThOSoQyzQkpq25ywRicwqYSfQuaAUbKQRUcmj/QVYQm1dAUOLkzCcsIDazgITEwRcvmCFq ZCXajj9nn8DIPwtJ2SwkZQsYmVYxCiWW5OQmZuaklxvqJeZm6iXn525ihETiph2MLRfNDzEy cTAeYpTgYFYS4U1Q/RcnxJuSWFmVWpQfX1Sak1p8iNEJ6P6JzFLcoAAExki8sYGBlCiMY2hi ZmJuZG5oaWJubKwkzjt57Zo4IYF0YMxmp6YWpBbBDGHi4JRqYLTb9eiKxNZD571ubvU/uNSl VcuPszUrc3OEaKFe9se9txJ2X7i8xCl/0iupkPvVkzT2Hdzn2XIi7HPxf8XDi36d4p/bFHyU 4zCH05y0NeEveDlv6H/XvfX/+0vNzRZNVcFS7pwf/GML9itWO3Pt3l5iI7nR9LvUwmVP8szm LXi50eRRf3DnviQlluKMREMt5qLiRADj4PCM2QIAAA== 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: iBnM9rkroYwCpWsVcOqrWVM7x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593723129; bh=8glL12B2YdXXAxoOf0Tr5f1lfzDFkwGyq8iIB5uTH+M=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=OZNG03mQBnOwAaZW8ZLaOEo+laqw8ukT91hikineMw04NUUU1Rnv1CzNFxVgjgWIbHo TJAgUNhkCzcB1/Vc6e5/GohzpiVcGp4MauOKFRqL590BeoWdU0gHWDDzSFsFw3O+nxjlk y9kcbnsm3kd5i2p8UEcmZgNBiqsIVHZY2dw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add EFI_MEMORY_WP attribute to EFI_MEMORY_CACHETYPE_MASK definition. Signed-off-by: Oleksiy Yakovlev Acked-by: Eric Dong Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- UefiCpuPkg/CpuDxe/CpuDxe.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/CpuDxe.h index 9299eaa..b30a896 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.h +++ b/UefiCpuPkg/CpuDxe/CpuDxe.h @@ -43,7 +43,8 @@ EFI_MEMORY_WC | \ EFI_MEMORY_WT | \ EFI_MEMORY_WB | \ - EFI_MEMORY_UCE \ + EFI_MEMORY_UCE | \ + EFI_MEMORY_WP \ ) =20 #define EFI_MEMORY_PAGETYPE_MASK (EFI_MEMORY_RP | \ --=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 (#61995): https://edk2.groups.io/g/devel/message/61995 Mute This Topic: https://groups.io/mt/75267366/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- From nobody Thu May 2 11:52:34 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+61996+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+61996+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1593723131; cv=none; d=zohomail.com; s=zohoarc; b=VyNlX7ejE0rcggyikHFiUkFdNh6ZtaWfr5CKLbbnaxaLRqSoLjY6N9PrMLPVFQjlRa4tOURuXWKLluME47I3d910YKK6AzTyyBJJHqEwezftQ2jOhu1coisI1qW0dGCzIsDG1+q6XDVVPhLPHkSQ/jxGB6xlKR4nj30ZliYhyZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593723131; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=oCHIoyBTWBzhcYrvJMr2R/5Sw6LLu49s4zsfdP//f7g=; b=aDR1Xdpe1HyzQPWtFHybvTEnlVnpoAeBglwQ6QE4tIETv3zHIBWSz7p8ks4iEkyLnWR2l2/iXjOhOpy9kJNvSSW41i5DBSDMaOZJaYB3WWoBSqLFYAYuIcIIywVjzswPzGERP4Vdmz7Atp575xvpLq2FSkIriCdYbLh+xu+/iqc= 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+61996+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593723131024535.5692392985693; Thu, 2 Jul 2020 13:52:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Tqb7YY1788612xaPHNN2zciQ; Thu, 02 Jul 2020 13:52:10 -0700 X-Received: from atlmailgw2.ami.com (atlmailgw2.ami.com []) by mx.groups.io with SMTP id smtpd.web10.6114.1593723126518679449 for ; Thu, 02 Jul 2020 13:52:10 -0700 X-AuditID: ac10606f-4dbff70000003ed3-02-5efe48f6872d 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 0B.C1.16083.6F84EFE5; Thu, 2 Jul 2020 16:52:06 -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; Thu, 2 Jul 2020 16:50:46 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , , , , Subject: [edk2-devel] [PATCH V3 4/4] UefiCpuPkg: Add New Memory Attributes Date: Thu, 2 Jul 2020 16:50:39 -0400 Message-ID: <20200702205039.52400-5-oleksiyy@ami.com> In-Reply-To: <20200702205039.52400-1-oleksiyy@ami.com> References: <20200702205039.52400-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBIsWRmVeSWpSXmKPExsWyRiBhgu43j39xBl2rNCy2blO3aJ8wm81i 2bEdLBYr7m1gt+jo+MdkMX27i8WX1e8ZHdg9tn+/wOixeM9LJo/3+66yBTBHNTDaJObl5Zck lqQqpKQWJ9sqBRRlliUmVyopZKbYKhkqKRTkJCan5qbmldgqJRYUpOalKNlxKWAAG6CyzDyF 1Lzk/JTMvHRbJc9gf10LC1NLXUMlu5CMVIXMvLT8otzEksz8PIXk/LwSoOrUFKCoQkI3Z8aM aT/ZCt5rVDSdWcjSwPhWtouRk0NCwETi9qYPLF2MXBxCAruYJE4vOsgM4WxmlLjx6xkzSBWb gKbEgWNTGEFsEQEpiSkHZjKBFDEL7GGU6Hl9ihUkISxgK9Hz9TsbiM0ioCLxdnI7mM0rYCrx 6vVNVoh1GhLT1txlArE5Bcwkehe0gg0VAqo5tP8gK0S9oMTJmU9YQGxmAQmJgy9eMEPUyEq0 HX/OPoGRfxaSsllIyhYwMq1iFEosyclNzMxJLzfSS8zN1EvOz93ECInG/B2MHz+aH2Jk4mA8 xCjBwawkwpug+i9OiDclsbIqtSg/vqg0J7X4EKMT0AMTmaW4QUEIjJN4YwMDKVEYx9DEzMTc yNzQ0sTc2FhJnHfS2jVxQgLpwLjNTk0tSC2CGcLEwSnVwLhuieTFh8eXdKQqyqQ1Ma054Xa/ +3iNyWO995Ud7We1X2xInv35S73Kvjv/fkw+/WbKszXXWpzO3s2KTjYwnuGcovcxYsVM+ZdW ffo10UpOL0vyy2UiRGeK3Zogp/34dPNuh6rlhdlb97V0duSGG51ze7LaXthh0quqMq/Dbm9i 7yTvzlfjUVRiKc5INNRiLipOBAAlEFoG2wIAAA== 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: GcxuAjd2ZQpq29orP6PkStJUx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593723130; bh=YMLpQqAFhPKVdpvJV4dcITwD1F5/Ad/SZL1zP8Mi0eE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=wu1Y9t9urMfteOnxRNqDZWusphBfnYOaiWMeeALbLPCcTLTKDvyGswZjOKSwngYzEqV ILxV7V222FVFDIlJspFL9hMD6EDtxBzhbd5DflKQvO3Gj6yOskde9OdP5xpO4JHWL1Mag /vNBczLPTuOZSPC/pwufQis3rmlqOSx3YlI= 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). Use attributes bitmasks, defined in MdePkg. Signed-off-by: Oleksiy Yakovlev Reviewed-by: Laszlo Ersek Reviewed-by: Eric Dong Tested-by: Laszlo Ersek --- UefiCpuPkg/CpuDxe/CpuDxe.c | 11 ++++------- UefiCpuPkg/CpuDxe/CpuDxe.h | 13 ------------- UefiCpuPkg/CpuDxe/CpuPageTable.c | 6 +++--- UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 2 +- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index a571fc3..52cc26e 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -10,9 +10,6 @@ #include "CpuMp.h" #include "CpuPageTable.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) - // // Global Variables // @@ -417,8 +414,8 @@ CpuSetMemoryAttributes ( return EFI_SUCCESS; } =20 - CacheAttributes =3D Attributes & CACHE_ATTRIBUTE_MASK; - MemoryAttributes =3D Attributes & MEMORY_ATTRIBUTE_MASK; + CacheAttributes =3D Attributes & EFI_CACHE_ATTRIBUTE_MASK; + MemoryAttributes =3D Attributes & EFI_MEMORY_ATTRIBUTE_MASK; =20 if (Attributes !=3D (CacheAttributes | MemoryAttributes)) { return EFI_INVALID_PARAMETER; @@ -677,7 +674,7 @@ SetGcdMemorySpaceAttributes ( gDS->SetMemorySpaceAttributes ( RegionStart, RegionLength, - (MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK)= | (MemorySpaceMap[Index].Capabilities & Attributes) + (MemorySpaceMap[Index].Attributes & ~EFI_CACHE_ATTRIBUTE_MASK) = | (MemorySpaceMap[Index].Capabilities & Attributes) ); } =20 @@ -754,7 +751,7 @@ RefreshMemoryAttributesFromMtrr ( gDS->SetMemorySpaceAttributes ( MemorySpaceMap[Index].BaseAddress, MemorySpaceMap[Index].Length, - (MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK)= | + (MemorySpaceMap[Index].Attributes & ~EFI_CACHE_ATTRIBUTE_MASK) | (MemorySpaceMap[Index].Capabilities & DefaultAttributes) ); } diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/CpuDxe.h index b30a896..9771ec8 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.h +++ b/UefiCpuPkg/CpuDxe/CpuDxe.h @@ -39,19 +39,6 @@ #include #include =20 -#define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \ - EFI_MEMORY_WC | \ - EFI_MEMORY_WT | \ - EFI_MEMORY_WB | \ - EFI_MEMORY_UCE | \ - EFI_MEMORY_WP \ - ) - -#define EFI_MEMORY_PAGETYPE_MASK (EFI_MEMORY_RP | \ - EFI_MEMORY_XP | \ - EFI_MEMORY_RO \ - ) - #define HEAP_GUARD_NONSTOP_MODE \ ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT6|BIT4|BIT1|BIT0)) > BI= T6) =20 diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTa= ble.c index 0a02cb3..06ee1b8 100644 --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c @@ -717,7 +717,7 @@ ConvertMemoryPageAttributes ( return RETURN_INVALID_PARAMETER; } =20 - if ((Attributes & ~(EFI_MEMORY_RP | EFI_MEMORY_RO | EFI_MEMORY_XP)) !=3D= 0) { + if ((Attributes & ~EFI_MEMORY_ATTRIBUTE_MASK) !=3D 0) { DEBUG ((DEBUG_ERROR, "Attributes(0x%lx) has unsupported bit\n", Attrib= utes)); return EFI_UNSUPPORTED; } @@ -1018,9 +1018,9 @@ RefreshGcdMemoryAttributesFromPaging ( =20 Length =3D MIN (PageLength, MemorySpaceLength); if (Attributes !=3D (MemorySpaceMap[Index].Attributes & - EFI_MEMORY_PAGETYPE_MASK)) { + EFI_MEMORY_ATTRIBUTE_MASK)) { NewAttributes =3D (MemorySpaceMap[Index].Attributes & - ~EFI_MEMORY_PAGETYPE_MASK) | Attributes; + ~EFI_MEMORY_ATTRIBUTE_MASK) | Attributes; Status =3D gDS->SetMemorySpaceAttributes ( BaseAddress, Length, diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPk= g/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c index 9c5a92a..ebfc46a 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c @@ -435,7 +435,7 @@ ConvertMemoryPageAttributes ( EFI_PHYSICAL_ADDRESS MaximumSupportMemAddress; =20 ASSERT (Attributes !=3D 0); - ASSERT ((Attributes & ~(EFI_MEMORY_RP | EFI_MEMORY_RO | EFI_MEMORY_XP)) = =3D=3D 0); + ASSERT ((Attributes & ~EFI_MEMORY_ATTRIBUTE_MASK) =3D=3D 0); =20 ASSERT ((BaseAddress & (SIZE_4KB - 1)) =3D=3D 0); ASSERT ((Length & (SIZE_4KB - 1)) =3D=3D 0); --=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 (#61996): https://edk2.groups.io/g/devel/message/61996 Mute This Topic: https://groups.io/mt/75267367/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-