From nobody Sun Feb 8 14:22:53 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+108169+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+108169+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1693437555; cv=none; d=zohomail.com; s=zohoarc; b=JKfqye3fVSSFB9BwyLPJOAvIC679LesGnQdmAHGl9WhAOglke+RRznA6ibDu5WqXneMKJEUwmz0n9jGfSfgmmyGZBGoI2cxfRrRXgp3E9sSPy7NlhmRee1dEeLMtU6YjVX9a70aLsJZw2CD+PoOGTNEwLljag4ljDqIYoRqsRMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693437555; 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=01tOiTqM05AVph7SmzBlCU/gqtwAfB2bAHdGOlAKMKk=; b=jSCT+ihYzwWCD5RtdQOeDJDLLDcfhAXFMmj/kxGkhNCyXGX+6wAc7cbyqjorj90FhkA9SoG8FHePjXvBU6uTKQLr6za6LosA7zIBIROsyMIGBJ5HKMqk89Fywec+L7D4h1uIm+v7Hn9EFYFxc7C3MinGHTReUO1w2YMa/oXG/Ng= 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+108169+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 1693437555092595.9468255724139; Wed, 30 Aug 2023 16:19:15 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=OjHx9GZd8rCi5rY+bvWBwsCmT+64jJGPdpUiXxxjitc=; 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=1693437554; v=1; b=YB04xI0CKjqjNnPCmuMOOyKqrZIMZ+rzh0lMmwhQyc55ybqVip3PpvlB/ztB/vXWXR2RP1Ru /s7adj3esXSnd+hWXdUDMfxoJqDGeH4pxwHj7DF37TEfIJ7P6yx0ai+QnAVSc7CElblDcbmOYAX iqVWYgKM50wADgajRPwYf3Es= X-Received: by 127.0.0.2 with SMTP id uCX9YY1788612xpL30K7UBWO; Wed, 30 Aug 2023 16:19:14 -0700 X-Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mx.groups.io with SMTP id smtpd.web10.4871.1693437554056293879 for ; Wed, 30 Aug 2023 16:19:14 -0700 X-Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5654051b27fso237893a12.0 for ; Wed, 30 Aug 2023 16:19:14 -0700 (PDT) X-Gm-Message-State: Xlqtztla0MBuRzqSvogkELM8x1787277AA= X-Google-Smtp-Source: AGHT+IGnr3giPdZ52yv1Q19QJEuDzmsEHdVTqRtAOIuVd10qdJZKH0o/zgKMmIbaVsWjOqi0udI8Dg== X-Received: by 2002:a05:6a20:191:b0:137:23a2:2b3c with SMTP id 17-20020a056a20019100b0013723a22b3cmr3647340pzy.49.1693437553372; Wed, 30 Aug 2023 16:19:13 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id x16-20020a62fb10000000b0064398fe3451sm102550pfm.217.2023.08.30.16.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 16:19:13 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v3 15/26] ArmPkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs Date: Wed, 30 Aug 2023 16:18:23 -0700 Message-ID: <20230830231851.779-16-taylor.d.beebe@gmail.com> In-Reply-To: <20230830231851.779-1-taylor.d.beebe@gmail.com> References: <20230830231851.779-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: 1693437556961100063 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 4939b3d59b7f..354535eb3718 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.1 -=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 (#108169): https://edk2.groups.io/g/devel/message/108169 Mute This Topic: https://groups.io/mt/101064089/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-