* [PATCH bpf-next v4 0/2] riscv, bpf: Introduce Zba optimization @ 2024-05-24 7:55 ` Xiao Wang 0 siblings, 0 replies; 12+ messages in thread From: Xiao Wang @ 2024-05-24 7:55 UTC (permalink / raw) To: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang The riscv Zba extension provides instructions to accelerate the generation of addresses that index into arrays of basic data types, bpf JIT generated insn counts could be reduced by leveraging Zba for address calculation. The first patch introduces RISCV_ISA_ZBA Kconfig option and uses Zba add.uw insn to optimize zextw operation. The second patch uses Zba shift-and-add insns to optimize address calculation for array of unsigned long data. Thanks, Xiao v4: * Combine the second patch (previously v1) and the first patch into a series. (Bjorn) * Rebase the second patch on bpf-next tree. * Link to v3: https://lore.kernel.org/bpf/20240516090430.493122-1-xiao.w.wang@intel.com/ v3: * Remove the Kconfig dependencies on TOOLCHAIN_HAS_ZBA and RISCV_ALTERNATIVE. (Andrew) * Link to v2: https://lore.kernel.org/bpf/20240511023436.3282285-1-xiao.w.wang@intel.com/ v2: * Add Zba description in the Kconfig. (Lehui) * Reword the Kconfig help message to make it clearer. (Conor) * Link to v1: https://lore.kernel.org/bpf/20240507104528.435980-1-xiao.w.wang@intel.com/ Xiao Wang (2): riscv, bpf: Optimize zextw insn with Zba extension riscv, bpf: Introduce shift add helper with Zba optimization arch/riscv/Kconfig | 12 ++++++++ arch/riscv/net/bpf_jit.h | 51 +++++++++++++++++++++++++++++++++ arch/riscv/net/bpf_jit_comp32.c | 3 +- arch/riscv/net/bpf_jit_comp64.c | 9 ++---- 4 files changed, 67 insertions(+), 8 deletions(-) base-commit: 5c1672705a1a2389f5ad78e0fea6f08ed32d6f18 -- 2.25.1 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 0/2] riscv, bpf: Introduce Zba optimization @ 2024-05-24 7:55 ` Xiao Wang 0 siblings, 0 replies; 12+ messages in thread From: Xiao Wang @ 2024-05-24 7:55 UTC (permalink / raw) To: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang The riscv Zba extension provides instructions to accelerate the generation of addresses that index into arrays of basic data types, bpf JIT generated insn counts could be reduced by leveraging Zba for address calculation. The first patch introduces RISCV_ISA_ZBA Kconfig option and uses Zba add.uw insn to optimize zextw operation. The second patch uses Zba shift-and-add insns to optimize address calculation for array of unsigned long data. Thanks, Xiao v4: * Combine the second patch (previously v1) and the first patch into a series. (Bjorn) * Rebase the second patch on bpf-next tree. * Link to v3: https://lore.kernel.org/bpf/20240516090430.493122-1-xiao.w.wang@intel.com/ v3: * Remove the Kconfig dependencies on TOOLCHAIN_HAS_ZBA and RISCV_ALTERNATIVE. (Andrew) * Link to v2: https://lore.kernel.org/bpf/20240511023436.3282285-1-xiao.w.wang@intel.com/ v2: * Add Zba description in the Kconfig. (Lehui) * Reword the Kconfig help message to make it clearer. (Conor) * Link to v1: https://lore.kernel.org/bpf/20240507104528.435980-1-xiao.w.wang@intel.com/ Xiao Wang (2): riscv, bpf: Optimize zextw insn with Zba extension riscv, bpf: Introduce shift add helper with Zba optimization arch/riscv/Kconfig | 12 ++++++++ arch/riscv/net/bpf_jit.h | 51 +++++++++++++++++++++++++++++++++ arch/riscv/net/bpf_jit_comp32.c | 3 +- arch/riscv/net/bpf_jit_comp64.c | 9 ++---- 4 files changed, 67 insertions(+), 8 deletions(-) base-commit: 5c1672705a1a2389f5ad78e0fea6f08ed32d6f18 -- 2.25.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 1/2] riscv, bpf: Optimize zextw insn with Zba extension 2024-05-24 7:55 ` Xiao Wang @ 2024-05-24 7:55 ` Xiao Wang -1 siblings, 0 replies; 12+ messages in thread From: Xiao Wang @ 2024-05-24 7:55 UTC (permalink / raw) To: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang, Andrew Jones The Zba extension provides add.uw insn which can be used to implement zext.w with rs2 set as ZERO. Signed-off-by: Xiao Wang <xiao.w.wang@intel.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Pu Lehui <pulehui@huawei.com> Tested-by: Pu Lehui <pulehui@huawei.com> --- arch/riscv/Kconfig | 12 ++++++++++++ arch/riscv/net/bpf_jit.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index be09c8836d56..a117adff5810 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -593,6 +593,18 @@ config TOOLCHAIN_HAS_VECTOR_CRYPTO def_bool $(as-instr, .option arch$(comma) +v$(comma) +zvkb) depends on AS_HAS_OPTION_ARCH +config RISCV_ISA_ZBA + bool "Zba extension support for bit manipulation instructions" + default y + help + Add support for enabling optimisations in the kernel when the Zba + extension is detected at boot. + + The Zba extension provides instructions to accelerate the generation + of addresses that index into arrays of basic data types. + + If you don't know what to do here, say Y. + config RISCV_ISA_ZBB bool "Zbb extension support for bit manipulation instructions" depends on TOOLCHAIN_HAS_ZBB diff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h index fdbf88ca8b70..97041b58237a 100644 --- a/arch/riscv/net/bpf_jit.h +++ b/arch/riscv/net/bpf_jit.h @@ -18,6 +18,11 @@ static inline bool rvc_enabled(void) return IS_ENABLED(CONFIG_RISCV_ISA_C); } +static inline bool rvzba_enabled(void) +{ + return IS_ENABLED(CONFIG_RISCV_ISA_ZBA) && riscv_has_extension_likely(RISCV_ISA_EXT_ZBA); +} + static inline bool rvzbb_enabled(void) { return IS_ENABLED(CONFIG_RISCV_ISA_ZBB) && riscv_has_extension_likely(RISCV_ISA_EXT_ZBB); @@ -939,6 +944,14 @@ static inline u16 rvc_sdsp(u32 imm9, u8 rs2) return rv_css_insn(0x7, imm, rs2, 0x2); } +/* RV64-only ZBA instructions. */ + +static inline u32 rvzba_zextw(u8 rd, u8 rs1) +{ + /* add.uw rd, rs1, ZERO */ + return rv_r_insn(0x04, RV_REG_ZERO, rs1, 0, rd, 0x3b); +} + #endif /* __riscv_xlen == 64 */ /* Helper functions that emit RVC instructions when possible. */ @@ -1161,6 +1174,11 @@ static inline void emit_zexth(u8 rd, u8 rs, struct rv_jit_context *ctx) static inline void emit_zextw(u8 rd, u8 rs, struct rv_jit_context *ctx) { + if (rvzba_enabled()) { + emit(rvzba_zextw(rd, rs), ctx); + return; + } + emit_slli(rd, rs, 32, ctx); emit_srli(rd, rd, 32, ctx); } -- 2.25.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 1/2] riscv, bpf: Optimize zextw insn with Zba extension @ 2024-05-24 7:55 ` Xiao Wang 0 siblings, 0 replies; 12+ messages in thread From: Xiao Wang @ 2024-05-24 7:55 UTC (permalink / raw) To: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang, Andrew Jones The Zba extension provides add.uw insn which can be used to implement zext.w with rs2 set as ZERO. Signed-off-by: Xiao Wang <xiao.w.wang@intel.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Pu Lehui <pulehui@huawei.com> Tested-by: Pu Lehui <pulehui@huawei.com> --- arch/riscv/Kconfig | 12 ++++++++++++ arch/riscv/net/bpf_jit.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index be09c8836d56..a117adff5810 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -593,6 +593,18 @@ config TOOLCHAIN_HAS_VECTOR_CRYPTO def_bool $(as-instr, .option arch$(comma) +v$(comma) +zvkb) depends on AS_HAS_OPTION_ARCH +config RISCV_ISA_ZBA + bool "Zba extension support for bit manipulation instructions" + default y + help + Add support for enabling optimisations in the kernel when the Zba + extension is detected at boot. + + The Zba extension provides instructions to accelerate the generation + of addresses that index into arrays of basic data types. + + If you don't know what to do here, say Y. + config RISCV_ISA_ZBB bool "Zbb extension support for bit manipulation instructions" depends on TOOLCHAIN_HAS_ZBB diff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h index fdbf88ca8b70..97041b58237a 100644 --- a/arch/riscv/net/bpf_jit.h +++ b/arch/riscv/net/bpf_jit.h @@ -18,6 +18,11 @@ static inline bool rvc_enabled(void) return IS_ENABLED(CONFIG_RISCV_ISA_C); } +static inline bool rvzba_enabled(void) +{ + return IS_ENABLED(CONFIG_RISCV_ISA_ZBA) && riscv_has_extension_likely(RISCV_ISA_EXT_ZBA); +} + static inline bool rvzbb_enabled(void) { return IS_ENABLED(CONFIG_RISCV_ISA_ZBB) && riscv_has_extension_likely(RISCV_ISA_EXT_ZBB); @@ -939,6 +944,14 @@ static inline u16 rvc_sdsp(u32 imm9, u8 rs2) return rv_css_insn(0x7, imm, rs2, 0x2); } +/* RV64-only ZBA instructions. */ + +static inline u32 rvzba_zextw(u8 rd, u8 rs1) +{ + /* add.uw rd, rs1, ZERO */ + return rv_r_insn(0x04, RV_REG_ZERO, rs1, 0, rd, 0x3b); +} + #endif /* __riscv_xlen == 64 */ /* Helper functions that emit RVC instructions when possible. */ @@ -1161,6 +1174,11 @@ static inline void emit_zexth(u8 rd, u8 rs, struct rv_jit_context *ctx) static inline void emit_zextw(u8 rd, u8 rs, struct rv_jit_context *ctx) { + if (rvzba_enabled()) { + emit(rvzba_zextw(rd, rs), ctx); + return; + } + emit_slli(rd, rs, 32, ctx); emit_srli(rd, rd, 32, ctx); } -- 2.25.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization 2024-05-24 7:55 ` Xiao Wang @ 2024-05-24 7:55 ` Xiao Wang -1 siblings, 0 replies; 12+ messages in thread From: Xiao Wang @ 2024-05-24 7:55 UTC (permalink / raw) To: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang Zba extension is very useful for generating addresses that index into array of basic data types. This patch introduces sh2add and sh3add helpers for RV32 and RV64 respectively, to accelerate addressing for array of unsigned long data. Signed-off-by: Xiao Wang <xiao.w.wang@intel.com> --- arch/riscv/net/bpf_jit.h | 33 +++++++++++++++++++++++++++++++++ arch/riscv/net/bpf_jit_comp32.c | 3 +-- arch/riscv/net/bpf_jit_comp64.c | 9 +++------ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h index 97041b58237a..1d1c78d4cff1 100644 --- a/arch/riscv/net/bpf_jit.h +++ b/arch/riscv/net/bpf_jit.h @@ -742,6 +742,17 @@ static inline u16 rvc_swsp(u32 imm8, u8 rs2) return rv_css_insn(0x6, imm, rs2, 0x2); } +/* RVZBA instructions. */ +static inline u32 rvzba_sh2add(u8 rd, u8 rs1, u8 rs2) +{ + return rv_r_insn(0x10, rs2, rs1, 0x4, rd, 0x33); +} + +static inline u32 rvzba_sh3add(u8 rd, u8 rs1, u8 rs2) +{ + return rv_r_insn(0x10, rs2, rs1, 0x6, rd, 0x33); +} + /* RVZBB instructions. */ static inline u32 rvzbb_sextb(u8 rd, u8 rs1) { @@ -1095,6 +1106,28 @@ static inline void emit_sw(u8 rs1, s32 off, u8 rs2, struct rv_jit_context *ctx) emit(rv_sw(rs1, off, rs2), ctx); } +static inline void emit_sh2add(u8 rd, u8 rs1, u8 rs2, struct rv_jit_context *ctx) +{ + if (rvzba_enabled()) { + emit(rvzba_sh2add(rd, rs1, rs2), ctx); + return; + } + + emit_slli(rd, rs1, 2, ctx); + emit_add(rd, rd, rs2, ctx); +} + +static inline void emit_sh3add(u8 rd, u8 rs1, u8 rs2, struct rv_jit_context *ctx) +{ + if (rvzba_enabled()) { + emit(rvzba_sh3add(rd, rs1, rs2), ctx); + return; + } + + emit_slli(rd, rs1, 3, ctx); + emit_add(rd, rd, rs2, ctx); +} + /* RV64-only helper functions. */ #if __riscv_xlen == 64 diff --git a/arch/riscv/net/bpf_jit_comp32.c b/arch/riscv/net/bpf_jit_comp32.c index f5ba73bb153d..592dd86fbf81 100644 --- a/arch/riscv/net/bpf_jit_comp32.c +++ b/arch/riscv/net/bpf_jit_comp32.c @@ -811,8 +811,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx) * if (!prog) * goto out; */ - emit(rv_slli(RV_REG_T0, lo(idx_reg), 2), ctx); - emit(rv_add(RV_REG_T0, RV_REG_T0, lo(arr_reg)), ctx); + emit_sh2add(RV_REG_T0, lo(idx_reg), lo(arr_reg), ctx); off = offsetof(struct bpf_array, ptrs); if (is_12b_check(off, insn)) return -1; diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c index 79a001d5533e..30ede3ce42d1 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -380,8 +380,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx) * if (!prog) * goto out; */ - emit_slli(RV_REG_T2, RV_REG_A2, 3, ctx); - emit_add(RV_REG_T2, RV_REG_T2, RV_REG_A1, ctx); + emit_sh3add(RV_REG_T2, RV_REG_A2, RV_REG_A1, ctx); off = offsetof(struct bpf_array, ptrs); if (is_12b_check(off, insn)) return -1; @@ -1097,12 +1096,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx, /* Load current CPU number in T1 */ emit_ld(RV_REG_T1, offsetof(struct thread_info, cpu), RV_REG_TP, ctx); - /* << 3 because offsets are 8 bytes */ - emit_slli(RV_REG_T1, RV_REG_T1, 3, ctx); /* Load address of __per_cpu_offset array in T2 */ emit_addr(RV_REG_T2, (u64)&__per_cpu_offset, extra_pass, ctx); - /* Add offset of current CPU to __per_cpu_offset */ - emit_add(RV_REG_T1, RV_REG_T2, RV_REG_T1, ctx); + /* Get address of __per_cpu_offset[cpu] in T1 */ + emit_sh3add(RV_REG_T1, RV_REG_T1, RV_REG_T2, ctx); /* Load __per_cpu_offset[cpu] in T1 */ emit_ld(RV_REG_T1, 0, RV_REG_T1, ctx); /* Add the offset to Rd */ -- 2.25.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization @ 2024-05-24 7:55 ` Xiao Wang 0 siblings, 0 replies; 12+ messages in thread From: Xiao Wang @ 2024-05-24 7:55 UTC (permalink / raw) To: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang Zba extension is very useful for generating addresses that index into array of basic data types. This patch introduces sh2add and sh3add helpers for RV32 and RV64 respectively, to accelerate addressing for array of unsigned long data. Signed-off-by: Xiao Wang <xiao.w.wang@intel.com> --- arch/riscv/net/bpf_jit.h | 33 +++++++++++++++++++++++++++++++++ arch/riscv/net/bpf_jit_comp32.c | 3 +-- arch/riscv/net/bpf_jit_comp64.c | 9 +++------ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h index 97041b58237a..1d1c78d4cff1 100644 --- a/arch/riscv/net/bpf_jit.h +++ b/arch/riscv/net/bpf_jit.h @@ -742,6 +742,17 @@ static inline u16 rvc_swsp(u32 imm8, u8 rs2) return rv_css_insn(0x6, imm, rs2, 0x2); } +/* RVZBA instructions. */ +static inline u32 rvzba_sh2add(u8 rd, u8 rs1, u8 rs2) +{ + return rv_r_insn(0x10, rs2, rs1, 0x4, rd, 0x33); +} + +static inline u32 rvzba_sh3add(u8 rd, u8 rs1, u8 rs2) +{ + return rv_r_insn(0x10, rs2, rs1, 0x6, rd, 0x33); +} + /* RVZBB instructions. */ static inline u32 rvzbb_sextb(u8 rd, u8 rs1) { @@ -1095,6 +1106,28 @@ static inline void emit_sw(u8 rs1, s32 off, u8 rs2, struct rv_jit_context *ctx) emit(rv_sw(rs1, off, rs2), ctx); } +static inline void emit_sh2add(u8 rd, u8 rs1, u8 rs2, struct rv_jit_context *ctx) +{ + if (rvzba_enabled()) { + emit(rvzba_sh2add(rd, rs1, rs2), ctx); + return; + } + + emit_slli(rd, rs1, 2, ctx); + emit_add(rd, rd, rs2, ctx); +} + +static inline void emit_sh3add(u8 rd, u8 rs1, u8 rs2, struct rv_jit_context *ctx) +{ + if (rvzba_enabled()) { + emit(rvzba_sh3add(rd, rs1, rs2), ctx); + return; + } + + emit_slli(rd, rs1, 3, ctx); + emit_add(rd, rd, rs2, ctx); +} + /* RV64-only helper functions. */ #if __riscv_xlen == 64 diff --git a/arch/riscv/net/bpf_jit_comp32.c b/arch/riscv/net/bpf_jit_comp32.c index f5ba73bb153d..592dd86fbf81 100644 --- a/arch/riscv/net/bpf_jit_comp32.c +++ b/arch/riscv/net/bpf_jit_comp32.c @@ -811,8 +811,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx) * if (!prog) * goto out; */ - emit(rv_slli(RV_REG_T0, lo(idx_reg), 2), ctx); - emit(rv_add(RV_REG_T0, RV_REG_T0, lo(arr_reg)), ctx); + emit_sh2add(RV_REG_T0, lo(idx_reg), lo(arr_reg), ctx); off = offsetof(struct bpf_array, ptrs); if (is_12b_check(off, insn)) return -1; diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c index 79a001d5533e..30ede3ce42d1 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -380,8 +380,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx) * if (!prog) * goto out; */ - emit_slli(RV_REG_T2, RV_REG_A2, 3, ctx); - emit_add(RV_REG_T2, RV_REG_T2, RV_REG_A1, ctx); + emit_sh3add(RV_REG_T2, RV_REG_A2, RV_REG_A1, ctx); off = offsetof(struct bpf_array, ptrs); if (is_12b_check(off, insn)) return -1; @@ -1097,12 +1096,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx, /* Load current CPU number in T1 */ emit_ld(RV_REG_T1, offsetof(struct thread_info, cpu), RV_REG_TP, ctx); - /* << 3 because offsets are 8 bytes */ - emit_slli(RV_REG_T1, RV_REG_T1, 3, ctx); /* Load address of __per_cpu_offset array in T2 */ emit_addr(RV_REG_T2, (u64)&__per_cpu_offset, extra_pass, ctx); - /* Add offset of current CPU to __per_cpu_offset */ - emit_add(RV_REG_T1, RV_REG_T2, RV_REG_T1, ctx); + /* Get address of __per_cpu_offset[cpu] in T1 */ + emit_sh3add(RV_REG_T1, RV_REG_T1, RV_REG_T2, ctx); /* Load __per_cpu_offset[cpu] in T1 */ emit_ld(RV_REG_T1, 0, RV_REG_T1, ctx); /* Add the offset to Rd */ -- 2.25.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization 2024-05-24 7:55 ` Xiao Wang @ 2024-05-29 9:41 ` Björn Töpel -1 siblings, 0 replies; 12+ messages in thread From: Björn Töpel @ 2024-05-29 9:41 UTC (permalink / raw) To: Xiao Wang, paul.walmsley, palmer, aou, luke.r.nels, xi.wang, daniel Cc: ast, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang Xiao, Xiao Wang <xiao.w.wang@intel.com> writes: > Zba extension is very useful for generating addresses that index into array > of basic data types. This patch introduces sh2add and sh3add helpers for > RV32 and RV64 respectively, to accelerate addressing for array of unsigned > long data. This patched slipped! Apologies for the slow reply. Acked-by: Björn Töpel <bjorn@kernel.org> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization @ 2024-05-29 9:41 ` Björn Töpel 0 siblings, 0 replies; 12+ messages in thread From: Björn Töpel @ 2024-05-29 9:41 UTC (permalink / raw) To: Xiao Wang, paul.walmsley, palmer, aou, luke.r.nels, xi.wang, daniel Cc: ast, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li, Xiao Wang Xiao, Xiao Wang <xiao.w.wang@intel.com> writes: > Zba extension is very useful for generating addresses that index into array > of basic data types. This patch introduces sh2add and sh3add helpers for > RV32 and RV64 respectively, to accelerate addressing for array of unsigned > long data. This patched slipped! Apologies for the slow reply. Acked-by: Björn Töpel <bjorn@kernel.org> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization 2024-05-29 9:41 ` Björn Töpel @ 2024-05-30 0:32 ` Wang, Xiao W -1 siblings, 0 replies; 12+ messages in thread From: Wang, Xiao W @ 2024-05-30 0:32 UTC (permalink / raw) To: Björn Töpel, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, luke.r.nels@gmail.com, xi.wang@gmail.com, daniel@iogearbox.net Cc: ast@kernel.org, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, pulehui@huawei.com, puranjay@kernel.org, Li, Haicheng > -----Original Message----- > From: Björn Töpel <bjorn@kernel.org> > Sent: Wednesday, May 29, 2024 5:41 PM > To: Wang, Xiao W <xiao.w.wang@intel.com>; paul.walmsley@sifive.com; > palmer@dabbelt.com; aou@eecs.berkeley.edu; luke.r.nels@gmail.com; > xi.wang@gmail.com; daniel@iogearbox.net > Cc: ast@kernel.org; andrii@kernel.org; martin.lau@linux.dev; > eddyz87@gmail.com; song@kernel.org; yonghong.song@linux.dev; > john.fastabend@gmail.com; kpsingh@kernel.org; sdf@google.com; > haoluo@google.com; jolsa@kernel.org; linux-riscv@lists.infradead.org; linux- > kernel@vger.kernel.org; bpf@vger.kernel.org; pulehui@huawei.com; > puranjay@kernel.org; Li, Haicheng <haicheng.li@intel.com>; Wang, Xiao W > <xiao.w.wang@intel.com> > Subject: Re: [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper > with Zba optimization > > Xiao, > > Xiao Wang <xiao.w.wang@intel.com> writes: > > > Zba extension is very useful for generating addresses that index into array > > of basic data types. This patch introduces sh2add and sh3add helpers for > > RV32 and RV64 respectively, to accelerate addressing for array of unsigned > > long data. > > This patched slipped! Apologies for the slow reply. No worry. Thanks for picking it up. BRs, Xiao > > Acked-by: Björn Töpel <bjorn@kernel.org> ^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization @ 2024-05-30 0:32 ` Wang, Xiao W 0 siblings, 0 replies; 12+ messages in thread From: Wang, Xiao W @ 2024-05-30 0:32 UTC (permalink / raw) To: Björn Töpel, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, luke.r.nels@gmail.com, xi.wang@gmail.com, daniel@iogearbox.net Cc: ast@kernel.org, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, pulehui@huawei.com, puranjay@kernel.org, Li, Haicheng > -----Original Message----- > From: Björn Töpel <bjorn@kernel.org> > Sent: Wednesday, May 29, 2024 5:41 PM > To: Wang, Xiao W <xiao.w.wang@intel.com>; paul.walmsley@sifive.com; > palmer@dabbelt.com; aou@eecs.berkeley.edu; luke.r.nels@gmail.com; > xi.wang@gmail.com; daniel@iogearbox.net > Cc: ast@kernel.org; andrii@kernel.org; martin.lau@linux.dev; > eddyz87@gmail.com; song@kernel.org; yonghong.song@linux.dev; > john.fastabend@gmail.com; kpsingh@kernel.org; sdf@google.com; > haoluo@google.com; jolsa@kernel.org; linux-riscv@lists.infradead.org; linux- > kernel@vger.kernel.org; bpf@vger.kernel.org; pulehui@huawei.com; > puranjay@kernel.org; Li, Haicheng <haicheng.li@intel.com>; Wang, Xiao W > <xiao.w.wang@intel.com> > Subject: Re: [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper > with Zba optimization > > Xiao, > > Xiao Wang <xiao.w.wang@intel.com> writes: > > > Zba extension is very useful for generating addresses that index into array > > of basic data types. This patch introduces sh2add and sh3add helpers for > > RV32 and RV64 respectively, to accelerate addressing for array of unsigned > > long data. > > This patched slipped! Apologies for the slow reply. No worry. Thanks for picking it up. BRs, Xiao > > Acked-by: Björn Töpel <bjorn@kernel.org> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 0/2] riscv, bpf: Introduce Zba optimization 2024-05-24 7:55 ` Xiao Wang @ 2024-05-24 15:10 ` patchwork-bot+netdevbpf -1 siblings, 0 replies; 12+ messages in thread From: patchwork-bot+netdevbpf @ 2024-05-24 15:10 UTC (permalink / raw) To: Wang, Xiao W Cc: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn, ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li Hello: This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Fri, 24 May 2024 15:55:41 +0800 you wrote: > The riscv Zba extension provides instructions to accelerate the generation > of addresses that index into arrays of basic data types, bpf JIT generated > insn counts could be reduced by leveraging Zba for address calculation. > > The first patch introduces RISCV_ISA_ZBA Kconfig option and uses Zba add.uw > insn to optimize zextw operation. > > [...] Here is the summary with links: - [bpf-next,v4,1/2] riscv, bpf: Optimize zextw insn with Zba extension https://git.kernel.org/bpf/bpf-next/c/c12603e76ef6 - [bpf-next,v4,2/2] riscv, bpf: Introduce shift add helper with Zba optimization (no matching commit) You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 0/2] riscv, bpf: Introduce Zba optimization @ 2024-05-24 15:10 ` patchwork-bot+netdevbpf 0 siblings, 0 replies; 12+ messages in thread From: patchwork-bot+netdevbpf @ 2024-05-24 15:10 UTC (permalink / raw) To: Wang, Xiao W Cc: paul.walmsley, palmer, aou, luke.r.nels, xi.wang, bjorn, ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-riscv, linux-kernel, bpf, pulehui, puranjay, haicheng.li Hello: This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Fri, 24 May 2024 15:55:41 +0800 you wrote: > The riscv Zba extension provides instructions to accelerate the generation > of addresses that index into arrays of basic data types, bpf JIT generated > insn counts could be reduced by leveraging Zba for address calculation. > > The first patch introduces RISCV_ISA_ZBA Kconfig option and uses Zba add.uw > insn to optimize zextw operation. > > [...] Here is the summary with links: - [bpf-next,v4,1/2] riscv, bpf: Optimize zextw insn with Zba extension https://git.kernel.org/bpf/bpf-next/c/c12603e76ef6 - [bpf-next,v4,2/2] riscv, bpf: Introduce shift add helper with Zba optimization (no matching commit) You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-05-30 0:32 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-05-24 7:55 [PATCH bpf-next v4 0/2] riscv, bpf: Introduce Zba optimization Xiao Wang 2024-05-24 7:55 ` Xiao Wang 2024-05-24 7:55 ` [PATCH bpf-next v4 1/2] riscv, bpf: Optimize zextw insn with Zba extension Xiao Wang 2024-05-24 7:55 ` Xiao Wang 2024-05-24 7:55 ` [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization Xiao Wang 2024-05-24 7:55 ` Xiao Wang 2024-05-29 9:41 ` Björn Töpel 2024-05-29 9:41 ` Björn Töpel 2024-05-30 0:32 ` Wang, Xiao W 2024-05-30 0:32 ` Wang, Xiao W 2024-05-24 15:10 ` [PATCH bpf-next v4 0/2] riscv, bpf: Introduce " patchwork-bot+netdevbpf 2024-05-24 15:10 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.