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: chasel.chiu@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 04 Sep 2019 01:59:04 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 01:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="scan'208";a="187556383" Received: from cchiu4-mobl1.gar.corp.intel.com ([10.5.215.135]) by orsmga006.jf.intel.com with ESMTP; 04 Sep 2019 01:59:03 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek Subject: [PATCH] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList Date: Wed, 4 Sep 2019 16:56:24 +0800 Message-Id: <20190904085624.14424-1-chasel.chiu@intel.com> X-Mailer: git-send-email 2.13.3.windows.1 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 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 != 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) ) { @@ -261,7 +260,8 @@ SecStartupPhase2( CpuDeadLoop (); } } - } + Index++; + } 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