forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/x86/include/asm/cpufeatures.h
....@@ -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
+#define X86_FEATURE_SME_COHERENT ( 3*32+17) /* "" AMD hardware-enforced cache coherency */
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
....@@ -202,8 +203,8 @@
202203 #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
203204 #define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */
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 */
....@@ -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,9 @@
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 */
239
+#define X86_FEATURE_SEV_ES ( 8*32+20) /* AMD Secure Encrypted Virtualization - Encrypted State */
235240
236241 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
237242 #define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
....@@ -283,18 +288,38 @@
283288 #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */
284289 #define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */
285290 #define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */
291
+#define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */
292
+#define X86_FEATURE_PER_THREAD_MBA (11*32+ 7) /* "" Per-thread Memory Bandwidth Allocation */
293
+/* FREE! (11*32+ 8) */
294
+/* FREE! (11*32+ 9) */
295
+#define X86_FEATURE_ENTRY_IBPB (11*32+10) /* "" Issue an IBPB on kernel entry */
296
+#define X86_FEATURE_RRSBA_CTRL (11*32+11) /* "" RET prediction control */
297
+#define X86_FEATURE_RETPOLINE (11*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
298
+#define X86_FEATURE_RETPOLINE_LFENCE (11*32+13) /* "" Use LFENCE for Spectre variant 2 */
299
+#define X86_FEATURE_RETHUNK (11*32+14) /* "" Use REturn THUNK */
300
+#define X86_FEATURE_UNRET (11*32+15) /* "" AMD BTB untrain return */
301
+#define X86_FEATURE_USE_IBPB_FW (11*32+16) /* "" Use IBPB during runtime firmware calls */
302
+#define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17) /* "" Fill RSB on VM exit when EIBRS is enabled */
303
+#define X86_FEATURE_MSR_TSX_CTRL (11*32+18) /* "" MSR IA32_TSX_CTRL (Intel) implemented */
304
+
305
+/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
306
+#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
286307
287308 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
288309 #define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */
289310 #define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */
290311 #define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */
312
+#define X86_FEATURE_RDPRU (13*32+ 4) /* Read processor register at user level */
313
+#define X86_FEATURE_WBNOINVD (13*32+ 9) /* WBNOINVD instruction */
291314 #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */
292315 #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
293316 #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */
294317 #define X86_FEATURE_AMD_STIBP_ALWAYS_ON (13*32+17) /* "" Single Thread Indirect Branch Predictors always-on preferred */
318
+#define X86_FEATURE_AMD_PPIN (13*32+23) /* Protected Processor Inventory Number */
295319 #define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */
296320 #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
297321 #define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
322
+#define X86_FEATURE_BTC_NO (13*32+29) /* "" Not vulnerable to Branch Type Confusion */
298323
299324 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
300325 #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */
....@@ -328,6 +353,7 @@
328353 #define X86_FEATURE_UMIP (16*32+ 2) /* User Mode Instruction Protection */
329354 #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */
330355 #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */
356
+#define X86_FEATURE_WAITPKG (16*32+ 5) /* UMONITOR/UMWAIT/TPAUSE Instructions */
331357 #define X86_FEATURE_AVX512_VBMI2 (16*32+ 6) /* Additional AVX512 Vector Bit Manipulation Instructions */
332358 #define X86_FEATURE_GFNI (16*32+ 8) /* Galois Field New Instructions */
333359 #define X86_FEATURE_VAES (16*32+ 9) /* Vector AES */
....@@ -339,6 +365,9 @@
339365 #define X86_FEATURE_LA57 (16*32+16) /* 5-level page tables */
340366 #define X86_FEATURE_RDPID (16*32+22) /* RDPID instruction */
341367 #define X86_FEATURE_CLDEMOTE (16*32+25) /* CLDEMOTE instruction */
368
+#define X86_FEATURE_MOVDIRI (16*32+27) /* MOVDIRI instruction */
369
+#define X86_FEATURE_MOVDIR64B (16*32+28) /* MOVDIR64B instruction */
370
+#define X86_FEATURE_ENQCMD (16*32+29) /* ENQCMD and ENQCMDS instructions */
342371
343372 /* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */
344373 #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery support */
....@@ -348,14 +377,20 @@
348377 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
349378 #define X86_FEATURE_AVX512_4VNNIW (18*32+ 2) /* AVX-512 Neural Network Instructions */
350379 #define X86_FEATURE_AVX512_4FMAPS (18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
380
+#define X86_FEATURE_FSRM (18*32+ 4) /* Fast Short Rep Mov */
381
+#define X86_FEATURE_AVX512_VP2INTERSECT (18*32+ 8) /* AVX-512 Intersect for D/Q */
351382 #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 */
353383 #define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */
384
+#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
385
+#define X86_FEATURE_SERIALIZE (18*32+14) /* SERIALIZE instruction */
386
+#define X86_FEATURE_TSXLDTRK (18*32+16) /* TSX Suspend Load Address Tracking */
354387 #define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */
388
+#define X86_FEATURE_ARCH_LBR (18*32+19) /* Intel ARCH LBR */
355389 #define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */
356390 #define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */
357391 #define X86_FEATURE_FLUSH_L1D (18*32+28) /* Flush L1D cache */
358392 #define X86_FEATURE_ARCH_CAPABILITIES (18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */
393
+#define X86_FEATURE_CORE_CAPABILITIES (18*32+30) /* "" IA32_CORE_CAPABILITIES MSR */
359394 #define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* "" Speculative Store Bypass Disable */
360395
361396 /*
....@@ -394,5 +429,9 @@
394429 #define X86_BUG_TAA X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
395430 #define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
396431 #define X86_BUG_SRBDS X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
432
+#define X86_BUG_MMIO_STALE_DATA X86_BUG(25) /* CPU is affected by Processor MMIO Stale Data vulnerabilities */
433
+#define X86_BUG_MMIO_UNKNOWN X86_BUG(26) /* CPU is too old and its MMIO Stale Data status is unknown */
434
+#define X86_BUG_RETBLEED X86_BUG(27) /* CPU is affected by RETBleed */
435
+#define X86_BUG_EIBRS_PBRSB X86_BUG(28) /* EIBRS is vulnerable to Post Barrier RSB Predictions */
397436
398437 #endif /* _ASM_X86_CPUFEATURES_H */