From patchwork Thu Feb 22 19:40:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Collin L. Walling" X-Patchwork-Id: 10236219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C66BE60349 for ; Thu, 22 Feb 2018 19:42:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD55B28D1A for ; Thu, 22 Feb 2018 19:42:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B11A528D1F; Thu, 22 Feb 2018 19:42:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8396E28D1A for ; Thu, 22 Feb 2018 19:42:15 +0000 (UTC) Received: from localhost ([::1]:40678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eowkw-0003Ht-Iq for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Feb 2018 14:42:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eowkJ-0002xZ-8Z for qemu-devel@nongnu.org; Thu, 22 Feb 2018 14:41:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eowkG-0007YD-2W for qemu-devel@nongnu.org; Thu, 22 Feb 2018 14:41:35 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51366 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eowkF-0007Xu-TX for qemu-devel@nongnu.org; Thu, 22 Feb 2018 14:41:32 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1MJfSU2114355 for ; Thu, 22 Feb 2018 14:41:31 -0500 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ga0hq1fm7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Feb 2018 14:41:27 -0500 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Feb 2018 12:41:02 -0700 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 22 Feb 2018 12:40:59 -0700 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1MJexs711469248; Thu, 22 Feb 2018 12:40:59 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA5076E038; Thu, 22 Feb 2018 12:40:58 -0700 (MST) Received: from [9.56.58.75] (unknown [9.56.58.75]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 3B3BF6E035; Thu, 22 Feb 2018 12:40:58 -0700 (MST) From: "Collin L. Walling" To: Christian Borntraeger , Viktor Mihajlovski , qemu-s390x@nongnu.org, qemu-devel@nongnu.org References: <1519241752-28083-1-git-send-email-walling@linux.vnet.ibm.com> <29048432-906e-5fbe-d927-0814b0c24e4d@de.ibm.com> <25e410d1-3b6a-1178-d46c-87f247eacea9@linux.vnet.ibm.com> <11d66e11-7a56-c5d0-f285-2a532e85fcf8@de.ibm.com> <450ee50a-660b-6ec8-7de4-e5c9ce8fa26a@linux.vnet.ibm.com> Organization: IBM Date: Thu, 22 Feb 2018 14:40:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <450ee50a-660b-6ec8-7de4-e5c9ce8fa26a@linux.vnet.ibm.com> Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18022219-0016-0000-0000-0000084C74E5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008578; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00993570; UDB=6.00504873; IPR=6.00772910; MB=3.00019692; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-22 19:41:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022219-0017-0000-0000-00003D94312C Message-Id: <173adc8c-f251-73e4-9cda-f278b2483186@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-22_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802220247 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id w1MJfSU2114355 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v8 00/13] Interactive Boot Menu for DASD and SCSI Guests on s390x 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: frankja@linux.vnet.ibm.com, thuth@redhat.com, alifm@linux.vnet.ibm.com, david@redhat.com, cohuck@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 02/22/2018 11:45 AM, Collin L. Walling wrote: > On 02/22/2018 10:44 AM, Christian Borntraeger wrote: >> >> On 02/22/2018 04:40 PM, Collin L. Walling wrote: >>> On 02/22/2018 07:23 AM, Viktor Mihajlovski wrote: >>>> On 22.02.2018 12:51, Christian Borntraeger wrote: >>>>> Series >>>>> Acked-by: Christian Borntraeger >>> Thanks!!! >>> >>>>> >>>>> menu on scsi and dasd bootmaps tested successfully. >>>>> >>>>> There is one thing that we might want to fix (can be an addon >>>>> patch since this is a non-customer >>>>> scenario (no libvirt)). >>>>> >>>>> If you start QEMU manually without a bootindex, the -boot menu=on >>>>> is ignored >>>>> if no drive has a bootindex. >>>>> >>>>> For example: >>>>> >>>>> -drive file=/dev/dasda,if=none,id=d1 -device >>>>> virtio-blk-ccw,drive=d1,bootindex=1 -boot menu=on >>>>> does work >>>>> >>>>> -drive file=/dev/dasda -boot menu=on >>>>> does not >>>>> >>>>> instead it prints: >>>>> qemu-system-s390x: boot menu is not supported for this device type. >>>>> >>>>> and the boots up the default entry. >>>>> >>>> That should indeed be a separate patch, as it would move logic >>>> currently >>>> in the BIOS up to QEMU (find the first defined virtio disk and >>>> select it >>>> as boot disk). >>>> In fact it's more complicated than that, because it would have to >>>> properly account for -boot order=[acdn] and produce the respective >>>> IPLB. >>>> While it makes sense, I wouldn't rush that in but rather change the >>>> error message to indicate that -device bootindex is needed to activate >>>> the menu, at least for the time being. >>>> [...] >>>> >>> I can look into it.  Theoretically, the easier fix should just >>> involve parsing all >>> of the -device commands and looking for a "bootindex=1" field. The >>> Qemu options >>> code already handles a bulk of this work, so it's just a matter of >>> putting it all >>> together. >>> >>> Shall I whip something up and post what I have as a reply to this >>> email chain? >> In fact, it should already be there. >> >> static bool s390_gen_initial_iplb(S390IPLState *ipl) >> { >>      DeviceState *dev_st; >> >>      dev_st = get_boot_device(0); >> >> --> if this returns 0 we have no bootindex statement anywhere and the >> BIOS will IPL the default >> disk. >> >> > Makes sense.  I'm working on making this patch look as clean as > possible. The fact that no boot menu > options present means we fallback to using zipl values for CCW being > tied into the switch statement > is making things a bit tricky. Just have to think the logic through a > bit.  Will get back to you once > I have something good. > This should do the trick (this can also be squished painlessly into 6/13 if desired): From dea9f22429cb3e4ccc81980974adc9f55ead87bf Mon Sep 17 00:00:00 2001 From: "Collin L. Walling" Date: Thu, 22 Feb 2018 14:26:14 -0500 Subject: [PATCH] s390-ccw: set boot menu options iff a bootindex was provided The boot menu options should be set iff a device was specified with bootindex=1, otherwise an error message will appear claiming that the boot menu is not available for a particular device type. This can be misleading. To amend this, only set the boot menu options when     -device ...,bootindex=1 is provded on the command line for a valid IPL device. The absence of a bootindex provided with -boot menu=on will display an error message, and -boot menu=off (or absence of -boot options) will return silently. Signed-off-by: Collin L. Walling ---  hw/s390x/ipl.c | 8 ++++++++  1 file changed, 8 insertions(+)          /* In the absence of -boot menu, use zipl parameters */ diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 566248e..edbec90 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -231,6 +231,14 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl)      const char *tmp;      unsigned long splash_time = 0; +    if (!get_boot_device(0)) { +        if (boot_menu) { +            error_report("boot menu requires a bootindex to be specified for " +                         "the IPL device."); +        } +        return; +    } +      switch (ipl->iplb.pbt) {      case S390_IPL_TYPE_CCW: