From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUHkf-0007jJ-Es for qemu-devel@nongnu.org; Sat, 16 Aug 2008 05:07:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUHkY-0007dB-ON for qemu-devel@nongnu.org; Sat, 16 Aug 2008 05:07:11 -0400 Received: from [199.232.76.173] (port=42190 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUHkX-0007cp-Hr for qemu-devel@nongnu.org; Sat, 16 Aug 2008 05:07:05 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:49645) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KUHkW-0001CJ-Iy for qemu-devel@nongnu.org; Sat, 16 Aug 2008 05:07:04 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 759D9E8ECE34 for ; Sat, 16 Aug 2008 11:07:01 +0200 (CEST) Received: from [88.64.23.108] (helo=[192.168.1.198]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KUHkT-0003l0-00 for qemu-devel@nongnu.org; Sat, 16 Aug 2008 11:07:01 +0200 Message-ID: <48A698B4.2090203@web.de> Date: Sat, 16 Aug 2008 11:07:00 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4881A6A5.1000603@web.de> In-Reply-To: <4881A6A5.1000603@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [RESEND][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)