public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v4 0/9] Add platform hook for ultimate boot failure.
@ 2018-07-04  1:50 Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot Ruiyu Ni
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel

v4:
  1. adds missing PlatformBootManagerLib instances modification for
     platform ArmPkg and ArmVirtPkg.
  2. Remove single quote in #1/9
  3. Wrap the long comments in #3/9

Ruiyu Ni (9):
  MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot
  CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot
  OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot
  Nt32Pkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  QuarkPlatform/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  ArmVirtPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"
  MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()

 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18 ++++++-
 .../Library/PlatformBootManagerLib/PlatformBm.c    | 62 +++++++++++++++++++++-
 .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
 .../Include/Library/PlatformBootManagerLib.h       | 13 +++++
 .../PlatformBootManager.c                          | 19 ++++++-
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c           | 61 ++-------------------
 .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
 .../Library/PlatformBootManagerLib/BdsPlatform.c   | 61 ++++++++++++++++++++-
 .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
 9 files changed, 228 insertions(+), 63 deletions(-)

-- 
2.16.1.windows.1



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

* [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  3:39   ` Wang, Sunny (HPS SW)
  2018-07-04  1:50 ` [PATCH v4 2/9] CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot Ruiyu Ni
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Sean Brogan, Michael Turner, Sunny Wang

The patch adds a new API PlatformBootManagerUnableToBoot()
to PlatformBootManagerLib.
The new API is provided by platform bds library and is called when
no boot option could be launched.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Sunny Wang <sunnywang@hpe.com>
---
 MdeModulePkg/Include/Library/PlatformBootManagerLib.h | 13 +++++++++++++
 .../PlatformBootManagerLibNull/PlatformBootManager.c  | 19 ++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
index 65630ce2bb..6e26329043 100644
--- a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
@@ -59,4 +59,17 @@ PlatformBootManagerWaitCallback (
   UINT16          TimeoutRemain
   );
 
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  );
+
 #endif
diff --git a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
index 1390e19097..5a4455ef23 100644
--- a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
+++ b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized
   by IBV/OEM.
 
-Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -65,3 +65,20 @@ PlatformBootManagerWaitCallback (
 {
   return;
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
+
-- 
2.16.1.windows.1



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

* [PATCH v4 2/9] CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 3/9] OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot Ruiyu Ni
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Maurice Ma, Prince Agyeman

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
---
 .../PlatformBootManagerLib/PlatformBootManager.c      | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 7e92441da1..368e89d586 100644
--- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized
   by IBV/OEM.
 
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -252,3 +252,20 @@ PlatformBootManagerWaitCallback (
 {
   return;
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
+
-- 
2.16.1.windows.1



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

* [PATCH v4 3/9] OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 2/9] CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 4/9] Nt32Pkg/PlatformBDS: " Ruiyu Ni
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Jordan Justen, Ard Biesheuvel, Anthony Perard, Julien Grall

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c   | 61 +++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 57870cb856..b2faa797c6 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -1,7 +1,7 @@
 /** @file
   Platform BDS customizations.
 
-  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials are licensed and made available
   under the terms and conditions of the BSD License which accompanies this
   distribution.  The full text of the license may be found at
@@ -1676,3 +1676,62 @@ PlatformBootManagerWaitCallback (
     );
 }
 
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  EFI_STATUS                   Status;
+  EFI_INPUT_KEY                Key;
+  EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu;
+  UINTN                        Index;
+
+  //
+  // BootManagerMenu doesn't contain the correct information when return status
+  // is EFI_NOT_FOUND.
+  //
+  Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu);
+  if (EFI_ERROR (Status)) {
+    return;
+  }
+  //
+  // Normally BdsDxe does not print anything to the system console, but this is
+  // a last resort -- the end-user will likely not see any DEBUG messages
+  // logged in this situation.
+  //
+  // AsciiPrint() will NULL-check gST->ConOut internally. We check gST->ConIn
+  // here to see if it makes sense to request and wait for a keypress.
+  //
+  if (gST->ConIn != NULL) {
+    AsciiPrint (
+      "%a: No bootable option or device was found.\n"
+      "%a: Press any key to enter the Boot Manager Menu.\n",
+      gEfiCallerBaseName,
+      gEfiCallerBaseName
+      );
+    Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
+    ASSERT_EFI_ERROR (Status);
+    ASSERT (Index == 0);
+
+    //
+    // Drain any queued keys.
+    //
+    while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {
+      //
+      // just throw away Key
+      //
+    }
+  }
+
+  for (;;) {
+    EfiBootManagerBoot (&BootManagerMenu);
+  }
+}
-- 
2.16.1.windows.1



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

* [PATCH v4 4/9] Nt32Pkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (2 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 3/9] OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 5/9] QuarkPlatform/PlatformBDS: " Ruiyu Ni
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <Hao.a.wu@intel.com>
---
 .../PlatformBootManagerLib/PlatformBootManager.c      | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 99f30f9ec2..cf8289faff 100644
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized
   by IBV/OEM.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
@@ -403,3 +403,20 @@ PlatformBootManagerWaitCallback (
     0
     );
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
+
-- 
2.16.1.windows.1



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

* [PATCH v4 5/9] QuarkPlatform/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (3 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 4/9] Nt32Pkg/PlatformBDS: " Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  1:50 ` [PATCH v4 6/9] ArmPkg/PlatformBDS: " Ruiyu Ni
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Michael D Kinney, Kelly Steele

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
---
 .../PlatformBootManagerLib/PlatformBootManager.c      | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 53391c6077..8b25f55f1c 100644
--- a/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/QuarkPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -2,7 +2,7 @@
 This file include all platform action which can be customized
 by IBV/OEM.
 
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -459,3 +459,20 @@ PlatformBootManagerWaitCallback (
 {
   Print (L"\r%-2d seconds remained...", TimeoutRemain);
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
+
-- 
2.16.1.windows.1



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

* [PATCH v4 6/9] ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (4 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 5/9] QuarkPlatform/PlatformBDS: " Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-11 14:21   ` Ard Biesheuvel
  2018-07-04  1:50 ` [PATCH v4 7/9] ArmVirtPkg/PlatformBDS: " Ruiyu Ni
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
index 079f1552d5..f9c71d430c 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -3,7 +3,7 @@
 
   Copyright (C) 2015-2016, Red Hat, Inc.
   Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
-  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials are licensed and made available
@@ -766,3 +766,19 @@ PlatformBootManagerWaitCallback (
     Print (L".");
   }
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
-- 
2.16.1.windows.1



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

* [PATCH v4 7/9] ArmVirtPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (5 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 6/9] ArmPkg/PlatformBDS: " Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-05 12:06   ` Laszlo Ersek
  2018-07-04  1:50 ` [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging" Ruiyu Ni
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Laszlo Ersek, Ard Biesheuvel, Julien Grall

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
---
 .../Library/PlatformBootManagerLib/PlatformBm.c    | 62 +++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
index 62cce6a01e..bb07f5e22b 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -3,7 +3,7 @@
 
   Copyright (C) 2015-2016, Red Hat, Inc.
   Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
-  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials are licensed and made available
   under the terms and conditions of the BSD License which accompanies this
@@ -865,3 +865,63 @@ PlatformBootManagerWaitCallback (
     0
     );
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  EFI_STATUS                   Status;
+  EFI_INPUT_KEY                Key;
+  EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu;
+  UINTN                        Index;
+
+  //
+  // BootManagerMenu doesn't contain the correct information when return status
+  // is EFI_NOT_FOUND.
+  //
+  Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu);
+  if (EFI_ERROR (Status)) {
+    return;
+  }
+  //
+  // Normally BdsDxe does not print anything to the system console, but this is
+  // a last resort -- the end-user will likely not see any DEBUG messages
+  // logged in this situation.
+  //
+  // AsciiPrint() will NULL-check gST->ConOut internally. We check gST->ConIn
+  // here to see if it makes sense to request and wait for a keypress.
+  //
+  if (gST->ConIn != NULL) {
+    AsciiPrint (
+      "%a: No bootable option or device was found.\n"
+      "%a: Press any key to enter the Boot Manager Menu.\n",
+      gEfiCallerBaseName,
+      gEfiCallerBaseName
+      );
+    Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
+    ASSERT_EFI_ERROR (Status);
+    ASSERT (Index == 0);
+
+    //
+    // Drain any queued keys.
+    //
+    while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {
+      //
+      // just throw away Key
+      //
+    }
+  }
+
+  for (;;) {
+    EfiBootManagerBoot (&BootManagerMenu);
+  }
+}
-- 
2.16.1.windows.1



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

* [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (6 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 7/9] ArmVirtPkg/PlatformBDS: " Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  3:39   ` Wang, Sunny (HPS SW)
  2018-07-04  1:50 ` [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot() Ruiyu Ni
  2018-07-04  1:55 ` [PATCH v4 0/9] Add platform hook for ultimate boot failure Ni, Ruiyu
  9 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Eric Dong

Commit d1de487dd2e77f4741abcbd71d19a8c93971fda0
"MdeModulePkg/BdsDxe: fall back to a Boot Manager Menu loop before
 hanging"
changed BDS core to fall back to UI loop when no bootable option
can be launched.
Now since PlatformBootManagerUnableToBoot() is added, the commit
can be reverted.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 60 +++-----------------------------
 1 file changed, 4 insertions(+), 56 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 49e403e181..39b643c77a 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -634,55 +634,6 @@ BdsFormalizeEfiGlobalVariable (
   BdsFormalizeOSIndicationVariable ();
 }
 
-/**
-  Enter an infinite loop of calling the Boot Manager Menu.
-
-  This is a last resort alternative to BdsEntry() giving up for good. This
-  function never returns.
-
-  @param[in] BootManagerMenu  The EFI_BOOT_MANAGER_LOAD_OPTION located and/or
-                              created by the EfiBootManagerGetBootManagerMenu()
-                              call in BdsEntry().
-**/
-VOID
-BdsBootManagerMenuLoop (
-  IN EFI_BOOT_MANAGER_LOAD_OPTION *BootManagerMenu
-  )
-{
-  EFI_INPUT_KEY Key;
-
-  //
-  // Normally BdsDxe does not print anything to the system console, but this is
-  // a last resort -- the end-user will likely not see any DEBUG messages
-  // logged in this situation.
-  //
-  // AsciiPrint() will NULL-check gST->ConOut internally. We check gST->ConIn
-  // here to see if it makes sense to request and wait for a keypress.
-  //
-  if (gST->ConIn != NULL) {
-    AsciiPrint (
-      "%a: No bootable option or device was found.\n"
-      "%a: Press any key to enter the Boot Manager Menu.\n",
-      gEfiCallerBaseName,
-      gEfiCallerBaseName
-      );
-    BdsWaitForSingleEvent (gST->ConIn->WaitForKey, 0);
-
-    //
-    // Drain any queued keys.
-    //
-    while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {
-      //
-      // just throw away Key
-      //
-    }
-  }
-
-  for (;;) {
-    EfiBootManagerBoot (BootManagerMenu);
-  }
-}
-
 /**
 
   Service routine for BdsInstance->Entry(). Devices are connected, the
@@ -1081,19 +1032,16 @@ BdsEntry (
     } while (BootSuccess);
   }
 
+  if (BootManagerMenuStatus != EFI_NOT_FOUND) {
+    EfiBootManagerFreeLoadOption (&BootManagerMenu);
+  }
+
   if (!BootSuccess) {
     LoadOptions = EfiBootManagerGetLoadOptions (&LoadOptionCount, LoadOptionTypePlatformRecovery);
     ProcessLoadOptions (LoadOptions, LoadOptionCount);
     EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount);
   }
 
-  //
-  // If BootManagerMenu is available, fall back to it indefinitely.
-  //
-  if (BootManagerMenuStatus != EFI_NOT_FOUND) {
-    BdsBootManagerMenuLoop (&BootManagerMenu);
-  }
-
   DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n"));
   CpuDeadLoop ();
 }
-- 
2.16.1.windows.1



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

* [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (7 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging" Ruiyu Ni
@ 2018-07-04  1:50 ` Ruiyu Ni
  2018-07-04  3:39   ` Wang, Sunny (HPS SW)
  2018-07-04  1:55 ` [PATCH v4 0/9] Add platform hook for ultimate boot failure Ni, Ruiyu
  9 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2018-07-04  1:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Sean Brogan, Michael Turner, Sunny Wang

When no boot option can be launched, BDS core calls
PlatformBootManagerUnableToBoot() to let platform BdsDxe handle it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Sunny Wang <sunnywang@hpe.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 39b643c77a..a25663ea43 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -1043,6 +1043,7 @@ BdsEntry (
   }
 
   DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n"));
+  PlatformBootManagerUnableToBoot ();
   CpuDeadLoop ();
 }
 
-- 
2.16.1.windows.1



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

* Re: [PATCH v4 0/9] Add platform hook for ultimate boot failure.
  2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
                   ` (8 preceding siblings ...)
  2018-07-04  1:50 ` [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot() Ruiyu Ni
@ 2018-07-04  1:55 ` Ni, Ruiyu
  2018-07-05 12:07   ` Laszlo Ersek
  9 siblings, 1 reply; 19+ messages in thread
From: Ni, Ruiyu @ 2018-07-04  1:55 UTC (permalink / raw)
  To: edk2-devel

On 7/4/2018 9:50 AM, Ruiyu Ni wrote:
> v4:
>    1. adds missing PlatformBootManagerLib instances modification for
>       platform ArmPkg and ArmVirtPkg.
>    2. Remove single quote in #1/9
>    3. Wrap the long comments in #3/9
> 
> Ruiyu Ni (9):
>    MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot
>    CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot
>    OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot
>    Nt32Pkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>    QuarkPlatform/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>    ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>    ArmVirtPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>    MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"
>    MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()
> 
>   ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18 ++++++-
>   .../Library/PlatformBootManagerLib/PlatformBm.c    | 62 +++++++++++++++++++++-
>   .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
>   .../Include/Library/PlatformBootManagerLib.h       | 13 +++++
>   .../PlatformBootManager.c                          | 19 ++++++-
>   MdeModulePkg/Universal/BdsDxe/BdsEntry.c           | 61 ++-------------------
>   .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
>   .../Library/PlatformBootManagerLib/BdsPlatform.c   | 61 ++++++++++++++++++++-
>   .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
>   9 files changed, 228 insertions(+), 63 deletions(-)
> 
I will take leave for 1.5 weeks and will not be back until next.next Monday.
Because there are still some internal platform codes that need 
PlatformBootManagerLib modifications which I will make after I am back, 
the open source check-ins will be deferred after the internal 
modification is done.

-- 
Thanks,
Ray


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

* Re: [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot
  2018-07-04  1:50 ` [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot Ruiyu Ni
@ 2018-07-04  3:39   ` Wang, Sunny (HPS SW)
  0 siblings, 0 replies; 19+ messages in thread
From: Wang, Sunny (HPS SW) @ 2018-07-04  3:39 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel@lists.01.org
  Cc: Sean Brogan, Michael Turner, Wang, Sunny (HPS SW)

Looks good to me. 
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

-----Original Message-----
From: Ruiyu Ni [mailto:ruiyu.ni@intel.com] 
Sent: Wednesday, July 04, 2018 9:51 AM
To: edk2-devel@lists.01.org
Cc: Sean Brogan <sean.brogan@microsoft.com>; Michael Turner <Michael.Turner@microsoft.com>; Wang, Sunny (HPS SW) <sunnywang@hpe.com>
Subject: [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot

The patch adds a new API PlatformBootManagerUnableToBoot() to PlatformBootManagerLib.
The new API is provided by platform bds library and is called when no boot option could be launched.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Sunny Wang <sunnywang@hpe.com>
---
 MdeModulePkg/Include/Library/PlatformBootManagerLib.h | 13 +++++++++++++  .../PlatformBootManagerLibNull/PlatformBootManager.c  | 19 ++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
index 65630ce2bb..6e26329043 100644
--- a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
@@ -59,4 +59,17 @@ PlatformBootManagerWaitCallback (
   UINT16          TimeoutRemain
   );
 
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to 
+applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  );
+
 #endif
diff --git a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
index 1390e19097..5a4455ef23 100644
--- a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
+++ b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManage
+++ r.c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized
   by IBV/OEM.
 
-Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at @@ -65,3 +65,20 @@ PlatformBootManagerWaitCallback (  {
   return;
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to 
+applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
+
--
2.16.1.windows.1



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

* Re: [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"
  2018-07-04  1:50 ` [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging" Ruiyu Ni
@ 2018-07-04  3:39   ` Wang, Sunny (HPS SW)
  0 siblings, 0 replies; 19+ messages in thread
From: Wang, Sunny (HPS SW) @ 2018-07-04  3:39 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel@lists.01.org; +Cc: Eric Dong, Wang, Sunny (HPS SW)

Looks good to me. This is clearer. 
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Wednesday, July 04, 2018 9:51 AM
To: edk2-devel@lists.01.org
Cc: Eric Dong <eric.dong@intel.com>
Subject: [edk2] [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"

Commit d1de487dd2e77f4741abcbd71d19a8c93971fda0
"MdeModulePkg/BdsDxe: fall back to a Boot Manager Menu loop before  hanging"
changed BDS core to fall back to UI loop when no bootable option can be launched.
Now since PlatformBootManagerUnableToBoot() is added, the commit can be reverted.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 60 +++-----------------------------
 1 file changed, 4 insertions(+), 56 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 49e403e181..39b643c77a 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -634,55 +634,6 @@ BdsFormalizeEfiGlobalVariable (
   BdsFormalizeOSIndicationVariable ();
 }
 
-/**
-  Enter an infinite loop of calling the Boot Manager Menu.
-
-  This is a last resort alternative to BdsEntry() giving up for good. This
-  function never returns.
-
-  @param[in] BootManagerMenu  The EFI_BOOT_MANAGER_LOAD_OPTION located and/or
-                              created by the EfiBootManagerGetBootManagerMenu()
-                              call in BdsEntry().
-**/
-VOID
-BdsBootManagerMenuLoop (
-  IN EFI_BOOT_MANAGER_LOAD_OPTION *BootManagerMenu
-  )
-{
-  EFI_INPUT_KEY Key;
-
-  //
-  // Normally BdsDxe does not print anything to the system console, but this is
-  // a last resort -- the end-user will likely not see any DEBUG messages
-  // logged in this situation.
-  //
-  // AsciiPrint() will NULL-check gST->ConOut internally. We check gST->ConIn
-  // here to see if it makes sense to request and wait for a keypress.
-  //
-  if (gST->ConIn != NULL) {
-    AsciiPrint (
-      "%a: No bootable option or device was found.\n"
-      "%a: Press any key to enter the Boot Manager Menu.\n",
-      gEfiCallerBaseName,
-      gEfiCallerBaseName
-      );
-    BdsWaitForSingleEvent (gST->ConIn->WaitForKey, 0);
-
-    //
-    // Drain any queued keys.
-    //
-    while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {
-      //
-      // just throw away Key
-      //
-    }
-  }
-
-  for (;;) {
-    EfiBootManagerBoot (BootManagerMenu);
-  }
-}
-
 /**
 
   Service routine for BdsInstance->Entry(). Devices are connected, the @@ -1081,19 +1032,16 @@ BdsEntry (
     } while (BootSuccess);
   }
 
+  if (BootManagerMenuStatus != EFI_NOT_FOUND) {
+    EfiBootManagerFreeLoadOption (&BootManagerMenu);  }
+
   if (!BootSuccess) {
     LoadOptions = EfiBootManagerGetLoadOptions (&LoadOptionCount, LoadOptionTypePlatformRecovery);
     ProcessLoadOptions (LoadOptions, LoadOptionCount);
     EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount);
   }
 
-  //
-  // If BootManagerMenu is available, fall back to it indefinitely.
-  //
-  if (BootManagerMenuStatus != EFI_NOT_FOUND) {
-    BdsBootManagerMenuLoop (&BootManagerMenu);
-  }
-
   DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n"));
   CpuDeadLoop ();
 }
--
2.16.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()
  2018-07-04  1:50 ` [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot() Ruiyu Ni
@ 2018-07-04  3:39   ` Wang, Sunny (HPS SW)
  0 siblings, 0 replies; 19+ messages in thread
From: Wang, Sunny (HPS SW) @ 2018-07-04  3:39 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel@lists.01.org
  Cc: Sean Brogan, Michael Turner, Wang, Sunny (HPS SW)

Looks good to me. This is clearer. 
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

-----Original Message-----
From: Ruiyu Ni [mailto:ruiyu.ni@intel.com] 
Sent: Wednesday, July 04, 2018 9:51 AM
To: edk2-devel@lists.01.org
Cc: Sean Brogan <sean.brogan@microsoft.com>; Michael Turner <Michael.Turner@microsoft.com>; Wang, Sunny (HPS SW) <sunnywang@hpe.com>
Subject: [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()

When no boot option can be launched, BDS core calls
PlatformBootManagerUnableToBoot() to let platform BdsDxe handle it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Sunny Wang <sunnywang@hpe.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 39b643c77a..a25663ea43 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -1043,6 +1043,7 @@ BdsEntry (
   }
 
   DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n"));
+  PlatformBootManagerUnableToBoot ();
   CpuDeadLoop ();
 }
 
-- 
2.16.1.windows.1



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

* Re: [PATCH v4 7/9] ArmVirtPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 ` [PATCH v4 7/9] ArmVirtPkg/PlatformBDS: " Ruiyu Ni
@ 2018-07-05 12:06   ` Laszlo Ersek
  0 siblings, 0 replies; 19+ messages in thread
From: Laszlo Ersek @ 2018-07-05 12:06 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel

On 07/04/18 03:50, Ruiyu Ni wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Julien Grall <julien.grall@linaro.org>
> ---
>  .../Library/PlatformBootManagerLib/PlatformBm.c    | 62 +++++++++++++++++++++-
>  1 file changed, 61 insertions(+), 1 deletion(-)
> 
> diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
> index 62cce6a01e..bb07f5e22b 100644
> --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -3,7 +3,7 @@
>  
>    Copyright (C) 2015-2016, Red Hat, Inc.
>    Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
> -  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>  
>    This program and the accompanying materials are licensed and made available
>    under the terms and conditions of the BSD License which accompanies this
> @@ -865,3 +865,63 @@ PlatformBootManagerWaitCallback (
>      0
>      );
>  }
> +
> +/**
> +  The function is called when no boot option could be launched,
> +  including platform recovery options and options pointing to applications
> +  built into firmware volumes.
> +
> +  If this function returns, BDS attempts to enter an infinite loop.
> +**/
> +VOID
> +EFIAPI
> +PlatformBootManagerUnableToBoot (
> +  VOID
> +  )
> +{
> +  EFI_STATUS                   Status;
> +  EFI_INPUT_KEY                Key;
> +  EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu;
> +  UINTN                        Index;
> +
> +  //
> +  // BootManagerMenu doesn't contain the correct information when return status
> +  // is EFI_NOT_FOUND.
> +  //
> +  Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu);
> +  if (EFI_ERROR (Status)) {
> +    return;
> +  }
> +  //
> +  // Normally BdsDxe does not print anything to the system console, but this is
> +  // a last resort -- the end-user will likely not see any DEBUG messages
> +  // logged in this situation.
> +  //
> +  // AsciiPrint() will NULL-check gST->ConOut internally. We check gST->ConIn
> +  // here to see if it makes sense to request and wait for a keypress.
> +  //
> +  if (gST->ConIn != NULL) {
> +    AsciiPrint (
> +      "%a: No bootable option or device was found.\n"
> +      "%a: Press any key to enter the Boot Manager Menu.\n",
> +      gEfiCallerBaseName,
> +      gEfiCallerBaseName
> +      );
> +    Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
> +    ASSERT_EFI_ERROR (Status);
> +    ASSERT (Index == 0);
> +
> +    //
> +    // Drain any queued keys.
> +    //
> +    while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {
> +      //
> +      // just throw away Key
> +      //
> +    }
> +  }
> +
> +  for (;;) {
> +    EfiBootManagerBoot (&BootManagerMenu);
> +  }
> +}
> 

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

