Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-30 Thread Murali Karicheri
On 01/29/2015 07:24 PM, Laurent Pinchart wrote: Hi Rob, On Thursday 29 January 2015 10:49:38 Rob Herring wrote: On Wed, Jan 28, 2015 at 5:32 PM, Laurent Pinchart wrote: On Wednesday 28 January 2015 13:32:19 Will Deacon wrote: On Wed, Jan 28, 2015 at 01:15:10PM +, Laurent Pinchart wrote:

dma_alloc_coherent - cma - and IOMMU question

2015-01-30 Thread Mark Hounschell
I've posted the following email to vger.kernel.org but got no response. I am trying to adapt some of our out of kernel GPL drivers to use the AMD IOMMU. Here is what I posted to LKML start quote Sorry for the noise. I've read everything DMA in the kernel Doc dir and searched the web to no avail.

Re: dma_alloc_coherent - cma - and IOMMU question

2015-01-30 Thread Alex Williamson
On Fri, 2015-01-30 at 19:12 +, Mark Hounschell wrote: I've posted the following email to vger.kernel.org but got no response. I am trying to adapt some of our out of kernel GPL drivers to use the AMD IOMMU. Here is what I posted to LKML start quote Sorry for the noise. I've read

Re: dma_alloc_coherent - cma - and IOMMU question

2015-01-30 Thread Alex Williamson
On Fri, 2015-01-30 at 16:07 -0500, Mark Hounschell wrote: On 01/30/2015 03:11 PM, Alex Williamson wrote: On Fri, 2015-01-30 at 19:12 +, Mark Hounschell wrote: I've posted the following email to vger.kernel.org but got no response. I am trying to adapt some of our out of kernel GPL

Re: dma_alloc_coherent - cma - and IOMMU question

2015-01-30 Thread Mark Hounschell
On 01/30/2015 03:11 PM, Alex Williamson wrote: On Fri, 2015-01-30 at 19:12 +, Mark Hounschell wrote: I've posted the following email to vger.kernel.org but got no response. I am trying to adapt some of our out of kernel GPL drivers to use the AMD IOMMU. Here is what I posted to LKML

[PATCH] iommu: arm-smmu: avoid build warning

2015-01-30 Thread Arnd Bergmann
ARM allmodconfig gained a new warning when dma_addr_t is 32-bit wide: drivers/iommu/arm-smmu.c: In function 'arm_smmu_iova_to_phys_hard': drivers/iommu/arm-smmu.c:1255:3: warning: right shift count = width of type This changes the calculation so that the effective type is always 64-bit.

Re: [v3 21/26] x86, irq: Define a global vector for VT-d Posted-Interrupts

2015-01-30 Thread H. Peter Anvin
On 12/12/2014 07:14 AM, Feng Wu wrote: Currently, we use a global vector as the Posted-Interrupts Notification Event for all the vCPUs in the system. We need to introduce another global vector for VT-d Posted-Interrtups, which will be used to wakeup the sleep vCPU when an external interrupt

RE: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

2015-01-30 Thread Varun Sethi
Hi Emil, -Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Friday, January 30, 2015 7:49 PM To: Sethi Varun-B16395; iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de Subject: Re: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

RE: [PATCH 00/26] iommu/fsl: Various cleanup

2015-01-30 Thread Varun Sethi
Hi Joerg, -Original Message- From: Joerg Roedel [mailto:j...@8bytes.org] Sent: Friday, January 30, 2015 6:01 PM To: Medve Emilian-EMMEDVE1 Cc: iommu@lists.linux-foundation.org; jroe...@suse.de; Sethi Varun-B16395 Subject: Re: [PATCH 00/26] iommu/fsl: Various cleanup Varun, On

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

2015-01-30 Thread Varun Sethi
Hi Emil, -Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Friday, January 30, 2015 12:26 PM To: Sethi Varun-B16395; iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*

RE: [PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 18/26] iommu/fsl: Fix checkpatch

RE: [PATCH 24/26] iommu/fsl: Remove unneeded semicolon

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 24/26] iommu/fsl: Remove

RE: [PATCH 23/26] iommu/fsl: Use NULL instead of zero

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 23/26] iommu/fsl: Use NULL

RE: [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 20/26] iommu/fsl: Fix alignment

RE: [PATCH 26/26] iommu/fsl: Remove extra paranthesis

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 26/26] iommu/fsl: Remove extra

RE: [PATCH 19/26] iommu/fsl: Fix some comments alignment

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 19/26] iommu/fsl: Fix some

RE: [PATCH 25/26] iommu/fsl: Don't use integers values with bool type

2015-01-30 Thread Varun Sethi
-Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 25/26] iommu/fsl: Don't use

RE: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

