@@ -238,7 +238,7 @@ static void x86_amd_ssb_disable(void)
238
238
239
239
/* Default mitigation for MDS-affected CPUs */
240
240
static enum mds_mitigations mds_mitigation __ro_after_init =
241
- IS_ENABLED (CONFIG_MITIGATION_MDS ) ? MDS_MITIGATION_FULL : MDS_MITIGATION_OFF ;
241
+ IS_ENABLED (CONFIG_MITIGATION_MDS ) ? MDS_MITIGATION_AUTO : MDS_MITIGATION_OFF ;
242
242
static bool mds_nosmt __ro_after_init = false;
243
243
244
244
static const char * const mds_strings [] = {
@@ -249,34 +249,37 @@ static const char * const mds_strings[] = {
249
249
250
250
enum taa_mitigations {
251
251
TAA_MITIGATION_OFF ,
252
+ TAA_MITIGATION_AUTO ,
252
253
TAA_MITIGATION_UCODE_NEEDED ,
253
254
TAA_MITIGATION_VERW ,
254
255
TAA_MITIGATION_TSX_DISABLED ,
255
256
};
256
257
257
258
/* Default mitigation for TAA-affected CPUs */
258
259
static enum taa_mitigations taa_mitigation __ro_after_init =
259
- IS_ENABLED (CONFIG_MITIGATION_TAA ) ? TAA_MITIGATION_VERW : TAA_MITIGATION_OFF ;
260
+ IS_ENABLED (CONFIG_MITIGATION_TAA ) ? TAA_MITIGATION_AUTO : TAA_MITIGATION_OFF ;
260
261
261
262
enum mmio_mitigations {
262
263
MMIO_MITIGATION_OFF ,
264
+ MMIO_MITIGATION_AUTO ,
263
265
MMIO_MITIGATION_UCODE_NEEDED ,
264
266
MMIO_MITIGATION_VERW ,
265
267
};
266
268
267
269
/* Default mitigation for Processor MMIO Stale Data vulnerabilities */
268
270
static enum mmio_mitigations mmio_mitigation __ro_after_init =
269
- IS_ENABLED (CONFIG_MITIGATION_MMIO_STALE_DATA ) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF ;
271
+ IS_ENABLED (CONFIG_MITIGATION_MMIO_STALE_DATA ) ? MMIO_MITIGATION_AUTO : MMIO_MITIGATION_OFF ;
270
272
271
273
enum rfds_mitigations {
272
274
RFDS_MITIGATION_OFF ,
275
+ RFDS_MITIGATION_AUTO ,
273
276
RFDS_MITIGATION_VERW ,
274
277
RFDS_MITIGATION_UCODE_NEEDED ,
275
278
};
276
279
277
280
/* Default mitigation for Register File Data Sampling */
278
281
static enum rfds_mitigations rfds_mitigation __ro_after_init =
279
- IS_ENABLED (CONFIG_MITIGATION_RFDS ) ? RFDS_MITIGATION_VERW : RFDS_MITIGATION_OFF ;
282
+ IS_ENABLED (CONFIG_MITIGATION_RFDS ) ? RFDS_MITIGATION_AUTO : RFDS_MITIGATION_OFF ;
280
283
281
284
static void __init mds_select_mitigation (void )
282
285
{
@@ -285,6 +288,9 @@ static void __init mds_select_mitigation(void)
285
288
return ;
286
289
}
287
290
291
+ if (mds_mitigation == MDS_MITIGATION_AUTO )
292
+ mds_mitigation = MDS_MITIGATION_FULL ;
293
+
288
294
if (mds_mitigation == MDS_MITIGATION_FULL ) {
289
295
if (!boot_cpu_has (X86_FEATURE_MD_CLEAR ))
290
296
mds_mitigation = MDS_MITIGATION_VMWERV ;
@@ -514,6 +520,9 @@ static void __init rfds_select_mitigation(void)
514
520
if (rfds_mitigation == RFDS_MITIGATION_OFF )
515
521
return ;
516
522
523
+ if (rfds_mitigation == RFDS_MITIGATION_AUTO )
524
+ rfds_mitigation = RFDS_MITIGATION_VERW ;
525
+
517
526
if (x86_arch_cap_msr & ARCH_CAP_RFDS_CLEAR )
518
527
setup_force_cpu_cap (X86_FEATURE_CLEAR_CPU_BUF );
519
528
else
@@ -1979,6 +1988,7 @@ void cpu_bugs_smt_update(void)
1979
1988
1980
1989
switch (mds_mitigation ) {
1981
1990
case MDS_MITIGATION_FULL :
1991
+ case MDS_MITIGATION_AUTO :
1982
1992
case MDS_MITIGATION_VMWERV :
1983
1993
if (sched_smt_active () && !boot_cpu_has (X86_BUG_MSBDS_ONLY ))
1984
1994
pr_warn_once (MDS_MSG_SMT );
@@ -1990,6 +2000,7 @@ void cpu_bugs_smt_update(void)
1990
2000
1991
2001
switch (taa_mitigation ) {
1992
2002
case TAA_MITIGATION_VERW :
2003
+ case TAA_MITIGATION_AUTO :
1993
2004
case TAA_MITIGATION_UCODE_NEEDED :
1994
2005
if (sched_smt_active ())
1995
2006
pr_warn_once (TAA_MSG_SMT );
@@ -2001,6 +2012,7 @@ void cpu_bugs_smt_update(void)
2001
2012
2002
2013
switch (mmio_mitigation ) {
2003
2014
case MMIO_MITIGATION_VERW :
2015
+ case MMIO_MITIGATION_AUTO :
2004
2016
case MMIO_MITIGATION_UCODE_NEEDED :
2005
2017
if (sched_smt_active ())
2006
2018
pr_warn_once (MMIO_MSG_SMT );
0 commit comments