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

2012-07-05 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 12/28] iommu/amd: Keep track of HPET and IOAPIC device ids

2012-07-05 Thread Joerg Roedel
The IVRS ACPI table provides information about the IOAPICs and the HPETs available in the system and which PCI device ID they use in transactions. Save that information for later usage in interrupt remapping. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c |

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

2012-07-05 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 13/28] iommu/amd: Add slab-cache for irq remapping tables

2012-07-05 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

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

2012-07-05 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 05/28] iommu/amd: Split out PCI related parts of IOMMU initialization

2012-07-05 Thread Joerg Roedel
For interrupt remapping the relevant IOMMU initialization needs to run earlier at boot when the PCI subsystem is not yet initialized. To support that this patch splits the parts of IOMMU initialization which need PCI accesses out of the initial setup path so that this can be done later.

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

2012-07-05 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 27/28] iommu/amd: Print message to system log when irq remapping is enabled

2012-07-05 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 04/28] iommu/amd: Use acpi_get_table instead of acpi_table_parse

2012-07-05 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 17/28] iommu/amd: Split device table initialization into irq and dma part

2012-07-05 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. Signed-off-by: Joerg Roedel joerg.roe...@amd.com

[PATCH 19/28] iommu/amd: Add IRTE invalidation routine

2012-07-05 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 15/28] iommu/amd: Check if IOAPIC information is correct

2012-07-05 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 26/28] iommu/irq: Use amd_iommu_irq_ops if supported

2012-07-05 Thread Joerg Roedel
Finally enable interrupt remapping for AMD systems. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/irq_remapping.c |5 + drivers/iommu/irq_remapping.h |1 + 2 files changed, 6 insertions(+) diff --git a/drivers/iommu/irq_remapping.c

[PATCH 22/28] iommu/amd: Implement MSI routines for interrupt remapping

2012-07-05 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 21/28] iommu/amd: Add IOAPIC remapping routines

2012-07-05 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 20/28] iommu/amd: Add routines to manage irq remapping tables

2012-07-05 Thread Joerg Roedel
Add routines to: * Alloc remapping tables and single entries from these tables * Change entries in the tables * Free entries in the table Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- drivers/iommu/amd_iommu.c | 230 + 1 file changed, 230

[PATCH 23/28] iommu/amd: Add call-back routine for HPET MSI

2012-07-05 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 ee10f30..fed1395

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

2012-07-05 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

[iommu:irq-remapping 7/28] WARNING: drivers/iommu/built-in.o(.text+0x617a): Section mismatch in reference from the function amd_iommu_init_pci() to the function .init.text:amd_iommu_init_devices()

2012-07-05 Thread wfg
Hi Joerg, There are new compile warnings show up in tree: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git irq-remapping head: afd6b14061a786c34b41722d35035d0eeecae55c commit: ac2ff05e6451271c6744e9c9d9742de40575dbce [7/28] iommu/amd: Introduce early_amd_iommu_init routine All

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

2012-07-05 Thread Joe Perches
On Thu, 2012-07-05 at 14:36 +0200, Joerg Roedel wrote: 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