linux-stable/arch
Thomas Gleixner 513f8dc02e x86/apic: Don't access the APIC when disabling x2APIC
commit 720a22fd6c upstream.

With 'iommu=off' on the kernel command line and x2APIC enabled by the BIOS
the code which disables the x2APIC triggers an unchecked MSR access error:

  RDMSR from 0x802 at rIP: 0xffffffff94079992 (native_apic_msr_read+0x12/0x50)

This is happens because default_acpi_madt_oem_check() selects an x2APIC
driver before the x2APIC is disabled.

When the x2APIC is disabled because interrupt remapping cannot be enabled
due to 'iommu=off' on the command line, x2apic_disable() invokes
apic_set_fixmap() which in turn tries to read the APIC ID. This triggers
the MSR warning because x2APIC is disabled, but the APIC driver is still
x2APIC based.

Prevent that by adding an argument to apic_set_fixmap() which makes the
APIC ID read out conditional and set it to false from the x2APIC disable
path. That's correct as the APIC ID has already been read out during early
discovery.

Fixes: d10a904435 ("x86/apic: Consolidate boot_cpu_physical_apicid initialization sites")
Reported-by: Adrian Huang <ahuang12@lenovo.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Adrian Huang <ahuang12@lenovo.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/875xw5t6r7.ffs@tglx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-17 12:02:35 +02:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:18:56 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:32:33 +02:00
arm ARM: 9381/1: kasan: clear stale stack poison 2024-05-17 12:02:20 +02:00
arm64 arm64: dts: qcom: sa8155p-adp: fix SDHC2 CD pin configuration 2024-05-17 12:02:35 +02:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:28:55 +02:00
ia64 cpu-hotplug: Provide prototypes for arch CPU registration 2023-10-11 14:27:37 +02:00
loongarch LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:32:45 +02:00
m68k mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
microblaze
mips MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 12:02:15 +02:00
nios2 mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
openrisc
parisc prctl: generalize PR_SET_MDWE support check to be per-arch 2024-04-03 15:28:54 +02:00
powerpc powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-05-17 12:02:18 +02:00
riscv riscv, bpf: Fix incorrect runtime stats 2024-05-17 12:02:01 +02:00
s390 s390/vdso: Add CFI for RA register to asm macro vdso_func 2024-05-17 12:02:02 +02:00
sh mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
sparc mm, treewide: introduce NR_PAGE_ORDERS 2024-05-02 16:32:41 +02:00
um um: Fix adding '-no-pie' for clang 2024-02-23 09:25:03 +01:00
x86 x86/apic: Don't access the APIC when disabling x2APIC 2024-05-17 12:02:35 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:02:32 +02:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:32:44 +02:00