public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jin Dongming <jin.dongming@np.css.fujitsu.com>
To: "H.Peter Anvin" <hpa@zytor.com>
Cc: LKLM <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Andi Kleen <ak@linux.intel.com>,
	Huang Ying <ying.huang@intel.com>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Subject: [PATCH] x86, mce: reset kernel for no-match exception errors
Date: Thu, 27 Aug 2009 17:41:06 +0900	[thread overview]
Message-ID: <4A9646A2.6080605@np.css.fujitsu.com> (raw)

The last case of severity table is used for no match exception error.
Maybe such kind of error could not happen. But I think when the error
really happened, the kernel should be reset. Because such error is
unknown and unexpected. So I make this patch for fixing this problem.

This patch is based on tip/x86/mce.

Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
---
 arch/x86/kernel/cpu/mcheck/mce-severity.c |    2 +-
 arch/x86/kernel/cpu/mcheck/mce.c          |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
index bc35a07..092755b 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -97,7 +97,7 @@ static struct severity {
 	     "Action optional with lost events", SER),
 	BITSET(MCI_STATUS_UC|MCI_STATUS_OVER, PANIC, "Overflowed uncorrected"),
 	BITSET(MCI_STATUS_UC, UC, "Uncorrected"),
-	BITSET(0, SOME, "No match")	/* always matches. keep at end */
+	BITSET(0, PANIC, "Unknown Error")     /* always matches. keep at end */
 };
 
 /*
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 2c3bcd1..cc6e9cb 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -245,6 +245,12 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
 		struct mce *m = &mcelog.entry[i];
 		if (!(m->status & MCI_STATUS_VAL))
 			continue;
+		/*
+		 * When no-match error happened, it is a corrected error and
+		 * logged as final one. Prevents it from being printed twice.
+		 */
+		if (final && !memcmp(m, final, sizeof(struct mce)))
+			continue;
 		if (!(m->status & MCI_STATUS_UC))
 			print_mce(m);
 	}
-- 
1.6.2.2


             reply	other threads:[~2009-08-27  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27  8:41 Jin Dongming [this message]
2009-08-27  9:08 ` [PATCH] x86, mce: reset kernel for no-match exception errors Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9646A2.6080605@np.css.fujitsu.com \
    --to=jin.dongming@np.css.fujitsu.com \
    --cc=ak@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox