Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 2 | #include <linux/smp.h> |
Ankur Arora | ae03900 | 2017-06-02 17:06:02 -0700 | [diff] [blame] | 3 | #include <linux/cpu.h> |
Vitaly Kuznetsov | 83b9679 | 2017-03-14 18:35:46 +0100 | [diff] [blame] | 4 | #include <linux/slab.h> |
| 5 | #include <linux/cpumask.h> |
| 6 | #include <linux/percpu.h> |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 7 | |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 8 | #include <xen/events.h> |
| 9 | |
Konrad Rzeszutek Wilk | ed467e6 | 2011-09-01 09:48:27 -0400 | [diff] [blame] | 10 | #include <xen/hvc-console.h> |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 11 | #include "xen-ops.h" |
Mukesh Rathor | a2ef5dc | 2014-09-10 16:36:06 -0700 | [diff] [blame] | 12 | #include "smp.h" |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 13 | |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 14 | static DEFINE_PER_CPU(struct xen_common_irq, xen_resched_irq) = { .irq = -1 }; |
| 15 | static DEFINE_PER_CPU(struct xen_common_irq, xen_callfunc_irq) = { .irq = -1 }; |
| 16 | static DEFINE_PER_CPU(struct xen_common_irq, xen_callfuncsingle_irq) = { .irq = -1 }; |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 17 | static DEFINE_PER_CPU(struct xen_common_irq, xen_debug_irq) = { .irq = -1 }; |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 18 | |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 19 | static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id); |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 20 | static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id); |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 21 | |
| 22 | /* |
Peter Zijlstra | 184748c | 2011-04-05 17:23:39 +0200 | [diff] [blame] | 23 | * Reschedule call back. |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 24 | */ |
| 25 | static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id) |
| 26 | { |
Brian Gerst | 1b437c8 | 2009-01-19 00:38:57 +0900 | [diff] [blame] | 27 | inc_irq_stat(irq_resched_count); |
Peter Zijlstra | 184748c | 2011-04-05 17:23:39 +0200 | [diff] [blame] | 28 | scheduler_ipi(); |
Jeremy Fitzhardinge | 38bb5ab | 2008-05-26 23:31:16 +0100 | [diff] [blame] | 29 | |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 30 | return IRQ_HANDLED; |
| 31 | } |
| 32 | |
Boris Ostrovsky | 5fc509b | 2016-08-03 13:22:27 -0400 | [diff] [blame] | 33 | void xen_smp_intr_free(unsigned int cpu) |
Konrad Rzeszutek Wilk | 53b94fd | 2013-06-04 16:31:34 -0400 | [diff] [blame] | 34 | { |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 35 | if (per_cpu(xen_resched_irq, cpu).irq >= 0) { |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 36 | unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu).irq, NULL); |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 37 | per_cpu(xen_resched_irq, cpu).irq = -1; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 38 | kfree(per_cpu(xen_resched_irq, cpu).name); |
| 39 | per_cpu(xen_resched_irq, cpu).name = NULL; |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 40 | } |
| 41 | if (per_cpu(xen_callfunc_irq, cpu).irq >= 0) { |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 42 | unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu).irq, NULL); |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 43 | per_cpu(xen_callfunc_irq, cpu).irq = -1; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 44 | kfree(per_cpu(xen_callfunc_irq, cpu).name); |
| 45 | per_cpu(xen_callfunc_irq, cpu).name = NULL; |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 46 | } |
| 47 | if (per_cpu(xen_debug_irq, cpu).irq >= 0) { |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 48 | unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu).irq, NULL); |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 49 | per_cpu(xen_debug_irq, cpu).irq = -1; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 50 | kfree(per_cpu(xen_debug_irq, cpu).name); |
| 51 | per_cpu(xen_debug_irq, cpu).name = NULL; |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 52 | } |
| 53 | if (per_cpu(xen_callfuncsingle_irq, cpu).irq >= 0) { |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 54 | unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu).irq, |
Konrad Rzeszutek Wilk | 53b94fd | 2013-06-04 16:31:34 -0400 | [diff] [blame] | 55 | NULL); |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 56 | per_cpu(xen_callfuncsingle_irq, cpu).irq = -1; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 57 | kfree(per_cpu(xen_callfuncsingle_irq, cpu).name); |
| 58 | per_cpu(xen_callfuncsingle_irq, cpu).name = NULL; |
Konrad Rzeszutek Wilk | ee336e1 | 2013-06-04 16:42:29 -0400 | [diff] [blame] | 59 | } |
Vitaly Kuznetsov | 04e9576 | 2017-03-14 18:35:42 +0100 | [diff] [blame] | 60 | } |
Konrad Rzeszutek Wilk | 53b94fd | 2013-06-04 16:31:34 -0400 | [diff] [blame] | 61 | |
Boris Ostrovsky | 5fc509b | 2016-08-03 13:22:27 -0400 | [diff] [blame] | 62 | int xen_smp_intr_init(unsigned int cpu) |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 63 | { |
| 64 | int rc; |
Vitaly Kuznetsov | 04e9576 | 2017-03-14 18:35:42 +0100 | [diff] [blame] | 65 | char *resched_name, *callfunc_name, *debug_name; |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 66 | |
| 67 | resched_name = kasprintf(GFP_KERNEL, "resched%d", cpu); |
| 68 | rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR, |
| 69 | cpu, |
| 70 | xen_reschedule_interrupt, |
Michael Opdenacker | 9d71cee | 2013-09-07 08:46:49 +0200 | [diff] [blame] | 71 | IRQF_PERCPU|IRQF_NOBALANCING, |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 72 | resched_name, |
| 73 | NULL); |
| 74 | if (rc < 0) |
| 75 | goto fail; |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 76 | per_cpu(xen_resched_irq, cpu).irq = rc; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 77 | per_cpu(xen_resched_irq, cpu).name = resched_name; |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 78 | |
| 79 | callfunc_name = kasprintf(GFP_KERNEL, "callfunc%d", cpu); |
| 80 | rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR, |
| 81 | cpu, |
| 82 | xen_call_function_interrupt, |
Michael Opdenacker | 9d71cee | 2013-09-07 08:46:49 +0200 | [diff] [blame] | 83 | IRQF_PERCPU|IRQF_NOBALANCING, |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 84 | callfunc_name, |
| 85 | NULL); |
| 86 | if (rc < 0) |
| 87 | goto fail; |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 88 | per_cpu(xen_callfunc_irq, cpu).irq = rc; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 89 | per_cpu(xen_callfunc_irq, cpu).name = callfunc_name; |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 90 | |
Jeremy Fitzhardinge | ee523ca | 2008-03-17 16:37:18 -0700 | [diff] [blame] | 91 | debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu); |
| 92 | rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt, |
Michael Opdenacker | 9d71cee | 2013-09-07 08:46:49 +0200 | [diff] [blame] | 93 | IRQF_PERCPU | IRQF_NOBALANCING, |
Jeremy Fitzhardinge | ee523ca | 2008-03-17 16:37:18 -0700 | [diff] [blame] | 94 | debug_name, NULL); |
| 95 | if (rc < 0) |
| 96 | goto fail; |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 97 | per_cpu(xen_debug_irq, cpu).irq = rc; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 98 | per_cpu(xen_debug_irq, cpu).name = debug_name; |
Jeremy Fitzhardinge | ee523ca | 2008-03-17 16:37:18 -0700 | [diff] [blame] | 99 | |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 100 | callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu); |
| 101 | rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR, |
| 102 | cpu, |
| 103 | xen_call_function_single_interrupt, |
Michael Opdenacker | 9d71cee | 2013-09-07 08:46:49 +0200 | [diff] [blame] | 104 | IRQF_PERCPU|IRQF_NOBALANCING, |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 105 | callfunc_name, |
| 106 | NULL); |
| 107 | if (rc < 0) |
| 108 | goto fail; |
Konrad Rzeszutek Wilk | 9547689 | 2013-06-04 16:37:44 -0400 | [diff] [blame] | 109 | per_cpu(xen_callfuncsingle_irq, cpu).irq = rc; |
Konrad Rzeszutek Wilk | b85fffe | 2013-06-04 16:47:17 -0400 | [diff] [blame] | 110 | per_cpu(xen_callfuncsingle_irq, cpu).name = callfunc_name; |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 111 | |
Vitaly Kuznetsov | 04e9576 | 2017-03-14 18:35:42 +0100 | [diff] [blame] | 112 | return 0; |
| 113 | |
| 114 | fail: |
| 115 | xen_smp_intr_free(cpu); |
| 116 | return rc; |
| 117 | } |
| 118 | |
Ankur Arora | ae03900 | 2017-06-02 17:06:02 -0700 | [diff] [blame] | 119 | void __init xen_smp_cpus_done(unsigned int max_cpus) |
| 120 | { |
| 121 | int cpu, rc, count = 0; |
| 122 | |
| 123 | if (xen_hvm_domain()) |
| 124 | native_smp_cpus_done(max_cpus); |
Prarit Bhargava | 63e708f | 2018-02-07 18:49:23 -0500 | [diff] [blame] | 125 | else |
| 126 | calculate_max_logical_packages(); |
Ankur Arora | ae03900 | 2017-06-02 17:06:02 -0700 | [diff] [blame] | 127 | |
| 128 | if (xen_have_vcpu_info_placement) |
| 129 | return; |
| 130 | |
| 131 | for_each_online_cpu(cpu) { |
| 132 | if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS) |
| 133 | continue; |
| 134 | |
| 135 | rc = cpu_down(cpu); |
| 136 | |
| 137 | if (rc == 0) { |
| 138 | /* |
| 139 | * Reset vcpu_info so this cpu cannot be onlined again. |
| 140 | */ |
| 141 | xen_vcpu_info_reset(cpu); |
| 142 | count++; |
| 143 | } else { |
| 144 | pr_warn("%s: failed to bring CPU %d down, error %d\n", |
| 145 | __func__, cpu, rc); |
| 146 | } |
| 147 | } |
| 148 | WARN(count, "%s: brought %d CPUs offline\n", __func__, count); |
| 149 | } |
| 150 | |
Vitaly Kuznetsov | a52482d | 2017-03-14 18:35:45 +0100 | [diff] [blame] | 151 | void xen_smp_send_reschedule(int cpu) |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 152 | { |
| 153 | xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR); |
| 154 | } |
| 155 | |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 156 | static void __xen_send_IPI_mask(const struct cpumask *mask, |
| 157 | int vector) |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 158 | { |
| 159 | unsigned cpu; |
| 160 | |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 161 | for_each_cpu_and(cpu, mask, cpu_online_mask) |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 162 | xen_send_IPI_one(cpu, vector); |
| 163 | } |
| 164 | |
Vitaly Kuznetsov | a52482d | 2017-03-14 18:35:45 +0100 | [diff] [blame] | 165 | void xen_smp_send_call_function_ipi(const struct cpumask *mask) |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 166 | { |
| 167 | int cpu; |
| 168 | |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 169 | __xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR); |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 170 | |
| 171 | /* Make sure other vcpus get a chance to run if they need to. */ |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 172 | for_each_cpu(cpu, mask) { |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 173 | if (xen_vcpu_stolen(cpu)) { |
Hannes Eder | 1207cf8e | 2009-03-05 20:13:57 +0100 | [diff] [blame] | 174 | HYPERVISOR_sched_op(SCHEDOP_yield, NULL); |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 175 | break; |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
Vitaly Kuznetsov | a52482d | 2017-03-14 18:35:45 +0100 | [diff] [blame] | 180 | void xen_smp_send_call_function_single_ipi(int cpu) |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 181 | { |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 182 | __xen_send_IPI_mask(cpumask_of(cpu), |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 183 | XEN_CALL_FUNCTION_SINGLE_VECTOR); |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 184 | } |
| 185 | |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 186 | static inline int xen_map_vector(int vector) |
| 187 | { |
| 188 | int xen_vector; |
| 189 | |
| 190 | switch (vector) { |
| 191 | case RESCHEDULE_VECTOR: |
| 192 | xen_vector = XEN_RESCHEDULE_VECTOR; |
| 193 | break; |
| 194 | case CALL_FUNCTION_VECTOR: |
| 195 | xen_vector = XEN_CALL_FUNCTION_VECTOR; |
| 196 | break; |
| 197 | case CALL_FUNCTION_SINGLE_VECTOR: |
| 198 | xen_vector = XEN_CALL_FUNCTION_SINGLE_VECTOR; |
| 199 | break; |
Lin Ming | 1ff2b0c | 2012-04-21 00:11:05 +0800 | [diff] [blame] | 200 | case IRQ_WORK_VECTOR: |
| 201 | xen_vector = XEN_IRQ_WORK_VECTOR; |
| 202 | break; |
Konrad Rzeszutek Wilk | 6efa20e | 2013-07-19 11:51:31 -0400 | [diff] [blame] | 203 | #ifdef CONFIG_X86_64 |
| 204 | case NMI_VECTOR: |
| 205 | case APIC_DM_NMI: /* Some use that instead of NMI_VECTOR */ |
| 206 | xen_vector = XEN_NMI_VECTOR; |
| 207 | break; |
| 208 | #endif |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 209 | default: |
| 210 | xen_vector = -1; |
| 211 | printk(KERN_ERR "xen: vector 0x%x is not implemented\n", |
| 212 | vector); |
| 213 | } |
| 214 | |
| 215 | return xen_vector; |
| 216 | } |
| 217 | |
| 218 | void xen_send_IPI_mask(const struct cpumask *mask, |
| 219 | int vector) |
| 220 | { |
| 221 | int xen_vector = xen_map_vector(vector); |
| 222 | |
| 223 | if (xen_vector >= 0) |
| 224 | __xen_send_IPI_mask(mask, xen_vector); |
| 225 | } |
| 226 | |
| 227 | void xen_send_IPI_all(int vector) |
| 228 | { |
| 229 | int xen_vector = xen_map_vector(vector); |
| 230 | |
| 231 | if (xen_vector >= 0) |
| 232 | __xen_send_IPI_mask(cpu_online_mask, xen_vector); |
| 233 | } |
| 234 | |
| 235 | void xen_send_IPI_self(int vector) |
| 236 | { |
| 237 | int xen_vector = xen_map_vector(vector); |
| 238 | |
| 239 | if (xen_vector >= 0) |
| 240 | xen_send_IPI_one(smp_processor_id(), xen_vector); |
| 241 | } |
| 242 | |
| 243 | void xen_send_IPI_mask_allbutself(const struct cpumask *mask, |
| 244 | int vector) |
| 245 | { |
| 246 | unsigned cpu; |
| 247 | unsigned int this_cpu = smp_processor_id(); |
Stefan Bader | 1db01b4 | 2013-05-08 16:37:35 +0200 | [diff] [blame] | 248 | int xen_vector = xen_map_vector(vector); |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 249 | |
Stefan Bader | 1db01b4 | 2013-05-08 16:37:35 +0200 | [diff] [blame] | 250 | if (!(num_online_cpus() > 1) || (xen_vector < 0)) |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 251 | return; |
| 252 | |
| 253 | for_each_cpu_and(cpu, mask, cpu_online_mask) { |
| 254 | if (this_cpu == cpu) |
| 255 | continue; |
| 256 | |
Stefan Bader | 1db01b4 | 2013-05-08 16:37:35 +0200 | [diff] [blame] | 257 | xen_send_IPI_one(cpu, xen_vector); |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 258 | } |
| 259 | } |
| 260 | |
| 261 | void xen_send_IPI_allbutself(int vector) |
| 262 | { |
Stefan Bader | 1db01b4 | 2013-05-08 16:37:35 +0200 | [diff] [blame] | 263 | xen_send_IPI_mask_allbutself(cpu_online_mask, vector); |
Ben Guthro | f447d56 | 2012-04-21 00:11:04 +0800 | [diff] [blame] | 264 | } |
| 265 | |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 266 | static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id) |
| 267 | { |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 268 | irq_enter(); |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 269 | generic_smp_call_function_interrupt(); |
Brian Gerst | 1b437c8 | 2009-01-19 00:38:57 +0900 | [diff] [blame] | 270 | inc_irq_stat(irq_call_count); |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 271 | irq_exit(); |
| 272 | |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 273 | return IRQ_HANDLED; |
| 274 | } |
| 275 | |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 276 | static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id) |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 277 | { |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 278 | irq_enter(); |
| 279 | generic_smp_call_function_single_interrupt(); |
Brian Gerst | 1b437c8 | 2009-01-19 00:38:57 +0900 | [diff] [blame] | 280 | inc_irq_stat(irq_call_count); |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 281 | irq_exit(); |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 282 | |
Jens Axboe | 3b16cf8 | 2008-06-26 11:21:54 +0200 | [diff] [blame] | 283 | return IRQ_HANDLED; |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 284 | } |