Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Fredrik Noring
Hi Jürgen, Robin, > Don't forget that the SIF DMA packets are limited and the kernel will > block/reschedule when it is out of SIF DMA packets. The allocation is > implemented inside the SBIOS. You may easily get a deadlock or a livelock > when you just let it run without thinking about the design

Aw: Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Jürgen Urban
Hello Fredrik, > Gesendet: Freitag, 06. Juli 2018 um 22:54 Uhr > Von: "Fredrik Noring" > An: "Robin Murphy" > Cc: "Christoph Hellwig" , linux-ker...@vger.kernel.org, > iommu@lists.linux-foundation.org, "Maciej W. Rozycki" , > juergenur...@gmx.de > Betreff: Re: [PATCH] dma-mapping: Relax warnin

Re: [PATCH v3 0/9] iommu/vt-d: Improve PASID id and table management

2018-07-06 Thread Lu Baolu
Hi Joerg, On 07/06/2018 08:31 PM, Joerg Roedel wrote: > Hey Lu, > > the patches do not apply cleanly to my x86/vt-d branch. Can you rebase > against that branch after the weekend when I pushed it out and re-send, > please? Sure. Best regards, Lu Baolu

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Fredrik Noring
Hi Robin, > > Does dma_set_coherent_mask want a device object representing the IOP? Such > > a thing is currently not implemented, but can certainly be done. > > Nope, just the same OHCI device as the dma_declare_coherent_memory() call. Ah... and then some kind of dma_ops structure is needed to

