@@ -247,6 +247,37 @@ static const char * const mds_strings[] = {
247247 [MDS_MITIGATION_VMWERV ] = "Vulnerable: Clear CPU buffers attempted, no microcode" ,
248248};
249249
250+ enum taa_mitigations {
251+ TAA_MITIGATION_OFF ,
252+ TAA_MITIGATION_UCODE_NEEDED ,
253+ TAA_MITIGATION_VERW ,
254+ TAA_MITIGATION_TSX_DISABLED ,
255+ };
256+
257+ /* Default mitigation for TAA-affected CPUs */
258+ static enum taa_mitigations taa_mitigation __ro_after_init =
259+ IS_ENABLED (CONFIG_MITIGATION_TAA ) ? TAA_MITIGATION_VERW : TAA_MITIGATION_OFF ;
260+
261+ enum mmio_mitigations {
262+ MMIO_MITIGATION_OFF ,
263+ MMIO_MITIGATION_UCODE_NEEDED ,
264+ MMIO_MITIGATION_VERW ,
265+ };
266+
267+ /* Default mitigation for Processor MMIO Stale Data vulnerabilities */
268+ static enum mmio_mitigations mmio_mitigation __ro_after_init =
269+ IS_ENABLED (CONFIG_MITIGATION_MMIO_STALE_DATA ) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF ;
270+
271+ enum rfds_mitigations {
272+ RFDS_MITIGATION_OFF ,
273+ RFDS_MITIGATION_VERW ,
274+ RFDS_MITIGATION_UCODE_NEEDED ,
275+ };
276+
277+ /* Default mitigation for Register File Data Sampling */
278+ static enum rfds_mitigations rfds_mitigation __ro_after_init =
279+ IS_ENABLED (CONFIG_MITIGATION_RFDS ) ? RFDS_MITIGATION_VERW : RFDS_MITIGATION_OFF ;
280+
250281static void __init mds_select_mitigation (void )
251282{
252283 if (!boot_cpu_has_bug (X86_BUG_MDS ) || cpu_mitigations_off ()) {
@@ -290,16 +321,6 @@ early_param("mds", mds_cmdline);
290321#undef pr_fmt
291322#define pr_fmt (fmt ) "TAA: " fmt
292323
293- enum taa_mitigations {
294- TAA_MITIGATION_OFF ,
295- TAA_MITIGATION_UCODE_NEEDED ,
296- TAA_MITIGATION_VERW ,
297- TAA_MITIGATION_TSX_DISABLED ,
298- };
299-
300- /* Default mitigation for TAA-affected CPUs */
301- static enum taa_mitigations taa_mitigation __ro_after_init =
302- IS_ENABLED (CONFIG_MITIGATION_TAA ) ? TAA_MITIGATION_VERW : TAA_MITIGATION_OFF ;
303324static bool taa_nosmt __ro_after_init ;
304325
305326static const char * const taa_strings [] = {
@@ -390,15 +411,6 @@ early_param("tsx_async_abort", tsx_async_abort_parse_cmdline);
390411#undef pr_fmt
391412#define pr_fmt (fmt ) "MMIO Stale Data: " fmt
392413
393- enum mmio_mitigations {
394- MMIO_MITIGATION_OFF ,
395- MMIO_MITIGATION_UCODE_NEEDED ,
396- MMIO_MITIGATION_VERW ,
397- };
398-
399- /* Default mitigation for Processor MMIO Stale Data vulnerabilities */
400- static enum mmio_mitigations mmio_mitigation __ro_after_init =
401- IS_ENABLED (CONFIG_MITIGATION_MMIO_STALE_DATA ) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF ;
402414static bool mmio_nosmt __ro_after_init = false;
403415
404416static const char * const mmio_strings [] = {
@@ -487,16 +499,6 @@ early_param("mmio_stale_data", mmio_stale_data_parse_cmdline);
487499#undef pr_fmt
488500#define pr_fmt (fmt ) "Register File Data Sampling: " fmt
489501
490- enum rfds_mitigations {
491- RFDS_MITIGATION_OFF ,
492- RFDS_MITIGATION_VERW ,
493- RFDS_MITIGATION_UCODE_NEEDED ,
494- };
495-
496- /* Default mitigation for Register File Data Sampling */
497- static enum rfds_mitigations rfds_mitigation __ro_after_init =
498- IS_ENABLED (CONFIG_MITIGATION_RFDS ) ? RFDS_MITIGATION_VERW : RFDS_MITIGATION_OFF ;
499-
500502static const char * const rfds_strings [] = {
501503 [RFDS_MITIGATION_OFF ] = "Vulnerable" ,
502504 [RFDS_MITIGATION_VERW ] = "Mitigation: Clear Register File" ,
0 commit comments