From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE28j-000308-BS for qemu-devel@nongnu.org; Thu, 13 Feb 2014 14:40:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WE28Z-00019b-LN for qemu-devel@nongnu.org; Thu, 13 Feb 2014 14:40:05 -0500 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:51738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE28Z-00018r-BL for qemu-devel@nongnu.org; Thu, 13 Feb 2014 14:39:55 -0500 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Feb 2014 19:39:53 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 38AFB17D8059 for ; Thu, 13 Feb 2014 19:40:19 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1DJddgJ524680 for ; Thu, 13 Feb 2014 19:39:39 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 s1DJdoAb022580 for ; Thu, 13 Feb 2014 12:39:51 -0700 Message-ID: <52FD1F85.8010600@de.ibm.com> Date: Thu, 13 Feb 2014 20:39:49 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <1392283031-40129-1-git-send-email-borntraeger@de.ibm.com> <1392283031-40129-2-git-send-email-borntraeger@de.ibm.com> <52FCE1AA.4080509@twiddle.net> In-Reply-To: <52FCE1AA.4080509@twiddle.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 1/3] s390-ccw.img: Fix sporadic reboot hangs: Initialize next_idx List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Anthony Liguori , Peter Maydell Cc: Cornelia Huck , Jens Freimann , Alexander Graf , =?ISO-8859-1?Q?Andreas_F=E4rber?= , qemu-devel On 13/02/14 16:15, Richard Henderson wrote: > On 02/13/2014 01:17 AM, Christian Borntraeger wrote: >> The current code does not initialize next_idx as the qemu >> elf loader does not zero the bss section. >> Make the initialization explicit. >> >> Signed-off-by: Christian Borntraeger >> --- >> pc-bios/s390-ccw/virtio.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c >> index 4d6e48f..a46914d 100644 >> --- a/pc-bios/s390-ccw/virtio.c >> +++ b/pc-bios/s390-ccw/virtio.c >> @@ -124,6 +124,7 @@ static void vring_init(struct vring *vr, unsigned int num, void *p, >> vr->used->flags = VRING_USED_F_NO_NOTIFY; >> vr->used->idx = 0; >> vr->used_idx = 0; >> + vr->next_idx = 0; >> >> debug_print_addr("init vr", vr); >> } >> > > FWIW, I believe that rom_reset needs to do this re-zeroing of the bss. > That seems to be the only place we don't take care for datasize != romsize. > Indeed, initializing the data as in my patches isnt wrong (and allows to move that structures around e.g. from a global variable to stack), so it still makes sense to apply both patches, but the main problem was that the bss section is not cleared on reset. So we need to memset from rom->data+rom->datasize to rom->data+rom->romsize to avoid more of these kind of problems in an add-on patch. Christian