aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2009-04-27 13:25:48 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-05-28 12:24:12 -0400
commit5d7279268b654d1f8ac43b0eb6cd9598d9cf55fd (patch)
tree6cfe2e8958506ff84e7ce61507e5555208938eae /arch/x86
parent2e6f694fde0a7158590e121962ca2e3c06633528 (diff)
x86, mce: use a call vector to call the 64bit mce handler
Allows to call different machine check handlers from the low level machine check entry vector. This is needed for later when it will be used for 32bit too. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> 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/mce.c23
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.h3
-rw-r--r--arch/x86/kernel/entry_64.S2
3 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 1336280edcc2..d99318b470d8 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -39,6 +39,16 @@
39 39
40#include "mce.h" 40#include "mce.h"
41 41
42/* Handle unconfigured int18 (should never happen) */
43static void unexpected_machine_check(struct pt_regs *regs, long error_code)
44{
45 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
46 smp_processor_id());
47}
48
49/* Call the installed machine check handler for this CPU setup. */
50void (*machine_check_vector)(struct pt_regs *, long error_code) =
51 unexpected_machine_check;
42#ifdef CONFIG_X86_64 52#ifdef CONFIG_X86_64
43 53
44#define MISC_MCELOG_MINOR 227 54#define MISC_MCELOG_MINOR 227
@@ -715,6 +725,8 @@ void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
715 } 725 }
716 mce_cpu_quirks(c); 726 mce_cpu_quirks(c);
717 727
728 machine_check_vector = do_machine_check;
729
718 mce_init(NULL); 730 mce_init(NULL);
719 mce_cpu_features(c); 731 mce_cpu_features(c);
720 mce_init_timer(); 732 mce_init_timer();
@@ -1285,17 +1297,6 @@ int mce_disabled;
1285int nr_mce_banks; 1297int nr_mce_banks;
1286EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */ 1298EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
1287 1299
1288/* Handle unconfigured int18 (should never happen) */
1289static void unexpected_machine_check(struct pt_regs *regs, long error_code)
1290{
1291 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
1292 smp_processor_id());
1293}
1294
1295/* Call the installed machine check handler for this CPU setup. */
1296void (*machine_check_vector)(struct pt_regs *, long error_code) =
1297 unexpected_machine_check;
1298
1299/* This has to be run for each processor */ 1300/* This has to be run for each processor */
1300void mcheck_init(struct cpuinfo_x86 *c) 1301void mcheck_init(struct cpuinfo_x86 *c)
1301{ 1302{
diff --git a/arch/x86/kernel/cpu/mcheck/mce.h b/arch/x86/kernel/cpu/mcheck/mce.h
index cd6cffcc2de0..966ae3c5cb11 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.h
+++ b/arch/x86/kernel/cpu/mcheck/mce.h
@@ -7,11 +7,12 @@ void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
7void intel_p6_mcheck_init(struct cpuinfo_x86 *c); 7void intel_p6_mcheck_init(struct cpuinfo_x86 *c);
8void winchip_mcheck_init(struct cpuinfo_x86 *c); 8void winchip_mcheck_init(struct cpuinfo_x86 *c);
9 9
10#ifdef CONFIG_X86_32
11 10
12/* Call the installed machine check handler for this CPU setup. */ 11/* Call the installed machine check handler for this CPU setup. */
13extern void (*machine_check_vector)(struct pt_regs *, long error_code); 12extern void (*machine_check_vector)(struct pt_regs *, long error_code);
14 13
14#ifdef CONFIG_X86_32
15
15extern int nr_mce_banks; 16extern int nr_mce_banks;
16 17
17void intel_set_thermal_handler(void); 18void intel_set_thermal_handler(void);
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 38946c6e8433..63276c45bffa 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1382,7 +1382,7 @@ paranoiderrorentry stack_segment do_stack_segment
1382errorentry general_protection do_general_protection 1382errorentry general_protection do_general_protection
1383errorentry page_fault do_page_fault 1383errorentry page_fault do_page_fault
1384#ifdef CONFIG_X86_MCE 1384#ifdef CONFIG_X86_MCE
1385paranoidzeroentry machine_check do_machine_check 1385paranoidzeroentry machine_check *machine_check_vector(%rip)
1386#endif 1386#endif
1387 1387
1388 /* 1388 /*