Re: [RFC 03/20] vfio: Add vfio_[un]register_device()
From: Jason Gunthorpe
Date: Wed Sep 22 2021 - 19:56:46 EST
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 interface should indicate that it's supported.
I'm a little worried about adding a struct device to vfio_device and
then making it optional.. That is a really weird situation.
I suppose you could create the sysfs presence in the struct device but
not create a cdev.
However, if we ever want to use the device fd for something else, like
querying the device driver capabilities or mode, (ie clean the
driver_api thing wrongly placed in mdev sysfs for instance), we are
blocked as the uAPI will be cdev == must support iommufd..
Jason