Christoph Hellwig
2018-Jun-04 12:55 UTC
[RFC V2] virtio: Add platform specific DMA API translation for virito devices
On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote:> Another is that given the basic functionality is in there, optimizations > can possibly wait until per-device quirks in DMA API are supported.We have had per-device dma_ops for quite a while.
Benjamin Herrenschmidt
2018-Jun-04 13:14 UTC
[RFC V2] virtio: Add platform specific DMA API translation for virito devices
On Mon, 2018-06-04 at 05:55 -0700, Christoph Hellwig wrote:> On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote: > > Another is that given the basic functionality is in there, optimizations > > can possibly wait until per-device quirks in DMA API are supported. > > We have had per-device dma_ops for quite a while.I've asked Ansuman to start with a patch that converts virtio to use DMA ops always, along with an init quirk to hookup "direct" ops when the IOMMU flag isn't set. This will at least remove that horrid duplication of code path we have in there. Then we can just involve the arch in that init quirk so we can chose an alternate set of ops when running a secure VM. This is completely orthogonal to whether an iommu exist qemu side or not, and should be entirely solved on the Linux side. Cheers, Ben.
Michael S. Tsirkin
2018-Jun-04 16:34 UTC
[RFC V2] virtio: Add platform specific DMA API translation for virito devices
On Mon, Jun 04, 2018 at 11:14:36PM +1000, Benjamin Herrenschmidt wrote:> On Mon, 2018-06-04 at 05:55 -0700, Christoph Hellwig wrote: > > On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote: > > > Another is that given the basic functionality is in there, optimizations > > > can possibly wait until per-device quirks in DMA API are supported. > > > > We have had per-device dma_ops for quite a while. > > I've asked Ansuman to start with a patch that converts virtio to use > DMA ops always, along with an init quirk to hookup "direct" ops when > the IOMMU flag isn't set. > > This will at least remove that horrid duplication of code path we have > in there. > > Then we can just involve the arch in that init quirk so we can chose an > alternate set of ops when running a secure VM. > > This is completely orthogonal to whether an iommu exist qemu side or > not, and should be entirely solved on the Linux side. > > Cheers, > Ben.Sounds good to me. -- MST
Reasonably Related Threads
- [RFC V2] virtio: Add platform specific DMA API translation for virito devices
- [RFC V2] virtio: Add platform specific DMA API translation for virito devices
- [RFC V2] virtio: Add platform specific DMA API translation for virito devices
- [RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
- [RFC V2] virtio: Add platform specific DMA API translation for virito devices