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

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

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

2021-06-15 Thread Georgi Djakov
From: "Isaac J. Manjarres" The io-pgtable code expects to operate on a single block or granule of memory that is supported by the IOMMU hardware when unmapping memory. This means that when a large buffer that consists of multiple such blocks is unmapped, the io-pgtable code will walk the page

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

2021-06-15 Thread Georgi Djakov
From: "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

[PATCH v6 00/15] Optimizing iommu_[map/unmap] performance

2021-06-15 Thread Georgi Djakov
When unmapping a buffer from an IOMMU domain, the IOMMU framework unmaps the buffer at a granule of the largest page size that is supported by the IOMMU hardware and fits within the buffer. For every block that is unmapped, the IOMMU framework will call into the IOMMU driver, and then the

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

2021-06-15 Thread Georgi Djakov
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 Signed-off-by: Georgi Djakov ---

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

2021-06-15 Thread Georgi Djakov
From: "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:

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

2021-06-15 Thread Georgi Djakov
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 Signed-off-by: Georgi Djakov --- drivers/iommu/iommu.c | 31

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

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

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

2021-06-15 Thread Georgi Djakov
From: "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 Signed-off-by: Georgi Djakov --- drivers/iommu/io-pgtable-arm.c | 75 +++--- 1 file changed, 49

Re: [PATCH v3 3/9] iommu/arm-smmu: Implement ->probe_finalize()

2021-06-15 Thread Marek Szyprowski
Hi, On 03.06.2021 18:46, Thierry Reding wrote: > From: Thierry Reding > > Implement a ->probe_finalize() callback that can be used by vendor > implementations to perform extra programming necessary after devices > have been attached to the SMMU. > > Signed-off-by: Thierry Reding This patch

Re: [PATCH v3 3/9] iommu/arm-smmu: Implement ->probe_finalize()

2021-06-15 Thread Will Deacon
On Tue, Jun 15, 2021 at 06:12:13PM +, Krishna Reddy wrote: > > if (smmu->impl->probe_finalize) > > The above is the issue. It should be updated as below similar to other > instances impl callbacks. > if (smmu->impl && smmu->impl->probe_finalize) I'll push a patch on top shortly... Will

Re: [PATCH v3 2/6] iommu/amd: Do not use flush-queue when NpCache is on

2021-06-15 Thread Nadav Amit
> On Jun 15, 2021, at 6:08 AM, Robin Murphy wrote: > > On 2021-06-07 19:25, Nadav Amit wrote: >> From: Nadav Amit >> Do not use flush-queue on virtualized environments, where the NpCache >> capability of the IOMMU is set. This is required to reduce >> virtualization overheads. >> This change

Re: [PATCH v3 6/6] iommu/amd: Sync once for scatter-gather operations

2021-06-15 Thread Nadav Amit
> On Jun 15, 2021, at 4:25 AM, Robin Murphy wrote: > > On 2021-06-07 19:25, Nadav Amit wrote: >> From: Nadav Amit >> On virtual machines, software must flush the IOTLB after each page table >> entry update. >> The iommu_map_sg() code iterates through the given scatter-gather list >> and

Re: [PATCH v3 4/6] iommu: Factor iommu_iotlb_gather_is_disjoint() out

2021-06-15 Thread Nadav Amit
> On Jun 15, 2021, at 3:29 AM, Will Deacon wrote: > > On Fri, Jun 11, 2021 at 09:50:31AM -0700, Nadav Amit wrote: >> >> >>> On Jun 11, 2021, at 6:57 AM, Will Deacon wrote: >>> >>> On Mon, Jun 07, 2021 at 11:25:39AM -0700, Nadav Amit wrote: From: Nadav Amit Refactor

Re: [PATCH v3 3/6] iommu: Improve iommu_iotlb_gather helpers

2021-06-15 Thread Nadav Amit
> On Jun 15, 2021, at 3:42 AM, Robin Murphy wrote: > > On 2021-06-07 19:25, Nadav Amit wrote: >> From: Robin Murphy >> The Mediatek driver is not the only one which might want a basic >> address-based gathering behaviour, so although it's arguably simple >> enough to open-code, let's factor

Re: [PATCH v3 3/6] iommu: Improve iommu_iotlb_gather helpers

2021-06-15 Thread Nadav Amit
> On Jun 15, 2021, at 12:05 PM, Nadav Amit wrote: > > > >> On Jun 15, 2021, at 3:42 AM, Robin Murphy wrote: >> >> On 2021-06-07 19:25, Nadav Amit wrote: >>> From: Robin Murphy >>> The Mediatek driver is not the only one which might want a basic >>> address-based gathering behaviour, so

[PATCH] dt-bindings: Drop redundant minItems/maxItems

2021-06-15 Thread Rob Herring
If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems. This

Re: [PATCH 1/1] iommu/arm-smmu-v3: remove unnecessary oom message

2021-06-15 Thread Will Deacon
On Wed, 9 Jun 2021 20:54:38 +0800, Zhen Lei wrote: > Fixes scripts/checkpatch.pl warning: > WARNING: Possible unnecessary 'out of memory' message > > Remove it can help us save a bit of memory. Applied to will (for-joerg/arm-smmu/updates), thanks! [1/1] iommu/arm-smmu-v3: Remove unnecessary oom

Re: [PATCH v3 5/6] iommu/amd: Tailored gather logic for AMD

2021-06-15 Thread Robin Murphy
On 2021-06-15 19:14, Nadav Amit wrote: On Jun 15, 2021, at 5:55 AM, Robin Murphy wrote: On 2021-06-07 19:25, Nadav Amit wrote: From: Nadav Amit AMD's IOMMU can flush efficiently (i.e., in a single flush) any range. This is in contrast, for instnace, to Intel IOMMUs that have a limit on

<    1   2