From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by mx.groups.io with SMTP id smtpd.web11.1762.1689119587883801951 for ; Tue, 11 Jul 2023 16:53:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@taylorbeebe.com header.s=google header.b=H/V0ghda; spf=pass (domain: taylorbeebe.com, ip: 209.85.166.169, mailfrom: t@taylorbeebe.com) Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3460aee1d57so31290685ab.0 for ; Tue, 11 Jul 2023 16:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=taylorbeebe.com; s=google; t=1689119587; x=1691711587; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bhp4vIh4omcREvvtRflCxambE50DsuYnvPAZEusRRdA=; b=H/V0ghda29Za7w5AzUXwHoO1FyB92DqizKFvZC2zfkwyrQrcNBe2PnuwrolGApuazQ ++Ex1I8/gARQC+0X9ImjML81tsgEE5OGXDOr/WasUGHmE/ueZ+ACPZNtEVGbNwRQnxjW Y5tEM5B3Y8ZDh+ZqLFjy4B+DG47D1Cf2crZY6MEElpI/HrQNOzRIHjo9dmgAp9trQk9O OZl4+RfotS7lvw9BSz0u85CI3KOVtBDvixCKEFqsKIq+K2Vf6+iuiOiYorzXq0fwZeXT +GrB08ZH8tbUS6uHtglfylLkMbFHytByznf+eW4n+D/ydyO2/xX1nkiyC3EEHXnKq44M U86g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689119587; x=1691711587; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bhp4vIh4omcREvvtRflCxambE50DsuYnvPAZEusRRdA=; b=Y+lBdp2go+J91g8HQOEceXn8si8EAZ39lzJk3sGTO+NA6byZ7iZlWiNHZzfWZUgXpd cuKB0/F+uFvqCgtfB/P+2u6DiJiNaSLidgc9MNURtF75Sax0n6PLcLKUebcl2gWw+yjN YNsGNQ5hTzQoEVjYw8NQ2EMUGAek+dP3F2SwYjQScG+utRjpqcecDSD47n76mRyJ3vP8 4PqwneeoG57ZeWw49AkfuN0YswBqY7GzShAlhJY5kY/urXwHg7hWC3lX/KHml5BHBUgx tdVkhus/pBgx3dRU5ByU4fk+hwunIE55foftgcy6TzIQIDpnD73ed1kOAxdyLLJNsGSp L7nA== X-Gm-Message-State: ABy/qLaHy0CXDyizPCfsumG9Cz1C81zLpXmSvdWSjp3jsRqQdYWPdb2X vErsaGyEo3hS6ShlU8Fc8comuzkfmxj3C+5IVVnYRA== X-Google-Smtp-Source: APBJJlEEpRRmtN80i1gmk+Fm7/K730ZSG+GXWAZTYCQZi3m8KtkKwy9JWEKv1rc/492CnF4mSWFD1g== X-Received: by 2002:a92:da11:0:b0:346:28e:ebf with SMTP id z17-20020a92da11000000b00346028e0ebfmr18522392ilm.2.1689119587062; Tue, 11 Jul 2023 16:53:07 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([50.46.230.135]) by smtp.gmail.com with ESMTPSA id a13-20020a62e20d000000b00660d80087a8sm2232677pfi.187.2023.07.11.16.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 16:53:06 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [PATCH 06/14] ArmPkg: Update to use memory protection HOB Date: Tue, 11 Jul 2023 16:52:43 -0700 Message-ID: <3bb18b2b369dbab06da677707c4c0d7713ea1239.1689101263.git.t@taylorbeebe.com> X-Mailer: git-send-email 2.41.0.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Taylor Beebe Replace references to the memory protection PCDs to instead reference the memory protection HOB. Signed-off-by: Taylor Beebe Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar --- ArmPkg/ArmPkg.dsc | 1 + ArmPkg/Drivers/CpuDxe/CpuDxe.c | 5 ++--- ArmPkg/Drivers/CpuDxe/CpuDxe.inf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 4939b3d59b..3d3605921f 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -57,6 +57,7 @@ PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf + DxeMemoryProtectionHobLib|MdeModulePkg/Library/MemoryProtectionHobLibNull/DxeMemoryProtectionHobLibNull.inf UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.c b/ArmPkg/Drivers/CpuDxe/CpuDxe.c index fc63e52784..6518a7130a 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.c +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.c @@ -12,6 +12,7 @@ #include #include +#include BOOLEAN mIsFlushingGCD; @@ -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; - TestBit = LShiftU64 (1, EfiBootServicesData); - if ((PcdGet64 (PcdDxeNxMemoryProtectionPolicy) & TestBit) == 0) { + if (!gDxeMps.ExecutionProtection.EnabledForType[EfiBootServicesData]) { return; } diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf index 7d8132200e..a0f94bc567 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf @@ -46,6 +46,7 @@ CpuExceptionHandlerLib DebugLib DefaultExceptionHandlerLib + DxeMemoryProtectionHobLib DxeServicesTableLib HobLib MemoryAllocationLib @@ -65,7 +66,6 @@ [Pcd.common] gArmTokenSpaceGuid.PcdVFPEnabled - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy [FeaturePcd.common] gArmTokenSpaceGuid.PcdDebuggerExceptionSupport -- 2.41.0.windows.2