Thank you, Ray!
Laszlo


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

* Re: [PATCH v4 0/9] Add platform hook for ultimate boot failure.
  2018-07-04  1:55 ` [PATCH v4 0/9] Add platform hook for ultimate boot failure Ni, Ruiyu
@ 2018-07-05 12:07   ` Laszlo Ersek
  0 siblings, 0 replies; 19+ messages in thread
From: Laszlo Ersek @ 2018-07-05 12:07 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel

On 07/04/18 03:55, Ni, Ruiyu wrote:
> On 7/4/2018 9:50 AM, Ruiyu Ni wrote:
>> v4:
>>    1. adds missing PlatformBootManagerLib instances modification for
>>       platform ArmPkg and ArmVirtPkg.
>>    2. Remove single quote in #1/9
>>    3. Wrap the long comments in #3/9
>>
>> Ruiyu Ni (9):
>>    MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot
>>    CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot
>>    OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot
>>    Nt32Pkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>>    QuarkPlatform/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>>    ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>>    ArmVirtPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
>>    MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"
>>    MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()
>>
>>   ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18 ++++++-
>>   .../Library/PlatformBootManagerLib/PlatformBm.c    | 62
>> +++++++++++++++++++++-
>>   .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
>>   .../Include/Library/PlatformBootManagerLib.h       | 13 +++++
>>   .../PlatformBootManager.c                          | 19 ++++++-
>>   MdeModulePkg/Universal/BdsDxe/BdsEntry.c           | 61
>> ++-------------------
>>   .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
>>   .../Library/PlatformBootManagerLib/BdsPlatform.c   | 61
>> ++++++++++++++++++++-
>>   .../PlatformBootManagerLib/PlatformBootManager.c   | 19 ++++++-
>>   9 files changed, 228 insertions(+), 63 deletions(-)
>>
> I will take leave for 1.5 weeks and will not be back until next.next
> Monday.
> Because there are still some internal platform codes that need
> PlatformBootManagerLib modifications which I will make after I am back,
> the open source check-ins will be deferred after the internal
> modification is done.
> 

