12 #include <linux/kernel.h>
35 static struct severity {
39 unsigned char mcgmask;
43 unsigned char covered;
46 #define MCESEV(s, m, c...) { .sev = MCE_ ## s ## _SEVERITY, .msg = m, ## c }
47 #define KERNEL .context = IN_KERNEL
48 #define USER .context = IN_USER
49 #define SER .ser = SER_REQUIRED
50 #define NOSER .ser = NO_SER
51 #define BITCLR(x) .mask = x, .result = 0
52 #define BITSET(x) .mask = x, .result = x
53 #define MCGMASK(x, y) .mcgmask = x, .mcgres = y
54 #define MASK(x, y) .mask = x, .result = y
55 #define MCI_UC_S (MCI_STATUS_UC|MCI_STATUS_S)
56 #define MCI_UC_SAR (MCI_STATUS_UC|MCI_STATUS_S|MCI_STATUS_AR)
57 #define MCI_ADDR (MCI_STATUS_ADDRV|MCI_STATUS_MISCV)
68 PANIC,
"Processor context corrupt",
73 PANIC,
"MCIP not set in MCA handler",
78 PANIC,
"Neither restart nor error IP",
82 PANIC,
"In kernel and no restart IP",
86 KEEP,
"Corrected error",
92 KEEP,
"Uncorrected no action required",
96 PANIC,
"Illegal combination (UCNA with AR=1)",
101 KEEP,
"Non signalled machine check",
106 PANIC,
"Action required with lost events",
111 #ifdef CONFIG_MEMORY_FAILURE
113 KEEP,
"HT thread notices Action required: data load error",
118 AR,
"Action required: data load error",
123 KEEP,
"HT thread notices Action required: instruction fetch error",
128 AR,
"Action required: instruction fetch error",
134 PANIC,
"Action required: unknown MCACOD",
140 AO,
"Action optional: memory scrubbing error",
144 AO,
"Action optional: last level cache writeback error",
148 SOME,
"Action optional: unknown MCACOD",
152 SOME,
"Action optional with lost events",
157 PANIC,
"Overflowed uncorrected",
181 static int error_context(
struct mce *
m)
191 for (s = severities;; s++) {
192 if ((m->
status & s->mask) != s->result)
194 if ((m->
mcgstatus & s->mcgmask) != s->mcgres)
200 if (s->context && ctx != s->context)
213 #ifdef CONFIG_DEBUG_FS
218 return &severities[*
pos];
221 static void *s_next(
struct seq_file *f,
void *
data, loff_t *pos)
225 return &severities[*
pos];
228 static void s_stop(
struct seq_file *f,
void *data)
232 static int s_show(
struct seq_file *f,
void *data)
235 seq_printf(f,
"%d\t%s\n", ser->covered, ser->msg);
248 return seq_open(file, &severities_seq_ops);
252 const char __user *ubuf,
253 size_t count, loff_t *ppos)
257 severities[i].covered = 0;
262 .
open = severities_coverage_open,
265 .write = severities_coverage_write,
269 static int __init severities_debugfs_init(
void)
271 struct dentry *dmce, *fsev;
278 &severities_coverage_fops);