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

Song Liu songliubraving at fb.com
Sun Apr 10 22:44:57 PDT 2022



> On Apr 10, 2022, at 3:12 AM, 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>

LGTM. 

Acked-by: Song Liu <songliubraving at fb.com>




More information about the linux-riscv mailing list