linux-stable/arch/x86
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
..
boot x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
coco x86/coco: Require seeding RNG with RDRAND on CoCo systems 2024-04-10 16:36:03 +02:00
configs
crypto crypto: x86/sha - load modules based on CPU features 2023-11-28 17:19:56 +00:00
entry x86/bhi: Add support for clearing branch history at syscall entry 2024-04-10 16:36:07 +02:00
events perf/x86: Fix out of range data 2024-04-17 11:19:36 +02:00
hyperv x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:20:06 -04:00
ia32
include x86/tdx: Preserve shared bit on mprotect() 2024-05-02 16:32:47 +02:00
kernel x86/apic: Don't access the APIC when disabling x2APIC 2024-05-17 12:02:35 +02:00
kvm KVM: x86/pmu: Set enable bits for GP counters in PERF_GLOBAL_CTRL at "RESET" 2024-05-02 16:32:40 +02:00
lib x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
math-emu
mm x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
net x86/bpf: Fix IP after emitting call depth accounting 2024-04-10 16:35:48 +02:00
pci PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge 2024-04-13 13:07:36 +02:00
platform x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:07:39 +02:00
power mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
purgatory x86/purgatory: Remove LTO flags 2023-09-17 09:49:03 +02:00
ras
realmode
tools x86, relocs: Ignore relocations in .notes section 2024-03-26 18:19:35 -04:00
um
video
virt/vmx/tdx
xen x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:07:39 +02:00
.gitignore
Kbuild
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:32:44 +02:00
Kconfig.assembler
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 09:25:10 +01:00
Kconfig.debug
Makefile
Makefile.postlink
Makefile.um
Makefile_32.cpu