From: "tip-bot2 for Borislav Petkov (AMD)" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>,
Sohil Mehta <sohil.mehta@intel.com>,
"Chang S. Bae" <chang.seok.bae@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/microcode] x86/microcode: Add microcode= cmdline parsing
Date: Fri, 05 Sep 2025 10:30:11 -0000 [thread overview]
Message-ID: <175706821167.1920.8357300911170308187.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250820135043.19048-2-bp@kernel.org>
The following commit has been merged into the x86/microcode branch of tip:
Commit-ID: 632ff61706473127cdc3b779bf24d368e3856ab3
Gitweb: https://git.kernel.org/tip/632ff61706473127cdc3b779bf24d368e3856ab3
Author: Borislav Petkov (AMD) <bp@alien8.de>
AuthorDate: Wed, 20 Aug 2025 15:50:42 +02:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Thu, 04 Sep 2025 16:02:20 +02:00
x86/microcode: Add microcode= cmdline parsing
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>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Chang S. Bae <chang.seok.bae@intel.com>
Link: https://lore.kernel.org/20250820135043.19048-2-bp@kernel.org
---
Documentation/admin-guide/kernel-parameters.txt | 8 +++--
arch/x86/Kconfig | 4 +-
arch/x86/kernel/cpu/microcode/core.c | 26 +++++++++++++---
3 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 747a55a..9e3bbce 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3767,8 +3767,12 @@
mga= [HW,DRM]
- microcode.force_minrev= [X86]
- Format: <bool>
+ microcode= [X86] Control the behavior of the microcode loader.
+ Available options, comma separated:
+
+ dis_ucode_ldr: disable the microcode loader
+
+ force_minrev:
Enable or disable the microcode minimal revision
enforcement for the runtime microcode loader.
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 58d890f..aa250d9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1340,7 +1340,7 @@ config MICROCODE_LATE_LOADING
use this at your own risk. Late loading taints the kernel unless the
microcode header indicates that it is safe for late loading via the
minimal revision check. This minimal revision check can be enforced on
- the kernel command line with "microcode.minrev=Y".
+ the kernel command line with "microcode=force_minrev".
config MICROCODE_LATE_FORCE_MINREV
bool "Enforce late microcode loading minimal revision check"
@@ -1356,7 +1356,7 @@ config MICROCODE_LATE_FORCE_MINREV
revision check fails.
This minimal revision check can also be controlled via the
- "microcode.minrev" parameter on the kernel command line.
+ "microcode=force_minrev" parameter on the kernel command line.
If unsure say Y.
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index b92e09a..7d59063 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);
/*
* Synchronization.
@@ -126,13 +125,32 @@ 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, sizeof(cmd_buf)) > 0) {
+ while ((s = strsep(&p, ","))) {
+ if (!strcmp("force_minrev", s))
+ force_minrev = true;
+
+ if (!strcmp(s, "dis_ucode_ldr"))
+ 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-09-05 10:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 13:50 [PATCH -v1 0/2] x86/microcode: Add debugging glue Borislav Petkov
2025-08-20 13:50 ` [PATCH -v1 1/2] x86/microcode: Add microcode= cmdline parsing Borislav Petkov
2025-08-21 5:03 ` Sohil Mehta
2025-08-21 5:15 ` Chang S. Bae
2025-09-02 8:45 ` kernel test robot
2025-09-04 11:37 ` Borislav Petkov
2025-09-04 23:29 ` Nathan Chancellor
2025-09-05 10:40 ` Borislav Petkov
2025-09-05 13:17 ` Ryusuke Konishi
2025-09-05 19:27 ` Nathan Chancellor
2025-09-05 10:30 ` tip-bot2 for Borislav Petkov (AMD) [this message]
2025-08-20 13:50 ` [PATCH -v1 2/2] x86/microcode: Add microcode loader debugging functionality Borislav Petkov
2025-08-20 15:35 ` Nikolay Borisov
2025-08-20 15:56 ` Borislav Petkov
2025-08-21 5:19 ` Sohil Mehta
2025-08-29 9:45 ` Borislav Petkov
2025-08-29 23:25 ` Sohil Mehta
2025-08-30 9:25 ` Borislav Petkov
2025-09-05 10:30 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov (AMD)
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=175706821167.1920.8357300911170308187.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=sohil.mehta@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).