From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTaai-0003v4-3p for qemu-devel@nongnu.org; Tue, 08 Oct 2013 12:57:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTaac-0006tw-5F for qemu-devel@nongnu.org; Tue, 08 Oct 2013 12:57:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTaab-0006tb-Tg for qemu-devel@nongnu.org; Tue, 08 Oct 2013 12:56:54 -0400 Message-ID: <5254394B.506@redhat.com> Date: Tue, 08 Oct 2013 18:56:43 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1381222058-16701-1-git-send-email-pbonzini@redhat.com> <1381222058-16701-6-git-send-email-pbonzini@redhat.com> <703C02BF-B3A3-493A-8713-7979746C6811@alex.org.uk> In-Reply-To: <703C02BF-B3A3-493A-8713-7979746C6811@alex.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/8] timers: prepare the code for future races in calling qemu_clock_warp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: qemu-devel@nongnu.org Il 08/10/2013 18:54, Alex Bligh ha scritto: >> > - >> > - /* Maintain prior (possibly buggy) behaviour where if no deadline >> > - * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than >> > - * INT32_MAX nanoseconds ahead, we still use INT32_MAX >> > - * nanoseconds. >> > - */ >> > - if ((deadline < 0) || (deadline > INT32_MAX)) { >> > - deadline = INT32_MAX; >> > + if (deadline < 0) { >> > + return; >> > } > > Arguably the patch could document why removing the check for deadline > INT32_MAX > (the bug for bug compatibility) is safe, as I couldn't entirely convince myself it > was, mostly because I couldn't see why it was doing it in the first place. I couldn't convince myself that it is _not_ safe :) and it made the code more complicated. As soon as a deadline appears, qemu_clock_warp() will be called again and update the icount_warp_timer. Ok to move that to a separate patch? Paolo