When I debug the hpet with linux v3.10. I found it can not work with linux-2.6/Documentation/timers/hpet_example.c. But on bare metal, hpet_example can work! After tracing, I found the trouble is caused by drivers/char/hpet.c hpet_timer_set_irq() gsi = acpi_register_gsi(NULL, irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); ---> According to ICH spec, #PIRQ16~23 will be low-active. And there is an internal inversion in ICH before the input of ioapic. But in qemu, we lack the emulation of this inversion. To fix the hpet problem, I have some solutions. --Emulation the inversion only in hpet. This will keep current PCI INTx# logic unchanged. --Emulation the inversion in ioapic (both qemu and kernel), so PCI INTx# logic will change.
Any suggestion? Thx, Pingfan