From: Pu Lehui Date: Tue, 30 Jan 2024 12:46:58 +0000 (+0000) Subject: riscv, bpf: Enable inline bpf_kptr_xchg() for RV64 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=69065aa11ca680d76a6c6bc088aa0f0abe24afdb;p=linux.git 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 Signed-off-by: Daniel Borkmann Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20240130124659.670321-2-pulehui@huaweicloud.com --- diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c index fda6b4f6a4c12..869e4282a2c42 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -1806,3 +1806,8 @@ bool bpf_jit_supports_kfunc_call(void) { return true; } + +bool bpf_jit_supports_ptr_xchg(void) +{ + return true; +}