Re: [PATCH v2] x86/bugs: Don't say no mitigation available if kernel not compiled with retpoline
From: Pawan Gupta
Date: Tue Sep 01 2026 - 13:16:58 EST
On Mon, Aug 31, 2026 at 04:09:16PM -0500, Kim Phillips wrote:
> When the kernel lacks retpoline support, spectre_v2_select_retpoline()
> emits
>
> "Kernel not compiled with retpoline; no mitigation available!"
>
> before returning SPECTRE_V2_NONE to its callers. SPECTRE_V2_NONE is not
> the final answer, though: spectre_v2_update_mitigation() runs afterwards
> and can still upgrade the mitigation.
>
> On an Intel CPU affected by RETBleed, built with
> CONFIG_MITIGATION_IBRS_ENTRY=y and CONFIG_MITIGATION_RETPOLINE=n, and
> booted with spectre_v2=auto, retbleed_select_mitigation() picks
> RETBLEED_MITIGATION_IBRS, and spectre_v2_update_mitigation() then promotes
> SPECTRE_V2_NONE to SPECTRE_V2_IBRS. The boot log claims no mitigation is
> available immediately before reporting "Spectre V2 : Mitigation: IBRS",
> and sysfs reports the machine as mitigated. The message is alarming and
> simply wrong.
>
> Drop "no mitigation available!" because the final mitigation state is
> printed afterwards in spectre_v2_update_mitigation() anyway.
>
> Suggested-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>
> Fixes: 480e803dacf8 ("x86/bugs: Restructure spectre_v2 mitigation")
> Cc: stable@xxxxxxxxxx
> Signed-off-by: Kim Phillips <kim.phillips@xxxxxxx>
Reviewed-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>