Skip to contentSkip to conversation

x86: Remove support for TSC-less and CX8-less CPUs

RFC PATCH In review Ingo Molnar 10 participants 68 messages Apr 25, 2025 – May 15, 2025

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

cover x86: Remove support for TSC-less and CX8-less CPUs

In the x86 architecture we have various complicated hardware emulation facilities on x86-32 to support ancient 32-bit CPUs that very very few people are using with modern kernels. This compatibility glue is sometimes even causing problems that people spend time to resolve, which time could be spent on other things.

As Linus recently remarked:

Quoted 3 lines

I really get the feeling that it's time to leave i486 support behind. There's zero real reason for anybody to waste one second of development effort on this kind of issue.

This series increases minimum kernel support features to include TSC and CX8 (CMPXCHG8B) hardware support, which removes 486 (and derivatives) support and early-586 (and derivatives) support.

Doing this allows the removal of a fair amount of code:

 80 files changed, 38 insertions(+), 14104 deletions(-)

Much of which is the math-emu/ library - but even without math-emu, the simplification is substantial:

 33 files changed, 38 insertions(+), 1081 deletions(-)

This series has 5 main parts:

1) Removal of the main CPU options and their dependencies in the Kconfig space:

x86/cpu: Remove M486/M486SX/ELAN support
x86/cpu: Remove CONFIG_MWINCHIP3D/MWINCHIPC6
x86/cpu: Remove CPU_SUP_UMC_32 support
x86/cpu: Remove TSC-less CONFIG_M586 support

2) Remove platform support for chips that weren't carried forward after these CPUs:

x86/cpu, x86/platform, watchdog: Remove CONFIG_X86_RDC321X support x86/cpu: Remove the CONFIG_X86_INVD_BUG quirk
x86/cpu, cpufreq: Remove AMD ELAN support

3) Remove math-emu/ support:

x86/fpu: Remove MATH_EMULATION and related glue code x86/fpu: Remove the 'no387' boot option x86/fpu: Remove the math-emu/ FPU emulation library

4) Make CONFIG_X86_TSC unconditional and simplify the build-time TSC variances:

x86/cpu: Make CONFIG_X86_TSC unconditional
x86: Remove !CONFIG_X86_TSC code

Note that runtime TSC disabling is still kept in its various forms.

Also note that I kept CONFIG_X86_TSC itself, which is a proxy for a few drivers for 'sane x86', and which might be used in changes still in-flight. There's very little cost to keep this Kconfig option going forward, even though it's always-enabled.

5) Make CONFIG_X86_CX8 unconditional and remove build-time complications:

x86/cpu: Make CONFIG_X86_CX8 unconditional
x86/percpu: Remove !CONFIG_X86_CX8 methods
x86/atomics: Remove !CONFIG_X86_CX8 methods

Note that CONFIG_X86_CX8 is still kept, but not used by anything anymore. We can probably remove it entirely and there's no expectation of pending/outside code having dependency on this.

Note that there's still some stray references to removed platforms in the main x86 Kconfig and Kconfig.x86, and the entire vector of CPU options is probably overly complicated and should probably be replaced with a single option - I'll clean that all up once there's rough agreement about the scope of this RFC series.

The tree can also be found in my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/cpu

Lightly tested.

Thanks,

Ingo

================>
Ingo Molnar (15):
x86/cpu: Remove M486/M486SX/ELAN support
x86/cpu: Remove CONFIG_MWINCHIP3D/MWINCHIPC6
x86/cpu: Remove CPU_SUP_UMC_32 support
x86/cpu: Remove TSC-less CONFIG_M586 support
x86/cpu, x86/platform, watchdog: Remove CONFIG_X86_RDC321X support x86/cpu: Remove the CONFIG_X86_INVD_BUG quirk
x86/cpu, cpufreq: Remove AMD ELAN support
x86/fpu: Remove MATH_EMULATION and related glue code x86/fpu: Remove the 'no387' boot option
x86/fpu: Remove the math-emu/ FPU emulation library x86/cpu: Make CONFIG_X86_TSC unconditional
x86: Remove !CONFIG_X86_TSC code
x86/cpu: Make CONFIG_X86_CX8 unconditional
x86/percpu: Remove !CONFIG_X86_CX8 methods
x86/atomics: Remove !CONFIG_X86_CX8 methods

 Documentation/admin-guide/kernel-parameters.txt |    4 -
 arch/x86/Kconfig                                |   71 +-
 arch/x86/Kconfig.cpu                            |   95 +-
 arch/x86/Kconfig.cpufeatures                    |    2 -
 arch/x86/Makefile                               |    1 -
 arch/x86/Makefile_32.cpu                        |    8 -
 arch/x86/include/asm/asm-prototypes.h           |    4 -
 arch/x86/include/asm/atomic64_32.h              |   17 +-
 arch/x86/include/asm/cmpxchg_32.h               |   86 +-
 arch/x86/include/asm/fpu/api.h                  |    6 -
 arch/x86/include/asm/percpu.h                   |    6 +-
 arch/x86/include/asm/timex.h                    |    3 +-
 arch/x86/include/asm/trace_clock.h              |    8 -
 arch/x86/include/asm/tsc.h                      |   13 +-
 arch/x86/include/asm/vermagic.h                 |   12 -
 arch/x86/kernel/Makefile                        |    4 +-
 arch/x86/kernel/cpu/common.c                    |    7 -
 arch/x86/kernel/cpu/umc.c                       |   26 -
 arch/x86/kernel/fpu/core.c                      |    5 -
 arch/x86/kernel/fpu/init.c                      |    9 +-
 arch/x86/kernel/i8253.c                         |    2 +-
 arch/x86/kernel/traps.c                         |   21 -
 arch/x86/kernel/tsc.c                           |   13 -
 arch/x86/lib/Makefile                           |    4 -
 arch/x86/lib/atomic64_386_32.S                  |  195 ---
 arch/x86/lib/cmpxchg8b_emu.S                    |   97 --
 arch/x86/math-emu/Makefile                      |   30 -
 arch/x86/math-emu/README                        |  427 ------
 arch/x86/math-emu/control_w.h                   |   46 -
 arch/x86/math-emu/div_Xsig.S                    |  367 -----
 arch/x86/math-emu/div_small.S                   |   48 -
 arch/x86/math-emu/errors.c                      |  686 ----------
 arch/x86/math-emu/exception.h                   |   51 -
 arch/x86/math-emu/fpu_arith.c                   |  153 ---
 arch/x86/math-emu/fpu_asm.h                     |   32 -
 arch/x86/math-emu/fpu_aux.c                     |  267 ----
 arch/x86/math-emu/fpu_emu.h                     |  218 ---
 arch/x86/math-emu/fpu_entry.c                   |  718 ----------
 arch/x86/math-emu/fpu_etc.c                     |  136 --
 arch/x86/math-emu/fpu_proto.h                   |  157 ---
 arch/x86/math-emu/fpu_system.h                  |  130 --
 arch/x86/math-emu/fpu_tags.c                    |  116 --
 arch/x86/math-emu/fpu_trig.c                    | 1649 -----------------------
 arch/x86/math-emu/get_address.c                 |  401 ------
 arch/x86/math-emu/load_store.c                  |  322 -----
 arch/x86/math-emu/mul_Xsig.S                    |  179 ---
 arch/x86/math-emu/poly.h                        |  115 --
 arch/x86/math-emu/poly_2xm1.c                   |  146 --
 arch/x86/math-emu/poly_atan.c                   |  209 ---
 arch/x86/math-emu/poly_l2.c                     |  245 ----
 arch/x86/math-emu/poly_sin.c                    |  379 ------
 arch/x86/math-emu/poly_tan.c                    |  213 ---
 arch/x86/math-emu/polynom_Xsig.S                |  137 --
 arch/x86/math-emu/reg_add_sub.c                 |  334 -----
 arch/x86/math-emu/reg_compare.c                 |  479 -------
 arch/x86/math-emu/reg_constant.c                |  123 --
 arch/x86/math-emu/reg_constant.h                |   26 -
 arch/x86/math-emu/reg_convert.c                 |   47 -
 arch/x86/math-emu/reg_divide.c                  |  183 ---
 arch/x86/math-emu/reg_ld_str.c                  | 1220 -----------------
 arch/x86/math-emu/reg_mul.c                     |  116 --
 arch/x86/math-emu/reg_norm.S                    |  150 ---
 arch/x86/math-emu/reg_round.S                   |  711 ----------
 arch/x86/math-emu/reg_u_add.S                   |  169 ---
 arch/x86/math-emu/reg_u_div.S                   |  474 -------
 arch/x86/math-emu/reg_u_mul.S                   |  150 ---
 arch/x86/math-emu/reg_u_sub.S                   |  274 ----
 arch/x86/math-emu/round_Xsig.S                  |  142 --
 arch/x86/math-emu/shr_Xsig.S                    |   89 --
 arch/x86/math-emu/status_w.h                    |   68 -
 arch/x86/math-emu/version.h                     |   12 -
 arch/x86/math-emu/wm_shrx.S                     |  207 ---
 arch/x86/math-emu/wm_sqrt.S                     |  472 -------
 arch/x86/xen/Kconfig                            |    2 +-
 drivers/cpufreq/Kconfig.x86                     |   26 -
 drivers/cpufreq/Makefile                        |    2 -
 drivers/cpufreq/elanfreq.c                      |  227 ----
 drivers/cpufreq/sc520_freq.c                    |  137 --
 drivers/watchdog/Kconfig                        |    2 +-
 lib/atomic64_test.c                             |    4 +-
 80 files changed, 38 insertions(+), 14104 deletions(-)
 delete mode 100644 arch/x86/kernel/cpu/umc.c
 delete mode 100644 arch/x86/lib/atomic64_386_32.S
 delete mode 100644 arch/x86/lib/cmpxchg8b_emu.S
 delete mode 100644 arch/x86/math-emu/Makefile
 delete mode 100644 arch/x86/math-emu/README
 delete mode 100644 arch/x86/math-emu/control_w.h
 delete mode 100644 arch/x86/math-emu/div_Xsig.S
 delete mode 100644 arch/x86/math-emu/div_small.S
 delete mode 100644 arch/x86/math-emu/errors.c
 delete mode 100644 arch/x86/math-emu/exception.h
 delete mode 100644 arch/x86/math-emu/fpu_arith.c
 delete mode 100644 arch/x86/math-emu/fpu_asm.h
 delete mode 100644 arch/x86/math-emu/fpu_aux.c
 delete mode 100644 arch/x86/math-emu/fpu_emu.h
 delete mode 100644 arch/x86/math-emu/fpu_entry.c
 delete mode 100644 arch/x86/math-emu/fpu_etc.c
 delete mode 100644 arch/x86/math-emu/fpu_proto.h
 delete mode 100644 arch/x86/math-emu/fpu_system.h
 delete mode 100644 arch/x86/math-emu/fpu_tags.c
 delete mode 100644 arch/x86/math-emu/fpu_trig.c
 delete mode 100644 arch/x86/math-emu/get_address.c
 delete mode 100644 arch/x86/math-emu/load_store.c
 delete mode 100644 arch/x86/math-emu/mul_Xsig.S
 delete mode 100644 arch/x86/math-emu/poly.h
 delete mode 100644 arch/x86/math-emu/poly_2xm1.c
 delete mode 100644 arch/x86/math-emu/poly_atan.c
 delete mode 100644 arch/x86/math-emu/poly_l2.c
 delete mode 100644 arch/x86/math-emu/poly_sin.c
 delete mode 100644 arch/x86/math-emu/poly_tan.c
 delete mode 100644 arch/x86/math-emu/polynom_Xsig.S
 delete mode 100644 arch/x86/math-emu/reg_add_sub.c
 delete mode 100644 arch/x86/math-emu/reg_compare.c
 delete mode 100644 arch/x86/math-emu/reg_constant.c
 delete mode 100644 arch/x86/math-emu/reg_constant.h
 delete mode 100644 arch/x86/math-emu/reg_convert.c
 delete mode 100644 arch/x86/math-emu/reg_divide.c
 delete mode 100644 arch/x86/math-emu/reg_ld_str.c
 delete mode 100644 arch/x86/math-emu/reg_mul.c
 delete mode 100644 arch/x86/math-emu/reg_norm.S
 delete mode 100644 arch/x86/math-emu/reg_round.S
 delete mode 100644 arch/x86/math-emu/reg_u_add.S
 delete mode 100644 arch/x86/math-emu/reg_u_div.S
 delete mode 100644 arch/x86/math-emu/reg_u_mul.S
 delete mode 100644 arch/x86/math-emu/reg_u_sub.S
 delete mode 100644 arch/x86/math-emu/round_Xsig.S
 delete mode 100644 arch/x86/math-emu/shr_Xsig.S
 delete mode 100644 arch/x86/math-emu/status_w.h
 delete mode 100644 arch/x86/math-emu/version.h
 delete mode 100644 arch/x86/math-emu/wm_shrx.S
 delete mode 100644 arch/x86/math-emu/wm_sqrt.S
 delete mode 100644 drivers/cpufreq/elanfreq.c
 delete mode 100644 drivers/cpufreq/sc520_freq.c
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/15 x86/cpu: Remove M486/M486SX/ELAN support

---
 arch/x86/Kconfig                | 10 ----------
 arch/x86/Kconfig.cpu            | 41 +++++++++--------------------------------
 arch/x86/Makefile_32.cpu        |  2 --
 arch/x86/include/asm/vermagic.h |  6 ------
 4 files changed, 9 insertions(+), 50 deletions(-)
arch/x86/Kconfig +0 -10
index 4b9f378e05f6..7f1a405efde0 100644
@@ -446,11 +446,6 @@ config SMP
 	  uniprocessor machines. On a uniprocessor machine, the kernel
 	  will run faster if you say N here.
 
-	  Note that if you say Y here and choose architecture "586" or
-	  "Pentium" under "Processor family", the kernel will not work on 486
-	  architectures. Similarly, multiprocessor kernels for the "PPro"
-	  architecture may not work on all Pentium based boards.
-
 	  People using multiprocessor machines who say Y here should also say
 	  Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
 	  Management" code will be disabled if you say Y here.
@@ -2756,11 +2751,6 @@ menuconfig APM
 	  manpage ("man 8 hdparm") for that), and it doesn't turn off
 	  VESA-compliant "green" monitors.
 
-	  This driver does not support the TI 4000M TravelMate and the ACER
-	  486/DX4/75 because they don't have compliant BIOSes. Many "green"
-	  desktop machines also don't have compliant BIOSes, and this driver
-	  may cause those machines to panic during the boot phase.
-
 	  Generally, if you don't have a battery in your machine, there isn't
 	  much point in using this driver and you should say N. If you get
 	  random kernel OOPSes or reboots that don't seem to be related to
arch/x86/Kconfig.cpu +9 -32

95 lines not on this page · raw message

arch/x86/Makefile_32.cpu +0 -2
index af7de9a42752..98ca6dd70d01 100644
@@ -10,8 +10,6 @@ else
 align		:= -falign-functions=0 -falign-jumps=0 -falign-loops=0
 endif
 
-cflags-$(CONFIG_M486SX)		+= -march=i486
-cflags-$(CONFIG_M486)		+= -march=i486
 cflags-$(CONFIG_M586)		+= -march=i586
 cflags-$(CONFIG_M586TSC)	+= -march=i586
 cflags-$(CONFIG_M586MMX)	+= -march=pentium-mmx
arch/x86/include/asm/vermagic.h +0 -6
index 5d471253c755..eda233a90ea8 100644
@@ -5,10 +5,6 @@
 
 #ifdef CONFIG_X86_64
 /* X86_64 does not define MODULE_PROC_FAMILY */
-#elif defined CONFIG_M486SX
-#define MODULE_PROC_FAMILY "486SX "
-#elif defined CONFIG_M486
-#define MODULE_PROC_FAMILY "486 "
 #elif defined CONFIG_M586
 #define MODULE_PROC_FAMILY "586 "
 #elif defined CONFIG_M586TSC
@@ -31,8 +27,6 @@
 #define MODULE_PROC_FAMILY "K6 "
 #elif defined CONFIG_MK7
 #define MODULE_PROC_FAMILY "K7 "
-#elif defined CONFIG_MELAN
-#define MODULE_PROC_FAMILY "ELAN "
 #elif defined CONFIG_MCRUSOE
 #define MODULE_PROC_FAMILY "CRUSOE "
 #elif defined CONFIG_MEFFICEON
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/15 x86/cpu: Remove CONFIG_MWINCHIP3D/MWINCHIPC6

In reply to Ingo Molnar

These CPUs lack CMPXCHG8B support, according to Arnd Bergmann:

| "Winchip6 (486-class, no tsc, no cx8) and Winchip3D | (486-class, with tsc but no cx8)"

---
 arch/x86/Kconfig.cpu            | 28 ++++------------------------
 arch/x86/Makefile_32.cpu        |  2 --
 arch/x86/include/asm/vermagic.h |  4 ----
 3 files changed, 4 insertions(+), 30 deletions(-)
arch/x86/Kconfig.cpu +4 -24
index 881d5f5ae7d5..f656033b3a8a 100644
@@ -32,8 +32,6 @@ choice
 	  - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
 	  - "Crusoe" for the Transmeta Crusoe series.
 	  - "Efficeon" for the Transmeta Efficeon series.
-	  - "Winchip-C6" for original IDT Winchip.
-	  - "Winchip-2" for IDT Winchips with 3dNow! capabilities.
 	  - "AMD Elan" for the 32-bit AMD Elan embedded CPU.
 	  - "GeodeGX1" for Geode GX1 (Cyrix MediaGX).
 	  - "Geode GX/LX" For AMD Geode GX and LX processors.
@@ -155,24 +153,6 @@ config MEFFICEON
 	help
 	  Select this for a Transmeta Efficeon processor.
 
-config MWINCHIPC6
-	bool "Winchip-C6"
-	depends on X86_32
-	help
-	  Select this for an IDT Winchip C6 chip.  Linux and GCC
-	  treat this chip as a 586TSC with some extended instructions
-	  and alignment requirements.
-
-config MWINCHIP3D
-	bool "Winchip-2/Winchip-2A/Winchip-3"
-	depends on X86_32
-	help
-	  Select this for an IDT Winchip-2, 2A or 3.  Linux and GCC
-	  treat this chip as a 586TSC with some extended instructions
-	  and alignment requirements.  Also enable out of order memory
-	  stores for this CPU, which can increase performance of some
-	  operations.
-
 config MGEODEGX1
 	bool "GeodeGX1"
 	depends on X86_32
@@ -246,7 +226,7 @@ config X86_L1_CACHE_SHIFT
 	default "7" if MPENTIUM4
 	default "6" if MK7 || MPENTIUMM || MATOM || MVIAC7 || X86_GENERIC || X86_64
 	default "4" if MGEODEGX1
-	default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
+	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
 
 config X86_F00F_BUG
 	def_bool y
@@ -258,7 +238,7 @@ config X86_INVD_BUG
 
 config X86_ALIGNMENT_16
 	def_bool y
-	depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK6 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
+	depends on MCYRIXIII || MK6 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
 
 config X86_INTEL_USERCOPY
 	def_bool y
@@ -266,7 +246,7 @@ config X86_INTEL_USERCOPY
 
 config X86_USE_PPRO_CHECKSUM
 	def_bool y
-	depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MATOM
+	depends on MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MATOM
 
 config X86_TSC
 	def_bool y
@@ -295,7 +275,7 @@ config X86_MINIMUM_CPU_FAMILY
 
 config X86_DEBUGCTLMSR
 	def_bool y
