Re: [Intel-gfx] [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-15 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Saturday, July 15, 2023 9:05 PM > > On Sat, Jul 15, 2023 at 04:16:52AM +, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Friday, July 14, 2023 10:42 PM > > > > > > On Mon, Jul 10, 2023 at 07:59:24PM -0700, Yi Liu wrote: > > > > > > > +static inline l

Re: [Intel-gfx] [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-15 Thread Jason Gunthorpe
On Sat, Jul 15, 2023 at 04:16:52AM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Friday, July 14, 2023 10:42 PM > > > > On Mon, Jul 10, 2023 at 07:59:24PM -0700, Yi Liu wrote: > > > > > +static inline long vfio_df_ioctl_bind_iommufd(struct vfio_device_file > > > *df, > > > +

Re: [Intel-gfx] [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-14 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Friday, July 14, 2023 10:42 PM > > On Mon, Jul 10, 2023 at 07:59:24PM -0700, Yi Liu wrote: > > > +static inline long vfio_df_ioctl_bind_iommufd(struct vfio_device_file *df, > > + struct vfio_device_bind_iommufd > > __user >

Re: [Intel-gfx] [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-14 Thread Jason Gunthorpe
On Mon, Jul 10, 2023 at 07:59:24PM -0700, Yi Liu wrote: > +static inline long vfio_df_ioctl_bind_iommufd(struct vfio_device_file *df, > + struct vfio_device_bind_iommufd > __user *arg) > +{ > + return -EOPNOTSUPP; > +} This should be -ENOTTY > @@ -1

[Intel-gfx] [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-10 Thread Yi Liu
This adds ioctl for userspace to bind device cdev fd to iommufd. VFIO_DEVICE_BIND_IOMMUFD: bind device to an iommufd, hence gain DMA control provided by the iommufd. open_device op is called after bind_iommufd op. Tested-by: Nicolin