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.100, mailfrom: chasel.chiu@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Wed, 04 Sep 2019 17:37:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 17:37:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,468,1559545200"; d="scan'208";a="212594453" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by fmsmga002.fm.intel.com with ESMTP; 04 Sep 2019 17:36:59 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.22]) by PGSMSX103.gar.corp.intel.com ([169.254.2.25]) with mapi id 14.03.0439.000; Thu, 5 Sep 2019 08:36:58 +0800 From: "Chiu, Chasel" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Dong, Eric" , Laszlo Ersek Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Topic: [edk2-devel] [PATCH] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Index: AQHVYv8KjVuBgNkmFkSzRi1MQPXMRKcbx1nggAB2Y4A= Date: Thu, 5 Sep 2019 00:36:58 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC50481B84@PGSMSX111.gar.corp.intel.com> References: <20190904085624.14424-1-chasel.chiu@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C2C1EC1@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C2C1EC1@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDczMDg3MjEtNzFhNy00MzA1LWE3YjctZjljNjU4N2MwMzRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMXpHMWwxU1RnSDlMQ1ZwOUZnek1sQTZneWtiM25FUUtzUjdYUlh4dzJXeU15bFZwZFBFd0hubGpWWWNKeSthUyJ9 x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Ni, Ray > Sent: Thursday, September 5, 2019 2:04 AM > To: devel@edk2.groups.io; Chiu, Chasel > Cc: Dong, Eric ; Laszlo Ersek > Subject: RE: [edk2-devel] [PATCH] UefiCpuPkg: support single > EFI_PEI_CORE_FV_LOCATION_PPI in PpiList >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Chiu, > > Chasel > > Sent: Wednesday, September 4, 2019 1:56 AM > > To: devel@edk2.groups.io > > Cc: Dong, Eric ; Ni, Ray ; > > Laszlo Ersek > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: support single > > EFI_PEI_CORE_FV_LOCATION_PPI in PpiList > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2153 > > > > 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. > > > > Changed the logic to verify PpiList first before checking > > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST flag. > > > > Test: Verified single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList and > > still can boot with the PeiCore specified by above PPI. > > > > Cc: Eric Dong > > Cc: Ray Ni > > Cc: Laszlo Ersek > > Signed-off-by: Chasel Chiu > > --- > > UefiCpuPkg/SecCore/SecMain.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/UefiCpuPkg/SecCore/SecMain.c > > b/UefiCpuPkg/SecCore/SecMain.c index 66c952b897..6beb025b4b 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, > &gEfiPeiCoreFvLocationPpiGuid) && > > (((EFI_PEI_CORE_FV_LOCATION_PPI *) > PpiList[Index].Ppi)->PeiCoreFvLocation !=3D 0) > > ) { > > @@ -261,7 +260,8 @@ SecStartupPhase2( > > CpuDeadLoop (); > > } > > } > > - } > > + Index++; > > + } while ((PpiList[Index].Flags & > > + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) !=3D > > + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST); >=20 > Index is firstly increased, and comparison of the Flags is after that. > What if there is only one PPI in the list, the comparison happens in the > random data out of the PPI list. Good catch! Let me update and re-test it again. Thanks! >=20 > Thanks, > Ray