diff options
author | Andi Kleen <andi@firstfloor.org> | 2009-05-27 15:56:58 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-06-03 17:45:34 -0400 |
commit | 86503560e48153aba539ff117450d31ab2ef76d7 (patch) | |
tree | 56e892d3dfa3a332237bb521bf5d25c8f5c680af /arch/x86/kernel/cpu/mcheck | |
parent | 29b0f591d678838435fbb3e15ef20266f1a9e01d (diff) |
x86, mce: print header/footer only once for multiple MCEs
When multiple MCEs are printed print the "HARDWARE ERROR" header
and "This is not a software error" footer only once. This
makes the output much more compact with many CPUs.
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>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 79d243145b8f..ff9c732989de 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -176,11 +176,13 @@ void mce_log(struct mce *mce) | |||
176 | set_bit(0, ¬ify_user); | 176 | set_bit(0, ¬ify_user); |
177 | } | 177 | } |
178 | 178 | ||
179 | static void print_mce(struct mce *m) | 179 | static void print_mce(struct mce *m, int *first) |
180 | { | 180 | { |
181 | printk(KERN_EMERG "\n" | 181 | if (*first) { |
182 | KERN_EMERG "HARDWARE ERROR\n" | 182 | printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n"); |
183 | KERN_EMERG | 183 | *first = 0; |
184 | } | ||
185 | printk(KERN_EMERG | ||
184 | "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n", | 186 | "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n", |
185 | m->extcpu, m->mcgstatus, m->bank, m->status); | 187 | m->extcpu, m->mcgstatus, m->bank, m->status); |
186 | if (m->ip) { | 188 | if (m->ip) { |
@@ -200,9 +202,12 @@ static void print_mce(struct mce *m) | |||
200 | printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", | 202 | printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", |
201 | m->cpuvendor, m->cpuid, m->time, m->socketid, | 203 | m->cpuvendor, m->cpuid, m->time, m->socketid, |
202 | m->apicid); | 204 | m->apicid); |
203 | printk(KERN_EMERG "This is not a software problem!\n"); | 205 | } |
204 | printk(KERN_EMERG "Run through mcelog --ascii to decode " | 206 | |
205 | "and contact your hardware vendor\n"); | 207 | static void print_mce_tail(void) |
208 | { | ||
209 | printk(KERN_EMERG "This is not a software problem!\n" | ||
210 | KERN_EMERG "Run through mcelog --ascii to decode and contact your hardware vendor\n"); | ||
206 | } | 211 | } |
207 | 212 | ||
208 | #define PANIC_TIMEOUT 5 /* 5 seconds */ | 213 | #define PANIC_TIMEOUT 5 /* 5 seconds */ |
@@ -225,6 +230,7 @@ static void wait_for_panic(void) | |||
225 | static void mce_panic(char *msg, struct mce *final, char *exp) | 230 | static void mce_panic(char *msg, struct mce *final, char *exp) |
226 | { | 231 | { |
227 | int i; | 232 | int i; |
233 | int first = 1; | ||
228 | 234 | ||
229 | /* | 235 | /* |
230 | * Make sure only one CPU runs in machine check panic | 236 | * Make sure only one CPU runs in machine check panic |
@@ -240,7 +246,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp) | |||
240 | struct mce *m = &mcelog.entry[i]; | 246 | struct mce *m = &mcelog.entry[i]; |
241 | if ((m->status & MCI_STATUS_VAL) && | 247 | if ((m->status & MCI_STATUS_VAL) && |
242 | !(m->status & MCI_STATUS_UC)) | 248 | !(m->status & MCI_STATUS_UC)) |
243 | print_mce(m); | 249 | print_mce(m, &first); |
244 | } | 250 | } |
245 | /* Now print uncorrected but with the final one last */ | 251 | /* Now print uncorrected but with the final one last */ |
246 | for (i = 0; i < MCE_LOG_LEN; i++) { | 252 | for (i = 0; i < MCE_LOG_LEN; i++) { |
@@ -248,12 +254,13 @@ static void mce_panic(char *msg, struct mce *final, char *exp) | |||
248 | if (!(m->status & MCI_STATUS_VAL)) | 254 | if (!(m->status & MCI_STATUS_VAL)) |
249 | continue; | 255 | continue; |
250 | if (!final || memcmp(m, final, sizeof(struct mce))) | 256 | if (!final || memcmp(m, final, sizeof(struct mce))) |
251 | print_mce(m); | 257 | print_mce(m, &first); |
252 | } | 258 | } |
253 | if (final) | 259 | if (final) |
254 | print_mce(final); | 260 | print_mce(final, &first); |
255 | if (cpu_missing) | 261 | if (cpu_missing) |
256 | printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n"); | 262 | printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n"); |
263 | print_mce_tail(); | ||
257 | if (exp) | 264 | if (exp) |
258 | printk(KERN_EMERG "Machine check: %s\n", exp); | 265 | printk(KERN_EMERG "Machine check: %s\n", exp); |
259 | if (panic_timeout == 0) | 266 | if (panic_timeout == 0) |