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.151, mailfrom: ray.ni@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Wed, 04 Sep 2019 23:46:16 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 23:46:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,469,1559545200"; d="scan'208";a="266920263" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 04 Sep 2019 23:46:15 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 23:46:15 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 4 Sep 2019 23:46:14 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 4 Sep 2019 23:46:14 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.140]) with mapi id 14.03.0439.000; Thu, 5 Sep 2019 14:46:13 +0800 From: "Ni, Ray" To: "Dong, Eric" , "Chiu, Chasel" , "devel@edk2.groups.io" CC: Laszlo Ersek Subject: Re: [PATCH v2] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Topic: [PATCH v2] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Thread-Index: AQHVY6JpIkT/eWN5dkq0H/WEyrT8o6ccFR0AgACOlpA= Date: Thu, 5 Sep 2019 06:46:11 +0000 Deferred-Delivery: Thu, 5 Sep 2019 06:46:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C2C4587@SHSMSX104.ccr.corp.intel.com> References: <20190905042729.16032-1-chasel.chiu@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDU3ZjFiOTMtNDVhYS00ZGU0LTlkYTYtYTIyNWVhNDkyYjQ4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY0QranNaMk45Z0NkTWg5Q0pETVwvVmprU2MrbmJTUmpNUnZaMzA3T1RxUitCTTVqaitxTG4rejZ4S0RlaDZNNTYifQ== 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 Reviewed-by: Ray Ni > -----Original Message----- > From: Dong, Eric > Sent: Wednesday, September 4, 2019 11:15 PM > To: Chiu, Chasel ; devel@edk2.groups.io > Cc: Ni, Ray ; Laszlo Ersek > Subject: RE: [PATCH v2] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATI= ON_PPI in PpiList >=20 > Reviewed-by: Eric Dong >=20 > > -----Original Message----- > > From: Chiu, Chasel > > Sent: Thursday, September 5, 2019 12:27 PM > > To: devel@edk2.groups.io > > Cc: Dong, Eric ; Ni, Ray ; Laszl= o > > Ersek > > Subject: [PATCH v2] 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 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. > > > > 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(-) > > > > 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, &gEfiPeiCoreFvLocationPpiG= uid) && > > (((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