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 <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Chasel Chiu 2019-09-04 16:37:46 +08:00
parent 7bf5255997
commit 8a1305a11f
1 changed files with 4 additions and 5 deletions

View File

@ -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.