提交 86503560 编写于 作者: A Andi Kleen 提交者: H. Peter Anvin

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: NAndi Kleen <ak@linux.intel.com>
Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
上级 29b0f591
...@@ -176,11 +176,13 @@ void mce_log(struct mce *mce) ...@@ -176,11 +176,13 @@ void mce_log(struct mce *mce)
set_bit(0, &notify_user); set_bit(0, &notify_user);
} }
static void print_mce(struct mce *m) static void print_mce(struct mce *m, int *first)
{ {
printk(KERN_EMERG "\n" if (*first) {
KERN_EMERG "HARDWARE ERROR\n" printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
KERN_EMERG *first = 0;
}
printk(KERN_EMERG
"CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n", "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
m->extcpu, m->mcgstatus, m->bank, m->status); m->extcpu, m->mcgstatus, m->bank, m->status);
if (m->ip) { if (m->ip) {
...@@ -200,9 +202,12 @@ static void print_mce(struct mce *m) ...@@ -200,9 +202,12 @@ static void print_mce(struct mce *m)
printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n",
m->cpuvendor, m->cpuid, m->time, m->socketid, m->cpuvendor, m->cpuid, m->time, m->socketid,
m->apicid); m->apicid);
printk(KERN_EMERG "This is not a software problem!\n"); }
printk(KERN_EMERG "Run through mcelog --ascii to decode "
"and contact your hardware vendor\n"); static void print_mce_tail(void)
{
printk(KERN_EMERG "This is not a software problem!\n"
KERN_EMERG "Run through mcelog --ascii to decode and contact your hardware vendor\n");
} }
#define PANIC_TIMEOUT 5 /* 5 seconds */ #define PANIC_TIMEOUT 5 /* 5 seconds */
...@@ -225,6 +230,7 @@ static void wait_for_panic(void) ...@@ -225,6 +230,7 @@ static void wait_for_panic(void)
static void mce_panic(char *msg, struct mce *final, char *exp) static void mce_panic(char *msg, struct mce *final, char *exp)
{ {
int i; int i;
int first = 1;
/* /*
* Make sure only one CPU runs in machine check panic * 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,7 +246,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
struct mce *m = &mcelog.entry[i]; struct mce *m = &mcelog.entry[i];
if ((m->status & MCI_STATUS_VAL) && if ((m->status & MCI_STATUS_VAL) &&
!(m->status & MCI_STATUS_UC)) !(m->status & MCI_STATUS_UC))
print_mce(m); print_mce(m, &first);
} }
/* Now print uncorrected but with the final one last */ /* Now print uncorrected but with the final one last */
for (i = 0; i < MCE_LOG_LEN; i++) { for (i = 0; i < MCE_LOG_LEN; i++) {
...@@ -248,12 +254,13 @@ static void mce_panic(char *msg, struct mce *final, char *exp) ...@@ -248,12 +254,13 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
if (!(m->status & MCI_STATUS_VAL)) if (!(m->status & MCI_STATUS_VAL))
continue; continue;
if (!final || memcmp(m, final, sizeof(struct mce))) if (!final || memcmp(m, final, sizeof(struct mce)))
print_mce(m); print_mce(m, &first);
} }
if (final) if (final)
print_mce(final); print_mce(final, &first);
if (cpu_missing) if (cpu_missing)
printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n"); printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
print_mce_tail();
if (exp) if (exp)
printk(KERN_EMERG "Machine check: %s\n", exp); printk(KERN_EMERG "Machine check: %s\n", exp);
if (panic_timeout == 0) if (panic_timeout == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册