From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfU5C-0006HV-KL for qemu-devel@nongnu.org; Thu, 23 May 2013 07:53:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfU5B-0000qZ-Eu for qemu-devel@nongnu.org; Thu, 23 May 2013 07:53:22 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:45987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfU3J-0008TI-VK for qemu-devel@nongnu.org; Thu, 23 May 2013 07:51:26 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 May 2013 12:46:59 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id C1E9E2190023 for ; Thu, 23 May 2013 12:54:16 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4NBp9dH33095708 for ; Thu, 23 May 2013 11:51:09 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 r4NBpImg003759 for ; Thu, 23 May 2013 05:51:19 -0600 From: Christian Borntraeger Date: Thu, 23 May 2013 13:51:41 +0200 Message-Id: <1369309901-418-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH] s390/ipl: Fix spurious errors in virtio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Christian Borntraeger , aliguori@us.ibm.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= , 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 --- 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