Re: [PATCH 1/2] KVM: x86: ioapic: Set remote_irr only after successful delivery

"Huang, Kai" <[email protected]>
Newsgroups org.kernel.vger.kvm
Message-ID <[email protected]>
> 
> > Btw, currently the IRQ is set to irr_delivered for level-triggered IRQ
> > regardless of the return value of kvm_irq_delivery_to_apic():
> > 
> >         if (irqe.trig_mode == IOAPIC_EDGE_TRIG)                                
> >                 ioapic->irr_delivered |= 1 << irq;           


[...]

> Thanks, yes, I think you're right. irr_delivered has the same problem for
> edge-triggered interrupts: it is used to hide delivered edge IRQs from
> KVM_GET_IRQCHIP, but currently it is set before knowing whether delivery
> actually succeeded. If delivery fails, KVM_GET_IRQCHIP can incorrectly
> drop the pending IRR bit.

Sorry as I replied in v2, I misread the code that I thought irr_delivered is for
level-triggered IRQ too.  For edge triggered I think the hardware behaviour is
once it is triggered the IRQ is considered delivered, since it's just an "edge".

> 
> I'll send a v2 that gates both remote_irr and irr_delivered on ret > 0, and
> extend the selftest to cover the edge-triggered irr_delivered case too.

I wish I saw this reply earlier.  Again sorry for the noise.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.