From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KK82y-0000xw-LF for qemu-devel@nongnu.org; Sat, 19 Jul 2008 04:44:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KK82w-0000wt-Ug for qemu-devel@nongnu.org; Sat, 19 Jul 2008 04:44:08 -0400 Received: from [199.232.76.173] (port=43708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK82w-0000wi-Rx for qemu-devel@nongnu.org; Sat, 19 Jul 2008 04:44:06 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:60609) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KK7rt-0002h1-Gk for qemu-devel@nongnu.org; Sat, 19 Jul 2008 04:32:41 -0400 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate02.web.de (Postfix) with ESMTP id 0B9A1E662FE6 for ; Sat, 19 Jul 2008 10:32:39 +0200 (CEST) Received: from [88.65.43.154] (helo=[192.168.1.198]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KK7rq-0004Ek-00 for qemu-devel@nongnu.org; Sat, 19 Jul 2008 10:32:38 +0200 Message-ID: <4881A6A5.1000603@web.de> Date: Sat, 19 Jul 2008 10:32:37 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] APIC: Do not start zero-period timers Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The APIC timer must not start when the initial count is (still) zero. This caused occasional stalls when booting secondary CPUs of Linux SMP guests. Signed-off-by: Jan Kiszka --- hw/apic.c | 2 ++ 1 file changed, 2 insertions(+) Index: b/hw/apic.c =================================================================== --- a/hw/apic.c +++ b/hw/apic.c @@ -566,6 +566,8 @@ static void apic_timer_update(APICState d = (current_time - s->initial_count_load_time) >> s->count_shift; if (s->lvt[APIC_LVT_TIMER] & APIC_LVT_TIMER_PERIODIC) { + if (!s->initial_count) + goto no_timer; d = ((d / ((uint64_t)s->initial_count + 1)) + 1) * ((uint64_t)s->initial_count + 1); } else { if (d >= s->initial_count)