diff options
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce-severity.c')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-severity.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c index 0c82091b165..1ccd453903d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-severity.c +++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c | |||
@@ -165,15 +165,19 @@ static struct severity { | |||
165 | }; | 165 | }; |
166 | 166 | ||
167 | /* | 167 | /* |
168 | * If the EIPV bit is set, it means the saved IP is the | 168 | * If mcgstatus indicated that ip/cs on the stack were |
169 | * instruction which caused the MCE. | 169 | * no good, then "m->cs" will be zero and we will have |
170 | * to assume the worst case (IN_KERNEL) as we actually | ||
171 | * have no idea what we were executing when the machine | ||
172 | * check hit. | ||
173 | * If we do have a good "m->cs" (or a faked one in the | ||
174 | * case we were executing in VM86 mode) we can use it to | ||
175 | * distinguish an exception taken in user from from one | ||
176 | * taken in the kernel. | ||
170 | */ | 177 | */ |
171 | static int error_context(struct mce *m) | 178 | static int error_context(struct mce *m) |
172 | { | 179 | { |
173 | if (m->mcgstatus & MCG_STATUS_EIPV) | 180 | return ((m->cs & 3) == 3) ? IN_USER : IN_KERNEL; |
174 | return (m->ip && (m->cs & 3) == 3) ? IN_USER : IN_KERNEL; | ||
175 | /* Unknown, assume kernel */ | ||
176 | return IN_KERNEL; | ||
177 | } | 181 | } |
178 | 182 | ||
179 | int mce_severity(struct mce *m, int tolerant, char **msg) | 183 | int mce_severity(struct mce *m, int tolerant, char **msg) |