From nobody Mon May 6 21:14:08 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.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 1499785014696563.8655348887005; Tue, 11 Jul 2017 07:56:54 -0700 (PDT) Received: from localhost ([::1]:46862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwan-0001LN-9i for importer@patchew.org; Tue, 11 Jul 2017 10:56:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwYy-000069-6k for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUwYv-00051s-3a for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59129 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 1dUwYu-00051X-Tq for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:53 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6BEs2Hf055220 for ; Tue, 11 Jul 2017 10:54:51 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bn0mv0m0k-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Jul 2017 10:54:51 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jul 2017 15:54:48 +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; Tue, 11 Jul 2017 15:54:45 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6BEsj0O3932442; Tue, 11 Jul 2017 14:54:45 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8980BA404D; Tue, 11 Jul 2017 15:52:04 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24BE8A4051; Tue, 11 Jul 2017 15:52:04 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 11 Jul 2017 15:52:04 +0100 (BST) From: Halil Pasic To: Christian Borntraeger , Cornelia Huck Date: Tue, 11 Jul 2017 16:54:36 +0200 X-Mailer: git-send-email 2.11.2 In-Reply-To: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> References: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071114-0016-0000-0000-000004D4685A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071114-0017-0000-0000-0000280861EA Message-Id: <20170711145441.33925-2-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-11_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110237 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v3 1/6] s390x: add helper get_machine_class 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: Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Halil Pasic , "Jason J . Herne" , Cornelia Huck , Dong Jia Shi 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" We will need the machine class at machine initialization time, so the usual way via qdev won't do. Let's cache the machine class and also use the default values of the base machine for capability discovery. Signed-off-by: Halil Pasic Acked-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 46 +++++++++++++++++++++++-------------------= ---- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 41ca6668e2..1eb17ad184 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -252,36 +252,35 @@ static inline void machine_set_dea_key_wrap(Object *o= bj, bool value, ms->dea_key_wrap =3D value; } =20 -bool ri_allowed(void) -{ - if (kvm_enabled()) { - MachineClass *mc =3D MACHINE_GET_CLASS(qdev_get_machine()); - if (object_class_dynamic_cast(OBJECT_CLASS(mc), - TYPE_S390_CCW_MACHINE)) { - S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); +static S390CcwMachineClass *current_mc; =20 - return s390mc->ri_allowed; - } +static S390CcwMachineClass *get_machine_class(void) +{ + if (unlikely(!current_mc)) { /* - * Make sure the "none" machine can have ri, otherwise it won't * = be - * unlocked in KVM and therefore the host CPU model might be wrong. - */ - return true; + * No s390 ccw machine was instantiated, we are likely to + * be called for the 'none' machine. The properties will + * have their after-initialization values. + */ + current_mc =3D S390_MACHINE_CLASS( + object_class_by_name(TYPE_S390_CCW_MACHINE)); } - return 0; + return current_mc; } =20 -bool cpu_model_allowed(void) +bool ri_allowed(void) { - MachineClass *mc =3D MACHINE_GET_CLASS(qdev_get_machine()); - if (object_class_dynamic_cast(OBJECT_CLASS(mc), - TYPE_S390_CCW_MACHINE)) { - S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); - - return s390mc->cpu_model_allowed; + if (!kvm_enabled()) { + return false; } - /* allow CPU model qmp queries with the "none" machine */ - return true; + /* for "none" machine this results in true */ + return get_machine_class()->ri_allowed; +} + +bool cpu_model_allowed(void) +{ + /* for "none" machine this results in true */ + return get_machine_class()->cpu_model_allowed; } =20 static char *machine_get_loadparm(Object *obj, Error **errp) @@ -391,6 +390,7 @@ static const TypeInfo ccw_machine_info =3D { static void ccw_machine_##suffix##_instance_init(Object *obj) = \ { = \ MachineState *machine =3D MACHINE(obj); = \ + current_mc =3D S390_MACHINE_CLASS(MACHINE_GET_CLASS(machine)); = \ ccw_machine_##suffix##_instance_options(machine); = \ } = \ static const TypeInfo ccw_machine_##suffix##_info =3D { = \ --=20 2.11.2 From nobody Mon May 6 21:14:08 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.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 149978501586660.07730475392361; Tue, 11 Jul 2017 07:56:55 -0700 (PDT) Received: from localhost ([::1]:46863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwap-0001NU-JB for importer@patchew.org; Tue, 11 Jul 2017 10:56:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwYz-00007x-GV for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUwYw-00052R-D4 for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33501 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 1dUwYw-00051Y-7W for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:54 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6BEsT3K133795 for ; Tue, 11 Jul 2017 10:54:51 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bn0mv8kvc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Jul 2017 10:54:51 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jul 2017 15:54:49 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 11 Jul 2017 15:54:46 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6BEskjK35717176; Tue, 11 Jul 2017 14:54:46 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EECFAA405B; Tue, 11 Jul 2017 15:52:05 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96B1DA404D; Tue, 11 Jul 2017 15:52:05 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 11 Jul 2017 15:52:05 +0100 (BST) From: Halil Pasic To: Christian Borntraeger , Cornelia Huck Date: Tue, 11 Jul 2017 16:54:37 +0200 X-Mailer: git-send-email 2.11.2 In-Reply-To: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> References: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071114-0040-0000-0000-000003E15EC6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071114-0041-0000-0000-0000207C5405 Message-Id: <20170711145441.33925-3-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-11_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110237 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v3 2/6] s390x: add css_migration_enabled to machine class 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: Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Halil Pasic , "Jason J . Herne" , Cornelia Huck , Dong Jia Shi 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" Currently the migration of the channel subsystem (css) is only partial and is done by the virtio ccw proxies -- the only migratable css devices existing at the moment. With the current work on emulated and passthrough devices we need to decouple the migration of the channel subsystem state from virtio ccw, and have a separate section for it. A new section however necessarily breaks the migration compatibility. So let us introduce a switch at the machine class, and put it in 'off' state for now. We will turn the switch 'on' for future machines once all preparations are met. For compatibility machines the switch will stay 'off'. Signed-off-by: Halil Pasic Acked-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 13 +++++++++++++ include/hw/s390x/s390-virtio-ccw.h | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1eb17ad184..751febb87a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -206,6 +206,7 @@ static void ccw_machine_class_init(ObjectClass *oc, voi= d *data) =20 s390mc->ri_allowed =3D true; s390mc->cpu_model_allowed =3D true; + s390mc->css_migration_enabled =3D false; /* TODO: set to true */ mc->init =3D ccw_init; mc->reset =3D s390_machine_reset; mc->hot_add_cpu =3D s390_hot_add_cpu; @@ -375,6 +376,11 @@ static const TypeInfo ccw_machine_info =3D { }, }; =20 +bool css_migration_enabled(void) +{ + return get_machine_class()->css_migration_enabled; +} + #define DEFINE_CCW_MACHINE(suffix, verstr, latest) = \ static void ccw_machine_##suffix##_class_init(ObjectClass *oc, = \ void *data) = \ @@ -476,6 +482,10 @@ static const TypeInfo ccw_machine_info =3D { =20 static void ccw_machine_2_10_instance_options(MachineState *machine) { + /* + * TODO Once preparations are done register vmstate for the css if + * css_migration_enabled(). + */ } =20 static void ccw_machine_2_10_class_options(MachineClass *mc) @@ -490,8 +500,11 @@ static void ccw_machine_2_9_instance_options(MachineSt= ate *machine) =20 static void ccw_machine_2_9_class_options(MachineClass *mc) { + S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); + ccw_machine_2_10_class_options(mc); SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9); + s390mc->css_migration_enabled =3D false; } DEFINE_CCW_MACHINE(2_9, "2.9", false); =20 diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 3027555f6d..ab88d49d10 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -39,6 +39,7 @@ typedef struct S390CcwMachineClass { /*< public >*/ bool ri_allowed; bool cpu_model_allowed; + bool css_migration_enabled; } S390CcwMachineClass; =20 /* runtime-instrumentation allowed by the machine */ @@ -46,4 +47,10 @@ bool ri_allowed(void); /* cpu model allowed by the machine */ bool cpu_model_allowed(void); =20 +/** + * Returns true if (vmstate based) migration of the channel subsystem + * is enabled, false if it is disabled. + */ +bool css_migration_enabled(void); + #endif --=20 2.11.2 From nobody Mon May 6 21:14:08 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.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 1499785020391152.5307672396026; Tue, 11 Jul 2017 07:57:00 -0700 (PDT) Received: from localhost ([::1]:46864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwau-0001Pv-4D for importer@patchew.org; Tue, 11 Jul 2017 10:56:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwZ2-0000AQ-98 for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUwYw-00052M-C9 for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:55:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45303 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 1dUwYw-000529-6v for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:54 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6BEsLgc103867 for ; Tue, 11 Jul 2017 10:54:53 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bn0msrm4a-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Jul 2017 10:54:53 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jul 2017 15:54:51 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 11 Jul 2017 15:54:48 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6BEslg737158936; Tue, 11 Jul 2017 14:54:47 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D8FFA4055; Tue, 11 Jul 2017 15:52:07 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 07148A4051; Tue, 11 Jul 2017 15:52:07 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 11 Jul 2017 15:52:06 +0100 (BST) From: Halil Pasic To: Christian Borntraeger , Cornelia Huck Date: Tue, 11 Jul 2017 16:54:38 +0200 X-Mailer: git-send-email 2.11.2 In-Reply-To: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> References: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071114-0040-0000-0000-000003E15ECA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071114-0041-0000-0000-0000207C5408 Message-Id: <20170711145441.33925-4-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-11_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110237 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v3 3/6] s390x/css: add missing css state conditionally 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: Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Halil Pasic , "Jason J . Herne" , Cornelia Huck , Dong Jia Shi 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" Although we have recently vmstatified the migration of some css infrastructure, for some css entities there is still state to be migrated left, because the focus was keeping migration stream compatibility (that is basically everything as-is). Let us add vmstate helpers and extend existing vmstate descriptions so that we have everything we need. Let us guard the added state via css_migration_enabled, so we keep the compatible behavior if css migration is disabled. Let's also annotate the bits which do not need to be migrated for better readability. Signed-off-by: Halil Pasic Reviewed-by: Cornelia Huck Reviewed-by: Juan Quintela --- hw/intc/s390_flic.c | 20 +++++++++++++++ hw/s390x/css.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 94 insertions(+) diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 837158bdaf..1678039d6b 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -138,6 +138,22 @@ static void qemu_s390_flic_register_types(void) =20 type_init(qemu_s390_flic_register_types) =20 +static bool adapter_info_so_needed(void *opaque) +{ + return css_migration_enabled(); +} + +const VMStateDescription vmstate_adapter_info_so =3D { + .name =3D "s390_adapter_info/summary_offset", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D adapter_info_so_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT32(summary_offset, AdapterInfo), + VMSTATE_END_OF_LIST() + } +}; + const VMStateDescription vmstate_adapter_info =3D { .name =3D "s390_adapter_info", .version_id =3D 1, @@ -151,6 +167,10 @@ const VMStateDescription vmstate_adapter_info =3D { */ VMSTATE_END_OF_LIST() }, + .subsections =3D (const VMStateDescription * []) { + &vmstate_adapter_info_so, + NULL + } }; =20 const VMStateDescription vmstate_adapter_routes =3D { diff --git a/hw/s390x/css.c b/hw/s390x/css.c index d67fffae30..4747589d90 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -29,12 +29,45 @@ typedef struct CrwContainer { QTAILQ_ENTRY(CrwContainer) sibling; } CrwContainer; =20 +static const VMStateDescription vmstate_crw =3D { + .name =3D "s390_crw", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT16(flags, CRW), + VMSTATE_UINT16(rsid, CRW), + VMSTATE_END_OF_LIST() + }, +}; + +static const VMStateDescription vmstate_crw_container =3D { + .name =3D "s390_crw_container", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_STRUCT(crw, CrwContainer, 0, vmstate_crw, CRW), + VMSTATE_END_OF_LIST() + }, +}; + typedef struct ChpInfo { uint8_t in_use; uint8_t type; uint8_t is_virtual; } ChpInfo; =20 +static const VMStateDescription vmstate_chp_info =3D { + .name =3D "s390_chp_info", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(in_use, ChpInfo), + VMSTATE_UINT8(type, ChpInfo), + VMSTATE_UINT8(is_virtual, ChpInfo), + VMSTATE_END_OF_LIST() + } +}; + typedef struct SubchSet { SubchDev *sch[MAX_SCHID + 1]; unsigned long schids_used[BITS_TO_LONGS(MAX_SCHID + 1)]; @@ -221,6 +254,19 @@ typedef struct CssImage { ChpInfo chpids[MAX_CHPID + 1]; } CssImage; =20 +static const VMStateDescription vmstate_css_img =3D { + .name =3D "s390_css_img", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + /* Subchannel sets have no relevant state. */ + VMSTATE_STRUCT_ARRAY(chpids, CssImage, MAX_CHPID + 1, 0, + vmstate_chp_info, ChpInfo), + VMSTATE_END_OF_LIST() + } + +}; + typedef struct IoAdapter { uint32_t id; uint8_t type; @@ -238,10 +284,34 @@ typedef struct ChannelSubSys { uint64_t chnmon_area; CssImage *css[MAX_CSSID + 1]; uint8_t default_cssid; + /* don't migrate, see css_register_io_adapters */ IoAdapter *io_adapters[CSS_IO_ADAPTER_TYPE_NUMS][MAX_ISC + 1]; + /* don't migrate, see get_indicator and IndAddrPtrTmp */ QTAILQ_HEAD(, IndAddr) indicator_addresses; } ChannelSubSys; =20 +static const VMStateDescription vmstate_css =3D { + .name =3D "s390_css", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_QTAILQ_V(pending_crws, ChannelSubSys, 1, vmstate_crw_conta= iner, + CrwContainer, sibling), + VMSTATE_BOOL(sei_pending, ChannelSubSys), + VMSTATE_BOOL(do_crw_mchk, ChannelSubSys), + VMSTATE_BOOL(crws_lost, ChannelSubSys), + /* These were kind of migrated by virtio */ + VMSTATE_UINT8(max_cssid, ChannelSubSys), + VMSTATE_UINT8(max_ssid, ChannelSubSys), + VMSTATE_BOOL(chnmon_active, ChannelSubSys), + VMSTATE_UINT64(chnmon_area, ChannelSubSys), + VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(css, ChannelSubSys, MAX_CSSID += 1, + 0, vmstate_css_img, CssImage), + VMSTATE_UINT8(default_cssid, ChannelSubSys), + VMSTATE_END_OF_LIST() + } +}; + static ChannelSubSys channel_subsys =3D { .pending_crws =3D QTAILQ_HEAD_INITIALIZER(channel_subsys.pending_crws), .do_crw_mchk =3D true, @@ -281,6 +351,10 @@ static int subch_dev_post_load(void *opaque, int versi= on_id) css_subch_assign(s->cssid, s->ssid, s->schid, s->devno, s); } =20 + if (css_migration_enabled()) { + /* No compat voodoo to do ;) */ + return 0; + } /* * Hack alert. If we don't migrate the channel subsystem status * we still need to find out if the guest enabled mss/mcss-e. --=20 2.11.2 From nobody Mon May 6 21:14:08 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.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 1499785136457390.0831877089888; Tue, 11 Jul 2017 07:58:56 -0700 (PDT) Received: from localhost ([::1]:46871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwcm-000328-J4 for importer@patchew.org; Tue, 11 Jul 2017 10:58:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwZ0-00008r-Ne for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUwYx-00052i-Ek for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59334 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 1dUwYx-00052e-9Q for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:55 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6BEs3BT055246 for ; Tue, 11 Jul 2017 10:54:54 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bn0mv0m32-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Jul 2017 10:54:54 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jul 2017 15:54:52 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 11 Jul 2017 15:54:49 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6BEsnEx11403696; Tue, 11 Jul 2017 14:54:49 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C83F2A4069; Tue, 11 Jul 2017 15:52:08 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B899A4051; Tue, 11 Jul 2017 15:52:08 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 11 Jul 2017 15:52:08 +0100 (BST) From: Halil Pasic To: Christian Borntraeger , Cornelia Huck Date: Tue, 11 Jul 2017 16:54:39 +0200 X-Mailer: git-send-email 2.11.2 In-Reply-To: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> References: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071114-0020-0000-0000-0000039F5EB6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071114-0021-0000-0000-0000422405C0 Message-Id: <20170711145441.33925-5-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-11_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110237 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v3 4/6] s390x/css: add ORB to SubchDev 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: Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Halil Pasic , "Jason J . Herne" , Cornelia Huck , Dong Jia Shi 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" Since we are going to need a migration compatibility breaking change to activate ChannelSubSys migration let us use the opportunity to introduce ORB to the SubchDev before that (otherwise we would need separate handling e.g. a compat property). The ORB will be useful for implementing IDA, or async handling of subchannel work. Signed-off-by: Halil Pasic Reviewed-by: Guenther Hutzl Reviewed-by: Cornelia Huck --- hw/s390x/css.c | 35 +++++++++++++++++++++++++++++++++++ include/hw/s390x/css.h | 1 + 2 files changed, 36 insertions(+) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 4747589d90..20b5fbed68 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -165,6 +165,36 @@ static const VMStateDescription vmstate_sense_id =3D { } }; =20 +static const VMStateDescription vmstate_orb =3D { + .name =3D "s390_orb", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT32(intparm, ORB), + VMSTATE_UINT16(ctrl0, ORB), + VMSTATE_UINT8(lpm, ORB), + VMSTATE_UINT8(ctrl1, ORB), + VMSTATE_UINT32(cpa, ORB), + VMSTATE_END_OF_LIST() + } +}; + +static bool vmstate_schdev_orb_needed(void *opaque) +{ + return css_migration_enabled(); +} + +static const VMStateDescription vmstate_schdev_orb =3D { + .name =3D "s390_subch_dev/orb", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D vmstate_schdev_orb_needed, + .fields =3D (VMStateField[]) { + VMSTATE_STRUCT(orb, SubchDev, 1, vmstate_orb, ORB), + VMSTATE_END_OF_LIST() + } +}; + static int subch_dev_post_load(void *opaque, int version_id); static void subch_dev_pre_save(void *opaque); =20 @@ -193,6 +223,10 @@ const VMStateDescription vmstate_subch_dev =3D { VMSTATE_BOOL(ccw_fmt_1, SubchDev), VMSTATE_UINT8(ccw_no_data_cnt, SubchDev), VMSTATE_END_OF_LIST() + }, + .subsections =3D (const VMStateDescription * []) { + &vmstate_schdev_orb, + NULL } }; =20 @@ -1342,6 +1376,7 @@ int css_do_ssch(SubchDev *sch, ORB *orb) if (channel_subsys.chnmon_active) { css_update_chnmon(sch); } + sch->orb =3D *orb; sch->channel_prog =3D orb->cpa; /* Trigger the start function. */ s->ctrl |=3D (SCSW_FCTL_START_FUNC | SCSW_ACTL_START_PEND); diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index eb0e26f258..5d302223e6 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -89,6 +89,7 @@ struct SubchDev { bool thinint_active; uint8_t ccw_no_data_cnt; uint16_t migrated_schid; /* used for missmatch detection */ + ORB orb; /* transport-provided data: */ int (*ccw_cb) (SubchDev *, CCW1); void (*disable_cb)(SubchDev *); --=20 2.11.2 From nobody Mon May 6 21:14:08 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.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 1499785260428983.4703479892615; Tue, 11 Jul 2017 08:01:00 -0700 (PDT) Received: from localhost ([::1]:46883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwek-0004Z5-PY for importer@patchew.org; Tue, 11 Jul 2017 11:00:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwZ3-0000C9-O6 for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUwZ0-000568-Lt for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:55:01 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUwZ0-00055V-CJ for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:58 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6BEs3eG075072 for ; Tue, 11 Jul 2017 10:54:56 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bn0n38mrx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Jul 2017 10:54:56 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jul 2017 15:54:53 +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, 11 Jul 2017 15:54:51 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6BEsooI39387296; Tue, 11 Jul 2017 14:54:50 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A8B8A405B; Tue, 11 Jul 2017 15:52:10 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4E05A4055; Tue, 11 Jul 2017 15:52:09 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 11 Jul 2017 15:52:09 +0100 (BST) From: Halil Pasic To: Christian Borntraeger , Cornelia Huck Date: Tue, 11 Jul 2017 16:54:40 +0200 X-Mailer: git-send-email 2.11.2 In-Reply-To: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> References: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071114-0008-0000-0000-0000047E6131 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071114-0009-0000-0000-00001E09514E Message-Id: <20170711145441.33925-6-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-11_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110237 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 v3 5/6] s390x/css: activate ChannelSubSys migration 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: Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Halil Pasic , "Jason J . Herne" , Cornelia Huck , Dong Jia Shi 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" Turn on migration for the channel subsystem for the next machine. For legacy machines we still have to do things the old way. Signed-off-by: Halil Pasic Reviewed-by: Cornelia Huck --- hw/s390x/css.c | 5 +++++ hw/s390x/s390-virtio-ccw.c | 9 ++++----- include/hw/s390x/css.h | 4 ++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 20b5fbed68..b89b60751a 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -407,6 +407,11 @@ static int subch_dev_post_load(void *opaque, int versi= on_id) return 0; } =20 +void css_register_vmstate(void) +{ + vmstate_register(NULL, 0, &vmstate_css, &channel_subsys); +} + IndAddr *get_indicator(hwaddr ind_addr, int len) { IndAddr *indicator; diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 751febb87a..20e3f06519 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -206,7 +206,7 @@ static void ccw_machine_class_init(ObjectClass *oc, voi= d *data) =20 s390mc->ri_allowed =3D true; s390mc->cpu_model_allowed =3D true; - s390mc->css_migration_enabled =3D false; /* TODO: set to true */ + s390mc->css_migration_enabled =3D true; mc->init =3D ccw_init; mc->reset =3D s390_machine_reset; mc->hot_add_cpu =3D s390_hot_add_cpu; @@ -482,10 +482,9 @@ bool css_migration_enabled(void) =20 static void ccw_machine_2_10_instance_options(MachineState *machine) { - /* - * TODO Once preparations are done register vmstate for the css if - * css_migration_enabled(). - */ + if (css_migration_enabled()) { + css_register_vmstate(); + } } =20 static void ccw_machine_2_10_class_options(MachineClass *mc) diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index 5d302223e6..949e0f0a28 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -226,4 +226,8 @@ extern PropertyInfo css_devid_ro_propinfo; */ SubchDev *css_create_sch(CssDevId bus_id, bool is_virtual, bool squash_mcs= s, Error **errp); + +/** Turn on css migration */ +void css_register_vmstate(void); + #endif --=20 2.11.2 From nobody Mon May 6 21:14:08 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.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 1499785134420117.56038711918427; Tue, 11 Jul 2017 07:58:54 -0700 (PDT) Received: from localhost ([::1]:46870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwck-00030l-4p for importer@patchew.org; Tue, 11 Jul 2017 10:58:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUwZ1-00009j-PT for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUwZ0-000562-LR for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43021 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 1dUwZ0-00055r-Eo for qemu-devel@nongnu.org; Tue, 11 Jul 2017 10:54:58 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6BEsuBS068276 for ; Tue, 11 Jul 2017 10:54:57 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bn0mvrksh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Jul 2017 10:54:57 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jul 2017 15:54:55 +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; Tue, 11 Jul 2017 15:54:52 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6BEsqsX38273202; Tue, 11 Jul 2017 14:54:52 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 937E7A4065; Tue, 11 Jul 2017 15:52:11 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 475E8A405F; Tue, 11 Jul 2017 15:52:11 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 11 Jul 2017 15:52:11 +0100 (BST) From: Halil Pasic To: Christian Borntraeger , Cornelia Huck Date: Tue, 11 Jul 2017 16:54:41 +0200 X-Mailer: git-send-email 2.11.2 In-Reply-To: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> References: <20170711145441.33925-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071114-0020-0000-0000-0000039F5EBD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071114-0021-0000-0000-0000422405C9 Message-Id: <20170711145441.33925-7-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-11_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110237 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v3 6/6] s390x/css: use SubchDev.orb 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: Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Halil Pasic , "Jason J . Herne" , Cornelia Huck , Dong Jia Shi 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" Instead of passing around a pointer to ORB let us simplify some function signatures by using the previously introduced ORB saved at the subchannel (SubchDev). Signed-off-by: Halil Pasic Reviewed-by: Cornelia Huck --- hw/s390x/css.c | 30 +++++++++++++++--------------- include/hw/s390x/css.h | 6 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index b89b60751a..abc77f7d4c 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -865,7 +865,7 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_= addr, return ret; } =20 -static void sch_handle_start_func_virtual(SubchDev *sch, ORB *orb) +static void sch_handle_start_func_virtual(SubchDev *sch) { =20 PMCW *p =3D &sch->curr_status.pmcw; @@ -879,10 +879,10 @@ static void sch_handle_start_func_virtual(SubchDev *s= ch, ORB *orb) =20 if (!(s->ctrl & SCSW_ACTL_SUSP)) { /* Start Function triggered via ssch, i.e. we have an ORB */ + ORB *orb =3D &sch->orb; s->cstat =3D 0; s->dstat =3D 0; /* Look at the orb and try to execute the channel program. */ - assert(orb !=3D NULL); /* resume does not pass an orb */ p->intparm =3D orb->intparm; if (!(orb->lpm & path)) { /* Generate a deferred cc 3 condition. */ @@ -896,8 +896,7 @@ static void sch_handle_start_func_virtual(SubchDev *sch= , ORB *orb) sch->ccw_no_data_cnt =3D 0; suspend_allowed =3D !!(orb->ctrl0 & ORB_CTRL0_MASK_SPND); } else { - /* Start Function resumed via rsch, i.e. we don't have an - * ORB */ + /* Start Function resumed via rsch */ s->ctrl &=3D ~(SCSW_ACTL_SUSP | SCSW_ACTL_RESUME_PEND); /* The channel program had been suspended before. */ suspend_allowed =3D true; @@ -967,13 +966,14 @@ static void sch_handle_start_func_virtual(SubchDev *s= ch, ORB *orb) =20 } =20 -static int sch_handle_start_func_passthrough(SubchDev *sch, ORB *orb) +static int sch_handle_start_func_passthrough(SubchDev *sch) { =20 PMCW *p =3D &sch->curr_status.pmcw; SCSW *s =3D &sch->curr_status.scsw; int ret; =20 + ORB *orb =3D &sch->orb; if (!(s->ctrl & SCSW_ACTL_SUSP)) { assert(orb !=3D NULL); p->intparm =3D orb->intparm; @@ -1018,7 +1018,7 @@ static int sch_handle_start_func_passthrough(SubchDev= *sch, ORB *orb) * read/writes) asynchronous later on if we start supporting more than * our current very simple devices. */ -int do_subchannel_work_virtual(SubchDev *sch, ORB *orb) +int do_subchannel_work_virtual(SubchDev *sch) { =20 SCSW *s =3D &sch->curr_status.scsw; @@ -1029,7 +1029,7 @@ int do_subchannel_work_virtual(SubchDev *sch, ORB *or= b) sch_handle_halt_func(sch); } else if (s->ctrl & SCSW_FCTL_START_FUNC) { /* Triggered by both ssch and rsch. */ - sch_handle_start_func_virtual(sch, orb); + sch_handle_start_func_virtual(sch); } else { /* Cannot happen. */ return 0; @@ -1038,7 +1038,7 @@ int do_subchannel_work_virtual(SubchDev *sch, ORB *or= b) return 0; } =20 -int do_subchannel_work_passthrough(SubchDev *sch, ORB *orb) +int do_subchannel_work_passthrough(SubchDev *sch) { int ret; SCSW *s =3D &sch->curr_status.scsw; @@ -1052,7 +1052,7 @@ int do_subchannel_work_passthrough(SubchDev *sch, ORB= *orb) sch_handle_halt_func(sch); ret =3D 0; } else if (s->ctrl & SCSW_FCTL_START_FUNC) { - ret =3D sch_handle_start_func_passthrough(sch, orb); + ret =3D sch_handle_start_func_passthrough(sch); } else { /* Cannot happen. */ return -ENODEV; @@ -1061,10 +1061,10 @@ int do_subchannel_work_passthrough(SubchDev *sch, O= RB *orb) return ret; } =20 -static int do_subchannel_work(SubchDev *sch, ORB *orb) +static int do_subchannel_work(SubchDev *sch) { if (sch->do_subchannel_work) { - return sch->do_subchannel_work(sch, orb); + return sch->do_subchannel_work(sch); } else { return -EINVAL; } @@ -1271,7 +1271,7 @@ int css_do_csch(SubchDev *sch) s->ctrl &=3D ~(SCSW_CTRL_MASK_FCTL | SCSW_CTRL_MASK_ACTL); s->ctrl |=3D SCSW_FCTL_CLEAR_FUNC | SCSW_ACTL_CLEAR_PEND; =20 - do_subchannel_work(sch, NULL); + do_subchannel_work(sch); ret =3D 0; =20 out: @@ -1312,7 +1312,7 @@ int css_do_hsch(SubchDev *sch) } s->ctrl |=3D SCSW_ACTL_HALT_PEND; =20 - do_subchannel_work(sch, NULL); + do_subchannel_work(sch); ret =3D 0; =20 out: @@ -1387,7 +1387,7 @@ int css_do_ssch(SubchDev *sch, ORB *orb) s->ctrl |=3D (SCSW_FCTL_START_FUNC | SCSW_ACTL_START_PEND); s->flags &=3D ~SCSW_FLAGS_MASK_PNO; =20 - ret =3D do_subchannel_work(sch, orb); + ret =3D do_subchannel_work(sch); =20 out: return ret; @@ -1666,7 +1666,7 @@ int css_do_rsch(SubchDev *sch) } =20 s->ctrl |=3D SCSW_ACTL_RESUME_PEND; - do_subchannel_work(sch, NULL); + do_subchannel_work(sch); ret =3D 0; =20 out: diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index 949e0f0a28..165ca2f4e9 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -93,7 +93,7 @@ struct SubchDev { /* transport-provided data: */ int (*ccw_cb) (SubchDev *, CCW1); void (*disable_cb)(SubchDev *); - int (*do_subchannel_work) (SubchDev *, ORB *); + int (*do_subchannel_work) (SubchDev *); SenseId id; void *driver_data; }; @@ -157,8 +157,8 @@ void css_generate_css_crws(uint8_t cssid); void css_clear_sei_pending(void); void css_adapter_interrupt(uint8_t isc); int s390_ccw_cmd_request(ORB *orb, SCSW *scsw, void *data); -int do_subchannel_work_virtual(SubchDev *sub, ORB *orb); -int do_subchannel_work_passthrough(SubchDev *sub, ORB *orb); +int do_subchannel_work_virtual(SubchDev *sub); +int do_subchannel_work_passthrough(SubchDev *sub); =20 typedef enum { CSS_IO_ADAPTER_VIRTIO =3D 0, --=20 2.11.2