Re: [PATCH v9 0/7] KVM PCIe/MSI passthrough on ARM/ARM64: kernel part 3/3: vfio changes

2016-06-08 Thread Alex Williamson
On Wed, 8 Jun 2016 10:29:35 +0200 Auger Eric wrote: > Dear all, > Le 20/05/2016 à 18:01, Eric Auger a écrit : > > Alex, Robin, > > > > While my 3 part series primarily addresses the problematic of mapping > > MSI doorbells into arm-smmu, it fails in : > > > > 1)

[RFC PATCH 15/15] iommu/exynos: update to use iommu big-endian

2016-06-08 Thread Matthew Leach
From: Ben Dooks Add initial support for big endian by always writing the pte in le32. Note, revisit if hardware capable of doing big endian fetches. Signed-off-by: Ben Dooks --- Cc: Marek Szyprowski Cc: Joerg

Re: [PATCH 1/3] PM / Runtime: Add notifiers for device runtime PM events

2016-06-08 Thread Rafael J. Wysocki
On Wed, Jun 8, 2016 at 12:25 PM, Marek Szyprowski wrote: > From: Krzysztof Kozlowski > > Allow drivers registering for certain runtime PM events of other > devices. Some drivers in power domain are more or less coupled. When one > driver is

Re: [RESEND PATCH] iommu/rockchip: fix zap cache during device attach

2016-06-08 Thread Heiko Stübner
Hi Joerg, Am Mittwoch, 1. Juni 2016, 16:46:10 schrieb John Keeping: > rk_iommu_command() takes a struct rk_iommu and iterates over the slave > MMUs, so this is doubly wrong in that we're passing in the wrong pointer > and talking to MMUs that we shouldn't be. > > Fixes: cd6438c5f844

[PATCH v2 6/7] iommu/rockchip: use DMA API to map, to flush cache

2016-06-08 Thread Shunqian Zheng
Use DMA API instead of architecture internal functions like __cpuc_flush_dcache_area() etc. To support the virtual device like DRM the virtual slave iommu added in the previous patch, attaching to which the DRM can use it own domain->dev for dma_map_*(), dma_sync_*() even VOP is disabled. With

[PATCH v2 7/7] iommu/rockchip: enable rockchip iommu on ARM64 platform

2016-06-08 Thread Shunqian Zheng
From: Simon Xue Signed-off-by: Simon Xue Signed-off-by: Shunqian Zheng --- drivers/iommu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index

[PATCH v2 5/7] drm: rockchip: use common iommu api to attach iommu

2016-06-08 Thread Shunqian Zheng
Rockchip DRM used the arm special API, arm_iommu_*(), to attach iommu for ARM32 SoCs. This patch convert to common iommu API so it would support ARM64 like RK3399. The general idea is domain_alloc(), attach_device() and arch_setup_dma_ops() to set dma_ops manually for DRM at the last.

[PATCH v2 4/7] ARM: dts: rockchip: add virtual iommu for display

2016-06-08 Thread Shunqian Zheng
An virtual iommu without reg or interrupts for display. Adding this according to iommu driver changes. Signed-off-by: Shunqian Zheng --- arch/arm/boot/dts/rk3288.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/rk3288.dtsi

[PATCH v2 3/7] iommu/rockchip: support virtual iommu slave device

2016-06-08 Thread Shunqian Zheng
An virtual master device like DRM need to attach to iommu domain to share the domain with VOP(the one with actual iommu slave). We currently check the group is NULL to indicate a virtual master, which is not true since we decide to use the common iommu api to attach device in DRM. With this

[PATCH v2 2/7] iommu/rockchip: add map_sg callback for rk_iommu_ops

2016-06-08 Thread Shunqian Zheng
From: Simon Xue The iommu_dma_alloc() in iommu/dma-iommu.c calls iommu_map_sg() that requires the callback iommu_ops .map_sg(). Adding the default_iommu_map_sg() to rockchip iommu accordingly. Signed-off-by: Simon Xue Signed-off-by: Shunqian Zheng

