vfio: Introduce VFIO_DEVICE_FEATURE ioctl and first user
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 24 Mar 2020 15:28:27 +0000 (09:28 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 24 Mar 2020 15:28:27 +0000 (09:28 -0600)
commit43eeeecc8ed5fa05652d68032a8bfb1308ee9baa
tree15d86c05a9a5fb6f05ba389ea55f21b9c6ee4743
parentcc20d7999000996557333910bcc99399b7244cd9
vfio: Introduce VFIO_DEVICE_FEATURE ioctl and first user

The VFIO_DEVICE_FEATURE ioctl is meant to be a general purpose, device
agnostic ioctl for setting, retrieving, and probing device features.
This implementation provides a 16-bit field for specifying a feature
index, where the data porition of the ioctl is determined by the
semantics for the given feature.  Additional flag bits indicate the
direction and nature of the operation; SET indicates user data is
provided into the device feature, GET indicates the device feature is
written out into user data.  The PROBE flag augments determining
whether the given feature is supported, and if provided, whether the
given operation on the feature is supported.

The first user of this ioctl is for setting the vfio-pci VF token,
where the user provides a shared secret key (UUID) on a SR-IOV PF
device, which users must provide when opening associated VF devices.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci.c
include/uapi/linux/vfio.h