aboutsummaryrefslogtreecommitdiff
path: root/include/hw/virtio/virtio-iommu.h
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2022-06-13 14:10:08 +0800
committerMichael S. Tsirkin <mst@redhat.com>2022-06-16 12:54:58 -0400
commit90519b90539b16258d1d52b908b199f44877dc18 (patch)
tree2b362751aa48cad7fcbbe1307b06162824f1f0ee /include/hw/virtio/virtio-iommu.h
parentb595d6272e9219bf70a9baf6d37f64045907f03b (diff)
downloadqemu-90519b90539b16258d1d52b908b199f44877dc18.zip
qemu-90519b90539b16258d1d52b908b199f44877dc18.tar.gz
qemu-90519b90539b16258d1d52b908b199f44877dc18.tar.bz2
virtio-iommu: Add bypass mode support to assigned device
Currently assigned devices can not work in virtio-iommu bypass mode. Guest driver fails to probe the device due to DMA failure. And the reason is because of lacking GPA -> HPA mappings when VM is created. Add a root container memory region to hold both bypass memory region and iommu memory region, so the switch between them is supported just like the implementation in virtual VT-d. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Message-Id: <20220613061010.2674054-2-zhenzhong.duan@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio/virtio-iommu.h')
-rw-r--r--include/hw/virtio/virtio-iommu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-iommu.h b/include/hw/virtio/virtio-iommu.h
index 84391f8..102eeef 100644
--- a/include/hw/virtio/virtio-iommu.h
+++ b/include/hw/virtio/virtio-iommu.h
@@ -37,6 +37,8 @@ typedef struct IOMMUDevice {
int devfn;
IOMMUMemoryRegion iommu_mr;
AddressSpace as;
+ MemoryRegion root; /* The root container of the device */
+ MemoryRegion bypass_mr; /* The alias of shared memory MR */
} IOMMUDevice;
typedef struct IOMMUPciBus {