Skip to contentSkip to conversation

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

PATCH In review Ingo Molnar 3 participants 20 messages May 15, 2025 – May 29, 2025

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

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

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.

Thanks,

Ingo

================>
Ingo Molnar (14):
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/atomics: Remove !CONFIG_X86_CX8 methods

Uros Bizjak (1):
x86/percpu: Remove !CONFIG_X86_CX8 methods

 Documentation/admin-guide/kernel-parameters.txt |    4 -
 arch/x86/Kconfig                                |   71 +-
 arch/x86/Kconfig.cpu                            |   96 +-
 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               |   88 +-
 arch/x86/include/asm/fpu/api.h                  |    6 -
 arch/x86/include/asm/percpu.h                   |   24 +-
 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                      |  226 ----
 drivers/cpufreq/sc520_freq.c                    |  136 --
 drivers/watchdog/Kconfig                        |    2 +-
 lib/atomic64_test.c                             |    7 +-
 80 files changed, 47 insertions(+), 14117 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            | 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 90570e3582cc..557322108b15 100644
@@ -447,11 +447,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.
@@ -2770,11 +2765,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.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)"

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 981097bd868a..97bffa97df41 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
@@ -294,7 +274,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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/Kconfig.cpu      | 14 --------------
 arch/x86/kernel/cpu/umc.c | 26 --------------------------
 2 files changed, 40 deletions(-)
arch/x86/Kconfig.cpu +0 -14
index 97bffa97df41..68788de88b1d 100644
@@ -375,20 +375,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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 68788de88b1d..abe4596ffa47 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
#5 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/Kconfig         | 11 -----------
 drivers/watchdog/Kconfig |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)
arch/x86/Kconfig +0 -11
index 557322108b15..1f29dc81018f 100644
@@ -674,17 +674,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
#6 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/Kconfig.cpu    | 4 ----
 arch/x86/kernel/traps.c | 7 -------
 2 files changed, 11 deletions(-)
arch/x86/Kconfig.cpu +0 -4
index abe4596ffa47..246a221c32e2 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 94c0236963c6..8d08c58b3fe2 100644
@@ -1346,13 +1346,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
#7 lore raw

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

In reply to Ingo Molnar
Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 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 -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.45.2
#8 lore raw

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

In reply to Ingo Molnar
Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 1f29dc81018f..e983705a4fe3 100644
@@ -1637,33 +1637,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 53daf4654f6c..84901c3acc94 100644
@@ -285,7 +285,6 @@ core-y  += arch/x86/boot/startup/
 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 8e6848f55dcd..87b794921070 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 948b4f5fad99..a39c0798c975 100644
@@ -520,11 +520,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 6bb3e35c40e2..20017fbfc16c 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");
 }
 
 /*
@@ -83,13 +78,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 8d08c58b3fe2..6b2ffb86c46d 100644
@@ -1414,20 +1414,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
#9 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc H . Peter Anvin <[email protected]>
Cc John Ogness <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 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 8f75ec177399..e380fff281a9 100644
@@ -4067,10 +4067,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 e983705a4fe3..be5f9be532a9 100644
@@ -2739,18 +2739,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 114aaaf6ae8a..a996915f763f 100644
@@ -1655,13 +1655,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
#10 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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.

#11 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 be5f9be532a9..3747efea6a31 100644
@@ -662,7 +662,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 246a221c32e2..5f0e29d154a8 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
#12 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 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 5d3a764ba77c..4a7c8b969346 100644
@@ -296,24 +296,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
#13 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.

Cc Ahmed S . Darwish <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Ard Biesheuvel <[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/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 3747efea6a31..a715f877e199 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 5f0e29d154a8..b3772d384fa0 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
 
 config X86_DEBUGCTLMSR
 	def_bool y
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
#14 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     |  88 +--------------
 arch/x86/lib/Makefile                 |   4 -
 arch/x86/lib/atomic64_386_32.S        | 195 ----------------------------------
 arch/x86/lib/cmpxchg8b_emu.S          |  97 -----------------
 lib/atomic64_test.c                   |   7 +-
 7 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 -83

94 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 +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.45.2
#16 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 | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)
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;					\
Signature · 1 line
2.45.2
#15 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]>

---
-v2: Fix UML build failure

 arch/x86/include/asm/asm-prototypes.h |   4 -
 arch/x86/include/asm/atomic64_32.h    |  17 +--
 arch/x86/include/asm/cmpxchg_32.h     |  88 +--------------
 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(+), 405 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 -83

94 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

arch/x86/um/Makefile +0 -1
index b42c31cd2390..b5f2961faef5 100644
@@ -21,7 +21,6 @@ obj-y += syscalls_32.o
 obj-$(CONFIG_ELF_CORE) += elfcore.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");
Acked-by on the v1 series
#18 lore raw
In reply to Ingo Molnar
Quoted 1 line · Ingo Molnar
 80 files changed, 47 insertions(+), 14117 deletions(-)

Thanks for doing this, Ingo. A lot of this code was sitting off on the side and not causing _too_ many problems. But that was (I think) mostly because it was being so lightly used.

I've been using Linux since the late 90's. The oldest systems I ever ran it on were i586's and they were old at the time.

I suspect this is going to throw a couple more compile issues at us to fix, that's par for the course on something like this. Ideally, we'd wait for v6.16-rc1 for applying something of this magnitude. What were your plans on when to apply it?

In any case:

#19 lore raw
Quoted 7 lines · Dave Hansen
Quoted 1 line · Ingo Molnar
 80 files changed, 47 insertions(+), 14117 deletions(-)

Thanks for doing this, Ingo. A lot of this code was sitting off on the side and not causing _too_ many problems. But that was (I think) mostly because it was being so lightly used.

Quoted 7 lines

I've been using Linux since the late 90's. The oldest systems I ever ran it on were i586's and they were old at the time.

I suspect this is going to throw a couple more compile issues at us to fix, that's par for the course on something like this. Ideally, we'd wait for v6.16-rc1 for applying something of this magnitude. What were your plans on when to apply it?

Yeah, so the good news is that the bots have been build-testing this series for a few weeks, and besides an UML build issue that I fixed there were very few problems. (knock on wood)

And since Linus asked for this and semi-acked it, I might try sending this in this merge window, if it's quiet enough from the x86 tree perspective. The diffstat is large, but as you too alluded to, it's 99.9% obsolete code that got very little testing in practice, so I don't think there's an elevated risk of regressions. But let's see how the v6.16 merge window goes?

Quoted 3 lines

In any case:

Thanks!

Ingo

#17 lore raw

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

In reply to Ingo Molnar
Quoted 30 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 | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)
arch/x86/include/asm/percpu.h +0 -0
index b0d03b6c279b..64c2e715af63 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)),                            \

Just noticed that the above line is missing a symbolic name for the operand. This line should read:

               : [var] "+m" (__my_cpu_var(_var)),                            \

Uros.

Quoted 29 lines
arch/x86/include/asm/percpu.h +7 -9
+                 "+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;                                     \
--

2.45.2