]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/kdump: Disable ftrace during kexec
authorAnton Blanchard <anton@samba.org>
Thu, 6 Jan 2011 18:00:36 +0000 (18:00 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 21 Jan 2011 03:08:36 +0000 (14:08 +1100)
We should disable ftrace during kexec, some of the tracers are very invasive
and we do not want them going off while doing the low level work of swapping
one kernel out for another. This mirrors what we do on x86.

Even though we cannot return from a kexec on powerpc (since we do not implement
CONFIG_KEXEC_JUMP), add the restore code in case we do one day.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/machine_kexec.c

index 3427b2faa19aed11cd2290fe24d5f97aeca6cca4..49a170af81456ce722fa58cd70e5980370f5f70b 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/irq.h>
+#include <linux/ftrace.h>
 
 #include <asm/machdep.h>
 #include <asm/prom.h>
@@ -82,8 +83,14 @@ void arch_crash_save_vmcoreinfo(void)
  */
 void machine_kexec(struct kimage *image)
 {
+       int save_ftrace_enabled;
+
+       save_ftrace_enabled = __ftrace_enabled_save();
+
        default_machine_kexec(image);
 
+       __ftrace_enabled_restore(save_ftrace_enabled);
+
        /* Fall back to normal restart if we're still alive. */
        machine_restart(NULL);
        for(;;);