Re: [PATCH v2] report IRQ injection status to userspace.

Marcelo Tosatti
2009-01-27T15:41:37Z

On Tue, Jan 27, 2009 at 03:27:39PM +0200, Gleb Natapov wrote:
> > -1 here ?
> >
> I think 1 is better here. For level=0 we always want to report that interrupt
> was injected and for the case of edge triggered interrupt and level=1
> ioapic_service() will always be called. BTW it seems that expression
> old_irr != ioapic->irr in:
> if ((!entry.fields.trig_mode && old_irr != ioapic->irr)
> || !entry.fields.remote_irr)
> ret = ioapic_service(ioapic, irq);
> Will always be true since for edge triggered interrupt irr is always
> cleared by ioapic_service(). Am I right?

Right, I was thinking about

if (irq >= 0 && irq < IOAPIC_NUM_PINS) {

Should return MASKED if irq is outside the acceptable range?

> > + }
> > + }
> > #endif
> >
> > Is that what you intended ?
> >
> Yes! If interrupt was lost due to making it should not be reinjected.

That assumes guests won't mask the interrupt temporarily in the irqchip,
hope that is OK (as Avi noted earlier guests use CPU to mask irqs
temporarily, most of the time).