Makes sense. Thanks!
Laszlo


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

* Re: [PATCH v4 6/9] ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-04  1:50 ` [PATCH v4 6/9] ArmPkg/PlatformBDS: " Ruiyu Ni
@ 2018-07-11 14:21   ` Ard Biesheuvel
  2018-07-16  9:07     ` Ni, Ruiyu
  0 siblings, 1 reply; 19+ messages in thread
From: Ard Biesheuvel @ 2018-07-11 14:21 UTC (permalink / raw)
  To: Ruiyu Ni; +Cc: edk2-devel@lists.01.org, Leif Lindholm

On 4 July 2018 at 03:50, Ruiyu Ni <ruiyu.ni@intel.com> wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> index 079f1552d5..f9c71d430c 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -3,7 +3,7 @@
>
>    Copyright (C) 2015-2016, Red Hat, Inc.
>    Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
> -  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>    Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
>
>    This program and the accompanying materials are licensed and made available
> @@ -766,3 +766,19 @@ PlatformBootManagerWaitCallback (
>      Print (L".");
>    }
>  }
> +
> +/**
> +  The function is called when no boot option could be launched,
> +  including platform recovery options and options pointing to applications
> +  built into firmware volumes.
> +
> +  If this function returns, BDS attempts to enter an infinite loop.
> +**/
> +VOID
> +EFIAPI
> +PlatformBootManagerUnableToBoot (
> +  VOID
> +  )
> +{
> +  return;
> +}
> --
> 2.16.1.windows.1
>


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

* Re: [PATCH v4 6/9] ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-11 14:21   ` Ard Biesheuvel
@ 2018-07-16  9:07     ` Ni, Ruiyu
  2018-07-16 11:01       ` Ard Biesheuvel
  0 siblings, 1 reply; 19+ messages in thread
