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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 24, 2011 at 9:57 PM, Ralf Baechle <ralf@xxxxxxxxxxxxxx> 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
>



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux