We've fixed that already. Thanks for pointing it out. We were just
trying to re-use code.
No, VMI timer is unique because for SMP, it is based on the APIC. On
i386, SMP is hardwired to depend on the APIC, and so we simply re-use
the pieces of it which are there, with the same assumptions about irqs,
and hardware behavior, good or bad. We just have a different way of
telling the LAPIC when to deliver interrupts.
The alternative is to pretty much completely copy apic.c into vmi.c or
vmitimer.c, which seems a rather bad idea, since now two copies of
nearly identical code need to be maintained.
But we definitely need pieces of the core APIC dependent code. Xen
needs pieces of it too, but very select pieces for SMP boot. The
ugliness you point out is there, but the reason it is there is not
because the paravirt code is cluttered, it is because the i386 code is
so hardwired to use the APIC model that there is pain separating from it.
The correct solution here is to properly separate the APIC, SMP, and
timer code so the logic of it which we want to reuse is separated from
the hardware dependence. Clock events and clocksources take care of
most of the timer issues, but there is still ugliness from SMP timer
events depending on having part of the APIC infrastructure for wiring
the interrupt gates.
I think that is what everyone wants. This is an iterative process. We
certainly don't want to reach out into core kernel code unless there is
a good reason to do so, and with every development of clock events,
sources, and interrupts, we have less of a reason to do so, and the code
gets cleaner and more maintainable.
Zach
-