Re: [PATCH] x86/bugs: Only log missing retpoline when it's actually the missing mitigation
From: Kim Phillips
Date: Mon Aug 31 2026 - 21:20:44 EST
On 8/26/26 11:59 PM, Pawan Gupta wrote:
On Wed, Aug 26, 2026 at 05:22:28PM -0500, Kim Phillips wrote:
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1956,10 +1956,8 @@ early_param("spectre_v2", spectre_v2_parse_cmdline);
static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void)
{
- if (!IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)) {
- pr_err("Kernel not compiled with retpoline; no mitigation available!");
The claim "No mitigation available" is really the problem. And, it is
redundant here because the final mitigation state is anyways printed in
spectre_v2_update_mitigation().
How about just change the message to:
pr_err("Kernel not compiled with retpoline");
It stays accurate here, telling retpoline mitigation was attempted.
Thanks for your review. I've made these changes and reworded the commit
text and submitted a v2 here:
https://lore.kernel.org/lkml/20260831210916.987152-1-kim.phillips@xxxxxxx/
Thanks,
Kim