Loading arch/arm64/configs/msm-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -547,6 +547,7 @@ CONFIG_MEM_SHARE_QMI_SERVICE=y CONFIG_MSM_CLK_CONTROLLER_V2=y CONFIG_MSM_MDSS_PLL=y CONFIG_REMOTE_SPINLOCK_MSM=y CONFIG_IOMMU_IO_PGTABLE_FAST=y CONFIG_ARM_SMMU=y CONFIG_IOMMU_DEBUG=y CONFIG_IOMMU_TESTS=y Loading arch/arm64/configs/msm_defconfig +2 −0 Original line number Diff line number Diff line Loading @@ -563,6 +563,8 @@ CONFIG_MEM_SHARE_QMI_SERVICE=y CONFIG_MSM_CLK_CONTROLLER_V2=y CONFIG_MSM_MDSS_PLL=y CONFIG_REMOTE_SPINLOCK_MSM=y CONFIG_IOMMU_IO_PGTABLE_FAST=y CONFIG_IOMMU_IO_PGTABLE_FAST_SELFTEST=y CONFIG_ARM_SMMU=y CONFIG_IOMMU_DEBUG=y CONFIG_IOMMU_DEBUG_TRACKING=y Loading arch/arm64/include/asm/dma-iommu.h +3 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include <linux/dma-debug.h> #include <linux/kmemcheck.h> #include <linux/kref.h> #include <linux/dma-mapping-fast.h> struct dma_iommu_mapping { /* iommu specific data */ Loading @@ -20,6 +21,8 @@ struct dma_iommu_mapping { spinlock_t lock; struct kref kref; struct dma_fast_smmu_mapping *fast; }; #ifdef CONFIG_ARM64_DMA_USE_IOMMU Loading arch/arm64/mm/dma-mapping.c +13 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ #include <asm/tlbflush.h> #include <asm/dma-iommu.h> #include <linux/io.h> #include <linux/dma-mapping-fast.h> #include "mm.h" Loading Loading @@ -1583,7 +1584,11 @@ int arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { int err; int s1_bypass = 0; int s1_bypass = 0, is_fast = 0; iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) return fast_smmu_attach_device(dev, mapping); err = iommu_attach_device(mapping->domain, dev); if (err) Loading Loading @@ -1612,6 +1617,7 @@ EXPORT_SYMBOL(arm_iommu_attach_device); void arm_iommu_detach_device(struct device *dev) { struct dma_iommu_mapping *mapping; int is_fast; mapping = to_dma_iommu_mapping(dev); if (!mapping) { Loading @@ -1619,6 +1625,12 @@ void arm_iommu_detach_device(struct device *dev) return; } iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) { fast_smmu_detach_device(dev, mapping); return; } iommu_detach_device(mapping->domain, dev); kref_put(&mapping->kref, release_iommu_mapping); dev->archdata.mapping = NULL; Loading drivers/iommu/Kconfig +36 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,42 @@ config IOMMU_IO_PGTABLE_LPAE_SELFTEST If unsure, say N here. config IOMMU_IO_PGTABLE_FAST bool "Fast ARMv7/v8 Long Descriptor Format" select IOMMU_IO_PGTABLE help Enable support for a subset of the ARM long descriptor pagetable format. This allocator achieves fast performance by pre-allocating and pre-populating page table memory up front. only supports a 32 bit virtual address space. This implementation is mainly optimized for use cases where the buffers are small (<= 64K) since it only supports 4K page sizes. config IOMMU_IO_PGTABLE_FAST_SELFTEST bool "Fast IO pgtable selftests" depends on IOMMU_IO_PGTABLE_FAST help Enable self-tests for "fast" page table allocator. This performs a series of page-table consistency checks during boot. If unsure, say N here. config IOMMU_IO_PGTABLE_FAST_PROVE_TLB bool "Prove correctness of TLB maintenance in the Fast DMA mapper" depends on IOMMU_IO_PGTABLE_FAST help Enables some debug features that help prove correctness of TLB maintenance routines in the Fast DMA mapper. This option will slow things down considerably, so should only be used in a debug configuration. This relies on the ability to set bits in an invalid page table entry, which is disallowed on some hardware due to errata. If you're running on such a platform then this option can only be used with unit tests. It will break real use cases. If unsure, say N here. endmenu config OF_IOMMU Loading Loading
arch/arm64/configs/msm-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -547,6 +547,7 @@ CONFIG_MEM_SHARE_QMI_SERVICE=y CONFIG_MSM_CLK_CONTROLLER_V2=y CONFIG_MSM_MDSS_PLL=y CONFIG_REMOTE_SPINLOCK_MSM=y CONFIG_IOMMU_IO_PGTABLE_FAST=y CONFIG_ARM_SMMU=y CONFIG_IOMMU_DEBUG=y CONFIG_IOMMU_TESTS=y Loading
arch/arm64/configs/msm_defconfig +2 −0 Original line number Diff line number Diff line Loading @@ -563,6 +563,8 @@ CONFIG_MEM_SHARE_QMI_SERVICE=y CONFIG_MSM_CLK_CONTROLLER_V2=y CONFIG_MSM_MDSS_PLL=y CONFIG_REMOTE_SPINLOCK_MSM=y CONFIG_IOMMU_IO_PGTABLE_FAST=y CONFIG_IOMMU_IO_PGTABLE_FAST_SELFTEST=y CONFIG_ARM_SMMU=y CONFIG_IOMMU_DEBUG=y CONFIG_IOMMU_DEBUG_TRACKING=y Loading
arch/arm64/include/asm/dma-iommu.h +3 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include <linux/dma-debug.h> #include <linux/kmemcheck.h> #include <linux/kref.h> #include <linux/dma-mapping-fast.h> struct dma_iommu_mapping { /* iommu specific data */ Loading @@ -20,6 +21,8 @@ struct dma_iommu_mapping { spinlock_t lock; struct kref kref; struct dma_fast_smmu_mapping *fast; }; #ifdef CONFIG_ARM64_DMA_USE_IOMMU Loading
arch/arm64/mm/dma-mapping.c +13 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ #include <asm/tlbflush.h> #include <asm/dma-iommu.h> #include <linux/io.h> #include <linux/dma-mapping-fast.h> #include "mm.h" Loading Loading @@ -1583,7 +1584,11 @@ int arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { int err; int s1_bypass = 0; int s1_bypass = 0, is_fast = 0; iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) return fast_smmu_attach_device(dev, mapping); err = iommu_attach_device(mapping->domain, dev); if (err) Loading Loading @@ -1612,6 +1617,7 @@ EXPORT_SYMBOL(arm_iommu_attach_device); void arm_iommu_detach_device(struct device *dev) { struct dma_iommu_mapping *mapping; int is_fast; mapping = to_dma_iommu_mapping(dev); if (!mapping) { Loading @@ -1619,6 +1625,12 @@ void arm_iommu_detach_device(struct device *dev) return; } iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) { fast_smmu_detach_device(dev, mapping); return; } iommu_detach_device(mapping->domain, dev); kref_put(&mapping->kref, release_iommu_mapping); dev->archdata.mapping = NULL; Loading
drivers/iommu/Kconfig +36 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,42 @@ config IOMMU_IO_PGTABLE_LPAE_SELFTEST If unsure, say N here. config IOMMU_IO_PGTABLE_FAST bool "Fast ARMv7/v8 Long Descriptor Format" select IOMMU_IO_PGTABLE help Enable support for a subset of the ARM long descriptor pagetable format. This allocator achieves fast performance by pre-allocating and pre-populating page table memory up front. only supports a 32 bit virtual address space. This implementation is mainly optimized for use cases where the buffers are small (<= 64K) since it only supports 4K page sizes. config IOMMU_IO_PGTABLE_FAST_SELFTEST bool "Fast IO pgtable selftests" depends on IOMMU_IO_PGTABLE_FAST help Enable self-tests for "fast" page table allocator. This performs a series of page-table consistency checks during boot. If unsure, say N here. config IOMMU_IO_PGTABLE_FAST_PROVE_TLB bool "Prove correctness of TLB maintenance in the Fast DMA mapper" depends on IOMMU_IO_PGTABLE_FAST help Enables some debug features that help prove correctness of TLB maintenance routines in the Fast DMA mapper. This option will slow things down considerably, so should only be used in a debug configuration. This relies on the ability to set bits in an invalid page table entry, which is disallowed on some hardware due to errata. If you're running on such a platform then this option can only be used with unit tests. It will break real use cases. If unsure, say N here. endmenu config OF_IOMMU Loading