From: jiangdongxu jiangdongxu1@huawei.com
virt inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8TP8X
----------------------------------------------------------------------
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 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 0e652026b776..d2c322a6e4ae 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -330,6 +330,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 */ @@ -400,6 +409,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); };