From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um5lT-0001b7-4f for qemu-devel@nongnu.org; Mon, 10 Jun 2013 13:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um5lQ-0000Gj-9q for qemu-devel@nongnu.org; Mon, 10 Jun 2013 13:20:18 -0400 Date: Mon, 10 Jun 2013 12:20:05 -0500 From: Scott Wood In-Reply-To: <51B5E20A.8030906@suse.de> (from agraf@suse.de on Mon Jun 10 09:26:18 2013) Message-ID: <1370884805.18413.8@snotra> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; delsp=Yes; format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2]booke: timer: Deactivate timer for target_bit above 61 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: "qemu-devel@nongnu.org" , Wood Scott-B07421 , "qemu-ppc@nongnu.org" , Andreas =?iso-8859-1?q?F=E4rber?= , Bhushan Bharat-R65777 On 06/10/2013 09:26:18 AM, Alexander Graf wrote: > On 06/10/2013 02:47 PM, Bhushan Bharat-R65777 wrote: >>=20 >>> -----Original Message----- >>> From: Andreas F=E4rber [mailto:afaerber@suse.de] >>> Sent: Monday, June 10, 2013 5:43 PM >>> To: Bhushan Bharat-R65777 >>> Cc: qemu-ppc@nongnu.org; qemu-devel@nongnu.org; agraf@suse.de; Wood =20 >>> Scott- >>> B07421; Bhushan Bharat-R65777 >>> Subject: Re: [Qemu-devel] [PATCH v2]booke: timer: Deactivate timer =20 >>> for >>> target_bit above 61 >>>=20 >>> So IIUC we can only allow 63 bits due to signedness, thus a maximum =20 >>> of >>> (1<< 62), thus target_bit<=3D 61. >>>=20 >>> Any chance at least the comment can be worded to explain that any =20 >>> better? Maybe >>> also use (target-bit + 1>=3D 63) or period> INT64_MAX as condition? >> How about this: >> /* QEMU timer supports a maximum timer of INT64_MAX =20 >> (0x7fffffff_ffffffff). >> * Run booke fit/wdog timer when >> * ((1ULL<< target_bit + 1)< 0x40000000_00000000), i.e =20 >> target_bit =3D 61. >> * Also the time with this maximum target_bit (with current =20 >> range of >> * CPU frequency PowerPC supports) will be many many years. So =20 >> it is >> * pretty safe to stop the timer above this threshold. */ >=20 > How about >=20 > /* This timeout will take years to trigger. Treat the timer as =20 > disabled. */ There should be at least a brief mention that it's because the QEMU =20 timer can't handle larger values, with the detailed explanation in the =20 changelog. A better lower bound on the number of years would be nice =20 as well (e.g. "hundreds of years"). -Scott=