Re: Question about arm smmu

2015-11-04 Thread Peng Fan
Hi Robin, Will, On Wed, Nov 04, 2015 at 03:31:55PM +, Robin Murphy wrote: >On 04/11/15 14:43, Will Deacon wrote: >>On Wed, Nov 04, 2015 at 09:44:40PM +0800, Peng Fan wrote: >>>Hi Will, >> >>Hello, >> >>>I am trying to enable SMMU(mmu500) on an platform. >>>My platform support only 32 SIDs, but

Re: Regression in kernel 4.2.3+ (relative to 4.1.10) on AMD 990FX system with IOMMU enabled

2015-11-04 Thread Alex Williamson
On Wed, 2015-11-04 at 12:24 -0500, Laine Stump wrote: > Last week I upgraded my Fedora 22 AMD 990FX system from kernel 4.1.10 to > 4.2.3 (standard Fedora builds) and multiple devices stopped working: > > * 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 > Azalia (Intel HDA) (r

[PATCH v2] vfio: Include No-IOMMU mode

2015-11-04 Thread Alex Williamson
There is really no way to safely give a user full access to a DMA capable device without an IOMMU to protect the host system. There is also no way to provide DMA translation, for use cases such as device assignment to virtual machines. However, there are still those users that want userspace driv

Re: [PATCH v6 2/3] arm64: Add IOMMU dma_ops

2015-11-04 Thread Laura Abbott
On 11/04/2015 05:11 AM, Robin Murphy wrote: On 04/11/15 08:39, Yong Wu wrote: On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. [...] +static void *__iom

Regression in kernel 4.2.3+ (relative to 4.1.10) on AMD 990FX system with IOMMU enabled

2015-11-04 Thread Laine Stump
Last week I upgraded my Fedora 22 AMD 990FX system from kernel 4.1.10 to 4.2.3 (standard Fedora builds) and multiple devices stopped working: * 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40) * 02:00.[01] Ethernet controller: Intel Corporation 82

Re: Question about arm smmu

2015-11-04 Thread Robin Murphy
On 04/11/15 14:43, Will Deacon wrote: On Wed, Nov 04, 2015 at 09:44:40PM +0800, Peng Fan wrote: Hi Will, Hello, I am trying to enable SMMU(mmu500) on an platform. My platform support only 32 SIDs, but it have more than 100 masters. Do you mean the MMU-500 configuration really only has 5 bi

[RFC] iommu: arm-smmu: correct reference count

2015-11-04 Thread Peng Fan
iommu_group_alloc will initialize the reference count for group to 1. iommu_group_add_device also increase the group reference count, if nothing bad happends. And we need to add iommu_group_put to decrease the reference count for group. Signed-off-by: Peng Fan Cc: Will Deacon Cc: Joerg Roedel -

Question about arm smmu

2015-11-04 Thread Peng Fan
Hi Will, I am trying to enable SMMU(mmu500) on an platform. My platform support only 32 SIDs, but it have more than 100 masters. So I need to let different masters share one SID. I read current arm-smmu.c, but it needs each master has unique SID. Do you have some suggestions about how to let diffe

Re: Question about arm smmu

2015-11-04 Thread Will Deacon
On Wed, Nov 04, 2015 at 09:44:40PM +0800, Peng Fan wrote: > Hi Will, Hello, > I am trying to enable SMMU(mmu500) on an platform. > My platform support only 32 SIDs, but it have more than 100 masters. > So I need to let different masters share one SID. I read current > arm-smmu.c, but it needs eac

Re: [PATCH v6 2/3] arm64: Add IOMMU dma_ops

2015-11-04 Thread Robin Murphy
On 04/11/15 08:39, Yong Wu wrote: On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. [...] +static void *__iommu_alloc_attrs(struct device *dev, size_t siz

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Russell King - ARM Linux
On Wed, Nov 04, 2015 at 06:48:50PM +0900, Tomasz Figa wrote: > There is no requirement, but shouldn't it be desired for the mapping > code to map them as such? Otherwise, how could the IOMMU use case you > described above (address translator for devices which don't have the > capability to address

[RFI] Watchdog detected hard LOCKUP on alloc_iova

2015-11-04 Thread Jinpu Wang
Hi David, We hit the warning during test: Oct 19 15:23:20 storage9-qa kernel: [ 638.139722] [ cut here ] Oct 19 15:23:20 storage9-qa kernel: [ 638.139730] WARNING: CPU: 5 PID: 1281 at kernel/watchdog.c:290 watchdog_overflow_callback+0x98/0xc0() Oct 19 15:23:20 storage9-q

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Tomasz Figa
On Wed, Nov 4, 2015 at 6:27 PM, Russell King - ARM Linux wrote: > On Wed, Nov 04, 2015 at 02:12:03PM +0900, Tomasz Figa wrote: >> My understanding of a scatterlist was that it represents a buffer as a >> whole, by joining together its physically discontinuous segments. > > Correct, and it may also

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Russell King - ARM Linux
On Wed, Nov 04, 2015 at 02:12:03PM +0900, Tomasz Figa wrote: > My understanding of a scatterlist was that it represents a buffer as a > whole, by joining together its physically discontinuous segments. Correct, and it may also be scattered in CPU virtual space as well. > I don't see how single se

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Russell King - ARM Linux
On Wed, Nov 04, 2015 at 02:15:41PM +0900, Tomasz Figa wrote: > On Wed, Nov 4, 2015 at 3:40 AM, Russell King - ARM Linux > wrote: > > On Tue, Nov 03, 2015 at 05:41:24PM +, Robin Murphy wrote: > >> Hi Tomasz, > >> > >> On 02/11/15 13:43, Tomasz Figa wrote: > >> >Agreed. The dma_map_*() API is no

Re: [PATCH v6 2/3] arm64: Add IOMMU dma_ops

2015-11-04 Thread Yong Wu
On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: > Taking some inspiration from the arch/arm code, implement the > arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. [...] > +static void *__iommu_alloc_attrs(struct device *dev, size_t size, > +