From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754025AbaIJVdn (ORCPT ); Wed, 10 Sep 2014 17:33:43 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:34542 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753945AbaIJVdl (ORCPT ); Wed, 10 Sep 2014 17:33:41 -0400 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Peter Zijlstra , Dave Jones , Thomas Gleixner , Russell King , Catalin Iacob , "Paul E . McKenney" , Will Deacon , Ingo Molnar , Catalin Marinas Subject: [PATCH 4/8] x86: Tell irq work about self IPI support Date: Wed, 10 Sep 2014 23:33:24 +0200 Message-Id: <1410384808-14760-5-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410384808-14760-1-git-send-email-fweisbec@gmail.com> References: <1410384808-14760-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Cc: Ingo Molnar Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Signed-off-by: Frederic Weisbecker --- arch/x86/include/asm/Kbuild | 1 - arch/x86/include/asm/irq_work.h | 11 +++++++++++ arch/x86/kernel/irq_work.c | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 arch/x86/include/asm/irq_work.h diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 8fa909c..3bf000f 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -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 diff --git a/arch/x86/include/asm/irq_work.h b/arch/x86/include/asm/irq_work.h new file mode 100644 index 0000000..4c01cab --- /dev/null +++ b/arch/x86/include/asm/irq_work.h @@ -0,0 +1,11 @@ +#ifndef _ASM_IRQ_WORK_H +#define _ASM_IRQ_WORK_H + +#include + +static inline bool arch_irq_work_has_interrupt(void) +{ + return static_cpu_has(X86_FEATURE_APIC); +} + +#endif /* _ASM_IRQ_WORK_H */ diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c index 1de84e3..15d741d 100644 --- a/arch/x86/kernel/irq_work.c +++ b/arch/x86/kernel/irq_work.c @@ -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); -- 2.1.0