[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240123000431.rqs5g6gjpq5uckcs@desk>
Date: Mon, 22 Jan 2024 16:04:31 -0800
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
To: Breno Leitao <leitao@...ian.org>
Cc: mingo@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] x86/bugs: spectre_v2_user default mode depends on
main default
On Thu, Jan 18, 2024 at 09:32:13AM -0800, Breno Leitao wrote:
> static enum spectre_v2_user_cmd __init
> spectre_v2_parse_user_cmdline(void)
> {
> + int ret, i, mode;
mode is being returned, it is better to match its type with function's
return type "enum spectre_v2_user_cmd".
> char arg[20];
> - int ret, i;
> +
> + mode = IS_ENABLED(CONFIG_MITIGATION_SPECTRE_V2) ?
> + SPECTRE_V2_USER_CMD_AUTO : SPECTRE_V2_USER_CMD_NONE;
>
> switch (spectre_v2_cmd) {
> case SPECTRE_V2_CMD_NONE:
> @@ -1236,7 +1239,7 @@ spectre_v2_parse_user_cmdline(void)
> ret = cmdline_find_option(boot_command_line, "spectre_v2_user",
> arg, sizeof(arg));
> if (ret < 0)
> - return SPECTRE_V2_USER_CMD_AUTO;
> + return mode;
>
> for (i = 0; i < ARRAY_SIZE(v2_user_options); i++) {
> if (match_option(arg, ret, v2_user_options[i].option)) {
> @@ -1246,8 +1249,8 @@ spectre_v2_parse_user_cmdline(void)
> }
> }
>
> - pr_err("Unknown user space protection option (%s). Switching to AUTO select\n", arg);
> - return SPECTRE_V2_USER_CMD_AUTO;
> + pr_err("Unknown user space protection option (%s). Switching to default\n", arg);
> + return mode;
> }
>
> static inline bool spectre_v2_in_ibrs_mode(enum spectre_v2_mitigation mode)
> --
> 2.34.1
>
Powered by blists - more mailing lists