> From: Jason Gunthorpe <jgg@xxxxxxxxxx> > Sent: Monday, January 9, 2023 9:21 PM > > On Mon, Jan 09, 2023 at 05:46:04AM +0000, Tian, Kevin wrote: > > > From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > > > Sent: Monday, December 19, 2022 4:47 PM > > > > > > This prepares to add ioctls for device cdev fd. This infrastructure includes: > > > - vfio_iommufd_bind() to accept pt_id, and also return back dev_id to > > > caller. > > > - vfio_iommufd_attach() to support iommufd pgtable attach after > > > bind_iommufd. > > > > Please mention that pt_id==-1 implies detach. > > Oh, do we want that or a dedicated ioctl? -1 isn't a u32.. > looks my comment was incorrect. 'detach' is marked by pt_id==NULL in vfio_iommufd_attach() while pt_id==0 in vfio ioctl. In the latter case u32 is fine. aside from that I don't have a strong preference on a dedicated ioctl. would like to hear Alex's opinion.