[PATCH RFC v2 6/7] x86/microcode: Decouple minimum revision check from late loading

From: Chang S. Bae

Date: Mon Nov 16 2026 - 12:14:20 EST


The microcode minimum revision check was originally introduced to express
dependencies involving OS-visible changes, thus it has been limited to
the late-load path.

In fact this can serve as a general guard against unsafe microcode
loading. Make the check independent of the loading path in preparation
for applying it to the early path as well.

For early-loading, establish a tracker to check whether an update
satisfies the minimum revision requirement and taint the kernel if not.

Right now, no vendor code implements the check, so every early load
taints the kernel.

Then, adjust the failure messages to suggest incremental updates, rather
than early-loading, as a solution to address revision dependencies.

Keep the existing force_minrev semantics unchanged; it continues to apply
only to late-loading.

Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
---
V1 -> V2:
* Do not apply force_minrev to early loading; keep the current semantics
* Move after incremental-loading support
* Massage changelog
---
arch/x86/kernel/cpu/microcode/core.c | 13 ++++++++++---
arch/x86/kernel/cpu/microcode/intel.c | 7 +++----
arch/x86/kernel/cpu/microcode/internal.h | 1 +
3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 5c4922031d91..b784d7df9906 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -609,8 +609,8 @@ static int load_late_stop_cpus(bool is_safe)
struct cpuinfo_x86 prev_info;

if (!is_safe) {
- pr_err("Late microcode loading without minimal revision check.\n");
- pr_err("You should switch to early loading, if possible.\n");
+ pr_err("Late microcode loading without minimum revision check.\n");
+ pr_err("You should update microcode incrementally.\n");
}

/*
@@ -959,9 +959,16 @@ static int __init microcode_init(void)

pr_info_once("Current revision: 0x%08x\n", (early_data.new_rev ?: early_data.old_rev));

- if (early_data.new_rev)
+ if (early_data.new_rev) {
pr_info_once("Updated early from: 0x%08x\n", early_data.old_rev);

+ if (!early_data.is_safe) {
+ pr_err("Early microcode loading without minimum revision check.\n");
+ pr_err("You should update microcode incrementally.\n");
+ add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+ }
+ }
+
if (incremental_loading && !microcode_ops->support_incremental) {
pr_warn("Incremental late loading not supported, disabling\n");
incremental_loading = false;
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 74c2d014efa0..eec8a45b283c 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -830,9 +830,8 @@ static bool ucode_validate_minrev(struct microcode_header_intel *mc_header)
int cur_rev = boot_cpu_data.microcode;

/*
- * When late-loading, ensure the header declares a minimum revision
- * required to perform a late-load. The previously reserved field
- * is 0 in older microcode blobs.
+ * Ensure the header declares a minimum revision required to perform a
+ * load. The previously reserved field is 0 in older microcode blobs.
*/
if (!mc_header->min_req_ver) {
pr_info("Unsafe microcode update: Microcode header does not specify a required min version\n");
@@ -845,7 +844,7 @@ static bool ucode_validate_minrev(struct microcode_header_intel *mc_header)
*/
if (cur_rev < mc_header->min_req_ver) {
pr_info("Unsafe microcode update: Current revision 0x%x too old\n", cur_rev);
- pr_info("Current should be at 0x%x or higher. Use early loading instead\n", mc_header->min_req_ver);
+ pr_info("Current should be at 0x%x or higher. Update incrementally.\n", mc_header->min_req_ver);
return false;
}
return true;
diff --git a/arch/x86/kernel/cpu/microcode/internal.h b/arch/x86/kernel/cpu/microcode/internal.h
index 246aac4a11bc..e60febbdf964 100644
--- a/arch/x86/kernel/cpu/microcode/internal.h
+++ b/arch/x86/kernel/cpu/microcode/internal.h
@@ -43,6 +43,7 @@ struct microcode_ops {
struct early_load_data {
u32 old_rev;
u32 new_rev;
+ bool is_safe;
};

extern struct early_load_data early_data;
--
2.53.0