mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Catalin Iacob <iacobcatalin@gmail.com>,
	Dave Jones <davej@redhat.com>, Ingo Molnar <mingo@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [RFC PATCH 4/9] x86: Build irq work only if local apic support
Date: Thu, 21 Aug 2014 16:52:52 +0200	[thread overview]
Message-ID: <1408632777-3348-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1408632777-3348-1-git-send-email-fweisbec@gmail.com>

Irq work won't run without local apic support. This check is currently
hacked-up through ifdeffery. Lets do conditional build instead. That
way we avoid further ifdefs with the implementation of
arch_irq_work_has_own_interrupt().

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/Kconfig                  | 4 ++++
 arch/x86/include/asm/entry_arch.h | 2 +-
 arch/x86/kernel/Makefile          | 2 +-
 arch/x86/kernel/entry_64.S        | 2 +-
 arch/x86/kernel/irq_work.c        | 2 --
 arch/x86/kernel/irqinit.c         | 2 +-
 6 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5d0bf1a..147772f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -837,6 +837,10 @@ config X86_LOCAL_APIC
 	def_bool y
 	depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
 
+config X86_IRQ_WORK
+	def_bool y
+	depends on X86_LOCAL_APIC && IRQ_WORK
+
 config X86_IO_APIC
 	def_bool y
 	depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index dc5fa66..f8344d2 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -38,7 +38,7 @@ BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
 BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
 BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
 
-#ifdef CONFIG_IRQ_WORK
+#ifdef CONFIG_X86_IRQ_WORK
 BUILD_INTERRUPT(irq_work_interrupt, IRQ_WORK_VECTOR)
 #endif
 
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index b5ea75c..ddb4994 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -22,7 +22,7 @@ obj-y			:= process_$(BITS).o signal.o entry_$(BITS).o
 obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y			+= time.o ioport.o ldt.o dumpstack.o nmi.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o jump_label.o
-obj-$(CONFIG_IRQ_WORK)  += irq_work.o
+obj-$(CONFIG_X86_IRQ_WORK)  += irq_work.o
 obj-y			+= probe_roms.o
 obj-$(CONFIG_X86_32)	+= i386_ksyms_32.o
 obj-$(CONFIG_X86_64)	+= sys_x86_64.o x8664_ksyms_64.o
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 2fac134..85056bd7 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1043,7 +1043,7 @@ apicinterrupt ERROR_APIC_VECTOR \
 apicinterrupt SPURIOUS_APIC_VECTOR \
 	spurious_interrupt smp_spurious_interrupt
 
-#ifdef CONFIG_IRQ_WORK
+#ifdef CONFIG_X86_IRQ_WORK
 apicinterrupt IRQ_WORK_VECTOR \
 	irq_work_interrupt smp_irq_work_interrupt
 #endif
diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c
index 1de84e3..54f60a2 100644
--- a/arch/x86/kernel/irq_work.c
+++ b/arch/x86/kernel/irq_work.c
@@ -40,11 +40,9 @@ __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)
 		return;
 
 	apic->send_IPI_self(IRQ_WORK_VECTOR);
 	apic_wait_icr_idle();
-#endif
 }
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 1e6cff5..566d377 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -176,7 +176,7 @@ static void __init apic_intr_init(void)
 	alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
 
 	/* IRQ work interrupts: */
-# ifdef CONFIG_IRQ_WORK
+# ifdef CONFIG_X86_IRQ_WORK
 	alloc_intr_gate(IRQ_WORK_VECTOR, irq_work_interrupt);
 # endif
 
-- 
1.8.3.1


  parent reply	other threads:[~2014-08-21 14:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 14:52 [RFC PATCH 0/9] nohz: Nohz full kick fixes Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 1/9] nohz: Restore NMI safe local irq work for local nohz kick Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 2/9] nohz: Move nohz full init call to tick init Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 3/9] irq_work: Force raised irq work to run on irq work interrupt Frederic Weisbecker
2014-09-04  6:11   ` Peter Zijlstra
2014-09-04 13:33     ` Frederic Weisbecker
2014-09-04 15:40       ` Peter Zijlstra
2014-09-05 13:54         ` Frederic Weisbecker
2014-09-06 13:35     ` Frederic Weisbecker
2014-09-06 15:45       ` Peter Zijlstra
2014-09-06 17:12         ` Frederic Weisbecker
2014-09-08  6:11           ` Peter Zijlstra
2014-08-21 14:52 ` Frederic Weisbecker [this message]
2014-08-21 14:52 ` [RFC PATCH 5/9] x86: Tell irq work about self IPI support Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 6/9] arm: " Frederic Weisbecker
2014-08-21 15:21   ` Russell King - ARM Linux
2014-08-21 17:35     ` Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 7/9] arm64: " Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 8/9] nohz: Consolidate nohz full init code Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 9/9] nohz: nohz full depends on irq work self IPI support Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408632777-3348-5-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=davej@redhat.com \
    --cc=iacobcatalin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®