Re: [PATCH/RFC 0/4] Probe deferral for IOMMU DT integration

2015-03-03 Thread Laurent Pinchart
Hello, I haven't seen any reply to this e-mail. I know that the combination of IOMMU, DMA mapping and DT doesn't exactly sound like fun, but I think we still need to move on :-) Will and Arnd, could you please confirm that my summary below matches your memories of our discussion ? On Monday 1

Re: [PATCH - v7] of: Move of_dma_configure() to device.c to help re-use

2015-03-03 Thread Murali Karicheri
On 03/03/2015 03:53 PM, Bjorn Helgaas wrote: [+cc linux-pci] On Tue, Mar 3, 2015 at 11:55 AM, Murali Karicheri wrote: On 03/02/2015 10:43 PM, Bjorn Helgaas wrote: On Mon, Mar 2, 2015 at 3:59 PM, Murali Karicheri wrote: Move of_dma_configure() to device.c so it can be re-used for PCI device

Re: [PATCH - v7] of: Move of_dma_configure() to device.c to help re-use

2015-03-03 Thread Bjorn Helgaas
[+cc linux-pci] On Tue, Mar 3, 2015 at 11:55 AM, Murali Karicheri wrote: > On 03/02/2015 10:43 PM, Bjorn Helgaas wrote: >> >> On Mon, Mar 2, 2015 at 3:59 PM, Murali Karicheri >> wrote: >>> >>> Move of_dma_configure() to device.c so it can be re-used for PCI devices >>> to >>> obtain DMA configura

Re: BUG: SCSI aic7xxx driver and AMD IOMMU

2015-03-03 Thread Mark Hounschell
Hi Joerg, It looks like this problem is NOT a bug with the SCSI aic7xxx driver after all. I can duplicate this BUG very easily with other hardware. Simply removing a driver module (whether it its self, has actually used any of the DMA API or not) that is sitting on the same pci bus as a card

Re: [PATCH v4 0/5] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-03 Thread Alex Williamson
On Tue, 2015-03-03 at 18:46 +0100, Eric Auger wrote: > Hi Baptiste, > > In "vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag" you still > kept domain->caps |= IOMMU_CAP_NOEXEC so potentially overwriting 1<< > IOMMU_CAP_CACHE_COHERENCY I guess. > > Sorry I do not have this 4th patch file i

Re: [PATCH v4 0/5] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-03 Thread Eric Auger
On 03/03/2015 06:46 PM, Eric Auger wrote: > Hi Baptiste, > > In "vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag" you still > kept domain->caps |= IOMMU_CAP_NOEXEC so potentially overwriting 1<< > IOMMU_CAP_CACHE_COHERENCY I guess. Well sorry no risk to overwrite but not homogeneous. Eri

Re: [PATCH - v7] of: Move of_dma_configure() to device.c to help re-use

2015-03-03 Thread Murali Karicheri
On 03/02/2015 10:43 PM, Bjorn Helgaas wrote: On Mon, Mar 2, 2015 at 3:59 PM, Murali Karicheri wrote: Move of_dma_configure() to device.c so it can be re-used for PCI devices to obtain DMA configuration from DT. Also add a second argument so that for PCI, the DT node of root bus host bridge can

[PATCH v8 3/7] of: Fix size when dma-range is not used

2015-03-03 Thread Murali Karicheri
Fix the dma-range size when the DT attribute is missing, i.e., set size to dev->coherent_dma_mask + 1 instead of dev->coherent_dma_mask. Also add code to check invalid values of size configured in DT and log error. Tested-by: Suravee Suthikulpanit (AMD Seattle) Signed-off-by: Murali Karicheri S

[PATCH v8 6/7] PCI: Update DMA configuration from DT

2015-03-03 Thread Murali Karicheri
If there is a DT node available for the root bridge's parent device, use the DMA configuration from that device node. For example, Keystone PCI devices would require dma_pfn_offset to be set correctly in the device structure of the PCI device in order to have the correct DMA mask. The DT node wil

[PATCH v8 1/7] of: iommu: Add ptr to OF node arg to of_iommu_configure()

2015-03-03 Thread Murali Karicheri
of_iommu_configure() is called from of_dma_configure() to setup iommu ops using DT property. This API is currently used for platform devices for which DMA configuration (including IOMMU ops) may come from the device's parent. To extend this functionality for PCI devices, this API needs to take a

