Skip to content

Commit 7a470e8

Browse files
sohilmehIngo Molnar
authored andcommitted
x86/cpufeatures: Free up unused feature bits
Linux defined feature bits X86_FEATURE_P3 and X86_FEATURE_P4 are not used anywhere. Commit f31d731 ("x86: use X86_FEATURE_NOPL in alternatives") got rid of the last usage in 2008. Remove the related mappings and code. Just like all X86_FEATURE bits, the raw bit numbers can be exposed to userspace via MODULE_DEVICE_TABLE(). There is a very small theoretical chance of userspace getting confused if these bits got reassigned and changed logical meaning. But these bits were never used for a device table, so it's highly unlikely this will ever happen in practice. [ dhansen: clarify userspace visibility of these bits ] Signed-off-by: Sohil Mehta <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/all/20241107233000.2742619-1-sohil.mehta%40intel.com
1 parent b8f5221 commit 7a470e8

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
#define X86_FEATURE_CENTAUR_MCR ( 3*32+ 3) /* "centaur_mcr" Centaur MCRs (= MTRRs) */
8484
#define X86_FEATURE_K8 ( 3*32+ 4) /* Opteron, Athlon64 */
8585
#define X86_FEATURE_ZEN5 ( 3*32+ 5) /* CPU based on Zen5 microarchitecture */
86-
#define X86_FEATURE_P3 ( 3*32+ 6) /* P3 */
87-
#define X86_FEATURE_P4 ( 3*32+ 7) /* P4 */
86+
/* Free ( 3*32+ 6) */
87+
/* Free ( 3*32+ 7) */
8888
#define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* "constant_tsc" TSC ticks at a constant rate */
8989
#define X86_FEATURE_UP ( 3*32+ 9) /* "up" SMP kernel running on UP */
9090
#define X86_FEATURE_ART ( 3*32+10) /* "art" Always running timer (ART) */

arch/x86/kernel/cpu/intel.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,11 +597,6 @@ static void init_intel(struct cpuinfo_x86 *c)
597597
if (p)
598598
strcpy(c->x86_model_id, p);
599599
}
600-
601-
if (c->x86 == 15)
602-
set_cpu_cap(c, X86_FEATURE_P4);
603-
if (c->x86 == 6)
604-
set_cpu_cap(c, X86_FEATURE_P3);
605600
#endif
606601

607602
/* Work around errata */

0 commit comments

Comments
 (0)