aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugenio Pérez <eperezma@redhat.com>2022-07-20 08:59:40 +0200
committerJason Wang <jasowang@redhat.com>2022-07-20 16:58:08 +0800
commit463ba1e3b8cf080812895c5f26d95d8d7db2e692 (patch)
tree1c3ff4cbb4f335f9ff5c7f3256f134bb85b6a06b /include
parente966c0b781aebabd2c0f5eef91678f08ce1d068c (diff)
downloadqemu-463ba1e3b8cf080812895c5f26d95d8d7db2e692.zip
qemu-463ba1e3b8cf080812895c5f26d95d8d7db2e692.tar.gz
qemu-463ba1e3b8cf080812895c5f26d95d8d7db2e692.tar.bz2
vdpa: Export vhost_vdpa_dma_map and unmap calls
Shadow CVQ will copy buffers on qemu VA, so we avoid TOCTOU attacks from the guest that could set a different state in qemu device model and vdpa device. To do so, it needs to be able to map these new buffers to the device. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/vhost-vdpa.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index a29dbb3..7214eb4 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -39,4 +39,8 @@ typedef struct vhost_vdpa {
VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX];
} VhostVDPA;
+int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
+ void *vaddr, bool readonly);
+int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova, hwaddr size);
+
#endif