]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/microcode: Consolidate the loader enablement checking
authorBorislav Petkov (AMD) <bp@alien8.de>
Mon, 14 Apr 2025 09:59:33 +0000 (11:59 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 5 May 2025 08:51:00 +0000 (10:51 +0200)
commit5214a9f6c0f56644acb9d2cbb58facf1856d322b
tree40064ce1822b86571e4cf9f714844631b8c3fba4
parent92a09c47464d040866cf2b4cd052bc60555185fb
x86/microcode: Consolidate the loader enablement checking

Consolidate the whole logic which determines whether the microcode loader
should be enabled or not into a single function and call it everywhere.

Well, almost everywhere - not in mk_early_pgtbl_32() because there the kernel
is running without paging enabled and checking dis_ucode_ldr et al would
require physical addresses and uglification of the code.

But since this is 32-bit, the easier thing to do is to simply map the initrd
unconditionally especially since that mapping is getting removed later anyway
by zap_early_initrd_mapping() and avoid the uglification.

In doing so, address the issue of old 486er machines without CPUID
support, not booting current kernels.

  [ mingo: Fix no previous prototype for â€˜microcode_loader_disabled’ [-Wmissing-prototypes] ]

Fixes: 4c585af7180c1 ("x86/boot/32: Temporarily map initrd for microcode loading")
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/CANpbe9Wm3z8fy9HbgS8cuhoj0TREYEEkBipDuhgkWFvqX0UoVQ@mail.gmail.com
arch/x86/include/asm/microcode.h
arch/x86/kernel/cpu/microcode/amd.c
arch/x86/kernel/cpu/microcode/core.c
arch/x86/kernel/cpu/microcode/intel.c
arch/x86/kernel/cpu/microcode/internal.h
arch/x86/kernel/head32.c