on 24/07/2009 19:26 Beth Kon said the following:
This patch addresses the problems found by Andriy Gapon:
- The code was incorrectly overwriting the high order 32
bits of the timer and hpet config registers. This didn't show up
in testing because linux and windows use hpet in legacy mode,
where the high order 32 bits (advertising available interrupts)
of the timer config register are ignored, and the high order 32
bits of the hpet config register are reserved and unused.
- The mask for level-triggered interrupts was off by a bit. (hpet
doesn't currently support level-triggered interrupts).
In addition, I removed some unused #defines, and corrected the ioapic
interrupt values advertised. I'd set this up early in hpet development
and never went back to correct it, and no bugs resulted since linux and
windows use hpet in legacy mode where available interrupts are ignored.
Beth,
thanks a lot!
And a comment: it seems that the code doesn't verify interrupt configured by
software, it happily uses any interrupt even if it's not advertised in interrupt
capabilities. I know, the software should not do that, but it happens :)
Also, maybe it would be a good idea to keep support for some additional
interrupts? E.g. irq 10, 11 or some such, or maybe something >= 16 for APIC mode
(if possible at all). But I know that this needs some careful thinking to not
interfere with other emulated devices.