MdeModulePkg: Support customized FV Migration Information
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4533 There are use cases which not all FVs need be migrated from TempRam to permanent memory before TempRam tears down. This new guid is introduced to avoid unnecessary FV migration to improve boot performance. Platform can publish MigrationInfo hob with this guid to customize FV migration info, and PeiCore will only migrate FVs indicated by this Hob info. This is a backwards compatible change, PeiCore will check MigrationInfo hob before migration. If MigrationInfo hobs exists, only migrate FVs recorded by hobs. If MigrationInfo hobs not exists, migrate all FVs to permanent memory. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Cheng Sun <chengx.sun@intel.com>
This commit is contained in:
@@ -166,46 +166,6 @@ MigrateMemoryPages (
|
||||
Private->FreePhysicalMemoryTop = NewMemPagesBase;
|
||||
}
|
||||
|
||||
/**
|
||||
Removes any FV HOBs whose base address is not in PEI installed memory.
|
||||
|
||||
@param[in] Private Pointer to PeiCore's private data structure.
|
||||
|
||||
**/
|
||||
VOID
|
||||
RemoveFvHobsInTemporaryMemory (
|
||||
IN PEI_CORE_INSTANCE *Private
|
||||
)
|
||||
{
|
||||
EFI_PEI_HOB_POINTERS Hob;
|
||||
EFI_HOB_FIRMWARE_VOLUME *FirmwareVolumeHob;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "Removing FVs in FV HOB not already migrated to permanent memory.\n"));
|
||||
|
||||
for (Hob.Raw = GetHobList (); !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
|
||||
if ((GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) || (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) || (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV3)) {
|
||||
FirmwareVolumeHob = Hob.FirmwareVolume;
|
||||
DEBUG ((DEBUG_INFO, " Found FV HOB.\n"));
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
" BA=%016lx L=%016lx\n",
|
||||
FirmwareVolumeHob->BaseAddress,
|
||||
FirmwareVolumeHob->Length
|
||||
));
|
||||
if (
|
||||
!(
|
||||
((EFI_PHYSICAL_ADDRESS)(UINTN)FirmwareVolumeHob->BaseAddress >= Private->PhysicalMemoryBegin) &&
|
||||
(((EFI_PHYSICAL_ADDRESS)(UINTN)FirmwareVolumeHob->BaseAddress + (FirmwareVolumeHob->Length - 1)) < Private->FreePhysicalMemoryTop)
|
||||
)
|
||||
)
|
||||
{
|
||||
DEBUG ((DEBUG_INFO, " Removing FV HOB to an FV in T-RAM (was not migrated).\n"));
|
||||
Hob.Header->HobType = EFI_HOB_TYPE_UNUSED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Migrate the base address in firmware volume allocation HOBs
|
||||
from temporary memory to PEI installed memory.
|
||||
|
Reference in New Issue
Block a user