2015-01-30 Thread Varun Sethi
Hi Emil, -Original Message- From: Emil Medve [mailto:emilian.me...@freescale.com] Sent: Wednesday, January 28, 2015 8:05 PM To: iommu@lists.linux-foundation.org; j...@8bytes.org; jroe...@suse.de; Sethi Varun-B16395 Cc: Medve Emilian-EMMEDVE1 Subject: [PATCH 11/26] iommu/fsl: Fix

Re: [PATCH 3/5] iommu: Limit iommu_attach/detach_device to devices with their own group

2015-01-30 Thread Joerg Roedel
On Wed, Jan 28, 2015 at 02:35:24PM +, Will Deacon wrote: On Tue, Jan 27, 2015 at 12:08:57AM +, Joerg Roedel wrote: @@ -51,6 +51,7 @@ struct iommu_group { void (*iommu_data_release)(void *iommu_data); char *name; int id; + unsigned dev_cnt; Is this actually used

Re: [PATCH 4/5] iommu: Make sure a device is always attached to a domain

2015-01-30 Thread Joerg Roedel
On Wed, Jan 28, 2015 at 02:38:52PM +, Will Deacon wrote: On Tue, Jan 27, 2015 at 12:08:58AM +, Joerg Roedel wrote: - return iommu_group_for_each_dev(group, domain, - iommu_group_do_attach_device); + int ret; + + if (group-default_domain

[PATCH v13 04/18] vfio/platform: return info for bound device

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com A VFIO userspace driver will start by opening the VFIO device that corresponds to an IOMMU group, and will use the ioctl interface to get the basic device info, such as number of memory regions and interrupts, and their properties. This

[PATCH v13 05/18] vfio/platform: return info for device memory mapped IO regions

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com ---

[PATCH v13 06/18] vfio/platform: read and write support for the device fd

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com VFIO returns a file descriptor which we can use to manipulate the memory regions of the device. Usually, the user will mmap memory regions that are addressable on page boundaries, however for memory regions where this is not the case we

[PATCH v13 17/18] vfio: initialize the virqfd workqueue in VFIO generic code

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com Now we have finally completely decoupled virqfd from VFIO_PCI. We can initialize it from the VFIO generic code, in order to safely use it from multiple independent VFIO bus drivers. Signed-off-by: Antonios Motakis

[PATCH v13 18/18] vfio/platform: implement IRQ masking/unmasking via an eventfd

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com With this patch the VFIO user will be able to set an eventfd that can be used in order to mask and unmask IRQs of platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com ---

[PATCH v13 15/18] vfio: pass an opaque pointer on virqfd initialization

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com VFIO_PCI passes the VFIO device structure *vdev via eventfd to the handler that implements masking/unmasking of IRQs via an eventfd. We can replace it in the virqfd infrastructure with an opaque type so we can make use of the mechanism from

[PATCH v13 16/18] vfio: move eventfd support code for VFIO_PCI to a separate file

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com The virqfd functionality that is used by VFIO_PCI to implement interrupt masking and unmasking via an eventfd, is generic enough and can be reused by another driver. Move it to a separate file in order to allow the code to be shared.

Re: [PATCH] iommu/ipmmu-vmsa: Fix IOMMU lookup when multiple IOMMUs are registered

2015-01-30 Thread Joerg Roedel
On Sat, Jan 24, 2015 at 11:13:50PM +0200, Laurent Pinchart wrote: When adding a new device the driver loops over all registered IOMMUs and calls the ipmmu_find_utlbs() function to parse the DT iommus attribute. The function returns an error when the IOMMU referenced in DT doesn't match the

[PATCH v13 02/18] vfio: platform: probe to devices on the platform bus

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com Driver to bind to Linux platform devices, and callbacks to discover their resources to be used by the main VFIO PLATFORM code. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform.c | 103

[PATCH v13 08/18] vfio/platform: return IRQ info

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com Return information for the interrupts exposed by the device. This patch extends VFIO_DEVICE_GET_INFO with the number of IRQs and enables VFIO_DEVICE_GET_IRQ_INFO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com ---

[PATCH v13 09/18] vfio/platform: initial interrupts support code

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis a.mota...@virtualopensystems.com This patch is a skeleton for the VFIO_DEVICE_SET_IRQS IOCTL, around which most IRQ functionality is implemented in VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c |

Re: [PATCH] iommu: disable on !MMU builds

2015-01-30 Thread Joerg Roedel
On Wed, Jan 28, 2015 at 03:45:53PM +0100, Arnd Bergmann wrote: A lot of the IOMMU support code does not build if the CPU does not have an MMU itself, and it's not clear if there is any use case for it, so let's just disable it and wait for anybody to need it. This avoids randconfig errors

Re: [PATCH 2/5] iommu: Allocate a default domain for iommu groups

2015-01-30 Thread Joerg Roedel
On Wed, Jan 28, 2015 at 02:30:06PM +, Will Deacon wrote: On Tue, Jan 27, 2015 at 12:08:56AM +, Joerg Roedel wrote: + if (group-default_domain == NULL) + group-default_domain = __iommu_domain_alloc(dev-bus, +