Skip to content

Commit

Permalink
x86, mce: Improve timeout error messages
Browse files Browse the repository at this point in the history
There are four different possible types of timeouts.  Distinguish
them in the logs to help debug them.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/0fa6d2653a54a01c48b43a3583caf950ea99606e.1419178397.git.luto@amacapital.net
Signed-off-by: Borislav Petkov <bp@suse.de>
  • Loading branch information
Andy Lutomirski authored and Borislav Petkov committed Dec 22, 2014
1 parent 97bf6af commit 6c80f87
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static void wait_for_panic(void)
panic("Panicing machine check CPU died");
}

static void mce_panic(char *msg, struct mce *final, char *exp)
static void mce_panic(const char *msg, struct mce *final, char *exp)
{
int i, apei_err = 0;

Expand Down Expand Up @@ -735,7 +735,7 @@ static atomic_t mce_callin;
/*
* Check if a timeout waiting for other CPUs happened.
*/
static int mce_timed_out(u64 *t)
static int mce_timed_out(u64 *t, const char *msg)
{
/*
* The others already did panic for some reason.
Expand All @@ -750,8 +750,7 @@ static int mce_timed_out(u64 *t)
goto out;
if ((s64)*t < SPINUNIT) {
if (mca_cfg.tolerant <= 1)
mce_panic("Timeout synchronizing machine check over CPUs",
NULL, NULL);
mce_panic(msg, NULL, NULL);
cpu_missing = 1;
return 1;
}
Expand Down Expand Up @@ -867,7 +866,8 @@ static int mce_start(int *no_way_out)
* Wait for everyone.
*/
while (atomic_read(&mce_callin) != cpus) {
if (mce_timed_out(&timeout)) {
if (mce_timed_out(&timeout,
"Timeout: Not all CPUs entered broadcast exception handler")) {
atomic_set(&global_nwo, 0);
return -1;
}
Expand All @@ -892,7 +892,8 @@ static int mce_start(int *no_way_out)
* only seen by one CPU before cleared, avoiding duplicates.
*/
while (atomic_read(&mce_executing) < order) {
if (mce_timed_out(&timeout)) {
if (mce_timed_out(&timeout,
"Timeout: Subject CPUs unable to finish machine check processing")) {
atomic_set(&global_nwo, 0);
return -1;
}
Expand Down Expand Up @@ -936,7 +937,8 @@ static int mce_end(int order)
* loops.
*/
while (atomic_read(&mce_executing) <= cpus) {
if (mce_timed_out(&timeout))
if (mce_timed_out(&timeout,
"Timeout: Monarch CPU unable to finish machine check processing"))
goto reset;
ndelay(SPINUNIT);
}
Expand All @@ -949,7 +951,8 @@ static int mce_end(int order)
* Subject: Wait for Monarch to finish.
*/
while (atomic_read(&mce_executing) != 0) {
if (mce_timed_out(&timeout))
if (mce_timed_out(&timeout,
"Timeout: Monarch CPU did not finish machine check processing"))
goto reset;
ndelay(SPINUNIT);
}
Expand Down

0 comments on commit 6c80f87

Please sign in to comment.