From patchwork Thu Jul 13 13:58:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 9838513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46A8C602A0 for ; Thu, 13 Jul 2017 13:59:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3743828569 for ; Thu, 13 Jul 2017 13:59:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BBA428574; Thu, 13 Jul 2017 13:59:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A719628569 for ; Thu, 13 Jul 2017 13:59:40 +0000 (UTC) Received: from localhost ([::1]:60236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeeZ-0003bZ-V9 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Jul 2017 09:59:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVedf-0003Vc-3H for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:58:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVedb-0005Je-Vq for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:58:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43876 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 1dVedb-0005Id-QF for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:58:39 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6DDs5LI116189 for ; Thu, 13 Jul 2017 09:58:38 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bp1squ2x0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 13 Jul 2017 09:58:38 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Jul 2017 09:58:37 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 13 Jul 2017 09:58:34 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6DDwX2F40829164; Thu, 13 Jul 2017 13:58:33 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A117B2046; Thu, 13 Jul 2017 09:56:04 -0400 (EDT) Received: from oc1450873852.ibm.com (unknown [9.152.224.155]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 4D7D3B204D; Thu, 13 Jul 2017 09:56:02 -0400 (EDT) To: Cornelia Huck References: <1499942429-55449-1-git-send-email-borntraeger@de.ibm.com> <1499942429-55449-4-git-send-email-borntraeger@de.ibm.com> <20170713142721.3a40e083@gondolin> <606fdb06-cb0e-00b3-ffa3-18a024f14309@de.ibm.com> <20170713151054.28eb7909@gondolin> From: Christian Borntraeger Date: Thu, 13 Jul 2017 15:58:30 +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: <20170713151054.28eb7909@gondolin> Content-Language: en-IE X-TM-AS-GCONF: 00 x-cbid: 17071313-0056-0000-0000-000003A678B5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007361; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00886987; UDB=6.00442811; IPR=6.00667128; BA=6.00005470; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016213; XFM=3.00000015; UTC=2017-07-13 13:58:35 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071313-0057-0000-0000-000007DC86DE Message-Id: <5bd135ce-ed8e-3326-04b7-3bff51ecc78a@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-13_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707130218 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/s390-next 3/3] s390x/flic: migrate ais states 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: Halil Pasic , Yi Min Zhao , Pierre Morel , qemu-devel , Alexander Graf , Thomas Huth , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 07/13/2017 03:10 PM, Cornelia Huck wrote: > On Thu, 13 Jul 2017 15:02:08 +0200 > Christian Borntraeger wrote: > >> On 07/13/2017 02:27 PM, Cornelia Huck wrote: >>> On Thu, 13 Jul 2017 12:40:29 +0200 >>> Christian Borntraeger wrote: >>> >>>> From: Yi Min Zhao >>>> >>>> During migration we should transfer ais states to the target guest. >>>> This patch introduces a subsection to kvm_s390_flic_vmstate and new >>>> vmsd for qemu_flic. The ais states need to be migrated only when >>>> ais is supported. >>>> >>>> Signed-off-by: Yi Min Zhao >>>> Signed-off-by: Christian Borntraeger >>>> --- >>>> hw/intc/s390_flic.c | 20 ++++++++++++ >>>> hw/intc/s390_flic_kvm.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ >>>> include/hw/s390x/s390_flic.h | 1 + >>>> 3 files changed, 96 insertions(+) > >>>> +static int kvm_flic_ais_post_load(void *opaque, int version_id) >>>> +{ >>>> + KVMS390FLICStateMigTmp *tmp = opaque; >>>> + KVMS390FLICState *flic = tmp->parent; >>>> + struct kvm_s390_ais_all ais = { >>>> + .simm = tmp->simm, >>>> + .nimm = tmp->nimm, >>>> + }; >>>> + struct kvm_device_attr attr = { >>>> + .group = KVM_DEV_FLIC_AISM_ALL, >>>> + .addr = (uint64_t)&ais, >>>> + }; >>>> + >>>> + if (!ais_needed(flic)) { >>>> + return -ENOSYS; >>>> + } >>> >>> I do not understand this... does that mean that >>> - we should never get here or >>> - we should not try to change the fields or >>> - I need coffee? >> >> My understanding is that this should not happen with a normal setup, >> but it can happen if the user does something "wrong". For example >> use qemu without libvirt and with -cpu host (which is not migration safe) >> and do a migration from a host that has AIS to a host that has no AIS. >> In that case the target system will reject the migration (late, but hopefully >> not too late). > > A comment would be helpful here. Something like Reviewed-by: Cornelia Huck diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index 4cf73ee..9b8dbd1 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -452,6 +452,12 @@ static int kvm_flic_ais_post_load(void *opaque, int version_id) .addr = (uint64_t)&ais, }; + /* This can happen when the user mis-configures its guests in an + * incompatible fashion or without a CPU model. For example using + * qemu with -cpu host (which is not migration safe) and do a + * migration from a host that has AIS to a host that has no AIS. + * In that case the target system will reject the migration here. + */ if (!ais_needed(flic)) { return -ENOSYS; }