public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic.
@ 2018-07-21 22:17 Marvin Häuser
  2018-07-23  8:28 ` Laszlo Ersek
  2018-07-24  0:45 ` Dong, Eric
  0 siblings, 2 replies; 3+ messages in thread
From: Marvin Häuser @ 2018-07-21 22:17 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: eric.dong@intel.com, lersek@redhat.com

Currently, the SecPlatformInformation2 PPI is installed when either
there is none present or the present one doesn't lack data.
Update the logic to only install the SecPlatformInformation2 PPI when
it's not already installed so that an up-to-date PPI remains the only
one and unchanged.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/CpuMpPei/CpuBist.c | 22 +++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/UefiCpuPkg/CpuMpPei/CpuBist.c b/UefiCpuPkg/CpuMpPei/CpuBist.c
index 20728525e2d9..5312d9f01dc8 100644
--- a/UefiCpuPkg/CpuMpPei/CpuBist.c
+++ b/UefiCpuPkg/CpuMpPei/CpuBist.c
@@ -275,18 +275,20 @@ CollectBistDataFromPpi (
     (UINTN) BistInformationSize
     );
 
-  if (SecPlatformInformation2 != NULL && NumberOfData < NumberOfProcessors) {
-    //
-    // Reinstall SecPlatformInformation2 PPI to include new BIST information
-    //
-    Status = PeiServicesReInstallPpi (
-               SecInformationDescriptor,
-               &mPeiSecPlatformInformation2Ppi
-               );
-    ASSERT_EFI_ERROR (Status);
+  if (SecPlatformInformation2 != NULL) {
+    if (NumberOfData < NumberOfProcessors) {
+      //
+      // Reinstall SecPlatformInformation2 PPI to include new BIST information
+      //
+      Status = PeiServicesReInstallPpi (
+                 SecInformationDescriptor,
+                 &mPeiSecPlatformInformation2Ppi
+                 );
+      ASSERT_EFI_ERROR (Status);
+    }
   } else {
     //
-    // Install SecPlatformInformation2 PPI to include new BIST information
+    // Install SecPlatformInformation2 PPI
     //
     Status = PeiServicesInstallPpi (&mPeiSecPlatformInformation2Ppi);
     ASSERT_EFI_ERROR(Status);
-- 
2.18.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic.
  2018-07-21 22:17 [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic Marvin Häuser
@ 2018-07-23  8:28 ` Laszlo Ersek
  2018-07-24  0:45 ` Dong, Eric
  1 sibling, 0 replies; 3+ messages in thread
From: Laszlo Ersek @ 2018-07-23  8:28 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org; +Cc: eric.dong@intel.com

On 07/22/18 00:17, Marvin Häuser wrote:
> Currently, the SecPlatformInformation2 PPI is installed when either
> there is none present or the present one doesn't lack data.
> Update the logic to only install the SecPlatformInformation2 PPI when
> it's not already installed so that an up-to-date PPI remains the only
> one and unchanged.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  UefiCpuPkg/CpuMpPei/CpuBist.c | 22 +++++++++++---------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/UefiCpuPkg/CpuMpPei/CpuBist.c b/UefiCpuPkg/CpuMpPei/CpuBist.c
> index 20728525e2d9..5312d9f01dc8 100644
> --- a/UefiCpuPkg/CpuMpPei/CpuBist.c
> +++ b/UefiCpuPkg/CpuMpPei/CpuBist.c
> @@ -275,18 +275,20 @@ CollectBistDataFromPpi (
>      (UINTN) BistInformationSize
>      );
>  
> -  if (SecPlatformInformation2 != NULL && NumberOfData < NumberOfProcessors) {
> -    //
> -    // Reinstall SecPlatformInformation2 PPI to include new BIST information
> -    //
> -    Status = PeiServicesReInstallPpi (
> -               SecInformationDescriptor,
> -               &mPeiSecPlatformInformation2Ppi
> -               );
> -    ASSERT_EFI_ERROR (Status);
> +  if (SecPlatformInformation2 != NULL) {
> +    if (NumberOfData < NumberOfProcessors) {
> +      //
> +      // Reinstall SecPlatformInformation2 PPI to include new BIST information
> +      //
> +      Status = PeiServicesReInstallPpi (
> +                 SecInformationDescriptor,
> +                 &mPeiSecPlatformInformation2Ppi
> +                 );
> +      ASSERT_EFI_ERROR (Status);
> +    }
>    } else {
>      //
> -    // Install SecPlatformInformation2 PPI to include new BIST information
> +    // Install SecPlatformInformation2 PPI
>      //
>      Status = PeiServicesInstallPpi (&mPeiSecPlatformInformation2Ppi);
>      ASSERT_EFI_ERROR(Status);
> 

Looks good to me:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

but Eric should decide.

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic.
  2018-07-21 22:17 [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic Marvin Häuser
  2018-07-23  8:28 ` Laszlo Ersek
@ 2018-07-24  0:45 ` Dong, Eric
  1 sibling, 0 replies; 3+ messages in thread
From: Dong, Eric @ 2018-07-24  0:45 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org; +Cc: lersek@redhat.com

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

And pushed:

SHA-1: 005c855dc6be0f61f76de0d7ec4a62ee737518d6

* UefiCpuPkg/CpuMpPei: Correct BIST PPI logic.

Currently, the SecPlatformInformation2 PPI is installed when either
there is none present or the present one doesn't lack data.
Update the logic to only install the SecPlatformInformation2 PPI when
it's not already installed so that an up-to-date PPI remains the only
one and unchanged.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>


Thanks,
Eric

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Marvin Häuser
> Sent: Sunday, July 22, 2018 6:17 AM
> To: edk2-devel@lists.01.org
> Cc: lersek@redhat.com; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic.
> 
> Currently, the SecPlatformInformation2 PPI is installed when either there is
> none present or the present one doesn't lack data.
> Update the logic to only install the SecPlatformInformation2 PPI when it's not
> already installed so that an up-to-date PPI remains the only one and
> unchanged.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  UefiCpuPkg/CpuMpPei/CpuBist.c | 22 +++++++++++---------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/UefiCpuPkg/CpuMpPei/CpuBist.c
> b/UefiCpuPkg/CpuMpPei/CpuBist.c index 20728525e2d9..5312d9f01dc8
> 100644
> --- a/UefiCpuPkg/CpuMpPei/CpuBist.c
> +++ b/UefiCpuPkg/CpuMpPei/CpuBist.c
> @@ -275,18 +275,20 @@ CollectBistDataFromPpi (
>      (UINTN) BistInformationSize
>      );
> 
> -  if (SecPlatformInformation2 != NULL && NumberOfData <
> NumberOfProcessors) {
> -    //
> -    // Reinstall SecPlatformInformation2 PPI to include new BIST information
> -    //
> -    Status = PeiServicesReInstallPpi (
> -               SecInformationDescriptor,
> -               &mPeiSecPlatformInformation2Ppi
> -               );
> -    ASSERT_EFI_ERROR (Status);
> +  if (SecPlatformInformation2 != NULL) {
> +    if (NumberOfData < NumberOfProcessors) {
> +      //
> +      // Reinstall SecPlatformInformation2 PPI to include new BIST information
> +      //
> +      Status = PeiServicesReInstallPpi (
> +                 SecInformationDescriptor,
> +                 &mPeiSecPlatformInformation2Ppi
> +                 );
> +      ASSERT_EFI_ERROR (Status);
> +    }
>    } else {
>      //
> -    // Install SecPlatformInformation2 PPI to include new BIST information
> +    // Install SecPlatformInformation2 PPI
>      //
>      Status = PeiServicesInstallPpi (&mPeiSecPlatformInformation2Ppi);
>      ASSERT_EFI_ERROR(Status);
> --
> 2.18.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-24  0:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-21 22:17 [PATCH] UefiCpuPkg/CpuMpPei: Correct BIST PPI logic Marvin Häuser
2018-07-23  8:28 ` Laszlo Ersek
2018-07-24  0:45 ` Dong, Eric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox