2022-02-28 21:31:33

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 00/10] x86: Kconfig cleanups and help text improvements

Hello,

There are some problems with the Kconfig files in the kernel. The help
text is frequently confusing and does not really describe what the
feature is about in a language that users could understand. Sometimes,
the help text was not updated after kernel or ecosystem changes.
References to something "future" or "old" are also usually given without
specifying any dates.

I have started improving the Kconfig files for x86. I'm sending the
first round of patches - what I have right now.

Greetings,
Mateusz

Mateusz Jończyk (10):
x86/Kconfig: enable X86_X2APIC by default and improve help text
x86/apic: fix panic message when x2APIC is not supported
x86/Kconfig: always enable ARCH_SPARSEMEM_ENABLE
x86/Kconfig: drop X86_32_NON_STANDARD
x86/Kconfig: move all X86_EXTENDED_PLATFORM options together
x86/Kconfig: update lists in X86_EXTENDED_PLATFORM
x86/Kconfig: add help text to CONFIG_PCI_MMCONFIG
x86/Kconfig: improve CONFIG_PCI_CNB20LE_QUIRK doc
x86/Kconfig: document year of release of glibc 2.3.3
x86/Kconfig: remove CONFIG_ISA_BUS

arch/x86/Kconfig | 129 +++++++++++++++++++-----------------
arch/x86/kernel/apic/apic.c | 2 +-
drivers/iio/dac/Kconfig | 2 +-
3 files changed, 71 insertions(+), 62 deletions(-)


base-commit: cfb92440ee71adcc2105b0890bb01ac3cddb8507
--
2.25.1


2022-02-28 21:32:05

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 03/10] x86/Kconfig: always enable ARCH_SPARSEMEM_ENABLE

It appears that (X86_64 || X86_32) is always true on x86.

This logical OR directive was introduced in
commit 6ea3038648da ("arch/x86: remove depends on CONFIG_EXPERIMENTAL")
probably by a trivial mistake.

Fixes: 6ea3038648da ("arch/x86: remove depends on CONFIG_EXPERIMENTAL")
Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Kees Cook <[email protected]>
---
arch/x86/Kconfig | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 64d760a2b81a..727fd3998022 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1641,7 +1641,6 @@ config ARCH_FLATMEM_ENABLE

config ARCH_SPARSEMEM_ENABLE
def_bool y
- depends on X86_64 || NUMA || X86_32 || X86_32_NON_STANDARD
select SPARSEMEM_STATIC if X86_32
select SPARSEMEM_VMEMMAP_ENABLE if X86_64

--
2.25.1

2022-02-28 21:32:12

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 04/10] x86/Kconfig: drop X86_32_NON_STANDARD

This patch drops the "Support non-standard 32-bit SMP architectures"
configuration option. Currently, the only such an architecture is
STA2X11, so this option is useless. STA2X11 could now be selected
independently.

The dependency of X86_BIGSMP on X86_32_NON_STANDARD was dropped in
2009, in
commit 26f7ef14a76b ("x86: don't treat bigsmp as non-standard")
but the help text for X86_32_NON_STANDARD was not updated since.

CONFIG_X86_32_NON_STANDARD was used only in arch/x86/Kconfig, so it
could be dropped easily.

X86_32_NON_STANDARD depended on SMP, so
(!SMP && !X86_32_NON_STANDARD) == !SMP
and
(SMP || X86_32_NON_STANDARD) == SMP

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
---
arch/x86/Kconfig | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 727fd3998022..61b58e24dc00 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -724,18 +724,6 @@ config X86_RDC321X
as R-8610-(G).
If you don't have one of these chips, you should say N here.

-config X86_32_NON_STANDARD
- bool "Support non-standard 32-bit SMP architectures"
- depends on X86_32 && SMP
- depends on X86_EXTENDED_PLATFORM
- help
- This option compiles in the bigsmp and STA2X11 default
- subarchitectures. It is intended for a generic binary
- kernel. If you select them all, kernel will probe it one by
- one and will fallback to default.
-
-# Alphabetically sorted list of Non standard 32 bit platforms
-
config X86_SUPPORTS_MEMORY_FAILURE
def_bool y
# MCE code calls memory_failure():
@@ -747,7 +735,8 @@ config X86_SUPPORTS_MEMORY_FAILURE

config STA2X11
bool "STA2X11 Companion Chip Support"
- depends on X86_32_NON_STANDARD && PCI
+ depends on X86_32 && SMP
+ depends on X86_EXTENDED_PLATFORM && PCI
select SWIOTLB
select MFD_STA2X11
select GPIOLIB
@@ -1074,7 +1063,7 @@ config UP_LATE_INIT
config X86_UP_APIC
bool "Local APIC support on uniprocessors" if !PCI_MSI
default PCI_MSI
- depends on X86_32 && !SMP && !X86_32_NON_STANDARD
+ depends on X86_32 && !SMP
help
A local APIC (Advanced Programmable Interrupt Controller) is an
integrated interrupt controller in the CPU. If you have a single-CPU
@@ -1099,7 +1088,7 @@ config X86_UP_IOAPIC

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_UP_APIC || PCI_MSI
select IRQ_DOMAIN_HIERARCHY
select PCI_MSI_IRQ_DOMAIN if PCI_MSI

