[GIT PULL] iommu/arm-smmu: Updates for 5.16

2021-10-19 Thread Will Deacon
Hi Joerg, Please pull this tiny batch of Arm SMMU updates for 5.16. It's dominated by compatible string additions for Qualcomm SMMUv2 implementations, but there's a bit of cleanup on the SMMUv3 command-submission side as well. Cheers, Will --->8 The following changes since commit

Re: [PATCH] iommu/arm: fix ARM_SMMU_QCOM compilation

2021-10-14 Thread Will Deacon
On Wed, Oct 13, 2021 at 09:31:40PM +0200, Arnd Bergmann wrote: > On Wed, Oct 13, 2021 at 6:20 PM Will Deacon wrote: > > On Wed, Oct 13, 2021 at 10:33:55AM +0200, Arnd Bergmann wrote: > > > On Wed, Oct 13, 2021 at 9:58 AM Will Deacon wrote: > > > > On Tue, Oct 12,

Re: [PATCH] iommu/arm: fix ARM_SMMU_QCOM compilation

2021-10-13 Thread Will Deacon
Hi Arnd, On Wed, Oct 13, 2021 at 10:33:55AM +0200, Arnd Bergmann wrote: > On Wed, Oct 13, 2021 at 9:58 AM Will Deacon wrote: > > On Tue, Oct 12, 2021 at 05:18:00PM +0200, Arnd Bergmann wrote: > > > From: Arnd Bergmann > > > > > > My previous bugfix ended

Re: [PATCH] iommu/arm: fix ARM_SMMU_QCOM compilation

2021-10-13 Thread Will Deacon
RM SMMU, this needs to be built into the SMMU driver. > + FWIW, I prefer this solution over changing the driver code, so: Acked-by: Will Deacon I assume you'll be getting this fixed for 5.15? Cheers, Will ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v2 2/2] iommu/arm-smmu-v3: Simplify useless instructions in arm_smmu_cmdq_build_cmd()

2021-10-04 Thread Will Deacon
On Wed, Aug 18, 2021 at 04:04:52PM +0800, Zhen Lei wrote: > Although the parameter 'cmd' is always passed by a local array variable, > and only this function modifies it, the compiler does not know this. The > compiler almost always reads the value of cmd[i] from memory rather than > directly

Re: [PATCH] iommu/arm-smmu-v3: Stop pre-zeroing batch commands in arm_smmu_atc_inv_master()

2021-10-04 Thread Will Deacon
On Tue, 17 Aug 2021 19:34:11 +0800, Zhen Lei wrote: > Pre-zeroing the batched commands structure is inefficient, as individual > commands are zeroed later in arm_smmu_cmdq_build_cmd(). Therefore, only > the member 'num' needs to be initialized to 0. > > Applied to will

Re: [PATCH v2 0/2] iommu/arm-smmu-v3: Perform some simple optimizations for arm_smmu_cmdq_build_cmd()

2021-10-04 Thread Will Deacon
On Wed, 18 Aug 2021 16:04:50 +0800, Zhen Lei wrote: > v1 --> v2: > 1. Add patch 1, Properly handle the return value of arm_smmu_cmdq_build_cmd() > 2. Remove arm_smmu_cmdq_copy_cmd(). In addition, when build command fails, > out_cmd is not filled. > > > Zhen Lei (2): > iommu/arm-smmu-v3:

Re: [PATCH 1/2] dt-bindings: arm-smmu: Add compatible for SM6350 SoC

2021-10-04 Thread Will Deacon
On Fri, 20 Aug 2021 22:29:04 +0200, Konrad Dybcio wrote: > Add the SoC specific compatible for SM6350 implementing > arm,mmu-500. > > Applied to will (for-joerg/arm-smmu/updates), thanks! [1/2] dt-bindings: arm-smmu: Add compatible for SM6350 SoC

Re: [PATCH 1/2] iommu: arm-smmu-qcom: Add compatible for qcm2290

2021-10-04 Thread Will Deacon
On Fri, 1 Oct 2021 16:00:31 +0200, Loic Poulain wrote: > Applied to will (for-joerg/arm-smmu/updates), thanks! [1/2] iommu: arm-smmu-qcom: Add compatible for qcm2290 https://git.kernel.org/will/c/756a622c8f06 [2/2] dt-bindings: arm-smmu: Add qcm2290 compatible strings

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: > The IOVA domain structure is a bit overloaded, holding: > - IOVA tree management > - FQ control > - IOVA rcache memories > > Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c > uses the FQ feature. > > This

Re: [PATCH 5/5] iommu/iova: Avoid double-negatives in magazine helpers

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:57PM +0800, John Garry wrote: > A similar crash to the following could be observed if initial CPU rcache > magazine allocations fail in init_iova_rcaches(): > > Unable to handle kernel NULL pointer dereference at virtual address > > Mem abort info:

Re: [PATCH 1/5] iova: Move fast alloc size roundup into alloc_iova_fast()

