linux_dsm_epyc7002/arch/x86/kernel/cpu/mcheck
Andi Kleen ccc3c3192a x86, mce: implement bootstrapping for machine check wakeups
Machine checks support waking up the mcelog daemon quickly.

The original wake up code for this was pretty ugly, relying on
a idle notifier and a special process flag. The reason it did
it this way is that the machine check handler is not subject
to normal interrupt locking rules so it's not safe
to call wake_up().  Instead it set a process flag
and then either did the wakeup in the syscall return
or in the idle notifier.

This patch adds a new "bootstraping" method as replacement.

The idea is that the handler checks if it's in a state where
it is unsafe to call wake_up(). If it's safe it calls it directly.
When it's not safe -- that is it interrupted in a critical
section with interrupts disables -- it uses a new "self IPI" to trigger
an IPI to its own CPU. This can be done safely because IPI
triggers are atomic with some care. The IPI is raised
once the interrupts are reenabled and can then safely call
wake_up().

When APICs are disabled the event is just queued and will be picked up
eventually by the next polling timer. I think that's a reasonable
compromise, since it should only happen quite rarely.

Contains fixes from Ying Huang.

[ solve conflict on irqinit, make it work on 32bit (entry_arch.h) - HS ]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-03 14:44:05 -07:00
..
k7.c x86, mce: clean up k7.c 2009-05-28 09:24:10 -07:00
Makefile x86, mce: add table driven machine check grading 2009-06-03 14:40:39 -07:00
mce_amd_64.c x86, mce: trivial clean up for mce_amd_64.c 2009-05-28 09:24:16 -07:00
mce_intel_64.c x86, mce: trivial clean up for mce_intel_64.c 2009-05-28 09:24:16 -07:00
mce_intel.c x86, mce: Cleanup symbols in intel thermal codes 2009-05-28 09:24:11 -07:00
mce-inject.c x86, mce: support more than 256 CPUs in struct mce 2009-06-03 14:40:38 -07:00
mce-internal.h x86, mce: add table driven machine check grading 2009-06-03 14:40:39 -07:00
mce-severity.c x86, mce: add table driven machine check grading 2009-06-03 14:40:39 -07:00
mce.c x86, mce: implement bootstrapping for machine check wakeups 2009-06-03 14:44:05 -07:00
mce.h x86, mce: use 64bit machine check code on 32bit 2009-05-28 09:24:13 -07:00
non-fatal.c x86, mce: clean up non-fatal.c 2009-05-28 09:24:10 -07:00
p4.c x86, mce: Cleanup symbols in intel thermal codes 2009-05-28 09:24:11 -07:00
p5.c x86, mce: use 64bit machine check code on 32bit 2009-05-28 09:24:13 -07:00
p6.c x86, mce: clean up p6.c 2009-05-28 09:24:09 -07:00
therm_throt.c x86, mce: trivial clean up for therm_throt.c 2009-05-28 09:24:15 -07:00
threshold.c x86, mce: enable MCE_INTEL for 32bit new MCE 2009-05-28 09:24:13 -07:00
winchip.c x86, mce: clean up winchip.c 2009-05-28 09:24:10 -07:00