debuggers.hg

view xen/arch/x86/cpu/mcheck/mce.c @ 10990:47af0e2ebb13

[XEN] Allow users to specify mce/nomce boot parameters.
Signed-off-by: Arun Sharma <arun@sharma-home.net>
author kaf24@firebug.cl.cam.ac.uk
date Mon Aug 07 15:42:25 2006 +0100 (2006-08-07)
parents b9b411b50587
children 63d58674596f
line source
1 /*
2 * mce.c - x86 Machine Check Exception Reporting
3 * (c) 2002 Alan Cox <alan@redhat.com>, Dave Jones <davej@codemonkey.org.uk>
4 */
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>
12 #include <asm/processor.h>
13 #include <asm/system.h>
15 #include "mce.h"
17 int mce_disabled = 0;
18 int nr_mce_banks;
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 }
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;
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;
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;
41 case X86_VENDOR_INTEL:
42 if (c->x86==5)
43 intel_p5_mcheck_init(c);
44 if (c->x86==6)
45 intel_p6_mcheck_init(c);
46 if (c->x86==15)
47 intel_p4_mcheck_init(c);
48 break;
50 case X86_VENDOR_CENTAUR:
51 if (c->x86==5)
52 winchip_mcheck_init(c);
53 break;
55 default:
56 break;
57 }
58 }
60 static int __init mcheck_disable(char *str)
61 {
62 mce_disabled = 1;
63 return 0;
64 }
66 static int __init mcheck_enable(char *str)
67 {
68 mce_disabled = -1;
69 return 0;
70 }
72 custom_param("nomce", mcheck_disable);
73 custom_param("mce", mcheck_enable);