What | Removed | Added |
---|---|---|
Status | NEW | CONFIRMED |
Ugh, oh my. The interaction of upstream vs. non-upstream spectre v2 handling is
in start_kernel as follows:
> parse_early_param
> nospec <- if passed "nospec" parameter
> check_bugs
> identify_boot_cpu
> identify_cpu(boot_cpu_data)
> init_intel
> x86_spec_check -> non-upstream IBRS
> setup_force_cpu_cap(X86_FEATURE_SPEC_CTRL)
> apply_forced_caps
> spectre_v2_select_mitigation
> spectre_v2_parse_cmdline
> nospec -> set by "nospectre_v2" param
> setup_clear_cpu_cap(X86_FEATURE_SPEC_CTRL)
> rest_init
> kernel_init
> kernel_init_freeable
> smp_init -> distribute
So non-upstream spec v2 sets the forced flag, but later call to nospec won't
help, as it does not remove forced flag to be cleared. So nospectre_v2 removes
the flag only from the boot cpu.
This should fix it:
--- a/arch/x86/kernel/cpu/spec_ctrl.c
+++ b/arch/x86/kernel/cpu/spec_ctrl.c
@@ -100,3 +100,4 @@ int nospec(char *str)
return 0;
}
early_param("nospec", nospec);
+early_param("nospectre_v2", nospec);