]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StandaloneMmPkg/StandaloneMmMemLib: Change max address computation
authorGirish Mahadevan <gmahadevan@nvidia.com>
Mon, 30 Jan 2023 16:28:58 +0000 (16:28 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Feb 2023 17:34:32 +0000 (17:34 +0000)
Currently the standalonemmlibinternal assumes the max physical bits
to be 36 which is causing issues on v8 architectures.
Instead use the MAX_ALLOC_ADDRESS macro to determine the maximum
allowed address rather than recomputing it locally.

Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c

index 297cfae916a02826caf1dd965a1866e540954b2d..fddcecf6da3bb1c668da873bb8bf34ebfad0dcf8 100644 (file)
 //\r
 extern EFI_PHYSICAL_ADDRESS  mMmMemLibInternalMaximumSupportAddress;\r
 \r
-#ifdef MDE_CPU_AARCH64\r
-#define ARM_PHYSICAL_ADDRESS_BITS  36\r
-#endif\r
-#ifdef MDE_CPU_ARM\r
-#define ARM_PHYSICAL_ADDRESS_BITS  32\r
-#endif\r
-\r
 /**\r
   Calculate and save the maximum support address.\r
 \r
@@ -36,14 +29,8 @@ MmMemLibInternalCalculateMaximumSupportAddress (
   VOID\r
   )\r
 {\r
-  UINT8  PhysicalAddressBits;\r
-\r
-  PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS;\r
+  mMmMemLibInternalMaximumSupportAddress = MAX_ALLOC_ADDRESS;\r
 \r
-  //\r
-  // Save the maximum support address in one global variable\r
-  //\r
-  mMmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);\r
   DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress));\r
 }\r
 \r