linux/arch/x86
Andi Kleen 450b6b22ac x86/mtrr: Check if fixed MTRRs exist before saving them
commit 919f18f961 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-19 05:41:20 +02:00
..
boot x86/boot: Ignore NMIs during very early boot 2024-02-23 08:42:02 +01:00
configs x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs 2022-01-27 10:54:21 +01:00
crypto crypto: x86/sha256-avx2 - add missing vzeroupper 2024-06-16 13:32:02 +02:00
entry syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-07-05 09:12:55 +02:00
events perf/x86/intel/pt: Fix a topa_entry base address calculation 2024-08-19 05:41:01 +02:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2023-01-14 10:16:13 +01:00
ia32 x86: remove address space overrides using set_fs() 2020-09-08 22:21:36 -04:00
include efi/x86: Free EFI memory map only when installing a new one. 2024-07-05 09:12:56 +02:00
kernel x86/mtrr: Check if fixed MTRRs exist before saving them 2024-08-19 05:41:20 +02:00
kvm KVM: VMX: Split out the non-virtualization part of vmx_interrupt_blocked() 2024-08-19 05:40:58 +02:00
lib x86/retpoline: Move a NOENDBR annotation to the SRSO dummy return thunk 2024-07-18 13:05:50 +02:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
mm x86/mm: Fix pti_clone_entry_text() for i386 2024-08-19 05:41:10 +02:00
net x86/returnthunk: Allow different return thunks 2024-03-01 13:16:49 +01:00
oprofile
pci x86/pci/xen: Fix PCIBIOS_* return code handling 2024-08-19 05:40:40 +02:00
platform x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos 2024-08-19 05:40:40 +02:00
power x86/stackprotector/32: Make the canary into a regular percpu variable 2024-04-13 12:58:45 +02:00
purgatory x86/purgatory: Switch to the position-independent small code model 2024-06-16 13:32:06 +02:00
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 10:54:14 +01:00
tools x86/boot: Ignore relocations in .notes sections in walk_relocs() too 2024-06-16 13:32:03 +02:00
um x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list 2023-03-11 16:40:11 +01:00
video
xen x86/xen: Convert comma to semicolon 2024-08-19 05:40:43 +02:00
.gitignore
Kbuild
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:23:44 +02:00
Kconfig.assembler
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 08:42:28 +01:00
Kconfig.debug x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y 2024-06-16 13:32:26 +02:00
Makefile x86/stackprotector/32: Make the canary into a regular percpu variable 2024-04-13 12:58:45 +02:00
Makefile_32.cpu
Makefile.um um: allow not setting extra rpaths in the linux binary 2024-03-15 10:48:18 -04:00