Skip to content

Commit

Permalink
x86: Tell irq work about self IPI support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frederic Weisbecker committed Sep 13, 2014
1 parent 76a3306 commit 3010279
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion arch/x86/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ genhdr-y += unistd_x32.h
generic-y += clkdev.h
generic-y += cputime.h
generic-y += early_ioremap.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h
generic-y += scatterlist.h
11 changes: 11 additions & 0 deletions arch/x86/include/asm/irq_work.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef _ASM_IRQ_WORK_H
#define _ASM_IRQ_WORK_H

#include <asm/processor.h>

static inline bool arch_irq_work_has_interrupt(void)
{
return cpu_has_apic;
}

#endif /* _ASM_IRQ_WORK_H */
2 changes: 1 addition & 1 deletion arch/x86/kernel/irq_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ __visible void smp_trace_irq_work_interrupt(struct pt_regs *regs)
void arch_irq_work_raise(void)
{
#ifdef CONFIG_X86_LOCAL_APIC
if (!cpu_has_apic)
if (!arch_irq_work_has_interrupt())
return;

apic->send_IPI_self(IRQ_WORK_VECTOR);
Expand Down

0 comments on commit 3010279

Please sign in to comment.