From nobody Fri May 3 05:18:46 2024 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 1492760555121207.6167606366049; Fri, 21 Apr 2017 00:42:35 -0700 (PDT) Received: from localhost ([::1]:57658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TD6-000240-2a for importer@patchew.org; Fri, 21 Apr 2017 03:42:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBS-0000yj-Vz for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBP-0000cy-Rf for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:50 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44012 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 1d1TBP-0000ci-MM for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:47 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cY4S008204 for ; Fri, 21 Apr 2017 03:40:47 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 29xucaxkf7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:47 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:45 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:42 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7egNK36372554; Fri, 21 Apr 2017 07:40:42 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D83642047; Fri, 21 Apr 2017 08:39:39 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66E664203F; Fri, 21 Apr 2017 08:39:39 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:39 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:28 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0020-0000-0000-0000034CF3D1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0021-0000-0000-0000415F6152 Message-Id: <20170421074038.774-2-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 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 01/11] s390x: introduce 2.10 compat machine 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, agraf@suse.de, qemu-devel@nongnu.org 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" Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 17 ++++++++++++++++- include/hw/compat.h | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 40914fde6f..5ac315ac78 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -336,6 +336,9 @@ static const TypeInfo ccw_machine_info =3D { } = \ type_init(ccw_machine_register_##suffix) =20 +#define CCW_COMPAT_2_9 \ + HW_COMPAT_2_9 + #define CCW_COMPAT_2_8 \ HW_COMPAT_2_8 \ {\ @@ -402,14 +405,26 @@ static const TypeInfo ccw_machine_info =3D { .value =3D "0",\ }, =20 +static void ccw_machine_2_10_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_2_10_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(2_10, "2.10", true); + static void ccw_machine_2_9_instance_options(MachineState *machine) { + ccw_machine_2_10_instance_options(machine); } =20 static void ccw_machine_2_9_class_options(MachineClass *mc) { + ccw_machine_2_10_class_options(mc); + SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9); } -DEFINE_CCW_MACHINE(2_9, "2.9", true); +DEFINE_CCW_MACHINE(2_9, "2.9", false); =20 static void ccw_machine_2_8_instance_options(MachineState *machine) { diff --git a/include/hw/compat.h b/include/hw/compat.h index 5d5be91daf..846b90eb67 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -1,6 +1,9 @@ #ifndef HW_COMPAT_H #define HW_COMPAT_H =20 +#define HW_COMPAT_2_9 \ + /* empty */ + #define HW_COMPAT_2_8 \ {\ .driver =3D "fw_cfg_mem",\ --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 149276068847796.09981726331546; Fri, 21 Apr 2017 00:44:48 -0700 (PDT) Received: from localhost ([::1]:57667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TFG-0003v5-JV for importer@patchew.org; Fri, 21 Apr 2017 03:44:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBU-0000yv-HZ for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBR-0000dI-FR for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58577 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 1d1TBR-0000d9-9L for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:49 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cZ6L074828 for ; Fri, 21 Apr 2017 03:40:48 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 29xur5nuq6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:48 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:46 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:43 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7eh4Q17236300; Fri, 21 Apr 2017 07:40:43 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EBAD942049; Fri, 21 Apr 2017 08:39:40 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACD1E42052; Fri, 21 Apr 2017 08:39:40 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:40 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:29 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0040-0000-0000-0000038DF882 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0041-0000-0000-00001FC928B3 Message-Id: <20170421074038.774-3-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 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 02/11] s390x/kvm: make printf always compile in debug output 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, Danil Antonov , agraf@suse.de, qemu-devel@nongnu.org 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: Danil Antonov Wrapped printf calls inside debug macros (DPRINTF) in `if` statement. This will ensure that printf function will always compile even if debug output is turned off and, in turn, will prevent bitrot of the format strings. Signed-off-by: Danil Antonov Message-Id: Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index ac47154b83..1a249d8359 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -47,16 +47,16 @@ #include "exec/memattrs.h" #include "hw/s390x/s390-virtio-ccw.h" =20 -/* #define DEBUG_KVM */ - -#ifdef DEBUG_KVM -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) +#ifndef DEBUG_KVM +#define DEBUG_KVM 0 #endif =20 +#define DPRINTF(fmt, ...) do { \ + if (DEBUG_KVM) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ +} while (0); + #define kvm_vm_check_mem_attr(s, attr) \ kvm_vm_check_attr(s, KVM_S390_VM_MEM_CTRL, attr) =20 --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760559070577.1525750869442; Fri, 21 Apr 2017 00:42:39 -0700 (PDT) Received: from localhost ([::1]:57660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TDB-00029C-L5 for importer@patchew.org; Fri, 21 Apr 2017 03:42:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBW-0000zy-IZ for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBT-0000dk-9S for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46151 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 1d1TBT-0000dW-36 for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:51 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7caVo026826 for ; Fri, 21 Apr 2017 03:40:50 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 29y02dy31m-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:50 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:48 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:45 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7eihx32833554; Fri, 21 Apr 2017 07:40:44 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 391A24204B; Fri, 21 Apr 2017 08:39:42 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 06E6042045; Fri, 21 Apr 2017 08:39:42 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:41 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:30 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0040-0000-0000-0000036FEED8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0041-0000-0000-0000250B24D2 Message-Id: <20170421074038.774-4-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 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 03/11] s390x/pci: make printf always compile in debug output 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, Danil Antonov , agraf@suse.de, qemu-devel@nongnu.org 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: Danil Antonov Wrapped printf calls inside debug macros (DPRINTF) in `if` statement. This will ensure that printf function will always compile even if debug output is turned off and, in turn, will prevent bitrot of the format strings. Signed-off-by: Danil Antonov Message-Id: [CH: remove now misleading comments] Signed-off-by: Cornelia Huck --- hw/s390x/s390-pci-bus.c | 16 +++++++++------- hw/s390x/s390-pci-inst.c | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 69b0291e8a..1570f2d12a 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -23,15 +23,17 @@ #include "hw/pci/msi.h" #include "qemu/error-report.h" =20 -/* #define DEBUG_S390PCI_BUS */ -#ifdef DEBUG_S390PCI_BUS -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) +#ifndef DEBUG_S390PCI_BUS +#define DEBUG_S390PCI_BUS 0 #endif =20 +#define DPRINTF(fmt, ...) \ + do { \ + if (DEBUG_S390PCI_BUS) { \ + fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); \ + } \ + } while (0) + S390pciState *s390_get_phb(void) { static S390pciState *phb; diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index d2a8c0a083..f520ce105f 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -20,15 +20,17 @@ #include "qemu/error-report.h" #include "sysemu/hw_accel.h" =20 -/* #define DEBUG_S390PCI_INST */ -#ifdef DEBUG_S390PCI_INST -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) +#ifndef DEBUG_S390PCI_INST +#define DEBUG_S390PCI_INST 0 #endif =20 +#define DPRINTF(fmt, ...) \ + do { \ + if (DEBUG_S390PCI_INST) { \ + fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); \ + } \ + } while (0) + static void s390_set_status_code(CPUS390XState *env, uint8_t r, uint64_t status_code) { --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760818111696.7491588789113; Fri, 21 Apr 2017 00:46:58 -0700 (PDT) Received: from localhost ([::1]:57681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1THM-0005d5-O6 for importer@patchew.org; Fri, 21 Apr 2017 03:46:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBZ-00012U-Di for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBW-0000eP-Ar for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:57 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36372) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TBW-0000e9-1l for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:54 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cXIC064958 for ; Fri, 21 Apr 2017 03:40:52 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 29y9tnrhf8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:52 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:49 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:46 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7ekBb38141956; Fri, 21 Apr 2017 07:40:46 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8484D42054; Fri, 21 Apr 2017 08:39:43 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 51AD742045; Fri, 21 Apr 2017 08:39:43 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:43 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:31 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0020-0000-0000-0000034CF3D9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0021-0000-0000-0000415F6164 Message-Id: <20170421074038.774-5-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 04/11] s390x/css: introduce read-only property type for device ids 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, Dong Jia Shi , agraf@suse.de, qemu-devel@nongnu.org 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: Dong Jia Shi Let's introduce a read-only property type that handles device ids of the CssDevId type used for channel devices for future use. e.g. exposing the busid of an I/O subchannel that is assigned to a ccw device. Signed-off-by: Dong Jia Shi Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 7 +++++++ include/hw/s390x/css.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 37caa98195..f966ce2d15 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1894,6 +1894,13 @@ PropertyInfo css_devid_propinfo =3D { .set =3D set_css_devid, }; =20 +PropertyInfo css_devid_ro_propinfo =3D { + .name =3D "str", + .description =3D "Read-only identifier of an I/O device in the channel= " + "subsystem, example: fe.1.23ab", + .get =3D get_css_devid, +}; + SubchDev *css_create_virtual_sch(CssDevId bus_id, Error **errp) { uint16_t schid =3D 0; diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index c96c862057..e88f24b868 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -172,6 +172,11 @@ extern PropertyInfo css_devid_propinfo; #define DEFINE_PROP_CSS_DEV_ID(_n, _s, _f) \ DEFINE_PROP(_n, _s, _f, css_devid_propinfo, CssDevId) =20 +extern PropertyInfo css_devid_ro_propinfo; + +#define DEFINE_PROP_CSS_DEV_ID_RO(_n, _s, _f) \ + DEFINE_PROP(_n, _s, _f, css_devid_ro_propinfo, CssDevId) + /** * Create a subchannel for the given bus id. * --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760812287819.4025096608983; Fri, 21 Apr 2017 00:46:52 -0700 (PDT) Received: from localhost ([::1]:57679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1THG-0005Xz-H0 for importer@patchew.org; Fri, 21 Apr 2017 03:46:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBZ-00012b-GS for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBW-0000eX-Cp for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44155 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 1d1TBW-0000eK-6n for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:54 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cY1D008201 for ; Fri, 21 Apr 2017 03:40:53 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 29xucaxkkb-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:53 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:51 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:47 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7elWF38928590; Fri, 21 Apr 2017 07:40:47 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D718842045; Fri, 21 Apr 2017 08:39:44 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D3F04204D; Fri, 21 Apr 2017 08:39:44 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:44 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:32 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0012-0000-0000-00000511F108 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0013-0000-0000-000018235D0F Message-Id: <20170421074038.774-6-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_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-1704210143 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 05/11] s390x/css: provide introspection for virtual subchannel and device busid 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, Dong Jia Shi , agraf@suse.de, qemu-devel@nongnu.org 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: Dong Jia Shi Expose the busids of the virtual I/O subchannel and the virtual CCW device to ease debugging. This is needed because: 1. subchannel id are assigned dynamically, and cannot be set from outside. 2. device busid could possibly be auto generated. An example of using HMP to retrieve the property values of a virtio-balloon-ccw device looks like: [root@localhost ~]# lscss -d 0.0.0004 Device Subchan. DevType CU Type Use PIM PAM POM CHPIDs ---------------------------------------------------------------------- 0.0.0004 0.0.0003 0000/00 3832/05 yes 80 80 ff 00000000 00000000 (qemu) info qtree ... ... dev: virtio-balloon-ccw, id "balloon0" devno =3D "" ioeventfd =3D true max_revision =3D 2 (0x2) dev_id =3D "fe.0.0004" subch_id =3D "fe.0.0003" ... ... After migration, if we have the same device that shows up on a different subchannel, we must re-fill the subch_id of the ccw device with the new schid, or the subch_id will have an old wrong schid value. So this also re-fills the subch_id after migration. While we are at it, also neaten the related error handling a bit. Signed-off-by: Dong Jia Shi Signed-off-by: Cornelia Huck --- hw/s390x/ccw-device.c | 39 +++++++++++++++++++++++++++++++++++++++ hw/s390x/ccw-device.h | 7 +++++++ hw/s390x/virtio-ccw.c | 27 +++++++++++++++++++++------ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 28ea20440e..8fe3cf49ef 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -11,11 +11,50 @@ #include "qemu/osdep.h" #include "ccw-device.h" =20 +static void ccw_device_refill_ids(CcwDevice *dev) +{ + SubchDev *sch =3D dev->sch; + + assert(sch); + + dev->dev_id.cssid =3D sch->cssid; + dev->dev_id.ssid =3D sch->ssid; + dev->dev_id.devid =3D sch->devno; + dev->dev_id.valid =3D true; + + dev->subch_id.cssid =3D sch->cssid; + dev->subch_id.ssid =3D sch->ssid; + dev->subch_id.devid =3D sch->schid; + dev->subch_id.valid =3D true; +} + +static void ccw_device_realize(CcwDevice *dev, Error **errp) +{ + ccw_device_refill_ids(dev); +} + +static Property ccw_device_properties[] =3D { + DEFINE_PROP_CSS_DEV_ID_RO("dev_id", CcwDevice, dev_id), + DEFINE_PROP_CSS_DEV_ID_RO("subch_id", CcwDevice, subch_id), + DEFINE_PROP_END_OF_LIST(), +}; + +static void ccw_device_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + CCWDeviceClass *k =3D CCW_DEVICE_CLASS(klass); + + k->realize =3D ccw_device_realize; + k->refill_ids =3D ccw_device_refill_ids; + dc->props =3D ccw_device_properties; +} + static const TypeInfo ccw_device_info =3D { .name =3D TYPE_CCW_DEVICE, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(CcwDevice), .class_size =3D sizeof(CCWDeviceClass), + .class_init =3D ccw_device_class_init, .abstract =3D true, }; =20 diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 59ba01b6c5..48700fe23a 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -19,12 +19,19 @@ typedef struct CcwDevice { DeviceState parent_obj; SubchDev *sch; /* .. */ + /* The user-set busid of the virtual ccw device. */ CssDevId bus_id; + /* The actual busid of the virtual ccw device. */ + CssDevId dev_id; + /* The actual busid of the virtual subchannel. */ + CssDevId subch_id; } CcwDevice; =20 typedef struct CCWDeviceClass { DeviceClass parent_class; void (*unplug)(HotplugHandler *, DeviceState *, Error **); + void (*realize)(CcwDevice *, Error **); + void (*refill_ids)(CcwDevice *); } CCWDeviceClass; =20 static inline CcwDevice *to_ccw_dev_fast(DeviceState *d) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 00b3bde4e9..b71ea94118 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -680,6 +680,7 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *= dev, Error **errp) { VirtIOCCWDeviceClass *k =3D VIRTIO_CCW_DEVICE_GET_CLASS(dev); CcwDevice *ccw_dev =3D CCW_DEVICE(dev); + CCWDeviceClass *ck =3D CCW_DEVICE_GET_CLASS(ccw_dev); SubchDev *sch =3D css_create_virtual_sch(ccw_dev->bus_id, errp); Error *err =3D NULL; =20 @@ -689,8 +690,7 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *= dev, Error **errp) if (!virtio_ccw_rev_max(dev) && dev->force_revision_1) { error_setg(&err, "Invalid value of property max_rev " "(is %d expected >=3D 1)", virtio_ccw_rev_max(dev)); - error_propagate(errp, err); - return; + goto out_err; } =20 sch->driver_data =3D dev; @@ -713,13 +713,23 @@ static void virtio_ccw_device_realize(VirtioCcwDevice= *dev, Error **errp) =20 if (k->realize) { k->realize(dev, &err); + if (err) { + goto out_err; + } } + + ck->realize(ccw_dev, &err); if (err) { - error_propagate(errp, err); - css_subch_assign(sch->cssid, sch->ssid, sch->schid, sch->devno, NU= LL); - ccw_dev->sch =3D NULL; - g_free(sch); + goto out_err; } + + return; + +out_err: + error_propagate(errp, err); + css_subch_assign(sch->cssid, sch->ssid, sch->schid, sch->devno, NULL); + ccw_dev->sch =3D NULL; + g_free(sch); } =20 static int virtio_ccw_exit(VirtioCcwDevice *dev) @@ -1261,12 +1271,17 @@ static int virtio_ccw_load_config(DeviceState *d, Q= EMUFile *f) { VirtioCcwDevice *dev =3D VIRTIO_CCW_DEVICE(d); CcwDevice *ccw_dev =3D CCW_DEVICE(d); + CCWDeviceClass *ck =3D CCW_DEVICE_GET_CLASS(ccw_dev); SubchDev *s =3D ccw_dev->sch; VirtIODevice *vdev =3D virtio_ccw_get_vdev(s); int len; =20 s->driver_data =3D dev; subch_device_load(s, f); + /* Re-fill subch_id after loading the subchannel states.*/ + if (ck->refill_ids) { + ck->refill_ids(ccw_dev); + } len =3D qemu_get_be32(f); if (len !=3D 0) { dev->indicators =3D get_indicator(qemu_get_be64(f), len); --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760907704925.7397766439717; Fri, 21 Apr 2017 00:48:27 -0700 (PDT) Received: from localhost ([::1]:57687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TIo-0006he-Cw for importer@patchew.org; Fri, 21 Apr 2017 03:48:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBb-000143-8X for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBX-0000f3-U7 for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TBX-0000em-Ka for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:55 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cWDu064939 for ; Fri, 21 Apr 2017 03:40:54 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 29y9tnrhh0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:54 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:51 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:49 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7emLu20054274; Fri, 21 Apr 2017 07:40:48 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 302EB42042; Fri, 21 Apr 2017 08:39:46 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F01024204D; Fri, 21 Apr 2017 08:39:45 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:45 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:33 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0020-0000-0000-0000034CF3DD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0021-0000-0000-0000415F6173 Message-Id: <20170421074038.774-7-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 06/11] s390x/css: consolidate the devno property for ccw devices 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, Dong Jia Shi , agraf@suse.de, qemu-devel@nongnu.org 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: Dong Jia Shi 'devno' should rather be a property of the ccw device, instead of a property of a specific virtio-ccw device. Let's consolidate it. While we are at here, also rename CcwDevice.bus_id to CcwDevice.devno to make things clearer. Signed-off-by: Dong Jia Shi Signed-off-by: Cornelia Huck --- hw/s390x/ccw-device.c | 1 + hw/s390x/ccw-device.h | 2 +- hw/s390x/virtio-ccw.c | 14 ++------------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 8fe3cf49ef..fb8d640a7e 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -34,6 +34,7 @@ static void ccw_device_realize(CcwDevice *dev, Error **er= rp) } =20 static Property ccw_device_properties[] =3D { + DEFINE_PROP_CSS_DEV_ID("devno", CcwDevice, devno), DEFINE_PROP_CSS_DEV_ID_RO("dev_id", CcwDevice, dev_id), DEFINE_PROP_CSS_DEV_ID_RO("subch_id", CcwDevice, subch_id), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 48700fe23a..89c8e5dff7 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -20,7 +20,7 @@ typedef struct CcwDevice { SubchDev *sch; /* .. */ /* The user-set busid of the virtual ccw device. */ - CssDevId bus_id; + CssDevId devno; /* The actual busid of the virtual ccw device. */ CssDevId dev_id; /* The actual busid of the virtual subchannel. */ diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index b71ea94118..b728439d40 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -681,7 +681,7 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *= dev, Error **errp) VirtIOCCWDeviceClass *k =3D VIRTIO_CCW_DEVICE_GET_CLASS(dev); CcwDevice *ccw_dev =3D CCW_DEVICE(dev); CCWDeviceClass *ck =3D CCW_DEVICE_GET_CLASS(ccw_dev); - SubchDev *sch =3D css_create_virtual_sch(ccw_dev->bus_id, errp); + SubchDev *sch =3D css_create_virtual_sch(ccw_dev->devno, errp); Error *err =3D NULL; =20 if (!sch) { @@ -705,7 +705,7 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *= dev, Error **errp) =20 trace_virtio_ccw_new_device( sch->cssid, sch->ssid, sch->schid, sch->devno, - ccw_dev->bus_id.valid ? "user-configured" : "auto-configured"); + ccw_dev->devno.valid ? "user-configured" : "auto-configured"); =20 if (!kvm_eventfds_enabled()) { dev->flags &=3D ~VIRTIO_CCW_FLAG_USE_IOEVENTFD; @@ -1369,7 +1369,6 @@ static void virtio_ccw_device_unplugged(DeviceState *= d) /**************** Virtio-ccw Bus Device Descriptions *******************/ =20 static Property virtio_ccw_net_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1398,7 +1397,6 @@ static const TypeInfo virtio_ccw_net =3D { }; =20 static Property virtio_ccw_blk_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1427,7 +1425,6 @@ static const TypeInfo virtio_ccw_blk =3D { }; =20 static Property virtio_ccw_serial_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1456,7 +1453,6 @@ static const TypeInfo virtio_ccw_serial =3D { }; =20 static Property virtio_ccw_balloon_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1485,7 +1481,6 @@ static const TypeInfo virtio_ccw_balloon =3D { }; =20 static Property virtio_ccw_scsi_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1515,7 +1510,6 @@ static const TypeInfo virtio_ccw_scsi =3D { =20 #ifdef CONFIG_VHOST_SCSI static Property vhost_ccw_scsi_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, VIRTIO_CCW_MAX_REV), DEFINE_PROP_END_OF_LIST(), @@ -1553,7 +1547,6 @@ static void virtio_ccw_rng_instance_init(Object *obj) } =20 static Property virtio_ccw_rng_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1582,7 +1575,6 @@ static const TypeInfo virtio_ccw_rng =3D { }; =20 static Property virtio_ccw_crypto_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1709,7 +1701,6 @@ static const TypeInfo virtio_ccw_bus_info =3D { =20 #ifdef CONFIG_VIRTFS static Property virtio_ccw_9p_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, @@ -1758,7 +1749,6 @@ static const TypeInfo virtio_ccw_9p_info =3D { #ifdef CONFIG_VHOST_VSOCK =20 static Property vhost_vsock_ccw_properties[] =3D { - DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, VIRTIO_CCW_MAX_REV), DEFINE_PROP_END_OF_LIST(), --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 149276069331976.2741866010474; Fri, 21 Apr 2017 00:44:53 -0700 (PDT) Received: from localhost ([::1]:57669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TFL-0003z3-Te for importer@patchew.org; Fri, 21 Apr 2017 03:44:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBX-00010v-SU for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBX-0000ep-15 for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44580 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 1d1TBW-0000eb-QW for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:54 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7ess5127990 for ; Fri, 21 Apr 2017 03:40:54 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 29xvy2sy3m-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:54 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:52 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:50 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7eoYU37486676; Fri, 21 Apr 2017 07:40:50 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8696242047; Fri, 21 Apr 2017 08:39:47 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48C684203F; Fri, 21 Apr 2017 08:39:47 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:47 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:34 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0020-0000-0000-0000034CF3E2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0021-0000-0000-0000415F617A Message-Id: <20170421074038.774-8-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 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 07/11] s390x: use enum for adapter type and standardize its naming 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, agraf@suse.de, Fei Li , qemu-devel@nongnu.org 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: Fei Li Let's use an enum for io adapter type, and standardize its naming to CSS_IO_ADAPTER_* by changing S390_PCIPT_ADAPTER to CSS_IO_ADAPTER_PCI. Signed-off-by: Fei Li Reviewed-by: Cornelia Huck Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 2 +- hw/s390x/s390-pci-bus.h | 1 - hw/s390x/s390-pci-inst.c | 2 +- include/hw/s390x/css.h | 9 +++++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index f966ce2d15..1b242c1fb7 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -155,7 +155,7 @@ int css_create_css_image(uint8_t cssid, bool default_im= age) return 0; } =20 -int css_register_io_adapter(uint8_t type, uint8_t isc, bool swap, +int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, bool maskable, uint32_t *id) { IoAdapter *adapter; diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index dcbf4820c9..cf142a3e68 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -30,7 +30,6 @@ #define FH_MASK_INDEX 0x0000ffff #define FH_SHM_VFIO 0x00010000 #define FH_SHM_EMUL 0x00020000 -#define S390_PCIPT_ADAPTER 2 #define ZPCI_MAX_FID 0xffffffff #define ZPCI_MAX_UID 0xffff #define UID_UNDEFINED 0 diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index f520ce105f..93980d6b1f 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -734,7 +734,7 @@ static int reg_irqs(CPUS390XState *env, S390PCIBusDevic= e *pbdev, ZpciFib fib) { int ret, len; =20 - ret =3D css_register_io_adapter(S390_PCIPT_ADAPTER, + ret =3D css_register_io_adapter(CSS_IO_ADAPTER_PCI, FIB_DATA_ISC(ldl_p(&fib.data)), true, fa= lse, &pbdev->routes.adapter.adapter_id); assert(ret =3D=3D 0); diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index e88f24b868..cdc73fe0aa 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -124,8 +124,13 @@ void css_generate_css_crws(uint8_t cssid); void css_clear_sei_pending(void); void css_adapter_interrupt(uint8_t isc); =20 -#define CSS_IO_ADAPTER_VIRTIO 1 -int css_register_io_adapter(uint8_t type, uint8_t isc, bool swap, +typedef enum { + CSS_IO_ADAPTER_VIRTIO =3D 0, + CSS_IO_ADAPTER_PCI =3D 1, + CSS_IO_ADAPTER_TYPE_NUMS, +} CssIoAdapterType; + +int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, bool maskable, uint32_t *id); =20 #ifndef CONFIG_USER_ONLY --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 149276068889640.26717355753374; Fri, 21 Apr 2017 00:44:48 -0700 (PDT) Received: from localhost ([::1]:57668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TFH-0003vo-Go for importer@patchew.org; Fri, 21 Apr 2017 03:44:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBb-00014d-W1 for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBY-0000fH-MN for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44189 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 1d1TBY-0000ez-4V for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:56 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cb3B008381 for ; Fri, 21 Apr 2017 03:40:55 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 29xucaxkmh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:55 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:53 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:51 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7epem23789662; Fri, 21 Apr 2017 07:40:51 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D28D342047; Fri, 21 Apr 2017 08:39:48 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 958204203F; Fri, 21 Apr 2017 08:39:48 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:48 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:35 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0016-0000-0000-00000482F4D8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0017-0000-0000-000027555845 Message-Id: <20170421074038.774-9-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 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 08/11] s390x: initialize flic before I/O subsystems 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, agraf@suse.de, Fei Li , qemu-devel@nongnu.org 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: Fei Li Let's have a flic before we move on to initialize more specific subsystems that make use of it. Signed-off-by: Fei Li Reviewed-by: Cornelia Huck Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 5ac315ac78..04bd0ebe40 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -113,12 +113,13 @@ static void ccw_init(MachineState *machine) s390_sclp_init(); s390_memory_init(machine->ram_size); =20 + s390_flic_init(); + /* get a BUS */ css_bus =3D virtual_css_bus_init(); s390_init_ipl_dev(machine->kernel_filename, machine->kernel_cmdline, machine->initrd_filename, "s390-ccw.img", "s390-netboot.img", true); - s390_flic_init(); =20 dev =3D qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDG= E, --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760571014579.3831051984952; Fri, 21 Apr 2017 00:42:51 -0700 (PDT) Received: from localhost ([::1]:57661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TDN-0002IW-MO for importer@patchew.org; Fri, 21 Apr 2017 03:42:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBe-000170-Kt for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBb-0000gA-Cf for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47907 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 1d1TBb-0000fs-0U for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:59 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cr4g128255 for ; Fri, 21 Apr 2017 03:40:58 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 29xwu7f086-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:58 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:56 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:53 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7eqCh7078392; Fri, 21 Apr 2017 07:40:52 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2AC4842049; Fri, 21 Apr 2017 08:39:50 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E17624203F; Fri, 21 Apr 2017 08:39:49 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:49 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:36 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0016-0000-0000-00000482F4DA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0017-0000-0000-00002755584B Message-Id: <20170421074038.774-10-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 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 09/11] s390x/flic: cache flic in s390_get_flic 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, agraf@suse.de, Fei Li , qemu-devel@nongnu.org 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: Fei Li s390_get_flic() is called many times to obtain the flic. This wastes a lot of time as it calls object_resolve_path() every time. Let's cache S390FLICState by defining it as static. Signed-off-by: Fei Li Signed-off-by: Cornelia Huck --- hw/intc/s390_flic.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index bef4caf980..711c11454f 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -21,11 +21,14 @@ =20 S390FLICState *s390_get_flic(void) { - S390FLICState *fs; + static S390FLICState *fs; =20 - fs =3D S390_FLIC_COMMON(object_resolve_path(TYPE_KVM_S390_FLIC, NULL)); if (!fs) { - fs =3D S390_FLIC_COMMON(object_resolve_path(TYPE_QEMU_S390_FLIC, N= ULL)); + fs =3D S390_FLIC_COMMON(object_resolve_path(TYPE_KVM_S390_FLIC, NU= LL)); + if (!fs) { + fs =3D S390_FLIC_COMMON(object_resolve_path(TYPE_QEMU_S390_FLI= C, + NULL)); + } } return fs; } --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760812733407.2473324548225; Fri, 21 Apr 2017 00:46:52 -0700 (PDT) Received: from localhost ([::1]:57680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1THH-0005Yh-9P for importer@patchew.org; Fri, 21 Apr 2017 03:46:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBe-00016g-8S for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBb-0000fz-3F for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44274 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 1d1TBa-0000fn-QD for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:40:58 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7cZm3008221 for ; Fri, 21 Apr 2017 03:40:58 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 29xucaxkp7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:58 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:55 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:54 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7esd319464682; Fri, 21 Apr 2017 07:40:54 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74E1342042; Fri, 21 Apr 2017 08:39:51 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37AAA4204B; Fri, 21 Apr 2017 08:39:51 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:51 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:37 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042107-0016-0000-0000-00000482F4E0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0017-0000-0000-000027555854 Message-Id: <20170421074038.774-11-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_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-1704210143 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/11] s390x: register I/O adapters per ISC during init 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, agraf@suse.de, Fei Li , qemu-devel@nongnu.org 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: Fei Li The I/O adapters should exist as soon as the bus/infrastructure exists, and not only when the guest is actually trying to do something with them. While the lazy allocation was not wrong, allocating at init time is cleaner, both for the architecture and the code. Let's adjust this by having each device type (currently for PCI and virtio-ccw) register the adapters for each ISC (as now we don't know which ISC the guest will use) as soon as it initializes. Use a two-dimensional array io_adapters[type][isc] to store adapters in ChannelSubSys, so that we can conveniently get the adapter id by the helper function css_get_adapter_id(type, isc). Signed-off-by: Fei Li Signed-off-by: Cornelia Huck --- hw/s390x/css-bridge.c | 3 ++ hw/s390x/css.c | 85 ++++++++++++++++++++++++++++++--------------= ---- hw/s390x/s390-pci-bus.c | 3 ++ hw/s390x/s390-pci-inst.c | 10 +++--- hw/s390x/virtio-ccw.c | 13 ++++---- include/hw/s390x/css.h | 7 ++-- 6 files changed, 74 insertions(+), 47 deletions(-) diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c index 9a7f7ee60c..b54ac01d37 100644 --- a/hw/s390x/css-bridge.c +++ b/hw/s390x/css-bridge.c @@ -107,6 +107,9 @@ VirtualCssBus *virtual_css_bus_init(void) /* Enable hotplugging */ qbus_set_hotplug_handler(bus, dev, &error_abort); =20 + css_register_io_adapters(CSS_IO_ADAPTER_VIRTIO, true, false, + &error_abort); + return cbus; } =20 diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 1b242c1fb7..c03bb20bc9 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -47,7 +47,6 @@ typedef struct IoAdapter { uint32_t id; uint8_t type; uint8_t isc; - QTAILQ_ENTRY(IoAdapter) sibling; } IoAdapter; =20 typedef struct ChannelSubSys { @@ -61,7 +60,7 @@ typedef struct ChannelSubSys { uint64_t chnmon_area; CssImage *css[MAX_CSSID + 1]; uint8_t default_cssid; - QTAILQ_HEAD(, IoAdapter) io_adapters; + IoAdapter *io_adapters[CSS_IO_ADAPTER_TYPE_NUMS][MAX_ISC + 1]; QTAILQ_HEAD(, IndAddr) indicator_addresses; } ChannelSubSys; =20 @@ -72,7 +71,6 @@ static ChannelSubSys channel_subsys =3D { .do_crw_mchk =3D true, .crws_lost =3D false, .chnmon_active =3D false, - .io_adapters =3D QTAILQ_HEAD_INITIALIZER(channel_subsys.io_adapters), .indicator_addresses =3D QTAILQ_HEAD_INITIALIZER(channel_subsys.indicator_addresses), }; @@ -155,44 +153,67 @@ int css_create_css_image(uint8_t cssid, bool default_= image) return 0; } =20 -int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, - bool maskable, uint32_t *id) +uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc) { + if (type >=3D CSS_IO_ADAPTER_TYPE_NUMS || isc > MAX_ISC || + !channel_subsys.io_adapters[type][isc]) { + return -1; + } + + return channel_subsys.io_adapters[type][isc]->id; +} + +/** + * css_register_io_adapters: Register I/O adapters per ISC during init + * + * @swap: an indication if byte swap is needed. + * @maskable: an indication if the adapter is subject to the mask operatio= n. + * @errp: location to store error information. + */ +void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maska= ble, + Error **errp) +{ + uint32_t id; + int ret, isc; IoAdapter *adapter; - bool found =3D false; - int ret; S390FLICState *fs =3D s390_get_flic(); S390FLICStateClass *fsc =3D S390_FLIC_COMMON_GET_CLASS(fs); =20 - *id =3D 0; - QTAILQ_FOREACH(adapter, &channel_subsys.io_adapters, sibling) { - if ((adapter->type =3D=3D type) && (adapter->isc =3D=3D isc)) { - *id =3D adapter->id; - found =3D true; - ret =3D 0; + /* + * Disallow multiple registrations for the same device type. + * Report an error if registering for an already registered type. + */ + if (channel_subsys.io_adapters[type][0]) { + error_setg(errp, "Adapters for type %d already registered", type); + } + + for (isc =3D 0; isc <=3D MAX_ISC; isc++) { + id =3D (type << 3) | isc; + ret =3D fsc->register_io_adapter(fs, id, isc, swap, maskable); + if (ret =3D=3D 0) { + adapter =3D g_new0(IoAdapter, 1); + adapter->id =3D id; + adapter->isc =3D isc; + adapter->type =3D type; + channel_subsys.io_adapters[type][isc] =3D adapter; + } else { + error_setg_errno(errp, -ret, "Unexpected error %d when " + "registering adapter %d", ret, id); break; } - if (adapter->id >=3D *id) { - *id =3D adapter->id + 1; - } - } - if (found) { - goto out; } - adapter =3D g_new0(IoAdapter, 1); - ret =3D fsc->register_io_adapter(fs, *id, isc, swap, maskable); - if (ret =3D=3D 0) { - adapter->id =3D *id; - adapter->isc =3D isc; - adapter->type =3D type; - QTAILQ_INSERT_TAIL(&channel_subsys.io_adapters, adapter, sibling); - } else { - g_free(adapter); - fprintf(stderr, "Unexpected error %d when registering adapter %d\n= ", - ret, *id); + + /* + * No need to free registered adapters in kvm: kvm will clean up + * when the machine goes away. + */ + if (ret) { + for (isc--; isc >=3D 0; isc--) { + g_free(channel_subsys.io_adapters[type][isc]); + channel_subsys.io_adapters[type][isc] =3D NULL; + } } -out: - return ret; + } =20 static void css_clear_io_interrupt(uint16_t subchannel_id, diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 1570f2d12a..a8a1bab50a 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -581,6 +581,9 @@ static int s390_pcihost_init(SysBusDevice *dev) s->bus_no =3D 0; QTAILQ_INIT(&s->pending_sei); QTAILQ_INIT(&s->zpci_devs); + + css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false, &error_abort= ); + return 0; } =20 diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 93980d6b1f..314a9cbad4 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -733,12 +733,10 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uin= t8_t r3, uint64_t gaddr, static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib f= ib) { int ret, len; + uint8_t isc =3D FIB_DATA_ISC(ldl_p(&fib.data)); =20 - ret =3D css_register_io_adapter(CSS_IO_ADAPTER_PCI, - FIB_DATA_ISC(ldl_p(&fib.data)), true, fa= lse, - &pbdev->routes.adapter.adapter_id); - assert(ret =3D=3D 0); - + pbdev->routes.adapter.adapter_id =3D css_get_adapter_id( + CSS_IO_ADAPTER_PCI, isc); pbdev->summary_ind =3D get_indicator(ldq_p(&fib.aisb), sizeof(uint64_t= )); len =3D BITS_TO_LONGS(FIB_DATA_NOI(ldl_p(&fib.data))) * sizeof(unsigne= d long); pbdev->indicator =3D get_indicator(ldq_p(&fib.aibv), len); @@ -757,7 +755,7 @@ static int reg_irqs(CPUS390XState *env, S390PCIBusDevic= e *pbdev, ZpciFib fib) pbdev->routes.adapter.summary_offset =3D FIB_DATA_AISBO(ldl_p(&fib.dat= a)); pbdev->routes.adapter.ind_addr =3D ldq_p(&fib.aibv); pbdev->routes.adapter.ind_offset =3D FIB_DATA_AIBVO(ldl_p(&fib.data)); - pbdev->isc =3D FIB_DATA_ISC(ldl_p(&fib.data)); + pbdev->isc =3D isc; pbdev->noi =3D FIB_DATA_NOI(ldl_p(&fib.data)); pbdev->sum =3D FIB_DATA_SUM(ldl_p(&fib.data)); =20 diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index b728439d40..f376381b9c 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -616,10 +616,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) dev->routes.adapter.ind_offset =3D ind_bit; dev->routes.adapter.summary_offset =3D 7; cpu_physical_memory_unmap(thinint, hw_len, 0, hw_len); - ret =3D css_register_io_adapter(CSS_IO_ADAPTER_VIRTIO, - dev->thinint_isc, true, fals= e, - &dev->routes.adapter.adapter= _id); - assert(ret =3D=3D 0); + dev->routes.adapter.adapter_id =3D css_get_adapter_id( + CSS_IO_ADAPTER_VIRTIO, + dev->thinint_isc); sch->thinint_active =3D ((dev->indicators !=3D NULL) && (dev->summary_indicator !=3D NULL)); sch->curr_status.scsw.count =3D ccw.count - len; @@ -1308,9 +1307,9 @@ static int virtio_ccw_load_config(DeviceState *d, QEM= UFile *f) dev->thinint_isc =3D qemu_get_byte(f); dev->revision =3D qemu_get_be32(f); if (s->thinint_active) { - return css_register_io_adapter(CSS_IO_ADAPTER_VIRTIO, - dev->thinint_isc, true, false, - &dev->routes.adapter.adapter_id); + dev->routes.adapter.adapter_id =3D css_get_adapter_id( + CSS_IO_ADAPTER_VIRTIO, + dev->thinint_isc); } =20 return 0; diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index cdc73fe0aa..f1f0d7f07a 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -23,6 +23,8 @@ #define MAX_CSSID 255 #define MAX_CHPID 255 =20 +#define MAX_ISC 7 + #define MAX_CIWS 62 =20 #define VIRTUAL_CSSID 0xfe @@ -130,8 +132,9 @@ typedef enum { CSS_IO_ADAPTER_TYPE_NUMS, } CssIoAdapterType; =20 -int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, - bool maskable, uint32_t *id); +uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc); +void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maska= ble, + Error **errp); =20 #ifndef CONFIG_USER_ONLY SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid, --=20 2.11.0 From nobody Fri May 3 05:18:46 2024 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 1492760976610362.44491851447924; Fri, 21 Apr 2017 00:49:36 -0700 (PDT) Received: from localhost ([::1]:57689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TJv-0007Eh-3G for importer@patchew.org; Fri, 21 Apr 2017 03:49:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TBg-00018F-4w for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TBc-0000ga-VL for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:04 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47939 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 1d1TBc-0000gO-NO for qemu-devel@nongnu.org; Fri, 21 Apr 2017 03:41:00 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L7crLi128260 for ; Fri, 21 Apr 2017 03:41:00 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 29xwu7f097-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 03:40:59 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 08:40:58 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Apr 2017 08:40:55 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L7etsD39125206; Fri, 21 Apr 2017 07:40:55 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB48842054; Fri, 21 Apr 2017 08:39:52 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D60E4203F; Fri, 21 Apr 2017 08:39:52 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2017 08:39:52 +0100 (BST) From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 21 Apr 2017 09:40:38 +0200 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421074038.774-1-cornelia.huck@de.ibm.com> References: <20170421074038.774-1-cornelia.huck@de.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17042107-0040-0000-0000-0000038DF89E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042107-0041-0000-0000-00001FC928F3 Message-Id: <20170421074038.774-12-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-21_06:, , 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-1704210143 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id v3L7crLi128260 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 11/11] s390x: Drop useless casts 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, agraf@suse.de, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Eric Blake An upcoming Coccinelle cleanup script wanted to reformat the casts present in this file - but on closer look, we don't need the casts at all because C automatically converts void* to any other pointer. Signed-off-by: Eric Blake Message-Id: <20170405194741.18956-4-eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Cornelia Huck --- target/s390x/cpu_models.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 1434d15315..ce461cc905 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, = const CpuModelInfo *info, =20 static void qdict_add_disabled_feat(const char *name, void *opaque) { - qdict_put((QDict *) opaque, name, qbool_from_bool(false)); + qdict_put(opaque, name, qbool_from_bool(false)); } =20 static void qdict_add_enabled_feat(const char *name, void *opaque) { - qdict_put((QDict *) opaque, name, qbool_from_bool(true)); + qdict_put(opaque, name, qbool_from_bool(true)); } =20 /* convert S390CPUDef into a static CpuModelInfo */ --=20 2.11.0