diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-20 13:50:05 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-20 13:50:05 -0400 |
| commit | 79319a052cb0ae862954fe9f6e606417f1698ddb (patch) | |
| tree | 8de4379dd3534fd5a92e15a4781d25f759e4f8b7 /include/linux | |
| parent | 6496edfce95f943e1da43631c2f437509e56af7f (diff) | |
| parent | 7f65ef01e131650d455875598099cd06fea6096b (diff) | |
Merge tag 'iommu-updates-v4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU updates from Joerg Roedel:
"Not much this time, but the changes include:
- moving domain allocation into the iommu drivers to prepare for the
introduction of default domains for devices
- fixing the IO page-table code in the AMD IOMMU driver to correctly
encode large page sizes
- extension of the PCI support in the ARM-SMMU driver
- various fixes and cleanups"
* tag 'iommu-updates-v4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (34 commits)
iommu/amd: Correctly encode huge pages in iommu page tables
iommu/amd: Optimize amd_iommu_iova_to_phys for new fetch_pte interface
iommu/amd: Optimize alloc_new_range for new fetch_pte interface
iommu/amd: Optimize iommu_unmap_page for new fetch_pte interface
iommu/amd: Return the pte page-size in fetch_pte
iommu/amd: Add support for contiguous dma allocator
iommu/amd: Don't allocate with __GFP_ZERO in alloc_coherent
iommu/amd: Ignore BUS_NOTIFY_UNBOUND_DRIVER event
iommu/amd: Use BUS_NOTIFY_REMOVED_DEVICE
iommu/tegra: smmu: Compute PFN mask at runtime
iommu/tegra: gart: Set aperture at domain initialization time
iommu/tegra: Setup aperture
iommu: Remove domain_init and domain_free iommu_ops
iommu/fsl: Make use of domain_alloc and domain_free
iommu/rockchip: Make use of domain_alloc and domain_free
iommu/ipmmu-vmsa: Make use of domain_alloc and domain_free
iommu/shmobile: Make use of domain_alloc and domain_free
iommu/msm: Make use of domain_alloc and domain_free
iommu/tegra-gart: Make use of domain_alloc and domain_free
iommu/tegra-smmu: Make use of domain_alloc and domain_free
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iommu.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 38daa453f2e5..0546b8710ce3 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -51,9 +51,33 @@ struct iommu_domain_geometry { | |||
| 51 | bool force_aperture; /* DMA only allowed in mappable range? */ | 51 | bool force_aperture; /* DMA only allowed in mappable range? */ |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | /* Domain feature flags */ | ||
| 55 | #define __IOMMU_DOMAIN_PAGING (1U << 0) /* Support for iommu_map/unmap */ | ||
| 56 | #define __IOMMU_DOMAIN_DMA_API (1U << 1) /* Domain for use in DMA-API | ||
| 57 | implementation */ | ||
| 58 | #define __IOMMU_DOMAIN_PT (1U << 2) /* Domain is identity mapped */ | ||
| 59 | |||
| 60 | /* | ||
| 61 | * This are the possible domain-types | ||
| 62 | * | ||
| 63 | * IOMMU_DOMAIN_BLOCKED - All DMA is blocked, can be used to isolate | ||
| 64 | * devices | ||
| 65 | * IOMMU_DOMAIN_IDENTITY - DMA addresses are system physical addresses | ||
| 66 | * IOMMU_DOMAIN_UNMANAGED - DMA mappings managed by IOMMU-API user, used | ||
| 67 | * for VMs | ||
| 68 | * IOMMU_DOMAIN_DMA - Internally used for DMA-API implementations. | ||
| 69 | * This flag allows IOMMU drivers to implement | ||
| 70 | * certain optimizations for these domains | ||
| 71 | */ | ||
| 72 | #define IOMMU_DOMAIN_BLOCKED (0U) | ||
| 73 | #define IOMMU_DOMAIN_IDENTITY (__IOMMU_DOMAIN_PT) | ||
| 74 | #define IOMMU_DOMAIN_UNMANAGED (__IOMMU_DOMAIN_PAGING) | ||
| 75 | #define IOMMU_DOMAIN_DMA (__IOMMU_DOMAIN_PAGING | \ | ||
| 76 | __IOMMU_DOMAIN_DMA_API) | ||
| 77 | |||
| 54 | struct iommu_domain { | 78 | struct iommu_domain { |
| 79 | unsigned type; | ||
| 55 | const struct iommu_ops *ops; | 80 | const struct iommu_ops *ops; |
| 56 | void *priv; | ||
| 57 | iommu_fault_handler_t handler; | 81 | iommu_fault_handler_t handler; |
| 58 | void *handler_token; | 82 | void *handler_token; |
| 59 | struct iommu_domain_geometry geometry; | 83 | struct iommu_domain_geometry geometry; |
| @@ -113,8 +137,11 @@ enum iommu_attr { | |||
| 113 | */ | 137 | */ |
| 114 | struct iommu_ops { | 138 | struct iommu_ops { |
| 115 | bool (*capable)(enum iommu_cap); | 139 | bool (*capable)(enum iommu_cap); |
| 116 | int (*domain_init)(struct iommu_domain *domain); | 140 | |
| 117 | void (*domain_destroy)(struct iommu_domain *domain); | 141 | /* Domain allocation and freeing by the iommu driver */ |
| 142 | struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type); | ||
| 143 | void (*domain_free)(struct iommu_domain *); | ||
| 144 | |||
| 118 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); | 145 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); |
| 119 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); | 146 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); |
| 120 | int (*map)(struct iommu_domain *domain, unsigned long iova, | 147 | int (*map)(struct iommu_domain *domain, unsigned long iova, |
