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>
8 #include <linux/init.h>
11 #include <asm/processor.h>
12 #include <asm/system.h>
16 /* By default disabled */
19 /* Machine check handler for Pentium class Intel CPUs: */
20 static void pentium_machine_check(struct pt_regs *regs, long error_code)
22 u32 loaddr, hi, lotype;
24 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
25 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
28 "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n",
29 smp_processor_id(), loaddr, lotype);
31 if (lotype & (1<<5)) {
33 "CPU#%d: Possible thermal failure (CPU on fire ?).\n",
37 add_taint(TAINT_MACHINE_CHECK);
40 /* Set up machine check reporting for processors with Intel style MCE: */
41 void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
45 /* Check for MCE support: */
46 if (!cpu_has(c, X86_FEATURE_MCE))
49 #ifdef CONFIG_X86_OLD_MCE
50 /* Default P5 to off as its often misconnected: */
51 if (mce_disabled != -1)
55 machine_check_vector = pentium_machine_check;
56 /* Make sure the vector pointer is visible before we enable MCEs: */
59 /* Read registers before enabling: */
60 rdmsr(MSR_IA32_P5_MC_ADDR, l, h);
61 rdmsr(MSR_IA32_P5_MC_TYPE, l, h);
63 "Intel old style machine check architecture supported.\n");
66 set_in_cr4(X86_CR4_MCE);
68 "Intel old style machine check reporting enabled on CPU#%d.\n",