RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-11-11 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Wednesday, November 3, 2021 9:26 PM > > On Tue, Nov 02, 2021 at 09:53:29AM +, Liu, Yi L wrote: > > > > vfio_uninit_group_dev(_state->vdev); > > > kfree(mdev_state->pages); > > > kfree(mdev_state->vconfig); > > > kfree(mdev_state); > > > > >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-11-03 Thread Jason Gunthorpe via iommu
On Tue, Nov 02, 2021 at 09:53:29AM +, Liu, Yi L wrote: > > vfio_uninit_group_dev(_state->vdev); > > kfree(mdev_state->pages); > > kfree(mdev_state->vconfig); > > kfree(mdev_state); > > > > pages/vconfig would logically be in a release function > > I see. So the criteria is:

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-11-02 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Monday, November 1, 2021 8:50 PM > > On Fri, Oct 29, 2021 at 09:47:27AM +, Liu, Yi L wrote: > > Hi Jason, > > > > > From: Jason Gunthorpe > > > Sent: Monday, October 25, 2021 8:53 PM > > > > > > On Mon, Oct 25, 2021 at 06:28:09AM +, Liu, Yi L wrote: > > >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-11-01 Thread Jason Gunthorpe via iommu
On Fri, Oct 29, 2021 at 09:47:27AM +, Liu, Yi L wrote: > Hi Jason, > > > From: Jason Gunthorpe > > Sent: Monday, October 25, 2021 8:53 PM > > > > On Mon, Oct 25, 2021 at 06:28:09AM +, Liu, Yi L wrote: > > >thanks for the guiding. will also refer to your vfio_group_cdev series. > > >

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-10-29 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Monday, October 25, 2021 8:53 PM > > On Mon, Oct 25, 2021 at 06:28:09AM +, Liu, Yi L wrote: > >thanks for the guiding. will also refer to your vfio_group_cdev series. > > > >Need to double confirm here. Not quite following on the kfree. Is >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-10-25 Thread Jason Gunthorpe via iommu
On Mon, Oct 25, 2021 at 06:28:09AM +, Liu, Yi L wrote: >thanks for the guiding. will also refer to your vfio_group_cdev series. > >Need to double confirm here. Not quite following on the kfree. Is >this kfree to free the vfio_device structure? But now the >vfio_device pointer

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-10-25 Thread Liu, Yi L
> From: Jason Gunthorpe mailto:j...@nvidia.com>> > Sent: Tuesday, September 21, 2021 11:57 PM > > On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > userspace to directly open a vfio device w/o relying on

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-10-20 Thread Liu, Yi L
> From: David Gibson > Sent: Wednesday, September 29, 2021 10:09 AM > > On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > userspace to directly open a vfio device w/o relying on container/group > >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-29 Thread David Gibson
On Wed, Sep 29, 2021 at 01:05:21PM -0600, Alex Williamson wrote: > On Wed, 29 Sep 2021 12:08:59 +1000 > David Gibson wrote: > > > On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > > userspace to directly open

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-29 Thread Alex Williamson
On Wed, 29 Sep 2021 12:08:59 +1000 David Gibson wrote: > On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > userspace to directly open a vfio device w/o relying on container/group > > (/dev/vfio/$GROUP).

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-28 Thread David Gibson
On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > userspace to directly open a vfio device w/o relying on container/group > (/dev/vfio/$GROUP). Anything related to group is now hidden behind > iommufd (more

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:51 PM > > On Wed, Sep 22, 2021 at 03:22:42AM +, Tian, Kevin wrote: > > > From: Tian, Kevin > > > Sent: Wednesday, September 22, 2021 9:07 AM > > > > > > > From: Jason Gunthorpe > > > > Sent: Wednesday, September 22, 2021 8:55

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:22:42AM +, Tian, Kevin wrote: > > From: Tian, Kevin > > Sent: Wednesday, September 22, 2021 9:07 AM > > > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 8:55 AM > > > > > > On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > > > >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 01:07:11AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 8:55 AM > > > > On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > > > The opened atomic is aweful. A newly created fd should start in a > > > > state

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Wednesday, September 22, 2021 9:07 AM > > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 8:55 AM > > > > On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > > > The opened atomic is aweful. A newly created fd should start in a > > > >

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:55 AM > > On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > > The opened atomic is aweful. A newly created fd should start in a > > > state where it has a disabled fops > > > > > > The only thing the disabled fops can

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, September 22, 2021 3:56 AM > > On Sun, 19 Sep 2021 14:38:30 +0800 > Liu Yi L wrote: > > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > userspace to directly open a vfio device w/o relying on container/group > >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Jason Gunthorpe via iommu
On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > The opened atomic is aweful. A newly created fd should start in a > > state where it has a disabled fops > > > > The only thing the disabled fops can do is register the device to the > > iommu fd. When successfully registered the

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, September 21, 2021 11:57 PM > > On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > userspace to directly open a vfio device w/o relying on container/group > >

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Alex Williamson
On Sun, 19 Sep 2021 14:38:30 +0800 Liu Yi L wrote: > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > userspace to directly open a vfio device w/o relying on container/group > (/dev/vfio/$GROUP). Anything related to group is now hidden behind > iommufd (more specifically

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-21 Thread Jason Gunthorpe via iommu
On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > userspace to directly open a vfio device w/o relying on container/group > (/dev/vfio/$GROUP). Anything related to group is now hidden behind > iommufd (more