From: Sohil Mehta <sohil.mehta@intel.com>
To: Borislav Petkov <bp@kernel.org>, X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Borislav Petkov (AMD)" <bp@alien8.de>
Subject: Re: [PATCH 1/2] x86/microcode: Add microcode= cmdline parsing
Date: Mon, 11 Aug 2025 19:26:59 -0700 [thread overview]
Message-ID: <f641cc0f-e542-45ef-bdb9-d8364860688e@intel.com> (raw)
In-Reply-To: <20250809094206.28028-2-bp@kernel.org>
On 8/9/2025 2:42 AM, Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
>
> Add a "microcode=" command line argument after which all options can be
> passed in a comma-separated list.
>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> ---
> .../admin-guide/kernel-parameters.txt | 8 +++--
> arch/x86/kernel/cpu/microcode/core.c | 30 +++++++++++++++----
> 2 files changed, 30 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 747a55abf494..7c095177da85 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3767,10 +3767,12 @@
>
> mga= [HW,DRM]
>
> - microcode.force_minrev= [X86]
> - Format: <bool>
> + microcode= [X86] Control the behavior of the microcode loader.
> + Available options, comma separated:
> +
How about adding something like this to encourage using the new options:
@@ -1211,7 +1211,7 @@
- dis_ucode_ldr [X86] Disable the microcode loader.
+ dis_ucode_ldr [X86] Same as microcode=disable_loader.
@@ -3770,6 +3770,9 @@
+ disable_loader
+ Disable the microcode loader.
+
> + force_minrev
> Enable or disable the microcode minimal revision
> - enforcement for the runtime microcode loader.
> + enforcement for the runtime microcode loader.
Unnecessary whitespace added before tab.
> mini2440= [ARM,HW,KNL]
> Format:[0..2][b][c][t]
> diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
> index b92e09a87c69..351a51861f00 100644
> --- a/arch/x86/kernel/cpu/microcode/core.c
> +++ b/arch/x86/kernel/cpu/microcode/core.c
> @@ -43,10 +43,9 @@
> #include "internal.h"
>
> static struct microcode_ops *microcode_ops;
> -static bool dis_ucode_ldr = false;
> +static bool dis_ucode_ldr;
>
> -bool force_minrev = IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV);
> -module_param(force_minrev, bool, S_IRUSR | S_IWUSR);
> +bool force_minrev = false;
>
Setting this to "false" is redundant.
> /*
> * Synchronization.
> @@ -126,13 +125,34 @@ bool __init microcode_loader_disabled(void)
> return dis_ucode_ldr;
> }
>
> +static void early_parse_cmdline(void)
> +{
> + char cmd_buf[64] = {};
> + char *s, *p = cmd_buf;
> +
> + if (cmdline_find_option(boot_command_line, "microcode", cmd_buf, 64) > 0) {
> + while ((s = strsep(&p, ","))) {
> + if (IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV)) {
> + if (!strcmp("force_minrev", s))
> + force_minrev = true;
> + }
> +
> + if (!strcmp(s, "dis_ucode_ldr"))
If you agree with the above suggestion,
s/dis_ucode_ldr/disable_loader
> + dis_ucode_ldr = true;
> + }
> + }
> +
> + /* old, compat option */
> + if (cmdline_find_option_bool(boot_command_line, "dis_ucode_ldr") > 0)
> + dis_ucode_ldr = true;
> +}
> +
> void __init load_ucode_bsp(void)
> {
> unsigned int cpuid_1_eax;
> bool intel = true;
>
> - if (cmdline_find_option_bool(boot_command_line, "dis_ucode_ldr") > 0)
> - dis_ucode_ldr = true;
> + early_parse_cmdline();
>
> if (microcode_loader_disabled())
> return;
next prev parent reply other threads:[~2025-08-12 2:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-09 9:42 [PATCH 0/2] x86/microcode: Add debugging glue Borislav Petkov
2025-08-09 9:42 ` [PATCH 1/2] x86/microcode: Add microcode= cmdline parsing Borislav Petkov
2025-08-12 2:26 ` Sohil Mehta [this message]
2025-08-12 10:23 ` Borislav Petkov
2025-08-12 19:14 ` Sohil Mehta
2025-08-12 21:28 ` Borislav Petkov
2025-08-14 23:08 ` Chang S. Bae
2025-08-15 9:20 ` Borislav Petkov
2025-08-15 19:50 ` Chang S. Bae
2025-08-18 16:30 ` Sohil Mehta
2025-08-09 9:42 ` [PATCH 2/2] x86/microcode: Add microcode loader debugging functionality Borislav Petkov
2025-08-12 3:04 ` Sohil Mehta
2025-08-12 10:26 ` Borislav Petkov
2025-08-12 18:57 ` Sohil Mehta
2025-08-12 19:09 ` 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=f641cc0f-e542-45ef-bdb9-d8364860688e@intel.com \
--to=sohil.mehta@intel.com \
--cc=bp@alien8.de \
--cc=bp@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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®