On Fri, Oct 20, 2023 at 11:30:06AM +0100, Robin Murphy wrote: >> Well, we can stage this. I wish I could find my old proposal about the >> dma_batch API (I remember Robin commented on it, my he is better at >> finding it than me). > > Heh, the dirty secret is that Office 365 is surprisingly effective at > searching 9 years worth of email I haven't deleted :) > > https://lore.kernel.org/linux-iommu/79926b59-0eb9-2b88-b1bb-1bd472b10370@xxxxxxx/ Perfect, thanks! > The other thing that's clear by now is that I think we definitely want > distinct APIs for "please map this bunch of disjoint things" for true > scatter-gather cases like biovecs where it's largely just convenient to > keep them grouped together (but opportunistic merging might still be a > bonus), vs. "please give me a linearised DMA mapping of these pages (and > fail if you can't)" for the dma-buf style cases. Hmm, I'm not sure I agree. For both the iommu and swiotlb case we get the linear mapping for free with small limitations: - for the iommu case the alignment needs to be a multiple of the iommu page size - for swiotlb the size of each mapping is very limited If these conditions are matched we can linearize for free, if they aren't we can't linearize at all. But maybe I'm missing something?