From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvVhs-0001gQ-Mu for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:05:40 -0400 Received: from [140.186.70.92] (port=42581 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvVhq-0001el-Hg for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:05:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvVhp-0004kH-1E for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:05:38 -0400 Received: from hall.aurel32.net ([88.191.82.174]:40794) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvVho-0004k1-PY for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:05:36 -0400 Date: Sat, 27 Mar 2010 14:05:34 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] fix race between timer firing vs. alarm_timer->pending = 0 Message-ID: <20100327130534.GN15194@volta.aurel32.net> References: <1268994635-5788-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1268994635-5788-1-git-send-email-pbonzini@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: geleman@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org On Fri, Mar 19, 2010 at 11:30:35AM +0100, Paolo Bonzini wrote: > The period for Win32 timers is very short and always the same > independent of dynticks, so it's possible that the timer fires > before qemu_run_all_timers has reset alarm_timer->pending to zero. > Reset alarm_timer->pending before rearming. Thanks, applied. > Signed-off-by: Paolo Bonzini > > Signed-off-by: Paolo Bonzini > --- > qemu-timer.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/qemu-timer.c b/qemu-timer.c > index 329d3a4..49eac86 100644 > --- a/qemu-timer.c > +++ b/qemu-timer.c > @@ -706,14 +706,14 @@ void configure_icount(const char *option) > > void qemu_run_all_timers(void) > { > + alarm_timer->pending = 0; > + > /* rearm timer, if not periodic */ > if (alarm_timer->expired) { > alarm_timer->expired = 0; > qemu_rearm_alarm_timer(alarm_timer); > } > > - alarm_timer->pending = 0; > - > /* vm time timers */ > if (vm_running) { > qemu_run_timers(vm_clock); > -- > 1.6.6.1 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net