2022-09-11 09:04:12

by Mateusz Jończyk

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

Hello,

There are some problems with Kconfig help texts in the kernel. They are
frequently confusing and use language that is difficult to understand
for people unfamiliar with the feature. Sometimes, the help text was not
updated after important kernel or ecosystem changes. References to
something "future" or "old" are also usually given without specifying
any dates.

First version of this patch series was sent out in February 2022.

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: document CONFIG_PCI_MMCONFIG
x86/Kconfig: make CONFIG_PCI_CNB20LE_QUIRK depend on X86_32
x86/Kconfig: document release year of glibc 2.3.3
x86/Kconfig: remove CONFIG_ISA_BUS

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]

arch/x86/Kconfig | 136 ++++++++++++++++++++----------------
arch/x86/kernel/apic/apic.c | 2 +-
drivers/iio/dac/Kconfig | 2 +-
3 files changed, 76 insertions(+), 64 deletions(-)


base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179
--
2.25.1


2022-09-11 09:04:53

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 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]>
---
v2: update entries' order,
Goldfish is now "mostly Android emualator"

arch/x86/Kconfig | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5a0bde075cae..31c2c574c67d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -512,12 +512,12 @@ 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
+ Goldfish (mostly Android emulator)
+ Intel CE media processor (CE4100) SoC
+ Intel MID (Mobile Internet Device)
+ Intel Quark
RDC R-321x SoC
- SGI 320/540 (Visual Workstation)
STA2X11-based (e.g. Northville)
- Moorestown MID devices

If you have one of these systems, or if you want to build a
generic distribution kernel, say Y here - otherwise say N.
@@ -537,6 +537,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-09-11 09:05:23

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 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 28133b5d3f12..70bf4df73fa2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1625,7 +1625,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-09-11 09:05:41

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 09/10] x86/Kconfig: document release year 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]>
---
v2: shorten prompt.

arch/x86/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 31f778b0cd0b..4612c356da4c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2278,7 +2278,7 @@ config DEBUG_HOTPLUG_CPU0

config COMPAT_VDSO
def_bool n
- prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
+ prompt "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-09-11 09:05:53

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 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 28f0c32fc65a..5a0bde075cae 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -642,6 +642,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
@@ -695,17 +720,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():
@@ -715,20 +729,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-09-11 09:06:30

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 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 provide 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]>
Acked-by: William Breathitt Gray <[email protected]>
---
v2: add "Acked by: William Breathitt Gray"

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 4612c356da4c..c8218d310d55 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2759,17 +2759,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 80521bd28d0f..e32245c013b0 100644
--- a/drivers/iio/dac/Kconfig
+++ b/drivers/iio/dac/Kconfig
@@ -275,7 +275,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-09-11 09:16:43

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 08/10] x86/Kconfig: make CONFIG_PCI_CNB20LE_QUIRK depend on X86_32

I was unable to find a good description of the ServerWorks CNB20LE
chipset. However, it was probably exclusively used with the Pentium III
processor (this CPU model was used in all references to it that I
found where the CPU model was provided: dmesgs in [1] and [2];
[3] page 2; [4]-[7]).

As is widely known, the Pentium III processor did not support the 64-bit
mode, support for which was introduced by Intel a couple of years later.
So it is safe to assume that no systems with the CNB20LE chipset have
amd64 and the CONFIG_PCI_CNB20LE_QUIRK may now depend on X86_32.

Additionally, I have determined that most computers with the CNB20LE
chipset did have ACPI support and this driver was inactive on them.
I have submitted a patch to remove this driver, but it was met with
resistance [8].

[1] Jim Studt, Re: Problem with ServerWorks CNB20LE and lost interrupts
Linux Kernel Mailing List, https://lkml.org/lkml/2002/1/11/111

[2] RedHat 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

[4] "Hardware for Linux",
Probe #d6b5151873 of Intel STL2-bd A28808-302 Desktop Computer (STL2)
https://linux-hardware.org/?probe=d6b5151873

