Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-29 Thread da...@gibson.dropbear.id.au
On Wed, Sep 29, 2021 at 09:22:30AM -0300, Jason Gunthorpe wrote: > On Wed, Sep 29, 2021 at 12:46:14PM +1000, da...@gibson.dropbear.id.au wrote: > > On Tue, Sep 21, 2021 at 10:00:14PM -0300, Jason Gunthorpe wrote: > > > On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: > > > > > From: Jas

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-29 Thread Jason Gunthorpe via iommu
On Wed, Sep 29, 2021 at 12:46:14PM +1000, da...@gibson.dropbear.id.au wrote: > On Tue, Sep 21, 2021 at 10:00:14PM -0300, Jason Gunthorpe wrote: > > On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: > > > > From: Jason Gunthorpe > > > > Sent: Wednesday, September 22, 2021 12:01 AM > > >

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-29 Thread Jason Gunthorpe via iommu
On Wed, Sep 29, 2021 at 09:08:25AM +0200, Cornelia Huck wrote: > On Wed, Sep 29 2021, "Tian, Kevin" wrote: > > >> From: David Gibson > >> Sent: Wednesday, September 29, 2021 10:44 AM > >> > >> > One alternative option is to arrange device nodes in sub-directories > >> > based > >> > on the dev

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-29 Thread Cornelia Huck
On Wed, Sep 29 2021, "Tian, Kevin" wrote: >> From: David Gibson >> Sent: Wednesday, September 29, 2021 10:44 AM >> >> > One alternative option is to arrange device nodes in sub-directories based >> > on the device type. But doing so also adds one trouble to userspace. The >> > current vfio uAPI

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-28 Thread Tian, Kevin
> From: David Gibson > Sent: Wednesday, September 29, 2021 10:44 AM > > > One alternative option is to arrange device nodes in sub-directories based > > on the device type. But doing so also adds one trouble to userspace. The > > current vfio uAPI is designed to have the user query device type vi

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-28 Thread Tian, Kevin
> From: David Gibson > Sent: Wednesday, September 29, 2021 10:44 AM > > > > > One open about how to organize the device nodes under > /dev/vfio/devices/. > > This RFC adopts a simple policy by keeping a flat layout with mixed > devname > > from all kinds of devices. The prerequisite of this model

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-28 Thread David Gibson
On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > With /dev/vfio/devices introduced, now a vfio device driver has three > options to expose its device to userspace: > > a) only legacy group interface, for devices which haven't been moved to > iommufd (e.g. platform devices, sw mdev,

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-28 Thread da...@gibson.dropbear.id.au
On Tue, Sep 21, 2021 at 10:00:14PM -0300, Jason Gunthorpe wrote: > On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > > > > One open about how to organize the device nodes under > > > /dev/vfio/devic

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-23 Thread Jason Gunthorpe via iommu
On Thu, Sep 23, 2021 at 09:25:27AM +0200, Eric Auger wrote: > Hi, > > On 9/22/21 3:00 AM, Jason Gunthorpe wrote: > > On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: > >>> From: Jason Gunthorpe > >>> Sent: Wednesday, September 22, 2021 12:01 AM > >>> > One open about how to orga

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-23 Thread Eric Auger
Hi, On 9/22/21 3:00 AM, Jason Gunthorpe wrote: > On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: >>> From: Jason Gunthorpe >>> Sent: Wednesday, September 22, 2021 12:01 AM >>> One open about how to organize the device nodes under >>> /dev/vfio/devices/. This RFC adopts a s

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, September 23, 2021 7:52 AM > > On Wed, Sep 22, 2021 at 11:45:33PM +, Tian, Kevin wrote: > > > From: Alex Williamson > > > btw I realized another related piece regarding to the new layout that > > Jason suggested, which have sys device node include a

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 02:10:36PM -0600, Alex Williamson wrote: > But why would we create vfio device interface files at all if they > can't work? I'm not really on board with creating a try-and-fail > interface for a mechanism that cannot work for a given device. The > existence of the device

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 11:45:33PM +, Tian, Kevin wrote: > > From: Alex Williamson > btw I realized another related piece regarding to the new layout that > Jason suggested, which have sys device node include a link to the vfio > devnode: > > /sys/bus/pci/devices/:BB:DD.F/vfio/vfio

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, September 23, 2021 6:45 AM > > On Wed, 22 Sep 2021 22:34:42 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Thursday, September 23, 2021 4:11 AM > > > > > > On Wed, 22 Sep 2021 09:22:52 -0300 > > > Jason Gunthorpe wrote: > > > >

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Alex Williamson
On Wed, 22 Sep 2021 22:34:42 + "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Thursday, September 23, 2021 4:11 AM > > > > On Wed, 22 Sep 2021 09:22:52 -0300 > > Jason Gunthorpe wrote: > > > > > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > > > > > Pro

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, September 23, 2021 4:11 AM > > On Wed, 22 Sep 2021 09:22:52 -0300 > Jason Gunthorpe wrote: > > > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > > allow

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Alex Williamson
On Wed, 22 Sep 2021 09:22:52 -0300 Jason Gunthorpe wrote: > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > allow a reasonable fallback in userspace.. > > > > I didn't get this point though. An err

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:23 PM > > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > allow a reasonable fallback in userspace.. > > > > I didn't get this point tho

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > Providing an ioctl to bind to a normal VFIO container or group might > > allow a reasonable fallback in userspace.. > > I didn't get this point though. An error in binding already allows the > user to fall back to the group path. Wh

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:54 AM > > On Tue, Sep 21, 2021 at 11:10:15PM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > > > On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > > > > With

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 9:00 AM > > On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > > > > One open about how to organize the device nodes under > > > /dev/vf

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 12:54:02AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > > One open about how to organize the device nodes under > > /dev/vfio/devices/. > > > This RFC adopts a simple policy by keeping a flat layout with mixe

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:54 AM > > On Tue, Sep 21, 2021 at 11:10:15PM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > > > On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > > > > With

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 12:01 AM > > > One open about how to organize the device nodes under > /dev/vfio/devices/. > > This RFC adopts a simple policy by keeping a flat layout with mixed > devname > > from all kinds of devices. The prerequisite of this model

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Jason Gunthorpe via iommu
On Tue, Sep 21, 2021 at 11:10:15PM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > > > With /dev/vfio/devices introduced, now a vfio device driver has three > > > options to ex

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 12:01 AM > > On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > > With /dev/vfio/devices introduced, now a vfio device driver has three > > options to expose its device to userspace: > > > > a) only legacy group interface, fo

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-21 Thread Jason Gunthorpe via iommu
On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > With /dev/vfio/devices introduced, now a vfio device driver has three > options to expose its device to userspace: > > a) only legacy group interface, for devices which haven't been moved to > iommufd (e.g. platform devices, sw mdev,