]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/cacheinfo: Remove the P4 trace leftovers for real
authorThomas Gleixner <tglx@linutronix.de>
Tue, 4 Mar 2025 08:51:22 +0000 (09:51 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Mar 2025 10:17:33 +0000 (11:17 +0100)
Commit 851026a2bf54 ("x86/cacheinfo: Remove unused trace variable") removed
the switch case for LVL_TRACE but did not get rid of the surrounding gunk.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250304085152.51092-12-darwi@linutronix.de
arch/x86/kernel/cpu/cacheinfo.c

index a6c6bccfa8b8d3d2762384e418efbd4ca0a69c9e..eccffe2ea06cf4e3eb1483a3ba1a93848b0b25c7 100644 (file)
@@ -31,7 +31,6 @@
 #define LVL_1_DATA     2
 #define LVL_2          3
 #define LVL_3          4
-#define LVL_TRACE      5
 
 /* Shared last level cache maps */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map);
@@ -96,10 +95,6 @@ static const struct _cache_table cache_table[] =
        { 0x66, LVL_1_DATA, 8 },        /* 4-way set assoc, sectored cache, 64 byte line size */
        { 0x67, LVL_1_DATA, 16 },       /* 4-way set assoc, sectored cache, 64 byte line size */
        { 0x68, LVL_1_DATA, 32 },       /* 4-way set assoc, sectored cache, 64 byte line size */
-       { 0x70, LVL_TRACE,  12 },       /* 8-way set assoc */
-       { 0x71, LVL_TRACE,  16 },       /* 8-way set assoc */
-       { 0x72, LVL_TRACE,  32 },       /* 8-way set assoc */
-       { 0x73, LVL_TRACE,  64 },       /* 8-way set assoc */
        { 0x78, LVL_2,      MB(1) },    /* 4-way set assoc, 64 byte line size */
        { 0x79, LVL_2,      128 },      /* 8-way set assoc, sectored cache, 64 byte line size */
        { 0x7a, LVL_2,      256 },      /* 8-way set assoc, sectored cache, 64 byte line size */
@@ -787,19 +782,13 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
                        }
                }
        }
-       /*
-        * Don't use cpuid2 if cpuid4 is supported. For P4, we use cpuid2 for
-        * trace cache
-        */
-       if ((!ci->num_leaves || c->x86 == 15) && c->cpuid_level > 1) {
+
+       /* Don't use CPUID(2) if CPUID(4) is supported. */
+       if (!ci->num_leaves && c->cpuid_level > 1) {
                /* supports eax=2  call */
                int j, n;
                unsigned int regs[4];
                unsigned char *dp = (unsigned char *)regs;
-               int only_trace = 0;
-
-               if (ci->num_leaves && c->x86 == 15)
-                       only_trace = 1;
 
                /* Number of times to iterate */
                n = cpuid_eax(2) & 0xFF;
@@ -820,8 +809,6 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
                                /* look up this descriptor in the table */
                                while (cache_table[k].descriptor != 0) {
                                        if (cache_table[k].descriptor == des) {
-                                               if (only_trace && cache_table[k].cache_type != LVL_TRACE)
-                                                       break;
                                                switch (cache_table[k].cache_type) {
                                                case LVL_1_INST:
                                                        l1i += cache_table[k].size;