€•6Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ)/translations/zh_CN/virt/kvm/devices/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/zh_TW/virt/kvm/devices/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/virt/kvm/devices/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/virt/kvm/devices/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/virt/kvm/devices/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/sp_SP/virt/kvm/devices/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒC/var/lib/git/docbuild/linux/Documentation/virt/kvm/devices/vfio.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒVFIO virtual device”h]”hŒVFIO virtual device”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hŒDevice types supported:”h]”hŒDevice types supported:”…””}”(hhËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhŒ block_quote”“”)”}”(hŒ- KVM_DEV_TYPE_VFIO ”h]”hŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒKVM_DEV_TYPE_VFIO ”h]”hÊ)”}”(hŒKVM_DEV_TYPE_VFIO”h]”hŒKVM_DEV_TYPE_VFIO”…””}”(hhêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K hhæubah}”(h]”h ]”h"]”h$]”h&]”uh1hähháubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1hßhŸh³h K hhÛubah}”(h]”h ]”h"]”h$]”h&]”uh1hÙhŸh³h K hh¶hžhubhÊ)”}”(hX‡Only one VFIO instance may be created per VM. The created device tracks VFIO files (group or device) in use by the VM and features of those groups/devices important to the correctness and acceleration of the VM. As groups/devices are enabled and disabled for use by the VM, KVM should be updated about their presence. When registered with KVM, a reference to the VFIO file is held by KVM.”h]”hX‡Only one VFIO instance may be created per VM. The created device tracks VFIO files (group or device) in use by the VM and features of those groups/devices important to the correctness and acceleration of the VM. As groups/devices are enabled and disabled for use by the VM, KVM should be updated about their presence. When registered with KVM, a reference to the VFIO file is held by KVM.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K hh¶hžhubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒ:Groups: KVM_DEV_VFIO_FILE alias: KVM_DEV_VFIO_GROUP ”h]”(hŒterm”“”)”}”(hŒGroups:”h]”hŒGroups:”…””}”(hj'hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h Khj!ubhŒ definition”“”)”}”(hhh]”j)”}”(hhh]”j )”}”(hŒ,KVM_DEV_VFIO_FILE alias: KVM_DEV_VFIO_GROUP ”h]”(j&)”}”(hŒKVM_DEV_VFIO_FILE”h]”hŒKVM_DEV_VFIO_FILE”…””}”(hjAhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h Khj=ubj6)”}”(hhh]”hÊ)”}”(hŒalias: KVM_DEV_VFIO_GROUP”h]”hŒalias: KVM_DEV_VFIO_GROUP”…””}”(hjRhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhjOubah}”(h]”h ]”h"]”h$]”h&]”uh1j5hj=ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h Khj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1j5hj!ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h Khjubj )”}”(hXˆKVM_DEV_VFIO_FILE attributes: KVM_DEV_VFIO_FILE_ADD: Add a VFIO file (group/device) to VFIO-KVM device tracking kvm_device_attr.addr points to an int32_t file descriptor for the VFIO file. KVM_DEV_VFIO_FILE_DEL: Remove a VFIO file (group/device) from VFIO-KVM device tracking kvm_device_attr.addr points to an int32_t file descriptor for the VFIO file. ”h]”(j&)”}”(hŒKVM_DEV_VFIO_FILE attributes:”h]”hŒKVM_DEV_VFIO_FILE attributes:”…””}”(hj‚hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h K!hj~ubj6)”}”(hhh]”j)”}”(hhh]”(j )”}”(hŒ KVM_DEV_VFIO_FILE_ADD: Add a VFIO file (group/device) to VFIO-KVM device tracking kvm_device_attr.addr points to an int32_t file descriptor for the VFIO file. ”h]”(j&)”}”(hŒHKVM_DEV_VFIO_FILE_ADD: Add a VFIO file (group/device) to VFIO-KVM device”h]”hŒHKVM_DEV_VFIO_FILE_ADD: Add a VFIO file (group/device) to VFIO-KVM device”…””}”(hjšhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h Khj–ubj6)”}”(hhh]”(hÊ)”}”(hŒtracking”h]”hŒtracking”…””}”(hj«hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj¨ubhÊ)”}”(hŒLkvm_device_attr.addr points to an int32_t file descriptor for the VFIO file.”h]”hŒLkvm_device_attr.addr points to an int32_t file descriptor for the VFIO file.”…””}”(hj¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj¨ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j5hj–ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h Khj“ubj )”}”(hŒ¥KVM_DEV_VFIO_FILE_DEL: Remove a VFIO file (group/device) from VFIO-KVM device tracking kvm_device_attr.addr points to an int32_t file descriptor for the VFIO file. ”h]”(j&)”}”(hŒFKVM_DEV_VFIO_FILE_DEL: Remove a VFIO file (group/device) from VFIO-KVM”h]”hŒFKVM_DEV_VFIO_FILE_DEL: Remove a VFIO file (group/device) from VFIO-KVM”…””}”(hj×hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h K!hjÓubj6)”}”(hhh]”(hÊ)”}”(hŒdevice tracking”h]”hŒdevice tracking”…””}”(hjèhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhjåubhÊ)”}”(hŒLkvm_device_attr.addr points to an int32_t file descriptor for the VFIO file.”h]”hŒLkvm_device_attr.addr points to an int32_t file descriptor for the VFIO file.”…””}”(hjöhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K hjåubeh}”(h]”h ]”h"]”h$]”h&]”uh1j5hjÓubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h K!hj“ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j5hj~ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h K!hjhžhubj )”}”(hX²KVM_DEV_VFIO_GROUP (legacy kvm device group restricted to the handling of VFIO group fd): KVM_DEV_VFIO_GROUP_ADD: same as KVM_DEV_VFIO_FILE_ADD for group fd only KVM_DEV_VFIO_GROUP_DEL: same as KVM_DEV_VFIO_FILE_DEL for group fd only KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table allocated by sPAPR KVM. kvm_device_attr.addr points to a struct:: struct kvm_vfio_spapr_tce { __s32 groupfd; __s32 tablefd; }; where: - @groupfd is a file descriptor for a VFIO group; - @tablefd is a file descriptor for a TCE table allocated via KVM_CREATE_SPAPR_TCE. ”h]”(j&)”}”(hŒYKVM_DEV_VFIO_GROUP (legacy kvm device group restricted to the handling of VFIO group fd):”h]”hŒYKVM_DEV_VFIO_GROUP (legacy kvm device group restricted to the handling of VFIO group fd):”…””}”(hj&hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h K5hj"ubj6)”}”(hhh]”(hÊ)”}”(hŒGKVM_DEV_VFIO_GROUP_ADD: same as KVM_DEV_VFIO_FILE_ADD for group fd only”h]”hŒGKVM_DEV_VFIO_GROUP_ADD: same as KVM_DEV_VFIO_FILE_ADD for group fd only”…””}”(hj7hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K$hj4ubhÊ)”}”(hŒGKVM_DEV_VFIO_GROUP_DEL: same as KVM_DEV_VFIO_FILE_DEL for group fd only”h]”hŒGKVM_DEV_VFIO_GROUP_DEL: same as KVM_DEV_VFIO_FILE_DEL for group fd only”…””}”(hjEhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K&hj4ubj)”}”(hhh]”j )”}”(hXŠKVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table allocated by sPAPR KVM. kvm_device_attr.addr points to a struct:: struct kvm_vfio_spapr_tce { __s32 groupfd; __s32 tablefd; }; where: - @groupfd is a file descriptor for a VFIO group; - @tablefd is a file descriptor for a TCE table allocated via KVM_CREATE_SPAPR_TCE. ”h]”(j&)”}”(hŒDKVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table”h]”hŒDKVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hŸh³h K5hjVubj6)”}”(hhh]”(hÊ)”}”(hŒAallocated by sPAPR KVM. kvm_device_attr.addr points to a struct::”h]”hŒ@allocated by sPAPR KVM. kvm_device_attr.addr points to a struct:”…””}”(hjkhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K)hjhubhŒ literal_block”“”)”}”(hŒPstruct kvm_vfio_spapr_tce { __s32 groupfd; __s32 tablefd; };”h]”hŒPstruct kvm_vfio_spapr_tce { __s32 groupfd; __s32 tablefd; };”…””}”hj{sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jyhŸh³h K,hjhubhÊ)”}”(hŒwhere:”h]”hŒwhere:”…””}”(hj‰hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K1hjhubhà)”}”(hhh]”(hå)”}”(hŒ/@groupfd is a file descriptor for a VFIO group;”h]”hÊ)”}”(hjœh]”hŒ/@groupfd is a file descriptor for a VFIO group;”…””}”(hjžhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K3hjšubah}”(h]”h ]”h"]”h$]”h&]”uh1hähj—ubhå)”}”(hŒR@tablefd is a file descriptor for a TCE table allocated via KVM_CREATE_SPAPR_TCE. ”h]”hÊ)”}”(hŒQ@tablefd is a file descriptor for a TCE table allocated via KVM_CREATE_SPAPR_TCE.”h]”hŒQ@tablefd is a file descriptor for a TCE table allocated via KVM_CREATE_SPAPR_TCE.”…””}”(hjµhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K4hj±ubah}”(h]”h ]”h"]”h$]”h&]”uh1hähj—ubeh}”(h]”h ]”h"]”h$]”h&]”jjuh1hßhŸh³h K3hjhubeh}”(h]”h ]”h"]”h$]”h&]”uh1j5hjVubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h K5hjSubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j5hj"ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h K5hjhžhubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhh¶hžhhŸNh NubhÊ)”}”(hXòThe FILE/GROUP_ADD operation above should be invoked prior to accessing the device file descriptor via VFIO_GROUP_GET_DEVICE_FD in order to support drivers which require a kvm pointer to be set in their .open_device() callback. It is the same for device file descriptor via character device open which gets device access via VFIO_DEVICE_BIND_IOMMUFD. For such file descriptors, FILE_ADD should be invoked before VFIO_DEVICE_BIND_IOMMUFD to support the drivers mentioned in prior sentence as well.”h]”hXòThe FILE/GROUP_ADD operation above should be invoked prior to accessing the device file descriptor via VFIO_GROUP_GET_DEVICE_FD in order to support drivers which require a kvm pointer to be set in their .open_device() callback. It is the same for device file descriptor via character device open which gets device access via VFIO_DEVICE_BIND_IOMMUFD. For such file descriptors, FILE_ADD should be invoked before VFIO_DEVICE_BIND_IOMMUFD to support the drivers mentioned in prior sentence as well.”…””}”(hjóhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K7hh¶hžhubeh}”(h]”Œvfio-virtual-device”ah ]”h"]”Œvfio virtual device”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j,Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”jjsŒ nametypes”}”j‰sh}”jh¶sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.