Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1206704
| From | "tip-bot for Chen, Gong" <tipbot@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [tip:ras/core] x86/mce: Avoid potential deadlock due to printk() in MCE context |
| Date | 2015-08-13 12:50 +0200 |
| Message-ID | <pWYf8-St-19@gated-at.bofh.it> (permalink) |
| References | <pWHei-1sf-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Commit-ID: f29a7aff4bd60ebc3da4982f80144a4158c4c74a Gitweb: http://git.kernel.org/tip/f29a7aff4bd60ebc3da4982f80144a4158c4c74a Author: Chen, Gong <gong.chen@linux.intel.com> AuthorDate: Wed, 12 Aug 2015 18:29:37 +0200 Committer: Ingo Molnar <mingo@kernel.org> CommitDate: Thu, 13 Aug 2015 10:12:51 +0200 x86/mce: Avoid potential deadlock due to printk() in MCE context Printing in MCE context is a no-no, currently, as printk() is not NMI-safe. If some of the notifiers on the MCE chain call do so, we may deadlock. In order to avoid that, delay printk() to process context where it is safe. Reported-by: Xie XiuQi <xiexiuqi@huawei.com> Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> [ Fold in subsequent patch from Boris for early boot logging. ] Signed-off-by: Tony Luck <tony.luck@intel.com> [ Kick irq_work in mce_log() directly. ] Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1439396985-12812-6-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/cpu/mcheck/mce-apei.c | 1 - arch/x86/kernel/cpu/mcheck/mce.c | 4 ++-- arch/x86/kernel/cpu/mcheck/mce_intel.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce-apei.c b/arch/x86/kernel/cpu/mcheck/mce-apei.c index a1aef95..34c89a3 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-apei.c +++ b/arch/x86/kernel/cpu/mcheck/mce-apei.c @@ -57,7 +57,6 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err) m.addr = mem_err->physical_addr; mce_log(&m); - mce_notify_irq(); } EXPORT_SYMBOL_GPL(apei_mce_report_mem_error); diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 8260369..9568bb5 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -159,7 +159,8 @@ void mce_log(struct mce *mce) /* Emit the trace record: */ trace_mce_record(mce); - atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, mce); + if (!mce_gen_pool_add(mce)) + irq_work_queue(&mce_irq_work); mce->finished = 0; wmb(); @@ -1122,7 +1123,6 @@ void do_machine_check(struct pt_regs *regs, long error_code) /* assuming valid severity level != 0 */ m.severity = severity; m.usable_addr = mce_usable_address(&m); - mce_gen_pool_add(&m); mce_log(&m); diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c index 844f56c..70f567f 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c @@ -246,7 +246,6 @@ static void intel_threshold_interrupt(void) return; machine_check_poll(MCP_TIMESTAMP, this_cpu_ptr(&mce_banks_owned)); - mce_notify_irq(); } /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/13] x86/RAS queue for 4.3 Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[PATCH 07/13] x86/mce: Remove unused function declarations Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Remove unused function declarations tip-bot for Ashok Raj <tipbot@zytor.com> - 2015-08-13 12:50 +0200
[PATCH 05/13] x86/mce: Avoid potential deadlock due to printk() in MCE context Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Avoid potential deadlock due to printk() in MCE context "tip-bot for Chen, Gong" <tipbot@zytor.com> - 2015-08-13 12:50 +0200
[PATCH 08/13] x86/mce: Clear Local MCE opt-in before kexec Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Clear Local MCE opt-in before kexec tip-bot for Ashok Raj <tipbot@zytor.com> - 2015-08-13 12:50 +0200
[PATCH 12/13] x86/mce: Add a wrapper around mce_log() for injection Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Add a wrapper around mce_log() for injection tip-bot for Borislav Petkov <tipbot@zytor.com> - 2015-08-13 13:00 +0200
[PATCH 03/13] x86/mce: Don't use percpu workqueues Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Don't use percpu workqueues "tip-bot for Chen, Gong" <tipbot@zytor.com> - 2015-08-13 12:50 +0200
[PATCH 11/13] x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check() Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check() tip-bot for Borislav Petkov <tipbot@zytor.com> - 2015-08-13 13:00 +0200
[PATCH 04/13] x86/mce: Remove the MCE ring for Action Optional errors Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/mce: Remove the MCE ring for Action Optional errors "tip-bot for Chen, Gong" <tipbot@zytor.com> - 2015-08-13 12:50 +0200
[PATCH 13/13] x86/ras: Move AMD MCE injector to arch/x86/ras/ Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] x86/ras: Move AMD MCE injector to arch/x86/ras/ tip-bot for Borislav Petkov <tipbot@zytor.com> - 2015-08-13 13:00 +0200
[PATCH 10/13] RAS: Add a menuconfig option with descriptive text Borislav Petkov <bp@alien8.de> - 2015-08-12 18:40 +0200
[tip:ras/core] RAS: Add a menuconfig option with descriptive text tip-bot for Borislav Petkov <tipbot@zytor.com> - 2015-08-13 13:00 +0200
csiph-web