On Tue, Jul 13, 2021 at 11:20:12PM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe <jgg@xxxxxxxxxx> > > Sent: Wednesday, July 14, 2021 7:03 AM > > > > On Tue, Jul 13, 2021 at 10:48:38PM +0000, Tian, Kevin wrote: > > > > > We can still bind to the parent with cookie, but with > > > iommu_register_ sw_device() IOMMU fd knows that this binding doesn't > > > need to establish any security context via IOMMU API. > > > > AFAIK there is no reason to involve the parent PCI or other device in > > SW mode. The iommufd doesn't need to be aware of anything there. > > > > Yes. but does it makes sense to have an unified model in IOMMU fd > which always have a [struct device, cookie] with flags to indicate whether > the binding/attaching should be specially handled for sw mdev? Or > are you suggesting that lacking of struct device is actually the indicator > for such trick? I think you've veered into such micro implementation details that it is better to wait and see how things look. The important point here is that whatever physical device is under a SW mdev does not need to be passed to the iommufd because there is nothing it can do with that information. Jason