From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nwk-aaemail-lapp02.apple.com (nwk-aaemail-lapp02.apple.com [17.151.62.67]) by mx.groups.io with SMTP id smtpd.web11.2328.1570810422462076598 for ; Fri, 11 Oct 2019 09:13:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=NDbjRWHt; spf=pass (domain: apple.com, ip: 17.151.62.67, mailfrom: afish@apple.com) Received: from pps.filterd (nwk-aaemail-lapp02.apple.com [127.0.0.1]) by nwk-aaemail-lapp02.apple.com (8.16.0.27/8.16.0.27) with SMTP id x9BGC8gT016822; Fri, 11 Oct 2019 09:13:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=sender : content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=20180706; bh=uUeCWncLUCR65MO42tBG0k/zk04CdZAulrzEH4DylIg=; b=NDbjRWHtuMVWiwyHKPlAoZmV3oAcOhZI0/atoLU64nrR3zRdyyJ2Uz9j+35bVBEORPuF W9NodPjTWCQdblKF93A6fa4e8W0MiDzrUe4dhQQ8g0gRKuDqIX48mZNPeHRy5ocMLz4N cI7zL3RY3OMEMhB3FRmwCiDQabBUP1oEzHtIwxYJR/Kk25RLKMSf8jhUN1ijedXDC3Eh x7kGY3MoJQDO79gM1Se89tZPFrZhJTg7sEIyRfmB9VqOYYVGIHgdeVwZJJ4EO5DXiGy7 Y1+ablql5WOfGx0141NdF8cS6Q72p9tmuDiNjX0v5jj4HNaE8IY5vGUgDEJxEp23II7S iw== Received: from ma1-mtap-s02.corp.apple.com (ma1-mtap-s02.corp.apple.com [17.40.76.6]) by nwk-aaemail-lapp02.apple.com with ESMTP id 2veqrmu3c0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 11 Oct 2019 09:13:40 -0700 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by ma1-mtap-s02.corp.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPS id <0PZ700JXTX2Q1C40@ma1-mtap-s02.corp.apple.com>; Fri, 11 Oct 2019 09:13:39 -0700 (PDT) Received: from process_milters-daemon.nwk-mmpp-sz09.apple.com by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) id <0PZ700M00WTHN900@nwk-mmpp-sz09.apple.com>; Fri, 11 Oct 2019 09:13:35 -0700 (PDT) X-Va-A: X-Va-T-CD: 1940670cc293356905f567fb1bae988b X-Va-E-CD: cf32b4f3f78fae560a18723452edbc35 X-Va-R-CD: ee16973f71e18d2094a81b62c4e963e5 X-Va-CD: 0 X-Va-ID: f48af424-200a-4c46-99fa-9c380b64fddb X-V-A: X-V-T-CD: 1940670cc293356905f567fb1bae988b X-V-E-CD: cf32b4f3f78fae560a18723452edbc35 X-V-R-CD: ee16973f71e18d2094a81b62c4e963e5 X-V-CD: 0 X-V-ID: b760aa6c-7811-40aa-af05-478d4bf8c4d8 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-11_09:,, signatures=0 Received: from [17.235.46.243] (unknown [17.235.46.243]) by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPSA id <0PZ7007T8X2KM140@nwk-mmpp-sz09.apple.com>; Fri, 11 Oct 2019 09:13:35 -0700 (PDT) Sender: afish@apple.com MIME-version: 1.0 (Mac OS X Mail 13.0 \(3594.4.17\)) Subject: Re: [PATCH 1/1] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 From: "Andrew Fish" In-reply-to: <20191011152451.14740-1-pete@akeo.ie> Date: Fri, 11 Oct 2019 09:13:31 -0700 Cc: devel@edk2.groups.io, lersek@redhat.com, liming.gao@intel.com Message-id: <9C673E1F-A694-4822-BBEE-309B32E480D3@apple.com> References: <20191011152451.14740-1-pete@akeo.ie> To: Pete Batard X-Mailer: Apple Mail (2.3594.4.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-11_09:,, signatures=0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Pete, I agree I was also thinking that and forgot to mention it in my email. = Not enough coffee in my system.=20 Thanks, Andrew Fish > On Oct 11, 2019, at 8:24 AM, Pete Batard wrote: >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2266 >=20 > 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. >=20 > 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. >=20 > We also change one variable name to make the code more explicit. >=20 > Signed-off-by: Pete Batard > --- > OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 13 = ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c = b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > index 70df6b841acc..352163436e10 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > @@ -1631,9 +1631,16 @@ 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 +1650,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 >=20