[PATCH 1/2] powerpc/ftrace: Separate the heuristics for checking call sites
Michael Ellerman
mpe at ellerman.id.au
Thu Jul 21 20:36:00 AEST 2016
Madhavan Srinivasan <maddy at linux.vnet.ibm.com> writes:
> On Tuesday 19 July 2016 10:18 AM, Michael Ellerman wrote:
>> In __ftrace_make_nop() (the 64-bit version), we have code to deal with
>> two ftrace ABIs. There is the original ABI, which looks mostly like a
>> function call, and then the mprofile-kernel ABI which is just a branch.
>>
...
>> diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
>> index 7af6c4de044b..438442dac44c 100644
>> --- a/arch/powerpc/kernel/ftrace.c
>> +++ b/arch/powerpc/kernel/ftrace.c
>> @@ -144,6 +144,21 @@ __ftrace_make_nop(struct module *mod,
>> return -EINVAL;
>> }
>>
>> +#ifdef CC_USING_MPROFILE_KERNEL
>> + /* When using -mkernel_profile there is no load to jump over */
>> + pop = PPC_INST_NOP;
>> +
>> + if (probe_kernel_read(&op, (void *)(ip - 4), 4)) {
>> + pr_err("Fetching instruction at %lx failed.\n", ip - 4);
>> + return -EFAULT;
>> + }
>> +
>> + /* We expect either a mlfr r0, or a std r0, LRSAVE(r1) */
>
> nit.. "mflr" and not "mlfr"
Yep, copied from the old comment, but I'll fix it up. Thanks.
cheers
More information about the Linuxppc-dev
mailing list