linux-stable/arch
Mateusz Jończyk 87c51832b7 x86/apic: Handle no CONFIG_X86_X2APIC on systems with x2APIC enabled by BIOS
[ Upstream commit e3998434da ]

A kernel that was compiled without CONFIG_X86_X2APIC was unable to boot on
platforms that have x2APIC already enabled in the BIOS before starting the
kernel.

The kernel was supposed to panic with an approprite error message in
validate_x2apic() due to the missing X2APIC support.

However, validate_x2apic() was run too late in the boot cycle, and the
kernel tried to initialize the APIC nonetheless. This resulted in an
earlier panic in setup_local_APIC() because the APIC was not registered.

In my experiments, a panic message in setup_local_APIC() was not visible
in the graphical console, which resulted in a hang with no indication
what has gone wrong.

Instead of calling panic(), disable the APIC, which results in a somewhat
working system with the PIC only (and no SMP). This way the user is able to
diagnose the problem more easily.

Disabling X2APIC mode is not an option because it's impossible on systems
with locked x2APIC.

The proper place to disable the APIC in this case is in check_x2apic(),
which is called early from setup_arch(). Doing this in
__apic_intr_mode_select() is too late.

Make check_x2apic() unconditionally available and remove the empty stub.

Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reported-by: Robert Elliott (Servers) <elliott@hpe.com>
Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/lkml/d573ba1c-0dc4-3016-712a-cc23a8a33d42@molgen.mpg.de
Link: https://lore.kernel.org/lkml/20220911084711.13694-3-mat.jonczyk@o2.pl
Link: https://lore.kernel.org/all/20221129215008.7247-1-mat.jonczyk@o2.pl
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:58 +01:00
..
alpha alpha: fix syscall entry in !AUDUT_SYSCALL case 2022-12-31 13:31:55 +01:00
arc ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
arm ARM: dts: aspeed: rainier,everest: Move reserved memory regions 2022-12-31 13:32:56 +01:00
arm64 arm64: dts: qcom: sm6350: Add apps_smmu with streamID to SDHCI 1/2 nodes 2022-12-31 13:32:57 +01:00
csky - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
hexagon - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
ia64 - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
loongarch LoongArch: mm: Fix huge page entry update for virtual machine 2022-12-08 14:59:15 +08:00
m68k - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
microblaze kbuild: fix "cat: .version: No such file or directory" 2022-11-24 09:26:02 +09:00
mips MIPS: OCTEON: warn only once if deprecated link status is being used 2022-12-31 13:32:00 +01:00
nios2 nios2: add FORCE for vmlinuz.gz 2022-11-27 08:28:41 +09:00
openrisc OpenRISC 6.1 Updates 2022-10-15 16:47:33 -07:00
parisc parisc: Avoid printing the hardware path twice 2022-10-31 15:37:14 +01:00
powerpc powerpc/pseries/eeh: use correct API for error log size 2022-12-31 13:32:52 +01:00
riscv RISC-V: KVM: Fix reg_val check in kvm_riscv_vcpu_set_reg_config() 2022-12-31 13:32:51 +01:00
s390 * Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns 2022-12-06 10:49:19 -08:00
sh - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
sparc mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
um Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
x86 x86/apic: Handle no CONFIG_X86_X2APIC on systems with x2APIC enabled by BIOS 2022-12-31 13:32:58 +01:00
xtensa - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
.gitignore
Kconfig ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack 2022-12-31 13:32:45 +01:00