Skip to content

Commit e0f4e01

Browse files
committed
Merge branch 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS fix from Thomas Gleixner: "The MCE atomic notifier callchain invokes callbacks which might sleep. Convert it to a blocking notifier and prevent calls from atomic context" * 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Make the MCE notifier a blocking one
2 parents fa8d7cd + 0dc9c63 commit e0f4e01

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

arch/x86/kernel/cpu/mcheck/mce-genpool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void mce_gen_pool_process(struct work_struct *__unused)
8585
head = llist_reverse_order(head);
8686
llist_for_each_entry_safe(node, tmp, head, llnode) {
8787
mce = &node->mce;
88-
atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, mce);
88+
blocking_notifier_call_chain(&x86_mce_decoder_chain, 0, mce);
8989
gen_pool_free(mce_evt_pool, (unsigned long)node, sizeof(*node));
9090
}
9191
}

arch/x86/kernel/cpu/mcheck/mce-internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum severity_level {
1313
MCE_PANIC_SEVERITY,
1414
};
1515

16-
extern struct atomic_notifier_head x86_mce_decoder_chain;
16+
extern struct blocking_notifier_head x86_mce_decoder_chain;
1717

1818
#define ATTR_LEN 16
1919
#define INITIAL_CHECK_INTERVAL 5 * 60 /* 5 minutes */

arch/x86/kernel/cpu/mcheck/mce.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs);
123123
* CPU/chipset specific EDAC code can register a notifier call here to print
124124
* MCE errors in a human-readable form.
125125
*/
126-
ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain);
126+
BLOCKING_NOTIFIER_HEAD(x86_mce_decoder_chain);
127127

128128
/* Do initial initialization of a struct mce */
129129
void mce_setup(struct mce *m)
@@ -220,15 +220,15 @@ void mce_register_decode_chain(struct notifier_block *nb)
220220

221221
WARN_ON(nb->priority > MCE_PRIO_LOWEST && nb->priority < MCE_PRIO_EDAC);
222222

223-
atomic_notifier_chain_register(&x86_mce_decoder_chain, nb);
223+
blocking_notifier_chain_register(&x86_mce_decoder_chain, nb);
224224
}
225225
EXPORT_SYMBOL_GPL(mce_register_decode_chain);
226226

227227
void mce_unregister_decode_chain(struct notifier_block *nb)
228228
{
229229
atomic_dec(&num_notifiers);
230230

231-
atomic_notifier_chain_unregister(&x86_mce_decoder_chain, nb);
231+
blocking_notifier_chain_unregister(&x86_mce_decoder_chain, nb);
232232
}
233233
EXPORT_SYMBOL_GPL(mce_unregister_decode_chain);
234234

@@ -321,18 +321,7 @@ static void __print_mce(struct mce *m)
321321

322322
static void print_mce(struct mce *m)
323323
{
324-
int ret = 0;
325-
326324
__print_mce(m);
327-
328-
/*
329-
* Print out human-readable details about the MCE error,
330-
* (if the CPU has an implementation for that)
331-
*/
332-
ret = atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m);
333-
if (ret == NOTIFY_STOP)
334-
return;
335-
336325
pr_emerg_ratelimited(HW_ERR "Run the above through 'mcelog --ascii'\n");
337326
}
338327

0 commit comments

Comments
 (0)