public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Subject: Re: [PATCH v2 1/2] MdeModulePkg/UefiBootManagerLib: new APIs for ultimate boot failure
Date: Sat, 30 Jun 2018 01:27:05 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BD4FF6A@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <0d0ca9c2-88fd-a69d-b22e-66a60cd37bee@redhat.com>

Laszlo,
I will post a V3 version that removes the registration mechanism, back
to the solution letting platform provides PlatformBootManagerUnableToBoot(),
based on the feedbacks I received.


> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Friday, June 29, 2018 8:41 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Michael Turner <Michael.Turner@microsoft.com>
> Subject: Re: [edk2] [PATCH v2 1/2] MdeModulePkg/UefiBootManagerLib: new
> APIs for ultimate boot failure
> 
> Hi Ray,
> 
> thanks for this patch; I only have a request for updating a comment:
> 
> On 06/29/18 08:03, Ruiyu Ni wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=982
> >
> > When no boot option could be launched including platform recovery
> > options and options pointing to applications built into firmware
> > volumes, a platform callback registered through
> > EfiBootManagerRegisterUnableToBootHandler() is called.
> >
> > 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>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Cc: Sunny Wang <sunnywang@hpe.com>
> > ---
> >  MdeModulePkg/Include/Library/UefiBootManagerLib.h | 48
> > +++++++++++++++++++++++
> > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c  | 41
> > +++++++++++++++++++
> >  2 files changed, 89 insertions(+)
> >
> > diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> > b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> > index bfc0cb86f8..453893e030 100644
> > --- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> > +++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> > @@ -800,4 +800,52 @@ EFIAPI
> >  EfiBootManagerDispatchDeferredImages (
> >    VOID
> >    );
> > +
> > +/**
> > +  The function is called when no boot option could be launched,
> > +  including platform recovery options and options pointing to
> > +applications
> > +  built into firmware volumes.
> > +
> > +  The platform may register this function to inform the user about the above
> fact.
> > +  If this function returns, BDS core attempts to enter an infinite
> > +loop of pulling
> > +  up the Boot Manager Menu (if the platform includes the Boot Manager
> Menu).
> > +  If the Boot Manager Menu is unavailable, BDS will hang.
> > +**/
> > +typedef
> > +VOID
> > +(EFIAPI *EFI_BOOT_MANAGER_UNABLE_TO_BOOT) (
> > +  VOID
> > +  );
> > +
> > +/**
> > +  Register the callback function when no boot option could be
> > +launched,
> > +  including platform recovery options and options pointing to
> > +applications
> > +  built into firmware volumes.
> > +
> > +  @param Handler  The callback function.
> > +**/
> > +VOID
> > +EFIAPI
> > +EfiBootManagerRegisterUnableToBootHandler (
> > +  EFI_BOOT_MANAGER_UNABLE_TO_BOOT  Handler
> > +  );
> > +
> > +/**
> > +  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 core attempts to enter an infinite
> > + loop of pulling  up the Boot Manager Menu (if the platform includes the Boot
> Manager Menu).
> > +  If the Boot Manager Menu is unavailable, BDS will hang.
> 
> This comment paragraph should state the following:
> 
>   If this function returns EFI_UNSUPPORTED, BDS core attempts to enter
>   an infinite loop of pulling up the Boot Manager Menu (if the platform
>   includes the Boot Manager Menu). If the Boot Manager Menu is
>   unavailable, BDS will hang.
> 
>   If this function returns EFI_SUCCESS, BDS will hang immediately.
> 
> 
> The same update should be done to the "BmBoot.c" file, below.
> 
> With this update:
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> Thanks!
> Laszlo
> 
> > +
> > +  @retval EFI_SUCCESS     The unable-to-boot callback is called successfully.
> > +  @retval EFI_UNSUPPORTED There is no unable-to-boot callback registered.
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +EfiBootManagerUnableToBoot (
> > +  VOID
> > +  );
> > +
> >  #endif
> > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > index 6a23477eb8..e59d790122 100644
> > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > @@ -19,6 +19,7 @@ EFI_RAM_DISK_PROTOCOL                        *mRamDisk
> = NULL;
> >
> >  EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION
> mBmRefreshLegacyBootOption = NULL;
> >  EFI_BOOT_MANAGER_LEGACY_BOOT                 mBmLegacyBoot              =
> NULL;
> > +EFI_BOOT_MANAGER_UNABLE_TO_BOOT              mBmUnableToBoot
> = NULL;
> >
> >  ///
> >  /// This GUID is used for an EFI Variable that stores the front
> > device pathes @@ -2461,3 +2462,43 @@
> EfiBootManagerGetBootManagerMenu (
> >    }
> >  }
> >
> > +/**
> > +  Register the callback function when no boot option could be
> > +launched,
> > +  including platform recovery options and options pointing to
> > +applications
> > +  built into firmware volumes.
> > +
> > +  @param Handler  The callback function.
> > +**/
> > +VOID
> > +EFIAPI
> > +EfiBootManagerRegisterUnableToBootHandler (
> > +  EFI_BOOT_MANAGER_UNABLE_TO_BOOT  Handler
> > +  )
> > +{
> > +  mBmUnableToBoot = Handler;
> > +}
> > +
> > +/**
> > +  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 core attempts to enter an infinite
> > + loop of pulling  up the Boot Manager Menu (if the platform includes the Boot
> Manager Menu).
> > +  If the Boot Manager Menu is unavailable, BDS will hang.
> > +
> > +  @retval EFI_SUCCESS     The unable-to-boot callback is called successfully.
> > +  @retval EFI_UNSUPPORTED There is no unable-to-boot callback registered.
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +EfiBootManagerUnableToBoot (
> > +  VOID
> > +  )
> > +{
> > +  if (mBmUnableToBoot != NULL) {
> > +    mBmUnableToBoot ();
> > +    return EFI_SUCCESS;
> > +  }
> > +  return EFI_UNSUPPORTED;
> > +}
> >


  reply	other threads:[~2018-06-30  1:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29  6:03 [PATCH v2 0/2] Enhance BDS to handle ultimate boot failure Ruiyu Ni
2018-06-29  6:03 ` [PATCH v2 1/2] MdeModulePkg/UefiBootManagerLib: new APIs for " Ruiyu Ni
2018-06-29  6:43   ` Wang, Sunny (HPS SW)
2018-06-29 12:40   ` Laszlo Ersek
2018-06-30  1:27     ` Ni, Ruiyu [this message]
2018-06-29  6:03 ` [PATCH v2 2/2] MdeModulePkg/BdsDxe: Call *UnableToBoot() " Ruiyu Ni
2018-06-29  6:43   ` Wang, Sunny (HPS SW)
2018-06-29 12:43   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=734D49CCEBEEF84792F5B80ED585239D5BD4FF6A@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox