]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PeiCore: Remove MigrateSecModulesInFv()
authorMichael Kubacki <michael.kubacki@microsoft.com>
Fri, 13 Aug 2021 20:01:32 +0000 (04:01 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 27 Aug 2021 08:32:20 +0000 (08:32 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3564

This function has not been called since it was added in commit
9bedaec. If the function were to remain, it would need to be
re-evaluated and tested. This change removes the function since
it is not being used.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Cc: Marvin H?user <mhaeuser@posteo.de>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c

index 3369585bcce82a4af3ec29db1a8b466885c0db97..61d4b67c64b9ae3298f74c3ac7638ef22d8c1959 100644 (file)
@@ -1057,102 +1057,6 @@ ConvertStatusCodeCallbacks (
   }\r
 }\r
 \r
   }\r
 }\r
 \r
-/**\r
-  Migrates SEC modules in the given firmware volume.\r
-\r
-  Migrating SECURITY_CORE files requires special treatment since they are not tracked for PEI dispatch.\r
-\r
-  This functioun should be called after the FV has been copied to its post-memory location and the PEI Core FV list has\r
-  been updated.\r
-\r
-  @param Private          Pointer to the PeiCore's private data structure.\r
-  @param FvIndex          The firmware volume index to migrate.\r
-  @param OrgFvHandle      The handle to the firmware volume in temporary memory.\r
-\r
-  @retval   EFI_SUCCESS           SEC modules were migrated successfully\r
-  @retval   EFI_INVALID_PARAMETER The Private pointer is NULL or FvCount is invalid.\r
-  @retval   EFI_NOT_FOUND         Can't find valid FFS header.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-MigrateSecModulesInFv (\r
-  IN PEI_CORE_INSTANCE    *Private,\r
-  IN  UINTN               FvIndex,\r
-  IN  UINTN               OrgFvHandle\r
-  )\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_STATUS                  FindFileStatus;\r
-  EFI_PEI_FILE_HANDLE         MigratedFileHandle;\r
-  EFI_PEI_FILE_HANDLE         FileHandle;\r
-  UINT32                      SectionAuthenticationStatus;\r
-  UINT32                      FileSize;\r
-  VOID                        *OrgPe32SectionData;\r
-  VOID                        *Pe32SectionData;\r
-  EFI_FFS_FILE_HEADER         *FfsFileHeader;\r
-  EFI_COMMON_SECTION_HEADER   *Section;\r
-  BOOLEAN                     IsFfs3Fv;\r
-  UINTN                       SectionInstance;\r
-\r
-  if (Private == NULL || FvIndex >= Private->FvCount) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  do {\r
-    FindFileStatus =  PeiFfsFindNextFile (\r
-                        GetPeiServicesTablePointer (),\r
-                        EFI_FV_FILETYPE_SECURITY_CORE,\r
-                        Private->Fv[FvIndex].FvHandle,\r
-                        &MigratedFileHandle\r
-                        );\r
-    if (!EFI_ERROR (FindFileStatus ) && MigratedFileHandle != NULL) {\r
-      FileHandle = (EFI_PEI_FILE_HANDLE) ((UINTN) MigratedFileHandle - (UINTN) Private->Fv[FvIndex].FvHandle + OrgFvHandle);\r
-      FfsFileHeader = (EFI_FFS_FILE_HEADER *) MigratedFileHandle;\r
-\r
-      DEBUG ((DEBUG_VERBOSE, "    Migrating SEC_CORE MigratedFileHandle at 0x%x.\n", (UINTN) MigratedFileHandle));\r
-      DEBUG ((DEBUG_VERBOSE, "                       FileHandle at 0x%x.\n", (UINTN) FileHandle));\r
-\r
-      IsFfs3Fv = CompareGuid (&Private->Fv[FvIndex].FvHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid);\r
-      if (IS_FFS_FILE2 (FfsFileHeader)) {\r
-        ASSERT (FFS_FILE2_SIZE (FfsFileHeader) > 0x00FFFFFF);\r
-        if (!IsFfs3Fv) {\r
-          DEBUG ((DEBUG_ERROR, "It is a FFS3 formatted file: %g in a non-FFS3 formatted FV.\n", &FfsFileHeader->Name));\r
-          return EFI_NOT_FOUND;\r
-        }\r
-        Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER2));\r
-        FileSize = FFS_FILE2_SIZE (FfsFileHeader) - sizeof (EFI_FFS_FILE_HEADER2);\r
-      } else {\r
-        Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER));\r
-        FileSize = FFS_FILE_SIZE (FfsFileHeader) - sizeof (EFI_FFS_FILE_HEADER);\r
-      }\r
-\r
-      SectionInstance = 1;\r
-      SectionAuthenticationStatus = 0;\r
-      Status = ProcessSection (\r
-                GetPeiServicesTablePointer (),\r
-                EFI_SECTION_PE32,\r
-                &SectionInstance,\r
-                Section,\r
-                FileSize,\r
-                &Pe32SectionData,\r
-                &SectionAuthenticationStatus,\r
-                IsFfs3Fv\r
-                );\r
-\r
-      if (!EFI_ERROR (Status)) {\r
-        OrgPe32SectionData = (VOID *) ((UINTN) Pe32SectionData - (UINTN) MigratedFileHandle + (UINTN) FileHandle);\r
-        DEBUG ((DEBUG_VERBOSE, "      PE32 section in migrated file at 0x%x.\n", (UINTN) Pe32SectionData));\r
-        DEBUG ((DEBUG_VERBOSE, "      PE32 section in original file at 0x%x.\n", (UINTN) OrgPe32SectionData));\r
-        Status = LoadAndRelocatePeCoffImageInPlace (OrgPe32SectionData, Pe32SectionData);\r
-        ASSERT_EFI_ERROR (Status);\r
-      }\r
-    }\r
-  } while (!EFI_ERROR (FindFileStatus));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   Migrates PEIMs in the given firmware volume.\r
 \r
 /**\r
   Migrates PEIMs in the given firmware volume.\r
 \r