OSDN Git Service

iommu/arm-smmu: Implement DOMAIN_ATTR_PGTBL_INFO
authorMitchel Humpherys <mitchelh@codeaurora.org>
Fri, 12 Feb 2016 22:18:02 +0000 (14:18 -0800)
committerJeevan Shriram <jshriram@codeaurora.org>
Sat, 21 May 2016 02:23:59 +0000 (19:23 -0700)
The DOMAIN_ATTR_PGTBL_INFO attribute will be useful in implementing DMA
APIs that can leverage the fast page table mapping routines.  Implement
it.

CRs-Fixed: 997751
Change-Id: Id3acec0089b126e7d6ad44d8d322bf473614f716
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
drivers/iommu/arm-smmu.c

index cec4ef4..f38eb8e 100644 (file)
@@ -2924,6 +2924,17 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
                                        & (1 << DOMAIN_ATTR_FAST));
                ret = 0;
                break;
+       case DOMAIN_ATTR_PGTBL_INFO: {
+               struct iommu_pgtbl_info *info = data;
+
+               if (!(smmu_domain->attributes & (1 << DOMAIN_ATTR_FAST))) {
+                       ret = -ENODEV;
+                       break;
+               }
+               info->pmds = smmu_domain->pgtbl_cfg.av8l_fast_cfg.pmds;
+               ret = 0;
+               break;
+       }
        default:
                ret = -ENODEV;
                break;