diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-03-30 14:47:00 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-05-07 08:34:59 -0400 |
commit | 736baef4472d00574089f295bc759ac002b9558c (patch) | |
tree | d4c9c69b1a0eecd6d87b3378a27396384e4b08f0 /arch/x86/kernel/apic/apic.c | |
parent | eef93fdb7cd41ae36794db0e765059dc1039e940 (diff) |
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>
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index edc24480469f..1db6f63a22ff 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/smp.h> | 35 | #include <linux/smp.h> |
36 | #include <linux/mm.h> | 36 | #include <linux/mm.h> |
37 | 37 | ||
38 | #include <asm/intr_remapping.h> | ||
38 | #include <asm/perf_event.h> | 39 | #include <asm/perf_event.h> |
39 | #include <asm/x86_init.h> | 40 | #include <asm/x86_init.h> |
40 | #include <asm/pgalloc.h> | 41 | #include <asm/pgalloc.h> |
@@ -1528,7 +1529,7 @@ int __init enable_IR(void) | |||
1528 | return -1; | 1529 | return -1; |
1529 | } | 1530 | } |
1530 | 1531 | ||
1531 | return enable_intr_remapping(); | 1532 | return intr_hardware_enable(); |
1532 | #endif | 1533 | #endif |
1533 | return -1; | 1534 | return -1; |
1534 | } | 1535 | } |
@@ -1537,10 +1538,13 @@ void __init enable_IR_x2apic(void) | |||
1537 | { | 1538 | { |
1538 | unsigned long flags; | 1539 | unsigned long flags; |
1539 | int ret, x2apic_enabled = 0; | 1540 | int ret, x2apic_enabled = 0; |
1540 | int dmar_table_init_ret; | 1541 | int hardware_init_ret; |
1541 | 1542 | ||
1542 | dmar_table_init_ret = dmar_table_init(); | 1543 | /* Make sure irq_remap_ops are initialized */ |
1543 | if (dmar_table_init_ret && !x2apic_supported()) | 1544 | setup_intr_remapping(); |
1545 | |||
1546 | hardware_init_ret = intr_hardware_init(); | ||
1547 | if (hardware_init_ret && !x2apic_supported()) | ||
1544 | return; | 1548 | return; |
1545 | 1549 | ||
1546 | ret = save_ioapic_entries(); | 1550 | ret = save_ioapic_entries(); |
@@ -1556,7 +1560,7 @@ void __init enable_IR_x2apic(void) | |||
1556 | if (x2apic_preenabled && nox2apic) | 1560 | if (x2apic_preenabled && nox2apic) |
1557 | disable_x2apic(); | 1561 | disable_x2apic(); |
1558 | 1562 | ||
1559 | if (dmar_table_init_ret) | 1563 | if (hardware_init_ret) |
1560 | ret = -1; | 1564 | ret = -1; |
1561 | else | 1565 | else |
1562 | ret = enable_IR(); | 1566 | ret = enable_IR(); |