vfio.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ===================
  3. VFIO virtual device
  4. ===================
  5. Device types supported:
  6. - KVM_DEV_TYPE_VFIO
  7. Only one VFIO instance may be created per VM. The created device
  8. tracks VFIO groups in use by the VM and features of those groups
  9. important to the correctness and acceleration of the VM. As groups
  10. are enabled and disabled for use by the VM, KVM should be updated
  11. about their presence. When registered with KVM, a reference to the
  12. VFIO-group is held by KVM.
  13. Groups:
  14. KVM_DEV_VFIO_GROUP
  15. KVM_DEV_VFIO_GROUP attributes:
  16. KVM_DEV_VFIO_GROUP_ADD: Add a VFIO group to VFIO-KVM device tracking
  17. kvm_device_attr.addr points to an int32_t file descriptor
  18. for the VFIO group.
  19. KVM_DEV_VFIO_GROUP_DEL: Remove a VFIO group from VFIO-KVM device tracking
  20. kvm_device_attr.addr points to an int32_t file descriptor
  21. for the VFIO group.
  22. KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table
  23. allocated by sPAPR KVM.
  24. kvm_device_attr.addr points to a struct::
  25. struct kvm_vfio_spapr_tce {
  26. __s32 groupfd;
  27. __s32 tablefd;
  28. };
  29. where:
  30. - @groupfd is a file descriptor for a VFIO group;
  31. - @tablefd is a file descriptor for a TCE table allocated via
  32. KVM_CREATE_SPAPR_TCE.