From: Ni, Ruiyu @ 2018-07-16  9:07 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel@lists.01.org, Leif Lindholm

Can someone give a r-b for this patch?
Is Ack-by enough for a check-in?

Thanks/Ray

> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: Wednesday, July 11, 2018 10:21 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>
> Cc: edk2-devel@lists.01.org; Leif Lindholm <leif.lindholm@linaro.org>
> Subject: Re: [PATCH v4 6/9] ArmPkg/PlatformBDS: Implement
> PlatformBootManagerUnableToBoot
> 
> On 4 July 2018 at 03:50, Ruiyu Ni <ruiyu.ni@intel.com> wrote:
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> > ---
> >  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18
> > +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> > b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> > index 079f1552d5..f9c71d430c 100644
> > --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> > +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
> > @@ -3,7 +3,7 @@
> >
> >    Copyright (C) 2015-2016, Red Hat, Inc.
> >    Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
> > -  Copyright (c) 2004 - 2016, Intel Corporation. All rights
> > reserved.<BR>
> > +  Copyright (c) 2004 - 2018, Intel Corporation. All rights
> > + reserved.<BR>
> >    Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
> >
> >    This program and the accompanying materials are licensed and made
> > available @@ -766,3 +766,19 @@ PlatformBootManagerWaitCallback (
> >      Print (L".");
> >    }
> >  }
> > +
> > +/**
> > +  The function is called when no boot option could be launched,
> > +  including platform recovery options and options pointing to
> > +applications
> > +  built into firmware volumes.
> > +
> > +  If this function returns, BDS attempts to enter an infinite loop.
> > +**/
> > +VOID
> > +EFIAPI
> > +PlatformBootManagerUnableToBoot (
> > +  VOID
> > +  )
> > +{
> > +  return;
> > +}
> > --
> > 2.16.1.windows.1
> >

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