2021-10-04 Thread Will Deacon
gt; --- > drivers/iommu/dma-iommu.c| 8 > drivers/iommu/iova.c | 9 + > drivers/vdpa/vdpa_user/iova_domain.c | 8 > 3 files changed, 9 insertions(+), 16 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH 0/2] arm64: retry dropping HAVE_ARCH_PFN_VALID

2021-10-01 Thread Will Deacon
On Thu, 30 Sep 2021 04:30:37 +0300, Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > This is a new attempt to drop HAVE_ARCH_PFN_VALID on arm64 and start using > the generic implementation of pfn_valid(). > > [...] Applied to arm64 (for-next/pfn-valid), thanks! [1/2] dma-mapping:

Re: [PATCH] [RFC] qcom_scm: hide Kconfig symbol

2021-09-29 Thread Will Deacon
On Mon, Sep 27, 2021 at 05:22:13PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > Now that SCM can be a loadable module, we have to add another > dependency to avoid link failures when ipa or adreno-gpu are > built-in: > > aarch64-linux-ld: drivers/net/ipa/ipa_main.o: in function

Re: [PATCH] swiotlb: use depends on for DMA_RESTRICTED_POOL

2021-08-31 Thread Will Deacon
;& OF_RESERVED_MEM && SWIOTLB > help > This enables support for restricted DMA pools which provide a level of > DMA memory protection on systems with limited hardware protection Acked-by: Will Deacon Will ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v11 01/12] iova: Export alloc_iova_fast() and free_iova_fast()

2021-08-25 Thread Will Deacon
pinlock in alloc_iova() and free_iova() > > during IOVA allocation. > > > > Signed-off-by: Xie Yongji > > > This needs ack from iommu maintainers. Guys? Looks fine to me: Acked-by: Will Deacon Will ___ iommu mai

Re: [PATCH v2 0/2] Don't fail device probing due to of_dma_set_restricted_buffer()

2021-08-23 Thread Will Deacon
On Mon, Aug 23, 2021 at 06:47:19AM -0400, Konrad Rzeszutek Wilk wrote: > On Mon, Aug 16, 2021 at 02:26:15PM +0100, Will Deacon wrote: > > Hi all, > > > > This is v2 of the patch I previously posted here: > > > > https://lore.kernel.org/r/20210805094736.902-1

Re: [PATCH -next] iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group()

2021-08-20 Thread Will Deacon
return ERR_PTR(-EINVAL); > + } Urgh, I should really have spotted that in review. Thanks: Acked-by: Will Deacon Joerg -- please can you throw this on top? Will ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [GIT PULL] iommu/arm-smmu: Updates for 5.15

2021-08-18 Thread Will Deacon
On Wed, Aug 18, 2021 at 02:08:25PM +0200, Joerg Roedel wrote: > On Fri, Aug 13, 2021 at 05:47:35PM +0100, Will Deacon wrote: > > This applies cleanly against iommu/next, but I suspect it will conflict > > with Robin's series on the list. Please shout if you need anything from

[PATCH v2 1/2] of: Move of_dma_set_restricted_buffer() into device.c

2021-08-16 Thread Will Deacon
Hellwig Cc: Robin Murphy Suggested-by: Rob Herring Link: https://lore.kernel.org/r/CAL_JsqJ7ROWWJX84x2kEex9NQ8G+2=ybrunoobx+j8bjzzs...@mail.gmail.com Signed-off-by: Will Deacon --- drivers/of/address.c| 33 - drivers/of/device.c | 34

[PATCH v2 2/2] of: restricted dma: Don't fail device probe on rmem init failure

2021-08-16 Thread Will Deacon
nd instead either returns early if CONFIG_DMA_RESTRICTED_POOL=n or emits a diagnostic if the reserved DMA pool fails to initialise. Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Cc: Christoph Hellwig Cc: Rob Herring Cc: Robin Murphy Signed-off-by: Will Deacon --- drivers/of/device.c | 13 ++

[PATCH v2 0/2] Don't fail device probing due to of_dma_set_restricted_buffer()

2021-08-16 Thread Will Deacon
devel/for-linus-5.15 branch in swiotlb.git Cheers, Will Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Cc: Christoph Hellwig Cc: Rob Herring Cc: Robin Murphy --->8 Will Deacon (2): of: Move of_dma_set_restricted_buffer() into device.c of: restricted dma: Don't fail device probe on rmem i

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

2021-08-16 Thread Will Deacon
On Mon, Aug 16, 2021 at 03:47:58PM +0800, Leizhen (ThunderTown) wrote: > > > On 2021/8/16 15:24, John Garry wrote: > >> In addition, I find that function arm_smmu_cmdq_build_cmd() can also be > >> optimized > >> slightly, three useless instructions can be reduced. > > > > I think that you

[GIT PULL] iommu/arm-smmu: Updates for 5.15

