bpf, arm64: remove prefetch insn in xadd mapping
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 26 Apr 2019 19:48:21 +0000 (21:48 +0200)
committerCosmin Tanislav <demonsingur@gmail.com>
Thu, 16 May 2024 07:58:22 +0000 (10:58 +0300)
commit17ae338fa47bad52d32e0452b945feb221724d99
tree950408e5f599e52fee024eedfb2872a74500c618
parent2a6ab896efcf0443747b582ff6847fb9ecf4e4a2
bpf, arm64: remove prefetch insn in xadd mapping

commit 8968c67a82ab7501bc3b9439c3624a49b42fe54c upstream.

Prefetch-with-intent-to-write is currently part of the XADD mapping in
the AArch64 JIT and follows the kernel's implementation of atomic_add.
This may interfere with other threads executing the LDXR/STXR loop,
leading to potential starvation and fairness issues. Drop the optional
prefetch instruction.

Fixes: 85f68fe89832 ("bpf, arm64: implement jiting of BPF_XADD")
Reported-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/net/bpf_jit.h
arch/arm64/net/bpf_jit_comp.c