* Re: [PATCH v4 6/9] ArmPkg/PlatformBDS: Implement PlatformBootManagerUnableToBoot
  2018-07-16  9:07     ` Ni, Ruiyu
@ 2018-07-16 11:01       ` Ard Biesheuvel
  0 siblings, 0 replies; 19+ messages in thread
From: Ard Biesheuvel @ 2018-07-16 11:01 UTC (permalink / raw)
  To: Ni, Ruiyu; +Cc: edk2-devel@lists.01.org, Leif Lindholm



> On 16 Jul 2018, at 17:07, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
> 
> Can someone give a r-b for this patch?
> Is Ack-by enough for a check-in?

Hi Ray,

Please go ahead and merge this patch with my ack.

Ard.

> 
>> -----Original Message-----
>> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Sent: Wednesday, July 11, 2018 10:21 PM
>> To: Ni, Ruiyu <ruiyu.ni@intel.com>
>> Cc: edk2-devel@lists.01.org; Leif Lindholm <leif.lindholm@linaro.org>
>> Subject: Re: [PATCH v4 6/9] ArmPkg/PlatformBDS: Implement
>> PlatformBootManagerUnableToBoot
>> 
>>> On 4 July 2018 at 03:50, Ruiyu Ni <ruiyu.ni@intel.com> wrote:
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
>>> Cc: Leif Lindholm <leif.lindholm@linaro.org>
>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> 
>> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> 
>>> ---
>>> ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 18
>>> +++++++++++++++++-
>>> 1 file changed, 17 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>>> b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>>> index 079f1552d5..f9c71d430c 100644
>>> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>>> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
>>> @@ -3,7 +3,7 @@
>>> 
>>>   Copyright (C) 2015-2016, Red Hat, Inc.
>>>   Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
>>> -  Copyright (c) 2004 - 2016, Intel Corporation. All rights
>>> reserved.<BR>
>>> +  Copyright (c) 2004 - 2018, Intel Corporation. All rights
>>> + reserved.<BR>
>>>   Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
>>> 
>>>   This program and the accompanying materials are licensed and made
>>> available @@ -766,3 +766,19 @@ PlatformBootManagerWaitCallback (
>>>     Print (L".");
>>>   }
>>> }
>>> +
>>> +/**
>>> +  The function is called when no boot option could be launched,
>>> +  including platform recovery options and options pointing to
>>> +applications
>>> +  built into firmware volumes.
>>> +
>>> +  If this function returns, BDS attempts to enter an infinite loop.
>>> +**/
>>> +VOID
>>> +EFIAPI
>>> +PlatformBootManagerUnableToBoot (
>>> +  VOID
>>> +  )
>>> +{
>>> +  return;
>>> +}
>>> --
>>> 2.16.1.windows.1
>>> 


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

