Skip to content

Commit fd9fc17

Browse files
committed
x86/cpufeatures: Free up unused feature bits
JIRA: https://issues.redhat.com/browse/RHEL-106912 commit 7a470e8 Author: Sohil Mehta <sohil.mehta@intel.com> Date: Thu Nov 7 23:30:00 2024 +0000 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 <sohil.mehta@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/all/20241107233000.2742619-1-sohil.mehta%40intel.com Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 253fc23 commit fd9fc17

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
@@ -85,8 +85,8 @@
8585
#define X86_FEATURE_CENTAUR_MCR ( 3*32+ 3) /* "centaur_mcr" Centaur MCRs (= MTRRs) */
8686
#define X86_FEATURE_K8 ( 3*32+ 4) /* Opteron, Athlon64 */
8787
#define X86_FEATURE_ZEN5 ( 3*32+ 5) /* CPU based on Zen5 microarchitecture */
88-
#define X86_FEATURE_P3 ( 3*32+ 6) /* P3 */
89-
#define X86_FEATURE_P4 ( 3*32+ 7) /* P4 */
88+
/* Free ( 3*32+ 6) */
89+
/* Free ( 3*32+ 7) */
9090
#define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* "constant_tsc" TSC ticks at a constant rate */
9191
#define X86_FEATURE_UP ( 3*32+ 9) /* "up" SMP kernel running on UP */
9292
#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
@@ -675,11 +675,6 @@ static void init_intel(struct cpuinfo_x86 *c)
675675
if (p)
676676
strcpy(c->x86_model_id, p);
677677
}
678-
679-
if (c->x86 == 15)
680-
set_cpu_cap(c, X86_FEATURE_P4);
681-
if (c->x86 == 6)
682-
set_cpu_cap(c, X86_FEATURE_P3);
683678
#endif
684679

685680
/* Work around errata */

0 commit comments

Comments
 (0)