From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: star.zeng@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 04 Sep 2019 22:38:53 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 22:38:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,469,1559545200"; d="scan'208";a="190387670" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 04 Sep 2019 22:38:52 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 22:38:51 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 22:38:51 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.195]) with mapi id 14.03.0439.000; Thu, 5 Sep 2019 13:38:49 +0800 From: "Zeng, Star" To: "devel@edk2.groups.io" , "Chiu, Chasel" CC: "Dong, Eric" , "Ni, Ray" , "Laszlo Ersek" , "Zeng, Star" Subject: Re: [edk2-devel] [PATCH v2] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Topic: [edk2-devel] [PATCH v2] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Index: AQHVY6JtoV5FUgAsN0WFKxQJkxzPqaccj9ng Date: Thu, 5 Sep 2019 05:38:48 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB048310403C29AD@shsmsx102.ccr.corp.intel.com> References: <20190905042729.16032-1-chasel.chiu@intel.com> In-Reply-To: <20190905042729.16032-1-chasel.chiu@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 Return-Path: star.zeng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Chiu, Chasel > Sent: Thursday, September 5, 2019 12:27 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Laszlo > Ersek > Subject: [edk2-devel] [PATCH v2] UefiCpuPkg: support single > EFI_PEI_CORE_FV_LOCATION_PPI in PpiList >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2153 >=20 > Current logic will skip searching EFI_PEI_CORE_FV_LOCATION_PPI when the > PPI in PpiList having EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST flag, but > platform may pass single PPI in PpiList that should be supported. >=20 > Changed the logic to verify PpiList first before checking > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST flag. >=20 > Test: Verified both single EFI_PEI_CORE_FV_LOCATION_PPI and multiple > PPIs in PpiList cases and both can boot with the PeiCore > specified by EFI_PEI_CORE_FV_LOCATION_PPI. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Chasel Chiu > --- > UefiCpuPkg/SecCore/SecMain.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) >=20 > diff --git a/UefiCpuPkg/SecCore/SecMain.c > b/UefiCpuPkg/SecCore/SecMain.c index 66c952b897..5d5e7f17dc 100644 > --- a/UefiCpuPkg/SecCore/SecMain.c > +++ b/UefiCpuPkg/SecCore/SecMain.c > @@ -238,9 +238,8 @@ SecStartupPhase2( > // is enabled. > // > if (PpiList !=3D NULL) { > - for (Index =3D 0; > - (PpiList[Index].Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) != =3D > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; > - Index++) { > + Index =3D 0; > + do { > if (CompareGuid (PpiList[Index].Guid, &gEfiPeiCoreFvLocationPpiGu= id) > && > (((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)- > >PeiCoreFvLocation !=3D 0) > ) { > @@ -256,12 +255,12 @@ SecStartupPhase2( > break; > } else { > // > - // PeiCore not found > + // Invalid PeiCore FV provided by platform > // > CpuDeadLoop (); > } > } > - } > + } while ((PpiList[Index++].Flags & > + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) !=3D > + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST); > } > // > // If EFI_PEI_CORE_FV_LOCATION_PPI not found, try to locate PeiCore > from BFV. > -- > 2.13.3.windows.1 >=20 >=20 >=20