linux/arch/x86/kernel/cpu
Andi Kleen 919f18f961 x86/mtrr: Check if fixed MTRRs exist before saving them
MTRRs have an obsolete fixed variant for fine grained caching control
of the 640K-1MB region that uses separate MSRs. This fixed variant has
a separate capability bit in the MTRR capability MSR.

So far all x86 CPUs which support MTRR have this separate bit set, so it
went unnoticed that mtrr_save_state() does not check the capability bit
before accessing the fixed MTRR MSRs.

Though on a CPU that does not support the fixed MTRR capability this
results in a #GP.  The #GP itself is harmless because the RDMSR fault is
handled gracefully, but results in a WARN_ON().

Add the missing capability check to prevent this.

Fixes: 2b1f6278d7 ("[PATCH] x86: Save the MTRRs of the BSP before booting an AP")
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240808000244.946864-1-ak@linux.intel.com
2024-08-08 17:03:12 +02:00
..
mce - Flip the logic to add feature names to /proc/cpuinfo to having to 2024-07-15 20:25:16 -07:00
microcode - Fix a clang-15 build warning and other cleanups 2024-05-14 09:09:32 -07:00
mtrr x86/mtrr: Check if fixed MTRRs exist before saving them 2024-08-08 17:03:12 +02:00
resctrl - Enable Sub-NUMA clustering to work with resource control on Intel by 2024-07-16 10:53:54 -07:00
sgx mm: switch mm->get_unmapped_area() to a flag 2024-04-25 20:56:25 -07:00
.gitignore
Makefile x86/pconfig: Remove unused MKTME pconfig code 2024-05-28 08:45:17 -07:00
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: Add models 0x60-0x6f to the Zen5 range 2024-07-30 15:22:52 +02:00
aperfmperf.c x86/aperfmperf: Fix deadlock on cpu_hotplug_lock 2024-07-29 15:32:37 +02:00
bugs.c x86/bugs: Add 'spectre_bhi=vmexit' cmdline option 2024-06-28 15:35:54 +02: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/topology/intel: Unlock CPUID before evaluating anything 2024-05-31 20:25:56 +02:00
cpu.h x86/topology/intel: Unlock CPUID before evaluating anything 2024-05-31 20:25:56 +02:00
cpuid-deps.c - Switch the in-place instruction patching which lead to at least one weird bug 2024-05-14 08:51:37 -07:00
cyrix.c
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.c - Flip the logic to add feature names to /proc/cpuinfo to having to 2024-07-15 20:25:16 -07:00
intel_epb.c x86/cpu/intel_epb: Switch to new Intel CPU model defines 2024-04-29 10:31:16 +02:00
match.c x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL 2024-05-22 11:31:10 +02:00
mkcapflags.sh x86/cpufeatures: Flip the /proc/cpuinfo appearance logic 2024-06-20 21:04:22 +02:00
mshyperv.c hyperv-next for v6.9 2024-03-21 10:01:02 -07:00
perfctr-watchdog.c
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 AMD FAST CPPC feature flag 2024-06-11 16:12:12 -05:00
topology.c x86/topology: Handle bogus ACPI tables correctly 2024-05-21 14:52:35 +02:00
topology.h x86/cpu/topology: Retrieve cores per package from topology bitmaps 2024-02-15 22:07:45 +01:00
topology_amd.c x86/topology/amd: Evaluate SMT in CPUID leaf 0x8000001e only on family 0x17 and greater 2024-05-30 15:58:55 +02:00
topology_common.c x86/topology: Don't evaluate logical IDs during early boot 2024-03-23 12:28:06 +01:00
topology_ext.c x86/cpu/topology: Add support for the AMD 0x80000026 leaf 2024-03-22 11:22:14 +01:00
transmeta.c
tsx.c
umc.c
umwait.c x86/umwait: move to use bus_get_dev_root() 2023-03-17 15:29:29 +01:00
vmware.c x86/vmware: Add TDX hypercall support 2024-06-25 17:15:48 +02:00
vortex.c
zhaoxin.c x86/cpu: Use common topology code for Centaur and Zhaoxin 2024-02-15 22:07:37 +01:00