From patchwork Fri Feb 23 11:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viktor Mihajlovski X-Patchwork-Id: 10237489 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 1CE58602A0 for ; Fri, 23 Feb 2018 11:52:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09CB22953E for ; Fri, 23 Feb 2018 11:52:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F22E429544; Fri, 23 Feb 2018 11:52:04 +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 AD2282953E for ; Fri, 23 Feb 2018 11:52:03 +0000 (UTC) Received: from localhost ([::1]:43922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epBtS-0002du-L2 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 23 Feb 2018 06:52:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epBsM-0001wJ-5o for qemu-devel@nongnu.org; Fri, 23 Feb 2018 06:50:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epBsI-0007w6-6Q for qemu-devel@nongnu.org; Fri, 23 Feb 2018 06:50:54 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1epBsH-0007uv-U9 for qemu-devel@nongnu.org; Fri, 23 Feb 2018 06:50:50 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1NBn88E041478 for ; Fri, 23 Feb 2018 06:50:48 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gaduaa4bf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 23 Feb 2018 06:50:47 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 23 Feb 2018 11:50:45 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 23 Feb 2018 11:50:41 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1NBoek941615562; Fri, 23 Feb 2018 11:50:40 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 16200A404D; Fri, 23 Feb 2018 11:43:49 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B19C5A4057; Fri, 23 Feb 2018 11:43:48 +0000 (GMT) Received: from [9.152.222.40] (unknown [9.152.222.40]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 23 Feb 2018 11:43:48 +0000 (GMT) To: Thomas Huth , Christian Borntraeger , "Collin L. Walling" , qemu-s390x@nongnu.org, qemu-devel@nongnu.org References: <1519241752-28083-1-git-send-email-walling@linux.vnet.ibm.com> <3b160f2d-8c32-7b0a-3afc-0519c02cee81@de.ibm.com> <5fd04c0d-ad1e-13a7-4e5a-5f28662479a7@redhat.com> From: Viktor Mihajlovski Date: Fri, 23 Feb 2018 12:50:40 +0100 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: <5fd04c0d-ad1e-13a7-4e5a-5f28662479a7@redhat.com> Content-Language: en-GB X-TM-AS-GCONF: 00 x-cbid: 18022311-0008-0000-0000-000004D39F0D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022311-0009-0000-0000-00001E66AF9B Message-Id: <68148fff-0c6e-0470-a0e5-0379ecfd3dd8@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-23_04:, , 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-1802230148 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: Re: [Qemu-devel] [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: alifm@linux.vnet.ibm.com, frankja@linux.vnet.ibm.com, cohuck@redhat.com, david@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 23.02.2018 11:17, Thomas Huth wrote: > On 23.02.2018 09:53, Christian Borntraeger wrote: >> Hmmm, on my ubuntu 16.04 guest, I get the boot menu with no timeout even if I do not >> specify loadparm or boot menu: >> >> qemu-kvm -drive file=/var/lib/libvirt/qemu/image.zhyp140,if=none,id=d1 -device virtio-blk-ccw,drive=d1,bootindex=1 > > I can reproduce this now, too. FWIW: It only happens with > virtio-blk-ccw, not with virtio-scsi-ccw (that's why I did not notice it > first). Collin, can you reproduce this, too? > > Thomas > The idea is to support the zipl boot menu on ECKD disks (which have a timeout by themselves) even without switching the boot menu on. This is to have the same behavior as one would see on LPAR or z/VM. The issue is that the boot code tries to interpret the program table of SCSI bootmaps as if a boot menu has been specified. The following patch fixes this. Collin might want to have a say in this matter as well. The scsi program table was erroneously evaluated as implicit boot menu. This patch adds a per-bootmap-type menu_is_enabled function. Signed-off-by: Viktor Mihajlovski --- pc-bios/s390-ccw/bootmap.c | 4 ++-- pc-bios/s390-ccw/menu.c | 7 ++++++- pc-bios/s390-ccw/s390-ccw.h | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 81dbd4a..b6fd77e 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -265,7 +265,7 @@ static void run_eckd_boot_script(block_number_t bmt_block_nr, BootMapTable *bmt = (void *)sec; BootMapScript *bms = (void *)sec; - if (menu_is_enabled()) { + if (menu_is_enabled_for_zipl()) { loadparm = eckd_get_boot_menu_index(s1b_block_nr); } @@ -568,7 +568,7 @@ static void ipl_scsi(void) debug_print_int("program table entries", program_table_entries); IPL_assert(program_table_entries != 0, "Empty Program Table"); - if (menu_is_enabled()) { + if (menu_is_enabled_for_enum()) { loadparm = menu_get_enum_boot_index(program_table_entries); } diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c index 16b5310..ebe5e9f 100644 --- a/pc-bios/s390-ccw/menu.c +++ b/pc-bios/s390-ccw/menu.c @@ -237,7 +237,12 @@ void menu_set_parms(uint8_t boot_menu_flag, uint32_t boot_menu_timeout) timeout = boot_menu_timeout; } -bool menu_is_enabled(void) +bool menu_is_enabled_for_zipl(void) { return flag; } + +bool menu_is_enabled_for_enum(void) +{ + return flag & ~QIPL_FLAG_BM_OPTS_ZIPL; +} diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index cfcaf3c..a18381f 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -89,7 +89,8 @@ void zipl_load(void); /* menu.c */ void menu_set_parms(uint8_t boot_menu_flag, uint32_t boot_menu_timeout); -bool menu_is_enabled(void); +bool menu_is_enabled_for_zipl(void); +bool menu_is_enabled_for_enum(void); int menu_get_zipl_boot_index(const char *menu_data); int menu_get_enum_boot_index(int entries);