[edk2] [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times

Ard Biesheuvel posted 1 patch 7 years, 2 months ago
Failed in applying to current master (apply log)
ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 23 ++++++++++++++++++--
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  1 +
2 files changed, 22 insertions(+), 2 deletions(-)
[edk2] [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times
Posted by Ard Biesheuvel 7 years, 2 months ago
The ESRT management protocol needs to be invoked at the appropriate times
to get the ESRT config table to be published at when the ReadyToBoot is
signalled. So add this handling to the default ArmPkg implementation of
PlatformBootManagerLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 23 ++++++++++++++++++--
 ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  1 +
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
index a3b2d7925f72..d4a7859ca9e8 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -25,6 +25,7 @@
 #include <Library/UefiBootManagerLib.h>
 #include <Library/UefiLib.h>
 #include <Protocol/DevicePath.h>
+#include <Protocol/EsrtManagement.h>
 #include <Protocol/GraphicsOutput.h>
 #include <Protocol/LoadedImage.h>
 #include <Protocol/PciIo.h>
@@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole (
   VOID
   )
 {
-  EFI_STATUS    Status;
+  EFI_STATUS                    Status;
+  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
 
   if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
     DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));
     Status = ProcessCapsules ();
     DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));
+  } else {
+    if (EsrtManagement != NULL) {
+      EsrtManagement->SyncEsrtFmp();
+    }
+  }
+
+  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,
+                  (VOID **)&EsrtManagement);
+  if (EFI_ERROR(Status)) {
+    EsrtManagement = NULL;
   }
 
   //
@@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole (
   VOID
   )
 {
-  EFI_STATUS      Status;
+  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
+  EFI_STATUS                    Status;
 
   //
   // Show the splash screen.
@@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole (
   //
   EfiBootManagerConnectAll ();
 
+  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,
+                  (VOID **)&EsrtManagement);
+  if (!EFI_ERROR(Status)) {
+    EsrtManagement->SyncEsrtFmp();
+  }
+
   if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
     DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n"));
     Status = ProcessCapsules ();
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 58c4d6d2c7d6..fce7349ff867 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -82,3 +82,4 @@ [Protocols]
   gEfiLoadedImageProtocolGuid
   gEfiPciRootBridgeIoProtocolGuid
   gEfiSimpleFileSystemProtocolGuid
+  gEsrtManagementProtocolGuid
-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times
Posted by Ard Biesheuvel 7 years, 2 months ago
On 2 October 2017 at 20:02, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> The ESRT management protocol needs to be invoked at the appropriate times
> to get the ESRT config table to be published at when the ReadyToBoot is
> signalled. So add this handling to the default ArmPkg implementation of
> PlatformBootManagerLib.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 23 ++++++++++++++++++--
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  1 +
>  2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> index a3b2d7925f72..d4a7859ca9e8 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -25,6 +25,7 @@
>  #include <Library/UefiBootManagerLib.h>
>  #include <Library/UefiLib.h>
>  #include <Protocol/DevicePath.h>
> +#include <Protocol/EsrtManagement.h>
>  #include <Protocol/GraphicsOutput.h>
>  #include <Protocol/LoadedImage.h>
>  #include <Protocol/PciIo.h>
> @@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole (
>    VOID
>    )
>  {
> -  EFI_STATUS    Status;
> +  EFI_STATUS                    Status;
> +  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
>
>    if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
>      DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));
>      Status = ProcessCapsules ();
>      DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));
> +  } else {
> +    if (EsrtManagement != NULL) {
> +      EsrtManagement->SyncEsrtFmp();
> +    }
> +  }
> +
> +  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,
> +                  (VOID **)&EsrtManagement);
> +  if (EFI_ERROR(Status)) {
> +    EsrtManagement = NULL;
>    }
>

Sigh. Not sure what happened here, but this is obviously bogus. I will
fix and merge right away.

>    //
> @@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole (
>    VOID
>    )
>  {
> -  EFI_STATUS      Status;
> +  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
> +  EFI_STATUS                    Status;
>
>    //
>    // Show the splash screen.
> @@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole (
>    //
>    EfiBootManagerConnectAll ();
>
> +  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,
> +                  (VOID **)&EsrtManagement);
> +  if (!EFI_ERROR(Status)) {
> +    EsrtManagement->SyncEsrtFmp();
> +  }
> +
>    if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
>      DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n"));
>      Status = ProcessCapsules ();
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 58c4d6d2c7d6..fce7349ff867 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -82,3 +82,4 @@ [Protocols]
>    gEfiLoadedImageProtocolGuid
>    gEfiPciRootBridgeIoProtocolGuid
>    gEfiSimpleFileSystemProtocolGuid
> +  gEsrtManagementProtocolGuid
> --
> 2.11.0
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times
Posted by Leif Lindholm 7 years, 2 months ago
On Mon, Oct 02, 2017 at 08:02:26PM +0100, Ard Biesheuvel wrote:
> The ESRT management protocol needs to be invoked at the appropriate times
> to get the ESRT config table to be published at when the ReadyToBoot is
> signalled. So add this handling to the default ArmPkg implementation of
> PlatformBootManagerLib.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 23 ++++++++++++++++++--
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  1 +
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> index a3b2d7925f72..d4a7859ca9e8 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -25,6 +25,7 @@
>  #include <Library/UefiBootManagerLib.h>
>  #include <Library/UefiLib.h>
>  #include <Protocol/DevicePath.h>
> +#include <Protocol/EsrtManagement.h>
>  #include <Protocol/GraphicsOutput.h>
>  #include <Protocol/LoadedImage.h>
>  #include <Protocol/PciIo.h>
> @@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole (
>    VOID
>    )
>  {
> -  EFI_STATUS    Status;
> +  EFI_STATUS                    Status;
> +  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
>  
>    if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
>      DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));
>      Status = ProcessCapsules ();
>      DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));
> +  } else {
> +    if (EsrtManagement != NULL) {
> +      EsrtManagement->SyncEsrtFmp();

Missing space before '('.

> +    }
> +  }
> +
> +  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,

Missing space before '('.

> +                  (VOID **)&EsrtManagement);
> +  if (EFI_ERROR(Status)) {

Missing space before '('.

> +    EsrtManagement = NULL;
>    }
>  
>    //
> @@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole (
>    VOID
>    )
>  {
> -  EFI_STATUS      Status;
> +  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
> +  EFI_STATUS                    Status;
>  
>    //
>    // Show the splash screen.
> @@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole (
>    //
>    EfiBootManagerConnectAll ();
>  
> +  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,

Missing space before '('.

> +                  (VOID **)&EsrtManagement);
> +  if (!EFI_ERROR(Status)) {

Missing space before '('.

> +    EsrtManagement->SyncEsrtFmp();

Missing space before '('.

If you fold those in,
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> +  }
> +
>    if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
>      DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n"));
>      Status = ProcessCapsules ();
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 58c4d6d2c7d6..fce7349ff867 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -82,3 +82,4 @@ [Protocols]
>    gEfiLoadedImageProtocolGuid
>    gEfiPciRootBridgeIoProtocolGuid
>    gEfiSimpleFileSystemProtocolGuid
> +  gEsrtManagementProtocolGuid
> -- 
> 2.11.0
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times
Posted by Ard Biesheuvel 7 years, 2 months ago
On 6 October 2017 at 15:39, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Mon, Oct 02, 2017 at 08:02:26PM +0100, Ard Biesheuvel wrote:
>> The ESRT management protocol needs to be invoked at the appropriate times
>> to get the ESRT config table to be published at when the ReadyToBoot is
>> signalled. So add this handling to the default ArmPkg implementation of
>> PlatformBootManagerLib.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 23 ++++++++++++++++++--
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  1 +
>>  2 files changed, 22 insertions(+), 2 deletions(-)
>>
>> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>> index a3b2d7925f72..d4a7859ca9e8 100644
>> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>> @@ -25,6 +25,7 @@
>>  #include <Library/UefiBootManagerLib.h>
>>  #include <Library/UefiLib.h>
>>  #include <Protocol/DevicePath.h>
>> +#include <Protocol/EsrtManagement.h>
>>  #include <Protocol/GraphicsOutput.h>
>>  #include <Protocol/LoadedImage.h>
>>  #include <Protocol/PciIo.h>
>> @@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole (
>>    VOID
>>    )
>>  {
>> -  EFI_STATUS    Status;
>> +  EFI_STATUS                    Status;
>> +  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
>>
>>    if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
>>      DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));
>>      Status = ProcessCapsules ();
>>      DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));
>> +  } else {
>> +    if (EsrtManagement != NULL) {
>> +      EsrtManagement->SyncEsrtFmp();
>
> Missing space before '('.
>
>> +    }
>> +  }
>> +
>> +  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,
>
> Missing space before '('.
>
>> +                  (VOID **)&EsrtManagement);
>> +  if (EFI_ERROR(Status)) {
>
> Missing space before '('.
>
>> +    EsrtManagement = NULL;
>>    }
>>
>>    //
>> @@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole (
>>    VOID
>>    )
>>  {
>> -  EFI_STATUS      Status;
>> +  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;
>> +  EFI_STATUS                    Status;
>>
>>    //
>>    // Show the splash screen.
>> @@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole (
>>    //
>>    EfiBootManagerConnectAll ();
>>
>> +  Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL,
>
> Missing space before '('.
>
>> +                  (VOID **)&EsrtManagement);
>> +  if (!EFI_ERROR(Status)) {
>
> Missing space before '('.
>
>> +    EsrtManagement->SyncEsrtFmp();
>
> Missing space before '('.
>
> If you fold those in,
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>

Thanks. Pushed as 13ca0abb01d90eb039abf7ef978bd803e2347cef
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel