From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZgzf-0008KJ-FN for qemu-devel@nongnu.org; Tue, 07 May 2013 08:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZgzc-0000ou-PU for qemu-devel@nongnu.org; Tue, 07 May 2013 08:27:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZgzc-0000oo-Gl for qemu-devel@nongnu.org; Tue, 07 May 2013 08:27:40 -0400 Date: Tue, 7 May 2013 15:27:31 +0300 From: "Michael S. Tsirkin" Message-ID: <20130507122731.GB21361@redhat.com> References: <20130507102050.GA16836@redhat.com> <5188F189.7040102@greensocs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <5188F189.7040102@greensocs.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv2 for-1.5] virtio-pci: fix level interrupts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: KONRAD =?iso-8859-1?Q?Fr=E9d=E9ric?= Cc: Peter Maydell , Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf On Tue, May 07, 2013 at 02:20:25PM +0200, KONRAD Fr=E9d=E9ric 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 > >Tested-by: Alexander Graf > >--- > > > >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(DeviceSta= te *d, int n, bool assign, > > bool with_irqfd) > > { > > VirtIOPCIProxy *proxy =3D to_virtio_pci_proxy(d); > >+ VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(d); >=20 > I think there is a mistake here. > VIRTIO_DEVICE_GET_CLASS(proxy->vdev) should be used. Hmm yes. I just realized I forgot vhostforce=3Don 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 =3D virtio_get_queue(proxy->vdev, n); > > EventNotifier *notifier =3D virtio_queue_get_guest_notifier(vq); > >@@ -758,6 +759,10 @@ static int virtio_pci_set_guest_notifier(DeviceSt= ate *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; > > }