[PATCH 5/7] iommu/msm: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Joerg Roedel
Implement the attribute for the MSM IOMMU driver. Acked-by: David Brown dav...@codeaurora.org Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/msm_iommu.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index

[PATCH 3/7] iommu/vt-d: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Joerg Roedel
Implement the attribute for the Intel IOMMU driver. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/intel-iommu.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index b12af2f..6cb0791 100644 ---

[PATCH 2/7] iommu/amd: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Joerg Roedel
Implement the attribute itself and add the code for the AMD IOMMU driver. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |4 drivers/iommu/iommu.c | 19 --- include/linux/iommu.h |8 3 files changed, 28

[PATCH 4/7] iommu/omap: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Joerg Roedel
Implement the attribute for the OMAP IOMMU driver. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/omap-iommu.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index e70ee2b..d0b1234 100644 ---

[PATCH 6/7] iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Joerg Roedel
From: Hiroshi DOYU hd...@nvidia.com Implement the attribute for the Tegra IOMMU drivers. Signed-off-by: Hiroshi DOYU hd...@nvidia.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/tegra-gart.c |5 + drivers/iommu/tegra-smmu.c |5 + 2 files changed, 10

Re: Tegra-DRM: Tegra30: DMA mapping API

2012-07-11 Thread Joerg Roedel
Hi, On Tue, Jul 10, 2012 at 01:26:39PM +0300, Hiroshi Doyu wrote: http://lists.linuxfoundation.org/pipermail/iommu/2012-January/003531.html Do you have any plan to merge the above IOMMU: Make IOMMU-API ready for GART-like hardware? Tegra DRM seems to need that feature eventually. I just

Re: Tegra-DRM: Tegra30: DMA mapping API

2012-07-11 Thread Hiroshi Doyu
Hi Joerg, On Wed, 11 Jul 2012 12:58:27 +0200 Joerg Roedel joerg.roe...@amd.com wrote: Hi, On Tue, Jul 10, 2012 at 01:26:39PM +0300, Hiroshi Doyu wrote: http://lists.linuxfoundation.org/pipermail/iommu/2012-January/003531.html Do you have any plan to merge the above IOMMU: Make

RE: [PATCH 2/7] iommu/amd: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Sethi Varun-B16395
-Original Message- From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- boun...@lists.linux-foundation.org] On Behalf Of Joerg Roedel Sent: Wednesday, July 11, 2012 4:19 PM To: iommu@lists.linux-foundation.org Cc: linux-ker...@vger.kernel.org Subject: [PATCH 2/7]

Re: [PATCH 2/7] iommu/amd: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Joerg Roedel
Hi Sethi, On Wed, Jul 11, 2012 at 11:47:39AM +, Sethi Varun-B16395 wrote: I am currently working on upstreaming the Freescale IOMMU driver. As discussed (with Scott Wood) a while back, this representation of the GEOMETRY attribute doesn't go well with our IOMMU implementation. Our

[PATCH 01/27] x86/irq: Add data structure to keep AMD specific irq remapping information

2012-07-11 Thread Joerg Roedel
Add a data structure to store information the IOMMU driver can use to get from a 'struct irq_cfg' to the remapping entry. Cc: x...@kernel.org Cc: Yinghai Lu ying...@kernel.org Cc: Suresh Siddha suresh.b.sid...@intel.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com ---

[PATCH 06/27] iommu/amd: Move informational prinks out of iommu_enable

2012-07-11 Thread Joerg Roedel
This function will be called before the PCI subsystem is initialized. Therefore dev_name doen't work and IOMMU information can't be printed to the klog as before. Move the code to print that information to a later point where PCI initializtion has already happened. Signed-off-by: Joerg Roedel

[PATCH 03/27] iommu/amd: Fix sparse warnings

2012-07-11 Thread Joerg Roedel
A few sparse warnings fire in drivers/iommu/amd_iommu_init.c. Fix most of them with this patch. Also fix the sparse warnings in drivers/iommu/irq_remapping.c while at it. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |2 +-

[PATCH 14/27] iommu/amd: Allocate data structures to keep track of irq remapping tables

2012-07-11 Thread Joerg Roedel
To easily map device ids to interrupt remapping table entries a new lookup table is necessary. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu_init.c | 16 drivers/iommu/amd_iommu_types.h |9 + 2 files changed, 25 insertions(+) diff

[PATCH 09/27] iommu/amd: Move unmap_flush message to amd_iommu_init_dma_ops()

2012-07-11 Thread Joerg Roedel
The message belongs there anyway, so move it to that function. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |5 + drivers/iommu/amd_iommu_init.c |8 2 files changed, 5 insertions(+), 8 deletions(-) diff --git

[PATCH 04/27] iommu/amd: Use acpi_get_table instead of acpi_table_parse

2012-07-11 Thread Joerg Roedel
This makes it easier to propagate errors while parsing the IVRS table and makes the amd_iommu_init_err hack obsolete. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu_init.c | 118 ++-- 1 file changed, 66 insertions(+), 52

[PATCH 07/27] iommu/amd: Introduce early_amd_iommu_init routine

2012-07-11 Thread Joerg Roedel
Split out the code to parse the ACPI table and setup relevant data structures into a new function. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |1 - drivers/iommu/amd_iommu_init.c | 38 +++--- 2 files changed, 23

[PATCH 02/27] x86/irq: Introduce irq_cfg-remapped

2012-07-11 Thread Joerg Roedel
This flag will show whether the interrupt is remapped in a way that works for VT-d and AMD-Vi. Cc: x...@kernel.org Cc: Yinghai Lu ying...@kernel.org Cc: Suresh Siddha suresh.b.sid...@intel.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/include/asm/hw_irq.h |1 +

