Skip to contentSkip to conversation

LoongArch: BPF features and fixes

PATCH In review Hengqi Chen 4 participants 19 messages Nov 24, 2025 – Dec 9, 2025

Subsystems (3)
lore
Share & tools
lore

Hengqi Chen

author reviewer
#0 lore raw

cover LoongArch: BPF features and fixes

This small set implement new features with 2 bug fixes for BPF.

* Patch 1 fixes a bug discovered while testing the BPF Arena feature.
Without this fix, the arena_htab test case which use the
bpf_arena_alloc_pages kfunc will trigger a kernel panic.
* Patch 2 fixes a subtle bug for tail call index, this can be verified
by the verifier_runtime_jit test case.
See the following two threads for background:
- https://lore.kernel.org/bpf/CAEyhmHTvj4cDRfu1FXSEXmdCqyWfs3ehw5gtB9qJCrThuUy2Kw@mail.gmail.com/
- https://lore.kernel.org/bpf/[email protected]/
* Patch 3 uses pack allocator for BPF programs (BPF trampoline already
use pack allocator, this make it complete), with this, no regression
on existing selftests
* Patch 4 & 5 implements basic support for BPF Arena, the following
test cases passed:
- arena_htab
- arena_list
- verifier_arena
- verifier_arena_large

Hengqi Chen (5):
LoongArch: BPF: Sign extend kfunc call arguments
LoongArch: BPF: Zero-extend bpf_tail_call() index
LoongArch: BPF: Use BPF prog pack allocator
LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions
LoongArch: BPF: Implement bpf_addr_space_cast instruction

 arch/loongarch/net/bpf_jit.c | 225 ++++++++++++++++++++++++++++-------
 arch/loongarch/net/bpf_jit.h |  30 ++++-
 2 files changed, 213 insertions(+), 42 deletions(-)

--
2.43.5

author reviewer
#1 lore raw

PATCH 1/5 LoongArch: BPF: Sign extend kfunc call arguments

The kfunc calls are native calls so they should follow LoongArch calling conventions. Sign extend its arguments properly to avoid kernel panic. This is done by adding a new emit_abi_ext() helper. The emit_abi_ext() helper performs extension in place meaning a value already store in target register (This is different from the existing sign_extend() helper and thus we can't reuse it).

Fixes 5dc615520c4d ("LoongArch: Add BPF JIT support")
---
 arch/loongarch/net/bpf_jit.c | 16 ++++++++++++++++
 arch/loongarch/net/bpf_jit.h | 26 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
arch/loongarch/net/bpf_jit.c +16 -0
index f97dc9936401..c67631303841 100644
@@ -950,6 +950,22 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 			emit_insn(ctx, ldd, REG_TCC, LOONGARCH_GPR_SP, tcc_ptr_off);
 		}
 
+		if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
+			const struct btf_func_model *m;
+			int i;
+
+			m = bpf_jit_find_kfunc_model(ctx->prog, insn);
+			if (!m)
+				return -EINVAL;
+
+			for (i = 0; i < m->nr_args; i++) {
+				u8 reg = regmap[BPF_REG_1 + i];
+				bool sign = m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG;
+
+				emit_abi_ext(ctx, reg, m->arg_size[i], sign);
+			}
+		}
+
 		move_addr(ctx, t1, func_addr);
 		emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0);
 
arch/loongarch/net/bpf_jit.h +26 -0
index 5697158fd164..ed0193659cf9 100644
@@ -88,6 +88,32 @@ static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo
 	emit_insn(ctx, addiw, reg, reg, 0);
 }
 
+/* Emit proper extension according to ABI requirements.
+ * Note that this requires a value of size `size` already resides in register `reg`.
+ */
+static inline void emit_abi_ext(struct jit_ctx *ctx, int reg, u8 size, bool sign)
+{
+	/* The ABI requires unsigned char/short to be zero-extended, leave it intact */
+	if (!sign && (size == 1 || size == 2))
+		return;
+
+	switch (size) {
+	case 1:
+		emit_insn(ctx, extwb, reg, reg);
+		break;
+	case 2:
+		emit_insn(ctx, extwh, reg, reg);
+		break;
+	case 4:
+		emit_insn(ctx, addiw, reg, reg, 0);
+		break;
+	case 8:
+		break;
+	default:
+		pr_warn("bpf_jit: invalid size %d for extension\n", size);
+	}
+}
+
 static inline void move_addr(struct jit_ctx *ctx, enum loongarch_gpr rd, u64 addr)
 {
 	u64 imm_11_0, imm_31_12, imm_51_32, imm_63_52;
Signature · 1 line
2.43.5
author reviewer
#5 lore raw

PATCH 2/5 LoongArch: BPF: Zero-extend bpf_tail_call() index

In reply to Hengqi Chen

The bpf_tail_call() index should be treated as u32 value. Let's zero-extend it to avoid calling wrong BPF progs. See similar fixes for x86 ([0]) and arm64 ([1]) for more details.

[0]: https://github.com/torvalds/linux/commit/90caccdd8cc0215705f18b92771b449b01e2474a
[1]: https://github.com/torvalds/linux/commit/16338a9b3ac30740d49f5dfed81bac0ffa53b9c7

Fixes 5dc615520c4d ("LoongArch: Add BPF JIT support")
---
 arch/loongarch/net/bpf_jit.c | 2 ++
 1 file changed, 2 insertions(+)
arch/loongarch/net/bpf_jit.c +2 -0
index c67631303841..4be8515197ce 100644
@@ -280,6 +280,8 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx, int insn)
 	 *	 goto out;
 	 */
 	tc_ninsn = insn ? ctx->offset[insn+1] - ctx->offset[insn] : ctx->offset[0];
+	emit_zext_32(ctx, a2, true);
+
 	off = offsetof(struct bpf_array, map.max_entries);
 	emit_insn(ctx, ldwu, t1, a1, off);
 	/* bgeu $a2, $t1, jmp_offset */
Signature · 1 line
2.43.5
author reviewer
#6 lore raw

PATCH 3/5 LoongArch: BPF: Use BPF prog pack allocator

In reply to Hengqi Chen

Use bpf_jit_binary_pack_alloc() for JIT binaries. The BPF prog pack allocator creates a pair of RW and RX buffers. The JIT writes the program into the RW buffer. When the JIT is done, the program is copied to the final RX buffer with bpf_jit_binary_pack_finalize.

---
 arch/loongarch/net/bpf_jit.c | 123 ++++++++++++++++++++++++-----------
 arch/loongarch/net/bpf_jit.h |   2 +-
 2 files changed, 87 insertions(+), 38 deletions(-)
