On Tue, Oct 18, 2011 at 09:50:53AM +0200, Jan Kiszka wrote: > As long as MSI-X is disabled, it's incorrect to invoke > msix_handle_mask_update on per-vector mask changes. That may misguide > the config notifier callback or spuriously trigger an MSI event. > > Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> And msix_is_pending is cleared on vector unuse, so how can a spurious MSI event happen? > --- > hw/msix.c | 14 +++++++++----- > 1 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/hw/msix.c b/hw/msix.c > index e351c68..f5c8d08 100644 > --- a/hw/msix.c > +++ b/hw/msix.c > @@ -277,12 +277,16 @@ static void msix_mmio_write(void *opaque, target_phys_addr_t addr, > bool was_masked = msix_is_masked(dev, vector); > > pci_set_long(dev->msix_table_page + offset, val); > - if (kvm_enabled() && kvm_irqchip_in_kernel()) { > - kvm_msix_update(dev, vector, was_masked, msix_is_masked(dev, vector)); > - } > > - if (was_masked != msix_is_masked(dev, vector)) { > - msix_handle_mask_update(dev, vector); > + if (msix_enabled(dev)) { > + if (kvm_enabled() && kvm_irqchip_in_kernel()) { > + kvm_msix_update(dev, vector, was_masked, > + msix_is_masked(dev, vector)); > + } > + > + if (was_masked != msix_is_masked(dev, vector)) { > + msix_handle_mask_update(dev, vector); > + } > } > } > > -- > 1.7.3.4 -- 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