Make TIF_MCE_NOTIFY optional So that we don't have to implement it on 32bit. I would actually like to remove it on 64bit too. Signed-off-by: Andi Kleen --- arch/x86/Kconfig | 5 +++++ arch/x86/kernel/cpu/mcheck/mce_64.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) Index: linux/arch/x86/kernel/cpu/mcheck/mce_64.c =================================================================== --- linux.orig/arch/x86/kernel/cpu/mcheck/mce_64.c +++ linux/arch/x86/kernel/cpu/mcheck/mce_64.c @@ -148,6 +148,13 @@ static void mce_panic(char *msg, struct panic(msg); } +static void mce_notify_userspace(void) +{ +#ifdef CONFIG_MCE_NOTIFY + set_thread_flag(TIF_MCE_NOTIFY); +#endif +} + static int mce_available(struct cpuinfo_x86 *c) { return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA); @@ -305,8 +312,7 @@ void do_machine_check(struct pt_regs * r } } - /* notify userspace ASAP */ - set_thread_flag(TIF_MCE_NOTIFY); + mce_notify_userspace(); out: /* the last thing we do is clear state */ @@ -387,7 +393,9 @@ static void mcheck_timer(struct work_str */ int mce_notify_user(void) { +#ifdef CONFIG_MCE_NOTIFY clear_thread_flag(TIF_MCE_NOTIFY); +#endif if (test_and_clear_bit(0, ¬ify_user)) { static unsigned long last_print; unsigned long now = jiffies; @@ -407,6 +415,7 @@ int mce_notify_user(void) return 0; } +#ifdef CONFIG_MCE_NOTIFY /* see if the idle task needs to notify userspace */ static int mce_idle_callback(struct notifier_block *nfb, unsigned long action, void *junk) @@ -421,6 +430,7 @@ mce_idle_callback(struct notifier_block static struct notifier_block mce_idle_notifier = { .notifier_call = mce_idle_callback, }; +#endif static __init int periodic_mcheck_init(void) { @@ -428,7 +438,9 @@ static __init int periodic_mcheck_init(v if (next_interval) schedule_delayed_work(&mcheck_work, round_jiffies_relative(next_interval)); +#ifdef CONFIG_MCE_NOTIFY idle_notifier_register(&mce_idle_notifier); +#endif return 0; } __initcall(periodic_mcheck_init); Index: linux/arch/x86/Kconfig =================================================================== --- linux.orig/arch/x86/Kconfig +++ linux/arch/x86/Kconfig @@ -555,6 +555,11 @@ config X86_MCE to disable it. MCE support simply ignores non-MCE processors like the 386 and 486, so nearly everyone can say Y here. +config MCE_NOTIFY + bool + default y + depends on X86_64 + config X86_MCE_INTEL def_bool y prompt "Intel MCE features"