diff options
author | Jean-Philippe Brucker <jean-philippe.brucker@arm.com> | 2019-04-10 16:15:16 +0100 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2019-04-11 17:08:52 +0200 |
commit | 26b25a2b98e45aeb40eedcedc586ad5034cbd984 (patch) | |
tree | 267d8417e78f528e7a5e1b342561359737225e04 /ipc | |
parent | a3a195929d40b38833ffd0f82b2db2cc898641eb (diff) | |
download | linux-stable-26b25a2b98e45aeb40eedcedc586ad5034cbd984.tar.gz linux-stable-26b25a2b98e45aeb40eedcedc586ad5034cbd984.tar.bz2 linux-stable-26b25a2b98e45aeb40eedcedc586ad5034cbd984.zip |
iommu: Bind process address spaces to devices
Add bind() and unbind() operations to the IOMMU API.
iommu_sva_bind_device() binds a device to an mm, and returns a handle to
the bond, which is released by calling iommu_sva_unbind_device().
Each mm bound to devices gets a PASID (by convention, a 20-bit system-wide
ID representing the address space), which can be retrieved with
iommu_sva_get_pasid(). When programming DMA addresses, device drivers
include this PASID in a device-specific manner, to let the device access
the given address space. Since the process memory may be paged out, device
and IOMMU must support I/O page faults (e.g. PCI PRI).
Using iommu_sva_set_ops(), device drivers provide an mm_exit() callback
that is called by the IOMMU driver if the process exits before the device
driver called unbind(). In mm_exit(), device driver should disable DMA
from the given context, so that the core IOMMU can reallocate the PASID.
Whether the process exited or nor, the device driver should always release
the handle with unbind().
To use these functions, device driver must first enable the
IOMMU_DEV_FEAT_SVA device feature with iommu_dev_enable_feature().
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions