[PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() function

Jason Gunthorpe jgg at ziepe.ca
Mon Mar 16 12:37:59 UTC 2020


On Mon, Mar 16, 2020 at 02:52:13AM -0700, Christoph Hellwig wrote:
> On Mon, Mar 16, 2020 at 10:41:42AM +0100, Christian König wrote:
> > Well I would prefer if the drivers can somehow express their requirements
> > and get IOVA structures already in the form they need.
> > 
> > Converting the IOVA data from one form to another is sometimes quite costly.
> > Especially when it is only temporarily needed.
> 
> We basically have two ways to generate the IOVA:
> 
>   - a linear translation for the direct mapping case or some dumb IOMMU
>     drivers - in that case case there is a 1:1 mapping between input
>     segments and output segments in DMA mapping
>   - a non-trivial IOMMU where all aligned segments are merged into
>     a single IOVA range
> 
> So I don't really see how the dma layer could help much with any
> limitation beyond existing max size and dma boundary ones.

Christian are you thinking of something like the controllable
address&flags scheme in hmm_range_fault() so that the dma_map process
can write DMA address pages directly to some HW formatted structure?

Jason


More information about the dri-devel mailing list