aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/irq_remapping.c
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2012-09-26 06:44:35 -0400
committerJoerg Roedel <joro@8bytes.org>2013-01-28 04:48:30 -0500
commit1c4248ca4e783e47cc34e313d9f82b4ea52774cc (patch)
treee64dba1b95ad1ed8bbf6b3bb6cd0ec893d3c7d9c /drivers/iommu/irq_remapping.c
parent336224ba5e4fb42a95d02ab0aa0fdff21649bb38 (diff)
x86, io_apic: Introduce x86_io_apic_ops.disable()
This function pointer is used to call a system-specific function for disabling the IO-APIC. Currently this is used for IRQ remapping which has its own disable routine. Also introduce the necessary infrastructure in the interrupt remapping code to overwrite this and other function pointers as necessary by interrupt remapping. Signed-off-by: Joerg Roedel <joro@8bytes.org> Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/iommu/irq_remapping.c')
-rw-r--r--drivers/iommu/irq_remapping.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 19381b90e619..db3dcaf4ddf0 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -1,3 +1,4 @@
1#include <linux/cpumask.h>
1#include <linux/kernel.h> 2#include <linux/kernel.h>
2#include <linux/string.h> 3#include <linux/string.h>
3#include <linux/cpumask.h> 4#include <linux/cpumask.h>
@@ -6,6 +7,9 @@
6 7
7#include <asm/hw_irq.h> 8#include <asm/hw_irq.h>
8#include <asm/irq_remapping.h> 9#include <asm/irq_remapping.h>
10#include <asm/processor.h>
11#include <asm/x86_init.h>
12#include <asm/apic.h>
9 13
10#include "irq_remapping.h" 14#include "irq_remapping.h"
11 15
@@ -17,6 +21,24 @@ int no_x2apic_optout;
17 21
18static struct irq_remap_ops *remap_ops; 22static struct irq_remap_ops *remap_ops;
19 23
24static void irq_remapping_disable_io_apic(void)
25{
26 /*
27 * With interrupt-remapping, for now we will use virtual wire A
28 * mode, as virtual wire B is little complex (need to configure
29 * both IOAPIC RTE as well as interrupt-remapping table entry).
30 * As this gets called during crash dump, keep this simple for
31 * now.
32 */
33 if (cpu_has_apic || apic_from_smp_config())
34 disconnect_bsp_APIC(0);
35}
36
37static void __init irq_remapping_modify_x86_ops(void)
38{
39 x86_io_apic_ops.disable = irq_remapping_disable_io_apic;
40}
41
20static __init int setup_nointremap(char *str) 42static __init int setup_nointremap(char *str)
21{ 43{
22 disable_irq_remap = 1; 44 disable_irq_remap = 1;
@@ -79,10 +101,17 @@ int __init irq_remapping_prepare(void)
79 101
80int __init irq_remapping_enable(void) 102int __init irq_remapping_enable(void)
81{ 103{
104 int ret;
105
82 if (!remap_ops || !remap_ops->enable) 106 if (!remap_ops || !remap_ops->enable)
83 return -ENODEV; 107 return -ENODEV;
84 108
85 return remap_ops->enable(); 109 ret = remap_ops->enable();
110
111 if (irq_remapping_enabled)
112 irq_remapping_modify_x86_ops();
113
114 return ret;
86} 115}
87 116
88void irq_remapping_disable(void) 117void irq_remapping_disable(void)