Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

riscv, bpf: Enable inline bpf_kptr_xchg() for RV64

RV64 JIT supports 64-bit BPF_XCHG atomic instructions. At the same time,
the underlying implementation of xchg() and atomic64_xchg() in RV64 both
are raw_xchg() that supported 64-bit. Therefore inline bpf_kptr_xchg()
will have equivalent semantics. Let's inline it for better performance.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Björn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/bpf/20240130124659.670321-2-pulehui@huaweicloud.com

authored by

Pu Lehui and committed by
Daniel Borkmann
69065aa1 088a464e

+5
+5
arch/riscv/net/bpf_jit_comp64.c
··· 1806 1806 { 1807 1807 return true; 1808 1808 } 1809 + 1810 + bool bpf_jit_supports_ptr_xchg(void) 1811 + { 1812 + return true; 1813 + }