From patchwork Thu Jun 30 13:24:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 71244 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp393420qgy; Thu, 30 Jun 2016 06:25:03 -0700 (PDT) X-Received: by 10.66.149.66 with SMTP id ty2mr21271241pab.153.1467293103208; Thu, 30 Jun 2016 06:25:03 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u87si4491647pfj.142.2016.06.30.06.25.03; Thu, 30 Jun 2016 06:25:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbcF3NY4 (ORCPT + 4 others); Thu, 30 Jun 2016 09:24:56 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33837 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922AbcF3NYz (ORCPT ); Thu, 30 Jun 2016 09:24:55 -0400 Received: by mail-pf0-f194.google.com with SMTP id 66so7415158pfy.1 for ; Thu, 30 Jun 2016 06:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=6dZP1UraagP4HhyCNIkoeC/iG+R+zcPpXT/kIbdyvS4=; b=DkCQNf4qYQpjzIU81BzKSsImFCwLYunu0ztNJa1Hr3eDlX9DlKukkQOvnV/1DpaH/s /kqyevq1HF642NO6osiS33TtC3T1PARV+wfoGqT+6ge3QCP56/pOl33qW+36cieTPEhe jw8eOVXUPTbZp7cEoc5M2MsLdCwWp6jI+3bz3tD/QG98pjiPA7GNutoYtVKiNTp/I86s Tzl4yn0UTNilHC0i0IelkQID/QfTY9fBgz9Jfi7DXMK0r605wWjtqeZLd8HkgQoc70Mx eCzN4vo/1Udxe8J5Rc3129xgrRdrTyg4RB1K8tNougskMp7ZB5vWzWzCfzbXCvdA3jnM zdyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=6dZP1UraagP4HhyCNIkoeC/iG+R+zcPpXT/kIbdyvS4=; b=Y2p2AzjsXslUNCYE+EYflX1QBZwdK+Yea0Y8Lstn86/yZtOzxydwRUQezKPLhgx4tS at3HfsAV2QC2DDQnkvxlFp2zmb3fa0LRLBGuN4yVtcYi/IIbGxp6yIWBgkPsg2EN9gPG lxRaNZHodj1BB6OlKqFo2yA9wCJ6rixtfP09QNpkDmVA4B4YKQ8SXrHqOp9EugE2WCIC yq3LZbT37nzORES8nunD4qXxyFa3tLvVJLyC9GikcjQHS2ctJdgFFRBrcx2+1eTZilez /eqtTITo5s1et39mxK5xpGkvxmWarr83PWa9m+kAJiFhivcpJX1nNy+IN9WzsT48ghbs E0JQ== X-Gm-Message-State: ALyK8tKQJH+hpx1ZSIl2qWH5j+ZiVe+szvbyreV64/DmM87Bro3NHABzA8uOMIuXSXQvQg== X-Received: by 10.98.207.4 with SMTP id b4mr21431550pfg.20.1467293095066; Thu, 30 Jun 2016 06:24:55 -0700 (PDT) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id 4sm5996007pav.33.2016.06.30.06.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 06:24:54 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:544:1afc:c07f:f3bb]) by serve.minyard.net (Postfix) with ESMTPA id 6730A782; Thu, 30 Jun 2016 08:24:52 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id B71633012B0; Thu, 30 Jun 2016 08:24:51 -0500 (CDT) From: minyard@acm.org To: linux-rt-users@vger.kernel.org, Steven Rostedt Cc: Corey Minyard Subject: [PATCH][RT] x86: Fix an RT MCE crash Date: Thu, 30 Jun 2016 08:24:49 -0500 Message-Id: <1467293089-27656-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Corey Minyard On some x86 systems an MCE interrupt would come in before the kernel was ready for it. Looking at the latest RT code, it has similar (but not quite the same) code, except it adds a bool that tells if MCE handling is initialized. Add the same bool for older versions. Signed-off-by: Corey Minyard --- arch/x86/kernel/cpu/mcheck/mce.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) We noticed this issue on a new Broadwell system when we booted RT on it. This patch is for 3.10, I'm not sure if it applies to other kernel versions. -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index aaf4b9b..7125584 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1365,6 +1365,7 @@ static void __mce_notify_work(void) } #ifdef CONFIG_PREEMPT_RT_FULL +static bool notify_work_ready __read_mostly; struct task_struct *mce_notify_helper; static int mce_notify_helper_thread(void *unused) @@ -1386,12 +1387,14 @@ static int mce_notify_work_init(void) if (!mce_notify_helper) return -ENOMEM; + notify_work_ready = true; return 0; } static void mce_notify_work(void) { - wake_up_process(mce_notify_helper); + if (notify_work_ready) + wake_up_process(mce_notify_helper); } #else static void mce_notify_work(void)