From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuXsb-0008Fr-O9 for qemu-devel@nongnu.org; Thu, 16 Apr 2009 16:08:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuXsX-0008FN-65 for qemu-devel@nongnu.org; Thu, 16 Apr 2009 16:08:13 -0400 Received: from [199.232.76.173] (port=59875 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuXsW-0008FK-Nm for qemu-devel@nongnu.org; Thu, 16 Apr 2009 16:08:08 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:43431) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LuXsV-0007BH-E5 for qemu-devel@nongnu.org; Thu, 16 Apr 2009 16:08:08 -0400 Message-ID: <49E79023.5090107@web.de> Date: Thu, 16 Apr 2009 22:08:03 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9112D3ED75E6661E9CB53942" Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH][STABLE] hpet: Fix emulation of HPET_TN_SETVAL 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 Cc: Beth Kon , Alexander Graf , Gleb Natapov , Dmitry Eremin-Solenikov This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9112D3ED75E6661E9CB53942 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable 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 =2E.TIMER: vector=3D0x30 apic1=3D0 pin1=3D2 apic2=3D-1 pin2=3D-1 =2E.MP-BIOS bug: 8254 timer not connected to IO-APIC =2E..trying to set up timer (IRQ0) through the 8259A ... =2E.... (found apic 0 pin 2) ... =2E...... failed. =2E..trying to set up timer as Virtual Wire IRQ... =2E.... failed. =2E..trying to set up timer as ExtINT IRQ... =2E.... failed :(. Kernel panic - not syncing: IO-APIC + timer doesn't work! [...] Signed-off-by: Jan Kiszka --- hw/hpet.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/hpet.c b/hw/hpet.c index 7df2d05..c7945ec 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -411,7 +411,7 @@ static void hpet_ram_writel(void *opaque, target_phys= _addr_t addr, (timer->config & HPET_TN_SETVAL)) timer->cmp =3D (timer->cmp & 0xffffffff00000000ULL) | new_val; - else { + if (timer_is_periodic(timer)) { /* * FIXME: Clamp period to reasonable min value? * Clamp period to reasonable max value --------------enig9112D3ED75E6661E9CB53942 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAknnkCMACgkQniDOoMHTA+kYlACfcRvYHgdmIC/vQO2akvfmI12v NXgAnAhmSDizwuXtJlMonVg5MNdV+ebs =f7ER -----END PGP SIGNATURE----- --------------enig9112D3ED75E6661E9CB53942--