* [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff
@ 2026-11-25 17:52 Erwan Velu
2026-11-26 0:44 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages 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] 4+ messages in thread
* Re: [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff
2026-11-25 17:52 [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff Erwan Velu
@ 2026-11-26 0:44 ` Borislav Petkov
2026-11-26 10:00 ` Erwan Velu
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2026-11-26 0:44 UTC (permalink / raw)
To: Erwan Velu
Cc: x86, Thomas Gleixner, Ingo Molnar, Dave Hansen, H . Peter Anvin,
linux-kernel, Erwan Velu
On Wed, Nov 25, 2026 at 06:52:03PM +0100, Erwan Velu wrote:
> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
We don't use the AI tag anymore:
1e035297ffda ("docs: remove Assisted-by references")
> + 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);
> +
Except that a one-liner in dmesg doesn't tell you the whole story.
Also, not everyone can get BIOS updates and then more questions arise.
Perhaps I can document it in Documentation/arch/x86/microcode.rst.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff
2026-11-26 0:44 ` Borislav Petkov
@ 2026-11-26 10:00 ` Erwan Velu
2026-11-27 1:31 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Erwan Velu @ 2026-11-26 10:00 UTC (permalink / raw)
To: Borislav Petkov
Cc: x86, Thomas Gleixner, Ingo Molnar, Dave Hansen, H . Peter Anvin,
linux-kernel, Erwan Velu
> > + 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);
> > +
>
> Except that a one-liner in dmesg doesn't tell you the whole story.
> Also, not everyone can get BIOS updates and then more questions arise.
> Perhaps I can document it in Documentation/arch/x86/microcode.rst.
Boris,
Thanks for the quick feedback.
We can adjust the wording, but it's important for the user to
understand that the non microcode loading was done intentionally
because of this trust issue, and the only way to avoid it is a BIOS
update.
In my case, two identical systems (kernel / ramfs / OS) : one loads
the 21c firmware and gets TSA enabled; the second one remains on 215,
no TSA, no error message.
User complained about the performance of the machine, so I initially
suspected late-loading behavior, then an incorrect microcode that led
to this code.
It's truly important, from a security and performance perspective, to
inform the user that the kernel made this decision not to load the
ucode and what the possible workarounds are.
I think it's important to inform the user that a BIOS update is
necessary to get a ucode greater than the cutoff, and that this has to
be exposed even if you don't have any available.
Erwan,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/microcode/AMD: Warn when a patch is skipped because of the Entrysign cutoff
2026-11-26 10:00 ` Erwan Velu
@ 2026-11-27 1:31 ` Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2026-11-27 1:31 UTC (permalink / raw)
To: Erwan Velu
Cc: x86, Thomas Gleixner, Ingo Molnar, Dave Hansen, H . Peter Anvin,
linux-kernel, Erwan Velu
On Thu, Nov 26, 2026 at 11:00:59AM +0100, Erwan Velu wrote:
> We can adjust the wording, but it's important for the user to understand
> that the non microcode loading was done intentionally because of this trust
> issue, and the only way to avoid it is a BIOS update.
I know what you wanna do. What will end up happening is something else, I'm
afraid.
Because a single line in dmesg doesn't explain the situation but raises more
questions. Now guess who will answer those? It won't be you... :)
And good luck explaining some poor folks that there'll be no more BIOS for
them. "But but, my kernel just told me to update my BIOS. There is no more
BIOS updates for my board... :-("
So, pls send me dmesg from that machine you're poking at so that I can take
a look. Privately is fine too.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-27 1:31 UTC | newest]
Thread overview: 4+ messages (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
2026-11-26 0:44 ` Borislav Petkov
2026-11-26 10:00 ` Erwan Velu
2026-11-27 1:31 ` Borislav Petkov
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®