diff options
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index d5cb0b4c17ff..a7dc369a9974 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -306,21 +306,22 @@ int mce_available(struct cpuinfo_x86 *c) | |||
306 | return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA); | 306 | return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA); |
307 | } | 307 | } |
308 | 308 | ||
309 | /* | ||
310 | * Get the address of the instruction at the time of the machine check | ||
311 | * error. | ||
312 | */ | ||
309 | static inline void mce_get_rip(struct mce *m, struct pt_regs *regs) | 313 | static inline void mce_get_rip(struct mce *m, struct pt_regs *regs) |
310 | { | 314 | { |
311 | if (regs && (m->mcgstatus & MCG_STATUS_RIPV)) { | 315 | |
316 | if (regs && (m->mcgstatus & (MCG_STATUS_RIPV|MCG_STATUS_EIPV))) { | ||
312 | m->ip = regs->ip; | 317 | m->ip = regs->ip; |
313 | m->cs = regs->cs; | 318 | m->cs = regs->cs; |
314 | } else { | 319 | } else { |
315 | m->ip = 0; | 320 | m->ip = 0; |
316 | m->cs = 0; | 321 | m->cs = 0; |
317 | } | 322 | } |
318 | if (rip_msr) { | 323 | if (rip_msr) |
319 | /* Assume the RIP in the MSR is exact. Is this true? */ | ||
320 | m->mcgstatus |= MCG_STATUS_EIPV; | ||
321 | m->ip = mce_rdmsrl(rip_msr); | 324 | m->ip = mce_rdmsrl(rip_msr); |
322 | m->cs = 0; | ||
323 | } | ||
324 | } | 325 | } |
325 | 326 | ||
326 | #ifdef CONFIG_X86_LOCAL_APIC | 327 | #ifdef CONFIG_X86_LOCAL_APIC |