diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2009-06-15 04:22:49 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-06-16 19:56:07 -0400 |
commit | c697836985e18d9c34897428ba563b13044a6dcd (patch) | |
tree | baf61b41254ff78b039cb5405422c0dbdaa6a240 /arch | |
parent | 9e55e44e39798541ba39d57f4b569deb555ae1ce (diff) |
x86, mce: make mce_disabled boolean
The mce_disabled on 32bit is a tristate variable [1,0,-1],
while 64bit version is boolean [0,1].
This patch makes mce_disabled always boolean, and use mce_p5_enabled
to indicate the third state instead.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/mce.h | 8 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/p5.c | 12 |
3 files changed, 11 insertions, 17 deletions
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index aae6fe2112f9..6568cdedcd89 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -107,6 +107,7 @@ struct mce_log { | |||
107 | #include <asm/atomic.h> | 107 | #include <asm/atomic.h> |
108 | 108 | ||
109 | extern int mce_disabled; | 109 | extern int mce_disabled; |
110 | extern int mce_p5_enabled; | ||
110 | 111 | ||
111 | #ifdef CONFIG_X86_OLD_MCE | 112 | #ifdef CONFIG_X86_OLD_MCE |
112 | void amd_mcheck_init(struct cpuinfo_x86 *c); | 113 | void amd_mcheck_init(struct cpuinfo_x86 *c); |
@@ -117,14 +118,11 @@ void intel_p6_mcheck_init(struct cpuinfo_x86 *c); | |||
117 | #ifdef CONFIG_X86_ANCIENT_MCE | 118 | #ifdef CONFIG_X86_ANCIENT_MCE |
118 | void intel_p5_mcheck_init(struct cpuinfo_x86 *c); | 119 | void intel_p5_mcheck_init(struct cpuinfo_x86 *c); |
119 | void winchip_mcheck_init(struct cpuinfo_x86 *c); | 120 | void winchip_mcheck_init(struct cpuinfo_x86 *c); |
120 | extern int mce_p5_enable; | 121 | static inline void enable_p5_mce(void) { mce_p5_enabled = 1; } |
121 | static inline int mce_p5_enabled(void) { return mce_p5_enable; } | ||
122 | static inline void enable_p5_mce(void) { mce_p5_enable = 1; } | ||
123 | #else | 122 | #else |
124 | static inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {} | 123 | static inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {} |
125 | static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {} | 124 | static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {} |
126 | static inline int mce_p5_enabled(void) { return 0; } | 125 | static inline void enable_p5_mce(void) {} |
127 | static inline void enable_p5_mce(void) { } | ||
128 | #endif | 126 | #endif |
129 | 127 | ||
130 | /* Call the installed machine check handler for this CPU setup. */ | 128 | /* Call the installed machine check handler for this CPU setup. */ |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index faedd776847d..6095e0296abd 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -1286,8 +1286,7 @@ static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c) | |||
1286 | return; | 1286 | return; |
1287 | switch (c->x86_vendor) { | 1287 | switch (c->x86_vendor) { |
1288 | case X86_VENDOR_INTEL: | 1288 | case X86_VENDOR_INTEL: |
1289 | if (mce_p5_enabled()) | 1289 | intel_p5_mcheck_init(c); |
1290 | intel_p5_mcheck_init(c); | ||
1291 | break; | 1290 | break; |
1292 | case X86_VENDOR_CENTAUR: | 1291 | case X86_VENDOR_CENTAUR: |
1293 | winchip_mcheck_init(c); | 1292 | winchip_mcheck_init(c); |
@@ -2002,7 +2001,7 @@ EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */ | |||
2002 | /* This has to be run for each processor */ | 2001 | /* This has to be run for each processor */ |
2003 | void mcheck_init(struct cpuinfo_x86 *c) | 2002 | void mcheck_init(struct cpuinfo_x86 *c) |
2004 | { | 2003 | { |
2005 | if (mce_disabled == 1) | 2004 | if (mce_disabled) |
2006 | return; | 2005 | return; |
2007 | 2006 | ||
2008 | switch (c->x86_vendor) { | 2007 | switch (c->x86_vendor) { |
@@ -2032,10 +2031,9 @@ void mcheck_init(struct cpuinfo_x86 *c) | |||
2032 | 2031 | ||
2033 | static int __init mcheck_enable(char *str) | 2032 | static int __init mcheck_enable(char *str) |
2034 | { | 2033 | { |
2035 | mce_disabled = -1; | 2034 | mce_p5_enabled = 1; |
2036 | return 1; | 2035 | return 1; |
2037 | } | 2036 | } |
2038 | |||
2039 | __setup("mce", mcheck_enable); | 2037 | __setup("mce", mcheck_enable); |
2040 | 2038 | ||
2041 | #endif /* CONFIG_X86_OLD_MCE */ | 2039 | #endif /* CONFIG_X86_OLD_MCE */ |
diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c index 747853f9188d..5c0e6533d9bc 100644 --- a/arch/x86/kernel/cpu/mcheck/p5.c +++ b/arch/x86/kernel/cpu/mcheck/p5.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm/msr.h> | 14 | #include <asm/msr.h> |
15 | 15 | ||
16 | /* By default disabled */ | 16 | /* By default disabled */ |
17 | int mce_p5_enable; | 17 | int mce_p5_enabled __read_mostly; |
18 | 18 | ||
19 | /* Machine check handler for Pentium class Intel CPUs: */ | 19 | /* Machine check handler for Pentium class Intel CPUs: */ |
20 | static void pentium_machine_check(struct pt_regs *regs, long error_code) | 20 | static void pentium_machine_check(struct pt_regs *regs, long error_code) |
@@ -42,15 +42,13 @@ void intel_p5_mcheck_init(struct cpuinfo_x86 *c) | |||
42 | { | 42 | { |
43 | u32 l, h; | 43 | u32 l, h; |
44 | 44 | ||
45 | /* Check for MCE support: */ | 45 | /* Default P5 to off as its often misconnected: */ |
46 | if (!cpu_has(c, X86_FEATURE_MCE)) | 46 | if (!mce_p5_enabled) |
47 | return; | 47 | return; |
48 | 48 | ||
49 | #ifdef CONFIG_X86_OLD_MCE | 49 | /* Check for MCE support: */ |
50 | /* Default P5 to off as its often misconnected: */ | 50 | if (!cpu_has(c, X86_FEATURE_MCE)) |
51 | if (mce_disabled != -1) | ||
52 | return; | 51 | return; |
53 | #endif | ||
54 | 52 | ||
55 | machine_check_vector = pentium_machine_check; | 53 | machine_check_vector = pentium_machine_check; |
56 | /* Make sure the vector pointer is visible before we enable MCEs: */ | 54 | /* Make sure the vector pointer is visible before we enable MCEs: */ |