public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	Michael Kubacki <michael.kubacki@microsoft.com>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
	"Bi, Dandan" <dandan.bi@intel.com>,
	"Liming Gao" <gaoliming@byosoft.com.cn>,
	"De, Debkumar" <debkumar.de@intel.com>,
	"Han, Harry" <harry.han@intel.com>,
	"West, Catharine" <catharine.west@intel.com>,
	"Marvin Häuser" <mhaeuser@posteo.de>
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/PeiCore: Remove MigrateSecModulesInFv()
Date: Fri, 27 Aug 2021 08:34:05 +0000	[thread overview]
Message-ID: <BN8PR11MB366668278FE1BEA78D199057CAC89@BN8PR11MB3666.namprd11.prod.outlook.com> (raw)
In-Reply-To: <BN8PR11MB3666EF76E7AA65C91AEE694CCAC19@BN8PR11MB3666.namprd11.prod.outlook.com>

Pushed via:
PR - https://github.com/tianocore/edk2/pull/1913
Commit - https://github.com/tianocore/edk2/commit/82f7e315d612399f65a3bedd3b2c0364b43b6929

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Wu, Hao
> A
> Sent: Friday, August 20, 2021 1:08 PM
> To: Michael Kubacki <michael.kubacki@microsoft.com>;
> devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Bi, Dandan
> <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; De,
> Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>;
> West, Catharine <catharine.west@intel.com>; Marvin Häuser
> <mhaeuser@posteo.de>
> Subject: Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/PeiCore: Remove
> MigrateSecModulesInFv()
> 
> > -----Original Message-----
> > From: Michael Kubacki <michael.kubacki@microsoft.com>
> > Sent: Saturday, August 14, 2021 4:02 AM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A
> <hao.a.wu@intel.com>;
> > Bi, Dandan <dandan.bi@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; De, Debkumar <debkumar.de@intel.com>;
> > Han, Harry <harry.han@intel.com>; West, Catharine
> > <catharine.west@intel.com>; Marvin Häuser <mhaeuser@posteo.de>
> > Subject: [PATCH v1 1/1] MdeModulePkg/PeiCore: Remove
> > MigrateSecModulesInFv()
> >
> > 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.
> 
> 
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> Will merge after the upcoming stable tag.
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > 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>
> > ---
> >  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 (
> >    }
> >  }
> >
> > -/**
> > -  Migrates SEC modules in the given firmware volume.
> > -
> > -  Migrating SECURITY_CORE files requires special treatment since they are
> > not tracked for PEI dispatch.
> > -
> > -  This functioun should be called after the FV has been copied to its post-
> > memory location and the PEI Core FV list has
> > -  been updated.
> > -
> > -  @param Private          Pointer to the PeiCore's private data structure.
> > -  @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 == NULL || FvIndex >= Private->FvCount) {
> > -    return EFI_INVALID_PARAMETER;
> > -  }
> > -
> > -  do {
> > -    FindFileStatus =  PeiFfsFindNextFile (
> > -                        GetPeiServicesTablePointer (),
> > -                        EFI_FV_FILETYPE_SECURITY_CORE,
> > -                        Private->Fv[FvIndex].FvHandle,
> > -                        &MigratedFileHandle
> > -                        );
> > -    if (!EFI_ERROR (FindFileStatus ) && MigratedFileHandle != NULL) {
> > -      FileHandle = (EFI_PEI_FILE_HANDLE) ((UINTN) MigratedFileHandle -
> > (UINTN) Private->Fv[FvIndex].FvHandle + OrgFvHandle);
> > -      FfsFileHeader = (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 = CompareGuid (&Private->Fv[FvIndex].FvHeader-
> > >FileSystemGuid, &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 = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *)
> > FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER2));
> > -        FileSize = FFS_FILE2_SIZE (FfsFileHeader) - sizeof
> > (EFI_FFS_FILE_HEADER2);
> > -      } else {
> > -        Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *)
> > FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER));
> > -        FileSize = FFS_FILE_SIZE (FfsFileHeader) - sizeof
> (EFI_FFS_FILE_HEADER);
> > -      }
> > -
> > -      SectionInstance = 1;
> > -      SectionAuthenticationStatus = 0;
> > -      Status = ProcessSection (
> > -                GetPeiServicesTablePointer (),
> > -                EFI_SECTION_PE32,
> > -                &SectionInstance,
> > -                Section,
> > -                FileSize,
> > -                &Pe32SectionData,
> > -                &SectionAuthenticationStatus,
> > -                IsFfs3Fv
> > -                );
> > -
> > -      if (!EFI_ERROR (Status)) {
> > -        OrgPe32SectionData = (VOID *) ((UINTN) Pe32SectionData - (UINTN)
> > MigratedFileHandle + (UINTN) FileHandle);
> > -        DEBUG ((DEBUG_VERBOSE, "      PE32 section in migrated file at
> 0x%x.\n",
> > (UINTN) Pe32SectionData));
> > -        DEBUG ((DEBUG_VERBOSE, "      PE32 section in original file at 0x%x.\n",
> > (UINTN) OrgPe32SectionData));
> > -        Status = LoadAndRelocatePeCoffImageInPlace (OrgPe32SectionData,
> > Pe32SectionData);
> > -        ASSERT_EFI_ERROR (Status);
> > -      }
> > -    }
> > -  } while (!EFI_ERROR (FindFileStatus));
> > -
> > -  return EFI_SUCCESS;
> > -}
> > -
> >  /**
> >    Migrates PEIMs in the given firmware volume.
> >
> > --
> > 2.29.2.windows.2
> 
> 
> 
> 
> 


      reply	other threads:[~2021-08-27  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 20:01 [PATCH v1 1/1] MdeModulePkg/PeiCore: Remove MigrateSecModulesInFv() Michael Kubacki
2021-08-20  5:07 ` Wu, Hao A
2021-08-27  8:34   ` Wu, Hao A [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN8PR11MB366668278FE1BEA78D199057CAC89@BN8PR11MB3666.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox