From nobody Mon Nov 3 14:13:45 2025 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 1505921444665501.94734359498773; Wed, 20 Sep 2017 08:30:44 -0700 (PDT) Received: from localhost ([::1]:48883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dugxX-00089O-Mh for importer@patchew.org; Wed, 20 Sep 2017 11:30:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dufj9-0000NR-JX for qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dufj5-00045o-JV for qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:11:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dufj5-000452-AI for qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:11:43 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8KCqJF5069335 for ; Wed, 20 Sep 2017 08:53:14 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2d3pksrdfv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 20 Sep 2017 08:53:14 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Sep 2017 13:53:11 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 20 Sep 2017 13:53:08 +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 v8KCr7qq13959320; Wed, 20 Sep 2017 12:53:07 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A748E42042; Wed, 20 Sep 2017 13:49:18 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61B714203F; Wed, 20 Sep 2017 13:49:18 +0100 (BST) Received: from oc7330422307.ibm.com (unknown [9.152.224.107]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 20 Sep 2017 13:49:18 +0100 (BST) From: Christian Borntraeger To: Peter Maydell References: <1500028867-134709-1-git-send-email-borntraeger@de.ibm.com> <1500028867-134709-34-git-send-email-borntraeger@de.ibm.com> <5eb9a7bd-2761-bea1-738a-da7a6d3fbfcf@de.ibm.com> Date: Wed, 20 Sep 2017 14:53:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <5eb9a7bd-2761-bea1-738a-da7a6d3fbfcf@de.ibm.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 17092012-0040-0000-0000-000003DBAA9C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092012-0041-0000-0000-000025DCE007 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-20_04:, , 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-1707230000 definitions=main-1709200174 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] block ais migration for machines <= 2.9 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 , Yi Min Zhao , Michael Roth , Cornelia Huck , qemu-devel , Alexander Graf , Halil Pasic , Richard Henderson 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" Something like the following seems to do the tricks. Needs proper patch description, review, full test with different kernel ver= sions..... diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1c7af39..2ff32ba 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -212,6 +212,7 @@ static void ccw_machine_class_init(ObjectClass *oc, voi= d *data) s390mc->cpu_model_allowed =3D true; s390mc->css_migration_enabled =3D true; s390mc->gs_allowed =3D true; + s390mc->ais_allowed =3D true; mc->init =3D ccw_init; mc->reset =3D s390_machine_reset; mc->hot_add_cpu =3D s390_hot_add_cpu; @@ -305,6 +306,11 @@ bool gs_allowed(void) return false; } =20 +bool ais_allowed(void) +{ + return get_machine_class()->ais_allowed; +} + static char *machine_get_loadparm(Object *obj, Error **errp) { S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); @@ -533,6 +539,7 @@ static void ccw_machine_2_9_class_options(MachineClass = *mc) S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); =20 s390mc->gs_allowed =3D false; + s390mc->ais_allowed =3D false; ccw_machine_2_10_class_options(mc); SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9); s390mc->css_migration_enabled =3D false; diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 41a9d28..bba8660 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -41,6 +41,7 @@ typedef struct S390CcwMachineClass { bool cpu_model_allowed; bool css_migration_enabled; bool gs_allowed; + bool ais_allowed; } S390CcwMachineClass; =20 /* runtime-instrumentation allowed by the machine */ @@ -49,6 +50,8 @@ bool ri_allowed(void); bool cpu_model_allowed(void); /* guarded-storage allowed by the machine */ bool gs_allowed(void); +/* ais allowed by the machine */ +bool ais_allowed(void); =20 /** * Returns true if (vmstate based) migration of the channel subsystem diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index c4c5791..531d474 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -309,7 +309,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s) } =20 /* Try to enable AIS facility */ - kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0); + if (ais_allowed()) { + kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0); + } =20 qemu_mutex_init(&qemu_sigp_mutex);