-	depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586) && !UML
+	depends on !(MK6 || MCYRIXIII || M586MMX || M586TSC || M586) && !UML
 
 config IA32_FEAT_CTL
 	def_bool y
arch/x86/Makefile_32.cpu +0 -2
index 98ca6dd70d01..2dda0a19b06a 100644
@@ -24,8 +24,6 @@ cflags-$(CONFIG_MK6)		+= -march=k6
 cflags-$(CONFIG_MK7)		+= -march=athlon
 cflags-$(CONFIG_MCRUSOE)	+= -march=i686 $(align)
 cflags-$(CONFIG_MEFFICEON)	+= -march=i686 $(call tune,pentium3) $(align)
-cflags-$(CONFIG_MWINCHIPC6)	+= $(call cc-option,-march=winchip-c6,-march=i586)
-cflags-$(CONFIG_MWINCHIP3D)	+= $(call cc-option,-march=winchip2,-march=i586)
 cflags-$(CONFIG_MCYRIXIII)	+= $(call cc-option,-march=c3,-march=i486) $(align)
 cflags-$(CONFIG_MVIAC3_2)	+= $(call cc-option,-march=c3-2,-march=i686)
 cflags-$(CONFIG_MVIAC7)		+= -march=i686
arch/x86/include/asm/vermagic.h +0 -4
index eda233a90ea8..b3a8beb32dfd 100644
@@ -31,10 +31,6 @@
 #define MODULE_PROC_FAMILY "CRUSOE "
 #elif defined CONFIG_MEFFICEON
 #define MODULE_PROC_FAMILY "EFFICEON "
-#elif defined CONFIG_MWINCHIPC6
-#define MODULE_PROC_FAMILY "WINCHIPC6 "
-#elif defined CONFIG_MWINCHIP3D
-#define MODULE_PROC_FAMILY "WINCHIP3D "
 #elif defined CONFIG_MCYRIXIII
 #define MODULE_PROC_FAMILY "CYRIXIII "
 #elif defined CONFIG_MVIAC3_2
Signature · 1 line
2.45.2
#3 lore raw

PATCH 3/15 x86/cpu: Remove CPU_SUP_UMC_32 support

In reply to Ingo Molnar

These are 486 based CPUs.

---
 arch/x86/Kconfig.cpu      | 14 --------------
 arch/x86/kernel/cpu/umc.c | 26 --------------------------
 2 files changed, 40 deletions(-)
arch/x86/Kconfig.cpu +0 -14
index f656033b3a8a..df586ff2178f 100644
@@ -376,20 +376,6 @@ config CPU_SUP_TRANSMETA_32
 
 	  If unsure, say N.
 
-config CPU_SUP_UMC_32
-	default y
-	bool "Support UMC processors" if PROCESSOR_SELECT
-	depends on M486SX || M486 || (EXPERT && !64BIT)
-	help
-	  This enables detection, tunings and quirks for UMC processors
-
-	  You need this enabled if you want your kernel to run on a
-	  UMC CPU. Disabling this option on other types of CPUs
-	  makes the kernel a tiny bit smaller. Disabling it on a UMC
-	  CPU might render the kernel unbootable.
-
-	  If unsure, say N.
-
 config CPU_SUP_ZHAOXIN
 	default y
 	bool "Support Zhaoxin processors" if PROCESSOR_SELECT
arch/x86/kernel/cpu/umc.c deleted +0 -26
deleted file mode 100644
index 65a58a390fc3..000000000000
@@ -1,26 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/kernel.h>
-#include <asm/processor.h>
-#include "cpu.h"
-
-/*
- * UMC chips appear to be only either 386 or 486,
- * so no special init takes place.
- */
-
-static const struct cpu_dev umc_cpu_dev = {
-	.c_vendor	= "UMC",
-	.c_ident	= { "UMC UMC UMC" },
-	.legacy_models	= {
-		{ .family = 4, .model_names =
-		  {
-			  [1] = "U5D",
-			  [2] = "U5S",
-		  }
-		},
-	},
-	.c_x86_vendor	= X86_VENDOR_UMC,
-};
-
-cpu_dev_register(umc_cpu_dev);
-
Signature · 1 line
2.45.2
#4 lore raw

PATCH 4/15 x86/cpu: Remove TSC-less CONFIG_M586 support

In reply to Ingo Molnar

Remove support for TSC-less Pentium variants.

All TSC-capable Pentium variants, derivatives and clones should still work under the M586TSC or M586MMX options.

---
 arch/x86/Kconfig.cpu            | 10 +---------
 arch/x86/Makefile_32.cpu        |  1 -
 arch/x86/include/asm/vermagic.h |  2 --
 3 files changed, 1 insertion(+), 12 deletions(-)
arch/x86/Kconfig.cpu +1 -9
index df586ff2178f..e9499e58776c 100644
@@ -43,14 +43,6 @@ choice
 	  See each option's help text for additional details. If you don't know
 	  what to do, choose "Pentium-Pro".
 
-config M586
-	bool "586/K5/5x86/6x86/6x86MX"
-	depends on X86_32
-	help
-	  Select this for an 586 or 686 series processor such as the AMD K5,
-	  the Cyrix 5x86, 6x86 and 6x86MX.  This choice does not
-	  assume the RDTSC (Read Time Stamp Counter) instruction.
-
 config M586TSC
 	bool "Pentium-Classic"
 	depends on X86_32
@@ -226,7 +218,7 @@ config X86_L1_CACHE_SHIFT
 	default "7" if MPENTIUM4
 	default "6" if MK7 || MPENTIUMM || MATOM || MVIAC7 || X86_GENERIC || X86_64
 	default "4" if MGEODEGX1
-	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
+	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MGEODE_LX
 
 config X86_F00F_BUG
 	def_bool y
arch/x86/Makefile_32.cpu +0 -1
index 2dda0a19b06a..43226c9fe795 100644
@@ -10,7 +10,6 @@ else
 align		:= -falign-functions=0 -falign-jumps=0 -falign-loops=0
 endif
 
-cflags-$(CONFIG_M586)		+= -march=i586
 cflags-$(CONFIG_M586TSC)	+= -march=i586
 cflags-$(CONFIG_M586MMX)	+= -march=pentium-mmx
 cflags-$(CONFIG_M686)		+= -march=i686
arch/x86/include/asm/vermagic.h +0 -2
index b3a8beb32dfd..e26061df0c9b 100644
@@ -5,8 +5,6 @@
 
 #ifdef CONFIG_X86_64
 /* X86_64 does not define MODULE_PROC_FAMILY */
-#elif defined CONFIG_M586
-#define MODULE_PROC_FAMILY "586 "
 #elif defined CONFIG_M586TSC
 #define MODULE_PROC_FAMILY "586TSC "
 #elif defined CONFIG_M586MMX
Signature · 1 line
2.45.2
#6 lore raw

PATCH 5/15 x86/cpu, x86/platform, watchdog: Remove CONFIG_X86_RDC321X support

In reply to Ingo Molnar

This depends on the to-be-removed M486 CPU support.

Note that we still keep the RDC321X MFD, watchdog and GPIO drivers, because apparently there were 586/686 CPUs offered with the RDC321X, according to Arnd Bergmann:

| "the [RDC321X] product line is still actively developed by RDC
|  and DM&P, and I suspect that some of the drivers are still used
|  on 586tsc-class (vortex86dx, vortex86mx) and 686-class
|  (vortex86dx3, vortex86ex) SoCs that do run modern kernels and
|  get updates."

For this reason, update the watchdog driver and enable it on the broader 32-bit landscape:

- depends on X86_RDC321X || COMPILE_TEST
+ depends on X86_32 || COMPILE_TEST

The MFD and GPIO drivers were already independent of CONFIG_X86_RDC321X.

---
 arch/x86/Kconfig         | 11 -----------
 drivers/watchdog/Kconfig |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)
arch/x86/Kconfig +0 -11
index 7f1a405efde0..62a9db3efa93 100644
@@ -673,17 +673,6 @@ 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 X86_INTEL_LPSS
 	bool "Intel Low Power Subsystem Support"
 	depends on X86 && ACPI && PCI
drivers/watchdog/Kconfig +1 -1
index 0d8d37f712e8..fcf0853a64d8 100644
@@ -1516,7 +1516,7 @@ config NV_TCO
 
 config RDC321X_WDT
 	tristate "RDC R-321x SoC watchdog"
-	depends on X86_RDC321X || COMPILE_TEST
+	depends on X86_32 || COMPILE_TEST
 	depends on PCI
 	help
 	  This is the driver for the built in hardware watchdog
Signature · 1 line
2.45.2
#7 lore raw

PATCH 6/15 x86/cpu: Remove the CONFIG_X86_INVD_BUG quirk

In reply to Ingo Molnar

Now that support for 486 CPUs is gone, remove this quirk as well.

---
 arch/x86/Kconfig.cpu    | 4 ----
 arch/x86/kernel/traps.c | 7 -------
 2 files changed, 11 deletions(-)
arch/x86/Kconfig.cpu +0 -4
index e9499e58776c..ab4988e06d86 100644
@@ -224,10 +224,6 @@ config X86_F00F_BUG
 	def_bool y
 	depends on M586MMX || M586TSC || M586
 
-config X86_INVD_BUG
-	def_bool y
-	depends on M486SX || M486
-
 config X86_ALIGNMENT_16
 	def_bool y
 	depends on MCYRIXIII || MK6 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
arch/x86/kernel/traps.c +0 -7
index 9f88b8a78e50..8d5bbac04435 100644
@@ -1345,13 +1345,6 @@ DEFINE_IDTENTRY(exc_coprocessor_error)
 
 DEFINE_IDTENTRY(exc_simd_coprocessor_error)
 {
-	if (IS_ENABLED(CONFIG_X86_INVD_BUG)) {
-		/* AMD 486 bug: INVD in CPL 0 raises #XF instead of #GP */
-		if (!static_cpu_has(X86_FEATURE_XMM)) {
-			__exc_general_protection(regs, 0);
-			return;
-		}
-	}
 	math_error(regs, X86_TRAP_XF);
 }
 
Signature · 1 line
2.45.2
#8 lore raw

PATCH 7/15 x86/cpu, cpufreq: Remove AMD ELAN support

In reply to Ingo Molnar
---
 arch/x86/Makefile_32.cpu     |   3 -
 drivers/cpufreq/Kconfig.x86  |  26 -----
 drivers/cpufreq/Makefile     |   2 -
 drivers/cpufreq/elanfreq.c   | 227 -------------------------------------------
 drivers/cpufreq/sc520_freq.c | 137 --------------------------
 5 files changed, 395 deletions(-)
arch/x86/Makefile_32.cpu +0 -3
index 43226c9fe795..f5e933077bf4 100644
@@ -28,9 +28,6 @@ cflags-$(CONFIG_MVIAC3_2)	+= $(call cc-option,-march=c3-2,-march=i686)
 cflags-$(CONFIG_MVIAC7)		+= -march=i686
 cflags-$(CONFIG_MATOM)		+= -march=atom
 
-# AMD Elan support
-cflags-$(CONFIG_MELAN)		+= -march=i486
-
 # Geode GX1 support
 cflags-$(CONFIG_MGEODEGX1)	+= -march=pentium-mmx
 cflags-$(CONFIG_MGEODE_LX)	+= $(call cc-option,-march=geode,-march=pentium-mmx)
drivers/cpufreq/Kconfig.x86 +0 -26
index 2c5c228408bf..dcd78ae62e47 100644
@@ -112,32 +112,6 @@ config X86_ACPI_CPUFREQ_CPB
 	  By enabling this option the acpi_cpufreq driver provides the old
 	  entry in addition to the new boost ones, for compatibility reasons.
 
-config ELAN_CPUFREQ
-	tristate "AMD Elan SC400 and SC410"
-	depends on MELAN
-	help
-	  This adds the CPUFreq driver for AMD Elan SC400 and SC410
-	  processors.
-
-	  You need to specify the processor maximum speed as boot
-	  parameter: elanfreq=maxspeed (in kHz) or as module
-	  parameter "max_freq".
-
-	  For details, take a look at <file:Documentation/cpu-freq/>.
-
-	  If in doubt, say N.
-
-config SC520_CPUFREQ
-	tristate "AMD Elan SC520"
-	depends on MELAN
-	help
-	  This adds the CPUFreq driver for AMD Elan SC520 processor.
-
-	  For details, take a look at <file:Documentation/cpu-freq/>.
-
-	  If in doubt, say N.
-
-
 config X86_POWERNOW_K6
 	tristate "AMD Mobile K6-2/K6-3 PowerNow!"
 	depends on X86_32
drivers/cpufreq/Makefile +0 -2
index 22ab45209f9b..701d90423b75 100644
@@ -38,8 +38,6 @@ obj-$(CONFIG_X86_POWERNOW_K6)		+= powernow-k6.o
 obj-$(CONFIG_X86_POWERNOW_K7)		+= powernow-k7.o
 obj-$(CONFIG_X86_LONGHAUL)		+= longhaul.o
 obj-$(CONFIG_X86_E_POWERSAVER)		+= e_powersaver.o
-obj-$(CONFIG_ELAN_CPUFREQ)		+= elanfreq.o
-obj-$(CONFIG_SC520_CPUFREQ)		+= sc520_freq.o
 obj-$(CONFIG_X86_LONGRUN)		+= longrun.o
 obj-$(CONFIG_X86_GX_SUSPMOD)		+= gx-suspmod.o
 obj-$(CONFIG_X86_SPEEDSTEP_ICH)		+= speedstep-ich.o
drivers/cpufreq/elanfreq.c deleted +0 -227

227 lines not on this page · raw message

drivers/cpufreq/sc520_freq.c deleted +0 -137

137 lines not on this page · raw message

Signature · 1 line
2.45.2
#9 lore raw

PATCH 8/15 x86/fpu: Remove MATH_EMULATION and related glue code

In reply to Ingo Molnar
---
 arch/x86/Kconfig               | 27 ---------------------------
 arch/x86/Kconfig.cpufeatures   |  1 -
 arch/x86/Makefile              |  1 -
 arch/x86/include/asm/fpu/api.h |  6 ------
 arch/x86/kernel/fpu/core.c     |  5 -----
 arch/x86/kernel/fpu/init.c     |  9 +--------
 arch/x86/kernel/traps.c        | 14 --------------
 7 files changed, 1 insertion(+), 62 deletions(-)
arch/x86/Kconfig +0 -27
index 62a9db3efa93..cd9dd10b15d2 100644
@@ -1636,33 +1636,6 @@ config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK
 	  Set whether the default state of memory_corruption_check is
 	  on or off.
 
-config MATH_EMULATION
-	bool
-	depends on MODIFY_LDT_SYSCALL
-	prompt "Math emulation" if X86_32 && (M486SX || MELAN)
-	help
-	  Linux can emulate a math coprocessor (used for floating point
-	  operations) if you don't have one. 486DX and Pentium processors have
-	  a math coprocessor built in, 486SX and 386 do not, unless you added
-	  a 487DX or 387, respectively. (The messages during boot time can
-	  give you some hints here ["man dmesg"].) Everyone needs either a
-	  coprocessor or this emulation.
-
-	  If you don't have a math coprocessor, you need to say Y here; if you
-	  say Y here even though you have a coprocessor, the coprocessor will
-	  be used nevertheless. (This behavior can be changed with the kernel
-	  command line option "no387", which comes handy if your coprocessor
-	  is broken. Try "man bootparam" or see the documentation of your boot
-	  loader (lilo or loadlin) about how to pass options to the kernel at
-	  boot time.) This means that it is a good idea to say Y here if you
-	  intend to use this kernel on different machines.
-
-	  More information about the internals of the Linux math coprocessor
-	  emulation can be found in <file:arch/x86/math-emu/README>.
-
-	  If you are not sure, say Y; apart from resulting in a 66 KB bigger
-	  kernel, it won't hurt.
-
 config MTRR
 	def_bool y
 	prompt "MTRR (Memory Type Range Register) support" if EXPERT
arch/x86/Kconfig.cpufeatures +0 -1
index e12d5b7e39a2..cd551818f451 100644
@@ -66,7 +66,6 @@ config X86_REQUIRED_FEATURE_UP
 
 config X86_REQUIRED_FEATURE_FPU
 	def_bool y
-	depends on !MATH_EMULATION
 
 config X86_REQUIRED_FEATURE_PAE
 	def_bool y
arch/x86/Makefile +0 -1
index 594723005d95..15975f63952e 100644
@@ -284,7 +284,6 @@ archprepare: $(cpufeaturemasks.hdr)
 libs-y  += arch/x86/lib/
 
 # drivers-y are linked after core-y
-drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
 drivers-$(CONFIG_PCI)            += arch/x86/pci/
 
 # suspend and hibernation support
arch/x86/include/asm/fpu/api.h +0 -6
index f42de5f05e7e..def9f7261b0d 100644
@@ -119,12 +119,6 @@ extern void fpu__init_system(void);
 extern void fpu__init_check_bugs(void);
 extern void fpu__resume_cpu(void);
 
-#ifdef CONFIG_MATH_EMULATION
-extern void fpstate_init_soft(struct swregs_state *soft);
-#else
-static inline void fpstate_init_soft(struct swregs_state *soft) {}
-#endif
-
 /* State tracking */
 DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
 
arch/x86/kernel/fpu/core.c +0 -5
index 91d6341f281f..59a4f430b46e 100644
@@ -512,11 +512,6 @@ static inline void fpstate_init_fstate(struct fpstate *fpstate)
  */
 void fpstate_init_user(struct fpstate *fpstate)
 {
-	if (!cpu_feature_enabled(X86_FEATURE_FPU)) {
-		fpstate_init_soft(&fpstate->regs.soft);
-		return;
-	}
-
 	xstate_init_xcomp_bv(&fpstate->regs.xsave, fpstate->xfeatures);
 
 	if (cpu_feature_enabled(X86_FEATURE_FXSR))
arch/x86/kernel/fpu/init.c +1 -8
index 998a08f17e33..7f64d0677160 100644
@@ -36,12 +36,7 @@ static void fpu__init_cpu_generic(void)
 	write_cr0(cr0);
 
 	/* Flush out any pending x87 state: */
-#ifdef CONFIG_MATH_EMULATION
-	if (!boot_cpu_has(X86_FEATURE_FPU))
-		fpstate_init_soft(&current->thread.fpu.fpstate->regs.soft);
-	else
-#endif
-		asm volatile ("fninit");
+	asm volatile ("fninit");
 }
 
 /*
@@ -81,13 +76,11 @@ static void __init fpu__init_system_early_generic(void)
 			setup_clear_cpu_cap(X86_FEATURE_FPU);
 	}
 
-#ifndef CONFIG_MATH_EMULATION
 	if (!test_cpu_cap(&boot_cpu_data, X86_FEATURE_FPU)) {
 		pr_emerg("x86/fpu: Giving up, no FPU found and no math emulation present\n");
 		for (;;)
 			asm volatile("hlt");
 	}
-#endif
 }
 
 /*
arch/x86/kernel/traps.c +0 -14
index 8d5bbac04435..6467b7832fea 100644
@@ -1413,20 +1413,6 @@ DEFINE_IDTENTRY(exc_device_not_available)
 	if (handle_xfd_event(regs))
 		return;
 
-#ifdef CONFIG_MATH_EMULATION
-	if (!boot_cpu_has(X86_FEATURE_FPU) && (cr0 & X86_CR0_EM)) {
-		struct math_emu_info info = { };
-
-		cond_local_irq_enable(regs);
-
-		info.regs = regs;
-		math_emulate(&info);
-
-		cond_local_irq_disable(regs);
-		return;
-	}
-#endif
-
 	/* This should not happen. */
 	if (WARN(cr0 & X86_CR0_TS, "CR0.TS was set")) {
 		/* Try to fix it up and carry on. */
Signature · 1 line
2.45.2
#10 lore raw

PATCH 9/15 x86/fpu: Remove the 'no387' boot option

In reply to Ingo Molnar

Without math emulation there's no point to this option.

---
 Documentation/admin-guide/kernel-parameters.txt |  4 ----
 arch/x86/Kconfig                                | 20 +++++++++-----------
 arch/x86/kernel/cpu/common.c                    |  7 -------
 3 files changed, 9 insertions(+), 22 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +0 -4
index d9fd26b95b34..6d391d76336f 100644
@@ -4049,10 +4049,6 @@
 			These settings can be accessed at runtime via
 			the nmi_watchdog and hardlockup_panic sysctls.
 
-	no387		[BUGS=X86-32] Tells the kernel to use the 387 maths
-			emulation library even if a 387 maths coprocessor
-			is present.
-
 	no4lvl		[RISCV,EARLY] Disable 4-level and 5-level paging modes.
 			Forces kernel to use 3-level paging instead.
 
arch/x86/Kconfig +9 -11
index cd9dd10b15d2..137b5ddf1f86 100644
@@ -2725,18 +2725,16 @@ menuconfig APM
 	  1) make sure that you have enough swap space and that it is
 	  enabled.
 	  2) pass the "idle=poll" option to the kernel
