From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cghKj-0006Te-5z for qemu-devel@nongnu.org; Wed, 22 Feb 2017 19:32:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cghKe-0004Xc-9N for qemu-devel@nongnu.org; Wed, 22 Feb 2017 19:32:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43858) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cghKe-0004XN-31 for qemu-devel@nongnu.org; Wed, 22 Feb 2017 19:32:28 -0500 Date: Wed, 22 Feb 2017 17:32:25 -0700 From: Alex Williamson Message-ID: <20170222173225.4f48dd99@t450s.home> In-Reply-To: <726a3292-9e27-6748-9669-a7c21cbf3b6e@redhat.com> References: <1487361200-29966-1-git-send-email-mst@redhat.com> <1487361200-29966-13-git-send-email-mst@redhat.com> <1487681835.2694.76.camel@redhat.com> <83a2d0c9-23a4-32b1-ffe7-b33bbe9ea25d@redhat.com> <726a3292-9e27-6748-9669-a7c21cbf3b6e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 12/23] virtio: use VRingMemoryRegionCaches for avail and used rings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Laszlo Ersek , Gerd Hoffmann , "Michael S. Tsirkin" , Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, 22 Feb 2017 10:03:56 +0100 Paolo Bonzini wrote: > On 21/02/2017 18:54, Laszlo Ersek wrote: > > Actually, QEMU segfaults. From the dmesg: > > > > [Tue Feb 21 18:47:28 2017] CPU 0/KVM[8298]: segfault at 48 ip > > 00007fcb5dd02105 sp 00007fcb49efc270 error 4 in > > qemu-system-x86_64[7fcb5dae3000+905000] > > > > Complete backtrace below. (Thread 11 seems to be the one > > segfaulting.) > > Indeed. It's the virtio-blk device that is segfaulting, please try > this one liner (haven't reproduced it, but it seems obvious with the > backtrace and some sleep). I hit this as well, the patch below resolves it. Tested-by: Alex Williamson > commit c1aa478c7181c543606ca81404c59e126d66213d > Author: Paolo Bonzini > Date: Wed Feb 22 10:02:37 2017 +0100 > > virtio: check for vring setup in virtio_queue_empty > > If the vring has not been set up, there is nothing in the virtqueue. > virtio_queue_host_notifier_aio_poll calls virtio_queue_empty even in > this case; we have to filter it out just like virtio_queue_notify_aio_vq. > > Reported-by: Gerd Hoffmann > Signed-off-by: Paolo Bonzini > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 23483c7..e487e36 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -2291,7 +2291,7 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque) > VirtQueue *vq = container_of(n, VirtQueue, host_notifier); > bool progress; > > - if (virtio_queue_empty(vq)) { > + if (!vq->vring.desc || virtio_queue_empty(vq)) { > return false; > } > >