summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
diff options
context:
space:
mode:
authorGirish Mahadevan <gmahadevan@nvidia.com>2023-01-30 16:28:58 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-02-09 17:34:32 +0000
commit289d93b79c18f42b9dd09770a22d15a11fd40670 (patch)
tree9e166471885a37b9b83044568f72b933c0a4bd16 /StandaloneMmPkg
parent173a7a7daaad560cd69e1000faca1d2b91774c46 (diff)
downloadedk2-289d93b79c18f42b9dd09770a22d15a11fd40670.tar.gz
edk2-289d93b79c18f42b9dd09770a22d15a11fd40670.tar.bz2
edk2-289d93b79c18f42b9dd09770a22d15a11fd40670.zip
StandaloneMmPkg/StandaloneMmMemLib: Change max address computation
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>
Diffstat (limited to 'StandaloneMmPkg')
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
index 297cfae916..fddcecf6da 100644
--- a/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
+++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
@@ -20,13 +20,6 @@
//
extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;
-#ifdef MDE_CPU_AARCH64
-#define ARM_PHYSICAL_ADDRESS_BITS 36
-#endif
-#ifdef MDE_CPU_ARM
-#define ARM_PHYSICAL_ADDRESS_BITS 32
-#endif
-
/**
Calculate and save the maximum support address.
@@ -36,14 +29,8 @@ MmMemLibInternalCalculateMaximumSupportAddress (
VOID
)
{
- UINT8 PhysicalAddressBits;
-
- PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS;
+ mMmMemLibInternalMaximumSupportAddress = MAX_ALLOC_ADDRESS;
- //
- // Save the maximum support address in one global variable
- //
- mMmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);
DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress));
}