Re: [PATCH v3 5/5] dma-iommu: account for min_align_mask

2021-08-11 Thread David Stevens
On Thu, Aug 12, 2021 at 4:12 AM Robin Murphy wrote: > > On 2021-08-11 03:42, David Stevens wrote: > > From: David Stevens > > > > For devices which set min_align_mask, swiotlb preserves the offset of > > the original physical address within that mask. Since __iommu_dma_map > > accounts for

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-11 Thread Sven Peter via iommu
On Tue, Aug 10, 2021, at 11:51, Robin Murphy wrote: > On 2021-08-09 21:45, Sven Peter wrote: > > > > > > On Mon, Aug 9, 2021, at 19:41, Robin Murphy wrote: > >> On 2021-08-07 12:47, Sven Peter via iommu wrote: > >>> > >>> > >>> On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: > On

Re: [PATCH v3 5/5] dma-iommu: account for min_align_mask

2021-08-11 Thread Robin Murphy
On 2021-08-11 03:42, David Stevens wrote: From: David Stevens For devices which set min_align_mask, swiotlb preserves the offset of the original physical address within that mask. Since __iommu_dma_map accounts for non-aligned addresses, passing a non-aligned swiotlb address with the swiotlb

Re: [PATCH v3 4/5] dma-iommu: Check CONFIG_SWIOTLB more broadly

2021-08-11 Thread Robin Murphy
On 2021-08-11 03:42, David Stevens wrote: From: David Stevens Introduce a new dev_use_swiotlb function to guard swiotlb code, instead of overloading dev_is_untrusted. This allows CONFIG_SWIOTLB to be checked more broadly, so the swiotlb related code can be removed more aggressively.

Re: [PATCH v3 3/5] dma-iommu: add SKIP_CPU_SYNC after syncing

2021-08-11 Thread Robin Murphy
On 2021-08-11 03:42, David Stevens wrote: From: David Stevens After syncing in map/unmap, add the DMA_ATTR_SKIP_CPU_SYNC flag so anything that uses attrs later on will skip any sync work that has already been completed. In particular, this skips copying from the swiotlb twice during unmap.

Re: [PATCH v3 2/5] dma-iommu: fix arch_sync_dma for map

2021-08-11 Thread Robin Murphy
On 2021-08-11 03:42, David Stevens wrote: From: David Stevens When calling arch_sync_dma, we need to pass it the memory that's actually being used for dma. When using swiotlb bounce buffers, this is the bounce buffer. Move arch_sync_dma into the __iommu_dma_map_swiotlb helper, so it can use

Re: [PATCH v3 1/5] dma-iommu: fix sync_sg with swiotlb

2021-08-11 Thread Robin Murphy
On 2021-08-11 06:57, Christoph Hellwig wrote: On Wed, Aug 11, 2021 at 11:42:43AM +0900, David Stevens wrote: From: David Stevens The is_swiotlb_buffer function takes the physical address of the swiotlb buffer, not the physical address of the original buffer. The sglist contains the physical

Re: [PATCHv4] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Sai Prakash Ranjan
On 2021-08-11 21:23, Robin Murphy wrote: On 2021-08-11 11:30, Will Deacon wrote: On Wed, Aug 11, 2021 at 11:37:25AM +0530, Sai Prakash Ranjan wrote: diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index f7da8953afbe..3904b598e0f9 100644 ---

[PATCHv5] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Sai Prakash Ranjan
Currently for iommu_unmap() of large scatter-gather list with page size elements, the majority of time is spent in flushing of partial walks in __arm_lpae_unmap() which is a VA based TLB invalidation invalidating page-by-page on iommus like arm-smmu-v2 (TLBIVA). For example: to unmap a 32MB

[PATCH] iommu/arm-smmu-v3: Stop pre-zeroing batch commands

2021-08-11 Thread John Garry
Pre-zeroing the batched commands structure is inefficient, as individual commands are zeroed later in arm_smmu_cmdq_build_cmd(). The size is quite large and commonly most commands won't even be used: struct arm_smmu_cmdq_batch cmds = {}; 345c: 5281mov w1, #0x0

Re: [PATCHv4] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Robin Murphy
On 2021-08-11 11:30, Will Deacon wrote: On Wed, Aug 11, 2021 at 11:37:25AM +0530, Sai Prakash Ranjan wrote: diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index f7da8953afbe..3904b598e0f9 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++

Re: [PATCH 07/11] treewide: Replace the use of mem_encrypt_active() with prot_guest_has()

