From patchwork Mon Nov 20 09:18:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10066189 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3B9B960375 for ; Mon, 20 Nov 2017 09:19:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D72D290A2 for ; Mon, 20 Nov 2017 09:19:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 215B329163; Mon, 20 Nov 2017 09:19:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D6FF290A2 for ; Mon, 20 Nov 2017 09:19:26 +0000 (UTC) Received: from localhost ([::1]:56206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGiEf-0005QT-2h for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Nov 2017 04:19:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGiE1-0005QC-K6 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 04:18:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGiDy-0004gG-FS for qemu-devel@nongnu.org; Mon, 20 Nov 2017 04:18:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26884) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGiDy-0004fr-8c; Mon, 20 Nov 2017 04:18:42 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3435B76526; Mon, 20 Nov 2017 09:18:41 +0000 (UTC) Received: from [10.36.116.58] (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 204F95C737; Mon, 20 Nov 2017 09:18:39 +0000 (UTC) To: Christian Borntraeger , qemu-s390x@nongnu.org, Cornelia Huck References: <1510942228-22822-1-git-send-email-thuth@redhat.com> From: Thomas Huth Message-ID: Date: Mon, 20 Nov 2017 10:18:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 20 Nov 2017 09:18:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH for-2.11] pc-bios/s390-ccw: Fix problem with invalid virtio-scsi LUN when rebooting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 20.11.2017 09:48, Christian Borntraeger wrote: > Thomas, > > does this patch help as well? > > 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 No, that alone does not help, the default_scsi_device variable is still in the normal .bss section in that case (you can also check that with objdump for example). You'd have to apply this patch on top to fix it that way: ... then the variable is in the .data section instead. But since the problem with other uninitialized .bss variables is then still pending, I think we should rather go with my patch for 2.11 and fix future problems properly in v2.12 by initializing the complete .bss to zero in the start.S file. Thomas diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c index c92f5d3..64ab095 100644 --- a/pc-bios/s390-ccw/virtio-scsi.c +++ b/pc-bios/s390-ccw/virtio-scsi.c @@ -15,7 +15,7 @@ #include "scsi.h" #include "virtio-scsi.h" -static ScsiDevice default_scsi_device; +static ScsiDevice default_scsi_device = { 0 }; static VirtioScsiCmdReq req; static VirtioScsiCmdResp resp;