RE: [RFC 14/20] iommu/iommufd: Add iommufd_device_[de]attach_ioasid()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:57 PM > > On Wed, Sep 22, 2021 at 03:53:52AM +, Tian, Kevin wrote: > > > Actually this was one open we closed in previous design proposal, but > > looks you have a different thought now. > > > > vfio maintains one ioas per conta

Re: [RFC 14/20] iommu/iommufd: Add iommufd_device_[de]attach_ioasid()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:53:52AM +, Tian, Kevin wrote: > Actually this was one open we closed in previous design proposal, but > looks you have a different thought now. > > vfio maintains one ioas per container. Devices in the container > can be attached to different domains (e.g. due to sn

RE: [RFC 14/20] iommu/iommufd: Add iommufd_device_[de]attach_ioasid()

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 2:02 AM > > > +static int ioas_check_device_compatibility(struct iommufd_ioas *ioas, > > + struct device *dev) > > +{ > > + bool snoop = false; > > + u32 addr_width; > > + int ret; > > + > > +

Re: [RFC 14/20] iommu/iommufd: Add iommufd_device_[de]attach_ioasid()

2021-09-21 Thread Jason Gunthorpe via iommu
On Sun, Sep 19, 2021 at 02:38:42PM +0800, Liu Yi L wrote: > An I/O address space takes effect in the iommu only after it's attached > by a device. This patch provides iommufd_device_[de/at]tach_ioasid() > helpers for this purpose. One device can be only attached to one ioasid > at this point, but o