aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mcheck/mce.c
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-12-21 11:18:25 -0500
committerBorislav Petkov <bp@suse.de>2014-12-22 11:47:45 -0500
commit6c80f87ed4483bff0ecbf4455a1b09e7f950e9ab (patch)
treedde17d59940c22fd139e090a4e2288595a504464 /arch/x86/kernel/cpu/mcheck/mce.c
parent97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff)
x86, mce: Improve timeout error messages
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>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce.c')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index d2c611699cd9..323e02c658af 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -311,7 +311,7 @@ static void wait_for_panic(void)
311 panic("Panicing machine check CPU died"); 311 panic("Panicing machine check CPU died");
312} 312}
313 313
314static void mce_panic(char *msg, struct mce *final, char *exp) 314static void mce_panic(const char *msg, struct mce *final, char *exp)
315{ 315{
316 int i, apei_err = 0; 316 int i, apei_err = 0;
317 317
@@ -735,7 +735,7 @@ static atomic_t mce_callin;
735/* 735/*
736 * Check if a timeout waiting for other CPUs happened. 736 * Check if a timeout waiting for other CPUs happened.
737 */ 737 */
738static int mce_timed_out(u64 *t) 738static int mce_timed_out(u64 *t, const char *msg)
739{ 739{
740 /* 740 /*
741 * The others already did panic for some reason. 741 * The others already did panic for some reason.
@@ -750,8 +750,7 @@ static int mce_timed_out(u64 *t)
750 goto out; 750 goto out;
751 if ((s64)*t < SPINUNIT) { 751 if ((s64)*t < SPINUNIT) {
752 if (mca_cfg.tolerant <= 1) 752 if (mca_cfg.tolerant <= 1)
753 mce_panic("Timeout synchronizing machine check over CPUs", 753 mce_panic(msg, NULL, NULL);
754 NULL, NULL);
755 cpu_missing = 1; 754 cpu_missing = 1;
756 return 1; 755 return 1;
757 } 756 }
@@ -867,7 +866,8 @@ static int mce_start(int *no_way_out)
867 * Wait for everyone. 866 * Wait for everyone.
868 */ 867 */
869 while (atomic_read(&mce_callin) != cpus) { 868 while (atomic_read(&mce_callin) != cpus) {
870 if (mce_timed_out(&timeout)) { 869 if (mce_timed_out(&timeout,
870 "Timeout: Not all CPUs entered broadcast exception handler")) {
871 atomic_set(&global_nwo, 0); 871 atomic_set(&global_nwo, 0);
872 return -1; 872 return -1;
873 } 873 }
@@ -892,7 +892,8 @@ static int mce_start(int *no_way_out)
892 * only seen by one CPU before cleared, avoiding duplicates. 892 * only seen by one CPU before cleared, avoiding duplicates.
893 */ 893 */
894 while (atomic_read(&mce_executing) < order) { 894 while (atomic_read(&mce_executing) < order) {
895 if (mce_timed_out(&timeout)) { 895 if (mce_timed_out(&timeout,
896 "Timeout: Subject CPUs unable to finish machine check processing")) {
896 atomic_set(&global_nwo, 0); 897 atomic_set(&global_nwo, 0);
897 return -1; 898 return -1;
898 } 899 }
@@ -936,7 +937,8 @@ static int mce_end(int order)
936 * loops. 937 * loops.
937 */ 938 */
938 while (atomic_read(&mce_executing) <= cpus) { 939 while (atomic_read(&mce_executing) <= cpus) {
939 if (mce_timed_out(&timeout)) 940 if (mce_timed_out(&timeout,
941 "Timeout: Monarch CPU unable to finish machine check processing"))
940 goto reset; 942 goto reset;
941 ndelay(SPINUNIT); 943 ndelay(SPINUNIT);
942 } 944 }
@@ -949,7 +951,8 @@ static int mce_end(int order)
949 * Subject: Wait for Monarch to finish. 951 * Subject: Wait for Monarch to finish.
950 */ 952 */
951 while (atomic_read(&mce_executing) != 0) { 953 while (atomic_read(&mce_executing) != 0) {
952 if (mce_timed_out(&timeout)) 954 if (mce_timed_out(&timeout,
955 "Timeout: Monarch CPU did not finish machine check processing"))
953 goto reset; 956 goto reset;
954 ndelay(SPINUNIT); 957 ndelay(SPINUNIT);
955 } 958 }