]> Git Repo - linux.git/commit
bpf: Add bitwise atomic instructions
authorBrendan Jackman <[email protected]>
Thu, 14 Jan 2021 18:17:49 +0000 (18:17 +0000)
committerAlexei Starovoitov <[email protected]>
Fri, 15 Jan 2021 02:34:29 +0000 (18:34 -0800)
commit981f94c3e92146705baf97fb417a5ed1ab1a79a5
tree3e9cd30902659db0e4de8f9afad972f259d9dcf9
parent462910670e4ac91509829c5549bd0227668176fb
bpf: Add bitwise atomic instructions

This adds instructions for

atomic[64]_[fetch_]and
atomic[64]_[fetch_]or
atomic[64]_[fetch_]xor

All these operations are isomorphic enough to implement with the same
verifier, interpreter, and x86 JIT code, hence being a single commit.

The main interesting thing here is that x86 doesn't directly support
the fetch_ version these operations, so we need to generate a CMPXCHG
loop in the JIT. This requires the use of two temporary registers,
IIUC it's safe to use BPF_REG_AX and x86's AUX_REG for this purpose.

Signed-off-by: Brendan Jackman <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
arch/x86/net/bpf_jit_comp.c
include/linux/filter.h
kernel/bpf/core.c
kernel/bpf/disasm.c
kernel/bpf/verifier.c
tools/include/linux/filter.h
This page took 0.077295 seconds and 4 git commands to generate.