mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: Breno Leitao <leitao@debian.org>
Cc: mingo@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] x86/bugs: spectre_v2_user default mode depends on main default
Date: Mon, 22 Jan 2024 16:04:31 -0800	[thread overview]
Message-ID: <20240123000431.rqs5g6gjpq5uckcs@desk> (raw)
In-Reply-To: <20240118173213.2008115-4-leitao@debian.org>

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
> 

  reply	other threads:[~2024-01-23  0:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 17:32 [PATCH 0/3] x86/bugs: Separate config for mitigations (part 2) Breno Leitao
2024-01-18 17:32 ` [PATCH 1/3] x86/bugs: Create a way to disable GDS mitigation Breno Leitao
2024-01-18 17:32 ` [PATCH 2/3] x86/bugs: Add a separate config for missing mitigation Breno Leitao
2024-01-22 20:58   ` Pawan Gupta
2024-01-23 15:05     ` Breno Leitao
2024-01-24  0:06       ` Pawan Gupta
2024-01-18 17:32 ` [PATCH 3/3] x86/bugs: spectre_v2_user default mode depends on main default Breno Leitao
2024-01-23  0:04   ` Pawan Gupta [this message]
2024-01-23 15:02     ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240123000431.rqs5g6gjpq5uckcs@desk \
    --to=pawan.kumar.gupta@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®