Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3618249imm; Mon, 25 Jun 2018 01:29:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK37X0Cps8LypvLI4DtCXGe0uGhaeVQ1SmhRyajeAbtU9hAJjCcKm/wAt8bVtruXLDF6Hos X-Received: by 2002:a65:4249:: with SMTP id d9-v6mr9921660pgq.362.1529915354648; Mon, 25 Jun 2018 01:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529915354; cv=none; d=google.com; s=arc-20160816; b=gWUYdCdmOIKpg9ni4OgiGwdXA8ltTGZ6ncxxB4t2+RN/vT4YyOqZR1f1pilt7ZarHn B4oTq6vZViIyMfj6jb8iiqtTXHFgM7nfGnFdMpfDXUXGL4NPgxnNtZg2+B+H0ObZoWw+ iNdEUsRnZ3l0AElOfXpsPDK1Xcez8YEof2pd2W6cMbV9tA+PscCxtu08ymGB1gYS3xXE wplHuFfZy6rp4ynYSHyyiX9zdxtpX/eTlOBQUg1pUvZQmQZaIyXcdC7xJ6X27nVPc8le C5f1vuhDzHWimoea8Om6Fy9QhCZUjcKxx448XZhKBvnseav0kFyij7QykBzngbDPNFnj ZymA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=LKy+cdJZLNsnLZeuw07fjTJR6RhFVl7CJR7LLowHh8M=; b=yrJzuKATkKv9A+l2cnsc5O0XzeQZHU4Jj9X6fu3JFX4+nQS+A71Xg+okUJAQrfU9N1 X4TCCXZO1gaAFOmoRu7/r/w8A2pFZ2iHYk3RY8P2wyOCZxcw9ZXEOZO3w9sh5LY43hyY OZs77FsHJu0fhk5PB3MREuVjvYjs3y11hMN2VbUEoPfymlbVgOld9DpX8ANCpCe5CzMQ QQU5HyND1vYLBSWXLxAYaTGOxA/mPFf2cpQ9J/jyUlx3ly5ppykIT+oMq8Y/BH7tRYoQ seg0IdoKS0GaN0i0RdwHuNCA7x4kvZmaubeOwBrvl8nxdUwXerNFxPpog2ikQf7IMRAl dtHA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si11689344pgr.521.2018.06.25.01.28.59; Mon, 25 Jun 2018 01:29:14 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754259AbeFYI1d (ORCPT + 99 others); Mon, 25 Jun 2018 04:27:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54968 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752169AbeFYI1b (ORCPT ); Mon, 25 Jun 2018 04:27:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4C9681A4EA0; Mon, 25 Jun 2018 08:27:30 +0000 (UTC) Received: from [10.36.116.31] (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4D152166BA0; Mon, 25 Jun 2018 08:27:27 +0000 (UTC) Subject: Re: [qemu-s390x] s390 qemu boot failure in -next To: Christian Borntraeger , Guenter Roeck , Martin Schwidefsky Cc: linux-s390@vger.kernel.org, Vasily Gorbik , Cornelia Huck , Heiko Carstens , linux-kernel@vger.kernel.org, qemu-devel , qemu-s390x References: <20180622194736.GA5794@roeck-us.net> <126ac556-0602-b927-58f5-cb5f65a5e0ec@de.ibm.com> <88d9afed-f91d-c320-13c8-9a93fc52b700@de.ibm.com> <947bbba3-dcd0-7f5b-1d92-b41be764c2f5@de.ibm.com> From: Thomas Huth Openpgp: preference=signencrypt Autocrypt: addr=thuth@redhat.com; prefer-encrypt=mutual; keydata= xsFNBFH7eUwBEACzyOXKU+5Pcs6wNpKzrlJwzRl3VGZt95VCdb+FgoU9g11m7FWcOafrVRwU yYkTm9+7zBUc0sW5AuPGR/dp3pSLX/yFWsA/UB4nJsHqgDvDU7BImSeiTrnpMOTXb7Arw2a2 4CflIyFqjCpfDM4MuTmzTjXq4Uov1giGE9X6viNo1pxyEpd7PanlKNnf4PqEQp06X4IgUacW tSGj6Gcns1bCuHV8OPWLkf4hkRnu8hdL6i60Yxz4E6TqlrpxsfYwLXgEeswPHOA6Mn4Cso9O 0lewVYfFfsmokfAVMKWzOl1Sr0KGI5T9CpmRfAiSHpthhHWnECcJFwl72NTi6kUcUzG4se81 O6n9d/kTj7pzTmBdfwuOZ0YUSqcqs0W+l1NcASSYZQaDoD3/SLk+nqVeCBB4OnYOGhgmIHNW 0CwMRO/GK+20alxzk//V9GmIM2ACElbfF8+Uug3pqiHkVnKqM7W9/S1NH2qmxB6zMiJUHlTH gnVeZX0dgH27mzstcF786uPcdEqS0KJuxh2kk5IvUSL3Qn3ZgmgdxBMyCPciD/1cb7/Ahazr 3ThHQXSHXkH/aDXdfLsKVuwDzHLVSkdSnZdt5HHh75/NFHxwaTlydgfHmFFwodK8y/TjyiGZ zg2Kje38xnz8zKn9iesFBCcONXS7txENTzX0z80WKBhK+XSFJwARAQABzRxUa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pXT3v2ymTAsRKrVaEZLibTXaf+ WslxWek3xNYRiqwwWAJuL652eAlxUgQ5ZS+fXBRTiQpJ+F26I/2lccScRd9G5w== Message-ID: <7416298e-8f8a-fa1a-759f-da6526eab6ca@redhat.com> Date: Mon, 25 Jun 2018 10:27:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <947bbba3-dcd0-7f5b-1d92-b41be764c2f5@de.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 25 Jun 2018 08:27:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 25 Jun 2018 08:27:30 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.06.2018 10:02, Christian Borntraeger wrote: > > > On 06/25/2018 09:27 AM, Christian Borntraeger wrote: >> Also adding QEMU. >> >> On 06/25/2018 09:10 AM, Christian Borntraeger wrote: >>> >>> >>> On 06/22/2018 09:47 PM, Guenter Roeck wrote: >>>> Hi, >>>> >>>> starting with commit 's390/boot: make head.S and als.c be part of the >>>> decompressor only' in -next, s390 immages no longer boot in qemu. >>>> As far as I can see, the reason is that the command line is no longer >>>> passed from qemu to the kernel, which results in a panic because the >>>> root file system can not be mounted. >>>> >>>> Was this change made on purpose ? If so, is there a way to get qemu >>>> back to working ? >>> >>> Certainly not on purpose. >>> >>> Vasily, I can reproduce this with KVM and an external kernel boot of the vmlinux file (the elf file) >>> >>> e.g. >>> >>> qemu-system-s390 -enable-kvm -nographic -kernel vmlinux -append "this string no longer is command line" >>> >>> The compressed image (bzImage) seems to work fine though. >>> >>> This seems to be an unfortunate side effect of QEMUs ways to "guess" its Linux (checking for start >>> address 0x10000, which is no longer true for the vmlinux file). With the pure vmlinux elf file >>> the load address is 0x100000 as there is no unpacker. >>> >>> Guenter, can you check if arch/s390/boot/bzImage works for you as a workaround? >> >> Something like this in QEMU >> >> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c >> index f278036fa7..14153ce880 100644 >> --- a/hw/s390x/ipl.c >> +++ b/hw/s390x/ipl.c >> @@ -187,11 +187,13 @@ static void s390_ipl_realize(DeviceState *dev, Error **errp) >> */ >> if (pentry == KERN_IMAGE_START || pentry == 0x800) { >> ipl->start_addr = KERN_IMAGE_START; >> - /* Overwrite parameters in the kernel image, which are "rom" */ >> - strcpy(rom_ptr(KERN_PARM_AREA), ipl->cmdline); >> } else { >> ipl->start_addr = pentry; >> } >> + if (ipl->cmdline) { >> + /* If there is a command line, put it in the right place */ >> + strcpy(rom_ptr(KERN_PARM_AREA), ipl->cmdline); You definitely need to check for rom_ptr() != NULL first before calling strcpy. Otherwise QEMU segfaults in case the user tried to load a kernel to a different location. See also: https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg04227.html Thomas