Lines Matching +full:dma +full:- +full:window
2 VFIO - "Virtual Function I/O" [1]_
5 Many modern systems now provide DMA and interrupt remapping facilities
7 allotted. This includes x86 hardware with AMD-Vi and Intel VT-d,
12 safe [2]_, non-privileged, userspace drivers.
19 bare-metal device drivers [3]_.
22 field, also benefit from low-overhead, direct device access from
23 userspace. Examples include network adapters (often non-TCP/IP based)
36 ---------------------------
40 and DMA. Without going into the details of each of these, DMA is
42 as allowing a device read-write access to system memory imposes the
55 For instance, an individual device may be part of a larger multi-
59 could be anything from a multi-function PCI device with backdoors
60 between functions to a non-PCI-ACS (Access Control Services) capable
62 can also play a factor in terms of hiding devices. A PCIe-to-PCI
96 group available, but not that particular device). TBD - interface
119 ------------------
127 pci bus, therefore the user will make use of vfio-pci to manage the
130 # modprobe vfio-pci
132 Binding this device to the vfio-pci driver creates the VFIO group
135 $ lspci -n -s 0000:06:0d.0
138 # echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
143 $ ls -l /sys/bus/pci/devices/0000:06:0d.0/iommu_group/devices
145 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:00:1e.0 ->
147 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:06:0d.0 ->
149 lrwxrwxrwx. 1 root root 0 Apr 23 16:13 0000:06:0d.1 ->
152 This device is behind a PCIe-to-PCI bridge [4]_, therefore we also
156 bind this device to the vfio-pci driver (vfio-pci does not currently
203 /* Allocate some space and setup a DMA mapping */
243 ----------------------------
246 It intends to be the portal of delivering advanced userspace DMA
260 VFIO_TYPE1v2_IOMMU (ex. DMA mapping MMIO) and does not attempt to
270 ----------------
283 VFIO_DEVICE_BIND_IOMMUFD to claim DMA ownership before starting to
295 can be only one DMA owner for the group. Devices belonging to the same
302 -------------------
306 $ ls /sys/bus/pci/devices/0000:6a:01.0/vfio-dev/
312 $ ls -l /dev/vfio/devices/vfio0
313 crw------- 1 root root 511, 0 Feb 16 01:22 /dev/vfio/devices/vfio0
314 $ cat /sys/bus/pci/devices/0000:6a:01.0/vfio-dev/vfio0/dev
316 $ ls -l /dev/char/511\:0
317 lrwxrwxrwx 1 root root 21 Feb 16 01:22 /dev/char/511:0 -> ../vfio/devices/vfio0
331 IOMMUFD IOAS/HWPT to enable userspace DMA::
362 /* Allocate some space and setup a DMA mapping */
374 -------------------------------------------------------------------------------
379 -------------------------------------------------------------------------------
381 VFIO bus drivers, such as vfio-pci make use of only a few interfaces
437 - The init/release callbacks are issued when vfio_device is initialized
440 - The open/close device callbacks are issued when the first
444 - The ioctl callback provides a direct pass through for some VFIO_DEVICE_*
447 - The [un]bind_iommufd callbacks are issued when the device is bound to
450 - The [de]attach_ioas callback is issued when the device is attached to
455 - The read/write/mmap callbacks implement the device region access defined
458 - The request callback is issued when device is going to be unregistered,
461 - The dma_unmap callback is issued when a range of iovas are unmapped
468 -------------------------------
481 2) The hardware supports so called DMA windows - the PCI address range
482 within which DMA transfer is allowed, any attempt to access address space
483 out of the window leads to the whole PE isolation.
486 to map/unmap pages for DMA, and it normally maps 1..32 pages per call and
494 error recovery. A PE may be a single or multi-function IOA (IO Adapter), a
495 function of a multi-function IOA, or multiple IOAs (possibly including
503 returns the size and the start of the DMA window on the PCI bus.
508 the DMA window is and adjust rlimit before doing any real job.
534 /* Allocate some space and setup a DMA mapping */
542 /* Check here is .iova/.size are within DMA window from spapr_iommu_info */
575 /* Inject EEH error, which is expected to be caused by 32-bits
639 - VFIO_IOMMU_SPAPR_REGISTER_MEMORY/VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY ioctls
646 - VFIO_IOMMU_MAP_DMA/VFIO_IOMMU_UNMAP_DMA ioctls only update the actual
648 address is from pre-registered range.
650 This separation helps in optimizing DMA for guests.
652 6) sPAPR specification allows guests to have an additional DMA window(s) on
656 the userspace. The existing hardware supports up to 2 DMA windows, one is
657 2GB long, uses 4K pages and called "default 32bit window"; the other can
658 be as big as entire RAM, use different page size, it is optional - guests
659 create those in run-time if the guest driver supports 64bit DMA.
661 VFIO_IOMMU_SPAPR_TCE_CREATE receives a page shift, a DMA window size and
664 memory). It creates a new window in the available slot and returns the bus
665 address where the new window starts. Due to hardware limitation, the user
666 space cannot choose the location of DMA windows.
668 VFIO_IOMMU_SPAPR_TCE_REMOVE receives the bus start address of the window
671 -------------------------------------------------------------------------------
678 possible for multi-function devices to have backdoors between
682 IOMMU driver to group multi-function PCI devices together
684 still provide isolation. For PCI, SR-IOV Virtual Functions are the
688 .. [3] As always there are trade-offs to virtual machine device
691 these trade-offs.
696 -[0000:00]-+-1e.0-[06]--+-0d.0
697 \-0d.1