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

2021-06-15 Thread Robin Murphy
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 follows a similar change to Intel's VT-d and a detailed explanation as

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

2021-06-15 Thread Robin Murphy
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 the number of pages that can be flushed in a single flush. In addition, AMD's IOMMU do not

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

2021-06-15 Thread Robin Murphy
On 2021-06-15 13:29, Yong Wu wrote: On Mon, 2021-06-07 at 11:25 -0700, 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 it out for the

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

2021-06-15 Thread Yong Wu
On Mon, 2021-06-07 at 11:25 -0700, 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 it out for the sake of cleanliness. > Let's

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

2021-06-15 Thread Will Deacon
On Tue, Jun 15, 2021 at 12:51:38PM +0100, Robin Murphy wrote: > On 2021-06-15 12:34, Will Deacon wrote: > > On Tue, Jun 15, 2021 at 07:22:10PM +0800, Leizhen (ThunderTown) wrote: > > > > > > > > > On 2021/6/11 18:32, Will Deacon wrote: > > > > On Wed, Jun 09, 2021 at 08:54:38PM +0800, Zhen Lei

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

2021-06-15 Thread Robin Murphy
On 2021-06-15 12:34, Will Deacon wrote: On Tue, Jun 15, 2021 at 07:22:10PM +0800, Leizhen (ThunderTown) wrote: On 2021/6/11 18:32, Will Deacon wrote: On Wed, Jun 09, 2021 at 08:54:38PM +0800, Zhen Lei wrote: Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory'

Re: [PATCH] iommu/io-pgtable-arm: Optimize partial walk flush for large scatter-gather list

2021-06-15 Thread Sai Prakash Ranjan
Hi Krishna, On 2021-06-14 23:18, Krishna Reddy wrote: Right but we won't know until we profile the specific usecases or try them in generic workload to see if they affect the performance. Sure, over invalidation is a concern where multiple buffers can be mapped to same context and the cache

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

2021-06-15 Thread Will Deacon
On Tue, Jun 15, 2021 at 12:34:17PM +0100, Will Deacon wrote: > On Tue, Jun 15, 2021 at 07:22:10PM +0800, Leizhen (ThunderTown) wrote: > > > > > > On 2021/6/11 18:32, Will Deacon wrote: > > > On Wed, Jun 09, 2021 at 08:54:38PM +0800, Zhen Lei wrote: > > >> Fixes scripts/checkpatch.pl warning: > >

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

2021-06-15 Thread Will Deacon
On Tue, Jun 15, 2021 at 07:22:10PM +0800, Leizhen (ThunderTown) wrote: > > > On 2021/6/11 18:32, Will Deacon wrote: > > On Wed, Jun 09, 2021 at 08:54:38PM +0800, Zhen Lei wrote: > >> Fixes scripts/checkpatch.pl warning: > >> WARNING: Possible unnecessary 'out of memory' message > >> > >> Remove

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

2021-06-15 Thread Robin Murphy
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 invokes iommu_map() for each element in the scatter-gather list, which

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

2021-06-15 Thread Leizhen (ThunderTown)
On 2021/6/11 18:32, Will Deacon wrote: > On Wed, Jun 09, 2021 at 08:54:38PM +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. >> >> Signed-off-by: Zhen Lei >> --- >>

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

2021-06-15 Thread Robin Murphy
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 it out for the sake of cleanliness. Let's also take this opportunity

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

2021-06-15 Thread Will Deacon
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 iommu_iotlb_gather_add_page() and factor out the logic that > >>

RE: [RFC] /dev/ioasid uAPI proposal

2021-06-15 Thread Tian, Kevin
Hi, Jason, > From: Jason Gunthorpe > Sent: Thursday, June 3, 2021 9:05 PM > > On Thu, Jun 03, 2021 at 06:39:30AM +, Tian, Kevin wrote: > > > > Two helper functions are provided to support VFIO_ATTACH_IOASID: > > > > > > > > struct attach_info { > > > > u32 ioasid;

Re: [PATCH v12 3/5] iommu/vt-d: Add support for IOMMU default DMA mode build options

2021-06-15 Thread Robin Murphy
On 2021-06-15 08:26, Lu Baolu wrote: Hi John, On 6/14/21 4:03 PM, John Garry wrote: On 12/06/2021 03:14, Lu Baolu wrote: On 2021/6/11 20:20, John Garry wrote: diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 2a71347611d4..4467353f981b 100644 --- a/drivers/iommu/Kconfig +++

Re: [PATCH v5 7/8] iommu/arm-smmu: Get associated RMR info and install bypass SMR

2021-06-15 Thread Jon Nettleton
On Mon, Jun 14, 2021 at 6:51 PM Shameerali Kolothum Thodi wrote: > > > > > -Original Message- > > From: Robin Murphy [mailto:robin.mur...@arm.com] > > Sent: 14 June 2021 11:06 > > To: Shameerali Kolothum Thodi ; > > linux-arm-ker...@lists.infradead.org; linux-a...@vger.kernel.org; > >

Re: [PATCH v12 3/5] iommu/vt-d: Add support for IOMMU default DMA mode build options

2021-06-15 Thread Lu Baolu
Hi John, On 6/14/21 4:03 PM, John Garry wrote: On 12/06/2021 03:14, Lu Baolu wrote: On 2021/6/11 20:20, John Garry wrote: diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 2a71347611d4..4467353f981b 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -94,6 +94,7

Re: [PATCH 1/1] dma: coherent: check no-map property for arm64

2021-06-15 Thread Marek Szyprowski
Hi Christoph, On 14.06.2021 17:36, Christoph Hellwig wrote: > On Mon, Jun 14, 2021 at 04:34:05PM +0100, Robin Murphy wrote: >>> Looking at the rmem_dma_device_init() -> dma_init_coherent_memory(), it >>> ends up calling memremap(MEMREMAP_WC) which would warn if it intersects >>> with system RAM

Re: [PATCH] iommu: Update "iommu.strict" documentation

2021-06-15 Thread Lu Baolu
On 6/14/21 10:57 PM, Robin Murphy wrote: Consolidating the flush queue logic also meant that the "iommu.strict" option started taking effect on x86 as well. Make sure we document that. Fixes: a250c23f15c2 ("iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE") Signed-off-by: Robin Murphy ---

<    1   2