[RFC/PATCH 0/4] Initial support for modular IOMMU drivers

2019-05-17 Thread Isaac J. Manjarres
o leverage the device tree ordering, and assign a property to the last SMMU device, and set the bus ops at that point? Or perhaps have some deferred timer based approach to know when to set the bus ops? Thanks, Isaac Isaac J. Manjarres (4): of: Export of_phandle_iterator_args() to modules PCI: Expo

[RFC/PATCH 4/4] iommu: Add probe deferral support for IOMMU kernel modules

2019-05-17 Thread Isaac J. Manjarres
. Otherwise, rely on the driver core to dictate when clients should stop deferring their probes. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/of_iommu.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index

[RFC/PATCH 2/4] PCI: Export PCI ACS and DMA searching functions to modules

2019-05-17 Thread Isaac J. Manjarres
IOMMU drivers that can be compiled as modules may want to use pci_for_each_dma_alias() and pci_request_acs(), so export those functions. Signed-off-by: Isaac J. Manjarres --- drivers/pci/pci.c| 1 + drivers/pci/search.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/pci/pci.c

[RFC/PATCH 3/4] iommu: Export core IOMMU functions to kernel modules

2019-05-17 Thread Isaac J. Manjarres
IOMMU drivers that can be compiled as modules need to use some of the IOMMU core functions, so expose them. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu-sysfs.c | 3 +++ drivers/iommu/iommu.c | 6 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/iommu/iommu

[RFC/PATCH 1/4] of: Export of_phandle_iterator_args() to modules

2019-05-17 Thread Isaac J. Manjarres
Kernel modules may want to use of_phandle_iterator_args(), so export it. Signed-off-by: Isaac J. Manjarres --- drivers/of/base.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/base.c b/drivers/of/base.c index 20e0e7e..8b9c597 100644 --- a/drivers/of/base.c +++ b/drivers

[PATCH] dma-mapping: Use unsigned types for size checks

2019-08-12 Thread Isaac J. Manjarres
erent dma allocator") Signed-off-by: Isaac J. Manjarres Cc: sta...@vger.kernel.org --- include/linux/dma-mapping.h | 6 +++--- kernel/dma/coherent.c | 8 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h ind

Re: [PATCH 7/7] iommu/arm-smmu: Allow building as a module

2019-11-04 Thread Isaac J. Manjarres
On Wed, Oct 30, 2019 at 02:51:12PM +, Will Deacon wrote: > By conditionally dropping support for the legacy binding and exporting > the newly introduced 'arm_smmu_impl_init()' function we can allow the > ARM SMMU driver to be built as a module. > > Signed-off-by: Will Deacon > --- >

[PATCH] iommu/dma: Add support for DMA_ATTR_SYS_CACHE

2019-10-25 Thread Isaac J. Manjarres
the buffers to be cached in the outer-level/system cache. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/dma-iommu.c | 2 ++ include/linux/dma-mapping.h | 8 2 files changed, 10 insertions(+) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index f321279..c433ece 100644

[RFC PATCH] iommu/iova: Add a best-fit algorithm

2020-02-14 Thread Isaac J. Manjarres
From: Liam Mark Using the best-fit algorithm, instead of the first-fit algorithm, may reduce fragmentation when allocating IOVAs. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/dma-iommu.c | 17 +++ drivers/iommu/iova.c | 73

[RFC PATCH] iommu/dma: Allow drivers to reserve an iova range

2020-02-14 Thread Isaac J. Manjarres
: I15bd1d313d889c2572d0eb2adecf6bebde3267f7 Signed-off-by: Isaac J. Manjarres --- drivers/iommu/dma-iommu.c | 28 include/linux/dma-iommu.h | 9 + 2 files changed, 37 insertions(+) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index a2e96a5..3b83e1a 100644 --- a/drivers/iommu/dma

[PATCH v2 4/5] iommu: Introduce map_sg() as an IOMMU op for IOMMU drivers

2021-01-11 Thread Isaac J. Manjarres
in the io-pgtable layer. For IOMMU drivers that do not provide a callback, the default implementation of iterating through the scatter-gather list, while calling iommu_map() will be used. Signed-off-by: Isaac J. Manjarres Tested-by: Sai Prakash Ranjan --- drivers/iommu/iommu.c | 13

[PATCH v2 1/5] iommu/io-pgtable: Introduce map_sg() as a page table op

2021-01-11 Thread Isaac J. Manjarres
calls, and boosting overall iommu_map_sg() performance. Signed-off-by: Isaac J. Manjarres Tested-by: Sai Prakash Ranjan --- include/linux/io-pgtable.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index ea727eb..6d0e731 100644

[PATCH v2 2/5] iommu/io-pgtable-arm: Hook up map_sg()

2021-01-11 Thread Isaac J. Manjarres
Implement the map_sg io-pgtable op for the ARM LPAE io-pgtable code, so that IOMMU drivers can call it when they need to map a scatter-gather list. Signed-off-by: Isaac J. Manjarres Tested-by: Sai Prakash Ranjan --- drivers/iommu/io-pgtable-arm.c | 86

[PATCH v2 5/5] iommu/arm-smmu: Hook up map_sg()

2021-01-11 Thread Isaac J. Manjarres
Now that everything is in place for iommu_map_sg() to defer mapping a scatter-gather list to the io-pgtable layer, implement the map_sg() callback in the SMMU driver, so that iommu_map_sg() can invoke it with the entire scatter-gather list that will be mapped. Signed-off-by: Isaac J. Manjarres

[PATCH v2 0/5] Optimize iommu_map_sg() performance

2021-01-11 Thread Isaac J. Manjarres
address ranges being mapped are within the appropriate limits. -Added Sai Prakash Ranjan's "Tested-by" tag. Thanks, Isaac Isaac J. Manjarres (5): iommu/io-pgtable: Introduce map_sg() as a page table op iommu/io-pgtable-arm: Hook up map_sg() iommu/io-pgtable-arm-v7s: Hook up map_sg

[PATCH v2 3/5] iommu/io-pgtable-arm-v7s: Hook up map_sg()

2021-01-11 Thread Isaac J. Manjarres
Implement the map_sg io-pgtable op for the ARMv7s io-pgtable code, so that IOMMU drivers can call it when they need to map a scatter-gather list. Signed-off-by: Isaac J. Manjarres Tested-by: Sai Prakash Ranjan --- drivers/iommu/io-pgtable-arm-v7s.c | 90

[RFC PATCH 0/3] iommu: Permit modular builds of io-pgtable drivers

2020-12-18 Thread Isaac J. Manjarres
module. Thanks in advance for the feedback, Isaac J. Manjarres Isaac J. Manjarres (3): iommu/io-pgtable-arm: Prepare for modularization iommu/io-pgtable: Prepare for modularization iommu/io-pgtable: Allow building as a module drivers/iommu/Kconfig | 6 +++--- drivers/iommu/io

[PATCH 1/3] iommu/io-pgtable-arm: Prepare for modularization

2020-12-18 Thread Isaac J. Manjarres
The io-pgtable-arm and io-pgtable-arm-v7s source files will be compiled as separate modules, along with the io-pgtable source. Export the symbols for the io-pgtable init function structures for the io-pgtable module to use. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm

[PATCH 2/3] iommu/io-pgtable: Prepare for modularization

2020-12-18 Thread Isaac J. Manjarres
() instead. Also, add the GPL v2 module license to the io-pgtable source file. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/io-pgtable.c b/drivers/iommu/io-pgtable.c index 94394c8..867ecb4

[PATCH 3/3] iommu/io-pgtable: Allow building as a module

2020-12-18 Thread Isaac J. Manjarres
with the descriptor format (either or both ARM LPAE and ARMV7S) can be built as modules. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 192ef8f..d7de6db 100644

[PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2020-12-21 Thread Isaac J. Manjarres
ng the ARM SMMU driver module. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index d8c6bfd..a72649f 100644 --- a/drivers/iommu/arm/ar

[PATCH v2 4/7] iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module

2020-12-21 Thread Isaac J. Manjarres
ARM SMMUv3 driver module. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 8ca7415..c498ac8 100644 --- a/drivers/iom

[RFC PATCH v2 0/7] iommu: Permit modular builds of io-pgtable drivers

2020-12-21 Thread Isaac J. Manjarres
the Kconfig options for the ARM LPAE nad ARM V7S to tristate. Thanks in advance for the feedback, Isaac J. Manjarres Isaac J. Manjarres (7): iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration iommu/io-pgtable: Add refcounting for io-pgtable format modules iommu/arm-smmu: Add dependency

[PATCH v2 2/7] iommu/io-pgtable: Add refcounting for io-pgtable format modules

2020-12-21 Thread Isaac J. Manjarres
In preparation for modularizing io-pgtable formats, add support for reference counting the io-pgtable format modules to ensure that the modules are not unloaded while they are in use. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 1 + drivers/iommu/io-pgtable-arm.c

[PATCH v2 6/7] drm/panfrost: Add dependency on io-pgtable-arm format module

2020-12-21 Thread Isaac J. Manjarres
re loading the Panfrost DRM driver module. Signed-off-by: Isaac J. Manjarres --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 83a461b..7294622 100644 --- a/drivers/gpu/dr

[PATCH v2 7/7] iommu/io-pgtable-arm: Allow building modular io-pgtable fmts

2020-12-21 Thread Isaac J. Manjarres
Now that everything is in place for modular io-pgtable formats, allow the ARM LPAE and ARMV7S io-pgtable formats to be built as modules. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/Kconfig | 4 ++-- drivers/iommu/io-pgtable-arm-v7s.c | 2 ++ drivers/iommu/io-pgtable-arm.c

[PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-21 Thread Isaac J. Manjarres
-pgtable formats, switch to a dynamic registration scheme, where each io-pgtable format can register their init functions with the io-pgtable code at boot or module insertion time. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 34 +- drivers/iommu/io-pgtable

[PATCH v2 5/7] drm/msm: Add dependency on io-pgtable-arm format module

2020-12-21 Thread Isaac J. Manjarres
he MSM DRM driver module. Signed-off-by: Isaac J. Manjarres --- drivers/gpu/drm/msm/msm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 535a026..8be3506 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm

[PATCH 0/7] iommu: Permit modular builds of io-pgtable drivers

2020-12-28 Thread Isaac J. Manjarres
to be enabled without having to select either page table format. The reason for doing this is so that a kernel can be built, such that it only provides the interface for io-pgtable formats to be registered as modules, as would be the case for the GKI. Thanks, Isaac Isaac J. Manjarres (7): iommu/io

[PATCH 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable format registration

2020-12-28 Thread Isaac J. Manjarres
each io-pgtable format can register their init functions with the io-pgtable code at boot or module insertion time. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 33 - drivers/iommu/io-pgtable-arm.c | 97 -- drivers

[PATCH 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2020-12-28 Thread Isaac J. Manjarres
e ARM SMMU driver module. Also, add a dependency on the ARMv7 short descriptor io-pgtable format, so that it can be loaded before the SMMU driver module, if available. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 4/7] iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module

2020-12-28 Thread Isaac J. Manjarres
ARM SMMUv3 driver module. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 8ca7415..c498ac8 100644 --- a/drivers/iom

[PATCH 6/7] drm/panfrost: Add dependency on io-pgtable-arm format module

2020-12-28 Thread Isaac J. Manjarres
re loading the Panfrost DRM driver module. Signed-off-by: Isaac J. Manjarres --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 83a461b..7294622 100644 --- a/drivers/gpu/dr

[PATCH 7/7] iommu/io-pgtable-arm: Allow building modular io-pgtable formats

2020-12-28 Thread Isaac J. Manjarres
Now that everything is in place for modular io-pgtable formats, allow the ARM LPAE and ARMV7S io-pgtable formats to be built as modules, and allow the io-pgtable framework to be enabled, without having to explicitly enable an io-pgtable format. Signed-off-by: Isaac J. Manjarres --- drivers

[PATCH 2/7] iommu/io-pgtable: Add refcounting for io-pgtable format modules

2020-12-28 Thread Isaac J. Manjarres
In preparation for modularizing io-pgtable formats, add support for reference counting the io-pgtable format modules to ensure that the modules are not unloaded while they are in use. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 1 + drivers/iommu/io-pgtable-arm.c

[PATCH 5/7] drm/msm: Add dependency on io-pgtable-arm format module

2020-12-28 Thread Isaac J. Manjarres
he MSM DRM driver module. Signed-off-by: Isaac J. Manjarres --- drivers/gpu/drm/msm/msm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 535a026..8be3506 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm

[PATCH RESEND 0/7] iommu: Permit modular builds of io-pgtable drivers

2021-01-04 Thread Isaac J. Manjarres
to be enabled without having to select either page table format. The reason for doing this is so that a kernel can be built, such that it only provides the interface for io-pgtable formats to be registered as modules, as would be the case for the GKI. Thanks, Isaac Isaac J. Manjarres (7): iommu/io

[PATCH RESEND 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2021-01-04 Thread Isaac J. Manjarres
e ARM SMMU driver module. Also, add a dependency on the ARMv7 short descriptor io-pgtable format, so that it can be loaded before the SMMU driver module, if available. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH RESEND 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable format registration

2021-01-04 Thread Isaac J. Manjarres
each io-pgtable format can register their init functions with the io-pgtable code at boot or module insertion time. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 33 - drivers/iommu/io-pgtable-arm.c | 97 -- drivers

[PATCH RESEND 7/7] iommu/io-pgtable-arm: Allow building modular io-pgtable formats

2021-01-04 Thread Isaac J. Manjarres
Now that everything is in place for modular io-pgtable formats, allow the ARM LPAE and ARMV7S io-pgtable formats to be built as modules, and allow the io-pgtable framework to be enabled, without having to explicitly enable an io-pgtable format. Signed-off-by: Isaac J. Manjarres --- drivers

[PATCH RESEND 6/7] drm/panfrost: Add dependency on io-pgtable-arm format module

2021-01-04 Thread Isaac J. Manjarres
re loading the Panfrost DRM driver module. Signed-off-by: Isaac J. Manjarres --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 83a461b..7294622 100644 --- a/drivers/gpu/dr

[PATCH RESEND 4/7] iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module

2021-01-04 Thread Isaac J. Manjarres
ARM SMMUv3 driver module. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 8ca7415..c498ac8 100644 --- a/drivers/iom

[PATCH RESEND 2/7] iommu/io-pgtable: Add refcounting for io-pgtable format modules

2021-01-04 Thread Isaac J. Manjarres
In preparation for modularizing io-pgtable formats, add support for reference counting the io-pgtable format modules to ensure that the modules are not unloaded while they are in use. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 1 + drivers/iommu/io-pgtable-arm.c

[PATCH RESEND 5/7] drm/msm: Add dependency on io-pgtable-arm format module

2021-01-04 Thread Isaac J. Manjarres
he MSM DRM driver module. Signed-off-by: Isaac J. Manjarres --- drivers/gpu/drm/msm/msm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 535a026..8be3506 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm

[PATCH 0/5] Optimize iommu_map_sg() performance

2021-01-08 Thread Isaac J. Manjarres
latencies is the same in both experiments. Clearly, reducing the jumps between the different layers in the IOMMU code offers a signficant performance boost in iommu_map_sg() latency. Thanks, Isaac Isaac J. Manjarres (5): iommu/io-pgtable: Introduce map_sg() as a page table op iommu/io-pgtable

[PATCH 1/5] iommu/io-pgtable: Introduce map_sg() as a page table op

2021-01-08 Thread Isaac J. Manjarres
calls, and boosting overall iommu_map_sg() performance. Signed-off-by: Isaac J. Manjarres --- include/linux/io-pgtable.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index ea727eb..6d0e731 100644 --- a/include/linux/io-pgtable.h

[PATCH 4/5] iommu: Introduce map_sg() as an IOMMU op for IOMMU drivers

2021-01-08 Thread Isaac J. Manjarres
in the io-pgtable layer. For IOMMU drivers that do not provide a callback, the default implementation of iterating through the scatter-gather list, while calling iommu_map() will be used. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c | 13 + include/linux/iommu.h | 5 + 2

[PATCH 3/5] iommu/io-pgtable-arm-v7s: Hook up map_sg()

2021-01-08 Thread Isaac J. Manjarres
Implement the map_sg io-pgtable op for the ARMv7s io-pgtable code, so that IOMMU drivers can call it when they need to map a scatter-gather list. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 90 ++ 1 file changed, 90 insertions

[PATCH 2/5] iommu/io-pgtable-arm: Hook up map_sg()

2021-01-08 Thread Isaac J. Manjarres
Implement the map_sg io-pgtable op for the ARM LPAE io-pgtable code, so that IOMMU drivers can call it when they need to map a scatter-gather list. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm.c | 86 ++ drivers/iommu/iommu.c

[PATCH 5/5] iommu/arm-smmu: Hook up map_sg()

2021-01-08 Thread Isaac J. Manjarres
Now that everything is in place for iommu_map_sg() to defer mapping a scatter-gather list to the io-pgtable layer, implement the map_sg() callback in the SMMU driver, so that iommu_map_sg() can invoke it with the entire scatter-gather list that will be mapped. Signed-off-by: Isaac J. Manjarres

[PATCH] iommu/arm-smmu-qcom: Fix mask extraction for bootloader programmed SMRs

2021-01-25 Thread Isaac J. Manjarres
ad back stream mappings") Signed-off-by: Isaac J. Manjarres Cc: sta...@vger.kernel.org --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index bcda170..abb1d2

[PATCH v2 06/12] iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts

2021-04-01 Thread Isaac J. Manjarres
improvements to iommu_pgsize() will need to check the alignment of the virtual and physical components of 'addr_merge' independently, so pass them in as separate parameters and reconstruct 'addr_merge' locally. No functional change. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres

[RFC PATCH v2 00/12] Optimizing iommu_[map/unmap] performance

2021-04-01 Thread Isaac J. Manjarres
to the patch which changes iommu_pgsize() to use bitmaps by using the ULL variants of the bitops) Any feedback is very much appreciated. Isaac J. Manjarres (9): iommu/io-pgtable: Introduce unmap_pages() as a page table op iommu: Add an unmap_pages() op for IOMMU drivers iommu/io-pgtable

[PATCH v2 09/12] iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages()

2021-04-01 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/io-pgtable-arm.c | 124 +++-- 1 file changed, 104 insertions(+), 20 deletions(-) diff --git a/drivers/iommu/io

[PATCH v2 07/12] iommu: Hook up '->unmap_pages' driver callback

2021-04-01 Thread Isaac J. Manjarres
From: Will Deacon Extend iommu_pgsize() to populate an optional 'count' paramater so that we can direct unmapping operation to the ->unmap_pages callback if it has been provided by the driver. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c |

[PATCH v2 12/12] iommu/arm-smmu: Implement the map_pages() IOMMU driver callback

2021-04-01 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM SMMU driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 19 +++ 1 file changed, 19

[PATCH v2 10/12] iommu/io-pgtable-arm: Implement arm_lpae_map_pages()

2021-04-01 Thread Isaac J. Manjarres
Implement the map_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/io-pgtable-arm.c | 95 +++--- 1 file changed, 88 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/io-pgtable

[PATCH v2 08/12] iommu: Add support for the map_pages() callback

2021-04-01 Thread Isaac J. Manjarres
Since iommu_pgsize can calculate how many pages of the same size can be mapped/unmapped before the next largest page size boundary, add support for invoking an IOMMU driver's map_pages() callback, if it provides one. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu

[PATCH v2 01/12] iommu/io-pgtable: Introduce unmap_pages() as a page table op

2021-04-01 Thread Isaac J. Manjarres
so allows multiple blocks to be unmapped in one call to the io-pgtable code, reducing the number of page table walks, and indirect calls. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions

[PATCH v2 03/12] iommu/io-pgtable: Introduce map_pages() as a page table op

2021-04-01 Thread Isaac J. Manjarres
-pgtable ops structure, so that a range of pages of the same size can be mapped within the same call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/io-pgtable.h b/include/linux/io

[PATCH v2 11/12] iommu/arm-smmu: Implement the unmap_pages() IOMMU driver callback

2021-04-01 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM SMMU driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 19 +++ 1 file changed, 19

[PATCH v2 02/12] iommu: Add an unmap_pages() op for IOMMU drivers

2021-04-01 Thread Isaac J. Manjarres
of unmapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon --- include/linux/iommu.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 5e7fe519430a

[PATCH v2 04/12] iommu: Add a map_pages() op for IOMMU drivers

2021-04-01 Thread Isaac J. Manjarres
of mapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/iommu.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9cf81242581a..528d6a58479e 100644 --- a/include

[PATCH v2 05/12] iommu: Use bitmap to calculate page size in iommu_pgsize()

2021-04-01 Thread Isaac J. Manjarres
From: Will Deacon Avoid the potential for shifting values by amounts greater than the width of their type by using a bitmap to compute page size in iommu_pgsize(). Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c | 31 --- 1

[RFC PATCH v3 00/12] Optimizing iommu_[map/unmap] performance

2021-04-05 Thread Isaac J. Manjarres
* Integrated Will's patches into this series which address several concerns about how iommu_pgsize() partitioned a buffer (I made a minor change to the patch which changes iommu_pgsize() to use bitmaps by using the ULL variants of the bitops) Isaac J. Manjarres (9): iommu/io-pgtable: Introduce

[RFC PATCH v3 03/12] iommu/io-pgtable: Introduce map_pages() as a page table op

2021-04-05 Thread Isaac J. Manjarres
-pgtable ops structure, so that a range of pages of the same size can be mapped within the same call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/io-pgtable.h b/include/linux/io

[RFC PATCH v3 04/12] iommu: Add a map_pages() op for IOMMU drivers

2021-04-05 Thread Isaac J. Manjarres
of mapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/iommu.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9cf81242581a..528d6a58479e 100644 --- a/include

[RFC PATCH v3 12/12] iommu/arm-smmu: Implement the map_pages() IOMMU driver callback

2021-04-05 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM SMMU driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 19 +++ 1 file changed, 19

[RFC PATCH v3 09/12] iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages()

2021-04-05 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/io-pgtable-arm.c | 124 +++-- 1 file changed, 104 insertions(+), 20 deletions(-) diff --git a/drivers/iommu/io

[RFC PATCH v3 10/12] iommu/io-pgtable-arm: Implement arm_lpae_map_pages()

2021-04-05 Thread Isaac J. Manjarres
Implement the map_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/io-pgtable-arm.c | 95 +++--- 1 file changed, 88 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/io-pgtable

[RFC PATCH v3 08/12] iommu: Add support for the map_pages() callback

2021-04-05 Thread Isaac J. Manjarres
Since iommu_pgsize can calculate how many pages of the same size can be mapped/unmapped before the next largest page size boundary, add support for invoking an IOMMU driver's map_pages() callback, if it provides one. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu

[RFC PATCH v3 02/12] iommu: Add an unmap_pages() op for IOMMU drivers

2021-04-05 Thread Isaac J. Manjarres
of unmapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon --- include/linux/iommu.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 5e7fe519430a

[RFC PATCH v3 05/12] iommu: Use bitmap to calculate page size in iommu_pgsize()

2021-04-05 Thread Isaac J. Manjarres
From: Will Deacon Avoid the potential for shifting values by amounts greater than the width of their type by using a bitmap to compute page size in iommu_pgsize(). Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c | 31 --- 1

[RFC PATCH v3 06/12] iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts

2021-04-05 Thread Isaac J. Manjarres
improvements to iommu_pgsize() will need to check the alignment of the virtual and physical components of 'addr_merge' independently, so pass them in as separate parameters and reconstruct 'addr_merge' locally. No functional change. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres

[RFC PATCH v3 01/12] iommu/io-pgtable: Introduce unmap_pages() as a page table op

2021-04-05 Thread Isaac J. Manjarres
so allows multiple blocks to be unmapped in one call to the io-pgtable code, reducing the number of page table walks, and indirect calls. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions

[RFC PATCH v3 07/12] iommu: Hook up '->unmap_pages' driver callback

2021-04-05 Thread Isaac J. Manjarres
From: Will Deacon Extend iommu_pgsize() to populate an optional 'count' paramater so that we can direct unmapping operation to the ->unmap_pages callback if it has been provided by the driver. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c |

[RFC PATCH v3 11/12] iommu/arm-smmu: Implement the unmap_pages() IOMMU driver callback

2021-04-05 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM SMMU driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 19 +++ 1 file changed, 19

[RFC PATCH 3/5] iommu: Add support for the unmap_pages IOMMU callback

2021-03-30 Thread Isaac J. Manjarres
of the same size can be unmapped in one shot, and invoke the IOMMU driver's unmap_pages callback if it has one. Otherwise, the existing behavior will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/iommu.c | 44 +-- 1 file

[RFC PATCH 5/5] iommu/arm-smmu: Implement the unmap_pages IOMMU driver callback

2021-03-30 Thread Isaac J. Manjarres
Implement the unmap_pages IOMMU driver callback for the ARM SMMU driver. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b

[RFC PATCH 2/5] iommu: Add an unmap_pages() op for IOMMU drivers

2021-03-30 Thread Isaac J. Manjarres
of unmapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/iommu.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 5e7fe519430a..9cf81242581a 100644

[RFC PATCH 4/5] iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages()

2021-03-30 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/io-pgtable-arm.c | 114 +++-- 1 file changed, 94 insertions(+), 20 deletions(-) diff --git a/drivers/iommu/io

[RFC PATCH 1/5] iommu/io-pgtable: Introduce unmap_pages() as a page table op

2021-03-30 Thread Isaac J. Manjarres
so allows multiple blocks to be unmapped in one call to the io-pgtable code, reducing the number of page table walks, and indirect calls. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions(+) diff --git a/include

[RFC PATCH 0/5] Optimization for unmapping iommu mapped buffers

2021-03-30 Thread Isaac J. Manjarres
feedback is very much appreciated. Thanks, Isaac Isaac J. Manjarres (5): iommu/io-pgtable: Introduce unmap_pages() as a page table op iommu: Add an unmap_pages() op for IOMMU drivers iommu: Add support for the unmap_pages IOMMU callback iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages

[RFC PATCH v5 05/15] iommu: Use bitmap to calculate page size in iommu_pgsize()

2021-04-08 Thread Isaac J. Manjarres
From: Will Deacon Avoid the potential for shifting values by amounts greater than the width of their type by using a bitmap to compute page size in iommu_pgsize(). Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c | 31 --- 1

[RFC PATCH v5 12/15] iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages()

2021-04-08 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM v7s io-pgtable format. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io

[RFC PATCH v5 11/15] iommu/io-pgtable-arm: Implement arm_lpae_map_pages()

2021-04-08 Thread Isaac J. Manjarres
Implement the map_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm.c | 42 ++ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io

[RFC PATCH v5 15/15] iommu/arm-smmu: Implement the map_pages() IOMMU driver callback

2021-04-08 Thread Isaac J. Manjarres
Implement the map_pages() callback for the ARM SMMU driver to allow calls from iommu_map to map multiple pages of the same size in one call. Also, remove the map() callback for the ARM SMMU driver, as it will no longer be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon

[RFC PATCH v5 06/15] iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts

2021-04-08 Thread Isaac J. Manjarres
improvements to iommu_pgsize() will need to check the alignment of the virtual and physical components of 'addr_merge' independently, so pass them in as separate parameters and reconstruct 'addr_merge' locally. No functional change. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres

[RFC PATCH v5 09/15] iommu/io-pgtable-arm: Prepare PTE methods for handling multiple entries

2021-04-08 Thread Isaac J. Manjarres
The PTE methods currently operate on a single entry. In preparation for manipulating multiple PTEs in one map or unmap call, allow them to handle multiple PTEs. Signed-off-by: Isaac J. Manjarres Suggested-by: Robin Murphy --- drivers/iommu/io-pgtable-arm.c | 78

[RFC PATCH v5 14/15] iommu/arm-smmu: Implement the unmap_pages() IOMMU driver callback

2021-04-08 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM SMMU driver to allow calls from iommu_unmap to unmap multiple pages of the same size in one call. Also, remove the unmap() callback for the SMMU driver, as it will no longer be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon

[RFC PATCH v5 13/15] iommu/io-pgtable-arm-v7s: Implement arm_v7s_map_pages()

2021-04-08 Thread Isaac J. Manjarres
Implement the map_pages() callback for the ARM v7s io-pgtable format. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io

[RFC PATCH v5 00/15] Optimizing iommu_[map/unmap] performance

2021-04-08 Thread Isaac J. Manjarres
address several concerns about how iommu_pgsize() partitioned a buffer (I made a minor change to the patch which changes iommu_pgsize() to use bitmaps by using the ULL variants of the bitops) Isaac J. Manjarres (12): iommu/io-pgtable: Introduce unmap_pages() as a page table op iommu: Add

[RFC PATCH v5 02/15] iommu: Add an unmap_pages() op for IOMMU drivers

2021-04-08 Thread Isaac J. Manjarres
of unmapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon Acked-by: Lu Baolu --- include/linux/iommu.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h

[RFC PATCH v5 08/15] iommu: Add support for the map_pages() callback

2021-04-08 Thread Isaac J. Manjarres
Since iommu_pgsize can calculate how many pages of the same size can be mapped/unmapped before the next largest page size boundary, add support for invoking an IOMMU driver's map_pages() callback, if it provides one. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu

[RFC PATCH v5 04/15] iommu: Add a map_pages() op for IOMMU drivers

2021-04-08 Thread Isaac J. Manjarres
of mapping memory one page block at a time will be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Acked-by: Lu Baolu --- include/linux/iommu.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9cf81242581a..528d6a58479e

[RFC PATCH v5 07/15] iommu: Hook up '->unmap_pages' driver callback

2021-04-08 Thread Isaac J. Manjarres
From: Will Deacon Extend iommu_pgsize() to populate an optional 'count' parameter so that we can direct unmapping operation to the ->unmap_pages callback if it has been provided by the driver. Signed-off-by: Will Deacon Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c |

[RFC PATCH v5 01/15] iommu/io-pgtable: Introduce unmap_pages() as a page table op

2021-04-08 Thread Isaac J. Manjarres
so allows multiple blocks to be unmapped in one call to the io-pgtable code, reducing the number of page table walks, and indirect calls. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions

[RFC PATCH v5 03/15] iommu/io-pgtable: Introduce map_pages() as a page table op

2021-04-08 Thread Isaac J. Manjarres
-pgtable ops structure, so that a range of pages of the same size can be mapped within the same call. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- include/linux/io-pgtable.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/io-pgtable.h b/include/linux/io

[RFC PATCH v5 10/15] iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages()

2021-04-08 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM LPAE io-pgtable format. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon --- drivers/iommu/io-pgtable-arm.c | 75 ++ 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/drivers/iommu/io

[RFC PATCH v4 12/15] iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages()

2021-04-07 Thread Isaac J. Manjarres
Implement the unmap_pages() callback for the ARM v7s io-pgtable format. Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm-v7s.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io

  1   2   >