Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Tell irq work about self IPI support

x86 supports irq work self-IPIs when local apic is available. This is
partly known on runtime so lets implement arch_irq_work_has_interrupt()
accordingly.

This should be safely called after setup_arch().

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>

+12 -2
-1
arch/x86/include/asm/Kbuild
··· 7 7 generic-y += clkdev.h 8 8 generic-y += cputime.h 9 9 generic-y += early_ioremap.h 10 - generic-y += irq_work.h 11 10 generic-y += mcs_spinlock.h 12 11 generic-y += scatterlist.h
+11
arch/x86/include/asm/irq_work.h
··· 1 + #ifndef _ASM_IRQ_WORK_H 2 + #define _ASM_IRQ_WORK_H 3 + 4 + #include <asm/processor.h> 5 + 6 + static inline bool arch_irq_work_has_interrupt(void) 7 + { 8 + return cpu_has_apic; 9 + } 10 + 11 + #endif /* _ASM_IRQ_WORK_H */
+1 -1
arch/x86/kernel/irq_work.c
··· 41 41 void arch_irq_work_raise(void) 42 42 { 43 43 #ifdef CONFIG_X86_LOCAL_APIC 44 - if (!cpu_has_apic) 44 + if (!arch_irq_work_has_interrupt()) 45 45 return; 46 46 47 47 apic->send_IPI_self(IRQ_WORK_VECTOR);