2021-08-13 Thread Will Deacon
Hi Joerg, Please pull these Arm SMMU updates for 5.15. There's not tonnes here, but a good mixture of optimisations and cleanups -- summary in the tag. This applies cleanly against iommu/next, but I suspect it will conflict with Robin's series on the list. Please shout if you need anything from

Re: [PATCH 0/4] Prepare for ECMDQ support

2021-08-13 Thread Will Deacon
On Wed, 11 Aug 2021 19:48:48 +0800, Zhen Lei wrote: > 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 >

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

2021-08-13 Thread Will Deacon
On Wed, 11 Aug 2021 21:34:26 +0530, Sai Prakash Ranjan wrote: > 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

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

2021-08-13 Thread Will Deacon
On Wed, 11 Aug 2021 23:49:26 +0800, John Garry wrote: > 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

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: [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 > >> (&quo

Re: [PATCHv2] iommu/arm-smmu: Add clk_bulk_{prepare/unprepare} to system pm callbacks

2021-08-10 Thread Will Deacon
On Tue, 10 Aug 2021 12:18:08 +0530, Sai Prakash Ranjan wrote: > Some clocks for SMMU can have parent as XO such as gpu_cc_hub_cx_int_clk > of GPU SMMU in QTI SC7280 SoC and in order to enter deep sleep states in > such cases, we would need to drop the XO clock vote in unprepare call and > this

Re: [Patch V3 0/2] iommu/arm-smmu: Fix races in iommu domain/group creation

2021-08-10 Thread Will Deacon
On Tue, 10 Aug 2021 10:13:59 +0530, Ashish Mhetre wrote: > When two devices with same SID are getting probed concurrently through > iommu_probe_device(), the iommu_group and iommu_domain are allocated more > than once because they are not protected for concurrency. This is leading > to context

Re: [PATCH RFC 0/8] iommu/arm-smmu-v3: add support for ECMDQ register mode

2021-08-10 Thread Will Deacon
On Sat, Jun 26, 2021 at 07:01:22PM +0800, Zhen Lei wrote: > SMMU v3.3 added a new feature, which is Enhanced Command queue interface > for reducing contention when submitting Commands to the SMMU, in this > patch set, ECMDQ is the abbreviation of Enhanced Command Queue. > > When the hardware

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

2021-08-10 Thread Will Deacon
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 during command-queue insertion") is > to allow multiple cores to insert commands in parallel after a brief mutex > contention.

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

2021-08-10 Thread Will Deacon
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 > > > b/drivers/iommu/arm/arm-

Re: [Freedreno] [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-08-10 Thread Will Deacon
On Mon, Aug 09, 2021 at 11:17:40PM +0530, Sai Prakash Ranjan wrote: > On 2021-08-09 23:10, Will Deacon wrote: > > On Mon, Aug 09, 2021 at 10:18:21AM -0700, Rob Clark wrote: > > > On Mon, Aug 9, 2021 at 10:05 AM Will Deacon wrote: > > > > On Mon, Aug 09, 2021 at 09:

Re: [Freedreno] [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-08-09 Thread Will Deacon
On Mon, Aug 09, 2021 at 10:18:21AM -0700, Rob Clark wrote: > On Mon, Aug 9, 2021 at 10:05 AM Will Deacon wrote: > > > > On Mon, Aug 09, 2021 at 09:57:08AM -0700, Rob Clark wrote: > > > On Mon, Aug 9, 2021 at 7:56 AM Will Deacon wrote: > > > > On Mon, Aug 02,

Re: [Freedreno] [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-08-09 Thread Will Deacon
On Mon, Aug 09, 2021 at 09:57:08AM -0700, Rob Clark wrote: > On Mon, Aug 9, 2021 at 7:56 AM Will Deacon wrote: > > On Mon, Aug 02, 2021 at 06:36:04PM -0700, Rob Clark wrote: > > > On Mon, Aug 2, 2021 at 8:14 AM Will Deacon wrote: > > > > On Mon, Aug 02, 2021 at 08:

Re: [Freedreno] [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-08-09 Thread Will Deacon
On Mon, Aug 02, 2021 at 06:36:04PM -0700, Rob Clark wrote: > On Mon, Aug 2, 2021 at 8:14 AM Will Deacon wrote: > > > > On Mon, Aug 02, 2021 at 08:08:07AM -0700, Rob Clark wrote: > > > On Mon, Aug 2, 2021 at 3:55 AM Will Deacon wrote: > > > > > > > &g

Re: [Patch V2 0/2] iommu/arm-smmu: Fix races in iommu domain/group creation

2021-08-09 Thread Will Deacon
On Mon, Aug 02, 2021 at 04:46:37PM +0100, Robin Murphy wrote: > On 2021-08-02 16:16, Will Deacon wrote: > > On Fri, Jun 18, 2021 at 02:00:35AM +0530, Ashish Mhetre wrote: > > > Multiple iommu domains and iommu groups are getting created for the > > > devices > > &

Re: [PATCH v3 24/25] iommu/dma: Factor out flush queue init

2021-08-09 Thread Will Deacon
On Wed, Aug 04, 2021 at 06:15:52PM +0100, Robin Murphy wrote: > Factor out flush queue setup from the initial domain init so that we > can potentially trigger it from sysfs later on in a domain's lifetime. > > Reviewed-by: Lu Baolu > Reviewed-by: John Garry > Signed-off-by: Robin Murphy > ---

Re: [PATCH v3 25/25] iommu: Allow enabling non-strict mode dynamically

2021-08-09 Thread Will Deacon
On Wed, Aug 04, 2021 at 06:15:53PM +0100, Robin Murphy wrote: > 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

Re: [PATCH] of: restricted dma: Don't fail device probe on rmem init failure

2021-08-06 Thread Will Deacon
On Thu, Aug 05, 2021 at 11:26:15AM +0100, Robin Murphy wrote: > On 2021-08-05 10:47, Will Deacon wrote: > > If CONFIG_DMA_RESTRICTED_POOL=n then probing a device with a reference > > to a "restricted-dma-pool" will fail with a reasonably cryptic error: > > &

Re: [PATCH v2 3/4] dma-iommu: pass SKIP_CPU_SYNC to swiotlb unmap

2021-08-06 Thread Will Deacon
On Thu, Aug 05, 2021 at 02:26:10PM +0900, David Stevens wrote: > On Mon, Aug 2, 2021 at 10:54 PM Will Deacon wrote: > > > > On Fri, Jul 09, 2021 at 12:35:01PM +0900, David Stevens wrote: > > > From: David Stevens > > > > > > If SKIP_CPU_SYNC isn't alrea

Re: [PATCH] iommu/arm-smmu-v3: Remove some unneeded init in arm_smmu_cmdq_issue_cmdlist()

2021-08-05 Thread Will Deacon
On Thu, Aug 05, 2021 at 11:22:15AM +0100, John Garry wrote: > On 21/06/2021 17:36, John Garry wrote: > > Members of struct "llq" will be zero-inited, apart from member max_n_shift. > > But we write llq.val straight after the init, so it was pointless to zero > > init those other members. As such,

[PATCH] of: restricted dma: Don't fail device probe on rmem init failure

2021-08-05 Thread Will Deacon
e as we do if the kernel doesn't have the restricted DMA patches applied or either CONFIG_OF_ADDRESS or CONFIG_HAS_DMA =n. Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Cc: Robin Murphy Cc: Christoph Hellwig Cc: Rob Herring Signed-off-by: Will Deacon --- drivers/of/address.c| 8 ---

Re: [PATCH v2 23/24] iommu/arm-smmu: Allow non-strict in pgtable_quirks interface

2021-08-03 Thread Will Deacon
On Tue, Aug 03, 2021 at 01:13:12PM +0100, Robin Murphy wrote: > On 2021-08-03 11:36, Will Deacon wrote: > > Overall, I'm really nervous about the concurrency here and think we'd be > > better off requiring the unbind as we have for the other domain changes. > > Sure, the d

Re: [PATCH v2 23/24] iommu/arm-smmu: Allow non-strict in pgtable_quirks interface

2021-08-03 Thread Will Deacon
On Mon, Aug 02, 2021 at 03:15:50PM +0100, Robin Murphy wrote: > On 2021-08-02 14:04, Will Deacon wrote: > > On Wed, Jul 28, 2021 at 04:58:44PM +0100, Robin Murphy wrote: > > > To make io-pgtable aware of a flush queue being dynamically enabled, > > > allow IO_PGTABLE

Re: [PATCH] iommu/arm-smmu: Add clk_bulk_{prepare/unprepare} to system pm callbacks

2021-08-02 Thread Will Deacon
On Tue, Jul 27, 2021 at 03:03:22PM +0530, Sai Prakash Ranjan wrote: > Some clocks for SMMU can have parent as XO such as gpu_cc_hub_cx_int_clk > of GPU SMMU in QTI SC7280 SoC and in order to enter deep sleep states in > such cases, we would need to drop the XO clock vote in unprepare call and >

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

2021-08-02 Thread Will Deacon
On Wed, Jun 23, 2021 at 07:12:01PM +0530, Sai Prakash Ranjan wrote: > 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 >

Re: [Patch V2 0/2] iommu/arm-smmu: Fix races in iommu domain/group creation

2021-08-02 Thread Will Deacon
On Fri, Jun 18, 2021 at 02:00:35AM +0530, Ashish Mhetre wrote: > Multiple iommu domains and iommu groups are getting created for the devices > sharing same SID. It is expected for devices sharing same SID to be in same > iommu group and same iommu domain. > This is leading to context faults when

Re: [Freedreno] [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-08-02 Thread Will Deacon
On Mon, Aug 02, 2021 at 08:08:07AM -0700, Rob Clark wrote: > On Mon, Aug 2, 2021 at 3:55 AM Will Deacon wrote: > > > > On Thu, Jul 29, 2021 at 10:08:22AM +0530, Sai Prakash Ranjan wrote: > > > On 2021-07-28 19:30, Georgi Djakov wrote: > > > > On Mon, Jan 11, 2

Re: [PATCH v4 5/6] iova: Add iova_len argument to init_iova_domain()

2021-08-02 Thread Will Deacon
On Wed, Jul 14, 2021 at 06:36:42PM +0800, John Garry wrote: > Add max opt argument to init_iova_domain(), and use it to set the rcaches > range. > > Also fix up all users to set this value (at 0, meaning use default). Wrap that in init_iova_domain_defaults() to avoid the mysterious 0? Will

Re: [PATCH v4 2/6] iova: Allow rcache range upper limit to be flexible

2021-08-02 Thread Will Deacon
On Wed, Jul 14, 2021 at 06:36:39PM +0800, John Garry wrote: > Some LLDs may request DMA mappings whose IOVA length exceeds that of the > current rcache upper limit. What's an LLD? > This means that allocations for those IOVAs will never be cached, and > always must be allocated and freed from

Re: [PATCH v4 1/6] iommu: Refactor iommu_group_store_type()

2021-08-02 Thread Will Deacon
hn Garry > --- > drivers/iommu/iommu.c | 73 +++ > 1 file changed, 46 insertions(+), 27 deletions(-) Acked-by: Will Deacon Although likely to conflict with Robin's monster series. Will ___ iom

Re: [PATCH 0/2] Implement [map/unmap]_pages callbacks for ARM SMMUV3

2021-08-02 Thread Will Deacon
g=128(512K size)7.8/93.7 1.3/94.2 > g=256(1M size) 14.7/280.8 1.8/191.5 > g=512(2M size) 3.6/3.2 1.5/2.5 > g=1024(4M size) 2.0/3.1 1.8/2.6 > > Xiang Chen (2): > iommu/arm-smmu-v3: Implement the unmap_pages() IOMMU driver callb

Re: [PATCH v2 3/4] dma-iommu: pass SKIP_CPU_SYNC to swiotlb unmap

2021-08-02 Thread Will Deacon
On Fri, Jul 09, 2021 at 12:35:01PM +0900, David Stevens wrote: > From: David Stevens > > If SKIP_CPU_SYNC isn't already set, then iommu_dma_unmap_(page|sg) has > already called iommu_dma_sync_(single|sg)_for_cpu, so there is no need > to copy from the bounce buffer again. > > Signed-off-by:

Re: [PATCH v2 2/4] dma-iommu: fix arch_sync_dma for map with swiotlb

2021-08-02 Thread Will Deacon
On Mon, Aug 02, 2021 at 02:40:59PM +0100, Will Deacon wrote: > On Fri, Jul 09, 2021 at 12:35:00PM +0900, 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 u

Re: [PATCH v2 2/4] dma-iommu: fix arch_sync_dma for map with swiotlb

2021-08-02 Thread Will Deacon
On Fri, Jul 09, 2021 at 12:35:00PM +0900, 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

Re: [PATCH v2 1/4] dma-iommu: fix sync_sg with swiotlb

2021-08-02 Thread Will Deacon
On Fri, Jul 09, 2021 at 12:34:59PM +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 addresses of the original buffer, so for

Re: [PATCH v2 23/24] iommu/arm-smmu: Allow non-strict in pgtable_quirks interface

2021-08-02 Thread Will Deacon
On Wed, Jul 28, 2021 at 04:58:44PM +0100, Robin Murphy wrote: > To make io-pgtable aware of a flush queue being dynamically enabled, > allow IO_PGTABLE_QUIRK_NON_STRICT to be set even after a domain has been > attached to, and hook up the final piece of the puzzle in iommu-dma. > > Signed-off-by:

Re: [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-08-02 Thread Will Deacon
On Thu, Jul 29, 2021 at 10:08:22AM +0530, Sai Prakash Ranjan wrote: > On 2021-07-28 19:30, Georgi Djakov wrote: > > On Mon, Jan 11, 2021 at 07:45:02PM +0530, Sai Prakash Ranjan wrote: > > > commit ecd7274fb4cd ("iommu: Remove unused IOMMU_SYS_CACHE_ONLY flag") > > > removed unused

Re: [PATCH v2 2/5] iommu: Implement of_iommu_get_resv_regions()

2021-07-30 Thread Will Deacon
On Sat, Jul 17, 2021 at 02:07:12PM +0300, Dmitry Osipenko wrote: > 16.07.2021 17:41, Rob Herring пишет: > > On Fri, Jul 2, 2021 at 8:05 AM Dmitry Osipenko wrote: > >> > >> 23.04.2021 19:32, Thierry Reding пишет: > >>> +void of_iommu_get_resv_regions(struct device *dev, struct list_head > >>>

[PATCH] powerpc/svm: Don't issue ultracalls if !mem_encrypt_active()

2021-07-30 Thread Will Deacon
Sachin Sant Tested-by: Sachin Sant Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/1905cd70-7656-42ae-99e2-a31fc3812...@linux.vnet.ibm.com/ Signed-off-by: Will Deacon --- arch/powerpc/platforms/pseries/svm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/platfo

Re: [powerpc][next-20210727] Boot failure - kernel BUG at arch/powerpc/kernel/interrupt.c:98!

2021-07-29 Thread Will Deacon
On Wed, Jul 28, 2021 at 10:35:34AM -0700, Nathan Chancellor wrote: > On Wed, Jul 28, 2021 at 01:31:06PM +0530, Sachin Sant wrote: > > next-20210723 was good. The boot failure seems to have been introduced with > > next-20210726. > > > > I have attached the boot log. > > I noticed this with

Re: [PATCH v2 1/1] s390/pv: fix the forcing of the swiotlb

2021-07-27 Thread Will Deacon
On Tue, Jul 27, 2021 at 02:54:14PM +0200, Christian Borntraeger wrote: > > On 24.07.21 02:27, Konrad Rzeszutek Wilk wrote: > > On Sat, Jul 24, 2021 at 01:17:46AM +0200, Halil Pasic wrote: > > > Since commit 903cd0f315fe ("swiotlb: Use is_swiotlb_force_bounce for > > > swiotlb data bouncing") if

[PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-20 Thread Will Deacon
: Robin Murphy Cc: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Signed-off-by: Will Deacon --- kernel/dma/swiotlb.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel

[PATCH v2 3/4] swiotlb: Emit diagnostic in swiotlb_exit()

2021-07-20 Thread Will Deacon
Hellwig Cc: Robin Murphy Link: https://lore.kernel.org/r/20210705190352.GA19461@willie-the-truck Suggested-by: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Signed-off-by: Will Deacon --- kernel/dma/swiotlb.c | 1 + 1 file changed

[PATCH v2 2/4] swiotlb: Convert io_default_tlb_mem to static allocation

2021-07-20 Thread Will Deacon
quot;) Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Signed-off-by: Will Deacon --- drivers/base/core.c | 2 +- drivers/xen/swiotlb-xen.c | 4 +-- include/linux/swiotlb.h | 4 +-- kern

[PATCH v2 1/4] of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS

2021-07-20 Thread Will Deacon
-by: Robin Murphy Tested-by: Guenter Roeck Tested-by: Claire Chang Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210702030807.ga2685...@roeck-us.net Fixes: fec9b625095f ("of: Add plumbing for restricted DMA pool") Signed-off-by: Will Deacon --- drivers/of/of_private.h

[PATCH v2 0/4] Fix restricted DMA vs swiotlb_exit()

2021-07-20 Thread Will Deacon
: Nathan Chancellor --->8 Will Deacon (4): of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS swiotlb: Convert io_default_tlb_mem to static allocation swiotlb: Emit diagnostic in swiotlb_exit() swiotlb: Free tbl memory in swiotlb_exit() drivers/base/core.c |

Re: [PATCH 2/5] swiotlb: Point io_default_tlb_mem at static allocation

2021-07-20 Thread Will Deacon
On Tue, Jul 20, 2021 at 09:51:12AM +0200, Christoph Hellwig wrote: > I'd prefer if the next patch is merged into this one, to avoid the > confusing state inbetween entirely. Of course. For some reason, I half thought this patch would need to go to stable, but the restricted DMA stuff didn't land

Re: [PATCH 5/5] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-20 Thread Will Deacon
On Tue, Jul 20, 2021 at 11:36:19AM +0800, Claire Chang wrote: > On Mon, Jul 19, 2021 at 8:31 PM Will Deacon wrote: > > > > Although swiotlb_exit() frees the 'slots' metadata array referenced by > > 'io_tlb_default_mem', it leaves the underlying buffer pages allocated > &

[PATCH 4/5] swiotlb: Emit diagnostic in swiotlb_exit()

2021-07-19 Thread Will Deacon
Hellwig Cc: Robin Murphy Link: https://lore.kernel.org/r/20210705190352.GA19461@willie-the-truck Suggested-by: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Signed-off-by: Will Deacon --- kernel/dma/swiotlb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/dma/swiotlb.c b

[PATCH 5/5] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-19 Thread Will Deacon
: Robin Murphy Cc: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Signed-off-by: Will Deacon --- kernel/dma/swiotlb.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index b3c793ed9e64..87c40517e822 100644

[PATCH 3/5] swiotlb: Remove io_tlb_default_mem indirection

2021-07-19 Thread Will Deacon
: Christoph Hellwig Cc: Robin Murphy Cc: Konrad Rzeszutek Wilk Tested-by: Nathan Chancellor Signed-off-by: Will Deacon --- drivers/base/core.c | 2 +- drivers/xen/swiotlb-xen.c | 4 ++-- include/linux/swiotlb.h | 2 +- kernel/dma/swiotlb.c | 38

[PATCH 1/5] of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS

2021-07-19 Thread Will Deacon
-by: Robin Murphy Tested-by: Guenter Roeck Link: https://lore.kernel.org/r/20210702030807.ga2685...@roeck-us.net Fixes: fec9b625095f ("of: Add plumbing for restricted DMA pool") Signed-off-by: Will Deacon --- drivers/of/of_private.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH 2/5] swiotlb: Point io_default_tlb_mem at static allocation

2021-07-19 Thread Will Deacon
Cc: Christoph Hellwig Cc: Robin Murphy Cc: Konrad Rzeszutek Wilk Fixes: 69031f500865 ("swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used") Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Will Deacon --- include/linux/swiotlb.h | 2 +- ke

[PATCH 0/5] Fix restricted DMA vs swiotlb_exit()

2021-07-19 Thread Will Deacon
://lore.kernel.org/r/YNvMDFWKXSm4LRfZ@Ryzen-9-3900X.localdomain [3] https://lore.kernel.org/r/yorsr0h7u5l9d...@char.us.oracle.com Cc: Guenter Roeck Cc: Claire Chang Cc: Christoph Hellwig Cc: Robin Murphy Cc: Konrad Rzeszutek Wilk Cc: Nathan Chancellor --->8 Will Deacon (5): of: Ret

Re: [PATCH] iommu/amd: Convert from atomic_t to refcount_t on device_state->count

2021-07-19 Thread Will Deacon
On Mon, Jul 19, 2021 at 02:00:37PM +0800, Xiyu Yang wrote: > refcount_t type and corresponding API can protect refcounters from > accidental underflow and overflow and further use-after-free situations. > > Signed-off-by: Xiyu Yang > Signed-off-by: Xin Tan > --- > drivers/iommu/amd/iommu_v2.c

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-12 Thread Will Deacon
On Tue, Jul 06, 2021 at 12:59:57PM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Jul 06, 2021 at 05:57:21PM +0100, Will Deacon wrote: > > On Tue, Jul 06, 2021 at 10:46:07AM -0400, Konrad Rzeszutek Wilk wrote: > > > On Tue, Jul 06, 2021 at 04:05:13PM +0200, Christoph Hellwig wro

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-08 Thread Will Deacon
On Tue, Jul 06, 2021 at 12:14:16PM -0700, Nathan Chancellor wrote: > On 7/6/2021 10:06 AM, Will Deacon wrote: > > On Tue, Jul 06, 2021 at 04:39:11PM +0100, Robin Murphy wrote: > > > On 2021-07-06 15:05, Christoph Hellwig wrote: > > > > On Tue, Jul 06, 2021 at 03:01:

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-06 Thread Will Deacon
On Tue, Jul 06, 2021 at 04:39:11PM +0100, Robin Murphy wrote: > On 2021-07-06 15:05, Christoph Hellwig wrote: > > On Tue, Jul 06, 2021 at 03:01:04PM +0100, Robin Murphy wrote: > > > FWIW I was pondering the question of whether to do something along those > > > lines or just scrap the default

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-06 Thread Will Deacon
On Tue, Jul 06, 2021 at 10:46:07AM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Jul 06, 2021 at 04:05:13PM +0200, Christoph Hellwig wrote: > > On Tue, Jul 06, 2021 at 03:01:04PM +0100, Robin Murphy wrote: > > > FWIW I was pondering the question of whether to do something along those > > > lines

Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path"

2021-07-06 Thread Will Deacon
("iommu/arm: Cleanup resources in case of probe error > path") > Suggested-by: Will Deacon > Signed-off-by: Marek Szyprowski > --- > drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++--- > 1 file changed, 2 insertions(+), 11 deletions(-) Thanks, Marek: Ac

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-06 Thread Will Deacon
On Tue, Jul 06, 2021 at 06:48:48AM +0200, Christoph Hellwig wrote: > On Mon, Jul 05, 2021 at 08:03:52PM +0100, Will Deacon wrote: > > So at this point, the AMD IOMMU driver does: > > > > swiotlb= (iommu_default_passthrough() || sme_me_mask) ? 1 : 0; &g

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-05 Thread Will Deacon
Hi Nathan, I may have just spotted something in these logs... On Fri, Jul 02, 2021 at 10:55:17PM -0700, Nathan Chancellor wrote: > [2.340956] pci :0c:00.1: Adding to iommu group 4 > [2.340996] pci :0c:00.2: Adding to iommu group 4 > [2.341038] pci :0c:00.3: Adding to

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-02 Thread Will Deacon
Hi Nathan, On Thu, Jul 01, 2021 at 12:52:20AM -0700, Nathan Chancellor wrote: > On 7/1/2021 12:40 AM, Will Deacon wrote: > > On Wed, Jun 30, 2021 at 08:56:51AM -0700, Nathan Chancellor wrote: > > > On Wed, Jun 30, 2021 at 12:43:48PM +0100, Will Deacon wrote: > > > >

Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool

2021-07-02 Thread Will Deacon
ted DMA when the restricted-dma-pool is presented. > > > > > > Signed-off-by: Claire Chang > > > Tested-by: Stefano Stabellini > > > Tested-by: Will Deacon > > > > With this patch in place, all sparc and sparc64 qemu emulations > > fail to

Re: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-07-01 Thread Will Deacon
On Thu, Jul 01, 2021 at 10:29:29AM +0200, Marek Szyprowski wrote: > Hi Robin, > > On 30.06.2021 16:01, Robin Murphy wrote: > > On 2021-06-30 14:48, Marek Szyprowski wrote: > >> On 30.06.2021 14:59, Will Deacon wrote: > >>> On Wed, Jun 30, 2021 at 02:4

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-07-01 Thread Will Deacon
On Wed, Jun 30, 2021 at 08:56:51AM -0700, Nathan Chancellor wrote: > On Wed, Jun 30, 2021 at 12:43:48PM +0100, Will Deacon wrote: > > On Wed, Jun 30, 2021 at 05:17:27PM +0800, Claire Chang wrote: > > > `BUG: unable to handle page fault for address: 003a8290` and > &g

Re: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-06-30 Thread Will Deacon
On Wed, Jun 30, 2021 at 02:48:15PM +0200, Marek Szyprowski wrote: > On 08.06.2021 18:45, Amey Narkhede wrote: > > If device registration fails, remove sysfs attribute > > and if setting bus callbacks fails, unregister the device > > and cleanup the sysfs attribute. > > > > Signed-off-by: Amey

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Will Deacon
d > > > use it to determine whether to bounce the data or not. This will be > > > useful later to allow for different pools. > > > > > > Signed-off-by: Claire Chang > > > Reviewed-by: Christoph Hellwig > > > Tested-by: Stefano Stabellini >

Re: [PATCH] iommu/arm-smmu-v3: Add default domain quirk for Arm Fast Models

2021-06-29 Thread Will Deacon
On Fri, Jun 18, 2021 at 05:24:49PM +0100, Robin Murphy wrote: > Arm Fast Models are still implementing legacy virtio-pci devices behind > the SMMU, which continue to be problematic as "real hardware" devices > (from the point of view of the simulated system) without the mitigating >

Re: [PATCH v15 00/12] Restricted DMA

2021-06-25 Thread Will Deacon
On Thu, Jun 24, 2021 at 03:19:48PM -0400, Konrad Rzeszutek Wilk wrote: > On Thu, Jun 24, 2021 at 11:55:14PM +0800, Claire Chang wrote: > > This series implements mitigations for lack of DMA access control on > > systems without an IOMMU, which could result in the DMA accessing the > > system

Re: [PATCH v14 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-24 Thread Will Deacon
On Thu, Jun 24, 2021 at 12:34:09PM +0100, Robin Murphy wrote: > On 2021-06-24 12:18, Will Deacon wrote: > > On Thu, Jun 24, 2021 at 12:14:39PM +0100, Robin Murphy wrote: > > > On 2021-06-24 07:05, Claire Chang wrote: > > > > On Thu, Jun 24, 2021 at 1:

Re: [PATCH v14 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-24 Thread Will Deacon
On Thu, Jun 24, 2021 at 12:14:39PM +0100, Robin Murphy wrote: > On 2021-06-24 07:05, Claire Chang wrote: > > On Thu, Jun 24, 2021 at 1:43 PM Christoph Hellwig wrote: > > > > > > On Wed, Jun 23, 2021 at 02:44:34PM -0400, Qian Cai wrote: > > > > is_swiotlb_force_bounce at > > > >

Re: [PATCH v14 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-23 Thread Will Deacon
l later to allow for different pools. > > > > Signed-off-by: Claire Chang > > Reviewed-by: Christoph Hellwig > > Tested-by: Stefano Stabellini > > Tested-by: Will Deacon > > Acked-by: Stefano Stabellini > > Reverting the rest of the series up to th

Re: [PATCH v3 2/9] dt-bindings: arm-smmu: Add Tegra186 compatible string

2021-06-21 Thread Will Deacon
On Mon, Jun 21, 2021 at 04:11:55PM +0200, Thierry Reding wrote: > On Mon, Jun 21, 2021 at 08:46:54AM +0200, Krzysztof Kozlowski wrote: > > On 18/06/2021 21:47, Rob Herring wrote: > > > On Thu, Jun 3, 2021 at 10:49 AM Thierry Reding > > > wrote: > > >> diff --git

Re: [PATCH 1/2] iommu: Fix race condition during default domain allocation

2021-06-17 Thread Will Deacon
On Thu, Jun 17, 2021 at 11:21:39AM +0530, Ashish Mhetre wrote: > > > On 6/11/2021 6:19 PM, Robin Murphy wrote: > > External email: Use caution opening links or attachments > > > > > > On 2021-06-11 11:45, Will Deacon wrote: > > > On Thu, Jun 10, 202

  1   2   3   4   5   6   7   8   9   10   >