]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuDxe: ARM: ignore page table updates that only change permissions
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 15 Feb 2017 17:11:55 +0000 (17:11 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 21 Feb 2017 17:23:03 +0000 (17:23 +0000)
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

index b6ba975b353ab66540457d9b1a49d00db8f44319..89e429925ba92cf0ef6da7ea8eb9cd5135b2b5ce 100644 (file)
@@ -680,6 +680,13 @@ SetMemoryAttributes (
 {\r
   EFI_STATUS    Status;\r
 \r
+  //\r
+  // Ignore invocations that only modify permission bits\r
+  //\r
+  if ((Attributes & EFI_MEMORY_CACHETYPE_MASK) == 0) {\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
   if(((BaseAddress & 0xFFFFF) == 0) && ((Length & 0xFFFFF) == 0)) {\r
     // Is the base and length a multiple of 1 MB?\r
     DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r