-	  3) switch on floating point emulation in the kernel and pass
-	  the "no387" option to the kernel
-	  4) pass the "floppy=nodma" option to the kernel
-	  5) pass the "mem=4M" option to the kernel (thereby disabling
+	  3) pass the "floppy=nodma" option to the kernel
+	  4) pass the "mem=4M" option to the kernel (thereby disabling
 	  all but the first 4 MB of RAM)
-	  6) make sure that the CPU is not over clocked.
-	  7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/>
-	  8) disable the cache from your BIOS settings
-	  9) install a fan for the video card or exchange video RAM
-	  10) install a better fan for the CPU
-	  11) exchange RAM chips
-	  12) exchange the motherboard.
+	  5) make sure that the CPU is not over clocked.
+	  6) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/>
+	  7) disable the cache from your BIOS settings
+	  8) install a fan for the video card or exchange video RAM
+	  9) install a better fan for the CPU
+	  10) exchange RAM chips
+	  11) exchange the motherboard.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called apm.
arch/x86/kernel/cpu/common.c +0 -7
index 12126adbc3a9..1755ef511fd7 100644
@@ -1574,13 +1574,6 @@ static void __init cpu_parse_early_param(void)
 	int arglen;
 
 #ifdef CONFIG_X86_32
-	if (cmdline_find_option_bool(boot_command_line, "no387"))
-#ifdef CONFIG_MATH_EMULATION
-		setup_clear_cpu_cap(X86_FEATURE_FPU);
-#else
-		pr_err("Option 'no387' required CONFIG_MATH_EMULATION enabled.\n");
-#endif
-
 	if (cmdline_find_option_bool(boot_command_line, "nofxsr"))
 		setup_clear_cpu_cap(X86_FEATURE_FXSR);
 #endif
Signature · 1 line
2.45.2
#11 lore raw

PATCH 10/15 x86/fpu: Remove the math-emu/ FPU emulation library

In reply to Ingo Molnar

Now that all enabling code is gone, remove the
FPU emulation library.

---
 arch/x86/math-emu/Makefile       |   30 -
 arch/x86/math-emu/README         |  427 ----------
 arch/x86/math-emu/control_w.h    |   46 --
 arch/x86/math-emu/div_Xsig.S     |  367 ---------
 arch/x86/math-emu/div_small.S    |   48 --
 arch/x86/math-emu/errors.c       |  686 ----------------
 arch/x86/math-emu/exception.h    |   51 --
 arch/x86/math-emu/fpu_arith.c    |  153 ----
 arch/x86/math-emu/fpu_asm.h      |   32 -
 arch/x86/math-emu/fpu_aux.c      |  267 ------
 arch/x86/math-emu/fpu_emu.h      |  218 -----
 arch/x86/math-emu/fpu_entry.c    |  718 -----------------
 arch/x86/math-emu/fpu_etc.c      |  136 ----
 arch/x86/math-emu/fpu_proto.h    |  157 ----
 arch/x86/math-emu/fpu_system.h   |  130 ---
 arch/x86/math-emu/fpu_tags.c     |  116 ---
 arch/x86/math-emu/fpu_trig.c     | 1649 --------------------------------------
 arch/x86/math-emu/get_address.c  |  401 ---------
 arch/x86/math-emu/load_store.c   |  322 --------
 arch/x86/math-emu/mul_Xsig.S     |  179 -----
 arch/x86/math-emu/poly.h         |  115 ---
 arch/x86/math-emu/poly_2xm1.c    |  146 ----
 arch/x86/math-emu/poly_atan.c    |  209 -----
 arch/x86/math-emu/poly_l2.c      |  245 ------
 arch/x86/math-emu/poly_sin.c     |  379 ---------
 arch/x86/math-emu/poly_tan.c     |  213 -----
 arch/x86/math-emu/polynom_Xsig.S |  137 ----
 arch/x86/math-emu/reg_add_sub.c  |  334 --------
 arch/x86/math-emu/reg_compare.c  |  479 -----------
 arch/x86/math-emu/reg_constant.c |  123 ---
 arch/x86/math-emu/reg_constant.h |   26 -
 arch/x86/math-emu/reg_convert.c  |   47 --
 arch/x86/math-emu/reg_divide.c   |  183 -----
 arch/x86/math-emu/reg_ld_str.c   | 1220 ----------------------------
 arch/x86/math-emu/reg_mul.c      |  116 ---
 arch/x86/math-emu/reg_norm.S     |  150 ----
 arch/x86/math-emu/reg_round.S    |  711 ----------------
 arch/x86/math-emu/reg_u_add.S    |  169 ----
 arch/x86/math-emu/reg_u_div.S    |  474 -----------
 arch/x86/math-emu/reg_u_mul.S    |  150 ----
 arch/x86/math-emu/reg_u_sub.S    |  274 -------
 arch/x86/math-emu/round_Xsig.S   |  142 ----
 arch/x86/math-emu/shr_Xsig.S     |   89 --
 arch/x86/math-emu/status_w.h     |   68 --
 arch/x86/math-emu/version.h      |   12 -
 arch/x86/math-emu/wm_shrx.S      |  207 -----
 arch/x86/math-emu/wm_sqrt.S      |  472 -----------
 47 files changed, 13023 deletions(-)
arch/x86/math-emu/Makefile deleted +0 -30
deleted file mode 100644
index 02211fc6f2ec..000000000000
@@ -1,30 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-#               Makefile for wm-FPU-emu
-#
-
-#DEBUG	= -DDEBUGGING
-DEBUG	=
-PARANOID = -DPARANOID
-ccflags-y += $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION)
-asflags-y += $(PARANOID)
-
-# From 'C' language sources:
-C_OBJS =fpu_entry.o errors.o \
-	fpu_arith.o fpu_aux.o fpu_etc.o fpu_tags.o fpu_trig.o \
-	load_store.o get_address.o \
-	poly_atan.o poly_l2.o poly_2xm1.o poly_sin.o poly_tan.o \
-	reg_add_sub.o reg_compare.o reg_constant.o reg_convert.o \
-	reg_ld_str.o reg_divide.o reg_mul.o
-
-# From 80x86 assembler sources:
-A_OBJS =reg_u_add.o reg_u_div.o reg_u_mul.o reg_u_sub.o \
-	div_small.o reg_norm.o reg_round.o \
-	wm_shrx.o wm_sqrt.o \
-	div_Xsig.o polynom_Xsig.o round_Xsig.o \
-	shr_Xsig.o mul_Xsig.o
-
-obj-y =$(C_OBJS) $(A_OBJS)
-
-proto:
-	cproto -e -DMAKING_PROTO *.c >fpu_proto.h
arch/x86/math-emu/README deleted +0 -427

427 lines not on this page · raw message

arch/x86/math-emu/control_w.h deleted +0 -46

46 lines not on this page · raw message

arch/x86/math-emu/div_Xsig.S deleted +0 -367

367 lines not on this page · raw message

arch/x86/math-emu/div_small.S deleted +0 -48

48 lines not on this page · raw message

arch/x86/math-emu/errors.c deleted +0 -686

686 lines not on this page · raw message

arch/x86/math-emu/exception.h deleted +0 -51

51 lines not on this page · raw message

arch/x86/math-emu/fpu_arith.c deleted +0 -153

153 lines not on this page · raw message

arch/x86/math-emu/fpu_asm.h deleted +0 -32
deleted file mode 100644
index a83353d5271c..000000000000
@@ -1,32 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*---------------------------------------------------------------------------+
- |  fpu_asm.h                                                                |
- |                                                                           |
- | Copyright (C) 1992,1995,1997                                              |
- |                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
- |                       Australia.  E-mail [email protected]               |
- |                                                                           |
- +---------------------------------------------------------------------------*/
-
-#ifndef _FPU_ASM_H_
-#define _FPU_ASM_H_
-
-#include <linux/linkage.h>
-
-#define	EXCEPTION	FPU_exception
-
-#define PARAM1	8(%ebp)
-#define	PARAM2	12(%ebp)
-#define	PARAM3	16(%ebp)
-#define	PARAM4	20(%ebp)
-#define	PARAM5	24(%ebp)
-#define	PARAM6	28(%ebp)
-#define	PARAM7	32(%ebp)
-
-#define SIGL_OFFSET 0
-#define	EXP(x)	8(x)
-#define SIG(x)	SIGL_OFFSET##(x)
-#define	SIGL(x)	SIGL_OFFSET##(x)
-#define	SIGH(x)	4(x)
-
-#endif /* _FPU_ASM_H_ */
arch/x86/math-emu/fpu_aux.c deleted +0 -267

267 lines not on this page · raw message

arch/x86/math-emu/fpu_emu.h deleted +0 -218

218 lines not on this page · raw message

arch/x86/math-emu/fpu_entry.c deleted +0 -718

675 lines not on this page · raw message

arch/x86/math-emu/fpu_etc.c deleted +0 -136

136 lines not on this page · raw message

arch/x86/math-emu/fpu_proto.h deleted +0 -157

157 lines not on this page · raw message

arch/x86/math-emu/fpu_system.h deleted +0 -130

130 lines not on this page · raw message

arch/x86/math-emu/fpu_tags.c deleted +0 -116

116 lines not on this page · raw message

arch/x86/math-emu/fpu_trig.c deleted +0 -1649

1,649 lines not on this page · raw message

arch/x86/math-emu/get_address.c deleted +0 -401

401 lines not on this page · raw message

arch/x86/math-emu/load_store.c deleted +0 -322

322 lines not on this page · raw message

arch/x86/math-emu/mul_Xsig.S deleted +0 -179

179 lines not on this page · raw message

arch/x86/math-emu/poly.h deleted +0 -115

115 lines not on this page · raw message

arch/x86/math-emu/poly_2xm1.c deleted +0 -146

146 lines not on this page · raw message

arch/x86/math-emu/poly_atan.c deleted +0 -209

209 lines not on this page · raw message

arch/x86/math-emu/poly_l2.c deleted +0 -245

245 lines not on this page · raw message

arch/x86/math-emu/poly_sin.c deleted +0 -379

379 lines not on this page · raw message

arch/x86/math-emu/poly_tan.c deleted +0 -213

213 lines not on this page · raw message

arch/x86/math-emu/polynom_Xsig.S deleted +0 -137

137 lines not on this page · raw message

arch/x86/math-emu/reg_add_sub.c deleted +0 -334

334 lines not on this page · raw message

arch/x86/math-emu/reg_compare.c deleted +0 -479

479 lines not on this page · raw message

arch/x86/math-emu/reg_constant.c deleted +0 -123

123 lines not on this page · raw message

arch/x86/math-emu/reg_constant.h deleted +0 -26
deleted file mode 100644
index f2fdd344dcaa..000000000000

Lines of this file are not shown. View the raw message.

arch/x86/math-emu/reg_convert.c deleted +0 -47

47 lines not on this page · raw message

arch/x86/math-emu/reg_divide.c deleted +0 -183

183 lines not on this page · raw message

arch/x86/math-emu/reg_ld_str.c deleted +0 -1220

1,220 lines not on this page · raw message

arch/x86/math-emu/reg_mul.c deleted +0 -116

116 lines not on this page · raw message

arch/x86/math-emu/reg_norm.S deleted +0 -150

150 lines not on this page · raw message

arch/x86/math-emu/reg_round.S deleted +0 -711

711 lines not on this page · raw message

arch/x86/math-emu/reg_u_add.S deleted +0 -169

169 lines not on this page · raw message

arch/x86/math-emu/reg_u_div.S deleted +0 -474

474 lines not on this page · raw message

arch/x86/math-emu/reg_u_mul.S deleted +0 -150

150 lines not on this page · raw message

arch/x86/math-emu/reg_u_sub.S deleted +0 -274

274 lines not on this page · raw message

arch/x86/math-emu/round_Xsig.S deleted +0 -142

142 lines not on this page · raw message

arch/x86/math-emu/shr_Xsig.S deleted +0 -89

89 lines not on this page · raw message

arch/x86/math-emu/status_w.h deleted +0 -68

68 lines not on this page · raw message

arch/x86/math-emu/version.h deleted +0 -12
deleted file mode 100644
index a0d73a1d2b67..000000000000

Lines of this file are not shown. View the raw message.

arch/x86/math-emu/wm_shrx.S deleted +0 -207

207 lines not on this page · raw message

arch/x86/math-emu/wm_sqrt.S deleted +0 -472

472 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.45.2

Part of the diff is not shown here. View the raw message.

#12 lore raw

PATCH 11/15 x86/cpu: Make CONFIG_X86_TSC unconditional

In reply to Ingo Molnar

I.e. it's a boot time requirement for the CPU to support it.

---
 arch/x86/Kconfig     | 1 -
 arch/x86/Kconfig.cpu | 1 -
 arch/x86/xen/Kconfig | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)
arch/x86/Kconfig +0 -1
index 137b5ddf1f86..465e5abd2750 100644
@@ -661,7 +661,6 @@ config X86_INTEL_QUARK
 	depends on X86_32
 	depends on X86_EXTENDED_PLATFORM
 	depends on X86_PLATFORM_DEVICES
-	depends on X86_TSC
 	depends on PCI
 	depends on PCI_GOANY
 	depends on X86_IO_APIC
arch/x86/Kconfig.cpu +0 -1
index ab4988e06d86..30466a258db8 100644
@@ -238,7 +238,6 @@ config X86_USE_PPRO_CHECKSUM
 
 config X86_TSC
 	def_bool y
-	depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MATOM) || X86_64
 
 config X86_HAVE_PAE
 	def_bool y
arch/x86/xen/Kconfig +1 -1
index 98d8a50d2aed..222b6fdad313 100644
@@ -10,7 +10,7 @@ config XEN
 	select X86_HV_CALLBACK_VECTOR
 	depends on X86_64 || (X86_32 && X86_PAE)
 	depends on X86_64 || (X86_GENERIC || MPENTIUM4 || MATOM)
-	depends on X86_LOCAL_APIC && X86_TSC
+	depends on X86_LOCAL_APIC
 	help
 	  This is the Linux Xen port.  Enabling this will allow the
 	  kernel to boot in a paravirtualized environment under the
Signature · 1 line
2.45.2
#13 lore raw

PATCH 12/15 x86: Remove !CONFIG_X86_TSC code

In reply to Ingo Molnar

Now that the Kconfig space always enables CONFIG_X86_TSC (on x86), remove !CONFIG_X86_TSC code.

We still keep the Kconfig option to catch any eventual code still pending in maintainer or non-mainline trees, and it's also still possible to disable TSC support runtime.

---
 arch/x86/include/asm/timex.h       |  3 +--
 arch/x86/include/asm/trace_clock.h |  8 --------
 arch/x86/include/asm/tsc.h         | 13 +------------
 arch/x86/kernel/Makefile           |  4 ++--
 arch/x86/kernel/i8253.c            |  2 +-
 arch/x86/kernel/tsc.c              | 13 -------------
 6 files changed, 5 insertions(+), 38 deletions(-)
arch/x86/include/asm/timex.h +1 -2
index 956e4145311b..6e57e3c0fdd2 100644
@@ -7,8 +7,7 @@
 
 static inline unsigned long random_get_entropy(void)
 {
-	if (!IS_ENABLED(CONFIG_X86_TSC) &&
-	    !cpu_feature_enabled(X86_FEATURE_TSC))
+	if (!cpu_feature_enabled(X86_FEATURE_TSC))
 		return random_get_entropy_fallback();
 	return rdtsc();
 }
arch/x86/include/asm/trace_clock.h +0 -8
index 7061a5650969..1efab284c32a 100644
@@ -5,17 +5,9 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
-#ifdef CONFIG_X86_TSC
-
 extern u64 notrace trace_clock_x86_tsc(void);
 
 # define ARCH_TRACE_CLOCKS \
 	{ trace_clock_x86_tsc,	"x86-tsc",	.in_ns = 0 },
 
-#else /* !CONFIG_X86_TSC */
-
-#define ARCH_TRACE_CLOCKS
-
-#endif
-
 #endif  /* _ASM_X86_TRACE_CLOCK_H */
arch/x86/include/asm/tsc.h +1 -12
index 94408a784c8e..2b61fa648ed7 100644
@@ -21,8 +21,7 @@ extern void disable_TSC(void);
 
 static inline cycles_t get_cycles(void)
 {
-	if (!IS_ENABLED(CONFIG_X86_TSC) &&
-	    !cpu_feature_enabled(X86_FEATURE_TSC))
+	if (!cpu_feature_enabled(X86_FEATURE_TSC))
 		return 0;
 	return rdtsc();
 }
@@ -39,25 +38,15 @@ extern unsigned long native_calibrate_tsc(void);
 extern unsigned long long native_sched_clock_from_tsc(u64 tsc);
 
 extern int tsc_clocksource_reliable;
-#ifdef CONFIG_X86_TSC
 extern bool tsc_async_resets;
-#else
-# define tsc_async_resets	false
-#endif
 
 /*
  * Boot-time check whether the TSCs are synchronized across
  * all CPUs/cores:
  */
-#ifdef CONFIG_X86_TSC
 extern bool tsc_store_and_check_tsc_adjust(bool bootcpu);
 extern void tsc_verify_tsc_adjust(bool resume);
 extern void check_tsc_sync_target(void);
-#else
-static inline bool tsc_store_and_check_tsc_adjust(bool bootcpu) { return false; }
-static inline void tsc_verify_tsc_adjust(bool resume) { }
-static inline void check_tsc_sync_target(void) { }
-#endif
 
 extern int notsc_setup(char *);
 extern void tsc_save_sched_clock_state(void);
arch/x86/kernel/Makefile +2 -2
index 84cfa179802c..abeca47b8225 100644
@@ -94,7 +94,7 @@ apm-y				:= apm_32.o
 obj-$(CONFIG_APM)		+= apm.o
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_SMP)		+= smpboot.o
-obj-$(CONFIG_X86_TSC)		+= tsc_sync.o
+obj-y				+= tsc_sync.o
 obj-$(CONFIG_SMP)		+= setup_percpu.o
 obj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
 obj-y				+= apic/
