From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D0AA8202E5324 for ; Wed, 13 Feb 2019 01:33:59 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2019 01:33:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,365,1544515200"; d="scan'208";a="114553978" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga007.jf.intel.com with ESMTP; 13 Feb 2019 01:33:58 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Feb 2019 01:33:58 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Feb 2019 01:33:58 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.207]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.110]) with mapi id 14.03.0415.000; Wed, 13 Feb 2019 17:33:56 +0800 From: "Zeng, Star" To: "Chiu, Chasel" , "Wang, Jian J" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , "Ni, Ray" , "Gao, Liming" , "Zeng, Star" Thread-Topic: [PATCH 2/3] MdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCATION_PPI Thread-Index: AQHUwtXMiTCoNeyBe0uy1ZNDqhobYqXcZwUAgAAuDICAAOOe8A== Date: Wed, 13 Feb 2019 09:33:55 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483104026940F@shsmsx102.ccr.corp.intel.com> References: <20190212131957.2576-1-chasel.chiu@intel.com> <20190212131957.2576-3-chasel.chiu@intel.com> <3C3EFB470A303B4AB093197B6777CCEC502608A8@PGSMSX111.gar.corp.intel.com> In-Reply-To: <3C3EFB470A303B4AB093197B6777CCEC502608A8@PGSMSX111.gar.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/3] MdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCATION_PPI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2019 09:34:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable With this addressed, Reviewed-by: Star Zeng . -----Original Message----- From: Chiu, Chasel=20 Sent: Wednesday, February 13, 2019 11:59 AM To: Wang, Jian J ; edk2-devel@lists.01.org Cc: Wu, Hao A ; Ni, Ray ; Zeng, Star = ; Gao, Liming Subject: RE: [PATCH 2/3] MdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCA= TION_PPI No issue, I will remove UINT32 casting. Thanks! > -----Original Message----- > From: Wang, Jian J > Sent: Wednesday, February 13, 2019 9:14 AM > To: Chiu, Chasel ; edk2-devel@lists.01.org > Cc: Wu, Hao A ; Ni, Ray ; Zeng,=20 > Star ; Gao, Liming > Subject: RE: [PATCH 2/3] MdeModulePkg/PeiMain: Support=20 > EFI_PEI_CORE_FV_LOCATION_PPI >=20 > Chasel, >=20 >=20 > > -----Original Message----- > > From: Chiu, Chasel > > Sent: Tuesday, February 12, 2019 9:20 PM > > To: edk2-devel@lists.01.org > > Cc: Wang, Jian J ; Wu, Hao A=20 > > ; Ni, Ray ; Zeng, Star=20 > > ; Gao, Liming ; Chiu,=20 > > Chasel > > Subject: [PATCH 2/3] MdeModulePkg/PeiMain: Support=20 > > EFI_PEI_CORE_FV_LOCATION_PPI > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1524 > > > > When shadowing PeiCore the EFI_PEI_CORE_FV_LOCATION_PPI should be=20 > > checked to see if PeiCore not in BFV, otherwise just shadowing=20 > > PeiCore from BFV. > > > > Test: Verified on internal platform and booting successfully. > > > > Cc: Jian J Wang > > Cc: Hao Wu > > Cc: Ray Ni > > Cc: Star Zeng > > Cc: Liming Gao > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Chasel Chiu > > --- > > MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 58 > > +++++++++++++++++++++++++++++++++++++++++++++------------- > > MdeModulePkg/Core/Pei/PeiMain.h | 3 ++- > > MdeModulePkg/Core/Pei/PeiMain.inf | 3 ++- > > 3 files changed, 49 insertions(+), 15 deletions(-) > > > > diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c > > b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c > > index 4da80a8222..408f24c216 100644 > > --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c > > +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c > > @@ -1,7 +1,7 @@ > > /** @file > > Pei Core Main Entry Point > > > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights=20 > > reserved.
> > +Copyright (c) 2006 - 2019, Intel Corporation. All rights=20 > > +reserved.
> > This program and the accompanying materials are licensed and made=20 > > available under the terms and conditions of the BSD License which=20 > > accompanies this distribution. The full text of the license may be=20 > > found at @@ -80,23 +80,55 @@ ShadowPeiCore ( > > IN PEI_CORE_INSTANCE *PrivateData > > ) > > { > > - EFI_PEI_FILE_HANDLE PeiCoreFileHandle; > > - EFI_PHYSICAL_ADDRESS EntryPoint; > > - EFI_STATUS Status; > > - UINT32 AuthenticationState; > > + EFI_PEI_FILE_HANDLE PeiCoreFileHandle; > > + EFI_PHYSICAL_ADDRESS EntryPoint; > > + EFI_STATUS Status; > > + UINT32 AuthenticationState; > > + UINTN Index; > > + EFI_PEI_CORE_FV_LOCATION_PPI *PeiCoreFvLocationPpi; > > > > PeiCoreFileHandle =3D NULL; > > > > // > > - // Find the PEI Core in the BFV > > + // Find the PEI Core either from EFI_PEI_CORE_FV_LOCATION_PPI=20 > > + indicated > > FV or BFV > > // > > - Status =3D PrivateData->Fv[0].FvPpi->FindFileByType ( > > - PrivateData->Fv[0].FvPpi, > > - EFI_FV_FILETYPE_PEI_CORE, > > - PrivateData->Fv[0].FvHandle, > > - &PeiCoreFileHandle > > - ); > > - ASSERT_EFI_ERROR (Status); > > + Status =3D PeiServicesLocatePpi ( > > + &gEfiPeiCoreFvLocationPpiGuid, > > + 0, > > + NULL, > > + (VOID **) &PeiCoreFvLocationPpi > > + ); > > + if (!EFI_ERROR (Status) &&=20 > > + (PeiCoreFvLocationPpi->PeiCoreFvLocation > > + !=3D > > NULL)) { > > + // > > + // If PeiCoreFvLocation present, the PEI Core should be found=20 > > + from indicated > > FV. > > + // > > + for (Index =3D 0; Index < PrivateData->FvCount; Index ++) { > > + if ((UINT32) PrivateData->Fv[Index].FvHandle !=3D (UINT32) > > PeiCoreFvLocationPpi->PeiCoreFvLocation) { >=20 > I think the UINT32 type cast is not necessary. FvHandle and=20 > PeiCoreFvLocation are actually type of VOID*. Do you encounter any compil= er error here? >=20 > Regards, > Jian >=20 > > + continue; > > + } > > + Status =3D PrivateData->Fv[Index].FvPpi->FindFileByType ( > > + PrivateData->Fv[Index].= FvPpi, > > + EFI_FV_FILETYPE_PEI_COR= E, > > + PrivateData->Fv[Index].= FvHandle, > > + &PeiCoreFileHandle > > + ); > > + if (!EFI_ERROR (Status)) { > > + break; > > + } > > + } > > + ASSERT (Index < PrivateData->FvCount); } else { > > + // > > + // Find PEI Core from BFV > > + // > > + Status =3D PrivateData->Fv[0].FvPpi->FindFileByType ( > > + PrivateData->Fv[0].FvPpi, > > + EFI_FV_FILETYPE_PEI_CORE, > > + PrivateData->Fv[0].FvHandle, > > + &PeiCoreFileHandle > > + ); > > + ASSERT_EFI_ERROR (Status); > > + } > > > > // > > // Shadow PEI Core into memory so it will run faster diff --git=20 > > a/MdeModulePkg/Core/Pei/PeiMain.h > b/MdeModulePkg/Core/Pei/PeiMain.h > > index 322e7cd845..38542ab072 100644 > > --- a/MdeModulePkg/Core/Pei/PeiMain.h > > +++ b/MdeModulePkg/Core/Pei/PeiMain.h > > @@ -1,7 +1,7 @@ > > /** @file > > Definition of Pei Core Structures and Services > > > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights=20 > > reserved.
> > +Copyright (c) 2006 - 2019, Intel Corporation. All rights=20 > > +reserved.
> > This program and the accompanying materials are licensed and made=20 > > available under the terms and conditions of the BSD License which=20 > > accompanies this distribution. The full text of the license may be=20 > > found at @@ -49,6 +49,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS > OF > > ANY KIND, EITHER EXPRESS OR IMPLIED. > > #include #include=20 > > #include > > +#include > > > > /// > > /// It is an FFS type extension used for PeiFindFileEx. It=20 > > indicates current diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf > > b/MdeModulePkg/Core/Pei/PeiMain.inf > > index 140c4444b1..5bab2aab8c 100644 > > --- a/MdeModulePkg/Core/Pei/PeiMain.inf > > +++ b/MdeModulePkg/Core/Pei/PeiMain.inf > > @@ -6,7 +6,7 @@ > > # 2) Dispatch PEIM from discovered FV. > > # 3) Handoff control to DxeIpl to load DXE core and enter DXE phase. > > # > > -# Copyright (c) 2006 - 2018, Intel Corporation. All rights=20 > > reserved.
> > +# Copyright (c) 2006 - 2019, Intel Corporation. All rights=20 > > +reserved.
> > # > > # This program and the accompanying materials # are licensed and=20 > > made available under the terms and conditions of the BSD License @@ > > -102,6 +102,7 @@ > > gEfiTemporaryRamDonePpiGuid ## > SOMETIMES_CONSUMES > > gEfiPeiReset2PpiGuid ## SOMETIMES_CONSUMES > > gEfiSecHobDataPpiGuid ## SOMETIMES_CONSUMES > > + gEfiPeiCoreFvLocationPpiGuid ## SOMETIMES_CONSUMES > > > > [Pcd] > > gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize > ## > > CONSUMES > > -- > > 2.13.3.windows.1