linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: ftrace: bugfix for test_24bit_addr
@ 2014-02-26  2:23 Liu Ping Fan
  2014-02-26  4:35 ` Ananth N Mavinakayanahalli
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Ping Fan @ 2014-02-26  2:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

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>
---
This bug will make ftrace fail to work. It can be triggered when the kernel
size grows up.
---
 arch/powerpc/kernel/ftrace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 9b27b29..b0ded97 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);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-26 23:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26  2:23 [PATCH] powerpc: ftrace: bugfix for test_24bit_addr Liu Ping Fan
2014-02-26  4:35 ` Ananth N Mavinakayanahalli
2014-02-26  6:06   ` Liu ping fan
2014-02-26 12:22   ` Michael Ellerman
2014-02-26 23:19     ` Tony Breeds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).