summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/mce.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2020-05-08 06:34:05 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-18 16:10:34 +0200
commitabd106fb437ad1cd8c8df8ccabd0fa941ef6342a (patch)
treecfa122e700d8609a592b2647576ee867ee8c3531 /arch/powerpc/kernel/mce.c
parentpowerpc: Implement ftrace_enabled() helpers (diff)
downloadlinux-abd106fb437ad1cd8c8df8ccabd0fa941ef6342a.tar.xz
linux-abd106fb437ad1cd8c8df8ccabd0fa941ef6342a.zip
powerpc/64s: machine check do not trace real-mode handler
Rather than notrace annotations throughout a significant part of the machine check code across kernel/ pseries/ and powernv/ which can easily be broken and is infrequently tested, use paca->ftrace_enabled to blanket-disable tracing of the real-mode non-maskable handler. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr> Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Link: https://lore.kernel.org/r/20200508043408.886394-14-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel/mce.c')
-rw-r--r--arch/powerpc/kernel/mce.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c
index be7e3f92a7b5..fd90c0eda229 100644
--- a/arch/powerpc/kernel/mce.c
+++ b/arch/powerpc/kernel/mce.c
@@ -16,6 +16,7 @@
#include <linux/export.h>
#include <linux/irq_work.h>
#include <linux/extable.h>
+#include <linux/ftrace.h>
#include <asm/machdep.h>
#include <asm/mce.h>
@@ -571,10 +572,14 @@ EXPORT_SYMBOL_GPL(machine_check_print_event_info);
*
* regs->nip and regs->msr contains srr0 and ssr1.
*/
-long machine_check_early(struct pt_regs *regs)
+long notrace machine_check_early(struct pt_regs *regs)
{
long handled = 0;
bool nested = in_nmi();
+ u8 ftrace_enabled = this_cpu_get_ftrace_enabled();
+
+ this_cpu_set_ftrace_enabled(0);
+
if (!nested)
nmi_enter();
@@ -589,6 +594,8 @@ long machine_check_early(struct pt_regs *regs)
if (!nested)
nmi_exit();
+ this_cpu_set_ftrace_enabled(ftrace_enabled);
+
return handled;
}