From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.41726.1628884905035762765 for ; Fri, 13 Aug 2021 13:01:45 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 spf-a.hotmail.com}: limit exceeded (domain: microsoft.com, ip: 13.77.154.182, mailfrom: michael.kubacki@microsoft.com) Received: from localhost.localdomain (c-73-27-179-174.hsd1.fl.comcast.net [73.27.179.174]) by linux.microsoft.com (Postfix) with ESMTPSA id 4D19B20BE693; Fri, 13 Aug 2021 13:01:43 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4D19B20BE693 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao , Debkumar De , Harry Han , Catharine West , =?UTF-8?q?Marvin=20H=C3=A4user?= Subject: [PATCH v1 1/1] MdeModulePkg/PeiCore: Remove MigrateSecModulesInFv() Date: Fri, 13 Aug 2021 16:01:32 -0400 Message-Id: <20210813200132.1778-1-michael.kubacki@microsoft.com> X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3564 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 Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Debkumar De Cc: Harry Han Cc: Catharine West Cc: Marvin H=C3=A4user Signed-off-by: Michael Kubacki --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 96 -------------------- 1 file changed, 96 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg= /Core/Pei/Dispatcher/Dispatcher.c index 3369585bcce8..61d4b67c64b9 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -1057,102 +1057,6 @@ ConvertStatusCodeCallbacks ( } } =20 -/** - Migrates SEC modules in the given firmware volume. - - Migrating SECURITY_CORE files requires special treatment since they ar= e not tracked for PEI dispatch. - - This functioun should be called after the FV has been copied to its po= st-memory location and the PEI Core FV list has - been updated. - - @param Private Pointer to the PeiCore's private data structur= e. - @param FvIndex The firmware volume index to migrate. - @param OrgFvHandle The handle to the firmware volume in temporary= memory. - - @retval EFI_SUCCESS SEC modules were migrated successfully - @retval EFI_INVALID_PARAMETER The Private pointer is NULL or FvCount= is invalid. - @retval EFI_NOT_FOUND Can't find valid FFS header. - -**/ -EFI_STATUS -EFIAPI -MigrateSecModulesInFv ( - IN PEI_CORE_INSTANCE *Private, - IN UINTN FvIndex, - IN UINTN OrgFvHandle - ) -{ - EFI_STATUS Status; - EFI_STATUS FindFileStatus; - EFI_PEI_FILE_HANDLE MigratedFileHandle; - EFI_PEI_FILE_HANDLE FileHandle; - UINT32 SectionAuthenticationStatus; - UINT32 FileSize; - VOID *OrgPe32SectionData; - VOID *Pe32SectionData; - EFI_FFS_FILE_HEADER *FfsFileHeader; - EFI_COMMON_SECTION_HEADER *Section; - BOOLEAN IsFfs3Fv; - UINTN SectionInstance; - - if (Private =3D=3D NULL || FvIndex >=3D Private->FvCount) { - return EFI_INVALID_PARAMETER; - } - - do { - FindFileStatus =3D PeiFfsFindNextFile ( - GetPeiServicesTablePointer (), - EFI_FV_FILETYPE_SECURITY_CORE, - Private->Fv[FvIndex].FvHandle, - &MigratedFileHandle - ); - if (!EFI_ERROR (FindFileStatus ) && MigratedFileHandle !=3D NULL) { - FileHandle =3D (EFI_PEI_FILE_HANDLE) ((UINTN) MigratedFileHandle -= (UINTN) Private->Fv[FvIndex].FvHandle + OrgFvHandle); - FfsFileHeader =3D (EFI_FFS_FILE_HEADER *) MigratedFileHandle; - - DEBUG ((DEBUG_VERBOSE, " Migrating SEC_CORE MigratedFileHandle = at 0x%x.\n", (UINTN) MigratedFileHandle)); - DEBUG ((DEBUG_VERBOSE, " FileHandle at 0x%x.= \n", (UINTN) FileHandle)); - - IsFfs3Fv =3D CompareGuid (&Private->Fv[FvIndex].FvHeader->FileSyst= emGuid, &gEfiFirmwareFileSystem3Guid); - if (IS_FFS_FILE2 (FfsFileHeader)) { - ASSERT (FFS_FILE2_SIZE (FfsFileHeader) > 0x00FFFFFF); - if (!IsFfs3Fv) { - DEBUG ((DEBUG_ERROR, "It is a FFS3 formatted file: %g in a non= -FFS3 formatted FV.\n", &FfsFileHeader->Name)); - return EFI_NOT_FOUND; - } - Section =3D (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) FfsFileHead= er + sizeof (EFI_FFS_FILE_HEADER2)); - FileSize =3D FFS_FILE2_SIZE (FfsFileHeader) - sizeof (EFI_FFS_FI= LE_HEADER2); - } else { - Section =3D (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) FfsFileHead= er + sizeof (EFI_FFS_FILE_HEADER)); - FileSize =3D FFS_FILE_SIZE (FfsFileHeader) - sizeof (EFI_FFS_FIL= E_HEADER); - } - - SectionInstance =3D 1; - SectionAuthenticationStatus =3D 0; - Status =3D ProcessSection ( - GetPeiServicesTablePointer (), - EFI_SECTION_PE32, - &SectionInstance, - Section, - FileSize, - &Pe32SectionData, - &SectionAuthenticationStatus, - IsFfs3Fv - ); - - if (!EFI_ERROR (Status)) { - OrgPe32SectionData =3D (VOID *) ((UINTN) Pe32SectionData - (UINT= N) MigratedFileHandle + (UINTN) FileHandle); - DEBUG ((DEBUG_VERBOSE, " PE32 section in migrated file at 0= x%x.\n", (UINTN) Pe32SectionData)); - DEBUG ((DEBUG_VERBOSE, " PE32 section in original file at 0= x%x.\n", (UINTN) OrgPe32SectionData)); - Status =3D LoadAndRelocatePeCoffImageInPlace (OrgPe32SectionData= , Pe32SectionData); - ASSERT_EFI_ERROR (Status); - } - } - } while (!EFI_ERROR (FindFileStatus)); - - return EFI_SUCCESS; -} - /** Migrates PEIMs in the given firmware volume. =20 --=20 2.29.2.windows.2