]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
riscv, bpf: Enable inline bpf_kptr_xchg() for RV64
authorPu Lehui <pulehui@huawei.com>
Tue, 30 Jan 2024 12:46:58 +0000 (12:46 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 1 Feb 2024 10:35:48 +0000 (11:35 +0100)
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
arch/riscv/net/bpf_jit_comp64.c

index fda6b4f6a4c12015d197ee16d1d06305c8bd59c7..869e4282a2c4214fc57ebf21be9b3b5e3ff47e5f 100644 (file)
@@ -1806,3 +1806,8 @@ bool bpf_jit_supports_kfunc_call(void)
 {
        return true;
 }
+
+bool bpf_jit_supports_ptr_xchg(void)
+{
+       return true;
+}