All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Kernel Team <kernel-team@fb.com>,
	Peter Zijlstra <peterz@infradead.org>, X86 ML <x86@kernel.org>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	Song Liu <songliubraving@fb.com>
Subject: Re: [PATCH v7 bpf-next 8/9] bpf: introduce bpf_jit_binary_pack_[alloc|finalize|free]
Date: Mon, 31 Jan 2022 16:35:23 -0800	[thread overview]
Message-ID: <CAPhsuW7911=38ym7ko23KLCFrgqCm0VFdQSu8Mqv+5Avc3sTFg@mail.gmail.com> (raw)
In-Reply-To: <c5100e9a-3e8a-a554-1d77-50d7b296340b@iogearbox.net>

On Mon, Jan 31, 2022 at 4:21 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 1/29/22 12:45 AM, Song Liu wrote:
> [...]
[...]
> > +}
> > +
> > +/* Copy JITed text from rw_header to its final location, the ro_header. */
> > +int bpf_jit_binary_pack_finalize(struct bpf_prog *prog,
> > +                              struct bpf_binary_header *ro_header,
> > +                              struct bpf_binary_header *rw_header)
> > +{
> > +     void *ptr;
> > +
> > +     ptr = bpf_arch_text_copy(ro_header, rw_header, rw_header->size);
>
> Does this need to be wrapped with a text_mutex lock/unlock pair given
> text_poke_copy() internally relies on __text_poke() ?

Yes... Good catch. I guess we may do the lock in text_poke_copy().

Thanks,
Song

  reply	other threads:[~2022-02-01  0:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 23:45 [PATCH v7 bpf-next 0/9] bpf_prog_pack allocator Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 1/9] x86/Kconfig: select HAVE_ARCH_HUGE_VMALLOC with HAVE_ARCH_HUGE_VMAP Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 2/9] bpf: use bytes instead of pages for bpf_jit_[charge|uncharge]_modmem Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 3/9] bpf: use size instead of pages in bpf_binary_header Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 4/9] bpf: use prog->jited_len in bpf_prog_ksym_set_addr() Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 5/9] x86/alternative: introduce text_poke_copy Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 6/9] bpf: introduce bpf_arch_text_copy Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 7/9] bpf: introduce bpf_prog_pack allocator Song Liu
2022-02-01  0:06   ` Daniel Borkmann
2022-02-01  1:34     ` Song Liu
2022-01-28 23:45 ` [PATCH v7 bpf-next 8/9] bpf: introduce bpf_jit_binary_pack_[alloc|finalize|free] Song Liu
2022-02-01  0:21   ` Daniel Borkmann
2022-02-01  0:35     ` Song Liu [this message]
2022-01-28 23:45 ` [PATCH v7 bpf-next 9/9] bpf, x86_64: use bpf_jit_binary_pack_alloc Song Liu

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='CAPhsuW7911=38ym7ko23KLCFrgqCm0VFdQSu8Mqv+5Avc3sTFg@mail.gmail.com' \
    --to=song@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=iii@linux.ibm.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    --cc=x86@kernel.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 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.