Commit d2e121601619631517409cba34e50db3cbff5852

Authored by Joerg Roedel
1 parent 57886518a8

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>

Showing 2 changed files with 6 additions and 0 deletions Side-by-side Diff

drivers/iommu/iommu.c
... ... @@ -869,6 +869,7 @@
869 869 enum iommu_attr attr, void *data)
870 870 {
871 871 struct iommu_domain_geometry *geometry;
  872 + bool *paging;
872 873 int ret = 0;
873 874  
874 875 switch (attr) {
... ... @@ -876,6 +877,10 @@
876 877 geometry = data;
877 878 *geometry = domain->geometry;
878 879  
  880 + break;
  881 + case DOMAIN_ATTR_PAGING:
  882 + paging = data;
  883 + *paging = (domain->ops->pgsize_bitmap != 0UL);
879 884 break;
880 885 default:
881 886 if (!domain->ops->domain_get_attr)
include/linux/iommu.h
... ... @@ -59,6 +59,7 @@
59 59  
60 60 enum iommu_attr {
61 61 DOMAIN_ATTR_GEOMETRY,
  62 + DOMAIN_ATTR_PAGING,
62 63 DOMAIN_ATTR_MAX,
63 64 };
64 65