From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Thu, 05 Sep 2019 06:16:13 -0700 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5205A64D32; Thu, 5 Sep 2019 13:16:13 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-133.ams2.redhat.com [10.36.116.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5080A600F8; Thu, 5 Sep 2019 13:16:12 +0000 (UTC) Subject: Re: [PATCH v2] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList To: "Ni, Ray" , "Dong, Eric" , "Chiu, Chasel" , "devel@edk2.groups.io" References: <20190905042729.16032-1-chasel.chiu@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C2C4587@SHSMSX104.ccr.corp.intel.com> From: "Laszlo Ersek" Message-ID: <8111424b-ddc8-d4c1-ba26-2f8fa2a3aa08@redhat.com> Date: Thu, 5 Sep 2019 15:16:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C2C4587@SHSMSX104.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 05 Sep 2019 13:16:13 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi All, On 09/05/19 08:46, Ni, Ray wrote: > Reviewed-by: Ray Ni Please go ahead with the push, I'll skip this. Thanks Laszlo >> -----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_LOCATION_PPI in PpiList >> >> Reviewed-by: Eric Dong >> >>> -----Original Message----- >>> From: Chiu, Chasel >>> Sent: Thursday, September 5, 2019 12:27 PM >>> To: devel@edk2.groups.io >>> Cc: Dong, Eric ; Ni, Ray ; Laszlo >>> Ersek >>> Subject: [PATCH v2] UefiCpuPkg: support single >>> EFI_PEI_CORE_FV_LOCATION_PPI in PpiList >>> >>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2153 >>> >>> 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 != NULL) { >>> - for (Index = 0; >>> - (PpiList[Index].Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) != >>> EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; >>> - Index++) { >>> + Index = 0; >>> + do { >>> if (CompareGuid (PpiList[Index].Guid, &gEfiPeiCoreFvLocationPpiGuid) && >>> (((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)- >>>> PeiCoreFvLocation != 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) != >>> + 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 >