* [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff
@ 2026-11-25 17:52 Erwan Velu
0 siblings, 0 replies; only message in thread
From: Erwan Velu @ 2026-11-25 17:52 UTC (permalink / raw)
To: Borislav Petkov, x86
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, H . Peter Anvin,
linux-kernel, Erwan Velu
Since commit 8d171045069c ("x86/microcode/AMD: Select which microcode
patch to load"), verify_patch() only considers patches which are on the
same side of the Entrysign cutoff revision as the microcode currently
running on the CPU. On a machine whose BIOS still ships pre-Entrysign
microcode, every post-Entrysign patch for that CPU, be it in the initrd
or in /lib/firmware, is skipped.
This choice is made silently: nothing is printed, neither at early load
nor on late load, where the write to the reload file in
/sys/devices/system/cpu/microcode/ even succeeds. The microcode shipped
by the distribution is simply never applied and the CPU stays at the
BIOS revision, or at the pre-Entrysign fallback patch. Because nothing
explains this, it is very hard to understand why the microcode is not
loaded: one has to read the loader source to find out that a BIOS update
is what is actually needed.
Print a one-time warning when a patch for the running CPU is skipped
because the current revision is at or below the cutoff, naming the
patch, the current revision and the cutoff, and pointing at the BIOS
update.
Patches below the cutoff are still skipped silently on CPUs which are
already past it, as they are older than the running revision anyway.
Tested in a KVM guest with CONFIG_MICROCODE_DBG=y, a guest CPUID of
family 0x19, model 0xa0, stepping 2 (EPYC 8004 "Siena", cutoff
0xaa00218), linux-firmware's microcode_amd_fam19h.bin in the early
initrd (it carries both 0xaa00215 and 0xaa0021c for that CPU) and the
running revision faked with microcode=base_rev=:
- base_rev=0xaa00216: without this patch, only "Current revision:
0x0aa00216" is printed and a late reload succeeds without changing
anything. With it, the warning about 0x0aa0021c is printed once.
- base_rev=0xaa00212: 0xaa00215 is applied early and the warning about
0x0aa0021c is printed.
- base_rev=0xaa0021b: 0xaa0021c is applied early and nothing new is
printed.
Fixes: 8d171045069c ("x86/microcode/AMD: Select which microcode patch to load")
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Erwan Velu <e.velu@criteo.com>
---
arch/x86/kernel/cpu/microcode/amd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 6cdc410e7547..ea7a8853d509 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -568,6 +568,11 @@ static int verify_patch(const u8 *buf, size_t buf_size, u32 *patch_size)
if (cur_rev > cutoff && patch_rev > cutoff)
goto ok;
+ if (cur_rev <= cutoff &&
+ ucode_rev_to_cpuid(patch_rev).full == bsp_cpuid_1_eax)
+ pr_warn_once("Patch 0x%08x skipped: current revision 0x%08x is at or below the Entrysign cutoff 0x%08x, a BIOS update is required\n",
+ patch_rev, cur_rev, cutoff);
+
return 1;
ok:
--
2.55.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 17:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 17:52 [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff Erwan Velu
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®