From nobody Mon Apr 29 13:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55378+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55378+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583315063; cv=none; d=zohomail.com; s=zohoarc; b=KirTFbTCOQH+I6ChT7onSkgyA/+OJ1s2aiLHobVfduRsNWqSdt1Kf1l0Jd80pgIGwzPhf64BeLaTUBKZp0vf96YzWPTax0By73xcymIKUI7uofCBt0PGLd8tEY8v/yTidERyk3lg8NZ2q/oJqzQ+of8qrWcZFWt0LEZhKybKYi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583315063; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=446Ff2X67KeOBT6Itv/RWykFGWvRPmyoJnOt/O2hydc=; b=lJ8QiZds/QGLIvsleLtduozekXyApN9gE2K16MbS/tMwmDcUyc1RljDcgNXja91onLaYWU/skq39r8u4kFE3vBuJqyDwqHas8r9W8JfBdWDN7E8waZtcslMjPQ2373y4jZA49A4cxb3w6PmGLyDC54pDxLiF7BPNf+oXnjk/nKA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55378+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583315063774238.7636785860849; Wed, 4 Mar 2020 01:44:23 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qrTwYY1788612xsrvOGkynR7; Wed, 04 Mar 2020 01:44:22 -0800 X-Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web09.9006.1583315062203790539 for ; Wed, 04 Mar 2020 01:44:22 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-kttRgcENPdmG9crIFJfiag-1; Wed, 04 Mar 2020 04:44:19 -0500 X-MC-Unique: kttRgcENPdmG9crIFJfiag-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79992800D50; Wed, 4 Mar 2020 09:44:18 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-59.ams2.redhat.com [10.36.117.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BA0619481; Wed, 4 Mar 2020 09:44:17 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 1/2] OvmfPkg/PlatformBootManagerLib: sync Timeout with PcdPlatformBootTimeOut Date: Wed, 4 Mar 2020 10:44:12 +0100 Message-Id: <20200304094413.19462-2-lersek@redhat.com> In-Reply-To: <20200304094413.19462-1-lersek@redhat.com> References: <20200304094413.19462-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: 42pnkgIS6LMGq0gSdHemjFMJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1583315062; bh=446Ff2X67KeOBT6Itv/RWykFGWvRPmyoJnOt/O2hydc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=m4KCoAJ6yrQYcaJ0shBopi75AiOU4+ywIn9lDigwBGw195EzX+TreqOpIKfUKojKYUS q24r7V5sAOMryPR96aiO34BOeOmOmXSMVsJIz3ap8ORPAX+WeeuCZOMGM0qKP6qTke0P2 Wc2BizhnkPtHqW0xHEElNEGw8LspJxKAfco= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Set the Timeout global variable to the same value as PcdPlatformBootTimeOut. This way the "setvar" command in the UEFI shell, and the "efibootmgr" command in a Linux guest, can report the front page timeout that was requested on the QEMU command line (see GetFrontPageTimeoutFromQemu()). A DEBUG_VERBOSE message is logged on success too, for our QE team's sake. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 ++ OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 26 +++= +++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index f89cce187942..c479f113b92b 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -38,6 +38,7 @@ [LibraryClasses] BaseLib MemoryAllocationLib UefiBootServicesTableLib + UefiRuntimeServicesTableLib BaseMemoryLib DebugLib PcdLib @@ -79,5 +80,6 @@ [Protocols] =20 [Guids] gEfiEndOfDxeEventGroupGuid + gEfiGlobalVariableGuid gRootBridgesConnectedEventGroupGuid gUefiShellFileGuid diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index 8af9b71f18a3..45d0ee9cc3a8 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -353,6 +353,7 @@ PlatformBootManagerBeforeConsole ( { EFI_HANDLE Handle; EFI_STATUS Status; + UINT16 FrontPageTimeout; RETURN_STATUS PcdStatus; =20 DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n")); @@ -400,9 +401,30 @@ PlatformBootManagerBeforeConsole ( =20 PlatformInitializeConsole ( XenDetected() ? gXenPlatformConsole : gPlatformConsole); - PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, - GetFrontPageTimeoutFromQemu ()); + + FrontPageTimeout =3D GetFrontPageTimeoutFromQemu (); + PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout); ASSERT_RETURN_ERROR (PcdStatus); + // + // Reflect the PCD in the standard Timeout variable. + // + Status =3D gRT->SetVariable ( + EFI_TIME_OUT_VARIABLE_NAME, + &gEfiGlobalVariableGuid, + (EFI_VARIABLE_NON_VOLATILE | + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS), + sizeof FrontPageTimeout, + &FrontPageTimeout + ); + DEBUG (( + EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE, + "%a: SetVariable(%s, %u): %r\n", + __FUNCTION__, + EFI_TIME_OUT_VARIABLE_NAME, + FrontPageTimeout, + Status + )); =20 PlatformRegisterOptionsAndKeys (); =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#55378): https://edk2.groups.io/g/devel/message/55378 Mute This Topic: https://groups.io/mt/71722700/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 13:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55380+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55380+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583315068; cv=none; d=zohomail.com; s=zohoarc; b=JGVv6wPqC4XyZCnfj7w260DTrP0IR2NzmqIUbqQY5Jg1+wSAVn8nrOsTyykWNJx8h6BbXwyyI1/6yeMG4epvHoJkPmF8clpjVlfyBVXWEflW7QrcZ+wXB2UFDZ9ZEot12DuShNrd7JRBNFNpAFoswW7FhU31MYELqDncAeGsC2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583315068; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=rqPA3tgOiUTne8d/nQRvGvj8XhrtlUV6Vdc2Lpvv/Yo=; b=BeINq9WHtY3ijsT1dyA/WUbi+MmIiBtfCEp+MbcoAVVYd5uFAyp42pvXqYog73I+XBAOGFH4TW1wLHVOzwE57JZUoAAyBikhnDPv1ZIpDREotNg0T7Ulq2GoOaDx2h2omAokvx0UQqNv6kqnUR0V1S4E1aLnEqd5LevdiLH/tyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55380+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583315068026758.4748323727077; Wed, 4 Mar 2020 01:44:28 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id jto4YY1788612x95ZTV7YEe1; Wed, 04 Mar 2020 01:44:26 -0800 X-Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.9041.1583315065520303667 for ; Wed, 04 Mar 2020 01:44:25 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-123-YVkFYRd_NqKKcOOBLYvpdw-1; Wed, 04 Mar 2020 04:44:21 -0500 X-MC-Unique: YVkFYRd_NqKKcOOBLYvpdw-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9FBF13F5; Wed, 4 Mar 2020 09:44:19 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-59.ams2.redhat.com [10.36.117.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE20D27069; Wed, 4 Mar 2020 09:44:18 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Leif Lindholm , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 2/2] ArmVirtPkg/PlatformBootManagerLib: sync Timeout with PcdPlatformBootTimeOut Date: Wed, 4 Mar 2020 10:44:13 +0100 Message-Id: <20200304094413.19462-3-lersek@redhat.com> In-Reply-To: <20200304094413.19462-1-lersek@redhat.com> References: <20200304094413.19462-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: nmFEyG0nbaOzskaMpXQtivoTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1583315066; bh=rqPA3tgOiUTne8d/nQRvGvj8XhrtlUV6Vdc2Lpvv/Yo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=woUPHYA6uPuPQQMT/V9pxXm/FXPUMS/9qkRprr0PBv3XNGoQo6qsdNxuzZECxMsfLVP IDY1q0Lf+GjnXc8hpeXNRfOfDRa0EhGtYRmWVU0Ojph01CUxuxebGdRK6bQ5H9odqG4r2 UqjNg75TzVSBivIPTflqC0lh+UcivLnHarM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Set the Timeout global variable to the same value as PcdPlatformBootTimeOut. This way the "setvar" command in the UEFI shell, and the "efibootmgr" command in a Linux guest, can report the front page timeout that was requested on the QEMU command line (see GetFrontPageTimeoutFromQemu()). A DEBUG_VERBOSE message is logged on success too, for our QE team's sake. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daude --- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 27 = ++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerL= ib.inf b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i= nf index a9d4888d4377..6fe0a1bb122b 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -68,6 +68,7 @@ [Guids] gEfiFileSystemInfoGuid gEfiFileSystemVolumeLabelInfoIdGuid gEfiEndOfDxeEventGroupGuid + gEfiGlobalVariableGuid gRootBridgesConnectedEventGroupGuid gUefiShellFileGuid =20 diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVi= rtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 5f6cfe64daca..69448ff65bde 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include =20 @@ -686,7 +687,9 @@ PlatformBootManagerBeforeConsole ( VOID ) { + UINT16 FrontPageTimeout; RETURN_STATUS PcdStatus; + EFI_STATUS Status; =20 // // Signal EndOfDxe PI Event @@ -744,9 +747,29 @@ PlatformBootManagerBeforeConsole ( // // Set the front page timeout from the QEMU configuration. // - PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, - GetFrontPageTimeoutFromQemu ()); + FrontPageTimeout =3D GetFrontPageTimeoutFromQemu (); + PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout); ASSERT_RETURN_ERROR (PcdStatus); + // + // Reflect the PCD in the standard Timeout variable. + // + Status =3D gRT->SetVariable ( + EFI_TIME_OUT_VARIABLE_NAME, + &gEfiGlobalVariableGuid, + (EFI_VARIABLE_NON_VOLATILE | + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS), + sizeof FrontPageTimeout, + &FrontPageTimeout + ); + DEBUG (( + EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE, + "%a: SetVariable(%s, %u): %r\n", + __FUNCTION__, + EFI_TIME_OUT_VARIABLE_NAME, + FrontPageTimeout, + Status + )); =20 // // Register platform-specific boot options and keyboard shortcuts. --=20 2.19.1.3.g30247aa5d201 -=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 (#55380): https://edk2.groups.io/g/devel/message/55380 Mute This Topic: https://groups.io/mt/71722703/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-