qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
	borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com,
	qemu-devel@nongnu.org, agraf@suse.de
Subject: [Qemu-devel] [PULL 3/8] s390-virtio: clear {used, avail}_event_idx on reset as well
Date: Fri,  8 May 2015 11:08:30 +0200	[thread overview]
Message-ID: <1431076115-13153-4-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1431076115-13153-1-git-send-email-cornelia.huck@de.ibm.com>

From: Christian Borntraeger <borntraeger@de.ibm.com>

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 <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 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

  parent reply	other threads:[~2015-05-08  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08  9:08 [Qemu-devel] [PULL 0/8] s390x: various patches Cornelia Huck
2015-05-08  9:08 ` [Qemu-devel] [PULL 1/8] s390-virtio: Accommodate guests using virtqueues too early Cornelia Huck
2015-05-08  9:08 ` [Qemu-devel] [PULL 2/8] s390-virtio: use common features Cornelia Huck
2015-05-08  9:08 ` Cornelia Huck [this message]
2015-05-08  9:08 ` [Qemu-devel] [PULL 4/8] virtio-ccw: change realization sequence Cornelia Huck
2015-05-08  9:08 ` [Qemu-devel] [PULL 5/8] virtio-ccw: implement ->device_plugged Cornelia Huck
2015-05-08  9:08 ` [Qemu-devel] [PULL 6/8] s390x/kvm: use ioctl KVM_S390_IRQ for vcpu interrupts Cornelia Huck
2015-05-08  9:08 ` [Qemu-devel] [PULL 7/8] s390x: move fpu regs into a subsection of the vmstate Cornelia Huck
2015-05-08  9:08 ` [Qemu-devel] [PULL 8/8] s390x/kvm: migrate vcpu interrupt state Cornelia Huck
2015-05-11  8:41 ` [Qemu-devel] [PULL 0/8] s390x: various patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431076115-13153-4-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).