[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5dbcafa73b065bc619fd6adc9ef47eb6367b8378.camel@kernel.crashing.org>
Date: Wed, 13 Jun 2018 22:25:30 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Ram Pai <linuxram@...ibm.com>,
"Michael S. Tsirkin" <mst@...hat.com>, robh@...nel.org,
pawel.moll@....com, Tom Lendacky <thomas.lendacky@....com>,
aik@...abs.ru, jasowang@...hat.com, cohuck@...hat.com,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, joe@...ches.com,
"Rustad, Mark D" <mark.d.rustad@...el.com>,
david@...son.dropbear.id.au, linuxppc-dev@...ts.ozlabs.org,
elfring@...rs.sourceforge.net,
Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for
virito devices
On Wed, 2018-06-13 at 00:41 -0700, Christoph Hellwig wrote:
> On Mon, Jun 11, 2018 at 01:29:18PM +1000, Benjamin Herrenschmidt wrote:
> > At the risk of repeating myself, let's just do the first pass which is
> > to switch virtio over to always using the DMA API in the actual data
> > flow code, with a hook at initialization time that replaces the DMA ops
> > with some home cooked "direct" ops in the case where the IOMMU flag
> > isn't set.
> >
> > This will be equivalent to what we have today but avoids having 2
> > separate code path all over the driver.
> >
> > Then a second stage, I think, is to replace this "hook" so that the
> > architecture gets a say in the matter.
>
> I don't think we can actually use dma_direct_ops. It still allows
> architectures to override parts of the dma setup, which virtio seems
> to blindly assume phys == dma and not cache flushing.
By direct ops I didn't mean *the* dma_direct_ops but a virtio-local
variants that effectively reproduces the existing expectations (ie,
virtio-dma-legacy-ops or something).
> I think the right way forward is to either add a new
> VIRTIO_F_IS_PCI_DEVICE (or redefine the existing iommu flag if deemed
> possible). And then make sure recent qemu always sets it.
Ben.
Powered by blists - more mailing lists