Re: [PATCH] x86/microcode: Fix crashes on early 486 CPUs due to usage of 'cpuid'.
From: Borislav Petkov
Date: Sat Apr 05 2025 - 17:03:42 EST
On Sat, Apr 05, 2025 at 10:50:13PM +0200, Borislav Petkov wrote:
> On Sat, Apr 05, 2025 at 01:33:46PM -0700, H. Peter Anvin wrote:
> > How the Hades does c->x86 not get set to 4 (hence < 0x10) on this CPU?
> >
> > That's the real bug imo...
>
> Go to the first mail in the thread.
>
> 4c585af7180c ("x86/boot/32: Temporarily map initrd for microcode loading")
>
> walks straight into native_cpuid_ecx().
... and what you're *really* asking is why that dis_ucode_ldr is there in
save_microcode_in_initrd() - because tglx made it an early_initcall() so it
runs independently of the loader detection logic and thus needs this check.
So I figure I'll stick all the checking logic into a single function which
everything can call now...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette