[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250522112730.GFaC8KIk7jbj4EyoV7@fat_crate.local>
Date: Thu, 22 May 2025 13:27:30 +0200
From: Borislav Petkov <bp@...en8.de>
To: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
Cc: x86@...nel.org, David Kaplan <david.kaplan@....com>,
linux-kernel@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...nel.org>
Subject: Re: [PATCH v2 1/7] x86/retbleed: Check for AUTO in all cases
On Wed, May 21, 2025 at 07:44:22PM -0700, Pawan Gupta wrote:
> When none of mitigation option is selected, AUTO gets converted to NONE.
> This is currently only being done for Intel. The check is useful in
> general, make it common.
>
> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
> ---
> arch/x86/kernel/cpu/bugs.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 7f94e6a5497d9a2d312a76095e48d6b364565777..19ff705b3128eacad5659990ed345d7a19bcb0f4 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -1294,15 +1294,15 @@ static void __init retbleed_update_mitigation(void)
> if (retbleed_mitigation != RETBLEED_MITIGATION_STUFF)
> pr_err(RETBLEED_INTEL_MSG);
> }
> - /* If nothing has set the mitigation yet, default to NONE. */
> - if (retbleed_mitigation == RETBLEED_MITIGATION_AUTO)
> - retbleed_mitigation = RETBLEED_MITIGATION_NONE;
> }
> +
> + /* If nothing has set the mitigation yet, default to NONE. */
> + if (retbleed_mitigation == RETBLEED_MITIGATION_AUTO)
> + retbleed_mitigation = RETBLEED_MITIGATION_NONE;
> out:
> pr_info("%s\n", retbleed_strings[retbleed_mitigation]);
> }
So, the way I see it is, AUTO means user didn't select anything so we will
select the default thing.
And we do that in the select function.
But then in the update function we bring back AUTO from the dead again,
forcing us to having to deal with it, well, again.
So can we simply set to RETBLEED_MITIGATION_NONE in the retbleed + its = stuff
option when SPECTRE_V2_RETPOLINE not selected?
This'll get rid of the AUTO crap.
For that, the select function should probably select something else from AUTO
on Intel too.
My point is, let's deal with AUTO in the select functions only and then forget
it from then on...
Right?
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists