提交 78fbe8f6 编写于 作者: T Tony Luck 提交者: Caspar Zhang

x86/mce: Add mce=print_all option

fix #29415191

commit 43505646941bee217b91d064756975aa1ab6ee3b upstream

Sometimes, when logs are getting lost, it's nice to just
have everything dumped to the serial console.
Signed-off-by: NTony Luck <tony.luck@intel.com>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Tested-by: NTony Luck <tony.luck@intel.com>
Link: https://lkml.kernel.org/r/20200214222720.13168-7-tony.luck@intel.comSigned-off-by: NYouquan Song <youquan.song@intel.com>
Signed-off-by: NWetp Zhang <wetp.zy@linux.alibaba.com>
Reviewed-by: NArtie Ding <artie.ding@linux.alibaba.com>
上级 b3029f49
...@@ -117,6 +117,7 @@ struct mca_config { ...@@ -117,6 +117,7 @@ struct mca_config {
bool dont_log_ce; bool dont_log_ce;
bool cmci_disabled; bool cmci_disabled;
bool ignore_ce; bool ignore_ce;
bool print_all;
__u64 lmce_disabled : 1, __u64 lmce_disabled : 1,
disabled : 1, disabled : 1,
......
...@@ -623,7 +623,7 @@ static int mce_default_notifier(struct notifier_block *nb, unsigned long val, ...@@ -623,7 +623,7 @@ static int mce_default_notifier(struct notifier_block *nb, unsigned long val,
if (!m) if (!m)
return NOTIFY_DONE; return NOTIFY_DONE;
if (!m->kflags) if (mca_cfg.print_all || !m->kflags)
__print_mce(m); __print_mce(m);
return NOTIFY_DONE; return NOTIFY_DONE;
...@@ -1895,6 +1895,7 @@ void mce_disable_bank(int bank) ...@@ -1895,6 +1895,7 @@ void mce_disable_bank(int bank)
* mce=no_cmci Disables CMCI * mce=no_cmci Disables CMCI
* mce=no_lmce Disables LMCE * mce=no_lmce Disables LMCE
* mce=dont_log_ce Clears corrected events silently, no log created for CEs. * 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=ignore_ce Disables polling and CMCI, corrected events are not cleared.
* mce=TOLERANCELEVEL[,monarchtimeout] (number, see above) * mce=TOLERANCELEVEL[,monarchtimeout] (number, see above)
* monarchtimeout is how long to wait for other CPUs on machine * monarchtimeout is how long to wait for other CPUs on machine
...@@ -1923,6 +1924,8 @@ static int __init mcheck_enable(char *str) ...@@ -1923,6 +1924,8 @@ static int __init mcheck_enable(char *str)
cfg->lmce_disabled = 1; cfg->lmce_disabled = 1;
else if (!strcmp(str, "dont_log_ce")) else if (!strcmp(str, "dont_log_ce"))
cfg->dont_log_ce = true; cfg->dont_log_ce = true;
else if (!strcmp(str, "print_all"))
cfg->print_all = true;
else if (!strcmp(str, "ignore_ce")) else if (!strcmp(str, "ignore_ce"))
cfg->ignore_ce = true; cfg->ignore_ce = true;
else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog")) else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
...@@ -2166,6 +2169,7 @@ static ssize_t store_int_with_restart(struct device *s, ...@@ -2166,6 +2169,7 @@ static ssize_t store_int_with_restart(struct device *s,
static DEVICE_INT_ATTR(tolerant, 0644, mca_cfg.tolerant); static DEVICE_INT_ATTR(tolerant, 0644, mca_cfg.tolerant);
static DEVICE_INT_ATTR(monarch_timeout, 0644, mca_cfg.monarch_timeout); 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(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 = { static struct dev_ext_attribute dev_attr_check_interval = {
__ATTR(check_interval, 0644, device_show_int, store_int_with_restart), __ATTR(check_interval, 0644, device_show_int, store_int_with_restart),
...@@ -2190,6 +2194,7 @@ static struct device_attribute *mce_device_attrs[] = { ...@@ -2190,6 +2194,7 @@ static struct device_attribute *mce_device_attrs[] = {
#endif #endif
&dev_attr_monarch_timeout.attr, &dev_attr_monarch_timeout.attr,
&dev_attr_dont_log_ce.attr, &dev_attr_dont_log_ce.attr,
&dev_attr_print_all.attr,
&dev_attr_ignore_ce.attr, &dev_attr_ignore_ce.attr,
&dev_attr_cmci_disabled.attr, &dev_attr_cmci_disabled.attr,
NULL NULL
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册