android_kernel_xiaomi_sm8350/arch/x86/kernel/cpu/mcheck
Ingo Molnar e412cd257e x86, mce: Don't initialize MCEs on unknown CPUs
An older test-box started hanging at the following point during
bootup:

 [    0.022996] Mount-cache hash table entries: 512
 [    0.024996] Initializing cgroup subsys debug
 [    0.025996] Initializing cgroup subsys cpuacct
 [    0.026995] Initializing cgroup subsys devices
 [    0.027995] Initializing cgroup subsys freezer
 [    0.028995] mce: CPU supports 5 MCE banks

I've bisected it down to commit 4efc0670 ("x86, mce: use 64bit
machine check code on 32bit"), which utilizes the MCE code on
32-bit systems too.

The problem is caused by this detail in my config:

  # CONFIG_CPU_SUP_INTEL is not set

This disables the quirks in mce_cpu_quirks() but still enables
MCE support - which then hangs due to the missing quirk
workaround needed on this CPU:

	if (c->x86 == 6 && c->x86_model < 0x1A && banks > 0)
		mce_banks[0].init = 0;

The safe solution is to not initialize MCEs if we dont know on
what CPU we are running (or if that CPU's support code got
disabled in the config).

Also be a bit more defensive on 32-bit systems: dont do a
boot-time dump of pending MCEs not just on the specific system
that we found a problem with (Pentium-M), but earlier ones as
well.

Now this problem is probably not common and disabling CPU
support is rare - but still being more defensive in something
we turned on for a wide range of CPUs is prudent.

Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
LKML-Reference: Message-ID: <4A88E3E4.40506@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-08-17 13:28:25 +02:00
..
k7.c x86, mce: unify mce.h 2009-06-16 16:56:07 -07:00
Makefile x86, mce: rename _64.c files which are no longer 64-bit-specific 2009-06-16 16:56:11 -07:00
mce_amd.c x86, mce: rename _64.c files which are no longer 64-bit-specific 2009-06-16 16:56:11 -07:00
mce_intel.c x86, mce: mce_intel.c needs <asm/apic.h> 2009-06-17 08:31:15 -07:00
mce-inject.c x86, mce: rename mce_notify_user to mce_notify_irq 2009-06-03 14:48:04 -07:00
mce-internal.h
mce-severity.c
mce.c x86, mce: Don't initialize MCEs on unknown CPUs 2009-08-17 13:28:25 +02:00
non-fatal.c x86, mce: unify mce.h 2009-06-16 16:56:07 -07:00
p4.c x86, mce: remove therm_throt.h 2009-06-16 16:56:09 -07:00
p5.c x86, mce: make mce_disabled boolean 2009-06-16 16:56:07 -07:00
p6.c x86, mce: unify mce.h 2009-06-16 16:56:07 -07:00
therm_throt.c x86, mce: therm_throt: Don't log redundant normality 2009-08-16 17:25:41 +02:00
threshold.c
winchip.c x86, mce: unify mce.h 2009-06-16 16:56:07 -07:00