]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/ftrace: Have arch_ftrace_get_regs() return NULL unless FL_SAVE_REGS is set
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 15 Feb 2022 18:31:24 +0000 (19:31 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Feb 2022 12:09:47 +0000 (23:09 +1100)
commitfba01c3ae9f242eb3b9ba35442fd62c350d85b22
tree32347525d29a13a6f59063034c8236c47319aac5
parentb8a72d80c0e6fca788d7bd51ec0a19ef8429a791
powerpc/ftrace: Have arch_ftrace_get_regs() return NULL unless FL_SAVE_REGS is set

When FL_SAVE_REGS is not set we get here via ftrace_caller()
which doesn't save all registers.

ftrace_caller() explicitely clears regs.msr, so we can rely
on it to know where we come from. We don't expect MSR register
to be 0 at all when involving ftrace.

Fixes: cf4e1809c66b ("powerpc/ftrace: Implement CONFIG_DYNAMIC_FTRACE_WITH_ARGS")
Reported-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/2f9a7e898c93cc7438ef5ccd47cb9c3a9c5b53ef.1644949750.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/ftrace.h
arch/powerpc/kernel/trace/ftrace_mprofile.S