@@ -103,7 +103,7 @@ obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
 obj-$(CONFIG_FUNCTION_TRACER)	+= ftrace_$(BITS).o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
 obj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
-obj-$(CONFIG_X86_TSC)		+= trace_clock.o
+obj-y				+= trace_clock.o
 obj-$(CONFIG_TRACING)		+= trace.o
 obj-$(CONFIG_RETHOOK)		+= rethook.o
 obj-$(CONFIG_VMCORE_INFO)	+= vmcore_info_$(BITS).o
arch/x86/kernel/i8253.c +1 -1
index cb9852ad6098..0b991035f127 100644
@@ -31,7 +31,7 @@ struct clock_event_device *global_clock_event;
  */
 static bool __init use_pit(void)
 {
-	if (!IS_ENABLED(CONFIG_X86_TSC) || !boot_cpu_has(X86_FEATURE_TSC))
+	if (!boot_cpu_has(X86_FEATURE_TSC))
 		return true;
 
 	/* This also returns true when APIC is disabled */
arch/x86/kernel/tsc.c +0 -13
index 88e5a4ed9db3..489c779ef3ef 100644
@@ -295,24 +295,11 @@ int check_tsc_unstable(void)
 }
 EXPORT_SYMBOL_GPL(check_tsc_unstable);
 
-#ifdef CONFIG_X86_TSC
 int __init notsc_setup(char *str)
 {
 	mark_tsc_unstable("boot parameter notsc");
 	return 1;
 }
-#else
-/*
- * disable flag for tsc. Takes effect by clearing the TSC cpu flag
- * in cpu/common.c
- */
-int __init notsc_setup(char *str)
-{
-	setup_clear_cpu_cap(X86_FEATURE_TSC);
-	return 1;
-}
-#endif
-
 __setup("notsc", notsc_setup);
 
 static int no_sched_irq_time;
Signature · 1 line
2.45.2
#14 lore raw

PATCH 13/15 x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Ingo Molnar

I.e. it's a boot time requirement for the CPU to support it.

---
 arch/x86/Kconfig             | 2 +-
 arch/x86/Kconfig.cpu         | 3 +--
 arch/x86/Kconfig.cpufeatures | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)
arch/x86/Kconfig +1 -1
index 465e5abd2750..a9d717558972 100644
@@ -136,7 +136,7 @@ config X86
 	select ARCH_SUPPORTS_AUTOFDO_CLANG
 	select ARCH_SUPPORTS_PROPELLER_CLANG    if X86_64
 	select ARCH_USE_BUILTIN_BSWAP
-	select ARCH_USE_CMPXCHG_LOCKREF		if X86_CX8
+	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_USE_MEMTEST
 	select ARCH_USE_QUEUED_RWLOCKS
 	select ARCH_USE_QUEUED_SPINLOCKS
arch/x86/Kconfig.cpu +1 -2
index 30466a258db8..6f1e8cc8fe58 100644
@@ -245,7 +245,6 @@ config X86_HAVE_PAE
 
 config X86_CX8
 	def_bool y
-	depends on X86_HAVE_PAE || M586TSC || M586MMX || MK6 || MK7 || MGEODEGX1 || MGEODE_LX
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
@@ -257,7 +256,7 @@ config X86_MINIMUM_CPU_FAMILY
 	int
 	default "64" if X86_64
 	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
-	default "5" if X86_32 && X86_CX8
+	default "5" if X86_32
 	default "4"
 
 config X86_DEBUGCTLMSR
arch/x86/Kconfig.cpufeatures +0 -1
index cd551818f451..f04ae53435bc 100644
@@ -42,7 +42,6 @@ config X86_REQUIRED_FEATURE_NOPL
 
 config X86_REQUIRED_FEATURE_CX8
 	def_bool y
-	depends on X86_CX8
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
Signature · 1 line
2.45.2
#26 lore raw

PATCH 14/15 x86/percpu: Remove !CONFIG_X86_CX8 methods

In reply to Ingo Molnar

TODO: review the constraints.

---
 arch/x86/include/asm/percpu.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/x86/include/asm/percpu.h +2 -4
