From: aliguori Date: Fri, 17 Apr 2009 20:50:58 +0000 (+0000) Subject: hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka) X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~12185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3787324101bbc68c0d13a6aca51e6a90d1f7ce06;p=sdk%2Femulator%2Fqemu.git 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 git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7168 c046a42c-6fe2-441c-8c8c-71466251a162 --- 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 = (timer->cmp & 0xffffffff00000000ULL) | new_val; - else { + if (timer_is_periodic(timer)) { /* * FIXME: Clamp period to reasonable min value? * Clamp period to reasonable max value