]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, x86: Remove unnecessary handling of BPF_SUB atomic op
authorHou Tao <houtao1@huawei.com>
Thu, 27 Jan 2022 08:32:40 +0000 (16:32 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 27 Jan 2022 21:47:05 +0000 (22:47 +0100)
commit76b7c3f53f6c3e5e32ed5095136f169e3118bc73
tree563e5069e58c36d50ffada0efadcf232fc4b125a
parent65a1fc73a3c117ccd240a73c9fc14be2360a1671
bpf, x86: Remove unnecessary handling of BPF_SUB atomic op

According to the LLVM commit (https://reviews.llvm.org/D72184),
sync_fetch_and_sub() is implemented as a negation followed by
sync_fetch_and_add(), so there will be no BPF_SUB op, thus just
remove it. BPF_SUB is also rejected by the verifier anyway.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Brendan Jackman <jackmanb@google.com>
Link: https://lore.kernel.org/bpf/20220127083240.1425481-1-houtao1@huawei.com
arch/x86/net/bpf_jit_comp.c