[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d27b7b29-df78-4904-8002-b697da5cb013@arm.com>
Date: Wed, 13 Nov 2019 14:45:15 +0000
From: Robin Murphy <robin.murphy@....com>
To: Christoph Hellwig <hch@....de>, iommu@...ts.linux-foundation.org,
Alexey Kardashevskiy <aik@...abs.ru>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: generic DMA bypass flag
On 13/11/2019 1:37 pm, Christoph Hellwig wrote:
> Hi all,
>
> I've recently beeing chatting with Lu about using dma-iommu and
> per-device DMA ops in the intel IOMMU driver, and one missing feature
> in dma-iommu is a bypass mode where the direct mapping is used even
> when an iommu is attached to improve performance. The powerpc
> code already has a similar mode, so I'd like to move it to the core
> DMA mapping code. As part of that I noticed that the current
> powerpc code has a little bug in that it used the wrong check in the
> dma_sync_* routines to see if the direct mapping code is used.
In all honesty, this seems silly. If we can set a per-device flag to say
"oh, bypass these ops and use some other ops instead", then we can just
as easily simply give the device the appropriate ops in the first place.
Because, y'know, the name of the game is "per-device ops".
> These two patches just add the generic code and move powerpc over,
> the intel IOMMU bits will require a separate discussion.
The ops need to match the default domain type, so the hard part of the
problem is choosing when and if to switch that (particularly fun if
there are multiple devices in the IOMMU group). Flipping between
iommu-dma and dma-direct at that point will be trivial.
I don't see a great benefit to pulling legacy cruft out into common code
instead of just working to get rid of it in-place, when said cruft pulls
in the opposite direction to where we're taking the common code (i.e.
it's inherently based on the premise of global ops).
Robin.
> The x86 AMD Gart code also has a bypass mode, but it is a lot
> strange, so I'm not going to touch it for now.
> _______________________________________________
> iommu mailing list
> iommu@...ts.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
>
Powered by blists - more mailing lists