From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NsYa8-0004IH-7d for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:33:28 -0400 Received: from [199.232.76.173] (port=40706 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsYa6-0004Hx-Sr for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:33:26 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NsYa4-0004Ex-CX for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:33:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42623) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NsYa4-0004Et-0e for qemu-devel@nongnu.org; Fri, 19 Mar 2010 05:33:24 -0400 Message-ID: <4BA344DF.2060105@redhat.com> Date: Fri, 19 Mar 2010 10:33:19 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: TeLeMan Cc: Anthony Liguori , qemu-devel 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. After 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% correct. alarm_timer->pending should remain 1 until qemu_run_all_timers runs. Can you test this one instead: 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); If it doesn't work, I'm fine with TeLeMan's patch. Paolo