iommu/vt-d: Make intr-remapping initialization generic

This patch introduces irq_remap_ops to hold implementation
specific function pointer to handle interrupt remapping. As
the first part the initialization functions for VT-d are
converted to these ops.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
Joerg Roedel
2012-03-30 11:47:00 -07:00
parent eef93fdb7c
commit 736baef447
11 changed files with 196 additions and 49 deletions

View File

@@ -35,6 +35,7 @@
#include <linux/smp.h>
#include <linux/mm.h>
#include <asm/intr_remapping.h>
#include <asm/perf_event.h>
#include <asm/x86_init.h>
#include <asm/pgalloc.h>
@@ -1528,7 +1529,7 @@ int __init enable_IR(void)
return -1;
}
return enable_intr_remapping();
return intr_hardware_enable();
#endif
return -1;
}
@@ -1537,10 +1538,13 @@ void __init enable_IR_x2apic(void)
{
unsigned long flags;
int ret, x2apic_enabled = 0;
int dmar_table_init_ret;
int hardware_init_ret;
dmar_table_init_ret = dmar_table_init();
if (dmar_table_init_ret && !x2apic_supported())
/* Make sure irq_remap_ops are initialized */
setup_intr_remapping();
hardware_init_ret = intr_hardware_init();
if (hardware_init_ret && !x2apic_supported())
return;
ret = save_ioapic_entries();
@@ -1556,7 +1560,7 @@ void __init enable_IR_x2apic(void)
if (x2apic_preenabled && nox2apic)
disable_x2apic();
if (dmar_table_init_ret)
if (hardware_init_ret)
ret = -1;
else
ret = enable_IR();

View File

@@ -57,6 +57,7 @@
#include <asm/msidef.h>
#include <asm/hypertransport.h>
#include <asm/setup.h>
#include <asm/intr_remapping.h>
#include <asm/irq_remapping.h>
#include <asm/hpet.h>
#include <asm/hw_irq.h>