From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org, leif.lindholm@linaro.org
Cc: jiewen.yao@intel.com, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v2 3/4] ArmPkg/CpuDxe: ARM: ignore page table updates that only change permissions
Date: Wed, 15 Feb 2017 17:11:55 +0000 [thread overview]
Message-ID: <1487178716-24569-4-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1487178716-24569-1-git-send-email-ard.biesheuvel@linaro.org>
Currently, we have not implemented support on 32-bit ARM for managing
permission bits in the page tables. Since the new DXE page protection
for PE/COFF images may invoke EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes()
with only permission attributes set, let's simply ignore those for now.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
---
ArmPkg/Drivers/CpuDxe/Arm/Mmu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
index b6ba975b353a..89e429925ba9 100644
--- a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
+++ b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
@@ -680,6 +680,13 @@ SetMemoryAttributes (
{
EFI_STATUS Status;
+ //
+ // Ignore invocations that only modify permission bits
+ //
+ if ((Attributes & EFI_MEMORY_CACHETYPE_MASK) == 0) {
+ return EFI_SUCCESS;
+ }
+
if(((BaseAddress & 0xFFFFF) == 0) && ((Length & 0xFFFFF) == 0)) {
// Is the base and length a multiple of 1 MB?
DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));
--
2.7.4
next prev parent reply other threads:[~2017-02-15 17:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 17:11 [PATCH v2 0/4] ArmPkg: add groundwork for DXE image protection Ard Biesheuvel
2017-02-15 17:11 ` [PATCH v2 1/4] ArmPkg/CpuDxe: Correct EFI_MEMORY_RO usage Ard Biesheuvel
2017-02-15 17:11 ` [PATCH v2 2/4] ArmPkg/CpuDxe: translate invalid memory types in EfiAttributeToArmAttribute Ard Biesheuvel
2017-02-21 14:00 ` Leif Lindholm
2017-02-15 17:11 ` Ard Biesheuvel [this message]
2017-02-15 17:11 ` [PATCH v2 4/4] ArmPkg/ArmMmuLib: AARCH64: add support for modifying only permissions Ard Biesheuvel
2017-02-21 14:04 ` Leif Lindholm
2017-02-21 7:36 ` [PATCH v2 0/4] ArmPkg: add groundwork for DXE image protection Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487178716-24569-4-git-send-email-ard.biesheuvel@linaro.org \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox