aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-06-04 16:37:44 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-06-10 08:43:30 -0400
commit9547689fcdf0b223967edcbbe588d9f0489ee5aa (patch)
tree6c793824fb12a92d1dc9763e2e1d6932a600009f /arch/x86/xen
parent53b94fdc8fa0ccd88f97b72a6149672d7ddc0c50 (diff)
xen/smp: Introduce a common structure to contain the IRQ name and interrupt line.
This patch adds a new structure to contain the common two things that each of the per-cpu interrupts need: - an interrupt number, - and the name of the interrupt (to be added in 'xen/smp: Don't leak interrupt name when offlining'). This allows us to carry the tuple of the per-cpu interrupt data structure and expand it as we need in the future. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/smp.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 19fc9f39e9cc..f5b29ecdf18d 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -39,11 +39,15 @@
39 39
40cpumask_var_t xen_cpu_initialized_map; 40cpumask_var_t xen_cpu_initialized_map;
41 41
42static DEFINE_PER_CPU(int, xen_resched_irq); 42struct xen_common_irq {
43static DEFINE_PER_CPU(int, xen_callfunc_irq); 43 int irq;
44static DEFINE_PER_CPU(int, xen_callfuncsingle_irq); 44 char *name;
45static DEFINE_PER_CPU(int, xen_irq_work); 45};
46static DEFINE_PER_CPU(int, xen_debug_irq) = -1; 46static DEFINE_PER_CPU(struct xen_common_irq, xen_resched_irq);
47static DEFINE_PER_CPU(struct xen_common_irq, xen_callfunc_irq);
48static DEFINE_PER_CPU(struct xen_common_irq, xen_callfuncsingle_irq);
49static DEFINE_PER_CPU(struct xen_common_irq, xen_irq_work);
50static DEFINE_PER_CPU(struct xen_common_irq, xen_debug_irq) = { .irq = -1 };
47 51
48static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id); 52static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id);
49static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id); 53static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id);
@@ -100,20 +104,20 @@ static void __cpuinit cpu_bringup_and_idle(void)
100 104
101static void xen_smp_intr_free(unsigned int cpu) 105static void xen_smp_intr_free(unsigned int cpu)
102{ 106{
103 if (per_cpu(xen_resched_irq, cpu) >= 0) 107 if (per_cpu(xen_resched_irq, cpu).irq >= 0)
104 unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL); 108 unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu).irq, NULL);
105 if (per_cpu(xen_callfunc_irq, cpu) >= 0) 109 if (per_cpu(xen_callfunc_irq, cpu).irq >= 0)
106 unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL); 110 unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu).irq, NULL);
107 if (per_cpu(xen_debug_irq, cpu) >= 0) 111 if (per_cpu(xen_debug_irq, cpu).irq >= 0)
108 unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL); 112 unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu).irq, NULL);
109 if (per_cpu(xen_callfuncsingle_irq, cpu) >= 0) 113 if (per_cpu(xen_callfuncsingle_irq, cpu).irq >= 0)
110 unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), 114 unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu).irq,
111 NULL); 115 NULL);
112 if (xen_hvm_domain()) 116 if (xen_hvm_domain())
113 return; 117 return;
114 118
115 if (per_cpu(xen_irq_work, cpu) >= 0) 119 if (per_cpu(xen_irq_work, cpu).irq >= 0)
116 unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL); 120 unbind_from_irqhandler(per_cpu(xen_irq_work, cpu).irq, NULL);
117}; 121};
118static int xen_smp_intr_init(unsigned int cpu) 122static int xen_smp_intr_init(unsigned int cpu)
119{ 123{
@@ -129,7 +133,7 @@ static int xen_smp_intr_init(unsigned int cpu)
129 NULL); 133 NULL);
130 if (rc < 0) 134 if (rc < 0)
131 goto fail; 135 goto fail;
132 per_cpu(xen_resched_irq, cpu) = rc; 136 per_cpu(xen_resched_irq, cpu).irq = rc;
133 137
134 callfunc_name = kasprintf(GFP_KERNEL, "callfunc%d", cpu); 138 callfunc_name = kasprintf(GFP_KERNEL, "callfunc%d", cpu);
135 rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR, 139 rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR,
@@ -140,7 +144,7 @@ static int xen_smp_intr_init(unsigned int cpu)
140 NULL); 144 NULL);
141 if (rc < 0) 145 if (rc < 0)
142 goto fail; 146 goto fail;
143 per_cpu(xen_callfunc_irq, cpu) = rc; 147 per_cpu(xen_callfunc_irq, cpu).irq = rc;
144 148
145 debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu); 149 debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
146 rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt, 150 rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt,
@@ -148,7 +152,7 @@ static int xen_smp_intr_init(unsigned int cpu)
148 debug_name, NULL); 152 debug_name, NULL);
149 if (rc < 0) 153 if (rc < 0)
150 goto fail; 154 goto fail;
151 per_cpu(xen_debug_irq, cpu) = rc; 155 per_cpu(xen_debug_irq, cpu).irq = rc;
152 156
153 callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu); 157 callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu);
154 rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR, 158 rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR,
@@ -159,7 +163,7 @@ static int xen_smp_intr_init(unsigned int cpu)
159 NULL); 163 NULL);
160 if (rc < 0) 164 if (rc < 0)
161 goto fail; 165 goto fail;
162 per_cpu(xen_callfuncsingle_irq, cpu) = rc; 166 per_cpu(xen_callfuncsingle_irq, cpu).irq = rc;
163 167
164 /* 168 /*
165 * The IRQ worker on PVHVM goes through the native path and uses the 169 * The IRQ worker on PVHVM goes through the native path and uses the
@@ -177,7 +181,7 @@ static int xen_smp_intr_init(unsigned int cpu)
177 NULL); 181 NULL);
178 if (rc < 0) 182 if (rc < 0)
179 goto fail; 183 goto fail;
180 per_cpu(xen_irq_work, cpu) = rc; 184 per_cpu(xen_irq_work, cpu).irq = rc;
181 185
182 return 0; 186 return 0;
183 187