qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] s390/ipl: Fix spurious errors in virtio
@ 2013-05-23 11:51 Christian Borntraeger
  2013-05-31 16:34 ` Andreas Färber
  2013-06-03 15:44 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Borntraeger @ 2013-05-23 11:51 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Christian Borntraeger, aliguori, Andreas Färber, qemu-devel

With the ccw ipl code sometimes an error message like
"virtio: trying to map MMIO memory" or
"Guest moved used index from %u to %u" appeared. Turns out
that the ccw bios did not zero out the vring, which might
cause stale values in avail->idx and friends, especially
on reboot.

Lets zero out the relevant fields. To activate the patch we
need to rebuild s390-ccw.img as well.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 pc-bios/s390-ccw/virtio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 5b9e1dc..f438af1 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -114,8 +114,13 @@ static void vring_init(struct vring *vr, unsigned int num, void *p,
     vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1)
                 & ~(align - 1));
 
+    /* Zero out all relevant field */
+    vr->avail->flags = 0;
+    vr->avail->idx = 0;
+
     /* We're running with interrupts off anyways, so don't bother */
     vr->used->flags = VRING_USED_F_NO_NOTIFY;
+    vr->used->idx = 0;
 
     debug_print_addr("init vr", vr);
 }
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-03 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 11:51 [Qemu-devel] [PATCH] s390/ipl: Fix spurious errors in virtio Christian Borntraeger
2013-05-31 16:34 ` Andreas Färber
2013-06-03 15:44 ` Anthony Liguori

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).