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 08793AC17FD for ; Tue, 31 Oct 2023 22:27:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=lBWVZK/gJs5SA3BD3RjhOHl1IJ9EYg9dxOiMPwjQilM=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent: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=1698791254; v=1; b=A/UC0WYXbf+Ts2NVi9YU/nT344wOr+23wm7V27E1xM0qeFUduoTna8nx0xIqFVy0E9RG/0ES 43kmbC4x1t05oN796R2LDLDfWU/b+5qpCzNWRR3LCNMeKjs1ZP807w28GfjBdERX1FCK5XNK7Lb Hn21YcnULPQHSH6PYSfDKWbw= X-Received: by 127.0.0.2 with SMTP id 0uBiYY7687511xoJSNcnNtO0; Tue, 31 Oct 2023 15:27:34 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.8908.1698791253747591276 for ; Tue, 31 Oct 2023 15:27:34 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB54E1FB; Tue, 31 Oct 2023 15:28:14 -0700 (PDT) X-Received: from [172.27.42.240] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B82423F738; Tue, 31 Oct 2023 15:27:32 -0700 (PDT) Message-ID: <58ec87dc-ce03-6ad8-681a-d815bc5c39f9@arm.com> Date: Tue, 31 Oct 2023 17:27:32 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Signal ReadyToBoot on platform recovery To: 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 , Laszlo Ersek References: <20231031173700.647004-1-ngompa@fedoraproject.org> From: "Jeremy Linton" In-Reply-To: <20231031173700.647004-1-ngompa@fedoraproject.org> 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,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3mcm0UlCArrY3KzjILAZJpzix7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="A/UC0WYX"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.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 12:37, Neal Gompa via groups.io wrote: > From: Neal Gompa >=20 > Currently, the ReadyToBoot event is only signaled when a formal Boot > Manager option is executed (in BmBoot.c -> EfiBootManagerBoot ()). >=20 > 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. >=20 > 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. >=20 > 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. >=20 > The expected behavior has been clarified in the UEFI 2.10 specification > to explicitly indicate this behavior is required for correct operation. >=20 > 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=20 spec's and code paths, but this all looks fine to me and should allow=20 the PFTF build to drop the similar patch from Pete that has been carried=20 downstream for the past couple years. As for testing the previous patch has been in the field for a couple=20 years now and i'm not aware of it causing any issues. The additional=20 restriction of limiting it to platform recovery logically makes sense,=20 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=20 and realized that apparently none of that support was ever merged? That=20 seems a bit of an oversight since its been in the spec for a few years now. >=20 > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2831 >=20 > Cc: Pete Batard > Cc: Daniel P. Berrang=C3=A9 > Cc: Gerd Hoffmann > Cc: Samer El-Haj-Mahmoud > Cc: Laszlo Ersek >=20 > Co-authored-by: Pete Batard > Signed-off-by: Neal Gompa > --- > .../Library/UefiBootManagerLib/BmLoadOption.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/Mde= ModulePkg/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; > } > =20 > + if (LoadOption->OptionType =3D=3D LoadOptionTypePlatformRecovery) { > + // > + // Signal the EVT_SIGNAL_READY_TO_BOOT event when we are about to lo= ad 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. > // -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110454): https://edk2.groups.io/g/devel/message/110454 Mute This Topic: https://groups.io/mt/102302654/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-