From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8qRf-0000VJ-AR for qemu-devel@nongnu.org; Tue, 04 Sep 2012 06:33:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8qRZ-0002l2-KZ for qemu-devel@nongnu.org; Tue, 04 Sep 2012 06:33:23 -0400 Received: from hall.aurel32.net ([88.191.126.93]:49698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8qRZ-0002ja-F1 for qemu-devel@nongnu.org; Tue, 04 Sep 2012 06:33:17 -0400 Date: Tue, 4 Sep 2012 12:32:59 +0200 From: Aurelien Jarno Message-ID: <20120904103257.GA6791@ohm.aurel32.net> References: <1346686472-23999-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: <1346686472-23999-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH for 1.2] qemu-timer: properly arm alarm timer for timers set by device initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Mon, Sep 03, 2012 at 05:34:32PM +0200, Paolo Bonzini wrote: > QEMU will hang when fed the following command-line > > qemu-system-mips -kernel vmlinux-2.6.32-5-4kc-malta -append "console=ttyS0" -nographic -net none > > The -net none is important otherwise it seems some events are generated > causing the things to work. When it doesn't work, the guest hangs when > measuring the CPU frequency, after the following line: > > [ 0.000000] NR_IRQS:256 > > Pressing a key on the serial port unblocks it, hinting that the problem > is due to the recent elimination of the 1 second timeout in the main > loop. > > The problem is that because init_timer_alarm sets the timer's pending > flag to true, the alarm timer is never armed until after the first time > through the main loop. Thus the bug started when QEMU started testing > the pending flag in qemu_mod_timer (commit 1828be3, more alarm timer > cleanup, 2010-03-10). > > But actually, it isn't true at all that a timer is pending when the > alarm timer is created, and the real bug has been latent forever: the > fix is to remove the bogus setting of pending flag. > > Reported-by: Aurelien Jarno > Signed-off-by: Paolo Bonzini > --- > qemu-timer.c | 3 --- > 1 file modificato, 3 rimozioni(-) > > diff --git a/qemu-timer.c b/qemu-timer.c > index 5aea94e..c7a1551 100644 > --- a/qemu-timer.c > +++ b/qemu-timer.c > @@ -759,11 +759,8 @@ int init_timer_alarm(void) > goto fail; > } > > - /* first event is at time 0 */ > atexit(quit_timers); > - t->pending = true; > alarm_timer = t; > - > return 0; > > fail: Thanks, I have applied it. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net