From nobody Mon Nov 3 18:05:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529939567673569.7236221695485; Mon, 25 Jun 2018 08:12:47 -0700 (PDT) Received: from localhost ([::1]:47699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXTAV-0003lY-40 for importer@patchew.org; Mon, 25 Jun 2018 11:12:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXT7V-0001kR-PV for qemu-devel@nongnu.org; Mon, 25 Jun 2018 11:09:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXT7R-0001Vf-J3 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 11:09:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41830) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXT7R-0001Uu-AA for qemu-devel@nongnu.org; Mon, 25 Jun 2018 11:09:29 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5PExUNL049139 for ; Mon, 25 Jun 2018 11:09:28 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ju2au1kt5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Jun 2018 11:09:27 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 Jun 2018 16:09:24 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 25 Jun 2018 16:09:22 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5PF9Kwe28770502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Jun 2018 15:09:20 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 19CA0A4040; Mon, 25 Jun 2018 16:09:15 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA7FBA404D; Mon, 25 Jun 2018 16:09:14 +0100 (BST) Received: from localhost (unknown [9.152.212.171]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 25 Jun 2018 16:09:14 +0100 (BST) Date: Mon, 25 Jun 2018 17:09:19 +0200 From: Vasily Gorbik To: Christian Borntraeger , Martin Schwidefsky References: <64bcba64-b88f-3594-da6e-7c2118482c20@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 x-cbid: 18062515-0012-0000-0000-000002834A51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062515-0013-0000-0000-000020B4A498 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-25_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806250175 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id w5PExUNL049139 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH] s390/boot: block uncompressed vmlinux booting attempts 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: linux-s390@vger.kernel.org, Thomas Huth , Cornelia Huck , Heiko Carstens , linux-kernel@vger.kernel.org, qemu-devel , qemu-s390x , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since uncompressed kernel image "vmlinux" elf file is not bootable under qemu anymore, add a check which would report that. Qemu users are encouraged to use bzImage or arch/s390/boot/compressed/vmlinux instead. The check relies on s390 linux entry point ABI definition, which is only present in bzImage and arch/s390/boot/compressed/vmlinux. Signed-off-by: Vasily Gorbik Acked-by: Christian Borntraeger Acked-by: Cornelia Huck Tested-by: Guenter Roeck --- arch/s390/boot/head.S | 4 ++-- arch/s390/include/asm/setup.h | 3 ++- arch/s390/kernel/early.c | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/s390/boot/head.S b/arch/s390/boot/head.S index f09e792df495..f721913b73f1 100644 --- a/arch/s390/boot/head.S +++ b/arch/s390/boot/head.S @@ -272,14 +272,14 @@ iplstart: .org 0x10000 ENTRY(startup) j .Lep_startup_normal - .org 0x10008 + .org EP_OFFSET # # This is a list of s390 kernel entry points. At address 0x1000f the numbe= r of # valid entry points is stored. # # IMPORTANT: Do not change this table, it is s390 kernel ABI! # - .ascii "S390EP" + .ascii EP_STRING .byte 0x00,0x01 # # kdump startup-code at 0x10010, running in 64 bit absolute addressing mode diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index be02f0558048..1d66016f4170 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h @@ -9,7 +9,8 @@ #include #include =20 - +#define EP_OFFSET 0x10008 +#define EP_STRING "S390EP" #define PARMAREA 0x10400 #define PARMAREA_END 0x11000 =20 diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index 827699eb48fa..45c5be3d8777 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -331,8 +331,20 @@ static void __init setup_boot_command_line(void) append_to_cmdline(append_ipl_scpdata); } =20 +static void __init check_image_bootable(void) +{ + if (!memcmp(EP_STRING, (void *)EP_OFFSET, strlen(EP_STRING))) + return; + + sclp_early_printk("The linux kernel boot failure: the image is corrupted = or not bootable.\n"); + sclp_early_printk("Please check that you are using bootable kernel image = \"bzImage\".\n"); + sclp_early_printk("(or alternatively \"arch/s390/boot/compressed/vmlinux\= " image for qemu)\n"); + disabled_wait(0xbadb007); +} + void __init startup_init(void) { + check_image_bootable(); time_early_init(); init_kernel_storage_key(); lockdep_off(); --=20 =E2=A3=94=E2=A2=BB=E2=A3=9F=E2=A2=A2 2.18.0.rc2.13.g4da9a5d =E2=A3=BF=E2=A2=BF=E2=A1=BF=E2=A3=BF pacman edition