Skip to content

Commit 4350564

Browse files
aeglsuryasaimadhu
authored andcommitted
x86/mce: Add mce=print_all option
Sometimes, when logs are getting lost, it's nice to just have everything dumped to the serial console. Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Tony Luck <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 925946c commit 4350564

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

arch/x86/kernel/cpu/mce/core.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static int mce_default_notifier(struct notifier_block *nb, unsigned long val,
591591
if (!m)
592592
return NOTIFY_DONE;
593593

594-
if (!m->kflags)
594+
if (mca_cfg.print_all || !m->kflags)
595595
__print_mce(m);
596596

597597
return NOTIFY_DONE;
@@ -1962,6 +1962,7 @@ void mce_disable_bank(int bank)
19621962
* mce=no_cmci Disables CMCI
19631963
* mce=no_lmce Disables LMCE
19641964
* mce=dont_log_ce Clears corrected events silently, no log created for CEs.
1965+
* mce=print_all Print all machine check logs to console
19651966
* mce=ignore_ce Disables polling and CMCI, corrected events are not cleared.
19661967
* mce=TOLERANCELEVEL[,monarchtimeout] (number, see above)
19671968
* monarchtimeout is how long to wait for other CPUs on machine
@@ -1990,6 +1991,8 @@ static int __init mcheck_enable(char *str)
19901991
cfg->lmce_disabled = 1;
19911992
else if (!strcmp(str, "dont_log_ce"))
19921993
cfg->dont_log_ce = true;
1994+
else if (!strcmp(str, "print_all"))
1995+
cfg->print_all = true;
19931996
else if (!strcmp(str, "ignore_ce"))
19941997
cfg->ignore_ce = true;
19951998
else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
@@ -2256,6 +2259,7 @@ static ssize_t store_int_with_restart(struct device *s,
22562259
static DEVICE_INT_ATTR(tolerant, 0644, mca_cfg.tolerant);
22572260
static DEVICE_INT_ATTR(monarch_timeout, 0644, mca_cfg.monarch_timeout);
22582261
static DEVICE_BOOL_ATTR(dont_log_ce, 0644, mca_cfg.dont_log_ce);
2262+
static DEVICE_BOOL_ATTR(print_all, 0644, mca_cfg.print_all);
22592263

22602264
static struct dev_ext_attribute dev_attr_check_interval = {
22612265
__ATTR(check_interval, 0644, device_show_int, store_int_with_restart),
@@ -2280,6 +2284,7 @@ static struct device_attribute *mce_device_attrs[] = {
22802284
#endif
22812285
&dev_attr_monarch_timeout.attr,
22822286
&dev_attr_dont_log_ce.attr,
2287+
&dev_attr_print_all.attr,
22832288
&dev_attr_ignore_ce.attr,
22842289
&dev_attr_cmci_disabled.attr,
22852290
NULL

arch/x86/kernel/cpu/mce/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct mca_config {
119119
bool dont_log_ce;
120120
bool cmci_disabled;
121121
bool ignore_ce;
122+
bool print_all;
122123

123124
__u64 lmce_disabled : 1,
124125
disabled : 1,

0 commit comments

Comments
 (0)