aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2011-06-07 21:53:35 -0400
committerBorislav Petkov <borislav.petkov@amd.com>2011-06-16 06:09:42 -0400
commita17957cdec69acb9e26319618b95a810a936e637 (patch)
treeceaa2c75a8feeba562b652c58f35c679a1a7fb80 /arch/x86/kernel
parent901d7691d3238ad68c80a567b88b1e5d614137fb (diff)
x86, mce, severity: Cleanup severity table
The current format of an item in this table is: condition(param, ..., level, message [, condition2 ...]) So we have to check both an item's head and tail to find the conditions which match the item. Format them in a more straight forward manner: item(level, message, condition [, condition2 ...]) Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Acked-by: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/4DEED61F.5010502@jp.fujitsu.com Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-severity.c127
1 files changed, 58 insertions, 69 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
index eaf5a43ff082..27e778eac8c6 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -43,116 +43,105 @@ static struct severity {
43 unsigned char covered; 43 unsigned char covered;
44 char *msg; 44 char *msg;
45} severities[] = { 45} severities[] = {
46#define KERNEL .context = IN_KERNEL 46#define MCESEV(s, m, c...) { .sev = MCE_ ## s ## _SEVERITY, .msg = m, ## c }
47#define USER .context = IN_USER 47#define KERNEL .context = IN_KERNEL
48#define SER .ser = SER_REQUIRED 48#define USER .context = IN_USER
49#define NOSER .ser = NO_SER 49#define SER .ser = SER_REQUIRED
50#define SEV(s) .sev = MCE_ ## s ## _SEVERITY 50#define NOSER .ser = NO_SER
51#define BITCLR(x, s, m, r...) { .mask = x, .result = 0, SEV(s), .msg = m, ## r } 51#define BITCLR(x) .mask = x, .result = 0
52#define BITSET(x, s, m, r...) { .mask = x, .result = x, SEV(s), .msg = m, ## r } 52#define BITSET(x) .mask = x, .result = x
53#define MCGMASK(x, res, s, m, r...) \ 53#define MCGMASK(x, y) .mcgmask = x, .mcgres = y
54 { .mcgmask = x, .mcgres = res, SEV(s), .msg = m, ## r } 54#define MASK(x, y) .mask = x, .result = y
55#define MASK(x, y, s, m, r...) \
56 { .mask = x, .result = y, SEV(s), .msg = m, ## r }
57#define MCI_UC_S (MCI_STATUS_UC|MCI_STATUS_S) 55#define MCI_UC_S (MCI_STATUS_UC|MCI_STATUS_S)
58#define MCI_UC_SAR (MCI_STATUS_UC|MCI_STATUS_S|MCI_STATUS_AR) 56#define MCI_UC_SAR (MCI_STATUS_UC|MCI_STATUS_S|MCI_STATUS_AR)
59#define MCACOD 0xffff 57#define MCACOD 0xffff
60 58
61 BITCLR( 59 MCESEV(
62 MCI_STATUS_VAL, 60 NO, "Invalid",
63 NO, "Invalid" 61 BITCLR(MCI_STATUS_VAL)
64 ), 62 ),
65 BITCLR( 63 MCESEV(
66 MCI_STATUS_EN, 64 NO, "Not enabled",
67 NO, "Not enabled" 65 BITCLR(MCI_STATUS_EN)
68 ), 66 ),
69 BITSET( 67 MCESEV(
70 MCI_STATUS_PCC, 68 PANIC, "Processor context corrupt",
71 PANIC, "Processor context corrupt" 69 BITSET(MCI_STATUS_PCC)
72 ), 70 ),
73 /* When MCIP is not set something is very confused */ 71 /* When MCIP is not set something is very confused */
74 MCGMASK( 72 MCESEV(
75 MCG_STATUS_MCIP, 0, 73 PANIC, "MCIP not set in MCA handler",
76 PANIC, "MCIP not set in MCA handler" 74 MCGMASK(MCG_STATUS_MCIP, 0)
77 ), 75 ),
78 /* Neither return not error IP -- no chance to recover -> PANIC */ 76 /* Neither return not error IP -- no chance to recover -> PANIC */
79 MCGMASK( 77 MCESEV(
80 MCG_STATUS_RIPV|MCG_STATUS_EIPV, 0, 78 PANIC, "Neither restart nor error IP",
81 PANIC, "Neither restart nor error IP" 79 MCGMASK(MCG_STATUS_RIPV|MCG_STATUS_EIPV, 0)
82 ), 80 ),
83 MCGMASK( 81 MCESEV(
84 MCG_STATUS_RIPV, 0,
85 PANIC, "In kernel and no restart IP", 82 PANIC, "In kernel and no restart IP",
86 KERNEL 83 KERNEL, MCGMASK(MCG_STATUS_RIPV, 0)
87 ), 84 ),
88 BITCLR( 85 MCESEV(
89 MCI_STATUS_UC,
90 KEEP, "Corrected error", 86 KEEP, "Corrected error",
91 NOSER 87 NOSER, BITCLR(MCI_STATUS_UC)
92 ), 88 ),
93 89
94 /* ignore OVER for UCNA */ 90 /* ignore OVER for UCNA */
95 MASK( 91 MCESEV(
96 MCI_UC_SAR, MCI_STATUS_UC,
97 KEEP, "Uncorrected no action required", 92 KEEP, "Uncorrected no action required",
98 SER 93 SER, MASK(MCI_UC_SAR, MCI_STATUS_UC)
99 ), 94 ),
100 MASK( 95 MCESEV(
101 MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_UC|MCI_STATUS_AR,
102 PANIC, "Illegal combination (UCNA with AR=1)", 96 PANIC, "Illegal combination (UCNA with AR=1)",
103 SER 97 SER,
98 MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_UC|MCI_STATUS_AR)
104 ), 99 ),
105 MASK( 100 MCESEV(
106 MCI_STATUS_S, 0,
107 KEEP, "Non signalled machine check", 101 KEEP, "Non signalled machine check",
108 SER 102 SER, MASK(MCI_STATUS_S, 0)
109 ), 103 ),
110 104
111 /* AR add known MCACODs here */ 105 /* AR add known MCACODs here */
112 MASK( 106 MCESEV(
113 MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_OVER|MCI_UC_SAR,
114 PANIC, "Action required with lost events", 107 PANIC, "Action required with lost events",
115 SER 108 SER,
109 MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_STATUS_OVER|MCI_UC_SAR)
116 ), 110 ),
117 MASK( 111 MCESEV(
118 MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_SAR,
119 PANIC, "Action required; unknown MCACOD", 112 PANIC, "Action required; unknown MCACOD",
120 SER 113 SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_SAR)
121 ), 114 ),
122 115
123 /* known AO MCACODs: */ 116 /* known AO MCACODs: */
124 MASK( 117 MCESEV(
125 MCI_UC_SAR|MCI_STATUS_OVER|0xfff0, MCI_UC_S|0xc0,
126 AO, "Action optional: memory scrubbing error", 118 AO, "Action optional: memory scrubbing error",
127 SER 119 SER, MASK(MCI_UC_SAR|MCI_STATUS_OVER|0xfff0, MCI_UC_S|0xc0)
128 ), 120 ),
129 MASK( 121 MCESEV(
130 MCI_UC_SAR|MCI_STATUS_OVER|MCACOD, MCI_UC_S|0x17a,
131 AO, "Action optional: last level cache writeback error", 122 AO, "Action optional: last level cache writeback error",
132 SER 123 SER, MASK(MCI_UC_SAR|MCI_STATUS_OVER|MCACOD, MCI_UC_S|0x17a)
133 ), 124 ),
134 125 MCESEV(
135 MASK(
136 MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S,
137 SOME, "Action optional unknown MCACOD", 126 SOME, "Action optional unknown MCACOD",
138 SER 127 SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S)
139 ), 128 ),
140 MASK( 129 MCESEV(
141 MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S|MCI_STATUS_OVER,
142 SOME, "Action optional with lost events", 130 SOME, "Action optional with lost events",
143 SER 131 SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR, MCI_UC_S|MCI_STATUS_OVER)
144 ), 132 ),
145 BITSET( 133
146 MCI_STATUS_UC|MCI_STATUS_OVER, 134 MCESEV(
147 PANIC, "Overflowed uncorrected" 135 PANIC, "Overflowed uncorrected",
136 BITSET(MCI_STATUS_UC|MCI_STATUS_OVER)
148 ), 137 ),
149 BITSET( 138 MCESEV(
150 MCI_STATUS_UC, 139 UC, "Uncorrected",
151 UC, "Uncorrected" 140 BITSET(MCI_STATUS_UC)
152 ), 141 ),
153 BITSET( 142 MCESEV(
154 0, 143 SOME, "No match",
155 SOME, "No match" 144 BITSET(0)
156 ) /* always matches. keep at end */ 145 ) /* always matches. keep at end */
157}; 146};
158 147