Skip to contentSkip to conversation

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

PATCH Applied Ingo Molnar 11 participants 29 messages Dec 14, 2025 – Mar 30

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

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

Changes in -v3:

- Port to v6.19-rc1

Changes in -v2:

- Rebase to v6.15-rc6 + the relevant x86 tree branch

- Use proper asm() constraints in the simplified CX8 methods (Uros Bizjak)

- Remove stray family-4 default (suggested by Arnd Bergmann)

- Simplify CX8 test (suggested by Uros Bizjak)

- Add review tags

The latest version of this series can be found at:

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

Thanks,

Ingo

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

Original -v1 announcement:

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

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

#1 lore raw

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

---
 arch/x86/Kconfig                | 10 ----------
 arch/x86/Kconfig.cpu            | 42 +++++++++--------------------------------
 arch/x86/Makefile_32.cpu        |  2 --
 arch/x86/include/asm/vermagic.h |  6 ------
 4 files changed, 9 insertions(+), 51 deletions(-)
arch/x86/Kconfig +0 -10
index 80527299f859..ed4485ee32ad 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.
@@ -2761,11 +2756,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 -33

99 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.51.0
merge bot Applied
#2 lore raw

[tip: x86/platform] x86/cpu: Remove M486/M486SX/ELAN support

The following commit has been merged into the x86/platform branch of tip:

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     7d246d15b140cf99eb7cc89b8cca9ef9e3a85660
Gitweb:        https://git.kernel.org/tip/7d246d15b140cf99eb7cc89b8cca9ef9e3a85660
Author:        Ingo Molnar <[email protected]>
AuthorDate:    Sun, 14 Dec 2025 09:46:49 +01:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Mon, 30 Mar 2026 08:54:32 +02:00

x86/cpu: Remove M486/M486SX/ELAN support

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.

Implement the first step and remove M486/M486SX/ELAN support:

CONFIG_M486SX
CONFIG_M486
CONFIG_MELAN

