Received: from eggs.gnu.org ([2001:4830:134:3::10]:45352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGivK-0000Gy-UW for qemu-devel@nongnu.org; Mon, 20 Nov 2017 05:03:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGivH-00019B-PB for qemu-devel@nongnu.org; Mon, 20 Nov 2017 05:03:30 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35404 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGivH-00018p-JW for qemu-devel@nongnu.org; Mon, 20 Nov 2017 05:03:27 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAKA3HcL088183 for ; Mon, 20 Nov 2017 05:03:21 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ebuyqjvjg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Nov 2017 05:03:18 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Nov 2017 10:02:50 -0000 References: <20171120091520.86128-1-borntraeger@de.ibm.com> <5a4be37f-29b5-1d0d-91ab-9cb15c93e088@suse.de> <08cec003-1291-8302-1280-d53cba5c7538@de.ibm.com> <5a6cd622-3064-a920-8f72-bc820aa13203@suse.de> From: Christian Borntraeger Date: Mon, 20 Nov 2017 11:02:46 +0100 MIME-Version: 1.0 In-Reply-To: <5a6cd622-3064-a920-8f72-bc820aa13203@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: Subject: Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: build s390 bios with -fno-zero-initialized-in-bss List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Cornelia Huck Cc: qemu-devel , qemu-s390x , Halil Pasic , Richard Henderson , Thomas Huth On 11/20/2017 10:29 AM, Alexander Graf wrote: > On 11/20/2017 10:27 AM, Christian Borntraeger wrote: >> >> On 11/20/2017 10:19 AM, Alexander Graf wrote: >>> On 11/20/2017 10:15 AM, Christian Borntraeger wrote: >>>> The QEMU ELF loader does not initialize the bss segment. This has >>>> triggered several bugs in the past, e.g. see commit 5d739a4787a5 >>>> ("s390-ccw.img: Fix sporadic errors with ccw boot image - initialize >>>> css"). >>>> >>>> Instead of fixing these things one-by-one we can build the BIOS >>>> with -fno-zero-initialized-in-bss. This will move the zero variables >>>> also into the data segment, which is then part of a LOAD section. >>> Doesn't this bloat the firmware? Why don't we just manually clear bss in the firmware itself? It's what all other firmwares do :) >> Yes the proper fix is to initialize bss in the bios itself. >> I was trying to come up with something for 2.11, but since the patch does not solve the original issues, lets drop it. > > > Initializing bss is quite simple. You can probably even do it from C. Just set two variables before and after .bss in the linker script and memset(0) from start to end :). Yes, I know but then we have to change the build process to use a linker script.(we rely on the default linker script right now).