Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4270056imm; Mon, 25 Jun 2018 12:41:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLFGrl76bXNG+zNIzkZlmD91wLJLTHEVdoAelER2b9ar/QcOg/ZRii2FqB5TLjjmvh5W5PZ X-Received: by 2002:a17:902:b216:: with SMTP id t22-v6mr13837390plr.199.1529955663384; Mon, 25 Jun 2018 12:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529955663; cv=none; d=google.com; s=arc-20160816; b=ZNhgMZn8EKAfEUQNHtx6/4gtRkhTiHP3oOJrkcyqQ/VVDl/lZZ3Eb00miFw8SI2HTV UPODPb3uIWNSEkZE9kZo8uYcAVTUD65RPgpa5IIG0rgyV9iKo80wdaaruT4MRBwylEKd jYiISvMUDUo9fWPvaczvuIM8t8/UdqZB+H/TuFKUvlUpix0fSn+BzDyr7JIEHB7xjdpv omsQPJSOqMaUdsdM/1Xad0ivj0zjk9r/7y9B+27exQOyiPyt1RLRP0q14m2UbyRjyWcT 7Y1QBEh2WJ/R+5xHxRGd37Q3L92Aw2OR0VukjLdi+YeDipemhUlIKr8NPJCsNiBF76pQ 2i9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=gq0JTHj5D4u/GkseGQRegusXjQY6Q6Abq18139Rv0AM=; b=EBvVfB+iiKiIUsEwXTYM4XpSaX8oBKXnAiHIHXdwvNug7PMj8+XAtyrbAg1wZgPe6+ DHlemGqWgHLhL8Chf5W1ENdHoGGqSP4iKhwLQVDnBNPyNLPm20xvKgGhkO9yMfwzIGWv 2h8OtOF0H6IdrUX78bVtA34rhfYQPvjsX06Gd54dFEkmQTql8B4MARA2a2T8fz7C2fHg WN7sYc86hrbJ2otw/z/nVx4SsKPVXnYC1aAEzjhg/yV9rXgnfvD6UWiY/nMCX6+tWrje PUqkFvfp42tDUgYlrjbE4FDLCVJkqXRacdlOrB1OI2+thx1WxN5o34yuhpGLydl5YZuV VXuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=s6aKmISo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s65-v6si15621947pfe.290.2018.06.25.12.40.48; Mon, 25 Jun 2018 12:41:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=s6aKmISo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935038AbeFYTkJ (ORCPT + 99 others); Mon, 25 Jun 2018 15:40:09 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:53572 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934940AbeFYTkH (ORCPT ); Mon, 25 Jun 2018 15:40:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gq0JTHj5D4u/GkseGQRegusXjQY6Q6Abq18139Rv0AM=; b=s6aKmISocxtbtepddjwWGvhb3p 1QEVuCxxl2WNj5RiJTqYaQXtx1z5CAHnRPCzz4VbAYOpfepKS9PVY65llhcE/1IuzjXGsaIqkXjX8 OniFurTsCrwUFVAoQ6Fmqz3MiGk15SKkqRkdMw158nuFbPd/J+zapKUigZ2wuuZUZtj+aH3zGvFNd mN4MpZs9iP8mMsxDTJfCKstF/T+3V0Qx24mfVX89DB5uUSfikxbVr5eKL1QBE7cJvhNB0o0YtS5kF 2LvIuJ8YMc3q7vjy41XXXDfPZVhirZ8eS7y1xz0ebkebZa0qCsRgmWDLoe6eYHYeSQDFplyTgdn3a Zyv/FB2A==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:47576 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.89) (envelope-from ) id 1fXXLK-00Gp2V-RM; Mon, 25 Jun 2018 19:40:07 +0000 Date: Mon, 25 Jun 2018 12:40:05 -0700 From: Guenter Roeck To: Vasily Gorbik Cc: Christian Borntraeger , Martin Schwidefsky , Heiko Carstens , Cornelia Huck , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, qemu-s390x , qemu-devel , Thomas Huth Subject: Re: [PATCH] s390/boot: block uncompressed vmlinux booting attempts Message-ID: <20180625194005.GA21023@roeck-us.net> References: <64bcba64-b88f-3594-da6e-7c2118482c20@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 05:09:19PM +0200, Vasily Gorbik wrote: > 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 With qemu: 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 number 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 > > - > +#define EP_OFFSET 0x10008 > +#define EP_STRING "S390EP" > #define PARMAREA 0x10400 > #define PARMAREA_END 0x11000 > > 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); > } > > +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(); > -- > ⣔⢻⣟⢢ 2.18.0.rc2.13.g4da9a5d > ⣿⢿⡿⣿ pacman edition >