[ There's no recent M486=y kernel package for any mainstream x86
32-bit distribution available that I've been able to find, so actual users should not be impacted, and any legacy users can keep using older kernels. ]

---
 arch/x86/Kconfig                | 10 +--------
 arch/x86/Kconfig.cpu            | 42 ++++++--------------------------
 arch/x86/Makefile_32.cpu        |  2 +--
 arch/x86/include/asm/vermagic.h |  6 +-----
 4 files changed, 9 insertions(+), 51 deletions(-)
arch/x86/Kconfig +0 -10
index e2df1b1..6627b6d 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.
@@ -2771,11 +2766,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 -33

99 lines not on this page · raw message

arch/x86/Makefile_32.cpu +0 -2
index a3dda95..7c9898c 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 5d47125..eda233a 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
merge bot Applied
#3 lore raw

[tip: x86/platform] x86/cpu: Remove M486/M486SX/ELAN support

In reply to Ingo Molnar
The following commit has been merged into the x86/platform branch of tip:

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     8b793a92d862c89055daa97ffa61a6929cf732f9
Gitweb:        https://git.kernel.org/tip/8b793a92d862c89055daa97ffa61a6929cf732f9
Author:        Ingo Molnar <[email protected]>
AuthorDate:    Sun, 14 Dec 2025 09:46:49 +01:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Mon, 30 Mar 2026 11:39:42 +02:00

x86/cpu: Remove M486/M486SX/ELAN support

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.

Implement the first step and remove M486/M486SX/ELAN support:

CONFIG_M486SX
CONFIG_M486
CONFIG_MELAN

[ There's no recent M486=y kernel package for any mainstream x86
32-bit distribution available that I've been able to find, so actual users should not be impacted, and any legacy users can keep using older kernels. ]

---
 arch/x86/Kconfig                | 10 +-------
 arch/x86/Kconfig.cpu            | 44 +++++++-------------------------
 arch/x86/Makefile_32.cpu        |  2 +-
 arch/x86/include/asm/vermagic.h |  6 +----
 4 files changed, 10 insertions(+), 52 deletions(-)
arch/x86/Kconfig +0 -10
index e2df1b1..6627b6d 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.
@@ -2771,11 +2766,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 +10 -34

101 lines not on this page · raw message

arch/x86/Makefile_32.cpu +0 -2
index a3dda95..7c9898c 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 5d47125..eda233a 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
#4 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 0239e5f82d93..c80bb16abeb4 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
@@ -270,7 +250,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
@@ -282,7 +262,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
@@ -290,7 +270,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
@@ -318,7 +298,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.51.0
#5 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 c80bb16abeb4..ac53e422f423 100644
@@ -399,20 +399,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.51.0
#6 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 ac53e422f423..052e06fec3b1 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
@@ -250,7 +242,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.51.0
#7 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 ed4485ee32ad..ecd4c77827e9 100644
@@ -681,17 +681,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 d3b9df7d466b..94769959fa1d 100644
@@ -1555,7 +1555,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.51.0
#8 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 052e06fec3b1..53242bce0d27 100644
@@ -248,10 +248,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 bcf1dedc1d00..5434cba078fb 100644
@@ -1473,13 +1473,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.51.0
#9 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   | 226 -------------------------------------------
 drivers/cpufreq/sc520_freq.c | 136 --------------------------
 5 files changed, 393 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 681d687b5a18..6012287723de 100644
@@ -40,8 +40,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 -226

226 lines not on this page · raw message

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

136 lines not on this page · raw message

Signature · 1 line
2.51.0
#10 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 ecd4c77827e9..60a03b61214a 100644
@@ -1622,33 +1622,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 733d5aff2456..888487e109bf 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 1d403a3612ea..be7d282bebc6 100644
@@ -280,7 +280,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 cd6f194a912b..90c63fe19c0f 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(bool, kernel_fpu_allowed);
 DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
arch/x86/kernel/fpu/core.c +0 -5
index da233f20ae6f..2996c1c8c71a 100644
@@ -532,11 +532,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 ff988b9ea39f..0d33c217b71c 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))
-		;
-	else
-#endif
-		asm volatile ("fninit");
+	asm volatile ("fninit");
 }
 
 /*
@@ -86,13 +81,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 5434cba078fb..d974b22e8b2a 100644
@@ -1541,20 +1541,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.51.0
#11 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 a8d0afde7f85..9da4c7bba5c5 100644
@@ -4340,10 +4340,6 @@ Kernel parameters
 			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 60a03b61214a..90ec7f2cda93 100644
@@ -2730,18 +2730,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 e7ab22fce3b5..0f2a869fb0e6 100644
@@ -1715,13 +1715,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.51.0
#12 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.51.0

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

#13 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 90ec7f2cda93..2e31ca35de1a 100644
@@ -669,7 +669,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 53242bce0d27..c855db6ff6a4 100644
@@ -262,7 +262,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 aa4040fd9215..dc38f950b1e2 100644
@@ -11,7 +11,7 @@ config XEN
 	select HIBERNATE_CALLBACKS
 	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.51.0
#14 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 4f7f09f50552..4d2d2f21ff06 100644
@@ -76,8 +76,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();
 }
@@ -94,25 +93,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 bc184dd38d99..19ebb67df142 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 7d3e13e14eab..5ad2c803d5a1 100644
@@ -297,24 +297,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.51.0
#15 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 2e31ca35de1a..7a28380a8d76 100644
@@ -134,7 +134,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 c855db6ff6a4..54545aa95286 100644
@@ -269,7 +269,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.
@@ -281,7 +280,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
 
 config X86_DEBUGCTLMSR
 	def_bool y
arch/x86/Kconfig.cpufeatures +0 -1
index 888487e109bf..1857f75a19d6 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.51.0
#16 lore raw

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

In reply to Ingo Molnar
Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc H . Peter Anvin <[email protected]>
Cc John Ogness <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 arch/x86/include/asm/asm-prototypes.h |   4 -
 arch/x86/include/asm/atomic64_32.h    |  17 +--
 arch/x86/include/asm/cmpxchg_32.h     |  87 +--------------
 arch/x86/lib/Makefile                 |   4 -
 arch/x86/lib/atomic64_386_32.S        | 195 ----------------------------------
 arch/x86/lib/cmpxchg8b_emu.S          |  97 -----------------
 arch/x86/um/Makefile                  |   1 -
 lib/atomic64_test.c                   |   7 +-
 8 files changed, 8 insertions(+), 404 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 +5 -82

93 lines not on this page · raw message

arch/x86/lib/Makefile +0 -4
index 2dba7f83ef97..210af275f468 100644
@@ -48,10 +48,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

arch/x86/um/Makefile +0 -1
index f9ea75bf43ac..2513aca5156a 100644
@@ -20,7 +20,6 @@ ifeq ($(CONFIG_X86_32),y)
 obj-y += syscalls_32.o
 
 subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
-subarch-y += ../lib/cmpxchg8b_emu.o ../lib/atomic64_386_32.o
 subarch-y += ../lib/checksum_32.o
 subarch-y += ../kernel/sys_ia32.o
 
lib/atomic64_test.c +2 -5
index d726068358c7..d7697c09041f 100644
@@ -251,15 +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",
-#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");
 #else
 	pr_info("passed\n");
Signature · 1 line
2.51.0
#17 lore raw

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

In reply to Ingo Molnar

From: Uros Bizjak <[email protected]>

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

Cc "Ahmed S . Darwish" <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H . Peter Anvin" <[email protected]>
Cc John Ogness <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/asm/percpu.h | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)
arch/x86/include/asm/percpu.h +10 -15
index 725d0eff7acd..4c84ae0ea261 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,14 +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) \
-		: ALT_OUTPUT_SP("=@ccz" (success),			\
-				[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])			\
+		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");						\
 	if (unlikely(!success))						\
 		*_oval = old__.var;					\
Signature · 1 line
2.51.0
#18 lore raw

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

Quoted 31 lines · Ingo Molnar

From: Uros Bizjak <[email protected]>

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

Cc "Ahmed S . Darwish" <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H . Peter Anvin" <[email protected]>
Cc John Ogness <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/asm/percpu.h | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)
arch/x86/include/asm/percpu.h +0 -0
index 725d0eff7acd..4c84ae0ea261 100644
@@ -335,13 +335,10 @@ do {                                                                      \
        old__.var = _oval;                                              \
        new__.var = _nval;                                              \

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

Quoted 10 lines
arch/x86/include/asm/percpu.h +2 -7
                                                                        \
-       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)),                            \

The above line should read:

              : [var] "+m" (__my_cpu_var(_var)),
Quoted 10 lines
arch/x86/include/asm/percpu.h +2 -1
+                 "+a" (old__.low), "+d" (old__.high)                   \
+               : "b" (new__.low), "c" (new__.high)                     \
                : "memory");                                            \
                                                                        \
        old__.var;                                                      \
@@ -364,14 +361,12 @@ do {                                                                      \
        old__.var = *_oval;                                             \
        new__.var = _nval;                                              \
                                                                        \
-       asm_inline qual (                                               \

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

Quoted 10 lines
arch/x86/include/asm/percpu.h +3 -7
-               ALTERNATIVE("call this_cpu_cmpxchg8b_emu",              \
-                           "cmpxchg8b " __percpu_arg([var]), X86_FEATURE_CX8) \
-               : ALT_OUTPUT_SP("=@ccz" (success),                      \
-                               [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])                      \
+               CC_SET(z)                                               \
+               : CC_OUT(z) (success),                                  \

CC_SET() and CC_OUT() macros have been removed in the meantime [1], so the last two lines should be changed to:

    : "=@ccz" (success),

[1] https://lore.kernel.org/lkml/[email protected]/

Uros.

#19 lore raw

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

Quoted 6 lines · Uros Bizjak

CC_SET() and CC_OUT() macros have been removed in the meantime [1], so the last two lines should be changed to:

    : "=@ccz" (success),

[1] https://lore.kernel.org/lkml/[email protected]/

Indeed, -v4 patch attached.

Thanks,

Ingo

=============>
From: Uros Bizjak <[email protected]>
Date: Sun, 14 Dec 2025 09:40:31 +0100
Subject: [PATCH] x86/percpu: Remove !CONFIG_X86_CX8 methods

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

Cc "Ahmed S . Darwish" <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H . Peter Anvin" <[email protected]>
Cc John Ogness <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[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 725d0eff7acd..ee98abae8427 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])			\
+		: [var] "+m" (__my_cpu_var(_var)),			\
+		  "+a" (old__.low), "+d" (old__.high)			\
+		: "b" (new__.low), "c" (new__.high)			\
 		: "memory");						\
 									\
 	old__.var;							\
@@ -364,14 +361,11 @@ 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("=@ccz" (success),			\
-				[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])			\
+		: "=@ccz" (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;					\
#20 lore raw
In reply to Ingo Molnar
Quoted 12 lines · On Sun, 14 Dec 2025 09:46:48 +0100 Ingo Molnar <[email protected]> wrote:

...

Original -v1 announcement:

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.

Two questions:

1) What happens if you try to boot the kernel on an old system? Is there an early check that makes it fail 'moderately gracefully'?

2) Is it worth also dropping support for cpu that don't support CMOV. I think that is 'Pentium Pro' and 'K7' rather than 'Pentium' and 'K5'. That simplifies some asm code.
'masked' user access would really need it (and a guard page). The 'long nop' get added at the same time.
It is also (almost certainly) new enough that the 'bit scan' instructions are guaranteed to leave the the destination unchanged if the source is zero (dropping just 486 may be enough for that).

Moving the minimum cpu to P-Pro now will probably save another similar change in the near future.

David

#21 lore raw
Quoted 37 lines · David Laight
Quoted 12 lines · On Sun, 14 Dec 2025 09:46:48 +0100 Ingo Molnar <[email protected]> wrote:

...

Original -v1 announcement:

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.

Two questions:

1) What happens if you try to boot the kernel on an old system? Is there an early check that makes it fail 'moderately gracefully'?

2) Is it worth also dropping support for cpu that don't support CMOV. I think that is 'Pentium Pro' and 'K7' rather than 'Pentium' and 'K5'. That simplifies some asm code.
'masked' user access would really need it (and a guard page). The 'long nop' get added at the same time.
It is also (almost certainly) new enough that the 'bit scan' instructions are guaranteed to leave the the destination unchanged if the source is zero (dropping just 486 may be enough for that).

Quoted 4 lines

Moving the minimum cpu to P-Pro now will probably save another similar change in the near future.

David

There is a check in the BIOS real-mode code to print an error message. If it gets invoked any other way (directly in protected mode) it will almost certainly crash.

Please consider the cost/benefit trade-off when it comes to dropping support; if the cost is small enough it doesn't matter much. Simplifying a small number of well-localized routines isn't a big enough deal, really.

In general, make sure that the appropriate X86_REQUIRED_FEATURE flags in Kconfig.cpufeature get set – that way the detect code and other checking code will work correctly.

#22 lore raw
In reply to Ingo Molnar
Quoted 108 lines · Ingo Molnar

Changes in -v3:

- Port to v6.19-rc1

Changes in -v2:

- Rebase to v6.15-rc6 + the relevant x86 tree branch

- Use proper asm() constraints in the simplified CX8 methods (Uros Bizjak)

- Remove stray family-4 default (suggested by Arnd Bergmann)

- Simplify CX8 test (suggested by Uros Bizjak)

- Add review tags

The latest version of this series can be found at:

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

Thanks,

Ingo

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

Original -v1 announcement:

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

Quoted 8 lines

Lightly tested.

Thanks,

Ingo

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

Does this also eliminate all processors that do not support CPUID?

Brian Gerst

#23 lore raw
Quoted 2 lines · Brian Gerst

Does this also eliminate all processors that do not support CPUID?

I do think it does, as it's also the only way to enumerate both TSC and CX8, afaik, so the whole "require CX8" effectively also requires cpuid.

So it probably means we can get rid of all the X86_EFLAGS_ID checks too.

Linus

#24 lore raw
In reply to Brian Gerst

Hi,

Quoted 3 lines · Brian Gerst

Does this also eliminate all processors that do not support CPUID?

If it does, then we can also remove X86_FEATURE_CPUID from word 3:

arch/x86/include/asm/cpufeatures.h +1 -1
@@ -94,3 +94,3 @@
 #define X86_FEATURE_NONSTOP_TSC	( 3*32+24) /* "nonstop_tsc" TSC does not stop in C states */
