]> Pileus Git - ~andy/linux/commitdiff
iommu: Implement DOMAIN_ATTR_PAGING attribute
authorJoerg Roedel <joro@8bytes.org>
Tue, 29 Jan 2013 12:49:04 +0000 (13:49 +0100)
committerJoerg Roedel <joro@8bytes.org>
Wed, 6 Feb 2013 09:47:11 +0000 (10:47 +0100)
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>
drivers/iommu/iommu.c
include/linux/iommu.h

index 4e6d6f857e6fcd2c1fbccb4953eafa8f57b8632f..0e0e5f2e0ccc33ae79a2ebdeafce20495459bdb1 100644 (file)
@@ -869,6 +869,7 @@ int iommu_domain_get_attr(struct iommu_domain *domain,
                          enum iommu_attr attr, void *data)
 {
        struct iommu_domain_geometry *geometry;
+       bool *paging;
        int ret = 0;
 
        switch (attr) {
@@ -876,6 +877,10 @@ int iommu_domain_get_attr(struct iommu_domain *domain,
                geometry  = data;
                *geometry = domain->geometry;
 
+               break;
+       case DOMAIN_ATTR_PAGING:
+               paging  = data;
+               *paging = (domain->ops->pgsize_bitmap != 0UL);
                break;
        default:
                if (!domain->ops->domain_get_attr)
index 7e6ce7260b1c277190d58fd6c1d2ad3d948fae1a..26066f54a849b0939179808088551b2a7717edcf 100644 (file)
@@ -59,6 +59,7 @@ struct iommu_domain {
 
 enum iommu_attr {
        DOMAIN_ATTR_GEOMETRY,
+       DOMAIN_ATTR_PAGING,
        DOMAIN_ATTR_MAX,
 };