Skip to contentSkip to conversation

qemu-kvm: msix: Fire mask notifier on global mask changes

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Nov 21, 2011 – Nov 27, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-kvm: msix: Fire mask notifier on global mask changes

Quoted 1 line

From: Jan Kiszka <[email protected]>

Also invoke the mask notifier if the global MSI-X mask is modified. For this purpose, we push the notifier call from the per-vector mask update to the central msix_handle_mask_update.

---

This needs to be applied on top of:
msix: avoid mask updates if mask is unchanged
I'll send a reminder once it's merged.

 hw/msix.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
hw/msix.c +6 -5
index 56422c6..e50074f 100644
@@ -231,6 +231,12 @@ static void msix_handle_mask_update(PCIDevice *dev, int vector, bool was_masked)
         return;
     }
 
+    if (dev->msix_mask_notifier) {
+        int ret;
+        ret = dev->msix_mask_notifier(dev, vector, is_masked);
+        assert(ret >= 0);
+    }
+
     if (!is_masked && msix_is_pending(dev, vector)) {
         msix_clr_pending(dev, vector);
         msix_notify(dev, vector);
@@ -292,11 +298,6 @@ static void msix_mmio_write(void *opaque, target_phys_addr_t addr,
     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) && dev->msix_mask_notifier) {
-        int r = dev->msix_mask_notifier(dev, vector,
-					msix_is_masked(dev, vector));
-        assert(r >= 0);
-    }
     msix_handle_mask_update(dev, vector, was_masked);
 }
 
Signature · 1 line
1.7.5.53.gc233e
Applied
#1 lore raw
Quoted 7 lines · Michael S. Tsirkin
Quoted 1 line

From: Jan Kiszka <[email protected]>

Also invoke the mask notifier if the global MSI-X mask is modified. For this purpose, we push the notifier call from the per-vector mask update to the central msix_handle_mask_update.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function