From nobody Tue Feb 10 05:26:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495192173895342.3181880281786; Fri, 19 May 2017 04:09:33 -0700 (PDT) Received: from localhost ([::1]:57860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBfmk-0007xh-90 for importer@patchew.org; Fri, 19 May 2017 07:09:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBfa3-00056j-LR for qemu-devel@nongnu.org; Fri, 19 May 2017 06:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBfa0-0008Ur-Fu for qemu-devel@nongnu.org; Fri, 19 May 2017 06:56:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59637 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 1dBfa0-0008To-At for qemu-devel@nongnu.org; Fri, 19 May 2017 06:56:20 -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 v4JAmuoF041227 for ; Fri, 19 May 2017 06:56:19 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ahts7vc98-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 May 2017 06:56:19 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 May 2017 11:56:17 +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, 19 May 2017 11:56:15 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4JAuE4629229268; Fri, 19 May 2017 10:56:14 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0BE7911C050; Fri, 19 May 2017 11:54:46 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC13611C04A; Fri, 19 May 2017 11:54:45 +0100 (BST) Received: from gondolin.boeblingen.de.ibm.com (unknown [9.152.224.119]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 19 May 2017 11:54:45 +0100 (BST) From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 19 May 2017 12:55:49 +0200 X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170519105600.11589-1-cornelia.huck@de.ibm.com> References: <20170519105600.11589-1-cornelia.huck@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17051910-0020-0000-0000-0000036E0B46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051910-0021-0000-0000-000041CE588F Message-Id: <20170519105600.11589-11-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-19_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-1705190067 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 10/21] s390x/css: add s390-squash-mcss machine option 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, Xiao Feng Ren 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: Xiao Feng Ren We want to support real (i.e. not virtual) channel devices even for guests that do not support MCSS-E (where guests may see devices from any channel subsystem image at once). As all virtio-ccw devices are in css 0xfe (and show up in the default css 0 for guests not activating MCSS-E), we need an option to squash both the virtio subchannels and e.g. passed-through subchannels from their real css (0-3, or 0 for hosts not activating MCSS-E) into the default css. This will be exploited in a later patch. Signed-off-by: Xiao Feng Ren Signed-off-by: Dong Jia Shi Message-Id: <20170517004813.58227-4-bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 21 +++++++++++++++++++++ include/hw/s390x/s390-virtio-ccw.h | 1 + qemu-options.hx | 6 +++++- target/s390x/cpu.h | 10 ++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index fdd4384ff0..cd007ca8cf 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -303,6 +303,20 @@ static void machine_set_loadparm(Object *obj, const ch= ar *val, Error **errp) ms->loadparm[i] =3D ' '; /* pad right with spaces */ } } +static inline bool machine_get_squash_mcss(Object *obj, Error **errp) +{ + S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); + + return ms->s390_squash_mcss; +} + +static inline void machine_set_squash_mcss(Object *obj, bool value, + Error **errp) +{ + S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); + + ms->s390_squash_mcss =3D value; +} =20 static inline void s390_machine_initfn(Object *obj) { @@ -328,6 +342,13 @@ static inline void s390_machine_initfn(Object *obj) " to upper case) to pass to machine loader, boot manager," " and guest kernel", NULL); + object_property_add_bool(obj, "s390-squash-mcss", + machine_get_squash_mcss, + machine_set_squash_mcss, NULL); + object_property_set_description(obj, "s390-squash-mcss", + "enable/disable squashing subchannels into the default css", + NULL); + object_property_set_bool(obj, false, "s390-squash-mcss", NULL); } =20 static const TypeInfo ccw_machine_info =3D { diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 7b8a3e4d74..3027555f6d 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -29,6 +29,7 @@ typedef struct S390CcwMachineState { bool aes_key_wrap; bool dea_key_wrap; uint8_t loadparm[8]; + bool s390_squash_mcss; } S390CcwMachineState; =20 typedef struct S390CcwMachineClass { diff --git a/qemu-options.hx b/qemu-options.hx index f07a310eb1..1e5382c1e1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -42,7 +42,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ " dea-key-wrap=3Don|off controls support for DEA key wr= apping (default=3Don)\n" " suppress-vmdesc=3Don|off disables self-describing mig= ration (default=3Doff)\n" " nvdimm=3Don|off controls NVDIMM support (default=3Dof= f)\n" - " enforce-config-section=3Don|off enforce configuration= section migration (default=3Doff)\n", + " enforce-config-section=3Don|off enforce configuration= section migration (default=3Doff)\n" + " s390-squash-mcss=3Don|off controls support for squash= ing into default css (default=3Doff)\n", QEMU_ARCH_ALL) STEXI @item -machine [type=3D]@var{name}[,prop=3D@var{value}[,...]] @@ -81,6 +82,9 @@ controls whether DEA wrapping keys will be created to all= ow execution of DEA cryptographic functions. The default is on. @item nvdimm=3Don|off Enables or disables NVDIMM support. The default is off. +@item s390-squash-mcss=3Don|off +Enables or disables squashing subchannels into the default css. +The default is off. @end table ETEXI =20 diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 240b8a5c22..e27d9d874a 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -1256,6 +1256,16 @@ static inline void s390_crypto_reset(void) } } =20 +static inline bool s390_get_squash_mcss(void) +{ + if (object_property_get_bool(OBJECT(qdev_get_machine()), "s390-squash-= mcss", + NULL)) { + return true; + } + + return false; +} + /* machine check interruption code */ =20 /* subclasses */ --=20 2.13.0