[PATCH RT 13/14] x86: Fix an RT MCE crash

From: Steven Rostedt
Date: Tue Jul 12 2016 - 12:55:35 EST


3.14.72-rt76-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Corey Minyard <cminyard@xxxxxxxxxx>

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. That was required because they had
switched to use swork instead of a kernel thread. Here, just
checking to see if the thread is NULL is good enough to see if
MCE handling is initialized.

Suggested-by: Borislav Petkov <bp@xxxxxxxxx>
Signed-off-by: Corey Minyard <cminyard@xxxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
arch/x86/kernel/cpu/mcheck/mce.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index d4867bd532f3..31ec14000e4a 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1403,7 +1403,8 @@ static int mce_notify_work_init(void)

static void mce_notify_work(void)
{
- wake_up_process(mce_notify_helper);
+ if (mce_notify_helper)
+ wake_up_process(mce_notify_helper);
}
#else
static void mce_notify_work(void)
--
2.8.1