From 27ddeab0f6cbe64f08caf6a9455a4c861e3dd3c9 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 20 Jan 2004 18:32:03 -0800 Subject: [PATCH] [PATCH] Check for MCE ability before checking registers. Here's a novel idea, check the CPU has machine check capabilities before we start polling registers. I was wondering why my VIA C3 was starting this. Who knows it may solve some of the random crashes I saw there. --- arch/i386/kernel/cpu/mcheck/non-fatal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c index 204192b166f93..46dd17daa174f 100644 --- a/arch/i386/kernel/cpu/mcheck/non-fatal.c +++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c @@ -74,6 +74,16 @@ static void mce_timerfunc (unsigned long data) static int __init init_nonfatal_mce_checker(void) { + struct cpuinfo_x86 *c = &boot_cpu_data; + + /* Check for MCE support */ + if (!cpu_has(c, X86_FEATURE_MCE)) + return -ENODEV; + + /* Check for PPro style MCA */ + if (!cpu_has(c, X86_FEATURE_MCA)) + return -ENODEV; + /* Some Athlons misbehave when we frob bank 0 */ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && boot_cpu_data.x86 == 6) -- 2.53.0