Commit a45525b5 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

x86/irq_work: Make it depend on APIC

The irq work interrupt vector is only installed when CONFIG_X86_LOCAL_APIC is
enabled, but the interrupt handler is compiled in unconditionally.

Compile the cruft out when the APIC is disabled.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170828064957.691909010@linutronix.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0428e01a
...@@ -3,9 +3,17 @@ ...@@ -3,9 +3,17 @@
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#ifdef CONFIG_X86_LOCAL_APIC
static inline bool arch_irq_work_has_interrupt(void) static inline bool arch_irq_work_has_interrupt(void)
{ {
return boot_cpu_has(X86_FEATURE_APIC); return boot_cpu_has(X86_FEATURE_APIC);
} }
extern void arch_irq_work_raise(void);
#else
static inline bool arch_irq_work_has_interrupt(void)
{
return false;
}
#endif
#endif /* _ASM_IRQ_WORK_H */ #endif /* _ASM_IRQ_WORK_H */
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <asm/trace/irq_vectors.h> #include <asm/trace/irq_vectors.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#ifdef CONFIG_X86_LOCAL_APIC
__visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) __visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs)
{ {
ipi_entering_ack_irq(); ipi_entering_ack_irq();
...@@ -23,11 +24,10 @@ __visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) ...@@ -23,11 +24,10 @@ __visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs)
void arch_irq_work_raise(void) void arch_irq_work_raise(void)
{ {
#ifdef CONFIG_X86_LOCAL_APIC
if (!arch_irq_work_has_interrupt()) if (!arch_irq_work_has_interrupt())
return; return;
apic->send_IPI_self(IRQ_WORK_VECTOR); apic->send_IPI_self(IRQ_WORK_VECTOR);
apic_wait_icr_idle(); apic_wait_icr_idle();
#endif
} }
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment