From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiHKs-0003Kx-Lj for qemu-devel@nongnu.org; Tue, 22 Mar 2016 04:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiHKp-0006fz-Ft for qemu-devel@nongnu.org; Tue, 22 Mar 2016 04:06:42 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:41235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiHKp-0006ef-7f for qemu-devel@nongnu.org; Tue, 22 Mar 2016 04:06:39 -0400 Received: from localhost by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Mar 2016 08:06:36 -0000 Date: Tue, 22 Mar 2016 09:06:32 +0100 From: Cornelia Huck Message-ID: <20160322090632.19be58c9.cornelia.huck@de.ibm.com> In-Reply-To: <20160321234519.GA24609@ad.usersys.redhat.com> References: <56E9425C.8030201@de.ibm.com> <56E957AD.2050005@redhat.com> <56E961EA.4090908@de.ibm.com> <56E9638B.5090204@redhat.com> <20160317003906.GA23821@ad.usersys.redhat.com> <56EA8EEE.2020801@linux.vnet.ibm.com> <20160321105718.GA7710@ad.usersys.redhat.com> <20160321121533.7db7d097.cornelia.huck@de.ibm.com> <20160321124527.GA21834@ad.usersys.redhat.com> <20160321140234.22b0ac41.cornelia.huck@de.ibm.com> <20160321234519.GA24609@ad.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-block@nongnu.org, "Michael S. Tsirkin" , qemu-devel@nongnu.org, tu bo , Stefan Hajnoczi , Paolo Bonzini , Christian Borntraeger On Tue, 22 Mar 2016 07:45:19 +0800 Fam Zheng wrote: > On Mon, 03/21 14:02, Cornelia Huck wrote: > > On Mon, 21 Mar 2016 20:45:27 +0800 > > Fam Zheng wrote: > > > > > On Mon, 03/21 12:15, Cornelia Huck wrote: > > > > On Mon, 21 Mar 2016 18:57:18 +0800 > > > > Fam Zheng wrote: > > > > > > > > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > > > > > index 08275a9..47f8043 100644 > > > > > --- a/hw/virtio/virtio.c > > > > > +++ b/hw/virtio/virtio.c > > > > > @@ -1098,7 +1098,14 @@ void virtio_queue_notify_vq(VirtQueue *vq) > > > > > > > > > > void virtio_queue_notify(VirtIODevice *vdev, int n) > > > > > { > > > > > - virtio_queue_notify_vq(&vdev->vq[n]); > > > > > + VirtQueue *vq = &vdev->vq[n]; > > > > > + EventNotifier *n; > > > > > + n = virtio_queue_get_host_notifier(vq); > > > > > + if (n) { > > > > > > > > Isn't that always true, even if the notifier has not been setup? > > > > > > You are right, this doesn't make a correct fix. But we can still do a quick > > > test with this as the else branch should never be used with ioeventfd=on. Am I > > > right? > > > > > > Fam > > > > Won't we come through here for the very first kick, when we haven't > > registered the ioeventfd with the kernel yet? > > > > The ioeventfd in virtio-ccw is registered in the main loop when > VIRTIO_CONFIG_S_DRIVER_OK is set, so I think the first kick is okay. You're right, for well-behaved drivers this will be done from set_status, so for testing that's fine.