Skip to contentSkip to conversation

riscv, bpf: Miscellaneous JIT optimizations

PATCH Applied Pu Lehui 2 participants 6 messages Dec 2 – Dec 3

Subsystems (4)
lore
Share & tools
lore

Pu Lehui

author
#0 lore raw

v2 cover riscv, bpf: Miscellaneous JIT optimizations

From: Pu Lehui <[email protected]>

This series brings four improvements to the RISC-V BPF JIT:

- Patch 1 fixes forward jump offset calculation across JIT passes so large programs (e.g. no_limits/dump) converge in 2 passes instead of hitting NR_JIT_ITERATIONS.
- Patch 2 reuses the tailcall epilogue across multiple bpf_tail_call() sites on RV64 to shrink JIT image size.
- Patch 3 introduces a per-image PLT on RV64 to eliminate stop_machine() in bpf_arch_text_poke(), reducing trampoline attach/detach latency.
- Patch 4 removes the now-redundant RV64 arch_bpf_trampoline_skip() and 4-byte-aligns the skip nop in invoke_bpf_prog().

This series has been tested with riscv-bpf-daily and passed:
https://github.com/pulehui/riscv-bpf-daily/pull/26

v2:
- update comment about fentry slot. (BPF CI)

v1: https://lore.kernel.org/bpf/[email protected]

Pu Lehui (4):
riscv, bpf: Fix forward jump offset calculation during JIT passes riscv, bpf: Reuse tailcall epilogue across tailcall sites riscv, bpf: Eliminate stop_machine in bpf_arch_text_poke with
per-image PLT
riscv, bpf: Remove arch_bpf_trampoline_skip

 arch/riscv/net/bpf_jit.h        |  19 ++--
 arch/riscv/net/bpf_jit_comp32.c |   5 +-
 arch/riscv/net/bpf_jit_comp64.c | 192 +++++++++++++++++++++++---------
 arch/riscv/net/bpf_jit_core.c   |  51 ++++-----
 4 files changed, 176 insertions(+), 91 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/4 riscv, bpf: Fix forward jump offset calculation during JIT passes

From: Pu Lehui <[email protected]>

Running the no_limits/dump selftest on RV64 fails to converge within NR_JIT_ITERATIONS (32) passes. The test generates ~560k instructions with dense short forward branches that fail to settle in time.

In build_body(), ctx->offset[] is updated immediately after emitting each instruction. When rv_offset() computes a forward jump, the source offset reflects the current pass while the target offset still holds the previous pass's value. This cross-pass mismatch inflates forward jump distances by the cumulative shrinkage of preceding instructions, allowing only a small batch of branches to shrink per pass. Similarly, epilogue_offset() mixes the current ninsns with the previous pass's epilogue offset.

Fix this by keeping the previous pass's offset intact in ctx->offset[] while emitting the current instruction. In rv_offset(), use previous-pass offsets for both source and target on forward jumps, and current-pass offsets on backward jumps. Also replace epilogue_offset() with rv_offset() targeting the end of the program. With this fix, no_limits/dump converges in 2 passes.

Furthermore, extend ctx->offset[] to prog->len + 1 entries and record the start of each instruction directly instead of shifting the array afterward for bpf_prog_update_insn_ptrs().

Fixes 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G")
---
 arch/riscv/net/bpf_jit.h        | 13 ++-----------
 arch/riscv/net/bpf_jit_comp32.c |  5 ++---
 arch/riscv/net/bpf_jit_comp64.c |  5 ++---
 arch/riscv/net/bpf_jit_core.c   | 31 +++++++++++++------------------
 4 files changed, 19 insertions(+), 35 deletions(-)
arch/riscv/net/bpf_jit.h +2 -11
index dbe1ac8cd0de..3603bbfcb120 100644
@@ -78,8 +78,6 @@ struct rv_jit_context {
 	u16 *insns;		/* RV insns */
 	u16 *ro_insns;
 	int ninsns;
-	int prologue_len;
-	int epilogue_offset;
 	int *offset;		/* BPF to RV */
 	int nexentries;
 	int ex_insn_off;
@@ -133,13 +131,6 @@ static inline void emitc(const u16 insn, struct rv_jit_context *ctx)
 	ctx->ninsns++;
 }
 
