From nobody Mon Feb 9 02:28:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493117624867724.7979813835348; Tue, 25 Apr 2017 03:53:44 -0700 (PDT) Received: from localhost ([::1]:48365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2y6I-0005m1-2Z for importer@patchew.org; Tue, 25 Apr 2017 06:53:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xzk-0000Hb-KX for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:46:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2xzg-0001DP-II for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:46:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2xzg-0001D0-9y for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:46:52 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3PAcwcL114754 for ; Tue, 25 Apr 2017 06:46:50 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2a22cdynpp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 25 Apr 2017 06:46:50 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Apr 2017 11:46:47 +0100 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; Tue, 25 Apr 2017 11:46:46 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3PAkjdc39714920; Tue, 25 Apr 2017 10:46:45 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A36624C05C; Tue, 25 Apr 2017 11:45:55 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FF6A4C046; Tue, 25 Apr 2017 11:45:55 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 25 Apr 2017 11:45:55 +0100 (BST) From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Apr 2017 12:46:30 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170425104633.6130-1-cornelia.huck@de.ibm.com> References: <20170425104633.6130-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042510-0008-0000-0000-000004310FB0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042510-0009-0000-0000-00001D670351 Message-Id: <20170425104633.6130-9-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-25_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704250193 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 08/11] pc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI disk 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: Cornelia Huck , borntraeger@de.ibm.com, Farhan Ali , agraf@suse.de, Eugene Dvurechenski Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Farhan Ali Fix SCSI bootmap interpreter to make use of any specified entry of the Program Table using the leftmost numeric value from the LOADPARM, if specif= ied. Initial patch from Eugene (jno) Dvurechenski. 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index b21c877b53..e39e67e07b 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -444,7 +444,8 @@ static void ipl_scsi(void) uint8_t *ns, *ns_end; int program_table_entries =3D 0; const int pte_len =3D sizeof(ScsiBlockPtr); - ScsiBlockPtr *prog_table_entry; + ScsiBlockPtr *prog_table_entry =3D NULL; + unsigned int loadparm =3D get_loadparm_index(); =20 /* Grab the MBR */ memset(sec, FREE_SPACE_FILLER, sizeof(sec)); @@ -467,6 +468,7 @@ static void ipl_scsi(void) =20 IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); =20 + debug_print_int("loadparm index", loadparm); ns_end =3D sec + virtio_get_block_size(); for (ns =3D (sec + pte_len); (ns + pte_len) < ns_end; ns +=3D pte_len)= { prog_table_entry =3D (ScsiBlockPtr *)ns; @@ -475,16 +477,15 @@ static void ipl_scsi(void) } =20 program_table_entries++; + if (program_table_entries =3D=3D loadparm + 1) { + break; /* selected entry found */ + } } =20 debug_print_int("program table entries", program_table_entries); =20 IPL_assert(program_table_entries !=3D 0, "Empty Program Table"); =20 - /* Run the default entry */ - - prog_table_entry =3D (ScsiBlockPtr *)(sec + pte_len); - zipl_run(prog_table_entry); /* no return */ } =20 --=20 2.11.0