linux/arch/x86/kernel/cpu
Thomas Gleixner c90399fbd7 x86/cpu: Ensure that CPU info updates are propagated on UP
The boot sequence evaluates CPUID information twice:

  1) During early boot

  2) When finalizing the early setup right before
     mitigations are selected and alternatives are patched.

In both cases the evaluation is stored in boot_cpu_data, but on UP the
copying of boot_cpu_data to the per CPU info of the boot CPU happens
between #1 and #2. So any update which happens in #2 is never propagated to
the per CPU info instance.

Consolidate the whole logic and copy boot_cpu_data right before applying
alternatives as that's the point where boot_cpu_data is in it's final
state and not supposed to change anymore.

This also removes the voodoo mb() from smp_prepare_cpus_common() which
had absolutely no purpose.

Fixes: 71eb4893cf ("x86/percpu: Cure per CPU madness on UP")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240322185305.127642785@linutronix.de
2024-03-23 12:22:04 +01:00
..
mce - Constify yet another static struct bus_type instance now that the 2024-03-11 17:22:57 -07:00
microcode x86/cpu/topology: Get rid of cpuinfo::x86_max_cores 2024-02-16 15:51:32 +01:00
mtrr x86/mtrr: Don't print errors if MtrrFixDramModEn is set when SNP enabled 2024-01-29 17:24:27 +01:00
resctrl x86/resctrl: Remove lockdep annotation that triggers false positive 2024-02-22 16:15:38 +01:00
sgx arch/x86: Fix typos 2024-01-03 11:46:22 +01:00
.gitignore
acrn.c x86/traps: Add sysvec_install() to install a system interrupt handler 2024-01-31 22:02:36 +01:00
amd.c x86/CPU/AMD: Update the Zenbleed microcode revisions 2024-03-16 09:04:09 -07: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 * Mitigate RFDS vulnerability 2024-03-12 09:31:39 -07:00
cacheinfo.c - Relax the PAT MSR programming which was unnecessarily using the MTRR 2024-03-11 17:27:12 -07:00
centaur.c x86/cpu: Use common topology code for Centaur and Zhaoxin 2024-02-15 22:07:37 +01:00
common.c x86/cpu: Ensure that CPU info updates are propagated on UP 2024-03-23 12:22:04 +01:00
cpu.h x86/cpu: Use common topology code for HYGON 2024-02-15 22:07:38 +01:00
cpuid-deps.c x86/cpufeatures: Add the CPU feature bit for FRED 2024-01-25 19:10:30 +01:00
cyrix.c x86/cyrix: include header linux/isa-dma.h 2022-07-26 14:03:12 -05:00
debugfs.c x86/cpu/topology: Get rid of cpuinfo::x86_max_cores 2024-02-16 15:51:32 +01:00
feat_ctl.c x86/cpu: Add a VMX flag to enumerate 5-level EPT support to userspace 2024-02-22 16:03:56 -08:00
hygon.c x86/cpu: Use common topology code for HYGON 2024-02-15 22:07:38 +01:00
hypervisor.c
intel_epb.c x86/cpu/intel_epb: Don't rely on link order 2023-11-24 13:54:31 +01:00
intel_pconfig.c x86/msr: Prepare for including <linux/percpu.h> into <asm/msr.h> 2024-03-04 12:01:39 +01:00
intel.c Merge branch 'x86/urgent' into x86/apic, to resolve conflicts 2024-02-27 10:09:49 +01:00
Makefile x86/cpu/topology: Move registration out of APIC code 2024-02-15 22:07:41 +01:00
match.c
mkcapflags.sh
mshyperv.c - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
perfctr-watchdog.c x86/nmi_watchdog: Fix old-style NMI watchdog regression on old Intel CPUs 2021-06-10 10:04:40 +02:00
powerflags.c
proc.c x86/cpu: Move cpu_core_id into topology info 2023-10-10 14:38:17 +02:00
rdrand.c x86/msr: Prepare for including <linux/percpu.h> into <asm/msr.h> 2024-03-04 12:01:39 +01:00
scattered.c x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag 2023-01-23 17:38:31 +01:00
topology_amd.c x86/cpu: Provide an AMD/HYGON specific topology parser 2024-02-15 22:07:37 +01:00
topology_common.c x86/cpu/topology: Get rid of cpuinfo::x86_max_cores 2024-02-16 15:51:32 +01:00
topology_ext.c x86/cpu: Provide a sane leaf 0xb/0x1f parser 2024-02-15 22:07:37 +01:00
topology.c x86/topology: Ignore non-present APIC IDs in a present package 2024-03-06 14:35:30 +01:00
topology.h x86/cpu/topology: Retrieve cores per package from topology bitmaps 2024-02-15 22:07:45 +01: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 x86/CPU: Add support for Vortex CPUs 2021-10-21 15:49:07 +02:00
zhaoxin.c x86/cpu: Use common topology code for Centaur and Zhaoxin 2024-02-15 22:07:37 +01:00