File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2217,11 +2217,20 @@ early_param("spectre_bhi", spectre_bhi_parse_cmdline);
2217
2217
2218
2218
static void __init bhi_select_mitigation (void )
2219
2219
{
2220
- if (!boot_cpu_has (X86_BUG_BHI ) || cpu_mitigations_off () )
2220
+ if (!boot_cpu_has (X86_BUG_BHI ))
2221
2221
bhi_mitigation = BHI_MITIGATION_OFF ;
2222
2222
2223
- if (bhi_mitigation == BHI_MITIGATION_AUTO )
2224
- bhi_mitigation = BHI_MITIGATION_ON ;
2223
+ if (bhi_mitigation != BHI_MITIGATION_AUTO )
2224
+ return ;
2225
+
2226
+ if (cpu_attack_vector_mitigated (CPU_MITIGATE_GUEST_HOST )) {
2227
+ if (cpu_attack_vector_mitigated (CPU_MITIGATE_USER_KERNEL ))
2228
+ bhi_mitigation = BHI_MITIGATION_ON ;
2229
+ else
2230
+ bhi_mitigation = BHI_MITIGATION_VMEXIT_ONLY ;
2231
+ } else {
2232
+ bhi_mitigation = BHI_MITIGATION_OFF ;
2233
+ }
2225
2234
}
2226
2235
2227
2236
static void __init bhi_update_mitigation (void )
You can’t perform that action at this time.
0 commit comments