Skip to content

Commit 58e1b92

Browse files
committed
tools/include: Sync x86 CPU feature headers with the kernel sources
To pick up the changes from: 598c2fa ("perf/x86/amd/lbr: Use freeze based on availability") 7f274e6 ("x86/cpufeatures: Add new word for scattered features") This should address these tools/perf build warnings: Warning: Kernel ABI header differences: diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h diff -u tools/arch/x86/include/asm/required-features.h arch/x86/include/asm/required-features.h diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h 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: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b7ce17f commit 58e1b92

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

tools/arch/x86/include/asm/cpufeatures.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/*
1414
* Defines x86 CPU feature bits
1515
*/
16-
#define NCAPINTS 21 /* N 32-bit words worth of info */
16+
#define NCAPINTS 22 /* N 32-bit words worth of info */
1717
#define NBUGINTS 2 /* N 32-bit bug flags */
1818

1919
/*
@@ -81,10 +81,8 @@
8181
#define X86_FEATURE_K6_MTRR ( 3*32+ 1) /* AMD K6 nonstandard MTRRs */
8282
#define X86_FEATURE_CYRIX_ARR ( 3*32+ 2) /* Cyrix ARRs (= MTRRs) */
8383
#define X86_FEATURE_CENTAUR_MCR ( 3*32+ 3) /* Centaur MCRs (= MTRRs) */
84-
85-
/* CPU types for specific tunings: */
8684
#define X86_FEATURE_K8 ( 3*32+ 4) /* "" Opteron, Athlon64 */
87-
/* FREE, was #define X86_FEATURE_K7 ( 3*32+ 5) "" Athlon */
85+
#define X86_FEATURE_ZEN5 ( 3*32+ 5) /* "" CPU based on Zen5 microarchitecture */
8886
#define X86_FEATURE_P3 ( 3*32+ 6) /* "" P3 */
8987
#define X86_FEATURE_P4 ( 3*32+ 7) /* "" P4 */
9088
#define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* TSC ticks at a constant rate */
@@ -97,7 +95,7 @@
9795
#define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in IA32 userspace */
9896
#define X86_FEATURE_REP_GOOD ( 3*32+16) /* REP microcode works well */
9997
#define X86_FEATURE_AMD_LBR_V2 ( 3*32+17) /* AMD Last Branch Record Extension Version 2 */
100-
/* FREE, was #define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) "" LFENCE synchronizes RDTSC */
98+
#define X86_FEATURE_CLEAR_CPU_BUF ( 3*32+18) /* "" Clear CPU buffers using VERW */
10199
#define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */
102100
#define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */
103101
#define X86_FEATURE_ALWAYS ( 3*32+21) /* "" Always-present feature */
@@ -461,6 +459,14 @@
461459
#define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* "" MSR_PRED_CMD[IBPB] flushes all branch type predictions */
462460
#define X86_FEATURE_SRSO_NO (20*32+29) /* "" CPU is not affected by SRSO */
463461

462+
/*
463+
* Extended auxiliary flags: Linux defined - for features scattered in various
464+
* CPUID levels like 0x80000022, etc.
465+
*
466+
* Reuse free bits when adding new feature flags!
467+
*/
468+
#define X86_FEATURE_AMD_LBR_PMC_FREEZE (21*32+ 0) /* AMD LBR and PMC Freeze */
469+
464470
/*
465471
* BUG word(s)
466472
*/
@@ -508,4 +514,5 @@
508514
/* BUG word 2 */
509515
#define X86_BUG_SRSO X86_BUG(1*32 + 0) /* AMD SRSO bug */
510516
#define X86_BUG_DIV0 X86_BUG(1*32 + 1) /* AMD DIV0 speculation bug */
517+
#define X86_BUG_RFDS X86_BUG(1*32 + 2) /* CPU is vulnerable to Register File Data Sampling */
511518
#endif /* _ASM_X86_CPUFEATURES_H */

tools/arch/x86/include/asm/disabled-features.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@
123123
# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31))
124124
#endif
125125

126+
#ifdef CONFIG_KVM_AMD_SEV
127+
#define DISABLE_SEV_SNP 0
128+
#else
129+
#define DISABLE_SEV_SNP (1 << (X86_FEATURE_SEV_SNP & 31))
130+
#endif
131+
126132
/*
127133
* Make sure to add features to the correct mask
128134
*/
@@ -147,8 +153,9 @@
147153
DISABLE_ENQCMD)
148154
#define DISABLED_MASK17 0
149155
#define DISABLED_MASK18 (DISABLE_IBT)
150-
#define DISABLED_MASK19 0
156+
#define DISABLED_MASK19 (DISABLE_SEV_SNP)
151157
#define DISABLED_MASK20 0
152-
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21)
158+
#define DISABLED_MASK21 0
159+
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)
153160

154161
#endif /* _ASM_X86_DISABLED_FEATURES_H */

tools/arch/x86/include/asm/required-features.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
#define REQUIRED_MASK18 0
100100
#define REQUIRED_MASK19 0
101101
#define REQUIRED_MASK20 0
102-
#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21)
102+
#define REQUIRED_MASK21 0
103+
#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)
103104

104105
#endif /* _ASM_X86_REQUIRED_FEATURES_H */

0 commit comments

Comments
 (0)