index 5fe314a2e73e..275c76a031ee 100644
@@ -334,8 +334,7 @@ do {									\
 	new__.var = _nval;						\
 									\
 	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
+		"cmpxchg8b " __percpu_arg([var])			\
 		: ALT_OUTPUT_SP([var] "+m" (__my_cpu_var(_var)),	\
 				"+a" (old__.low), "+d" (old__.high))	\
 		: "b" (new__.low), "c" (new__.high),			\
@@ -363,8 +362,7 @@ do {									\
 	new__.var = _nval;						\
 									\
 	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
+		"cmpxchg8b " __percpu_arg([var])			\
 		CC_SET(z)						\
 		: ALT_OUTPUT_SP(CC_OUT(z) (success),			\
 				[var] "+m" (__my_cpu_var(_var)),	\
Signature · 1 line
2.45.2
#29 lore raw

PATCH 15/15 x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Ingo Molnar
---
 arch/x86/include/asm/asm-prototypes.h |   4 -
 arch/x86/include/asm/atomic64_32.h    |  17 +--
 arch/x86/include/asm/cmpxchg_32.h     |  86 +--------------
 arch/x86/lib/Makefile                 |   4 -
 arch/x86/lib/atomic64_386_32.S        | 195 ----------------------------------
 arch/x86/lib/cmpxchg8b_emu.S          |  97 -----------------
 lib/atomic64_test.c                   |   4 +-
 7 files changed, 6 insertions(+), 401 deletions(-)
arch/x86/include/asm/asm-prototypes.h +0 -4
index 11c6fecc3ad7..6ec680a36dea 100644
@@ -16,10 +16,6 @@
 #include <asm/gsseg.h>
 #include <asm/nospec-branch.h>
 
-#ifndef CONFIG_X86_CX8
-extern void cmpxchg8b_emu(void);
-#endif
-
 #ifdef CONFIG_STACKPROTECTOR
 extern unsigned long __ref_stack_chk_guard;
 #endif
arch/x86/include/asm/atomic64_32.h +1 -16
index ab838205c1c6..1ac093b89c43 100644
@@ -48,29 +48,14 @@ static __always_inline s64 arch_atomic64_read_nonatomic(const atomic64_t *v)
 	ATOMIC64_EXPORT(atomic64_##sym)
 #endif
 
-#ifdef CONFIG_X86_CX8
 #define __alternative_atomic64(f, g, out, in, clobbers...)		\
 	asm volatile("call %c[func]"					\
-		     : ALT_OUTPUT_SP(out) \
+		     : ALT_OUTPUT_SP(out)				\
 		     : [func] "i" (atomic64_##g##_cx8)			\
 		       COMMA(in)					\
 		     : clobbers)
 
 #define ATOMIC64_DECL(sym) ATOMIC64_DECL_ONE(sym##_cx8)
-#else
-#define __alternative_atomic64(f, g, out, in, clobbers...)		\
-	alternative_call(atomic64_##f##_386, atomic64_##g##_cx8,	\
-			 X86_FEATURE_CX8, ASM_OUTPUT(out),		\
-			 ASM_INPUT(in), clobbers)
-
-#define ATOMIC64_DECL(sym) ATOMIC64_DECL_ONE(sym##_cx8); \
-	ATOMIC64_DECL_ONE(sym##_386)
-
-ATOMIC64_DECL_ONE(add_386);
-ATOMIC64_DECL_ONE(sub_386);
-ATOMIC64_DECL_ONE(inc_386);
-ATOMIC64_DECL_ONE(dec_386);
-#endif
 
 #define alternative_atomic64(f, out, in, clobbers...) \
 	__alternative_atomic64(f, f, ASM_OUTPUT(out), ASM_INPUT(in), clobbers)
arch/x86/include/asm/cmpxchg_32.h +4 -82

92 lines not on this page · raw message

arch/x86/lib/Makefile +0 -4
index 1c50352eb49f..59b513978d7e 100644
@@ -58,10 +58,6 @@ ifeq ($(CONFIG_X86_32),y)
         lib-y += strstr_32.o
         lib-y += string_32.o
         lib-y += memmove_32.o
-        lib-y += cmpxchg8b_emu.o
-ifneq ($(CONFIG_X86_CX8),y)
-        lib-y += atomic64_386_32.o
-endif
 else
 ifneq ($(CONFIG_GENERIC_CSUM),y)
         lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
arch/x86/lib/atomic64_386_32.S deleted +0 -195

195 lines not on this page · raw message

arch/x86/lib/cmpxchg8b_emu.S deleted +0 -97

97 lines not on this page · raw message

lib/atomic64_test.c +1 -3
index d726068358c7..352e811c99ce 100644
@@ -254,10 +254,8 @@ static __init int test_atomics_init(void)
 	pr_info("passed for %s platform %s CX8 and %s SSE\n",
 #ifdef CONFIG_X86_64
 		"x86-64",
-#elif defined(CONFIG_X86_CX8)
-		"i586+",
 #else
-		"i386+",
+		"i586+",
 #endif
 	       boot_cpu_has(X86_FEATURE_CX8) ? "with" : "without",
 	       boot_cpu_has(X86_FEATURE_XMM) ? "with" : "without");
Signature · 1 line
2.45.2
Reviewed-by on the v1 series
#37 lore raw
In reply to Ingo Molnar
Quoted 8 lines · Ingo Molnar

In the x86 architecture we have various complicated hardware emulation facilities on x86-32 to support ancient 32-bit CPUs that very very few people are using with modern kernels. This compatibility glue is sometimes even causing problems that people spend time to resolve, which time could be spent on other things.

As Linus recently remarked:

Quoted 7 lines
Quoted 3 lines

I really get the feeling that it's time to leave i486 support behind. There's zero real reason for anybody to waste one second of development effort on this kind of issue.

This series increases minimum kernel support features to include TSC and CX8 (CMPXCHG8B) hardware support, which removes 486 (and derivatives) support and early-586 (and derivatives) support.

Looks all good to me, thanks for including my earlier feedback.

#15 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Ingo Molnar

arch/x86/Kconfig.cpu config X86_MINIMUM_CPU_FAMILY · line 262

Quoted 9 lines · Ingo Molnar
arch/x86/Kconfig.cpu +1 -1
@@ -257,7 +256,7 @@ config X86_MINIMUM_CPU_FAMILY
 	int
 	default "64" if X86_64
 	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
 MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
-	default "5" if X86_32 && X86_CX8
+	default "5" if X86_32
 	default "4"
 

I just noticed this one: the final 'default "4"' is no longer possible here and can be removed. All the remaining CPUs report family "5" or higher.

There is an old issue for some rare CPUs (Geode LX and Crusoe) that
support CMOV but report family=6. These to boot a kernel with X86_MINIMUM_CPU_FAMILY=6 because it triggers the boot time check.

Arnd

#30 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Ingo Molnar

arch/x86/include/asm/cmpxchg_32.h static __always_inline bool __try_cmpxchg64_local(volatile u64 *ptr, u64 *oldp, · line 77

Quoted 6 lines · Ingo Molnar
arch/x86/include/asm/cmpxchg_32.h +4 -0
+#define arch_cmpxchg64			__cmpxchg64
+#define arch_cmpxchg64_local		__cmpxchg64_local
+#define arch_try_cmpxchg64		__try_cmpxchg64
+#define arch_try_cmpxchg64_local	__try_cmpxchg64_local
 
 #define system_has_cmpxchg64()		boot_cpu_has(X86_FEATURE_CX8)

system_has_cmpxchg64() should now become a constant.

Arnd

#27 lore raw

Re: [PATCH 14/15] x86/percpu: Remove !CONFIG_X86_CX8 methods

In reply to Ingo Molnar
Quoted 12 lines · Ingo Molnar

TODO: review the constraints.

---
  arch/x86/include/asm/percpu.h | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
arch/x86/include/asm/percpu.h +0 -0
index 5fe314a2e73e..275c76a031ee 100644

arch/x86/include/asm/percpu.h do { \ · line 340

Quoted 9 lines
arch/x86/include/asm/percpu.h +1 -2
@@ -334,8 +334,7 @@ do {									\
  	new__.var = _nval;						\
  									\
  	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
+		"cmpxchg8b " __percpu_arg([var])			\
  		: ALT_OUTPUT_SP([var] "+m" (__my_cpu_var(_var)),	\
  				"+a" (old__.low), "+d" (old__.high))	\
  		: "b" (new__.low), "c" (new__.high),			\

There is no need for asm_inline, ALT_OUTPUT_SP() macro and "S" input (that was used to force the compiler to put the memory argument into %esi register):

	asm qual ("cmpxchg8b " __percpu_arg([var])		\
		: "+m" (__my_cpu_var(_var)),			\
		  "+a" (old__.low), "+d" (old__.high)		\
		: "b" (new__.low), "c" (new__.high)		\
		: "memory");					\

arch/x86/include/asm/percpu.h do { \ · line 368

Quoted 10 lines
arch/x86/include/asm/percpu.h +1 -2
@@ -363,8 +362,7 @@ do {									\
  	new__.var = _nval;						\
  									\
  	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
+		"cmpxchg8b " __percpu_arg([var])			\
  		CC_SET(z)						\
  		: ALT_OUTPUT_SP(CC_OUT(z) (success),			\
  				[var] "+m" (__my_cpu_var(_var)),	\

Same here:

	asm qual ("cmpxchg8b " __percpu_arg([var])		\
		CC_SET(z)					\
		: CC_OUT(z) (success),				\
		  [var] "+m" (__my_cpu_var(_var)),		\
		  "+a" (old__.low), "+d" (old__.high)		\
		: "b" (new__.low), "c" (new__.high)		\
		: "memory");					\

Please see the attached patch that implements the change.

Uros.

arch/x86/include/asm/percpu.h +9 -15
index b0d03b6c279b..64c2e715af63 100644
@@ -335,13 +335,10 @@ do {									\
 	old__.var = _oval;						\
 	new__.var = _nval;						\
 									\
-	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
-		: ALT_OUTPUT_SP([var] "+m" (__my_cpu_var(_var)),	\
-				"+a" (old__.low), "+d" (old__.high))	\
-		: "b" (new__.low), "c" (new__.high),			\
-		  "S" (&(_var))						\
+	asm qual ("cmpxchg8b " __percpu_arg([var])			\
+		: "+m" (__my_cpu_var(_var)),				\
+		  "+a" (old__.low), "+d" (old__.high)			\
+		: "b" (new__.low), "c" (new__.high)			\
 		: "memory");						\
 									\
 	old__.var;							\
@@ -364,15 +361,12 @@ do {									\
 	old__.var = *_oval;						\
 	new__.var = _nval;						\
 									\
-	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
+	asm qual ("cmpxchg8b " __percpu_arg([var])			\
 		CC_SET(z)						\
-		: ALT_OUTPUT_SP(CC_OUT(z) (success),			\
-				[var] "+m" (__my_cpu_var(_var)),	\
-				"+a" (old__.low), "+d" (old__.high))	\
-		: "b" (new__.low), "c" (new__.high),			\
-		  "S" (&(_var))						\
+		: CC_OUT(z) (success),					\
+		  [var] "+m" (__my_cpu_var(_var)),			\
+		  "+a" (old__.low), "+d" (old__.high)			\
+		: "b" (new__.low), "c" (new__.high)			\
 		: "memory");						\
 	if (unlikely(!success))						\
 		*_oval = old__.var;					\
#31 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Ingo Molnar

arch/x86/include/asm/cmpxchg_32.h static __always_inline bool __try_cmpxchg64_local(volatile u64 *ptr, u64 *oldp, · line 77

Quoted 7 lines · Ingo Molnar
arch/x86/include/asm/cmpxchg_32.h +4 -1
-#endif
+#define arch_cmpxchg64			__cmpxchg64
+#define arch_cmpxchg64_local		__cmpxchg64_local
+#define arch_try_cmpxchg64		__try_cmpxchg64
+#define arch_try_cmpxchg64_local	__try_cmpxchg64_local
 
  #define system_has_cmpxchg64()		boot_cpu_has(X86_FEATURE_CX8)

#define system_has_cmpxchg64() 1

Uros.

#32 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

Quoted 11 lines · Uros Bizjak
Quoted 6 lines · Ingo Molnar
arch/x86/include/asm/cmpxchg_32.h +4 -1
-#endif
+#define arch_cmpxchg64                       __cmpxchg64
+#define arch_cmpxchg64_local         __cmpxchg64_local
+#define arch_try_cmpxchg64           __try_cmpxchg64
+#define arch_try_cmpxchg64_local     __try_cmpxchg64_local
Quoted 3 lines
Quoted 1 line
  #define system_has_cmpxchg64()              boot_cpu_has(X86_FEATURE_CX8)

#define system_has_cmpxchg64() 1

Or just outright removed, since x86 was the only arch that defined it.

Brian Gerst

#5 lore raw

Re: [PATCH 04/15] x86/cpu: Remove TSC-less CONFIG_M586 support

In reply to Ingo Molnar
Quoted 58 lines · Ingo Molnar

Remove support for TSC-less Pentium variants.

All TSC-capable Pentium variants, derivatives and clones should still work under the M586TSC or M586MMX options.

---

arch/x86/Kconfig.cpu            | 10 +---------
arch/x86/Makefile_32.cpu        |  1 -
arch/x86/include/asm/vermagic.h |  2 --
3 files changed, 1 insertion(+), 12 deletions(-)
arch/x86/Kconfig.cpu +0 -8
index df586ff2178f..e9499e58776c 100644
@@ -43,14 +43,6 @@ choice
 	  See each option's help text for additional details. If you don't know
 	  what to do, choose "Pentium-Pro".
 
-config M586
-	bool "586/K5/5x86/6x86/6x86MX"
-	depends on X86_32
-	help
-	  Select this for an 586 or 686 series processor such as the AMD K5,
-	  the Cyrix 5x86, 6x86 and 6x86MX.  This choice does not
-	  assume the RDTSC (Read Time Stamp Counter) instruction.
-

config M586TSC

	bool "Pentium-Classic"
	depends on X86_32
arch/x86/Kconfig.cpu +1 -1
@@ -226,7 +218,7 @@ config X86_L1_CACHE_SHIFT
 	default "7" if MPENTIUM4
 	default "6" if MK7 || MPENTIUMM || MATOM || MVIAC7 || X86_GENERIC || X86_64
 	default "4" if MGEODEGX1
-	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
+	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MGEODE_LX
 

config X86_F00F_BUG
def_bool y

arch/x86/Makefile_32.cpu +0 -0
index 2dda0a19b06a..43226c9fe795 100644
@@ -10,7 +10,6 @@ else

align := -falign-functions=0 -falign-jumps=0 -falign-loops=0
endif

-cflags-$(CONFIG_M586) += -march=i586
cflags-$(CONFIG_M586TSC) += -march=i586
cflags-$(CONFIG_M586MMX) += -march=pentium-mmx
cflags-$(CONFIG_M686) += -march=i686

arch/x86/include/asm/vermagic.h +0 -0
index b3a8beb32dfd..e26061df0c9b 100644

arch/x86/include/asm/vermagic.h line 10

Quoted 8 lines
arch/x86/include/asm/vermagic.h +0 -2
@@ -5,8 +5,6 @@
 
 #ifdef CONFIG_X86_64
 /* X86_64 does not define MODULE_PROC_FAMILY */
-#elif defined CONFIG_M586
-#define MODULE_PROC_FAMILY "586 "
 #elif defined CONFIG_M586TSC
 #define MODULE_PROC_FAMILY "586TSC "
 #elif defined CONFIG_M586MMX

For the record, all "real" Pentium chips had CX8 and TSC.

#16 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Arnd Bergmann
Quoted 15 lines · Arnd Bergmann

arch/x86/Kconfig.cpu config X86_MINIMUM_CPU_FAMILY · line 262

Quoted 9 lines · Ingo Molnar
arch/x86/Kconfig.cpu +1 -1
@@ -257,7 +256,7 @@ config X86_MINIMUM_CPU_FAMILY
 	int
 	default "64" if X86_64
 	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
 MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
-	default "5" if X86_32 && X86_CX8
+	default "5" if X86_32
 	default "4"
 

I just noticed this one: the final 'default "4"' is no longer possible here and can be removed. All the remaining CPUs report family "5" or higher.

Quoted 4 lines

There is an old issue for some rare CPUs (Geode LX and Crusoe) that
support CMOV but report family=6. These to boot a kernel with X86_MINIMUM_CPU_FAMILY=6 because it triggers the boot time check.

Arnd

They report family=5 because family=6 implies fcomi and nopl support (in the case of Crusoe, they have fcomi but didn't support movl.)

#17 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · Arnd Bergmann

I just noticed this one: the final 'default "4"' is no longer possible here and can be removed. All the remaining CPUs report family "5" or higher.

Quoted 6 lines
Quoted 3 lines

There is an old issue for some rare CPUs (Geode LX and Crusoe) that
support CMOV but report family=6. These to boot a kernel with X86_MINIMUM_CPU_FAMILY=6 because it triggers the boot time check.

They report family=5 because family=6 implies fcomi and nopl support (in the case of Crusoe, they have fcomi but didn't support movl.)

Ah right, I see now. I had only checked that the kernel itself no longer uses nopl after your ba0593bf553c ("x86: completely disable NOPL on 32 bits"), and I had seen that Debian intentionally builds 32-bit i686 kernels with CONFIG_MGEODEGX1.

I now found that both Debian 12 and gcc 11 changed their definition if 686 to actually require nopl for Indirect branch tracking (-fcf-protection) in user space, as discussed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104713

So even if it makes sense for GeodeLX specific kernel to use CMOV, any general-purpose i686 distro would still want to enable IBT in userspace to gain IBT on Tiger Lake and newer 64-bit CPUs.

Arnd

#38 lore raw
In reply to Ingo Molnar

Hi!

Quoted 5 lines

In the x86 architecture we have various complicated hardware emulation facilities on x86-32 to support ancient 32-bit CPUs that very very few people are using with modern kernels. This compatibility glue is sometimes even causing problems that people spend time to resolve, which time could be spent on other things.

We have open-source 486 cores, such as
https://github.com/MiSTer-devel/ao486_MiSTer . I'm not aware of open-source 586 cores... so this is a bit sad.

Best regards,
Pavel

Signature · 2 lines
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!
#28 lore raw

PATCH 14/15 x86/percpu: Remove !CONFIG_X86_CX8 methods

In reply to Uros Bizjak
Quoted 1 line · Uros Bizjak

Please see the attached patch that implements the change.

Thanks! I've turned this into a commit with your SOB, replacing my placeholder patch, see below.

Ingo

===================================>
From: Uros Bizjak <[email protected]>
Date: Fri, 25 Apr 2025 16:05:14 +0200
Subject: [PATCH] x86/percpu: Remove !CONFIG_X86_CX8 methods

Adjust the constraints to the non-alternatives asm() statement.

https://lore.kernel.org/r/[email protected]

---
 arch/x86/include/asm/percpu.h | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)
arch/x86/include/asm/percpu.h +9 -15
index 5fe314a2e73e..bef13b358f7b 100644
@@ -333,13 +333,10 @@ do {									\
 	old__.var = _oval;						\
 	new__.var = _nval;						\
 									\
-	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
-		: ALT_OUTPUT_SP([var] "+m" (__my_cpu_var(_var)),	\
-				"+a" (old__.low), "+d" (old__.high))	\
-		: "b" (new__.low), "c" (new__.high),			\
-		  "S" (&(_var))						\
+	asm qual ("cmpxchg8b " __percpu_arg([var])			\
+		: "+m" (__my_cpu_var(_var)),				\
+		  "+a" (old__.low), "+d" (old__.high)			\
+		: "b" (new__.low), "c" (new__.high)			\
 		: "memory");						\
 									\
 	old__.var;							\
@@ -362,15 +359,12 @@ do {									\
 	old__.var = *_oval;						\
 	new__.var = _nval;						\
 									\
-	asm_inline qual (						\
-		ALTERNATIVE("call this_cpu_cmpxchg8b_emu",		\
-			    "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
+	asm qual ("cmpxchg8b " __percpu_arg([var])			\
 		CC_SET(z)						\
-		: ALT_OUTPUT_SP(CC_OUT(z) (success),			\
-				[var] "+m" (__my_cpu_var(_var)),	\
-				"+a" (old__.low), "+d" (old__.high))	\
-		: "b" (new__.low), "c" (new__.high),			\
-		  "S" (&(_var))						\
+		: CC_OUT(z) (success),					\
+		  [var] "+m" (__my_cpu_var(_var)),			\
+		  "+a" (old__.low), "+d" (old__.high)			\
+		: "b" (new__.low), "c" (new__.high)			\
 		: "memory");						\
 	if (unlikely(!success))						\
 		*_oval = old__.var;					\
#25 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Arnd Bergmann
Quoted 14 lines · Arnd Bergmann

Review config X86_MINIMUM_CPU_FAMILY · line 262

Quoted 9 lines · Ingo Molnar
(quoted diff) +1 -1
@@ -257,7 +256,7 @@ config X86_MINIMUM_CPU_FAMILY
 	int
 	default "64" if X86_64
 	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
 MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
-	default "5" if X86_32 && X86_CX8
+	default "5" if X86_32
 	default "4"
 

I just noticed this one: the final 'default "4"' is no longer possible here and can be removed. All the remaining CPUs report family "5" or higher.

Right, I've applied the fix below and backmerged it into the series.

Thanks,

Ingo

==========================>

 arch/x86/Kconfig.cpu | 1 -
 1 file changed, 1 deletion(-)
arch/x86/Kconfig.cpu +0 -1
index 6f1e8cc8fe58..b3772d384fa0 100644
@@ -257,7 +257,6 @@ config X86_MINIMUM_CPU_FAMILY
 	default "64" if X86_64
 	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
 	default "5" if X86_32
-	default "4"
 
 config X86_DEBUGCTLMSR
 	def_bool y
#33 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Brian Gerst
Quoted 12 lines · Brian Gerst
Quoted 11 lines · Uros Bizjak
Quoted 6 lines · Ingo Molnar
arch/x86/include/asm/cmpxchg_32.h +4 -1
-#endif
+#define arch_cmpxchg64                       __cmpxchg64
+#define arch_cmpxchg64_local         __cmpxchg64_local
+#define arch_try_cmpxchg64           __try_cmpxchg64
+#define arch_try_cmpxchg64_local     __try_cmpxchg64_local
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
  #define system_has_cmpxchg64()              boot_cpu_has(X86_FEATURE_CX8)

#define system_has_cmpxchg64() 1

Or just outright removed, since x86 was the only arch that defined it.

No, it cannot be removed, x86-32 *is* still the only 32-bit arch that enables it.

I.e. defining it to 1 is the correct solution, and that unconditionally enables the SLUB code optimizations. It depended on a runtime boot_cpu_has() check before.

Removing it would remove the optimization from x86-32 for no good reason.

Thanks,

Ingo

#34 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Uros Bizjak
Quoted 4 lines · Uros Bizjak

On 25. 04. 25 10:42, Ingo Molnar wrote:

Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +4 -1
-#endif
+#define arch_cmpxchg64			__cmpxchg64
+#define arch_cmpxchg64_local		__cmpxchg64_local
+#define arch_try_cmpxchg64		__try_cmpxchg64
+#define arch_try_cmpxchg64_local	__try_cmpxchg64_local
  #define system_has_cmpxchg64()		boot_cpu_has(X86_FEATURE_CX8)

#define system_has_cmpxchg64() 1

Thanks, I've updated the patch with the change below.

Ingo

===========>

 arch/x86/include/asm/cmpxchg_32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/cmpxchg_32.h +1 -1
index 5902fa5af93b..6c7b37bc65c1 100644
@@ -74,6 +74,6 @@ static __always_inline bool __try_cmpxchg64_local(volatile u64 *ptr, u64 *oldp,
 #define arch_try_cmpxchg64		__try_cmpxchg64
 #define arch_try_cmpxchg64_local	__try_cmpxchg64_local
 
-#define system_has_cmpxchg64()		boot_cpu_has(X86_FEATURE_CX8)
+#define system_has_cmpxchg64()		1
 
 #endif /* _ASM_X86_CMPXCHG_32_H */
#18 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Arnd Bergmann
Quoted 19 lines · Arnd Bergmann
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · Arnd Bergmann

I just noticed this one: the final 'default "4"' is no longer possible here and can be removed. All the remaining CPUs report family "5" or higher.

Quoted 6 lines
Quoted 3 lines

There is an old issue for some rare CPUs (Geode LX and Crusoe) that
support CMOV but report family=6. These to boot a kernel with X86_MINIMUM_CPU_FAMILY=6 because it triggers the boot time check.

They report family=5 because family=6 implies fcomi and nopl support (in the case of Crusoe, they have fcomi but didn't support movl.)

Ah right, I see now. I had only checked that the kernel itself no longer uses nopl after your ba0593bf553c ("x86: completely disable NOPL on 32 bits"), and I had seen that Debian intentionally builds 32-bit i686 kernels with CONFIG_MGEODEGX1.

Quoted 8 lines

I now found that both Debian 12 and gcc 11 changed their definition if 686 to actually require nopl for Indirect branch tracking (-fcf-protection) in user space, as discussed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104713

So even if it makes sense for GeodeLX specific kernel to use CMOV, any general-purpose i686 distro would still want to enable IBT in userspace to gain IBT on Tiger Lake and newer 64-bit CPUs.

And the kernel Debian 12 uses is a "686" one:

./pool/main/l/linux-signed-i386/linux-image-6.1.0-32-686_6.1.129-1_i386.deb ./pool/main/l/linux-signed-i386/linux-image-686_6.1.129-1_i386.deb

and the kernel is set to CONFIG_MGEODE_LX=y:

  $ grep CONFIG_MGEODE_LX ./boot/config-6.1.0-32-686
  CONFIG_MGEODE_LX=y

... which CPU has CMOV support:

config X86_CMOV

        def_bool y
        depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || MATOM || MGEODE_LX || X86_64)                                                                                                                                                                                                                                           ^^^^^^^^^

So I'd argue that the kernel's x86-32 CPU support cutoff should match the i386 CPU support cutoff of the Debian i386 installer.

Survey of other distros:

- Fedora dropped x86-32 with Fedora 31, almost 5 years ago.

- Ubuntu dropped x86-32 after 18 LTS, more than 5 years ago. The LTS kernel is v5.6 based.

- Arch Linux dropped i686 support even earlier than that, the spin-off-community project of archlinux32.org has 486 and 686 variants. 686 variant includes CMOV.

- Gentoo has an 'x86' variant with 486 and 686 stages. 686 stage includes CMOV.

Ie. I think we can also make CMOV a hard requirement, and keep support for all family 5 CPUs that have CMOV and have a chance to boot current 32-bit distros. Even distros that had 486 builds have 686 variants that should still work.

I.e. remove support for M586MMX, M586TSC, MCYRIXIII, MGEODEGX1 and MK6 as well, these don't have CMOV support and won't even boot i386 Debian 12.

Summary, the plan would be to remove support for the following pre-CMOV CPUs (the ones not yet in this series are marked 'NEW'):

M486
M486SX
M586

  M586MMX         # NEW
  M586TSC         # NEW
  MCYRIXIII       # NEW

MELAN
MGEODEGX1 # NEW
MK6 # NEW
MWINCHIP3D
MWINCHIPC6

And to keep these:

M686
MATOM
MCRUSOE
MEFFICEON
MGEODE_LX
MK7
MPENTIUM4
MPENTIUMII
MPENTIUMIII
MPENTIUMM
MVIAC3_2
MVIAC7

Thanks,

Ingo

#35 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Ingo Molnar
Quoted 17 lines · Ingo Molnar
Quoted 4 lines · Uros Bizjak

On 25. 04. 25 10:42, Ingo Molnar wrote:

Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +4 -1
-#endif
+#define arch_cmpxchg64                     __cmpxchg64
+#define arch_cmpxchg64_local               __cmpxchg64_local
+#define arch_try_cmpxchg64         __try_cmpxchg64
+#define arch_try_cmpxchg64_local   __try_cmpxchg64_local
  #define system_has_cmpxchg64()            boot_cpu_has(X86_FEATURE_CX8)

#define system_has_cmpxchg64() 1

Quoted 1 line

Thanks, I've updated the patch with the change below.

I think you also want to change:

Quoted 5 lines
lib/atomic64_test.c +0 -0
index d726068358c7de..352e811c99ce9e 100644

lib/atomic64_test.c static __init int test_atomics_init(void) · line 260

Quoted 10 lines
lib/atomic64_test.c +1 -3
@@ -254,10 +254,8 @@ static __init int test_atomics_init(void)
 pr_info("passed for %s platform %s CX8 and %s SSE\n",
 #ifdef CONFIG_X86_64
 "x86-64",
-#elif defined(CONFIG_X86_CX8)
- "i586+",
 #else
- "i386+",
+ "i586+",
 #endif
 boot_cpu_has(X86_FEATURE_CX8) ? "with" : "without",

X86_FEATURE_CX8 is now always defined, so the "without" part is now a dead code. Perhaps the info message should be updated to always say "... platform with CX8 and ..." or even to remove this part.

Thanks,
Uros.

#19 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Ingo Molnar
Quoted 31 lines · Ingo Molnar
Quoted 10 lines · Arnd Bergmann

On Fri, Apr 25, 2025, at 17:15, H. Peter Anvin wrote:

I now found that both Debian 12 and gcc 11 changed their definition if 686 to actually require nopl for Indirect branch tracking (-fcf-protection) in user space, as discussed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104713

So even if it makes sense for GeodeLX specific kernel to use CMOV, any general-purpose i686 distro would still want to enable IBT in userspace to gain IBT on Tiger Lake and newer 64-bit CPUs.

And the kernel Debian 12 uses is a "686" one:

./pool/main/l/linux-signed-i386/linux-image-6.1.0-32-686_6.1.129-1_i386.deb ./pool/main/l/linux-signed-i386/linux-image-686_6.1.129-1_i386.deb

and the kernel is set to CONFIG_MGEODE_LX=y:

  $ grep CONFIG_MGEODE_LX ./boot/config-6.1.0-32-686
  CONFIG_MGEODE_LX=y

... which CPU has CMOV support:

config X86_CMOV

        def_bool y
        depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || 
MATOM || MGEODE_LX || X86_64)                                           
Quoted 3 lines
                                                ^^^^^^^^^

So I'd argue that the kernel's x86-32 CPU support cutoff should match the i386 CPU support cutoff of the Debian i386 installer.

I think this misses a few other bits of information, some of which we already mentioned in this thread:

- Debian 13 no longer has any 32-bit kernel, so debian-i686 is primarily targeted at running on 64-bit kernels for memory constrained environments.

- Debian 12 started requiring NOPL in userspace, which is not supported on GeodeLX (or Crusoe), the kernel option should have been changed to M686 instead but was accidentally left at MGEODE_LX, so the kernel still works, but userspace doesn't.

- Anyone running Linux on an i586 machine likely already wants a custom kernel, regardless what the distros provide. This is especially true for the embedded targets.

Quoted 29 lines

Survey of other distros:

- Fedora dropped x86-32 with Fedora 31, almost 5 years ago.

- Ubuntu dropped x86-32 after 18 LTS, more than 5 years ago. The LTS kernel is v5.6 based.

- Arch Linux dropped i686 support even earlier than that, the spin-off-community project of archlinux32.org has 486 and 686 variants. 686 variant includes CMOV.

- Gentoo has an 'x86' variant with 486 and 686 stages. 686 stage includes CMOV.

Ie. I think we can also make CMOV a hard requirement, and keep support for all family 5 CPUs that have CMOV and have a chance to boot current 32-bit distros. Even distros that had 486 builds have 686 variants that should still work.

I.e. remove support for M586MMX, M586TSC, MCYRIXIII, MGEODEGX1 and MK6 as well, these don't have CMOV support and won't even boot i386 Debian 12.

Summary, the plan would be to remove support for the following pre-CMOV CPUs (the ones not yet in this series are marked 'NEW'):

M486
M486SX
M586

Quoted 8 lines
  M586MMX         # NEW
  M586TSC         # NEW
  MCYRIXIII       # NEW

MELAN
MGEODEGX1 # NEW
MK6 # NEW
MWINCHIP3D
MWINCHIPC6

This would also mean dropping support for the pre-2015 Intel Quark and DM&P Vortex86DX/DX2/MX/EX that never had a custom CONFIG_Mxxxx option but are still relevant to some degree.
I think that would be a mistake.

Quoted 14 lines

And to keep these:

M686
MATOM
MCRUSOE
MEFFICEON
MGEODE_LX
MK7
MPENTIUM4
MPENTIUMII
MPENTIUMIII
MPENTIUMM
MVIAC3_2
MVIAC7

As Linus said, overall they are barely different from the first group, and they are just as obsolete, only Atom and Vortex86DX3/EmKore are less than 20 years old.

Here are some alternatives I like better than dropping i586:

a) keep my patch with an new bool option to pick between i586 and i686 targets, by any name.

b) always build with -march=i586 and leave only the -mtune flags; see if anyone cares enough to even benchmark and pick one of the other options if they can show a meaningful regression over -march=i686 -mtune=

c) keep the outcome of your v1 series, dropping only pre-i586 support, and leave my patch out. No change here, so at least no regression potential.

d) use -march=i686 (plus -mtune=) for normal builds, but keep support for the older cores guarded by X86_EXTENDED_PLATFORM or CONFIG_EXPERT, use -march=i586 if at least one of those platforms is selected.

Arnd

#20 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

Quoted 128 lines · Arnd Bergmann
Quoted 31 lines · Ingo Molnar
Quoted 10 lines · Arnd Bergmann

On Fri, Apr 25, 2025, at 17:15, H. Peter Anvin wrote:

I now found that both Debian 12 and gcc 11 changed their definition if 686 to actually require nopl for Indirect branch tracking (-fcf-protection) in user space, as discussed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104713

So even if it makes sense for GeodeLX specific kernel to use CMOV, any general-purpose i686 distro would still want to enable IBT in userspace to gain IBT on Tiger Lake and newer 64-bit CPUs.

And the kernel Debian 12 uses is a "686" one:

./pool/main/l/linux-signed-i386/linux-image-6.1.0-32-686_6.1.129-1_i386.deb ./pool/main/l/linux-signed-i386/linux-image-686_6.1.129-1_i386.deb

and the kernel is set to CONFIG_MGEODE_LX=y:

  $ grep CONFIG_MGEODE_LX ./boot/config-6.1.0-32-686
  CONFIG_MGEODE_LX=y

... which CPU has CMOV support:

config X86_CMOV

        def_bool y
        depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || 
MATOM || MGEODE_LX || X86_64)                                           
Quoted 3 lines
                                                ^^^^^^^^^

So I'd argue that the kernel's x86-32 CPU support cutoff should match the i386 CPU support cutoff of the Debian i386 installer.

I think this misses a few other bits of information, some of which we already mentioned in this thread:

- Debian 13 no longer has any 32-bit kernel, so debian-i686 is primarily targeted at running on 64-bit kernels for memory constrained environments.

- Debian 12 started requiring NOPL in userspace, which is not supported on GeodeLX (or Crusoe), the kernel option should have been changed to M686 instead but was accidentally left at MGEODE_LX, so the kernel still works, but userspace doesn't.

- Anyone running Linux on an i586 machine likely already wants a custom kernel, regardless what the distros provide. This is especially true for the embedded targets.

Quoted 29 lines

Survey of other distros:

- Fedora dropped x86-32 with Fedora 31, almost 5 years ago.

- Ubuntu dropped x86-32 after 18 LTS, more than 5 years ago. The LTS kernel is v5.6 based.

- Arch Linux dropped i686 support even earlier than that, the spin-off-community project of archlinux32.org has 486 and 686 variants. 686 variant includes CMOV.

- Gentoo has an 'x86' variant with 486 and 686 stages. 686 stage includes CMOV.

Ie. I think we can also make CMOV a hard requirement, and keep support for all family 5 CPUs that have CMOV and have a chance to boot current 32-bit distros. Even distros that had 486 builds have 686 variants that should still work.

I.e. remove support for M586MMX, M586TSC, MCYRIXIII, MGEODEGX1 and MK6 as well, these don't have CMOV support and won't even boot i386 Debian 12.

Summary, the plan would be to remove support for the following pre-CMOV CPUs (the ones not yet in this series are marked 'NEW'):

M486
M486SX
M586

Quoted 8 lines
  M586MMX         # NEW
  M586TSC         # NEW
  MCYRIXIII       # NEW

MELAN
MGEODEGX1 # NEW
MK6 # NEW
MWINCHIP3D
MWINCHIPC6

This would also mean dropping support for the pre-2015 Intel Quark and DM&P Vortex86DX/DX2/MX/EX that never had a custom CONFIG_Mxxxx option but are still relevant to some degree.
I think that would be a mistake.

Quoted 14 lines

And to keep these:

M686
MATOM
MCRUSOE
MEFFICEON
MGEODE_LX
MK7
MPENTIUM4
MPENTIUMII
MPENTIUMIII
MPENTIUMM
MVIAC3_2
MVIAC7

As Linus said, overall they are barely different from the first group, and they are just as obsolete, only Atom and Vortex86DX3/EmKore are less than 20 years old.

Here are some alternatives I like better than dropping i586:

a) keep my patch with an new bool option to pick between i586 and i686 targets, by any name.

b) always build with -march=i586 and leave only the -mtune flags; see if anyone cares enough to even benchmark and pick one of the other options if they can show a meaningful regression over -march=i686 -mtune=

c) keep the outcome of your v1 series, dropping only pre-i586 support, and leave my patch out. No change here, so at least no regression potential.

Quoted 6 lines

d) use -march=i686 (plus -mtune=) for normal builds, but keep support for the older cores guarded by X86_EXTENDED_PLATFORM or CONFIG_EXPERT, use -march=i586 if at least one of those platforms is selected.

Arnd

Interesting. They really should be using x32 for that application...

#21 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann
Quoted 11 lines

M486
M486SX
M586

  M586MMX         # NEW
  M586TSC         # NEW
  MCYRIXIII       # NEW

MELAN
MGEODEGX1 # NEW
MK6 # NEW
MWINCHIP3D
MWINCHIPC6

Quoted 4 lines

This would also mean dropping support for the pre-2015 Intel Quark and DM&P Vortex86DX/DX2/MX/EX that never had a custom CONFIG_Mxxxx option but are still relevant to some degree.
I think that would be a mistake.

Yeah, agreed, and especially with the <asm/bitops.h> CMOV complication removed per Linus's patch, we could actually remove CONFIG_X86_CMOV, as nothing uses it anymore:

starship:~/mingo.tip.git> git grep X86_CMOV
arch/x86/Kconfig.cpu:config X86_CMOV
arch/x86/Kconfig.cpufeatures: depends on X86_CMOV

The CMOV dependency comes in through compiler options only:

  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_M586TSC)	+= -march=i586
  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_M586MMX)	+= -march=pentium-mmx
  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_MCYRIXIII)	+= $(call cc-option,-march=c3,-march=i486) $(align)
  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_MGEODEGX1)	+= -march=pentium-mmx
  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_MGEODE_LX)	+= $(call cc-option,-march=geode,-march=pentium-mmx)

These build options will, indirectly, not include CMOV in the kernel image, while i686 and higher march options will.

(BTW., we should probably remove the -march=i486 fallback for MCYRIXIII, our minimum CC version is beyond that already I believe.)

Anyway, the current plan is to not drop common-i586, only the removal of what's in the -v1 series:

M486
M486SX
M586
MELAN
MWINCHIP3D
MWINCHIPC6

Quoted 9 lines

Here are some alternatives I like better than dropping i586:

a) keep my patch with an new bool option to pick between i586 and i686 targets, by any name.

b) always build with -march=i586 and leave only the -mtune flags; see if anyone cares enough to even benchmark and pick one of the other options if they can show a meaningful regression over -march=i686 -mtune=

That's actually a good idea IMO. I looked at the code generation with current compilers and it turns out that M686 is *substantially* worse in code generation than M586, as apparently the extra CMOV instructions bloat up the generated code:

text data bss dec hex filename
15427023 7601010 1744896 24772929 17a0141 vmlinux.M586
16578295 7598826 1744896 25922017 18b89e1 vmlinux.M686

- +7.5% increase in text size (5.6% according to bloatometer),
- +2% increase in instruction count,
- while number of branches increases by +1.3%.

But it's not about CMOV: I checked about a dozen functions that end up using CMOV, and the 'conditional' part of CMOV does seem to reduce branches for those functions by a minor degree and ends up reducing their size as well. So CMOV helps, a bit.

The substantial code bloat comes from some other aspect of GCC's march=i686 flag ... I bet it's primarily inlining: there's a 0.7% reduction in number of calls done.

I have a hard time believing that this kind of bloat and complexity helps performance to *any* degree.

I really didn't remember how bad it was, until I re-measured it.

CMOV is likely a drop in the ocean compared to this kind of text bloat. And yeah, it doesn't really matter that i686 class CPUs have larger caches, the kernel is dominantly cache-cold code execution, inlining driven bloat almost never helps performance.

Quoted 3 lines

c) keep the outcome of your v1 series, dropping only pre-i586 support, and leave my patch out. No change here, so at least no regression potential.

Yeah, so this is roughly the current plan, with perhaps light touchups on top to make it easier to configure, and to remove residual legacies.

Thanks,

Ingo

#22 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

Quoted 20 lines · Ingo Molnar
Quoted 5 lines · Arnd Bergmann

b) always build with -march=i586 and leave only the -mtune flags; see if anyone cares enough to even benchmark and pick one of the other options if they can show a meaningful regression over -march=i686 -mtune=

That's actually a good idea IMO. I looked at the code generation with current compilers and it turns out that M686 is *substantially* worse in code generation than M586, as apparently the extra CMOV instructions bloat up the generated code:

text data bss dec hex filename
15427023 7601010 1744896 24772929 17a0141 vmlinux.M586
16578295 7598826 1744896 25922017 18b89e1 vmlinux.M686

- +7.5% increase in text size (5.6% according to bloatometer),
- +2% increase in instruction count,
- while number of branches increases by +1.3%.

Quoted 8 lines

But it's not about CMOV: I checked about a dozen functions that end up using CMOV, and the 'conditional' part of CMOV does seem to reduce branches for those functions by a minor degree and ends up reducing their size as well. So CMOV helps, a bit.

The substantial code bloat comes from some other aspect of GCC's march=i686 flag ... I bet it's primarily inlining: there's a 0.7% reduction in number of calls done.

I had tried the same thing already, but saw a different result, For me, the i686 output is 0.2% smaller than the i586 one (both -mtune=generic), using gcc-14.2. or just 0.1% with clang-21, which is roughly what I expected:

text data bss dec hex filename
7454055 4158218 1695744 13308017 cb1071 build/tmp/vmlinux-i586
7433427 4154146 1695744 13283317 caaff5 build/tmp/vmlinux-i686
7318514 4052573 1687552 13058639 c7424f build/tmp/vmlinux-i586-clang
7309938 4052573 1687552 13050063 c720cf build/tmp/vmlinux-i686-clang

I do see a larger difference compared to other -mtune= options, here is the same config with "clang-21 -march=i586 -mtune=i686" instead of "-march=i586 -mtune=generic":

7254510 4056669 1687552 12998731 c6584b build/tmp/vmlinux

There is a good chance that the -mtune= optimizations totally dwarf cmov not just in code size difference but also actual performance, the bit I'm unsure about is whether we still need to worry about any core where this is not the case (I'm guessing not but have no way to prove that).

Arnd

#23 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

Quoted 26 lines · Arnd Bergmann
Quoted 25 lines · Ingo Molnar
Quoted 5 lines · Arnd Bergmann

b) always build with -march=i586 and leave only the -mtune flags; see if anyone cares enough to even benchmark and pick one of the other options if they can show a meaningful regression over -march=i686 -mtune=

That's actually a good idea IMO. I looked at the code generation with current compilers and it turns out that M686 is *substantially* worse in code generation than M586, as apparently the extra CMOV instructions bloat up the generated code:

text data bss dec hex filename
15427023 7601010 1744896 24772929 17a0141 vmlinux.M586
16578295 7598826 1744896 25922017 18b89e1 vmlinux.M686

- +7.5% increase in text size (5.6% according to bloatometer),
- +2% increase in instruction count,
- while number of branches increases by +1.3%.

But it's not about CMOV: I checked about a dozen functions that end up using CMOV, and the 'conditional' part of CMOV does seem to reduce branches for those functions by a minor degree and ends up reducing their size as well. So CMOV helps, a bit.

Quoted 5 lines
Quoted 3 lines

The substantial code bloat comes from some other aspect of GCC's march=i686 flag ... I bet it's primarily inlining: there's a 0.7% reduction in number of calls done.

I had tried the same thing already, but saw a different result,

Just to clarify, my measurements only compare -march=i586 to -march=i686, not -mtune. Your results are primarily -mtune figures.

So unless you see something different from my figures with -march only, it's an apples to oranges comparison.

Quoted 5 lines

There is a good chance that the -mtune= optimizations totally dwarf cmov not just in code size difference but also actual performance, the bit I'm unsure about is whether we still need to worry about any core where this is not the case (I'm guessing not but have no way to prove that).

I didn't use -mtune - I only tested two Kconfig variants:

CONFIG_M686=y vs. CONFIG_M586TSC=y

... which map to two -march flags, not different -mtune flags:

  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_M586TSC)       += -march=i586
  ...
  arch/x86/Makefile_32.cpu:cflags-$(CONFIG_M686)          += -march=i686

This is the current upstream status quo of x86-32 compiler flags, which results in significant .text bloat:

text data bss dec hex filename

  15427023      7601010 1744896 24772929        17a0141 vmlinux.M586
  16578295      7598826 1744896 25922017        18b89e1 vmlinux.M686

- +7.5% increase in text size (+5.6% according to bloatometer),
- +2% increase in instruction count,
- the number of branches increases by +1.3%,
- while there's a -0.7% reduction in number of CALLs done.

I believe this is mostly the result of increased amount of inlining GCC 14.2.0 does on march=i686 vs. march=i586.

The extra CMOV use on -march=i686 helps a bit but is overwhelmed by the effects of inlining.

Obviously these metrics cannot be automatically transformed into performance figures, but such inlining driven bloat almost always reduces the kernel's performance even on CPUs with large caches, for most but a few select 'hot' functions.

An interesting 'modern' twist: the reduced number of CALLs due to increased inlining is almost certainly reflected in a reduced number of CALLs in real workloads as well, which would be a disproportionately positive factor on x86 kernels and CPUs with retbleed-style mitigations activated (which is almost all of them).

Thanks,

Ingo

#24 lore raw

Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional

Quoted 9 lines · Ingo Molnar

* Arnd Bergmann <[email protected]> wrote:

This is the current upstream status quo of x86-32 compiler flags, which results in significant .text bloat:

text data bss dec hex filename

  15427023      7601010 1744896 24772929        17a0141 vmlinux.M586
  16578295      7598826 1744896 25922017        18b89e1 vmlinux.M686
Quoted 7 lines

- +7.5% increase in text size (+5.6% according to bloatometer),
- +2% increase in instruction count,
- the number of branches increases by +1.3%,
- while there's a -0.7% reduction in number of CALLs done.

I believe this is mostly the result of increased amount of inlining GCC 14.2.0 does on march=i686 vs. march=i586.

I can reproduce +7% numbers like the ones you have shown when CONFIG_X86_GENERIC is disabled, but not if I turn that on, or with my "[RFC] x86/cpu: rework instruction set selection" patch applied.

What makes this confusing is that the -march=i686 option does two things: it changes the allowed instructions to include cmov, and it changes the implicit -mtune= argument to the same value, unless you pass an explicit -mtune= as well.

Selecting the i686 instruction set by itself does not change the amount of inlining at all, you can see that by comparing the i586 and i686 output when CONFIG_X86_GENERIC=y is set, or if you change the flags in the Makefile

What really kills it is the implied -mtune=i686, these are the results of manually changing the flags:

text data bss dec hex filename
7235028 4240706 1691648 13167382 c8eb16 vmlinux # i585
7218356 4240718 1691648 13150722 c8aa02 vmlinux # i686, tune=i586
7299828 4240706 1691648 13232182 c9e836 vmlinux # i586, tune=generic
7278948 4244826 1691648 13215422 c9a6be vmlinux # i686, tune=generic
7784708 4239410 1691648 13715766 d14936 vmlinux # i586, tune=i686
7768340 4239446 1691648 13699434 d1096a vmlinux # i686

If you set the CONFIG_M586/M686 options, you get an additional effect from a couple of changed Kconfig options, that lead to the i686 further shrinking a little more, mainly from less padding:

-CONFIG_X86_F00F_BUG=y
-CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
-CONFIG_X86_MINIMUM_CPU_FAMILY=5
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=6
+CONFIG_X86_DEBUGCTLMSR=y
-CONFIG_CPU_SUP_CYRIX_32=y
-CONFIG_FUNCTION_PADDING_CFI=11
-CONFIG_FUNCTION_PADDING_BYTES=16
+CONFIG_FUNCTION_PADDING_CFI=0
+CONFIG_FUNCTION_PADDING_BYTES=4
+CONFIG_X86_REQUIRED_FEATURE_CMOV=y
-CONFIG_FUNCTION_ALIGNMENT_16B=y
-CONFIG_FUNCTION_ALIGNMENT=16
+CONFIG_FUNCTION_ALIGNMENT=4

Arnd

#39 lore raw
In reply to Ingo Molnar
Quoted 7 lines · Ingo Molnar
Quoted 3 lines

I really get the feeling that it's time to leave i486 support behind. There's zero real reason for anybody to waste one second of development effort on this kind of issue.

This series increases minimum kernel support features to include TSC and CX8 (CMPXCHG8B) hardware support, which removes 486 (and derivatives) support and early-586 (and derivatives) support.

FWIW I'm not happy about that at the very least because this will prevent
me from using my 486 box for EISA defxx driver maintenance. What exactly is the problem with 486?

I know the lack of TSC has security implications, but don't use the
machine in a way for which it would be an issue and I don't expect anyone doing otherwise. We have non-x86 platforms that lack a high-resolution timer and nobody's going to drop them.

We also have platforms that lack atomics, let alone double-precision ones
and they're fine too, so why is x86 different?

Maciej

#40 lore raw
Quoted 19 lines · Maciej W. Rozycki
Quoted 7 lines · Ingo Molnar
Quoted 3 lines

I really get the feeling that it's time to leave i486 support behind. There's zero real reason for anybody to waste one second of development effort on this kind of issue.

This series increases minimum kernel support features to include TSC and CX8 (CMPXCHG8B) hardware support, which removes 486 (and derivatives) support and early-586 (and derivatives) support.

FWIW I'm not happy about that at the very least because this will prevent me from using my 486 box for EISA defxx driver maintenance. What exactly is the problem with 486?

I know the lack of TSC has security implications, but don't use the machine in a way for which it would be an issue and I don't expect anyone doing otherwise. We have non-x86 platforms that lack a high-resolution timer and nobody's going to drop them.

Quoted 4 lines

We also have platforms that lack atomics, let alone double-precision ones and they're fine too, so why is x86 different?

Maciej

Why is x86 different? Because it is a tightly integrated platform with code shared across a very large number of generations, without "silly embedded nonsense hacks."

I think if you have a use case, you need to speak up about it, rather than for people to guess.

#41 lore raw
Quoted 17 lines · H. Peter Anvin
Quoted 17 lines
Quoted 7 lines
Quoted 3 lines

I really get the feeling that it's time to leave i486 support behind. There's zero real reason for anybody to waste one second of development effort on this kind of issue.

This series increases minimum kernel support features to include TSC and CX8 (CMPXCHG8B) hardware support, which removes 486 (and derivatives) support and early-586 (and derivatives) support.

FWIW I'm not happy about that at the very least because this will prevent me from using my 486 box for EISA defxx driver maintenance. What exactly is the problem with 486?

I know the lack of TSC has security implications, but don't use the machine in a way for which it would be an issue and I don't expect anyone doing otherwise. We have non-x86 platforms that lack a high-resolution timer and nobody's going to drop them.

Quoted 6 lines
Quoted 2 lines

We also have platforms that lack atomics, let alone double-precision ones and they're fine too, so why is x86 different?

Why is x86 different? Because it is a tightly integrated platform with code shared across a very large number of generations, without "silly embedded nonsense hacks."

Thank you for the clarification. By "silly embedded nonsense hacks" I
suppose you refer to missing instruction emulation, which some platforms do so as to contain legacy support in a single place and let the rest of the code base assume the required feature is there, relieving maintainers from extra burden, correct?

Quoted 2 lines

I think if you have a use case, you need to speak up about it, rather than for people to guess.

Which I just did; I think that's exactly what an RFC is about, isn't it?

Maciej

#60 lore raw
In reply to Maciej W. Rozycki
Quoted 3 lines · Maciej W. Rozycki

We also have platforms that lack atomics, let alone double-precision ones
and they're fine too, so why is x86 different?

So I don't know if you saw this thread:

https://lore.kernel.org/all/[email protected]/

where I initially thought that it was the lack of TSC, but it looks like it's the CMPXCHG8B code that ends up causing problems.

And the core issue boils down to "there's no point in wasting time on even debugging this".

So basically, the support for i486 costs us more than it is worth.

Linus

#42 lore raw
In reply to Maciej W. Rozycki
Quoted 32 lines · Maciej W. Rozycki
Quoted 17 lines · H. Peter Anvin
Quoted 17 lines
Quoted 7 lines
Quoted 3 lines

I really get the feeling that it's time to leave i486 support behind. There's zero real reason for anybody to waste one second of development effort on this kind of issue.

This series increases minimum kernel support features to include TSC and CX8 (CMPXCHG8B) hardware support, which removes 486 (and derivatives) support and early-586 (and derivatives) support.

FWIW I'm not happy about that at the very least because this will prevent me from using my 486 box for EISA defxx driver maintenance. What exactly is the problem with 486?

I know the lack of TSC has security implications, but don't use the machine in a way for which it would be an issue and I don't expect anyone doing otherwise. We have non-x86 platforms that lack a high-resolution timer and nobody's going to drop them.

Quoted 6 lines
Quoted 2 lines

We also have platforms that lack atomics, let alone double-precision ones and they're fine too, so why is x86 different?

Why is x86 different? Because it is a tightly integrated platform with code shared across a very large number of generations, without "silly embedded nonsense hacks."

Thank you for the clarification. By "silly embedded nonsense hacks" I suppose you refer to missing instruction emulation, which some platforms do so as to contain legacy support in a single place and let the rest of the code base assume the required feature is there, relieving maintainers from extra burden, correct?

Quoted 6 lines
Quoted 2 lines

I think if you have a use case, you need to speak up about it, rather than for people to guess.

Which I just did; I think that's exactly what an RFC is about, isn't it?

Maciej

No, with "silly embedded nonsense hacks" (Google for it) I mean ad hoc hacks breaking the notion of a common platform.

As far as EISA is concerned, could you go into more detail? What are the remaining users of EISA? One thing that happened with i386 was that we found out that the only remaining "users" were people dragging out an old machine to test if the kernel still booted. With bigsmp we had similar experiences – in at least one case we ended up maintaining support for a system of which there were no machines left in existence...

maintainer
#43 lore raw
Quoted 3 lines · H. Peter Anvin

One thing that happened with i386 was that we found out that the only remaining "users" were people dragging out an old machine to test if the kernel still booted.

Follow this thread:

https://lore.kernel.org/r/CANpbe9Wm3z8fy9HbgS8cuhoj0TREYEEkBipDuhgkWFvqX0UoVQ@mail.gmail.com

People booting latest kernel on 486 without CPUID support.

I can't find it in me to care for that old rust and yet I did it again. :-\

So yeah, +1 for removing old code which ain't worth maintaining.

There's stable and older kernels, those folks can use those and that's it.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#58 lore raw
In reply to H. Peter Anvin
Quoted 7 lines · H. Peter Anvin
Quoted 4 lines
Quoted 2 lines

I think if you have a use case, you need to speak up about it, rather than for people to guess.

Which I just did; I think that's exactly what an RFC is about, isn't it?

No, with "silly embedded nonsense hacks" (Google for it) I mean ad hoc hacks breaking the notion of a common platform.

I don't feel like I'm the right person to talk about such stuff. I've
always cared about portability and standardisation.

In fact running old hardware is one aspect of portability verification,
for example I run PCIe stuff off my Pentium MMX and Alpha hardware, and conversely I run conventional PCI stuff off my POWER9 (no port I/O!) and RISC-V hardware. That has triggered numerous bugs, fixed over the years.

Quoted 7 lines

As far as EISA is concerned, could you go into more detail? What are the remaining users of EISA? One thing that happened with i386 was that we found out that the only remaining "users" were people dragging out an old machine to test if the kernel still booted. With bigsmp we had similar experiences – in at least one case we ended up maintaining support for a system of which there were no machines left in existence...

Well, my i486 box is plain EISA, so naturally I need EISA support to run
it:

platform eisa.0: Probing EISA bus 0
eisa 00:00: EISA: Mainboard AEI0401 detected
eisa 00:05: EISA: slot 5: DEC3002 detected
defxx: v1.12 2021/03/10 Lawrence V. Stefani and others
00:05: DEFEA at I/O addr = 0x5000, IRQ = 10, Hardware addr = 00-00-f8-xx-yy-zz 00:05: registered as fddi0
eisa 00:06: EISA: slot 6: NPI0303 detected
eisa 00:08: EISA: slot 8: TCM5094 detected
eth0: 3c5x9 found at 0x8000, 10baseT port, address 00:a0:24:xx:yy:zz, IRQ 12. platform eisa.0: EISA: Detected 3 cards

(fddi0 is the fast intranet interface, eth0 is the slow external one). It's a luggable integrated computer BTW, a Dolch PAC 60, very nice and compact, previously used by a field engineer for network fault isolation.

I've already mentioned the maintenance of the defxx driver (it is also an
exercise in portability, with defxx supporting 3 host bus attachments).

This is also my backup box for GNU toolchain (GCC/glibc/GDB) verification
for the i386 target. It has actually proved recently to still have some commercial relevance (again, for portability verification), but who says the use of Linux is supposed to be solely commercial even nowadays?

The origin of Linux is obvious and I wouldn't be around at all let alone
for so many years if not for my enthusiasm solely for the technical merit of Linux (following my earlier passion for processors and systems) accompanied by the fairness of the GNU GPL, with any commercial aspect being at most distantly relevant and a late comer into the game.

So yes, count me in as a passionate systems software engineer with a
fondness for running odd configurations for the sake of experimentation (and consequently a portability exercise) and please do not deprive me of my enthusiasm.

Maciej

#44 lore raw
In reply to Borislav Petkov
Quoted 9 lines · Borislav Petkov
Quoted 3 lines

One thing that happened with i386 was that we found out that the only remaining "users" were people dragging out an old machine to test if the kernel still booted.

Follow this thread:

https://lore.kernel.org/r/CANpbe9Wm3z8fy9HbgS8cuhoj0TREYEEkBipDuhgkWFvqX0UoVQ@mail.gmail.com

People booting latest kernel on 486 without CPUID support.

No such hardware here:

processor : 0
vendor_id : GenuineIntel
cpu family : 4
model : 3
model name : 486 DX/2
stepping : 5
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme cpuid
bugs : itlb_multihit
bogomips : 32.56
clflush size : 32
cache_alignment : 32
address sizes : 32 bits physical, 32 bits virtual
power management:

Sadly it's not one with 4MiB page support (that would be stepping 6).

Quoted 1 line

There's stable and older kernels, those folks can use those and that's it.

Doesn't work for ongoing driver maintenance (and yes, distractions such
as this only keep me from taking care of outstanding stuff, like figuring out why the defxx driver reproducibly crashes with my POWER9 box running glibc verification remotely for my RISC-V box; it's all intertwined and an issue in one place affects other ones, sigh).

Maciej

#61 lore raw
In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds
Quoted 2 lines

We also have platforms that lack atomics, let alone double-precision ones
and they're fine too, so why is x86 different?

So I don't know if you saw this thread:

   https://lore.kernel.org/all/[email protected]/

where I initially thought that it was the lack of TSC, but it looks like it's the CMPXCHG8B code that ends up causing problems.

I did glance over (in my effort to process outstanding 40k mailing list
messages in two days), but haven't spotted CMPXCHG8B being the culprit; thanks for the pointer.

Quoted 2 lines

And the core issue boils down to "there's no point in wasting time on even debugging this".

Sadly I tend to agree, being unable, owing to time constraints, to commit
myself to doing such debugging (NB glibc verification crashes i386 Linux reliably on Pentium MMX, apparently due to FP context corruption, and I need to prioritise debugging that, once I've figured out which actual test case triggers it, as due to the oddity of the glibc test system it's quite tough getting the logs matched between the host and the target system).

Quoted 1 line

So basically, the support for i486 costs us more than it is worth.

So the cost has to be reduced and just as I proposed on the previous
iteration last year this can be solved quite easily without sacrificing i486 support by adding #UD handler for CMPXCHG8B, just as we did for analogous stuff with some RISC platforms years if not decades ago.

I was told in said discussion that decoding x86 address modes was not as
easy as with RISC modes (thank you, Captain Obvious!), but still that boils down to indexing into registers by ModR/M and SIB bit-fields, with a couple of corner cases, which ought to be less than a screenful of code. If objdump(1) can do it, so can we.

No i486 has ever run Linux SMP. Back in the day I tried hard to chase by
the spec a single i486 system built around the APIC and Intel MP Spec and could not find any. Compaq had some proprietary stuff (Corollary bus?) we never had support for. And we discarded support for the discrete i82489DX APIC years ago anyway that some Pentium systems used too for the original P5 microarchitecture or to go beyond dual. So said emulation would have to handle the UP case only, which ought to be straightforward and well contained.

Thoughts?

Maciej

#59 lore raw
In reply to Maciej W. Rozycki
Quoted 4 lines · Maciej W. Rozycki

In fact running old hardware is one aspect of portability verification,
for example I run PCIe stuff off my Pentium MMX and Alpha hardware, and conversely I run conventional PCI stuff off my POWER9 (no port I/O!) and RISC-V hardware. That has triggered numerous bugs, fixed over the years.

I agree with that stance. Building and running Debian on various architectures has enabled use to find obscure bugs that did not trigger easily on x86_64 or arm64.

I remember one nasty bug in the DMA code that initially showed on ia64 only and it was only when someone finally ran into the same problem on x86_64 that it was actually fixed.

Quoted 5 lines

(fddi0 is the fast intranet interface, eth0 is the slow external one). It's a luggable integrated computer BTW, a Dolch PAC 60, very nice and compact, previously used by a field engineer for network fault isolation.

Quoted 7 lines

I've already mentioned the maintenance of the defxx driver (it is also an
exercise in portability, with defxx supporting 3 host bus attachments).

This is also my backup box for GNU toolchain (GCC/glibc/GDB) verification
for the i386 target. It has actually proved recently to still have some commercial relevance (again, for portability verification), but who says the use of Linux is supposed to be solely commercial even nowadays?

I fully agree with this. Cross-architecture testing really helps finding hidden bugs and it's also fun ;-).

Quoted 10 lines

The origin of Linux is obvious and I wouldn't be around at all let alone
for so many years if not for my enthusiasm solely for the technical merit of Linux (following my earlier passion for processors and systems) accompanied by the fairness of the GNU GPL, with any commercial aspect being at most distantly relevant and a late comer into the game.

So yes, count me in as a passionate systems software engineer with a
fondness for running odd configurations for the sake of experimentation (and consequently a portability exercise) and please do not deprive me of my enthusiasm.

Count me in as well.

PS: No, we don't have to bring back ia64 for that matter ;-).

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer
#45 lore raw
In reply to Maciej W. Rozycki
Quoted 1 line · Maciej W. Rozycki

Doesn't work for ongoing driver maintenance

Dunno, I'd concentrate my efforts on something, a *little* *bit* more modern. At some point this is old rusty hw no matter from which way you look at it and it might as well be left to rest in its sunset days.

But I certainly am not trying to tell you what to do with your time.

What I have problem with is wasting my time maintaining old, ancient hw which is not worth the electricity it needs to run. Especially if you can get something orders of magnitudes better in *any* aspect you can think of, and actually get some real work done.

:-P

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#62 lore raw
In reply to Maciej W. Rozycki
Quoted 48 lines · Maciej W. Rozycki
Quoted 9 lines · Linus Torvalds
Quoted 2 lines

We also have platforms that lack atomics, let alone double-precision ones
and they're fine too, so why is x86 different?

So I don't know if you saw this thread:

   https://lore.kernel.org/all/[email protected]/

where I initially thought that it was the lack of TSC, but it looks like it's the CMPXCHG8B code that ends up causing problems.

I did glance over (in my effort to process outstanding 40k mailing list messages in two days), but haven't spotted CMPXCHG8B being the culprit; thanks for the pointer.

Quoted 2 lines

And the core issue boils down to "there's no point in wasting time on even debugging this".

Sadly I tend to agree, being unable, owing to time constraints, to commit myself to doing such debugging (NB glibc verification crashes i386 Linux reliably on Pentium MMX, apparently due to FP context corruption, and I need to prioritise debugging that, once I've figured out which actual test case triggers it, as due to the oddity of the glibc test system it's quite tough getting the logs matched between the host and the target system).

Quoted 1 line

So basically, the support for i486 costs us more than it is worth.

So the cost has to be reduced and just as I proposed on the previous iteration last year this can be solved quite easily without sacrificing i486 support by adding #UD handler for CMPXCHG8B, just as we did for analogous stuff with some RISC platforms years if not decades ago.

I was told in said discussion that decoding x86 address modes was not as easy as with RISC modes (thank you, Captain Obvious!), but still that boils down to indexing into registers by ModR/M and SIB bit-fields, with a couple of corner cases, which ought to be less than a screenful of code. If objdump(1) can do it, so can we.

No i486 has ever run Linux SMP. Back in the day I tried hard to chase by the spec a single i486 system built around the APIC and Intel MP Spec and could not find any. Compaq had some proprietary stuff (Corollary bus?) we never had support for. And we discarded support for the discrete i82489DX APIC years ago anyway that some Pentium systems used too for the original P5 microarchitecture or to go beyond dual. So said emulation would have to handle the UP case only, which ought to be straightforward and well contained.

Quoted 3 lines

Thoughts?

Maciej

However, building a #UD instruction emulator is a project in itself that someone would have to take on. It isn't inherently simpler – quite the opposite – than the alternatives calling to a stub function than we have now.

We have the tools to do it; there is now a full x86 instruction decoder in the kernel that one could use to do this, but...

a. Someone would have to take it on;
b. It will need continuous testing;
c. That someone would *also* have to go through the additional effort of keeping the mainline code clean for the maintainers of the modern hardware.

And at some point we will be at a point where we were with i386 that the only users are occasional testers.

With regards to EISA, you still haven't clarified if there is a true use case or if this is a museum/nostalgia project. There isn't anything *wrong* with museum projects, not at all (I recently got to play SPACEWAR! on a real PDP-1; it was amazing) but imposing a maintenance burden on the mainline developers of one of the most heavily used architecture on the planet is not practical.

If someone really wanted to, they could maybe fork off, say, arch/i486 and maintain the a version of the kernel limited to these old machines, but it would require someone being willing to do the work.

#63 lore raw
Quoted 4 lines · H. Peter Anvin

a. Someone would have to take it on;
b. It will need continuous testing;
c. That someone would *also* have to go through the additional effort of keeping the mainline code clean for the maintainers of the modern hardware.

I think the main issue is "when problems happen, people who *shouldn't* have to care get reports".

I really think that the way forward is basically what we did for ia64:
get rid of i486 support in mainline, and people who care about i486 can maintain a smallish patch that basically keeps it alive for them.

Because I suspect that the "patch to keep it working in practice" is likely going to remain pretty small: it's the silly cmpxchg helper wrappers, it's disabling ARCH_USE_CMPXCHG_LOCKREF, and probably a few X86_FEATURE_CX8 tests.

And it probably (a) works fine and (b) won't be code that changs very much upstream, so maintaining it outside the main tree is likely not a lot of work.

But because it's outside of the main tree, it won't cause pointless noise from 0day bots etc, and won't affect people who care about modern machines. And it can do various hacky things because the patch would *only* be used by people who actually run on an i486-class machine.

(Ok, if you actually care about the i486SX, the patch will be much bigger, because it will have that whole FPU emulation code in it)

Linus

#64 lore raw
Quoted 28 lines · Linus Torvalds
Quoted 4 lines · H. Peter Anvin

a. Someone would have to take it on;
b. It will need continuous testing;
c. That someone would *also* have to go through the additional effort of keeping the mainline code clean for the maintainers of the modern hardware.

I think the main issue is "when problems happen, people who *shouldn't* have to care get reports".

I really think that the way forward is basically what we did for ia64:
get rid of i486 support in mainline, and people who care about i486 can maintain a smallish patch that basically keeps it alive for them.

Because I suspect that the "patch to keep it working in practice" is likely going to remain pretty small: it's the silly cmpxchg helper wrappers, it's disabling ARCH_USE_CMPXCHG_LOCKREF, and probably a few X86_FEATURE_CX8 tests.

And it probably (a) works fine and (b) won't be code that changs very much upstream, so maintaining it outside the main tree is likely not a lot of work.

But because it's outside of the main tree, it won't cause pointless noise from 0day bots etc, and won't affect people who care about modern machines. And it can do various hacky things because the patch would *only* be used by people who actually run on an i486-class machine.

Quoted 4 lines

(Ok, if you actually care about the i486SX, the patch will be much bigger, because it will have that whole FPU emulation code in it)

Linus

Yes, the patch will be bigger, but it's just a bunch of highly static code copied straight out of the current kernel with very few touch points to the rest of the kernel (which is why we didn't axe it together with i386 support. Now that one was ugly, with touch points all over the place.)

