diff -ur stock/linux-2.4.0-test11-pre5/arch/i386/kernel/bluesmoke.c linux-2.4.0-test11-pre5/arch/i386/kernel/bluesmoke.c --- stock/linux-2.4.0-test11-pre5/arch/i386/kernel/bluesmoke.c Wed Nov 15 11:24:19 2000 +++ linux-2.4.0-test11-pre5/arch/i386/kernel/bluesmoke.c Wed Nov 15 13:23:02 2000 @@ -1,7 +1,9 @@ /* - * Machine Check Handler For PII/PIII + * Machine Check Exception handler. If the machine supports + * Machine Check Architecture, give further information. */ + #include #include #include @@ -12,53 +14,66 @@ void do_machine_check(struct pt_regs * regs, long error_code) { + struct cpuinfo_x86 *c = current_cpu_data; int recover=1; u32 alow, ahigh, high, low; u32 mcgstl, mcgsth; int i; - rdmsr(0x17a, mcgstl, mcgsth); - if(mcgstl&(1<<0)) /* Recoverable ? */ - recover=0; - - printk(KERN_EMERG "CPU %d: Machine Check Exception: %08x%08x\n", smp_processor_id(), mcgsth, mcgstl); - - for(i=0;ix86_capability) ) { - rdmsr(0x401+i*4,low, high); - if(high&(1<<31)) + /* MCA available; at least we can figure out what just hit us */ + + rdmsr(0x17a, mcgstl, mcgsth); + if(mcgstl&(1<<0)) /* Recoverable ? */ + recover=0; + + printk(KERN_EMERG "CPU %d: Machine Check Exception: %08x%08x\n", + smp_processor_id(), mcgsth, mcgstl); + + for(i=0;ix86_vendor != X86_VENDOR_INTEL ) - return; + char *what; - if( !test_bit(X86_FEATURE_TSC, &c->x86_capability) ) - return; - - if( !test_bit(X86_FEATURE_MCA, &c->x86_capability) ) + /* We should not check for vendor here. The MCA capability + bit, below, should only be set if the CPU has the Machine + Check Architecture as specified by Intel. It's up to + identify_cpu() to make sure that is true! */ + + if( !test_bit(X86_FEATURE_MCE, &c->x86_capability) ) return; - - /* Ok machine check is available */ - if(done==0) - printk(KERN_INFO "Intel machine check architecture supported.\n"); - rdmsr(0x179, l, h); - if(l&(1<<8)) - wrmsr(0x17b, 0xffffffff, 0xffffffff); - banks = l&0xff; - for(i=1;ix86_capability) ) { - wrmsr(0x401+4*i, 0x0, 0x0); + /* Ok, Machine Check Architecture is available */ + + rdmsr(0x179, l, h); + if(l&(1<<8)) + wrmsr(0x17b, 0xffffffff, 0xffffffff); + banks = l&0xff; + for(i=1;ix86_model_id, p); - - /* Enable MCA if available */ - mcheck_init(c); } void __init get_cpu_vendor(struct cpuinfo_x86 *c) @@ -1797,6 +1793,8 @@ return have_cpuid_p(); /* Check to see if CPUID now enabled? */ } +extern void mcheck_init(struct cpuinfo_x86 *c); + /* * This does the hard work of actually picking apart the CPU stuff... */ @@ -1919,6 +1917,9 @@ * The vendor-specific functions might have changed features. Now * we do "generic changes." */ + + /* Enable Machine Check Architecture if appropriate */ + mcheck_init(c); /* TSC disabled? */ #ifdef CONFIG_TSC diff -ur stock/linux-2.4.0-test11-pre5/include/asm-i386/cpufeature.h linux-2.4.0-test11-pre5/include/asm-i386/cpufeature.h --- stock/linux-2.4.0-test11-pre5/include/asm-i386/cpufeature.h Wed Nov 15 11:24:21 2000 +++ linux-2.4.0-test11-pre5/include/asm-i386/cpufeature.h Wed Nov 15 11:35:10 2000 @@ -20,7 +20,7 @@ #define X86_FEATURE_TSC (0*32+ 4) /* Time Stamp Counter */ #define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers, RDMSR, WRMSR */ #define X86_FEATURE_PAE (0*32+ 6) /* Physical Address Extensions */ -#define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Architecture */ +#define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Exception */ #define X86_FEATURE_CX8 (0*32+ 8) /* CMPXCHG8 instruction */ #define X86_FEATURE_APIC (0*32+ 9) /* Onboard APIC */ #define X86_FEATURE_SEP (0*32+11) /* SYSENTER/SYSEXIT */