powerpc/ftrace: bugfix for test_24bit_addr
authorLiu Ping Fan <kernelfans@gmail.com>
Wed, 26 Feb 2014 02:23:01 +0000 (10:23 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 28 Feb 2014 07:06:25 +0000 (18:06 +1100)
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 <pingfank@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/ftrace.c

index 9b27b29..b0ded97 100644 (file)
@@ -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);