[PATCH] util: basic support for vendor-specific vfio drivers

Daniel P. Berrangé berrange at redhat.com
Fri Aug 5 09:38:51 UTC 2022


On Thu, Aug 04, 2022 at 01:51:20PM -0300, Jason Gunthorpe wrote:
> On Mon, Aug 01, 2022 at 09:49:28AM -0600, Alex Williamson wrote:
> 
> > > > > > Fortunately these new vendor/device-specific drivers can be easily
> > > > > > identified as being "vfio-pci + extra stuff" - all that's needed is to
> > > > > > look at the output of the "modinfo $driver_name" command to see if
> > > > > > "vfio_pci" is in the alias list for the driver.
> 
> We are moving in a direction on the kernel side to expose a sysfs
> under the PCI device that definitively says it is VFIO enabled, eg
> something like
> 
>  /sys/devices/pci0000:00/0000:00:1f.6/vfio/<N>
> 
> Which is how every other subsystem in the kernel works. When this
> lands libvirt can simply stat the vfio directory and confirm that the
> device handle it is looking at is vfio enabled, for all things that
> vfio support.
> 
> My thinking had been to do the above work a bit later, but if libvirt
> needs it right now then lets do it right away so we don't have to
> worry about this hacky modprobe stuff down the road?

I wouldn't go so far as to say libvirt "needs" it, as obviously we can
make it work using  module.alias information.  I would say that exposing
this in sysfs though makes it simpler and faster, because the check then
essentially turns into a single stat() call. So from that POV libvirt
would be happy to see that improvement.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


More information about the libvir-list mailing list