-static inline int epilogue_offset(struct rv_jit_context *ctx)
-{
-	int to = ctx->epilogue_offset, from = ctx->ninsns;
-
-	return ninsns_rvoff(to - from);
-}
-
 /* Return -1 or inverted cond. */
 static inline int invert_bpf_cond(u8 cond)
 {
@@ -228,8 +219,8 @@ static inline int rv_offset(int insn, int off, struct rv_jit_context *ctx)
 	int from, to;
 
 	off++; /* BPF branch is from PC+1, RV is from PC */
-	from = (insn > 0) ? ctx->offset[insn - 1] : ctx->prologue_len;
-	to = (insn + off > 0) ? ctx->offset[insn + off - 1] : ctx->prologue_len;
+	from = (off >= 0) ? ctx->offset[insn] : ctx->ninsns;
+	to = ctx->offset[insn + off];
 	return ninsns_rvoff(to - from);
 }
 
arch/riscv/net/bpf_jit_comp32.c +2 -3
index a9e0bd5cc81d..a32fb59b74e9 100644
@@ -787,8 +787,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
 	const s8 *arr_reg = bpf2rv32[BPF_REG_2];
 	const s8 *idx_reg = bpf2rv32[BPF_REG_3];
 
-	tc_ninsn = insn ? ctx->offset[insn] - ctx->offset[insn - 1] :
-		ctx->offset[0];
+	tc_ninsn = ctx->offset[insn + 1] - ctx->offset[insn];
 
 	/* max_entries = array->map.max_entries; */
 	off = offsetof(struct bpf_array, map.max_entries);
@@ -1305,7 +1304,7 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
 		if (i == ctx->prog->len - 1)
 			break;
 
-		rvoff = epilogue_offset(ctx);
+		rvoff = rv_offset(i, ctx->prog->len - 1 - i, ctx);
 		emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
 		break;
 
arch/riscv/net/bpf_jit_comp64.c +2 -3
index a7a7d2f9da85..dfea7d24155e 100644
@@ -342,8 +342,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
 	 * if (index >= array->map.max_entries)
 	 *	goto out;
 	 */
-	tc_ninsn = insn ? ctx->offset[insn] - ctx->offset[insn - 1] :
-		   ctx->offset[0];
+	tc_ninsn = ctx->offset[insn + 1] - ctx->offset[insn];
 	emit_zextw(RV_REG_A2, RV_REG_A2, ctx);
 
 	off = offsetof(struct bpf_array, map.max_entries);
@@ -1962,7 +1961,7 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
 		if (i == ctx->prog->len - 1)
 			break;
 
-		rvoff = epilogue_offset(ctx);
+		rvoff = rv_offset(i, ctx->prog->len - 1 - i, ctx);
 		ret = emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);
 		if (ret)
 			return ret;
arch/riscv/net/bpf_jit_core.c +13 -18
index 138e9fa90963..91b14945d3f2 100644
@@ -24,19 +24,24 @@ static int build_body(struct rv_jit_context *ctx, bool extra_pass, int *offset)
 
 	for (i = 0; i < prog->len; i++) {
 		const struct bpf_insn *insn = &prog->insnsi[i];
+		int start_ninsns = ctx->ninsns;
 		int ret;
 
 		ret = bpf_jit_emit_insn(insn, ctx, extra_pass);
+		if (ret < 0)
+			return ret;
 		if (offset)
-			offset[i] = ctx->ninsns;
+			offset[i] = start_ninsns;
 		if (ret > 0) {
 			i++; /* skip the next instruction */
 			if (offset)
-				offset[i] = ctx->ninsns;
+				offset[i] = start_ninsns;
 		}
-		if (ret < 0)
-			return ret;
 	}
+
+	if (offset)
+		offset[i] = ctx->ninsns;
+
 	return 0;
 }
 
@@ -142,14 +147,14 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	if (prog->aux->jits_use_priv_stack && alloc_priv_stack(prog))
 		goto out_free_hdr;
 