-#define X86_FEATURE_CPUID		( 3*32+25) /* "cpuid" CPU has CPUID instruction itself */
+/* Reserved				( 3*32+25) */
 #define X86_FEATURE_EXTD_APICID	( 3*32+26) /* "extd_apicid" Extended APICID (8 bits) */

plus its call sites.

Thanks,
Ahmed

maintainer
#25 lore raw

arch/x86/include/asm/cpufeatures.h line 95

Quoted 8 lines · Ahmed S. Darwish

If it does, then we can also remove X86_FEATURE_CPUID from word 3:

arch/x86/include/asm/cpufeatures.h +1 -1
@@ -94,3 +94,3 @@
 #define X86_FEATURE_NONSTOP_TSC	( 3*32+24) /* "nonstop_tsc" TSC does not stop in C states */
-#define X86_FEATURE_CPUID		( 3*32+25) /* "cpuid" CPU has CPUID instruction itself */
+/* Reserved				( 3*32+25) */

s/Reserved/Free/

so that it gets reused.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#26 lore raw
Quoted 12 lines · Borislav Petkov

arch/x86/include/asm/cpufeatures.h line 95

Quoted 8 lines · Ahmed S. Darwish

If it does, then we can also remove X86_FEATURE_CPUID from word 3:

arch/x86/include/asm/cpufeatures.h +1 -1
@@ -94,3 +94,3 @@
 #define X86_FEATURE_NONSTOP_TSC	( 3*32+24) /* "nonstop_tsc" TSC does not stop in C states */
