Skip to contentSkip to conversation

x86: kconfig: simplify APIC entries

RFC In review Luis R. Rodriguez 3 participants 7 messages Mar 10, 2015 – Mar 11, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover x86: kconfig: simplify APIC entries

From: "Luis R. Rodriguez" <[email protected]>

There's quite a bit of Kconfig entries related to X86_LOCAL_APIC and X86_IO_APIC, and all for 32-bit purposes. Since 32-bit isn't in a magical state of flux we now *should* know when to enable or disable APIC stuff for these systems. Through history we've observed for instance PCI_MSI requires these under specific scenarios, just enable it for those learned scenarios and expect future requirements to also be explicit about the requirements on 32-bit. This lets us remove clutter (3 Kconfig entries) from x86 Kconfig simply for 32-bit build purposes.

Luis R. Rodriguez (2):
x86: kconfig: simplify enabling [IO]APIC for PCI_MSI
x86: kconfig: remove UP [IO]APIC options

 Documentation/PCI/MSI-HOWTO.txt |  5 +----
 arch/x86/Kconfig                | 33 ++-------------------------------
 drivers/pci/Kconfig             |  2 ++
 3 files changed, 5 insertions(+), 35 deletions(-)
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
#1 lore raw

RFC 1/2 x86: kconfig: simplify enabling [IO]APIC for PCI_MSI

From: "Luis R. Rodriguez" <[email protected]>

Commit 38a1dfda by Bryan O'Donoghue fixed a build issue when PCI_MSI support is enabled on non-SMP X86_32 systems, this was done by introducing a new Kconfig entry, X86_UP_APIC_MSI, with the only purpose of selecting X86_UP_APIC under certain conditions. The real goal in the end though is to enable X86_LOCAL_APIC and X86_IO_APIC. We already have enough APIC related Kconfig entries and adding more only confuses things, we can remove X86_UP_APIC_MSI by just passing on to PCI_MSI what it needs.

Cc Bjorn Helgaas <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Juergen Gross <[email protected]>
---
 Documentation/PCI/MSI-HOWTO.txt | 5 +----
 arch/x86/Kconfig                | 6 +-----
 drivers/pci/Kconfig             | 2 ++
 3 files changed, 4 insertions(+), 9 deletions(-)
Documentation/PCI/MSI-HOWTO.txt +1 -4
index 0d920d5..7306d2c 100644
@@ -71,10 +71,7 @@ will simply fail and the device will continue to use pin-based interrupts.
 4.1 Include kernel support for MSIs
 
 To support MSI or MSI-X, the kernel must be built with the CONFIG_PCI_MSI
-option enabled.  This option is only available on some architectures,
-and it may depend on some other options also being set.  For example,
-on x86, you must also enable X86_UP_APIC or SMP in order to see the
-CONFIG_PCI_MSI option.
+option enabled.  This option is only available on some architectures.
 
 4.2 Using MSI
 
arch/x86/Kconfig +1 -5
index d038475..0ecdeb1 100644
@@ -902,10 +902,6 @@ config X86_UP_APIC
 	  performance counters), and the NMI watchdog which detects hard
 	  lockups.
 
-config X86_UP_APIC_MSI
-	def_bool y
-	select X86_UP_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD && PCI_MSI
-
 config X86_UP_IOAPIC
 	bool "IO-APIC support on uniprocessors"
 	depends on X86_UP_APIC
@@ -924,7 +920,7 @@ config X86_LOCAL_APIC
 	select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ
 
 config X86_IO_APIC
-	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC
+	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
 	depends on X86_LOCAL_APIC
 	select IRQ_DOMAIN
 
drivers/pci/Kconfig +2 -0
index 7a8f1c5..01370c0 100644
@@ -5,6 +5,8 @@ config PCI_MSI
 	bool "Message Signaled Interrupts (MSI and MSI-X)"
 	depends on PCI
 	select GENERIC_MSI_IRQ
+	select X86_LOCAL_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD
+	select X86_IO_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD
 	help
 	   This allows device drivers to enable MSI (Message Signaled
 	   Interrupts).  Message Signaled Interrupts enable a device to
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
#2 lore raw

Re: [RFC v1 1/2] x86: kconfig: simplify enabling [IO]APIC for PCI_MSI

Quoted 45 lines · Luis R. Rodriguez
Documentation/PCI/MSI-HOWTO.txt +1 -4
index 0d920d5..7306d2c 100644
@@ -71,10 +71,7 @@ will simply fail and the device will continue to use pin-based interrupts.
 4.1 Include kernel support for MSIs
 
 To support MSI or MSI-X, the kernel must be built with the CONFIG_PCI_MSI
