Sunny,
I don't like to add a library interface as a short term fix. I will provide a 
patch next week to enable platform recovery (We are still working on OS 
recovery) so that you don't need PlatformBootManagerDefaultBootFail() interface.

Thanks,
Ray

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Wang, 
Sunny (HPS SW)
Sent: Friday, October 30, 2015 6:14 PM
To: Ni, Ruiyu <ruiyu...@intel.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerDefaultBootFail to PlatformBootManagerLib

Hi Ray,
Yes, I think OS/Platform recovery feature can meet our requirement.
However, OS/Platform recovery feature has not yet been completely implemented, 
so we would like to have a short-term solution for this.
Just like Samer said, if you are OK with introducing a new StatusCode in either 
BootAllBootOptions() or DefaultBootBehavior(), I can update patch for this. 
Of cause, If you think my current patch (adding hook function) could be used 
for short-term, it would be great.
By the way, I have the other similar need as the attached email.  If you have 
time, please help to review it. Thanks! 

Regards,
Sunny Wang

-----Original Message-----
From: Ni, Ruiyu [mailto:ruiyu...@intel.com] 
Sent: Friday, October 30, 2015 2:41 PM
To: Wang, Sunny (HPS SW)
Cc: edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerDefaultBootFail to PlatformBootManagerLib
Importance: High

Sunny,
Can the OS/Platform recovery feature in UEFI spec can meet your requirement?

Thanks,
Ray

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Wang, 
Sunny (HPS SW)
Sent: Friday, October 30, 2015 11:46 AM
To: Ni, Ruiyu <ruiyu...@intel.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerDefaultBootFail to PlatformBootManagerLib

Hi Ray,
Thanks for the information.
However, the Status codes you mentioned in EfiBootManagerBoot() is for 
indicating booting a specific boot option failure rather than booting ALL boot 
options failure, so I can't use these Status codes for my purpose. The 
following two are detailed reasons:
-  I can't figure out how to know that all the boot options are booted in the 
Status code handler which is triggered by the REPORT_STATUS_CODE in 
EfiBootManagerBoot()
-  If there is no boot option in the boot order, this status code will not work 
either because BDS code doesn't call EfiBootManagerBoot().

Regards,
Sunny Wang

-----Original Message-----
From: Ni, Ruiyu [mailto:ruiyu...@intel.com]
Sent: Thursday, October 29, 2015 1:07 PM
To: El-Haj-Mahmoud, Samer
Cc: Wang, Sunny (HPS SW); edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerDefaultBootFail to PlatformBootManagerLib

Samer,
EfiBootManagerBoot() function reports the failure to load boot option and the 
failure to start boot option through status code.

//
// Report Status Code to indicate that the failure to load boot option // 
REPORT_STATUS_CODE (
  EFI_ERROR_CODE | EFI_ERROR_MINOR,
  (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR)
  );
...

//
// Report Status Code to indicate that boot failure // REPORT_STATUS_CODE (
  EFI_ERROR_CODE | EFI_ERROR_MINOR,
  (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED)
  );

Platform can hook the above two status code so that the 
PlatformBootManagerDefaultBootFail() can be avoided.

We are working on the Platform Recovery feature right now. But not sure whether 
it can be done by the end of this year.
Some spec clarification/discussion are on-going.

Thanks,
Ray

