From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE3A2202E5305 for ; Fri, 29 Jun 2018 00:25:35 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 00:25:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="70942481" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.4]) ([10.239.9.4]) by orsmga002.jf.intel.com with ESMTP; 29 Jun 2018 00:25:34 -0700 To: Laszlo Ersek , "Wang, Sunny (HPS SW)" , "edk2-devel@lists.01.org" Cc: Michael Turner References: <20180628074020.53444-1-ruiyu.ni@intel.com> <01641a9a-d151-283f-28e0-5db34527b558@redhat.com> From: "Ni, Ruiyu" Message-ID: <3d30e2d6-de45-0348-4f03-56759b7091b1@Intel.com> Date: Fri, 29 Jun 2018 15:25:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <01641a9a-d151-283f-28e0-5db34527b558@redhat.com> Subject: Re: [PATCH] MdeModulePkg/UefiBootManagerLib: handle ultimate boot failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 07:25:36 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 6/28/2018 11:04 PM, Laszlo Ersek wrote: > Personally I'd be very happy with the current version of the patch as > well, but I agree Sunny's request makes sense. How about this, for > BdsDxe: > >> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c >> index 3191a986304b..cb4196a56c87 100644 >> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c >> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c >> @@ -1088,11 +1088,26 @@ BdsEntry ( >> EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount); >> } >> >> - // >> - // If BootManagerMenu is available, fall back to it indefinitely. >> - // >> - if (BootManagerMenuStatus != EFI_NOT_FOUND) { >> - BdsBootManagerMenuLoop (&BootManagerMenu); >> + if (BootManagerMenuStatus == EFI_NOT_FOUND) { >> + // >> + // Inform the platform that we're unable to boot, and that there's no >> + // BootManagerMenu. >> + // >> + EfiBootManagerUnableToBoot (NULL); >> + } else { >> + // >> + // Inform the platform that we're unable to boot. The platform may enter >> + // BootManagerMenu with the public EfiBootManagerBoot() interface, if so >> + // desired. >> + // >> + Status = EfiBootManagerUnableToBoot (&BootManagerMenu); >> + if (EFI_ERROR (Status)) { >> + // >> + // The platform didn't register a callback; fall back to BootManagerMenu >> + // internally, indefinitely. >> + // >> + BdsBootManagerMenuLoop (&BootManagerMenu); >> + } >> } >> >> DEBUG ((EFI_D_ERROR, "[Bds] Unable to boot!\n")); > Note that this requires changing the declaration of > EfiBootManagerUnableBoot(), so that it takes the parameter > > IN EFI_BOOT_MANAGER_LOAD_OPTION *BootManagerMenu OPTIONAL > > The structure EFI_BOOT_MANAGER_LOAD_OPTION is from > "MdeModulePkg/Include/Library/UefiBootManagerLib.h", so it is OK to > expose to platforms. > > Just an idea, of course. Platform can use EfiBootManagerGetBootManagerMenu() to get the boot manager menu. So there is no need to add an extra parameter for EfiBootManagerUnableToBoot(). I agree with your idea to only pop up boot manager menu as the default behavior. > > --*-- > > Anyway, for a v2, I have some superficial reuqests / questions for Ray: > > * Please replace "UNABLE_BOOT" with "UNABLE_TO_BOOT". Same for > "UnableBoot" and "UnableToBoot". > > (Compare: READY_TO_BOOT, ReadyToBoot.) > > Note that this affects the commit message too. OK. > > * Should we split the BdsDxe modification to a separate patch? OK. > > * Can you please reference > in the commit > message? OK. > > Thank you very much Ray for doing this! > Laszlo -- Thanks, Ray