2021-08-11 Thread Tom Lendacky via iommu
On 8/11/21 7:19 AM, Kirill A. Shutemov wrote: > On Tue, Aug 10, 2021 at 02:48:54PM -0500, Tom Lendacky wrote: >> On 8/10/21 1:45 PM, Kuppuswamy, Sathyanarayanan wrote: >>> >>> >>> On 7/27/21 3:26 PM, Tom Lendacky wrote: diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c

Re: [PATCH 01/11] mm: Introduce a function to check for virtualization protection features

2021-08-11 Thread Tom Lendacky via iommu
On 8/11/21 9:53 AM, Kuppuswamy, Sathyanarayanan wrote: > On 7/27/21 3:26 PM, Tom Lendacky wrote: >> diff --git a/include/linux/protected_guest.h >> b/include/linux/protected_guest.h >> new file mode 100644 >> index ..f8ed7b72967b >> --- /dev/null >> +++

Re: [PATCH 01/11] mm: Introduce a function to check for virtualization protection features

2021-08-11 Thread Kuppuswamy, Sathyanarayanan
On 7/27/21 3:26 PM, Tom Lendacky wrote: diff --git a/include/linux/protected_guest.h b/include/linux/protected_guest.h new file mode 100644 index ..f8ed7b72967b --- /dev/null +++ b/include/linux/protected_guest.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-08-11 Thread Andy Shevchenko
On Wed, Aug 11, 2021 at 10:02:48PM +0800, Lu Baolu wrote: > On 2021/8/11 21:49, Andy Shevchenko wrote: > > On Fri, Jul 30, 2021 at 09:01:41PM +0800, Lu Baolu wrote: > > > On 2021/7/30 16:05, Andy Shevchenko wrote: > > > > On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: > > > > > On

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-08-11 Thread Lu Baolu
On 2021/8/11 21:49, Andy Shevchenko wrote: On Fri, Jul 30, 2021 at 09:01:41PM +0800, Lu Baolu wrote: On 2021/7/30 16:05, Andy Shevchenko wrote: On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: On 7/30/21 12:35 AM, Andy Shevchenko wrote: Compiler is not happy about hidden declaration

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-08-11 Thread Andy Shevchenko
On Fri, Jul 30, 2021 at 09:01:41PM +0800, Lu Baolu wrote: > On 2021/7/30 16:05, Andy Shevchenko wrote: > > On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: > > > On 7/30/21 12:35 AM, Andy Shevchenko wrote: > > > > Compiler is not happy about hidden declaration of intel_iommu_ops. > > > >

Re: [PATCH RFC 0/2] dma-pool: allow user to disable atomic pool

2021-08-11 Thread Tom Lendacky via iommu
On 8/10/21 9:23 PM, Baoquan He wrote: > On 08/10/21 at 03:52pm, Tom Lendacky wrote: >> On 8/5/21 1:54 AM, Baoquan He wrote: >>> On 06/24/21 at 11:47am, Robin Murphy wrote: On 2021-06-24 10:29, Baoquan He wrote: > On 06/24/21 at 08:40am, Christoph Hellwig wrote: ... > Looking at the

[PATCH v4 24/24] iommu: Allow enabling non-strict mode dynamically

2021-08-11 Thread Robin Murphy
Allocating and enabling a flush queue is in fact something we can reasonably do while a DMA domain is active, without having to rebuild it from scratch. Thus we can allow a strict -> non-strict transition from sysfs without requiring to unbind the device's driver, which is of particular interest

[PATCH v4 23/24] iommu: Merge strictness and domain type configs

2021-08-11 Thread Robin Murphy
To parallel the sysfs behaviour, merge the new build-time option for DMA domain strictness into the default domain type choice. Suggested-by: Joerg Roedel Reviewed-by: Lu Baolu Reviewed-by: Jean-Philippe Brucker Reviewed-by: John Garry Signed-off-by: Robin Murphy --- v3: Remember to update

[PATCH v4 21/24] iommu: Expose DMA domain strictness via sysfs

2021-08-11 Thread Robin Murphy
The sysfs interface for default domain types exists primarily so users can choose the performance/security tradeoff relevant to their own workload. As such, the choice between the policies for DMA domains fits perfectly as an additional point on that scale - downgrading a particular device from a

[PATCH v4 22/24] iommu: Only log strictness for DMA domains

2021-08-11 Thread Robin Murphy
When passthrough is enabled, the default strictness policy becomes irrelevant, since any subsequent runtime override to a DMA domain type now embodies an explicit choice of strictness as well. Save on noise by only logging the default policy when it is meaningfully in effect. Reviewed-by: John

