12 #include <linux/export.h>
19 #include <asm/hw_irq.h>
32 if (printk_ratelimit())
33 pr_err(
"unexpected IRQ trap at vector %02x\n", irq);
47 #define irq_stats(x) (&per_cpu(irq_stat, x))
59 #ifdef CONFIG_X86_LOCAL_APIC
72 seq_printf(p,
" Performance monitoring interrupts\n");
103 #ifdef CONFIG_X86_THERMAL_VECTOR
109 #ifdef CONFIG_X86_MCE_THRESHOLD
113 seq_printf(p,
" Threshold APIC interrupts\n");
115 #ifdef CONFIG_X86_MCE
126 #if defined(CONFIG_X86_IO_APIC)
139 #ifdef CONFIG_X86_LOCAL_APIC
141 sum +=
irq_stats(cpu)->irq_spurious_count;
143 sum +=
irq_stats(cpu)->apic_irq_work_irqs;
144 sum +=
irq_stats(cpu)->icr_read_retry_count;
147 sum +=
irq_stats(cpu)->x86_platform_ipis;
149 sum +=
irq_stats(cpu)->irq_resched_count;
152 #ifdef CONFIG_X86_THERMAL_VECTOR
153 sum +=
irq_stats(cpu)->irq_thermal_count;
155 #ifdef CONFIG_X86_MCE_THRESHOLD
156 sum +=
irq_stats(cpu)->irq_threshold_count;
158 #ifdef CONFIG_X86_MCE
159 sum +=
per_cpu(mce_exception_count, cpu);
160 sum +=
per_cpu(mce_poll_count, cpu);
169 #ifdef CONFIG_X86_IO_APIC
183 struct pt_regs *old_regs = set_irq_regs(regs);
186 unsigned vector = ~regs->orig_ax;
197 if (printk_ratelimit())
198 pr_emerg(
"%s: %d.%d No irq handler for vector (irq %d)\n",
204 set_irq_regs(old_regs);
213 struct pt_regs *old_regs = set_irq_regs(regs);
228 set_irq_regs(old_regs);
233 #ifdef CONFIG_HOTPLUG_CPU
244 int break_affinity = 0;
245 int set_affinity = 1;
256 data = irq_desc_get_irq_data(desc);
258 if (!irq_has_action(irq) || irqd_is_per_cpu(data) ||
259 cpumask_subset(affinity, cpu_online_mask)) {
269 irq_force_complete_move(irq);
276 chip = irq_data_get_irq_chip(data);
277 if (!irqd_can_move_in_process_context(data) && chip->
irq_mask)
282 else if (!(warned++))
290 if (!irqd_can_move_in_process_context(data) &&
296 if (break_affinity && set_affinity)
297 pr_notice(
"Broke affinity for irq %i\n", irq);
298 else if (!set_affinity)
299 pr_notice(
"Cannot set affinity for irq %i\n", irq);
319 irr = apic_read(
APIC_IRR + (vector / 32 * 0x10));
320 if (irr & (1 << (vector % 32))) {
324 data = irq_desc_get_irq_data(desc);
325 chip = irq_data_get_irq_chip(data);