Ulrich Weigand wrote:
>
> > I would have tried to debug the interrupt problem tonight,
> > but it all went wrong. The problem is that my base development
> > PC (this one) is an SMP box, and your kernel module made it go
> > all wrong with the IPIs, because you don't forward those
> > to the kernel !
>
> Yup, INT 0x30 ('IRQ 16') needs to be forwarded as well.
> AFAICT you'd only need to add it to mon_irq_handler table ...
> (It is a little ugly, though :-/)
OK, let me know if anyone confirms adding this works on an SMP
machine. I need to learn more about the APIC, and the
special IPI messaging.
>
> > Another thing, it may be that linux expects interrupts to be
> > on when an interrupt occurs --- I don't know whether it really
> > matters, but I wouldn't hestitate to make such an assumption
> > in MY OS code, if I needed to :). So it may be nice to
> > sti() BEFORE forwarding the interrupt to the host kernel.
>
> Eh? Linux uses interrupt gates as hardware IRQ vectors, so
> the interrupt flag is turned *off* before calling the handler.
> And I'd bet Linux relies on it being off ...
True enough. I went groping through the Linux kernel
sources to see what they were using.
I guess out of anal-ness, and to get in a good habit
for other host OSes, we should set IF just before calling
the INT instruction. It should be the instruction exactly
one before the INT instruction though.
-Kevin