[PATCH 16/27] iommu/amd: Split device table initialization into irq and dma part

2012-07-11 Thread Joerg Roedel
When the IOMMU is enabled very early (as with irq-remapping) some devices are still in BIOS hand. When dma is blocked early this can cause lots of IO_PAGE_FAULTs. So delay the DMA initialization and do it right before the dma_ops are initialized. To be secure, block all interrupts by default when

[PATCH 15/27] iommu/amd: Check if IOAPIC information is correct

2012-07-11 Thread Joerg Roedel
When the IOAPIC information provided in the IVRS table is not correct or not complete the system may not boot at all when interrupt remapping is enabled. So check if this information is correct and print out a firmware bug message when it is not. Signed-off-by: Joerg Roedel joerg.roe...@amd.com

[PATCH 11/27] iommu/amd: Convert iommu initialization to state machine

2012-07-11 Thread Joerg Roedel
This step makes it very easy to keep track about the current intialization state of the iommu driver. With this change we can initialize the IOMMU hardware to a point where it can remap interrupts and later resume the initializion to enable dma remapping. Signed-off-by: Joerg Roedel

[PATCH 22/27] iommu/amd: Add call-back routine for HPET MSI

2012-07-11 Thread Joerg Roedel
Add a routine to setup a HPET MSI interrupt for remapping. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 9a24a1b..ac6e731

[PATCH 18/27] iommu/amd: Add IRTE invalidation routine

2012-07-11 Thread Joerg Roedel
Add routine to invalidate the IOMMU cache for interupt translations. Also include the IRTE caches when flushing all IOMMU caches. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c | 27 +++ drivers/iommu/amd_iommu_types.h |1 + 2

[PATCH 26/27] iommu/amd: Print message to system log when irq remapping is enabled

2012-07-11 Thread Joerg Roedel
Print an indicator to dmesg to easily find out if interrupt remapping is enabled of a given system. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu_init.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/amd_iommu_init.c

[PATCH 21/27] iommu/amd: Implement MSI routines for interrupt remapping

2012-07-11 Thread Joerg Roedel
Add routines to setup interrupt remapping for MSI interrupts. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c | 74 + 1 file changed, 74 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c

[PATCH 20/27] iommu/amd: Add IOAPIC remapping routines

2012-07-11 Thread Joerg Roedel
Add the routine to setup interrupt remapping for ioapic interrupts. Also add a routine to change the affinity of an irq and to free an irq allocation for interrupt remapping. The last two functions will also be used for MSI interrupts. Signed-off-by: Joerg Roedel joerg.roe...@amd.com ---

[PATCH 24/27] iommu/amd: Make sure irq remapping still works on dma init failure

2012-07-11 Thread Joerg Roedel
Do not deinitialize the AMD IOMMU driver completly when interrupt remapping is already in use but the initialization of the DMA layer fails for some reason. Make sure the IOMMU can still be used to remap interrupts. Signed-off-by: Joerg Roedel joerg.roe...@amd.com ---

[PATCH 17/27] iommu/amd: Make sure IOMMU is not considered to translate itself

2012-07-11 Thread Joerg Roedel
The IVRS table usually includes the IOMMU device. But the IOMMU does never translate itself, so make sure the IOMMU driver knows this. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu_init.c |7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 27/27] iommu/amd: Report irq remapping through IOMMU-API

2012-07-11 Thread Joerg Roedel
Report the availability of irq remapping through the IOMMU-API to allow KVM device passthrough again without additional module parameter overrides. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH 13/27] iommu/amd: Add slab-cache for irq remapping tables

2012-07-11 Thread Joerg Roedel
The irq remapping tables for the AMD IOMMU need to be aligned on a 128 byte boundary. Create a seperate slab-cache to guarantee this alignment. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |2 ++ drivers/iommu/amd_iommu_init.c | 23

RE: [PATCH 2/7] iommu/amd: Implement DOMAIN_ATTR_GEOMETRY attribute

2012-07-11 Thread Sethi Varun-B16395
-Original Message- From: Joerg Roedel [mailto:joerg.roe...@amd.com] Sent: Wednesday, July 11, 2012 5:47 PM To: Sethi Varun-B16395 Cc: iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org Subject: Re: [PATCH 2/7] iommu/amd: Implement DOMAIN_ATTR_GEOMETRY attribute Hi

Re: Tegra-DRM: Tegra30: DMA mapping API

2012-07-11 Thread markz
On Wed, 2012-07-11 at 19:42 +0800, Hiroshi Doyu wrote: Hi Joerg, On Wed, 11 Jul 2012 12:58:27 +0200 Joerg Roedel joerg.roe...@amd.com wrote: Hi, On Tue, Jul 10, 2012 at 01:26:39PM +0300, Hiroshi Doyu wrote: http://lists.linuxfoundation.org/pipermail/iommu/2012-January/003531.html

Re: Tegra-DRM: Tegra30: DMA mapping API

2012-07-11 Thread Hiroshi Doyu
On Thu, 12 Jul 2012 05:04:33 +0200 markz ma...@nvidia.com wrote: On Wed, 2012-07-11 at 19:42 +0800, Hiroshi Doyu wrote: Hi Joerg, On Wed, 11 Jul 2012 12:58:27 +0200 Joerg Roedel joerg.roe...@amd.com wrote: Hi, On Tue, Jul 10, 2012 at 01:26:39PM +0300, Hiroshi Doyu wrote: