qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1771042] [NEW] dataplane interrupt handler doesn't support msi
@ 2018-05-14  0:13 eric hoffman
  2018-05-14  3:00 ` [Qemu-devel] [Bug 1771042] " eric hoffman
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: eric hoffman @ 2018-05-14  0:13 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

hw/block/dataplane/virtio-blk.c commit
1010cadf62332017648abee0d7a3dc7f2eef9632

in the function notify_guest_bh, the function virtio_notify_irqfd is called
to deliver the interrupt corresponding to the vq

however, without the dataplane, hw/block/virtio_blk_req_complete calls
virtio_notify to deliver the interrupt (immediately). this goes though
a slightly more involved path that calls virtio_pci_notify which includes
a case to handle msi interrupts.

so, msi interrupts with block devices aren't serviced when using dataplane
batching.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1771042

Title:
  dataplane interrupt handler doesn't support msi

Status in QEMU:
  New

Bug description:
  hw/block/dataplane/virtio-blk.c commit
  1010cadf62332017648abee0d7a3dc7f2eef9632

  in the function notify_guest_bh, the function virtio_notify_irqfd is called
  to deliver the interrupt corresponding to the vq

  however, without the dataplane, hw/block/virtio_blk_req_complete calls
  virtio_notify to deliver the interrupt (immediately). this goes though
  a slightly more involved path that calls virtio_pci_notify which includes
  a case to handle msi interrupts.

  so, msi interrupts with block devices aren't serviced when using dataplane
  batching.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1771042/+subscriptions

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

* [Qemu-devel] [Bug 1771042] Re: dataplane interrupt handler doesn't support msi
  2018-05-14  0:13 [Qemu-devel] [Bug 1771042] [NEW] dataplane interrupt handler doesn't support msi eric hoffman
@ 2018-05-14  3:00 ` eric hoffman
  2018-05-14 14:06   ` Stefan Hajnoczi
  2018-05-14  3:48 ` eric hoffman
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: eric hoffman @ 2018-05-14  3:00 UTC (permalink / raw)
  To: qemu-devel

diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 101f32c..31d9eb8 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -73,7 +73,7 @@ static void notify_guest_bh(void *opaque)
             unsigned i = j + ctzl(bits);
             VirtQueue *vq = virtio_get_queue(s->vdev, i);

-            virtio_notify_irqfd(s->vdev, vq);
+            virtio_notify(s->vdev, vq);

             bits &= bits - 1; /* clear right-most bit */
         }

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1771042

Title:
  dataplane interrupt handler doesn't support msi

Status in QEMU:
  New

Bug description:
  hw/block/dataplane/virtio-blk.c commit
  1010cadf62332017648abee0d7a3dc7f2eef9632

  in the function notify_guest_bh, the function virtio_notify_irqfd is called
  to deliver the interrupt corresponding to the vq

  however, without the dataplane, hw/block/virtio_blk_req_complete calls
  virtio_notify to deliver the interrupt (immediately). this goes though
  a slightly more involved path that calls virtio_pci_notify which includes
  a case to handle msi interrupts.

  so, msi interrupts with block devices aren't serviced when using dataplane
  batching.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1771042/+subscriptions

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

* [Qemu-devel] [Bug 1771042] Re: dataplane interrupt handler doesn't support msi
  2018-05-14  0:13 [Qemu-devel] [Bug 1771042] [NEW] dataplane interrupt handler doesn't support msi eric hoffman
  2018-05-14  3:00 ` [Qemu-devel] [Bug 1771042] " eric hoffman
@ 2018-05-14  3:48 ` eric hoffman
  2018-05-14 18:30 ` eric hoffman
  2020-11-24 16:27 ` Thomas Huth
  3 siblings, 0 replies; 6+ messages in thread
From: eric hoffman @ 2018-05-14  3:48 UTC (permalink / raw)
  To: qemu-devel

oh right, another note. this only manifests when using kvm.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1771042

Title:
  dataplane interrupt handler doesn't support msi

Status in QEMU:
  New

Bug description:
  hw/block/dataplane/virtio-blk.c commit
  1010cadf62332017648abee0d7a3dc7f2eef9632

  in the function notify_guest_bh, the function virtio_notify_irqfd is called
  to deliver the interrupt corresponding to the vq

  however, without the dataplane, hw/block/virtio_blk_req_complete calls
  virtio_notify to deliver the interrupt (immediately). this goes though
  a slightly more involved path that calls virtio_pci_notify which includes
  a case to handle msi interrupts.

  so, msi interrupts with block devices aren't serviced when using dataplane
  batching.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1771042/+subscriptions

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

