[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220831111512.4924e152.alex.williamson@redhat.com>
Date: Wed, 31 Aug 2022 11:15:12 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: "Tian, Kevin" <kevin.tian@...el.com>
Cc: Jason Gunthorpe <jgg@...pe.ca>,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
"Wang, Zhi A" <zhi.a.wang@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@...ux.intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Eric Farman <farman@...ux.ibm.com>,
Matthew Rosato <mjrosato@...ux.ibm.com>,
Halil Pasic <pasic@...ux.ibm.com>,
Vineeth Vijayan <vneethv@...ux.ibm.com>,
"Peter Oberparleiter" <oberpar@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Tony Krowiak <akrowiak@...ux.ibm.com>,
Jason Herne <jjherne@...ux.ibm.com>,
Harald Freudenberger <freude@...ux.ibm.com>,
Diana Craciun <diana.craciun@....nxp.com>,
"Cornelia Huck" <cohuck@...hat.com>,
Longfang Liu <liulongfang@...wei.com>,
"Shameer Kolothum" <shameerali.kolothum.thodi@...wei.com>,
Yishai Hadas <yishaih@...dia.com>,
Eric Auger <eric.auger@...hat.com>,
Kirti Wankhede <kwankhede@...dia.com>,
Leon Romanovsky <leon@...nel.org>,
Abhishek Sahu <abhsahu@...dia.com>,
"intel-gvt-dev@...ts.freedesktop.org"
<intel-gvt-dev@...ts.freedesktop.org>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Liu, Yi L" <yi.l.liu@...el.com>
Subject: Re: [PATCH 15/15] vfio: Add struct device to vfio_device
On Wed, 31 Aug 2022 06:10:51 +0000
"Tian, Kevin" <kevin.tian@...el.com> wrote:
> > From: Jason Gunthorpe <jgg@...pe.ca>
> > Sent: Wednesday, August 31, 2022 7:53 AM
> >
> > On Tue, Aug 30, 2022 at 04:18:38PM -0600, Alex Williamson wrote:
> > > On Sun, 28 Aug 2022 01:10:37 +0800
> > > Kevin Tian <kevin.tian@...el.com> wrote:
> > >
> > > > From: Yi Liu <yi.l.liu@...el.com>
> > > >
> > > > and replace kref. With it a 'vfio-dev/vfioX' node is created under the
> > > > sysfs path of the parent, indicating the device is bound to a vfio
> > > > driver, e.g.:
> > > >
> > > > /sys/devices/pci0000\:6f/0000\:6f\:01.0/vfio-dev/vfio0
> > > >
> > > > It is also a preparatory step toward adding cdev for supporting future
> > > > device-oriented uAPI.
> > >
> > > Shall we start Documentation/ABI/testing/vfio-dev now? Thanks.
> >
> > I always thought that was something to use when adding new custom
> > sysfs attributes?
> >
> > Here we are just creating a standard struct device with its standard
> > sysfs?
> >
>
> There is nothing special for vfio-dev/vfioX. But from pci device p.o.v
> this does introduce a custom node in the directory, which is probably
> what Alex referred to?
Yup, but not just for pci, we're adding a node into the device
directory for any device bound to vfio.
> Anyway if required following can be introduced:
>
> diff --git a/Documentation/ABI/testing/sysfs-devices-vfio-dev b/Documentation/ABI/testing/sysfs-devices-vfio-dev
> new file mode 100644
> index 000000000000..dfe8baaf1ccb
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-devices-vfio-dev
> @@ -0,0 +1,8 @@
> +What: /sys/.../<device>/vfio-dev/vfioX/
> +Date: September 2022
> +Contact: Yi Liu <yi.l.liu@...el.com>
> +Description:
> + This directory is created when the device is bound to a
> + vfio driver. The layout under this directory matches what
> + exists for a standard 'struct device'. 'X' is a random
> + number marking this device in vfio.
It's not really random, it's a unique index. Seems like a good
starting point.
>
> At the start I thought it might make more sense to add it into an
> existing vfio ABI file. But looks it doesn't exist.
>
> Curious why nobody asked for ABI doc for /dev/vfio/vfio, /sys/class/vfio, etc...
Oversight, there should probably be a sysfs-class-vfio file. Thanks,
Alex
Powered by blists - more mailing lists