If function_graph tracer is enabled during kexec, we see the below
exception in the simulator:
        root@(none):/# kexec -e
        kvm: exiting hardware virtualization
        kexec_core: Starting new kernel
        [   19.262020070,5] OPAL: Switch to big-endian OS
        kexec: Starting switchover sequence.
        Interrupt to 0xC000000000004380 from 0xC000000000004380
        ** Execution stopped: Continuous Interrupt, Instruction caused 
exception,  **

Now that we have a more effective way to disable ftrace, let's use that
before switching to a new kernel during kexec.

Signed-off-by: Naveen N. Rao <naveen.n....@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/machine_kexec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/machine_kexec.c 
b/arch/powerpc/kernel/machine_kexec.c
index 2694d078741d..4a1b24a9dd61 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -95,16 +95,14 @@ void arch_crash_save_vmcoreinfo(void)
  */
 void machine_kexec(struct kimage *image)
 {
-       int save_ftrace_enabled;
-
-       save_ftrace_enabled = __ftrace_enabled_save();
+       get_paca()->ftrace_disabled = 1;
 
        if (ppc_md.machine_kexec)
                ppc_md.machine_kexec(image);
        else
                default_machine_kexec(image);
 
-       __ftrace_enabled_restore(save_ftrace_enabled);
+       get_paca()->ftrace_disabled = 0;
 
        /* Fall back to normal restart if we're still alive. */
        machine_restart(NULL);
-- 
2.16.2

Reply via email to