* Re: [Qemu-devel] [Bug 1771042] Re: dataplane interrupt handler doesn't support msi
  2018-05-14  3:00 ` [Qemu-devel] [Bug 1771042] " eric hoffman
@ 2018-05-14 14:06   ` Stefan Hajnoczi
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2018-05-14 14:06 UTC (permalink / raw)
  To: Bug 1771042; +Cc: qemu-devel, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

On Mon, May 14, 2018 at 03:00:44AM -0000, eric hoffman wrote:
> diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
> index 101f32c..31d9eb8 100644
> --- a/hw/block/dataplane/virtio-blk.c
> +++ b/hw/block/dataplane/virtio-blk.c
> @@ -73,7 +73,7 @@ static void notify_guest_bh(void *opaque)
>              unsigned i = j + ctzl(bits);
>              VirtQueue *vq = virtio_get_queue(s->vdev, i);
> 
> -            virtio_notify_irqfd(s->vdev, vq);
> +            virtio_notify(s->vdev, vq);
> 
>              bits &= bits - 1; /* clear right-most bit */
>          }

Please send patches to qemu-devel@nongnu.org.  Guidelines for submitting
patches are here:
https://wiki.qemu.org/Contribute/SubmitAPatch

The issue with this approach is that hw/pci/msi.c:msi_send_message()
invokes device emulation outside the QEMU global mutex (it calls into
the APIC to send MSIs).  I've CCed Paolo Bonzini to check whether doing
this is thread-safe.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* [Qemu-devel] [Bug 1771042] Re: dataplane interrupt handler doesn't support msi
  2018-05-14  0:13 [Qemu-devel] [Bug 1771042] [NEW] dataplane interrupt handler doesn't support msi eric hoffman
  2018-05-14  3:00 ` [Qemu-devel] [Bug 1771042] " eric hoffman
  2018-05-14  3:48 ` eric hoffman
@ 2018-05-14 18:30 ` eric hoffman
  2020-11-24 16:27 ` Thomas Huth
  3 siblings, 0 replies; 6+ messages in thread
From: eric hoffman @ 2018-05-14 18:30 UTC (permalink / raw)
  To: qemu-devel

thanks for looking at this Stefan - since I don't have any context of
exactly the kind of environmental issues like threading, the patch
posted here isn't really a suggested fix.

it does in general seem helpful if batched interrupts have the same
delivery semantics as non-deferred.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1771042

Title:
  dataplane interrupt handler doesn't support msi

Status in QEMU:
  New

Bug description:
  hw/block/dataplane/virtio-blk.c commit
  1010cadf62332017648abee0d7a3dc7f2eef9632

  in the function notify_guest_bh, the function virtio_notify_irqfd is called
  to deliver the interrupt corresponding to the vq

  however, without the dataplane, hw/block/virtio_blk_req_complete calls
  virtio_notify to deliver the interrupt (immediately). this goes though
  a slightly more involved path that calls virtio_pci_notify which includes
  a case to handle msi interrupts.

  so, msi interrupts with block devices aren't serviced when using dataplane
  batching.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1771042/+subscriptions

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

* [Bug 1771042] Re: dataplane interrupt handler doesn't support msi
  2018-05-14  0:13 [Qemu-devel] [Bug 1771042] [NEW] dataplane interrupt handler doesn't support msi eric hoffman
                   ` (2 preceding siblings ...)
  2018-05-14 18:30 ` eric hoffman
@ 2020-11-24 16:27 ` Thomas Huth
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2020-11-24 16:27 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1771042

Title:
  dataplane interrupt handler doesn't support msi

Status in QEMU:
  Invalid

Bug description:
  hw/block/dataplane/virtio-blk.c commit
  1010cadf62332017648abee0d7a3dc7f2eef9632

  in the function notify_guest_bh, the function virtio_notify_irqfd is called
  to deliver the interrupt corresponding to the vq

  however, without the dataplane, hw/block/virtio_blk_req_complete calls
  virtio_notify to deliver the interrupt (immediately). this goes though
  a slightly more involved path that calls virtio_pci_notify which includes
  a case to handle msi interrupts.

  so, msi interrupts with block devices aren't serviced when using dataplane
  batching.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1771042/+subscriptions


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

end of thread, other threads:[~2020-11-24 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-14  0:13 [Qemu-devel] [Bug 1771042] [NEW] dataplane interrupt handler doesn't support msi eric hoffman
2018-05-14  3:00 ` [Qemu-devel] [Bug 1771042] " eric hoffman
2018-05-14 14:06   ` Stefan Hajnoczi
2018-05-14  3:48 ` eric hoffman
2018-05-14 18:30 ` eric hoffman
2020-11-24 16:27 ` Thomas Huth

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