From: Andi Kleen <andi@firstfloor.org>
To: akpm@linux-foundation.org, mingo@elte.hu, tglx@linutronix.de,
hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: [PATCH] [6/10] x86: MCE: Disable machine checks on offlined CPUs.
Date: Thu, 12 Feb 2009 13:39:31 +0100 (CET) [thread overview]
Message-ID: <20090212123931.BC6253E666D@basil.firstfloor.org> (raw)
In-Reply-To: <20090212139.634236515@firstfloor.org>
Impact: Lower priority bug fix
Offlined CPUs could still get machine checks, but the machine check handler
cannot handle them properly, leading to an unconditional crash. Disable
machine checks on CPUs that are going down.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
arch/x86/kernel/cpu/mcheck/mce_64.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Index: linux/arch/x86/kernel/cpu/mcheck/mce_64.c
===================================================================
--- linux.orig/arch/x86/kernel/cpu/mcheck/mce_64.c 2009-02-12 12:10:54.000000000 +0100
+++ linux/arch/x86/kernel/cpu/mcheck/mce_64.c 2009-02-12 12:12:26.000000000 +0100
@@ -881,6 +881,27 @@
cpu_clear(cpu, mce_device_initialized);
}
+/* Make sure there are no machine checks on offlined CPUs. */
+static void __cpuexit mce_disable_cpu(void *h)
+{
+ int i;
+
+ if (!mce_available(¤t_cpu_data))
+ return;
+ for (i = 0; i < banks; i++)
+ wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
+}
+
+static void __cpuexit mce_reenable_cpu(void *h)
+{
+ int i;
+
+ if (!mce_available(¤t_cpu_data))
+ return;
+ for (i = 0; i < banks; i++)
+ wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]);
+}
+
/* Get notified when a cpu comes on/off. Be hotplug friendly. */
static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
@@ -904,11 +925,13 @@
case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
del_timer_sync(t);
+ smp_call_function_single(cpu, mce_disable_cpu, NULL, 1);
break;
case CPU_DOWN_FAILED:
case CPU_DOWN_FAILED_FROZEN:
t->expires = round_jiffies_relative(jiffies + next_interval);
add_timer_on(t, cpu);
+ smp_call_function_single(cpu, mce_reenable_cpu, NULL, 1);
break;
}
return NOTIFY_OK;
next prev parent reply other threads:[~2009-02-12 12:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 12:39 [PATCH] [0/10] x86: MCE: machine check bug fix series Andi Kleen
2009-02-12 12:39 ` [PATCH] [1/10] x86: MCE: Reinitialize per cpu features on resume v3 Andi Kleen
2009-02-12 12:39 ` [PATCH] [2/10] x86: MCE: Don't disable machine checks during code patching Andi Kleen
2009-02-12 12:39 ` [PATCH] [3/10] x86: MCE: Always use separate work queue to run trigger Andi Kleen
2009-02-12 12:39 ` [PATCH] [4/10] x86: MCE: Switch machine check polling to per CPU timer v3 Andi Kleen
2009-02-12 12:39 ` [PATCH] [5/10] x86: MCE: Don't set up mce sysdev devices with mce=off Andi Kleen
2009-02-12 12:39 ` Andi Kleen [this message]
2009-02-12 12:39 ` [PATCH] [7/10] x86: MCE: Disable machine checks on suspend v2 Andi Kleen
2009-02-12 12:39 ` [PATCH] [8/10] x86: MCE: Use force_sig_info to kill process in machine check Andi Kleen
2009-02-12 12:39 ` [PATCH] [9/10] x86: MCE: Fix a race condition in mce_read() Andi Kleen
2009-02-12 12:39 ` [PATCH] [10/10] x86: MCE: Fix ifdef for 64bit thermal apic vector clear on shutdown Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2009-02-12 12:37 [PATCH] [0/10] x86: MCE: machine check bug fix series Andi Kleen
2009-02-12 12:37 ` [PATCH] [6/10] x86: MCE: Disable machine checks on offlined CPUs Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090212123931.BC6253E666D@basil.firstfloor.org \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome