[RFC PATCH 5/9] x86: Tell irq work about self IPI support

Frederic Weisbecker
2014-08-21T14:53:14Z

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

This should be safely called after setup_arch().

Cc: Catalin Iacob <iacobcatalin@gmail.com>
Cc: Dave Jones <davej@redhat.com>
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>
---
arch/x86/kernel/irq_work.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c
index 54f60a2..b5f8fff 100644
--- a/arch/x86/kernel/irq_work.c
+++ b/arch/x86/kernel/irq_work.c
@@ -38,6 +38,11 @@ __visible void smp_trace_irq_work_interrupt(struct pt_regs *regs)
exiting_irq();
}

+int __init arch_irq_work_has_own_interrupt(void)
+{
+ return cpu_has_apic;
+}
+
void arch_irq_work_raise(void)
{
if (!cpu_has_apic)
--
1.8.3.1