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

2021-07-30 Thread chenxiang
From: Xiang Chen The series ("Optimizing iommu_[map/unmap] performance") improve the iommu_[map/unmap] performance. Based on the series, implement [map/unmap]_pages callbacks for ARM SMMUV3. Use tool dma_map_benchmark to test the latency of map/unmap, and it promotes much on it. The test result i

[PATCH 2/2] iommu/arm-smmu-v3: Implement the map_pages() IOMMU driver callback

2021-07-30 Thread chenxiang
From: Xiang Chen Implement the map_pages() callback for ARM SMMUV3 driver to allow calls from iommu_map to map multiple pages of the same size in one call. Also remove the map() callback for the ARM SMMUV3 driver as it will no longer be used. Signed-off-by: Xiang Chen --- drivers/iommu/arm/arm

[PATCH 1/2] iommu/arm-smmu-v3: Implement the unmap_pages() IOMMU driver callback

2021-07-30 Thread chenxiang
From: Xiang Chen Implement the unmap_pages() callback for ARM SMMUV3 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 ARM SMMUV3 driver as it will no longer be used. Signed-off-by: Xiang Chen --- drivers/iommu

Re: [PATCH v2] iommu/vt-d: Dump DMAR translation structure

2021-07-30 Thread Kyung Min Park
Hi Joerg, On Mon, 2021-07-26 at 14:25 +0200, Joerg Roedel wrote: > On Wed, Jul 21, 2021 at 09:24:53PM -0700, Kyung Min Park wrote: > > When the dmar translation fault happens, the kernel prints a single > > line > > fault reason with corresponding hexadecimal code defined in the > > Intel VT-d > >

Re: [RFC v2] /dev/iommu uAPI proposal

2021-07-30 Thread Jason Gunthorpe via iommu
On Mon, Jul 26, 2021 at 02:50:48PM +1000, David Gibson wrote: > That said, I'm still finding the various ways a device can attach to > an ioasid pretty confusing. Here are some thoughts on some extra > concepts that might make it easier to handle [note, I haven't thought > this all the way throug

Re: [PATCH v7 3/4] iommu: rockchip: Add internal ops to handle variants

2021-07-30 Thread Robin Murphy
On 2021-07-30 13:52, Dafna Hirschfeld wrote: On 29.07.21 18:58, Robin Murphy wrote: On 2021-07-29 17:08, Heiko Stübner wrote: Hi Dafna, Am Donnerstag, 29. Juli 2021, 17:59:26 CEST schrieb Dafna Hirschfeld: On 25.05.21 14:15, Benjamin Gaignard wrote: @@ -879,7 +895,7 @@ static int rk_iommu_

Re: [PATCH] iommu: check if group is NULL before remove device

2021-07-30 Thread Frank Wunderlich (linux)
Am 2021-07-15 09:20, schrieb Joerg Roedel: On Thu, Jul 15, 2021 at 09:11:50AM +0200, Frank Wunderlich wrote: From: Frank Wunderlich if probe is failing, iommu_group may be not initialized, Sentences start with capital letters. IOMMU patch subjects too, after the 'iommu:' prefix. so freein

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-07-30 Thread Lu Baolu
On 2021/7/30 16:05, Andy Shevchenko wrote: On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: On 7/30/21 12:35 AM, Andy Shevchenko wrote: Compiler is not happy about hidden declaration of intel_iommu_ops. .../drivers/iommu/intel/iommu.c:414:24: warning: symbol 'intel_iommu_ops' was not

Re: [PATCH v7 3/4] iommu: rockchip: Add internal ops to handle variants

