aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxime Coquelin <maxime.coquelin@redhat.com>2017-06-02 12:18:28 +0200
committerMichael S. Tsirkin <mst@redhat.com>2017-06-02 18:57:17 +0300
commit020e571b8bf90e022bbb78346e189f0f26e4675f (patch)
tree4ba3ebdf103587568856399eed662cccfeea173e /include
parentfc58bd0d97c41dc3257001c86b2f802ae7255dff (diff)
vhost: rework IOTLB messaging
This patch reworks IOTLB messaging to prepare for vhost-user device IOTLB support. IOTLB messages handling is extracted from vhost-kernel backend, so that only the messages transport remains backend specifics. Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/vhost-backend.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h
index c3cf4a72bc..a7a5f22bc6 100644
--- a/include/hw/virtio/vhost-backend.h
+++ b/include/hw/virtio/vhost-backend.h
@@ -27,6 +27,7 @@ struct vhost_vring_file;
struct vhost_vring_state;
struct vhost_vring_addr;
struct vhost_scsi_target;
+struct vhost_iotlb_msg;
typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque);
typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev);
@@ -81,12 +82,8 @@ typedef int (*vhost_vsock_set_guest_cid_op)(struct vhost_dev *dev,
typedef int (*vhost_vsock_set_running_op)(struct vhost_dev *dev, int start);
typedef void (*vhost_set_iotlb_callback_op)(struct vhost_dev *dev,
int enabled);
-typedef int (*vhost_update_device_iotlb_op)(struct vhost_dev *dev,
- uint64_t iova, uint64_t uaddr,
- uint64_t len,
- IOMMUAccessFlags perm);
-typedef int (*vhost_invalidate_device_iotlb_op)(struct vhost_dev *dev,
- uint64_t iova, uint64_t len);
+typedef int (*vhost_send_device_iotlb_msg_op)(struct vhost_dev *dev,
+ struct vhost_iotlb_msg *imsg);
typedef struct VhostOps {
VhostBackendType backend_type;
@@ -120,8 +117,7 @@ typedef struct VhostOps {
vhost_vsock_set_guest_cid_op vhost_vsock_set_guest_cid;
vhost_vsock_set_running_op vhost_vsock_set_running;
vhost_set_iotlb_callback_op vhost_set_iotlb_callback;
- vhost_update_device_iotlb_op vhost_update_device_iotlb;
- vhost_invalidate_device_iotlb_op vhost_invalidate_device_iotlb;
+ vhost_send_device_iotlb_msg_op vhost_send_device_iotlb_msg;
} VhostOps;
extern const VhostOps user_ops;
@@ -129,4 +125,15 @@ extern const VhostOps user_ops;
int vhost_set_backend_type(struct vhost_dev *dev,
VhostBackendType backend_type);
+int vhost_backend_update_device_iotlb(struct vhost_dev *dev,
+ uint64_t iova, uint64_t uaddr,
+ uint64_t len,
+ IOMMUAccessFlags perm);
+
+int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,
+ uint64_t iova, uint64_t len);
+
+int vhost_backend_handle_iotlb_msg(struct vhost_dev *dev,
+ struct vhost_iotlb_msg *imsg);
+
#endif /* VHOST_BACKEND_H */