summaryrefslogtreecommitdiffstats
path: root/block/commit.c
diff options
context:
space:
mode:
authorJason Wang2017-03-29 06:10:04 +0200
committerMichael S. Tsirkin2017-03-30 18:09:16 +0200
commit375f74f473cfcb0c73a64088a6a5880829c155da (patch)
treeaee4d20aa355077002fd6ef6b5dc51202ad42715 /block/commit.c
parentMerge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into sta... (diff)
downloadqemu-375f74f473cfcb0c73a64088a6a5880829c155da.tar.gz
qemu-375f74f473cfcb0c73a64088a6a5880829c155da.tar.xz
qemu-375f74f473cfcb0c73a64088a6a5880829c155da.zip
vhost: generalize iommu memory region
We assumes the iommu_ops were attached to the root region of address space. This may not be true for all kinds of IOMMU implementation and especially after commit 3716d5902d74 ("pci: introduce a bus master container"). So fix this by not assuming as->root has iommu_ops, instead depending on the regions reported by memory listener through: - register a memory listener to dma_as - during region_add, if it's a region of IOMMU, register a specific IOMMU notifier, and store all notifiers in a list. - during region_del, compare and delete the IOMMU notifier from the list This is also a must for making vhost device IOTLB works for all types of IOMMUs. Note, since we register one notifier during each .region_add, the IOTLB may be flushed more than one times, this is suboptimal and could be optimized in the future. Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com> Fixes: 3716d5902d74 ("pci: introduce a bus master container") Cc: Peter Xu <peterx@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Diffstat (limited to 'block/commit.c')
0 files changed, 0 insertions, 0 deletions