[{"id":1775426,"web_url":"http://patchwork.ozlabs.org/comment/1775426/","msgid":"<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>","list_archive_url":null,"date":"2017-09-26T12:26:15","subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","submitter":{"id":70402,"url":"http://patchwork.ozlabs.org/api/people/70402/","name":"David Hildenbrand","email":"david@redhat.com"},"content":"On 22.09.2017 10:38, Christian Borntraeger wrote:\n> With newer kernels that do support the ais feature (4.13) a qemu 2.11\n> will not only enable the ais feature for the 2.11 machine, but also\n> for a <=2.10 compat machine. As this feature is not available in\n> QEMU <=2.9 (and QEMU 2.10.1), this guest will fail to migrate\n> back to an older qemu like 2.9 with:\n> \n> _snip_\n> error while loading state for instance 0x0 of device 's390-flic'\n> _snip_\n> \n> making the whole compat machine dis-functional. As a permanent fix, we\n> need to fence the ais feature for machines <= 2.10\n> \n> Due to ais being enabled on 2.10.0 (fixed in 2.10.1) this will prevent\n> migration of ais-enabled guests from 2.10.0 with\n> \n> _snip_\n> qemu-system-s390x: Failed to load s390-flic/ais:tmp\n> qemu-system-s390x: error while loading state for instance 0x0 of device 's390-flic'\n> qemu-system-s390x: load of migration failed: Function not implemented\n> _snip_\n> \n> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>\n> Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>\n> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> ---\n>  hw/intc/s390_flic_kvm.c            |  4 +++-\n>  hw/s390x/s390-virtio-ccw.c         | 10 ++++++++++\n>  include/hw/s390x/s390-virtio-ccw.h |  3 +++\n>  3 files changed, 16 insertions(+), 1 deletion(-)\n> \n> diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c\n> index a655567..2a94bfc 100644\n> --- a/hw/intc/s390_flic_kvm.c\n> +++ b/hw/intc/s390_flic_kvm.c\n> @@ -22,6 +22,7 @@\n>  #include \"hw/s390x/s390_flic.h\"\n>  #include \"hw/s390x/adapter.h\"\n>  #include \"hw/s390x/css.h\"\n> +#include \"hw/s390x/s390-virtio-ccw.h\"\n>  #include \"trace.h\"\n>  \n>  #define FLIC_SAVE_INITIAL_SIZE getpagesize()\n> @@ -559,7 +560,8 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)\n>                                              KVM_HAS_DEVICE_ATTR, test_attr);\n>      /* try enable the AIS facility */\n>      test_attr.group = KVM_DEV_FLIC_AISM_ALL;\n> -    if (!ioctl(flic_state->fd, KVM_HAS_DEVICE_ATTR, test_attr)) {\n> +    if (ais_allowed() &&\n> +        !ioctl(flic_state->fd, KVM_HAS_DEVICE_ATTR, test_attr)) {\n>              kvm_vm_enable_cap(kvm_state, KVM_CAP_S390_AIS, 0);\n>      }\n>  \n\nWondering if this is really necessary. Shouldn't the CPU model feature\nmake sure that migration works?","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=david@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1gG15fGzz9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 22:27:53 +1000 (AEST)","from localhost ([::1]:47352 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwoxr-0006JL-Ua\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 08:27:51 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56000)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <david@redhat.com>) id 1dwowS-0005hw-2n\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 08:26:24 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <david@redhat.com>) id 1dwowN-0001NW-5W\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 08:26:24 -0400","from mx1.redhat.com ([209.132.183.28]:36974)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <david@redhat.com>) id 1dwowM-0001NA-T5\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 08:26:19 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id EA3B281DE5;\n\tTue, 26 Sep 2017 12:26:17 +0000 (UTC)","from [10.36.117.152] (ovpn-117-152.ams2.redhat.com [10.36.117.152])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 0D3A2614DC;\n\tTue, 26 Sep 2017 12:26:15 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com EA3B281DE5","To":"Christian Borntraeger <borntraeger@de.ibm.com>,\n\tCornelia Huck <cohuck@redhat.com>","References":"<20170922083855.102341-1-borntraeger@de.ibm.com>\n\t<20170922083855.102341-4-borntraeger@de.ibm.com>","From":"David Hildenbrand <david@redhat.com>","Organization":"Red Hat GmbH","Message-ID":"<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>","Date":"Tue, 26 Sep 2017 14:26:15 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922083855.102341-4-borntraeger@de.ibm.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tTue, 26 Sep 2017 12:26:18 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,\n\t\"Jason J . Herne\" <jjherne@linux.vnet.ibm.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1775441,"web_url":"http://patchwork.ozlabs.org/comment/1775441/","msgid":"<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>","list_archive_url":null,"date":"2017-09-26T12:45:48","subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","submitter":{"id":590,"url":"http://patchwork.ozlabs.org/api/people/590/","name":"Christian Borntraeger","email":"borntraeger@de.ibm.com"},"content":"On 09/26/2017 02:26 PM, David Hildenbrand wrote:\n> On 22.09.2017 10:38, Christian Borntraeger wrote:\n>> With newer kernels that do support the ais feature (4.13) a qemu 2.11\n>> will not only enable the ais feature for the 2.11 machine, but also\n>> for a <=2.10 compat machine. As this feature is not available in\n>> QEMU <=2.9 (and QEMU 2.10.1), this guest will fail to migrate\n>> back to an older qemu like 2.9 with:\n>>\n>> _snip_\n>> error while loading state for instance 0x0 of device 's390-flic'\n>> _snip_\n>>\n>> making the whole compat machine dis-functional. As a permanent fix, we\n>> need to fence the ais feature for machines <= 2.10\n>>\n>> Due to ais being enabled on 2.10.0 (fixed in 2.10.1) this will prevent\n>> migration of ais-enabled guests from 2.10.0 with\n>>\n>> _snip_\n>> qemu-system-s390x: Failed to load s390-flic/ais:tmp\n>> qemu-system-s390x: error while loading state for instance 0x0 of device 's390-flic'\n>> qemu-system-s390x: load of migration failed: Function not implemented\n>> _snip_\n>>\n>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>\n>> Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>\n>> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n>> ---\n>>  hw/intc/s390_flic_kvm.c            |  4 +++-\n>>  hw/s390x/s390-virtio-ccw.c         | 10 ++++++++++\n>>  include/hw/s390x/s390-virtio-ccw.h |  3 +++\n>>  3 files changed, 16 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c\n>> index a655567..2a94bfc 100644\n>> --- a/hw/intc/s390_flic_kvm.c\n>> +++ b/hw/intc/s390_flic_kvm.c\n>> @@ -22,6 +22,7 @@\n>>  #include \"hw/s390x/s390_flic.h\"\n>>  #include \"hw/s390x/adapter.h\"\n>>  #include \"hw/s390x/css.h\"\n>> +#include \"hw/s390x/s390-virtio-ccw.h\"\n>>  #include \"trace.h\"\n>>  \n>>  #define FLIC_SAVE_INITIAL_SIZE getpagesize()\n>> @@ -559,7 +560,8 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)\n>>                                              KVM_HAS_DEVICE_ATTR, test_attr);\n>>      /* try enable the AIS facility */\n>>      test_attr.group = KVM_DEV_FLIC_AISM_ALL;\n>> -    if (!ioctl(flic_state->fd, KVM_HAS_DEVICE_ATTR, test_attr)) {\n>> +    if (ais_allowed() &&\n>> +        !ioctl(flic_state->fd, KVM_HAS_DEVICE_ATTR, test_attr)) {\n>>              kvm_vm_enable_cap(kvm_state, KVM_CAP_S390_AIS, 0);\n>>      }\n>>  \n> \n> Wondering if this is really necessary. Shouldn't the CPU model feature\n> make sure that migration works?\n\nolder QEMUs complain like when migrating a 2.9 machine to 2.9\n\nqemu-system-s390x: Failed to load s390-flic/ais:tmp\nqemu-system-s390x: error while loading state for instance 0x0 of device 's390-flic'\nqemu-system-s390x: load of migration failed: Function not implemented\n\ne.g. when using the host model.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1ggS2y4dz9tXP\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 22:46:27 +1000 (AEST)","from localhost ([::1]:47406 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwpFo-00053y-K4\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 08:46:24 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:59750)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1dwpFV-00053r-Sf\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 08:46:06 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1dwpFR-0005Sm-F6\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 08:46:05 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40690)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <borntraeger@de.ibm.com>)\n\tid 1dwpFR-0005SS-5e\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 08:46:01 -0400","from pps.filterd (m0098393.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8QCj1QI000617\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 08:45:54 -0400","from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d7junssvr-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 08:45:54 -0400","from localhost\n\tby e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <borntraeger@de.ibm.com>;\n\tTue, 26 Sep 2017 13:45:51 +0100","from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197)\n\tby e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tTue, 26 Sep 2017 13:45:49 +0100","from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com\n\t[9.149.105.61])\n\tby b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8QCjnbr21037106; Tue, 26 Sep 2017 12:45:49 GMT","from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 389A711C050;\n\tTue, 26 Sep 2017 13:41:43 +0100 (BST)","from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id EBD3311C04A;\n\tTue, 26 Sep 2017 13:41:42 +0100 (BST)","from oc7330422307.ibm.com (unknown [9.152.224.56])\n\tby d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tTue, 26 Sep 2017 13:41:42 +0100 (BST)"],"To":"David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>","References":"<20170922083855.102341-1-borntraeger@de.ibm.com>\n\t<20170922083855.102341-4-borntraeger@de.ibm.com>\n\t<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>","From":"Christian Borntraeger <borntraeger@de.ibm.com>","Date":"Tue, 26 Sep 2017 14:45:48 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.0","MIME-Version":"1.0","In-Reply-To":"<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17092612-0012-0000-0000-0000057C3A25","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092612-0013-0000-0000-000018F58723","Message-Id":"<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-26_05:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709260185","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.156.1","Subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,\n\t\"Jason J . Herne\" <jjherne@linux.vnet.ibm.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1775456,"web_url":"http://patchwork.ozlabs.org/comment/1775456/","msgid":"<49e66ee4-2df2-c310-93a7-e4ec91217c32@redhat.com>","list_archive_url":null,"date":"2017-09-26T13:00:09","subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","submitter":{"id":70402,"url":"http://patchwork.ozlabs.org/api/people/70402/","name":"David Hildenbrand","email":"david@redhat.com"},"content":"On 26.09.2017 14:45, Christian Borntraeger wrote:\n> \n> \n> On 09/26/2017 02:26 PM, David Hildenbrand wrote:\n>> On 22.09.2017 10:38, Christian Borntraeger wrote:\n>>> With newer kernels that do support the ais feature (4.13) a qemu 2.11\n>>> will not only enable the ais feature for the 2.11 machine, but also\n>>> for a <=2.10 compat machine. As this feature is not available in\n>>> QEMU <=2.9 (and QEMU 2.10.1), this guest will fail to migrate\n>>> back to an older qemu like 2.9 with:\n>>>\n>>> _snip_\n>>> error while loading state for instance 0x0 of device 's390-flic'\n>>> _snip_\n>>>\n>>> making the whole compat machine dis-functional. As a permanent fix, we\n>>> need to fence the ais feature for machines <= 2.10\n>>>\n>>> Due to ais being enabled on 2.10.0 (fixed in 2.10.1) this will prevent\n>>> migration of ais-enabled guests from 2.10.0 with\n>>>\n>>> _snip_\n>>> qemu-system-s390x: Failed to load s390-flic/ais:tmp\n>>> qemu-system-s390x: error while loading state for instance 0x0 of device 's390-flic'\n>>> qemu-system-s390x: load of migration failed: Function not implemented\n>>> _snip_\n>>>\n>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>\n>>> Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>\n>>> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>\n>>> ---\n>>>  hw/intc/s390_flic_kvm.c            |  4 +++-\n>>>  hw/s390x/s390-virtio-ccw.c         | 10 ++++++++++\n>>>  include/hw/s390x/s390-virtio-ccw.h |  3 +++\n>>>  3 files changed, 16 insertions(+), 1 deletion(-)\n>>>\n>>> diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c\n>>> index a655567..2a94bfc 100644\n>>> --- a/hw/intc/s390_flic_kvm.c\n>>> +++ b/hw/intc/s390_flic_kvm.c\n>>> @@ -22,6 +22,7 @@\n>>>  #include \"hw/s390x/s390_flic.h\"\n>>>  #include \"hw/s390x/adapter.h\"\n>>>  #include \"hw/s390x/css.h\"\n>>> +#include \"hw/s390x/s390-virtio-ccw.h\"\n>>>  #include \"trace.h\"\n>>>  \n>>>  #define FLIC_SAVE_INITIAL_SIZE getpagesize()\n>>> @@ -559,7 +560,8 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)\n>>>                                              KVM_HAS_DEVICE_ATTR, test_attr);\n>>>      /* try enable the AIS facility */\n>>>      test_attr.group = KVM_DEV_FLIC_AISM_ALL;\n>>> -    if (!ioctl(flic_state->fd, KVM_HAS_DEVICE_ATTR, test_attr)) {\n>>> +    if (ais_allowed() &&\n>>> +        !ioctl(flic_state->fd, KVM_HAS_DEVICE_ATTR, test_attr)) {\n>>>              kvm_vm_enable_cap(kvm_state, KVM_CAP_S390_AIS, 0);\n>>>      }\n>>>  \n>>\n>> Wondering if this is really necessary. Shouldn't the CPU model feature\n>> make sure that migration works?\n> \n> older QEMUs complain like when migrating a 2.9 machine to 2.9\n> \n> qemu-system-s390x: Failed to load s390-flic/ais:tmp\n> qemu-system-s390x: error while loading state for instance 0x0 of device 's390-flic'\n> qemu-system-s390x: load of migration failed: Function not implemented\n> \n> e.g. when using the host model.\n> \n\nWonder when we can finally let go of these hacks. The host cpu model is\nnot migration safe, therefore such things are expected to not work. Just\nthink about trying to migrate from a kernel without AIS support to a\nkernel with AIS support. It is broken.\n\nAIS is just one feature that actually tells you that you are currently\ndoing something evil. Other CPU features you lose on the way simply\ndon't result in an error, but still migration could break silently\nafterwards, when the guest assumes it has certain CPU features.\n\n\nThe main problem is that we have machines <= 2.7 that had no CPU model\nsupport. For these machines, migration should work just fine, as\n\ts390_has_feat(S390_FEAT_ADAPTER_INT_SUPPRESSION)\nwill always return false.\nHowever, the guest will be presented the AIS bit, as soon as the\ncapability is enabled (as we then don't manually set the stfle bitmap\nfrom QEMU), which is bad.\n\nSo my point would be: don't turn on these new facilities if the cpu\nmodel is not allowed (<=2.7), but don't add ais_allowed() compat\nhandling for any newer machines. If they use the host model, they have\nto assume that migration can break.\n\nI think using cpu_model_allowed() would be just fine to be used instead\nof ais_allowed().","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=david@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1h0c68lkz9tXq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 23:01:20 +1000 (AEST)","from localhost ([::1]:47451 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwpUE-0000hH-V6\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 09:01:19 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36221)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <david@redhat.com>) id 1dwpTR-0000fU-D2\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:00:30 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <david@redhat.com>) id 1dwpTH-0004BG-Na\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:00:29 -0400","from mx1.redhat.com ([209.132.183.28]:49962)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <david@redhat.com>) id 1dwpTH-0004As-E3\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:00:19 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id B9D73461F9;\n\tTue, 26 Sep 2017 13:00:17 +0000 (UTC)","from [10.36.117.152] (ovpn-117-152.ams2.redhat.com [10.36.117.152])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 25BEA784AD;\n\tTue, 26 Sep 2017 13:00:09 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B9D73461F9","To":"Christian Borntraeger <borntraeger@de.ibm.com>,\n\tCornelia Huck <cohuck@redhat.com>","References":"<20170922083855.102341-1-borntraeger@de.ibm.com>\n\t<20170922083855.102341-4-borntraeger@de.ibm.com>\n\t<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>\n\t<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>","From":"David Hildenbrand <david@redhat.com>","Organization":"Red Hat GmbH","Message-ID":"<49e66ee4-2df2-c310-93a7-e4ec91217c32@redhat.com>","Date":"Tue, 26 Sep 2017 15:00:09 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tTue, 26 Sep 2017 13:00:17 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,\n\t\"Jason J . Herne\" <jjherne@linux.vnet.ibm.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1775503,"web_url":"http://patchwork.ozlabs.org/comment/1775503/","msgid":"<cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>","list_archive_url":null,"date":"2017-09-26T13:32:41","subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","submitter":{"id":590,"url":"http://patchwork.ozlabs.org/api/people/590/","name":"Christian Borntraeger","email":"borntraeger@de.ibm.com"},"content":"On 09/26/2017 03:00 PM, David Hildenbrand wrote:\n\n> \n> Wonder when we can finally let go of these hacks. The host cpu model is\n> not migration safe, therefore such things are expected to not work. Just\n> think about trying to migrate from a kernel without AIS support to a\n> kernel with AIS support. It is broken.\n> \n> AIS is just one feature that actually tells you that you are currently\n> doing something evil. Other CPU features you lose on the way simply\n> don't result in an error, but still migration could break silently\n> afterwards, when the guest assumes it has certain CPU features.\n> \n> \n> The main problem is that we have machines <= 2.7 that had no CPU model\n> support. For these machines, migration should work just fine, as\n> \ts390_has_feat(S390_FEAT_ADAPTER_INT_SUPPRESSION)\n> will always return false.\n> However, the guest will be presented the AIS bit, as soon as the\n> capability is enabled (as we then don't manually set the stfle bitmap\n> from QEMU), which is bad.\n> \n> So my point would be: don't turn on these new facilities if the cpu\n> model is not allowed (<=2.7), but don't add ais_allowed() compat\n> handling for any newer machines. If they use the host model, they have\n> to assume that migration can break.\n> \n> I think using cpu_model_allowed() would be just fine to be used instead\n> of ais_allowed().\n\nLet me thing about that. I will send 2 (with fs->ais_supported gone) and 3\nand we can then decide if we only want to apply 2 or both.\n\nNow: regarding your -cpu host comment:\n\nI checked all the migration stuff now with -cpu z13 and it seems that\nmigration is now broken for qemu 2.10->qemu 2.11 when using the s390-ccw-virtio-2.9\nmachine due to the PCI fencing from Conny.\n\nqemu-system-s390x: Unknown savevm section or instance 'PCIBUS' 0\nqemu-system-s390x: load of migration failed: Invalid argument","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1hjz2zgJz9tXq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 23:33:43 +1000 (AEST)","from localhost ([::1]:47577 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwpzZ-0003d5-8V\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 09:33:41 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47823)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1dwpyp-0003a0-5v\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:33:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1dwpyl-0004up-V2\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:32:55 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42257\n\thelo=mx0a-001b2d01.pphosted.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <borntraeger@de.ibm.com>)\n\tid 1dwpyl-0004uX-Oc\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:32:51 -0400","from pps.filterd (m0098416.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8QDTbAm052061\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 09:32:48 -0400","from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2d7p99fqw8-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 09:32:47 -0400","from localhost\n\tby e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <borntraeger@de.ibm.com>;\n\tTue, 26 Sep 2017 14:32:45 +0100","from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198)\n\tby e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tTue, 26 Sep 2017 14:32:42 +0100","from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com\n\t[9.149.105.58])\n\tby b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8QDWgru13631704; Tue, 26 Sep 2017 13:32:42 GMT","from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 8418F4C04A;\n\tTue, 26 Sep 2017 14:28:58 +0100 (BST)","from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 3E1CC4C040;\n\tTue, 26 Sep 2017 14:28:58 +0100 (BST)","from oc7330422307.ibm.com (unknown [9.152.224.56])\n\tby d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tTue, 26 Sep 2017 14:28:58 +0100 (BST)"],"To":"David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>","References":"<20170922083855.102341-1-borntraeger@de.ibm.com>\n\t<20170922083855.102341-4-borntraeger@de.ibm.com>\n\t<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>\n\t<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>\n\t<49e66ee4-2df2-c310-93a7-e4ec91217c32@redhat.com>","From":"Christian Borntraeger <borntraeger@de.ibm.com>","Date":"Tue, 26 Sep 2017 15:32:41 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.0","MIME-Version":"1.0","In-Reply-To":"<49e66ee4-2df2-c310-93a7-e4ec91217c32@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17092613-0016-0000-0000-000004F03AD9","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092613-0017-0000-0000-0000282A87AD","Message-Id":"<cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-26_05:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709260196","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.158.5","Subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,\n\t\"Jason J . Herne\" <jjherne@linux.vnet.ibm.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1775528,"web_url":"http://patchwork.ozlabs.org/comment/1775528/","msgid":"<20170926154356.638a0fcb.cohuck@redhat.com>","list_archive_url":null,"date":"2017-09-26T13:43:56","subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","submitter":{"id":71914,"url":"http://patchwork.ozlabs.org/api/people/71914/","name":"Cornelia Huck","email":"cohuck@redhat.com"},"content":"On Tue, 26 Sep 2017 15:32:41 +0200\nChristian Borntraeger <borntraeger@de.ibm.com> wrote:\n\n> I checked all the migration stuff now with -cpu z13 and it seems that\n> migration is now broken for qemu 2.10->qemu 2.11 when using the s390-ccw-virtio-2.9\n> machine due to the PCI fencing from Conny.\n> \n> qemu-system-s390x: Unknown savevm section or instance 'PCIBUS' 0\n> qemu-system-s390x: load of migration failed: Invalid argument\n\nThat's unfortunate... let me look into that.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=cohuck@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1j0d0Xl9z9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 23:46:25 +1000 (AEST)","from localhost ([::1]:47638 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwqBr-0004T4-71\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 09:46:23 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51353)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dwq9h-0002zO-9P\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:44:10 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dwq9b-0003zc-H6\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:44:09 -0400","from mx1.redhat.com ([209.132.183.28]:52120)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <cohuck@redhat.com>) id 1dwq9b-0003zK-B3\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:44:03 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 50C2FC0587F5;\n\tTue, 26 Sep 2017 13:44:02 +0000 (UTC)","from gondolin (dhcp-192-215.str.redhat.com [10.33.192.215])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id C60456F95F;\n\tTue, 26 Sep 2017 13:43:58 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 50C2FC0587F5","Date":"Tue, 26 Sep 2017 15:43:56 +0200","From":"Cornelia Huck <cohuck@redhat.com>","To":"Christian Borntraeger <borntraeger@de.ibm.com>","Message-ID":"<20170926154356.638a0fcb.cohuck@redhat.com>","In-Reply-To":"<cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>","References":"<20170922083855.102341-1-borntraeger@de.ibm.com>\n\t<20170922083855.102341-4-borntraeger@de.ibm.com>\n\t<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>\n\t<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>\n\t<49e66ee4-2df2-c310-93a7-e4ec91217c32@redhat.com>\n\t<cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>","Organization":"Red Hat GmbH","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tTue, 26 Sep 2017 13:44:02 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tDavid Hildenbrand <david@redhat.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,\n\t\"Jason J . Herne\" <jjherne@linux.vnet.ibm.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1775531,"web_url":"http://patchwork.ozlabs.org/comment/1775531/","msgid":"<932ad4e2-a10c-77fc-fcb7-5dbbed0d2c7c@de.ibm.com>","list_archive_url":null,"date":"2017-09-26T13:45:36","subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","submitter":{"id":590,"url":"http://patchwork.ozlabs.org/api/people/590/","name":"Christian Borntraeger","email":"borntraeger@de.ibm.com"},"content":"On 09/26/2017 03:32 PM, Christian Borntraeger wrote:\n> \n> \n> On 09/26/2017 03:00 PM, David Hildenbrand wrote:\n> \n>>\n>> Wonder when we can finally let go of these hacks. The host cpu model is\n>> not migration safe, therefore such things are expected to not work. Just\n>> think about trying to migrate from a kernel without AIS support to a\n>> kernel with AIS support. It is broken.\n>>\n>> AIS is just one feature that actually tells you that you are currently\n>> doing something evil. Other CPU features you lose on the way simply\n>> don't result in an error, but still migration could break silently\n>> afterwards, when the guest assumes it has certain CPU features.\n>>\n>>\n>> The main problem is that we have machines <= 2.7 that had no CPU model\n>> support. For these machines, migration should work just fine, as\n>> \ts390_has_feat(S390_FEAT_ADAPTER_INT_SUPPRESSION)\n>> will always return false.\n>> However, the guest will be presented the AIS bit, as soon as the\n>> capability is enabled (as we then don't manually set the stfle bitmap\n>> from QEMU), which is bad.\n>>\n>> So my point would be: don't turn on these new facilities if the cpu\n>> model is not allowed (<=2.7), but don't add ais_allowed() compat\n>> handling for any newer machines. If they use the host model, they have\n>> to assume that migration can break.\n>>\n>> I think using cpu_model_allowed() would be just fine to be used instead\n>> of ais_allowed().\n> \n> Let me thing about that. I will send 2 (with fs->ais_supported gone) and 3\n> and we can then decide if we only want to apply 2 or both.\n> \n> Now: regarding your -cpu host comment:\n> \n> I checked all the migration stuff now with -cpu z13 and it seems that\n> migration is now broken for qemu 2.10->qemu 2.11 when using the s390-ccw-virtio-2.9\n> machine due to the PCI fencing from Conny.\n> \n> qemu-system-s390x: Unknown savevm section or instance 'PCIBUS' 0\n> qemu-system-s390x: load of migration failed: Invalid argument\n> \n\nA very dirty hack like this seems to do the trick\n\ndiff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c\nindex 41b770a..3d49044 100644\n--- a/hw/s390x/s390-virtio-ccw.c\n+++ b/hw/s390x/s390-virtio-ccw.c\n@@ -294,7 +294,7 @@ static void ccw_init(MachineState *machine)\n                       machine->initrd_filename, \"s390-ccw.img\",\n                       \"s390-netboot.img\", true);\n \n-    if (s390_has_feat(S390_FEAT_ZPCI)) {\n+    if (s390_has_feat(S390_FEAT_ZPCI) || !ais_allowed()) {\n         DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);\n         object_property_add_child(qdev_get_machine(),\n                                   TYPE_S390_PCI_HOST_BRIDGE,\n\nBasic idea is that for compat_machines <= 2.10 we enable the PCI host bridge\n(and I abused ais_allowed to check for <= 2.10). \nNot sure what to do for for CONFIG_PCI = off case, but the normal case is\nbroken right now.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1j226QwYz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 23:47:38 +1000 (AEST)","from localhost ([::1]:47641 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwqD2-0005DZ-W5\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 09:47:37 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52218)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1dwqCS-00058I-Mg\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:47:06 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1dwqCN-0005aY-NJ\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:47:00 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34476\n\thelo=mx0a-001b2d01.pphosted.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <borntraeger@de.ibm.com>)\n\tid 1dwqCN-0005ZU-Gr\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:46:55 -0400","from pps.filterd (m0098413.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8QDkRep019109\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 09:46:52 -0400","from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2d7p8v8uqs-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Tue, 26 Sep 2017 09:46:43 -0400","from localhost\n\tby e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <borntraeger@de.ibm.com>;\n\tTue, 26 Sep 2017 14:45:40 +0100","from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196)\n\tby e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tTue, 26 Sep 2017 14:45:37 +0100","from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com\n\t[9.149.105.232])\n\tby b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8QDjbai26607858; Tue, 26 Sep 2017 13:45:37 GMT","from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 1803252041;\n\tTue, 26 Sep 2017 13:40:27 +0100 (BST)","from oc7330422307.ibm.com (unknown [9.152.224.56])\n\tby d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C504D5203F; \n\tTue, 26 Sep 2017 13:40:26 +0100 (BST)"],"From":"Christian Borntraeger <borntraeger@de.ibm.com>","To":"David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>","References":"<20170922083855.102341-1-borntraeger@de.ibm.com>\n\t<20170922083855.102341-4-borntraeger@de.ibm.com>\n\t<a19a2b4f-af68-12d1-ee34-fbd174785c6f@redhat.com>\n\t<fc891aa4-d6f1-7348-3de7-cfa06ffa20c8@de.ibm.com>\n\t<49e66ee4-2df2-c310-93a7-e4ec91217c32@redhat.com>\n\t<cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>","Date":"Tue, 26 Sep 2017 15:45:36 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.0","MIME-Version":"1.0","In-Reply-To":"<cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17092613-0012-0000-0000-0000057C41FE","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092613-0013-0000-0000-000018F58F41","Message-Id":"<932ad4e2-a10c-77fc-fcb7-5dbbed0d2c7c@de.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-26_05:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709260200","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.158.5","Subject":"Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat\n\tmachines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,\n\t\"Jason J . Herne\" <jjherne@linux.vnet.ibm.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]