Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-03-06 Thread Mitchel Humpherys
On Fri, Mar 06 2015 at 02:48:17 AM, wrote: > From: Yong Wu > > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). > Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [...] > +static int mtk_iommu_invalidate_tlb(const struct mtk_iommu_info *

Re: [PATCH 3/5] dt-bindings: mediatek: Add smi dts binding

2015-03-06 Thread Sergei Shtylyov
Hello. On 3/6/2015 1:48 PM, yong...@mediatek.com wrote: From: Yong Wu This patch add smi binding document. Signed-off-by: Yong Wu --- .../devicetree/bindings/soc/mediatek/mediatek,smi.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/d

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Alex Williamson
On Fri, 2015-03-06 at 10:41 +, Will Deacon wrote: > > As a longer term solution, would it make sense to add a user flag at VFIO > > user API level to turn the IOMMU_CACHE on? > > I think userspace certainly needs a way to figure out if a device is > coherent or not, otherwise it can't generate

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Baptiste Reynal
Good news Eric ! Here are more information about the NOEXEC flag. This flag is used to set the XN flag on the PTE, which make the page non-executable (XN is set if NOEXEC is set). As it used to be an EXEC flag (XN was set by default, unset if EXEC was set), this patch serie was mandatory for PL33

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Eric Auger
On 03/06/2015 12:27 PM, Baptiste Reynal wrote: > Hi everyone, > > Indeed, the NOEXEC flag is needed for our tests and VFIO should work > without it for some other devices (including xgmac). I think it is > reasonable to drop this patch serie for now. > > Still we have the IOMMU_CACHE issue. To an

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Eric Auger
Hi All, On 03/06/2015 12:27 PM, Baptiste Reynal wrote: > Hi everyone, > > Indeed, the NOEXEC flag is needed for our tests and VFIO should work > without it for some other devices (including xgmac). I think it is > reasonable to drop this patch serie for now. > > Still we have the IOMMU_CACHE iss

Re: [PATCH 1/2] iommu: move pgsize_bitmap from struct iommu_ops to struct iommu_domain

2015-03-06 Thread Will Deacon
On Fri, Mar 06, 2015 at 11:57:58AM +, Laurent Pinchart wrote: > On Friday 06 March 2015 11:34:47 Will Deacon wrote: > > @@ -108,8 +109,6 @@ enum iommu_attr { > > * @domain_get_attr: Query domain attributes > > * @domain_set_attr: Change domain attributes > > * @of_xlate: add OF master IDs

Re: [PATCH 1/2] iommu: move pgsize_bitmap from struct iommu_ops to struct iommu_domain

2015-03-06 Thread Marek Szyprowski
Hello, On 2015-03-06 12:34, Will Deacon wrote: struct iommu_ops contains function pointers for IOMMU driver callbacks in order to implement the core IOMMU API. Amongst these pointers is an unsigned long pgsize_bitmap field, which is problematic because the set of supported page sizes is not nece

Re: [PATCH 1/2] iommu: move pgsize_bitmap from struct iommu_ops to struct iommu_domain

2015-03-06 Thread Will Deacon
On Fri, Mar 06, 2015 at 11:56:08AM +, Laurent Pinchart wrote: > Hi Will, Hi Laurent, Cheers for taking a look. > On Friday 06 March 2015 11:34:47 Will Deacon wrote: > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > > index 10186cac7716..cd867b255b99 100644 > > --- a/

Re: [PATCH 1/2] iommu: move pgsize_bitmap from struct iommu_ops to struct iommu_domain

2015-03-06 Thread Laurent Pinchart
Hi Will, On Friday 06 March 2015 11:34:47 Will Deacon wrote: > struct iommu_ops contains function pointers for IOMMU driver callbacks > in order to implement the core IOMMU API. Amongst these pointers is > an unsigned long pgsize_bitmap field, which is problematic because the > set of supported pa

Re: [PATCH 1/2] iommu: move pgsize_bitmap from struct iommu_ops to struct iommu_domain

2015-03-06 Thread Laurent Pinchart
Hi Will, Thank you for the patch. On Friday 06 March 2015 11:34:47 Will Deacon wrote: > struct iommu_ops contains function pointers for IOMMU driver callbacks > in order to implement the core IOMMU API. Amongst these pointers is > an unsigned long pgsize_bitmap field, which is problematic because

Re: [PATCH 1/5] soc: mediatek: Add SMI driver

2015-03-06 Thread Paul Bolle
On Fri, 2015-03-06 at 18:48 +0800, yong...@mediatek.com wrote: > --- a/drivers/soc/mediatek/Kconfig > +++ b/drivers/soc/mediatek/Kconfig > @@ -20,3 +20,10 @@ config MT8173_PMIC_WRAP > PMIC wrapper is a proprietary hardware in MT8173 to make > communication protocols to access PMIC d

[PATCH 2/2] iommu: of: enforce const-ness of struct iommu_ops

2015-03-06 Thread Will Deacon
From: Robin Murphy With the pgsize_bitmap removed, there is no compelling reason for the remaining callbacks in struct iommu_ops to be mutable, so enforce const-ness throughout the core code. Signed-off-by: Robin Murphy Signed-off-by: Will Deacon --- arch/arm/include/asm/dma-mapping.h | 2

[PATCH 0/2] Kill off pgsize_bitmap field from struct iommu_ops

2015-03-06 Thread Will Deacon
Hi all, These patches move the pgsize_bitmap field out of iommu_ops and into the iommu_domain structure, as there are systems containing multiple instances of a given IOMMU (e.g. the ARM SMMU) with different page size support on the individual devices. Once that's done, we can get back to treatin

[PATCH 1/2] iommu: move pgsize_bitmap from struct iommu_ops to struct iommu_domain

2015-03-06 Thread Will Deacon
struct iommu_ops contains function pointers for IOMMU driver callbacks in order to implement the core IOMMU API. Amongst these pointers is an unsigned long pgsize_bitmap field, which is problematic because the set of supported page sizes is not necessarily the same across all instances of a given I

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Baptiste Reynal
Hi everyone, Indeed, the NOEXEC flag is needed for our tests and VFIO should work without it for some other devices (including xgmac). I think it is reasonable to drop this patch serie for now. Still we have the IOMMU_CACHE issue. To answer Will, the SMMU page tables are installed at stage-2. Cur

Re: [PATCH 4/5] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-03-06 Thread Mark Rutland
On Fri, Mar 06, 2015 at 10:48:19AM +, yong...@mediatek.com wrote: > From: Yong Wu > > This patch add mediatek iommu dts binding document. > > Signed-off-by: Yong Wu > --- > .../devicetree/bindings/iommu/mediatek,iommu.txt | 41 > ++ > 1 file changed, 41 insertions(+)

Re: [PATCH 3/5] dt-bindings: mediatek: Add smi dts binding

2015-03-06 Thread Mark Rutland
On Fri, Mar 06, 2015 at 10:48:18AM +, yong...@mediatek.com wrote: > From: Yong Wu > > This patch add smi binding document. Please move binding documents to the start of the series. It makes things far easier to review. > > Signed-off-by: Yong Wu > --- > .../devicetree/bindings/soc/mediat

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-03-06 Thread Will Deacon
On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: > From: Yong Wu > > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). > Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [...] > diff --git a/drivers/iommu/mtk_iommu_pa

[PATCH 4/5] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-03-06 Thread yong.wu
From: Yong Wu This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 41 ++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/mediatek,iommu.txt diff --g

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

2015-03-06 Thread yong.wu
From: Yong Wu This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. Signed-off-by: Yong Wu --- drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile | 1 + drivers

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

2015-03-06 Thread yong.wu
From: Yong Wu This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 60 include/dt-bindings/iommu/mt8173-iommu-port.h | 127 ++ 2 files changed, 187 insertions(+) create mode 100644 incl

[PATCH 3/5] dt-bindings: mediatek: Add smi dts binding

2015-03-06 Thread yong.wu
From: Yong Wu This patch add smi binding document. Signed-off-by: Yong Wu --- .../devicetree/bindings/soc/mediatek/mediatek,smi.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/mediatek/mediatek,smi.txt diff --git a/Docu

[PATCH 1/5] soc: mediatek: Add SMI driver

2015-03-06 Thread yong.wu
From: 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/soc/mediatek/Kconfig | 7 ++ drivers/soc/mediatek/Makefile | 1 + drivers/so

[RFC PATCH 0/5] MT8173 IOMMU support

2015-03-06 Thread yong.wu
This is based on Robin Murphy's arm64: IOMMU-backed DMA mapping[1]. This patch adds support for m4u(Multimedia Memory Management Unit), Currently it only support the m4u with 2 levels of page table on mt8173. Please check the hardware block diagram of Mediatek IOMMU. EMI (Exter

[PATCH 1/5] soc: mediatek: Add SMI driver

2015-03-06 Thread yong.wu
From: 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/soc/mediatek/Kconfig | 7 ++ drivers/soc/mediatek/Makefile | 1 + drivers/

[RFC PATCH 0/5] MT8173 IOMMU support

2015-03-06 Thread yong.wu
This is based on Robin Murphy's arm64: IOMMU-backed DMA mapping[1]. This patch adds support for m4u(Multimedia Memory Management Unit), Currently it only support the m4u with 2 levels of page table on mt8173. Please check the hardware block diagram of Mediatek IOMMU. EMI (Exter

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Will Deacon
Hi Eric, On Fri, Mar 06, 2015 at 09:04:22AM +, Eric Auger wrote: > Yes to me "vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1" is > not a direct dependency of vfio-platform driver although I understand > Baptiste needs it to test with PL330 device. On my side I can test > vfio-platfor

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-06 Thread Eric Auger
On 03/05/2015 10:11 PM, Alex Williamson wrote: > On Thu, 2015-03-05 at 18:34 +0100, Eric Auger wrote: >> Hi All, >> >> Ironically, since the correction of the IOMMU_CAP_CACHE_COHERENCY bug >> (https://lkml.org/lkml/2015/1/29/514) in vfio_iommu_type1.c, my Calxeda >> Midway VFIO use case is not work