€•8Œ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/driver-api/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/driver-api/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/driver-api/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/driver-api/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/driver-api/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/driver-api/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/driver-api/vfio”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ"VFIO - "Virtual Function I/O" [1]_”h]”(hŒ"VFIO - “Virtual Function I/Oâ€� ”…”�”}”(hh¼h²hh³Nh´NubhŒfootnote_reference”“”)�”}”(hŒ[1]_”h]”hŒ1”…”�”}”(hhÆh²hh³Nh´Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œrefid”Œid9”Œdocname”Œdriver-api/vfio”uh1hÄhh¼Œresolved”Kubeh}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ=/var/lib/git/docbuild/linux/Documentation/driver-api/vfio.rst”h´KubhŒ paragraph”“”)�”}”(hXMany modern systems now provide DMA and interrupt remapping facilities to help ensure I/O devices behave within the boundaries they've been allotted. This includes x86 hardware with AMD-Vi and Intel VT-d, POWER systems with Partitionable Endpoints (PEs) and embedded PowerPC systems such as Freescale PAMU. The VFIO driver is an IOMMU/device agnostic framework for exposing direct device access to userspace, in a secure, IOMMU protected environment. In other words, this allows safe [2]_, non-privileged, userspace drivers.”h]”(hXéMany modern systems now provide DMA and interrupt remapping facilities to help ensure I/O devices behave within the boundaries they’ve been allotted. This includes x86 hardware with AMD-Vi and Intel VT-d, POWER systems with Partitionable Endpoints (PEs) and embedded PowerPC systems such as Freescale PAMU. The VFIO driver is an IOMMU/device agnostic framework for exposing direct device access to userspace, in a secure, IOMMU protected environment. In other words, this allows safe ”…”�”}”(hhãh²hh³Nh´NubhÅ)�”}”(hŒ[2]_”h]”hŒ2”…”�”}”(hhëh²hh³Nh´Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”hÕŒid10”h×hØuh1hÄhhãhÙKubhŒ$, non-privileged, userspace drivers.”…”�”}”(hhãh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Khh·h²hubhâ)�”}”(hXlWhy do we want that? Virtual machines often make use of direct device access ("device assignment") when configured for the highest possible I/O performance. From a device and host perspective, this simply turns the VM into a userspace driver, with the benefits of significantly reduced latency, higher bandwidth, and direct use of bare-metal device drivers [3]_.”h]”(hXkWhy do we want that? Virtual machines often make use of direct device access (“device assignmentâ€�) when configured for the highest possible I/O performance. From a device and host perspective, this simply turns the VM into a userspace driver, with the benefits of significantly reduced latency, higher bandwidth, and direct use of bare-metal device drivers ”…”�”}”(hjh²hh³Nh´NubhÅ)�”}”(hŒ[3]_”h]”hŒ3”…”�”}”(hj h²hh³Nh´Nubah}”(h]”Œid3”ah ]”h"]”h$]”h&]”hÕŒid11”h×hØuh1hÄhjhÙKubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Khh·h²hubhâ)�”}”(hX$Some applications, particularly in the high performance computing field, also benefit from low-overhead, direct device access from userspace. Examples include network adapters (often non-TCP/IP based) and compute accelerators. Prior to VFIO, these drivers had to either go through the full development cycle to become proper upstream driver, be maintained out of tree, or make use of the UIO framework, which has no notion of IOMMU protection, limited interrupt support, and requires root privileges to access things like PCI configuration space.”h]”hX$Some applications, particularly in the high performance computing field, also benefit from low-overhead, direct device access from userspace. Examples include network adapters (often non-TCP/IP based) and compute accelerators. Prior to VFIO, these drivers had to either go through the full development cycle to become proper upstream driver, be maintained out of tree, or make use of the UIO framework, which has no notion of IOMMU protection, limited interrupt support, and requires root privileges to access things like PCI configuration space.”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Khh·h²hubhâ)�”}”(hŒÅThe VFIO driver framework intends to unify these, replacing both the KVM PCI specific device assignment code as well as provide a more secure, more featureful userspace driver environment than UIO.”h]”hŒÅThe VFIO driver framework intends to unify these, replacing both the KVM PCI specific device assignment code as well as provide a more secure, more featureful userspace driver environment than UIO.”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Khh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒGroups, Devices, and IOMMUs”h]”hŒGroups, Devices, and IOMMUs”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjCh²hh³hàh´K$ubhâ)�”}”(hX}Devices are the main target of any I/O driver. Devices typically create a programming interface made up of I/O access, interrupts, and DMA. Without going into the details of each of these, DMA is by far the most critical aspect for maintaining a secure environment as allowing a device read-write access to system memory imposes the greatest risk to the overall system integrity.”h]”hX}Devices are the main target of any I/O driver. Devices typically create a programming interface made up of I/O access, interrupts, and DMA. Without going into the details of each of these, DMA is by far the most critical aspect for maintaining a secure environment as allowing a device read-write access to system memory imposes the greatest risk to the overall system integrity.”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K&hjCh²hubhâ)�”}”(hX–To help mitigate this risk, many modern IOMMUs now incorporate isolation properties into what was, in many cases, an interface only meant for translation (ie. solving the addressing problems of devices with limited address spaces). With this, devices can now be isolated from each other and from arbitrary memory access, thus allowing things like secure direct assignment of devices into virtual machines.”h]”hX–To help mitigate this risk, many modern IOMMUs now incorporate isolation properties into what was, in many cases, an interface only meant for translation (ie. solving the addressing problems of devices with limited address spaces). With this, devices can now be isolated from each other and from arbitrary memory access, thus allowing things like secure direct assignment of devices into virtual machines.”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K-hjCh²hubhâ)�”}”(hXsThis isolation is not always at the granularity of a single device though. Even when an IOMMU is capable of this, properties of devices, interconnects, and IOMMU topologies can each reduce this isolation. For instance, an individual device may be part of a larger multi- function enclosure. While the IOMMU may be able to distinguish between devices within the enclosure, the enclosure may not require transactions between devices to reach the IOMMU. Examples of this could be anything from a multi-function PCI device with backdoors between functions to a non-PCI-ACS (Access Control Services) capable bridge allowing redirection without reaching the IOMMU. Topology can also play a factor in terms of hiding devices. A PCIe-to-PCI bridge masks the devices behind it, making transaction appear as if from the bridge itself. Obviously IOMMU design plays a major factor as well.”h]”hXsThis isolation is not always at the granularity of a single device though. Even when an IOMMU is capable of this, properties of devices, interconnects, and IOMMU topologies can each reduce this isolation. For instance, an individual device may be part of a larger multi- function enclosure. While the IOMMU may be able to distinguish between devices within the enclosure, the enclosure may not require transactions between devices to reach the IOMMU. Examples of this could be anything from a multi-function PCI device with backdoors between functions to a non-PCI-ACS (Access Control Services) capable bridge allowing redirection without reaching the IOMMU. Topology can also play a factor in terms of hiding devices. A PCIe-to-PCI bridge masks the devices behind it, making transaction appear as if from the bridge itself. Obviously IOMMU design plays a major factor as well.”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K4hjCh²hubhâ)�”}”(hXMTherefore, while for the most part an IOMMU may have device level granularity, any system is susceptible to reduced granularity. The IOMMU API therefore supports a notion of IOMMU groups. A group is a set of devices which is isolatable from all other devices in the system. Groups are therefore the unit of ownership used by VFIO.”h]”hXMTherefore, while for the most part an IOMMU may have device level granularity, any system is susceptible to reduced granularity. The IOMMU API therefore supports a notion of IOMMU groups. A group is a set of devices which is isolatable from all other devices in the system. Groups are therefore the unit of ownership used by VFIO.”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KChjCh²hubhâ)�”}”(hXLWhile the group is the minimum granularity that must be used to ensure secure user access, it's not necessarily the preferred granularity. In IOMMUs which make use of page tables, it may be possible to share a set of page tables between different groups, reducing the overhead both to the platform (reduced TLB thrashing, reduced duplicate page tables), and to the user (programming only a single set of translations). For this reason, VFIO makes use of a container class, which may hold one or more groups. A container is created by simply opening the /dev/vfio/vfio character device.”h]”hXNWhile the group is the minimum granularity that must be used to ensure secure user access, it’s not necessarily the preferred granularity. In IOMMUs which make use of page tables, it may be possible to share a set of page tables between different groups, reducing the overhead both to the platform (reduced TLB thrashing, reduced duplicate page tables), and to the user (programming only a single set of translations). For this reason, VFIO makes use of a container class, which may hold one or more groups. A container is created by simply opening the /dev/vfio/vfio character device.”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KIhjCh²hubhâ)�”}”(hXÅOn its own, the container provides little functionality, with all but a couple version and extension query interfaces locked away. The user needs to add a group into the container for the next level of functionality. To do this, the user first needs to identify the group associated with the desired device. This can be done using the sysfs links described in the example below. By unbinding the device from the host driver and binding it to a VFIO driver, a new VFIO group will appear for the group as /dev/vfio/$GROUP, where $GROUP is the IOMMU group number of which the device is a member. If the IOMMU group contains multiple devices, each will need to be bound to a VFIO driver before operations on the VFIO group are allowed (it's also sufficient to only unbind the device from host drivers if a VFIO driver is unavailable; this will make the group available, but not that particular device). TBD - interface for disabling driver probing/locking a device.”h]”hXÇOn its own, the container provides little functionality, with all but a couple version and extension query interfaces locked away. The user needs to add a group into the container for the next level of functionality. To do this, the user first needs to identify the group associated with the desired device. This can be done using the sysfs links described in the example below. By unbinding the device from the host driver and binding it to a VFIO driver, a new VFIO group will appear for the group as /dev/vfio/$GROUP, where $GROUP is the IOMMU group number of which the device is a member. If the IOMMU group contains multiple devices, each will need to be bound to a VFIO driver before operations on the VFIO group are allowed (it’s also sufficient to only unbind the device from host drivers if a VFIO driver is unavailable; this will make the group available, but not that particular device). TBD - interface for disabling driver probing/locking a device.”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KShjCh²hubhâ)�”}”(hXåOnce the group is ready, it may be added to the container by opening the VFIO group character device (/dev/vfio/$GROUP) and using the VFIO_GROUP_SET_CONTAINER ioctl, passing the file descriptor of the previously opened container file. If desired and if the IOMMU driver supports sharing the IOMMU context between groups, multiple groups may be set to the same container. If a group fails to set to a container with existing groups, a new empty container will need to be used instead.”h]”hXåOnce the group is ready, it may be added to the container by opening the VFIO group character device (/dev/vfio/$GROUP) and using the VFIO_GROUP_SET_CONTAINER ioctl, passing the file descriptor of the previously opened container file. If desired and if the IOMMU driver supports sharing the IOMMU context between groups, multiple groups may be set to the same container. If a group fails to set to a container with existing groups, a new empty container will need to be used instead.”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KchjCh²hubhâ)�”}”(hXWith a group (or groups) attached to a container, the remaining ioctls become available, enabling access to the VFIO IOMMU interfaces. Additionally, it now becomes possible to get file descriptors for each device within a group using an ioctl on the VFIO group file descriptor.”h]”hXWith a group (or groups) attached to a container, the remaining ioctls become available, enabling access to the VFIO IOMMU interfaces. Additionally, it now becomes possible to get file descriptors for each device within a group using an ioctl on the VFIO group file descriptor.”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KlhjCh²hubhâ)�”}”(hŒØThe VFIO device API includes ioctls for describing the device, the I/O regions and their read/write/mmap offsets on the device descriptor, as well as mechanisms for describing and registering interrupt notifications.”h]”hŒØThe VFIO device API includes ioctls for describing the device, the I/O regions and their read/write/mmap offsets on the device descriptor, as well as mechanisms for describing and registering interrupt notifications.”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KqhjCh²hubeh}”(h]”Œgroups-devices-and-iommus”ah ]”h"]”Œgroups, devices, and iommus”ah$]”h&]”uh1hµhh·h²hh³hàh´K$ubh¶)�”}”(hhh]”(h»)�”}”(hŒVFIO Usage Example”h]”hŒVFIO Usage Example”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÚh²hh³hàh´Kwubhâ)�”}”(hŒ5Assume user wants to access PCI device 0000:06:0d.0::”h]”hŒ4Assume user wants to access PCI device 0000:06:0d.0:”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KyhjÚh²hubhŒ literal_block”“”)�”}”(hŒ[$ readlink /sys/bus/pci/devices/0000:06:0d.0/iommu_group ../../../../kernel/iommu_groups/26”h]”hŒ[$ readlink /sys/bus/pci/devices/0000:06:0d.0/iommu_group ../../../../kernel/iommu_groups/26”…”�”}”hjûsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jùh³hàh´K{hjÚh²hubhâ)�”}”(hŒŽThis device is therefore in IOMMU group 26. This device is on the pci bus, therefore the user will make use of vfio-pci to manage the group::”h]”hŒ�This device is therefore in IOMMU group 26. This device is on the pci bus, therefore the user will make use of vfio-pci to manage the group:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K~hjÚh²hubjú)�”}”(hŒ# modprobe vfio-pci”h]”hŒ# modprobe vfio-pci”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´K‚hjÚh²hubhâ)�”}”(hŒdBinding this device to the vfio-pci driver creates the VFIO group character devices for this group::”h]”hŒcBinding this device to the vfio-pci driver creates the VFIO group character devices for this group:”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K„hjÚh²hubjú)�”}”(hŒ¹$ lspci -n -s 0000:06:0d.0 06:0d.0 0401: 1102:0002 (rev 08) # echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind # echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id”h]”hŒ¹$ lspci -n -s 0000:06:0d.0 06:0d.0 0401: 1102:0002 (rev 08) # echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind # echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id”…”�”}”hj5sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´K‡hjÚh²hubhâ)�”}”(hŒWNow we need to look at what other devices are in the group to free it for use by VFIO::”h]”hŒVNow we need to look at what other devices are in the group to free it for use by VFIO:”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KŒhjÚh²hubjú)�”}”(hX $ ls -l /sys/bus/pci/devices/0000:06:0d.0/iommu_group/devices total 0 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:00:1e.0 -> ../../../../devices/pci0000:00/0000:00:1e.0 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:06:0d.0 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.0 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:06:0d.1 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.1”h]”hX $ ls -l /sys/bus/pci/devices/0000:06:0d.0/iommu_group/devices total 0 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:00:1e.0 -> ../../../../devices/pci0000:00/0000:00:1e.0 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:06:0d.0 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.0 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:06:0d.1 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.1”…”�”}”hjQsbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´K�hjÚh²hubhâ)�”}”(hX]This device is behind a PCIe-to-PCI bridge [4]_, therefore we also need to add device 0000:06:0d.1 to the group following the same procedure as above. Device 0000:00:1e.0 is a bridge that does not currently have a host driver, therefore it's not required to bind this device to the vfio-pci driver (vfio-pci does not currently support PCI bridges).”h]”(hŒ+This device is behind a PCIe-to-PCI bridge ”…”�”}”(hj_h²hh³Nh´NubhÅ)�”}”(hŒ[4]_”h]”hŒ4”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”Œid4”ah ]”h"]”h$]”h&]”hÕŒid12”h×hØuh1hÄhj_hÙKubhX0, therefore we also need to add device 0000:06:0d.1 to the group following the same procedure as above. Device 0000:00:1e.0 is a bridge that does not currently have a host driver, therefore it’s not required to bind this device to the vfio-pci driver (vfio-pci does not currently support PCI bridges).”…”�”}”(hj_h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K˜hjÚh²hubhâ)�”}”(hŒãThe final step is to provide the user with access to the group if unprivileged operation is desired (note that /dev/vfio/vfio provides no capabilities on its own and is therefore expected to be set to mode 0666 by the system)::”h]”hŒâThe final step is to provide the user with access to the group if unprivileged operation is desired (note that /dev/vfio/vfio provides no capabilities on its own and is therefore expected to be set to mode 0666 by the system):”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KŸhjÚh²hubjú)�”}”(hŒ# chown user:user /dev/vfio/26”h]”hŒ# chown user:user /dev/vfio/26”…”�”}”hj�sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´K¤hjÚh²hubhâ)�”}”(hŒmThe user now has full access to all the devices and the iommu for this group and can access them as follows::”h]”hŒlThe user now has full access to all the devices and the iommu for this group and can access them as follows:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´K¦hjÚh²hubjú)�”}”(hX] int container, group, device, i; struct vfio_group_status group_status = { .argsz = sizeof(group_status) }; struct vfio_iommu_type1_info iommu_info = { .argsz = sizeof(iommu_info) }; struct vfio_iommu_type1_dma_map dma_map = { .argsz = sizeof(dma_map) }; struct vfio_device_info device_info = { .argsz = sizeof(device_info) }; /* Create a new container */ container = open("/dev/vfio/vfio", O_RDWR); if (ioctl(container, VFIO_GET_API_VERSION) != VFIO_API_VERSION) /* Unknown API version */ if (!ioctl(container, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU)) /* Doesn't support the IOMMU driver we want. */ /* Open the group */ group = open("/dev/vfio/26", O_RDWR); /* Test the group is viable and available */ ioctl(group, VFIO_GROUP_GET_STATUS, &group_status); if (!(group_status.flags & VFIO_GROUP_FLAGS_VIABLE)) /* Group is not viable (ie, not all devices bound for vfio) */ /* Add the group to the container */ ioctl(group, VFIO_GROUP_SET_CONTAINER, &container); /* Enable the IOMMU model we want */ ioctl(container, VFIO_SET_IOMMU, VFIO_TYPE1_IOMMU); /* Get addition IOMMU info */ ioctl(container, VFIO_IOMMU_GET_INFO, &iommu_info); /* Allocate some space and setup a DMA mapping */ dma_map.vaddr = mmap(0, 1024 * 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); dma_map.size = 1024 * 1024; dma_map.iova = 0; /* 1MB starting at 0x0 from device view */ dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; ioctl(container, VFIO_IOMMU_MAP_DMA, &dma_map); /* Get a file descriptor for the device */ device = ioctl(group, VFIO_GROUP_GET_DEVICE_FD, "0000:06:0d.0"); /* Test and setup the device */ ioctl(device, VFIO_DEVICE_GET_INFO, &device_info); for (i = 0; i < device_info.num_regions; i++) { struct vfio_region_info reg = { .argsz = sizeof(reg) }; reg.index = i; ioctl(device, VFIO_DEVICE_GET_REGION_INFO, ®); /* Setup mappings... read/write offsets, mmaps * For PCI devices, config space is a region */ } for (i = 0; i < device_info.num_irqs; i++) { struct vfio_irq_info irq = { .argsz = sizeof(irq) }; irq.index = i; ioctl(device, VFIO_DEVICE_GET_IRQ_INFO, &irq); /* Setup IRQs... eventfds, VFIO_DEVICE_SET_IRQS */ } /* Gratuitous device reset and go... */ ioctl(device, VFIO_DEVICE_RESET);”h]”hX] int container, group, device, i; struct vfio_group_status group_status = { .argsz = sizeof(group_status) }; struct vfio_iommu_type1_info iommu_info = { .argsz = sizeof(iommu_info) }; struct vfio_iommu_type1_dma_map dma_map = { .argsz = sizeof(dma_map) }; struct vfio_device_info device_info = { .argsz = sizeof(device_info) }; /* Create a new container */ container = open("/dev/vfio/vfio", O_RDWR); if (ioctl(container, VFIO_GET_API_VERSION) != VFIO_API_VERSION) /* Unknown API version */ if (!ioctl(container, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU)) /* Doesn't support the IOMMU driver we want. */ /* Open the group */ group = open("/dev/vfio/26", O_RDWR); /* Test the group is viable and available */ ioctl(group, VFIO_GROUP_GET_STATUS, &group_status); if (!(group_status.flags & VFIO_GROUP_FLAGS_VIABLE)) /* Group is not viable (ie, not all devices bound for vfio) */ /* Add the group to the container */ ioctl(group, VFIO_GROUP_SET_CONTAINER, &container); /* Enable the IOMMU model we want */ ioctl(container, VFIO_SET_IOMMU, VFIO_TYPE1_IOMMU); /* Get addition IOMMU info */ ioctl(container, VFIO_IOMMU_GET_INFO, &iommu_info); /* Allocate some space and setup a DMA mapping */ dma_map.vaddr = mmap(0, 1024 * 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); dma_map.size = 1024 * 1024; dma_map.iova = 0; /* 1MB starting at 0x0 from device view */ dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; ioctl(container, VFIO_IOMMU_MAP_DMA, &dma_map); /* Get a file descriptor for the device */ device = ioctl(group, VFIO_GROUP_GET_DEVICE_FD, "0000:06:0d.0"); /* Test and setup the device */ ioctl(device, VFIO_DEVICE_GET_INFO, &device_info); for (i = 0; i < device_info.num_regions; i++) { struct vfio_region_info reg = { .argsz = sizeof(reg) }; reg.index = i; ioctl(device, VFIO_DEVICE_GET_REGION_INFO, ®); /* Setup mappings... read/write offsets, mmaps * For PCI devices, config space is a region */ } for (i = 0; i < device_info.num_irqs; i++) { struct vfio_irq_info irq = { .argsz = sizeof(irq) }; irq.index = i; ioctl(device, VFIO_DEVICE_GET_IRQ_INFO, &irq); /* Setup IRQs... eventfds, VFIO_DEVICE_SET_IRQS */ } /* Gratuitous device reset and go... */ ioctl(device, VFIO_DEVICE_RESET);”…”�”}”hj«sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´K©hjÚh²hubeh}”(h]”Œvfio-usage-example”ah ]”h"]”Œvfio usage example”ah$]”h&]”uh1hµhh·h²hh³hàh´Kwubh¶)�”}”(hhh]”(h»)�”}”(hŒIOMMUFD and vfio_iommu_type1”h]”hŒIOMMUFD and vfio_iommu_type1”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÁh²hh³hàh´Kóubhâ)�”}”(hX›IOMMUFD is the new user API to manage I/O page tables from userspace. It intends to be the portal of delivering advanced userspace DMA features (nested translation [5]_, PASID [6]_, etc.) while also providing a backwards compatibility interface for existing VFIO_TYPE1v2_IOMMU use cases. Eventually the vfio_iommu_type1 driver, as well as the legacy vfio container and group model is intended to be deprecated.”h]”(hŒ¤IOMMUFD is the new user API to manage I/O page tables from userspace. It intends to be the portal of delivering advanced userspace DMA features (nested translation ”…”�”}”(hjÒh²hh³Nh´NubhÅ)�”}”(hŒ[5]_”h]”hŒ5”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”Œid5”ah ]”h"]”h$]”h&]”hÕŒid13”h×hØuh1hÄhjÒhÙKubhŒ, PASID ”…”�”}”(hjÒh²hh³Nh´NubhÅ)�”}”(hŒ[6]_”h]”hŒ6”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”Œid6”ah ]”h"]”h$]”h&]”hÕŒid14”h×hØuh1hÄhjÒhÙKubhŒç, etc.) while also providing a backwards compatibility interface for existing VFIO_TYPE1v2_IOMMU use cases. Eventually the vfio_iommu_type1 driver, as well as the legacy vfio container and group model is intended to be deprecated.”…”�”}”(hjÒh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KõhjÁh²hubhâ)�”}”(hXThe IOMMUFD backwards compatibility interface can be enabled two ways. In the first method, the kernel can be configured with CONFIG_IOMMUFD_VFIO_CONTAINER, in which case the IOMMUFD subsystem transparently provides the entire infrastructure for the VFIO container and IOMMU backend interfaces. The compatibility mode can also be accessed if the VFIO container interface, ie. /dev/vfio/vfio is simply symlink'd to /dev/iommu. Note that at the time of writing, the compatibility mode is not entirely feature complete relative to VFIO_TYPE1v2_IOMMU (ex. DMA mapping MMIO) and does not attempt to provide compatibility to the VFIO_SPAPR_TCE_IOMMU interface. Therefore it is not generally advisable at this time to switch from native VFIO implementations to the IOMMUFD compatibility interfaces.”h]”hXThe IOMMUFD backwards compatibility interface can be enabled two ways. In the first method, the kernel can be configured with CONFIG_IOMMUFD_VFIO_CONTAINER, in which case the IOMMUFD subsystem transparently provides the entire infrastructure for the VFIO container and IOMMU backend interfaces. The compatibility mode can also be accessed if the VFIO container interface, ie. /dev/vfio/vfio is simply symlink’d to /dev/iommu. Note that at the time of writing, the compatibility mode is not entirely feature complete relative to VFIO_TYPE1v2_IOMMU (ex. DMA mapping MMIO) and does not attempt to provide compatibility to the VFIO_SPAPR_TCE_IOMMU interface. Therefore it is not generally advisable at this time to switch from native VFIO implementations to the IOMMUFD compatibility interfaces.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´KühjÁh²hubhâ)�”}”(hŒœLong term, VFIO users should migrate to device access through the cdev interface described below, and native access through the IOMMUFD provided interfaces.”h]”hŒœLong term, VFIO users should migrate to device access through the cdev interface described below, and native access through the IOMMUFD provided interfaces.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M hjÁh²hubeh}”(h]”Œiommufd-and-vfio-iommu-type1”ah ]”h"]”Œiommufd and vfio_iommu_type1”ah$]”h&]”uh1hµhh·h²hh³hàh´Kóubh¶)�”}”(hhh]”(h»)�”}”(hŒVFIO Device cdev”h]”hŒVFIO Device cdev”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj,h²hh³hàh´Mubhâ)�”}”(hŒUTraditionally user acquires a device fd via VFIO_GROUP_GET_DEVICE_FD in a VFIO group.”h]”hŒUTraditionally user acquires a device fd via VFIO_GROUP_GET_DEVICE_FD in a VFIO group.”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mhj,h²hubhâ)�”}”(hŒÍWith CONFIG_VFIO_DEVICE_CDEV=y the user can now acquire a device fd by directly opening a character device /dev/vfio/devices/vfioX where "X" is the number allocated uniquely by VFIO for registered devices.”h]”hŒÑWith CONFIG_VFIO_DEVICE_CDEV=y the user can now acquire a device fd by directly opening a character device /dev/vfio/devices/vfioX where “Xâ€� is the number allocated uniquely by VFIO for registered devices.”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mhj,h²hubhâ)�”}”(hX*The cdev only works with IOMMUFD. Both VFIO drivers and applications must adapt to the new cdev security model which requires using VFIO_DEVICE_BIND_IOMMUFD to claim DMA ownership before starting to actually use the device. Once BIND succeeds then a VFIO device can be fully accessed by the user.”h]”hX*The cdev only works with IOMMUFD. Both VFIO drivers and applications must adapt to the new cdev security model which requires using VFIO_DEVICE_BIND_IOMMUFD to claim DMA ownership before starting to actually use the device. Once BIND succeeds then a VFIO device can be fully accessed by the user.”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mhj,h²hubhâ)�”}”(hŒ­VFIO device cdev doesn't rely on VFIO group/container/iommu drivers. Hence those modules can be fully compiled out in an environment where no legacy VFIO application exists.”h]”hŒ¯VFIO device cdev doesn’t rely on VFIO group/container/iommu drivers. Hence those modules can be fully compiled out in an environment where no legacy VFIO application exists.”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mhj,h²hubhâ)�”}”(hŒTSo far SPAPR does not support IOMMUFD yet. So it cannot support device cdev either.”h]”hŒTSo far SPAPR does not support IOMMUFD yet. So it cannot support device cdev either.”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M!hj,h²hubhâ)�”}”(hX©vfio device cdev access is still bound by IOMMU group semantics, ie. there can be only one DMA owner for the group. Devices belonging to the same group can not be bound to multiple iommufd_ctx or shared between native kernel and vfio bus driver or other driver supporting the driver_managed_dma flag. A violation of this ownership requirement will fail at the VFIO_DEVICE_BIND_IOMMUFD ioctl, which gates full device access.”h]”hX©vfio device cdev access is still bound by IOMMU group semantics, ie. there can be only one DMA owner for the group. Devices belonging to the same group can not be bound to multiple iommufd_ctx or shared between native kernel and vfio bus driver or other driver supporting the driver_managed_dma flag. A violation of this ownership requirement will fail at the VFIO_DEVICE_BIND_IOMMUFD ioctl, which gates full device access.”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M$hj,h²hubeh}”(h]”Œvfio-device-cdev”ah ]”h"]”Œvfio device cdev”ah$]”h&]”uh1hµhh·h²hh³hàh´Mubh¶)�”}”(hhh]”(h»)�”}”(hŒDevice cdev Example”h]”hŒDevice cdev Example”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj™h²hh³hàh´M,ubhâ)�”}”(hŒ5Assume user wants to access PCI device 0000:6a:01.0::”h]”hŒ4Assume user wants to access PCI device 0000:6a:01.0:”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M.hj™h²hubjú)�”}”(hŒ6$ ls /sys/bus/pci/devices/0000:6a:01.0/vfio-dev/ vfio0”h]”hŒ6$ ls /sys/bus/pci/devices/0000:6a:01.0/vfio-dev/ vfio0”…”�”}”hj¸sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´M0hj™h²hubhâ)�”}”(hŒSThis device is therefore represented as vfio0. The user can verify its existence::”h]”hŒRThis device is therefore represented as vfio0. The user can verify its existence:”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M3hj™h²hubjú)�”}”(hX $ ls -l /dev/vfio/devices/vfio0 crw------- 1 root root 511, 0 Feb 16 01:22 /dev/vfio/devices/vfio0 $ cat /sys/bus/pci/devices/0000:6a:01.0/vfio-dev/vfio0/dev 511:0 $ ls -l /dev/char/511\:0 lrwxrwxrwx 1 root root 21 Feb 16 01:22 /dev/char/511:0 -> ../vfio/devices/vfio0”h]”hX $ ls -l /dev/vfio/devices/vfio0 crw------- 1 root root 511, 0 Feb 16 01:22 /dev/vfio/devices/vfio0 $ cat /sys/bus/pci/devices/0000:6a:01.0/vfio-dev/vfio0/dev 511:0 $ ls -l /dev/char/511\:0 lrwxrwxrwx 1 root root 21 Feb 16 01:22 /dev/char/511:0 -> ../vfio/devices/vfio0”…”�”}”hjÔsbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´M6hj™h²hubhâ)�”}”(hŒVThen provide the user with access to the device if unprivileged operation is desired::”h]”hŒUThen provide the user with access to the device if unprivileged operation is desired:”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M=hj™h²hubjú)�”}”(hŒ)$ chown user:user /dev/vfio/devices/vfio0”h]”hŒ)$ chown user:user /dev/vfio/devices/vfio0”…”�”}”hjðsbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´M@hj™h²hubhâ)�”}”(hŒ'Finally the user could get cdev fd by::”h]”hŒ&Finally the user could get cdev fd by:”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MBhj™h²hubjú)�”}”(hŒ2cdev_fd = open("/dev/vfio/devices/vfio0", O_RDWR);”h]”hŒ2cdev_fd = open("/dev/vfio/devices/vfio0", O_RDWR);”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´MDhj™h²hubhâ)�”}”(hŒ÷An opened cdev_fd doesn't give the user any permission of accessing the device except binding the cdev_fd to an iommufd. After that point then the device is fully accessible including attaching it to an IOMMUFD IOAS/HWPT to enable userspace DMA::”h]”hŒøAn opened cdev_fd doesn’t give the user any permission of accessing the device except binding the cdev_fd to an iommufd. After that point then the device is fully accessible including attaching it to an IOMMUFD IOAS/HWPT to enable userspace DMA:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MFhj™h²hubjú)�”}”(hX¯struct vfio_device_bind_iommufd bind = { .argsz = sizeof(bind), .flags = 0, }; struct iommu_ioas_alloc alloc_data = { .size = sizeof(alloc_data), .flags = 0, }; struct vfio_device_attach_iommufd_pt attach_data = { .argsz = sizeof(attach_data), .flags = 0, }; struct iommu_ioas_map map = { .size = sizeof(map), .flags = IOMMU_IOAS_MAP_READABLE | IOMMU_IOAS_MAP_WRITEABLE | IOMMU_IOAS_MAP_FIXED_IOVA, .__reserved = 0, }; iommufd = open("/dev/iommu", O_RDWR); bind.iommufd = iommufd; ioctl(cdev_fd, VFIO_DEVICE_BIND_IOMMUFD, &bind); ioctl(iommufd, IOMMU_IOAS_ALLOC, &alloc_data); attach_data.pt_id = alloc_data.out_ioas_id; ioctl(cdev_fd, VFIO_DEVICE_ATTACH_IOMMUFD_PT, &attach_data); /* Allocate some space and setup a DMA mapping */ map.user_va = (int64_t)mmap(0, 1024 * 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); map.iova = 0; /* 1MB starting at 0x0 from device view */ map.length = 1024 * 1024; map.ioas_id = alloc_data.out_ioas_id; ioctl(iommufd, IOMMU_IOAS_MAP, &map); /* Other device operations as stated in "VFIO Usage Example" */”h]”hX¯struct vfio_device_bind_iommufd bind = { .argsz = sizeof(bind), .flags = 0, }; struct iommu_ioas_alloc alloc_data = { .size = sizeof(alloc_data), .flags = 0, }; struct vfio_device_attach_iommufd_pt attach_data = { .argsz = sizeof(attach_data), .flags = 0, }; struct iommu_ioas_map map = { .size = sizeof(map), .flags = IOMMU_IOAS_MAP_READABLE | IOMMU_IOAS_MAP_WRITEABLE | IOMMU_IOAS_MAP_FIXED_IOVA, .__reserved = 0, }; iommufd = open("/dev/iommu", O_RDWR); bind.iommufd = iommufd; ioctl(cdev_fd, VFIO_DEVICE_BIND_IOMMUFD, &bind); ioctl(iommufd, IOMMU_IOAS_ALLOC, &alloc_data); attach_data.pt_id = alloc_data.out_ioas_id; ioctl(cdev_fd, VFIO_DEVICE_ATTACH_IOMMUFD_PT, &attach_data); /* Allocate some space and setup a DMA mapping */ map.user_va = (int64_t)mmap(0, 1024 * 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); map.iova = 0; /* 1MB starting at 0x0 from device view */ map.length = 1024 * 1024; map.ioas_id = alloc_data.out_ioas_id; ioctl(iommufd, IOMMU_IOAS_MAP, &map); /* Other device operations as stated in "VFIO Usage Example" */”…”�”}”hj(sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´MKhj™h²hubeh}”(h]”Œdevice-cdev-example”ah ]”h"]”Œdevice cdev example”ah$]”h&]”uh1hµhh·h²hh³hàh´M,ubh¶)�”}”(hhh]”(h»)�”}”(hŒVFIO NOIOMMU mode”h]”hŒVFIO NOIOMMU mode”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj>h²hh³hàh´Mtubhâ)�”}”(hŒ·VFIO also supports a no-IOMMU mode, intended for usages where unsafe DMA can be performed by userspace drivers w/o physical IOMMU protection. This mode is controlled by the parameter:”h]”hŒ·VFIO also supports a no-IOMMU mode, intended for usages where unsafe DMA can be performed by userspace drivers w/o physical IOMMU protection. This mode is controlled by the parameter:”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Muhj>h²hubhâ)�”}”(hŒ6/sys/module/vfio/parameters/enable_unsafe_noiommu_mode”h]”hŒ6/sys/module/vfio/parameters/enable_unsafe_noiommu_mode”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Myhj>h²hubhâ)�”}”(hŒvUpon enabling this mode, with an assigned device, the user will be presented with a VFIO group and device file, e.g.::”h]”hŒuUpon enabling this mode, with an assigned device, the user will be presented with a VFIO group and device file, e.g.:”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M{hj>h²hubjú)�”}”(hŒs/dev/vfio/ |-- devices | `-- noiommu-vfioX /* VFIO device cdev */ |-- noiommu-Y /* VFIO group */ `-- vfio”h]”hŒs/dev/vfio/ |-- devices | `-- noiommu-vfioX /* VFIO device cdev */ |-- noiommu-Y /* VFIO group */ `-- vfio”…”�”}”hjysbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´M~hj>h²hubhâ)�”}”(hŒüThe capabilities vary depending on the device programming interface and kernel configuration used. The following table summarizes the differences ("Yes" means the UAPI is accessible and functional in noiommu mode, "No" means the UAPI is not supported):”h]”hXThe capabilities vary depending on the device programming interface and kernel configuration used. The following table summarizes the differences (“Yesâ€� means the UAPI is accessible and functional in noiommu mode, “Noâ€� means the UAPI is not supported):”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M„hj>h²hubhŒtable”“”)�”}”(hhh]”hŒtgroup”“”)�”}”(hhh]”(hŒcolspec”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjœubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjœubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjœubhŒthead”“”)�”}”(hhh]”hŒrow”“”)�”}”(hhh]”(hŒentry”“”)�”}”(hhh]”hâ)�”}”(hŒFeature”h]”hŒFeature”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŠhjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÆubjÊ)�”}”(hhh]”hâ)�”}”(hŒ VFIO group”h]”hŒ VFIO group”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŠhjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÆubjÊ)�”}”(hhh]”hâ)�”}”(hŒVFIO device cdev”h]”hŒVFIO device cdev”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŠhjùubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÆubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhjÁubah}”(h]”h ]”h"]”h$]”h&]”uh1j¿hjœubhŒtbody”“”)�”}”(hhh]”(jÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒVFIO device UAPI”h]”hŒVFIO device UAPI”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŒhj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj!ubjÊ)�”}”(hhh]”hâ)�”}”(hŒYes”h]”hŒYes”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŒhj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj!ubjÊ)�”}”(hhh]”hâ)�”}”(hŒYes”h]”hŒYes”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŒhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj!ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhjubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒVFIO container”h]”hŒVFIO container”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŽhjrubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjoubjÊ)�”}”(hhh]”hâ)�”}”(hŒNo”h]”hŒNo”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŽhj‰ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjoubjÊ)�”}”(hhh]”hâ)�”}”(hŒNo”h]”hŒNo”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MŽhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjoubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhjubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ IOMMUFD IOAS”h]”hŒ IOMMUFD IOAS”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M�hjÀubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj½ubjÊ)�”}”(hhh]”hâ)�”}”(hŒNo”h]”hŒNo”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M�hj×ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj½ubjÊ)�”}”(hhh]”hâ)�”}”(hŒYes*”h]”hŒYes*”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M�hjîubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj½ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjœubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jšhj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1j•hj>h²hh³hàh´Nubhâ)�”}”(hŒ¨Note that the VFIO container case includes IOMMUFD provided VFIO compatibility interfaces when either CONFIG_VFIO_CONTAINER or CONFIG_IOMMUFD_VFIO_CONTAINER is enabled.”h]”hŒ¨Note that the VFIO container case includes IOMMUFD provided VFIO compatibility interfaces when either CONFIG_VFIO_CONTAINER or CONFIG_IOMMUFD_VFIO_CONTAINER is enabled.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M“hj>h²hubhŒ bullet_list”“”)�”}”(hhh]”hŒ list_item”“”)�”}”(hŒ–IOMMUFD UAPI is available for VFIO device cdev to pin and map user memory with the ability to retrieve physical addresses for DMA command submission. ”h]”hâ)�”}”(hŒ•IOMMUFD UAPI is available for VFIO device cdev to pin and map user memory with the ability to retrieve physical addresses for DMA command submission.”h]”hŒ•IOMMUFD UAPI is available for VFIO device cdev to pin and map user memory with the ability to retrieve physical addresses for DMA command submission.”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M—hj3ubah}”(h]”h ]”h"]”h$]”h&]”uh1j1hj.h²hh³hàh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1j,h³hàh´M—hj>h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒKconfig Support Matrix”h]”hŒKconfig Support Matrix”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjSh²hh³hàh´M›ubhâ)�”}”(hXThe visibility of CONFIG_VFIO_NOIOMMU depends on the combination of CONFIG_VFIO_GROUP, CONFIG_VFIO_DEVICE_CDEV, and whether a container backend (CONFIG_VFIO_CONTAINER or CONFIG_IOMMUFD_VFIO_CONTAINER) is configured. The Kconfig dependencies enforce the following constraints:”h]”hXThe visibility of CONFIG_VFIO_NOIOMMU depends on the combination of CONFIG_VFIO_GROUP, CONFIG_VFIO_DEVICE_CDEV, and whether a container backend (CONFIG_VFIO_CONTAINER or CONFIG_IOMMUFD_VFIO_CONTAINER) is configured. The Kconfig dependencies enforce the following constraints:”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M�hjSh²hubj-)�”}”(hhh]”(j2)�”}”(hŒ;At least one access path (group or cdev) must be available.”h]”hâ)�”}”(hjwh]”hŒ;At least one access path (group or cdev) must be available.”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¢hjuubah}”(h]”h ]”h"]”h$]”h&]”uh1j1hjrh²hh³hàh´Nubj2)�”}”(hŒvIf VFIO_GROUP is enabled, a container backend is required; otherwise the group node would be unusable in noiommu mode.”h]”hâ)�”}”(hŒvIf VFIO_GROUP is enabled, a container backend is required; otherwise the group node would be unusable in noiommu mode.”h]”hŒvIf VFIO_GROUP is enabled, a container backend is required; otherwise the group node would be unusable in noiommu mode.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M£hjŒubah}”(h]”h ]”h"]”h$]”h&]”uh1j1hjrh²hh³hàh´Nubj2)�”}”(hŒgThe cdev noiommu path requires CONFIG_GENERIC_ATOMIC64=n because it depends on CONFIG_IOMMUFD_NOIOMMU. ”h]”hâ)�”}”(hŒfThe cdev noiommu path requires CONFIG_GENERIC_ATOMIC64=n because it depends on CONFIG_IOMMUFD_NOIOMMU.”h]”hŒfThe cdev noiommu path requires CONFIG_GENERIC_ATOMIC64=n because it depends on CONFIG_IOMMUFD_NOIOMMU.”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¥hj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1j1hjrh²hh³hàh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jQŒ-”uh1j,h³hàh´M¢hjSh²hubhâ)�”}”(hŒThe resulting support matrix:”h]”hŒThe resulting support matrix:”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¨hjSh²hubj–)�”}”(hhh]”j›)�”}”(hhh]”(j )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjÔubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjÔubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K uh1jŸhjÔubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjÔubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K uh1jŸhjÔubj )�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jŸhjÔubjÀ)�”}”(hhh]”jÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒCase”h]”hŒCase”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M«hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubjÊ)�”}”(hhh]”hâ)�”}”(hŒGROUP”h]”hŒGROUP”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M«hj0ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubjÊ)�”}”(hhh]”hâ)�”}”(hŒ Container”h]”hŒ Container”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M«hjGubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubjÊ)�”}”(hhh]”hâ)�”}”(hŒCDEV”h]”hŒCDEV”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M«hj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubjÊ)�”}”(hhh]”hâ)�”}”(hŒNOIOMMU”h]”hŒNOIOMMU”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M«hjuubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubjÊ)�”}”(hhh]”hâ)�”}”(hŒNotes”h]”hŒNotes”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M«hjŒubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j¿hjÔubj)�”}”(hhh]”(jÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ1”h]”hŒ1”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M­hjµubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj²ubjÊ)�”}”(hhh]”hâ)�”}”(hŒy”h]”hŒy”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M­hjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj²ubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M­hjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj²ubjÊ)�”}”(hhh]”hâ)�”}”(hŒn”h]”hŒn”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M­hjùubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj²ubjÊ)�”}”(hhh]”hâ)�”}”(hŒyes”h]”hŒyes”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M­hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj²ubjÊ)�”}”(hhh]”hâ)�”}”(hŒGroup noiommu works”h]”hŒGroup noiommu works”…”�”}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M­hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj²ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhj¯ubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ2”h]”hŒ2”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¯hjGubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjDubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¯hj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjDubjÊ)�”}”(hhh]”hâ)�”}”(hjþh]”hŒn”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¯hjtubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjDubjÊ)�”}”(hhh]”hâ)�”}”(hjþh]”hŒn”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¯hjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjDubjÊ)�”}”(hhh]”hâ)�”}”(hŒno”h]”hŒno”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¯hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjDubjÊ)�”}”(hhh]”hâ)�”}”(hŒBlocked - no container”h]”hŒBlocked - no container”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¯hj·ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjDubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhj¯ubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ3”h]”hŒ3”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M±hj×ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÔubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M±hjîubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÔubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M±hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÔubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M±hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÔubjÊ)�”}”(hhh]”hâ)�”}”(hŒyes”h]”hŒyes”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M±hj0 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÔubjÊ)�”}”(hhh]”hâ)�”}”(hŒBoth paths work [#cdev]_”h]”(hŒBoth paths work ”…”�”}”(hjJ h²hh³Nh´NubhÅ)�”}”(hŒ[#cdev]_”h]”hŒ7”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”Œid7”ah ]”h"]”h$]”h&]”Œauto”KhÕŒcdev”h×hØuh1hÄhjJ hÙKubeh}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M±hjG ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÔubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhj¯ubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ4”h]”hŒ4”…”�”}”(hj{ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M³hjx ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhju ubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hj’ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M³hj� ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhju ubjÊ)�”}”(hhh]”hâ)�”}”(hjþh]”hŒn”…”�”}”(hj¨ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M³hj¥ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhju ubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hj¾ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M³hj» ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhju ubjÊ)�”}”(hhh]”hâ)�”}”(hŒno”h]”hŒno”…”�”}”(hjÔ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M³hjÑ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhju ubjÊ)�”}”(hhh]”hâ)�”}”(hŒBlocked - no container”h]”hŒBlocked - no container”…”�”}”(hjë h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M³hjè ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhju ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhj¯ubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ5”h]”hŒ5”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mµhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubjÊ)�”}”(hhh]”hâ)�”}”(hjþh]”hŒn”…”�”}”(hj" h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mµhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubjÊ)�”}”(hhh]”j-)�”}”(hhh]”j2)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1j1hj8 ubah}”(h]”h ]”h"]”h$]”h&]”jQjÂuh1j,h³hàh´Mµhj5 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubjÊ)�”}”(hhh]”hâ)�”}”(hjÑh]”hŒy”…”�”}”(hjS h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MµhjP ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubjÊ)�”}”(hhh]”hâ)�”}”(hŒyes”h]”hŒyes”…”�”}”(hji h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mµhjf ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubjÊ)�”}”(hhh]”hâ)�”}”(hŒCdev-only works [#cdev]_”h]”(hŒCdev-only works ”…”�”}”(hj€ h²hh³Nh´NubhÅ)�”}”(hŒ[#cdev]_”h]”hŒ7”…”�”}”(hjˆ h²hh³Nh´Nubah}”(h]”Œid8”ah ]”h"]”h$]”h&]”ja KhÕjb h×hØuh1hÄhj€ hÙKubeh}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´Mµhj} ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhj¯ubjÅ)�”}”(hhh]”(jÊ)�”}”(hhh]”hâ)�”}”(hŒ6”h]”hŒ6”…”�”}”(hj¯ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M·hj¬ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj© ubjÊ)�”}”(hhh]”hâ)�”}”(hjþh]”hŒn”…”�”}”(hjÆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M·hjà ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj© ubjÊ)�”}”(hhh]”j-)�”}”(hhh]”j2)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1j1hjÜ ubah}”(h]”h ]”h"]”h$]”h&]”jQjÂuh1j,h³hàh´M·hjÙ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj© ubjÊ)�”}”(hhh]”hâ)�”}”(hjþh]”hŒn”…”�”}”(hj÷ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M·hjô ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj© ubjÊ)�”}”(hhh]”hâ)�”}”(hŒno”h]”hŒno”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M·hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj© ubjÊ)�”}”(hhh]”hâ)�”}”(hŒNo access path”h]”hŒNo access path”…”�”}”(hj$ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M·hj! ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj© ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÄhj¯ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjÔubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jšhjÑubah}”(h]”h ]”h"]”h$]”h&]”uh1j•hjSh²hh³hàh´Nubhâ)�”}”(hXContainer = CONFIG_VFIO_CONTAINER or CONFIG_IOMMUFD_VFIO_CONTAINER (either suffices). Case 4 is intentionally blocked: allowing NOIOMMU with GROUP enabled but no container would create unusable group nodes. Users who want cdev-only noiommu should set CONFIG_VFIO_GROUP=n (case 5).”h]”hXContainer = CONFIG_VFIO_CONTAINER or CONFIG_IOMMUFD_VFIO_CONTAINER (either suffices). Case 4 is intentionally blocked: allowing NOIOMMU with GROUP enabled but no container would create unusable group nodes. Users who want cdev-only noiommu should set CONFIG_VFIO_GROUP=n (case 5).”…”�”}”(hjQ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MºhjSh²hubhŒfootnote”“”)�”}”(hX-The cdev noiommu path requires CONFIG_GENERIC_ATOMIC64=n. When CONFIG_VFIO_GROUP=y, CONFIG_VFIO_DEVICE_CDEV=y, and CONFIG_GENERIC_ATOMIC64=y, CONFIG_VFIO_NOIOMMU remains selectable for the group path, but no noiommu device cdev is registered. Cdev-only noiommu is not selectable on those platforms. ”h]”(hŒlabel”“”)�”}”(hhh]”hŒ7”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1je hja h²hh³Nh´Nubhâ)�”}”(hX,The cdev noiommu path requires CONFIG_GENERIC_ATOMIC64=n. When CONFIG_VFIO_GROUP=y, CONFIG_VFIO_DEVICE_CDEV=y, and CONFIG_GENERIC_ATOMIC64=y, CONFIG_VFIO_NOIOMMU remains selectable for the group path, but no noiommu device cdev is registered. Cdev-only noiommu is not selectable on those platforms.”h]”hX,The cdev noiommu path requires CONFIG_GENERIC_ATOMIC64=n. When CONFIG_VFIO_GROUP=y, CONFIG_VFIO_DEVICE_CDEV=y, and CONFIG_GENERIC_ATOMIC64=y, CONFIG_VFIO_NOIOMMU remains selectable for the group path, but no noiommu device cdev is registered. Cdev-only noiommu is not selectable on those platforms.”…”�”}”(hjt h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M¿hja ubeh}”(h]”jb ah ]”h"]”Œcdev”ah$]”h&]”(j\ j’ eja Kh×hØuh1j_ h³hàh´M¿hjSh²hubhâ)�”}”(hX0A new IOMMUFD ioctl IOMMU_IOAS_NOIOMMU_GET_PA is added to retrieve the physical address for a given IOVA. Although there is no physical DMA remapping hardware, IOMMU_IOAS_MAP_FIXED_IOVA is still used to establish IOVA-to-PA mappings in the software page table for later IOMMU_IOAS_NOIOMMU_GET_PA lookups.”h]”hX0A new IOMMUFD ioctl IOMMU_IOAS_NOIOMMU_GET_PA is added to retrieve the physical address for a given IOVA. Although there is no physical DMA remapping hardware, IOMMU_IOAS_MAP_FIXED_IOVA is still used to establish IOVA-to-PA mappings in the software page table for later IOMMU_IOAS_NOIOMMU_GET_PA lookups.”…”�”}”(hj‰ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MÅhjSh²hubeh}”(h]”Œkconfig-support-matrix”ah ]”h"]”Œkconfig support matrix”ah$]”h&]”uh1hµhj>h²hh³hàh´M›ubeh}”(h]”Œvfio-noiommu-mode”ah ]”h"]”Œvfio noiommu mode”ah$]”h&]”uh1hµhh·h²hh³hàh´Mtubh¶)�”}”(hhh]”(h»)�”}”(hŒ VFIO User API”h]”hŒ VFIO User API”…”�”}”(hjª h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj§ h²hh³hàh´MËubhâ)�”}”(hŒDPlease see include/uapi/linux/vfio.h for complete API documentation.”h]”hŒDPlease see include/uapi/linux/vfio.h for complete API documentation.”…”�”}”(hj¸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MÍhj§ h²hubeh}”(h]”Œ vfio-user-api”ah ]”h"]”Œ vfio user api”ah$]”h&]”uh1hµhh·h²hh³hàh´MËubh¶)�”}”(hhh]”(h»)�”}”(hŒVFIO bus driver API”h]”hŒVFIO bus driver API”…”�”}”(hjÑ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÎ h²hh³hàh´MÐubhâ)�”}”(hŒßVFIO bus drivers, such as vfio-pci make use of only a few interfaces into VFIO core. When devices are bound and unbound to the driver, Following interfaces are called when devices are bound to and unbound from the driver::”h]”hŒÞVFIO bus drivers, such as vfio-pci make use of only a few interfaces into VFIO core. When devices are bound and unbound to the driver, Following interfaces are called when devices are bound to and unbound from the driver:”…”�”}”(hjß h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MÒhjÎ h²hubjú)�”}”(hŒ¶int vfio_register_group_dev(struct vfio_device *device); int vfio_register_emulated_iommu_dev(struct vfio_device *device); void vfio_unregister_group_dev(struct vfio_device *device);”h]”hŒ¶int vfio_register_group_dev(struct vfio_device *device); int vfio_register_emulated_iommu_dev(struct vfio_device *device); void vfio_unregister_group_dev(struct vfio_device *device);”…”�”}”hjí sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´M×hjÎ h²hubhâ)�”}”(hŒÔThe driver should embed the vfio_device in its own structure and use vfio_alloc_device() to allocate the structure, and can register @init/@release callbacks to manage any private state wrapping the vfio_device::”h]”hŒÓThe driver should embed the vfio_device in its own structure and use vfio_alloc_device() to allocate the structure, and can register @init/@release callbacks to manage any private state wrapping the vfio_device:”…”�”}”(hjû h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MÛhjÎ h²hubjú)�”}”(hŒbvfio_alloc_device(dev_struct, member, dev, ops); void vfio_put_device(struct vfio_device *device);”h]”hŒbvfio_alloc_device(dev_struct, member, dev, ops); void vfio_put_device(struct vfio_device *device);”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´MàhjÎ h²hubhâ)�”}”(hX¡vfio_register_group_dev() indicates to the core to begin tracking the iommu_group of the specified dev and register the dev as owned by a VFIO bus driver. Once vfio_register_group_dev() returns it is possible for userspace to start accessing the driver, thus the driver should ensure it is completely ready before calling it. The driver provides an ops structure for callbacks similar to a file operations structure::”h]”hX vfio_register_group_dev() indicates to the core to begin tracking the iommu_group of the specified dev and register the dev as owned by a VFIO bus driver. Once vfio_register_group_dev() returns it is possible for userspace to start accessing the driver, thus the driver should ensure it is completely ready before calling it. The driver provides an ops structure for callbacks similar to a file operations structure:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MãhjÎ h²hubjú)�”}”(hXlstruct vfio_device_ops { char *name; int (*init)(struct vfio_device *vdev); void (*release)(struct vfio_device *vdev); int (*bind_iommufd)(struct vfio_device *vdev, struct iommufd_ctx *ictx, u32 *out_device_id); void (*unbind_iommufd)(struct vfio_device *vdev); int (*attach_ioas)(struct vfio_device *vdev, u32 *pt_id); void (*detach_ioas)(struct vfio_device *vdev); int (*open_device)(struct vfio_device *vdev); void (*close_device)(struct vfio_device *vdev); ssize_t (*read)(struct vfio_device *vdev, char __user *buf, size_t count, loff_t *ppos); ssize_t (*write)(struct vfio_device *vdev, const char __user *buf, size_t count, loff_t *size); long (*ioctl)(struct vfio_device *vdev, unsigned int cmd, unsigned long arg); int (*mmap)(struct vfio_device *vdev, struct vm_area_struct *vma); void (*request)(struct vfio_device *vdev, unsigned int count); int (*match)(struct vfio_device *vdev, char *buf); void (*dma_unmap)(struct vfio_device *vdev, u64 iova, u64 length); int (*device_feature)(struct vfio_device *device, u32 flags, void __user *arg, size_t argsz); };”h]”hXlstruct vfio_device_ops { char *name; int (*init)(struct vfio_device *vdev); void (*release)(struct vfio_device *vdev); int (*bind_iommufd)(struct vfio_device *vdev, struct iommufd_ctx *ictx, u32 *out_device_id); void (*unbind_iommufd)(struct vfio_device *vdev); int (*attach_ioas)(struct vfio_device *vdev, u32 *pt_id); void (*detach_ioas)(struct vfio_device *vdev); int (*open_device)(struct vfio_device *vdev); void (*close_device)(struct vfio_device *vdev); ssize_t (*read)(struct vfio_device *vdev, char __user *buf, size_t count, loff_t *ppos); ssize_t (*write)(struct vfio_device *vdev, const char __user *buf, size_t count, loff_t *size); long (*ioctl)(struct vfio_device *vdev, unsigned int cmd, unsigned long arg); int (*mmap)(struct vfio_device *vdev, struct vm_area_struct *vma); void (*request)(struct vfio_device *vdev, unsigned int count); int (*match)(struct vfio_device *vdev, char *buf); void (*dma_unmap)(struct vfio_device *vdev, u64 iova, u64 length); int (*device_feature)(struct vfio_device *device, u32 flags, void __user *arg, size_t argsz); };”…”�”}”hj% sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´MêhjÎ h²hubhâ)�”}”(hŒÞEach function is passed the vdev that was originally registered in the vfio_register_group_dev() or vfio_register_emulated_iommu_dev() call above. This allows the bus driver to obtain its private data using container_of().”•œ£h]”hŒÞEach function is passed the vdev that was originally registered in the vfio_register_group_dev() or vfio_register_emulated_iommu_dev() call above. This allows the bus driver to obtain its private data using container_of().”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MhjÎ h²hubjú)�”}”(hX- The init/release callbacks are issued when vfio_device is initialized and released. - The open/close device callbacks are issued when the first instance of a file descriptor for the device is created (eg. via VFIO_GROUP_GET_DEVICE_FD) for a user session. - The ioctl callback provides a direct pass through for some VFIO_DEVICE_* ioctls. - The [un]bind_iommufd callbacks are issued when the device is bound to and unbound from iommufd. - The [de]attach_ioas callback is issued when the device is attached to and detached from an IOAS managed by the bound iommufd. However, the attached IOAS can also be automatically detached when the device is unbound from iommufd. - The read/write/mmap callbacks implement the device region access defined by the device's own VFIO_DEVICE_GET_REGION_INFO ioctl. - The request callback is issued when device is going to be unregistered, such as when trying to unbind the device from the vfio bus driver. - The dma_unmap callback is issued when a range of iovas are unmapped in the container or IOAS attached by the device. Drivers which make use of the vfio page pinning interface must implement this callback in order to unpin pages within the dma_unmap range. Drivers must tolerate this callback even before calls to open_device().”h]”hX- The init/release callbacks are issued when vfio_device is initialized and released. - The open/close device callbacks are issued when the first instance of a file descriptor for the device is created (eg. via VFIO_GROUP_GET_DEVICE_FD) for a user session. - The ioctl callback provides a direct pass through for some VFIO_DEVICE_* ioctls. - The [un]bind_iommufd callbacks are issued when the device is bound to and unbound from iommufd. - The [de]attach_ioas callback is issued when the device is attached to and detached from an IOAS managed by the bound iommufd. However, the attached IOAS can also be automatically detached when the device is unbound from iommufd. - The read/write/mmap callbacks implement the device region access defined by the device's own VFIO_DEVICE_GET_REGION_INFO ioctl. - The request callback is issued when device is going to be unregistered, such as when trying to unbind the device from the vfio bus driver. - The dma_unmap callback is issued when a range of iovas are unmapped in the container or IOAS attached by the device. Drivers which make use of the vfio page pinning interface must implement this callback in order to unpin pages within the dma_unmap range. Drivers must tolerate this callback even before calls to open_device().”…”�”}”hjA sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1jùh³hàh´M hjÎ h²hubeh}”(h]”Œvfio-bus-driver-api”ah ]”h"]”Œvfio bus driver api”ah$]”h&]”uh1hµhh·h²hh³hàh´MÐubh¶)�”}”(hhh]”(h»)�”}”(hŒPPC64 sPAPR implementation note”h]”hŒPPC64 sPAPR implementation note”…”�”}”(hjZ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjW h²hh³hàh´M)ubhâ)�”}”(hŒ'This implementation has some specifics:”h]”hŒ'This implementation has some specifics:”…”�”}”(hjh h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M+hjW h²hubhŒenumerated_list”“”)�”}”(hhh]”(j2)�”}”(hX˜On older systems (POWER7 with P5IOC2/IODA1) only one IOMMU group per container is supported as an IOMMU table is allocated at the boot time, one table per a IOMMU group which is a Partitionable Endpoint (PE) (PE is often a PCI domain but not always). Newer systems (POWER8 with IODA2) have improved hardware design which allows to remove this limitation and have multiple IOMMU groups per a VFIO container. ”h]”(hâ)�”}”(hŒúOn older systems (POWER7 with P5IOC2/IODA1) only one IOMMU group per container is supported as an IOMMU table is allocated at the boot time, one table per a IOMMU group which is a Partitionable Endpoint (PE) (PE is often a PCI domain but not always).”h]”hŒúOn older systems (POWER7 with P5IOC2/IODA1) only one IOMMU group per container is supported as an IOMMU table is allocated at the boot time, one table per a IOMMU group which is a Partitionable Endpoint (PE) (PE is often a PCI domain but not always).”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M-hj{ ubhâ)�”}”(hŒ›Newer systems (POWER8 with IODA2) have improved hardware design which allows to remove this limitation and have multiple IOMMU groups per a VFIO container.”h]”hŒ›Newer systems (POWER8 with IODA2) have improved hardware design which allows to remove this limitation and have multiple IOMMU groups per a VFIO container.”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M2hj{ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j1hjx h²hh³hàh´Nubj2)�”}”(hŒÁThe hardware supports so called DMA windows - the PCI address range within which DMA transfer is allowed, any attempt to access address space out of the window leads to the whole PE isolation. ”h]”hâ)�”}”(hŒÀThe hardware supports so called DMA windows - the PCI address range within which DMA transfer is allowed, any attempt to access address space out of the window leads to the whole PE isolation.”h]”hŒÀThe hardware supports so called DMA windows - the PCI address range within which DMA transfer is allowed, any attempt to access address space out of the window leads to the whole PE isolation.”…”�”}”(hj¥ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M6hj¡ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j1hjx h²hh³hàh´Nubj2)�”}”(hX¡PPC64 guests are paravirtualized but not fully emulated. There is an API to map/unmap pages for DMA, and it normally maps 1..32 pages per call and currently there is no way to reduce the number of calls. In order to make things faster, the map/unmap handling has been implemented in real mode which provides an excellent performance which has limitations such as inability to do locked pages accounting in real time. ”h]”hâ)�”}”(hX PPC64 guests are paravirtualized but not fully emulated. There is an API to map/unmap pages for DMA, and it normally maps 1..32 pages per call and currently there is no way to reduce the number of calls. In order to make things faster, the map/unmap handling has been implemented in real mode which provides an excellent performance which has limitations such as inability to do locked pages accounting in real time.”h]”hX PPC64 guests are paravirtualized but not fully emulated. There is an API to map/unmap pages for DMA, and it normally maps 1..32 pages per call and currently there is no way to reduce the number of calls. In order to make things faster, the map/unmap handling has been implemented in real mode which provides an excellent performance which has limitations such as inability to do locked pages accounting in real time.”…”�”}”(hj½ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´M:hj¹ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j1hjx h²hh³hàh´Nubj2)�”}”(hXûAccording to sPAPR specification, A Partitionable Endpoint (PE) is an I/O subtree that can be treated as a unit for the purposes of partitioning and error recovery. A PE may be a single or multi-function IOA (IO Adapter), a function of a multi-function IOA, or multiple IOAs (possibly including switch and bridge structures above the multiple IOAs). PPC64 guests detect PCI errors and recover from them via EEH RTAS services, which works on the basis of additional ioctl commands. So 4 additional ioctls have been added: VFIO_IOMMU_SPAPR_TCE_GET_INFO returns the size and the start of the DMA window on the PCI bus. VFIO_IOMMU_ENABLE enables the container. The locked pages accounting is done at this point. This lets user first to know what the DMA window is and adjust rlimit before doing any real job. VFIO_IOMMU_DISABLE disables the container. VFIO_EEH_PE_OP provides an API for EEH setup, error detection and recovery. The code flow from the example above should be slightly changed:: struct vfio_eeh_pe_op pe_op = { .argsz = sizeof(pe_op), .flags = 0 }; ..... /* Add the group to the container */ ioctl(group, VFIO_GROUP_SET_CONTAINER, &container); /* Enable the IOMMU model we want */ ioctl(container, VFIO_SET_IOMMU, VFIO_SPAPR_TCE_IOMMU) /* Get addition sPAPR IOMMU info */ vfio_iommu_spapr_tce_info spapr_iommu_info; ioctl(container, VFIO_IOMMU_SPAPR_TCE_GET_INFO, &spapr_iommu_info); if (ioctl(container, VFIO_IOMMU_ENABLE)) /* Cannot enable container, may be low rlimit */ /* Allocate some space and setup a DMA mapping */ dma_map.vaddr = mmap(0, 1024 * 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); dma_map.size = 1024 * 1024; dma_map.iova = 0; /* 1MB starting at 0x0 from device view */ dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE; /* Check here is .iova/.size are within DMA window from spapr_iommu_info */ ioctl(container, VFIO_IOMMU_MAP_DMA, &dma_map); /* Get a file descriptor for the device */ device = ioctl(group, VFIO_GROUP_GET_DEVICE_FD, "0000:06:0d.0"); .... /* Gratuitous device reset and go... */ ioctl(device, VFIO_DEVICE_RESET); /* Make sure EEH is supported */ ioctl(container, VFIO_CHECK_EXTENSION, VFIO_EEH); /* Enable the EEH functionality on the device */ pe_op.op = VFIO_EEH_PE_ENABLE; ioctl(container, VFIO_EEH_PE_OP, &pe_op); /* You're suggested to create additional data struct to represent * PE, and put child devices belonging to same IOMMU group to the * PE instance for later reference. */ /* Check the PE's state and make sure it's in functional state */ pe_op.op = VFIO_EEH_PE_GET_STATE; ioctl(container, VFIO_EEH_PE_OP, &pe_op); /* Save device state using pci_save_state(). * EEH should be enabled on the specified device. */ .... /* Inject EEH error, which is expected to be caused by 32-bits * config load. */ pe_op.op = VFIO_EEH_PE_INJECT_ERR; pe_op.err.type = EEH_ERR_TYPE_32; pe_op.err.func = EEH_ERR_FUNC_LD_CFG_ADDR; pe_op.err.addr = 0ul; pe_op.err.mask = 0ul; ioctl(container, VFIO_EEH_PE_OP, &pe_op); .... /* When 0xFF's returned from reading PCI config space or IO BARs * of the PCI device. Check the PE's state to see if that has been * frozen. */ ioctl(container, VFIO_EEH_PE_OP, &pe_op); /* Waiting for pending PCI transactions to be completed and don't * produce any more PCI traffic from/to the affected PE until * recovery is finished. */ /* Enable IO for the affected PE and collect logs. Usually, the * standard part of PCI config space, AER registers are dumped * as logs for further analysis. */ pe_op.op = VFIO_EEH_PE_UNFREEZE_IO; ioctl(container, VFIO_EEH_PE_OP, &pe_op); /* * Issue PE reset: hot or fundamental reset. Usually, hot reset * is enough. However, the firmware of some PCI adapters would * require fundamental reset. */ pe_op.op = VFIO_EEH_PE_RESET_HOT; ioctl(container, VFIO_EEH_PE_OP, &pe_op); pe_op.op = VFIO_EEH_PE_RESET_DEACTIVATE; ioctl(container, VFIO_EEH_PE_OP, &pe_op); /* Configure the PCI bridges for the affected PE */ pe_op.op = VFIO_EEH_PE_CONFIGURE; ioctl(container, VFIO_EEH_PE_OP, &pe_op); /* Restored state we saved at initialization time. pci_restore_state() * is good enough as an example. */ /* Hopefully, error is recovered successfully. Now, you can resume to * start PCI traffic to/from the affected PE. */ .... ”h]”(hâ)�”}”(hXàAccording to sPAPR specification, A Partitionable Endpoint (PE) is an I/O subtree that can be treated as a unit for the purposes of partitioning and error recovery. A PE may be a single or multi-function IOA (IO Adapter), a function of a multi-function IOA, or multiple IOAs (possibly including switch and bridge structures above the multiple IOAs). PPC64 guests detect PCI errors and recover from them via EEH RTAS services, which works on the basis of additional ioctl commands.”h]”hXàAccording to sPAPR specification, A Partitionable Endpoint (PE) is an I/O subtree that can be treated as a unit for the purposes of partitioning and error recovery. A PE may be a single or multi-function IOA (IO Adapter), a function of a multi-function IOA, or multiple IOAs (possibly including switch and bridge structures above the multiple IOAs). PPC64 guests detect PCI errors and recover from them via EEH RTAS services, which works on the basis of additional ioctl commands.”…”�”}”(hjÕ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MAhjÑ ubhâ)�”}”(hŒ'So 4 additional ioctls have been added:”h]”hŒ'So 4 additional ioctls have been added:”…”�”}”(hjã h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MIhjÑ ubhŒ block_quote”“”)�”}”(hXÆVFIO_IOMMU_SPAPR_TCE_GET_INFO returns the size and the start of the DMA window on the PCI bus. VFIO_IOMMU_ENABLE enables the container. The locked pages accounting is done at this point. This lets user first to know what the DMA window is and adjust rlimit before doing any real job. VFIO_IOMMU_DISABLE disables the container. VFIO_EEH_PE_OP provides an API for EEH setup, error detection and recovery. ”h]”hŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒ_VFIO_IOMMU_SPAPR_TCE_GET_INFO returns the size and the start of the DMA window on the PCI bus. ”h]”(hŒterm”“”)�”}”(hŒVFIO_IOMMU_SPAPR_TCE_GET_INFO”h]”hŒVFIO_IOMMU_SPAPR_TCE_GET_INFO”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hàh´MLhjþ ubhŒ definition”“”)�”}”(hhh]”hâ)�”}”(hŒ@returns the size and the start of the DMA window on the PCI bus.”h]”hŒ@returns the size and the start of the DMA window on the PCI bus.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MLhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjþ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jü h³hàh´MLhjù ubjý )�”}”(hŒ½VFIO_IOMMU_ENABLE enables the container. The locked pages accounting is done at this point. This lets user first to know what the DMA window is and adjust rlimit before doing any real job. ”h]”(j )�”}”(hŒVFIO_IOMMU_ENABLE”h]”hŒVFIO_IOMMU_ENABLE”…”�”}”(hj5 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hàh´MQhj1 ubj )�”}”(hhh]”hâ)�”}”(hŒªenables the container. The locked pages accounting is done at this point. This lets user first to know what the DMA window is and adjust rlimit before doing any real job.”h]”hŒªenables the container. The locked pages accounting is done at this point. This lets user first to know what the DMA window is and adjust rlimit before doing any real job.”…”�”}”(hjF h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MOhjC ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj1 ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jü h³hàh´MQhjù ubjý )�”}”(hŒ+VFIO_IOMMU_DISABLE disables the container. ”h]”(j )�”}”(hŒVFIO_IOMMU_DISABLE”h]”hŒVFIO_IOMMU_DISABLE”…”�”}”(hjd h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hàh´MThj` ubj )�”}”(hhh]”hâ)�”}”(hŒdisables the container.”h]”hŒdisables the container.”…”�”}”(hju h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háh³hàh´MThjr ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj` ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jü h³hàh´MThjù ubjý )�”}”(hŒLVFIO_EEH_PE_OP provides an API for EEH setup, error detection and recovery. ”h]”(j )�”}”(hŒVFIO_EEH_PE_OP”h]”hŒVFIO_EEH_PE_OP”…”�”}”(hj“ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hàh´MWhj� ubj )�”}”(hhh]”hâ)�”}”(hŒj™ jSj\ jR j’ jˆ jb ja jÈ j§ jQ jÎ jžjW hÖj¤hújËjjòjvjjéjNjýjuuŒ footnote_refs”}”(j]”hÆaj]”hëaj]”j aj]”jgaj]”jÚaj]”jîaj]”(jR jˆ euŒ citation_refs”}”Œ autofootnotes”]”ja aŒautofootnote_refs”]”(jR jˆ eŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”(j¤jËjòjjNjueŒ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jÜKs…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.