[PATCH v4 20/24] iommu: Express DMA strictness via the domain type

2021-08-11 Thread Robin Murphy
Eliminate the iommu_get_dma_strict() indirection and pipe the information through the domain type from the beginning. Besides the flow simplification this also has several nice side-effects: - Automatically implies strict mode for untrusted devices by virtue of their IOMMU_DOMAIN_DMA

[PATCH v4 19/24] iommu/vt-d: Prepare for multiple DMA domain types

2021-08-11 Thread Robin Murphy
In preparation for the strict vs. non-strict decision for DMA domains to be expressed in the domain type, make sure we expose our flush queue awareness by accepting the new domain type, and test the specific feature flag where we want to identify DMA domains in general. The DMA ops reset/setup can

[PATCH v4 18/24] iommu/arm-smmu: Prepare for multiple DMA domain types

2021-08-11 Thread Robin Murphy
In preparation for the strict vs. non-strict decision for DMA domains to be expressed in the domain type, make sure we expose our flush queue awareness by accepting the new domain type. Signed-off-by: Robin Murphy --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +

[PATCH v4 17/24] iommu/amd: Prepare for multiple DMA domain types

2021-08-11 Thread Robin Murphy
The DMA ops reset/setup can simply be unconditional, since iommu-dma already knows only to touch DMA domains. Signed-off-by: Robin Murphy --- drivers/iommu/amd/iommu.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/amd/iommu.c

[PATCH v4 15/24] iommu/io-pgtable: Remove non-strict quirk

2021-08-11 Thread Robin Murphy
IO_PGTABLE_QUIRK_NON_STRICT was never a very comfortable fit, since it's not a quirk of the pagetable format itself. Now that we have a more appropriate way to convey non-strict unmaps, though, this last of the non-quirk quirks can also go, and with the flush queue code also now enforcing its own

[PATCH v4 16/24] iommu: Introduce explicit type for non-strict DMA domains

2021-08-11 Thread Robin Murphy
Promote the difference between strict and non-strict DMA domains from an internal detail to a distinct domain feature and type, to pave the road for exposing it through the sysfs default domain interface. Reviewed-by: Lu Baolu Reviewed-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy ---

[PATCH v4 14/24] iommu: Indicate queued flushes via gather data

2021-08-11 Thread Robin Murphy
Since iommu_iotlb_gather exists to help drivers optimise flushing for a given unmap request, it is also the logical place to indicate whether the unmap is strict or not, and thus help them further optimise for whether to expect a sync or a flush_all subsequently. As part of that, it also seems

[PATCH v4 13/24] iommu/dma: Remove redundant "!dev" checks

2021-08-11 Thread Robin Murphy
iommu_dma_init_domain() is now only called from iommu_setup_dma_ops(), which has already assumed dev to be non-NULL. Reviewed-by: John Garry Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH v4 12/24] iommu/dma: Unexport IOVA cookie management

2021-08-11 Thread Robin Murphy
IOVA cookies are now got and put by core code, so we no longer need to export these to modular drivers. The export for getting MSI cookies stays, since VFIO can still be a module, but it was already relying on someone else putting them, so that aspect is unaffected. Reviewed-by: Lu Baolu

[PATCH v4 11/24] iommu/virtio: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Reviewed-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy --- drivers/iommu/virtio-iommu.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 6abdcab7273b..80930ce04a16

[PATCH v4 10/24] iommu/sun50i: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. CC: Maxime Ripard Signed-off-by: Robin Murphy --- v3: Also remove unneeded include --- drivers/iommu/sun50i-iommu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/sun50i-iommu.c

[PATCH v4 09/24] iommu/sprd: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Acked-by: Chunyan Zhang Signed-off-by: Robin Murphy --- v3: Also remove unneeded include --- drivers/iommu/sprd-iommu.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index

[PATCH v4 08/24] iommu/rockchip: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Tested-by: Heiko Stuebner Acked-by: Heiko Stuebner Signed-off-by: Robin Murphy --- v3: Also remove unneeded include --- drivers/iommu/rockchip-iommu.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git

[PATCH v4 07/24] iommu/mtk: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. CC: Yong Wu Signed-off-by: Robin Murphy --- v3: Also remove unneeded includes --- drivers/iommu/mtk_iommu.c| 7 --- drivers/iommu/mtk_iommu_v1.c | 1 - 2 files changed, 8 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c

