On 1/7/25 2:06 PM, Alex Williamson wrote:
Why are configuration changes to the device allowed while the device is
in use?
Would a uevent be considered an inefficient mechanism? Why?
Thanks,
Alex
I believe a vfio device is typically used to pass through a single I/O
device, like a VGPU or PCI device. VFIO allows direct access to the
memory of the underlying device to perform the I/O. Our vfio device does
not follow that model. It represents a guest's AP configuration, not
individual AP devices. Granting guest access to the AP devices in the
configuration is controlled outside of VFIO. The purpose of the mediated
device is to provide a means for specifying the AP configuration for the
guest. When the mediated device is attached to the guest, the vfio_ap
device driver sets the AP configuration assigned to the mdev into the
control blocks used to start the guest.
We could use the sysfs attributes of the mediated device to do hot
plug/unplug of devices for the guest. The vfio_ap host device driver
would perform the hot plug/unplug via an IBM Z mechanism. It was left up
to the AP bus driver running in the guest to detect these changes via a
polling mechanism. My patches allow us to notify the AP bus driver
immediately - via an eventfd to userspace - of those changes which is
far more efficient than relying on a polling mechanism.