From patchwork Thu Feb 13 09:17:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 319929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7A44C2C00BA for ; Thu, 13 Feb 2014 20:17:45 +1100 (EST) Received: from localhost ([::1]:45165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDsQR-0004id-03 for incoming@patchwork.ozlabs.org; Thu, 13 Feb 2014 04:17:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDsPq-0004WH-6K for qemu-devel@nongnu.org; Thu, 13 Feb 2014 04:17:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDsPf-00057Y-JN for qemu-devel@nongnu.org; Thu, 13 Feb 2014 04:17:06 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:57203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDsPf-000576-BP for qemu-devel@nongnu.org; Thu, 13 Feb 2014 04:16:55 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Feb 2014 09:16:53 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 13 Feb 2014 09:16:52 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9974F17D805F for ; Thu, 13 Feb 2014 09:17:18 +0000 (GMT) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1D9GdSt57868328 for ; Thu, 13 Feb 2014 09:16:39 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1DAGp8v011252 for ; Thu, 13 Feb 2014 03:16:52 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s1DAGp3i011242; Thu, 13 Feb 2014 03:16:51 -0700 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 63EFA122444D; Thu, 13 Feb 2014 10:16:50 +0100 (CET) From: Christian Borntraeger To: Anthony Liguori , Peter Maydell Date: Thu, 13 Feb 2014 10:17:10 +0100 Message-Id: <1392283031-40129-3-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1392283031-40129-1-git-send-email-borntraeger@de.ibm.com> References: <1392283031-40129-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14021309-1948-0000-0000-000007CBA855 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.110 Cc: qemu-devel , Alexander Graf , Christian Borntraeger , Jens Freimann , Cornelia Huck , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PULL 2/3] s390-ccw.img: Fix sporadic errors with ccw boot image - initialize css X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 first boot this is ok, but on reboots this might fail. 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..d7fc727 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;