]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc64/bpf: Introduce bpf_jit_emit_atomic_ops() to emit atomic instructions
authorSaket Kumar Bhaskar <skb99@linux.ibm.com>
Thu, 4 Sep 2025 10:08:34 +0000 (15:38 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Sat, 6 Sep 2025 10:19:44 +0000 (15:49 +0530)
commit45ed2e8b0591eb6211d79f436f76c3af31e626af
tree00d18e100d21f6502f937dbfe0d849e3aba259ac
parenta2485d06cad3741303b9414e44f9b6d76d3713f2
powerpc64/bpf: Introduce bpf_jit_emit_atomic_ops() to emit atomic instructions

The existing code for emitting bpf atomic instruction sequences for
atomic operations such as XCHG, CMPXCHG, ADD, AND, OR, and XOR has been
refactored into a reusable function, bpf_jit_emit_ppc_atomic_op().
It also computes the jump offset and tracks the instruction index for jited
LDARX/LWARX to be used in case it causes a fault.

Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250904100835.1100423-4-skb99@linux.ibm.com
arch/powerpc/net/bpf_jit_comp64.c