From: Alex Williamson <alex.williamson@redhat.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
Zhenyu Wang <zhenyuw@linux.intel.com>,
"Wang, Zhi A" <zhi.a.wang@intel.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Eric Farman <farman@linux.ibm.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Vineeth Vijayan <vneethv@linux.ibm.com>,
"Peter Oberparleiter" <oberpar@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Tony Krowiak <akrowiak@linux.ibm.com>,
Jason Herne <jjherne@linux.ibm.com>,
Harald Freudenberger <freude@linux.ibm.com>,
Diana Craciun <diana.craciun@oss.nxp.com>,
"Cornelia Huck" <cohuck@redhat.com>,
Longfang Liu <liulongfang@huawei.com>,
"Shameer Kolothum" <shameerali.kolothum.thodi@huawei.com>,
Yishai Hadas <yishaih@nvidia.com>,
Eric Auger <eric.auger@redhat.com>,
Kirti Wankhede <kwankhede@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Abhishek Sahu <abhsahu@nvidia.com>,
"intel-gvt-dev@lists.freedesktop.org"
<intel-gvt-dev@lists.freedesktop.org>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Liu, Yi L" <yi.l.liu@intel.com>
Subject: Re: [PATCH 15/15] vfio: Add struct device to vfio_device
Date: Wed, 31 Aug 2022 20:05:52 -0600 [thread overview]
Message-ID: <20220831200552.12169ae3.alex.williamson@redhat.com> (raw)
In-Reply-To: <BN9PR11MB527652B0557897BDA08B5FE38C7B9@BN9PR11MB5276.namprd11.prod.outlook.com>
On Thu, 1 Sep 2022 00:46:51 +0000
"Tian, Kevin" <kevin.tian@intel.com> wrote:
> > From: Alex Williamson <alex.williamson@redhat.com>
> > Sent: Thursday, September 1, 2022 1:15 AM
> >
> > On Wed, 31 Aug 2022 06:10:51 +0000
> > "Tian, Kevin" <kevin.tian@intel.com> wrote:
> >
> > > > From: Jason Gunthorpe <jgg@ziepe.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@intel.com> wrote:
> > > > >
> > > > > > From: Yi Liu <yi.l.liu@intel.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@intel.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.
This. Thanks,
Alex
>
> 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
>
next prev parent reply other threads:[~2022-09-01 2:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 17:10 [PATCH 00/15] Tidy up vfio_device life cycle Kevin Tian
2022-08-27 17:10 ` [PATCH 01/15] vfio: Add helpers for unifying " Kevin Tian
2022-08-30 13:42 ` Anthony Krowiak
2022-08-30 15:10 ` Jason Gunthorpe
2022-08-30 19:43 ` Anthony Krowiak
2022-08-31 6:03 ` Tian, Kevin
2022-08-27 17:10 ` [PATCH 02/15] vfio/pci: Use the new device life cycle helpers Kevin Tian
2022-08-27 17:10 ` [PATCH 03/15] vfio/mlx5: " Kevin Tian
2022-08-27 17:10 ` [PATCH 04/15] vfio/hisi_acc: " Kevin Tian
2022-08-31 7:36 ` Shameerali Kolothum Thodi
2022-08-27 17:10 ` [PATCH 05/15] vfio/mdpy: " Kevin Tian
2022-08-27 17:10 ` [PATCH 06/15] vfio/mtty: " Kevin Tian
2022-08-27 17:10 ` [PATCH 07/15] vfio/mbochs: " Kevin Tian
2022-08-27 17:10 ` [PATCH 08/15] drm/i915/gvt: " Kevin Tian
2022-08-27 17:10 ` [PATCH 09/15] vfio/ap: " Kevin Tian
2022-08-30 13:43 ` Anthony Krowiak
2022-08-27 17:10 ` [PATCH 10/15] vfio/fsl-mc: " Kevin Tian
2022-08-31 0:22 ` Jason Gunthorpe
2022-08-31 6:14 ` Tian, Kevin
2022-08-27 17:10 ` [PATCH 11/15] vfio/platform: " Kevin Tian
2022-08-27 17:10 ` [PATCH 12/15] vfio/amba: " Kevin Tian
2022-08-27 17:10 ` [PATCH 13/15] vfio/ccw: " Kevin Tian
2022-08-27 10:39 ` Tian, Kevin
2022-08-27 17:10 ` [PATCH 14/15] vfio: Rename vfio_device_put() and vfio_device_try_get() Kevin Tian
2022-08-27 17:10 ` [PATCH 15/15] vfio: Add struct device to vfio_device Kevin Tian
2022-08-30 22:18 ` Alex Williamson
2022-08-30 23:53 ` Jason Gunthorpe
2022-08-31 6:10 ` Tian, Kevin
2022-08-31 17:15 ` Alex Williamson
2022-09-01 0:46 ` Tian, Kevin
2022-09-01 2:05 ` Alex Williamson [this message]
2022-08-31 0:32 ` Jason Gunthorpe
2022-08-31 6:14 ` Tian, Kevin
2022-08-27 22:41 ` [PATCH 00/15] Tidy up vfio_device life cycle Tian, Kevin
2022-08-31 0:34 ` Jason Gunthorpe
2022-08-31 6:14 ` Tian, Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220831200552.12169ae3.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=abhsahu@nvidia.com \
--cc=agordeev@linux.ibm.com \
--cc=airlied@linux.ie \
--cc=akrowiak@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=daniel@ffwll.ch \
--cc=diana.craciun@oss.nxp.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric.auger@redhat.com \
--cc=farman@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jgg@ziepe.ca \
--cc=jjherne@linux.ibm.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=mjrosato@linux.ibm.com \
--cc=oberpar@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=rodrigo.vivi@intel.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=svens@linux.ibm.com \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=vneethv@linux.ibm.com \
--cc=yi.l.liu@intel.com \
--cc=yishaih@nvidia.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox