From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NsYnL-00082L-45 for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:47:07 -0400 Received: from [199.232.76.173] (port=52008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsYnK-000814-Am for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:47:06 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NsYnJ-0004xc-Fe for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:47:06 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:37850) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NsYnJ-0004xW-4j for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:47:05 -0400 Received: by pwi9 with SMTP id 9so2103040pwi.4 for ; Fri, 19 Mar 2010 02:47:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BA344DF.2060105@redhat.com> References: <4BA344DF.2060105@redhat.com> Date: Fri, 19 Mar 2010 17:47:03 +0800 Message-ID: From: TeLeMan Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH, RFC] qemu-timer: fix alarm_timer pending List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Anthony Liguori , qemu-devel On Fri, Mar 19, 2010 at 17:33, Paolo Bonzini wrote: > On 03/19/2010 06:24 AM, TeLeMan wrote: >> >> I fetched the lastest qemu-timer codes and found qemu would have no >> response when the guest os was WinXP and the timer was "dynticks" on >> the win32 host. =C2=A0After qemu froze, it seemed the win32_rearm_timer(= ) >> would never be called and alarm_timer->pending was always 0. >> I could not find the more deeper reason and just referred to the >> previous implement to make this patch. > > Interesting, it ran fine for me under Wine. > > I can see why the patch you have works, but I don't think it's 100% corre= ct. > =C2=A0alarm_timer->pending should remain 1 until qemu_run_all_timers runs= . =C2=A0Can > you test this one instead: Yes, I did test this one firstly. It's working also but different with the previous implement and I didn't know the exact reason, so I made the another patch. > 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) > > =C2=A0void qemu_run_all_timers(void) > =C2=A0{ > + =C2=A0 =C2=A0alarm_timer->pending =3D 0; > + > =C2=A0 =C2=A0 /* rearm timer, if not periodic */ > =C2=A0 =C2=A0 if (alarm_timer->expired) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 alarm_timer->expired =3D 0; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 qemu_rearm_alarm_timer(alarm_timer); > =C2=A0 =C2=A0 } > > - =C2=A0 =C2=A0alarm_timer->pending =3D 0; > - > =C2=A0 =C2=A0 /* vm time timers */ > =C2=A0 =C2=A0 if (vm_running) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 qemu_run_timers(vm_clock); > > > If it doesn't work, I'm fine with TeLeMan's patch. > > Paolo >