diff options
author | Chasel Chiu <chasel.chiu@intel.com> | 2019-09-04 16:37:46 +0800 |
---|---|---|
committer | Chasel Chiu <chasel.chiu@intel.com> | 2019-09-05 20:42:20 +0800 |
commit | 8a1305a11f3bda2d6c1ab758e4aea79ee021dd1c (patch) | |
tree | 3f399caa46daba02494bd611313106b19709fed2 | |
parent | 7bf525599713703a60c4f300bd82787545a74a52 (diff) | |
download | edk2-8a1305a11f3bda2d6c1ab758e4aea79ee021dd1c.tar.gz edk2-8a1305a11f3bda2d6c1ab758e4aea79ee021dd1c.tar.bz2 edk2-8a1305a11f3bda2d6c1ab758e4aea79ee021dd1c.zip |
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>
-rw-r--r-- | UefiCpuPkg/SecCore/SecMain.c | 9 |
1 files 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.
|