linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Tony Luck <tony.luck@intel.com>
Cc: Yazen Ghannam <Yazen.Ghannam@amd.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 7/9] x86/mce: Add mce=print_all option
Date: Tue,  7 Apr 2020 18:34:12 +0200	[thread overview]
Message-ID: <20200407163414.18058-8-bp@alien8.de> (raw)
In-Reply-To: <20200407163414.18058-1-bp@alien8.de>

From: Tony Luck <tony.luck@intel.com>

Sometimes, when logs are getting lost, it's nice to just
have everything dumped to the serial console.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200214222720.13168-7-tony.luck@intel.com
---
 arch/x86/kernel/cpu/mce/core.c     | 7 ++++++-
 arch/x86/kernel/cpu/mce/internal.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index fc879b6669d5..4efe6c128887 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -591,7 +591,7 @@ static int mce_default_notifier(struct notifier_block *nb, unsigned long val,
 	if (!m)
 		return NOTIFY_DONE;
 
-	if (!m->kflags)
+	if (mca_cfg.print_all || !m->kflags)
 		__print_mce(m);
 
 	return NOTIFY_DONE;
@@ -1962,6 +1962,7 @@ void mce_disable_bank(int bank)
  * mce=no_cmci Disables CMCI
  * mce=no_lmce Disables LMCE
  * mce=dont_log_ce Clears corrected events silently, no log created for CEs.
+ * mce=print_all Print all machine check logs to console
  * mce=ignore_ce Disables polling and CMCI, corrected events are not cleared.
  * mce=TOLERANCELEVEL[,monarchtimeout] (number, see above)
  *	monarchtimeout is how long to wait for other CPUs on machine
@@ -1990,6 +1991,8 @@ static int __init mcheck_enable(char *str)
 		cfg->lmce_disabled = 1;
 	else if (!strcmp(str, "dont_log_ce"))
 		cfg->dont_log_ce = true;
+	else if (!strcmp(str, "print_all"))
+		cfg->print_all = true;
 	else if (!strcmp(str, "ignore_ce"))
 		cfg->ignore_ce = true;
 	else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
@@ -2256,6 +2259,7 @@ static ssize_t store_int_with_restart(struct device *s,
 static DEVICE_INT_ATTR(tolerant, 0644, mca_cfg.tolerant);
 static DEVICE_INT_ATTR(monarch_timeout, 0644, mca_cfg.monarch_timeout);
 static DEVICE_BOOL_ATTR(dont_log_ce, 0644, mca_cfg.dont_log_ce);
+static DEVICE_BOOL_ATTR(print_all, 0644, mca_cfg.print_all);
 
 static struct dev_ext_attribute dev_attr_check_interval = {
 	__ATTR(check_interval, 0644, device_show_int, store_int_with_restart),
@@ -2280,6 +2284,7 @@ static struct device_attribute *mce_device_attrs[] = {
 #endif
 	&dev_attr_monarch_timeout.attr,
 	&dev_attr_dont_log_ce.attr,
+	&dev_attr_print_all.attr,
 	&dev_attr_ignore_ce.attr,
 	&dev_attr_cmci_disabled.attr,
 	NULL
diff --git a/arch/x86/kernel/cpu/mce/internal.h b/arch/x86/kernel/cpu/mce/internal.h
index 74a01829c4f4..55f5c7b755f2 100644
--- a/arch/x86/kernel/cpu/mce/internal.h
+++ b/arch/x86/kernel/cpu/mce/internal.h
@@ -119,6 +119,7 @@ struct mca_config {
 	bool dont_log_ce;
 	bool cmci_disabled;
 	bool ignore_ce;
+	bool print_all;
 
 	__u64 lmce_disabled		: 1,
 	      disabled			: 1,
-- 
2.21.0


  parent reply	other threads:[~2020-04-07 16:34 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 20:46 [RFC PATCH 0/5] New way to track mce notifier chain actions Tony Luck
2020-02-12 20:46 ` [PATCH 1/5] x86/mce: Rename "first" function as "early" Tony Luck
2020-02-12 20:46 ` [PATCH 2/5] x86/mce: Convert corrected error collector to use mce notifier Tony Luck
2020-02-12 20:46 ` [PATCH 3/5] x86/mce: Add new "handled" field to "struct mce" Tony Luck
2020-02-13 16:56   ` Borislav Petkov
2020-02-13 22:09     ` Luck, Tony
2020-02-14  8:50       ` Borislav Petkov
2020-02-12 20:46 ` [PATCH 4/5] x86/mce: Fix all mce notifiers to update the mce->handled bitmask Tony Luck
2020-02-13 17:03   ` Borislav Petkov
2020-02-13 22:19     ` Luck, Tony
2020-02-13 22:27       ` Andy Lutomirski
2020-02-13 23:08         ` Luck, Tony
2020-02-14  9:02           ` Borislav Petkov
2020-02-14  0:18         ` Thomas Gleixner
2020-02-14  8:59       ` Borislav Petkov
2020-02-12 20:46 ` [PATCH 5/5] x86/mce: Change default mce logger to check mce->handled Tony Luck
2020-02-13 17:08   ` Borislav Petkov
2020-02-13 22:27     ` Luck, Tony
2020-02-14  9:05       ` Borislav Petkov
2020-02-12 23:08 ` [RFC PATCH 0/5] New way to track mce notifier chain actions Luck, Tony
2020-02-13  5:52   ` Andy Lutomirski
2020-02-13  6:09     ` Borislav Petkov
2020-02-13 16:05       ` Andy Lutomirski
2020-02-14 22:27 ` [PATCH v2 0/7] " Tony Luck
2020-02-14 22:27   ` [PATCH v2 1/7] x86/mce: Rename "first" function as "early" Tony Luck
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 2/7] x86/mce: Convert corrected error collector to use mce notifier Tony Luck
2020-04-15  9:49     ` [tip: ras/core] x86/mce: Convert the CEC to use the MCE notifier tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 3/7] x86/mce: Add new "kflags" field to "struct mce" Tony Luck
2020-04-15  9:49     ` [tip: ras/core] x86/mce: Add a struct mce.kflags field tip-bot2 for Tony Luck
2020-04-15 18:19       ` Luck, Tony
2020-04-15 18:36         ` Borislav Petkov
2020-04-15 19:58           ` [PATCH] x86/mce: Drop bogus comment about mce.kflags Luck, Tony
2020-04-17  9:21             ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-04-20  8:06       ` [tip: ras/core] x86/mce: Add a struct mce.kflags field Christoph Hellwig
2020-04-20  8:42         ` Borislav Petkov
2020-02-14 22:27   ` [PATCH v2 4/7] x86/mce: Fix all mce notifiers to update the mce->kflags bitmask Tony Luck
2020-04-07  8:21     ` Borislav Petkov
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 5/7] x86/mce: Change default mce logger to check mce->kflags Tony Luck
2020-04-07 11:10     ` Borislav Petkov
2020-04-07 16:43       ` Luck, Tony
2020-04-07 19:37         ` Borislav Petkov
2020-04-07 19:44           ` Luck, Tony
2020-04-15  9:49     ` [tip: ras/core] x86/mce: Change default MCE " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 6/7] x86/mce: Add mce=print_all option Tony Luck
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 7/7] x86/mce: Drop the EDAC report status checks Tony Luck
2020-04-15  9:49     ` [tip: ras/core] EDAC: " tip-bot2 for Tony Luck
2020-04-07 16:34 ` [PATCH 0/9 v3] New way to track mce notifier chain actions Borislav Petkov
2020-04-07 16:34   ` [PATCH 1/9] x86/mce/amd, edac: Remove report_gart_errors Borislav Petkov
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Borislav Petkov
2020-04-07 16:34   ` [PATCH 2/9] x86/mce: Rename "first" function as "early" Borislav Petkov
2020-04-07 16:34   ` [PATCH 3/9] x86/mce: Convert the CEC to use the MCE notifier Borislav Petkov
2020-04-07 16:34   ` [PATCH 4/9] x86/mce: Add a struct mce.kflags field Borislav Petkov
2020-04-07 16:34   ` [PATCH 5/9] x86/mce: Fix all mce notifiers to update the mce->kflags bitmask Borislav Petkov
2020-04-07 16:34   ` [PATCH 6/9] x86/mce: Change default MCE logger to check mce->kflags Borislav Petkov
2020-04-07 16:34   ` Borislav Petkov [this message]
2020-04-07 16:34   ` [PATCH 8/9] EDAC: Drop the EDAC report status checks Borislav Petkov
2020-04-07 16:34   ` [PATCH 9/9] x86/mce: Fixup exception only for the correct MCEs Borislav Petkov
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Borislav Petkov
2020-04-07 19:53   ` [PATCH 0/9 v3] New way to track mce notifier chain actions Luck, Tony
2020-04-07 19:56     ` Borislav Petkov

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=20200407163414.18058-8-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).