Skip to content

Commit

Permalink
x86, mce: use a call vector to call the 64bit mce handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and H. Peter Anvin committed May 28, 2009
1 parent 2e6f694 commit 5d72792
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
23 changes: 12 additions & 11 deletions arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@

#include "mce.h"

/* Handle unconfigured int18 (should never happen) */
static void unexpected_machine_check(struct pt_regs *regs, long error_code)
{
printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
smp_processor_id());
}

/* Call the installed machine check handler for this CPU setup. */
void (*machine_check_vector)(struct pt_regs *, long error_code) =
unexpected_machine_check;
#ifdef CONFIG_X86_64

#define MISC_MCELOG_MINOR 227
Expand Down Expand Up @@ -715,6 +725,8 @@ void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
}
mce_cpu_quirks(c);

machine_check_vector = do_machine_check;

mce_init(NULL);
mce_cpu_features(c);
mce_init_timer();
Expand Down Expand Up @@ -1285,17 +1297,6 @@ int mce_disabled;
int nr_mce_banks;
EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */

/* Handle unconfigured int18 (should never happen) */
static void unexpected_machine_check(struct pt_regs *regs, long error_code)
{
printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
smp_processor_id());
}

/* Call the installed machine check handler for this CPU setup. */
void (*machine_check_vector)(struct pt_regs *, long error_code) =
unexpected_machine_check;

/* This has to be run for each processor */
void mcheck_init(struct cpuinfo_x86 *c)
{
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/cpu/mcheck/mce.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
void intel_p6_mcheck_init(struct cpuinfo_x86 *c);
void winchip_mcheck_init(struct cpuinfo_x86 *c);

#ifdef CONFIG_X86_32

/* Call the installed machine check handler for this CPU setup. */
extern void (*machine_check_vector)(struct pt_regs *, long error_code);

#ifdef CONFIG_X86_32

extern int nr_mce_banks;

void intel_set_thermal_handler(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ paranoiderrorentry stack_segment do_stack_segment
errorentry general_protection do_general_protection
errorentry page_fault do_page_fault
#ifdef CONFIG_X86_MCE
paranoidzeroentry machine_check do_machine_check
paranoidzeroentry machine_check *machine_check_vector(%rip)
#endif

/*
Expand Down

0 comments on commit 5d72792

Please sign in to comment.