-	ctx->offset = kvzalloc_objs(int, prog->len);
+	ctx->offset = kvzalloc_objs(int, prog->len + 1);
 	if (!ctx->offset)
 		goto out_free_hdr;
 
 	if (build_body(ctx, extra_pass, NULL))
 		goto out_free_hdr;
 
-	for (i = 0; i < prog->len; i++) {
+	for (i = 0; i <= prog->len; i++) {
 		prev_ninsns += 32;
 		ctx->offset[i] = prev_ninsns;
 	}
@@ -159,12 +164,10 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 		ctx->ninsns = 0;
 
 		bpf_jit_build_prologue(ctx, bpf_is_subprog(prog));
-		ctx->prologue_len = ctx->ninsns;
 
 		if (build_body(ctx, extra_pass, ctx->offset))
 			goto out_free_hdr;
 
-		ctx->epilogue_offset = ctx->ninsns;
 		bpf_jit_build_epilogue(ctx);
 
 		if (ctx->ninsns == prev_ninsns) {
@@ -236,17 +239,9 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	prog->jited_len = prog_size - cfi_get_offset();
 
 	if (!prog->is_func || extra_pass) {
-		for (i = 0; i < prog->len; i++)
+		for (i = 0; i <= prog->len; i++)
 			ctx->offset[i] = ninsns_rvoff(ctx->offset[i]);
-		bpf_prog_fill_jited_linfo(prog, ctx->offset);
-
-		/*
-		 * bpf_prog_update_insn_ptrs() wants the start of each insn, so
-		 * shift ctx->offset[] by one and get insn 0 from the prologue.
-		 */
-		for (i = prog->len - 1; i > 0; i--)
-			ctx->offset[i] = ctx->offset[i - 1];
-		ctx->offset[0] = ninsns_rvoff(ctx->prologue_len);
+		bpf_prog_fill_jited_linfo(prog, ctx->offset + 1);
 		bpf_prog_update_insn_ptrs(prog, ctx->offset, jit_data->ro_image);
 		goto out_free_ctx;
 	}
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v2 2/4 riscv, bpf: Reuse tailcall epilogue across tailcall sites

In reply to Pu Lehui

From: Pu Lehui <[email protected]>

Currently, the RV64 BPF JIT emits a full tailcall epilogue inline at every bpf_tail_call() site. For programs with multiple tailcalls, duplicating the register restoration and stack unwinding sequences bloats the JIT image.

Emit the tailcall epilogue only at the first bpf_tail_call() site and record its offset in ctx->tc_epilog_off, then have subsequent tailcall sites jump to it after loading the target address. Keeping the normal epilogue separate preserves ret (jr ra) for hardware return address stack (RAS) prediction and avoids extra instructions on the normal exit path. Also rename the fixed_addr parameter of emit_jump_and_link() and emit_call() to can_relax to better reflect its meaning.

Tested with synthetic programs containing 10 and 100 distinct bpf_tail_call() sites on RV64 (with RVC enabled):

  Program       Before      After       Savings
  tailcall_10   1368 B      1272 B      -96 B   (-7.02%)
  tailcall_100  11816 B     10800 B     -1016 B (-8.60%)
---
 arch/riscv/net/bpf_jit.h        |  1 +
 arch/riscv/net/bpf_jit_comp64.c | 19 +++++++++++++++----
 arch/riscv/net/bpf_jit_core.c   |  2 ++
 3 files changed, 18 insertions(+), 4 deletions(-)
arch/riscv/net/bpf_jit.h +1 -0
index 3603bbfcb120..28f024b5f722 100644
@@ -86,6 +86,7 @@ struct rv_jit_context {
 	int stack_size;
 	int tcc_offset;
 	int stack_arg_sz;
+	int tc_epilog_off;
 	u64 arena_vm_start;
 	u64 user_vm_start;
 };
arch/riscv/net/bpf_jit_comp64.c +15 -4
index dfea7d24155e..1846d0a6e030 100644
@@ -25,6 +25,9 @@
 #define RV_REG_TCC RV_REG_T5
 #define RV_REG_ARENA RV_REG_S7 /* For storing arena_vm_start */
 
+static int emit_jump_and_link(u8 rd, s64 rvoff, bool can_relax,
+			      struct rv_jit_context *ctx);
+
 static const int regmap[] = {
 	[BPF_REG_0] =	RV_REG_T6,
 	[BPF_REG_1] =	RV_REG_A0,
@@ -380,6 +383,14 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
 	if (is_12b_check(off, insn))
 		return -1;
 	emit_ld(RV_REG_T3, off, RV_REG_T2, ctx);
+
+	/* reuse the tailcall epilogue emitted at the first site */
+	if (ctx->tc_epilog_off) {
+		off = ninsns_rvoff(ctx->tc_epilog_off - ctx->ninsns);
+		return emit_jump_and_link(RV_REG_ZERO, off, true, ctx);
+	}
+
+	ctx->tc_epilog_off = ctx->ninsns;
 	__build_epilogue(true, ctx);
 	return 0;
 }
@@ -405,12 +416,12 @@ static void init_regs(u8 *rd, u8 *rs, const struct bpf_insn *insn,
 		*rs = bpf_to_rv_reg(insn->src_reg, ctx);
 }
 
-static int emit_jump_and_link(u8 rd, s64 rvoff, bool fixed_addr,
+static int emit_jump_and_link(u8 rd, s64 rvoff, bool can_relax,
 			      struct rv_jit_context *ctx)
 {
 	s64 upper, lower;
 
-	if (rvoff && fixed_addr && is_21b_int(rvoff)) {
+	if (can_relax && rvoff && is_21b_int(rvoff)) {
 		emit(rv_jal(rd, rvoff >> 1), ctx);
 		return 0;
 	} else if (in_auipc_jalr_range(rvoff)) {
@@ -431,7 +442,7 @@ static bool is_signed_bpf_cond(u8 cond)
 		cond == BPF_JSGE || cond == BPF_JSLE;
 }
 
-static int emit_call(u64 addr, bool fixed_addr, struct rv_jit_context *ctx)
+static int emit_call(u64 addr, bool can_relax, struct rv_jit_context *ctx)
 {
 	s64 off = 0;
 	u64 ip;
@@ -445,7 +456,7 @@ static int emit_call(u64 addr, bool fixed_addr, struct rv_jit_context *ctx)
 		off = addr - ip;
 	}
 
-	return emit_jump_and_link(RV_REG_RA, off, fixed_addr, ctx);
+	return emit_jump_and_link(RV_REG_RA, off, can_relax, ctx);
 }
 
 static inline void emit_kcfi(u32 hash, struct rv_jit_context *ctx)
arch/riscv/net/bpf_jit_core.c +2 -0
index 91b14945d3f2..5efada7b081a 100644
@@ -22,6 +22,8 @@ static int build_body(struct rv_jit_context *ctx, bool extra_pass, int *offset)
 	const struct bpf_prog *prog = ctx->prog;
 	int i;
 
+	/* reset per-pass tailcall epilogue offset */
+	ctx->tc_epilog_off = 0;
 	for (i = 0; i < prog->len; i++) {
 		const struct bpf_insn *insn = &prog->insnsi[i];
 		int start_ninsns = ctx->ninsns;
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v2 3/4 riscv, bpf: Eliminate stop_machine in bpf_arch_text_poke with per-image PLT

In reply to Pu Lehui

From: Pu Lehui <[email protected]>

On RV64, updating bpf trampolines on kernel functions relies on ftrace, which has recently been optimized to patch text atomically. However, updating bpf trampolines on bpf programs uses bpf_arch_text_poke(), which currently relies on stop_machine().

When the target trampoline lies beyond the +/- 1MB range of a direct jal instruction, an auipc/jalr pair is required. Because updating a two-instruction sequence cannot be executed atomically, it must use patch_text() to halt all online CPUs, introducing noticeable stop-the-world latency and jitter during bpf trampoline updates.

Optimize this by introducing a per-image PLT at the end of each bpf JITed image, and pre-emitting an auipc instruction at the prologue entry at JIT time to compute the upper bits of the PLT offset. When updating trampolines, the instruction following the auipc is patched: for short jumps, directly with a jal targeting the trampoline; for long jumps, with a jalr targeting the PLT along with updating the 64-bit aligned PLT target. Both cases modify at most a single instruction via patch_text_nosync(), eliminating stop_machine().

Per-cycle time for 1000 attach + detach cycles on bpf prog:

            Before       After        Reduction
  Avg       211.60 us    120.26 us    -91.34 us  (-43.17%, 1.76x speedup)
  P99       772.75 us    176.00 us    -596.75 us (-77.22%, 4.39x speedup)
---
 arch/riscv/net/bpf_jit.h        |   5 ++
 arch/riscv/net/bpf_jit_comp64.c | 151 ++++++++++++++++++++++++++------
 arch/riscv/net/bpf_jit_core.c   |  18 ++--
 3 files changed, 138 insertions(+), 36 deletions(-)
arch/riscv/net/bpf_jit.h +5 -0
index 28f024b5f722..37d8947dc06b 100644
@@ -751,6 +751,11 @@ static inline u16 rvc_swsp(u32 imm8, u8 rs2)
 	return rv_css_insn(0x6, imm, rs2, 0x2);
 }
 
+static inline u16 rvc_nop(void)
+{
+	return rv_ci_insn(0, 0, 0, 0x1);
+}
+
 /* RVZACAS instructions. */
 static inline u32 rvzacas_amocas_w(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl)
 {
arch/riscv/net/bpf_jit_comp64.c +122 -29

214 lines not on this page · raw message

arch/riscv/net/bpf_jit_core.c +11 -7
index 5efada7b081a..2188788dc25a 100644
@@ -16,6 +16,7 @@
 
 /* Number of iterations to try until offsets converge. */
 #define NR_JIT_ITERATIONS	32
+#define PLT_TARGET_NBYTES	(IS_ENABLED(CONFIG_64BIT) ? sizeof(u64) : 0)
 
 static int build_body(struct rv_jit_context *ctx, bool extra_pass, int *offset)
 {
@@ -172,17 +173,20 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 
 		bpf_jit_build_epilogue(ctx);
 
-		if (ctx->ninsns == prev_ninsns) {
+		/* compare before variable PLT alignment padding */
+		if (ctx->offset[prog->len] == prev_ninsns) {
+			/* obtain the actual prog size */
+			prog_size = sizeof(*ctx->insns) * ctx->ninsns;
+
 			if (jit_data->header)
 				break;
-			/* obtain the actual image size */
+
 			extable_size = prog->aux->num_exentries *
 				sizeof(struct exception_table_entry);
-			prog_size = sizeof(*ctx->insns) * ctx->ninsns;
 
 			jit_data->ro_header =
-				bpf_jit_binary_pack_alloc(prog_size + extable_size,
-							  &jit_data->ro_image, sizeof(u32),
+				bpf_jit_binary_pack_alloc(prog_size + PLT_TARGET_NBYTES + extable_size,
+							  &jit_data->ro_image, sizeof(u64),
 							  &jit_data->header, &jit_data->image,
 							  bpf_fill_ill_insns,
 							  bpf_prog_was_classic(prog));
@@ -203,7 +207,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 			 * potentially shrink more (auipc/jalr -> jal).
 			 */
 		}
-		prev_ninsns = ctx->ninsns;
+		prev_ninsns = ctx->offset[prog->len];
 	}
 
 	if (i == NR_JIT_ITERATIONS) {
@@ -212,7 +216,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	}
 
 	if (extable_size)
-		prog->aux->extable = (void *)ctx->ro_insns + prog_size;
+		prog->aux->extable = (void *)ctx->ro_insns + prog_size + PLT_TARGET_NBYTES;
 
 skip_init_ctx:
 	pass++;
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH v2 4/4 riscv, bpf: Remove arch_bpf_trampoline_skip

In reply to Pu Lehui

From: Pu Lehui <[email protected]>

Now that the preceding commit extends bpf_arch_text_poke() to cover the functionality of arch_bpf_trampoline_skip(), the RV64-specific implementation is redundant. Remove it in favor of the generic weak implementation which calls bpf_arch_text_poke().

Also align the skip nop in invoke_bpf_prog() to 4 bytes with c.nop when RVC is enabled, as bpf_arch_text_poke() requires 4-byte alignment for atomic single-instruction patching.

---
 arch/riscv/net/bpf_jit_comp64.c | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)
arch/riscv/net/bpf_jit_comp64.c +5 -20
index ac655db5239f..7d15617aee1b 100644
@@ -10,7 +10,6 @@
 #include <linux/filter.h>
 #include <linux/memory.h>
 #include <linux/smp.h>
-#include <linux/stop_machine.h>
 #include <asm/text-patching.h>
 #include <asm/cfi.h>
 #include <asm/percpu.h>
@@ -918,24 +917,6 @@ static int gen_poke_insn(void *target, void *ip, void *plt_slot, u32 *insn,
 	return 0;
 }
 
-int arch_bpf_trampoline_skip(void *nop, void *target)
-{
-	u32 old_insn = rv_nop();
-	u32 new_insn = rv_jal(RV_REG_ZERO, (target - nop) >> 1);
-	int ret;
-
-	if (memcmp(nop, &old_insn, sizeof(old_insn)))
-		return -EFAULT;
-
-	cpus_read_lock();
-	mutex_lock(&text_mutex);
-	ret = patch_text(nop, &new_insn, sizeof(new_insn));
-	mutex_unlock(&text_mutex);
-	cpus_read_unlock();
-
-	return ret;
-}
-
 int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type old_t,
 		       enum bpf_text_poke_type new_t, void *old_addr,
 		       void *new_addr)
@@ -1083,8 +1064,12 @@ static int invoke_bpf_prog(struct bpf_tramp_image *im, struct bpf_tramp_node *no
 	int ret, branch_off;
 	struct bpf_prog *p = node->link->prog;
 	int cookie_off = offsetof(struct bpf_tramp_run_ctx, bpf_cookie);
-	void *skip = ctx->ro_insns + ctx->ninsns;
+	void *skip;
 
+	/* make sure skip address is 4-byte aligned */
+	if (rvc_enabled() && (ninsns_rvoff(ctx->ninsns) & 2))
+		emitc(rvc_nop(), ctx);
+	skip = ctx->ro_insns + ctx->ninsns;
 	/* nop, patched to a jal over this prog when it is detached */
 	emit(rv_nop(), ctx);
 
Signature · 1 line
2.34.1
#5 lore raw
In reply to Pu Lehui
This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 14 lines · On Wed, 2 Dec 2026 02:32:33 +0000 you wrote:

From: Pu Lehui <[email protected]>

This series brings four improvements to the RISC-V BPF JIT:

- Patch 1 fixes forward jump offset calculation across JIT passes so large programs (e.g. no_limits/dump) converge in 2 passes instead of hitting NR_JIT_ITERATIONS.
- Patch 2 reuses the tailcall epilogue across multiple bpf_tail_call() sites on RV64 to shrink JIT image size.
- Patch 3 introduces a per-image PLT on RV64 to eliminate stop_machine() in bpf_arch_text_poke(), reducing trampoline attach/detach latency.
- Patch 4 removes the now-redundant RV64 arch_bpf_trampoline_skip() and 4-byte-aligns the skip nop in invoke_bpf_prog().

Quoted 1 line

[...]

Here is the summary with links:
- [bpf-next,v2,1/4] riscv, bpf: Fix forward jump offset calculation during JIT passes

    https://git.kernel.org/bpf/bpf-next/c/98e822f5f824
  - [bpf-next,v2,2/4] riscv, bpf: Reuse tailcall epilogue across tailcall sites
    https://git.kernel.org/bpf/bpf-next/c/d8a32701ba53
  - [bpf-next,v2,3/4] riscv, bpf: Eliminate stop_machine in bpf_arch_text_poke with per-image PLT
    https://git.kernel.org/bpf/bpf-next/c/583227375d0e
  - [bpf-next,v2,4/4] riscv, bpf: Remove arch_bpf_trampoline_skip
    https://git.kernel.org/bpf/bpf-next/c/c3b1e2d1221e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html