|
|
@@ -56,7 +56,7 @@ void setup_barrier_nospec(void)
|
|
|
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
|
|
|
security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR);
|
|
|
|
|
|
- if (!no_nospec)
|
|
|
+ if (!no_nospec && !cpu_mitigations_off())
|
|
|
enable_barrier_nospec(enable);
|
|
|
}
|
|
|
|
|
|
@@ -115,7 +115,7 @@ static int __init handle_nospectre_v2(char *p)
|
|
|
early_param("nospectre_v2", handle_nospectre_v2);
|
|
|
void setup_spectre_v2(void)
|
|
|
{
|
|
|
- if (no_spectrev2)
|
|
|
+ if (no_spectrev2 || cpu_mitigations_off())
|
|
|
do_btb_flush_fixups();
|
|
|
else
|
|
|
btb_flush_enabled = true;
|
|
|
@@ -299,7 +299,7 @@ void setup_stf_barrier(void)
|
|
|
|
|
|
stf_enabled_flush_types = type;
|
|
|
|
|
|
- if (!no_stf_barrier)
|
|
|
+ if (!no_stf_barrier && !cpu_mitigations_off())
|
|
|
stf_barrier_enable(enable);
|
|
|
}
|
|
|
|