From nobody Mon Feb 9 02:50:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109430+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109430+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696810093; cv=none; d=zohomail.com; s=zohoarc; b=gj3PmlT0qgmqrWd5ppsm0qtep2iZrhUekhWowZ2jdmsWhqNyOXNYDkwrNTtTnjsXK3cUR6rq7tzQXSGXUMW6sLV6jURk02k9gdVemVsI0I8m4PMT2JOzsyTwlt1NiSiSk47ki5nI188XJ0HOghYaZsIWQQVW+9b6lwADSlfLkX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696810093; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=tLZoCxBwDWJd7lJpo4IJQFZPa/3RqERgT1L6272/If8=; b=TqX6jQLAGq0wN0mTmvadlfmoSwekTzB0itk7OjzwVBBWqDgPnHn5xSzoMLR9msPbE02PyaDmB4MN/4cxzmoG46uPoq7Byvv+h+MRinmEUB7IZaCxRKynMwVlIZ7zYKdvjDE5gs90+P3eeyQhmxdloWB5OaL7wIs+eFU9UUl2MBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109430+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696810093464604.605383602369; Sun, 8 Oct 2023 17:08:13 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=siEb5GNON7tbniv7e44mgsS+uAfs1W29OIs2ns3paSM=; 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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696810093; v=1; b=W3J+Q37ubAinDERyDVl7l63EaaLvGD75jpvNYyVUyQAhffgXl/+jwRARO+pYeDLc6Y2BIOUR mc3IZlR8PCWuAjzOmw0pdjAcY1b8sl2/2ZQsufeb8kTRxWm/114vcwmd02FxW75xjYlWXz2mrIe TxQhr9f7gOHtCqTbWkd3+OLE= X-Received: by 127.0.0.2 with SMTP id JJiUYY1788612x37WdXiuA1p; Sun, 08 Oct 2023 17:08:13 -0700 X-Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web10.50234.1696810092500899724 for ; Sun, 08 Oct 2023 17:08:12 -0700 X-Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-691c05bc5aaso3585740b3a.2 for ; Sun, 08 Oct 2023 17:08:12 -0700 (PDT) X-Gm-Message-State: 1Mkp0MxixrSDeN2jL8yzFTSTx1787277AA= X-Google-Smtp-Source: AGHT+IE3yVzWwpke5FupdSwuL8HZCwCajBnoYaVdXdUhkLaUPjgAe/Yk1O9Xl63vok4vvpMqkzTegw== X-Received: by 2002:a05:6a00:17a1:b0:691:fd26:f54a with SMTP id s33-20020a056a0017a100b00691fd26f54amr17048236pfg.20.1696810091741; Sun, 08 Oct 2023 17:08:11 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id t20-20020a62ea14000000b0068fcc7f6b00sm5048320pfh.74.2023.10.08.17.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 17:08:11 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao Subject: [edk2-devel] [PATCH v5 25/28] MdeModulePkg: Delete PCD Profile from SetMemoryProtectionsLib Date: Sun, 8 Oct 2023 17:07:37 -0700 Message-ID: <20231009000742.1792-26-taylor.d.beebe@gmail.com> In-Reply-To: <20231009000742.1792-1-taylor.d.beebe@gmail.com> References: <20231009000742.1792-1-taylor.d.beebe@gmail.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 Reply-To: devel@edk2.groups.io,taylor.d.beebe@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696810094656100105 Content-Type: text/plain; charset="utf-8" Now that the transition to use SetMemoryProtectionsLib and GetMemoryProtectionsLib is complete, delete the PCD profile to avoid confusing the interface. All memory protection settings will now be set and consumed via the libraries. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc: Liming Gao --- MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtectionsLib.c |= 174 +------------------- MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h |= 2 - MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtectionsLib.inf |= 11 -- 3 files changed, 4 insertions(+), 183 deletions(-) diff --git a/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtecti= onsLib.c b/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtection= sLib.c index 5a82a94fe258..b49d68547ce9 100644 --- a/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtectionsLib.c +++ b/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtectionsLib.c @@ -10,7 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include #include =20 #pragma pack(1) @@ -249,99 +248,6 @@ typedef struct { } \ } =20 -// -// A memory profile which uses the fixed at build PCDs defined in MdeModu= lePkg.dec -// -#define DXE_MEMORY_PROTECTION_SETTINGS_PCD = \ -{ = \ - DXE_MEMORY_PROTECTION_SIGNATURE, = \ - DXE_MEMORY_PROTECTION_SETTINGS_CURRENT_VERSION, = \ - FixedPcdGetBool (PcdCpuStackGuard), /* Stack Guard */ = \ - TRUE, /* Stack Execution Protection (MUST = BE POPULATED) */ \ - { /* NULL Pointer Detection */ = \ - .Enabled =3D ((FixedPcdGet8 (PcdNullPointerDetectionPropert= yMask) & BIT0) !=3D 0), \ - .DisableEndOfDxe =3D ((FixedPcdGet8 (PcdNullPointerDetectionPropert= yMask) & BIT7) !=3D 0), \ - .NonstopModeEnabled =3D ((FixedPcdGet8 (PcdNullPointerDetectionPropert= yMask) & BIT6) !=3D 0) \ - }, = \ - { /* Image Protection */ = \ - .ProtectImageFromUnknown =3D ((FixedPcdGet32 (PcdImageProtectionPolicy= ) & BIT0) !=3D 0), \ - .ProtectImageFromFv =3D ((FixedPcdGet32 (PcdImageProtectionPolicy= ) & BIT1) !=3D 0) \ - }, = \ - { /* Execution Protection */ = \ - .EnabledForType =3D { = \ - [EfiReservedMemoryType] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiReservedMemoryType) !=3D 0), \ - [EfiLoaderCode] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiLoaderCode) !=3D 0), \ - [EfiLoaderData] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiLoaderData) !=3D 0), \ - [EfiBootServicesCode] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiBootServicesCode) !=3D 0), \ - [EfiBootServicesData] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiBootServicesData) !=3D 0), \ - [EfiRuntimeServicesCode] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiRuntimeServicesCode) !=3D 0), \ - [EfiRuntimeServicesData] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiRuntimeServicesData) !=3D 0), \ - [EfiConventionalMemory] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiConventionalMemory) !=3D 0), \ - [EfiUnusableMemory] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiUnusableMemory) !=3D 0), \ - [EfiACPIReclaimMemory] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiACPIReclaimMemory) !=3D 0), \ - [EfiACPIMemoryNVS] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiACPIMemoryNVS) !=3D 0), \ - [EfiMemoryMappedIO] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiMemoryMappedIO) !=3D 0), \ - [EfiMemoryMappedIOPortSpace] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiMemoryMappedIOPortSpace) !=3D 0), \ - [EfiPalCode] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiPalCode) !=3D 0), \ - [EfiPersistentMemory] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiPersistentMemory) !=3D 0), \ - [EfiUnacceptedMemoryType] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & EfiUnacceptedMemoryType) !=3D 0), \ - [OEM_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & BIT62) !=3D 0), \ - [OS_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdDxeNxM= emoryProtectionPolicy) & BIT63) !=3D 0) \ - } = \ - }, = \ - { /* Heap Guard */ = \ - .PageGuardEnabled =3D ((FixedPcdGet8 (PcdHeapGua= rdPropertyMask) & BIT0) !=3D 0), \ - .PoolGuardEnabled =3D ((FixedPcdGet8 (PcdHeapGua= rdPropertyMask) & BIT1) !=3D 0), \ - .FreedMemoryGuardEnabled =3D ((FixedPcdGet8 (PcdHeapGua= rdPropertyMask) & BIT4) !=3D 0), \ - .NonstopModeEnabled =3D ((FixedPcdGet8 (PcdHeapGua= rdPropertyMask) & BIT6) !=3D 0), \ - .GuardAlignedToTail =3D ((FixedPcdGet8 (PcdHeapGua= rdPropertyMask) & BIT7) =3D=3D 0) \ - }, = \ - { /* Pool Guard */ = \ - .EnabledForType =3D { = \ - [EfiReservedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiReservedMemoryType) !=3D 0), \ - [EfiLoaderCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiLoaderCode) !=3D 0), \ - [EfiLoaderData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiLoaderData) !=3D 0), \ - [EfiBootServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiBootServicesCode) !=3D 0), \ - [EfiBootServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiBootServicesData) !=3D 0), \ - [EfiRuntimeServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiRuntimeServicesCode) !=3D 0), \ - [EfiRuntimeServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiRuntimeServicesData) !=3D 0), \ - [EfiConventionalMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiConventionalMemory) !=3D 0), \ - [EfiUnusableMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiUnusableMemory) !=3D 0), \ - [EfiACPIReclaimMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiACPIReclaimMemory) !=3D 0), \ - [EfiACPIMemoryNVS] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiACPIMemoryNVS) !=3D 0), \ - [EfiMemoryMappedIO] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiMemoryMappedIO) !=3D 0), \ - [EfiMemoryMappedIOPortSpace] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiMemoryMappedIOPortSpace) !=3D 0), \ - [EfiPalCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiPalCode) !=3D 0), \ - [EfiPersistentMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiPersistentMemory) !=3D 0), \ - [EfiUnacceptedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiUnacceptedMemoryType) !=3D 0), \ - [OEM_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & BIT62) !=3D 0), \ - [OS_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & BIT63) !=3D 0) \ - } = \ - }, = \ - { /* Page Guard */ = \ - .EnabledForType =3D { = \ - [EfiReservedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiReservedMemoryType) !=3D 0), \ - [EfiLoaderCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiLoaderCode) !=3D 0), \ - [EfiLoaderData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiLoaderData) !=3D 0), \ - [EfiBootServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiBootServicesCode) !=3D 0), \ - [EfiBootServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiBootServicesData) !=3D 0), \ - [EfiRuntimeServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiRuntimeServicesCode) !=3D 0), \ - [EfiRuntimeServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiRuntimeServicesData) !=3D 0), \ - [EfiConventionalMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiConventionalMemory) !=3D 0), \ - [EfiUnusableMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiUnusableMemory) !=3D 0), \ - [EfiACPIReclaimMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiACPIReclaimMemory) !=3D 0), \ - [EfiACPIMemoryNVS] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiACPIMemoryNVS) !=3D 0), \ - [EfiMemoryMappedIO] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiMemoryMappedIO) !=3D 0), \ - [EfiMemoryMappedIOPortSpace] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiMemoryMappedIOPortSpace) !=3D 0), \ - [EfiPalCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiPalCode) !=3D 0), \ - [EfiPersistentMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiPersistentMemory) !=3D 0), \ - [EfiUnacceptedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiUnacceptedMemoryType) !=3D 0), \ - [OEM_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & BIT62) !=3D 0), \ - [OS_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & BIT63) !=3D 0) \ - } = \ - } = \ -} - // A memory profile recommended for compatibility with older // versions of Grub. // @@ -556,69 +462,6 @@ typedef struct { } \ } =20 -// -// A memory profile which uses the fixed at build PCDs defined in MdeModu= lePkg.dec -// -#define MM_MEMORY_PROTECTION_SETTINGS_PCD = \ -{ = \ - MM_MEMORY_PROTECTION_SIGNATURE, = \ - MM_MEMORY_PROTECTION_SETTINGS_CURRENT_VERSION, = \ - { /* NULL Pointer Detection */ = \ - .Enabled =3D ((FixedPcdGet8 (PcdNullPointerDetectionPropert= yMask) & BIT1) !=3D 0), \ - .NonstopModeEnabled =3D ((FixedPcdGet8 (PcdNullPointerDetectionPropert= yMask) & BIT6) !=3D 0) \ - }, = \ - { /* Heap Guard */ = \ - .PageGuardEnabled =3D ((FixedPcdGet8(PcdHeapGuar= dPropertyMask) & BIT2) !=3D 0), \ - .PoolGuardEnabled =3D ((FixedPcdGet8(PcdHeapGuar= dPropertyMask) & BIT3) !=3D 0), \ - .NonstopModeEnabled =3D ((FixedPcdGet8(PcdHeapGuar= dPropertyMask) & BIT6) !=3D 0), \ - .GuardAlignedToTail =3D ((FixedPcdGet8(PcdHeapGuar= dPropertyMask) & BIT7) =3D=3D 0) \ - }, = \ - { /* Pool Guard */ = \ - .EnabledForType =3D { = \ - [EfiReservedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiReservedMemoryType) !=3D 0), \ - [EfiLoaderCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiLoaderCode) !=3D 0), \ - [EfiLoaderData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiLoaderData) !=3D 0), \ - [EfiBootServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiBootServicesCode) !=3D 0), \ - [EfiBootServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiBootServicesData) !=3D 0), \ - [EfiRuntimeServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiRuntimeServicesCode) !=3D 0), \ - [EfiRuntimeServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiRuntimeServicesData) !=3D 0), \ - [EfiConventionalMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiConventionalMemory) !=3D 0), \ - [EfiUnusableMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiUnusableMemory) !=3D 0), \ - [EfiACPIReclaimMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiACPIReclaimMemory) !=3D 0), \ - [EfiACPIMemoryNVS] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiACPIMemoryNVS) !=3D 0), \ - [EfiMemoryMappedIO] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiMemoryMappedIO) !=3D 0), \ - [EfiMemoryMappedIOPortSpace] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiMemoryMappedIOPortSpace) !=3D 0), \ - [EfiPalCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiPalCode) !=3D 0), \ - [EfiPersistentMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiPersistentMemory) !=3D 0), \ - [EfiUnacceptedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & EfiUnacceptedMemoryType) !=3D 0), \ - [OEM_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & BIT62) !=3D 0), \ - [OS_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPoolType) & BIT63) !=3D 0) \ - } = \ - }, = \ - { /* Page Guard */ = \ - .EnabledForType =3D { = \ - [EfiReservedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiReservedMemoryType) !=3D 0), \ - [EfiLoaderCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiLoaderCode) !=3D 0), \ - [EfiLoaderData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiLoaderData) !=3D 0), \ - [EfiBootServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiBootServicesCode) !=3D 0), \ - [EfiBootServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiBootServicesData) !=3D 0), \ - [EfiRuntimeServicesCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiRuntimeServicesCode) !=3D 0), \ - [EfiRuntimeServicesData] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiRuntimeServicesData) !=3D 0), \ - [EfiConventionalMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiConventionalMemory) !=3D 0), \ - [EfiUnusableMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiUnusableMemory) !=3D 0), \ - [EfiACPIReclaimMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiACPIReclaimMemory) !=3D 0), \ - [EfiACPIMemoryNVS] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiACPIMemoryNVS) !=3D 0), \ - [EfiMemoryMappedIO] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiMemoryMappedIO) !=3D 0), \ - [EfiMemoryMappedIOPortSpace] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiMemoryMappedIOPortSpace) !=3D 0), \ - [EfiPalCode] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiPalCode) !=3D 0), \ - [EfiPersistentMemory] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiPersistentMemory) !=3D 0), \ - [EfiUnacceptedMemoryType] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & EfiUnacceptedMemoryType) !=3D 0), \ - [OEM_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & BIT62) !=3D 0), \ - [OS_RESERVED_MPS_MEMORY_TYPE] =3D ((FixedPcdGet64 (PcdHeapGu= ardPageType) & BIT63) !=3D 0) \ - } = \ - } = \ -} - // // A memory profile which disables all MM memory protection settings. // @@ -660,11 +503,6 @@ DXE_MEMORY_PROTECTION_PROFILES DxeMemoryProtectionPro= files[DxeMemoryProtectionS .Description =3D "Release profile without page guards recommended for = performance sensitive production scenarios", .Settings =3D DXE_MEMORY_PROTECTION_SETTINGS_PROD_MODE_NO_PAGE_GUAR= DS }, - [DxeMemoryProtectionSettingsPcd] =3D { - .Name =3D "Pcd", - .Description =3D "Memory protection settings from PCDs", - .Settings =3D DXE_MEMORY_PROTECTION_SETTINGS_PCD - }, [DxeMemoryProtectionSettingsGrubCompat] =3D { .Name =3D "GrubCompat", .Description =3D "DXE_MEMORY_PROTECTION_SETTINGS_PROD_MODE with some p= rotections disabled for legacy Grub compatibility", @@ -688,11 +526,6 @@ MM_MEMORY_PROTECTION_PROFILES MmMemoryProtectionProfi= les[MmMemoryProtectionSett .Description =3D "Release profile recommended for production scenarios= ", .Settings =3D MM_MEMORY_PROTECTION_SETTINGS_PROD_MODE }, - [MmMemoryProtectionSettingsPcd] =3D { - .Name =3D "Pcd", - .Description =3D "Memory protection settings from PCDs", - .Settings =3D MM_MEMORY_PROTECTION_SETTINGS_PCD - }, [MmMemoryProtectionSettingsOff] =3D { .Name =3D "Off", .Description =3D "Disables all memory protection settings", @@ -727,9 +560,10 @@ GetOrCreateMemoryProtectionSettings ( } =20 ZeroMem (&Mpsp, sizeof (Mpsp)); - Mpsp.Mps.Dxe =3D DxeMemoryProtectionProf= iles[DxeMemoryProtectionSettingsPcd].Settings; - Mpsp.Mps.Mm =3D MmMemoryProtectionProfi= les[MmMemoryProtectionSettingsPcd].Settings; - Mpsp.Mps.Dxe.StackExecutionProtectionEnabled =3D PcdGetBool (PcdSetNxFor= Stack); + Mpsp.Mps.Dxe.StructVersion =3D DXE_MEMORY_PROTECTION_SETTINGS_CURRENT_VE= RSION; + Mpsp.Mps.Dxe.Signature =3D DXE_MEMORY_PROTECTION_SIGNATURE; + Mpsp.Mps.Mm.StructVersion =3D MM_MEMORY_PROTECTION_SETTINGS_CURRENT_VER= SION; + Mpsp.Mps.Mm.Signature =3D MM_MEMORY_PROTECTION_SIGNATURE; =20 Ptr =3D BuildGuidDataHob ( &gMemoryProtectionSettingsGuid, diff --git a/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h b/MdeMo= dulePkg/Include/Library/SetMemoryProtectionsLib.h index 3638ba7e3ef7..02e1a2995171 100644 --- a/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h +++ b/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h @@ -22,7 +22,6 @@ typedef enum { DxeMemoryProtectionSettingsReleaseNoPageGuards, DxeMemoryProtectionSettingsGrubCompat, DxeMemoryProtectionSettingsOff, - DxeMemoryProtectionSettingsPcd, DxeMemoryProtectionSettingsMax } DXE_MEMORY_PROTECTION_PROFILE_INDEX; =20 @@ -36,7 +35,6 @@ typedef enum { MmMemoryProtectionSettingsDebug =3D 0, MmMemoryProtectionSettingsRelease, MmMemoryProtectionSettingsOff, - MmMemoryProtectionSettingsPcd, MmMemoryProtectionSettingsMax } MM_MEMORY_PROTECTION_PROFILE_INDEX; =20 diff --git a/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtecti= onsLib.inf b/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtecti= onsLib.inf index 2e4a9a66ac68..830d151a8378 100644 --- a/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtectionsLib.= inf +++ b/MdeModulePkg/Library/SetMemoryProtectionsLib/SetMemoryProtectionsLib.= inf @@ -29,17 +29,6 @@ [LibraryClasses] BaseLib HobLib DebugLib - PcdLib - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask - gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPageType - gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPoolType - gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask - gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy - gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack - gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy =20 [Guids] gMemoryProtectionSettingsGuid --=20 2.42.0.windows.2 -=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 (#109430): https://edk2.groups.io/g/devel/message/109430 Mute This Topic: https://groups.io/mt/101843369/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-