From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id EA641740040 for ; Thu, 2 Nov 2023 10:35:28 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=oUYfvOZDWck7DVCrLzjOkniqTXcvPcH9nrOU5gaJUVI=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1698921327; v=1; b=oqwMZe+RQyBG8iUBAh85aOFCYM/8Ff6d+U/hGZ6kfXrNrgDi7e2qWgFWULe/iH3w598zclb+ qi8Szt1twyNrsvOUnOhxVUfVvE3R6QyuJ8TjZb17poylku2t8F4tPCwa0ihie4STfPI8Rb6oupa q6We8cPp9owi+oo5KUikIDjE= X-Received: by 127.0.0.2 with SMTP id QC5ZYY7687511xKdbpKOktSS; Thu, 02 Nov 2023 03:35:27 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.27936.1698921326688811643 for ; Thu, 02 Nov 2023 03:35:26 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-_iDeyvEAMx-hFe30hT7wUg-1; Thu, 02 Nov 2023 06:35:22 -0400 X-MC-Unique: _iDeyvEAMx-hFe30hT7wUg-1 X-Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73200380627E; Thu, 2 Nov 2023 10:35:22 +0000 (UTC) X-Received: from [10.39.195.76] (unknown [10.39.195.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CA57492BE0; Thu, 2 Nov 2023 10:35:21 +0000 (UTC) Message-ID: Date: Thu, 2 Nov 2023 11:35:19 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Signal ReadyToBoot on platform recovery To: Jeremy Linton , devel@edk2.groups.io, ngompa13@gmail.com Cc: Neal Gompa , Pete Batard , =?UTF-8?Q?Daniel_P_=2e_Berrang=c3=a9?= , Gerd Hoffmann , Samer El-Haj-Mahmoud References: <20231031173700.647004-1-ngompa@fedoraproject.org> <58ec87dc-ce03-6ad8-681a-d815bc5c39f9@arm.com> From: "Laszlo Ersek" In-Reply-To: <58ec87dc-ce03-6ad8-681a-d815bc5c39f9@arm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 8ywdB42tl8M9oDkx6RnGf64ax7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=oqwMZe+R; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 10/31/23 23:27, Jeremy Linton wrote: > On 10/31/23 12:37, Neal Gompa via groups.io wrote: >> From: Neal Gompa >> >> Currently, the ReadyToBoot event is only signaled when a formal Boot >> Manager option is executed (in BmBoot.c -> EfiBootManagerBoot ()). >> >> However, the introduction of Platform Recovery in UEFI 2.5 makes it >> necessary to signal ReadyToBoot when a Platform Recovery boot loader >> runs because otherwise it may lead to the execution of a boot loader >> that has similar requirements to a regular one that is not launched >> as a Boot Manager option. >> >> This is especially critical to ensuring that the graphical console >> is actually usable during platform recovery, as some platforms do >> rely on the ConsolePrefDxe driver, which only performs console >> initialization after ReadyToBoot is triggered. >> >> This patch fixes that behavior by calling EfiSignalEventReadyToBoot () >> in EfiBootManagerProcessLoadOption () when invoking platform recovery, >> which is the function that sets up the platform recovery boot process. >> >> The expected behavior has been clarified in the UEFI 2.10 specification >> to explicitly indicate this behavior is required for correct operation. >> >> This is a rebased version of the patch originally written by Pete Batard. > > Took me a bit to swap in that whole conversation again, and recheck the > spec's and code paths, but this all looks fine to me and should allow > the PFTF build to drop the similar patch from Pete that has been carried > downstream for the past couple years. > > As for testing the previous patch has been in the field for a couple > years now and i'm not aware of it causing any issues. The additional > restriction of limiting it to platform recovery logically makes sense, > and as far as I can see shouldn't cause any problems. > > So, > > Reviewed-by: Jeremy Linton > > > As a PS: I also went to check the ready to boot behavior for OsRecovery > and realized that apparently none of that support was ever merged? What else is there, outside of this patch, in need of upstreaming? > That seems a bit of an oversight since its been in the spec for a few years now. "ready-to-boot for OsRecovery" is new in UEFI 2.10 (according to the commit message), which is quite recent ("Aug 29, 2022"). I couldn't find the Mantis ticket in the Revision History (for 2.10) though. Laszlo > > >> >> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2831 >> >> Cc: Pete Batard >> Cc: Daniel P. Berrangé >> Cc: Gerd Hoffmann >> Cc: Samer El-Haj-Mahmoud >> Cc: Laszlo Ersek >> >> Co-authored-by: Pete Batard >> Signed-off-by: Neal Gompa >> --- >>   .../Library/UefiBootManagerLib/BmLoadOption.c         | 11 +++++++++++ >>   1 file changed, 11 insertions(+) >> >> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >> b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >> index 2087f0b91d..83a2f893e4 100644 >> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >> @@ -1416,6 +1416,17 @@ EfiBootManagerProcessLoadOption ( >>       return EFI_SUCCESS; >>     } >>   +  if (LoadOption->OptionType == LoadOptionTypePlatformRecovery) { >> +    // >> +    // Signal the EVT_SIGNAL_READY_TO_BOOT event when we are about to >> load and execute the boot option. >> +    // >> +    EfiSignalEventReadyToBoot (); >> +    // >> +    // Report Status Code to indicate ReadyToBoot was signaled >> +    // >> +    REPORT_STATUS_CODE (EFI_PROGRESS_CODE, >> (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)); >> +  } >> + >>     // >>     // Load and start the load option. >>     // > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110519): https://edk2.groups.io/g/devel/message/110519 Mute This Topic: https://groups.io/mt/102302654/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-