[5] "Hardware for Linux", Probe #0b5d843f10 of Compaq ProLiant DL380
https://linux-hardware.org/?probe=0b5d843f10

[6] Ubuntu Forums, Dell Poweredge 2400 - Adaptec SCSI Bus AIC-7880
https://ubuntuforums.org/showthread.php?t=1689552

[7] Ira W. Snyder, "BISECTED: 2.6.35 (and -git) fail to boot: APIC problems"
https://lkml.org/lkml/2010/8/13/220

[8] Bjorn Helgaas, "Re: [PATCH] x86/pci: drop ServerWorks / Broadcom
CNB20LE PCI host bridge driver"
https://lore.kernel.org/lkml/20220318165535.GA840063@bhelgaas/T/

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]>
Cc: Bjorn Helgaas <[email protected]>
---
v2: make CONFIG_PCI_CNB20LE_QUIRK depend on X86_32
(previously only help text and description were changed)
upgrade short description.

arch/x86/Kconfig | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index fdfe8b7e895a..31f778b0cd0b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2739,13 +2739,21 @@ config MMCONF_FAM10H
depends on X86_64 && PCI_MMCONFIG && ACPI

config PCI_CNB20LE_QUIRK
- bool "Read CNB20LE Host Bridge Windows" if EXPERT
- depends on PCI
+ bool "Read PCI host bridge windows from the CNB20LE chipset" if EXPERT
+ depends on X86_32 && 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
+ most probably only 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-09-11 09:18:27

by Mateusz Jończyk

[permalink] [raw]
Subject: [PATCH v2 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 70bf4df73fa2..28f0c32fc65a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -706,18 +706,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():
@@ -729,7 +717,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
@@ -1077,7 +1066,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
@@ -1102,7 +1091,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-09-13 23:12:07

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v2 08/10] x86/Kconfig: make CONFIG_PCI_CNB20LE_QUIRK depend on X86_32

On Sun, Sep 11, 2022 at 10:47:09AM +0200, Mateusz Jończyk wrote:
> I was unable to find a good description of the ServerWorks CNB20LE
> chipset. However, it was probably exclusively used with the Pentium III
> processor (this CPU model was used in all references to it that I
> found where the CPU model was provided: dmesgs in [1] and [2];
> [3] page 2; [4]-[7]).
>
> As is widely known, the Pentium III processor did not support the 64-bit
> mode, support for which was introduced by Intel a couple of years later.
> So it is safe to assume that no systems with the CNB20LE chipset have
> amd64 and the CONFIG_PCI_CNB20LE_QUIRK may now depend on X86_32.
>
> Additionally, I have determined that most computers with the CNB20LE
> chipset did have ACPI support and this driver was inactive on them.
> I have submitted a patch to remove this driver, but it was met with
> resistance [8].

Only because removing the driver appeared to have no demonstrated
benefit and risked breaking old machines.

Making this depend on X86_32 seems plausible to me.

> [8] Bjorn Helgaas, "Re: [PATCH] x86/pci: drop ServerWorks / Broadcom
> CNB20LE PCI host bridge driver"
> https://lore.kernel.org/lkml/20220318165535.GA840063@bhelgaas/T/
>
> 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]>
> Cc: Bjorn Helgaas <[email protected]>
> ---
> v2: make CONFIG_PCI_CNB20LE_QUIRK depend on X86_32
> (previously only help text and description were changed)
> upgrade short description.
>
> arch/x86/Kconfig | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index fdfe8b7e895a..31f778b0cd0b 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2739,13 +2739,21 @@ config MMCONF_FAM10H
> depends on X86_64 && PCI_MMCONFIG && ACPI
>
> config PCI_CNB20LE_QUIRK
> - bool "Read CNB20LE Host Bridge Windows" if EXPERT
> - depends on PCI
> + bool "Read PCI host bridge windows from the CNB20LE chipset" if EXPERT
> + depends on X86_32 && 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
> + most probably only 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
>