diff options
| author | Joerg Roedel <joro@8bytes.org> | 2013-01-29 07:49:04 -0500 |
|---|---|---|
| committer | Joerg Roedel <joro@8bytes.org> | 2013-02-06 04:47:11 -0500 |
| commit | d2e121601619631517409cba34e50db3cbff5852 (patch) | |
| tree | 31f5362774bb8e25e9ff2515386156726feb642f | |
| parent | 57886518a8cdd319a04f5ea06a5f7ffcb8a93120 (diff) | |
iommu: Implement DOMAIN_ATTR_PAGING attribute
This attribute of a domain can be queried to find out if the
domain supports setting up page-tables using the iommu_map()
and iommu_unmap() functions.
Signed-off-by: Joerg Roedel <joro@8bytes.org>
| -rw-r--r-- | drivers/iommu/iommu.c | 5 | ||||
| -rw-r--r-- | include/linux/iommu.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 4e6d6f857e6f..0e0e5f2e0ccc 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c | |||
| @@ -869,6 +869,7 @@ int iommu_domain_get_attr(struct iommu_domain *domain, | |||
| 869 | enum iommu_attr attr, void *data) | 869 | enum iommu_attr attr, void *data) |
| 870 | { | 870 | { |
| 871 | struct iommu_domain_geometry *geometry; | 871 | struct iommu_domain_geometry *geometry; |
| 872 | bool *paging; | ||
| 872 | int ret = 0; | 873 | int ret = 0; |
| 873 | 874 | ||
| 874 | switch (attr) { | 875 | switch (attr) { |
| @@ -877,6 +878,10 @@ int iommu_domain_get_attr(struct iommu_domain *domain, | |||
| 877 | *geometry = domain->geometry; | 878 | *geometry = domain->geometry; |
| 878 | 879 | ||
| 879 | break; | 880 | break; |
| 881 | case DOMAIN_ATTR_PAGING: | ||
| 882 | paging = data; | ||
| 883 | *paging = (domain->ops->pgsize_bitmap != 0UL); | ||
| 884 | break; | ||
| 880 | default: | 885 | default: |
| 881 | if (!domain->ops->domain_get_attr) | 886 | if (!domain->ops->domain_get_attr) |
| 882 | return -EINVAL; | 887 | return -EINVAL; |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7e6ce7260b1c..26066f54a849 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -59,6 +59,7 @@ struct iommu_domain { | |||
| 59 | 59 | ||
| 60 | enum iommu_attr { | 60 | enum iommu_attr { |
| 61 | DOMAIN_ATTR_GEOMETRY, | 61 | DOMAIN_ATTR_GEOMETRY, |
| 62 | DOMAIN_ATTR_PAGING, | ||
| 62 | DOMAIN_ATTR_MAX, | 63 | DOMAIN_ATTR_MAX, |
| 63 | }; | 64 | }; |
| 64 | 65 | ||
