summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2015-07-30 20:17:19 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:13:48 -0700
commit7c8a93f1f365327179215f4b2cb1a6f2ffba65a8 (patch)
tree62bb35fa5c779761fa28ca4d7d6d48f7c3000e94
parent2b39d026fbde0220f85980f1a3b2bad36bd4fad0 (diff)
iommu/arm-smmu: Assign page table memory on domain finalization
When a domain is attached for the first time, memory for its top level of page tables is allocated. If it's a secure domain, this memory needs to be assigned to a secure VMID. Currently, it's not being assigned to a secure VMID, so when the domain is torn down and unassigned we get a warning. Fix this by adding the missing assign call after initial domain allocation. Change-Id: I9ff2418749e768e17b4598f5f89e587ad7828d52 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
-rw-r--r--drivers/iommu/arm-smmu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ba616eff02d3..d5310e476592 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1325,6 +1325,8 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
writel_relaxed(reg, cb_base + ARM_SMMU_CB_SCTLR);
}
+static void arm_smmu_assign_table(struct arm_smmu_domain *smmu_domain);
+
static int arm_smmu_init_domain_context(struct iommu_domain *domain,
struct arm_smmu_device *smmu)
{
@@ -1421,6 +1423,11 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
ret = -ENOMEM;
goto out_clear_smmu;
}
+ /*
+ * assign any page table memory that might have been allocated
+ * during alloc_io_pgtable_ops
+ */
+ arm_smmu_assign_table(smmu_domain);
/* Update our support page sizes to reflect the page table format */
arm_smmu_ops.pgsize_bitmap = smmu_domain->pgtbl_cfg.pgsize_bitmap;
@@ -1712,6 +1719,12 @@ static int arm_smmu_attach_dynamic(struct iommu_domain *domain,
if (!pgtbl_ops)
return -ENOMEM;
+ /*
+ * assign any page table memory that might have been allocated
+ * during alloc_io_pgtable_ops
+ */
+ arm_smmu_assign_table(smmu_domain);
+
cfg->vmid = cfg->cbndx + 2;
smmu_domain->smmu = smmu;