[PATCH bpf-next] riscv, bpf: Implement more atomic operations for RV64

Björn Töpel bjorn at kernel.org
Mon Apr 11 05:49:58 PDT 2022


On Sun, 10 Apr 2022 at 11:43, Pu Lehui <pulehui at huawei.com> wrote:
>
> This patch implement more bpf atomic operations for RV64.
> The added operations are shown below:
>
> atomic[64]_[fetch_]add
> atomic[64]_[fetch_]and
> atomic[64]_[fetch_]or
> atomic[64]_xchg
> atomic[64]_cmpxchg
>
> Since riscv specification does not provide AMO instruction for
> CAS operation, we use lr/sc instruction for cmpxchg operation,
> and AMO instructions for the rest ops. Tests "test_bpf.ko" and
> "test_progs -t atomic" have passed, as well as "test_verifier"
> with no new failure ceses.
>
> Signed-off-by: Pu Lehui <pulehui at huawei.com>

Thank you for implementing this! It's been long overdue.

Acked-by: Björn Töpel <bjorn at kernel.org>



More information about the linux-riscv mailing list