diff options
author | Chasel, Chiu <chasel.chiu@intel.com> | 2019-02-19 15:30:23 +0800 |
---|---|---|
committer | Chasel, Chiu <chasel.chiu@intel.com> | 2019-02-20 09:41:23 +0800 |
commit | 08283b966ea10c0430140dc2b2951d8534d05aaa (patch) | |
tree | 9502426ec3257bc8337bcba941d18efb8d0f147b /UefiCpuPkg/SecCore/SecMain.c | |
parent | f168816c49e388dcd097dd62d766d63f73aaabb3 (diff) | |
download | edk2-08283b966ea10c0430140dc2b2951d8534d05aaa.tar.gz edk2-08283b966ea10c0430140dc2b2951d8534d05aaa.tar.bz2 edk2-08283b966ea10c0430140dc2b2951d8534d05aaa.zip |
UefiCpuPkg/SecCore: Wrong Debug Information for SecCore
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1533
When SecCore and PeiCore in different FV, current
implementation still assuming SecCore and PeiCore are in
the same FV.
To fix this issue 2 FVs will be input parameters for
FindAndReportEntryPoints () and SecCore and PeiCore will
be found in each FV and correct debug information will
be reported.
Test: Booted with internal platform successfully.
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'UefiCpuPkg/SecCore/SecMain.c')
-rw-r--r-- | UefiCpuPkg/SecCore/SecMain.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c index 752156a98e..14696c81a5 100644 --- a/UefiCpuPkg/SecCore/SecMain.c +++ b/UefiCpuPkg/SecCore/SecMain.c @@ -248,8 +248,17 @@ SecStartupPhase2( for (Index = 0;
(PpiList[Index].Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) != EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
Index++) {
- if (CompareGuid (PpiList[Index].Guid, &gEfiPeiCoreFvLocationPpiGuid) && (((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCoreFvLocation != 0)) {
- FindAndReportEntryPoints ((EFI_FIRMWARE_VOLUME_HEADER *) ((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCoreFvLocation, &PeiCoreEntryPoint);
+ if (CompareGuid (PpiList[Index].Guid, &gEfiPeiCoreFvLocationPpiGuid) &&
+ (((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCoreFvLocation != 0)
+ ) {
+ //
+ // In this case, SecCore is in BFV but PeiCore is in another FV reported by PPI.
+ //
+ FindAndReportEntryPoints (
+ (EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase,
+ (EFI_FIRMWARE_VOLUME_HEADER *) ((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCoreFvLocation,
+ &PeiCoreEntryPoint
+ );
if (PeiCoreEntryPoint != NULL) {
break;
} else {
@@ -265,7 +274,14 @@ SecStartupPhase2( // If EFI_PEI_CORE_FV_LOCATION_PPI not found, try to locate PeiCore from BFV.
//
if (PeiCoreEntryPoint == NULL) {
- FindAndReportEntryPoints ((EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase, &PeiCoreEntryPoint);
+ //
+ // Both SecCore and PeiCore are in BFV.
+ //
+ FindAndReportEntryPoints (
+ (EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase,
+ (EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase,
+ &PeiCoreEntryPoint
+ );
if (PeiCoreEntryPoint == NULL) {
CpuDeadLoop ();
}
|