hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/msr-index.h
....@@ -54,8 +54,13 @@
5454 #define SPEC_CTRL_RRSBA_DIS_S_SHIFT 6 /* Disable RRSBA behavior */
5555 #define SPEC_CTRL_RRSBA_DIS_S BIT(SPEC_CTRL_RRSBA_DIS_S_SHIFT)
5656
57
+/* A mask for bits which the kernel toggles when controlling mitigations */
58
+#define SPEC_CTRL_MITIGATIONS_MASK (SPEC_CTRL_IBRS | SPEC_CTRL_STIBP | SPEC_CTRL_SSBD \
59
+ | SPEC_CTRL_RRSBA_DIS_S)
60
+
5761 #define MSR_IA32_PRED_CMD 0x00000049 /* Prediction Command */
5862 #define PRED_CMD_IBPB BIT(0) /* Indirect Branch Prediction Barrier */
63
+#define PRED_CMD_SBPB BIT(7) /* Selective Branch Prediction Barrier */
5964
6065 #define MSR_PPIN_CTL 0x0000004e
6166 #define MSR_PPIN 0x0000004f
....@@ -152,6 +157,15 @@
152157 * Not susceptible to Post-Barrier
153158 * Return Stack Buffer Predictions.
154159 */
160
+#define ARCH_CAP_GDS_CTRL BIT(25) /*
161
+ * CPU is vulnerable to Gather
162
+ * Data Sampling (GDS) and
163
+ * has controls for mitigation.
164
+ */
165
+#define ARCH_CAP_GDS_NO BIT(26) /*
166
+ * CPU is not vulnerable to Gather
167
+ * Data Sampling (GDS).
168
+ */
155169
156170 #define MSR_IA32_FLUSH_CMD 0x0000010b
157171 #define L1D_FLUSH BIT(0) /*
....@@ -170,6 +184,8 @@
170184 #define MSR_IA32_MCU_OPT_CTRL 0x00000123
171185 #define RNGDS_MITG_DIS BIT(0)
172186 #define FB_CLEAR_DIS BIT(3) /* CPU Fill buffer clear disable */
187
+#define GDS_MITG_DIS BIT(4) /* Disable GDS mitigation */
188
+#define GDS_MITG_LOCKED BIT(5) /* GDS mitigation locked */
173189
174190 #define MSR_IA32_SYSENTER_CS 0x00000174
175191 #define MSR_IA32_SYSENTER_ESP 0x00000175
....@@ -493,6 +509,7 @@
493509 #define MSR_AMD64_DE_CFG 0xc0011029
494510 #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
495511 #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)
512
+#define MSR_AMD64_DE_CFG_ZEN2_FP_BACKUP_FIX_BIT 9
496513
497514 #define MSR_AMD64_BU_CFG2 0xc001102a
498515 #define MSR_AMD64_IBSFETCHCTL 0xc0011030
....@@ -514,6 +531,7 @@
514531 #define MSR_AMD64_ICIBSEXTDCTL 0xc001103c
515532 #define MSR_AMD64_IBSOPDATA4 0xc001103d
516533 #define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */
534
+#define MSR_AMD64_VM_PAGE_FLUSH 0xc001011e
517535 #define MSR_AMD64_SEV_ES_GHCB 0xc0010130
518536 #define MSR_AMD64_SEV 0xc0010131
519537 #define MSR_AMD64_SEV_ENABLED_BIT 0