From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: ray.ni@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Wed, 04 Sep 2019 11:03:50 -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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 11:03:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,467,1559545200"; d="scan'208";a="212486935" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 04 Sep 2019 11:03:49 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 11:03:49 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 11:03:49 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by shsmsx102.ccr.corp.intel.com ([169.254.2.113]) with mapi id 14.03.0439.000; Thu, 5 Sep 2019 02:03:47 +0800 From: "Ni, Ray" 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 Thread-Topic: [edk2-devel] [PATCH] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Index: AQHVYv8KaeLZgQkev0u77goZ0ww2Pqcbx1ng Date: Wed, 4 Sep 2019 18:03:47 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C2C1EC1@SHSMSX104.ccr.corp.intel.com> References: <20190904085624.14424-1-chasel.chiu@intel.com> In-Reply-To: <20190904085624.14424-1-chasel.chiu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDczMDg3MjEtNzFhNy00MzA1LWE3YjctZjljNjU4N2MwMzRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMXpHMWwxU1RnSDlMQ1ZwOUZnek1sQTZneWtiM25FUUtzUjdYUlh4dzJXeU15bFZwZFBFd0hubGpWWWNKeSthUyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chiu, Chas= el > 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 >=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 single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList and > still can boot with the PeiCore specified by above PPI. >=20 > 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(-) >=20 > 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, &gEfiPeiCoreFvLocationPpiGui= d) && > (((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCor= eFvLocation !=3D 0) > ) { > @@ -261,7 +260,8 @@ SecStartupPhase2( > CpuDeadLoop (); > } > } > - } > + Index++; > + } while ((PpiList[Index].Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LI= ST) !=3D EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST); 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 ra= ndom data out of the PPI list. Thanks, Ray