From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8AAFB2C00A3 for ; Wed, 26 Feb 2014 13:21:09 +1100 (EST) Received: by mail-pa0-f52.google.com with SMTP id fb1so289005pad.25 for ; Tue, 25 Feb 2014 18:21:05 -0800 (PST) From: Liu Ping Fan To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr Date: Wed, 26 Feb 2014 10:23:01 +0800 Message-Id: <1393381381-30179-1-git-send-email-pingfank@linux.vnet.ibm.com> Cc: Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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