hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/cpufeatures.h
....@@ -13,8 +13,8 @@
1313 /*
1414 * Defines x86 CPU feature bits
1515 */
16
-#define NCAPINTS 19 /* N 32-bit words worth of info */
17
-#define NBUGINTS 1 /* N 32-bit bug flags */
16
+#define NCAPINTS 21 /* N 32-bit words worth of info */
17
+#define NBUGINTS 2 /* N 32-bit bug flags */
1818
1919 /*
2020 * Note: If the comment begins with a quoted string, that string is used
....@@ -96,7 +96,7 @@
9696 #define X86_FEATURE_SYSCALL32 ( 3*32+14) /* "" syscall in IA32 userspace */
9797 #define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in IA32 userspace */
9898 #define X86_FEATURE_REP_GOOD ( 3*32+16) /* REP microcode works well */
99
-#define X86_FEATURE_MFENCE_RDTSC ( 3*32+17) /* "" MFENCE synchronizes RDTSC */
99
+/* FREE! ( 3*32+17) */
100100 #define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" LFENCE synchronizes RDTSC */
101101 #define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */
102102 #define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */
....@@ -108,6 +108,7 @@
108108 #define X86_FEATURE_EXTD_APICID ( 3*32+26) /* Extended APICID (8 bits) */
109109 #define X86_FEATURE_AMD_DCM ( 3*32+27) /* AMD multi-node processor */
110110 #define X86_FEATURE_APERFMPERF ( 3*32+28) /* P-State hardware coordination feedback capability (APERF/MPERF MSRs) */
111
+/* free ( 3*32+29) */
111112 #define X86_FEATURE_NONSTOP_TSC_S3 ( 3*32+30) /* TSC doesn't stop in S3 state */
112113 #define X86_FEATURE_TSC_KNOWN_FREQ ( 3*32+31) /* TSC has known frequency */
113114
....@@ -200,17 +201,17 @@
200201 #define X86_FEATURE_INVPCID_SINGLE ( 7*32+ 7) /* Effectively INVPCID && CR4.PCIDE=1 */
201202 #define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
202203 #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
203
-#define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */
204
+/* FREE! ( 7*32+10) */
204205 #define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */
205
-#define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
206
-#define X86_FEATURE_RETPOLINE_AMD ( 7*32+13) /* "" AMD Retpoline mitigation for Spectre variant 2 */
206
+#define X86_FEATURE_KERNEL_IBRS ( 7*32+12) /* "" Set/clear IBRS on kernel entry/exit */
207
+#define X86_FEATURE_RSB_VMEXIT ( 7*32+13) /* "" Fill RSB on VM-Exit */
207208 #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */
208209 #define X86_FEATURE_CDP_L2 ( 7*32+15) /* Code and Data Prioritization L2 */
209210 #define X86_FEATURE_MSR_SPEC_CTRL ( 7*32+16) /* "" MSR SPEC_CTRL is implemented */
210211 #define X86_FEATURE_SSBD ( 7*32+17) /* Speculative Store Bypass Disable */
211212 #define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */
212213 #define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* "" Fill RSB on context switches */
213
-#define X86_FEATURE_SEV ( 7*32+20) /* AMD Secure Encrypted Virtualization */
214
+/* FREE! ( 7*32+20) */
214215 #define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
215216 #define X86_FEATURE_USE_IBRS_FW ( 7*32+22) /* "" Use IBRS during runtime firmware calls */
216217 #define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE ( 7*32+23) /* "" Disable Speculative Store Bypass. */
....@@ -218,9 +219,10 @@
218219 #define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */
219220 #define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */
220221 #define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */
221
-#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
222
+#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 or above (Zen) */
222223 #define X86_FEATURE_L1TF_PTEINV ( 7*32+29) /* "" L1TF workaround PTE inversion */
223224 #define X86_FEATURE_IBRS_ENHANCED ( 7*32+30) /* Enhanced IBRS */
225
+#define X86_FEATURE_MSR_IA32_FEAT_CTL ( 7*32+31) /* "" MSR IA32_FEAT_CTL configured */
224226
225227 /* Virtualization flags: Linux defined, word 8 */
226228 #define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */
....@@ -232,6 +234,8 @@
232234 #define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer VMMCALL to VMCALL */
233235 #define X86_FEATURE_XENPV ( 8*32+16) /* "" Xen paravirtual guest */
234236 #define X86_FEATURE_EPT_AD ( 8*32+17) /* Intel Extended Page Table access-dirty bit */
237
+#define X86_FEATURE_VMCALL ( 8*32+18) /* "" Hypervisor supports the VMCALL instruction */
238
+#define X86_FEATURE_VMW_VMMCALL ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */
235239
236240 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
237241 #define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
....@@ -283,18 +287,42 @@
283287 #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */
284288 #define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */
285289 #define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */
290
+#define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */
291
+#define X86_FEATURE_PER_THREAD_MBA (11*32+ 7) /* "" Per-thread Memory Bandwidth Allocation */
292
+/* FREE! (11*32+ 8) */
293
+/* FREE! (11*32+ 9) */
294
+#define X86_FEATURE_ENTRY_IBPB (11*32+10) /* "" Issue an IBPB on kernel entry */
295
+#define X86_FEATURE_RRSBA_CTRL (11*32+11) /* "" RET prediction control */
296
+#define X86_FEATURE_RETPOLINE (11*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
297
+#define X86_FEATURE_RETPOLINE_LFENCE (11*32+13) /* "" Use LFENCE for Spectre variant 2 */
298
+#define X86_FEATURE_RETHUNK (11*32+14) /* "" Use REturn THUNK */
299
+#define X86_FEATURE_UNRET (11*32+15) /* "" AMD BTB untrain return */
300
+#define X86_FEATURE_USE_IBPB_FW (11*32+16) /* "" Use IBPB during runtime firmware calls */
301
+#define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17) /* "" Fill RSB on VM exit when EIBRS is enabled */
302
+#define X86_FEATURE_MSR_TSX_CTRL (11*32+18) /* "" MSR IA32_TSX_CTRL (Intel) implemented */
303
+
304
+#define X86_FEATURE_SRSO (11*32+24) /* "" AMD BTB untrain RETs */
305
+#define X86_FEATURE_SRSO_ALIAS (11*32+25) /* "" AMD BTB untrain RETs through aliasing */
306
+#define X86_FEATURE_IBPB_ON_VMEXIT (11*32+26) /* "" Issue an IBPB only on VMEXIT */
307
+
308
+/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
309
+#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
286310
287311 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
288312 #define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */
289313 #define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */
290314 #define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */
315
+#define X86_FEATURE_RDPRU (13*32+ 4) /* Read processor register at user level */
316
+#define X86_FEATURE_WBNOINVD (13*32+ 9) /* WBNOINVD instruction */
291317 #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */
292318 #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
293319 #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */
294320 #define X86_FEATURE_AMD_STIBP_ALWAYS_ON (13*32+17) /* "" Single Thread Indirect Branch Predictors always-on preferred */
321
+#define X86_FEATURE_AMD_PPIN (13*32+23) /* Protected Processor Inventory Number */
295322 #define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */
296323 #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
297324 #define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
325
+#define X86_FEATURE_BTC_NO (13*32+29) /* "" Not vulnerable to Branch Type Confusion */
298326
299327 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
300328 #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */
....@@ -328,6 +356,7 @@
328356 #define X86_FEATURE_UMIP (16*32+ 2) /* User Mode Instruction Protection */
329357 #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */
330358 #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */
359
+#define X86_FEATURE_WAITPKG (16*32+ 5) /* UMONITOR/UMWAIT/TPAUSE Instructions */
331360 #define X86_FEATURE_AVX512_VBMI2 (16*32+ 6) /* Additional AVX512 Vector Bit Manipulation Instructions */
332361 #define X86_FEATURE_GFNI (16*32+ 8) /* Galois Field New Instructions */
333362 #define X86_FEATURE_VAES (16*32+ 9) /* Vector AES */
....@@ -339,6 +368,9 @@
339368 #define X86_FEATURE_LA57 (16*32+16) /* 5-level page tables */
340369 #define X86_FEATURE_RDPID (16*32+22) /* RDPID instruction */
341370 #define X86_FEATURE_CLDEMOTE (16*32+25) /* CLDEMOTE instruction */
371
+#define X86_FEATURE_MOVDIRI (16*32+27) /* MOVDIRI instruction */
372
+#define X86_FEATURE_MOVDIR64B (16*32+28) /* MOVDIR64B instruction */
373
+#define X86_FEATURE_ENQCMD (16*32+29) /* ENQCMD and ENQCMDS instructions */
342374
343375 /* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */
344376 #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery support */
....@@ -348,15 +380,32 @@
348380 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
349381 #define X86_FEATURE_AVX512_4VNNIW (18*32+ 2) /* AVX-512 Neural Network Instructions */
350382 #define X86_FEATURE_AVX512_4FMAPS (18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
383
+#define X86_FEATURE_FSRM (18*32+ 4) /* Fast Short Rep Mov */
384
+#define X86_FEATURE_AVX512_VP2INTERSECT (18*32+ 8) /* AVX-512 Intersect for D/Q */
351385 #define X86_FEATURE_SRBDS_CTRL (18*32+ 9) /* "" SRBDS mitigation MSR available */
352
-#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
353386 #define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */
387
+#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
388
+#define X86_FEATURE_SERIALIZE (18*32+14) /* SERIALIZE instruction */
389
+#define X86_FEATURE_TSXLDTRK (18*32+16) /* TSX Suspend Load Address Tracking */
354390 #define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */
391
+#define X86_FEATURE_ARCH_LBR (18*32+19) /* Intel ARCH LBR */
355392 #define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */
356393 #define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */
357394 #define X86_FEATURE_FLUSH_L1D (18*32+28) /* Flush L1D cache */
358395 #define X86_FEATURE_ARCH_CAPABILITIES (18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */
396
+#define X86_FEATURE_CORE_CAPABILITIES (18*32+30) /* "" IA32_CORE_CAPABILITIES MSR */
359397 #define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* "" Speculative Store Bypass Disable */
398
+
399
+/* AMD-defined memory encryption features, CPUID level 0x8000001f (EAX), word 19 */
400
+#define X86_FEATURE_SME (19*32+ 0) /* AMD Secure Memory Encryption */
401
+#define X86_FEATURE_SEV (19*32+ 1) /* AMD Secure Encrypted Virtualization */
402
+#define X86_FEATURE_VM_PAGE_FLUSH (19*32+ 2) /* "" VM Page Flush MSR is supported */
403
+#define X86_FEATURE_SEV_ES (19*32+ 3) /* AMD Secure Encrypted Virtualization - Encrypted State */
404
+#define X86_FEATURE_SME_COHERENT (19*32+10) /* "" AMD hardware-enforced cache coherency */
405
+
406
+#define X86_FEATURE_SBPB (20*32+27) /* "" Selective Branch Prediction Barrier */
407
+#define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* "" MSR_PRED_CMD[IBPB] flushes all branch type predictions */
408
+#define X86_FEATURE_SRSO_NO (20*32+29) /* "" CPU is not affected by SRSO */
360409
361410 /*
362411 * BUG word(s)
....@@ -394,5 +443,13 @@
394443 #define X86_BUG_TAA X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
395444 #define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
396445 #define X86_BUG_SRBDS X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
446
+#define X86_BUG_MMIO_STALE_DATA X86_BUG(25) /* CPU is affected by Processor MMIO Stale Data vulnerabilities */
447
+#define X86_BUG_MMIO_UNKNOWN X86_BUG(26) /* CPU is too old and its MMIO Stale Data status is unknown */
448
+#define X86_BUG_RETBLEED X86_BUG(27) /* CPU is affected by RETBleed */
449
+#define X86_BUG_EIBRS_PBRSB X86_BUG(28) /* EIBRS is vulnerable to Post Barrier RSB Predictions */
450
+#define X86_BUG_GDS X86_BUG(29) /* CPU is affected by Gather Data Sampling */
397451
452
+/* BUG word 2 */
453
+#define X86_BUG_SRSO X86_BUG(1*32 + 0) /* AMD SRSO bug */
454
+#define X86_BUG_DIV0 X86_BUG(1*32 + 1) /* AMD DIV0 speculation bug */
398455 #endif /* _ASM_X86_CPUFEATURES_H */