Received: from eggs.gnu.org ([2001:4830:134:3::10]:51915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJJmi-0002V2-JD for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:31:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJJmU-0004mh-6u for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:31:12 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:34261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJJmT-0004mb-Tl for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:30:58 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Feb 2014 09:30:57 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8FD391B08040 for ; Fri, 28 Feb 2014 09:30:36 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1S9UgUC66846854 for ; Fri, 28 Feb 2014 09:30:42 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1S9Up8j023933 for ; Fri, 28 Feb 2014 02:30:54 -0700 From: Christian Borntraeger Date: Fri, 28 Feb 2014 10:31:00 +0100 Message-Id: <1393579866-43465-17-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1393579866-43465-1-git-send-email-borntraeger@de.ibm.com> References: <1393579866-43465-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 16/22] s390-ccw.img: Fix sporadic errors with ccw boot image - initialize css List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Anthony Liguori , Peter Maydell Cc: Cornelia Huck , Christian Borntraeger , Jens Freimann , Alexander Graf , Richard Henderson We have to set the cssid to 0, otherwise the stsch code will return an operand exception without the m bit. In the same way we should set m=0. This case was triggered in some cases during reboot, if for some reason the location of blk_schid.cssid contains 1 and m was 0. Turns out that the qemu elf loader does not zero out the bss section on reboot. The symptom was an dump of the old kernel with several areas overwritten. The bootloader does not register a program check handler, so bios exception jumped back into the old kernel. Lets just use a local struct with a designed initializer. That will guarantee that all other subelements are initialized to 0. Signed-off-by: Christian Borntraeger Reviewed-by: Cornelia Huck --- pc-bios/s390-ccw/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index c5d5332..5c33766 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -10,7 +10,6 @@ #include "s390-ccw.h" -struct subchannel_id blk_schid; char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); uint64_t boot_value; @@ -23,13 +22,13 @@ void virtio_panic(const char *string) static void virtio_setup(uint64_t dev_info) { + struct subchannel_id blk_schid = { .one = 1 }; struct schib schib; int i; int r; bool found = false; bool check_devno = false; uint16_t dev_no = -1; - blk_schid.one = 1; if (dev_info != -1) { check_devno = true; -- 1.8.4.2