Re: [PATCH] iommu/dma: Add support for DMA_ATTR_SYS_CACHE

2019-10-26 Thread isaacm
On 2019-10-25 22:30, Christoph Hellwig wrote: The definition makes very little sense. Can you please clarify what part doesn’t make sense, and why? This is really just an extension of this patch that got mainlined, so that clients that use the DMA API can use IOMMU_QCOM_SYS_CACHE as well:

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

2020-02-18 Thread isaacm
On 2020-02-17 07:50, Robin Murphy wrote: On 17/02/2020 8:01 am, Christoph Hellwig wrote: On Fri, Feb 14, 2020 at 02:58:16PM -0800, Isaac J. Manjarres wrote: From: Liam Mark Some devices have a memory map which contains gaps or holes. In order for the device to have as much IOVA space as

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

2020-02-19 Thread isaacm
On 2020-02-19 03:15, Will Deacon wrote: On Tue, Feb 18, 2020 at 05:57:18PM -0800, isa...@codeaurora.org wrote: On 2020-02-17 07:50, Robin Murphy wrote: > On 17/02/2020 8:01 am, Christoph Hellwig wrote: > > On Fri, Feb 14, 2020 at 02:58:16PM -0800, Isaac J. Manjarres wrote: > > > From: Liam Mark

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

2020-02-19 Thread isaacm
On 2020-02-17 08:03, Robin Murphy wrote: On 14/02/2020 11:06 pm, Isaac J. Manjarres wrote: From: Liam Mark Using the best-fit algorithm, instead of the first-fit algorithm, may reduce fragmentation when allocating IOVAs. What kind of pathological allocation patterns make that a serious

Re: [PATCH 0/5] Optimize iommu_map_sg() performance

2021-01-11 Thread isaacm
On 2021-01-10 23:52, Sai Prakash Ranjan wrote: On 2021-01-11 11:52, Sai Prakash Ranjan wrote: Hi Isaac, I gave this series a go on chromebook and saw these warnings and several device probe failures, logs attached below: WARN corresponds to this code in arm_lpae_map_by_pgsize() if

Re: [PATCH] iommu/io-pgtable-arm: Allow non-coherent masters to use system cache

2021-01-07 Thread isaacm
On 2021-01-06 03:56, Will Deacon wrote: On Thu, Dec 24, 2020 at 12:10:07PM +0530, Sai Prakash Ranjan wrote: commit ecd7274fb4cd ("iommu: Remove unused IOMMU_SYS_CACHE_ONLY flag") removed unused IOMMU_SYS_CACHE_ONLY prot flag and along with it went the memory type setting required for the

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

2020-12-23 Thread isaacm
On 2020-12-23 05:44, Robin Murphy wrote: On 2020-12-22 19:54, isa...@codeaurora.org wrote: On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not

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

2020-12-21 Thread isaacm
On 2020-12-21 07:22, Robin Murphy wrote: On 2020-12-18 18:59, isa...@codeaurora.org wrote: On 2020-12-18 04:38, Robin Murphy wrote: On 2020-12-18 08:38, Isaac J. Manjarres wrote: The io-pgtable-arm and io-pgtable-arm-v7s source files will be compiled as separate modules, along with the

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

2020-12-18 Thread isaacm
On 2020-12-18 04:38, Robin Murphy wrote: On 2020-12-18 08:38, Isaac J. Manjarres wrote: 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

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

2020-12-22 Thread isaacm
On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not ideal, as this increases the footprint of the io-pgtable code, as well as prevents io-pgtable

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

2020-12-22 Thread isaacm
On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The SMMU driver depends on the availability of the ARM LPAE and ARM V7S io-pgtable format code to work properly. In preparation Nit: we don't really depend on v7s - we *can* use it if it's available,

Re: [PATCH] iommu/io-pgtable-arm: Allow non-coherent masters to use system cache

2021-01-08 Thread isaacm
On 2021-01-08 10:18, Will Deacon wrote: On Fri, Jan 08, 2021 at 11:17:25AM +0530, Sai Prakash Ranjan wrote: On 2021-01-07 22:27, isa...@codeaurora.org wrote: > On 2021-01-06 03:56, Will Deacon wrote: > > On Thu, Dec 24, 2020 at 12:10:07PM +0530, Sai Prakash Ranjan wrote: > > > commit

Re: [PATCH] iommu/io-pgtable-arm: Allow non-coherent masters to use system cache

2021-01-08 Thread isaacm
On 2021-01-07 21:47, Sai Prakash Ranjan wrote: On 2021-01-07 22:27, isa...@codeaurora.org wrote: On 2021-01-06 03:56, Will Deacon wrote: On Thu, Dec 24, 2020 at 12:10:07PM +0530, Sai Prakash Ranjan wrote: commit ecd7274fb4cd ("iommu: Remove unused IOMMU_SYS_CACHE_ONLY flag") removed unused

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

2021-01-21 Thread isaacm
On 2021-01-12 08:00, Robin Murphy wrote: On 2021-01-11 14:54, Isaac J. Manjarres wrote: The iommu_map_sg() code currently iterates through the given scatter-gather list, and in the worst case, invokes iommu_map() for each element in the scatter-gather list, which calls into the IOMMU driver

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

2021-03-30 Thread isaacm
On 2021-03-30 21:47, Lu Baolu wrote: On 3/31/21 11:00 AM, Isaac J. Manjarres wrote: Add a callback for IOMMU drivers to provide a path for the IOMMU framework to call into an IOMMU driver, which can call into the io-pgtable code, to unmap a virtually contiguous range of pages of the same size.

Re: [RFC PATCH 3/6] iommu: Use bitmap to calculate page size in iommu_pgsize()

2021-04-01 Thread isaacm
On 2021-04-01 09:47, Will Deacon wrote: 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 --- drivers/iommu/iommu.c | 31 --- 1 file changed,

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

2021-04-05 Thread isaacm
On 2021-04-04 23:00, Lu Baolu wrote: Hi, On 4/2/21 9:34 AM, Isaac J. Manjarres wrote: static size_t __iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size, struct iommu_iotlb_gather *iotlb_gather) @@ -2476,7 +2519,7

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

2021-04-06 Thread isaacm
On 2021-04-06 05:15, Will Deacon wrote: On Mon, Apr 05, 2021 at 12:11:09PM -0700, Isaac J. Manjarres wrote: 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

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

2021-04-06 Thread isaacm
On 2021-04-06 04:53, Will Deacon wrote: On Mon, Apr 05, 2021 at 12:11:06PM -0700, Isaac J. Manjarres wrote: From: Will Deacon The 'addr_merge' parameter to iommu_pgsize() is a fabricated address intended to describe the alignment requirements to consider when choosing an appropriate page

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

2021-04-06 Thread isaacm
On 2021-04-06 04:57, Will Deacon wrote: On Mon, Apr 05, 2021 at 12:11:03PM -0700, Isaac J. Manjarres wrote: Mapping memory into io-pgtables follows the same semantics that unmapping memory used to follow (i.e. a buffer will be mapped one page block per call to the io-pgtable code). This means

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

2021-04-02 Thread isaacm
On 2021-03-30 22:39, Lu Baolu wrote: On 3/31/21 1:36 PM, isa...@codeaurora.org wrote: On 2021-03-30 21:47, Lu Baolu wrote: On 3/31/21 11:00 AM, Isaac J. Manjarres wrote: Add a callback for IOMMU drivers to provide a path for the IOMMU framework to call into an IOMMU driver, which can call

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

2021-04-07 Thread isaacm
On 2021-04-07 02:57, Will Deacon wrote: On Tue, Apr 06, 2021 at 02:02:26PM -0700, isa...@codeaurora.org wrote: On 2021-04-06 05:15, Will Deacon wrote: > On Mon, Apr 05, 2021 at 12:11:09PM -0700, Isaac J. Manjarres wrote: > > Implement the unmap_pages() callback for the ARM LPAE io-pgtable > >

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

2021-04-08 Thread isaacm
On 2021-04-08 06:58, Will Deacon wrote: On Wed, Apr 07, 2021 at 09:52:38PM -0700, Isaac J. Manjarres wrote: 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

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

2021-04-08 Thread isaacm
On 2021-04-08 06:59, Will Deacon wrote: On Wed, Apr 07, 2021 at 09:52:32PM -0700, Isaac J. Manjarres wrote: From: Will Deacon The 'addr_merge' parameter to iommu_pgsize() is a fabricated address intended to describe the alignment requirements to consider when choosing an appropriate page

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

2021-04-08 Thread isaacm
On 2021-04-08 07:32, Will Deacon wrote: On Wed, Apr 07, 2021 at 09:52:36PM -0700, Isaac J. Manjarres wrote: 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 | 70