Message ID | 20221123113236.896-5-shameerali.kolothum.thodi@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2736661wrr; Wed, 23 Nov 2022 03:45:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf4WubDuLp02VZTPYhGPQtlBZqwP+hqINGzs4W3OVt5aRRYH/aI6pj8Cg6Job0BRXRVoDHdI X-Received: by 2002:a17:902:ba89:b0:189:385f:b7f5 with SMTP id k9-20020a170902ba8900b00189385fb7f5mr5734436pls.69.1669203944484; Wed, 23 Nov 2022 03:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669203944; cv=none; d=google.com; s=arc-20160816; b=tvMeP15D2ZuEmNqxNEaLxz9qu19fR9IHde/3PHw2FduMtFOFPMTgjMrfDHXKnc9fcd mUXV34rtOkHDv22NeCeAK3d1GfR9VNprvV8WLIpOMoidMhVqp/iXITSsVP3CeJ2Yh6bw 6n9RKVptLaj7YCBBcM3qDn4ZxAn/2liGvmJxYel6MKWsrHbgb3lqDv+S6iO87sAe1RMv +siB2XQwzLVwZoBbVMGMGgWPGYqnK9dNZuNkR5tUPS66ojGKu1NqSJ8VmycguXuEK6I/ A9llruA/FsuwK3sKOV8MTEavmXr4AIfco/YLOVtWhjjhn0RMDFSzrCsZKUQPVgkzeqgJ FjQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NVB0uSvDiCnb5Fh4Dnx0NSlAlx7e+Hyz9NlOSGnCKYo=; b=b70ivip3jwryc61HtDMAG9nF0CSQKExj/U9LPEa3o4Nabb2ldcvPxBHdgsf/+gR6r+ GSdF0FrZVcHFp1vAGmNH42HYYhIHBc0lX9b4It+/bYWitP1Gku8vdxxld3JU1H0mKf7M vYVo9YHcxbnOFp+THqF4fv1R9KHRjVXnJpoK4FDk6x1F3xc0uMqys+o4v2da9SnrTaZI PdlTWcDzWM90dWwc7lurTGkK0veVmASKwF+Qd5HyRzQhp+GcZlshc15iira6VRK7WNGA uEG4l3KsDrWRPqRciGjXiYHbmou7UiBOh1kyd7XgT67rExDz1aLIlmXmXNvG6TkiY18d JPSg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020a056a0023d300b0056beba0b31dsi18344253pfc.8.2022.11.23.03.45.30; Wed, 23 Nov 2022 03:45:44 -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 S237444AbiKWLeA (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Wed, 23 Nov 2022 06:34:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237201AbiKWLdv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 06:33:51 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B39011DA22; Wed, 23 Nov 2022 03:33:37 -0800 (PST) Received: from fraeml743-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NHJph0vRSz6HJYL; Wed, 23 Nov 2022 19:30:52 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml743-chm.china.huawei.com (10.206.15.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 23 Nov 2022 12:33:35 +0100 Received: from A2006125610.china.huawei.com (10.202.227.178) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 23 Nov 2022 11:33:30 +0000 From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> To: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <alex.williamson@redhat.com>, <jgg@nvidia.com>, <yishaih@nvidia.com>, <kevin.tian@intel.com>, <linuxarm@huawei.com>, <liulongfang@huawei.com>, <prime.zeng@hisilicon.com> Subject: [PATCH 4/4] hisi_acc_vfio_pci: Enable PRE_COPY flag Date: Wed, 23 Nov 2022 11:32:36 +0000 Message-ID: <20221123113236.896-5-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20221123113236.896-1-shameerali.kolothum.thodi@huawei.com> References: <20221123113236.896-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.178] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750287195528609280?= X-GMAIL-MSGID: =?utf-8?q?1750287195528609280?= |
Series |
hisi_acc_vfio_pci: Add PRE_COPY migration feature support
|
|
Commit Message
Shameerali Kolothum Thodi
Nov. 23, 2022, 11:32 a.m. UTC
Now that we have everything to support the PRE_COPY state,
enable it.
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
---
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Shameer, I love your patch! Yet something to improve: [auto build test ERROR on awilliam-vfio/for-linus] [also build test ERROR on linus/master v6.1-rc7 next-20221202] [cannot apply to awilliam-vfio/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Shameer-Kolothum/hisi_acc_vfio_pci-Add-PRE_COPY-migration-feature-support/20221123-193542 base: https://github.com/awilliam/linux-vfio.git for-linus patch link: https://lore.kernel.org/r/20221123113236.896-5-shameerali.kolothum.thodi%40huawei.com patch subject: [PATCH 4/4] hisi_acc_vfio_pci: Enable PRE_COPY flag config: arm64-allyesconfig compiler: aarch64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/0a0337a53f36cbe7185cefb1365816476e10bdf7 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Shameer-Kolothum/hisi_acc_vfio_pci-Add-PRE_COPY-migration-feature-support/20221123-193542 git checkout 0a0337a53f36cbe7185cefb1365816476e10bdf7 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c: In function 'hisi_acc_vf_precopy_ioctl': drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:772:34: error: storage size of 'info' isn't known 772 | struct vfio_precopy_info info; | ^~~~ drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:776:20: error: 'VFIO_MIG_GET_PRECOPY_INFO' undeclared (first use in this function) 776 | if (cmd != VFIO_MIG_GET_PRECOPY_INFO) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:776:20: note: each undeclared identifier is reported only once for each function it appears in In file included from include/uapi/linux/posix_types.h:5, from include/uapi/linux/types.h:14, from include/linux/types.h:6, from include/linux/kasan-checks.h:5, from include/asm-generic/rwonce.h:26, from arch/arm64/include/asm/rwonce.h:71, from include/linux/compiler.h:246, from include/linux/dev_printk.h:14, from include/linux/device.h:15, from drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:6: include/linux/stddef.h:16:33: error: invalid use of undefined type 'struct vfio_precopy_info' 16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) | ^~~~~~~~~~~~~~~~~~ include/linux/stddef.h:33:10: note: in expansion of macro 'offsetof' 33 | (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER)) | ^~~~~~~~ drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:779:17: note: in expansion of macro 'offsetofend' 779 | minsz = offsetofend(struct vfio_precopy_info, dirty_bytes); | ^~~~~~~~~~~ include/linux/stddef.h:24:55: error: invalid use of undefined type 'struct vfio_precopy_info' 24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) | ^~ include/linux/stddef.h:33:35: note: in expansion of macro 'sizeof_field' 33 | (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER)) | ^~~~~~~~~~~~ drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:779:17: note: in expansion of macro 'offsetofend' 779 | minsz = offsetofend(struct vfio_precopy_info, dirty_bytes); | ^~~~~~~~~~~ drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:787:41: error: 'VFIO_DEVICE_STATE_PRE_COPY' undeclared (first use in this function); did you mean 'VFIO_DEVICE_STATE_STOP_COPY'? 787 | if (hisi_acc_vdev->mig_state != VFIO_DEVICE_STATE_PRE_COPY) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | VFIO_DEVICE_STATE_STOP_COPY drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:772:34: warning: unused variable 'info' [-Wunused-variable] 772 | struct vfio_precopy_info info; | ^~~~ drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c: In function 'hisi_acc_vf_set_device_state': drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:957:56: error: 'VFIO_DEVICE_STATE_PRE_COPY' undeclared (first use in this function); did you mean 'VFIO_DEVICE_STATE_STOP_COPY'? 957 | if (cur == VFIO_DEVICE_STATE_RUNNING && new == VFIO_DEVICE_STATE_PRE_COPY) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | VFIO_DEVICE_STATE_STOP_COPY drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c: In function 'hisi_acc_vfio_pci_migrn_init_dev': >> drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:1345:65: error: 'VFIO_MIGRATION_PRE_COPY' undeclared (first use in this function); did you mean 'VFIO_MIGRATION_STOP_COPY'? 1345 | core_vdev->migration_flags = VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_PRE_COPY; | ^~~~~~~~~~~~~~~~~~~~~~~ | VFIO_MIGRATION_STOP_COPY vim +1345 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c 1332 1333 static int hisi_acc_vfio_pci_migrn_init_dev(struct vfio_device *core_vdev) 1334 { 1335 struct hisi_acc_vf_core_device *hisi_acc_vdev = container_of(core_vdev, 1336 struct hisi_acc_vf_core_device, core_device.vdev); 1337 struct pci_dev *pdev = to_pci_dev(core_vdev->dev); 1338 struct hisi_qm *pf_qm = hisi_acc_get_pf_qm(pdev); 1339 1340 hisi_acc_vdev->vf_id = pci_iov_vf_id(pdev) + 1; 1341 hisi_acc_vdev->pf_qm = pf_qm; 1342 hisi_acc_vdev->vf_dev = pdev; 1343 mutex_init(&hisi_acc_vdev->state_mutex); 1344 > 1345 core_vdev->migration_flags = VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_PRE_COPY; 1346 core_vdev->mig_ops = &hisi_acc_vfio_pci_migrn_state_ops; 1347 1348 return vfio_pci_core_init_dev(core_vdev); 1349 } 1350
diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index 9a51f41e1d2a..51941bb4f31f 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -1351,7 +1351,7 @@ static int hisi_acc_vfio_pci_migrn_init_dev(struct vfio_device *core_vdev) hisi_acc_vdev->vf_dev = pdev; mutex_init(&hisi_acc_vdev->state_mutex); - core_vdev->migration_flags = VFIO_MIGRATION_STOP_COPY; + core_vdev->migration_flags = VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_PRE_COPY; core_vdev->mig_ops = &hisi_acc_vfio_pci_migrn_state_ops; return vfio_pci_core_init_dev(core_vdev);