]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add BPF_FETCH field / create atomic_fetch_add instruction
authorBrendan Jackman <jackmanb@google.com>
Thu, 14 Jan 2021 18:17:46 +0000 (18:17 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 Jan 2021 02:34:29 +0000 (18:34 -0800)
commit03939617f5823aca7525b3c86cc2ac8f2b8a178d
treeedd181e67503cb404dfa55cfaae6d757db3e22b6
parent8e9330f150bb169f3eb17f61c876a7d8e070e9b2
bpf: Add BPF_FETCH field / create atomic_fetch_add instruction

The BPF_FETCH field can be set in bpf_insn.imm, for BPF_ATOMIC
instructions, in order to have the previous value of the
atomically-modified memory location loaded into the src register
after an atomic op is carried out.

Suggested-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210114181751.768687-7-jackmanb@google.com
arch/x86/net/bpf_jit_comp.c
include/linux/filter.h
include/uapi/linux/bpf.h
kernel/bpf/core.c
kernel/bpf/disasm.c
kernel/bpf/verifier.c
tools/include/linux/filter.h
tools/include/uapi/linux/bpf.h