From nobody Tue Feb 10 10:54:30 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.zohomail.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 1515640250272927.0934825130615; Wed, 10 Jan 2018 19:10:50 -0800 (PST) Received: from localhost ([::1]:34180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZTGT-0000oa-Dw for importer@patchew.org; Wed, 10 Jan 2018 22:10:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZTB8-0004th-CR for qemu-devel@nongnu.org; Wed, 10 Jan 2018 22:05:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZTB6-000313-C7 for qemu-devel@nongnu.org; Wed, 10 Jan 2018 22:05:18 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZTB5-0002yc-Hn for qemu-devel@nongnu.org; Wed, 10 Jan 2018 22:05:15 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0B34DiZ061209 for ; Wed, 10 Jan 2018 22:05:13 -0500 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fduc6sqpe-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 10 Jan 2018 22:05:12 -0500 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Jan 2018 20:05:11 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Jan 2018 20:05:09 -0700 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0B359wN8323578; Wed, 10 Jan 2018 20:05:09 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2666EC604A; Wed, 10 Jan 2018 20:05:09 -0700 (MST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 4E291C6047; Wed, 10 Jan 2018 20:05:07 -0700 (MST) From: Dong Jia Shi To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, qemu-s390x@nongnu.org Date: Thu, 11 Jan 2018 04:04:56 +0100 X-Mailer: git-send-email 2.13.5 In-Reply-To: <20180111030459.33757-1-bjsdjshi@linux.vnet.ibm.com> References: <20180111030459.33757-1-bjsdjshi@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18011103-0028-0000-0000-000008F8C150 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008357; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000245; SDB=6.00973252; UDB=6.00493124; IPR=6.00753202; MB=3.00018971; MTD=3.00000008; XFM=3.00000015; UTC=2018-01-11 03:05:11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011103-0029-0000-0000-00003915E449 Message-Id: <20180111030459.33757-3-bjsdjshi@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-11_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 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-1801110036 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [RFC PATCH 2/5] vfio/ccw: get schib region info 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: borntraeger@de.ibm.com, bjsdjshi@linux.vnet.ibm.com, cohuck@redhat.com, pmorel@linux.vnet.ibm.com, pasic@linux.vnet.ibm.com 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" vfio-ccw provides an MMIO region for store subchannel information. We fetch this information via ioctls here, then we can use it to update schib for virtual subchannels later on. While we are at it, also modify the comment and error message for the config region a bit, to make these unified with the schib likeness. Signed-off-by: Dong Jia Shi --- hw/vfio/ccw.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 16713f2c52..e673695509 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -32,6 +32,10 @@ typedef struct VFIOCCWDevice { uint64_t io_region_offset; struct ccw_io_region *io_region; EventNotifier io_notifier; + + uint64_t schib_region_size; + uint64_t schib_region_offset; + struct ccw_schib_region *schib_region; } VFIOCCWDevice; =20 static void vfio_ccw_compute_needs_reset(VFIODevice *vdev) @@ -268,9 +272,10 @@ static void vfio_ccw_get_region(VFIOCCWDevice *vcdev, = Error **errp) return; } =20 + /* Get I/O region info. */ ret =3D vfio_get_region_info(vdev, VFIO_CCW_CONFIG_REGION_INDEX, &info= ); if (ret) { - error_setg_errno(errp, -ret, "vfio: Error getting config info"); + error_setg_errno(errp, -ret, "vfio: Error getting config region in= fo"); return; } =20 @@ -283,13 +288,30 @@ static void vfio_ccw_get_region(VFIOCCWDevice *vcdev,= Error **errp) =20 vcdev->io_region_offset =3D info->offset; vcdev->io_region =3D g_malloc0(info->size); + g_free(info); =20 + /* Get SCHIB region info. */ + ret =3D vfio_get_region_info(vdev, VFIO_CCW_SCHIB_REGION_INDEX, &info); + if (ret) { + error_setg_errno(errp, -ret, "vfio: Error getting schib region inf= o"); + return; + } + + vcdev->schib_region_size =3D info->size; + if (sizeof(*vcdev->schib_region) !=3D vcdev->schib_region_size) { + error_setg(errp, "vfio: Unexpected size of the schib region"); + g_free(info); + return; + } + vcdev->schib_region_offset =3D info->offset; + vcdev->schib_region =3D g_malloc0(info->size); g_free(info); } =20 static void vfio_ccw_put_region(VFIOCCWDevice *vcdev) { g_free(vcdev->io_region); + g_free(vcdev->schib_region); } =20 static void vfio_put_device(VFIOCCWDevice *vcdev) --=20 2.13.5