Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Naveen N Rao and committed by
Michael Ellerman
1d59bd2f 8b0dc130

+1 -1
+1 -1
arch/powerpc/kernel/trace/ftrace.c
··· 82 82 { 83 83 int ret = ftrace_validate_inst(ip, old); 84 84 85 - if (!ret) 85 + if (!ret && !ppc_inst_equal(old, new)) 86 86 ret = patch_instruction((u32 *)ip, new); 87 87 88 88 return ret;