Skip to contentSkip to conversation

x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix

PATCH Applied Andrew Cooper 2 participants 2 messages Nov 26, 2025 – Dec 15, 2025

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

PATCH 1/1 x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix

Besides formatting changes, this logic dates back to Linux 2.4.0-test11 in November 2000.

Prior to "Massive cleanup of CPU detection and bug handling", c->x86_capability was a single u32 containing cpuid(1).edx, cpuid(0x80000001).edx, or a synthesis thereof. X86_FEATURE_AMD3D was defined as the top bit this single u32.

After "Massive cleanup of CPU detection and bug handling", c->x86_capability became an array with AMD's extended feature leaf split away from Intel's basic feature leaf.

AMD doc #20734-G states that 3DNow is only enumerated in the extended feature leaf, and that other vendors where using this bit too. i.e. AMD never produced a CPU which set bit 31 in the basic leaf, meaning that there's nothing to clear out in the first place.

This logic looks like it was relevant in the pre-"Massive cleanup" world but ought to have been dropped when c->x86_capability was properly split.

---
CC: Thomas Gleixner <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Borislav Petkov <[email protected]>
CC: Dave Hansen <[email protected]>
CC: "H. Peter Anvin" <[email protected]>
CC: Pu Wen <[email protected]> (maintainer:HYGON PROCESSOR SUPPORT)
CC: "Peter Zijlstra (Intel)" <[email protected]>
CC: [email protected]
CC: [email protected]

I'm not sure how best to represent:

https://github.com/schwabe/davej-history/commit/67ad24e6d39c3bc4618e7eb0563ccde3d76d0a51#diff-ab4c065cef7ebcd6d255c47ed4c3c0a77da8ad3df004dab9a183cc88814730ff

in the commit message.

git://git.kernel.org/pub/scm/linux/kernel/git/davej/history.git doesn't appear to exist any more.

In principle this wants a fixes tag to 25 years ago, but I don't think it's important enough to warrant backporting.

---
 arch/x86/kernel/cpu/amd.c     | 6 ------
 arch/x86/kernel/cpu/centaur.c | 6 ------
 arch/x86/kernel/cpu/cyrix.c   | 6 ------
 arch/x86/kernel/cpu/hygon.c   | 6 ------
 4 files changed, 24 deletions(-)
arch/x86/kernel/cpu/amd.c +0 -6
index 505ff37b850c..73d634bc8e98 100644
@@ -1051,12 +1051,6 @@ static void init_amd(struct cpuinfo_x86 *c)
 
 	early_init_amd(c);
 
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
-
 	if (c->x86 >= 0x10)
 		set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 
arch/x86/kernel/cpu/centaur.c +0 -6
index a3b55db35c96..c8398940b975 100644
@@ -119,12 +119,6 @@ static void init_centaur(struct cpuinfo_x86 *c)
 	u32  fcr_clr = 0;
 	u32  lo, hi, newlo;
 	u32  aa, bb, cc, dd;
-
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
 #endif
 	early_init_centaur(c);
 	init_intel_cacheinfo(c);
arch/x86/kernel/cpu/cyrix.c +0 -6
index dfec2c61e354..8f22085c4dd2 100644
@@ -195,12 +195,6 @@ static void init_cyrix(struct cpuinfo_x86 *c)
 	char *buf = c->x86_model_id;
 	const char *p = NULL;
 
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
-
 	/* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
 	if (test_cpu_cap(c, 1*32+24)) {
 		clear_cpu_cap(c, 1*32+24);
arch/x86/kernel/cpu/hygon.c +0 -6
index 1fda6c3a2b65..7f95a74e4c65 100644
@@ -174,12 +174,6 @@ static void init_hygon(struct cpuinfo_x86 *c)
 
 	early_init_hygon(c);
 
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
-
 	set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 
 	/*

base-commit: ac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d

Signature · 1 line
2.39.5
merge bot Applied
#1 lore raw
The following commit has been merged into the x86/cpu branch of tip:

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

Commit-ID:     0bc03750deefc5fdab77b01c459bb1691c64c3c5
Gitweb:        https://git.kernel.org/tip/0bc03750deefc5fdab77b01c459bb1691c64c3c5
Author:        Andrew Cooper <[email protected]>
AuthorDate:    Wed, 26 Nov 2025 12:51:47 
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Sun, 14 Dec 2025 09:57:13 +01:00

x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix

Besides formatting changes, this logic dates back to Linux 2.4.0-test11 in November 2000.

Prior to "Massive cleanup of CPU detection and bug handling", c->x86_capability was a single u32 containing cpuid(1).edx, cpuid(0x80000001).edx, or a synthesis thereof. X86_FEATURE_AMD3D was defined as the top bit this single u32.

After "Massive cleanup of CPU detection and bug handling", c->x86_capability became an array with AMD's extended feature leaf split away from Intel's basic feature leaf.

AMD doc #20734-G states that 3DNow is only enumerated in the extended feature leaf, and that other vendors where using this bit too. i.e. AMD never produced a CPU which set bit 31 in the basic leaf, meaning that there's nothing to clear out in the first place.

This logic looks like it was relevant in the pre-"Massive cleanup" world but ought to have been dropped when c->x86_capability was properly split.

---
 arch/x86/kernel/cpu/amd.c     | 6 ------
 arch/x86/kernel/cpu/centaur.c | 6 ------
 arch/x86/kernel/cpu/cyrix.c   | 6 ------
 arch/x86/kernel/cpu/hygon.c   | 6 ------
 4 files changed, 24 deletions(-)
arch/x86/kernel/cpu/amd.c +0 -6
index c04f53f..c792c2a 100644
@@ -1051,12 +1051,6 @@ static void init_amd(struct cpuinfo_x86 *c)
 
 	early_init_amd(c);
 
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
-
 	if (c->x86 >= 0x10)
 		set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 
arch/x86/kernel/cpu/centaur.c +0 -6
index a3b55db..c839894 100644
@@ -119,12 +119,6 @@ static void init_centaur(struct cpuinfo_x86 *c)
 	u32  fcr_clr = 0;
 	u32  lo, hi, newlo;
 	u32  aa, bb, cc, dd;
-
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
 #endif
 	early_init_centaur(c);
 	init_intel_cacheinfo(c);
arch/x86/kernel/cpu/cyrix.c +0 -6
index dfec2c6..8f22085 100644
@@ -195,12 +195,6 @@ static void init_cyrix(struct cpuinfo_x86 *c)
 	char *buf = c->x86_model_id;
 	const char *p = NULL;
 
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
-
 	/* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
 	if (test_cpu_cap(c, 1*32+24)) {
 		clear_cpu_cap(c, 1*32+24);
arch/x86/kernel/cpu/hygon.c +0 -6
index 1fda6c3..7f95a74 100644
@@ -174,12 +174,6 @@ static void init_hygon(struct cpuinfo_x86 *c)
 
 	early_init_hygon(c);
 
-	/*
-	 * Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	 * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
-	 */
-	clear_cpu_cap(c, 0*32+31);
-
 	set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 
 	/*