arch/loongarch/net/bpf_jit.c +86 -37
index 4be8515197ce..c1c71c2e86f0 100644
@@ -459,11 +459,11 @@ static int add_exception_handler(const struct bpf_insn *insn,
 				 struct jit_ctx *ctx,
 				 int dst_reg)
 {
-	unsigned long pc;
-	off_t offset;
 	struct exception_table_entry *ex;
+	off_t ins_offset, fixup_offset;
+	unsigned long pc;
 
-	if (!ctx->image || !ctx->prog->aux->extable)
+	if (!ctx->image || !ctx->ro_image || !ctx->prog->aux->extable)
 		return 0;
 
 	if (BPF_MODE(insn->code) != BPF_PROBE_MEM &&
@@ -474,14 +474,18 @@ static int add_exception_handler(const struct bpf_insn *insn,
 		return -EINVAL;
 
 	ex = &ctx->prog->aux->extable[ctx->num_exentries];
-	pc = (unsigned long)&ctx->image[ctx->idx - 1];
+	pc = (unsigned long)&ctx->ro_image[ctx->idx - 1];
 
-	offset = pc - (long)&ex->insn;
-	if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN))
+	/*
+	 * This is the relative offset of the instruction that may fault from
+	 * the exception table itself. This will be written to the exception
+	 * table and if this instruction faults, the destination register will
+	 * be set to '0' and the execution will jump to the next instruction.
+	 */
+	ins_offset = pc - (long)&ex->insn;
+	if (WARN_ON_ONCE(ins_offset >= 0 || ins_offset < INT_MIN))
 		return -ERANGE;
 
-	ex->insn = offset;
-
 	/*
 	 * Since the extable follows the program, the fixup offset is always
 	 * negative and limited to BPF_JIT_REGION_SIZE. Store a positive value
@@ -489,13 +493,25 @@ static int add_exception_handler(const struct bpf_insn *insn,
 	 * bits. We don't need to worry about buildtime or runtime sort
 	 * modifying the upper bits because the table is already sorted, and
 	 * isn't part of the main exception table.
+	 *
+	 * The fixup_offset is set to the next instruction from the instruction
+	 * that may fault. The execution will jump to this after handling the
+	 * fault.
 	 */
-	offset = (long)&ex->fixup - (pc + LOONGARCH_INSN_SIZE);
-	if (!FIELD_FIT(BPF_FIXUP_OFFSET_MASK, offset))
+	fixup_offset = (long)&ex->fixup - (pc + LOONGARCH_INSN_SIZE);
+	if (!FIELD_FIT(BPF_FIXUP_OFFSET_MASK, fixup_offset))
 		return -ERANGE;
 
+	/*
+	 * The offsets above have been calculated using the RO buffer but we
+	 * need to use the R/W buffer for writes.
+	 * switch ex to rw buffer for writing.
+	 */
+	ex = (void *)ctx->image + ((void *)ex - (void *)ctx->ro_image);
+	ex->insn = ins_offset;
+	ex->fixup = FIELD_PREP(BPF_FIXUP_OFFSET_MASK, fixup_offset) |
+		    FIELD_PREP(BPF_FIXUP_REG_MASK, dst_reg);
 	ex->type = EX_TYPE_BPF;
-	ex->fixup = FIELD_PREP(BPF_FIXUP_OFFSET_MASK, offset) | FIELD_PREP(BPF_FIXUP_REG_MASK, dst_reg);
 
 	ctx->num_exentries++;
 
@@ -1808,11 +1824,12 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 {
 	bool tmp_blinded = false, extra_pass = false;
-	u8 *image_ptr;
+	u8 *image_ptr, *ro_image_ptr;
 	int image_size, prog_size, extable_size;
 	struct jit_ctx ctx;
 	struct jit_data *jit_data;
 	struct bpf_binary_header *header;
+	struct bpf_binary_header *ro_header;
 	struct bpf_prog *tmp, *orig_prog = prog;
 
 	/*
@@ -1847,8 +1864,10 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 	}
 	if (jit_data->ctx.offset) {
 		ctx = jit_data->ctx;
-		image_ptr = jit_data->image;
+		ro_image_ptr = (void *)ctx.ro_image;
+		ro_header = jit_data->ro_header;
 		header = jit_data->header;
+		image_ptr = (void *)header + ((void *)ro_image_ptr - (void *)ro_header);
 		extra_pass = true;
 		prog_size = sizeof(u32) * ctx.idx;
 		goto skip_init_ctx;
@@ -1882,17 +1901,26 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 	prog_size = sizeof(u32) * ctx.idx;
 	image_size = prog_size + extable_size;
 	/* Now we know the size of the structure to make */
-	header = bpf_jit_binary_alloc(image_size, &image_ptr,
-				      sizeof(u32), jit_fill_hole);
-	if (header == NULL) {
+	ro_header = bpf_jit_binary_pack_alloc(image_size, &ro_image_ptr,
+					      sizeof(u32), &header, &image_ptr,
+					      jit_fill_hole);
+	if (!ro_header) {
 		prog = orig_prog;
 		goto out_offset;
 	}
 
 	/* 2. Now, the actual pass to generate final JIT code */
+	/*
+	 * Use the image(RW) for writing the JITed instructions. But also save
+	 * the ro_image(RX) for calculating the offsets in the image. The RW
+	 * image will be later copied to the RX image from where the program
+	 * will run. The bpf_jit_binary_pack_finalize() will do this copy in the
+	 * final step.
+	 */
 	ctx.image = (union loongarch_instruction *)image_ptr;
+	ctx.ro_image = (union loongarch_instruction *)ro_image_ptr;
 	if (extable_size)
-		prog->aux->extable = (void *)image_ptr + prog_size;
+		prog->aux->extable = (void *)ro_image_ptr + prog_size;
 
 skip_init_ctx:
 	ctx.idx = 0;
@@ -1900,48 +1928,47 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 
 	build_prologue(&ctx);
 	if (build_body(&ctx, extra_pass)) {
-		bpf_jit_binary_free(header);
 		prog = orig_prog;
-		goto out_offset;
+		goto out_free;
 	}
 	build_epilogue(&ctx);
 
 	/* 3. Extra pass to validate JITed code */
 	if (validate_ctx(&ctx)) {
-		bpf_jit_binary_free(header);
 		prog = orig_prog;
-		goto out_offset;
+		goto out_free;
 	}
 
 	/* And we're done */
 	if (bpf_jit_enable > 1)
 		bpf_jit_dump(prog->len, prog_size, 2, ctx.image);
 
-	/* Update the icache */
-	flush_icache_range((unsigned long)header, (unsigned long)(ctx.image + ctx.idx));
-
 	if (!prog->is_func || extra_pass) {
-		int err;
-
 		if (extra_pass && ctx.idx != jit_data->ctx.idx) {
 			pr_err_once("multi-func JIT bug %d != %d\n",
 				    ctx.idx, jit_data->ctx.idx);
 			goto out_free;
 		}
-		err = bpf_jit_binary_lock_ro(header);
-		if (err) {
-			pr_err_once("bpf_jit_binary_lock_ro() returned %d\n",
-				    err);
+		if (WARN_ON(bpf_jit_binary_pack_finalize(ro_header, header))) {
+			/* ro_header has been freed */
+			ro_header = NULL;
+			prog = orig_prog;
 			goto out_free;
 		}
+		/*
+		 * The instructions have now been copied to the ROX region from
+		 * where they will execute. Now the data cache has to be cleaned to
+		 * the PoU and the I-cache has to be invalidated for the VAs.
+		 */
+		bpf_flush_icache(ro_header, ctx.ro_image + ctx.idx);
 	} else {
 		jit_data->ctx = ctx;
-		jit_data->image = image_ptr;
 		jit_data->header = header;
+		jit_data->ro_header = ro_header;
 	}
 	prog->jited = 1;
 	prog->jited_len = prog_size;
-	prog->bpf_func = (void *)ctx.image;
+	prog->bpf_func = (void *)ctx.ro_image;
 
 	if (!prog->is_func || extra_pass) {
 		int i;
@@ -1961,17 +1988,39 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 	if (tmp_blinded)
 		bpf_jit_prog_release_other(prog, prog == orig_prog ? tmp : orig_prog);
 
-
 	return prog;
 
 out_free:
-	bpf_jit_binary_free(header);
-	prog->bpf_func = NULL;
-	prog->jited = 0;
-	prog->jited_len = 0;
+	if (header) {
+		bpf_arch_text_copy(&ro_header->size, &header->size, sizeof(header->size));
+		bpf_jit_binary_pack_free(ro_header, header);
+	}
 	goto out_offset;
 }
 
+void bpf_jit_free(struct bpf_prog *prog)
+{
+	if (prog->jited) {
+		struct jit_data *jit_data = prog->aux->jit_data;
+		struct bpf_binary_header *hdr;
+
+		/*
+		 * If we fail the final pass of JIT (from jit_subprogs),
+		 * the program may not be finalized yet. Call finalize here
+		 * before freeing it.
+		 */
+		if (jit_data) {
+			bpf_jit_binary_pack_finalize(jit_data->ro_header, jit_data->header);
+			kfree(jit_data);
+		}
+		hdr = bpf_jit_binary_pack_hdr(prog);
+		bpf_jit_binary_pack_free(hdr, NULL);
+		WARN_ON_ONCE(!bpf_prog_kallsyms_verify_off(prog));
+	}
+
+	bpf_prog_unlock_free(prog);
+}
+
 bool bpf_jit_bypass_spec_v1(void)
 {
 	return true;
arch/loongarch/net/bpf_jit.h +1 -1
index ed0193659cf9..7a9d2134f8d1 100644
@@ -24,7 +24,7 @@ struct jit_ctx {
 
 struct jit_data {
 	struct bpf_binary_header *header;
-	u8 *image;
+	struct bpf_binary_header *ro_header;
 	struct jit_ctx ctx;
 };
 
Signature · 1 line
2.43.5
author reviewer
#7 lore raw

PATCH 4/5 LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions

In reply to Hengqi Chen

Add support for {LDX,STX,ST} | PROBE_MEM32 | {B,H,W,DW} instructions. They are similar to PROBE_MEM instructions with the following differences:
* PROBE_MEM32 supports store.
* PROBE_MEM32 relies on the verifier to clear upper 32-bit of the src/dst register
* PROBE_MEM32 adds 64-bit kern_vm_start address (which is stored in S6 in the prologue). Due to bpf_arena constructions such S6 + reg + off16 access is guaranteed to be within arena virtual range, so no address check at run-time.
* S6 is a free callee-saved register, so it is used to store arena_vm_start
* PROBE_MEM32 allows STX and ST. If they fault the store is a nop. When LDX faults the destination register is zeroed.

To support these on LoongArch, we employ the t2/t3 registers to store intermediate results of reg_arena + src/dst reg and use the t2/t3 registers as the new src/dst reg. This allows us to reuse most of the existing code.

---
 arch/loongarch/net/bpf_jit.c | 69 +++++++++++++++++++++++++++++++++---
 arch/loongarch/net/bpf_jit.h |  1 +
 2 files changed, 66 insertions(+), 4 deletions(-)
arch/loongarch/net/bpf_jit.c +65 -4
index c1c71c2e86f0..14188e8d86bc 100644
@@ -17,6 +17,7 @@
 #define LOONGARCH_BPF_FENTRY_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
 
 #define REG_TCC		LOONGARCH_GPR_A6
+#define REG_ARENA	LOONGARCH_GPR_S6 /* For storing arena_vm_start */
 #define BPF_TAIL_CALL_CNT_PTR_STACK_OFF(stack) (round_up(stack, 16) - 80)
 
 static const int regmap[] = {
@@ -136,6 +137,9 @@ static void build_prologue(struct jit_ctx *ctx)
 	/* To store tcc and tcc_ptr */
 	stack_adjust += sizeof(long) * 2;
 
+	if (ctx->arena_vm_start)
+		stack_adjust += 8;
+
 	stack_adjust = round_up(stack_adjust, 16);
 	stack_adjust += bpf_stack_adjust;
 
@@ -177,6 +181,11 @@ static void build_prologue(struct jit_ctx *ctx)
 	store_offset -= sizeof(long);
 	emit_insn(ctx, std, LOONGARCH_GPR_S5, LOONGARCH_GPR_SP, store_offset);
 
+	if (ctx->arena_vm_start) {
+		store_offset -= sizeof(long);
+		emit_insn(ctx, std, REG_ARENA, LOONGARCH_GPR_SP, store_offset);
+	}
+
 	prepare_bpf_tail_call_cnt(ctx, &store_offset);
 
 	emit_insn(ctx, addid, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_adjust);
@@ -185,6 +194,9 @@ static void build_prologue(struct jit_ctx *ctx)
 		emit_insn(ctx, addid, regmap[BPF_REG_FP], LOONGARCH_GPR_SP, bpf_stack_adjust);
 
 	ctx->stack_size = stack_adjust;
+
+	if (ctx->arena_vm_start)
+		move_imm(ctx, REG_ARENA, ctx->arena_vm_start, false);
 }
 
 static void __build_epilogue(struct jit_ctx *ctx, bool is_tail_call)
@@ -216,6 +228,11 @@ static void __build_epilogue(struct jit_ctx *ctx, bool is_tail_call)
 	load_offset -= sizeof(long);
 	emit_insn(ctx, ldd, LOONGARCH_GPR_S5, LOONGARCH_GPR_SP, load_offset);
 
+	if (ctx->arena_vm_start) {
+		load_offset -= sizeof(long);
+		emit_insn(ctx, ldd, REG_ARENA, LOONGARCH_GPR_SP, load_offset);
+	}
+
 	/*
 	 * When push into the stack, follow the order of tcc then tcc_ptr.
 	 * When pop from the stack, first pop tcc_ptr then followed by tcc.
@@ -441,6 +458,7 @@ static bool is_signed_bpf_cond(u8 cond)
 
 #define BPF_FIXUP_REG_MASK	GENMASK(31, 27)
 #define BPF_FIXUP_OFFSET_MASK	GENMASK(26, 0)
+#define REG_DONT_CLEAR_MARKER	0
 
 bool ex_handler_bpf(const struct exception_table_entry *ex,
 		    struct pt_regs *regs)
@@ -448,7 +466,8 @@ bool ex_handler_bpf(const struct exception_table_entry *ex,
 	int dst_reg = FIELD_GET(BPF_FIXUP_REG_MASK, ex->fixup);
 	off_t offset = FIELD_GET(BPF_FIXUP_OFFSET_MASK, ex->fixup);
 
-	regs->regs[dst_reg] = 0;
+	if (dst_reg != REG_DONT_CLEAR_MARKER)
+		regs->regs[dst_reg] = 0;
 	regs->csr_era = (unsigned long)&ex->fixup - offset;
 
 	return true;
@@ -467,7 +486,8 @@ static int add_exception_handler(const struct bpf_insn *insn,
 		return 0;
 
 	if (BPF_MODE(insn->code) != BPF_PROBE_MEM &&
-	    BPF_MODE(insn->code) != BPF_PROBE_MEMSX)
+	    BPF_MODE(insn->code) != BPF_PROBE_MEMSX &&
+	    BPF_MODE(insn->code) != BPF_PROBE_MEM32)
 		return 0;
 
 	if (WARN_ON_ONCE(ctx->num_exentries >= ctx->prog->aux->num_exentries))
@@ -529,8 +549,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 	const u8 cond = BPF_OP(code);
 	const u8 t1 = LOONGARCH_GPR_T1;
 	const u8 t2 = LOONGARCH_GPR_T2;
-	const u8 src = regmap[insn->src_reg];
-	const u8 dst = regmap[insn->dst_reg];
+	const u8 t3 = LOONGARCH_GPR_T3;
+	u8 src = regmap[insn->src_reg];
+	u8 dst = regmap[insn->dst_reg];
 	const s16 off = insn->off;
 	const s32 imm = insn->imm;
 	const bool is32 = BPF_CLASS(insn->code) == BPF_ALU || BPF_CLASS(insn->code) == BPF_JMP32;
@@ -1036,8 +1057,19 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 	case BPF_LDX | BPF_PROBE_MEMSX | BPF_B:
 	case BPF_LDX | BPF_PROBE_MEMSX | BPF_H:
 	case BPF_LDX | BPF_PROBE_MEMSX | BPF_W:
+	/* LDX | PROBE_MEM32: dst = *(unsigned size *)(src + REG_ARENA + off) */
+	case BPF_LDX | BPF_PROBE_MEM32 | BPF_B:
+	case BPF_LDX | BPF_PROBE_MEM32 | BPF_H:
+	case BPF_LDX | BPF_PROBE_MEM32 | BPF_W:
+	case BPF_LDX | BPF_PROBE_MEM32 | BPF_DW:
 		sign_extend = BPF_MODE(insn->code) == BPF_MEMSX ||
 			      BPF_MODE(insn->code) == BPF_PROBE_MEMSX;
+
+		if (BPF_MODE(code) == BPF_PROBE_MEM32) {
+			emit_insn(ctx, addd, t2, src, REG_ARENA);
+			src = t2;
+		}
+
 		switch (BPF_SIZE(code)) {
 		case BPF_B:
 			if (is_signed_imm12(off)) {
@@ -1097,6 +1129,16 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 	case BPF_ST | BPF_MEM | BPF_H:
 	case BPF_ST | BPF_MEM | BPF_W:
 	case BPF_ST | BPF_MEM | BPF_DW:
+	/* ST | PROBE_MEM32: *(size *)(dst + REG_ARENA + off) = imm */
+	case BPF_ST | BPF_PROBE_MEM32 | BPF_B:
+	case BPF_ST | BPF_PROBE_MEM32 | BPF_H:
+	case BPF_ST | BPF_PROBE_MEM32 | BPF_W:
+	case BPF_ST | BPF_PROBE_MEM32 | BPF_DW:
+		if (BPF_MODE(code) == BPF_PROBE_MEM32) {
+			emit_insn(ctx, addd, t3, dst, REG_ARENA);
+			dst = t3;
+		}
+
 		switch (BPF_SIZE(code)) {
 		case BPF_B:
 			move_imm(ctx, t1, imm, is32);
@@ -1139,6 +1181,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 			}
 			break;
 		}
+
+		ret = add_exception_handler(insn, ctx, REG_DONT_CLEAR_MARKER);
+		if (ret)
+			return ret;
 		break;
 
 	/* *(size *)(dst + off) = src */
@@ -1146,6 +1192,16 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 	case BPF_STX | BPF_MEM | BPF_H:
 	case BPF_STX | BPF_MEM | BPF_W:
 	case BPF_STX | BPF_MEM | BPF_DW:
+	/* STX | PROBE_MEM32: *(size *)(dst + REG_ARENA + off) = src */
+	case BPF_STX | BPF_PROBE_MEM32 | BPF_B:
+	case BPF_STX | BPF_PROBE_MEM32 | BPF_H:
+	case BPF_STX | BPF_PROBE_MEM32 | BPF_W:
+	case BPF_STX | BPF_PROBE_MEM32 | BPF_DW:
+		if (BPF_MODE(code) == BPF_PROBE_MEM32) {
+			emit_insn(ctx, addd, t2, dst, REG_ARENA);
+			dst = t2;
+		}
+
 		switch (BPF_SIZE(code)) {
 		case BPF_B:
 			if (is_signed_imm12(off)) {
@@ -1184,6 +1240,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 			}
 			break;
 		}
+
+		ret = add_exception_handler(insn, ctx, REG_DONT_CLEAR_MARKER);
+		if (ret)
+			return ret;
 		break;
 
 	case BPF_STX | BPF_ATOMIC | BPF_W:
@@ -1875,6 +1935,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 
 	memset(&ctx, 0, sizeof(ctx));
 	ctx.prog = prog;
+	ctx.arena_vm_start = bpf_arena_get_kern_vm_start(prog->aux->arena);
 
 	ctx.offset = kvcalloc(prog->len + 1, sizeof(u32), GFP_KERNEL);
 	if (ctx.offset == NULL) {
arch/loongarch/net/bpf_jit.h +1 -0
index 7a9d2134f8d1..328ec445a710 100644
@@ -20,6 +20,7 @@ struct jit_ctx {
 	union loongarch_instruction *image;
 	union loongarch_instruction *ro_image;
 	u32 stack_size;
+	u64 arena_vm_start;
 };
 
 struct jit_data {
Signature · 1 line
2.43.5
author reviewer
#8 lore raw

PATCH 5/5 LoongArch: BPF: Implement bpf_addr_space_cast instruction

In reply to Hengqi Chen

LLVM generates bpf_addr_space_cast instruction while translating pointers between native (zero) address space and __attribute__((address_space(N))). The addr_space=0 is reserved as bpf_arena address space.

rY = addr_space_cast(rX, 0, 1) is processed by the verifier and converted to normal 32-bit move: wX = wY

rY = addr_space_cast(rX, 1, 0) has to be converted by JIT.

---
 arch/loongarch/net/bpf_jit.c | 15 +++++++++++++++
 arch/loongarch/net/bpf_jit.h |  1 +
 2 files changed, 16 insertions(+)
arch/loongarch/net/bpf_jit.c +15 -0
index 14188e8d86bc..12fc7bfe3fe4 100644
@@ -560,6 +560,15 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 	/* dst = src */
 	case BPF_ALU | BPF_MOV | BPF_X:
 	case BPF_ALU64 | BPF_MOV | BPF_X:
+		if (insn_is_cast_user(insn)) {
+			move_reg(ctx, t1, src);
+			emit_zext_32(ctx, t1, true);
+			move_imm(ctx, dst, (ctx->user_vm_start >> 32) << 32, false);
+			emit_insn(ctx, beq, t1, LOONGARCH_GPR_ZERO, 1);
+			emit_insn(ctx, or, t1, dst, t1);
+			move_reg(ctx, dst, t1);
+			break;
+		}
 		switch (off) {
 		case 0:
 			move_reg(ctx, dst, src);
@@ -1936,6 +1945,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 	memset(&ctx, 0, sizeof(ctx));
 	ctx.prog = prog;
 	ctx.arena_vm_start = bpf_arena_get_kern_vm_start(prog->aux->arena);
+	ctx.user_vm_start = bpf_arena_get_user_vm_start(prog->aux->arena);
 
 	ctx.offset = kvcalloc(prog->len + 1, sizeof(u32), GFP_KERNEL);
 	if (ctx.offset == NULL) {
@@ -2097,3 +2107,8 @@ bool bpf_jit_supports_subprog_tailcalls(void)
 {
 	return true;
 }
+
+bool bpf_jit_supports_arena(void)
+{
+	return true;
+}
arch/loongarch/net/bpf_jit.h +1 -0
index 328ec445a710..93720f5ec8bb 100644
@@ -21,6 +21,7 @@ struct jit_ctx {
 	union loongarch_instruction *ro_image;
 	u32 stack_size;
 	u64 arena_vm_start;
+	u64 user_vm_start;
 };
 
 struct jit_data {
Signature · 1 line
2.43.5
maintainer
#9 lore raw
In reply to Hengqi Chen

Hi, Hengqi,

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Huacai

Quoted 34 lines · Hengqi Chen

This small set implement new features with 2 bug fixes for BPF.

* Patch 1 fixes a bug discovered while testing the BPF Arena feature.
Without this fix, the arena_htab test case which use the
bpf_arena_alloc_pages kfunc will trigger a kernel panic.
* Patch 2 fixes a subtle bug for tail call index, this can be verified
by the verifier_runtime_jit test case.
See the following two threads for background:
- https://lore.kernel.org/bpf/CAEyhmHTvj4cDRfu1FXSEXmdCqyWfs3ehw5gtB9qJCrThuUy2Kw@mail.gmail.com/
- https://lore.kernel.org/bpf/[email protected]/
* Patch 3 uses pack allocator for BPF programs (BPF trampoline already
use pack allocator, this make it complete), with this, no regression
on existing selftests
* Patch 4 & 5 implements basic support for BPF Arena, the following
test cases passed:
- arena_htab
- arena_list
- verifier_arena
- verifier_arena_large

Hengqi Chen (5):
LoongArch: BPF: Sign extend kfunc call arguments
LoongArch: BPF: Zero-extend bpf_tail_call() index
LoongArch: BPF: Use BPF prog pack allocator
LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions
LoongArch: BPF: Implement bpf_addr_space_cast instruction

 arch/loongarch/net/bpf_jit.c | 225 ++++++++++++++++++++++++++++-------
 arch/loongarch/net/bpf_jit.h |  30 ++++-
 2 files changed, 213 insertions(+), 42 deletions(-)

--
2.43.5

maintainer
#2 lore raw

Re: [PATCH 1/5] LoongArch: BPF: Sign extend kfunc call arguments

In reply to Hengqi Chen

Hi, Hengqi,

Quoted 65 lines · Hengqi Chen

The kfunc calls are native calls so they should follow LoongArch calling conventions. Sign extend its arguments properly to avoid kernel panic. This is done by adding a new emit_abi_ext() helper. The emit_abi_ext() helper performs extension in place meaning a value already store in target register (This is different from the existing sign_extend() helper and thus we can't reuse it).

Fixes 5dc615520c4d ("LoongArch: Add BPF JIT support")
---
 arch/loongarch/net/bpf_jit.c | 16 ++++++++++++++++
 arch/loongarch/net/bpf_jit.h | 26 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
arch/loongarch/net/bpf_jit.c +16 -0
index f97dc9936401..c67631303841 100644
@@ -950,6 +950,22 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
                        emit_insn(ctx, ldd, REG_TCC, LOONGARCH_GPR_SP, tcc_ptr_off);
                }
 
+               if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
+                       const struct btf_func_model *m;
+                       int i;
+
+                       m = bpf_jit_find_kfunc_model(ctx->prog, insn);
+                       if (!m)
+                               return -EINVAL;
+
+                       for (i = 0; i < m->nr_args; i++) {
+                               u8 reg = regmap[BPF_REG_1 + i];
+                               bool sign = m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG;
+
+                               emit_abi_ext(ctx, reg, m->arg_size[i], sign);
+                       }
+               }
+
                move_addr(ctx, t1, func_addr);
                emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0);
 
arch/loongarch/net/bpf_jit.h +15 -0
index 5697158fd164..ed0193659cf9 100644
@@ -88,6 +88,32 @@ static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo
        emit_insn(ctx, addiw, reg, reg, 0);
 }
 
+/* Emit proper extension according to ABI requirements.
+ * Note that this requires a value of size `size` already resides in register `reg`.
+ */
+static inline void emit_abi_ext(struct jit_ctx *ctx, int reg, u8 size, bool sign)
+{
+       /* The ABI requires unsigned char/short to be zero-extended, leave it intact */
+       if (!sign && (size == 1 || size == 2))
+               return;
+
+       switch (size) {
+       case 1:
+               emit_insn(ctx, extwb, reg, reg);
+               break;
+       case 2:
+               emit_insn(ctx, extwh, reg, reg);

arch/loongarch/net/bpf_jit.h static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo · line 115

Quoted 10 lines
arch/loongarch/net/bpf_jit.h +10 -0
+               break;
+       case 4:
+               emit_insn(ctx, addiw, reg, reg, 0);
+               break;
+       case 8:
+               break;
+       default:
+               pr_warn("bpf_jit: invalid size %d for extension\n", size);
+       }
+}

Looks very similar to sign_extend(), can we reuse something?

Huacai

Quoted 7 lines
arch/loongarch/net/bpf_jit.h +1 -1
+
 static inline void move_addr(struct jit_ctx *ctx, enum loongarch_gpr rd, u64 addr)
 {
        u64 imm_11_0, imm_31_12, imm_51_32, imm_63_52;
--

2.43.5

author reviewer
#10 lore raw
In reply to Huacai Chen
Quoted 8 lines · Huacai Chen

Hi, Hengqi,

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Quoted 38 lines

Huacai

Quoted 34 lines · Hengqi Chen

This small set implement new features with 2 bug fixes for BPF.

* Patch 1 fixes a bug discovered while testing the BPF Arena feature.
Without this fix, the arena_htab test case which use the
bpf_arena_alloc_pages kfunc will trigger a kernel panic.
* Patch 2 fixes a subtle bug for tail call index, this can be verified
by the verifier_runtime_jit test case.
See the following two threads for background:
- https://lore.kernel.org/bpf/CAEyhmHTvj4cDRfu1FXSEXmdCqyWfs3ehw5gtB9qJCrThuUy2Kw@mail.gmail.com/
- https://lore.kernel.org/bpf/[email protected]/
* Patch 3 uses pack allocator for BPF programs (BPF trampoline already
use pack allocator, this make it complete), with this, no regression
on existing selftests
* Patch 4 & 5 implements basic support for BPF Arena, the following
test cases passed:
- arena_htab
- arena_list
- verifier_arena
- verifier_arena_large

Hengqi Chen (5):
LoongArch: BPF: Sign extend kfunc call arguments
LoongArch: BPF: Zero-extend bpf_tail_call() index
LoongArch: BPF: Use BPF prog pack allocator
LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions
LoongArch: BPF: Implement bpf_addr_space_cast instruction

 arch/loongarch/net/bpf_jit.c | 225 ++++++++++++++++++++++++++++-------
 arch/loongarch/net/bpf_jit.h |  30 ++++-
 2 files changed, 213 insertions(+), 42 deletions(-)

--
2.43.5

author reviewer
#3 lore raw

Re: [PATCH 1/5] LoongArch: BPF: Sign extend kfunc call arguments

In reply to Huacai Chen
Quoted 72 lines · Huacai Chen

Hi, Hengqi,

Quoted 68 lines · Hengqi Chen

The kfunc calls are native calls so they should follow LoongArch calling conventions. Sign extend its arguments properly to avoid kernel panic. This is done by adding a new emit_abi_ext() helper. The emit_abi_ext() helper performs extension in place meaning a value already store in target register (This is different from the existing sign_extend() helper and thus we can't reuse it).

Fixes 5dc615520c4d ("LoongArch: Add BPF JIT support")
---
 arch/loongarch/net/bpf_jit.c | 16 ++++++++++++++++
 arch/loongarch/net/bpf_jit.h | 26 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
arch/loongarch/net/bpf_jit.c +16 -0
index f97dc9936401..c67631303841 100644
@@ -950,6 +950,22 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
                        emit_insn(ctx, ldd, REG_TCC, LOONGARCH_GPR_SP, tcc_ptr_off);
                }
 
+               if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
+                       const struct btf_func_model *m;
+                       int i;
+
+                       m = bpf_jit_find_kfunc_model(ctx->prog, insn);
+                       if (!m)
+                               return -EINVAL;
+
+                       for (i = 0; i < m->nr_args; i++) {
+                               u8 reg = regmap[BPF_REG_1 + i];
+                               bool sign = m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG;
+
+                               emit_abi_ext(ctx, reg, m->arg_size[i], sign);
+                       }
+               }
+
                move_addr(ctx, t1, func_addr);
                emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0);
 
arch/loongarch/net/bpf_jit.h +18 -0
index 5697158fd164..ed0193659cf9 100644
@@ -88,6 +88,32 @@ static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo
        emit_insn(ctx, addiw, reg, reg, 0);
 }
 
+/* Emit proper extension according to ABI requirements.
+ * Note that this requires a value of size `size` already resides in register `reg`.
+ */
+static inline void emit_abi_ext(struct jit_ctx *ctx, int reg, u8 size, bool sign)
+{
+       /* The ABI requires unsigned char/short to be zero-extended, leave it intact */
+       if (!sign && (size == 1 || size == 2))
+               return;
+
+       switch (size) {
+       case 1:
+               emit_insn(ctx, extwb, reg, reg);
+               break;
+       case 2:
+               emit_insn(ctx, extwh, reg, reg);
+               break;
+       case 4:
+               emit_insn(ctx, addiw, reg, reg, 0);
Quoted 9 lines

arch/loongarch/net/bpf_jit.h static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo · line 115

Quoted 7 lines
arch/loongarch/net/bpf_jit.h +7 -0
+               break;
+       case 8:
+               break;
+       default:
+               pr_warn("bpf_jit: invalid size %d for extension\n", size);
+       }
+}

Looks very similar to sign_extend(), can we reuse something?

As decribed in the commit message, both helpers have strong implications:
- emit_abi_ext() requires values already store in dst reg
- sign_extend() assumes values not in dst reg and have to move value to dst reg even extension is not required

Adding a new helper here is because:
- requested by Tiezhu in last cycle
- emit_abi_ext() has better naming (I think)
- ease the backport process

Even if we are going to reuse the code, I would suggest replacing the existing sign_extend() with emit_abi_ext(). Note that reuse will require one extra instruction for struct_ops return value.

Quoted 9 lines

Huacai

Quoted 7 lines
arch/loongarch/net/bpf_jit.h +1 -1
+
 static inline void move_addr(struct jit_ctx *ctx, enum loongarch_gpr rd, u64 addr)
 {
        u64 imm_11_0, imm_31_12, imm_51_32, imm_63_52;
--

2.43.5

maintainer
#4 lore raw

Re: [PATCH 1/5] LoongArch: BPF: Sign extend kfunc call arguments

Quoted 84 lines · Hengqi Chen
Quoted 72 lines · Huacai Chen

Hi, Hengqi,

Quoted 68 lines · Hengqi Chen

The kfunc calls are native calls so they should follow LoongArch calling conventions. Sign extend its arguments properly to avoid kernel panic. This is done by adding a new emit_abi_ext() helper. The emit_abi_ext() helper performs extension in place meaning a value already store in target register (This is different from the existing sign_extend() helper and thus we can't reuse it).

Fixes 5dc615520c4d ("LoongArch: Add BPF JIT support")
---
 arch/loongarch/net/bpf_jit.c | 16 ++++++++++++++++
 arch/loongarch/net/bpf_jit.h | 26 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
arch/loongarch/net/bpf_jit.c +16 -0
index f97dc9936401..c67631303841 100644
@@ -950,6 +950,22 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
                        emit_insn(ctx, ldd, REG_TCC, LOONGARCH_GPR_SP, tcc_ptr_off);
                }
 
+               if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
+                       const struct btf_func_model *m;
+                       int i;
+
+                       m = bpf_jit_find_kfunc_model(ctx->prog, insn);
+                       if (!m)
+                               return -EINVAL;
+
+                       for (i = 0; i < m->nr_args; i++) {
+                               u8 reg = regmap[BPF_REG_1 + i];
+                               bool sign = m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG;
+
+                               emit_abi_ext(ctx, reg, m->arg_size[i], sign);
+                       }
+               }
+
                move_addr(ctx, t1, func_addr);
                emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0);
 
arch/loongarch/net/bpf_jit.h +18 -0
index 5697158fd164..ed0193659cf9 100644
@@ -88,6 +88,32 @@ static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo
        emit_insn(ctx, addiw, reg, reg, 0);
 }
 
+/* Emit proper extension according to ABI requirements.
+ * Note that this requires a value of size `size` already resides in register `reg`.
+ */
+static inline void emit_abi_ext(struct jit_ctx *ctx, int reg, u8 size, bool sign)
+{
+       /* The ABI requires unsigned char/short to be zero-extended, leave it intact */
+       if (!sign && (size == 1 || size == 2))
+               return;
+
+       switch (size) {
+       case 1:
+               emit_insn(ctx, extwb, reg, reg);
+               break;
+       case 2:
+               emit_insn(ctx, extwh, reg, reg);
+               break;
+       case 4:
+               emit_insn(ctx, addiw, reg, reg, 0);
Quoted 9 lines

arch/loongarch/net/bpf_jit.h static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo · line 115

Quoted 7 lines
arch/loongarch/net/bpf_jit.h +7 -0
+               break;
+       case 8:
+               break;
+       default:
+               pr_warn("bpf_jit: invalid size %d for extension\n", size);
+       }
+}

Looks very similar to sign_extend(), can we reuse something?

Quoted 8 lines

As decribed in the commit message, both helpers have strong implications:
- emit_abi_ext() requires values already store in dst reg
- sign_extend() assumes values not in dst reg and have to move value to dst reg even extension is not required

Adding a new helper here is because:
- requested by Tiezhu in last cycle
- emit_abi_ext() has better naming (I think)

Emm, but I think this name is strage, though I don't know what is better.

Huacai

Quoted 16 lines

- ease the backport process

Even if we are going to reuse the code, I would suggest replacing the existing sign_extend() with emit_abi_ext(). Note that reuse will require one extra instruction for struct_ops return value.

Quoted 9 lines

Huacai

Quoted 7 lines
arch/loongarch/net/bpf_jit.h +1 -1
+
 static inline void move_addr(struct jit_ctx *ctx, enum loongarch_gpr rd, u64 addr)
 {
        u64 imm_11_0, imm_31_12, imm_51_32, imm_63_52;
--

2.43.5

#18 lore raw
In reply to Hengqi Chen
Quoted 28 lines · Hengqi Chen

This small set implement new features with 2 bug fixes for BPF.

* Patch 1 fixes a bug discovered while testing the BPF Arena feature.
Without this fix, the arena_htab test case which use the
bpf_arena_alloc_pages kfunc will trigger a kernel panic.
* Patch 2 fixes a subtle bug for tail call index, this can be verified
by the verifier_runtime_jit test case.
See the following two threads for background:
- https://lore.kernel.org/bpf/CAEyhmHTvj4cDRfu1FXSEXmdCqyWfs3ehw5gtB9qJCrThuUy2Kw@mail.gmail.com/
- https://lore.kernel.org/bpf/[email protected]/
* Patch 3 uses pack allocator for BPF programs (BPF trampoline already
use pack allocator, this make it complete), with this, no regression
on existing selftests
* Patch 4 & 5 implements basic support for BPF Arena, the following
test cases passed:
- arena_htab
- arena_list
- verifier_arena
- verifier_arena_large

Hengqi Chen (5):
LoongArch: BPF: Sign extend kfunc call arguments
LoongArch: BPF: Zero-extend bpf_tail_call() index
LoongArch: BPF: Use BPF prog pack allocator
LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions
LoongArch: BPF: Implement bpf_addr_space_cast instruction

Quoted 4 lines
 arch/loongarch/net/bpf_jit.c | 225 ++++++++++++++++++++++++++++-------
 arch/loongarch/net/bpf_jit.h |  30 ++++-
 2 files changed, 213 insertions(+), 42 deletions(-)

Hi Hengqi,

you can add Tested-by: Vincent Li <[email protected]>

[root@fedora bpf]#./test_progs --deny=timer_lockup --json-summary="./bpf_selftests.json"

[root@fedora bpf]#cat bpf_selftests.json | jq . > bpf_selftests.txt

[root@fedora bpf]# grep -B4 '"failed": true' bpf_selftests.txt | grep -v '"message":'

    {
      "name": "arena_atomics",
      "number": 3,
      "failed": true,
--
    {
      "name": "arena_spin_lock",
      "number": 6,
      "failed": true,
--
        {
          "name": "arena_spin_lock_1",
          "number": 1,
          "failed": true
--
        {
          "name": "arena_spin_lock_1000",
          "number": 2,
          "failed": true
--
        {
          "name": "arena_spin_lock_50000",
          "number": 3,
          "failed": true
--
    {
      "name": "bpf_tcp_ca",
      "number": 31,
      "failed": true,
--
        {
          "name": "tcp_ca_kfunc",
          "number": 14,
          "failed": true
--
    {
      "name": "build_id",
      "number": 46,
      "failed": true,
--
        {
          "name": "nofault-paged-out",
          "number": 1,
          "failed": true
--
    {
      "name": "dynptr",
      "number": 97,
      "failed": true,
--
        {
          "name": "test_probe_read_user_dynptr",
          "number": 27,
          "failed": true
--
        {
          "name": "test_probe_read_kernel_dynptr",
          "number": 28,
          "failed": true
--
        {
          "name": "test_probe_read_user_str_dynptr",
          "number": 29,
          "failed": true
--
        {
          "name": "test_probe_read_kernel_str_dynptr",
          "number": 30,
          "failed": true
--
    {
      "name": "exceptions",
      "number": 101,
      "failed": true,
--
        {
          "name": "reject_exception_cb_type_1",
          "number": 1,
          "failed": true
--
        {
          "name": "reject_exception_cb_type_2",
          "number": 2,
          "failed": true
--
        {
          "name": "reject_exception_cb_type_3",
          "number": 3,
          "failed": true
--
        {
          "name": "reject_exception_cb_type_4",
          "number": 4,
          "failed": true
--
        {
          "name": "reject_async_callback_throw",
          "number": 5,
          "failed": true
--
        {
          "name": "reject_with_rcu_read_lock",
          "number": 8,
          "failed": true
--
        {
          "name": "reject_subprog_with_rcu_read_lock",
          "number": 9,
          "failed": true
--
        {
          "name": "reject_with_reference",
          "number": 11,
          "failed": true
--
        {
          "name": "reject_with_cb_reference",
          "number": 12,
          "failed": true
--
        {
          "name": "reject_with_cb",
          "number": 13,
          "failed": true
--
        {
          "name": "reject_with_subprog_reference",
          "number": 14,
          "failed": true
--
        {
          "name": "reject_throwing_exception_cb",
          "number": 15,
          "failed": true
--
        {
          "name": "reject_exception_throw_cb",
          "number": 19,
          "failed": true
--
        {
          "name": "reject_exception_throw_cb_diff",
          "number": 20,
          "failed": true
--
        {
          "name": "reject_set_exception_cb_bad_ret2",
          "number": 22,
          "failed": true
--
        {
          "name": "check_assert_eq_int_min",
          "number": 23,
          "failed": true
--
        {
          "name": "check_assert_eq_int_max",
          "number": 24,
          "failed": true
--
        {
          "name": "check_assert_eq_zero",
          "number": 25,
          "failed": true
--
        {
          "name": "check_assert_eq_llong_min",
          "number": 26,
          "failed": true
--
        {
          "name": "check_assert_eq_llong_max",
          "number": 27,
          "failed": true
--
        {
          "name": "check_assert_lt_pos",
          "number": 28,
          "failed": true
--
        {
          "name": "check_assert_lt_zero",
          "number": 29,
          "failed": true
--
        {
          "name": "check_assert_lt_neg",
          "number": 30,
          "failed": true
--
        {
          "name": "check_assert_le_pos",
          "number": 31,
          "failed": true
--
        {
          "name": "check_assert_le_zero",
          "number": 32,
          "failed": true
--
        {
          "name": "check_assert_le_neg",
          "number": 33,
          "failed": true
--
        {
          "name": "check_assert_gt_pos",
          "number": 34,
          "failed": true
--
        {
          "name": "check_assert_gt_zero",
          "number": 35,
          "failed": true
--
        {
          "name": "check_assert_gt_neg",
          "number": 36,
          "failed": true
--
        {
          "name": "check_assert_ge_pos",
          "number": 37,
          "failed": true
--
        {
          "name": "check_assert_ge_zero",
          "number": 38,
          "failed": true
--
        {
          "name": "check_assert_ge_neg",
          "number": 39,
          "failed": true
--
        {
          "name": "check_assert_range_s64",
          "number": 40,
          "failed": true
--
        {
          "name": "check_assert_range_u64",
          "number": 41,
          "failed": true
--
        {
          "name": "check_assert_single_range_s64",
          "number": 42,
          "failed": true
--
        {
          "name": "check_assert_single_range_u64",
          "number": 43,
          "failed": true
--
        {
          "name": "check_assert_generic",
          "number": 44,
          "failed": true
--
        {
          "name": "check_assert_with_return",
          "number": 45,
          "failed": true
--
    {
      "name": "fentry_test",
      "number": 109,
      "failed": true,
--
        {
          "name": "fentry_many_args",
          "number": 2,
          "failed": true
--
    {
      "name": "fexit_test",
      "number": 113,
      "failed": true,
--
        {
          "name": "fexit_many_args",
          "number": 2,
          "failed": true
--
    {
      "name": "flow_dissector_classification",
      "number": 117,
      "failed": true,
--
        {
          "name": "ipv4",
          "number": 1,
          "failed": true
--
        {
          "name": "ipv4_continue_dissect",
          "number": 2,
          "failed": true
--
        {
          "name": "ipip",
          "number": 3,
          "failed": true
--
        {
          "name": "gre",
          "number": 4,
          "failed": true
--
        {
          "name": "port_range",
          "number": 5,
          "failed": true
--
        {
          "name": "ipv6",
          "number": 6,
          "failed": true
--
    {
      "name": "global_map_resize",
      "number": 136,
      "failed": true,
--
        {
          "name": "global_map_resize_bss",
          "number": 1,
          "failed": true
--
        {
          "name": "global_map_resize_data",
          "number": 2,
          "failed": true
--
    {
      "name": "hash_large_key",
      "number": 137,
      "failed": true,
--
    {
      "name": "ldsx_insn",
      "number": 162,
      "failed": true,
--
        {
          "name": "map_val and probed_memory",
          "number": 1,
          "failed": true
--
    {
      "name": "libbpf_probe_prog_types",
      "number": 167,
      "failed": true,
--
        {
          "name": "BPF_PROG_TYPE_LIRC_MODE2",
          "number": 20,
          "failed": true
--
    {
      "name": "livepatch_trampoline",
      "number": 175,
      "failed": true,
--
    {
      "name": "lwt_ip_encap_ipv4",
      "number": 184,
      "failed": true,
--
        {
          "name": "egress",
          "number": 1,
          "failed": true
--
        {
          "name": "ingress",
          "number": 2,
          "failed": true
--
    {
      "name": "lwt_ip_encap_ipv6",
      "number": 185,
      "failed": true,
--
        {
          "name": "egress",
          "number": 1,
          "failed": true
--
        {
          "name": "ingress",
          "number": 2,
          "failed": true
--
    {
      "name": "lwt_ip_encap_vrf_ipv4",
      "number": 186,
      "failed": true,
--
        {
          "name": "egress",
          "number": 1,
          "failed": true
--
        {
          "name": "ingress",
          "number": 2,
          "failed": true
--
    {
      "name": "lwt_ip_encap_vrf_ipv6",
      "number": 187,
      "failed": true,
--
        {
          "name": "egress",
          "number": 1,
          "failed": true
--
        {
          "name": "ingress",
          "number": 2,
          "failed": true
--
    {
      "name": "lwt_redirect",
      "number": 188,
      "failed": true,
--
        {
          "name": "lwt_redirect_normal",
          "number": 1,
          "failed": true
--
        {
          "name": "lwt_redirect_normal_nomac",
          "number": 2,
          "failed": true
--
        {
          "name": "lwt_redirect_dev_down",
          "number": 3,
          "failed": true
--
        {
          "name": "lwt_redirect_dev_down_nomac",
          "number": 4,
          "failed": true
--
        {
          "name": "lwt_redirect_dev_carrier_down",
          "number": 5,
          "failed": true
--
    {
      "name": "lwt_reroute",
      "number": 189,
      "failed": true,
--
        {
          "name": "lwt_reroute_normal_xmit",
          "number": 1,
          "failed": true
--
        {
          "name": "lwt_reroute_qdisc_dropped",
          "number": 2,
          "failed": true
--
    {
      "name": "lwt_seg6local",
      "number": 190,
      "failed": true,
--
    {
      "name": "module_attach",
      "number": 207,
      "failed": true,
--
    {
      "name": "module_fentry_shadow",
      "number": 208,
      "failed": true,
--
    {
      "name": "ns_tc_links_dev_chain0",
      "number": 224,
      "failed": true,
--
    {
      "name": "perf_skip",
      "number": 260,
      "failed": true,
--
    {
      "name": "pro_epilogue",
      "number": 271,
      "failed": true,
--
        {
          "name": "syscall_prologue",
          "number": 4,
          "failed": true
--
        {
          "name": "syscall_epilogue",
          "number": 5,
          "failed": true
--
        {
          "name": "syscall_pro_epilogue",
          "number": 6,
          "failed": true
--
        {
          "name": "syscall_prologue_goto_start",
          "number": 10,
          "failed": true
--
        {
          "name": "syscall_epilogue_goto_start",
          "number": 11,
          "failed": true
--
        {
          "name": "syscall_pro_epilogue_goto_start",
          "number": 12,
          "failed": true
--
        {
          "name": "syscall_epilogue_exit0",
          "number": 14,
          "failed": true
--
        {
          "name": "syscall_epilogue_exit1",
          "number": 15,
          "failed": true
--
        {
          "name": "syscall_pro_epilogue",
          "number": 17,
          "failed": true
--
        {
          "name": "tailcall",
          "number": 18,
          "failed": true
--
    {
      "name": "res_spin_lock_failure",
      "number": 361,
      "failed": true,
--
        {
          "name": "res_spin_lock_var_off",
          "number": 12,
          "failed": true
--
    {
      "name": "setget_sockopt",
      "number": 370,
      "failed": true,
--
    {
      "name": "stream_success",
      "number": 413,
      "failed": true,
--
        {
          "name": "stream_deadlock",
          "number": 3,
          "failed": true
--
    {
      "name": "struct_ops_id_ops_mapping",
      "number": 417,
      "failed": true,
--
        {
          "name": "st_ops_id_ops_mapping",
          "number": 1,
          "failed": true
--
    {
      "name": "struct_ops_module",
      "number": 420,
      "failed": true,
--
        {
          "name": "struct_ops_load",
          "number": 1,
          "failed": true
--
        {
          "name": "struct_ops_incompatible",
          "number": 3,
          "failed": true
--
    {
      "name": "struct_ops_multi_pages",
      "number": 421,
      "failed": true,
--
        {
          "name": "multi_pages",
          "number": 1,
          "failed": true
--
    {
      "name": "subprogs_extable",
      "number": 426,
      "failed": true,
--
    {
      "name": "task_local_data",
      "number": 435,
      "failed": true,
--
        {
          "name": "task_local_data_basic",
          "number": 1,
          "failed": true
--
        {
          "name": "task_local_data_race",
          "number": 2,
          "failed": true
--
    {
      "name": "tc_netkit_basic",
      "number": 443,
      "failed": true,
--
    {
      "name": "tc_netkit_device",
      "number": 444,
      "failed": true,
--
    {
      "name": "tc_netkit_multi_links",
      "number": 445,
      "failed": true,
--
    {
      "name": "tc_netkit_multi_opts",
      "number": 446,
      "failed": true,
--
    {
      "name": "tc_netkit_neigh_links",
      "number": 447,
      "failed": true,
--
    {
      "name": "tc_netkit_pkt_type",
      "number": 448,
      "failed": true,
--
    {
      "name": "tc_netkit_scrub",
      "number": 449,
      "failed": true,
--
    {
      "name": "tc_redirect",
      "number": 455,
      "failed": true,
--
        {
          "name": "tc_redirect_peer",
          "number": 2,
          "failed": true
--
        {
          "name": "tc_redirect_peer_l3",
          "number": 4,
          "failed": true
--
    {
      "name": "test_bpffs",
      "number": 456,
      "failed": true,
--
    {
      "name": "test_ima",
      "number": 461,
      "failed": true,
--
    {
      "name": "test_lsm",
      "number": 463,
      "failed": true,
--
        {
          "name": "lsm_basic",
          "number": 1,
          "failed": true
--
    {
      "name": "timer",
      "number": 468,
      "failed": true,
--
    {
      "name": "timer_mim",
      "number": 472,
      "failed": true,
--
    {
      "name": "tracing_struct",
      "number": 481,
      "failed": true,
--
        {
          "name": "struct_args",
          "number": 1,
          "failed": true
--
        {
          "name": "struct_many_args",
          "number": 2,
          "failed": true
--
        {
          "name": "union_args",
          "number": 3,
          "failed": true
--
    {
      "name": "tunnel",
      "number": 483,
      "failed": true,
--
        {
          "name": "vxlan_tunnel",
          "number": 1,
          "failed": true
--
        {
          "name": "ip6vxlan_tunnel",
          "number": 2,
          "failed": true
--
        {
          "name": "ipip_tunnel",
          "number": 3,
          "failed": true
--
        {
          "name": "ipip_tunnel",
          "number": 4,
          "failed": true
--
        {
          "name": "ipip_tunnel",
          "number": 5,
          "failed": true
--
        {
          "name": "xfrm_tunnel",
          "number": 6,
          "failed": true
--
        {
          "name": "gre_tunnel",
          "number": 7,
          "failed": true
--
        {
          "name": "gre_tunnel",
          "number": 8,
          "failed": true
--
        {
          "name": "gre_tunnel",
          "number": 9,
          "failed": true
--
        {
          "name": "gre_tunnel",
          "number": 10,
          "failed": true
--
        {
          "name": "ip6gre_tunnel",
          "number": 11,
          "failed": true
--
        {
          "name": "ip6gre_tunnel",
          "number": 12,
          "failed": true
--
        {
          "name": "erspan_tunnel",
          "number": 13,
          "failed": true
--
        {
          "name": "erspan_tunnel",
          "number": 14,
          "failed": true
--
        {
          "name": "ip6erspan_tunnel",
          "number": 15,
          "failed": true
--
        {
          "name": "ip6erspan_tunnel",
          "number": 16,
          "failed": true
--
        {
          "name": "geneve_tunnel",
          "number": 17,
          "failed": true
--
        {
          "name": "ip6geneve_tunnel",
          "number": 18,
          "failed": true
--
        {
          "name": "ip6tnl_tunnel",
          "number": 19,
          "failed": true
--
        {
          "name": "ip6tnl_tunnel",
          "number": 20,
          "failed": true
--
    {
      "name": "usdt",
      "number": 492,
      "failed": true,
--
        {
          "name": "basic",
          "number": 1,
          "failed": true
--
        {
          "name": "multispec",
          "number": 2,
          "failed": true
--
        {
          "name": "urand_auto_attach",
          "number": 3,
          "failed": true
--
        {
          "name": "urand_pid_attach",
          "number": 4,
          "failed": true
--
    {
      "name": "verifier_bits_iter",
      "number": 501,
      "failed": true,
--
        {
          "name": "max words",
          "number": 12,
          "failed": true
--
    {
      "name": "verifier_bounds",
      "number": 502,
      "failed": true,
--
        {
          "name": "subtraction bounds (map value) variant 2 @unpriv",
          "number": 4,
          "failed": true

--
{
"name": "bounds check map access with off+size signed 32bit
overflow. test2 @unpriv",

          "number": 30,
          "failed": true

--
{
"name": "bounds check map access with off+size signed 32bit
overflow. test3 @unpriv",

          "number": 32,
          "failed": true
--
    {
      "name": "verifier_bounds_deduction",
      "number": 503,
      "failed": true,
--
        {
          "name": "check deducing bounds from const, 1 @unpriv",
          "number": 2,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 2 @unpriv",
          "number": 4,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 3 @unpriv",
          "number": 6,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 4 @unpriv",
          "number": 8,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 5 @unpriv",
          "number": 10,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 6 @unpriv",
          "number": 12,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 7 @unpriv",
          "number": 14,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 8 @unpriv",
          "number": 16,
          "failed": true
--
        {
          "name": "check deducing bounds from const, 9 @unpriv",
          "number": 18,
          "failed": true
--
    {
      "name": "verifier_direct_stack_access_wraparound",
      "number": 521,
      "failed": true,
--
        {
          "name": "direct stack access with 32-bit wraparound. test3 @unpriv",
          "number": 6,
          "failed": true
--
    {
      "name": "verifier_map_ptr",
      "number": 548,
      "failed": true,
--
        {
          "name": "bpf_map_ptr: r = 0, map_ptr = map_ptr + r @unpriv",
          "number": 10,
          "failed": true
--
        {
          "name": "bpf_map_ptr: r = 0, r = r + map_ptr @unpriv",
          "number": 12,
          "failed": true
--
    {
      "name": "verifier_map_ptr_mixing",
      "number": 549,
      "failed": true,

--
{
"name": "cond: two branches returning different map pointers
for lookup (tail, tail) @unpriv",

          "number": 2,
          "failed": true
--
    {
      "name": "verifier_runtime_jit",
      "number": 570,
      "failed": true,

--
{
"name": "runtime/jit: tail_call within bounds, different
maps, first branch @unpriv",

          "number": 18,
          "failed": true

--
{
"name": "runtime/jit: tail_call within bounds, different
maps, second branch @unpriv",

          "number": 20,
          "failed": true
--
        {
          "name": "runtime/jit: pass > 32bit index to tail_call @unpriv",
          "number": 26,
          "failed": true
--
    {
      "name": "verifier_scalar_ids",
      "number": 571,
      "failed": true,
--
        {
          "name": "linked_regs_and_subreg_def",
          "number": 18,
          "failed": true
--
    {
      "name": "verifier_stack_ptr",
      "number": 579,
      "failed": true,
--
        {
          "name": "PTR_TO_STACK store/load - out of bounds low @unpriv",
          "number": 8,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check high 3 @unpriv",
          "number": 16,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check high 4 @unpriv",
          "number": 18,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check high 5 @unpriv",
          "number": 20,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check high 6 @unpriv",
          "number": 22,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check high 7 @unpriv",
          "number": 24,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check low 2 @unpriv",
          "number": 28,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check low 3 @unpriv",
          "number": 30,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check low 5 @unpriv",
          "number": 34,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check low 6 @unpriv",
          "number": 36,
          "failed": true
--
        {
          "name": "PTR_TO_STACK check low 7 @unpriv",
          "number": 38,
          "failed": true
--
    {
      "name": "verifier_unpriv",
      "number": 587,
      "failed": true,
--
        {
          "name": "unpriv: adding of fp, reg @unpriv",
          "number": 46,
          "failed": true
--
        {
          "name": "unpriv: adding of fp, imm @unpriv",
          "number": 48,
          "failed": true
--
    {
      "name": "verifier_value_ptr_arith",
      "number": 593,
      "failed": true,
--
        {
          "name": "map access: known scalar += value_ptr unknown vs
const @unpriv",
          "number": 2,
          "failed": true
--
        {
          "name": "map access: known scalar += value_ptr const vs
unknown @unpriv",
          "number": 4,
          "failed": true
--
        {
          "name": "map access: known scalar += value_ptr const vs
const (ne) @unpriv",
          "number": 6,
          "failed": true
--
        {
          "name": "map access: known scalar += value_ptr unknown vs
unknown (lt) @unpriv",
          "number": 12,
          "failed": true
--
        {
          "name": "map access: known scalar += value_ptr unknown vs
unknown (gt) @unpriv",
          "number": 14,
          "failed": true

--
{
"name": "map access: value_ptr -= known scalar from
different maps @unpriv",

          "number": 18,
          "failed": true
--
        {
          "name": "map access: mixing value pointer and scalar, 1 @unpriv",
          "number": 22,
          "failed": true
--
        {
          "name": "map access: mixing value pointer and scalar, 2 @unpriv",
          "number": 24,
          "failed": true
--
        {
          "name": "map access: value_ptr += known scalar, upper oob
arith, test 1 @unpriv",
          "number": 32,
          "failed": true
--
        {
          "name": "map access: value_ptr += known scalar, upper oob
arith, test 2 @unpriv",
          "number": 34,
          "failed": true

--
{
"name": "map access: value_ptr -= known scalar, lower oob
arith, test 1 @unpriv",

          "number": 38,
          "failed": true

--
{
"name": "map access: value_ptr -= known scalar, lower oob
arith, test 2 @unpriv",

          "number": 40,
          "failed": true
--
        {
          "name": "map access: unknown scalar += value_ptr, 3 @unpriv",
          "number": 64,
          "failed": true
--
        {
          "name": "map access: unknown scalar += value_ptr, 4 @unpriv",
          "number": 66,
          "failed": true
--
    {
      "name": "verifier_var_off",
      "number": 594,
      "failed": true,
--
        {
          "name": "variable-offset stack read, priv vs unpriv @unpriv",
          "number": 6,
          "failed": true
--
        {
          "name": "variable-offset stack read, uninitialized @unpriv",
          "number": 8,
          "failed": true

--
{
"name": "indirect variable-offset stack access, min_off <
min_initialized @unpriv",

          "number": 10,
          "failed": true

--
{
"name": "indirect variable-offset stack access, priv vs
unpriv @unpriv",

          "number": 12,
          "failed": true
--
        {
          "name": "variable-offset stack write, priv vs unpriv @unpriv",
          "number": 14,
          "failed": true
--
        {
          "name": "variable-offset stack write followed by read @unpriv",
          "number": 16,
          "failed": true
--
        {
          "name": "variable-offset stack write clobbers spilled regs @unpriv",
          "number": 18,
          "failed": true
--
    {
      "name": "verif_scale_pyperf600",
      "number": 612,
      "failed": true,
--
    {
      "name": "verif_scale_seg6_loop",
      "number": 618,
      "failed": true,
--
    {
      "name": "vmlinux",
      "number": 631,
      "failed": true,
--
    {
      "name": "vrf_socket_lookup",
      "number": 632,
      "failed": true,
--
    {
      "name": "wq",
      "number": 633,
      "failed": true,
--
        {
          "name": "test_call_array_sleepable",
          "number": 1,
          "failed": true
--
        {
          "name": "test_call_hash_sleepable",
          "number": 2,
          "failed": true
--
        {
          "name": "test_call_hash_malloc_sleepable",
          "number": 3,
          "failed": true
--
        {
          "name": "test_call_lru_sleepable",
          "number": 4,
          "failed": true
--
        {
          "name": "test_syscall_array_sleepable",
          "number": 5,
          "failed": true
--
    {
      "name": "xdp_adjust_tail",
      "number": 636,
      "failed": true,
--
        {
          "name": "xdp_adjust_tail_grow",
          "number": 2,
          "failed": true
--
        {
          "name": "xdp_adjust_frags_tail_grow",
          "number": 5,
          "failed": true
--
    {
      "name": "xdp_context_tuntap",
      "number": 641,
      "failed": true,
--
        {
          "name": "clone_data_meta_empty_on_data_write",
          "number": 8,
          "failed": true
--
        {
          "name": "clone_data_meta_empty_on_meta_write",
          "number": 9,
          "failed": true
--
        {
          "name": "clone_dynptr_empty_on_data_slice_write",
          "number": 10,
          "failed": true
--
        {
          "name": "clone_dynptr_empty_on_meta_slice_write",
          "number": 11,
          "failed": true
--
        {
          "name": "clone_dynptr_rdonly_before_data_dynptr_write",
          "number": 12,
          "failed": true
--
        {
          "name": "clone_dynptr_rdonly_before_meta_dynptr_write",
          "number": 13,
          "failed": true
--
    {
      "name": "xdp_do_redirect",
      "number": 646,
      "failed": true,
--
    {
      "name": "xdp_flowtable",
      "number": 647,
      "failed": true,
--
    {
      "name": "xdp_pull_data",
      "number": 654,
      "failed": true,
--
        {
          "name": "xdp_pull_data",
          "number": 1,
          "failed": true
--
    {
      "name": "xdp_synproxy",
      "number": 655,
      "failed": true,
--
        {
          "name": "xdp",
          "number": 1,
          "failed": true
--
        {
          "name": "tc",
          "number": 2,
          "failed": true
--
    {
      "name": "xfrm_info",
      "number": 662,
      "failed": true,

[root@fedora bpf]#

Quoted 2 lines

--
2.43.5

maintainer
#11 lore raw
In reply to Hengqi Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

Huacai

Quoted 39 lines
Quoted 39 lines

Huacai

Quoted 34 lines · Hengqi Chen

This small set implement new features with 2 bug fixes for BPF.

* Patch 1 fixes a bug discovered while testing the BPF Arena feature.
Without this fix, the arena_htab test case which use the
bpf_arena_alloc_pages kfunc will trigger a kernel panic.
* Patch 2 fixes a subtle bug for tail call index, this can be verified
by the verifier_runtime_jit test case.
See the following two threads for background:
- https://lore.kernel.org/bpf/CAEyhmHTvj4cDRfu1FXSEXmdCqyWfs3ehw5gtB9qJCrThuUy2Kw@mail.gmail.com/
- https://lore.kernel.org/bpf/[email protected]/
* Patch 3 uses pack allocator for BPF programs (BPF trampoline already
use pack allocator, this make it complete), with this, no regression
on existing selftests
* Patch 4 & 5 implements basic support for BPF Arena, the following
test cases passed:
- arena_htab
- arena_list
- verifier_arena
- verifier_arena_large

Hengqi Chen (5):
LoongArch: BPF: Sign extend kfunc call arguments
LoongArch: BPF: Zero-extend bpf_tail_call() index
LoongArch: BPF: Use BPF prog pack allocator
LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions
LoongArch: BPF: Implement bpf_addr_space_cast instruction

 arch/loongarch/net/bpf_jit.c | 225 ++++++++++++++++++++++++++++-------
 arch/loongarch/net/bpf_jit.h |  30 ++++-
 2 files changed, 213 insertions(+), 42 deletions(-)

--
2.43.5

maintainer Acked-by
#12 lore raw
Quoted 8 lines · Huacai Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

I trust Hengqi and I am OK with this series in general with a quick look.

For the two functions sign_extend() and emit_abi_ext(), I have no strong opinion, I do not want to respin the patch since the merge window is coming soon, it does not affect the correctness, so we can refine the code later if there is a better way.

Thanks,
Tiezhu

author reviewer
#13 lore raw
Quoted 22 lines · Tiezhu Yang
Quoted 8 lines · Huacai Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

I trust Hengqi and I am OK with this series in general with a quick look.

Quoted 8 lines

For the two functions sign_extend() and emit_abi_ext(), I have no strong opinion, I do not want to respin the patch since the merge window is coming soon, it does not affect the correctness, so we can refine the code later if there is a better way.

Thanks.

Quoted 3 lines

Thanks,
Tiezhu

author reviewer
#14 lore raw

Hi Huacai,

Will you pick this series for 6.19 ?

Thanks.

Quoted 38 lines · Hengqi Chen
Quoted 22 lines · Tiezhu Yang
Quoted 8 lines · Huacai Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

I trust Hengqi and I am OK with this series in general with a quick look.

Quoted 8 lines

For the two functions sign_extend() and emit_abi_ext(), I have no strong opinion, I do not want to respin the patch since the merge window is coming soon, it does not affect the correctness, so we can refine the code later if there is a better way.

Thanks.

Quoted 3 lines

Thanks,
Tiezhu

maintainer
#15 lore raw
Quoted 4 lines · Hengqi Chen

Hi Huacai,

Will you pick this series for 6.19 ?

I tend to not pick it, because it is a little hurried.

Huacai

Quoted 42 lines

Thanks.

Quoted 38 lines · Hengqi Chen
Quoted 22 lines · Tiezhu Yang
Quoted 8 lines · Huacai Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

I trust Hengqi and I am OK with this series in general with a quick look.

Quoted 8 lines

For the two functions sign_extend() and emit_abi_ext(), I have no strong opinion, I do not want to respin the patch since the merge window is coming soon, it does not affect the correctness, so we can refine the code later if there is a better way.

Thanks.

Quoted 3 lines

Thanks,
Tiezhu

author reviewer
#16 lore raw
Quoted 8 lines · Huacai Chen
Quoted 4 lines · Hengqi Chen

Hi Huacai,

Will you pick this series for 6.19 ?

I tend to not pick it, because it is a little hurried.

Fine, but deferring does not improve anything if no one else is involved. Maybe the fixes part can go in after rc1 ?
Anyway, no big deal. Thanks.

Hengqi

Quoted 44 lines

Huacai

Quoted 42 lines

Thanks.

Quoted 38 lines · Hengqi Chen
Quoted 22 lines · Tiezhu Yang
Quoted 8 lines · Huacai Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

I trust Hengqi and I am OK with this series in general with a quick look.

Quoted 8 lines

For the two functions sign_extend() and emit_abi_ext(), I have no strong opinion, I do not want to respin the patch since the merge window is coming soon, it does not affect the correctness, so we can refine the code later if there is a better way.

Thanks.

Quoted 3 lines

Thanks,
Tiezhu

maintainer
#17 lore raw
Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen
Quoted 1 line · Hengqi Chen
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Huacai,

Will you pick this series for 6.19 ?

I tend to not pick it, because it is a little hurried.

Fine, but deferring does not improve anything if no one else is involved. Maybe the fixes part can go in after rc1 ?

The first two? No problem, but I still want a name better than emit_abi_ext()...

Huacai

Quoted 48 lines

Anyway, no big deal. Thanks.

Hengqi

Quoted 44 lines

Huacai

Quoted 42 lines

Thanks.

Quoted 38 lines · Hengqi Chen
Quoted 22 lines · Tiezhu Yang
Quoted 8 lines · Huacai Chen

Hi, Tiezhu,

Quoted 5 lines · Hengqi Chen
Quoted 3 lines · Huacai Chen

Hi, Hengqi,

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I think this is the successor of
https://lore.kernel.org/loongarch/[email protected]/T/#t

Right?

Right, sorry for the long delay.

Could you please help to review this series?

I trust Hengqi and I am OK with this series in general with a quick look.

Quoted 8 lines

For the two functions sign_extend() and emit_abi_ext(), I have no strong opinion, I do not want to respin the patch since the merge window is coming soon, it does not affect the correctness, so we can refine the code later if there is a better way.

Thanks.

Quoted 3 lines

Thanks,
Tiezhu