x86, mce: add basic error injection infrastructure
commitea149b36c7f511d17dd89fee734cb09778a91fa0
authorAndi Kleen <ak@linux.intel.com>
Wed, 29 Apr 2009 17:31:00 +0000 (29 19:31 +0200)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 28 May 2009 16:24:14 +0000 (28 09:24 -0700)
tree04466a9b92dc5ce01c2ab8661165e3564d99f5c1
parent5f8c1a54cab6f449fe04d42d0661bc796fa4e73e
x86, mce: add basic error injection infrastructure

Allow user programs to write mce records into /dev/mcelog. When they do
that a fake machine check is triggered to test the machine check code.

This uses the MCE MSR wrappers added earlier.

The implementation is straight forward. There is a struct mce record
per CPU and the MCE MSR accesses get data from there if there is valid
data injected there. This allows to test the machine check code
relatively realistically because only the lowest layer of hardware
access is intercepted.

The test suite and injector are available at
git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git
git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/Kconfig
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mcheck/Makefile
arch/x86/kernel/cpu/mcheck/mce-inject.c [new file with mode: 0644]
arch/x86/kernel/cpu/mcheck/mce.c