[PATCH v4 06/24] iommu/ipmmu-vmsa: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Robin Murphy --- v3: Also remove unneeded include --- drivers/iommu/ipmmu-vmsa.c | 28 1 file changed, 4 insertions(+), 24 deletions(-) diff

[PATCH v4 05/24] iommu/exynos: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robin Murphy --- v3: Also remove unneeded include --- drivers/iommu/exynos-iommu.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git

[PATCH v4 04/24] iommu/vt-d: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy --- drivers/iommu/intel/iommu.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index c12cc955389a..7e168634c433 100644 ---

[PATCH v4 03/24] iommu/arm-smmu: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Signed-off-by: Robin Murphy --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 15 --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 9 - 3 files changed, 4 insertions(+), 27

[PATCH v4 02/24] iommu/amd: Drop IOVA cookie management

2021-08-11 Thread Robin Murphy
The core code bakes its own cookies now. Signed-off-by: Robin Murphy --- drivers/iommu/amd/iommu.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 52fe2326042a..0fd98d35d73b 100644 --- a/drivers/iommu/amd/iommu.c +++

[PATCH v4 01/24] iommu: Pull IOVA cookie management into the core

2021-08-11 Thread Robin Murphy
Now that everyone has converged on iommu-dma for IOMMU_DOMAIN_DMA support, we can abandon the notion of drivers being responsible for the cookie type, and consolidate all the management into the core code. CC: Yong Wu CC: Chunyan Zhang CC: Maxime Ripard Tested-by: Heiko Stuebner Tested-by:

[PATCH v4 00/24] iommu: Refactor DMA domain strictness

2021-08-11 Thread Robin Murphy
v1: https://lore.kernel.org/linux-iommu/cover.1626888444.git.robin.mur...@arm.com/ v2: https://lore.kernel.org/linux-iommu/cover.1627468308.git.robin.mur...@arm.com/ v3: https://lore.kernel.org/linux-iommu/cover.1628094600.git.robin.mur...@arm.com/ Hi all, I'm hoping this is good to go now.

Re: [PATCH 07/11] treewide: Replace the use of mem_encrypt_active() with prot_guest_has()

2021-08-11 Thread Kirill A. Shutemov
On Tue, Aug 10, 2021 at 02:48:54PM -0500, Tom Lendacky wrote: > On 8/10/21 1:45 PM, Kuppuswamy, Sathyanarayanan wrote: > > > > > > On 7/27/21 3:26 PM, Tom Lendacky wrote: > >> diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c > >> index de01903c3735..cafed6456d45 100644 > >> ---

[PATCH 0/4] Prepare for ECMDQ support

2021-08-11 Thread Zhen Lei
RFC --> v1 1. Resend the patches for ECMDQ preparation and remove the patches for ECMDQ implementation. 2. Patch 2 is modified. Other patches remain unchanged. 1) Add static helper __arm_smmu_cmdq_issue_cmd(), and make arm_smmu_cmdq_issue_cmd() and arm_smmu_cmdq_issue_cmd_with_sync()

[PATCH 3/4] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_get_cmdq()

2021-08-11 Thread Zhen Lei
One SMMU has only one normal CMDQ. Therefore, this CMDQ is used regardless of the core on which the command is inserted. It can be referenced directly through "smmu->cmdq". However, one SMMU has multiple ECMDQs, and the ECMDQ used by the core on which the command insertion is executed may be

[PATCH 2/4] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync()

2021-08-11 Thread Zhen Lei
The obvious key to the performance optimization of commit 587e6c10a7ce ("iommu/arm-smmu-v3: Reduce contention during command-queue insertion") is to allow multiple cores to insert commands in parallel after a brief mutex contention. Obviously, inserting as many commands at a time as possible can

[PATCH 1/4] iommu/arm-smmu-v3: Use command queue batching helpers to improve performance

2021-08-11 Thread Zhen Lei
The obvious key to the performance optimization of commit 587e6c10a7ce ("iommu/arm-smmu-v3: Reduce contention during command-queue insertion") is to allow multiple cores to insert commands in parallel after a brief mutex contention. Obviously, inserting as many commands at a time as possible can

[PATCH 4/4] iommu/arm-smmu-v3: Extract reusable function __arm_smmu_cmdq_skip_err()

2021-08-11 Thread Zhen Lei
When SMMU_GERROR.CMDQP_ERR is different to SMMU_GERRORN.CMDQP_ERR, it indicates that one or more errors have been encountered on a command queue control page interface. We need to traverse all ECMDQs in that control page to find all errors. For each ECMDQ error handling, it is much the same as the

