Received: from eggs.gnu.org ([2001:4830:134:3::10]:37919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpIoI-0000Oa-A9 for qemu-devel@nongnu.org; Mon, 04 May 2015 12:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpIoC-0005BZ-Or for qemu-devel@nongnu.org; Mon, 04 May 2015 12:01:34 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:55758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpIoC-00053i-FY for qemu-devel@nongnu.org; Mon, 04 May 2015 12:01:28 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 May 2015 17:00:54 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id D46E517D8E8B for ; Mon, 4 May 2015 16:29:07 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t44FSN1b9765374 for ; Mon, 4 May 2015 15:28:23 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t44FSN1D027126 for ; Mon, 4 May 2015 09:28:23 -0600 From: Cornelia Huck Date: Mon, 4 May 2015 17:28:18 +0200 Message-Id: <1430753300-25739-4-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1430753300-25739-1-git-send-email-cornelia.huck@de.ibm.com> References: <1430753300-25739-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 3/5] s390-virtio: clear {used, avail}_event_idx on reset as well List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, 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