Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <srostedt@redhat.com>, linux-mips@linux-mips.org
Subject: Re: [PATCH 2/5] tracing, MIPS: Substitute in_kernel_space() for in_module()
Date: Mon, 24 Jan 2011 14:57:13 +0100	[thread overview]
Message-ID: <20110124135713.GA31240@linux-mips.org> (raw)
In-Reply-To: <bce694a8e18c01fa0d2cc667561870b56a7d672f.1295464855.git.wuzhangjin@gmail.com>

On Thu, Jan 20, 2011 at 03:28:29AM +0800, Wu Zhangjin wrote:

> @@ -91,10 +91,16 @@ int ftrace_make_nop(struct module *mod,
>  	unsigned long ip = rec->ip;
>  
>  	/*
> -	 * We have compiled module with -mlong-calls, but compiled the kernel
> -	 * without it, we need to cope with them respectively.
> +	 * If ip is in kernel space, no long call, otherwise, long call is
> +	 * needed.
>  	 */

Or even better, just check if the destination is in the same 28-bit segment
of address space.  Something like:

	if ((src ^ dst) >> 28)  {
		/* out of range of simple R_MIPS_26 relocation */
	}

That way you no longer rely on a particular address layout - and there are
plans to change the address space layout eventually!

  Ralf

  reply	other threads:[~2011-01-24 13:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 19:28 [PATCH 0/5] Misc updates for Ftrace of MIPS Wu Zhangjin
2011-01-19 19:28 ` [PATCH 1/5] tracing, MIPS: Speed up function graph tracer Wu Zhangjin
2011-01-24 13:50   ` Ralf Baechle
     [not found] ` <cover.1295464564.git.wuzhangjin@gmail.com>
2011-01-19 19:28   ` [PATCH 1/5] tracing, MIPS: reduce one instruction for " Wu Zhangjin
2011-01-19 19:30     ` wu zhangjin
2011-01-19 19:28   ` [PATCH 2/5] tracing, MIPS: replace in_module() with a generic in_kernel_space() Wu Zhangjin
2011-01-19 19:30     ` wu zhangjin
2011-01-19 19:28 ` [PATCH 2/5] tracing, MIPS: Substitute in_kernel_space() for in_module() Wu Zhangjin
2011-01-24 13:57   ` Ralf Baechle [this message]
2011-01-26 12:36     ` wu zhangjin
2011-01-19 19:28 ` [PATCH 3/5] tracing, MIPS: Clean up prepare_ftrace_return() Wu Zhangjin
2011-01-24 14:21   ` Ralf Baechle
2011-01-19 19:28 ` [PATCH 4/5] tracing, MIPS: Clean up ftrace_make_nop() Wu Zhangjin
2011-01-19 19:28 ` [PATCH 5/5] tracing, MIPS: Fix set_graph_function of function graph tracer Wu Zhangjin
2011-01-20 11:03   ` Sergei Shtylyov
2011-01-20 12:46     ` wu zhangjin
2011-01-20 14:04     ` Steven Rostedt
2011-01-21  9:09       ` wu zhangjin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110124135713.GA31240@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=srostedt@redhat.com \
    --cc=wuzhangjin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox