History

Merge tag 'vfio-v6.17-rc1-v2' of https://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson: - Fix imbalance where the no-iommu/cdev device path skips too much on open, failing to increment a reference, but still decrements the reference on close. Add bounds checking to prevent such underflows (Jacob Pan) - Fill missing detach_ioas op for pds_vfio_pci, fixing probe failure when used with IOMMUFD (Brett Creeley) - Split SR-IOV VFs to separate dev_set, avoiding unnecessary serialization between VFs that appear on the same bus (Alex Williamson) - Fix a theoretical integer overflow is the mlx5-vfio-pci variant driver (Artem Sadovnikov) - Implement missing VF token checking support via vfio cdev/IOMMUFD interface (Jason Gunthorpe) - Update QAT vfio-pci variant driver to claim latest VF devices (Małgorzata Mielnik) - Add a cond_resched() call to avoid holding the CPU too long during DMA mapping operations (Keith Busch) * tag 'vfio-v6.17-rc1-v2' of https://github.com/awilliam/linux-vfio: vfio/type1: conditional rescheduling while pinning vfio/qat: add support for intel QAT 6xxx virtual functions vfio/qat: Remove myself from VFIO QAT PCI driver maintainers vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD vfio/mlx5: fix possible overflow in tracking max message size vfio/pci: Separate SR-IOV VF dev_set vfio/pds: Fix missing detach_ioas op vfio: Prevent open_count decrement to negative vfio: Fix unbalanced vfio_df_close call in no-iommu mode

Linus Torvalds committed 1 year ago

Commit e8214ed2 parents cca7a0a b1779e418 files · +99 −22Browse files

Showing the changes to include/uapi/linux (1 of 18 files). Show all

Unified · Split

include/uapi/linux/vfio.h+11−1
@@ -905,10 +905,12 @@ struct vfio_device_feature { · 904 unmodified lines
905905 * VFIO_DEVICE_BIND_IOMMUFD - _IOR(VFIO_TYPE, VFIO_BASE + 18,
906906 * struct vfio_device_bind_iommufd)
907907 * @argsz: User filled size of this data.
908− * @flags: Must be 0.
908+ * @flags: Must be 0 or a bit flags of VFIO_DEVICE_BIND_*
909909 * @iommufd: iommufd to bind.
910910 * @out_devid: The device id generated by this bind. devid is a handle for
911911 * this device/iommufd bond and can be used in IOMMUFD commands.
912+ * @token_uuid_ptr: Valid if VFIO_DEVICE_BIND_FLAG_TOKEN. Points to a 16 byte
913+ * UUID in the same format as VFIO_DEVICE_FEATURE_PCI_VF_TOKEN.
912914 *
913915 * Bind a vfio_device to the specified iommufd.
914916 *
@@ -917,13 +919,21 @@ struct vfio_device_feature { · 2 unmodified lines
917919 *
918920 * Unbind is automatically conducted when device fd is closed.
919921 *
922+ * A token is sometimes required to open the device, unless this is known to be
923+ * needed VFIO_DEVICE_BIND_FLAG_TOKEN should not be set and token_uuid_ptr is
924+ * ignored. The only case today is a PF/VF relationship where the VF bind must
925+ * be provided the same token as VFIO_DEVICE_FEATURE_PCI_VF_TOKEN provided to
926+ * the PF.
927+ *
920928 * Return: 0 on success, -errno on failure.
921929 */
922930 struct vfio_device_bind_iommufd {
923931 __u32 argsz;
924932 __u32 flags;
933+#define VFIO_DEVICE_BIND_FLAG_TOKEN (1 << 0)
925934 __s32 iommufd;
926935 __u32 out_devid;
936+ __aligned_u64 token_uuid_ptr;
927937 };
928938
929939 #define VFIO_DEVICE_BIND_IOMMUFD _IO(VFIO_TYPE, VFIO_BASE + 18)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t