linux/arch/x86/kernel/cpu
Thomas Gleixner dd5e3e3ca6 x86/microcode/intel: Simplify early loading
The early loading code is overly complicated:

  - It scans the builtin/initrd for microcode not only on the BSP, but also
    on all APs during early boot and then later in the boot process it
    scans again to duplicate and save the microcode before initrd goes
    away.

    That's a pointless exercise because this can be simply done before
    bringing up the APs when the memory allocator is up and running.

 - Saving the microcode from within the scan loop is completely
   non-obvious and a left over of the microcode cache.

   This can be done at the call site now which makes it obvious.

Rework the code so that only the BSP scans the builtin/initrd microcode
once during early boot and save it away in an early initcall for later
use.

  [ bp: Test and fold in a fix from tglx ontop which handles the need to
    distinguish what save_microcode() does depending on when it is
    called:

     - when on the BSP during early load, it needs to find a newer
       revision than the one currently loaded on the BSP

     - later, before SMP init, it still runs on the BSP and gets the BSP
       revision just loaded and uses that revision to know which patch
       to save for the APs. For that it needs to find the exact one as
       on the BSP.
   ]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231017211722.629085215@linutronix.de
2023-10-24 15:02:36 +02:00
..
mce * Rework apic callbacks, getting rid of unnecessary ones and 2023-08-30 10:44:46 -07:00
microcode x86/microcode/intel: Simplify early loading 2023-10-24 15:02:36 +02:00
mtrr x86/mtrr: Unify debugging printing 2023-06-01 15:04:33 +02:00
resctrl x86/resctrl: Fix kernel-doc warnings 2023-10-08 11:45:16 +02:00
sgx x86/sgx: Resolves SECS reclaim vs. page fault for EAUG race 2023-09-28 16:16:40 -07:00
.gitignore
acrn.c x86/apic: Nuke ack_APIC_irq() 2023-08-09 11:58:34 -07:00
amd.c x86/cpu: Fix AMD erratum #1485 on Zen4-based CPUs 2023-10-11 11:00:11 +02:00
aperfmperf.c x86/aperfmperf: Erase stale arch_freq_scale values when disabling frequency invariance readings 2023-01-16 10:19:15 +01:00
bugs.c x86/srso: Fix SBPB enablement for spec_rstack_overflow=off 2023-09-19 10:54:39 +02:00
cacheinfo.c x86/cpu/cacheinfo: Remove cpu_callout_mask dependency 2023-05-15 13:44:52 +02:00
centaur.c
common.c x86/microcode/32: Move early loading after paging enable 2023-10-18 22:15:01 +02:00
cpu.h x86/speculation: Add Gather Data Sampling mitigation 2023-07-19 16:45:37 -07:00
cpuid-deps.c x86/cpufeatures: Add CPU feature flags for shadow stacks 2023-07-11 14:12:18 -07:00
cyrix.c x86/cyrix: include header linux/isa-dma.h 2022-07-26 14:03:12 -05:00
feat_ctl.c x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype 2022-09-26 17:06:27 +02:00
hygon.c x86/apic: Get rid of hard_smp_processor_id() 2023-08-09 11:58:17 -07:00
hypervisor.c
intel.c x86/microcode: Include vendor headers into microcode.h 2023-08-13 18:42:55 +02:00
intel_epb.c x86/cpu: Fix Gracemont uarch 2023-08-09 21:51:06 +02:00
intel_pconfig.c
Makefile x86/cpu: Remove X86_FEATURE_NAMES 2023-05-15 20:03:08 +02:00
match.c
mkcapflags.sh
mshyperv.c hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
perfctr-watchdog.c
powerflags.c
proc.c x86: Expose thread features in /proc/$PID/status 2023-08-02 15:01:51 -07:00
rdrand.c x86/rdrand: Remove "nordrand" flag in favor of "random.trust_cpu" 2022-07-18 15:04:04 +02:00
scattered.c x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag 2023-01-23 17:38:31 +01:00
topology.c x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms 2023-05-25 10:48:42 -07:00
transmeta.c
tsx.c x86/cpu: Remove redundant extern x86_read_arch_cap_msr() 2023-01-10 12:40:24 +01:00
umc.c
umwait.c x86/umwait: move to use bus_get_dev_root() 2023-03-17 15:29:29 +01:00
vmware.c sched/clock/x86: Mark sched_clock() noinstr 2023-01-31 15:01:47 +01:00
vortex.c
zhaoxin.c