linux/arch
Thomas Gleixner c983c044ad 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:15:08 +02:00
..
alpha RTC for 6.8 2024-01-18 17:25:39 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:35:14 +02:00
arm ARM: 9381/1: kasan: clear stale stack poison 2024-05-17 12:14:51 +02:00
arm64 arm64: dts: qcom: sa8155p-adp: fix SDHC2 CD pin configuration 2024-05-17 12:15:07 +02:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:32:39 +02:00
loongarch LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:35:28 +02:00
m68k kbuild: use 4-space indentation when followed by conditionals 2024-02-15 06:05:44 +09:00
microblaze Microblaze patches for 6.8-rc1 2024-01-17 11:27:23 -08:00
mips MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 12:14:45 +02:00
nios2 percpu: 2024-01-18 15:01:28 -08:00
openrisc
parisc prctl: generalize PR_SET_MDWE support check to be per-arch 2024-04-03 15:32:37 +02:00
powerpc powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-05-17 12:14:48 +02:00
riscv riscv, bpf: Fix incorrect runtime stats 2024-05-17 12:14:27 +02:00
s390 s390/vdso: Add CFI for RA register to asm macro vdso_func 2024-05-17 12:14:29 +02:00
sh sh updates for v6.8 2024-01-20 09:24:06 -08:00
sparc mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:38:00 +02:00
um work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
x86 x86/apic: Don't access the APIC when disabling x2APIC 2024-05-17 12:15:08 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:15:03 +02:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:35:28 +02:00