2015-03-16 19:30-0600, James Sullivan: > An MSI interrupt should only be delivered to the lowest priority CPU > when it has RH=1, regardless of the delivery mode. Modified > kvm_is_dm_lowest_prio() to check for either irq->delivery_mode == APIC_DM_LOWPRI > or irq->msi_redir_hint. > > Moved kvm_is_dm_lowest_prio() into lapic.h and renamed to > kvm_lowest_prio_delivery(). > > Changed a check in kvm_irq_delivery_to_apic_fast() from > irq->delivery_mode == APIC_DM_LOWPRI to kvm_is_dm_lowest_prio(). > > Signed-off-by: James Sullivan <sullivan.james.f@xxxxxxxxx> > --- Reviewed-by: Radim Krčmář <rkrcmar@xxxxxxxxxx> > diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c > @@ -31,6 +31,8 @@ > #include "ioapic.h" > > +#include "lapic.h" > + (No need for the empty line between them.) > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > @@ -701,8 +701,7 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, > dst = map->logical_map[cid]; > > bitmap = apic_logical_id(map, mda); > - (It's polite to preserve blank lines.) > - if (irq->delivery_mode == APIC_DM_LOWEST) { > + if (kvm_lowest_prio_delivery(irq)) { lapic.c does not directly include lapic.h, (gets pulled via irq.h) it would be nicer to fix it here, but can also be done later ... > diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h > @@ -168,6 +168,12 @@ static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu) > +static inline bool kvm_lowest_prio_delivery(struct kvm_lapic_irq *irq) > +{ > + return (irq->delivery_mode == APIC_DM_LOWEST || > + irq->msi_redir_hint); (These parentheses improve readability?) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html