aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-08 06:31:21 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-05-28 12:24:09 -0400
commited8bc7ed9a2ad875617b24d2ba09e49ee886638c (patch)
treea91e2e43b4b8450c99755248a12dea5bf66fe92a /arch/x86
parentc5aaf0e0702513637278ca4e27a156caa9392817 (diff)
x86, mce: clean up p5.c
Make the coding style match that of the rest of the x86 arch code. [ Impact: cleanup ] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/mcheck/p5.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
index c9f77ea69edc..8812f5441830 100644
--- a/arch/x86/kernel/cpu/mcheck/p5.c
+++ b/arch/x86/kernel/cpu/mcheck/p5.c
@@ -2,11 +2,10 @@
2 * P5 specific Machine Check Exception Reporting 2 * P5 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5
6#include <linux/init.h>
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
10#include <linux/smp.h> 9#include <linux/smp.h>
11 10
12#include <asm/processor.h> 11#include <asm/processor.h>
@@ -15,39 +14,53 @@
15 14
16#include "mce.h" 15#include "mce.h"
17 16
18/* Machine check handler for Pentium class Intel */ 17/* Machine check handler for Pentium class Intel CPUs: */
19static void pentium_machine_check(struct pt_regs *regs, long error_code) 18static void pentium_machine_check(struct pt_regs *regs, long error_code)
20{ 19{
21 u32 loaddr, hi, lotype; 20 u32 loaddr, hi, lotype;
21
22 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi); 22 rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
23 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi); 23 rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
24 printk(KERN_EMERG "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n", smp_processor_id(), loaddr, lotype); 24
25 if (lotype&(1<<5)) 25 printk(KERN_EMERG
26 printk(KERN_EMERG "CPU#%d: Possible thermal failure (CPU on fire ?).\n", smp_processor_id()); 26 "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n",
27 smp_processor_id(), loaddr, lotype);
28
29 if (lotype & (1<<5)) {
30 printk(KERN_EMERG
31 "CPU#%d: Possible thermal failure (CPU on fire ?).\n",
32 smp_processor_id());
33 }
34
27 add_taint(TAINT_MACHINE_CHECK); 35 add_taint(TAINT_MACHINE_CHECK);
28} 36}
29 37
30/* Set up machine check reporting for processors with Intel style MCE */ 38/* Set up machine check reporting for processors with Intel style MCE: */
31void intel_p5_mcheck_init(struct cpuinfo_x86 *c) 39void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
32{ 40{
33 u32 l, h; 41 u32 l, h;
34 42
35 /*Check for MCE support */ 43 /* Check for MCE support: */
36 if (!cpu_has(c, X86_FEATURE_MCE)) 44 if (!cpu_has(c, X86_FEATURE_MCE))
37 return; 45 return;
38 46
39 /* Default P5 to off as its often misconnected */ 47 /* Default P5 to off as its often misconnected: */
40 if (mce_disabled != -1) 48 if (mce_disabled != -1)
41 return; 49 return;
50
42 machine_check_vector = pentium_machine_check; 51 machine_check_vector = pentium_machine_check;
52 /* Make sure the vector pointer is visible before we enable MCEs: */
43 wmb(); 53 wmb();
44 54
45 /* Read registers before enabling */ 55 /* Read registers before enabling: */
46 rdmsr(MSR_IA32_P5_MC_ADDR, l, h); 56 rdmsr(MSR_IA32_P5_MC_ADDR, l, h);
47 rdmsr(MSR_IA32_P5_MC_TYPE, l, h); 57 rdmsr(MSR_IA32_P5_MC_TYPE, l, h);
48 printk(KERN_INFO "Intel old style machine check architecture supported.\n"); 58 printk(KERN_INFO
59 "Intel old style machine check architecture supported.\n");
49 60
50 /* Enable MCE */ 61 /* Enable MCE: */
51 set_in_cr4(X86_CR4_MCE); 62 set_in_cr4(X86_CR4_MCE);
52 printk(KERN_INFO "Intel old style machine check reporting enabled on CPU#%d.\n", smp_processor_id()); 63 printk(KERN_INFO
64 "Intel old style machine check reporting enabled on CPU#%d.\n",
65 smp_processor_id());
53} 66}