2021-07-30 Thread Dafna Hirschfeld
On 29.07.21 18:58, Robin Murphy wrote: On 2021-07-29 17:08, Heiko Stübner wrote: Hi Dafna, Am Donnerstag, 29. Juli 2021, 17:59:26 CEST schrieb Dafna Hirschfeld: On 25.05.21 14:15, Benjamin Gaignard wrote: @@ -879,7 +895,7 @@ static int rk_iommu_enable(struct rk_iommu *iommu)    for (i =

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 > >>> *lis

Aw: [PATCH v7 00/12] Clean up "mediatek,larb"

2021-07-30 Thread Frank Wunderlich
Full Series tested on BPI-R2/MT7623 Tested-By: Frank Wunderlich regards Frank ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

2021-07-30 Thread Will Deacon
Commit ad6c00283163 ("swiotlb: Free tbl memory in swiotlb_exit()") introduced a set_memory_encrypted() call to swiotlb_exit() so that the buffer pages are returned to an encrypted state prior to being freed. Sachin reports that this leads to the following crash on a Power server: [0.010799] s

Re: [PATCH v2 19/24] iommu: Expose DMA domain strictness via sysfs

2021-07-30 Thread John Garry
On 28/07/2021 16:58, Robin Murphy wrote: The sysfs interface for default domain types exists primarily so users can choose the performance/security tradeoff relevant to their own workload. As such, the choice between the policies for DMA domains fits perfectly as an additional point on that scale

Re: [PATCH v2 20/24] iommu: Merge strictness and domain type configs

2021-07-30 Thread John Garry
On 28/07/2021 16:58, Robin Murphy wrote: -config IOMMU_DEFAULT_LAZY - bool "lazy" + Untrusted devices always use this mode, with an additional layer of + bounce-buffering such that they cannot gain access to any unrelated + data within a mapped page. + +config IOM

Re: [PATCH v2 01/24] iommu: Pull IOVA cookie management into the core

2021-07-30 Thread Jean-Philippe Brucker
On Wed, Jul 28, 2021 at 04:58:22PM +0100, Robin Murphy wrote: > Now that everyone has converged on iommu-dma for IOMMU_DOMAIN_DMA > support, we can abandon the notion of drivers being responsible for the > cookie type, and consolidate all the management into the core code. > > CC: Marek Szyprowski

Re: [PATCH v2 20/24] iommu: Merge strictness and domain type configs

2021-07-30 Thread Jean-Philippe Brucker
On Wed, Jul 28, 2021 at 04:58:41PM +0100, Robin Murphy wrote: > To parallel the sysfs behaviour, merge the new build-time option > for DMA domain strictness into the default domain type choice. > > Suggested-by: Joerg Roedel > Signed-off-by: Robin Murphy kernel-parameters.txt still refers to th

Re: [PATCH v2 19/24] iommu: Expose DMA domain strictness via sysfs

2021-07-30 Thread Jean-Philippe Brucker
On Wed, Jul 28, 2021 at 04:58:40PM +0100, Robin Murphy wrote: > The sysfs interface for default domain types exists primarily so users > can choose the performance/security tradeoff relevant to their own > workload. As such, the choice between the policies for DMA domains fits > perfectly as an add

Re: [PATCH v2 22/24] iommu: Allow enabling non-strict mode dynamically

2021-07-30 Thread John Garry
On 28/07/2021 16:58, 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 requiring to unbind the device's

Re: [PATCH v2 14/24] iommu: Introduce explicit type for non-strict DMA domains

2021-07-30 Thread Jean-Philippe Brucker
On Wed, Jul 28, 2021 at 04:58:35PM +0100, Robin Murphy wrote: > Promote the difference between strict and non-strict DMA domains from an > internal detail to a distinct domain feature and type, to pave the road > for exposing it through the sysfs default domain interface. > > Signed-off-by: Robin

Re: [PATCH v2 12/24] iommu/dma: Unexport IOVA cookie management

2021-07-30 Thread Jean-Philippe Brucker
On Wed, Jul 28, 2021 at 04:58:33PM +0100, Robin Murphy wrote: > IOVA cookies are now got and put by core code, so we no longer need to > export these to modular drivers. The export for getting MSI cookies > stays, since VFIO can still be a module, but it was already relying on > someone else puttin

Re: [PATCH v2 21/24] iommu/dma: Factor out flush queue init

2021-07-30 Thread John Garry
On 28/07/2021 16:58, 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. Signed-off-by: Robin Murphy Reviewed-by: John Garry ___ iommu mail

Re: [PATCH v2 11/24] iommu/virtio: Drop IOVA cookie management

2021-07-30 Thread Jean-Philippe Brucker
On Wed, Jul 28, 2021 at 04:58:32PM +0100, Robin Murphy wrote: > The core code bakes its own cookies now. > > CC: Jean-Philippe Brucker > Signed-off-by: Robin Murphy Reviewed-by: Jean-Philippe Brucker Also tested on the Seattle (vsmmuv3/viommu with lazy/strict, still need to test the runtime s

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-07-30 Thread Andy Shevchenko
On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: > On 7/30/21 12:35 AM, Andy Shevchenko wrote: > > Compiler is not happy about hidden declaration of intel_iommu_ops. > > > > .../drivers/iommu/intel/iommu.c:414:24: warning: symbol 'intel_iommu_ops' > > was not declared. Should it be stati