[PATCH] dma-mapping: benchmark: use the correct HiSilicon copyright

2021-03-30 Thread Hao Fang
s/Hisilicon/HiSilicon/g. It should use capital S, according to https://www.hisilicon.com/en/terms-of-use. Signed-off-by: Hao Fang --- kernel/dma/map_benchmark.c | 2 +- tools/testing/selftests/dma/dma_map_benchmark.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH v14 13/13] iommu/smmuv3: Accept configs with more than one context descriptor

2021-03-30 Thread Zenghui Yu
Hi Eric, On 2021/2/24 4:56, Eric Auger wrote: In preparation for vSVA, let's accept userspace provided configs with more than one CD. We check the max CD against the host iommu capability and also the format (linear versus 2 level). Signed-off-by: Eric Auger Signed-off-by: Shameer Kolothum

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-03-30 Thread Zenghui Yu
On 2021/2/24 4:56, Eric Auger wrote: @@ -1936,7 +1950,12 @@ static void arm_smmu_tlb_inv_range_domain(unsigned long iova, size_t size, }, }; - if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { + if (ext_asid >= 0) { /* guest stage 1 invalidation */ +

Re: [PATCH] iommu: Add a check to avoid invalid iotlb sync

2021-03-30 Thread Robin Murphy
On 2021-03-30 02:22, chenxiang (M) wrote: Hi Will, 在 2021/3/29 22:45, Will Deacon 写道: On Sat, Mar 27, 2021 at 02:23:10PM +0800, chenxiang wrote: From: Xiang Chen Currently it will send a iotlb sync at end of iommu unmap even if iotlb_gather is not valid (iotlb_gather->pgsize = 0). Actually

Re: [PATCH] iommu: Add a check to avoid invalid iotlb sync

2021-03-30 Thread Will Deacon
On Tue, Mar 30, 2021 at 10:04:53AM +0100, Robin Murphy wrote: > On 2021-03-30 02:22, chenxiang (M) wrote: > > Hi Will, > > > > > > 在 2021/3/29 22:45, Will Deacon 写道: > > > On Sat, Mar 27, 2021 at 02:23:10PM +0800, chenxiang wrote: > > > > From: Xiang Chen > > > > > > > > Currently it will send

Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-30 Thread Robin Murphy
On 2021-03-26 21:03, Heiner Kallweit wrote: Zillions of drivers use the unlikely() hint when checking the result of dma_mapping_error(). This is an inline function anyway, so we can move the hint into the function and remove it from drivers over time. I'm pretty sure I reviewed this last time

Re: [PATCH 04/18] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:10PM +0100, Christoph Hellwig wrote: > Keep the functionality to allocate the domain together. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/fsl_pamu_domain.c | 34 ++--- > 1 file changed, 10

Re: [PATCH 14/18] iommu: remove DOMAIN_ATTR_NESTING

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:20PM +0100, Christoph Hellwig wrote: > Use an explicit enable_nesting method instead. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 - > drivers/iommu/arm/arm-smmu/arm-smmu.c

Re: [PATCH 17/18] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:23PM +0100, Christoph Hellwig wrote: > Use an explicit set_pgtable_quirks method instead that just passes > the actual quirk bitmask instead. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +- >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jason Gunthorpe
On Tue, Mar 30, 2021 at 01:37:05AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, March 30, 2021 12:32 AM > > > > On Wed, Mar 24, 2021 at 12:05:28PM -0700, Jacob Pan wrote: > > > > > > IMHO a use created PASID is either bound to a mm (current) at creation > > > > time,

Re: [PATCH 09/18] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:15PM +0100, Christoph Hellwig wrote: > No good reason to split this functionality over two functions. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/fsl_pamu_domain.c | 59 +++-- > 1 file changed, 20

Re: [PATCH 03/18] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:09PM +0100, Christoph Hellwig wrote: > The default geometry is the same as the one set by qman_port given > that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. > > Remove the support to update the geometry and remove the now pointless > geom_size

Re: [PATCH 15/18] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:21PM +0100, Christoph Hellwig wrote: > Don't obsfucate the trivial bit flag check. > > Signed-off-by: Christoph Hellwig > --- > drivers/iommu/iommu.c | 23 +-- > 1 file changed, 5 insertions(+), 18 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: > From: Robin Murphy > > Instead make the global iommu_dma_strict paramete in iommu.c canonical by > exporting helpers to get and set it and use those directly in the drivers. > > This make sure that the iommu.strict parameter

Re: [PATCH] iommu: Add a check to avoid invalid iotlb sync

2021-03-30 Thread chenxiang (M)
在 2021/3/30 17:25, Will Deacon 写道: On Tue, Mar 30, 2021 at 10:04:53AM +0100, Robin Murphy wrote: On 2021-03-30 02:22, chenxiang (M) wrote: Hi Will, 在 2021/3/29 22:45, Will Deacon 写道: On Sat, Mar 27, 2021 at 02:23:10PM +0800, chenxiang wrote: From: Xiang Chen Currently it will send a

Re: [PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:14PM +0100, Christoph Hellwig wrote: > Merge the two fuctions that configure the ppaace into a single coherent > function. I somehow doubt we need the two pamu_config_ppaace calls, > but keep the existing behavior just to be on the safe side. > > Signed-off-by:

[PATCH v2] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync

2021-03-30 Thread chenxiang
From: Xiang Chen It may send a invalid tlb sync for smmuv3 if iotlb_gather is not valid (iotlb_gather->pgsize = 0). So add a check to avoid invalid iotlb sync for it. Signed-off-by: Xiang Chen --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jason Gunthorpe
On Tue, Mar 30, 2021 at 04:14:58AM +, Tian, Kevin wrote: > One correction. The mdev should still construct the list of allowed PASID's as > you said (by listening to IOASID_BIND/UNBIND event), in addition to the > ioasid > set maintained per VM (updated when a PASID is allocated/freed). The

Re: [PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:11PM +0100, Christoph Hellwig wrote: > The only domains allocated forces use of a single window. Remove all > the code related to multiple window support, as well as the need for > qman_portal to force a single window. > > Remove the now unused DOMAIN_ATTR_WINDOWS

Re: [PATCH 18/18] iommu: remove iommu_domain_{get,set}_attr

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:24PM +0100, Christoph Hellwig wrote: > Remove the now unused iommu attr infrastructure. > > Signed-off-by: Christoph Hellwig > --- > drivers/iommu/iommu.c | 26 -- > include/linux/iommu.h | 36 > 2 files

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-30 Thread Robin Murphy
On 2021-03-30 14:11, Will Deacon wrote: On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: From: Robin Murphy Instead make the global iommu_dma_strict paramete in iommu.c canonical by exporting helpers to get and set it and use those directly in the drivers. This make sure

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jason Gunthorpe
On Tue, Mar 30, 2021 at 02:24:09AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, March 30, 2021 12:32 AM > > > In terms of usage for guest SVA, an ioasid_set is mostly tied to a host > > > mm, > > > the use case is as the following: > > > > From that doc: > > > > It

Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-30 Thread Heiner Kallweit
On 30.03.2021 12:21, Robin Murphy wrote: > On 2021-03-26 21:03, Heiner Kallweit wrote: >> Zillions of drivers use the unlikely() hint when checking the result of >> dma_mapping_error(). This is an inline function anyway, so we can move >> the hint into the function and remove it from drivers over

Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-30 Thread Heiner Kallweit
On 26.03.2021 22:03, Heiner Kallweit wrote: > Zillions of drivers use the unlikely() hint when checking the result of > dma_mapping_error(). This is an inline function anyway, so we can move > the hint into the function and remove it from drivers over time. > > Signed-off-by: Heiner Kallweit >

Re: [PATCH 24/30] Kconfig: Change Synopsys to Synopsis

2021-03-30 Thread Robin Murphy
On 2021-03-29 00:53, Bhaskar Chowdhury wrote: s/Synopsys/Synopsis/ .two different places. Erm, that is definitely not a typo... :/ ..and for some unknown reason it introduce a empty line deleted and added back. Presumably your editor is configured to trim trailing whitespace on save.

Re: [PATCH 01/18] iommu: remove the unused domain_window_disable method

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:07PM +0100, Christoph Hellwig wrote: > domain_window_disable is wired up by fsl_pamu, but never actually called. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/fsl_pamu_domain.c | 48 - >

Re: [PATCH 02/18] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:08PM +0100, Christoph Hellwig wrote: > None of the values returned by this function are ever queried. Also > remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- >

Re: [PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:12PM +0100, Christoph Hellwig wrote: > The only thing that fsl_pamu_window_enable does for the current caller > is to fill in the prot value in the only dma_window structure, and to > propagate a few values from the iommu_domain_geometry struture into the >

Re: [PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:17PM +0100, Christoph Hellwig wrote: > The snoop_id is always set to ~(u32)0. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/fsl_pamu_domain.c | 5 ++--- > drivers/iommu/fsl_pamu_domain.h | 1 - > 2 files changed, 2 insertions(+), 4

Re: [PATCH 12/18] iommu: remove DOMAIN_ATTR_PAGING

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:18PM +0100, Christoph Hellwig wrote: > DOMAIN_ATTR_PAGING is never used. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/iommu.c | 5 - > include/linux/iommu.h | 1 - > 2 files changed, 6 deletions(-) Acked-by: Will Deacon

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jason Gunthorpe
On Fri, Mar 26, 2021 at 09:06:42AM +0100, Jean-Philippe Brucker wrote: > It's not inconceivable to have a control queue doing DMA tagged with > PASID. The devices I know either use untagged DMA, or have a choice to use > a PASID. I don't think we should encourage that. A PASID and all the

Re: [PATCH 07/18] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:13PM +0100, Christoph Hellwig wrote: > Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly > instead of indirecting through the iommu attr API. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- >

Re: [PATCH 10/18] iommu/fsl_pamu: enable the liodn when attaching a device

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:16PM +0100, Christoph Hellwig wrote: > Instead of a separate call to enable all devices from the list, just > enablde the liodn one the device is attached to the iommu domain. (typos: "enablde" and "one" probably needs to be "once"?) > This also remove the

Re: [PATCH 13/18] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:19PM +0100, Christoph Hellwig wrote: > The geometry information can be trivially queried from the iommu_domain > struture. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/iommu.c | 20 +++- >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jean-Philippe Brucker
On Tue, Mar 30, 2021 at 10:07:55AM -0300, Jason Gunthorpe wrote: > On Fri, Mar 26, 2021 at 09:06:42AM +0100, Jean-Philippe Brucker wrote: > > > It's not inconceivable to have a control queue doing DMA tagged with > > PASID. The devices I know either use untagged DMA, or have a choice to use > > a

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jason Gunthorpe
On Tue, Mar 30, 2021 at 03:42:24PM +0200, Jean-Philippe Brucker wrote: > On Tue, Mar 30, 2021 at 10:07:55AM -0300, Jason Gunthorpe wrote: > > On Fri, Mar 26, 2021 at 09:06:42AM +0100, Jean-Philippe Brucker wrote: > > > > > It's not inconceivable to have a control queue doing DMA tagged with > > >

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-30 Thread Will Deacon
On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: > On 2021-03-30 14:11, Will Deacon wrote: > > On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: > > > From: Robin Murphy > > > > > > Instead make the global iommu_dma_strict paramete in iommu.c canonical by > > >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jason Gunthorpe
On Mon, Mar 29, 2021 at 03:55:26PM -0700, Jacob Pan wrote: > In one of the earlier discussions, I was made aware of some use cases (by > AMD, iirc) where PASID can be used w/o IOMMU. That is why I tried to keep > ioasid a separate subsystem. Other than that, I don't see an issue > combining the

Re: [PATCH v2] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync

2021-03-30 Thread Will Deacon
On Tue, 30 Mar 2021 20:58:26 +0800, chenxiang wrote: > It may send a invalid tlb sync for smmuv3 if iotlb_gather is not valid > (iotlb_gather->pgsize = 0). So add a check to avoid invalid iotlb sync > for it. Applied to will (for-joerg/arm-smmu/updates), thanks! [1/1] iommu/arm-smmu-v3: Add a

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-30 Thread Robin Murphy
On 2021-03-30 14:58, Will Deacon wrote: On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: On 2021-03-30 14:11, Will Deacon wrote: On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: From: Robin Murphy Instead make the global iommu_dma_strict paramete in iommu.c

Re: [PATCH v13 00/10] iommu: I/O page faults for SMMUv3

2021-03-30 Thread Jean-Philippe Brucker
Hi Will, Joerg, On Tue, Mar 02, 2021 at 10:26:36AM +0100, Jean-Philippe Brucker wrote: > Add stall support to the SMMUv3 driver, along with a common I/O Page > Fault handler. I only have review/ack tags and one assert_lockdep to add to this series. Should I send a v14 now or wait a little

Re: [PATCH 14/30] Revert "s3c24xx-dma.c: Fix a typo"

2021-03-30 Thread Vinod Koul
On 29-03-21, 05:23, Bhaskar Chowdhury wrote: > s/transferred/transfered/ > > This reverts commit a2ddb8aea8106bd5552f8516ad7a8a26b9282a8f. This is not upstream, why not squash in. Also would make sense to write sensible changelog and not phrases and use the right subsystem conventions! Droped

Re: [PATCH v2 1/4] iommu/vt-d: Enable write protect for supervisor SVM

2021-03-30 Thread Jacob Pan
Hi Guenter, On Mon, 22 Mar 2021 10:53:38 -0700, Guenter Roeck wrote: > On Tue, Mar 02, 2021 at 02:13:57AM -0800, Jacob Pan wrote: > > Write protect bit, when set, inhibits supervisor writes to the read-only > > pages. In supervisor shared virtual addressing (SVA), where page tables > > are

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

2021-03-30 Thread Lu Baolu
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 into the io-pgtable code, to unmap a

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: [PATCH v2 1/4] iommu/vt-d: Enable write protect for supervisor SVM

2021-03-30 Thread Guenter Roeck
On 3/30/21 10:52 AM, Jacob Pan wrote: > Hi Guenter, > > On Mon, 22 Mar 2021 10:53:38 -0700, Guenter Roeck > wrote: > >> On Tue, Mar 02, 2021 at 02:13:57AM -0800, Jacob Pan wrote: >>> Write protect bit, when set, inhibits supervisor writes to the read-only >>> pages. In supervisor shared virtual

Re: [PATCH 24/30] Kconfig: Change Synopsys to Synopsis

2021-03-30 Thread Bhaskar Chowdhury
On 12:43 Tue 30 Mar 2021, Robin Murphy wrote: On 2021-03-29 00:53, Bhaskar Chowdhury wrote: s/Synopsys/Synopsis/ .two different places. Erm, that is definitely not a typo... :/ ..and for some unknown reason it introduce a empty line deleted and added back. Presumably your editor is

Re: [PATCH 14/30] Revert "s3c24xx-dma.c: Fix a typo"

2021-03-30 Thread Bhaskar Chowdhury
On 22:59 Tue 30 Mar 2021, Vinod Koul wrote: On 29-03-21, 05:23, Bhaskar Chowdhury wrote: s/transferred/transfered/ This reverts commit a2ddb8aea8106bd5552f8516ad7a8a26b9282a8f. This is not upstream, why not squash in. Also would make sense to write sensible changelog and not phrases and use

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-30 Thread Jacob Pan
Hi Jason, On Tue, 30 Mar 2021 10:43:13 -0300, Jason Gunthorpe wrote: > > If two mdevs from the same PF dev are assigned to two VMs, the PASID > > table will be shared. IOASID set ensures one VM cannot program another > > VM's PASIDs. I assume 'secure context' is per VM when it comes to host > >

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

2021-03-30 Thread Lu Baolu
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. For IOMMU drivers that do not specify

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

2021-03-30 Thread Isaac J. Manjarres
The IOMMU framework currently unmaps memory one page block at a time, per the page block sizes that are supported by the IOMMU hardware. Now that IOMMU drivers can supply a callback for unmapping multiple in one call, add support in the IOMMU framework to calculate how many page mappings of the

[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

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

2021-03-30 Thread Isaac J. Manjarres
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. For IOMMU drivers that do not specify an unmap_pages() callback, the existing logic of

[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

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

2021-03-30 Thread 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 tables to the correct level to

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

2021-03-30 Thread Isaac J. Manjarres
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] iommu: sprd: Fix parameter type warning

2021-03-30 Thread Chunyan Zhang
From: Chunyan Zhang The second parameter of clk_get_optional() is "const char *", so use NULL instead of integer 0 to fix a sparse warning like: ">> drivers/iommu/sprd-iommu.c:456:42: sparse: sparse: Using plain integer as NULL pointer" Also this patch changes to use the resource-managed