summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
diff options
context:
space:
mode:
authorCheng Sun <chengx.sun@intel.com>2023-12-21 10:45:22 +0800
committerLiming Gao <gaoliming@byosoft.com.cn>2023-12-25 12:57:18 +0800
commit1065536c64ab919ad5c207e50b82d4a88ac29ed8 (patch)
tree01e64774357fb4d95bf7d39250f89f8e34e79b73 /MdeModulePkg/Core/Pei/Memory/MemoryServices.c
parentd01defe06b35eb3fe9c94e7b2e08a8762873f924 (diff)
downloadedk2-1065536c64ab919ad5c207e50b82d4a88ac29ed8.tar.gz
edk2-1065536c64ab919ad5c207e50b82d4a88ac29ed8.tar.bz2
edk2-1065536c64ab919ad5c207e50b82d4a88ac29ed8.zip
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>
Diffstat (limited to 'MdeModulePkg/Core/Pei/Memory/MemoryServices.c')
-rw-r--r--MdeModulePkg/Core/Pei/Memory/MemoryServices.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index 3b2e15699f..a30925da39 100644
--- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
+++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
@@ -167,46 +167,6 @@ MigrateMemoryPages (
}
/**
- 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.