]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
ArmPkg/ArmMmuLib: base page table VA size on GCD memory map size
[mirror_edk2.git] / ArmPkg / Library / ArmMmuLib / AArch64 / ArmMmuLibCore.c
index 57e789f68b3b7527e495fc6d81be4dfa4153ca50..1fb3bbec6347852bdf2e3c5d392e6e98f77dc463 100644 (file)
@@ -555,9 +555,7 @@ ArmConfigureMmu (
   VOID*                         TranslationTable;\r
   VOID*                         TranslationTableBuffer;\r
   UINT32                        TranslationTableAttribute;\r
-  ARM_MEMORY_REGION_DESCRIPTOR *MemoryTableEntry;\r
   UINT64                        MaxAddress;\r
-  UINT64                        TopAddress;\r
   UINTN                         T0SZ;\r
   UINTN                         RootTableEntryCount;\r
   UINTN                         RootTableEntrySize;\r
@@ -569,16 +567,8 @@ ArmConfigureMmu (
     return RETURN_INVALID_PARAMETER;\r
   }\r
 \r
-  // Identify the highest address of the memory table\r
-  MaxAddress = MemoryTable->PhysicalBase + MemoryTable->Length - 1;\r
-  MemoryTableEntry = MemoryTable;\r
-  while (MemoryTableEntry->Length != 0) {\r
-    TopAddress = MemoryTableEntry->PhysicalBase + MemoryTableEntry->Length - 1;\r
-    if (TopAddress > MaxAddress) {\r
-      MaxAddress = TopAddress;\r
-    }\r
-    MemoryTableEntry++;\r
-  }\r
+  // Cover the entire GCD memory space\r
+  MaxAddress = (1UL << PcdGet8 (PcdPrePiCpuMemorySize)) - 1;\r
 \r
   // Lookup the Table Level to get the information\r
   LookupAddresstoRootTable (MaxAddress, &T0SZ, &RootTableEntryCount);\r