From nobody Sun Apr 28 07:28:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48909+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48909+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1571065408; cv=none; d=zoho.com; s=zohoarc; b=GuH/J2roKTCd1OsjmVNI8PjugcsulRJ5jIplm3SQRR9IMDjLwAHAhikbVTjc0rzwxyKSWdmwwveJVqkH4aEA18NYZAC4LB2tm0OqJbuNOtIyk1uZGAKQuPN+vTpSxcGsuT1rjHgvPPD8uDPw4wU6yVvMRb1oDLhGrShAiM2OjVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571065408; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Pi0FuMGqcjgnSFN/aXs5hMRFaLKNQXaYof/HvKYotOw=; b=kMUN896WDPcCdnjh4ACLSo606bReNhFSPr1skXag2QaI1w7Y3wYunOhBoxIprCVQ04HTZx0K9GEprJWNMBmNTFGYkJITLT8UY4CDY5F/dqIKKbtfCwhaNm6vEuAitC9ZXBgJuX1AZTcQxh1uR++fp/9zcGkPAPTuxL+5x32U0gY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48909+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157106540847465.64928611425614; Mon, 14 Oct 2019 08:03:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4sKsYY1788612xT59wzB4X5o; Mon, 14 Oct 2019 08:03:27 -0700 X-Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web12.4207.1571065406867439576 for ; Mon, 14 Oct 2019 08:03:27 -0700 X-Received: by mail-wm1-f65.google.com with SMTP id v17so17096149wml.4 for ; Mon, 14 Oct 2019 08:03:26 -0700 (PDT) X-Gm-Message-State: z1TleC2WBcFRfMHfhxREMbEDx1787277AA= X-Google-Smtp-Source: APXvYqxMZ6RDRX5bOlCgu9qqOrPT32d08akCBYlGghLCDJ0vJEyPh8EZQ+cmUcrMzvsEFOdmflmPTw== X-Received: by 2002:a1c:f709:: with SMTP id v9mr16183085wmh.62.1571065405066; Mon, 14 Oct 2019 08:03:25 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.40.122]) by smtp.gmail.com with ESMTPSA id k24sm391750wmi.1.2019.10.14.08.03.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Oct 2019 08:03:24 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: afish@apple.com, lersek@redhat.com, liming.gao@intel.com Subject: [edk2-devel] [PATCH v2 1/2] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 Date: Mon, 14 Oct 2019 16:03:10 +0100 Message-Id: <20191014150311.16740-2-pete@akeo.ie> In-Reply-To: <20191014150311.16740-1-pete@akeo.ie> References: <20191014150311.16740-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571065407; bh=g05ON1UsPxLFhWYcnFMMXRI7T1GGAxfvZob7ygcKij0=; h=Cc:Date:From:Reply-To:Subject:To; b=a/zp40//6sVNkpthzBHnofBwDVTaMoW0XoPVXLm5/z2VaG+hNxVRPr4fWKko6l6nTCy 0g9PB2Uvwks5wXidSCw1HtDUfvCM3k7cxW50/Yw0mMlFbBS3nFhNDyZ3EP+sqM/WmOHKh jT2kaQdVLji76gXYNqbDN7bKAm/5a+CV/x4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2266 Independently of how we decide to address other aspects of the regression introduced with commit 2de1f611be06ded3a59726a4052a9039be7d459b, it doesn't make much sense to call for a progress update if PcdPlatformBootTimeOut is zero. PcdPlatformBootTimeOut 0, which is the cause of the bug (division by zero) should be considered to indicate that a platform is not interested in displaying a progress report, so we alter PlatformBootManagerWaitCallback to behave that way. We also change one variable name to make the code more explicit. Signed-off-by: Pete Batard Reviewed-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index 70df6b841acc..8af9b71f18a3 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -1631,9 +1631,18 @@ PlatformBootManagerWaitCallback ( { EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White; - UINT16 Timeout; + UINT16 TimeoutInitial; =20 - Timeout =3D PcdGet16 (PcdPlatformBootTimeOut); + TimeoutInitial =3D PcdGet16 (PcdPlatformBootTimeOut); + + // + // If PcdPlatformBootTimeOut is set to zero, then we consider + // that no progress update should be enacted (since we'd only + // ever display a one-shot progress of either 0% or 100%). + // + if (TimeoutInitial =3D=3D 0) { + return; + } =20 Black.Raw =3D 0x00000000; White.Raw =3D 0x00FFFFFF; @@ -1643,7 +1652,7 @@ PlatformBootManagerWaitCallback ( Black.Pixel, L"Start boot option", White.Pixel, - (Timeout - TimeoutRemain) * 100 / Timeout, + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial, 0 ); } --=20 2.21.0.windows.1 -=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 (#48909): https://edk2.groups.io/g/devel/message/48909 Mute This Topic: https://groups.io/mt/34534294/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 Sun Apr 28 07:28:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48910+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48910+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1571065409; cv=none; d=zoho.com; s=zohoarc; b=a+phMQkt0dq6sibKDn9R0E5tjLyRkCCjrvsIg+QYnNjnjm2+R0EIZYSvHyb46umNFGm90PoJTBuyfhbqd2xoCE/nI3ARhf4oQ9oWQUeqMWDASqOkNb10gmMp/hQ+QF1OMT5PzD+8IFHMW4HWb/pkrv/uv7jRr7Tyhx6CPfKeZIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571065409; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=xzmFEDirDrBR0uWLMNrco+8hN/qh5vN8MN1QNBgzd/g=; b=Vouc8GwMjMsnOv0yiVu3PM28e9uvlVxOnJmnmPLMngnVaiiz4OVFnGrqLwZnkGw9rUQosTKO9f7GTMEekig2G/tDs5vsnc/vNoieWlhgTEwhnexisqxD6vN7qFj+yj73Vt7EGuqllIE1dONG0ybad28drGJTEI8XntZDkeWPP0M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48910+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1571065409420659.3301955067355; Mon, 14 Oct 2019 08:03:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qs2MYY1788612x0FX3EdjOgd; Mon, 14 Oct 2019 08:03:29 -0700 X-Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web11.4166.1571065408153138104 for ; Mon, 14 Oct 2019 08:03:28 -0700 X-Received: by mail-wr1-f67.google.com with SMTP id o18so20091717wrv.13 for ; Mon, 14 Oct 2019 08:03:27 -0700 (PDT) X-Gm-Message-State: n7UQKv6GIgmEwVRB95zuKHqex1787277AA= X-Google-Smtp-Source: APXvYqxgS+x9nE1VSznuwu39Y0Ahm/QfMKbI8BWgEHy5dVPTamMhtWqIsI4OqRu0ErKdoAECNfNPiw== X-Received: by 2002:adf:fad2:: with SMTP id a18mr27899916wrs.279.1571065406411; Mon, 14 Oct 2019 08:03:26 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.40.122]) by smtp.gmail.com with ESMTPSA id k24sm391750wmi.1.2019.10.14.08.03.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Oct 2019 08:03:25 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: afish@apple.com, lersek@redhat.com, liming.gao@intel.com Subject: [edk2-devel] [PATCH v2 2/2] ArmVirtPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 Date: Mon, 14 Oct 2019 16:03:11 +0100 Message-Id: <20191014150311.16740-3-pete@akeo.ie> In-Reply-To: <20191014150311.16740-1-pete@akeo.ie> References: <20191014150311.16740-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571065409; bh=dHV+pDXYk2J8ZAL1gMEnZperHccBuAON39PEXef5Y04=; h=Cc:Date:From:Reply-To:Subject:To; b=tqdFPEK9VATm9/TbOVgT/933QEsAmt9+4rGaTKTiMFVQ+93edutCcCtAUc024eXw+zH KS8RL1wcnegk+S5IWYeMP+93cRT6N7XRpuxiJrIdGqYsmB8QUHzLNYBxckGpcZUBmuqQh UfnPNlDpKN1b203bwKMDeoSiu3CUYpeS7s0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Similar to what we now do for OVMF, we need to consider the possibility that PlatformBootManagerWaitCallback () may be called with a PcdPlatformBootTimeOut that was set to zero, in which case the call should simply return. We also change the initial timeout variable name to make the code explicit. Signed-off-by: Pete Batard Reviewed-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVi= rtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 30c015eec5b0..5f6cfe64daca 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -842,9 +842,17 @@ PlatformBootManagerWaitCallback ( { EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White; - UINT16 Timeout; + UINT16 TimeoutInitial; =20 - Timeout =3D PcdGet16 (PcdPlatformBootTimeOut); + TimeoutInitial =3D PcdGet16 (PcdPlatformBootTimeOut); + + // + // If PcdPlatformBootTimeOut is set to zero, then we consider + // that no progress update should be enacted. + // + if (TimeoutInitial =3D=3D 0) { + return; + } =20 Black.Raw =3D 0x00000000; White.Raw =3D 0x00FFFFFF; @@ -854,7 +862,7 @@ PlatformBootManagerWaitCallback ( Black.Pixel, L"Start boot option", White.Pixel, - (Timeout - TimeoutRemain) * 100 / Timeout, + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial, 0 ); } --=20 2.21.0.windows.1 -=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 (#48910): https://edk2.groups.io/g/devel/message/48910 Mute This Topic: https://groups.io/mt/34534296/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-