[PATCH v8 5/7] of/pci: Add of_pci_dma_configure() to update DMA configuration

2015-03-03 Thread Murali Karicheri
Add of_pci_dma_configure() to allow updating the DMA configuration of the PCI device using the configuration from DT of the parent of the root bridge device. Use the newly added APIs pci_get/put_host_bridge_device() for implementing this. Tested-by: Suravee Suthikulpanit (AMD Seattle) Signed-off

[PATCH v8 0/7] PCI: get DMA configuration from parent device

2015-03-03 Thread Murali Karicheri
This series is already applied on arm-pci iommu branch for next, but kbuild test robot reported build errors on x86_64 and sparc. So I am sending v8 to help apply on arm-pci iommu branch. Here is the original cover letter of the series. This patch add an important capability to PCI driver on Key

[PATCH v8 7/7] arm: dma-mapping: limit IOMMU mapping size

2015-03-03 Thread Murali Karicheri
arm_iommu_create_mapping() has size parameter of size_t and arm_setup_iommu_dma_ops() can take a value higher than that when this is called from the OF code. So limit the size to SIZE_MAX. Tested-by: Suravee Suthikulpanit (AMD Seattle) Signed-off-by: Murali Karicheri Signed-off-by: Bjorn Helgaa

[PATCH v8 2/7] of: Move of_dma_configure() to device.c to help re-use

