mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 03:38:10 -04:00
powerpc/ftrace: Skip instruction patching if the instructions are the same
To simplify upcoming changes to ftrace, add a check to skip actual instruction patching if the old and new instructions are the same. We still validate that the instruction is what we expect, but don't actually patch the same instruction again. Signed-off-by: Naveen N Rao <naveen@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://patch.msgid.link/20241030070850.1361304-8-hbathini@linux.ibm.com
This commit is contained in:
committed by
Michael Ellerman
parent
8b0dc1305e
commit
1d59bd2fc0
@@ -82,7 +82,7 @@ static inline int ftrace_modify_code(unsigned long ip, ppc_inst_t old, ppc_inst_
|
||||
{
|
||||
int ret = ftrace_validate_inst(ip, old);
|
||||
|
||||
if (!ret)
|
||||
if (!ret && !ppc_inst_equal(old, new))
|
||||
ret = patch_instruction((u32 *)ip, new);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user