From: Joerg Roedel Date: Thu, 28 May 2015 16:41:35 +0000 (+0200) Subject: iommu: Add function to query the default domain of a group X-Git-Tag: v4.2-rc1~138^2^6~12 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=6827ca83695d5e41ad31b0719788ee65f00ca4b3;p=linux.git iommu: Add function to query the default domain of a group This will be used to handle unity mappings in the iommu drivers. Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index ffad1eaf450d..224c6dd2d249 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -837,6 +837,11 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) return group; } +struct iommu_domain *iommu_group_default_domain(struct iommu_group *group) +{ + return group->default_domain; +} + static int add_iommu_group(struct device *dev, void *data) { struct iommu_callback_data *cb = data; diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 689499904166..b944b2be4fa2 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -249,6 +249,7 @@ extern int iommu_group_unregister_notifier(struct iommu_group *group, struct notifier_block *nb); extern int iommu_group_id(struct iommu_group *group); extern struct iommu_group *iommu_group_get_for_dev(struct device *dev); +extern struct iommu_domain *iommu_group_default_domain(struct iommu_group *); extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, void *data);