[{"id":1772028,"web_url":"http://patchwork.ozlabs.org/comment/1772028/","msgid":"<20170920160417.GB3132@work-vm>","list_archive_url":null,"date":"2017-09-20T16:04:18","subject":"Re: [Qemu-devel] block ais migration for machines <= 2.9","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Christian Borntraeger (borntraeger@de.ibm.com) wrote:\n> Something like the following seems to do the tricks.\n> Needs proper patch description, review, full test with different kernel versions.....\n\nWithout knowing anything about 'ais' - will this break migration from\n2.10 -> 2.10+this fix?\n\nDave\n\n> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c\n> index 1c7af39..2ff32ba 100644\n> --- a/hw/s390x/s390-virtio-ccw.c\n> +++ b/hw/s390x/s390-virtio-ccw.c\n> @@ -212,6 +212,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)\n>      s390mc->cpu_model_allowed = true;\n>      s390mc->css_migration_enabled = true;\n>      s390mc->gs_allowed = true;\n> +    s390mc->ais_allowed = true;\n>      mc->init = ccw_init;\n>      mc->reset = s390_machine_reset;\n>      mc->hot_add_cpu = s390_hot_add_cpu;\n> @@ -305,6 +306,11 @@ bool gs_allowed(void)\n>      return false;\n>  }\n>  \n> +bool ais_allowed(void)\n> +{\n> +    return get_machine_class()->ais_allowed;\n> +}\n> +\n>  static char *machine_get_loadparm(Object *obj, Error **errp)\n>  {\n>      S390CcwMachineState *ms = S390_CCW_MACHINE(obj);\n> @@ -533,6 +539,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc)\n>      S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);\n>  \n>      s390mc->gs_allowed = false;\n> +    s390mc->ais_allowed = false;\n>      ccw_machine_2_10_class_options(mc);\n>      SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);\n>      s390mc->css_migration_enabled = false;\n> diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h\n> index 41a9d28..bba8660 100644\n> --- a/include/hw/s390x/s390-virtio-ccw.h\n> +++ b/include/hw/s390x/s390-virtio-ccw.h\n> @@ -41,6 +41,7 @@ typedef struct S390CcwMachineClass {\n>      bool cpu_model_allowed;\n>      bool css_migration_enabled;\n>      bool gs_allowed;\n> +    bool ais_allowed;\n>  } S390CcwMachineClass;\n>  \n>  /* runtime-instrumentation allowed by the machine */\n> @@ -49,6 +50,8 @@ bool ri_allowed(void);\n>  bool cpu_model_allowed(void);\n>  /* guarded-storage allowed by the machine */\n>  bool gs_allowed(void);\n> +/* ais allowed by the machine */\n> +bool ais_allowed(void);\n>  \n>  /**\n>   * Returns true if (vmstate based) migration of the channel subsystem\n> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c\n> index c4c5791..531d474 100644\n> --- a/target/s390x/kvm.c\n> +++ b/target/s390x/kvm.c\n> @@ -309,7 +309,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>      }\n>  \n>      /* Try to enable AIS facility */\n> -    kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n> +    if (ais_allowed()) {\n> +       kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n> +    }\n>  \n>      qemu_mutex_init(&qemu_sigp_mutex);\n> \n> \n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","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=dgilbert@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 3xy4X70YfHz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 02:12:38 +1000 (AEST)","from localhost ([::1]:49374 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 1duhc4-00014r-UJ\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 12:12:36 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47898)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1duhUC-0003EK-Py\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 12:04:32 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1duhU8-0005Tz-BQ\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 12:04:28 -0400","from mx1.redhat.com ([209.132.183.28]:42932)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>) id 1duhU7-0005SM-T3\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 12:04:24 -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 B710281DF3;\n\tWed, 20 Sep 2017 16:04:22 +0000 (UTC)","from work-vm (ovpn-117-183.ams2.redhat.com [10.36.117.183])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 97A486060A;\n\tWed, 20 Sep 2017 16:04:20 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B710281DF3","Date":"Wed, 20 Sep 2017 17:04:18 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Christian Borntraeger <borntraeger@de.ibm.com>","Message-ID":"<20170920160417.GB3132@work-vm>","References":"<1500028867-134709-1-git-send-email-borntraeger@de.ibm.com>\n\t<1500028867-134709-34-git-send-email-borntraeger@de.ibm.com>\n\t<5eb9a7bd-2761-bea1-738a-da7a6d3fbfcf@de.ibm.com>\n\t<f6da1ec7-4845-fe78-b6b8-29a71d481458@de.ibm.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<f6da1ec7-4845-fe78-b6b8-29a71d481458@de.ibm.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","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\tWed, 20 Sep 2017 16:04:22 +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] block ais migration for machines <= 2.9","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":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tCornelia Huck <cohuck@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,\n\tMichael Roth <mdroth@linux.vnet.ibm.com>,\n\tAlexander Graf <agraf@suse.de>, Halil Pasic <pasic@linux.vnet.ibm.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":1772040,"web_url":"http://patchwork.ozlabs.org/comment/1772040/","msgid":"<150592444730.27.1338735295153306404@d650bbe78fe3>","list_archive_url":null,"date":"2017-09-20T16:20:47","subject":"Re: [Qemu-devel] block ais migration for machines <= 2.9","submitter":{"id":69632,"url":"http://patchwork.ozlabs.org/api/people/69632/","name":null,"email":"no-reply@patchew.org"},"content":"Hi,\n\nThis series seems to have some coding style problems. See output below for\nmore information:\n\nSubject: [Qemu-devel] block ais migration for machines <= 2.9\nMessage-id: f6da1ec7-4845-fe78-b6b8-29a71d481458@de.ibm.com\nType: series\n\n=== TEST SCRIPT BEGIN ===\n#!/bin/bash\n\nBASE=base\nn=1\ntotal=$(git log --oneline $BASE.. | wc -l)\nfailed=0\n\ngit config --local diff.renamelimit 0\ngit config --local diff.renames True\n\ncommits=\"$(git log --format=%H --reverse $BASE..)\"\nfor c in $commits; do\n    echo \"Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)...\"\n    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then\n        failed=1\n        echo\n    fi\n    n=$((n+1))\ndone\n\nexit $failed\n=== TEST SCRIPT END ===\n\nUpdating 3c8cf5a9c21ff8782164d1def7f44bd888713384\nSwitched to a new branch 'test'\nc0b3083c71 block ais migration for machines <= 2.9\n\n=== OUTPUT BEGIN ===\nChecking PATCH 1/1: block ais migration for machines <= 2.9...\nERROR: suspect code indent for conditional statements (4, 7)\n#73: FILE: target/s390x/kvm.c:315:\n+    if (ais_allowed()) {\n+       kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n\nERROR: Missing Signed-off-by: line(s)\n\ntotal: 2 errors, 0 warnings, 50 lines checked\n\nYour patch has style problems, please review.  If any of these errors\nare false positives report them to the maintainer, see\nCHECKPATCH in MAINTAINERS.\n\n=== OUTPUT END ===\n\nTest command exited with code: 1\n\n\n---\nEmail generated automatically by Patchew [http://patchew.org/].\nPlease send your feedback to patchew-devel@freelists.org","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 3xy4kt1c7vz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 02:21:58 +1000 (AEST)","from localhost ([::1]:49488 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 1duhl6-0000Bg-1H\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 12:21:56 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42706)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <no-reply@patchew.org>) id 1duhkJ-00008k-1z\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 12:21:09 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <no-reply@patchew.org>) id 1duhkF-00031i-PG\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 12:21:07 -0400","from sender-of-o52.zoho.com ([135.84.80.217]:21485)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <no-reply@patchew.org>)\n\tid 1duhkF-00030w-Hs\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 12:21:03 -0400","from [172.17.0.2] (23.253.156.214 [23.253.156.214]) by\n\tmx.zohomail.com with SMTPS id 1505924447959607.8284716586323;\n\tWed, 20 Sep 2017 09:20:47 -0700 (PDT)"],"Resent-Date":"Wed, 20 Sep 2017 12:21:07 -0400","Resent-Message-Id":"<E1duhkF-00031i-PG@eggs.gnu.org>","In-Reply-To":"<f6da1ec7-4845-fe78-b6b8-29a71d481458@de.ibm.com>","Message-ID":"<150592444730.27.1338735295153306404@d650bbe78fe3>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Resent-From":"","From":"no-reply@patchew.org","To":"borntraeger@de.ibm.com","Date":"Wed, 20 Sep 2017 09:20:47 -0700 (PDT)","X-ZohoMailClient":"External","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [fuzzy]","X-Received-From":"135.84.80.217","Subject":"Re: [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":"<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>","Reply-To":"qemu-devel@nongnu.org","Cc":"peter.maydell@linaro.org, thuth@redhat.com, zyimin@linux.vnet.ibm.com,\n\tfamz@redhat.com, cohuck@redhat.com, mdroth@linux.vnet.ibm.com,\n\tqemu-devel@nongnu.org, agraf@suse.de, pasic@linux.vnet.ibm.com,\n\trth@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":1772394,"web_url":"http://patchwork.ozlabs.org/comment/1772394/","msgid":"<f0fcf8d6-e341-c53d-1198-3457ec2a007a@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-21T03:40:47","subject":"Re: [Qemu-devel] block ais migration for machines <= 2.9","submitter":{"id":66807,"url":"http://patchwork.ozlabs.org/api/people/66807/","name":"Yi Min Zhao","email":"zyimin@linux.vnet.ibm.com"},"content":"在 2017/9/21 上午12:04, Dr. David Alan Gilbert 写道:\n> * Christian Borntraeger (borntraeger@de.ibm.com) wrote:\n>> Something like the following seems to do the tricks.\n>> Needs proper patch description, review, full test with different kernel versions.....\n> Without knowing anything about 'ais' - will this break migration from\n> 2.10 -> 2.10+this fix?\nI think it doesn't break. I will have a try later.\n>\n> Dave\n>\n>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c\n>> index 1c7af39..2ff32ba 100644\n>> --- a/hw/s390x/s390-virtio-ccw.c\n>> +++ b/hw/s390x/s390-virtio-ccw.c\n>> @@ -212,6 +212,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)\n>>       s390mc->cpu_model_allowed = true;\n>>       s390mc->css_migration_enabled = true;\n>>       s390mc->gs_allowed = true;\n>> +    s390mc->ais_allowed = true;\n>>       mc->init = ccw_init;\n>>       mc->reset = s390_machine_reset;\n>>       mc->hot_add_cpu = s390_hot_add_cpu;\n>> @@ -305,6 +306,11 @@ bool gs_allowed(void)\n>>       return false;\n>>   }\n>>   \n>> +bool ais_allowed(void)\n>> +{\n>> +    return get_machine_class()->ais_allowed;\n>> +}\n>> +\n>>   static char *machine_get_loadparm(Object *obj, Error **errp)\n>>   {\n>>       S390CcwMachineState *ms = S390_CCW_MACHINE(obj);\n>> @@ -533,6 +539,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc)\n>>       S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);\n>>   \n>>       s390mc->gs_allowed = false;\n>> +    s390mc->ais_allowed = false;\n>>       ccw_machine_2_10_class_options(mc);\n>>       SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);\n>>       s390mc->css_migration_enabled = false;\n>> diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h\n>> index 41a9d28..bba8660 100644\n>> --- a/include/hw/s390x/s390-virtio-ccw.h\n>> +++ b/include/hw/s390x/s390-virtio-ccw.h\n>> @@ -41,6 +41,7 @@ typedef struct S390CcwMachineClass {\n>>       bool cpu_model_allowed;\n>>       bool css_migration_enabled;\n>>       bool gs_allowed;\n>> +    bool ais_allowed;\n>>   } S390CcwMachineClass;\n>>   \n>>   /* runtime-instrumentation allowed by the machine */\n>> @@ -49,6 +50,8 @@ bool ri_allowed(void);\n>>   bool cpu_model_allowed(void);\n>>   /* guarded-storage allowed by the machine */\n>>   bool gs_allowed(void);\n>> +/* ais allowed by the machine */\n>> +bool ais_allowed(void);\n>>   \n>>   /**\n>>    * Returns true if (vmstate based) migration of the channel subsystem\n>> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c\n>> index c4c5791..531d474 100644\n>> --- a/target/s390x/kvm.c\n>> +++ b/target/s390x/kvm.c\n>> @@ -309,7 +309,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>>       }\n>>   \n>>       /* Try to enable AIS facility */\n>> -    kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n>> +    if (ais_allowed()) {\n>> +       kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n>> +    }\n>>   \n>>       qemu_mutex_init(&qemu_sigp_mutex);\n>>\n>>\n> --\n> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK\n>\n>","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 3xyMq56HMzz9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 13:41:37 +1000 (AEST)","from localhost ([::1]:51619 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 1dusMp-0005U0-Vg\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 23:41:36 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36687)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <zyimin@linux.vnet.ibm.com>) id 1dusMF-0005T4-M5\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 23:41:01 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <zyimin@linux.vnet.ibm.com>) id 1dusMC-0001b7-J4\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 23:40:59 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49652\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 <zyimin@linux.vnet.ibm.com>)\n\tid 1dusMC-0001ZM-DY\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 23:40:56 -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\tv8L3dtPk121834\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 23:40:54 -0400","from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2d3w1n3cbs-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 23:40:54 -0400","from localhost\n\tby e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <zyimin@linux.vnet.ibm.com>;\n\tWed, 20 Sep 2017 21:40:53 -0600","from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15)\n\tby e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 20 Sep 2017 21:40:50 -0600","from b03ledav001.gho.boulder.ibm.com\n\t(b03ledav001.gho.boulder.ibm.com [9.17.130.232])\n\tby b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8L3eoHo3932638\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 20:40:50 -0700","from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 1EFDF6E035\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 21:40:50 -0600 (MDT)","from zyimindembp.cn.ibm.com (unknown [9.115.193.63])\n\tby b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id A47CA6E038\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 21:40:49 -0600 (MDT)"],"To":"qemu-devel@nongnu.org","References":"<1500028867-134709-1-git-send-email-borntraeger@de.ibm.com>\n\t<1500028867-134709-34-git-send-email-borntraeger@de.ibm.com>\n\t<5eb9a7bd-2761-bea1-738a-da7a6d3fbfcf@de.ibm.com>\n\t<f6da1ec7-4845-fe78-b6b8-29a71d481458@de.ibm.com>\n\t<20170920160417.GB3132@work-vm>","From":"Yi Min Zhao <zyimin@linux.vnet.ibm.com>","Date":"Thu, 21 Sep 2017 11:40:47 +0800","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0)\n\tGecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920160417.GB3132@work-vm>","Content-Type":"text/plain; charset=gbk; format=flowed","X-TM-AS-GCONF":"00","x-cbid":"17092103-8235-0000-0000-00000C4D1A86","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007770; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000230; SDB=6.00920048; UDB=6.00462279;\n\tIPR=6.00700270; \n\tBA=6.00005599; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017230;\n\tXFM=3.00000015; UTC=2017-09-21 03:40:52","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092103-8236-0000-0000-00003DBBD647","Message-Id":"<f0fcf8d6-e341-c53d-1198-3457ec2a007a@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-21_01:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\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-1709210050","Content-Transfer-Encoding":"quoted-printable","X-MIME-Autoconverted":"from 8bit to quoted-printable by\n\tmx0b-001b2d01.pphosted.com id v8L3dtPk121834","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] block ais migration for machines <= 2.9","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>","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":1772500,"web_url":"http://patchwork.ozlabs.org/comment/1772500/","msgid":"<f7a2284d-7ac5-001c-ad36-1894ec97a3e9@de.ibm.com>","list_archive_url":null,"date":"2017-09-21T07:41:52","subject":"Re: [Qemu-devel] block ais migration for machines <= 2.9","submitter":{"id":590,"url":"http://patchwork.ozlabs.org/api/people/590/","name":"Christian Borntraeger","email":"borntraeger@de.ibm.com"},"content":"On 09/20/2017 06:04 PM, Dr. David Alan Gilbert wrote:\n> * Christian Borntraeger (borntraeger@de.ibm.com) wrote:\n>> Something like the following seems to do the tricks.\n>> Needs proper patch description, review, full test with different kernel versions.....\n> \n> Without knowing anything about 'ais' - will this break migration from\n> 2.10 -> 2.10+this fix?\n\nThe problem only happens if the source system has kernel >= 4.12 thats why it\nsomehow missed my testing during the 2.10 freeze.\n\nNow: \"2.10\" -> \"2.10+this fix\" will works fine for the 2.10 machine, but it does \nfail for the combination of qemu-2.10 with an older machine type like 2.8 and 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\nWe do run into an explicit check from hw/intc/s390_flic_kvm.c (see the return ENOSYS)\n\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 443) static int kvm_flic_ais_post_load(void *opaque, int version_id)\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 444) {\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 445)     KVMS390FLICStateMigTmp *tmp = opaque;\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 446)     KVMS390FLICState *flic = tmp->parent;\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 447)     struct kvm_s390_ais_all ais = {\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 448)         .simm = tmp->simm,\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 449)         .nimm = tmp->nimm,\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 450)     };\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 451)     struct kvm_device_attr attr = {\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 452)         .group = KVM_DEV_FLIC_AISM_ALL,\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 453)         .addr = (uint64_t)&ais,\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 454)     };\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 455) \ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 456)     /* This can happen when the user mis-configures its guests in an\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 457)      * incompatible fashion or without a CPU model. For example using\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 458)      * qemu with -cpu host (which is not migration safe) and do a\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 459)      * migration from a host that has AIS to a host that has no AIS.\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 460)      * In that case the target system will reject the migration here.\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 461)      */\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 462)     if (!ais_needed(flic)) {\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 463)         return -ENOSYS;\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 464)     }\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 465) \ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 466)     return ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr) ? -errno : 0;\ne7be8d49 (Yi Min Zhao       2017-05-16 18:58:44 +0800 467) }\n\nSo I think if we fix this we should definitely add this to 2.10.1 \nto minimize the affected qemu versions. Not fixing it will break\nmigrations from 4.12/2.10 to older versions. \n \n> \n> Dave\n> \n>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c\n>> index 1c7af39..2ff32ba 100644\n>> --- a/hw/s390x/s390-virtio-ccw.c\n>> +++ b/hw/s390x/s390-virtio-ccw.c\n>> @@ -212,6 +212,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)\n>>      s390mc->cpu_model_allowed = true;\n>>      s390mc->css_migration_enabled = true;\n>>      s390mc->gs_allowed = true;\n>> +    s390mc->ais_allowed = true;\n>>      mc->init = ccw_init;\n>>      mc->reset = s390_machine_reset;\n>>      mc->hot_add_cpu = s390_hot_add_cpu;\n>> @@ -305,6 +306,11 @@ bool gs_allowed(void)\n>>      return false;\n>>  }\n>>  \n>> +bool ais_allowed(void)\n>> +{\n>> +    return get_machine_class()->ais_allowed;\n>> +}\n>> +\n>>  static char *machine_get_loadparm(Object *obj, Error **errp)\n>>  {\n>>      S390CcwMachineState *ms = S390_CCW_MACHINE(obj);\n>> @@ -533,6 +539,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc)\n>>      S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);\n>>  \n>>      s390mc->gs_allowed = false;\n>> +    s390mc->ais_allowed = false;\n>>      ccw_machine_2_10_class_options(mc);\n>>      SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);\n>>      s390mc->css_migration_enabled = false;\n>> diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h\n>> index 41a9d28..bba8660 100644\n>> --- a/include/hw/s390x/s390-virtio-ccw.h\n>> +++ b/include/hw/s390x/s390-virtio-ccw.h\n>> @@ -41,6 +41,7 @@ typedef struct S390CcwMachineClass {\n>>      bool cpu_model_allowed;\n>>      bool css_migration_enabled;\n>>      bool gs_allowed;\n>> +    bool ais_allowed;\n>>  } S390CcwMachineClass;\n>>  \n>>  /* runtime-instrumentation allowed by the machine */\n>> @@ -49,6 +50,8 @@ bool ri_allowed(void);\n>>  bool cpu_model_allowed(void);\n>>  /* guarded-storage allowed by the machine */\n>>  bool gs_allowed(void);\n>> +/* ais allowed by the machine */\n>> +bool ais_allowed(void);\n>>  \n>>  /**\n>>   * Returns true if (vmstate based) migration of the channel subsystem\n>> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c\n>> index c4c5791..531d474 100644\n>> --- a/target/s390x/kvm.c\n>> +++ b/target/s390x/kvm.c\n>> @@ -309,7 +309,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n>>      }\n>>  \n>>      /* Try to enable AIS facility */\n>> -    kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n>> +    if (ais_allowed()) {\n>> +       kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);\n>> +    }\n>>  \n>>      qemu_mutex_init(&qemu_sigp_mutex);\n>>\n>>\n> --\n> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK\n>","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 3xyT925jGPz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 17:42:28 +1000 (AEST)","from localhost ([::1]:52192 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 1duw7r-0004DR-VP\n\tfor incoming@patchwork.ozlabs.org; Thu, 21 Sep 2017 03:42:23 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60352)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1duw7V-0004D2-PJ\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 03:42:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <borntraeger@de.ibm.com>) id 1duw7S-0003zS-Gu\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 03:42:01 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44660\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 1duw7S-0003zB-A5\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 03:41:58 -0400","from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8L7eWBt097524\n\tfor <qemu-devel@nongnu.org>; Thu, 21 Sep 2017 03:41:57 -0400","from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2d48cgj8w4-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Thu, 21 Sep 2017 03:41:57 -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\tThu, 21 Sep 2017 08:41:55 +0100","from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198)\n\tby e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tThu, 21 Sep 2017 08:41:53 +0100","from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com\n\t[9.149.105.232])\n\tby b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8L7fqPa12058836; Thu, 21 Sep 2017 07:41:52 GMT","from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id BB57952091;\n\tThu, 21 Sep 2017 07:36:49 +0100 (BST)","from oc7330422307.ibm.com (unknown [9.152.224.107])\n\tby d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 579675208E; \n\tThu, 21 Sep 2017 07:36:49 +0100 (BST)"],"To":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","References":"<1500028867-134709-1-git-send-email-borntraeger@de.ibm.com>\n\t<1500028867-134709-34-git-send-email-borntraeger@de.ibm.com>\n\t<5eb9a7bd-2761-bea1-738a-da7a6d3fbfcf@de.ibm.com>\n\t<f6da1ec7-4845-fe78-b6b8-29a71d481458@de.ibm.com>\n\t<20170920160417.GB3132@work-vm>","From":"Christian Borntraeger <borntraeger@de.ibm.com>","Date":"Thu, 21 Sep 2017 09:41:52 +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":"<20170920160417.GB3132@work-vm>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17092107-0012-0000-0000-0000057AECE6","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092107-0013-0000-0000-000018F428B6","Message-Id":"<f7a2284d-7ac5-001c-ad36-1894ec97a3e9@de.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-21_01:, , 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-1709210103","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] block ais migration for machines <= 2.9","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":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\tYi Min Zhao <zyimin@linux.vnet.ibm.com>,\n\tCornelia Huck <cohuck@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,\n\tMichael Roth <mdroth@linux.vnet.ibm.com>,\n\tAlexander Graf <agraf@suse.de>, Halil Pasic <pasic@linux.vnet.ibm.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>"}}]