[PATCH v2 2/2] cpu: fix hard lockup triggered by printk calls within scheduling context

Will Deacon will at kernel.org
Thu Oct 30 07:50:07 PDT 2025


On Wed, Oct 29, 2025 at 11:45:54AM +0800, shechenglong wrote:
> @@ -1197,3 +1185,15 @@ void unpriv_ebpf_notify(int new_state)
>                 pr_err("WARNING: %s", EBPF_WARN);
>  }
>  #endif
> +
> +void spectre_print_disabled_mitigations(void)
> +{
> +       if (spectre_v2_mitigations_off())
> +               pr_info("spectre-v2 mitigation disabled by command-line option\n");
> +
> +       if (spectre_v4_mitigations_off())
> +               pr_info("spectre-v4 mitigation disabled by command-line option\n");
> +
> +       if (__nospectre_bhb || cpu_mitigations_off())
> +               pr_info("spectre-bhb mitigation disabled by command-line option\n");

Is the compiler smart enough to store a single string for the "mitigation
disabled by command-line option\n" part? If not, you might want to use %s
to avoid wasting memory. (I was going to check with llvm but I'm unable
to apply your changes due to whitespace corruption).

Will



More information about the linux-arm-kernel mailing list