Re: [PATCH 6/6] KVM: lapic: do not scan IRR when delivering an interrupt

From: Paolo Bonzini
Date: Tue Dec 20 2016 - 12:11:25 EST




On 19/12/2016 10:47, Paolo Bonzini wrote:
> + if (!test_bit(vector, vcpu_to_synic(vcpu)->auto_eoi_bitmap))
> + apic_set_isr(vector, apic);
>
> + apic_clear_irr(vector, apic);
> + __apic_update_ppr(apic, &ppr);

Hmm, EOI does apic_update_ppr, so for auto-EOI interrupts I think it's
safer to do apic_update_ppr instead. You could have to interrupts
injected at the same time, and the lower-priority interrupt would be
lost if the higher-priority interrupt does automatic EOI.

Paolo