diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core/StandaloneMmCore.c index 6bdb30f954..c1281ca8d4 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.c +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c @@ -669,9 +669,12 @@ StandaloneMmMain ( // // Extract the MMRAM ranges from the MMRAM descriptor HOB // - MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart); + MmramRangesHob = GetNextGuidHob (&gEfiSmmSmramMemoryGuid, HobStart); if (MmramRangesHob == NULL) { - return EFI_UNSUPPORTED; + MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart); + if (MmramRangesHob == NULL) { + return EFI_UNSUPPORTED; + } } MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob); diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf index 0073f51894..a6fafa5690 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf @@ -76,6 +76,7 @@ gEfiEventExitBootServicesGuid gEfiEventReadyToBootGuid gMmCommBufferHobGuid + gEfiSmmSmramMemoryGuid [Pcd] gStandaloneMmPkgTokenSpaceGuid.PcdFwVolMmMaxEncapsulationDepth ##CONSUMES diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c index afced78cde..cd27fc5965 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c @@ -857,9 +857,12 @@ MemoryAllocationLibConstructor ( // // Search for a Hob containing the MMRAM ranges // - MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart); + MmramRangesHob = GetNextGuidHob (&gEfiSmmSmramMemoryGuid, HobStart); if (MmramRangesHob == NULL) { - return EFI_UNSUPPORTED; + MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart); + if (MmramRangesHob == NULL) { + return EFI_UNSUPPORTED; + } } MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob); diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf index bf7530bb74..2848c4b0c7 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf @@ -42,3 +42,4 @@ [Guids] gEfiMmPeiMmramMemoryReserveGuid + gEfiSmmSmramMemoryGuid diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf index 696b8e0689..a748af5ea5 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf @@ -52,3 +52,4 @@ [Guids] gEfiMmPeiMmramMemoryReserveGuid ## SOMETIMES_CONSUMES ## HOB + gEfiSmmSmramMemoryGuid ## SOMETIMES_CONSUMES ## HOB diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c index c8ffe43cd1..19e1736ae1 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c @@ -96,9 +96,12 @@ MmMemLibInternalPopulateMmramRanges ( // // Search for a Hob containing the MMRAM ranges // - MmramRangesHob = GetFirstGuidHob (&gEfiMmPeiMmramMemoryReserveGuid); + MmramRangesHob = GetFirstGuidHob (&gEfiSmmSmramMemoryGuid); if (MmramRangesHob == NULL) { - return EFI_UNSUPPORTED; + MmramRangesHob = GetFirstGuidHob (&gEfiMmPeiMmramMemoryReserveGuid); + if (MmramRangesHob == NULL) { + return EFI_UNSUPPORTED; + } } MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);