BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>, memxor@gmail.com
Cc: puranjay@kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 1/6] bpf: Derive the atomic load register in one place
Date: Tue, 11 Aug 2026 14:45:37 -0700	[thread overview]
Message-ID: <ab558ace2c4806c58db4b82f5d35953cce1b548f.camel@gmail.com> (raw)
In-Reply-To: <20260811131600.506721-1-daniel@iogearbox.net>

On Tue, 2026-08-11 at 15:15 +0200, Daniel Borkmann wrote:
> check_atomic_rmw() open codes the mapping from a BPF_ATOMIC to the register
> it reads the old value into, the BPF_STX case of insn_def_regno() open codes
> the very same mapping a second time, the const folding and the liveness
> transfer functions a third and a fourth time, and BPF JITs need it as well
> to know which register a faulting BPF_PROBE_ATOMIC has to clear.
> 
> Add a small helper so that all of them can share it. No functional change.
> The BPF_LOAD_ACQ case is there for the JITs, which do walk all instruction
> classes. const_reg_xfer() loses its explicit BPF_ATOMIC mode test since the
> helper checks class and mode itself; the BPF_PROBE_ATOMIC it additionally
> accepts cannot be seen there as it is only set from bpf_do_misc_fixups(),
> that is, after const folding has run. arg_track_xfer() keeps its mode test
> since that also guards the stack clearing next to it.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> ---
>   v2 -> v3:
>    - Also use the helper for const_fold and liveness (bpf ci)
>    - Drop the return value comment in verifier since the helper
>      comment already covers it (Jakub)
>   v1 -> v2:
>    - also convert insn_def_regno (Eduard, sashiko)
> 
>  include/linux/filter.h  | 24 ++++++++++++++++++++++++
>  kernel/bpf/const_fold.c | 11 +++--------
>  kernel/bpf/fixups.c     | 11 +----------
>  kernel/bpf/liveness.c   |  9 +++------
>  kernel/bpf/verifier.c   | 13 ++-----------
>  5 files changed, 33 insertions(+), 35 deletions(-)

Acked-by: Eduard Zingerman <eddyz87@gmail.com>

...

  parent reply	other threads:[~2026-08-11 21:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 13:15 [PATCH bpf-next v3 1/6] bpf: Derive the atomic load register in one place Daniel Borkmann
2026-08-11 13:15 ` [PATCH bpf-next v3 2/6] bpf, riscv: Clear fetch destination on faulting arena atomic Daniel Borkmann
2026-08-11 13:15 ` [PATCH bpf-next v3 3/6] bpf, x86: " Daniel Borkmann
2026-08-11 13:15 ` [PATCH bpf-next v3 4/6] bpf, arm64: " Daniel Borkmann
2026-08-12 12:18   ` Puranjay Mohan
2026-08-11 13:15 ` [PATCH bpf-next v3 5/6] bpf, s390: " Daniel Borkmann
2026-08-12  9:40   ` Ilya Leoshkevich
2026-08-11 13:16 ` [PATCH bpf-next v3 6/6] selftests/bpf: Add arena fault tests for atomics with fetch Daniel Borkmann
2026-08-11 14:27   ` bot+bpf-ci
2026-08-11 15:14     ` Daniel Borkmann
2026-08-11 15:57   ` Puranjay Mohan
2026-08-11 21:45 ` Eduard Zingerman [this message]
2026-08-12 17:40 ` [PATCH bpf-next v3 1/6] bpf: Derive the atomic load register in one place patchwork-bot+netdevbpf

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=ab558ace2c4806c58db4b82f5d35953cce1b548f.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=memxor@gmail.com \
    --cc=puranjay@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox