linux-kernel-test/arch
Tim Hockin bd78432c8f x86_64: mcelog tolerant level cleanup
Background:
 The MCE handler has several paths that it can take, depending on various
 conditions of the MCE status and the value of the 'tolerant' knob.  The
 exact semantics are not well defined and the code is a bit twisty.

Description:
 This patch makes the MCE handler's behavior more clear by documenting the
 behavior for various 'tolerant' levels.  It also fixes or enhances
 several small things in the handler.  Specifically:
     * If RIPV is set it is not safe to restart, so set the 'no way out'
       flag rather than the 'kill it' flag.
     * Don't panic() on correctable MCEs.
     * If the _OVER bit is set *and* the _UC bit is set (meaning possibly
       dropped uncorrected errors), set the 'no way out' flag.
     * Use EIPV for testing whether an app can be killed (SIGBUS) rather
       than RIPV.  According to docs, EIPV indicates that the error is
       related to the IP, while RIPV simply means the IP is valid to
       restart from.
     * Don't clear the MCi_STATUS registers until after the panic() path.
       This leaves the status bits set after the panic() so clever BIOSes
       can find them (and dumb BIOSes can do nothing).

 This patch also calls nonseekable_open() in mce_open (as suggested by akpm).

Result:
 Tolerant levels behave almost identically to how they always have, but
 not it's well defined.  There's a slightly higher chance of panic()ing
 when multiple errors happen (a good thing, IMHO).  If you take an MBE and
 panic(), the error status bits are not cleared.

Alternatives:
 None.

Testing:
 I used software to inject correctable and uncorrectable errors.  With
 tolerant = 3, the system usually survives.  With tolerant = 2, the system
 usually panic()s (PCC) but not always.  With tolerant = 1, the system
 always panic()s.  When the system panic()s, the BIOS is able to detect
 that the cause of death was an MC4.  I was not able to reproduce the
 case of a non-PCC error in userspace, with EIPV, with (tolerant < 3).
 That will be rare at best.

Signed-off-by: Tim Hockin <thockin@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21 18:37:10 -07:00
..
alpha some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
arm clockevents: fix resume logic 2007-07-21 17:49:15 -07:00
arm26 mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
avr32 mm: fault feedback #2 2007-07-19 10:04:41 -07:00
blackfin some kmalloc/memset ->kzalloc (tree wide) 2007-07-19 10:04:50 -07:00
cris Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-07-19 14:28:19 -07:00
frv FRV: work around a possible compiler bug 2007-07-19 10:04:50 -07:00
h8300 PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
i386 i386: insert unclaimed MMCONFIG resources 2007-07-21 18:37:10 -07:00
ia64 revert "PIE randomization" 2007-07-21 17:49:14 -07:00
m32r Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6 2007-07-19 14:24:57 -07:00
m68k m68k: exclude more unbuildable drivers 2007-07-20 08:24:49 -07:00
m68knommu m68knommu: reformat show_cpuinfo() 2007-07-20 08:44:20 -07:00
mips [MIPS] User stack pointer randomisation 2007-07-20 18:57:40 +01:00
parisc define new percpu interface for shared data 2007-07-19 10:04:44 -07:00
powerpc spufs: make signal-notification files readonly for NOSCHED contexts 2007-07-21 17:49:16 -07:00
ppc Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6 2007-07-19 14:24:57 -07:00
s390 s390: Put allocated ELF notes in read-only data segment 2007-07-19 10:04:47 -07:00
sh clockevents: fix resume logic 2007-07-21 17:49:15 -07:00
sh64 sh64: Flag sh64_get_page() as __init_refok. 2007-07-20 17:46:42 +09:00
sparc [SPARC]: Make sure dev_archdata is filled in for all devices. 2007-07-20 17:13:42 -07:00
sparc64 NTP: move the cmos update code into ntp.c 2007-07-21 17:49:15 -07:00
um fallout from kbuild changes 2007-07-19 18:37:54 -07:00
v850 PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
x86_64 x86_64: mcelog tolerant level cleanup 2007-07-21 18:37:10 -07:00
xtensa Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-07-19 14:28:19 -07:00