diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-03-26 13:43:05 +0100 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-03-31 15:31:49 +0200 |
commit | 8539c7c16b970258e14761d8a1f7d10fe798031a (patch) | |
tree | 816ddaba62328708e590be824176d17dabad6449 /drivers/iommu | |
parent | 938c470976192590b4adc921b2e10fa31237eddc (diff) | |
download | op-kernel-dev-8539c7c16b970258e14761d8a1f7d10fe798031a.zip op-kernel-dev-8539c7c16b970258e14761d8a1f7d10fe798031a.tar.gz |
iommu: Introduce iommu domain types
This allows to handle domains differently based on their
type in the future. An IOMMU driver can implement certain
optimizations for DMA-API domains for example.
The domain types can be extended later and some of the
existing domain attributes can be migrated to become domain
flags.
Tested-by: Thierry Reding <treding@nvidia.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/iommu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 11de262..4920605 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -909,14 +909,15 @@ struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) ops = bus->iommu_ops; if (ops->domain_alloc) - domain = ops->domain_alloc(); + domain = ops->domain_alloc(IOMMU_DOMAIN_UNMANAGED); else domain = kzalloc(sizeof(*domain), GFP_KERNEL); if (!domain) return NULL; - domain->ops = bus->iommu_ops; + domain->ops = bus->iommu_ops; + domain->type = IOMMU_DOMAIN_UNMANAGED; if (ops->domain_init && domain->ops->domain_init(domain)) goto out_free; |