/* Call the installed machine check handler for this CPU setup. */
void (*machine_check_vector)(struct pt_regs *, long error_code) =
unexpected_machine_check;
+
+int mce_disabled;
+
#ifdef CONFIG_X86_64
#define MISC_MCELOG_MINOR 227
atomic_t mce_entry;
-static int mce_dont_init;
-
/*
* Tolerant levels:
* 0: always panic on uncorrected errors, log corrected errors
int mce_available(struct cpuinfo_x86 *c)
{
- if (mce_dont_init)
+ if (mce_disabled)
return 0;
return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA);
}
return 0;
}
-/* see if the idle task needs to notify userspace: */
-static int
-mce_idle_callback(struct notifier_block *nfb, unsigned long action,
- void *unused)
-{
- /* IDLE_END should be safe - interrupts are back on */
- if (action == IDLE_END && test_thread_flag(TIF_MCE_NOTIFY))
- mce_notify_user();
-
- return NOTIFY_OK;
-}
-
-static struct notifier_block mce_idle_notifier = {
- .notifier_call = mce_idle_callback,
-};
-
-static __init int periodic_mcheck_init(void)
-{
- idle_notifier_register(&mce_idle_notifier);
- return 0;
-}
-__initcall(periodic_mcheck_init);
-
/*
* Initialize Machine Checks for a CPU.
*/
return;
if (mce_cap_init() < 0) {
- mce_dont_init = 1;
+ mce_disabled = 1;
return;
}
mce_cpu_quirks(c);
};
/*
- * Old style boot options parsing. Only for compatibility.
- */
-static int __init mcheck_disable(char *str)
-{
- mce_dont_init = 1;
- return 1;
-}
-__setup("nomce", mcheck_disable);
-
-/*
* mce=off disables machine check
* mce=TOLERANCELEVEL (number, see above)
* mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
static int __init mcheck_enable(char *str)
{
if (!strcmp(str, "off"))
- mce_dont_init = 1;
+ mce_disabled = 1;
else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
mce_bootlog = (str[0] == 'b');
else if (isdigit(str[0]))
#else /* CONFIG_X86_32: */
-int mce_disabled;
-
int nr_mce_banks;
EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
printk(KERN_INFO "mce: CPU supports %d MCE banks\n", nr_mce_banks);
}
-static int __init mcheck_disable(char *str)
-{
- mce_disabled = 1;
- return 1;
-}
-
static int __init mcheck_enable(char *str)
{
mce_disabled = -1;
return 1;
}
-__setup("nomce", mcheck_disable);
__setup("mce", mcheck_enable);
-#endif /* CONFIG_X86_32 */
+#endif /* CONFIG_X86_OLD_MCE */
+
+/*
+ * Old style boot options parsing. Only for compatibility.
+ */
+static int __init mcheck_disable(char *str)
+{
+ mce_disabled = 1;
+ return 1;
+}
+__setup("nomce", mcheck_disable);