[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200323125530.GA17038@lst.de>
Date: Mon, 23 Mar 2020 13:55:30 +0100
From: Christoph Hellwig <hch@....de>
To: Robin Murphy <robin.murphy@....com>
Cc: Christoph Hellwig <hch@....de>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
Alexey Kardashevskiy <aik@...abs.ru>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joerg Roedel <joro@...tes.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct
device
On Mon, Mar 23, 2020 at 12:14:08PM +0000, Robin Murphy wrote:
> On 2020-03-20 2:16 pm, Christoph Hellwig wrote:
>> Several IOMMU drivers have a bypass mode where they can use a direct
>> mapping if the devices DMA mask is large enough. Add generic support
>> to the core dma-mapping code to do that to switch those drivers to
>> a common solution.
>
> Hmm, this is _almost_, but not quite the same as the case where drivers are
> managing their own IOMMU mappings, but still need to use streaming DMA for
> cache maintenance on the underlying pages.
In that case they should simply not call the DMA API at all. We'll just
need versions of the cache maintainance APIs that tie in with the raw
IOMMU API.
> For that we need the ops bypass
> to be a "true" bypass and also avoid SWIOTLB regardless of the device's DMA
> mask. That behaviour should in fact be fine for the opportunistic bypass
> case here as well, since the mask being "big enough" implies by definition
> that this should never need to bounce either.
In practice it does. But that means adding yet another code path
vs the simple direct call to dma_direct_* vs calling the DMA ops
which I'd rather avoid.
Powered by blists - more mailing lists