[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1652893170.ef56yw5h6t.naveen@linux.ibm.com>
Date: Wed, 18 May 2022 22:33:46 +0530
From: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Michael Ellerman <mpe@...erman.id.au>,
Paul Mackerras <paulus@...ba.org>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH v3 19/25] powerpc/ftrace: Minimise number of #ifdefs
Christophe Leroy wrote:
>
>
> Le 18/05/2022 à 14:03, Michael Ellerman a écrit :
>> Michael Ellerman <mpe@...erman.id.au> writes:
>>> "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com> writes:
>>>> Christophe Leroy wrote:
>>>>> A lot of #ifdefs can be replaced by IS_ENABLED()
>>>>>
>>>>> Do so.
>>>>>
>>>>> This requires to have kernel_toc_addr() defined at all time
>>>>> as well as PPC_INST_LD_TOC and PPC_INST_STD_LR.
>>>>>
>>>>> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
>>>>> ---
>>>>> v2: Moved the setup of pop outside of the big if()/else() in __ftrace_make_nop()
>>>>> ---
>>>>> arch/powerpc/include/asm/code-patching.h | 2 -
>>>>> arch/powerpc/include/asm/module.h | 2 -
>>>>> arch/powerpc/include/asm/sections.h | 24 +--
>>>>> arch/powerpc/kernel/trace/ftrace.c | 182 +++++++++++------------
>>>>> 4 files changed, 103 insertions(+), 107 deletions(-)
>>>>>
>>>>
>>>> <snip>
>>>>
>>>>> @@ -710,6 +707,9 @@ void arch_ftrace_update_code(int command)
>>>>>
>>>>> #ifdef CONFIG_PPC64
>>>>> #define PACATOC offsetof(struct paca_struct, kernel_toc)
>>>>> +#else
>>>>> +#define PACATOC 0
>>>>> +#endif
>>>>
>>>> This conflicts with my fix for the ftrace init tramp:
>>>> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220516071422.463738-1-naveen.n.rao@linux.vnet.ibm.com/
>>>>
>>>> It probably makes sense to retain #ifdef CONFIG_PPC64, so that we can
>>>> get rid of the PACATOC. Here is an incremental diff:
>>>
>>> Where is the incremental diff meant to apply?
>>>
>>> It doesn't apply on top of patch 19, or at the end of the series.
Ugh, sorry. I had an additional patch that converts those
ftrace_[regs_]_caller uses to FTRACE_REGS_ADDR, which prevented one of
the hunks from applying.
>>
>> I think I worked out what you meant.
>>
>> Can you check what's in next-test:
>>
>> https://github.com/linuxppc/linux/commits/next-test
>
> Yes that looks fine.
+1
>
> As Naveen mentioned we can also get rid of PACATOC completely and use
> offsetof(struct paca_struct, kernel_toc) directly at the only place
> PACATOC is used.
Yes, or we can send it out as a separate cleanup.
Thanks,
Naveen
Powered by blists - more mailing lists