Re: [PATCH RFC 2/8] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync()

2021-08-11 Thread John Garry
Therefore, function arm_smmu_cmdq_issue_cmd_with_sync() is added to insert the 'cmd+sync' commands at a time. Signed-off-by: Zhen Lei --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 33 + 1 file changed, 21 insertions(+), 12 deletions(-) diff --git

Re: [PATCH] iommu: APPLE_DART should depend on ARCH_APPLE

2021-08-11 Thread Sven Peter via iommu
Good catch, thanks! Acked-by: Sven Peter Sven On Tue, Aug 10, 2021, at 15:47, Geert Uytterhoeven wrote: > The Apple DART (Device Address Resolution Table) IOMMU is only present > on Apple ARM SoCs like the M1. Hence add a dependency on ARCH_APPLE, to > prevent asking the user about this

Re: [PATCHv4] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Sai Prakash Ranjan
On 2021-08-11 16:00, Will Deacon wrote: On Wed, Aug 11, 2021 at 11:37:25AM +0530, Sai Prakash Ranjan wrote: diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index f7da8953afbe..3904b598e0f9 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++

Re: [PATCH RFC 2/8] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync()

2021-08-11 Thread Will Deacon
On Wed, Aug 11, 2021 at 11:31:08AM +0100, John Garry wrote: > > > > > Obviously, inserting as many commands at a time as possible can > > > > > reduce the > > > > > number of times the mutex contention participates, thereby improving > > > > > the > > > > > overall performance. At least it

Re: [PATCH RFC 2/8] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync()

2021-08-11 Thread John Garry
Obviously, inserting as many commands at a time as possible can reduce the number of times the mutex contention participates, thereby improving the overall performance. At least it reduces the number of calls to function arm_smmu_cmdq_issue_cmdlist(). Therefore, function

Re: [PATCHv4] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Will Deacon
On Wed, Aug 11, 2021 at 11:37:25AM +0530, Sai Prakash Ranjan wrote: > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c > b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index f7da8953afbe..3904b598e0f9 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c

Re: [PATCH RFC 2/8] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync()

2021-08-11 Thread Will Deacon
On Wed, Aug 11, 2021 at 10:16:39AM +0800, Leizhen (ThunderTown) wrote: > > > On 2021/8/11 2:24, Will Deacon wrote: > > On Sat, Jun 26, 2021 at 07:01:24PM +0800, Zhen Lei wrote: > >> The obvious key to the performance optimization of commit 587e6c10a7ce > >> ("iommu/arm-smmu-v3: Reduce contention

RE: [PATCH v3 5/5] dma-iommu: account for min_align_mask

2021-08-11 Thread Mi, Dapeng1
> -Original Message- > From: iommu On Behalf Of > David Stevens > Sent: Wednesday, August 11, 2021 10:43 AM > To: Robin Murphy ; Will Deacon > Cc: linux-ker...@vger.kernel.org; Tom Murphy ; > iommu@lists.linux-foundation.org; David Stevens > Subject: [PATCH v3 5/5] dma-iommu: account

Re: [PATCHv3] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Sai Prakash Ranjan
On 2021-08-10 23:38, Will Deacon wrote: On Tue, Aug 03, 2021 at 11:09:17AM +0530, Sai Prakash Ranjan wrote: On 2021-08-02 21:13, Will Deacon wrote: > On Wed, Jun 23, 2021 at 07:12:01PM +0530, Sai Prakash Ranjan wrote: > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c > >

Re: [PATCH v3 3/5] dma-iommu: add SKIP_CPU_SYNC after syncing

2021-08-11 Thread Christoph Hellwig
> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > index 4f0cc4a0a61f..be0214b1455c 100644 > --- a/drivers/iommu/dma-iommu.c > +++ b/drivers/iommu/dma-iommu.c > @@ -859,8 +859,11 @@ static dma_addr_t iommu_dma_map_page(struct device *dev, > struct page *page, > static void

[PATCHv4] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-08-11 Thread Sai Prakash Ranjan
Currently for iommu_unmap() of large scatter-gather list with page size elements, the majority of time is spent in flushing of partial walks in __arm_lpae_unmap() which is a VA based TLB invalidation invalidating page-by-page on iommus like arm-smmu-v2 (TLBIVA). For example: to unmap a 32MB

Re: [PATCH v3 2/5] dma-iommu: fix arch_sync_dma for map

2021-08-11 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu