Re: [PATCH 1/2] x86/microcode: Add microcode= cmdline parsing

From: Chang S. Bae
Date: Thu Aug 14 2025 - 19:09:14 EST


On 8/9/2025 2:42 AM, Borislav Petkov wrote:
- microcode.force_minrev= [X86]
- Format: <bool>
+ microcode= [X86] Control the behavior of the microcode loader.
+ Available options, comma separated:

It looks like microcode=dis_ucode_ldr is also supported.
This could be added here:
ldr_ucode_ldr
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.

I also noticed in arch/x86/Kconfig:

config MICROCODE_LATE_LOADING
bool "Late microcode loading (DANGEROUS)"
default n
depends on MICROCODE && SMP
help
...
the kernel command line with "microcode.minrev=Y".

This outdated has been there already. Perhaps, it might be better to fix this typo with the new one while updating the option.
-bool force_minrev = IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV);
-module_param(force_minrev, bool, S_IRUSR | S_IWUSR);
+bool force_minrev = false;

<snip>

+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) {

nit: s/64/sizeof(cmd_bug)/

+ while ((s = strsep(&p, ","))) {
+ if (IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV)) {
+ if (!strcmp("force_minrev", s))
+ force_minrev = true;
+ }

I think the behavior here differs from before:

Previously, the minrev requirement could be enforced by either
(a) Build with MICROCODE_LATE_FORCE_MINREV=y, or
(b) microcode.force_minrev with MICROCODE_LATE=y.

Now, this requires both. I don't know this is intentional, but it’s like asking for more from the user.

Thanks,
Chang