kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for v1.0] qemu-kvm: msix: Fire mask notifier on global mask changes
@ 2011-11-21 17:14 Michael S. Tsirkin
  2011-11-27 11:42 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2011-11-21 17:14 UTC (permalink / raw)
  To: kvm; +Cc: Jan Kiszka, Avi Kivity, Marcelo Tosatti, Anthony Liguori

>From: Jan Kiszka <jan.kiszka@siemens.com>

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.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

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(-)

diff --git a/hw/msix.c b/hw/msix.c
index 56422c6..e50074f 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -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);
 }
 
-- 
1.7.5.53.gc233e

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for v1.0] qemu-kvm: msix: Fire mask notifier on global mask changes
  2011-11-21 17:14 [PATCH for v1.0] qemu-kvm: msix: Fire mask notifier on global mask changes Michael S. Tsirkin
@ 2011-11-27 11:42 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2011-11-27 11:42 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: kvm, Jan Kiszka, Marcelo Tosatti, Anthony Liguori

On 11/21/2011 07:14 PM, Michael S. Tsirkin wrote:
> >From: Jan Kiszka <jan.kiszka@siemens.com>
>
> 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.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-27 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 17:14 [PATCH for v1.0] qemu-kvm: msix: Fire mask notifier on global mask changes Michael S. Tsirkin
2011-11-27 11:42 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).