RE: [PATCH v6 0/9] ACPI/IORT: Support for IORT RMR node

2021-07-26 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Laurentiu Tudor [mailto:laurentiu.tu...@nxp.com] > Sent: 19 July 2021 14:46 > To: Shameerali Kolothum Thodi ; > linux-arm-ker...@lists.infradead.org; linux-a...@vger.kernel.org; > iommu@lists.linux-foundation.org > Cc: j...@solid-run.com; Linuxarm ; > steven.p

RE: [PATCH] iommu/iova: kmemleak when disable SRIOV.

2021-07-26 Thread Zhou, Peng Ju via iommu
[AMD Official Use Only] Hi Robin 1. it is not a good manner to free a statically allocated object(in this case, it is iovad->head) dynamically even though the free only occurred when shut down the OS in most cases. 2. the kmemleak occurred when disable SRIOV(remove a PCIE device), I post the l

Re: [RFC 3/5] dma-mapping: Enable global non-coherent pool support for RISC-V

2021-07-26 Thread Atish Patra
On Mon, Jul 26, 2021 at 12:00 AM Christoph Hellwig wrote: > > On Fri, Jul 23, 2021 at 02:40:29PM -0700, Atish Patra wrote: > > Currently, linux,dma-default is used to reserve a global non-coherent pool > > to allocate memory for dma operations. This can be useful for RISC-V as > > well as the ISA

Re: [RFC 1/5] RISC-V: Implement arch_sync_dma* functions

2021-07-26 Thread Atish Patra
On Sun, Jul 25, 2021 at 11:57 PM Christoph Hellwig wrote: > > > +#ifdef CONFIG_RISCV_DMA_NONCOHERENT > > +struct riscv_dma_cache_sync { > > + void (*cache_invalidate)(phys_addr_t paddr, size_t size); > > + void (*cache_clean)(phys_addr_t paddr, size_t size); > > + void (*cache_flush)(p

Re: [GIT PULL] dma-mapping fix for Linux 5.14

2021-07-26 Thread Stefano Stabellini
On Mon, 26 Jul 2021, Boris Ostrovsky wrote: > On 7/25/21 12:50 PM, Linus Torvalds wrote: > > On Sat, Jul 24, 2021 at 11:03 PM Christoph Hellwig > > wrote: > > > >> - handle vmalloc addresses in dma_common_{mmap,get_sgtable} > >> (Roman Skakun) > > I've pulled this, but my reaction is that w

Re: [PATCH 16/23] iommu/arm-smmu: Prepare for multiple DMA domain types

2021-07-26 Thread Joerg Roedel
On Mon, Jul 26, 2021 at 02:09:00PM +0100, Robin Murphy wrote: > Ha, I had exactly that at one point, except I think in the order of > iommu_is_dma_domain() :) That name is fine too :) > The end result didn't seem to give enough extra clarity to justify the > header churn for me, but I'm happy to

Re: [GIT PULL] dma-mapping fix for Linux 5.14

2021-07-26 Thread Boris Ostrovsky
On 7/25/21 12:50 PM, Linus Torvalds wrote: > On Sat, Jul 24, 2021 at 11:03 PM Christoph Hellwig wrote: > >> - handle vmalloc addresses in dma_common_{mmap,get_sgtable} >> (Roman Skakun) > I've pulled this, but my reaction is that we've tried to avoid this in > the past. Why is Xen using vm

[PATCH v2] iommu/amd: Use report_iommu_fault()

2021-07-26 Thread Lennert Buytenhek
This patch makes iommu/amd call report_iommu_fault() when an I/O page fault occurs, which has two effects: 1) It allows device drivers to register a callback to be notified of I/O page faults, via the iommu_set_fault_handler() API. 2) It triggers the io_page_fault tracepoint in report_iommu_fa

Re: [PATCH,RFC] iommu/amd: Use report_iommu_fault()

