linux/arch/x86/kernel/cpu/microcode
Borislav Petkov (AMD) 5214a9f6c0 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: 4c585af718 ("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
2025-05-05 10:51:00 +02:00
..
Makefile x86/microcode: Hide the config knob 2023-08-13 10:26:39 +02:00
amd.c x86/microcode: Consolidate the loader enablement checking 2025-05-05 10:51:00 +02:00
amd_shas.c x86/microcode/AMD: Load only SHA256-checksummed patches 2025-02-22 11:46:05 +01:00
core.c x86/microcode: Consolidate the loader enablement checking 2025-05-05 10:51:00 +02:00
intel.c x86/microcode: Consolidate the loader enablement checking 2025-05-05 10:51:00 +02:00
internal.h x86/microcode: Consolidate the loader enablement checking 2025-05-05 10:51:00 +02:00