From b40f602bfa240777ab4ffaa1218031dac4e81aa7 Mon Sep 17 00:00:00 2001 From: Liam Mark Date: Fri, 14 Oct 2016 10:37:23 -0700 Subject: iommu/arm-smmu: support mapping before enabling S1 translations For performance reasons there are clients who would like to move from stage 1 bypass to stage 1 enabled without having to stop their device. Currently clients need to stop their device because they have to create the required stage 1 mappings before re-enabling the device. Add the new DOMAIN_ATTR_EARLY_MAP domain attribute to allow clients to create stage 1 mappings after attaching but before enabling stage 1 translations. If the clients set the DOMAIN_ATTR_EARLY_MAP domain attribute to 1 before attaching then then once they attach the SMMU driver won't enable stage 1 translations. This gives the client the opportunity to create the required early mappings (for example using iommu_map). When the client has finished creating the necessary early mappings the client can then set the DOMAIN_ATTR_EARLY_MAP domain attribute to 0, this will in turn enable stage 1 translations. Change-Id: I9e95c5d2130f1d371e201eac69dec140cc773b1f Signed-off-by: Liam Mark --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/iommu.h b/include/linux/iommu.h index c34a68ce901a..d33e10784b23 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -133,6 +133,7 @@ enum iommu_attr { DOMAIN_ATTR_S1_BYPASS, DOMAIN_ATTR_FAST, DOMAIN_ATTR_PGTBL_INFO, + DOMAIN_ATTR_EARLY_MAP, DOMAIN_ATTR_MAX, }; -- cgit v1.2.3