diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index ad77481b3b..e3a63cc12b 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -1038,6 +1038,7 @@ ProcessPpiListFromSec ( EFI_STATUS Status; EFI_SEC_HOB_DATA_PPI *SecHobDataPpi; EFI_HOB_GENERIC_HEADER *SecHobList; + PEI_CORE_INSTANCE *PrivateData; for ( ; ;) { if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) != 0) { @@ -1052,6 +1053,15 @@ ProcessPpiListFromSec ( // Status = InternalPeiInstallPpi (PeiServices, PpiList, TRUE); ASSERT_EFI_ERROR (Status); + + // + // Set the PeiMemoryInstalled flag if SEC passed MemoryDiscoveredPpi, so the PEI runs in + // physical memory. + // + if (CompareGuid (PpiList->Guid, &gEfiPeiMemoryDiscoveredPpiGuid)) { + PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices); + PrivateData->PeiMemoryInstalled = TRUE; + } } if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) {