--
2.25.1

2022-02-28 21:32:13

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 05/10] x86/Kconfig: move all X86_EXTENDED_PLATFORM options together

so that these options will be displayed together in menuconfig etc.

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
---
arch/x86/Kconfig | 50 ++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 61b58e24dc00..ddbc407976fb 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -660,6 +660,31 @@ config X86_INTEL_QUARK
Say Y here if you have a Quark based system such as the Arduino
compatible Intel Galileo.

+config X86_RDC321X
+ bool "RDC R-321x SoC"
+ depends on X86_32
+ depends on X86_EXTENDED_PLATFORM
+ select M486
+ select X86_REBOOTFIXUPS
+ help
+ This option is needed for RDC R-321x system-on-chip, also known
+ as R-8610-(G).
+ If you don't have one of these chips, you should say N here.
+
+config STA2X11
+ bool "STA2X11 Companion Chip Support"
+ depends on X86_32 && SMP
+ depends on X86_EXTENDED_PLATFORM && PCI
+ select SWIOTLB
+ select MFD_STA2X11
+ select GPIOLIB
+ help
+ This adds support for boards based on the STA2X11 IO-Hub,
+ a.k.a. "ConneXt". The chip is used in place of the standard
+ PC chipset, so all "standard" peripherals are missing. If this
+ option is selected the kernel will still be able to boot on
+ standard PC machines.
+
config X86_INTEL_LPSS
bool "Intel Low Power Subsystem Support"
depends on X86 && ACPI && PCI
@@ -713,17 +738,6 @@ config IOSF_MBI_DEBUG

If you don't require the option or are in doubt, say N.

-config X86_RDC321X
- bool "RDC R-321x SoC"
- depends on X86_32
- depends on X86_EXTENDED_PLATFORM
- select M486
- select X86_REBOOTFIXUPS
- help
- This option is needed for RDC R-321x system-on-chip, also known
- as R-8610-(G).
- If you don't have one of these chips, you should say N here.
-
config X86_SUPPORTS_MEMORY_FAILURE
def_bool y
# MCE code calls memory_failure():
@@ -733,20 +747,6 @@ config X86_SUPPORTS_MEMORY_FAILURE
depends on X86_64 || !SPARSEMEM
select ARCH_SUPPORTS_MEMORY_FAILURE

-config STA2X11
- bool "STA2X11 Companion Chip Support"
- depends on X86_32 && SMP
- depends on X86_EXTENDED_PLATFORM && PCI
- select SWIOTLB
- select MFD_STA2X11
- select GPIOLIB
- help
- This adds support for boards based on the STA2X11 IO-Hub,
- a.k.a. "ConneXt". The chip is used in place of the standard
- PC chipset, so all "standard" peripherals are missing. If this
- option is selected the kernel will still be able to boot on
- standard PC machines.
-
config X86_32_IRIS
tristate "Eurobraille/Iris poweroff module"
depends on X86_32
--
2.25.1

2022-02-28 21:32:51

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 06/10] x86/Kconfig: update lists in X86_EXTENDED_PLATFORM

The order of the entries matches the order they appear in Kconfig.

In 2011, AMD Elan was moved to Kconfig.cpu and the dependency on
X86_EXTENDED_PLATFORM was dropped in
commit ce9c99af8d4b ("x86, cpu: Move AMD Elan Kconfig under "Processor family"")

Support for Moorestown MID devices was removed in 2012 in
commit 1a8359e411eb ("x86/mid: Remove Intel Moorestown")

SGI 320/540 (Visual Workstation) was removed in 2014 in
commit c5f9ee3d665a ("x86, platforms: Remove SGI Visual Workstation")

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
---
arch/x86/Kconfig | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ddbc407976fb..c55a837a00ab 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -531,11 +531,11 @@ config X86_EXTENDED_PLATFORM
If you enable this option then you'll be able to select support
for the following (non-PC) 32 bit x86 platforms:
Goldfish (Android emulator)
- AMD Elan
RDC R-321x SoC
- SGI 320/540 (Visual Workstation)
STA2X11-based (e.g. Northville)
- Moorestown MID devices
+ Intel CE media processor (CE4100) SoC
+ Intel MID (Mobile Internet Device)
+ Intel Quark

