]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmMmuLib: remove VirtualMask arg from ArmSetMemoryAttributes
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 1 Mar 2017 16:31:41 +0000 (16:31 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 7 Mar 2017 08:38:08 +0000 (09:38 +0100)
We no longer make use of the ArmMmuLib 'feature' to create aliased
memory ranges with mismatched attributes, and in fact, it was only
wired up in the ARM version to begin with.

So remove the VirtualMask argument from ArmSetMemoryAttributes()'s
prototype, and remove the dead code that referred to it.

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/CpuMmuCommon.c
ArmPkg/Include/Library/ArmMmuLib.h
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c

index d0a3fedd3aa7a6a27e9f000c31dae1a8f1a7e178..8150486217cf11a723c13c82c274d40d43a63aa1 100644 (file)
@@ -210,7 +210,7 @@ CpuSetMemoryAttributes (
   if (EFI_ERROR (Status) || (RegionArmAttributes != ArmAttributes) ||\r
       ((BaseAddress + Length) > (RegionBaseAddress + RegionLength)))\r
   {\r
-    return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes, 0);\r
+    return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes);\r
   } else {\r
     return EFI_SUCCESS;\r
   }\r
index d3a302fa8125550a13ce7d8364d3dcce5a403671..fb7fd006417cb6bc64d7304eeda05da14a2edd17 100644 (file)
@@ -66,8 +66,7 @@ EFI_STATUS
 ArmSetMemoryAttributes (\r
   IN EFI_PHYSICAL_ADDRESS      BaseAddress,\r
   IN UINT64                    Length,\r
-  IN UINT64                    Attributes,\r
-  IN EFI_PHYSICAL_ADDRESS      VirtualMask\r
+  IN UINT64                    Attributes\r
   );\r
 \r
 #endif\r
index 77f108971f3efd15ec789084dcd9936967bf16f8..8bd1c6fad95f7c57c19a5f66f963f73ce8a6eb0a 100644 (file)
@@ -450,8 +450,7 @@ EFI_STATUS
 ArmSetMemoryAttributes (\r
   IN EFI_PHYSICAL_ADDRESS      BaseAddress,\r
   IN UINT64                    Length,\r
-  IN UINT64                    Attributes,\r
-  IN EFI_PHYSICAL_ADDRESS      VirtualMask\r
+  IN UINT64                    Attributes\r
   )\r
 {\r
   EFI_STATUS                   Status;\r
index 8a472a1eb64b6597fd31441f65f071b6ef1a9f33..351b6c03a42c7593017a81727c38a304f0cb80a7 100644 (file)
@@ -471,7 +471,6 @@ UpdatePageEntries (
   IN  EFI_PHYSICAL_ADDRESS      BaseAddress,\r
   IN  UINT64                    Length,\r
   IN  UINT64                    Attributes,\r
-  IN  EFI_PHYSICAL_ADDRESS      VirtualMask,\r
   OUT BOOLEAN                   *FlushTlbs OPTIONAL\r
   )\r
 {\r
@@ -587,11 +586,6 @@ UpdatePageEntries (
     // Mask in new attributes and/or permissions\r
     PageTableEntry |= EntryValue;\r
 \r
-    if (VirtualMask != 0) {\r
-      // Make this virtual address point at a physical page\r
-      PageTableEntry &= ~VirtualMask;\r
-    }\r
-\r
     if (CurrentPageTableEntry  != PageTableEntry) {\r
       Mva = (VOID *)(UINTN)((((UINTN)FirstLevelIdx) << TT_DESCRIPTOR_SECTION_BASE_SHIFT) + (PageTableIndex << TT_DESCRIPTOR_PAGE_BASE_SHIFT));\r
 \r
@@ -619,8 +613,7 @@ EFI_STATUS
 UpdateSectionEntries (\r
   IN EFI_PHYSICAL_ADDRESS      BaseAddress,\r
   IN UINT64                    Length,\r
-  IN UINT64                    Attributes,\r
-  IN EFI_PHYSICAL_ADDRESS      VirtualMask\r
+  IN UINT64                    Attributes\r
   )\r
 {\r
   EFI_STATUS    Status = EFI_SUCCESS;\r
@@ -704,7 +697,6 @@ UpdateSectionEntries (
                  (FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT,\r
                  TT_DESCRIPTOR_SECTION_SIZE,\r
                  Attributes,\r
-                 VirtualMask,\r
                  NULL);\r
     } else {\r
       // still a section entry\r
@@ -714,9 +706,6 @@ UpdateSectionEntries (
 \r
       // mask in new attributes and/or permissions\r
       Descriptor |= EntryValue;\r
-      if (VirtualMask != 0) {\r
-        Descriptor &= ~VirtualMask;\r
-      }\r
 \r
       if (CurrentDescriptor  != Descriptor) {\r
         Mva = (VOID *)(UINTN)(((UINTN)FirstLevelTable) << TT_DESCRIPTOR_SECTION_BASE_SHIFT);\r
@@ -743,8 +732,7 @@ EFI_STATUS
 ArmSetMemoryAttributes (\r
   IN EFI_PHYSICAL_ADDRESS      BaseAddress,\r
   IN UINT64                    Length,\r
-  IN UINT64                    Attributes,\r
-  IN EFI_PHYSICAL_ADDRESS      VirtualMask\r
+  IN UINT64                    Attributes\r
   )\r
 {\r
   EFI_STATUS    Status;\r
@@ -766,8 +754,7 @@ ArmSetMemoryAttributes (
         "SetMemoryAttributes(): MMU section 0x%lx length 0x%lx to %lx\n",\r
         BaseAddress, ChunkLength, Attributes));\r
 \r
-      Status = UpdateSectionEntries (BaseAddress, ChunkLength, Attributes,\r
-                 VirtualMask);\r
+      Status = UpdateSectionEntries (BaseAddress, ChunkLength, Attributes);\r
 \r
       FlushTlbs = TRUE;\r
     } else {\r
@@ -787,7 +774,7 @@ ArmSetMemoryAttributes (
         BaseAddress, ChunkLength, Attributes));\r
 \r
       Status = UpdatePageEntries (BaseAddress, ChunkLength, Attributes,\r
-                 VirtualMask, &FlushTlbs);\r
+                 &FlushTlbs);\r
     }\r
 \r
     if (EFI_ERROR (Status)) {\r