Received: from eggs.gnu.org ([2001:4830:134:3::10]:54995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqeHD-00049T-Ew for qemu-devel@nongnu.org; Fri, 08 May 2015 05:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqeH9-0001gR-9I for qemu-devel@nongnu.org; Fri, 08 May 2015 05:08:59 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:35924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqeH9-0001fx-07 for qemu-devel@nongnu.org; Fri, 08 May 2015 05:08:55 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 May 2015 10:08:54 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 002CA1B0806E for ; Fri, 8 May 2015 10:09:33 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4898obv10551714 for ; Fri, 8 May 2015 09:08:50 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4898lk0028163 for ; Fri, 8 May 2015 03:08:49 -0600 From: Cornelia Huck Date: Fri, 8 May 2015 11:08:30 +0200 Message-Id: <1431076115-13153-4-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1431076115-13153-1-git-send-email-cornelia.huck@de.ibm.com> References: <1431076115-13153-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL 3/8] s390-virtio: clear {used, avail}_event_idx on reset as well List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, qemu-devel@nongnu.org, agraf@suse.de From: Christian Borntraeger The old s390-virtio transport clears the vring used/avail indices in the shared area on reset. When we enabled event_idx for virtio-blk, we noticed that this is not enough: We also need to clear the published used/avail event indices, or reboot will fail. Signed-off-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-bus.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 4a33c6a..4f69cbb 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -77,10 +77,18 @@ void s390_virtio_reset_idx(VirtIOS390Device *dev) VIRTIO_VRING_AVAIL_IDX_OFFS; address_space_stw(&address_space_memory, idx_addr, 0, MEMTXATTRS_UNSPECIFIED, NULL); + idx_addr = virtio_queue_get_avail_addr(dev->vdev, i) + + virtio_queue_get_avail_size(dev->vdev, i); + address_space_stw(&address_space_memory, idx_addr, 0, + MEMTXATTRS_UNSPECIFIED, NULL); idx_addr = virtio_queue_get_used_addr(dev->vdev, i) + VIRTIO_VRING_USED_IDX_OFFS; address_space_stw(&address_space_memory, idx_addr, 0, MEMTXATTRS_UNSPECIFIED, NULL); + idx_addr = virtio_queue_get_used_addr(dev->vdev, i) + + virtio_queue_get_used_size(dev->vdev, i); + address_space_stw(&address_space_memory, idx_addr, 0, + MEMTXATTRS_UNSPECIFIED, NULL); } } -- 2.4.0