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

Configure Feed

Select the types of activity you want to include in your feed.

riscv, bpf: Add Zacas instructions

Add Zacas instructions introduced by [0] to reduce code size and
improve performance of RV64 JIT.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Björn Töpel <bjorn@rivosinc.com>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Acked-by: Björn Töpel <bjorn@kernel.org>
Link: https://github.com/riscvarchive/riscv-zacas/releases/download/v1.0/riscv-zacas.pdf [0]
Link: https://lore.kernel.org/bpf/20250719091730.2660197-7-pulehui@huaweicloud.com

authored by

Pu Lehui and committed by
Daniel Borkmann
de39d2c4 5090b339

+11
+11
arch/riscv/net/bpf_jit.h
··· 751 751 return rv_css_insn(0x6, imm, rs2, 0x2); 752 752 } 753 753 754 + /* RVZACAS instructions. */ 755 + static inline u32 rvzacas_amocas_w(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) 756 + { 757 + return rv_amo_insn(0x5, aq, rl, rs2, rs1, 2, rd, 0x2f); 758 + } 759 + 760 + static inline u32 rvzacas_amocas_d(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) 761 + { 762 + return rv_amo_insn(0x5, aq, rl, rs2, rs1, 3, rd, 0x2f); 763 + } 764 + 754 765 /* RVZBA instructions. */ 755 766 static inline u32 rvzba_sh2add(u8 rd, u8 rs1, u8 rs2) 756 767 {