aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2009-07-30 21:41:40 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-08-10 16:58:27 -0400
commit5b7e88edc6193f36941bccbfd5ed9ed5fe27d2e1 (patch)
tree2f2cb2ab05cef96bae484d829bef19e925961f52 /arch/x86/include
parentf3a0867b12e0cf1512c0bd0665f2339fc75ed2a8 (diff)
x86, mce: Support specifying context for software mce injection
The cpu context is specified via the new mce.inject_flags fields. This allows more realistic machine check testing in different situations. "RANDOM" context is implemented via NMI broadcasting to add randomization to testing. AK: Fix NMI broadcasting check. Fix 32-bit building. Some race fixes. Move to module. Various changes ChangeLog: v3: - Re-based on latest x86-tip.git/mce4 - Fix 32-bit building v2: - Re-base on latest x86-tip.git/mce3 Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/mce.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index ad7535372918..8945be9ad2b1 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -38,6 +38,13 @@
38#define MCM_ADDR_MEM 3 /* memory address */ 38#define MCM_ADDR_MEM 3 /* memory address */
39#define MCM_ADDR_GENERIC 7 /* generic */ 39#define MCM_ADDR_GENERIC 7 /* generic */
40 40
41#define MCJ_CTX_MASK 3
42#define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK)
43#define MCJ_CTX_RANDOM 0 /* inject context: random */
44#define MCJ_CTX_PROCESS 1 /* inject context: process */
45#define MCJ_CTX_IRQ 2 /* inject context: IRQ */
46#define MCJ_NMI_BROADCAST 4 /* do NMI broadcasting */
47
41/* Fields are zero when not available */ 48/* Fields are zero when not available */
42struct mce { 49struct mce {
43 __u64 status; 50 __u64 status;
@@ -48,8 +55,8 @@ struct mce {
48 __u64 tsc; /* cpu time stamp counter */ 55 __u64 tsc; /* cpu time stamp counter */
49 __u64 time; /* wall time_t when error was detected */ 56 __u64 time; /* wall time_t when error was detected */
50 __u8 cpuvendor; /* cpu vendor as encoded in system.h */ 57 __u8 cpuvendor; /* cpu vendor as encoded in system.h */
51 __u8 pad1; 58 __u8 inject_flags; /* software inject flags */
52 __u16 pad2; 59 __u16 pad;
53 __u32 cpuid; /* CPUID 1 EAX */ 60 __u32 cpuid; /* CPUID 1 EAX */
54 __u8 cs; /* code segment */ 61 __u8 cs; /* code segment */
55 __u8 bank; /* machine check bank */ 62 __u8 bank; /* machine check bank */