From 4170aea1a77d7adf9e35ab4d3c17086c38ca6c09 Mon Sep 17 00:00:00 2001 From: Jens Freimann Date: Thu, 26 Apr 2012 09:03:36 +0000 Subject: s390: reset avail and used index on reboot reset the guest vring avail/used idx fields, otherwise it's possible that old values remain in memory which would cause a reboot to fail with a "Guest moved used index" message Signed-off-by: Jens Freimann Signed-off-by: Christian Borntraeger Signed-off-by: Alexander Graf --- hw/s390-virtio-bus.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw/s390-virtio-bus.h') diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h index 0e60bc0..49e6c46 100644 --- a/hw/s390-virtio-bus.h +++ b/hw/s390-virtio-bus.h @@ -34,6 +34,8 @@ #define VIRTIO_VQCONFIG_LEN 24 #define VIRTIO_RING_LEN (TARGET_PAGE_SIZE * 3) +#define VIRTIO_VRING_AVAIL_IDX_OFFS 2 +#define VIRTIO_VRING_USED_IDX_OFFS 2 #define S390_DEVICE_PAGES 512 #define VIRTIO_PARAM_MASK 0xff @@ -90,3 +92,5 @@ VirtIOS390Device *s390_virtio_bus_find_vring(VirtIOS390Bus *bus, ram_addr_t mem, int *vq_num); VirtIOS390Device *s390_virtio_bus_find_mem(VirtIOS390Bus *bus, ram_addr_t mem); void s390_virtio_device_sync(VirtIOS390Device *dev); +void s390_virtio_reset_idx(VirtIOS390Device *dev); + -- cgit v1.1