Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Luv1Z-0000qM-AE for qemu-devel@nongnu.org; Fri, 17 Apr 2009 16:51:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Luv1Y-0000ps-RQ for qemu-devel@nongnu.org; Fri, 17 Apr 2009 16:51:01 -0400 Received: from [199.232.76.173] (port=44281 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Luv1Y-0000pj-LE for qemu-devel@nongnu.org; Fri, 17 Apr 2009 16:51:00 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37686 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Luv1X-0006gf-RX for qemu-devel@nongnu.org; Fri, 17 Apr 2009 16:51:00 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Luv1X-0003Z1-5x for qemu-devel@nongnu.org; Fri, 17 Apr 2009 20:50:59 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Luv1W-0003Yv-VP for qemu-devel@nongnu.org; Fri, 17 Apr 2009 20:50:59 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 17 Apr 2009 20:50:58 +0000 Subject: [Qemu-devel] [7168] hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka) 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 Revision: 7168 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7168 Author: aliguori Date: 2009-04-17 20:50:58 +0000 (Fri, 17 Apr 2009) Log Message: ----------- hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka) While Intel's spec is not that clear here, latest changes to Linux' HPET code (commit c23e253e67c9d8a91a0ffa33c1f571a17f0a2403, "x86: hpet: stop HPET_COUNTER when programming periodic mode") strongly suggest that HPET_TN_SETVAL rather means: Set _both_ the comparator value and register. With this patch applied, I'm again able to boot 2.6.30-rc kernels as they no longer panic like this (which was due to the comparator register remaining 0): ENABLING IO-APIC IRQs ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1 ..MP-BIOS bug: 8254 timer not connected to IO-APIC ...trying to set up timer (IRQ0) through the 8259A ... ..... (found apic 0 pin 2) ... ....... failed. ...trying to set up timer as Virtual Wire IRQ... ..... failed. ...trying to set up timer as ExtINT IRQ... ..... failed :(. Kernel panic - not syncing: IO-APIC + timer doesn't work! [...] Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/hpet.c Modified: trunk/hw/hpet.c =================================================================== --- trunk/hw/hpet.c 2009-04-17 20:50:54 UTC (rev 7167) +++ trunk/hw/hpet.c 2009-04-17 20:50:58 UTC (rev 7168) @@ -411,7 +411,7 @@ (timer->config & HPET_TN_SETVAL)) timer->cmp = (timer->cmp & 0xffffffff00000000ULL) | new_val; - else { + if (timer_is_periodic(timer)) { /* * FIXME: Clamp period to reasonable min value? * Clamp period to reasonable max value