From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Jordan Niethe <jniethe5@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: ajd@linux.ibm.com, npiggin@gmail.com, cmr@codefail.de,
aneesh.kumar@linux.ibm.com, naveen.n.rao@linux.ibm.com,
dja@axtens.net
Subject: Re: [PATCH v12 4/8] powerpc/bpf: Remove bpf_jit_free()
Date: Fri, 7 May 2021 07:51:54 +0200 [thread overview]
Message-ID: <a4fb13b5-79f0-f50a-b301-2329f9715709@csgroup.eu> (raw)
In-Reply-To: <20210506023449.3568630-5-jniethe5@gmail.com>
Le 06/05/2021 à 04:34, Jordan Niethe a écrit :
> Commit 74451e66d516 ("bpf: make jited programs visible in traces") added
> a default bpf_jit_free() implementation. Powerpc did not use the default
> bpf_jit_free() as powerpc did not set the images read-only. The default
> bpf_jit_free() called bpf_jit_binary_unlock_ro() is why it could not be
> used for powerpc.
>
> Commit d53d2f78cead ("bpf: Use vmalloc special flag") moved keeping
> track of read-only memory to vmalloc. This included removing
> bpf_jit_binary_unlock_ro(). Therefore there is no reason powerpc needs
> its own bpf_jit_free(). Remove it.
>
> Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v11: New to series
> ---
> arch/powerpc/net/bpf_jit_comp.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
> index 798ac4350a82..6c8c268e4fe8 100644
> --- a/arch/powerpc/net/bpf_jit_comp.c
> +++ b/arch/powerpc/net/bpf_jit_comp.c
> @@ -257,15 +257,3 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
>
> return fp;
> }
> -
> -/* Overriding bpf_jit_free() as we don't set images read-only. */
> -void bpf_jit_free(struct bpf_prog *fp)
> -{
> - unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
> - struct bpf_binary_header *bpf_hdr = (void *)addr;
> -
> - if (fp->jited)
> - bpf_jit_binary_free(bpf_hdr);
> -
> - bpf_prog_unlock_free(fp);
> -}
>
next prev parent reply other threads:[~2021-05-07 5:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 2:34 [PATCH v12 0/8] powerpc: Further Strict RWX support Jordan Niethe
2021-05-06 2:34 ` [PATCH v12 1/8] powerpc/mm: Implement set_memory() routines Jordan Niethe
2021-05-06 2:34 ` [PATCH v12 2/8] powerpc/lib/code-patching: Set up Strict RWX patching earlier Jordan Niethe
2021-05-07 5:51 ` Christophe Leroy
2021-05-06 2:34 ` [PATCH v12 3/8] powerpc/kprobes: Mark newly allocated probes as ROX Jordan Niethe
2021-05-07 5:34 ` Christophe Leroy
2021-05-06 2:34 ` [PATCH v12 4/8] powerpc/bpf: Remove bpf_jit_free() Jordan Niethe
2021-05-07 5:51 ` Christophe Leroy [this message]
2021-05-06 2:34 ` [PATCH v12 5/8] powerpc/bpf: Write protect JIT code Jordan Niethe
2021-05-07 5:53 ` Christophe Leroy
2021-05-06 2:34 ` [PATCH v12 6/8] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX Jordan Niethe
2021-05-07 5:35 ` Christophe Leroy
2021-05-10 0:52 ` Jordan Niethe
2021-05-06 2:34 ` [PATCH v12 7/8] powerpc/mm: implement set_memory_attr() Jordan Niethe
2021-05-06 2:34 ` [PATCH v12 8/8] powerpc/32: use set_memory_attr() Jordan Niethe
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=a4fb13b5-79f0-f50a-b301-2329f9715709@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=ajd@linux.ibm.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=cmr@codefail.de \
--cc=dja@axtens.net \
--cc=jniethe5@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
/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).