Re: [RFC v6 04/10] PCI: Add support for enforcing all MMIO BARs to be page aligned

2016-04-25 Thread Alexey Kardashevskiy
On 04/18/2016 08:56 PM, Yongji Xie wrote: When vfio passthrough a PCI device of which MMIO BARs are smaller than PAGE_SIZE, guest will not handle the mmio accesses to the BARs which leads to mmio emulations in host. This is because vfio will not allow to passthrough one BAR's mmio page which may

RE: [v8, 1/7] Documentation: DT: update Freescale DCFG compatible

2016-04-25 Thread Yangbo Lu
Hi Mark, > -Original Message- > From: Mark Rutland [mailto:mark.rutl...@arm.com] > Sent: Friday, April 22, 2016 9:12 PM > To: Yangbo Lu > Cc: linux-...@vger.kernel.org; linuxppc-...@lists.ozlabs.org; > devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux- > ker...@vger.

Re: [lkp] [PATCH v7 7/8] genirq/msi: map/unmap the MSI doorbells on msi_domain_alloc/free_irqs

2016-04-25 Thread Ye Xiaolong
On Wed, Apr 20, 2016 at 09:47:19AM +0200, Eric Auger wrote: >Hi, > Hi, Eric >Both reported errors related to this series are due to the fact part n >has dependency on part n-1. > If I understand correctly, what you meant is that you send patch series (let's say B), and B has its dependency patch s

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-04-25 Thread Christoph Hellwig
On Mon, Apr 25, 2016 at 04:26:19PM +0200, Niklas S?derlund wrote: > I have followed the call path from the usage in > drivers/dma/sh/rcar-dmac.c and made sure the dma_addr_t is not used in a > bad way. The dma-debug routines are called from the generic code in include/linux/dma-mapping.h, and fr

Re: [PATCH 6/7] iommu/arm-smmu: Decouple context format from kernel config

2016-04-25 Thread Robin Murphy
On 25/04/16 14:41, Will Deacon wrote: On Mon, Apr 25, 2016 at 02:14:57PM +0100, Robin Murphy wrote: On 25/04/16 12:02, Will Deacon wrote: In what case would you not have a viable AArch64 granule, but the option of falling back to AArch32 makes things work? A 4KB page kernel with MMU-401, whos

Re: [PATCH 4/7] io-64-nonatomic: Add relaxed accessor variants

2016-04-25 Thread Arnd Bergmann
On Wednesday 13 April 2016 18:13:00 Robin Murphy wrote: > Whilst commit 9439eb3ab9d1 ("asm-generic: io: implement relaxed > accessor macros as conditional wrappers") makes the *_relaxed forms of > I/O accessors universally available to drivers, in cases where writeq() > is implemented via the io-64

Re: [PATCH 4/7] io-64-nonatomic: Add relaxed accessor variants

2016-04-25 Thread Will Deacon
On Mon, Apr 25, 2016 at 05:41:21PM +0200, Arnd Bergmann wrote: > On Monday 25 April 2016 16:28:01 Robin Murphy wrote: > > >>> > > >>> We _could_ - indeed I started doing that, but then decided that the > > >>> obfuscation of horrible macro-templated functions wasn't worth saving a > > >>> couple of

[RFC 8/9] drivers: of: call iommu_bus_add_dev after iommu_configure_ops

2016-04-25 Thread Sricharan R
Now that the device's iommu ops are configured at probe time, the device has to be added to the iommu late. Signed-off-by: Sricharan R --- drivers/of/device.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/of/device.c b/drivers/of/device.c index 57a5f2d..722115c 100644 --- a/dri

[RFC 3/9] of: dma: Make of_dma_deconfigure() public

2016-04-25 Thread Sricharan R
From: Laurent Pinchart As part of moving DMA initializing to probe time the of_dma_deconfigure() function will need to be called from different source files. Make it public and move it to drivers/of/device.c where the of_dma_configure() function is. Signed-off-by: Laurent Pinchart --- drivers/

[RFC 1/9] arm: dma-mapping: Don't override dma_ops in arch_setup_dma_ops()

2016-04-25 Thread Sricharan R
From: Laurent Pinchart The arch_setup_dma_ops() function is in charge of setting dma_ops with a call to set_dma_ops(). set_dma_ops() is also called from - highbank and mvebu bus notifiers - dmabounce (to be replaced with swiotlb) - arm_iommu_attach_device (arm_iommu_attach_device is itself call

[RFC 7/9] drivers: iommu: Add a new add device api

2016-04-25 Thread Sricharan R
Associating a master with an group happens when the master is added to the bus, notified with BUS_ADD_DEVICE. But the iommu has to be ready before this using early iommu registration and also master should have been added to the iommu using xlate. So, when trying to get rid of the early registratio

[RFC 4/9] of: dma: Split of_configure_dma() into mask and ops configuration

2016-04-25 Thread Sricharan R
From: Laurent Pinchart The of_configure_dma() function configures both the DMA masks and ops. Moving DMA ops configuration to probe time would thus also delay configuration of the DMA masks, which might not be safe. To avoid issues split the configuration in two to allow keeping masks configurati

[RFC 9/9] drivers: iommu: arm-smmu: Set iommu_ops in probe

2016-04-25 Thread Sricharan R
iommu_ops should be set after the iommu is probed. This ensures that the iommu is really ready when master's iommu ops are set during their probe or else deferred. Signed-off-by: Sricharan R --- drivers/iommu/arm-smmu.c | 34 ++ 1 file changed, 2 insertions(+), 32

[RFC 6/9] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2016-04-25 Thread Sricharan R
From: Laurent Pinchart Failures to look up an IOMMU when parsing the DT iommus property need to be handled separately from the .of_xlate() failures to support deferred probing. The lack of a registered IOMMU can be caused by the lack of a driver for the IOMMU, the IOMMU device probe not having b

[RFC 5/9] drivers: platform: Configure dma operations at probe time

2016-04-25 Thread Sricharan R
From: Laurent Pinchart Configuring DMA ops at probe time will allow deferring device probe when the IOMMU isn't available yet. Signed-off-by: Laurent Pinchart --- drivers/base/platform.c | 13 + drivers/of/platform.c | 7 +++ 2 files changed, 16 insertions(+), 4 deletions(-)

[RFC 2/9] of: dma: Move range size workaround to of_dma_get_range()

2016-04-25 Thread Sricharan R
From: Laurent Pinchart Invalid dma-ranges values should be worked around when retrieving the DMA range in of_dma_get_range(), not by all callers of the function. This isn't much of a problem now that we have a single caller, but that situation will change when moving DMA configuration to device p

[RFC 0/9] IOMMU probe deferral support

2016-04-25 Thread Sricharan R
This is mostly a repost of the probe deferral series from Laurent Pinchart [1]. Added a check to fix boot with ACPI. Adapted arm-smmu driver to work with deferred probing and added a new api for the below reason. This is based on the generic iommu binding series from Robin Murphy . Now associating

Re: [PATCH 4/7] io-64-nonatomic: Add relaxed accessor variants

2016-04-25 Thread Arnd Bergmann
On Monday 25 April 2016 16:28:01 Robin Murphy wrote: > >>> > >>> We _could_ - indeed I started doing that, but then decided that the > >>> obfuscation of horrible macro-templated functions wasn't worth saving a > >>> couple of hundred bytes in some code that isn't exactly difficult to > >>> maintai

Re: [PATCH 4/7] io-64-nonatomic: Add relaxed accessor variants

2016-04-25 Thread Robin Murphy
Hi Arnd, On 25/04/16 16:21, Arnd Bergmann wrote: On Monday 25 April 2016 14:32:42 Will Deacon wrote: +static inline __u64 hi_lo_readq_relaxed(const volatile void __iomem *addr) +{ + const volatile u32 __iomem *p = addr; + u32 low, high; + + high = readl_relaxed(p + 1); + low = readl_re

Re: [PATCH 4/7] io-64-nonatomic: Add relaxed accessor variants

2016-04-25 Thread Arnd Bergmann
On Monday 25 April 2016 14:32:42 Will Deacon wrote: > > >> > > >>+static inline __u64 hi_lo_readq_relaxed(const volatile void __iomem > > >>*addr) > > >>+{ > > >>+ const volatile u32 __iomem *p = addr; > > >>+ u32 low, high; > > >>+ > > >>+ high = readl_relaxed(p + 1); > > >>+ low = readl_

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-04-25 Thread Niklas Söderlund
Hi Christoph, On 2016-04-21 06:49:42 -0700, Christoph Hellwig wrote: > On Wed, Apr 13, 2016 at 03:29:17PM +0200, Niklas S?derlund wrote: > > > Yes, it would be good to do an audit of all the ARM dma_ops as well > > > as generic code like drivers/base/dma-*.c, lib/dma-debug.c and > > > include/linu

Re: [PATCH 6/7] iommu/arm-smmu: Decouple context format from kernel config

2016-04-25 Thread Will Deacon
On Mon, Apr 25, 2016 at 02:14:57PM +0100, Robin Murphy wrote: > On 25/04/16 12:02, Will Deacon wrote: > >In what case would you not have a viable AArch64 granule, but the option > >of falling back to AArch32 makes things work? > > A 4KB page kernel with MMU-401, whose only supported AArch64 granul

Re: [PATCH 4/7] io-64-nonatomic: Add relaxed accessor variants

2016-04-25 Thread Will Deacon
On Fri, Apr 22, 2016 at 06:08:46PM +0100, Robin Murphy wrote: > On 21/04/16 17:18, Will Deacon wrote: > >On Wed, Apr 13, 2016 at 06:13:00PM +0100, Robin Murphy wrote: > >>Whilst commit 9439eb3ab9d1 ("asm-generic: io: implement relaxed > >>accessor macros as conditional wrappers") makes the *_relaxe

Re: [PATCH 6/7] iommu/arm-smmu: Decouple context format from kernel config

2016-04-25 Thread Robin Murphy
On 25/04/16 12:02, Will Deacon wrote: On Fri, Apr 22, 2016 at 06:38:04PM +0100, Robin Murphy wrote: On 21/04/16 17:30, Will Deacon wrote: Hi Robin, On Wed, Apr 13, 2016 at 06:13:02PM +0100, Robin Murphy wrote: The way the driver currently forces an AArch32 or AArch64 context format based on t

Re: [RFC v6 00/10] vfio-pci: Allow to mmap sub-page MMIO BARs and MSI-X table

2016-04-25 Thread Yongji Xie
Hi Alex, Any comment? Thanks, Yongji On 2016/4/18 18:53, Yongji Xie wrote: Current vfio-pci implementation disallows to mmap sub-page(size < PAGE_SIZE) MMIO BARs and MSI-X table. This is because sub-page BARs' mmio page may be shared with other BARs and MSI-X table should not be accessed direc

Re: [PATCH 6/7] iommu/arm-smmu: Decouple context format from kernel config

2016-04-25 Thread Will Deacon
On Fri, Apr 22, 2016 at 06:38:04PM +0100, Robin Murphy wrote: > On 21/04/16 17:30, Will Deacon wrote: > >Hi Robin, > > > >On Wed, Apr 13, 2016 at 06:13:02PM +0100, Robin Murphy wrote: > >>The way the driver currently forces an AArch32 or AArch64 context format > >>based on the kernel config and SMM

Re: [BUGREPORT] Intel X58 Boards don't boot after "iommu/vt-d: Make root entry visible for hardware right after allocation"

2016-04-25 Thread Joerg Roedel
On Mon, Apr 25, 2016 at 07:19:52AM +0400, Dheeraj CVR wrote: > I have tried to grab details about the kernel panic stack trace to make it > easier for Joerg to identify and fix the issue. I have downloaded the latest > Kubuntu Live ISO image which is based on kernel 4.2.0. I have changed the boot >

Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-04-25 Thread Joerg Roedel
On Mon, Apr 18, 2016 at 02:03:50PM +0200, Luis R. Rodriguez wrote: > You said that with my patch you saw AMD IOMMUv2 kick off first, > that was intentional as I thought that's what you needed. Can > someone please describe the requirements? > > Also what does drm use that you say has a conflict al