From patchwork Tue May 2 13:36:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 9708107 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 73DCB60245 for ; Tue, 2 May 2017 13:45:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6395F204BA for ; Tue, 2 May 2017 13:45:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5442F27FC0; Tue, 2 May 2017 13:45:12 +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 22FC3204BA for ; Tue, 2 May 2017 13:45:10 +0000 (UTC) Received: from localhost ([::1]:58942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Y73-00082K-V6 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 May 2017 09:45:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Xye-0001N0-2d for qemu-devel@nongnu.org; Tue, 02 May 2017 09:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5Xya-0001qf-QR for qemu-devel@nongnu.org; Tue, 02 May 2017 09:36:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50900 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 1d5Xya-0001qY-K0 for qemu-devel@nongnu.org; Tue, 02 May 2017 09:36:24 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v42DYIFa119383 for ; Tue, 2 May 2017 09:36:24 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2a6t1mufrp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 02 May 2017 09:36:23 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 May 2017 14:36:21 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 2 May 2017 14:36:19 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v42DaJW333095798; Tue, 2 May 2017 13:36:19 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 067F3A4057; Tue, 2 May 2017 14:35:06 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBB64A406B; Tue, 2 May 2017 14:35:05 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.119]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 2 May 2017 14:35:05 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 2 May 2017 15:36:02 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170502133604.17735-1-cornelia.huck@de.ibm.com> References: <20170502133604.17735-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17050213-0040-0000-0000-0000037BBF1C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050213-0041-0000-0000-00002531C19A Message-Id: <20170502133604.17735-11-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-02_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705020077 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 10/12] pc-bios/s390-ccw: add boot entry selection to El Torito routine 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: Farhan Ali , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Cornelia Huck , "Eugene \(jno\) Dvurechenski" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Eugene (jno) Dvurechenski" If there is no LOADPARM given or '0' specified, then IPL the first matched entry. Otherwise IPL the matching entry of that number. Signed-off-by: Eugene (jno) Dvurechenski Signed-off-by: Farhan Ali Reviewed-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- pc-bios/s390-ccw/bootmap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index e974350b6f..523fa78c5f 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -655,6 +655,7 @@ static IsoBcSection *find_iso_bc_entry(void) IsoBcEntry *e = (IsoBcEntry *)sec; uint32_t offset = find_iso_bc(); int i; + unsigned int loadparm = get_loadparm_index(); if (!offset) { return NULL; @@ -675,7 +676,11 @@ static IsoBcSection *find_iso_bc_entry(void) for (i = 1; i < ISO_BC_ENTRY_PER_SECTOR; i++) { if (e[i].id == ISO_BC_BOOTABLE_SECTION) { if (is_iso_bc_entry_compatible(&e[i].body.sect)) { - return &e[i].body.sect; + if (loadparm <= 1) { + /* found, default, or unspecified */ + return &e[i].body.sect; + } + loadparm--; } } }