Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3114729pxb; Thu, 10 Feb 2022 12:37:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb6KpPfx6UIT25aMkM1RvwWNjy+rqycz4SFBibYbV03rrlH3czl4YrDG8WmEWhEZuLODQX X-Received: by 2002:a17:90a:7605:: with SMTP id s5mr4632262pjk.194.1644525440043; Thu, 10 Feb 2022 12:37:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644525440; cv=none; d=google.com; s=arc-20160816; b=d0fNd3zHrqDn+b7fm0/Vm334ECoXCexhjDnhGBsDVw0Bex11ef+BBs8F+h017yK2b0 tkFgJaL0BFBZqY89drNSmZeSYwMfogcNy/IKbN9Z1Xh90U6qZbvUkl4WAmCIoIRvasqi FmS02sReoe5LP5PkkTvvxHn1ZqLk36hr1x2Gl4U7Gn82B0mZg07O0k+U2cJEy0Uk39BZ a919calS8r71T8Ymeom/dS/+5hfR+asasE84ICda75escjTctb8Uy42kdaDGRhAmnx3L ct7NAemagola9qcQ5VKP1h2R6OFiCQYR4cBPJegagu+EBGob0G1YjyaBOZhX1qA/x8Th xYWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=11/ZjHwxDmhy9u3koWOi39iOPF1uScOPuOMtFnRvnAg=; b=GZa8Uk1dpR/CtOKiBO7aoNTSe3pm4F8T3DC+wAr54qCrCAGZYOV+88dVj0RUZScR7C rZ65TAs6rd4p3QVL+V7bSFWF2I0BiehNT/4v0i+zhPhS+DX/4VdVAd0XTrWz614yy1pO 4zt8dRuSI2YeZxI/yUk4KxzLZLUnWVG5mwrURbroa+yjFkFQOH74+Pa0QAA4QCppS8QZ w5oQCaJu+cj2f44zGSDqeEPTgUL73i/uIGcET3QuDJLUTf1D/e3dtaXXtBlSGyHw7gUR Y4mXwVqdT5KQLZfzrQN+l/boAHxDpWh7mVmfVeUcywhksFRFJmK+Yn5RkYQLYz9S9Fh+ nCOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7si3319525plh.546.2022.02.10.12.37.07; Thu, 10 Feb 2022 12:37:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243325AbiBJPHo convert rfc822-to-8bit (ORCPT + 99 others); Thu, 10 Feb 2022 10:07:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234385AbiBJPHn (ORCPT ); Thu, 10 Feb 2022 10:07:43 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637181A2; Thu, 10 Feb 2022 07:07:43 -0800 (PST) Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Jvg80084yz67MkT; Thu, 10 Feb 2022 23:06:56 +0800 (CST) Received: from lhreml714-chm.china.huawei.com (10.201.108.65) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Thu, 10 Feb 2022 16:07:40 +0100 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by lhreml714-chm.china.huawei.com (10.201.108.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Feb 2022 15:07:40 +0000 Received: from lhreml710-chm.china.huawei.com ([169.254.81.184]) by lhreml710-chm.china.huawei.com ([169.254.81.184]) with mapi id 15.01.2308.021; Thu, 10 Feb 2022 15:07:40 +0000 From: Shameerali Kolothum Thodi To: Alex Williamson CC: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "jgg@nvidia.com" , "cohuck@redhat.com" , "mgurtovoy@nvidia.com" , "yishaih@nvidia.com" , Linuxarm , liulongfang , "Zengtao (B)" , "Jonathan Cameron" , "Wangzhou (B)" Subject: RE: [RFC v4 7/8] hisi_acc_vfio_pci: Add support for VFIO live migration Thread-Topic: [RFC v4 7/8] hisi_acc_vfio_pci: Add support for VFIO live migration Thread-Index: AQHYHPDyAsbl+xVOv0mWAZg3hAhxZqyL5CAAgAEAYUA= Date: Thu, 10 Feb 2022 15:07:40 +0000 Message-ID: References: <20220208133425.1096-1-shameerali.kolothum.thodi@huawei.com> <20220208133425.1096-8-shameerali.kolothum.thodi@huawei.com> <20220209164440.0d77284c.alex.williamson@redhat.com> In-Reply-To: <20220209164440.0d77284c.alex.williamson@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.92.146] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Alex Williamson [mailto:alex.williamson@redhat.com] > Sent: 09 February 2022 23:45 > To: Shameerali Kolothum Thodi > Cc: kvm@vger.kernel.org; linux-kernel@vger.kernel.org; > linux-crypto@vger.kernel.org; jgg@nvidia.com; cohuck@redhat.com; > mgurtovoy@nvidia.com; yishaih@nvidia.com; Linuxarm > ; liulongfang ; Zengtao (B) > ; Jonathan Cameron > ; Wangzhou (B) > Subject: Re: [RFC v4 7/8] hisi_acc_vfio_pci: Add support for VFIO live > migration > > On Tue, 8 Feb 2022 13:34:24 +0000 > Shameer Kolothum wrote: > > + > > +static struct hisi_acc_vf_migration_file * > > +hisi_acc_vf_stop_copy(struct hisi_acc_vf_core_device *hisi_acc_vdev) > > +{ > > + struct hisi_qm *vf_qm = &hisi_acc_vdev->vf_qm; > > + struct device *dev = &hisi_acc_vdev->vf_dev->dev; > > + struct hisi_acc_vf_migration_file *migf; > > + int ret; > > + > > + if (unlikely(qm_wait_dev_not_ready(vf_qm))) { > > + dev_info(dev, "QM device not ready, no data to transfer\n"); > > + return 0; > > + } > > This return value looks suspicious and I think would cause a segfault > in the calling code: Ah..Right!. I think I can move the above to the vf_qm_state_save() and use migf->total_length to handle this. Thanks, Shameer