From patchwork Tue Apr 25 10:46:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 754733 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wC0RJ0CsRz9s80 for ; Tue, 25 Apr 2017 20:52:43 +1000 (AEST) Received: from localhost ([::1]:48357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2y5H-0004Vg-N3 for incoming@patchwork.ozlabs.org; Tue, 25 Apr 2017 06:52:39 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 specified. 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 = 0; const int pte_len = sizeof(ScsiBlockPtr); - ScsiBlockPtr *prog_table_entry; + ScsiBlockPtr *prog_table_entry = NULL; + unsigned int loadparm = get_loadparm_index(); /* Grab the MBR */ memset(sec, FREE_SPACE_FILLER, sizeof(sec)); @@ -467,6 +468,7 @@ static void ipl_scsi(void) IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); + debug_print_int("loadparm index", loadparm); ns_end = sec + virtio_get_block_size(); for (ns = (sec + pte_len); (ns + pte_len) < ns_end; ns += pte_len) { prog_table_entry = (ScsiBlockPtr *)ns; @@ -475,16 +477,15 @@ static void ipl_scsi(void) } program_table_entries++; + if (program_table_entries == loadparm + 1) { + break; /* selected entry found */ + } } debug_print_int("program table entries", program_table_entries); IPL_assert(program_table_entries != 0, "Empty Program Table"); - /* Run the default entry */ - - prog_table_entry = (ScsiBlockPtr *)(sec + pte_len); - zipl_run(prog_table_entry); /* no return */ }