x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...)
[deliverable/linux.git] / arch / x86 / kernel / cpu / mcheck / p5.c
CommitLineData
1da177e4
LT
1/*
2 * P5 specific Machine Check Exception Reporting
87c6fe26 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
1da177e4 4 */
1da177e4 5#include <linux/interrupt.h>
ed8bc7ed
IM
6#include <linux/kernel.h>
7#include <linux/types.h>
1da177e4
LT
8#include <linux/smp.h>
9
15777205 10#include <asm/processor.h>
95927475 11#include <asm/traps.h>
375074cc 12#include <asm/tlbflush.h>
9e55e44e 13#include <asm/mce.h>
1da177e4
LT
14#include <asm/msr.h>
15
4efc0670 16/* By default disabled */
c6978369 17int mce_p5_enabled __read_mostly;
4efc0670 18
ed8bc7ed 19/* Machine check handler for Pentium class Intel CPUs: */
15777205 20static void pentium_machine_check(struct pt_regs *regs, long error_code)
1da177e4
LT
21{
22 u32 loaddr, hi, lotype;
ed8bc7ed 23
8c84014f 24 ist_enter(regs);
95927475 25
1da177e4
LT
26 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
27 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
ed8bc7ed 28
1b74dde7
CY
29 pr_emerg("CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n",
30 smp_processor_id(), loaddr, lotype);
ed8bc7ed
IM
31
32 if (lotype & (1<<5)) {
1b74dde7
CY
33 pr_emerg("CPU#%d: Possible thermal failure (CPU on fire ?).\n",
34 smp_processor_id());
ed8bc7ed
IM
35 }
36
373d4d09 37 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
95927475 38
8c84014f 39 ist_exit(regs);
1da177e4
LT
40}
41
ed8bc7ed 42/* Set up machine check reporting for processors with Intel style MCE: */
31ab269a 43void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
1da177e4
LT
44{
45 u32 l, h;
15777205 46
c6978369
HS
47 /* Default P5 to off as its often misconnected: */
48 if (!mce_p5_enabled)
15777205 49 return;
1da177e4 50
c6978369
HS
51 /* Check for MCE support: */
52 if (!cpu_has(c, X86_FEATURE_MCE))
1da177e4 53 return;
ed8bc7ed 54
1da177e4 55 machine_check_vector = pentium_machine_check;
ed8bc7ed 56 /* Make sure the vector pointer is visible before we enable MCEs: */
1da177e4
LT
57 wmb();
58
ed8bc7ed 59 /* Read registers before enabling: */
1da177e4
LT
60 rdmsr(MSR_IA32_P5_MC_ADDR, l, h);
61 rdmsr(MSR_IA32_P5_MC_TYPE, l, h);
1b74dde7 62 pr_info("Intel old style machine check architecture supported.\n");
1da177e4 63
ed8bc7ed 64 /* Enable MCE: */
375074cc 65 cr4_set_bits(X86_CR4_MCE);
1b74dde7
CY
66 pr_info("Intel old style machine check reporting enabled on CPU#%d.\n",
67 smp_processor_id());
1da177e4 68}
This page took 0.815581 seconds and 5 git commands to generate.