2 * P5 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
5 #include <linux/interrupt.h>
6 #include <linux/kernel.h>
7 #include <linux/types.h>
10 #include <asm/processor.h>
11 #include <asm/traps.h>
15 /* By default disabled */
16 int mce_p5_enabled __read_mostly;
18 /* Machine check handler for Pentium class Intel CPUs: */
19 static void pentium_machine_check(struct pt_regs *regs, long error_code)
21 enum ctx_state prev_state;
22 u32 loaddr, hi, lotype;
24 prev_state = ist_enter(regs);
26 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
27 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
30 "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n",
31 smp_processor_id(), loaddr, lotype);
33 if (lotype & (1<<5)) {
35 "CPU#%d: Possible thermal failure (CPU on fire ?).\n",
39 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
41 ist_exit(regs, prev_state);
44 /* Set up machine check reporting for processors with Intel style MCE: */
45 void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
49 /* Default P5 to off as its often misconnected: */
53 /* Check for MCE support: */
54 if (!cpu_has(c, X86_FEATURE_MCE))
57 machine_check_vector = pentium_machine_check;
58 /* Make sure the vector pointer is visible before we enable MCEs: */
61 /* Read registers before enabling: */
62 rdmsr(MSR_IA32_P5_MC_ADDR, l, h);
63 rdmsr(MSR_IA32_P5_MC_TYPE, l, h);
65 "Intel old style machine check architecture supported.\n");
68 set_in_cr4(X86_CR4_MCE);
70 "Intel old style machine check reporting enabled on CPU#%d.\n",