Re: [PATCH v4 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping

2018-07-06 Thread Nicolas Chauvet
2018-05-30 16:06 GMT+02:00 Thierry Reding : > From: Thierry Reding > > Depending on the kernel configuration, early ARM architecture setup code > may have attached the GPU to a DMA/IOMMU mapping that transparently uses > the IOMMU to back the DMA API. Tegra requires special handling for IOMMU > ba

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Robin Murphy
On 06/07/18 15:19, Fredrik Noring wrote: Hi Robin, On Fri, Jul 06, 2018 at 12:57:11PM +0100, Robin Murphy wrote: On 05/07/18 20:36, Christoph Hellwig wrote: - BUG_ON(!ops); - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); - if (dma_alloc_from_dev_coherent(dev, size, dma_hand

Re: [RFC 0/3] iommu/iova: Unsafe locking in find_iova()

2018-07-06 Thread Joerg Roedel
On Fri, Jul 06, 2018 at 03:10:47PM +0100, Dmitry Safonov wrote: > Yes, as far as I can see, there are code-paths which may try to handle > it at the same time: > o memory notifiers for hot-unplug (intel-iommu.c) > o drivers unloading calls free_iova(), which in the result calls > find_iova() > o

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Fredrik Noring
Hi Robin, On Fri, Jul 06, 2018 at 12:57:11PM +0100, Robin Murphy wrote: > On 05/07/18 20:36, Christoph Hellwig wrote: > > > - BUG_ON(!ops); > > > - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > > - > > > if (dma_alloc_from_dev_coherent(dev, size, dma_handle, > > > &cpu_addr)) > > >

Re: [RFC PATCH 2/2] dma-mapping: Clean up dma_get_required_mask() hooks

2018-07-06 Thread Robin Murphy
On 05/07/18 20:38, Christoph Hellwig wrote: On Wed, Jul 04, 2018 at 06:50:12PM +0100, Robin Murphy wrote: As for the other mask-related hooks, standardise the arch override into a Kconfig option, and also pull the generic implementation into the DMA mapping code rather than having it hide away i

Re: [RFC PATCH 1/2] dma-mapping: Clean up dma_set_*mask() hooks

2018-07-06 Thread Robin Murphy
On 05/07/18 20:37, Christoph Hellwig wrote: On Wed, Jul 04, 2018 at 06:50:11PM +0100, Robin Murphy wrote: Arch-specific implementions for dma_set_{coherent_,}mask() currently rely on an inconsistent mix of arch-defined Kconfig symbols and macro overrides. Now that we have a nice centralised home

Re: [RFC 0/3] iommu/iova: Unsafe locking in find_iova()

2018-07-06 Thread Dmitry Safonov via iommu
On Fri, 2018-07-06 at 15:16 +0200, Joerg Roedel wrote: > On Thu, Jun 21, 2018 at 07:08:20PM +0100, Dmitry Safonov wrote: > > find_iova() looks to be using a bad locking practice: it locks the > > returned iova only for the search time. And looking in code, the > > element can be removed from the t

Re: [RFC 0/3] iommu/iova: Unsafe locking in find_iova()

2018-07-06 Thread Joerg Roedel
On Thu, Jun 21, 2018 at 07:08:20PM +0100, Dmitry Safonov wrote: > find_iova() looks to be using a bad locking practice: it locks the > returned iova only for the search time. And looking in code, the > element can be removed from the tree and freed under rbtree lock. That > happens during memory h

Re: [PATCH] iommu/amd: fix missing tag from dev_err message

2018-07-06 Thread Joerg Roedel
On Tue, Jul 03, 2018 at 10:34:12AM -0700, Joe Perches wrote: > On Tue, 2018-07-03 at 18:57 +0200, Walter Harms wrote: > > It is only cosmetics but even the author got lost about the loose bracket. > > I would suggest to remove all the brackets or if needed to move the [ in the > > message. We have

Re: [PATCH v2 0/3] iommu/amd: Enable x2APIC support

2018-07-06 Thread Joerg Roedel
On Wed, Jun 27, 2018 at 10:31:19AM -0500, Suravee Suthikulpanit wrote: > Changes from V1 (https://lkml.org/lkml/2018/6/22/645): > * 3/3: Declare the variable amd_iommu_xt_mode as static (per kbuild test > robot) > > Suravee Suthikulpanit (3): > x86: irq_remapping: Move irq remapping mode enum

Re: [PATCH v3 0/9] iommu/vt-d: Improve PASID id and table management

2018-07-06 Thread Joerg Roedel
Hey Lu, the patches do not apply cleanly to my x86/vt-d branch. Can you rebase against that branch after the weekend when I pushed it out and re-send, please? Thanks a lot, Joerg ___ iommu mailing list iommu@lists.linux-foundation.org https://

RE: [PATCH 7/7 v5] arm64: dts: ls208xa: comply with the iommu map binding for fsl_mc

2018-07-06 Thread Nipun Gupta
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Tuesday, July 3, 2018 10:06 PM > To: Nipun Gupta ; will.dea...@arm.com; > robh...@kernel.org; r...@kernel.org; mark.rutl...@arm.com; > catalin.mari...@arm.com; gre...@linuxfoundation.org; Laurentiu Tudor > ;

Re: [PATCH 1/1] iommu/vt-d: Remove unnecessary WARN_ON()

2018-07-06 Thread Joerg Roedel
On Tue, Jun 19, 2018 at 10:49:19AM +0800, Lu Baolu wrote: > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel-svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org http

RE: [PATCH 5/7 v5] bus: fsl-mc: support dma configure for devices on fsl-mc bus

2018-07-06 Thread Nipun Gupta
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Tuesday, July 3, 2018 9:44 PM > To: Nipun Gupta ; will.dea...@arm.com; > robh...@kernel.org; r...@kernel.org; mark.rutl...@arm.com; > catalin.mari...@arm.com; gre...@linuxfoundation.org; Laurentiu Tudor > ; b

Re: [RESEND 0/6] iommu: ipmmu-vmsa: Add more Gen3 SoCs support

2018-07-06 Thread Joerg Roedel
On Thu, Jun 14, 2018 at 12:48:20PM +0200, Jacopo Mondi wrote: > Jacopo Mondi (2): > dt-bindings: iommu/ipmmu-vmsa: Add R-Car M3-N (R8A77965) > iommu/ipmmu-vmsa: Hook up R8A77965 DT matching code > > Magnus Damm (3): > iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 > iommu/ipmmu-vmsa:

RE: [PATCH 1/7 v5] Docs: dt: add fsl-mc iommu-map device-tree binding

2018-07-06 Thread Nipun Gupta
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Tuesday, July 3, 2018 8:10 PM > To: Nipun Gupta ; will.dea...@arm.com; > robh...@kernel.org; r...@kernel.org; mark.rutl...@arm.com; > catalin.mari...@arm.com; gre...@linuxfoundation.org; Laurentiu Tudor > ; b

Re: [PATCH v9 0/2] Base enablement of IOMMU debugfs support

2018-07-06 Thread Joerg Roedel
On Tue, Jun 12, 2018 at 04:41:12PM -0500, Gary R Hook wrote: > Gary R Hook (2): > iommu - Enable debugfs exposure of IOMMU driver internals > iommu/amd: Add basic debugfs infrastructure for AMD IOMMU Applied, thanks Gary. ___ iommu mailing li

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Robin Murphy
On 05/07/18 20:36, Christoph Hellwig wrote: - BUG_ON(!ops); - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); - if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr)) return cpu_addr; + BUG_ON(!ops); + WARN_ON_ONCE(dev && !dev->coherent_dma_

Re: [PATCH RESEND] iommu/msm: Don't call iommu_device_{, un}link from atomic context

2018-07-06 Thread Joerg Roedel
On Tue, Jun 12, 2018 at 04:06:10PM +0200, Niklas Cassel wrote: > > Fixes: 42df43b36163 ("iommu/msm: Make use of iommu_device_register interface") > Signed-off-by: Niklas Cassel > --- > drivers/iommu/msm_iommu.c | 16 +--- > 1 file changed, 5 insertions(+), 11 deletions(-) Applied, t

Re: [PATCH v2 0/2] iommu/vt-d: pfsid fix

2018-07-06 Thread Joerg Roedel
On Thu, Jun 07, 2018 at 09:56:58AM -0700, Jacob Pan wrote: > When device invalidation throttling(DIT) is supported by an IOMMU, device TLB > invalidation should include physical function source ID(PFSID). > > Changes since v1: > - Fixed compile error when CONFIG_PCI_ATS is not set > - Simplified h

RE: [PATCH 0/7 v5] Support for fsl-mc bus and its devices in SMMU

2018-07-06 Thread Nipun Gupta
Thanks Joro, I will be sending it by mid of next week. Regards, Nipun > -Original Message- > From: j...@8bytes.org [mailto:j...@8bytes.org] > Sent: Friday, July 6, 2018 4:43 PM > To: Nipun Gupta > Cc: robin.mur...@arm.com; will.dea...@arm.com; > gre...@linuxfoundation.org; h...@lst.de

Re: [PATCH 1/1] iommu/amd: make sure TLB to be flushed before IOVA freed

2018-07-06 Thread Joerg Roedel
On Wed, Jun 06, 2018 at 10:18:46AM +0800, Zhen Lei wrote: > Although the mapping has already been removed in the page table, it maybe > still exist in TLB. Suppose the freed IOVAs is reused by others before the > flush operation completed, the new user can not correctly access to its > meomory. >

Re: [PATCH] iommu/amd: Argument page_size could be uninitialized

2018-07-06 Thread Joerg Roedel
On Fri, Jun 01, 2018 at 11:30:14AM -0700, yzhai...@ucr.edu wrote: > Argument "page_size" passing to function "fetch_pte" could be > uninitialized if the function returns NULL > > The caller "iommu_unmap_page" checks the return value but the page_size is > used outside the if block. > > Signed-off

Re: [PATCH 0/7 v5] Support for fsl-mc bus and its devices in SMMU

2018-07-06 Thread j...@8bytes.org
Hi Nipun, On Thu, Jun 21, 2018 at 03:59:27AM +, Nipun Gupta wrote: > Will this patch-set be taken for the next kernel release (and via which tree)? I can take this through IOMMU tree if nobody objects. Please work out the last remaining comment on patch 7 with Robin and then re-send with all