-----Original Message-----
From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
Sent: Wednesday, October 28, 2015 10:49 PM
To: Ni, Ruiyu <ruiyu...@intel.com>
Cc: Wang, Sunny (HPS SW) <sunnyw...@hpe.com>; edk2-devel@lists.01.org; 
El-Haj-Mahmoud, Samer <samer.el-haj-mahm...@hpe.com>
Subject: RE: [edk2] [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerDefaultBootFail to PlatformBootManagerLib

Ray,

The use case is in taking some platform specific action when all boot options 
have failed. I guess this is more in line with UEFI 2.5 Platform Recovery 
(section 3.4.3). Since EDK2 has not implemented that yet, and there is no 
processing of PlatformRecovery#### variables, a hook function seems to solve 
the issue for now.

I guess a Status Code could solve this as well, if you are OK with introducting 
a new StatusCode in BootAllBootOptions() or DefaultBootBehavior(). If so, Sunny 
can update the patch with this proposal.

On a separate note, what is the plan for implementing UEFI 2.5 Platform 
Recovery in EDK2?

Thanks,
--Samer






-----Original Message-----
From: Ni, Ruiyu [mailto:ruiyu...@intel.com]
Sent: Wednesday, October 28, 2015 8:18 AM
To: El-Haj-Mahmoud, Samer <samer.el-haj-mahm...@hpe.com>
Cc: Wang, Sunny (HPS SW) <sunnyw...@hpe.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerDefaultBootFail to PlatformBootManagerLib

Do you have real requirement about the boot failure notify?
Have you considered to use report status handler?

Thanks,
Ray

> 在 2015年10月27日,23:18,El-Haj-Mahmoud, Samer 
> <samer.el-haj-mahm...@hpe.com> 写道:
> 
> Reviewed-by: Samer El-Haj-Mahmoud <el...@hpe.com>
> 
> -----Original Message-----
> From: Wang, Sunny (HPS SW)
> Sent: Tuesday, October 27, 2015 4:21 AM
> To: edk2-devel@lists.01.org
> Cc: El-Haj-Mahmoud, Samer <samer.el-haj-mahm...@hpe.com>; Wang, Sunny 
> (HPS SW) <sunnyw...@hpe.com>
> Subject: [PATCH] MdeModulePkg: Add a BDS platform hook function 
> PlatformBootManagerDefaultBootFail to PlatformBootManagerLib
> 
> Add a BDS platform hook function PlatformBootManagerDefaultBootFail to 
> PlatformBootManagerLib
> 
> Why we need this hook function :
> 1) According to UEFI 2.5 Section 3.4.3, the 3rd paragraph, It seems we need 
> to have a hook function (PlatformBootManagerDefaultBootFail) for platform 
> firmware to do platform action like recovering or setting to a known set of 
> boot options.
> 2) This hook function is similar to IntelFrameworkModulePkg's 
> PlatformBdsLib's PlatformBdsBootFail function which was used in several 
> platforms in EDK2, so it would be helpful for other platforms to change their 
> BDS platform library from IntelFrameworkModulePkg's PlatformBdsLib to 
> MdeModulePkg's PlatformBootManagerLib in the future.
> 
> Where we call/run this hook function:
> 1) According to UEFI 2.5 Section 3.1.1, the 5th paragraph, we need to present 
> a boot manager menu to the user for the successful boot attempt, so we only 
> call PlatformBootManagerDefaultBootFail when booting enumerated boot options 
> fails.
> 
> Reference:
> 1) UEFI 2.5 Section 3.4.3, the 3rd paragraph:
>    - It is expected that this default boot will load an operating system or a 
> maintenance utility. If this is an operating system setup program it is then 
> responsible for setting the requisite environment variables for subsequent 
> boots. The platform firmware may also decide to recover or set to a known set 
> of boot options.
> 2) UEFI 2.5 Section 3.1.1, the 5th paragraph:
>    - If the boot via Boot#### returns with a status of EFI_SUCCESS, platform 
> firmware supports boot manager menu, and if firmware is configured to boot in 
> an interactive mode, the boot manager will stop processing the BootOrder 
> variable and present a boot manager menu to the user.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> 
> Signed-off-by: Sunny Wang <sunnyw...@hpe.com>
> ---
> MdeModulePkg/Include/Library/PlatformBootManagerLib.h  | 15 +++++++++++++++
> .../PlatformBootManagerLibNull/PlatformBootManager.c   | 18 ++++++++++++++++++
> MdeModulePkg/Universal/BdsDxe/BdsEntry.c               | 18 ++++++++++++++++--
> .../PlatformBootManagerLib/PlatformBootManager.c       | 18 ++++++++++++++++++
> 4 files changed, 67 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
> b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
> index 5274503..974dcc5 100644
> --- a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
> +++ b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
> @@ -3,6 +3,7 @@
>   instances to support platform-specific behavior.
> 
> Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
> +(C) Copyright 2015 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  which accompanies this 
> distribution.  The full text of the license may be found at @@ -59,4 +60,18 
> @@ PlatformBootManagerWaitCallback (
>   UINT16          TimeoutRemain
>   );
> 
> +/**
> +  Do the platform specific action after all the boot attempts are failed to 
> boot.
> +
> +  Such as:
> +    Print specific string
> +    Show the Boot Manager Menu
> +
> +**/
> +VOID
> +EFIAPI
> +PlatformBootManagerDefaultBootFail (
> +  VOID
> +  );
> +
> #endif
> diff --git
> a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.
> c
> b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.
> c
> index 1390e19..b9e5a71 100644
> ---
> a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.
> c
> +++ b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootMana
> +++ ge
> +++ r.c
> @@ -3,6 +3,7 @@
>   by IBV/OEM.
> 
> Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
> +(C) Copyright 2015 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  which accompanies this 
> distribution.  The full text of the license may be found at @@ -65,3 +66,20 
> @@ PlatformBootManagerWaitCallback (  {
>   return;
> }
> +
> +/**
> +  Do the platform specific action after all the boot attempts are failed to 
> boot.
> +
> +  Such as:
> +    Print specific string
> +    Show the Boot Manager Menu
> +
> +**/
> +VOID
> +EFIAPI
> +PlatformBootManagerDefaultBootFail (
> +  VOID
> +  )
> +{
> +  return;
> +}
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index c889892..729a220 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -5,8 +5,8 @@
>   After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be 
> invoked
>   to enter BDS phase.
> 
> -(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> 
> Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
> +(C) Copyright 2015 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  which accompanies this 
> distribution.  The full text of the license may be found at @@ -532,6 +532,12 
> @@ DefaultBootBehavior (
>     //
>     // Show the Boot Manager Menu after successful boot
>     //
> +    // If the boot via Boot#### returns with a status of EFI_SUCCESS, 
> platform firmware 
> +    // supports boot manager menu, and if firmware is configured to boot in 
> an interactive 
> +    // mode, the boot manager will stop processing the BootOrder variable 
> and present a 
> +    // boot manager menu to the user.
> +    //                 -- UEFI 2.5 Section 3.1.1 Boot Manager Programming, 
> the 5th paragraph
> +    //
>     EfiBootManagerBoot (&BootManagerMenu);
>   } else {
>     EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount); @@ -542,13 
> +548,21 @@ DefaultBootBehavior (
>     // devices followed by all fixed media devices. The order within each 
> group is undefined.
>     // These new default boot options are not saved to non volatile 
> storage.The boot manger
>     // will then attempt toboot from each boot option.
> -    //                            -- Chapter 3.3 Boot Manager Programming, 
> the 2nd paragraph
> +    //                   -- UEFI 2.4 Section 3.3 Boot Manager Programming, 
> the 2nd paragraph
>     //
>     EfiBootManagerConnectAll ();
>     BootOptions = BdsEnumerateBootOptions (&BootOptionCount);
> 
>     if (!BootAllBootOptions (BootOptions, BootOptionCount)) {
>       DEBUG ((EFI_D_ERROR, "[Bds]No bootable device!\n"));
> +      //
> +      // The platform firmware may decide to recover or set to a known set 
> of boot options.
> +      //
> +      PlatformBootManagerDefaultBootFail ();
> +    } else {
> +      //
> +      // Show the Boot Manager Menu after successful boot.
> +      //
>       EfiBootManagerBoot (&BootManagerMenu);
>     }
>   }
> diff --git
> a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index e944105..db973c0 100644
> --- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> +++ b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> @@ -3,6 +3,7 @@
>   by IBV/OEM.
> 
> Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
> +(C) Copyright 2015 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  which accompanies this 
> distribution.  The full text of the license may be found at @@ -280,3 +281,20 
> @@ PlatformBootManagerWaitCallback (
>     0
>     );
> }
> +
> +/**
> +  Do the platform specific action after all the boot attempts are failed to 
> boot.
> +
> +  Such as:
> +    Print specific string
> +    Show the Boot Manager Menu
> +
> +**/
> +VOID
> +EFIAPI
> +PlatformBootManagerDefaultBootFail (
> +  VOID
> +  )
> +{
> +  return;
> +}
> --
> 2.5.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

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

Reply via email to