summary refs log tree commit diff stats
path: root/hw/vfio-user/proxy.h
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2025-06-25 20:30:05 +0100
committerCédric Le Goater <clg@redhat.com>2025-06-26 08:55:38 +0200
commit18e899e63dd9d05e567c081023ad7fc5b2c5dc9a (patch)
tree3ae2f6b165b49a9669ed9f8d727255d1c2af5542 /hw/vfio-user/proxy.h
parent019232358124e4f4b929e40fa23253de60eec73e (diff)
downloadfocaccia-qemu-18e899e63dd9d05e567c081023ad7fc5b2c5dc9a.tar.gz
focaccia-qemu-18e899e63dd9d05e567c081023ad7fc5b2c5dc9a.zip
vfio-user: implement VFIO_USER_DMA_MAP/UNMAP
When the vfio-user container gets mapping updates, share them with the
vfio-user by sending a message; this can include the region fd, allowing
the server to directly mmap() the region as needed.

For performance, we only wait for the message responses when we're doing
with a series of updates via the listener_commit() callback.

Originally-by: John Johnson <john.g.johnson@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250625193012.2316242-14-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio-user/proxy.h')
-rw-r--r--hw/vfio-user/proxy.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
index ba1c33aba8..e2fc83ca3b 100644
--- a/hw/vfio-user/proxy.h
+++ b/hw/vfio-user/proxy.h
@@ -70,6 +70,7 @@ typedef struct VFIOUserProxy {
     QemuCond close_cv;
     AioContext *ctx;
     QEMUBH *req_bh;
+    bool async_ops;
 
     /*
      * above only changed when BQL is held
@@ -99,9 +100,14 @@ void vfio_user_set_handler(VFIODevice *vbasedev,
                            void *reqarg);
 bool vfio_user_validate_version(VFIOUserProxy *proxy, Error **errp);
 
+VFIOUserFDs *vfio_user_getfds(int numfds);
+
 void vfio_user_request_msg(VFIOUserHdr *hdr, uint16_t cmd,
                            uint32_t size, uint32_t flags);
+void vfio_user_wait_reqs(VFIOUserProxy *proxy);
 bool vfio_user_send_wait(VFIOUserProxy *proxy, VFIOUserHdr *hdr,
                          VFIOUserFDs *fds, int rsize, Error **errp);
+bool vfio_user_send_nowait(VFIOUserProxy *proxy, VFIOUserHdr *hdr,
+                           VFIOUserFDs *fds, int rsize, Error **errp);
 
 #endif /* VFIO_USER_PROXY_H */