2021-07-26 Thread Lennert Buytenhek
On Mon, Jul 26, 2021 at 01:54:49PM +0200, Joerg Roedel wrote: > Hi Lennert, Hi Joerg, > On Mon, Jul 19, 2021 at 12:54:43PM +0300, Lennert Buytenhek wrote: > > + if (dev_data) { > > + int report_flags; > > + > > + /* > > +* AMD I/O Virtualization Technology (IOM

Re: [PATCH v2 1/1] s390/pv: fix the forcing of the swiotlb

2021-07-26 Thread Halil Pasic
On Fri, 23 Jul 2021 20:27:56 -0400 Konrad Rzeszutek Wilk wrote: > On Sat, Jul 24, 2021 at 01:17:46AM +0200, Halil Pasic wrote: > > Since commit 903cd0f315fe ("swiotlb: Use is_swiotlb_force_bounce for > > swiotlb data bouncing") if code sets swiotlb_force it needs to do so > > before the swiotlb i

Re: [PATCH v4 3/3] iommu: dart: Add DART iommu driver

2021-07-26 Thread Alyssa Rosenzweig
> I'll let my current version simmer for a bit and wait until it's been > tested by a few people and will send it in a week or so then! New version has my T-b :) ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/ma

Re: [PATCH 16/23] iommu/arm-smmu: Prepare for multiple DMA domain types

2021-07-26 Thread Robin Murphy
On 2021-07-26 13:46, Joerg Roedel wrote: On Wed, Jul 21, 2021 at 07:20:27PM +0100, Robin Murphy wrote: - if (type == IOMMU_DOMAIN_DMA && using_legacy_binding) + if ((type & __IOMMU_DOMAIN_DMA_API) && using_legacy_binding) Hmm, I wonder whether it is time to introduce helpers for th

Re: [PATCH 00/23] iommu: Refactor DMA domain strictness

2021-07-26 Thread Joerg Roedel
Hi Robin, On Wed, Jul 21, 2021 at 07:20:11PM +0100, Robin Murphy wrote: > Robin Murphy (23): > iommu: Pull IOVA cookie management into the core > iommu/amd: Drop IOVA cookie management > iommu/arm-smmu: Drop IOVA cookie management > iommu/vt-d: Drop IOVA cookie management > iommu/exynos:

Re: [PATCH 16/23] iommu/arm-smmu: Prepare for multiple DMA domain types

2021-07-26 Thread Joerg Roedel
On Wed, Jul 21, 2021 at 07:20:27PM +0100, Robin Murphy wrote: > - if (type == IOMMU_DOMAIN_DMA && using_legacy_binding) > + if ((type & __IOMMU_DOMAIN_DMA_API) && using_legacy_binding) Hmm, I wonder whether it is time to introduce helpers for these checks? Something like iommu_domain_is_d

Re: [PATCH 18/23] iommu: Express DMA strictness via the domain type

2021-07-26 Thread Robin Murphy
On 2021-07-26 13:29, Lu Baolu wrote: [...] diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index b1af1ff324c5..a114a7ad88ec 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -363,13 +363,15 @@ static int iommu_dma_init_domain(struct iommu_domain *domain

Re: [PATCH v6 0/7] iommu/amd: Enable page-selective flushes

2021-07-26 Thread Joerg Roedel
[ Adding Suravee, reviewer for AMD IOMMU ] On Fri, Jul 23, 2021 at 02:32:02AM -0700, Nadav Amit wrote: > Nadav Amit (6): > iommu/amd: Selective flush on unmap > iommu/amd: Do not use flush-queue when NpCache is on > iommu: Factor iommu_iotlb_gather_is_disjoint() out > iommu/amd: Tailored g

Re: [PATCH 18/23] iommu: Express DMA strictness via the domain type

2021-07-26 Thread Lu Baolu
On 2021/7/26 16:27, Robin Murphy wrote: On 2021-07-24 06:29, Lu Baolu wrote: Hi Robin, On 2021/7/22 2:20, Robin Murphy wrote: Eliminate the iommu_get_dma_strict() indirection and pipe the information through the domain type from the beginning. Besides the flow simplification this also has seve

Re: [PATCH] iommu/dma: Fix leak in non-contiguous API

2021-07-26 Thread Joerg Roedel
On Thu, Jul 22, 2021 at 10:05:52PM -0300, Ezequiel Garcia wrote: > drivers/iommu/dma-iommu.c | 1 + > 1 file changed, 1 insertion(+) Applied to iommu/fixes, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.or

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

2021-07-26 Thread Joerg Roedel
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 > specification. > > Currently, when user wants to debug the translation fault in

Re: [PATCH] iommu/amd: Fix printing of IOMMU events when rate limiting kicks in

2021-07-26 Thread Joerg Roedel
On Wed, Jul 21, 2021 at 04:44:53PM +0300, Lennert Buytenhek wrote: > drivers/iommu/amd/iommu.c | 28 +--- > 1 file changed, 17 insertions(+), 11 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.or

Re: [PATCH 00/23] iommu: Refactor DMA domain strictness

2021-07-26 Thread Robin Murphy
On 2021-07-26 09:13, John Garry wrote: On 21/07/2021 19:20, Robin Murphy wrote: Hi all, First off, yes, this conflicts with just about everything else currently in-flight. Sorry about that. If it stands up to initial review then I'll start giving some thought to how to fit everything together (

Re: [PATCH 0/3] iommu/vt-d: Implement [map/unmap]_pages callbacks

2021-07-26 Thread Joerg Roedel
On Tue, Jul 20, 2021 at 10:06:12AM +0800, Lu Baolu wrote: > Lu Baolu (3): > iommu/vt-d: Report real pgsize bitmap to iommu core > iommu/vt-d: Implement map/unmap_pages() iommu_ops callback > iommu/vt-d: Move clflush'es from iotlb_sync_map() to map_pages() Applied to iommu/core, thanks. _

Re: [PATCH,RFC] iommu/amd: Use report_iommu_fault()

2021-07-26 Thread Joerg Roedel
Hi Lennert, On Mon, Jul 19, 2021 at 12:54:43PM +0300, Lennert Buytenhek wrote: > + if (dev_data) { > + int report_flags; > + > + /* > + * AMD I/O Virtualization Technology (IOMMU) Specification, > + * revision 3.00, section 2.5.3 ("IO_PAGE_FAUL

Re: [PATCH] iommu/amd: Convert from atomic_t to refcount_t on pasid_state->count

2021-07-26 Thread Joerg Roedel
On Mon, Jul 19, 2021 at 04:32:58PM +0800, Xiyu Yang wrote: > drivers/iommu/amd/iommu_v2.c | 13 +++-- > 1 file changed, 7 insertions(+), 6 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxf

Re: [PATCH v2] iommu: Streamline iommu_iova_to_phys()

2021-07-26 Thread Joerg Roedel
On Thu, Jul 15, 2021 at 02:04:24PM +0100, Robin Murphy wrote: > --- > > v2: Lowered the priority of the ops check per Baolu's suggestion, only > even further to the point of non-existence :) Err, missed this newer version. Replaced the previous patch with this one. ___

Re: [PATCH] iommu: Unify iova_to_phys for identity domains

2021-07-26 Thread Joerg Roedel
On Wed, Jul 14, 2021 at 06:28:34PM +0100, Robin Murphy wrote: > If people are going to insist on calling iommu_iova_to_phys() > pointlessly and expecting it to work, we can at least do ourselves a > favour by handling those cases in the core code, rather than repeatedly > across an inconsistent han

Re: [PATCH 18/23] iommu: Express DMA strictness via the domain type

2021-07-26 Thread Lu Baolu
On 2021/7/26 16:27, Robin Murphy wrote: On 2021-07-24 06:29, Lu Baolu wrote: Hi Robin, On 2021/7/22 2:20, Robin Murphy wrote: Eliminate the iommu_get_dma_strict() indirection and pipe the information through the domain type from the beginning. Besides the flow simplification this also has seve

Re: [PATCH v15 0/6] iommu: Enhance IOMMU default DMA mode build options

2021-07-26 Thread Joerg Roedel
On Mon, Jul 12, 2021 at 07:12:14PM +0800, John Garry wrote: > John Garry (3): > iommu: Deprecate Intel and AMD cmdline methods to enable strict mode > iommu: Print strict or lazy mode at init time > iommu: Remove mode argument from iommu_set_dma_strict() > > Zhen Lei (3): > iommu: Enhance

Re: [PATCH v7 00/15] Optimizing iommu_[map/unmap] performance

2021-07-26 Thread Joerg Roedel
On Wed, Jun 16, 2021 at 06:38:41AM -0700, Georgi Djakov wrote: > Isaac J. Manjarres (12): > iommu/io-pgtable: Introduce unmap_pages() as a page table op > iommu: Add an unmap_pages() op for IOMMU drivers > iommu/io-pgtable: Introduce map_pages() as a page table op > iommu: Add a map_pages()

Re: [PATCH 17/23] iommu/vt-d: Prepare for multiple DMA domain types

2021-07-26 Thread Robin Murphy
On 2021-07-24 06:23, Lu Baolu wrote: Hi Robin, On 2021/7/22 2:20, Robin Murphy wrote: In preparation for the strict vs. non-strict decision for DMA domains to be expressed in the domain type, make sure we expose our flush queue awareness by accepting the new domain type, and test the specific f

Re: [PATCH 13/23] iommu/dma: Remove redundant "!dev" checks

2021-07-26 Thread John Garry
On 21/07/2021 19:20, Robin Murphy wrote: iommu_dma_init_domain() is now only called from iommu_setup_dma_ops(), which has already assumed dev to be non-NULL. Signed-off-by: Robin Murphy FWIW, Reviewed-by: John Garry ___ iommu mailing list iommu@lis

Re: [PATCH 18/23] iommu: Express DMA strictness via the domain type

2021-07-26 Thread Robin Murphy
On 2021-07-24 06:29, Lu Baolu wrote: Hi Robin, On 2021/7/22 2:20, Robin Murphy wrote: Eliminate the iommu_get_dma_strict() indirection and pipe the information through the domain type from the beginning. Besides the flow simplification this also has several nice side-effects:   - Automatically

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

2021-07-26 Thread Jean-Philippe Brucker
Hi Kevin, On Fri, Jul 09, 2021 at 07:48:44AM +, Tian, Kevin wrote: > /dev/iommu provides an unified interface for managing I/O page tables for > devices assigned to userspace. Device passthrough frameworks (VFIO, vDPA, > etc.) are expected to use this interface instead of creating their own

Re: [PATCH 00/23] iommu: Refactor DMA domain strictness

2021-07-26 Thread John Garry
On 21/07/2021 19:20, Robin Murphy wrote: Hi all, First off, yes, this conflicts with just about everything else currently in-flight. Sorry about that. If it stands up to initial review then I'll start giving some thought to how to fit everything together (particularly John's cleanup of strictnes

Re: [bug report] iommu_dma_unmap_sg() is very slow then running IO from remote numa node

2021-07-26 Thread John Garry
On 23/07/2021 11:21, Ming Lei wrote: Thanks, I was also going to suggest the latter, since it's what arm_smmu_cmdq_issue_cmdlist() does with IRQs masked that should be most indicative of where the slowness most likely stems from. The improvement from 'iommu.strict=0' is very small: Have you t

Re: [RFC 4/5] dma-direct: Allocate dma pages directly if global pool allocation fails

2021-07-26 Thread Christoph Hellwig
On Fri, Jul 23, 2021 at 02:40:30PM -0700, Atish Patra wrote: > DMA_GLOBAL_POOL config may be enabled for platforms where global pool is > not supported because a generic defconfig is expected to boot on different > platforms. Specifically, some RISC-V platforms may use global pool for > non-coheren

Re: [RFC 3/5] dma-mapping: Enable global non-coherent pool support for RISC-V

2021-07-26 Thread Christoph Hellwig
On Fri, Jul 23, 2021 at 02:40:29PM -0700, Atish Patra wrote: > Currently, linux,dma-default is used to reserve a global non-coherent pool > to allocate memory for dma operations. This can be useful for RISC-V as > well as the ISA specification doesn't specify a method to modify PMA > attributes or