summary refs log tree commit diff stats
path: root/include/hw/vfio
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2025-06-10 08:39:20 -0700
committerCédric Le Goater <clg@redhat.com>2025-06-11 14:01:58 +0200
commitdac0dd68d9b150a6aa334ab8ee9aeba011d54b32 (patch)
treed11cf4a2a28b533e5e2f1e06051c551b5e9c3405 /include/hw/vfio
parent7e9f21411302d823e9ee563ff6a2a40b1ffc1266 (diff)
downloadfocaccia-qemu-dac0dd68d9b150a6aa334ab8ee9aeba011d54b32.tar.gz
focaccia-qemu-dac0dd68d9b150a6aa334ab8ee9aeba011d54b32.zip
vfio/container: mdev cpr blocker
During CPR, after VFIO_DMA_UNMAP_FLAG_VADDR, the vaddr is temporarily
invalid, so mediated devices cannot be supported.  Add a blocker for them.
This restriction will not apply to iommufd containers when CPR is added
for them in a future patch.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/1749569991-25171-8-git-send-email-steven.sistare@oracle.com
[ clg: Fixed context change in VFIODevice ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include/hw/vfio')
-rw-r--r--include/hw/vfio/vfio-cpr.h3
-rw-r--r--include/hw/vfio/vfio-device.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-cpr.h b/include/hw/vfio/vfio-cpr.h
index 04624475f8..b83dd42751 100644
--- a/include/hw/vfio/vfio-cpr.h
+++ b/include/hw/vfio/vfio-cpr.h
@@ -22,6 +22,9 @@ typedef struct VFIOContainerCPR {
                          void *vaddr, bool readonly, MemoryRegion *mr);
 } VFIOContainerCPR;
 
+typedef struct VFIODeviceCPR {
+    Error *mdev_blocker;
+} VFIODeviceCPR;
 
 bool vfio_legacy_cpr_register_container(struct VFIOContainer *container,
                                         Error **errp);
diff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h
index 9793b2dba0..f39259406b 100644
--- a/include/hw/vfio/vfio-device.h
+++ b/include/hw/vfio/vfio-device.h
@@ -28,6 +28,7 @@
 #endif
 #include "system/system.h"
 #include "hw/vfio/vfio-container-base.h"
+#include "hw/vfio/vfio-cpr.h"
 #include "system/host_iommu_device.h"
 #include "system/iommufd.h"
 
@@ -86,6 +87,7 @@ typedef struct VFIODevice {
     QLIST_ENTRY(VFIODevice) hwpt_next;
     struct vfio_region_info **reginfo;
     int *region_fds;
+    VFIODeviceCPR cpr;
 } VFIODevice;
 
 struct VFIODeviceOps {