From: jiangdongxu1 jiangdongxu1@huawei.com
euleros inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I86ITO
----------------------------------------------------------------------
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: jiangdongxu1 jiangdongxu1@huawei.com --- include/linux/vdpa.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 0f6d8bef66c2..cbac7221bd08 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -290,6 +290,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 */ @@ -353,6 +362,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); };