From: Borislav Petkov <bp@alien8.de>
To: Brendan Jackman <jackmanb@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v2 1/3] x86/cpu: Create helper to parse clearcpuid param
Date: Mon, 17 Feb 2025 11:59:37 +0100 [thread overview]
Message-ID: <20250217105937.GGZ7MWmb4eTtRaN72e@fat_crate.local> (raw)
In-Reply-To: <20250129-force-cpu-bug-v2-1-5637b337b443@google.com>
On Wed, Jan 29, 2025 at 03:35:39PM +0000, Brendan Jackman wrote:
> +/*
> + * We parse cpu parameters early because fpu__init_system() is executed
While at it:
s/We parse cpu parameters/Parse CPU parameters/
> + * before parse_early_param().
> + */
> +static void __init cpu_parse_early_param(void)
> +{
> + char arg[128];
> + int arglen;
> +
> +#ifdef CONFIG_X86_32
> + if (cmdline_find_option_bool(boot_command_line, "no387"))
> +#ifdef CONFIG_MATH_EMULATION
> + setup_clear_cpu_cap(X86_FEATURE_FPU);
> +#else
> + pr_err("Option 'no387' required CONFIG_MATH_EMULATION enabled.\n");
> +#endif
> +
> + if (cmdline_find_option_bool(boot_command_line, "nofxsr"))
> + setup_clear_cpu_cap(X86_FEATURE_FXSR);
> +#endif
> +
> + if (cmdline_find_option_bool(boot_command_line, "noxsave"))
> + setup_clear_cpu_cap(X86_FEATURE_XSAVE);
> +
> + if (cmdline_find_option_bool(boot_command_line, "noxsaveopt"))
> + setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
> +
> + if (cmdline_find_option_bool(boot_command_line, "noxsaves"))
> + setup_clear_cpu_cap(X86_FEATURE_XSAVES);
> +
> + if (cmdline_find_option_bool(boot_command_line, "nousershstk"))
> + setup_clear_cpu_cap(X86_FEATURE_USER_SHSTK);
> +
> + /* Minimize the gap between FRED is available and available but disabled. */
> + arglen = cmdline_find_option(boot_command_line, "fred", arg, sizeof(arg));
> + if (arglen != 2 || strncmp(arg, "on", 2))
> + setup_clear_cpu_cap(X86_FEATURE_FRED);
> +
> + arglen = cmdline_find_option(boot_command_line, "clearcpuid", arg, sizeof(arg));
> + if (arglen <= 0)
> + return;
Newline here.
> + parse_clearcpuid(arg);
> }
>
> /*
>
> --
> 2.48.1.262.g85cc9f2d1e-goog
>
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2025-02-17 11:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 15:35 [PATCH RESEND v2 0/3] x86/cpu: Add facility to force-enable CPU caps and bugs Brendan Jackman
2025-01-29 15:35 ` [PATCH RESEND v2 1/3] x86/cpu: Create helper to parse clearcpuid param Brendan Jackman
2025-02-17 10:59 ` Borislav Petkov [this message]
2025-01-29 15:35 ` [PATCH RESEND v2 2/3] x86/cpu: Add setcpuid cmdline param Brendan Jackman
2025-02-17 11:03 ` Borislav Petkov
2025-01-29 15:35 ` [PATCH RESEND v2 3/3] x86/cpu: Enable modifying bug flags with {clear,set}puid Brendan Jackman
2025-02-17 11:10 ` Borislav Petkov
2025-02-17 11:20 ` Brendan Jackman
2025-02-17 11:53 ` Borislav Petkov
2025-02-17 16:56 ` Brendan Jackman
2025-02-17 17:08 ` Borislav Petkov
2025-02-17 17:20 ` Brendan Jackman
2025-02-17 19:22 ` Borislav Petkov
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=20250217105937.GGZ7MWmb4eTtRaN72e@fat_crate.local \
--to=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jackmanb@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.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®