[PATCH v2 0/7] fix bugs; enable iommu for ARM64

2016-06-08 Thread Shunqian Zheng
This series patches mainly for ARM64 supporting. To do this, it first add virtual iommu slave device which DRM can attach to, convert DRM driver to use common iommu API instead of the ARM32 functions, and then use DMA API in iommu driver to map, to flush cache. The v2 patches make a lot changes

Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the clear

2016-06-08 Thread Matt Fleming
On Tue, 26 Apr, at 05:57:40PM, Tom Lendacky wrote: > The EFI tables are not encrypted and need to be accessed as such. Be sure > to memmap them without the encryption attribute set. For EFI support that > lives outside of the arch/x86 tree, create a routine that uses the __weak > attribute so that

[PATCH 1/3] PM / Runtime: Add notifiers for device runtime PM events

2016-06-08 Thread Marek Szyprowski
From: Krzysztof Kozlowski Allow drivers registering for certain runtime PM events of other devices. Some drivers in power domain are more or less coupled. When one driver is suspending (thus leading to power domain being also turned off) the other might have to perform

[PATCH 3/3] iommu/exynos: Add proper runtime pm support

2016-06-08 Thread Marek Szyprowski
This patch uses recently introduced runtime pm notifiers to track the runtime pm state of the master's device. This way each SYSMMU controller knows when its master's device is active and can save/restore its state instead of being enabled all the time. This way SYSMMU controllers no longer

[PATCH 2/3] iommu/exynos: Remove excessive, useless debug

2016-06-08 Thread Marek Szyprowski
Remove excessive, useless debug about skipping TLB invalidation, which is a normal situation when more aggressive power management is enabled. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 3 --- 1 file changed, 3 deletions(-) diff --git

[PATCH 0/3] Exynos IOMMU: proper runtime pm support

2016-06-08 Thread Marek Szyprowski
Hello, This patch series finally implements proper runtime pm support in Exynos IOMMU driver. This has been achieved by adding runtime pm notifiers, which lets SYSMMU controller to follow it's master device (the device which actually performs DMA transaction) runtime pm. The main idea behind this

Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the clear

2016-06-08 Thread Matt Fleming
(Sorry for the delay) On Thu, 26 May, at 08:45:58AM, Tom Lendacky wrote: > > The patch in question is patch 6/18 where PAGE_KERNEL is changed to > include the _PAGE_ENC attribute (the encryption mask). This now > makes FIXMAP_PAGE_NORMAL contain the encryption mask while > FIXMAP_PAGE_IO does

Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X table

2016-06-08 Thread Yongji Xie
Hi, Eric On 2016/6/8 15:41, Auger Eric wrote: Hi Yongji, Le 02/06/2016 à 08:09, Yongji Xie a écrit : Current vfio-pci implementation disallows to mmap the page containing MSI-X table in case that users can write directly to MSI-X table and generate an incorrect MSIs. However, this will

[PATCH v4 2/5] iommu/mediatek: move the common struct into header file

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Move the struct defines of mtk iommu into a new header files for common use. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 48 + drivers/iommu/mtk_iommu.h | 77

[PATCH v4 1/5] dt-bindings: mediatek: add descriptions for mediatek mt2701 iommu and smi

2016-06-08 Thread honghui.zhang
From: Honghui Zhang This patch defines the local arbitor port IDs for mediatek SoC MT2701 and add descriptions of binding for mediatek generation one iommu and smi. Signed-off-by: Honghui Zhang Acked-by: Rob Herring ---

[PATCH v4 0/5] MT2701 iommu support

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Mediatek's m4u(Multimedia Memory Management Unit) and SMI(Smart Multimedia Interface)have two generations HW. They basically sharing the same hardware block diagram, but have some difference as below: Generation one m4u only supports one

