Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2411582pxb; Tue, 13 Apr 2021 00:54:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMewuZI72vfrJr5aefAoyTpImQ5FNV23plkZmseOg/qZq/arFkrXC+4vOs6u7TarmPI227 X-Received: by 2002:aa7:cc03:: with SMTP id q3mr33840354edt.366.1618300450008; Tue, 13 Apr 2021 00:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618300450; cv=none; d=google.com; s=arc-20160816; b=qr54rd3+DJMLi3A6HPdkHaWMtkgoj5L5y69jnjufFIyWkTQhdpG8YzUuNV77P4R5Bg 5VvgEGudJGs1Dbo8woSbGNSeuLQAW9genVZ6vO25sV3ghnHM23HZAKelmX+PtspqUgVw dga8lRrkj1Kdak4PelMu5QSYID0D6DgNePTgGoejjkHDmHMLYr6imH1Azd97ms/oNdWK 2H+pXACrYy5AvsxyHJS8XH52BLx0gpsluUq2Ro39UMSIfrSYgqlKW6h5hyA7yE1BKLj7 egTfxrdwQN+tqJbwZYqkcWwUrPPbutFU1VyQDZ299/f1gN62jka6c8U2rhOCTw5QukaU r2Ig== 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=5Iu5OerUSpQhkqLnL9eloiOaStU9k7kBa6sazgcmu0A=; b=jWkMVXKQDj1MpJr5Uw/IOauuSdAw+BozoI1XpHB2jn7bzo/B7G3yQgqNDTDzT1hZCu cmZshPXde91WRk3QdzasIokfwWNDSwJzcEJed7HK3r64NpSxB/bUaFKvAlV5Vorw8Xw6 OoxJQ9sgTDijX6nxnzC3dJnHmzS6CYW/WrOsEtDvMblysEtca/VmArHxDbKvK+8zxWwo z4IYieYJpTWNrfuaqk4DGDSiLLUztUETBLk0atiRv0vTCBZcrnS5kwZke1vu++kw1hOM nOnv9qU4LoMVEDmg6EkkRFJFYS2jh0mRhswJHKN4ye5T7B7mBhNPsraliBRQdqPcHU+N Zbyw== 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 q11si5953870eju.518.2021.04.13.00.53.46; Tue, 13 Apr 2021 00:54:09 -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 S241708AbhDMC50 (ORCPT + 99 others); Mon, 12 Apr 2021 22:57:26 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:16578 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237380AbhDMC5Z (ORCPT ); Mon, 12 Apr 2021 22:57:25 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FK9F62RWfz18HpF; Tue, 13 Apr 2021 10:54:50 +0800 (CST) Received: from [10.67.102.118] (10.67.102.118) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Tue, 13 Apr 2021 10:57:02 +0800 Subject: Re: [RFC PATCH v3 0/3] vfio/hisilicon: add acc live migration driver To: CC: , , References: <1618276821-8320-1-git-send-email-liulongfang@huawei.com> From: liulongfang Message-ID: Date: Tue, 13 Apr 2021 10:57:01 +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: <1618276821-8320-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/13 9:20, 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 patch, I will resend it. Thanks Longfang.