€•ä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ŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/pt_BR/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&]”uh1j9h³hÇh´Khj5ubhŒ definition”“”)�”}”(hhh]”j/)�”}”(hhh]”j4)�”}”(hŒ,KVM_DEV_VFIO_FILE alias: KVM_DEV_VFIO_GROUP ”h]”(j:)�”}”(hŒKVM_DEV_VFIO_FILE”h]”hŒKVM_DEV_VFIO_FILE”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j9h³hÇh´KhjQubjJ)�”}”(hhh]”hÞ)�”}”(hŒalias: KVM_DEV_VFIO_GROUP”h]”hŒalias: KVM_DEV_VFIO_GROUP”…”�”}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjcubah}”(h]”h ]”h"]”h$]”h&]”uh1jIhjQubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´KhjNubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjKubah}”(h]”h ]”h"]”h$]”h&]”uh1jIhj5ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´Khj0ubj4)�”}”(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&]”uh1j9h³hÇh´K!hj’ubjJ)�”}”(hhh]”j/)�”}”(hhh]”(j4)�”}”(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&]”uh1j9h³hÇh´KhjªubjJ)�”}”(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&]”uh1jIhjªubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´Khj§ubj4)�”}”(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&]”uh1j9h³hÇh´K!hjçubjJ)�”}”(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&]”uh1jIhjçubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´K!hj§ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j.hj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1jIhj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´K!hj0h²hubj4)�”}”(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&]”uh1j9h³hÇh´K5hj6ubjJ)�”}”(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”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K$hjHubhÞ)�”}”(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”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K&hjHubj/)�”}”(hhh]”j4)�”}”(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”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j9h³hÇh´K5hjjubjJ)�”}”(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:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K)hj|ubhŒ 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Æuh1j�h³hÇh´K,hj|ubhÞ)�”}”(hŒwhere:”h]”hŒwhere:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K1hj|ubhô)�”}”(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´K3hj|ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jIhjjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´K5hjgubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjHubeh}”(h]”h ]”h"]”h$]”h&]”uh1jIhj6ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3h³hÇh´K5hj0h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1j.hhÊ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.”…”�”}”(hjh²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.