hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/fpu/types.h
....@@ -114,6 +114,12 @@
114114 XFEATURE_Hi16_ZMM,
115115 XFEATURE_PT_UNIMPLEMENTED_SO_FAR,
116116 XFEATURE_PKRU,
117
+ XFEATURE_PASID,
118
+ XFEATURE_RSRVD_COMP_11,
119
+ XFEATURE_RSRVD_COMP_12,
120
+ XFEATURE_RSRVD_COMP_13,
121
+ XFEATURE_RSRVD_COMP_14,
122
+ XFEATURE_LBR,
117123
118124 XFEATURE_MAX,
119125 };
....@@ -128,6 +134,8 @@
128134 #define XFEATURE_MASK_Hi16_ZMM (1 << XFEATURE_Hi16_ZMM)
129135 #define XFEATURE_MASK_PT (1 << XFEATURE_PT_UNIMPLEMENTED_SO_FAR)
130136 #define XFEATURE_MASK_PKRU (1 << XFEATURE_PKRU)
137
+#define XFEATURE_MASK_PASID (1 << XFEATURE_PASID)
138
+#define XFEATURE_MASK_LBR (1 << XFEATURE_LBR)
131139
132140 #define XFEATURE_MASK_FPSSE (XFEATURE_MASK_FP | XFEATURE_MASK_SSE)
133141 #define XFEATURE_MASK_AVX512 (XFEATURE_MASK_OPMASK \
....@@ -229,6 +237,34 @@
229237 u32 pad;
230238 } __packed;
231239
240
+/*
241
+ * State component 15: Architectural LBR configuration state.
242
+ * The size of Arch LBR state depends on the number of LBRs (lbr_depth).
243
+ */
244
+
245
+struct lbr_entry {
246
+ u64 from;
247
+ u64 to;
248
+ u64 info;
249
+};
250
+
251
+struct arch_lbr_state {
252
+ u64 lbr_ctl;
253
+ u64 lbr_depth;
254
+ u64 ler_from;
255
+ u64 ler_to;
256
+ u64 ler_info;
257
+ struct lbr_entry entries[];
258
+} __packed;
259
+
260
+/*
261
+ * State component 10 is supervisor state used for context-switching the
262
+ * PASID state.
263
+ */
264
+struct ia32_pasid_state {
265
+ u64 pasid;
266
+} __packed;
267
+
232268 struct xstate_header {
233269 u64 xfeatures;
234270 u64 xcomp_bv;
....@@ -294,13 +330,11 @@
294330 unsigned int last_cpu;
295331
296332 /*
297
- * @initialized:
333
+ * @avx512_timestamp:
298334 *
299
- * This flag indicates whether this context is initialized: if the task
300
- * is not running then we can restore from this context, if the task
301
- * is running then we should save into this context.
335
+ * Records the timestamp of AVX512 use during last context switch.
302336 */
303
- unsigned char initialized;
337
+ unsigned long avx512_timestamp;
304338
305339 /*
306340 * @state: