linux-mips
[Top] [All Lists]

Re: [PATCH 2/5] tracing, MIPS: Substitute in_kernel_space() for in_modul

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 2/5] tracing, MIPS: Substitute in_kernel_space() for in_module()
From: wu zhangjin <wuzhangjin@gmail.com>
Date: Wed, 26 Jan 2011 20:36:10 +0800
Cc: Steven Rostedt <srostedt@redhat.com>, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Mbbp8dLvRzkbE+NvpzzjeW40cMkY/xPzO8bhWoMUG0g=; b=TRbZO+m+PQ1lq+mGG9Gn24Yzv37KmCN4k3FWqnmR7JnX+awaGG1g112YkJJ6Jhf9iw 5UHR0/b1k//A/aJdtmMp7GKlFCXFucfr5oPrAkaH4p2dX//SrWAdFkGl/ekY0hSUpOKZ 91d8XnXQLFhgj3vrqcDSrnjnuv0oVTGBV1he0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=nerDd2a+4rY2OnCfjGibzFcC45jPHwKxtwWXxZn+3b+Bv+0l/P+giM/shN3R6wGAtM xdphf7+zf0ujDWAHiAEl1bxeZ2BXVsFfxAN8JfcysgXcWelkKX1djTz+gSInqvsGnSAF aXQmNTOy91mhC8PeUiwyBRB6Zqms3VC/seEio=
In-reply-to: <20110124135713.GA31240@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cover.1295464855.git.wuzhangjin@gmail.com> <bce694a8e18c01fa0d2cc667561870b56a7d672f.1295464855.git.wuzhangjin@gmail.com> <20110124135713.GA31240@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Mon, Jan 24, 2011 at 9:57 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> 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 */
>        }

Yeah, will check if the following statement works:

if ((rec->ip ^ _mcount) >> 28) {
    ...
}

This check may be faster and clearer ;-)

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

Yeah, we really need an address space independent method.

Thanks & Regards,
Wu Zhangjin

>
>  Ralf
>

<Prev in Thread] Current Thread [Next in Thread>