From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Date: Sat, 16 Jun 2018 11:07:24 +1000 Message-ID: <1b4732c5015ee4377fef1de0270065174cde397a.camel@kernel.crashing.org> References: <20180524072104.GD6139@ram.oc3035372033.ibm.com> <0c508eb2-08df-3f76-c260-90cf7137af80@linux.vnet.ibm.com> <20180531204320-mutt-send-email-mst@kernel.org> <20180607052306.GA1532@infradead.org> <20180607185234-mutt-send-email-mst@kernel.org> <20180611023909.GA5726@ram.oc3035372033.ibm.com> <07b804fccd7373c650be79ac9fa77ae7f2375ced.camel@kernel.crashing.org> <20180613074141.GA12033@infradead.org> <5dbcafa73b065bc619fd6adc9ef47eb6367b8378.camel@kernel.crashing.org> <10bbd7122aaa67f51de7a8328df8154212a13f23.camel@kernel.crashing.org> <20180615091624.GA1064@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180615091624.GA1064@infradead.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Christoph Hellwig Cc: robh@kernel.org, cohuck@redhat.com, pawel.moll@arm.com, Tom Lendacky , "Michael S. Tsirkin" , Ram Pai , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, joe@perches.com, "Rustad, Mark D" , Anshuman Khandual , linuxppc-dev@lists.ozlabs.org, elfring@users.sourceforge.net, david@gibson.dropbear.id.au List-Id: virtualization@lists.linuxfoundation.org On Fri, 2018-06-15 at 02:16 -0700, Christoph Hellwig wrote: > On Wed, Jun 13, 2018 at 11:11:01PM +1000, Benjamin Herrenschmidt wrote: > > Actually ... the stuff in lib/dma-direct.c seems to be just it, no ? > > > > There's no cache flushing and there's no architecture hooks that I can > > see other than the AMD security stuff which is probably fine. > > > > Or am I missing something ? > > You are missing the __phys_to_dma arch hook that allows architectures > to adjust the dma address. Various systems have offsets, or even > multiple banks with different offsets there. Most of them don't > use the dma-direct code yet (working on it), but there are a few > examples in the tree already. Ok and on those systems, qemu will bypass said offset ? Maybe we could just create a device DMA "flag" or (or use the attributes) to instruct dma-direct to not use that for legacy virtio ? Cheers, Ben.