OpenCloudOS-Kernel/arch
Andi Kleen 8a90d3fc7c x86/mtrr: Check if fixed MTRRs exist before saving them
commit 919f18f961c03d6694aa726c514184f2311a4614 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-14 13:59:00 +02:00
..
alpha vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:32:33 +02:00
arm ARM: 9406/1: Fix callchain_trace() return value 2024-08-11 12:47:18 +02:00
arm64 arm64: errata: Expand speculative SSBS workaround (again) 2024-08-14 13:58:49 +02:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:34:02 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:34:02 +02:00
ia64 vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
loongarch LoongArch: Enable general EFI poweroff method 2024-08-14 13:58:58 +02:00
m68k m68k: amiga: Turn off Warp1260 interrupts during boot 2024-08-03 08:54:17 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-12 11:12:23 +02:00
mips MIPS: dts: loongson: Fix ls2k1000-rtc interrupt 2024-08-11 12:47:17 +02:00
nios2 mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
openrisc openrisc: traps: Don't send signals to kernel mode threads 2024-06-12 11:11:42 +02:00
parisc parisc: fix a possible DMA corruption 2024-08-14 13:58:57 +02:00
powerpc powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap() 2024-08-03 08:54:38 +02:00
riscv riscv: Fix linear mapping checks for non-contiguous memory regions 2024-08-11 12:47:23 +02:00
s390 s390/cpum_cf: Fix endless loop in CF_DIAG event stop 2024-08-03 08:54:41 +02:00
sh sh: rework sync_file_range ABI 2024-07-05 09:34:02 +02:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-03 08:53:55 +02:00
um um: time-travel: fix signal blocking race/hang 2024-08-03 08:54:35 +02:00
x86 x86/mtrr: Check if fixed MTRRs exist before saving them 2024-08-14 13:59:00 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:02:32 +02:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:49:15 +02:00