powerpc/ftrace: Add separate ftrace_init_nop() with additional validation
authorNaveen N Rao <naveen@kernel.org>
Mon, 19 Jun 2023 09:47:28 +0000 (15:17 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 21 Aug 2023 14:09:06 +0000 (00:09 +1000)
commitcc93b9233230312a8a905fabd590c405d60f9edd
tree16f8e9a618842a7afb9c96dad35c2c5634a250f4
parent33bb8a0be9c826fce545ae390ecaf91e96b5db43
powerpc/ftrace: Add separate ftrace_init_nop() with additional validation

Currently, we validate instructions around the ftrace location every
time we have to enable/disable ftrace. Introduce ftrace_init_nop() to
instead perform all the validation during ftrace initialization. This
allows us to simply patch the necessary instructions during
enabling/disabling ftrace.

Signed-off-by: Naveen N Rao <naveen@kernel.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/f373684081e8e98be09b7f44d2d93069768324dc.1687166935.git.naveen@kernel.org
arch/powerpc/include/asm/ftrace.h
arch/powerpc/kernel/trace/ftrace.c