Line | |
---|
1 | /* |
---|
2 | * mce.c - x86 Machine Check Exception Reporting |
---|
3 | * (c) 2002 Alan Cox <alan@redhat.com>, Dave Jones <davej@codemonkey.org.uk> |
---|
4 | */ |
---|
5 | |
---|
6 | #include <xen/init.h> |
---|
7 | #include <xen/types.h> |
---|
8 | #include <xen/kernel.h> |
---|
9 | #include <xen/config.h> |
---|
10 | #include <xen/smp.h> |
---|
11 | |
---|
12 | #include <asm/processor.h> |
---|
13 | #include <asm/system.h> |
---|
14 | |
---|
15 | #include "mce.h" |
---|
16 | |
---|
17 | int mce_disabled = 0; |
---|
18 | int nr_mce_banks; |
---|
19 | |
---|
20 | /* Handle unconfigured int18 (should never happen) */ |
---|
21 | static fastcall void unexpected_machine_check(struct cpu_user_regs * regs, long error_code) |
---|
22 | { |
---|
23 | printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n", smp_processor_id()); |
---|
24 | } |
---|
25 | |
---|
26 | /* Call the installed machine check handler for this CPU setup. */ |
---|
27 | void fastcall (*machine_check_vector)(struct cpu_user_regs *, long error_code) = unexpected_machine_check; |
---|
28 | |
---|
29 | /* This has to be run for each processor */ |
---|
30 | void mcheck_init(struct cpuinfo_x86 *c) |
---|
31 | { |
---|
32 | if (mce_disabled==1) |
---|
33 | return; |
---|
34 | |
---|
35 | switch (c->x86_vendor) { |
---|
36 | case X86_VENDOR_AMD: |
---|
37 | if (c->x86==6 || c->x86==15) |
---|
38 | amd_mcheck_init(c); |
---|
39 | break; |
---|
40 | |
---|
41 | case X86_VENDOR_INTEL: |
---|
42 | #ifndef CONFIG_X86_64 |
---|
43 | if (c->x86==5) |
---|
44 | intel_p5_mcheck_init(c); |
---|
45 | if (c->x86==6) |
---|
46 | intel_p6_mcheck_init(c); |
---|
47 | #endif |
---|
48 | if (c->x86==15) |
---|
49 | intel_p4_mcheck_init(c); |
---|
50 | break; |
---|
51 | |
---|
52 | #ifndef CONFIG_X86_64 |
---|
53 | case X86_VENDOR_CENTAUR: |
---|
54 | if (c->x86==5) |
---|
55 | winchip_mcheck_init(c); |
---|
56 | break; |
---|
57 | #endif |
---|
58 | |
---|
59 | default: |
---|
60 | break; |
---|
61 | } |
---|
62 | } |
---|
63 | |
---|
64 | static int __init mcheck_disable(char *str) |
---|
65 | { |
---|
66 | mce_disabled = 1; |
---|
67 | return 0; |
---|
68 | } |
---|
69 | |
---|
70 | static int __init mcheck_enable(char *str) |
---|
71 | { |
---|
72 | mce_disabled = -1; |
---|
73 | return 0; |
---|
74 | } |
---|
75 | |
---|
76 | custom_param("nomce", mcheck_disable); |
---|
77 | custom_param("mce", mcheck_enable); |
---|
Note: See
TracBrowser
for help on using the repository browser.