qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pc-bios/s390-ccw: build s390 bios with -fno-zero-initialized-in-bss
@ 2017-11-20  9:15 Christian Borntraeger
  2017-11-20  9:19 ` Alexander Graf
  2017-11-20  9:20 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
  0 siblings, 2 replies; 11+ messages in thread
From: Christian Borntraeger @ 2017-11-20  9:15 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: qemu-devel, qemu-s390x, Halil Pasic, Alexander Graf,
	Richard Henderson, Thomas Huth, Christian Borntraeger

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.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 pc-bios/s390-ccw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
index 6d0c2ee..2687590 100644
--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -12,7 +12,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw)
 OBJECTS = start.o main.o bootmap.o sclp.o virtio.o virtio-scsi.o virtio-blkdev.o
 QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
 QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
-QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
+QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing -fno-zero-initialized-in-bss
 QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
 LDFLAGS += -Wl,-pie -nostdlib
 
-- 
2.9.4

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

end of thread, other threads:[~2017-11-20 13:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20  9:15 [Qemu-devel] [PATCH] pc-bios/s390-ccw: build s390 bios with -fno-zero-initialized-in-bss Christian Borntraeger
2017-11-20  9:19 ` Alexander Graf
2017-11-20  9:27   ` Christian Borntraeger
2017-11-20  9:29     ` Alexander Graf
2017-11-20 10:02       ` Christian Borntraeger
2017-11-20 10:16         ` Alexander Graf
2017-11-20 10:19           ` Christian Borntraeger
2017-11-20 10:24             ` Alexander Graf
2017-11-20 10:27               ` Christian Borntraeger
2017-11-20 13:13             ` Richard Henderson
2017-11-20  9:20 ` [Qemu-devel] [qemu-s390x] " Thomas Huth

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