qemu-e2k/include/hw/virtio
Jason Wang 375f74f473 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 3716d5902d ("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: 3716d5902d ("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>
2017-03-30 19:09:16 +03:00
..
vhost-backend.h vhost_net: device IOTLB support 2017-01-18 22:59:53 +02:00
vhost-scsi.h
vhost-vsock.h vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
vhost.h vhost: generalize iommu memory region 2017-03-30 19:09:16 +03:00
virtio-access.h virtio: add virtio_*_phys_cached 2017-02-17 21:52:30 +02:00
virtio-balloon.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-blk.h virtio: Report real progress in VQ aio poll handler 2017-02-17 21:52:30 +02:00
virtio-bus.h virtio: convert to use DMA api 2017-01-10 05:56:58 +02:00
virtio-crypto.h virtio-crypto: using bh to handle dataq's requests 2016-11-01 19:21:08 +02:00
virtio-gpu.h virtio-gpu: track and limit host memory allocations 2016-12-20 14:19:08 +01:00
virtio-input.h virtio-input: fix eventq batching 2017-03-27 12:14:45 +02:00
virtio-net.h virtio/migration: Migrate virtio-net to VMState 2017-02-13 17:27:14 +00:00
virtio-rng.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-scsi.h virtio-scsi: Make virtio_scsi_acquire/release public 2017-03-24 11:48:58 +01:00
virtio-serial.h virtio-serial: enable virtio console emergency write feature 2016-10-10 01:16:57 +03:00
virtio.h virtio: fix vring_align() on 64-bit windows 2017-03-29 02:35:24 +03:00