Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp1348918rdb; Fri, 25 Aug 2023 21:34:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdBpI3H5EzTwMIWTfJ+J2vXb25p7nDj4LzO+vkki4BOc9RKezF2ppyZ1+lNKgBkNB05E3H X-Received: by 2002:a17:907:a05c:b0:9a1:bd53:b23 with SMTP id gz28-20020a170907a05c00b009a1bd530b23mr9163429ejc.14.1693024448391; Fri, 25 Aug 2023 21:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693024448; cv=none; d=google.com; s=arc-20160816; b=Z1VSscGgjhmW2/wnBfDWi/f4HBIf7o7H7DCPjxBc6gmrgaz2UsgbmutG73yOCNhUce KOJNxNcybQoSDXyC1AqhNC567dQXQxmoDixlOcNZmDnAaldXEIQJvvK2GA1Ej/BIF5w5 qBtyKgeB29tEX0ugzPtvjW4cO8FujBPhTMLif29vrZV1YCC5DI2MotIHGTrdRbqMA4+X E19i9yvVpbsllgzSOvUMK7weiaXlaZRXMdTsViRn8RFAfZlErFzTmE/QgBDrJ2BD+nTo vcZPk7QhBmFnmdKXGtjdq5L4lFp3RzOK0JffRYtz1Q7I7DZ82eCmfDxX9M6CjF0FBkUJ pUEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Xxlc/iQMvTChwOiPXKKrtIbxotpdE23XAIYFq7A3udU=; fh=HQEYiDkHWm+iyDy6Iy8ezzU3XnCEZFhJuYNKBtR+sm8=; b=qGZkzd/wFnN9EdFtTS/lFnQ4tF1/rvGizEk0DsBrWEDT6fD2EPQcVy7IN5hYgDoapi C+/qhJNp8dpbwBS+RVmPurDhtaUpaDepkEu+pRDPJ0X1bi17/4uUFzgNFBy/l+IVNObW d1O4X3nfv2Nj0Zr5CdfAb/w8YbHO8W8a60KGtfULjUfBS1CvMIxQzP3CRJgxDLMKd5bj h38BN4YrOZewuVnyRaNsNq+L9vMTL5iIYXvgfWzhX4RqZV95sWX30xjnX+DJgKdMcOKV KbDiYSQxi5AjJ4jlUu3WtzzVtciLdoLi0ZujrfciddNIylSg9e1LsqdbcTkn9SZL4Pj3 y2Zg== 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 a23-20020a17090680d700b0099bc98ccef6si1689864ejx.446.2023.08.25.21.33.14; Fri, 25 Aug 2023 21:34:08 -0700 (PDT) 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 S231648AbjHZBYo (ORCPT + 99 others); Fri, 25 Aug 2023 21:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231644AbjHZBYP (ORCPT ); Fri, 25 Aug 2023 21:24:15 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A87A1E77 for ; Fri, 25 Aug 2023 18:24:12 -0700 (PDT) Received: from kwepemm600016.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RXfDZ5JXJzVkJP; Sat, 26 Aug 2023 09:21:50 +0800 (CST) Received: from linux-hNCriV.Euler.HZ (10.175.124.27) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 26 Aug 2023 09:24:09 +0800 From: Jiang Dongxu To: , CC: jiangdongxu , , , , Subject: [PATCH 1/2] vdpa: add log operations Date: Sat, 26 Aug 2023 09:23:31 +0800 Message-ID: <5b93796745b277ab8a8b8981ce04456763a9bcaa.1693012755.git.jiangdongxu1@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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: X-Mailing-List: linux-kernel@vger.kernel.org From: jiangdongxu Several new interfaces are introduced to allow vdpa device logging guest memory during live migration and return to the VMM. The set_log_base interface is used to set the base address for buffer storing bitmaps. The set_log_size interface is used to set the size of buffer used for storing bitmaps. The log_sync interface is used to copy the bitmaps from kernel space to user space of VMM. These operations are optional. If they are not implemented, these operations will return EOPNOTSUPP. Signed-off-by: jiangdongxu --- include/linux/vdpa.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index db1b0eaef4eb..985eed4f05b3 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -327,6 +327,15 @@ struct vdpa_map_file { * @unbind_mm: Unbind the device from the address space * bound using the bind_mm callback. (optional) * @vdev: vdpa device + * @set_log_base Set base address for logging. (optional) + * @vdev: vdpa device + * @base: base address + * @set_log_size Set buffer size for logging. (optional) + * @vdev: vdpa device + * @size: logging buffer size + * @log_sync Synchronize logging buffer from kernel space to + * user space. (optional) + * @vdev: vdpa device * @free: Free resources that belongs to vDPA (optional) * @vdev: vdpa device */ @@ -396,6 +405,11 @@ struct vdpa_config_ops { int (*bind_mm)(struct vdpa_device *vdev, struct mm_struct *mm); void (*unbind_mm)(struct vdpa_device *vdev); + /* Log ops */ + int (*set_log_base)(struct vdpa_device *vdev, uint64_t base); + int (*set_log_size)(struct vdpa_device *vdev, uint64_t size); + int (*log_sync)(struct vdpa_device *vdev); + /* Free device resources */ void (*free)(struct vdpa_device *vdev); }; -- 2.27.0