From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Christophe Leroy <christophe.leroy@csgroup.eu>, Michael Ellerman <mpe@ellerman.id.au>, Paul Mackerras <paulus@samba.org> Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org> Subject: Re: [PATCH v3 19/25] powerpc/ftrace: Minimise number of #ifdefs Date: Wed, 18 May 2022 22:33:46 +0530 [thread overview] Message-ID: <1652893170.ef56yw5h6t.naveen@linux.ibm.com> (raw) In-Reply-To: <a7e47e3d-9b2b-ee12-d38c-3e6bbba83f7d@csgroup.eu> Christophe Leroy wrote: > > > Le 18/05/2022 à 14:03, Michael Ellerman a écrit : >> Michael Ellerman <mpe@ellerman.id.au> writes: >>> "Naveen N. Rao" <naveen.n.rao@linux.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@csgroup.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
WARNING: multiple messages have this Message-ID (diff)
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Christophe Leroy <christophe.leroy@csgroup.eu>, Michael Ellerman <mpe@ellerman.id.au>, Paul Mackerras <paulus@samba.org> Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH v3 19/25] powerpc/ftrace: Minimise number of #ifdefs Date: Wed, 18 May 2022 22:33:46 +0530 [thread overview] Message-ID: <1652893170.ef56yw5h6t.naveen@linux.ibm.com> (raw) In-Reply-To: <a7e47e3d-9b2b-ee12-d38c-3e6bbba83f7d@csgroup.eu> Christophe Leroy wrote: > > > Le 18/05/2022 à 14:03, Michael Ellerman a écrit : >> Michael Ellerman <mpe@ellerman.id.au> writes: >>> "Naveen N. Rao" <naveen.n.rao@linux.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@csgroup.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
next prev parent reply other threads:[~2022-05-18 17:04 UTC|newest] Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-09 5:35 [PATCH v3 00/25] powerpc: ftrace optimisation and cleanup and more [v3] Christophe Leroy 2022-05-09 5:35 ` Christophe Leroy 2022-05-09 5:35 ` [PATCH v3 01/25] powerpc/ftrace: Refactor prepare_ftrace_return() Christophe Leroy 2022-05-09 5:35 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 02/25] powerpc/ftrace: Remove redundant create_branch() calls Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 03/25] powerpc/code-patching: Inline is_offset_in_{cond}_branch_range() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 04/25] powerpc/ftrace: Use is_offset_in_branch_range() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 05/25] powerpc/code-patching: Inline create_branch() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 06/25] powerpc/ftrace: Inline ftrace_modify_code() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 07/25] powerpc/ftrace: Use patch_instruction() return directly Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 08/25] powerpc: Add CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2 Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 09/25] powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2} Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 10/25] powerpc: Finalise cleanup around ABI use Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 11/25] powerpc/ftrace: Make __ftrace_make_{nop/call}() common to PPC32 and PPC64 Christophe Leroy 2022-08-08 18:41 ` Nick Desaulniers 2022-08-08 18:41 ` Nick Desaulniers 2022-05-09 5:36 ` Christophe Leroy 2022-08-08 18:47 ` Nick Desaulniers 2022-08-08 18:47 ` Nick Desaulniers 2022-08-09 6:25 ` Naveen N. Rao 2022-08-09 6:25 ` Naveen N. Rao 2022-05-09 5:36 ` [PATCH v3 12/25] powerpc/ftrace: Don't include ftrace.o for CONFIG_FTRACE_SYSCALLS Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 13/25] powerpc/ftrace: Use CONFIG_FUNCTION_TRACER instead of CONFIG_DYNAMIC_FTRACE Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 14/25] powerpc/ftrace: Remove ftrace_plt_tramps[] Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 15/25] powerpc/ftrace: Use BRANCH_SET_LINK instead of value 1 Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 16/25] powerpc/ftrace: Use PPC_RAW_xxx() macros instead of opencoding Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 17/25] powerpc/ftrace: Use size macro " Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 18/25] powerpc/ftrace: Simplify expected_nop_sequence() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 19/25] powerpc/ftrace: Minimise number of #ifdefs Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-18 9:45 ` Naveen N. Rao 2022-05-18 9:45 ` Naveen N. Rao 2022-05-18 10:08 ` Christophe Leroy 2022-05-18 10:08 ` Christophe Leroy 2022-05-18 11:19 ` Michael Ellerman 2022-05-18 11:19 ` Michael Ellerman 2022-05-18 12:03 ` Michael Ellerman 2022-05-18 12:03 ` Michael Ellerman 2022-05-18 12:12 ` Christophe Leroy 2022-05-18 12:12 ` Christophe Leroy 2022-05-18 17:03 ` Naveen N. Rao [this message] 2022-05-18 17:03 ` Naveen N. Rao 2022-05-18 12:04 ` Christophe Leroy 2022-05-18 12:04 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 20/25] powerpc/inst: Add __copy_inst_from_kernel_nofault() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 21/25] powerpc/ftrace: Don't use copy_from_kernel_nofault() in module_trampoline_target() Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 22/25] powerpc/inst: Remove PPC_INST_BRANCH Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 23/25] powerpc/modules: Use PPC_LI macros instead of opencoding Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 24/25] powerpc/inst: Remove PPC_INST_BL Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-09 5:36 ` [PATCH v3 25/25] powerpc/opcodes: Remove unused PPC_INST_XXX macros Christophe Leroy 2022-05-09 5:36 ` Christophe Leroy 2022-05-24 11:09 ` [PATCH v3 00/25] powerpc: ftrace optimisation and cleanup and more [v3] Michael Ellerman
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=1652893170.ef56yw5h6t.naveen@linux.ibm.com \ --to=naveen.n.rao@linux.vnet.ibm.com \ --cc=benh@kernel.crashing.org \ --cc=christophe.leroy@csgroup.eu \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=mpe@ellerman.id.au \ --cc=paulus@samba.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.