2015-03-03 Thread Murali Karicheri
Move of_dma_configure() to device.c so it can be re-used for PCI devices to obtain DMA configuration from DT. Also add a second argument so that for PCI, the DT node of root bus host bridge can be used to obtain the DMA configuration for the slave PCI device. Tested-by: Suravee Suthikulpanit (AM

[PATCH v8 4/7] PCI: Add helper functions pci_get[put]_host_bridge_device()

2015-03-03 Thread Murali Karicheri
Add helper functions to get/put the root bus's host bridge device. Tested-by: Suravee Suthikulpanit (AMD Seattle) Signed-off-by: Murali Karicheri Signed-off-by: Bjorn Helgaas Reviewed-by: Catalin Marinas Acked-by: Will Deacon CC: Joerg Roedel CC: Grant Likely CC: Rob Herring CC: Russell Ki

Re: [PATCH v4 0/5] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-03 Thread Eric Auger
Hi Baptiste, In "vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag" you still kept domain->caps |= IOMMU_CAP_NOEXEC so potentially overwriting 1<< IOMMU_CAP_CACHE_COHERENCY I guess. Sorry I do not have this 4th patch file in my mailbox. Best Regards Eric if (iommu_capable(bus, I

Re: [PATCH - v7] of: Move of_dma_configure() to device.c to help re-use

2015-03-03 Thread Rob Herring
On Mon, Mar 2, 2015 at 3:59 PM, Murali Karicheri wrote: > Move of_dma_configure() to device.c so it can be re-used for PCI devices to > obtain DMA configuration from DT. Also add a second argument so that for > PCI, the DT node of root bus host bridge can be used to obtain the DMA > configuration

Re: [PATCH - v7] of: Move of_dma_configure() to device.c to help re-use

2015-03-03 Thread Murali Karicheri
On 03/02/2015 10:43 PM, Bjorn Helgaas wrote: On Mon, Mar 2, 2015 at 3:59 PM, Murali Karicheri wrote: Move of_dma_configure() to device.c so it can be re-used for PCI devices to obtain DMA configuration from DT. Also add a second argument so that for PCI, the DT node of root bus host bridge can

Re: [patch] iommu/amd: small cleanup in mn_release()

2015-03-03 Thread Joerg Roedel
On Fri, Feb 20, 2015 at 01:52:01PM +0300, Dan Carpenter wrote: > "pasid_state->device_state" and "dev_state" are the same, but it's nicer > to use dev_state consistently. > > Signed-off-by: Dan Carpenter Applied, thanks. ___ iommu mailing list iommu@li

Re: [PATCH] iommu/fsl: Really fix init section(s) content

2015-03-03 Thread Joerg Roedel
On Thu, Feb 12, 2015 at 03:45:28PM -0600, Emil Medve wrote: > '0f1fb99 iommu/fsl: Fix section mismatch' was intended to address the modpost > warning and the potential crash. Crash which is actually easy to trigger with > a > 'unbind' followed by a 'bind' sequence. The fix is/ wrong as > fsl_of_pa

Re: [PATCH] CHROMIUM: iommu: rockchip: Make sure that page table state is coherent

2015-03-03 Thread Joerg Roedel
On Mon, Feb 09, 2015 at 08:19:21PM +0900, Tomasz Figa wrote: > Even though the code uses the dt_lock spin lock to serialize mapping > operation from different threads, it does not protect from IOMMU > accesses that might be already taking place and thus altering state > of the IOTLB. This means tha

Re: [PATCH 1/1] iommu/vt-d: Convert non-returned local variable to boolean when relevant

2015-03-03 Thread Joerg Roedel
On Fri, Feb 06, 2015 at 10:59:53AM +0100, Quentin Lambert wrote: > drivers/iommu/intel-iommu.c | 13 +++-- > drivers/iommu/intel_irq_remapping.c | 12 ++-- > 2 files changed, 13 insertions(+), 12 deletions(-) Applied, thanks. __

Re: [RFC PATCH v2 3/3] arm64: hook up IOMMU dma_ops

2015-03-03 Thread Robin Murphy
On 03/03/15 11:05, leizhen wrote: On 2015/2/6 22:55, Robin Murphy wrote: With iommu_dma_ops in place, hook them up to the configuration code, so IOMMU-fronted devices will get them automatically. Signed-off-by: Robin Murphy --- arch/arm64/Kconfig | 1 + arch/arm64/include

Re: [PATCH v2] iommu/io-pgtable-arm: Add built time dependency

2015-03-03 Thread Joerg Roedel
On Mon, Feb 23, 2015 at 10:05:21AM +0100, Jean Delvare wrote: > If io-pgtable-arm is an ARM-specific driver then configuration option > IOMMU_IO_PGTABLE_LPAE should not be presented to the user by default > for non-ARM kernels. > > Signed-off-by: Jean Delvare > Cc: Will Deacon > Cc: Joerg Roedel

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-03 Thread Robin Murphy
On 03/03/15 03:38, Yong Wu wrote: On Mon, 2015-02-16 at 20:04 +, Robin Murphy wrote: 2)int (*domain_init)(struct iommu_domain *domain); About this function, it will alloc pagetable for the iommu domain. And We expect the pagetable memory is uncacheable, so try to call "dma_a

Re: [RFC PATCH v2 3/3] arm64: hook up IOMMU dma_ops

2015-03-03 Thread leizhen
On 2015/2/6 22:55, Robin Murphy wrote: > With iommu_dma_ops in place, hook them up to the configuration code, so > IOMMU-fronted devices will get them automatically. > > Signed-off-by: Robin Murphy > --- > arch/arm64/Kconfig | 1 + > arch/arm64/include/asm/dma-mapping.h | 11 +

Re: [PATCH v14 00/20] VFIO support for platform devices

2015-03-03 Thread Baptiste Reynal
Added Eric Auger for comments. On Mon, Mar 2, 2015 at 5:59 PM, Baptiste Reynal < b.rey...@virtualopensystems.com> wrote: > This patch series aims to implement VFIO support for platform devices that > reside behind an IOMMU. Examples of such devices are devices behind an ARM > SMMU, or behind a Sa

Re: [PATCH v4 0/5] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-03 Thread Baptiste Reynal
Added Eric Auger for comments. On Mon, Mar 2, 2015 at 5:58 PM, Baptiste Reynal < b.rey...@virtualopensystems.com> wrote: > This patch series makes the VFIO_IOMMU_TYPE1 driver buildable on ARM, so it > may be used with ARM SMMUs. It also adds support for the IOMMU_NOEXEC flag > supported by SMMUs

Re: [PATCH 1/1] iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS condition

2015-03-03 Thread Baptiste Reynal
Good point, I didn't thought about it. I will publish a new version with your modifications. Thanks On Mon, Mar 2, 2015 at 6:24 PM, Will Deacon wrote: > On Mon, Mar 02, 2015 at 04:57:22PM +, Baptiste Reynal wrote: > > This patch is a fix to "iommu/arm-smmu: add support for iova_to_phys > >