From nobody Sun Feb 8 19:38:17 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+108877+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+108877+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1695171496; cv=none; d=zohomail.com; s=zohoarc; b=YWwOmCraLIueO+EWYEv+nJVIPNqr81YgIBYt83B+S8x0K4CcCriJFWclmh28d8krmnj+UcbUippscEIRvHuT381cMTSxP6V2zJrZg4oqJpRxPv3dCBvnR3bKW8l8/g6UwhEoiSfY6qrq+vv8fSpGhkfoQIXvraOa/jyKf8sGv8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695171496; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IjygyF4xkzcejEORE/crk+bmJ+UOXb7cL5zqXWZY0ms=; b=f/g8gyoiZzHVVMCyoBYF0xhpsP2uKYa3/ueawdczH5Pb3vRi48AnmgeJ4LbNP/XPSUjW7e0ZheGjaOenKVaH/QR86YtxkJ11AbiwTbzfX2ggeK1mmspXsITSlhFt3EvVpv6pQg6X1+J6XraHPVYBKGN1jrLKdvvpIh7KHYE7ZfA= 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+108877+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 16951714968771007.8132158604591; Tue, 19 Sep 2023 17:58:16 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=d2kaRZfoU5KfIdXo8T6hp3c2c+1kPpJBN6Hhs456wGs=; 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=1695171496; v=1; b=f9FS6yy5jFTjyaJRjGbnDWVtdDtlG1Gx7SeJs8SqjXzH1Ir0agyATF1saBH7TxguCIVNxEHi 2IHlHyOwER4smaEvKqQlaL5l0BHZXESJqGUuotlu5frVSbYx32U/h7w2fd8H0EkYriXHdCvgnKL vCDjZH2Wq0+BqfaBcyDwimzc= X-Received: by 127.0.0.2 with SMTP id CCQRYY1788612xJkORLWwtfx; Tue, 19 Sep 2023 17:58:16 -0700 X-Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web11.26926.1695171496133669304 for ; Tue, 19 Sep 2023 17:58:16 -0700 X-Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1c47309a8ccso2603075ad.1 for ; Tue, 19 Sep 2023 17:58:16 -0700 (PDT) X-Gm-Message-State: DnQ7WaLvS2Lf4A6Q5Co3mNmmx1787277AA= X-Google-Smtp-Source: AGHT+IFGe0PdyjfLYScNM+qCxAgQZpsEKnwyNDfPcxF6JDMKcCkAD/YrkzVtkgre927YuBkqdr4zaw== X-Received: by 2002:a17:903:234f:b0:1c3:2c4d:889e with SMTP id c15-20020a170903234f00b001c32c4d889emr5274725plh.16.1695171495423; Tue, 19 Sep 2023 17:58:15 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c24d00b001bb988ac243sm10563576plg.297.2023.09.19.17.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:58:14 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v4 15/28] ArmPkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs Date: Tue, 19 Sep 2023 17:57:38 -0700 Message-ID: <20230920005752.2041-16-taylor.d.beebe@gmail.com> In-Reply-To: <20230920005752.2041-1-taylor.d.beebe@gmail.com> References: <20230920005752.2041-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: 1695171498279100063 Content-Type: text/plain; charset="utf-8" Replace references to the memory protection PCDs to instead check the platform protections via GetMemoryProtectionsLib. Signed-off-by: Taylor Beebe Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar --- ArmPkg/Drivers/CpuDxe/CpuDxe.c | 5 ++--- ArmPkg/ArmPkg.dsc | 1 + ArmPkg/Drivers/CpuDxe/CpuDxe.inf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.c b/ArmPkg/Drivers/CpuDxe/CpuDxe.c index fc63e527846a..8a25e78dfebd 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.c +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.c @@ -12,6 +12,7 @@ #include =20 #include +#include =20 BOOLEAN mIsFlushingGCD; =20 @@ -241,7 +242,6 @@ RemapUnusedMemoryNx ( VOID ) { - UINT64 TestBit; UINTN MemoryMapSize; UINTN MapKey; UINTN DescriptorSize; @@ -251,8 +251,7 @@ RemapUnusedMemoryNx ( EFI_MEMORY_DESCRIPTOR *MemoryMapEnd; EFI_STATUS Status; =20 - TestBit =3D LShiftU64 (1, EfiBootServicesData); - if ((PcdGet64 (PcdDxeNxMemoryProtectionPolicy) & TestBit) =3D=3D 0) { + if (!gMps.Dxe.ExecutionProtection.EnabledForType[EfiBootServicesData]) { return; } =20 diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 6dd91e694192..1e34ef95b7cb 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -57,6 +57,7 @@ [LibraryClasses.common] PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf + GetMemoryProtectionsLib|MdeModulePkg/Library/GetMemoryProtectionsLib/Get= MemoryProtectionsLibNull.inf =20 UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/ArmPkg/Drivers/CpuDxe/CpuDx= e.inf index 7d8132200e64..4d0a3de99546 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf @@ -46,6 +46,7 @@ [LibraryClasses] CpuExceptionHandlerLib DebugLib DefaultExceptionHandlerLib + GetMemoryProtectionsLib DxeServicesTableLib HobLib MemoryAllocationLib @@ -65,7 +66,6 @@ [Guids] =20 [Pcd.common] gArmTokenSpaceGuid.PcdVFPEnabled - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy =20 [FeaturePcd.common] gArmTokenSpaceGuid.PcdDebuggerExceptionSupport --=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 (#108877): https://edk2.groups.io/g/devel/message/108877 Mute This Topic: https://groups.io/mt/101469954/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-