-#define X86_FEATURE_CPUID		( 3*32+25) /* "cpuid" CPU has CPUID instruction itself */
+/* Reserved				( 3*32+25) */

s/Reserved/Free/

Quoted 2 lines

so that it gets reused.

Please DON'T do this.

I have been cleaning up the boot code and it turns out that having this flag available makes the error message generating code in the boot stub a lot nicer.

-hpa

#27 lore raw
In reply to Ingo Molnar
Quoted 8 lines · Ingo Molnar

Changes in -v3:

- Port to v6.19-rc1

Changes in -v2:

- Rebase to v6.15-rc6 + the relevant x86 tree branch

Quoted 7 lines

- Use proper asm() constraints in the simplified CX8 methods (Uros Bizjak)

- Remove stray family-4 default (suggested by Arnd Bergmann)

- Simplify CX8 test (suggested by Uros Bizjak)

- Add review tags

Looks all good to me, thanks for rebasing!

I did a few patches on top of v1 to simplify the configuration further when we discussed this earlier this year. I'll rebase and submit them once you merge yours.

Arnd

#28 lore raw
Quoted 5 lines · Arnd Bergmann

Looks all good to me, thanks for rebasing!

I did a few patches on top of v1 to simplify the configuration further when we discussed this earlier this year. I'll rebase and submit them once you merge yours.

FWIW I haven't lost this from my radar. Alas, there's been too much of
stuff of all kinds for me to make progress on the matters discussed such as emulation or even setting up a repo to keep it in to start with.

Happy New Year everyone!

Maciej