end of thread, other threads:[~2018-07-16 11:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04  1:50 [PATCH v4 0/9] Add platform hook for ultimate boot failure Ruiyu Ni
2018-07-04  1:50 ` [PATCH v4 1/9] MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot Ruiyu Ni
2018-07-04  3:39   ` Wang, Sunny (HPS SW)
2018-07-04  1:50 ` [PATCH v4 2/9] CorebootPayload/PlatformBDS: Impl PlatformBootManagerUnableToBoot Ruiyu Ni
2018-07-04  1:50 ` [PATCH v4 3/9] OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot Ruiyu Ni
2018-07-04  1:50 ` [PATCH v4 4/9] Nt32Pkg/PlatformBDS: " Ruiyu Ni
2018-07-04  1:50 ` [PATCH v4 5/9] QuarkPlatform/PlatformBDS: " Ruiyu Ni
2018-07-04  1:50 ` [PATCH v4 6/9] ArmPkg/PlatformBDS: " Ruiyu Ni
2018-07-11 14:21   ` Ard Biesheuvel
2018-07-16  9:07     ` Ni, Ruiyu
2018-07-16 11:01       ` Ard Biesheuvel
2018-07-04  1:50 ` [PATCH v4 7/9] ArmVirtPkg/PlatformBDS: " Ruiyu Ni
2018-07-05 12:06   ` Laszlo Ersek
2018-07-04  1:50 ` [PATCH v4 8/9] MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging" Ruiyu Ni
2018-07-04  3:39   ` Wang, Sunny (HPS SW)
2018-07-04  1:50 ` [PATCH v4 9/9] MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot() Ruiyu Ni
2018-07-04  3:39   ` Wang, Sunny (HPS SW)
2018-07-04  1:55 ` [PATCH v4 0/9] Add platform hook for ultimate boot failure Ni, Ruiyu
2018-07-05 12:07   ` Laszlo Ersek

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