From patchwork Fri Mar 19 09:33:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 48121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C1098B7CB6 for ; Fri, 19 Mar 2010 20:34:24 +1100 (EST) Received: from localhost ([127.0.0.1]:47663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsYaz-0004IO-DX for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2010 05:34:21 -0400 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2J9XLLl007636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Mar 2010 05:33:21 -0400 Received: from yakj.usersys.redhat.com (dhcp-lab-231.englab.brq.redhat.com [10.34.33.231]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2J9XJiv012646; Fri, 19 Mar 2010 05:33:20 -0400 Message-ID: <4BA344DF.2060105@redhat.com> Date: Fri, 19 Mar 2010 10:33:19 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3 MIME-Version: 1.0 To: TeLeMan References: In-Reply-To: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Anthony Liguori , qemu-devel Subject: [Qemu-devel] Re: [PATCH, RFC] qemu-timer: fix alarm_timer pending X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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: If it doesn't work, I'm fine with TeLeMan's patch. Paolo 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);