linux/arch/x86/kernel/cpu/mcheck
Borislav Petkov 254fe9c7a4 x86/MCE/AMD: Fix thinko about thresholding_en
So adding thresholding_en et al was a good thing for removing the
per-CPU thresholding callback, i.e., threshold_cpu_callback.

But, in order for it to work and especially that test in
mce_threshold_create_device() so that all thresholding banks get
properly created and not the whole thing to fail with a NULL ptr
dereference at mce_cpu_pre_down() when we offline the CPUs, we need to
set the thresholding_en flag *before* we start creating the devices.

Yap, it failed because thresholding_en wasn't set at the time
we were creating the banks so we didn't create any and then at
mce_cpu_pre_down() -> mce_threshold_remove_device() time, we would blow
up.

And the fix is actually easy: we have thresholding on the system when we
have managed to set the thresholding vector to amd_threshold_interrupt()
earlier in mce_amd_feature_init() while we were picking apart the
thresholding banks and what is set and what not.

So let's do that.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yazen Ghannam <Yazen.Ghannam@amd.com>
Fixes: 4d7b02d58c ("x86/mcheck: Split threshold_cpu_callback into two callbacks")
Link: http://lkml.kernel.org/r/20161119103402.5227-1-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-11-21 11:02:12 +01:00
..
Makefile x86/mce: Provide a lockless memory pool to save error records 2015-08-13 10:12:50 +02:00
mce-apei.c x86/mce: Do not use bank 1 for APEI generated error logs 2016-06-14 10:51:14 +02:00
mce-genpool.c x86/mce: Look in genpool instead of mcelog for pending error records 2016-05-03 08:24:16 +02:00
mce-inject.c x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...) 2016-02-03 10:30:03 +01:00
mce-internal.h x86/mce: Look in genpool instead of mcelog for pending error records 2016-05-03 08:24:16 +02:00
mce-severity.c x86/mce: Grade uncorrected errors for SMCA-enabled systems 2016-05-03 08:24:15 +02:00
mce.c x86/mcheck: Move CPU_DEAD to hotplug state machine 2016-11-16 09:34:18 +01:00
mce_amd.c x86/MCE/AMD: Fix thinko about thresholding_en 2016-11-21 11:02:12 +01:00
mce_intel.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
p5.c x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...) 2016-02-03 10:30:03 +01:00
therm_throt.c Linux 4.6-rc4 2016-04-19 10:38:52 +02:00
threshold.c x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...) 2016-02-03 10:30:03 +01:00
winchip.c x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...) 2016-02-03 10:30:03 +01:00