Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449336

Re: [PATCH v3] virtio: new feature to detect IOMMU device quirk

From Christoph Hellwig <hch@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3] virtio: new feature to detect IOMMU device quirk
Date 2016-07-25 10:00 +0200
Message-ID <rYIXT-1RO-5@gated-at.bofh.it> (permalink)
References <rWt6W-6qm-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jul 19, 2016 at 05:38:23AM +0300, Michael S. Tsirkin wrote:
> 
> 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.

This is the wrong way around.

> 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.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 
> wanted to use per-device dma ops but that does not
> seem to be ready. So let's put this in virtio
> code for now, and move when it becomes possible.

So work on making it ready.  We're close to there, and given that
virtio needs it, finish it off.  We now have everyone using the
operation vectors for DMA, so the only thing you need is a dma_ops
pointer in struct device initialized to what get_dma_ops returns.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] virtio: new feature to detect IOMMU device quirk "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-19 04:40 +0200
  Re: [PATCH v3] virtio: new feature to detect IOMMU device quirk kbuild test robot <lkp@intel.com> - 2016-07-23 23:40 +0200
  Re: [PATCH v3] virtio: new feature to detect IOMMU device quirk kbuild test robot <lkp@intel.com> - 2016-07-25 00:50 +0200
  Re: [PATCH v3] virtio: new feature to detect IOMMU device quirk Christoph Hellwig <hch@infradead.org> - 2016-07-25 10:00 +0200
    Re: [PATCH v3] virtio: new feature to detect IOMMU device quirk "Michael S. Tsirkin" <mst@redhat.com> - 2016-07-25 21:20 +0200

csiph-web