0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 ===================
0004 VFIO virtual device
0005 ===================
0006
0007 Device types supported:
0008
0009 - KVM_DEV_TYPE_VFIO
0010
0011 Only one VFIO instance may be created per VM. The created device
0012 tracks VFIO groups in use by the VM and features of those groups
0013 important to the correctness and acceleration of the VM. As groups
0014 are enabled and disabled for use by the VM, KVM should be updated
0015 about their presence. When registered with KVM, a reference to the
0016 VFIO-group is held by KVM.
0017
0018 Groups:
0019 KVM_DEV_VFIO_GROUP
0020
0021 KVM_DEV_VFIO_GROUP attributes:
0022 KVM_DEV_VFIO_GROUP_ADD: Add a VFIO group to VFIO-KVM device tracking
0023 kvm_device_attr.addr points to an int32_t file descriptor
0024 for the VFIO group.
0025 KVM_DEV_VFIO_GROUP_DEL: Remove a VFIO group from VFIO-KVM device tracking
0026 kvm_device_attr.addr points to an int32_t file descriptor
0027 for the VFIO group.
0028 KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table
0029 allocated by sPAPR KVM.
0030 kvm_device_attr.addr points to a struct::
0031
0032 struct kvm_vfio_spapr_tce {
0033 __s32 groupfd;
0034 __s32 tablefd;
0035 };
0036
0037 where:
0038
0039 - @groupfd is a file descriptor for a VFIO group;
0040 - @tablefd is a file descriptor for a TCE table allocated via
0041 KVM_CREATE_SPAPR_TCE.