[PATCH v4 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Mediatek SoC's M4U has two generations of HW architcture. Generation one uses flat, one layer pagetable, and was shipped with ARM architecture, it only supports 4K size page mapping. MT2701 SoC uses this generation one m4u HW. Generation two uses

[PATCH v4 3/5] memory/mediatek: add support for mt2701

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Mediatek SMI has two generations of HW architecture, mt8173 uses the second generation of SMI HW while mt2701 uses the first generation HW of SMI. There's slight differences between the two generations, for generation 2, the register which control

[PATCH] iommu/mediatek: Do not call of_node_put in mtk_iommu_of_xlate

2016-06-08 Thread honghui.zhang
From: Honghui Zhang The device_node will be released in of_iommu_configure, it may be double released if call of_node_put in mtk_iommu_of_xlate. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 1 - 1 file changed, 1

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2016-06-08 Thread Magnus Damm
Hi Laurent, On Wed, Jun 8, 2016 at 5:48 PM, Laurent Pinchart wrote: > Hi Geert, > > On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote: >> On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart wrote: >> >> --- 0031/drivers/iommu/ipmmu-vmsa.c >> >> +++

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2016-06-08 Thread Laurent Pinchart
Hi Geert, On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote: > On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart wrote: > >> --- 0031/drivers/iommu/ipmmu-vmsa.c > >> +++ work/drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 > >> @@ -1074,7 +1074,7 @@ static const struct

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2016-06-08 Thread Magnus Damm
Hi Laurent, On Wed, Jun 8, 2016 at 9:18 AM, Laurent Pinchart wrote: > Hi Magnus, > > Thank you for the patch. > > On Tuesday 07 Jun 2016 12:39:45 Magnus Damm wrote: >> From: Magnus Damm >> >> Support the r8a7796 IPMMU by sharing

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2016-06-08 Thread Magnus Damm
Hi Geert, On Wed, Jun 8, 2016 at 4:04 PM, Geert Uytterhoeven wrote: > Hi Laurent, > > On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart > wrote: >>> --- 0031/drivers/iommu/ipmmu-vmsa.c >>> +++ work/drivers/iommu/ipmmu-vmsa.c 2016-06-06

Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X table

2016-06-08 Thread Auger Eric
Hi Yongji, Le 02/06/2016 à 08:09, Yongji Xie a écrit : > Current vfio-pci implementation disallows to mmap the page > containing MSI-X table in case that users can write directly > to MSI-X table and generate an incorrect MSIs. > > However, this will cause some performance issue when there > are

[PATCH v4 07/07] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency

2016-06-08 Thread Magnus Damm
From: Magnus Damm Neither the ARM page table code enabled by IOMMU_IO_PGTABLE_LPAE nor the IPMMU_VMSA driver actually depends on ARM_LPAE, so get rid of the dependency. Tested with ipmmu-vmsa on r8a7794 ALT and a kernel config using: # CONFIG_ARM_LPAE is not set

[PATCH v4 01/07] iommu/ipmmu-vmsa: Remove platform data handling

2016-06-08 Thread Magnus Damm
From: Magnus Damm The IPMMU driver is using DT these days, and platform data is no longer used by the driver. Remove unused code. Signed-off-by: Magnus Damm Reviewed-by: Laurent Pinchart --- Changes

[PATCH v4 03/07] iommu/ipmmu-vmsa: Break out utlb parsing code

2016-06-08 Thread Magnus Damm
From: Magnus Damm Break out the utlb parsing code and dev_data allocation into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm --- Changes since V3: - Initialize "mmu" to NULL, check before

[PATCH v4 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2016-06-08 Thread Magnus Damm
From: Magnus Damm Introduce an alternative set of iommu_ops suitable for 64-bit ARM as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. Signed-off-by: Magnus Damm --- Changes since V3: - Removed group parameter from

[PATCH v4 04/07] iommu/ipmmu-vmsa: Break out domain allocation code

2016-06-08 Thread Magnus Damm
From: Magnus Damm Break out the domain allocation code into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm --- Changes since V3: - None Changes since V2: - Included this new patch as-is