From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCsm7-0007YF-CY for qemu-devel@nongnu.org; Tue, 05 Mar 2013 09:23:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCsm4-000167-Af for qemu-devel@nongnu.org; Tue, 05 Mar 2013 09:23:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCsm4-00015z-1n for qemu-devel@nongnu.org; Tue, 05 Mar 2013 09:23:24 -0500 Date: Tue, 5 Mar 2013 16:23:36 +0200 From: "Michael S. Tsirkin" Message-ID: <20130305142336.GE2256@redhat.com> References: <513596D7.3060307@ozlabs.ru> <20130305125614.GA2256@redhat.com> <5135F16B.2010403@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5135F16B.2010403@ozlabs.ru> Subject: Re: [Qemu-devel] QEMU -netdev vhost=on + -device virtio-net-pci bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: rusty@rustcorp.com.au, "qemu-devel@nongnu.org" , David Gibson On Wed, Mar 06, 2013 at 12:21:47AM +1100, Alexey Kardashevskiy wrote: > On 05/03/13 23:56, Michael S. Tsirkin wrote: > >>The patch f56a12475ff1b8aa61210d08522c3c8aaf0e2648 "vhost: backend > >>masking support" breaks virtio-net + vhost=on on PPC64 platform. > >> > >>The problem command line is: > >>1) -netdev tap,id=tapnet,ifname=tap0,script=qemu-ifup.sh,vhost=on \ > >>-device virtio-net-pci,netdev=tapnet,addr=0.0 \ > > > >I think the issue is irqfd in not supported on kvm ppc. > > How can I make sure this is the case? Some work has been done there > recently but midnight is quite late to figure this out :) Look in virtio_pci_set_guest_notifiers, what is the value of with_irqfd? bool with_irqfd = msix_enabled(&proxy->pci_dev) && kvm_msi_via_irqfd_enabled(); Also check what each of the values in the expression above is. > > >Could you please check this: > > > >+ /* If guest supports masking, set up irqfd now. > >+ * Otherwise, delay until unmasked in the frontend. > >+ */ > >+ if (proxy->vdev->guest_notifier_mask) { > >+ ret = kvm_virtio_pci_irqfd_use(proxy, queue_no, vector); > >+ if (ret < 0) { > >+ kvm_virtio_pci_vq_vector_release(proxy, vector); > >+ goto undo; > >+ } > >+ } > > > > > >Could you please add a printf before "undo" and check whether the > >error path above is triggered? > > > Checked, it is not triggered. > > > -- > Alexey I think I get it. Does the following help (probably not the right thing to do, but just for testing): Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index ba56ab2..c2a0c5a 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -800,6 +800,10 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) } } + if (!with_irqfd && proxy->vdev->guest_notifier_mask) { + proxy->vdev->guest_notifier_mask(proxy->vdev, queue_no, !assign); + } + /* Must set vector notifier after guest notifier has been assigned */ if (with_irqfd && assign) { proxy->vector_irqfd =