All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Mask jump target in ftrace_dyn_arch_init_insns().
@ 2010-12-28 21:21 David Daney
  2010-12-29  1:38 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: David Daney @ 2010-12-28 21:21 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: David Daney, Steven Rostedt, Wu Zhangjin

The current code is abusing the uasm interface by passing jump target
addresses with high bits set.  Mask the addresses to avoid annoying
messages at boot time.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/kernel/ftrace.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 5a84a1f..72008b5 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -37,6 +37,7 @@ static inline int in_module(unsigned long ip)
 
 #define JAL 0x0c000000		/* jump & link: ip --> ra, jump to target */
 #define ADDR_MASK 0x03ffffff	/*  op_code|addr : 31...26|25 ....0 */
+#define JUMP_RANGE_MASK ((1UL << 28) - 1)
 
 #define INSN_B_1F_4 0x10000004	/* b 1f; offset = 4 */
 #define INSN_B_1F_5 0x10000005	/* b 1f; offset = 5 */
@@ -60,12 +61,12 @@ static inline void ftrace_dyn_arch_init_insns(void)
 
 	/* jal (ftrace_caller + 8), jump over the first two instruction */
 	buf = (u32 *)&insn_jal_ftrace_caller;
-	uasm_i_jal(&buf, (FTRACE_ADDR + 8));
+	uasm_i_jal(&buf, (FTRACE_ADDR + 8) & JUMP_RANGE_MASK);
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 	/* j ftrace_graph_caller */
 	buf = (u32 *)&insn_j_ftrace_graph_caller;
-	uasm_i_j(&buf, (unsigned long)ftrace_graph_caller);
+	uasm_i_j(&buf, (unsigned long)ftrace_graph_caller & JUMP_RANGE_MASK);
 #endif
 }
 
-- 
1.7.2.3

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

* Re: [PATCH] MIPS: Mask jump target in ftrace_dyn_arch_init_insns().
  2010-12-28 21:21 [PATCH] MIPS: Mask jump target in ftrace_dyn_arch_init_insns() David Daney
@ 2010-12-29  1:38 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2010-12-29  1:38 UTC (permalink / raw)
  To: David Daney; +Cc: linux-mips, Steven Rostedt, Wu Zhangjin

On Tue, Dec 28, 2010 at 01:21:37PM -0800, David Daney wrote:

> The current code is abusing the uasm interface by passing jump target
> addresses with high bits set.  Mask the addresses to avoid annoying
> messages at boot time.
> 
> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Wu Zhangjin <wuzhangjin@gmail.com>

Thanks, applied.

  Ralf

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

end of thread, other threads:[~2010-12-29  1:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28 21:21 [PATCH] MIPS: Mask jump target in ftrace_dyn_arch_init_insns() David Daney
2010-12-29  1:38 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.