* [Qemu-devel] [PATCHv2 for-1.5] virtio-pci: fix level interrupts
@ 2013-05-07 10:20 Michael S. Tsirkin
2013-05-07 12:20 ` KONRAD Frédéric
0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2013-05-07 10:20 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Paolo Bonzini, Anthony Liguori, Alexander Graf,
KONRAD Frederic
mask notifiers are never called without msix,
so devices with backend masking like vhost don't work.
Call mask notifiers explicitly at
startup/cleanup to make it work.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
---
Changes from v1:
- rebase to master
hw/virtio/virtio-pci.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index d8708c1..c97aee1 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -744,6 +744,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
bool with_irqfd)
{
VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
+ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(d);
VirtQueue *vq = virtio_get_queue(proxy->vdev, n);
EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
@@ -758,6 +759,10 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
event_notifier_cleanup(notifier);
}
+ if (!msix_enabled(&proxy->pci_dev) && vdc->guest_notifier_mask) {
+ vdc->guest_notifier_mask(proxy->vdev, n, !assign);
+ }
+
return 0;
}
--
MST
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2 for-1.5] virtio-pci: fix level interrupts
2013-05-07 10:20 [Qemu-devel] [PATCHv2 for-1.5] virtio-pci: fix level interrupts Michael S. Tsirkin
@ 2013-05-07 12:20 ` KONRAD Frédéric
2013-05-07 12:27 ` Michael S. Tsirkin
0 siblings, 1 reply; 3+ messages in thread
From: KONRAD Frédéric @ 2013-05-07 12:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Peter Maydell, Paolo Bonzini, Anthony Liguori, qemu-devel,
Alexander Graf
On 07/05/2013 12:20, Michael S. Tsirkin wrote:
> mask notifiers are never called without msix,
> so devices with backend masking like vhost don't work.
> Call mask notifiers explicitly at
> startup/cleanup to make it work.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Tested-by: Alexander Graf <agraf@suse.de>
> ---
>
> Changes from v1:
> - rebase to master
>
> hw/virtio/virtio-pci.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index d8708c1..c97aee1 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -744,6 +744,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
> bool with_irqfd)
> {
> VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
> + VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(d);
I think there is a mistake here.
VIRTIO_DEVICE_GET_CLASS(proxy->vdev) should be used.
> VirtQueue *vq = virtio_get_queue(proxy->vdev, n);
> EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
>
> @@ -758,6 +759,10 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
> event_notifier_cleanup(notifier);
> }
>
> + if (!msix_enabled(&proxy->pci_dev) && vdc->guest_notifier_mask) {
> + vdc->guest_notifier_mask(proxy->vdev, n, !assign);
> + }
> +
> return 0;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2 for-1.5] virtio-pci: fix level interrupts
2013-05-07 12:20 ` KONRAD Frédéric
@ 2013-05-07 12:27 ` Michael S. Tsirkin
0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2013-05-07 12:27 UTC (permalink / raw)
To: KONRAD Frédéric
Cc: Peter Maydell, Paolo Bonzini, Anthony Liguori, qemu-devel,
Alexander Graf
On Tue, May 07, 2013 at 02:20:25PM +0200, KONRAD Frédéric wrote:
> On 07/05/2013 12:20, Michael S. Tsirkin wrote:
> >mask notifiers are never called without msix,
> >so devices with backend masking like vhost don't work.
> >Call mask notifiers explicitly at
> >startup/cleanup to make it work.
> >
> >Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >Tested-by: Alexander Graf <agraf@suse.de>
> >---
> >
> >Changes from v1:
> > - rebase to master
> >
> > hw/virtio/virtio-pci.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> >diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> >index d8708c1..c97aee1 100644
> >--- a/hw/virtio/virtio-pci.c
> >+++ b/hw/virtio/virtio-pci.c
> >@@ -744,6 +744,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
> > bool with_irqfd)
> > {
> > VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
> >+ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(d);
>
> I think there is a mistake here.
> VIRTIO_DEVICE_GET_CLASS(proxy->vdev) should be used.
Hmm yes. I just realized I forgot vhostforce=on in my test
script, so wasn't testing it at all actually :(
Once I force it, it crashes happily.
So self-NAK, sorry about the noise.
> > VirtQueue *vq = virtio_get_queue(proxy->vdev, n);
> > EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
> >@@ -758,6 +759,10 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
> > event_notifier_cleanup(notifier);
> > }
> >+ if (!msix_enabled(&proxy->pci_dev) && vdc->guest_notifier_mask) {
> >+ vdc->guest_notifier_mask(proxy->vdev, n, !assign);
> >+ }
> >+
> > return 0;
> > }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-07 12:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-07 10:20 [Qemu-devel] [PATCHv2 for-1.5] virtio-pci: fix level interrupts Michael S. Tsirkin
2013-05-07 12:20 ` KONRAD Frédéric
2013-05-07 12:27 ` Michael S. Tsirkin
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).