If you have one of these systems, or if you want to build a
generic distribution kernel, say Y here - otherwise say N.
@@ -555,6 +555,8 @@ config X86_EXTENDED_PLATFORM
Numascale NumaChip
ScaleMP vSMP
SGI Ultraviolet
+ Goldfish (mostly Android emulator)
+ Intel MID (Mobile Internet Device)

If you have one of these systems, or if you want to build a
generic distribution kernel, say Y here - otherwise say N.
--
2.25.1

2022-02-28 21:32:55

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 07/10] x86/Kconfig: add help text to CONFIG_PCI_MMCONFIG

This configuration option had no help text, so add it.

CONFIG_EXPERT is enabled on some distribution kernels, so people using a
distribution kernel's configuration as a starting point will see this
option.

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Jan Kiszka <[email protected]>

---
I would like someone to confirm that PCI Express is required for
MMCONFIG support.
---
arch/x86/Kconfig | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c55a837a00ab..27d21ef518b0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2645,6 +2645,19 @@ config PCI_MMCONFIG
default y
depends on PCI && (ACPI || JAILHOUSE_GUEST)
depends on X86_64 || (PCI_GOANY || PCI_GOMMCONFIG)
+ help
+ Add support for accessing the PCI configuration space as a memory
+ mapped area. It is the recommended method if the system supports
+ this (it must have PCI Express and ACPI for it to be available).
+
+ In the unlikely case that enabling this configuration option causes
+ problems, the mechanism can be switched off with the 'pci=nommconf'
+ command line parameter.
+
+ Say 'n' only if you are sure that your platform does not support this
+ access method or you have problems caused by it.
+
+ Say 'y' otherwise.

config PCI_OLPC
def_bool y
--
2.25.1

2022-02-28 21:33:30

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 08/10] x86/Kconfig: improve CONFIG_PCI_CNB20LE_QUIRK doc

I was unable to find a specification of this chipset.

There is a bug report in Red Hat from 2010 [2]. From dmesg from there it
looks ServerWorks CNB20LE was a chipset (controlling the PCI root
bridge and peripherals) and it was working with Pentium III. There was
also a LKML thread from 2002 [1].

There was also some research paper from CERN listing some server
configured with it with a dual Pentium III setup. [3]

[1] Zwane Mwaikambo, Re: Problem with ServerWorks CNB20LE and lost interrupts
https://lkml.org/lkml/2002/1/11/71

[2] Bug 665109 - e100 problems on old Compaq Proliant DL320
https://bugzilla.redhat.com/show_bug.cgi?id=665109

[3] R. Hughes-Jones, S. Dallison, G. Fairey, Performance Measurements on
Gigabit Ethernet NICs and Server Quality Motherboards,
http://datatag.web.cern.ch/papers/pfldnet2003-rhj.doc

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ira W. Snyder <[email protected]>
---
arch/x86/Kconfig | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 27d21ef518b0..212f2b9a9d91 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2672,13 +2672,21 @@ config MMCONF_FAM10H
depends on X86_64 && PCI_MMCONFIG && ACPI

config PCI_CNB20LE_QUIRK
- bool "Read CNB20LE Host Bridge Windows" if EXPERT
+ bool "Support PCI hotplug with the CNB20LE chipset" if EXPERT
depends on PCI
help
Read the PCI windows out of the CNB20LE host bridge. This allows
PCI hotplug to work on systems with the CNB20LE chipset which do
not have ACPI.

+ The ServerWorks (later Broadcom) CNB20LE was a chipset designed
+ probably for Pentium III.
+
+ To find out if you have such a chipset, search for a PCI device with
+ 1166:0009 PCI IDs, for example by executing
+ lspci -nn | grep '1166:0009'
+ The code is inactive if there is none.
+
There's no public spec for this chipset, and this functionality
is known to be incomplete.

--
2.25.1

2022-02-28 21:33:30

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 09/10] x86/Kconfig: document year of release of glibc 2.3.3

I wonder how many people were checking their glibc version when
considering whether to enable this option.

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Andy Lutomirski <[email protected]>
---
arch/x86/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 212f2b9a9d91..19acc5954083 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2283,7 +2283,7 @@ config DEBUG_HOTPLUG_CPU0

config COMPAT_VDSO
def_bool n
- prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
+ prompt "Enable workaround for glibc 2.3.2 / 2.3.3 (released in year 2003/2004)"
depends on COMPAT_32
help
Certain buggy versions of glibc will crash if they are
--
2.25.1

2022-02-28 21:57:56

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH 10/10] x86/Kconfig: remove CONFIG_ISA_BUS

CONFIG_ISA_BUS was used only as a dependency for a single Industrial IO
driver: CONFIG_CIO_DAC ("Measurement Computing CIO-DAC IIO driver"). At
least grepping the kernel source for "ISA_BUS" did not find any other
meaningful results.

There are more configuration options that select CONFIG_ISA_BUS_API, but
did not depend on CONFIG_ISA_BUS. Most of these are for Industrial IO and
GPIO drivers.

Signed-off-by: Mateusz Jończyk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: William Breathitt Gray <[email protected]>
---
arch/x86/Kconfig | 11 -----------
drivers/iio/dac/Kconfig | 2 +-
2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 19acc5954083..2de46adfbde2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2692,17 +2692,6 @@ config PCI_CNB20LE_QUIRK

You should say N unless you know you need this.

-config ISA_BUS
- bool "ISA bus support on modern systems" if EXPERT
- help
- Expose ISA bus device drivers and options available for selection and
- configuration. Enable this option if your target machine has an ISA
- bus. ISA is an older system, displaced by PCI and newer bus
- architectures -- if your target machine is modern, it probably does
- not have an ISA bus.
-
- If unsure, say N.
-
# x86_64 have no ISA slots, but can have ISA-style DMA.
config ISA_DMA_API
bool "ISA-style DMA support" if (X86_64 && EXPERT)
diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
index bfcf7568de32..fe0f2a93055d 100644
--- a/drivers/iio/dac/Kconfig
+++ b/drivers/iio/dac/Kconfig
@@ -264,7 +264,7 @@ config AD8801

config CIO_DAC
tristate "Measurement Computing CIO-DAC IIO driver"
- depends on X86 && (ISA_BUS || PC104)
+ depends on X86
select ISA_BUS_API
help
Say yes here to build support for the Measurement Computing CIO-DAC
--
2.25.1

2022-03-01 00:33:27

by William Breathitt Gray

[permalink] [raw]
Subject: Re: [PATCH 10/10] x86/Kconfig: remove CONFIG_ISA_BUS

On Mon, Feb 28, 2022 at 10:28:26PM +0100, Mateusz Jończyk wrote:
> CONFIG_ISA_BUS was used only as a dependency for a single Industrial IO
> driver: CONFIG_CIO_DAC ("Measurement Computing CIO-DAC IIO driver"). At
> least grepping the kernel source for "ISA_BUS" did not find any other
> meaningful results.
>
> There are more configuration options that select CONFIG_ISA_BUS_API, but
> did not depend on CONFIG_ISA_BUS. Most of these are for Industrial IO and
> GPIO drivers.
>
> Signed-off-by: Mateusz Jończyk <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: Dave Hansen <[email protected]>
> Cc: [email protected]
> Cc: "H. Peter Anvin" <[email protected]>
> Cc: William Breathitt Gray <[email protected]>

For context, the Measurement Computing CIO-DAC device comes in two
form factors: PC104 and ISA. The PC104 bus is typically aimed at
embedded systems and not commonly used by general users, so the
CONFIG_PC104 Kconfig option was introduced to filter out these devices
for most users who would generally not be interested in them. Because
the CIO-DAC device is also available in an ISA form factor, I needed a
way to have the CONFIG_CIO_DAC Kconfig available even on non-PC104
systems; that's how the CONFIG_ISA_BUS Kconfig option came about.

The purpose of the CONFIG_ISA_BUS Kconfig option is filter out ISA bus
devices because few users will have an ISA bus. I suppose it does no
harm to remove that filter because users can still select CONFIG_CIO_DAC
if they want it, so I'm all right with this patch.

Acked-by: William Breathitt Gray <[email protected]>

> ---
> arch/x86/Kconfig | 11 -----------
> drivers/iio/dac/Kconfig | 2 +-
> 2 files changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 19acc5954083..2de46adfbde2 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2692,17 +2692,6 @@ config PCI_CNB20LE_QUIRK
>
> You should say N unless you know you need this.
>
> -config ISA_BUS
> - bool "ISA bus support on modern systems" if EXPERT
> - help
> - Expose ISA bus device drivers and options available for selection and
> - configuration. Enable this option if your target machine has an ISA
> - bus. ISA is an older system, displaced by PCI and newer bus
> - architectures -- if your target machine is modern, it probably does
> - not have an ISA bus.
> -
> - If unsure, say N.
> -
> # x86_64 have no ISA slots, but can have ISA-style DMA.
> config ISA_DMA_API
> bool "ISA-style DMA support" if (X86_64 && EXPERT)
> diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
> index bfcf7568de32..fe0f2a93055d 100644
> --- a/drivers/iio/dac/Kconfig
> +++ b/drivers/iio/dac/Kconfig
> @@ -264,7 +264,7 @@ config AD8801
>
> config CIO_DAC
> tristate "Measurement Computing CIO-DAC IIO driver"
> - depends on X86 && (ISA_BUS || PC104)
> + depends on X86
> select ISA_BUS_API
> help
> Say yes here to build support for the Measurement Computing CIO-DAC
> --
> 2.25.1
>