[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB527652B0557897BDA08B5FE38C7B9@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Thu, 1 Sep 2022 00:46:51 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Alex Williamson <alex.williamson@...hat.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
> From: Alex Williamson <alex.williamson@...hat.com>
> Sent: Thursday, September 1, 2022 1:15 AM
>
> 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,
>
I can help add one.
btw I plan to respin v2 tomorrow. Regarding to this ABI thing there are
three options:
1) Just add sysfs-devices-vfio-dev in this series. Later merge to
sysfs-class-vfio once the latter is introduced in a separate patch.
2) Do sysfs-class-vfio in this series, including both existing vfio ABIs and
the new vfio-dev.
3) No ABI file in this series. Handle it in a separate patch with
sysfs-class-vfio.
Which one do you prefer to?
Thanks
Kevin
Powered by blists - more mailing lists