diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2016-04-18 12:58:14 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-08-01 21:44:52 +0300 |
commit | 1a937693993ff10d7e80cca6ddd55f3000aa6376 (patch) | |
tree | 77df81f5acf23d1c21240a625b5a8066b350e27a /drivers/misc | |
parent | 37cf99e08c6fb4dcea0f9ad2b13b6daa8c76a711 (diff) |
virtio: new feature to detect IOMMU device quirk
The interaction between virtio and IOMMUs is messy.
On most systems with virtio, physical addresses match bus addresses,
and it doesn't particularly matter which one we use to program
the device.
On some systems, including Xen and any system with a physical device
that speaks virtio behind a physical IOMMU, we must program the IOMMU
for virtio DMA to work at all.
On other systems, including SPARC and PPC64, virtio-pci devices are
enumerated as though they are behind an IOMMU, but the virtio host
ignores the IOMMU, so we must either pretend that the IOMMU isn't
there or somehow map everything as the identity.
Add a feature bit to detect that quirk: VIRTIO_F_IOMMU_PLATFORM.
Any device with this feature bit set to 0 needs a quirk and has to be
passed physical addresses (as opposed to bus addresses) even though
the device is behind an IOMMU.
Note: it has to be a per-device quirk because for example, there could
be a mix of passed-through and virtual virtio devices. As another
example, some devices could be implemented by an out of process
hypervisor backend (in case of qemu vhost, or vhost-user) and so support
for an IOMMU needs to be coded up separately.
It would be cleanest to handle this in IOMMU core code, but that needs
per-device DMA ops. While we are waiting for that to be implemented, use
a work-around in virtio core.
Note: a "noiommu" feature is a quirk - add a wrapper to make
that clear.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/misc')
0 files changed, 0 insertions, 0 deletions