Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-20 Thread Alexey Kardashevskiy
On 27/2/23 22:11, Yi Liu wrote: 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 bi

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-09 Thread Liu, Yi L
> From: Alexey Kardashevskiy > Sent: Friday, March 10, 2023 10:39 AM > > On 27/2/23 22:11, Yi Liu wrote: > > 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 pr

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-07 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Tuesday, March 7, 2023 9:04 PM > > > From: Jason Gunthorpe > > Sent: Tuesday, March 7, 2023 8:38 PM > > > > On Tue, Mar 07, 2023 at 06:38:59AM +, Tian, Kevin wrote: > > > > From: Liu, Yi L > > > > Sent: Friday, March 3, 2023 2:58 PM > > > > > > > > > What should we

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-07 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, March 7, 2023 8:38 PM > > On Tue, Mar 07, 2023 at 06:38:59AM +, Tian, Kevin wrote: > > > From: Liu, Yi L > > > Sent: Friday, March 3, 2023 2:58 PM > > > > > > > What should we return here anyhow if an access was created? > > > > > > iommufd_access->ob

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-07 Thread Jason Gunthorpe
On Tue, Mar 07, 2023 at 06:38:59AM +, Tian, Kevin wrote: > > From: Liu, Yi L > > Sent: Friday, March 3, 2023 2:58 PM > > > > > What should we return here anyhow if an access was created? > > > > iommufd_access->obj.id. should be fine. Is it? > > Thinking more I'm not sure whether it's a goo

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-06 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Friday, March 3, 2023 2:58 PM > > > What should we return here anyhow if an access was created? > > iommufd_access->obj.id. should be fine. Is it? > Thinking more I'm not sure whether it's a good idea to fill the dev_id field with an access object id and then later co

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-02 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Friday, March 3, 2023 2:58 PM > > > From: Jason Gunthorpe > > Sent: Thursday, March 2, 2023 1:47 AM > > > > On Wed, Mar 01, 2023 at 09:19:07AM +, Liu, Yi L wrote: > > > > From: Liu, Yi L > > > > Sent: Monday, February 27, 2023 7:12 PM > > > [...] > > > > +long vfio

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-02 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, March 2, 2023 1:47 AM > > On Wed, Mar 01, 2023 at 09:19:07AM +, Liu, Yi L wrote: > > > From: Liu, Yi L > > > Sent: Monday, February 27, 2023 7:12 PM > > [...] > > > +long vfio_device_ioctl_bind_iommufd(struct vfio_device_file *df, > > > +

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, March 2, 2023 1:47 AM > > On Wed, Mar 01, 2023 at 09:19:07AM +, Liu, Yi L wrote: > > > From: Liu, Yi L > > > Sent: Monday, February 27, 2023 7:12 PM > > [...] > > > +long vfio_device_ioctl_bind_iommufd(struct vfio_device_file *df, > > > +

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-01 Thread Jason Gunthorpe
On Wed, Mar 01, 2023 at 09:19:07AM +, Liu, Yi L wrote: > > From: Liu, Yi L > > Sent: Monday, February 27, 2023 7:12 PM > [...] > > +long vfio_device_ioctl_bind_iommufd(struct vfio_device_file *df, > > + unsigned long arg) > > +{ > > + struct vfio_device *device

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-01 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Monday, February 27, 2023 7:12 PM [...] > +long vfio_device_ioctl_bind_iommufd(struct vfio_device_file *df, > + unsigned long arg) > +{ > + struct vfio_device *device = df->device; > + struct vfio_device_bind_iommufd bind; > + s

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-02-27 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, February 28, 2023 3:20 AM > > On Mon, Feb 27, 2023 at 03:11:32AM -0800, Yi Liu wrote: > > This adds ioctl for userspace to bind device cdev fd to iommufd. > > > > VFIO_DEVICE_BIND_IOMMUFD: bind device to an iommufd, hence gain > DMA > >

Re: [Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-02-27 Thread Jason Gunthorpe
On Mon, Feb 27, 2023 at 03:11:32AM -0800, Yi Liu wrote: > 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 >

[Intel-gfx] [PATCH v5 16/19] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-02-27 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.