]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 26 Nov 2025 12:51:47 +0000 (12:51 +0000)
committerIngo Molnar <mingo@kernel.org>
Sun, 14 Dec 2025 08:57:13 +0000 (09:57 +0100)
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.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Pu Wen <puwen@hygon.cn>
Link: https://patch.msgid.link/20251126125147.880275-1-andrew.cooper3@citrix.com
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/cpu/centaur.c
arch/x86/kernel/cpu/cyrix.c
arch/x86/kernel/cpu/hygon.c

index c04f53f43af1dc4d6bcbda2163e57f49d0480ec3..c792c2afd849989450e0b83735bdd85a3221c161 100644 (file)
@@ -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);
 
index a3b55db35c9612151b69b2ef559d93897cabf727..c8398940b97526773d3b344a5fd2e250bffbaf97 100644 (file)
@@ -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);
index dfec2c61e3547d83ae8b74f8d6e128cec5703e55..8f22085c4dd23aaaf093ec64f45b22eeb4be27cc 100644 (file)
@@ -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);
index 1fda6c3a2b65a7b5c90361376dafead61b084209..7f95a74e4c6576ae89dae2a59d461449d3b5f045 100644 (file)
@@ -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);
 
        /*