From nobody Sat Feb 7 03:45:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619103561; cv=none; d=zohomail.com; s=zohoarc; b=B+FlQguJFmJ+qyir7ouRLAhtxJwZjI2lbXbJn9AltwCku9fXLGB4Kpx/OJ27DV2dJfsAQjY+xd9V0d1hYt/KptVchoA7BoAtYhj65F7Bd29Qn+v0G1Ka2/aVyFLr2sLOJdsPNrtX3VYvkT00EGbHVPF+cY4M5kQRclE/P/bEcW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619103561; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=KyU49pUarJyylQp+gLXcuupEdSTxKWJDdKxo6CuEd2k=; b=OY1/F+9l0qF+MhT2y8W6apqvuKvRV1nfHg+PQHsuAsdk8s+yzvWye21UGTd6+WibqJNfcv5lD0vY0XWM5xer2dbB840kFtShEJ8SrL0Q+zI3I05Q8jYqK1TU96CjjvIEd0T+Y+wCd5HBE6S4XO+37dGx6so0OjopW96BCt5JgEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1619103561395248.0963188515733; Thu, 22 Apr 2021 07:59:21 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-wk4AwQYZPFynf0d2YOGI_w-1; Thu, 22 Apr 2021 10:59:15 -0400 Received: by mail-wr1-f69.google.com with SMTP id d15-20020a5d538f0000b02901027c18c581so13820169wrv.3 for ; Thu, 22 Apr 2021 07:59:14 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id g3sm4079976wrp.46.2021.04.22.07.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 07:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619103560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyU49pUarJyylQp+gLXcuupEdSTxKWJDdKxo6CuEd2k=; b=h0oDRlAusfF9Xj6ychMXq58Q6JzUlGp4s/QcT8XnVK/EhYxVGXOC9n0VboKXAnKMTsPHcf IjlXBISuzs80vk7C+d/ZqRKEalphb1Cjnah1APyr2ZGNUaolSq6RVDp5dtZ3ZS8fT2zzX3 TpQ4eO94BDQfzlm+fkkbXBBT/uM25B4= X-MC-Unique: wk4AwQYZPFynf0d2YOGI_w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KyU49pUarJyylQp+gLXcuupEdSTxKWJDdKxo6CuEd2k=; b=ObEs9Yw97wVWbMpsmrM/i33NVQXK0Ft9G3NbLu8RT+Pztw6PDNQ7x3GisOQ8f1RWWT 6hWkTmgrkQYo1bAd0Bluzdpvr4D/Dd9Mc1W7tv3dM8zF31XkLl1yAAXuHMSnNE2ecw8W Hd/EJ0wOhZ3VKu26i6DFc/8Z4AQb/0SU93bQIy0i+yeVOOFF4cPFGLJFAYuHa0oDFHab 1ZAQNriMs9dzmx4mqAwZs5s80krn9y1wi/PooiodCR3MEek2P8nBeXJR2M7K9MXvmcbO vz8rkO0U75YTEEoT7/ZJ6GEKLMvNTIBVhIH1Ccn301e+Fj3XNz1yfLxm1o8GmkmIUQDi +Zpw== X-Gm-Message-State: AOAM532VUBGwLh84VdyASOs7Blsg3D0CuSsKsSNYnt8Yfpvx9q1DVbPU 9Wb/lJYRDJzrXxWTMHro3Mkhz961fCor8qJUxQBNclc1LsjQz1Wx2qB1z9OnnGd3ZjibY6FV92D moaATKDaoTqF97A== X-Received: by 2002:adf:d1c3:: with SMTP id b3mr4643232wrd.367.1619103553687; Thu, 22 Apr 2021 07:59:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3yej6n7aUc3ixdpKXj5rml98CRYad4AOWud2e0P4rvR8YpNySf1SluDDQ4ZKrnXJ1eSiFpA== X-Received: by 2002:adf:d1c3:: with SMTP id b3mr4643211wrd.367.1619103553474; Thu, 22 Apr 2021 07:59:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cornelia Huck , Thomas Huth , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , qemu-s390x@nongnu.org, Christian Borntraeger , Richard Henderson , Stefano Garzarella , Peter Maydell , Miroslav Rezanina , Janosch Frank , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] pc-bios/s390-ccw: Silence GCC 11 stringop-overflow warning Date: Thu, 22 Apr 2021 16:59:11 +0200 Message-Id: <20210422145911.2513980-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) When building on Fedora 34 (gcc version 11.0.0 20210210) we get: In file included from pc-bios/s390-ccw/main.c:11: In function =E2=80=98memset=E2=80=99, inlined from =E2=80=98boot_setup=E2=80=99 at pc-bios/s390-ccw/main.c:= 185:5, inlined from =E2=80=98main=E2=80=99 at pc-bios/s390-ccw/main.c:288:5: pc-bios/s390-ccw/libc.h:28:14: warning: writing 1 byte into a region of s= ize 0 [-Wstringop-overflow=3D] 28 | p[i] =3D c; | ~~~~~^~~ The offending code is: memset((char *)S390EP, 0, 6); where S390EP is a const address: #define S390EP 0x10008 The compiler doesn't now how big that pointed area is, so assume its length is zero. This has been reported as BZ#99578 to GCC: "gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a pointer from integer literal" https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99578 As this warning does us more harm than good in the BIOS code (where lot of direct accesses to low memory are done), silence this warning for all BIOS objects. Re-introduce the cc-c-option macro (see commit 036999e93e4) to check whether the compiler supports this warning or not. Suggested-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Christian Borntraeger --- pc-bios/s390-ccw/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 29fd9019b83..21581d1258d 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -8,6 +8,8 @@ CFLAGS =3D -O2 -g quiet-command =3D $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1= , @$1)) cc-option =3D $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/n= ull \ 2>&1 && echo OK), $1, $2) +cc-c-option =3D $(if $(shell $(CC) $1 $2 -c -o /dev/null -xc /dev/null \ + >/dev/null 2>&1 && echo OK), $2, $3) =20 VPATH_SUFFIXES =3D %.c %.h %.S %.m %.mak %.sh %.rc Kconfig% %.json.in set-vpath =3D $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(P= ATTERN) $1))) @@ -30,6 +32,7 @@ OBJECTS =3D start.o main.o bootmap.o jump2ipl.o sclp.o me= nu.o \ virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o =20 QEMU_CFLAGS :=3D -Wall $(filter -W%, $(QEMU_CFLAGS)) +QEMU_CFLAGS +=3D $(call cc-c-option, $(QEMU_CFLAGS), -Wno-stringop-overflo= w) QEMU_CFLAGS +=3D -ffreestanding -fno-delete-null-pointer-checks -fno-commo= n -fPIE QEMU_CFLAGS +=3D -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tab= les QEMU_CFLAGS +=3D $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector) --=20 2.26.3