On Wed, May 19, 2021 at 11:12:46PM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe <jgg@xxxxxxxx> > > Sent: Thursday, May 20, 2021 2:07 AM > > > > On Wed, May 19, 2021 at 04:23:21PM +0100, Robin Murphy wrote: > > > On 2021-05-17 16:35, Joerg Roedel wrote: > > > > On Mon, May 17, 2021 at 10:35:00AM -0300, Jason Gunthorpe wrote: > > > > > Well, I'm sorry, but there is a huge other thread talking about the > > > > > IOASID design in great detail and why this is all needed. Jumping into > > > > > this thread without context and basically rejecting all the > > > > > conclusions that were reached over the last several weeks is really > > > > > not helpful - especially since your objection is not technical. > > > > > > > > > > I think you should wait for Intel to put together the /dev/ioasid uAPI > > > > > proposal and the example use cases it should address then you can give > > > > > feedback there, with proper context. > > > > > > > > Yes, I think the next step is that someone who read the whole thread > > > > writes up the conclusions and a rough /dev/ioasid API proposal, also > > > > mentioning the use-cases it addresses. Based on that we can discuss the > > > > implications this needs to have for IOMMU-API and code. > > > > > > > > From the use-cases I know the mdev concept is just fine. But if there is > > > > a more generic one we can talk about it. > > > > > > Just to add another voice here, I have some colleagues working on drivers > > > where they want to use SMMU Substream IDs for a single hardware block > > to > > > operate on multiple iommu_domains managed entirely within the > > > kernel. > > > > If it is entirely within the kernel I'm confused how mdev gets > > involved? mdev is only for vfio which is userspace. > > > > Just add some background. aux domain is used to support mdev but they > are not tied together. Literally aux domain just implies that there could be > multiple domains attached to a device then when one of them becomes > the primary all the remaining are deemed as auxiliary. From this angle it > doesn't matter whether the requirement of multiple domains come from > user or kernel. You can't entirely use aux domain from inside the kernel because you can't compose it with the DMA API unless you also attach it to some struct device, and where will the struct device come from? We already talked about this on the "how to use PASID from the kernel" thread. If Robin just wants to use a stream ID from a kernel driver then that API to make a PASID == RID seems like a better answer for kernel DMA than aux domains is. Jason