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

2015-10-08 Thread Yong Wu
On Wed, 2015-10-07 at 17:07 +0100, Robin Murphy wrote: > On 06/10/15 12:00, 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. > >>

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Andreas Hartmann
On 10/08/2015 at 09:52 PM, Andreas Hartmann wrote: > On 10/08/2015 at 08:21 PM, Andreas Hartmann wrote: >> Am 08.10.2015 um 18:39 schrieb Joerg Roedel: >>> On Wed, Oct 07, 2015 at 06:52:58PM +0200, Andreas Hartmann wrote: To reproduce the error: First I mounted /daten2, afterwards /raid/m

[PATCH v5 6/6] dts: mt8173: Add iommu/smi nodes for mt8173

2015-10-08 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 81 1 file changed, 81 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi index 425

[PATCH v5 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-10-08 Thread Yong Wu
This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu --- drivers/iommu/Kconfig | 15 + drivers/iommu/Makefile| 1 + drivers/iommu/mtk_iommu.c | 767 ++ 3 files changed, 783 insertions(+) creat

[PATCH v5 2/6] dt-bindings: mediatek: Add smi dts binding

2015-10-08 Thread Yong Wu
This patch add smi binding document. Signed-off-by: Yong Wu --- .../memory-controllers/mediatek,smi-larb.txt | 25 ++ .../bindings/memory-controllers/mediatek,smi.txt | 24 + 2 files changed, 49 insertions(+) create mode 100644 Documentation/devi

[PATCH v5 4/6] memory: mediatek: Add SMI driver

2015-10-08 Thread Yong Wu
This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the clocks of each local arbiter Signed-off-by: Yong Wu --- drivers/memory/Kconfig | 8 ++ drivers/memory/Makefile| 1 + drivers/memory/mtk-smi.c | 274

[PATCH v5 1/6] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-10-08 Thread Yong Wu
This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 61 include/dt-bindings/memory/mt8173-larb-port.h | 105 + 2 files changed, 166 insertions(+) create mode 100644 Documentati

[PATCH v5 3/6] iommu: add ARM short descriptor page table allocator

2015-10-08 Thread Yong Wu
This patch is for ARM Short Descriptor Format. Signed-off-by: Yong Wu --- drivers/iommu/Kconfig| 18 + drivers/iommu/Makefile | 1 + drivers/iommu/io-pgtable-arm-short.c | 827 +++ drivers/iommu/io-pgtable-arm.c | 3 - driv

[PATCH v5 0/6] MT8173 IOMMU SUPPORT

2015-10-08 Thread Yong Wu
This patch set adds support for m4u(Multimedia Memory Management Unit), Currently it only support the m4u with 2 levels of pagetable on mt8173. It's based on Robin Murphy's latest ARM64 DMA-v6[1]. The dsti is based on MTK clock patch[2]. Please check the hardware block diagram of Mediatek

[PATCH 7/7] iommu/vt-d: Implement page request handling

2015-10-08 Thread David Woodhouse
Signed-off-by: David Woodhouse --- drivers/iommu/intel-svm.c | 115 +++- include/linux/intel-iommu.h | 21 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index 1260e87..ace1

[PATCH 5/7] iommu/vt-d: Assume BIOS lies about ATSR for integrated gfx

2015-10-08 Thread David Woodhouse
If the device itself reports ATS in its PCIe capabilities, but the BIOS neglects to provide an ATSR structure to indicate that the root port can also cope, then assume the latter is lying. Signed-off-by: David Woodhouse --- drivers/iommu/intel-iommu.c | 11 --- 1 file changed, 8 insertio

[PATCH 6/7] iommu/vt-d: Enable page request interrupt

2015-10-08 Thread David Woodhouse
Signed-off-by: David Woodhouse --- drivers/iommu/intel-iommu.c | 22 +- drivers/iommu/intel-svm.c | 71 + include/linux/intel-iommu.h | 5 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/d

[PATCH 4/7] iommu/vt-d: Generalise DMAR MSI setup to allow for page request events

2015-10-08 Thread David Woodhouse
Signed-off-by: David Woodhouse --- drivers/iommu/dmar.c| 42 +++--- include/linux/intel-iommu.h | 10 +- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 8757f8d..80e3c17 100644 -

[PATCH 2/7] iommu/vt-d: Add initial support for PASID tables

2015-10-08 Thread David Woodhouse
Add CONFIG_INTEL_IOMMU_SVM, and allocate PASID tables on supported hardware. Signed-off-by: David Woodhouse --- drivers/iommu/Kconfig | 8 ++ drivers/iommu/Makefile | 1 + drivers/iommu/intel-iommu.c | 14 ++ drivers/iommu/intel-svm.c | 65 +

[PATCH 3/7] iommu/vt-d: Add intel_svm_{un,}bind_mm() functions

2015-10-08 Thread David Woodhouse
This provides basic PASID support for endpoint devices, tested with a version of the i915 driver. A given process can bind to only one device per IOMMU for now. Making that more generic isn't particularly difficult but isn't needed yet, and can come later once the basic functionality is stable. E

[PATCH 1/7] iommu/vt-d: Introduce intel_iommu=pasid28, and pasid_enabled() macro

2015-10-08 Thread David Woodhouse
As long as we use an identity mapping to work around the worst of the hardware bugs which caused us to defeature it and change the definition of the capability bit, we *can* use PASID support on the devices which advertised it in bit 28 of the Extended Capability Register. Allow people to do so wi

[PATCH 0/7] Enable SVM for Intel VT-d

2015-10-08 Thread David Woodhouse
This patch set enables PASID support for the Intel IOMMU, along with page request support. Like its AMD counterpart, it exposes an IOMMU-specific API. I believe we'll have a session at the Kernel Summit later this month in which we can work out a generic API which will cover the two (now) existing

[PATCH v7 58/60] PCI: Introduce resource_disabled()

2015-10-08 Thread Yinghai Lu
Current is using !flags, and we are going to use IORESOURCE_DISABLED instead of clearing resource flags. Let's convert all !flags to helper function resource_disabled(). resource_disabled will check !flags and IORESOURCE_DISABLED both. Cc: linux-al...@vger.kernel.org Cc: linux-i...@vger.kernel.or

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Andreas Hartmann
On 10/08/2015 at 08:21 PM, Andreas Hartmann wrote: > Am 08.10.2015 um 18:39 schrieb Joerg Roedel: >> On Wed, Oct 07, 2015 at 06:52:58PM +0200, Andreas Hartmann wrote: >>> To reproduce the error: >>> First I mounted /daten2, afterwards /raid/mt, which produces the errors. >>> The ssd mounts have bee

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Andreas Hartmann
On 10/08/2015 at 08:59 PM, Andreas Hartmann wrote: > On 10/08/2015 at 07:30 PM Joerg Roedel wrote: >> On Wed, Oct 07, 2015 at 07:02:32PM +0200, Andreas Hartmann wrote: >>> Binding the device to vfio isn't a problem (it's done before the vm is >>> started). The problem occurs during start of qemu-sy

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Andreas Hartmann
On 10/08/2015 at 07:30 PM Joerg Roedel wrote: > On Wed, Oct 07, 2015 at 07:02:32PM +0200, Andreas Hartmann wrote: >> Binding the device to vfio isn't a problem (it's done before the vm is >> started). The problem occurs during start of qemu-system-x86_64 (2.3.0). >> >> The attached dmesg.out doesn'

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Andreas Hartmann
Am 08.10.2015 um 18:39 schrieb Joerg Roedel: On Wed, Oct 07, 2015 at 06:52:58PM +0200, Andreas Hartmann wrote: To reproduce the error: First I mounted /daten2, afterwards /raid/mt, which produces the errors. The ssd mounts have been already active (during boot by fstab). Okay, I spent the day

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Joerg Roedel
On Wed, Oct 07, 2015 at 07:02:32PM +0200, Andreas Hartmann wrote: > Binding the device to vfio isn't a problem (it's done before the vm is > started). The problem occurs during start of qemu-system-x86_64 (2.3.0). > > The attached dmesg.out doesn't show the trace, but the desired iommu dump. > >

