From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Benjamin Gray <bgray@linux.ibm.com>,
"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>,
"ardb@kernel.org" <ardb@kernel.org>,
"jbaron@akamai.com" <jbaron@akamai.com>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"npiggin@gmail.com" <npiggin@gmail.com>,
"jpoimboe@kernel.org" <jpoimboe@kernel.org>
Subject: Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function
Date: Mon, 19 Sep 2022 06:38:05 +0000 [thread overview]
Message-ID: <05f79cf0-bdb3-6c17-ed32-4b4b381226ef@csgroup.eu> (raw)
In-Reply-To: <20220916062330.430468-2-bgray@linux.ibm.com>
Le 16/09/2022 à 08:23, Benjamin Gray a écrit :
>
> -static int do_patch_instruction(u32 *addr, ppc_inst_t instr)
> +static int patch_text(void *dest, const void *src, size_t size, bool is_exec)
> {
> int err;
> unsigned long flags;
>
> - /*
> - * During early early boot patch_instruction is called
> - * when text_poke_area is not ready, but we still need
> - * to allow patching. We just do the plain old patching
> - */
> + /* Make sure we aren't patching a freed init section */
> + if (static_branch_likely(&init_mem_is_free) && init_section_contains(dest, 4))
> + return 0;
> +
> if (!static_branch_likely(&poking_init_done))
> - return raw_patch_instruction(addr, instr);
> + return __patch_text(dest, src, size, is_exec, dest);
>
Test ordering looks odd. How can init_mem_is_free be true and
poking_init_done be false ?
> local_irq_save(flags);
> - err = __do_patch_instruction(addr, instr);
> + err = do_patch_text(dest, src, size, is_exec);
> local_irq_restore(flags);
>
> return err;
> }
next prev parent reply other threads:[~2022-09-19 6:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 6:23 [PATCH 0/6] Out-of-line static calls for powerpc64 ELF V2 Benjamin Gray
2022-09-16 6:23 ` [PATCH 1/6] powerpc/code-patching: Implement generic text patching function Benjamin Gray
2022-09-16 9:39 ` kernel test robot
2022-09-16 11:16 ` kernel test robot
2022-09-19 6:04 ` Christophe Leroy
2022-09-19 6:49 ` Benjamin Gray
2022-09-19 7:16 ` Christophe Leroy
2022-09-20 2:32 ` Benjamin Gray
2022-09-20 5:44 ` Christophe Leroy
2022-09-20 7:01 ` Benjamin Gray
2022-09-19 6:38 ` Christophe Leroy [this message]
2022-09-20 1:49 ` Benjamin Gray
2022-09-16 6:23 ` [PATCH 2/6] powerpc/module: Handle caller-saved TOC in module linker Benjamin Gray
2022-09-19 6:09 ` Christophe Leroy
2022-09-16 6:23 ` [PATCH 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub Benjamin Gray
2022-09-19 6:11 ` Christophe Leroy
2022-09-16 6:23 ` [PATCH 4/6] static_call: Move static call selftest to static_call_selftest.c Benjamin Gray
2022-09-20 4:30 ` Andrew Donnellan
2022-09-16 6:23 ` [PATCH 5/6] powerpc/64: Add support for out-of-line static calls Benjamin Gray
2022-09-16 8:32 ` kernel test robot
2022-09-16 6:23 ` [PATCH 6/6] powerpc/64: Add tests " Benjamin Gray
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=05f79cf0-bdb3-6c17-ed32-4b4b381226ef@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=ajd@linux.ibm.com \
--cc=ardb@kernel.org \
--cc=bgray@linux.ibm.com \
--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).