It is basically the same idea as the arch/i486 I suggested, just in a separate git tree (although I guess I don't really see how this is fundamentally different than, say, arch/m68k.)

An i486/i586 retroport can presumably also axe a bunch of things like side channel mitigations; most of them aren't applicable to the in-order i486/586 pipelines and the rest ... well, on a machine that slow, you are unlikely to be running the kind of workloads that care.

Similarly, you should be able to simply unsupport the things that make the entry/exit code a nightmare, like SYSENTER and fancy NMI hacks (the latter requires an APIC.)

As far as I know, Transmeta Crusoe was the only i586-class CPU which supported SYSENTER (if that version of the firmware even shipped, I'm not sure), and Crusoe was "almost" i686 class in terms of ISA (mainly lacking PAE and NOPL, and having P5-like flags behavior.)

There is a huge gap then to the i686, with the i686 being the direct ancestor of the x86-64 systems in terms of systems architecture (APIC, PAE*, etc; SYSENTER in the second iteration; a general tightening of the ISA definition; PCI universal by then...)

But again, this is all academic unless someone steps up and wants to take on such a project.

-hpa

* – I believe there was one version of the Pentium M which didn't have PAE, at least officially, although I understand that if you flipped the CR4 bit it actually worked. I am guessing, without any concrete evidence, that there was a timing path and that it would fail at the highest operating temperatures on some subset of chips.

#46 lore raw
In reply to Borislav Petkov
Quoted 5 lines · Borislav Petkov
Quoted 1 line

Doesn't work for ongoing driver maintenance

Dunno, I'd concentrate my efforts on something, a *little* *bit* more modern. At some point this is old rusty hw no matter from which way you look at it and it might as well be left to rest in its sunset days.

One doesn't exclude the other. I do POWER9 or RISC-V stuff too. Isn't
it modern enough?

Quoted 4 lines

What I have problem with is wasting my time maintaining old, ancient hw which is not worth the electricity it needs to run. Especially if you can get something orders of magnitudes better in *any* aspect you can think of, and actually get some real work done.

I don't want you let alone expect to waste time on anything you're not
interested in. I'm trying to find a solution that saves you from that while preferably keeping everyone happy enough, including myself.

Real work? I find engineering challenges enjoyable regardless of the age
of hardware involved and I don't want to take away anyone's daily bread (including mine) by spending my free time on a project someone might have commercial interest in and should pay for. An obsolete platform is ideal for this purpose.

And what's better and what's not is subjective. I don't find all the new
stuff better, just as I don't all the old stuff. At least the old gear tends to be sturdy (once you've contained issues with the PSU) and likely won't suffer from electromigration in a few years' time. It can be easier to repair too if a component does fail.

NB people also fancy old cars, or boats, or trains even, not because
they're faster, more comfortable, or have any real advantage over modern alternatives.

Maciej

#67 lore raw
In reply to H. Peter Anvin
Quoted 9 lines · H. Peter Anvin
Quoted 8 lines

No i486 has ever run Linux SMP. Back in the day I tried hard to chase by the spec a single i486 system built around the APIC and Intel MP Spec and could not find any. Compaq had some proprietary stuff (Corollary bus?) we never had support for. And we discarded support for the discrete i82489DX APIC years ago anyway that some Pentium systems used too for the original P5 microarchitecture or to go beyond dual. So said emulation would have to handle the UP case only, which ought to be straightforward and well contained.

Quoted 4 lines

However, building a #UD instruction emulator is a project in itself that someone would have to take on. It isn't inherently simpler – quite the opposite – than the alternatives calling to a stub function than we have now.

Perhaps my RISC background makes me view instruction emulation as simpler
than patching code. It has been common throughout computing history too. In any case it would contain all the handling in a single function called from the generic #UD exception handler, something that could be `if (IS_ENABLED(CONFIG_M486))' and therefore completely ignored for all the newer platforms, and leaving the rest of the kernel code exactly the same as we now have for CMPXCHG8B platforms.

My x86-fu is a bit rusty and surely I'm not familiar with all the recent
features, however I retain my 20+ years of past experience, most recently with interfacing Atom systems via a JTAG probe to GDB over the remote serial protocol (which did include writing instruction emulation in the debug stub, specifically for MOV to/from debug registers or you wouldn't be able to run e.g. BIOS initialisation with the debugger attached due to the general-detect fault), and the i486/Pentium stuff is contemporary to my experience, so writing such an emulation handler shouldn't be a big deal to me.

Note that we'll only have to emulate it for the kernel itself, so the
emulation won't have to handle all the obscure corner cases, such as 16-bit address modes, odd segment prefixes, or VM86 mode.

Quoted 8 lines

We have the tools to do it; there is now a full x86 instruction decoder in the kernel that one could use to do this, but...

a. Someone would have to take it on;
b. It will need continuous testing;
c. That someone would *also* have to go through the additional effort of
keeping the mainline code clean for the maintainers of the modern hardware.

I'd expect instruction emulation code to be zero-maintenance effort. We
have had such bits in the MIPS platform and they haven't been touched in decades. It's not like machine instruction interpretation is ever going to change. And none of the x86 maintainters will have to care whether it actually works, as nobody will see any adverse effect *unless* they build an i486 kernel *and* actually run it on an i486 both at a time. Anything newer just won't ever trigger it.

Quoted 2 lines

And at some point we will be at a point where we were with i386 that the only users are occasional testers.

I agree that the lack of the WP bit with the original i386 CPU was a real
showstopper and a maintenance nightmare, and still having code to handle that misfeature would surely be a security hell nowadays too, so it had to go as soon as feasible. As a nice side effect it let us get rid of the 287/387 PC/AT-specific handling mess.

Quoted 6 lines

With regards to EISA, you still haven't clarified if there is a true use case or if this is a museum/nostalgia project. There isn't anything *wrong* with museum projects, not at all (I recently got to play SPACEWAR! on a real PDP-1; it was amazing) but imposing a maintenance burden on the mainline developers of one of the most heavily used architecture on the planet is not practical.

There is no commercial value and no use case beyond making sure all the
pieces involved continue to run. You can call it a museum/nostalgia project if you prefer; for me it's the usual engineering challenge as with everything I do around Linux.

As already stated in my reply to Borislav I don't want to put any burden
on any maintainers and I'm trying to reduce it to zero while not losing the features. The lone presence of a piece of code isn't a burden unless you actually have to do anything about it.

I realise it's easier done with a niche kernel architecture than with one
of the mainstream ones.

Quoted 3 lines

If someone really wanted to, they could maybe fork off, say, arch/i486 and maintain the a version of the kernel limited to these old machines, but it would require someone being willing to do the work.

There's willingness and there's the availability of resources. If it's
say 2KiB worth of source code difference that you don't have to look at unless you run the platform that needs it, I'd argue I could maintain it, but question whether it's worth forking in the first place rather than keeping it in the main repo.

Maciej

#66 lore raw
In reply to Linus Torvalds
Quoted 6 lines · Linus Torvalds
Quoted 3 lines

a. Someone would have to take it on;
b. It will need continuous testing;
c. That someone would *also* have to go through the additional effort of keeping the mainline code clean for the maintainers of the modern hardware.

I think the main issue is "when problems happen, people who *shouldn't* have to care get reports".

FWIW I can't agree more here.

Quoted 8 lines

I really think that the way forward is basically what we did for ia64:
get rid of i486 support in mainline, and people who care about i486 can maintain a smallish patch that basically keeps it alive for them.

Because I suspect that the "patch to keep it working in practice" is likely going to remain pretty small: it's the silly cmpxchg helper wrappers, it's disabling ARCH_USE_CMPXCHG_LOCKREF, and probably a few X86_FEATURE_CX8 tests.

Why would these have to be disabled if we have CMPXCHG8B emulation? Yes,
performance won't be stellar, but we talked it through already in the context of my recent EV4 Alpha effort. People ran FPU emulation back in the day too rather than using soft-float, which would have surely reduced the handling overhead.

Quoted 3 lines

And it probably (a) works fine and (b) won't be code that changs very much upstream, so maintaining it outside the main tree is likely not a lot of work.

Conversely dropping support for a subtarget in the kernel will likely
prompt the removal on the userland side, namely glibc, which will only complicate things.

Quoted 5 lines

But because it's outside of the main tree, it won't cause pointless noise from 0day bots etc, and won't affect people who care about modern machines. And it can do various hacky things because the patch would *only* be used by people who actually run on an i486-class machine.

This is a fair point, although I'm not sure why the bots are expected to
complain about a piece of code once it's settled and does not change. I can't recall any mailing list traffic about MIPS instruction emulation for legacy systems (and we made it a part of the uABI even) in what? -- 20 years or so.

And I'd prefer to stay away from hacks even at the cost of performance.
I don't find the emulation of CMPXCHG8B and maybe RDTSC if really needed (possibly in a trivial way, such as returning an incrementing software counter) a hack, but evolution. It has happened before.

Quoted 2 lines

(Ok, if you actually care about the i486SX, the patch will be much bigger, because it will have that whole FPU emulation code in it)

FWIW I'm fine to see FPU emulation code go, especially as it's something
that can be sorted in the userland for the so inclined. Or you can run a soft-float userland, for example in the form of a GCC multilib just as done with numerous targets.

Maciej

#65 lore raw
In reply to H. Peter Anvin
Quoted 8 lines · H. Peter Anvin

An i486/i586 retroport can presumably also axe a bunch of things like side channel mitigations; most of them aren't applicable to the in-order i486/586 pipelines and the rest ... well, on a machine that slow, you are unlikely to be running the kind of workloads that care.

Similarly, you should be able to simply unsupport the things that make the entry/exit code a nightmare, like SYSENTER and fancy NMI hacks (the latter requires an APIC.)

I do have a dual i586 with an APIC; used it to work on some NMI watchdog
stuff that landed in mainline 25+ years ago. Back in the day such systems were pretty common, built around the NX or later the HX chipset, so it's not that APIC support is irrelevent could be dropped. If we were to go for a separate port, than stuff could potentially be resurrected too that was previously removed, such as discrete i82489DX APIC support.

NB that box actually still runs some server software I need for my lab
(MOP daemon, needed to netboot various DEC equipment) that I haven't ported to POWER9 owing to higher priority items.

Quoted 4 lines

There is a huge gap then to the i686, with the i686 being the direct ancestor of the x86-64 systems in terms of systems architecture (APIC, PAE*, etc; SYSENTER in the second iteration; a general tightening of the ISA definition; PCI universal by then...)

I suspect eventually we'll want to drop all IA-32 support from mainline;
isn't it of no commercial relevance already? Hasn't even the embedded x86 ecosystem switched to 64-bit Atom and the like?

Actually I think a project to maintain the whole IA-32 platform alive
rather than just the i486 subtarget might attract more attention and people beyond just myself and Adrian. So far I've committed to support across the board (Linux where applicable and the GNU toolchain) for DEC Alpha, MIPS and VAX platforms plus a couple of small pieces such as the defxx driver and I can hardly cope already, so taking on another large project just won't work if I were alone with it.

Quoted 2 lines

But again, this is all academic unless someone steps up and wants to take on such a project.

Correct, I just want to keep support to the minimum at the moment.

Maciej

maintainer
#47 lore raw
In reply to Maciej W. Rozycki
Quoted 32 lines · Maciej W. Rozycki
Quoted 5 lines · Borislav Petkov
Quoted 1 line

Doesn't work for ongoing driver maintenance

Dunno, I'd concentrate my efforts on something, a *little* *bit* more modern. At some point this is old rusty hw no matter from which way you look at it and it might as well be left to rest in its sunset days.

One doesn't exclude the other. I do POWER9 or RISC-V stuff too. Isn't it modern enough?

Quoted 4 lines

What I have problem with is wasting my time maintaining old, ancient hw which is not worth the electricity it needs to run. Especially if you can get something orders of magnitudes better in *any* aspect you can think of, and actually get some real work done.

I don't want you let alone expect to waste time on anything you're not interested in. I'm trying to find a solution that saves you from that while preferably keeping everyone happy enough, including myself.

Real work? I find engineering challenges enjoyable regardless of the age of hardware involved and I don't want to take away anyone's daily bread (including mine) by spending my free time on a project someone might have commercial interest in and should pay for. An obsolete platform is ideal for this purpose.

And what's better and what's not is subjective. I don't find all the new stuff better, just as I don't all the old stuff. At least the old gear tends to be sturdy (once you've contained issues with the PSU) and likely won't suffer from electromigration in a few years' time. It can be easier to repair too if a component does fail.

Quoted 3 lines

NB people also fancy old cars, or boats, or trains even, not because they're faster, more comfortable, or have any real advantage over modern alternatives.

This fits very well, IMO, with Linus' suggestion to support this stuff out of tree. I think this solution is the optimal one for all parties involved...

Signature · 1 line
Sent from a small device: formatting sucks and brevity is inevitable.
#48 lore raw
Quoted 8 lines · Borislav Petkov
Quoted 3 lines

NB people also fancy old cars, or boats, or trains even, not because they're faster, more comfortable, or have any real advantage over modern alternatives.

This fits very well, IMO, with Linus' suggestion to support this stuff out of tree. I think this solution is the optimal one for all parties involved...

Would kernel.org git infrastructure be available for such a project?

Maciej

maintainer
#49 lore raw
Quoted 7 lines · Maciej W. Rozycki
Quoted 5 lines · Borislav Petkov
Quoted 3 lines

NB people also fancy old cars, or boats, or trains even, not because they're faster, more comfortable, or have any real advantage over modern alternatives.

Quoted 5 lines
Quoted 3 lines

This fits very well, IMO, with Linus' suggestion to support this stuff out of tree. I think this solution is the optimal one for all parties involved...

Would kernel.org git infrastructure be available for such a project?

as in hosting your repo there?

I don't see why not:

https://korg.docs.kernel.org/accounts.html

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#50 lore raw
Quoted 7 lines · Borislav Petkov
Quoted 1 line

Would kernel.org git infrastructure be available for such a project?

as in hosting your repo there?

I don't see why not:

https://korg.docs.kernel.org/accounts.html

Thank you. It seems it'll be tough for me though to fulfil the GPG key
trustability requirement. While I've used PGP/GPG since 1995, I haven't been active collecting signatures with my more recent keys/IDs and neither I have appeared in public among Linux kernel developers often enough for me to be identified by face over a video call. Oh well...

Maciej

#51 lore raw
Quoted 6 lines · Maciej W. Rozycki

Thank you. It seems it'll be tough for me though to fulfil the GPG key
trustability requirement. While I've used PGP/GPG since 1995, I haven't been active collecting signatures with my more recent keys/IDs and neither I have appeared in public among Linux kernel developers often enough for me to be identified by face over a video call. Oh well...

I don't think this has been insurmountable before, particularly for anybody who has been around for as long as you have. Even your current email goes back to at least the beginnings of git.

If "two decades+ of active kernel development involvement using the same email address" doesn't make you eligible for a kernel.org account, we're doing something wrong.

Linus

#52 lore raw
Quoted 12 lines · Linus Torvalds
Quoted 6 lines · Maciej W. Rozycki

Thank you. It seems it'll be tough for me though to fulfil the GPG key
trustability requirement. While I've used PGP/GPG since 1995, I haven't been active collecting signatures with my more recent keys/IDs and neither I have appeared in public among Linux kernel developers often enough for me to be identified by face over a video call. Oh well...

I don't think this has been insurmountable before, particularly for anybody who has been around for as long as you have. Even your current email goes back to at least the beginnings of git.

Quoted 6 lines

If "two decades+ of active kernel development involvement using the same email address" doesn't make you eligible for a kernel.org account, we're doing something wrong.

Linus

Yeah, we have dealt with this before :)

#53 lore raw
In reply to Linus Torvalds

Hi,

Quoted 8 lines · Linus Torvalds
Quoted 6 lines · Maciej W. Rozycki

Thank you. It seems it'll be tough for me though to fulfil the GPG key
trustability requirement. While I've used PGP/GPG since 1995, I haven't been active collecting signatures with my more recent keys/IDs and neither I have appeared in public among Linux kernel developers often enough for me to be identified by face over a video call. Oh well...

Quoted 7 lines

I don't think this has been insurmountable before, particularly for anybody who has been around for as long as you have. Even your current email goes back to at least the beginnings of git.

If "two decades+ of active kernel development involvement using the same email address" doesn't make you eligible for a kernel.org account, we're doing something wrong.

I agree. Maciej does a fantastic job saving old junk^W^Wretro hardware ;-).

I'm sure there should be anyone in Maciej's area that could sign his keys.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#54 lore raw
Quoted 9 lines · John Paul Adrian Glaubitz
Quoted 9 lines
Quoted 5 lines

Thank you. It seems it'll be tough for me though to fulfil the GPG key
trustability requirement. While I've used PGP/GPG since 1995, I haven't been active collecting signatures with my more recent keys/IDs and neither I have appeared in public among Linux kernel developers often enough for me to be identified by face over a video call. Oh well...

I don't think this has been insurmountable before, particularly for anybody who has been around for as long as you have. Even your current email goes back to at least the beginnings of git.

Hmm, a .mailmap artifact perhaps; I actually only switched to my current
e-mail address back in 2021 once linux-mips.org has lost all the remaining credibility in my eyes. There's exactly one "Patch-dusted-off-by:" commit using my yet earlier personal address, plus a bunch using my various old work addresses too.

All the earlier work has been buried either in the linux-mips.org git
repo, going back via conversion from CVS to:

commit 1513ff9b7899ab588401c89db0e99903dbf5f886

Author: Ralf Baechle <[email protected]>
Date:   Mon Nov 28 11:59:19 1994 +0000

Import of Linus's Linux 1.1.68

(which I still do hope to fully recover and for which kernel.org seems to be the right ultimate haven), or in LKML and other mailing list archives.

None of this however proves any GPG key offered is actually mine.

Quoted 5 lines
Quoted 3 lines

If "two decades+ of active kernel development involvement using the same email address" doesn't make you eligible for a kernel.org account, we're doing something wrong.

I agree. Maciej does a fantastic job saving old junk^W^Wretro hardware ;-).

Thank you. That makes two of us; the rest has switched to NetBSD.

Quoted 1 line

I'm sure there should be anyone in Maciej's area that could sign his keys.

Undoubtedly, but finding someone local who has a kernel.org account and
can actually tell I am who I claim I am will be rather tough, and trusting a government-issued ID alone may be questionable nowadays, as correctly observed in <https://korg.docs.kernel.org/accounts.html#pgp-web-of-trust>.

Maciej

#55 lore raw
Quoted 2 lines · Maciej W. Rozycki

Hmm, a .mailmap artifact perhaps

Ahh, indeed. I was looking at commit feea1db26e5b ("[PATCH] defxx: Use irqreturn_t for the interrupt handler") from 2005, but yes, the raw commit information has your linux-mips address, and it's just that "git log" will translate it to something much newer...

But I really don't think we've ever been *so* strict about pgp keys having all the proper pgp key signature chains. Yes, it's the normal rule and the regular way people identify themselves, but nothing should ever be mindlessly black-and-white.

Linus

#56 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 2 lines · Maciej W. Rozycki

Hmm, a .mailmap artifact perhaps

Ahh, indeed. I was looking at commit feea1db26e5b ("[PATCH] defxx: Use irqreturn_t for the interrupt handler") from 2005, but yes, the raw commit information has your linux-mips address, and it's just that "git log" will translate it to something much newer...

Quoted 4 lines

But I really don't think we've ever been *so* strict about pgp keys having all the proper pgp key signature chains. Yes, it's the normal rule and the regular way people identify themselves, but nothing should ever be mindlessly black-and-white.

Having the discussion with Maciej offlist.

The issue here is obviously not that Maciej is qualified to have a kernel.org account (I consider that to be a given), but that we need to avoid a "Jia Tan" incident.

-hpa

#36 lore raw

Re: [PATCH 15/15] x86/atomics: Remove !CONFIG_X86_CX8 methods

In reply to Uros Bizjak
Quoted 33 lines · Uros Bizjak
Quoted 17 lines · Ingo Molnar
Quoted 4 lines · Uros Bizjak

On 25. 04. 25 10:42, Ingo Molnar wrote:

Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +4 -1
-#endif
+#define arch_cmpxchg64                     __cmpxchg64
+#define arch_cmpxchg64_local               __cmpxchg64_local
+#define arch_try_cmpxchg64         __try_cmpxchg64
+#define arch_try_cmpxchg64_local   __try_cmpxchg64_local
  #define system_has_cmpxchg64()            boot_cpu_has(X86_FEATURE_CX8)

#define system_has_cmpxchg64() 1

Quoted 1 line

Thanks, I've updated the patch with the change below.

I think you also want to change:

Quoted 11 lines
lib/atomic64_test.c +0 -2
index d726068358c7de..352e811c99ce9e 100644
@@ -254,10 +254,8 @@ static __init int test_atomics_init(void)
 pr_info("passed for %s platform %s CX8 and %s SSE\n",
 #ifdef CONFIG_X86_64
 "x86-64",
-#elif defined(CONFIG_X86_CX8)
- "i586+",
 #else
Quoted 8 lines

lib/atomic64_test.c static __init int test_atomics_init(void) · line 260

Quoted 4 lines
lib/atomic64_test.c +1 -1
- "i386+",
+ "i586+",
 #endif
 boot_cpu_has(X86_FEATURE_CX8) ? "with" : "without",

X86_FEATURE_CX8 is now always defined, so the "without" part is now a dead code. Perhaps the info message should be updated to always say "... platform with CX8 and ..." or even to remove this part.

Yeah, agreed. I've folded in the delta change below.

Thanks,

Ingo

---
 lib/atomic64_test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/atomic64_test.c +1 -2
index 352e811c99ce..d7697c09041f 100644
@@ -251,13 +251,12 @@ static __init int test_atomics_init(void)
 	test_atomic64();
 
 #ifdef CONFIG_X86
-	pr_info("passed for %s platform %s CX8 and %s SSE\n",
+	pr_info("passed for %s platform with CX8 and %s SSE\n",
 #ifdef CONFIG_X86_64
 		"x86-64",
 #else
 		"i586+",
 #endif
-	       boot_cpu_has(X86_FEATURE_CX8) ? "with" : "without",
 	       boot_cpu_has(X86_FEATURE_XMM) ? "with" : "without");
 #else
 	pr_info("passed\n");
#57 lore raw
In reply to Linus Torvalds
Quoted 4 lines · Linus Torvalds

But I really don't think we've ever been *so* strict about pgp keys having all the proper pgp key signature chains. Yes, it's the normal rule and the regular way people identify themselves, but nothing should ever be mindlessly black-and-white.

I agree about being reasonable. However times are such that we need to
be extremely vigilant. I wish we were back in the 1990s when the worst threat online seemed to be unsolicited offers received via e-mail for various enlargement treatments; sadly not for the brain.

Maciej