-option enabled.  This option is only available on some architectures,
-and it may depend on some other options also being set.  For example,
-on x86, you must also enable X86_UP_APIC or SMP in order to see the
-CONFIG_PCI_MSI option.
+option enabled.  This option is only available on some architectures.
 
 4.2 Using MSI
 
arch/x86/Kconfig +1 -5
index d038475..0ecdeb1 100644
@@ -902,10 +902,6 @@ config X86_UP_APIC
 	  performance counters), and the NMI watchdog which detects hard
 	  lockups.
 
-config X86_UP_APIC_MSI
-	def_bool y
-	select X86_UP_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD && PCI_MSI
-
 config X86_UP_IOAPIC
 	bool "IO-APIC support on uniprocessors"
 	depends on X86_UP_APIC
@@ -924,7 +920,7 @@ config X86_LOCAL_APIC
 	select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ
 
 config X86_IO_APIC
-	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC
+	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
 	depends on X86_LOCAL_APIC
 	select IRQ_DOMAIN
 
drivers/pci/Kconfig +0 -0
index 7a8f1c5..01370c0 100644

drivers/pci/Kconfig config PCI_MSI · line 12

Quoted 8 lines
drivers/pci/Kconfig +2 -0
@@ -5,6 +5,8 @@ config PCI_MSI
 	bool "Message Signaled Interrupts (MSI and MSI-X)"
 	depends on PCI
 	select GENERIC_MSI_IRQ
+	select X86_LOCAL_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD
+	select X86_IO_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD
 	help
 	   This allows device drivers to enable MSI (Message Signaled
 	   Interrupts).  Message Signaled Interrupts enable a device to

This conflicts with commit 50849eefea3b ("x86/Kconfig: Simplify X86_UP_APIC handling"), which has already been merged for the 4.0 release cycle, and I think I prefer the simplification done there over the additional "select"s for PCI_MSI.

#3 lore raw

Re: [RFC v1 1/2] x86: kconfig: simplify enabling [IO]APIC for PCI_MSI

Quoted 42 lines · David Rientjes
Quoted 40 lines · Luis R. Rodriguez
Documentation/PCI/MSI-HOWTO.txt +1 -4
index 0d920d5..7306d2c 100644
@@ -71,10 +71,7 @@ will simply fail and the device will continue to use pin-based interrupts.
 4.1 Include kernel support for MSIs
 
 To support MSI or MSI-X, the kernel must be built with the CONFIG_PCI_MSI
-option enabled.  This option is only available on some architectures,
-and it may depend on some other options also being set.  For example,
-on x86, you must also enable X86_UP_APIC or SMP in order to see the
-CONFIG_PCI_MSI option.
+option enabled.  This option is only available on some architectures.
 
 4.2 Using MSI
 
arch/x86/Kconfig +1 -5
index d038475..0ecdeb1 100644
@@ -902,10 +902,6 @@ config X86_UP_APIC
 	  performance counters), and the NMI watchdog which detects hard
 	  lockups.
 
-config X86_UP_APIC_MSI
-	def_bool y
-	select X86_UP_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD && PCI_MSI
-
 config X86_UP_IOAPIC
 	bool "IO-APIC support on uniprocessors"
 	depends on X86_UP_APIC
@@ -924,7 +920,7 @@ config X86_LOCAL_APIC
 	select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ
 
 config X86_IO_APIC
-	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC
+	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
 	depends on X86_LOCAL_APIC
 	select IRQ_DOMAIN
 
Quoted 16 lines

drivers/pci/Kconfig config PCI_MSI · line 12

Quoted 13 lines
drivers/pci/Kconfig +2 -0
index 7a8f1c5..01370c0 100644
@@ -5,6 +5,8 @@ config PCI_MSI
 	bool "Message Signaled Interrupts (MSI and MSI-X)"
 	depends on PCI
 	select GENERIC_MSI_IRQ
+	select X86_LOCAL_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD
+	select X86_IO_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD
 	help
 	   This allows device drivers to enable MSI (Message Signaled
 	   Interrupts).  Message Signaled Interrupts enable a device to

and I think I prefer the simplification done there over the additional "select"s for PCI_MSI.

OK found a way to address that which makes it even easier to read.

Luis

#4 lore raw

RFC 2/2 x86: kconfig: remove UP [IO]APIC options

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

These were here mostly to help as wrappers for PCI_MSI under certain UP 32-bit build scenarios, now that PCI_MSI properly selects what it needs and when it needs it these Kconfig options are now only enabling users reduce the size of 32-bit kernels optionally. Since 32-bit kernels are not in a huge state of flux and since there is no penalty for adding APIC support other than a bit of size moving forward we simply expect folks to enable APIC options on 32-bit systems when a system needs it, as with PCI_MSI. This lets us remove clutter from the x86 Kconfig file.

Cc Bjorn Helgaas <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Juergen Gross <[email protected]>
---
 arch/x86/Kconfig | 29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)
arch/x86/Kconfig +2 -27
index 0ecdeb1..bfd4d66 100644
@@ -889,38 +889,13 @@ config UP_LATE_INIT
        def_bool y
        depends on !SMP && X86_LOCAL_APIC
 
-config X86_UP_APIC
-	bool "Local APIC support on uniprocessors"
-	depends on X86_32 && !SMP && !X86_32_NON_STANDARD
-	---help---
-	  A local APIC (Advanced Programmable Interrupt Controller) is an
-	  integrated interrupt controller in the CPU. If you have a single-CPU
-	  system which has a processor with a local APIC, you can say Y here to
-	  enable and use it. If you say Y here even though your machine doesn't
-	  have a local APIC, then the kernel will still run with no slowdown at
-	  all. The local APIC supports CPU-generated self-interrupts (timer,
-	  performance counters), and the NMI watchdog which detects hard
-	  lockups.
-
-config X86_UP_IOAPIC
-	bool "IO-APIC support on uniprocessors"
-	depends on X86_UP_APIC
-	---help---
-	  An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
-	  SMP-capable replacement for PC-style interrupt controllers. Most
-	  SMP systems and many recent uniprocessor systems have one.
-
-	  If you have a single-CPU system with an IO-APIC, you can say Y here
-	  to use it. If you say Y here even though your machine doesn't have
-	  an IO-APIC, then the kernel will still run with no slowdown at all.
-
 config X86_LOCAL_APIC
 	def_bool y
-	depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
+	depends on X86_64 || SMP || X86_32_NON_STANDARD || PCI_MSI
 	select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ
 
 config X86_IO_APIC
-	def_bool X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
+	def_bool X86_64 || SMP || X86_32_NON_STANDARD || PCI_MSI
 	depends on X86_LOCAL_APIC
 	select IRQ_DOMAIN
 
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
#5 lore raw

Re: [RFC v1 2/2] x86: kconfig: remove UP [IO]APIC options

Quoted 13 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

These were here mostly to help as wrappers for PCI_MSI under certain UP 32-bit build scenarios, now that PCI_MSI properly selects what it needs and when it needs it these Kconfig options are now only enabling users reduce the size of 32-bit kernels optionally. Since 32-bit kernels are not in a huge state of flux and since there is no penalty for adding APIC support other than a bit of size moving forward we simply expect folks to enable APIC options on 32-bit systems when a system needs it, as with PCI_MSI. This lets us remove clutter from the x86 Kconfig file.

Check out Linus's latest tree at
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git and see how it looks after commit 50849eefea3b ("x86/Kconfig: Simplify X86_UP_APIC handling") and commit b1da1e715d4f ("x86/Kconfig: Simplify X86_IO_APIC dependencies").

#6 lore raw

Re: [RFC v1 2/2] x86: kconfig: remove UP [IO]APIC options

Quoted 16 lines · David Rientjes
Quoted 13 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

These were here mostly to help as wrappers for PCI_MSI under certain UP 32-bit build scenarios, now that PCI_MSI properly selects what it needs and when it needs it these Kconfig options are now only enabling users reduce the size of 32-bit kernels optionally. Since 32-bit kernels are not in a huge state of flux and since there is no penalty for adding APIC support other than a bit of size moving forward we simply expect folks to enable APIC options on 32-bit systems when a system needs it, as with PCI_MSI. This lets us remove clutter from the x86 Kconfig file.

Quoted 5 lines

Check out Linus's latest tree at
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git and see how it looks after commit 50849eefea3b ("x86/Kconfig: Simplify X86_UP_APIC handling") and commit b1da1e715d4f ("x86/Kconfig: Simplify X86_IO_APIC dependencies").

OK thanks yeah I see that now, yeah this can be simplified further, will send a follow up based on top of these two.

Luis