]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Factor out check_atomic_rmw()
authorPeilin Ye <yepeilin@google.com>
Mon, 3 Mar 2025 05:37:19 +0000 (05:37 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 15 Mar 2025 18:48:26 +0000 (11:48 -0700)
commit2626ffe9f33f9e27aa0a60b2761c2d0760dbcca4
treed41dfd097cc54a758419174db74e44c2be0106f1
parent66faaea94e1a8e8197d98de6e9d07591970837d6
bpf: Factor out check_atomic_rmw()

Currently, check_atomic() only handles atomic read-modify-write (RMW)
instructions.  Since we are planning to introduce other types of atomic
instructions (i.e., atomic load/store), extract the existing RMW
handling logic into its own function named check_atomic_rmw().

Remove the @insn_idx parameter as it is not really necessary.  Use
'env->insn_idx' instead, as in other places in verifier.c.

Signed-off-by: Peilin Ye <yepeilin@google.com>
Link: https://lore.kernel.org/r/6323ac8e73a10a1c8ee547c77ed68cf8eb6b90e1.1740978603.git.yepeilin@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c