From: Liu Ping Fan Date: Wed, 26 Feb 2014 02:23:01 +0000 (+0800) Subject: powerpc/ftrace: bugfix for test_24bit_addr X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a95fc58549e8f462e560868a16b1fa97b12d5db6;p=openwrt%2Fstaging%2Fblogic.git powerpc/ftrace: bugfix for test_24bit_addr The branch target should be the func addr, not the addr of func_descr_t. So using ppc_function_entry() to generate the right target addr. Signed-off-by: Liu Ping Fan Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 9b27b293a922..b0ded97ee4e1 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c @@ -74,6 +74,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new) */ static int test_24bit_addr(unsigned long ip, unsigned long addr) { + addr = ppc_function_entry((void *)addr); /* use the create_branch to verify that this offset can be branched */ return create_branch((unsigned int *)ip, addr, 0);