]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c
ArmVirtPkg/ArmVirtPlatformLib: reduce ID map size to GCD region size
[mirror_edk2.git] / ArmVirtPkg / Library / ArmVirtPlatformLib / VirtMem.c
index 530f7d608e0b589fd780728157cd8404a2533247..e5536ecd8e286a7d93319a785e12f2db6c60ed3a 100644 (file)
@@ -97,7 +97,9 @@ ArmPlatformGetVirtualMemoryMap (
   // Peripheral space after DRAM\r
   VirtualMemoryTable[2].PhysicalBase = VirtualMemoryTable[0].Length + VirtualMemoryTable[1].Length;\r
   VirtualMemoryTable[2].VirtualBase  = VirtualMemoryTable[2].PhysicalBase;\r
-  VirtualMemoryTable[2].Length       = ArmGetPhysAddrTop () - VirtualMemoryTable[2].PhysicalBase;\r
+  VirtualMemoryTable[2].Length       = MIN (1ULL << FixedPcdGet8 (PcdPrePiCpuMemorySize),\r
+                                         ArmGetPhysAddrTop ()) -\r
+                                       VirtualMemoryTable[2].PhysicalBase;\r
   VirtualMemoryTable[2].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
 \r
   // Remap the FD region as normal executable memory\r