aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2009-07-30 21:41:41 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-08-10 16:58:41 -0400
commit0dcc66851f1091af421416c28a9458836885f522 (patch)
tree7dd11e406c501068a50d5e3f1fc272262445c519 /arch/x86/kernel
parent5b7e88edc6193f36941bccbfd5ed9ed5fe27d2e1 (diff)
x86, mce: Support specifying raise mode for software MCE injection
Raise mode include raising as exception or raising as poll, it is specified via the mce.inject_flags field. This can be used to specify raise mode of UCNA, which is UC error but raised not as exception. And this can be used to test the filter code of poll handler or exception handler too. For example, enforce a poll raise mode for a fatal MCE. ChangeLog: v2: - Re-base on latest x86-tip.git/mce3 Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-inject.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index ad5d92790ebc..7029f0e2acad 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -44,7 +44,7 @@ static void inject_mce(struct mce *m)
44 i->finished = 1; 44 i->finished = 1;
45} 45}
46 46
47static void raise_corrected(struct mce *m) 47static void raise_poll(struct mce *m)
48{ 48{
49 unsigned long flags; 49 unsigned long flags;
50 mce_banks_t b; 50 mce_banks_t b;
@@ -56,7 +56,7 @@ static void raise_corrected(struct mce *m)
56 m->finished = 0; 56 m->finished = 0;
57} 57}
58 58
59static void raise_uncorrected(struct mce *m, struct pt_regs *pregs) 59static void raise_exception(struct mce *m, struct pt_regs *pregs)
60{ 60{
61 struct pt_regs regs; 61 struct pt_regs regs;
62 unsigned long flags; 62 unsigned long flags;
@@ -85,10 +85,10 @@ static int mce_raise_notify(struct notifier_block *self,
85 if (val != DIE_NMI_IPI || !cpu_isset(cpu, mce_inject_cpumask)) 85 if (val != DIE_NMI_IPI || !cpu_isset(cpu, mce_inject_cpumask))
86 return NOTIFY_DONE; 86 return NOTIFY_DONE;
87 cpu_clear(cpu, mce_inject_cpumask); 87 cpu_clear(cpu, mce_inject_cpumask);
88 if (m->status & MCI_STATUS_UC) 88 if (m->inject_flags & MCJ_EXCEPTION)
89 raise_uncorrected(m, args->regs); 89 raise_exception(m, args->regs);
90 else if (m->status) 90 else if (m->status)
91 raise_corrected(m); 91 raise_poll(m);
92 return NOTIFY_STOP; 92 return NOTIFY_STOP;
93} 93}
94 94
@@ -104,7 +104,7 @@ static int raise_local(struct mce *m)
104 int ret = 0; 104 int ret = 0;
105 int cpu = m->extcpu; 105 int cpu = m->extcpu;
106 106
107 if (m->status & MCI_STATUS_UC) { 107 if (m->inject_flags & MCJ_EXCEPTION) {
108 printk(KERN_INFO "Triggering MCE exception on CPU %d\n", cpu); 108 printk(KERN_INFO "Triggering MCE exception on CPU %d\n", cpu);
109 switch (context) { 109 switch (context) {
110 case MCJ_CTX_IRQ: 110 case MCJ_CTX_IRQ:
@@ -115,7 +115,7 @@ static int raise_local(struct mce *m)
115 */ 115 */
116 /*FALL THROUGH*/ 116 /*FALL THROUGH*/
117 case MCJ_CTX_PROCESS: 117 case MCJ_CTX_PROCESS:
118 raise_uncorrected(m, NULL); 118 raise_exception(m, NULL);
119 break; 119 break;
120 default: 120 default:
121 printk(KERN_INFO "Invalid MCE context\n"); 121 printk(KERN_INFO "Invalid MCE context\n");
@@ -124,7 +124,7 @@ static int raise_local(struct mce *m)
124 printk(KERN_INFO "MCE exception done on CPU %d\n", cpu); 124 printk(KERN_INFO "MCE exception done on CPU %d\n", cpu);
125 } else if (m->status) { 125 } else if (m->status) {
126 printk(KERN_INFO "Starting machine check poll CPU %d\n", cpu); 126 printk(KERN_INFO "Starting machine check poll CPU %d\n", cpu);
127 raise_corrected(m); 127 raise_poll(m);
128 mce_notify_irq(); 128 mce_notify_irq();
129 printk(KERN_INFO "Machine check poll done on CPU %d\n", cpu); 129 printk(KERN_INFO "Machine check poll done on CPU %d\n", cpu);
130 } else 130 } else