linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Gray <bgray@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: "ajd@linux.ibm.com" <ajd@linux.ibm.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"npiggin@gmail.com" <npiggin@gmail.com>,
	"ardb@kernel.org" <ardb@kernel.org>,
	"jbaron@akamai.com" <jbaron@akamai.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"jpoimboe@kernel.org" <jpoimboe@kernel.org>
Subject: Re: [PATCH v2 1/6] powerpc/code-patching: Implement generic text patching function
Date: Wed, 28 Sep 2022 11:30:02 +1000	[thread overview]
Message-ID: <d0c9bde1e7be8004155bb8179f9ea2a17d874471.camel@linux.ibm.com> (raw)
In-Reply-To: <7c06a079-4189-e09f-939e-f672e7ff1ab1@csgroup.eu>

On Tue, 2022-09-27 at 06:40 +0000, Christophe Leroy wrote:
> > +       /* Flush on the EA that may be executed in case of a non-
> > coherent icache */
> > +       icbi(prog_addr);
> 
> prog_addr is a misleading name ? Is that the address at which you 
> program it ? Is that the address the programs runs at ?
> 
> exec_addr was a lot more explicit as it clearly defines the address
> at 
> which the code is executed.

I'm not sure what it could be confused for other than "the address the
program uses" (be it uses for executing, or uses as data). I just
called it that because it's not necessarily executed, so 'exec_addr' is
misleading (to the extent it matters in the first place...).

> > +       if (IS_ENABLED(CONFIG_PPC64) && L1_CACHE_BYTES < 64)
> > +               icbi(prog_addr + size - 1);
> 
> This doesn't exist today.
> 
> I'd rather have:
> 
>         BUILD_BUG_ON(IS_ENABLED(CONFIG_PPC64) && L1_CACHE_BYTES <
> 64);

Sure, I can adjust the style.

> > +static int __always_inline __do_patch_memory(void *dest, unsigned
> > long src, size_t size)
> >   {
> >         int err;
> >         u32 *patch_addr;
> > -       unsigned long text_poke_addr;
> >         pte_t *pte;
> > -       unsigned long pfn = get_patch_pfn(addr);
> > -
> > -       text_poke_addr = (unsigned
> > long)__this_cpu_read(text_poke_area)->addr & PAGE_MASK;
> > -       patch_addr = (u32 *)(text_poke_addr +
> > offset_in_page(addr));
> > +       unsigned long text_poke_addr = (unsigned
> > long)__this_cpu_read(text_poke_area)->addr & PAGE_MASK;
> > +       unsigned long pfn = get_patch_pfn(dest);
> > 
> > +       patch_addr = (u32 *)(text_poke_addr +
> > offset_in_page(dest));
> 
> Can we avoid this churn ?
> Ok, you want to change 'addr' to 'dest', can we leave everything else
> as 
> is ?

'addr' was only renamed because the v1 used a pointer to the data, so
'addr' was ambiguous. I'll restore it to 'addr' for v3.

I'll also restore the formatting.

  reply	other threads:[~2022-09-28  2:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26  6:43 [PATCH v2 0/6] Out-of-line static calls for powerpc64 ELF V2 Benjamin Gray
2022-09-26  6:43 ` [PATCH v2 1/6] powerpc/code-patching: Implement generic text patching function Benjamin Gray
2022-09-26  8:56   ` kernel test robot
2022-09-26 13:28   ` kernel test robot
2022-09-26 14:33   ` Christophe Leroy
2022-09-27  2:57     ` Benjamin Gray
2022-09-27  5:54       ` Christophe Leroy
2022-09-27  6:40   ` Christophe Leroy
2022-09-28  1:30     ` Benjamin Gray [this message]
2022-09-28 10:52       ` Christophe Leroy
2022-09-27  7:30   ` Christophe Leroy
2022-09-26  6:43 ` [PATCH v2 2/6] powerpc/module: Handle caller-saved TOC in module linker Benjamin Gray
2022-09-26  6:43 ` [PATCH v2 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub Benjamin Gray
2022-09-26 14:49   ` Christophe Leroy
2022-09-27  3:12     ` Benjamin Gray
2022-09-26  6:43 ` [PATCH v2 4/6] static_call: Move static call selftest to static_call_selftest.c Benjamin Gray
2022-09-26 14:50   ` Christophe Leroy
2022-09-26  6:43 ` [PATCH v2 5/6] powerpc/64: Add support for out-of-line static calls Benjamin Gray
2022-09-26 13:16   ` Christophe Leroy
2022-09-27  5:18     ` Benjamin Gray
2022-09-27  6:07       ` Christophe Leroy
2022-09-26 14:54   ` Christophe Leroy
2022-09-27  3:21     ` Benjamin Gray
2022-09-27  6:01       ` Christophe Leroy
2022-09-26  6:43 ` [PATCH v2 6/6] powerpc/64: Add tests " Benjamin Gray
2022-09-26 14:55   ` Christophe Leroy
2022-09-27  3:31     ` Benjamin Gray
2022-09-27  6:05       ` Christophe Leroy
2022-09-26 14:19 ` [PATCH v2 0/6] Out-of-line static calls for powerpc64 ELF V2 Christophe Leroy

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=d0c9bde1e7be8004155bb8179f9ea2a17d874471.camel@linux.ibm.com \
    --to=bgray@linux.ibm.com \
    --cc=ajd@linux.ibm.com \
    --cc=ardb@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).