[edk2-devel] [PATCH] UefiCpuPkg: support single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList

Dong, Eric eric.dong at intel.com
Wed Sep 4 14:39:24 UTC 2019


Hi Chasel,

Thanks for your quick fix. 

Reviewed-by: Eric Dong <eric.dong at intel.com>

Thanks,
Eric

> -----Original Message-----
> From: devel at edk2.groups.io [mailto:devel at edk2.groups.io] On Behalf Of Chiu,
> Chasel
> Sent: Wednesday, September 4, 2019 4:56 PM
> To: devel at edk2.groups.io
> Cc: Dong, Eric <eric.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Laszlo
> Ersek <lersek at redhat.com>
> Subject: [edk2-devel] [PATCH] 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 single EFI_PEI_CORE_FV_LOCATION_PPI in PpiList and
>       still can boot with the PeiCore specified by above PPI.
> 
> Cc: Eric Dong <eric.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Signed-off-by: Chasel Chiu <chasel.chiu at intel.com>
> ---
>  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
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46816): https://edk2.groups.io/g/devel/message/46816
Mute This Topic: https://groups.io/mt/33136208/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list