Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2404437pxb; Tue, 13 Apr 2021 00:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj9yQLsqndYeh5CeSxO8TJjMvjpJwJmv1EnkWkjVqffaxzFMb+4MsW2INEzvcta+zU/9rz X-Received: by 2002:a05:6402:b26:: with SMTP id bo6mr34779409edb.162.1618299617749; Tue, 13 Apr 2021 00:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618299617; cv=none; d=google.com; s=arc-20160816; b=iqr3p9qXsvZcRG23VvozDNbXB8egmA+3dtbgp3vTP36NeoNWaQrO8OT8jjQLZqOH1W QYGrP60EppGbf3KhPgnkoHk1JRHxlkrdCaMd1K0D5/WE+bspn/XMoYbA1CueCkRekb9Z yM7bvH7aB+CjWeqZfQ7/rPYxadhx4D13IuUBrAX4Qo00b4Vbah39XyZqnHmI+j8mpf8T 4YcA2zwI7RP41TmuUKztCtHvWwZHdJc2Z5F/ZXQrNY+WZIXNFgEgmXrNuo7kjPifpwIv VxwfX5x/NCOKNgtBCBulVrCplHtkr2XHtyPIhf4YqbgXZ9CrRbnUHS0WcHequAUcOAeB RJ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=PW6xSq0N20y9/yMRszO7a/f/zAK8DXNVLwI++6P4+GA=; b=J+YDCD2h1V6DX7E4t+z1CmJ58YF4hNeAAD236k/+GZfmHWA0UecHYBrA++2bUs9fbO biDYLfhV1R+dU56HtNcOajFW2ZAh5Bzy1EHxzwJJZEGyIegBivtGL2Q0SZe9Z224JMn7 z/sNGmz6DYlq5ayICS/Q9NmUHXbioJHQ73fdkFnHiAdyqrSG0eo2zPpzNuwqHKu6IRS9 jbOn99+DYR74wHo2YFu0UEgGMAbzc+qxnMkMVO3Qm2KmYFXgAq+Z3gdLWSB0fVQcHr/9 SqtjyeidG0lbAEQhIB888ZOIPmKcLkgsUWqazbrw+AxDouxxGd4Kedmae7c2wLjrHZSK Njtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt17si263714ejc.330.2021.04.13.00.39.53; Tue, 13 Apr 2021 00:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240518AbhDMBRt (ORCPT + 99 others); Mon, 12 Apr 2021 21:17:49 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16904 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240327AbhDMBRs (ORCPT ); Mon, 12 Apr 2021 21:17:48 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FK72f0g78zjZ2B; Tue, 13 Apr 2021 09:15:38 +0800 (CST) Received: from [10.67.102.118] (10.67.102.118) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Tue, 13 Apr 2021 09:17:27 +0800 Subject: Re: [RFC PATCH v3 0/3] vfio/hisilicon: add acc live migration driver To: CC: , , References: <1618217596-13621-1-git-send-email-liulongfang@huawei.com> From: liulongfang Message-ID: <6bab97f7-c7ed-5837-4b7c-e49770fb9029@huawei.com> Date: Tue, 13 Apr 2021 09:17:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1618217596-13621-1-git-send-email-liulongfang@huawei.com> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.118] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/4/12 16:53, Longfang Liu wrote: > The live migration solution relies on the vfio_device_migration_info protocol. > The structure vfio_device_migration_info is placed at the 0th offset of > the VFIO_REGION_SUBTYPE_MIGRATION region to get and set VFIO device related > migration information. Field accesses from this structure are only supported > at their native width and alignment. Otherwise, the result is undefined and > vendor drivers should return an error. > > (1).The driver framework is based on vfio_pci_register_dev_region() of vfio-pci, > and then a new live migration region is added, and the live migration is > realized through the ops of this region. > > (2).In order to ensure the compatibility of the devices before and after the > migration, the device compatibility information check will be performed in > the Pre-copy stage. If the check fails, an error will be returned and the > source VM will exit the migration function. > > (3).After the compatibility check is passed, it will enter the Stop-and-copy > stage. At this time, all the live migration data will be copied, and then > saved to the VF device of the destination, and then the VF device of the > destination will be started and the VM of the source will be exited. > > Longfang Liu (3): > vfio/hisilicon: add acc live migration driver > vfio/hisilicon: register the driver to vfio > vfio/hisilicom: add debugfs for driver > > drivers/vfio/pci/Kconfig | 9 + > drivers/vfio/pci/Makefile | 3 +- > drivers/vfio/pci/hisilicon/acc_vf_migration.c | 1357 +++++++++++++++++++++++++ > drivers/vfio/pci/hisilicon/acc_vf_migration.h | 172 ++++ > drivers/vfio/pci/vfio_pci.c | 11 + > drivers/vfio/pci/vfio_pci_private.h | 10 + > 6 files changed, 1561 insertions(+), 1 deletion(-) > create mode 100644 drivers/vfio/pci/hisilicon/acc_vf_migration.c > create mode 100644 drivers/vfio/pci/hisilicon/acc_vf_migration.h > Sorry, Please ignore this patchset due to the wrong email address, I will resend it. Thanks Longfang