Re: [dm-devel] AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

2015-10-08 Thread Joerg Roedel
On Wed, Oct 07, 2015 at 06:52:58PM +0200, Andreas Hartmann wrote: > To reproduce the error: > First I mounted /daten2, afterwards /raid/mt, which produces the errors. > The ssd mounts have been already active (during boot by fstab). Okay, I spent the day on that problem, and managed to reproduce i

[PATCH v3] iommu/arm-smmu: Add support for MSI on SMMUv3

2015-10-08 Thread Marc Zyngier
Despite being a platform device, the SMMUv3 is capable of signaling interrupts using MSIs. Hook it into the platform MSI framework and enjoy faults being reported in a new and exciting way. Signed-off-by: Marc Zyngier --- * From v2: - MSI indexes as an enum - Fixed stupid 16bit writes instead

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

2015-10-08 Thread Anup Patel
On Wed, Oct 7, 2015 at 10:06 PM, Robin Murphy wrote: > On 07/10/15 10:03, Anup Patel wrote: > [...] > >>> +static bool do_iommu_attach(struct device *dev, const struct iommu_ops >>> *ops, >>> + u64 dma_base, u64 size) >>> +{ >>> + struct iommu_domain *domain = iommu_

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

2015-10-08 Thread Anup Patel
Hi Robin, On Fri, Oct 2, 2015 at 12:43 AM, 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. > > Since there is still work to do elsewhere to make DMA configuration happen > in a more appr

[PATCH 2/3] iommu/hisilicon: Add hi6220 iommu driver

2015-10-08 Thread Chen Feng
Enable iommu on hi6220 SoC platform. Signed-off-by: Chen Feng Signed-off-by: Yu Dongbin --- drivers/iommu/Kconfig| 8 + drivers/iommu/Makefile | 1 + drivers/iommu/hi6220_iommu.c | 503 +++ 3 files changed, 512 insertions(+) create mode

[PATCH 1/3] docs: dts: Documentation for smmu in hi6220 SoC.

2015-10-08 Thread Chen Feng
Documentation for system mmu in hi6220 platform. Signed-off-by: Chen Feng Signed-off-by: Yu Dongbin --- .../bindings/iommu/hisi,hi6220-iommu.txt | 52 ++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/hisi,hi6220-iommu

[PATCH 3/3] arm64: dts: Add dts node for hi6220 iommu

2015-10-08 Thread Chen Feng
Signed-off-by: Chen Feng Signed-off-by: Yu Dongbin --- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi index 3f03380..3ef33b4 100644 --- a/arch/ar