AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/31 08:09 flow patch-triage
1m Args:
null

Results:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "bpf_arch_text_poke"
  ],
  "KMSANReasoning": "The patch modifies the PowerPC BPF JIT compiler (arch/powerpc/net/bpf_jit*) and corresponding BPF selftests. The changes address multi-pass code generation convergence, alignment of fentry stubs/dummy trampoline address, branch range checks, and 64-bit register comparisons for tail calls.\n\nThere are no uninitialized heap/stack memory allocations, no conditional branches on uninitialized variables, and no kernel-to-userspace data leaks introduced or modified. Any potential risks related to JIT code generation or buffer sizing are handled by standard compiler verification, runtime execution tests, or KASAN, rather than KMSAN uninitialized memory tracking. Therefore, a dedicated KMSAN fuzzing session is not required.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch modifies the PowerPC BPF JIT compiler logic, including code generation multi-pass convergence, fentry stub alignment, text poking, exit instruction emission, and 64-bit tail call comparisons. These changes alter BPF program compilation and patching behavior on PowerPC and should be fuzzed.",
  "WorthFuzzing": true
}

1/1 2026/08/31 08:09 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 7c6736e974bf332664fd028d4c169492062ba461\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Mon Aug 31 08:09:33 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h\nindex f32de8704d4d9..4da8bde92e1ef 100644\n--- a/arch/powerpc/net/bpf_jit.h\n+++ b/arch/powerpc/net/bpf_jit.h\n@@ -14,6 +14,13 @@\n #include \u003casm/ppc-opcode.h\u003e\n #include \u003clinux/build_bug.h\u003e\n \n+/*\n+ * We need at least 2 passes for proper code generation, and may need\n+ * additional passes if code size changes between passes.\n+ */\n+#define CODEGEN_MIN_PASSES    2\n+#define CODEGEN_MAX_PASSES    3\n+\n #ifdef CONFIG_PPC64_ELF_ABI_V1\n #define FUNCTION_DESCR_SIZE\t24\n #else\n@@ -188,6 +195,12 @@ struct codegen_context {\n \n #define bpf_to_ppc(r)\t(ctx-\u003eb2p[r])\n \n+#ifdef CONFIG_PPC64\n+#define PPC_RAW_CMPLLI(a, i)    PPC_RAW_CMPLDI(a, i)\n+#else\n+#define PPC_RAW_CMPLLI(a, i)    PPC_RAW_CMPLWI(a, i)\n+#endif\n+\n #ifdef CONFIG_PPC32\n #define BPF_FIXUP_LEN\t3 /* Three instructions =\u003e 12 bytes */\n #else\n@@ -214,10 +227,11 @@ int bpf_jit_emit_func_call_rel(u32 *image, u32 *fimage, struct codegen_context *\n int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct codegen_context *ctx,\n \t\t       u32 *addrs, int pass, bool extra_pass);\n void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx);\n-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx);\n-void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx);\n+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx);\n+void bpf_jit_build_fentry_stubs(u32 *image, u32 *fimage, struct codegen_context *ctx);\n void bpf_jit_realloc_regs(struct codegen_context *ctx);\n-int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, long exit_addr);\n+int bpf_jit_emit_exit_insn(u32 *image, u32 *fimage, struct codegen_context *ctx, int tmp_reg,\n+\t\t\t\t\t\t\t\t\t\tlong exit_addr);\n void prepare_for_fsession_fentry(u32 *image, struct codegen_context *ctx, int cookie_cnt,\n \t\t\t\t\t\t\t\tint cookie_off, int retval_off);\n void store_func_meta(u32 *image, struct codegen_context *ctx, u64 func_meta, int func_meta_off);\ndiff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c\nindex 7b07b43575f11..c2717f0d9cdd4 100644\n--- a/arch/powerpc/net/bpf_jit_comp.c\n+++ b/arch/powerpc/net/bpf_jit_comp.c\n@@ -49,11 +49,35 @@ asm (\n \"\t.popsection\t\t\t\t;\"\n );\n \n-void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx)\n+void bpf_jit_build_fentry_stubs(u32 *image, u32 *fimage, struct codegen_context *ctx)\n {\n \tint ool_stub_idx, long_branch_stub_idx;\n+\tint stub_sz;\n \n \t/*\n+\t * The dummy_tramp_addr field is placed at bottom of Long branch stub.\n+\t * Align the mis-aligned dummy_tramp_addr field in the fimage.\n+\t * The alignment NOP must appear before OOL stub, to make\n+\t * ool_stub_idx \u0026 long_branch_stub_idx constant from end.\n+\t *\n+\t * The fimage can be non 8-byte aligned, so final alignment depends\n+\t * on start of fimage and the stub's instruction count. The\n+\t * stubs block has 11 instructions (with CONFIG_PPC_FTRACE_OUT_OF_LINE)\n+\t * or 10 instructions (without) before dummy_tramp_addr field. Emit a\n+\t * NOP if the address of dummy_tramp_addr is non aligned.\n+\t *\n+\t * In pass=0 when image==NULL, conservatively account for space\n+\t * required to accommodate alignment NOP. In case final pass skips\n+\t * emitting alignment NOP, the image buffer have 4 spare bytes and\n+\t * jited_len signifies correct program size.\n+\t */\n+\n+\tstub_sz = IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE) ? 44 : 40;\n+\tif (!image || !IS_ALIGNED((unsigned long)fimage + ctx-\u003eidx*4 + stub_sz, SZL))\n+\t\tEMIT(PPC_RAW_NOP());\n+\n+\t/*\n+\t *\tnop     // optional, for alignment of dummy_tramp_addr\n \t * Out-of-line stub:\n \t *\tmflr\tr0\n \t *\t[b|bl]\ttramp\n@@ -70,44 +94,46 @@ void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx)\n \n \t/*\n \t * Long branch stub:\n-\t *\t.long\t\u003cdummy_tramp_addr\u003e\n \t *\tmflr\tr11\n \t *\tbcl\t20,31,$+4\n-\t *\tmflr\tr12\n-\t *\tld\tr12, -8-SZL(r12)\n+\t *\tmflr\tr12\t// lr/r12 stores pc of current(this) inst.\n+\t *\tld\tr12, 20(r12) // offset(dummy_tramp_addr) from prev inst. is 20\n \t *\tmtctr\tr12\n-\t *\tmtlr\tr11 // needed to retain ftrace ABI\n+\t *\tmtlr\tr11\t// needed to retain ftrace ABI\n \t *\tbctr\n+\t *\t.long\t\u003cdummy_tramp_addr\u003e  // SZL bytes aligned\n \t */\n-\tif (image)\n-\t\t*((unsigned long *)\u0026image[ctx-\u003eidx]) = (unsigned long)dummy_tramp;\n-\tctx-\u003eidx += SZL / 4;\n \tlong_branch_stub_idx = ctx-\u003eidx;\n \tEMIT(PPC_RAW_MFLR(_R11));\n \tEMIT(PPC_RAW_BCL4());\n \tEMIT(PPC_RAW_MFLR(_R12));\n-\tEMIT(PPC_RAW_LL(_R12, _R12, -8-SZL));\n+\tEMIT(PPC_RAW_LL(_R12, _R12, 20));\n \tEMIT(PPC_RAW_MTCTR(_R12));\n \tEMIT(PPC_RAW_MTLR(_R11));\n \tEMIT(PPC_RAW_BCTR());\n \n+\tif (image)\n+\t\t*((unsigned long *)\u0026image[ctx-\u003eidx]) = (unsigned long)dummy_tramp;\n+\n+\tctx-\u003eidx += SZL / 4;\n+\n \tif (!bpf_jit_ool_stub) {\n \t\tbpf_jit_ool_stub = (ctx-\u003eidx - ool_stub_idx) * 4;\n \t\tbpf_jit_long_branch_stub = (ctx-\u003eidx - long_branch_stub_idx) * 4;\n \t}\n }\n \n-int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, long exit_addr)\n+int bpf_jit_emit_exit_insn(u32 *image, u32 *fimage, struct codegen_context *ctx,\n+\t\t\t\t\t\t\tint tmp_reg, long exit_addr)\n {\n-\tif (!exit_addr || is_offset_in_branch_range(exit_addr - (ctx-\u003eidx * 4))) {\n+\tif (exit_addr \u0026\u0026 is_offset_in_branch_range(exit_addr - (long)(ctx-\u003eidx * 4))) {\n \t\tPPC_JMP(exit_addr);\n-\t} else if (ctx-\u003ealt_exit_addr) {\n-\t\tif (WARN_ON(!is_offset_in_branch_range((long)ctx-\u003ealt_exit_addr - (ctx-\u003eidx * 4))))\n-\t\t\treturn -1;\n+\t} else if (ctx-\u003ealt_exit_addr \u0026\u0026 is_offset_in_branch_range(\n+\t\t\t(long)(ctx-\u003ealt_exit_addr) - (long)(ctx-\u003eidx * 4))) {\n \t\tPPC_JMP(ctx-\u003ealt_exit_addr);\n \t} else {\n \t\tctx-\u003ealt_exit_addr = ctx-\u003eidx * 4;\n-\t\tbpf_jit_build_epilogue(image, ctx);\n+\t\tbpf_jit_build_epilogue(image, fimage, ctx);\n \t}\n \n \treturn 0;\n@@ -274,6 +300,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \t */\n \tif (cgctx.seen \u0026 SEEN_TAILCALL || !is_offset_in_branch_range((long)cgctx.idx * 4)) {\n \t\tcgctx.idx = 0;\n+\t\tcgctx.alt_exit_addr = 0;\n \t\tif (bpf_jit_build_body(fp, NULL, NULL, \u0026cgctx, addrs, 0, false))\n \t\t\tgoto out_err;\n \t}\n@@ -286,7 +313,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \t */\n \tbpf_jit_build_prologue(NULL, \u0026cgctx);\n \taddrs[fp-\u003elen] = cgctx.idx * 4;\n-\tbpf_jit_build_epilogue(NULL, \u0026cgctx);\n+\tbpf_jit_build_epilogue(NULL, NULL, \u0026cgctx);\n \n \tfixup_len = fp-\u003eaux-\u003enum_exentries * BPF_FIXUP_LEN * 4;\n \textable_len = fp-\u003eaux-\u003enum_exentries * sizeof(struct exception_table_entry);\n@@ -306,10 +333,13 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \tcode_base = (u32 *)(image + FUNCTION_DESCR_SIZE);\n \tfcode_base = (u32 *)(fimage + FUNCTION_DESCR_SIZE);\n \n-\t/* Code generation passes 1-2 */\n-\tfor (pass = 1; pass \u003c 3; pass++) {\n+\t/* Code generation passes 1-2+, loop until program size converges. */\n+\tfor (pass = 1; pass \u003c= CODEGEN_MAX_PASSES; pass++) {\n+\t\tu32 prev_proglen = proglen;\n+\n \t\t/* Now build the prologue, body code \u0026 epilogue for real. */\n \t\tcgctx.idx = 0;\n+\t\tcgctx.exentry_idx = 0;\n \t\tcgctx.alt_exit_addr = 0;\n \t\tbpf_jit_build_prologue(code_base, \u0026cgctx);\n \t\tif (bpf_jit_build_body(fp, code_base, fcode_base, \u0026cgctx, addrs, pass,\n@@ -318,11 +348,26 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \t\t\tbpf_jit_binary_pack_free(fhdr, hdr);\n \t\t\tgoto out_err;\n \t\t}\n-\t\tbpf_jit_build_epilogue(code_base, \u0026cgctx);\n+\t\taddrs[fp-\u003elen] = cgctx.idx * 4;\n+\t\tbpf_jit_build_epilogue(code_base, fcode_base, \u0026cgctx);\n+\n+\t\tproglen = cgctx.idx * 4;\n \n \t\tif (bpf_jit_enable \u003e 1)\n \t\t\tpr_info(\"Pass %d: shrink = %d, seen = 0x%x\\n\", pass,\n-\t\t\t\tproglen - (cgctx.idx * 4), cgctx.seen);\n+\t\t\t\tprev_proglen - proglen, cgctx.seen);\n+\n+\t\t/* Check if program size has converged, but ensure minimum passes */\n+\t\tif (pass \u003e= CODEGEN_MIN_PASSES \u0026\u0026 proglen == prev_proglen)\n+\t\t\tbreak;\n+\n+\t\tif (pass == CODEGEN_MAX_PASSES \u0026\u0026 proglen != prev_proglen) {\n+\t\t\tpr_err(\"BPF JIT: Program did not converge after %d passes\\n\",\n+\t\t\t\t\t\t\t\tCODEGEN_MAX_PASSES);\n+\t\t\tbpf_arch_text_copy(\u0026fhdr-\u003esize, \u0026hdr-\u003esize, sizeof(hdr-\u003esize));\n+\t\t\tbpf_jit_binary_pack_free(fhdr, hdr);\n+\t\t\tgoto out_err;\n+\t\t}\n \t}\n \n \tif (bpf_jit_enable \u003e 1)\n@@ -357,7 +402,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \t\t\t\t(void *)fimage + FUNCTION_DESCR_SIZE);\n \n out_addrs:\n-\t\tif (!image \u0026\u0026 priv_stack_ptr) {\n+\t\tif (!fp-\u003ejited \u0026\u0026 priv_stack_ptr) {\n \t\t\tfp-\u003eaux-\u003epriv_stack_ptr = NULL;\n \t\t\tfree_percpu(priv_stack_ptr);\n \t\t}\n@@ -399,7 +444,7 @@ int bpf_add_extable_entry(struct bpf_prog *fp, u32 *image, u32 *fimage, int pass\n \tu32 *fixup;\n \n \t/* Populate extable entries only in the last pass */\n-\tif (pass != 2)\n+\tif (pass \u003c CODEGEN_MIN_PASSES)\n \t\treturn 0;\n \n \tif (!fp-\u003eaux-\u003eextable ||\n@@ -739,7 +784,7 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte\n \t\t * Setting the tail_call_info in trampoline's frame\n \t\t * depending on if previous frame had value or reference.\n \t\t */\n-\t\tEMIT(PPC_RAW_CMPLWI(_R3, MAX_TAIL_CALL_CNT));\n+\t\tEMIT(PPC_RAW_CMPLLI(_R3, MAX_TAIL_CALL_CNT));\n \t\tPPC_BCC_CONST_SHORT(COND_GT, 8);\n \t\tEMIT(PPC_RAW_ADDI(_R3, _R4, -BPF_PPC_TAILCALL));\n \n@@ -1265,6 +1310,7 @@ static void do_isync(void *info __maybe_unused)\n  * bpf_func:\n  *\t[nop|b]\tool_stub\n  * 2. Out-of-line stub:\n+ *\tnop\t// optional nop for alignment\n  * ool_stub:\n  *\tmflr\tr0\n  *\t[b|bl]\t\u003cbpf_prog\u003e/\u003clong_branch_stub\u003e\n@@ -1272,14 +1318,14 @@ static void do_isync(void *info __maybe_unused)\n  *\tb\tbpf_func + 4\n  * 3. Long branch stub:\n  * long_branch_stub:\n- *\t.long\t\u003cbranch_addr\u003e/\u003cdummy_tramp\u003e\n  *\tmflr\tr11\n  *\tbcl\t20,31,$+4\n  *\tmflr\tr12\n- *\tld\tr12, -16(r12)\n+ *\tld\tr12, 20(r12)\n  *\tmtctr\tr12\n  *\tmtlr\tr11 // needed to retain ftrace ABI\n  *\tbctr\n+ *\t.long\t\u003cbranch_addr\u003e/\u003cdummy_tramp\u003e\n  *\n  * dummy_tramp is used to reduce synchronization requirements.\n  *\n@@ -1381,10 +1427,12 @@ int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type old_t,\n \t * 1. Update the address in the long branch stub:\n \t * If new_addr is out of range, we will have to use the long branch stub, so patch new_addr\n \t * here. Otherwise, revert to dummy_tramp, but only if we had patched old_addr here.\n+\t *\n+\t * dummy_tramp_addr moved to bottom of long branch stub.\n \t */\n \tif ((new_addr \u0026\u0026 !is_offset_in_branch_range(new_addr - ip)) ||\n \t    (old_addr \u0026\u0026 !is_offset_in_branch_range(old_addr - ip)))\n-\t\tret = patch_ulong((void *)(bpf_func_end - bpf_jit_long_branch_stub - SZL),\n+\t\tret = patch_ulong((void *)(bpf_func_end - SZL), /* SZL: dummy_tramp_addr offset */\n \t\t\t\t  (new_addr \u0026\u0026 !is_offset_in_branch_range(new_addr - ip)) ?\n \t\t\t\t  (unsigned long)new_addr : (unsigned long)dummy_tramp);\n \tif (ret)\ndiff --git a/arch/powerpc/net/bpf_jit_comp32.c b/arch/powerpc/net/bpf_jit_comp32.c\nindex bfdc50740da8e..f5b9441cf46aa 100644\n--- a/arch/powerpc/net/bpf_jit_comp32.c\n+++ b/arch/powerpc/net/bpf_jit_comp32.c\n@@ -229,7 +229,7 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx\n \n }\n \n-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)\n+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx)\n {\n \tEMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_0)));\n \n@@ -237,7 +237,7 @@ void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)\n \n \tEMIT(PPC_RAW_BLR());\n \n-\tbpf_jit_build_fentry_stubs(image, ctx);\n+\tbpf_jit_build_fentry_stubs(image, fimage, ctx);\n }\n \n /* Relative offset needs to be calculated based on final image location */\n@@ -1149,7 +1149,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code\n \t\t\t * we'll just fall through to the epilogue.\n \t\t\t */\n \t\t\tif (i != flen - 1) {\n-\t\t\t\tret = bpf_jit_emit_exit_insn(image, ctx, _R0, exit_addr);\n+\t\t\t\tret = bpf_jit_emit_exit_insn(image, fimage,\n+\t\t\t\t\t\t\t\tctx, _R0, exit_addr);\n \t\t\t\tif (ret)\n \t\t\t\t\treturn ret;\n \t\t\t}\ndiff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c\nindex dab106cae22b5..e80312171aa74 100644\n--- a/arch/powerpc/net/bpf_jit_comp64.c\n+++ b/arch/powerpc/net/bpf_jit_comp64.c\n@@ -276,7 +276,7 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)\n \t\t */\n \t\tEMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), _R1, 0));\n \t\tEMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2), -(BPF_PPC_TAILCALL)));\n-\t\tEMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));\n+\t\tEMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));\n \t\tPPC_BCC_CONST_SHORT(COND_GT, 8);\n \t\tEMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2),\n \t\t\t\t\t\t\t\t-(BPF_PPC_TAILCALL)));\n@@ -398,7 +398,7 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx\n \t}\n }\n \n-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)\n+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx)\n {\n \tbpf_jit_emit_common_epilogue(image, ctx);\n \n@@ -407,7 +407,7 @@ void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)\n \n \tEMIT(PPC_RAW_BLR());\n \n-\tbpf_jit_build_fentry_stubs(image, ctx);\n+\tbpf_jit_build_fentry_stubs(image, fimage, ctx);\n }\n \n /*\n@@ -662,7 +662,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o\n \tPPC_BCC_SHORT(COND_GE, out);\n \n \tEMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), _R1, bpf_jit_stack_tailcallinfo_offset(ctx)));\n-\tEMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));\n+\tEMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));\n \tPPC_BCC_CONST_SHORT(COND_LE, 8);\n \n \t/* dereference TMP_REG_1 */\n@@ -672,7 +672,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o\n \t * if (tail_call_info == MAX_TAIL_CALL_CNT)\n \t *   goto out;\n \t */\n-\tEMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));\n+\tEMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));\n \tPPC_BCC_SHORT(COND_EQ, out);\n \n \t/*\n@@ -707,7 +707,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o\n \t * tail_call_info.\n \t */\n \tEMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), _R1, bpf_jit_stack_tailcallinfo_offset(ctx)));\n-\tEMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_2), MAX_TAIL_CALL_CNT));\n+\tEMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_2), MAX_TAIL_CALL_CNT));\n \tPPC_BCC_CONST_SHORT(COND_GT, 8);\n \n \t/* First get address of tail_call_info */\n@@ -1737,7 +1737,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code\n \t\t\t * we'll just fall through to the epilogue.\n \t\t\t */\n \t\t\tif (i != flen - 1) {\n-\t\t\t\tret = bpf_jit_emit_exit_insn(image, ctx, tmp1_reg, exit_addr);\n+\t\t\t\tret = bpf_jit_emit_exit_insn(image, fimage, ctx,\n+\t\t\t\t\t\t\t\ttmp1_reg, exit_addr);\n \t\t\t\tif (ret)\n \t\t\t\t\treturn ret;\n \t\t\t}\ndiff --git a/tools/testing/selftests/bpf/jit_disasm_helpers.c b/tools/testing/selftests/bpf/jit_disasm_helpers.c\nindex 3558fe10e28cf..b291d934dd1ab 100644\n--- a/tools/testing/selftests/bpf/jit_disasm_helpers.c\n+++ b/tools/testing/selftests/bpf/jit_disasm_helpers.c\n@@ -179,9 +179,11 @@ int get_jited_program_text(int fd, char *text, size_t text_sz)\n \tstruct bpf_prog_info info = {};\n \t__u32 info_len = sizeof(info);\n \t__u32 jited_funcs, len, pc;\n+\t__u32 trunc_len = 0, disasm_len;\n \t__u32 *func_lens = NULL;\n \tFILE *text_out = NULL;\n \tuint8_t *image = NULL;\n+\tchar *triple = NULL;\n \tint i, err = 0;\n \n \tif (!llvm_initialized) {\n@@ -225,9 +227,30 @@ int get_jited_program_text(int fd, char *text, size_t text_sz)\n \tif (!ASSERT_OK(err, \"bpf_prog_get_info_by_fd #2\"))\n \t\tgoto out;\n \n+\t/*\n+\t * last 8 bytes contains dummy_trampoline address in JIT\n+\t * output on 64-bit and last 4 bytes on 32-bit powerpc,\n+\t * which can't disassemble to a valid instruction.\n+\t */\n+\ttriple = LLVMGetDefaultTargetTriple();\n+\tif (triple) {\n+\t\tif (strstr(triple, \"powerpc64\") || strstr(triple, \"ppc64\"))\n+\t\t\ttrunc_len = 8;\n+\t\telse if (strstr(triple, \"powerpc\") || strstr(triple, \"ppc\"))\n+\t\t\ttrunc_len = 4;\n+\t\tLLVMDisposeMessage(triple);\n+\t}\n+\n \tfor (pc = 0, i = 0; i \u003c jited_funcs; ++i) {\n \t\tfprintf(text_out, \"func #%d:\\n\", i);\n-\t\tdisasm_one_func(text_out, image + pc, func_lens[i]);\n+\n+\t\t/*\n+\t\t * Disabled JIT have zero func_lens, hence underflow\n+\t\t */\n+\t\tdisasm_len = func_lens[i] \u003e trunc_len ?\n+\t\t\t\t\tfunc_lens[i] - trunc_len : 0;\n+\t\tdisasm_one_func(text_out, image + pc, disasm_len);\n+\n \t\tfprintf(text_out, \"\\n\");\n \t\tpc += func_lens[i];\n \t}\ndiff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h\nindex b0c441384f206..365008d1ed40c 100644\n--- a/tools/testing/selftests/bpf/progs/bpf_misc.h\n+++ b/tools/testing/selftests/bpf/progs/bpf_misc.h\n@@ -159,6 +159,7 @@\n #define __arch_riscv64\t\t__arch(\"RISCV64\")\n #define __arch_s390x\t\t__arch(\"s390x\")\n #define __arch_loongarch\t__arch(\"LOONGARCH\")\n+#define __arch_powerpc64\t__arch(\"POWERPC64\")\n #define __caps_unpriv(caps)\t__test_tag(\"test_caps_unpriv=\" EXPAND_QUOTE(caps))\n #define __load_if_JITed()\t__test_tag(\"load_mode=jited\")\n #define __load_if_no_JITed()\t__test_tag(\"load_mode=no_jited\")\ndiff --git a/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c b/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c\nindex 48fa34d2959f4..9880ce4f1931a 100644\n--- a/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c\n+++ b/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c\n@@ -91,6 +91,84 @@ __jited(\"\tpopq\t%rax\")\n __jited(\"\tjmp\t{{.*}}\")\t\t/* jump to tail call tgt   */\n __jited(\"L0:\tleave\")\n __jited(\"\t{{(retq|jmp\t0x)}}\")\t\t/* return or jump to rethunk */\n+__arch_powerpc64\n+/* program entry for main(), regular function prologue */\n+__jited(\"\tnop\")\n+__jited(\"...\")                          /* ld 2, 16(13) absent with CONFIG_PPC_KERNEL_PCREL */\n+__jited(\"\tli 9, 0\")\n+__jited(\"\tstd 9, -8(1)\")\n+__jited(\"\tmflr 0\")\n+__jited(\"\tstd 0, 16(1)\")\n+__jited(\"\tstdu 1, {{.*}}(1)\")\n+/*\n+ * load address and call sub() via count register\n+ *\n+ * Address materialization differs between PCREL and non-PCREL kernels.\n+ * Skip the address generation sequence and verify only that the call\n+ * target is loaded into CTR before branching.\n+ */\n+__jited(\"...\")\n+__jited(\"...\")\n+__jited(\"...\")\n+__jited(\"...\")\n+__jited(\"...\")\n+__jited(\"...\")\n+__jited(\"\tmtctr {{.*}}\")\n+__jited(\"...\")\n+__jited(\"\tbctrl\")\n+__jited(\"\tmr\t8, 3\")\n+__jited(\"\tli 8, 0\")\n+__jited(\"\taddi 1, 1, {{.*}}\")\n+__jited(\"\tld 0, 16(1)\")\n+__jited(\"\tmtlr 0\")\n+__jited(\"\tmr\t3, 8\")\n+__jited(\"\tblr\")\n+__jited(\"...\")\n+__jited(\"func #1\")\n+/* subprogram entry for sub() */\n+__jited(\"\tnop\")\n+__jited(\"...\")                          /* ld 2, 16(13) absent with CONFIG_PPC_KERNEL_PCREL */\n+/* tail call prologue for subprogram */\n+__jited(\"\tld 10, 0(1)\")\n+__jited(\"\tld 9, -8(10)\")\n+__jited(\"\tcmpldi\t9, 33\")\n+__jited(\"\tbt\t{{.*}}, {{.*}}\")\n+__jited(\"\taddi 9, 10, -8\")\n+__jited(\"\tstd 9, -8(1)\")\n+__jited(\"\tlis {{.*}}, {{.*}}\")\n+__jited(\"\tsldi {{.*}}, {{.*}}, 32\")\n+__jited(\"\toris {{.*}}, {{.*}}, {{.*}}\")\n+__jited(\"\tori {{.*}}, {{.*}}, {{.*}}\")\n+__jited(\"\tli {{.*}}, 0\")\n+__jited(\"\tlwz 9, {{.*}}({{.*}})\")\n+__jited(\"\tslwi {{.*}}, {{.*}}, 0\")\n+__jited(\"\tcmplw\t{{.*}}, 9\")\n+__jited(\"\tbf\t0, {{.*}}\")\n+/* bpf_tail_call implementation */\n+__jited(\"\tld 9, -8(1)\")\n+__jited(\"\tcmpldi\t9, 33\")\n+__jited(\"\tbf\t{{.*}}, {{.*}}\")\n+__jited(\"\tld 9, 0(9)\")\n+__jited(\"\tcmpldi\t9, 33\")\n+__jited(\"\tbt\t{{.*}}, {{.*}}\")\n+__jited(\"\taddi 9, 9, 1\")\n+__jited(\"\tmulli 10, {{.*}}, 8\")\n+__jited(\"\tadd 10, 10, {{.*}}\")\n+__jited(\"\tld 10, {{.*}}(10)\")\n+__jited(\"\tcmpldi\t10, 0\")\n+__jited(\"\tbt\t{{.*}}, {{.*}}\")\n+__jited(\"\tld 10, {{.*}}(10)\")\n+__jited(\"\taddi 10, 10, {{.*}}\")    /* offset depends on CONFIG_PPC_KERNEL_PCREL */\n+__jited(\"\tmtctr 10\")\n+__jited(\"\tld 10, -8(1)\")\n+__jited(\"\tcmpldi\t10, 33\")\n+__jited(\"\tbt\t{{.*}}, {{.*}}\")\n+__jited(\"\taddi 10, 1, -8\")\n+__jited(\"\tstd 9, 0(10)\")\n+__jited(\"\tbctr\")\n+__jited(\"\tmr\t3, 8\")\n+__jited(\"\tblr\")\n+\n SEC(\"tc\")\n __naked int main(void)\n {\ndiff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c\nindex 3ce32d134e2cc..01b1420097d27 100644\n--- a/tools/testing/selftests/bpf/test_loader.c\n+++ b/tools/testing/selftests/bpf/test_loader.c\n@@ -378,6 +378,7 @@ enum arch {\n \tARCH_RISCV64\t= 0x8,\n \tARCH_S390X\t= 0x10,\n \tARCH_LOONGARCH\t= 0x20,\n+\tARCH_POWERPC64\t= 0x40,\n };\n \n static int get_current_arch(void)\n@@ -392,6 +393,8 @@ static int get_current_arch(void)\n \treturn ARCH_S390X;\n #elif defined(__loongarch__)\n \treturn ARCH_LOONGARCH;\n+#elif defined(__powerpc64__)\n+\treturn ARCH_POWERPC64;\n #endif\n \treturn ARCH_UNKNOWN;\n }\n@@ -585,6 +588,8 @@ static int parse_test_spec(struct test_loader *tester,\n \t\t\t\tarch = ARCH_S390X;\n \t\t\t} else if (strcmp(val, \"LOONGARCH\") == 0) {\n \t\t\t\tarch = ARCH_LOONGARCH;\n+\t\t\t} else if (strcmp(val, \"POWERPC64\") == 0) {\n+\t\t\t\tarch = ARCH_POWERPC64;\n \t\t\t} else {\n \t\t\t\tPRINT_FAIL(\"bad arch spec: '%s'\\n\", val);\n \t\t\t\terr = -EINVAL;\n"
}

2/1 2026/08/31 08:09 agent patch-evaluator
1m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "bpf_arch_text_poke"
  ],
  "Reasoning": "The patch modifies the PowerPC BPF JIT compiler logic, including code generation multi-pass convergence, fentry stub alignment, text poking, exit instruction emission, and 64-bit tail call comparisons. These changes alter BPF program compilation and patching behavior on PowerPC and should be fuzzed.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
  even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).
- Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed,
  ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU.
- Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove)
  that are executed only during PCI hot-unplug or sysfs driver unbind operations.

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
   Prefer non-static, non-inlined API entrypoint functions over internal static helper functions
   (which are inlined by the compiler and do not have distinct symbol addresses).
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs
   needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs
   output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit 7c6736e974bf332664fd028d4c169492062ba461
Author: syz-cluster <triage@syzkaller.com>
Date:   Mon Aug 31 08:09:33 2026 +0000

    syz-cluster: applied patch under review

diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index f32de8704d4d9..4da8bde92e1ef 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -14,6 +14,13 @@
 #include <asm/ppc-opcode.h>
 #include <linux/build_bug.h>
 
+/*
+ * We need at least 2 passes for proper code generation, and may need
+ * additional passes if code size changes between passes.
+ */
+#define CODEGEN_MIN_PASSES    2
+#define CODEGEN_MAX_PASSES    3
+
 #ifdef CONFIG_PPC64_ELF_ABI_V1
 #define FUNCTION_DESCR_SIZE	24
 #else
@@ -188,6 +195,12 @@ struct codegen_context {
 
 #define bpf_to_ppc(r)	(ctx->b2p[r])
 
+#ifdef CONFIG_PPC64
+#define PPC_RAW_CMPLLI(a, i)    PPC_RAW_CMPLDI(a, i)
+#else
+#define PPC_RAW_CMPLLI(a, i)    PPC_RAW_CMPLWI(a, i)
+#endif
+
 #ifdef CONFIG_PPC32
 #define BPF_FIXUP_LEN	3 /* Three instructions => 12 bytes */
 #else
@@ -214,10 +227,11 @@ int bpf_jit_emit_func_call_rel(u32 *image, u32 *fimage, struct codegen_context *
 int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct codegen_context *ctx,
 		       u32 *addrs, int pass, bool extra_pass);
 void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx);
-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx);
-void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx);
+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx);
+void bpf_jit_build_fentry_stubs(u32 *image, u32 *fimage, struct codegen_context *ctx);
 void bpf_jit_realloc_regs(struct codegen_context *ctx);
-int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, long exit_addr);
+int bpf_jit_emit_exit_insn(u32 *image, u32 *fimage, struct codegen_context *ctx, int tmp_reg,
+										long exit_addr);
 void prepare_for_fsession_fentry(u32 *image, struct codegen_context *ctx, int cookie_cnt,
 								int cookie_off, int retval_off);
 void store_func_meta(u32 *image, struct codegen_context *ctx, u64 func_meta, int func_meta_off);
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 7b07b43575f11..c2717f0d9cdd4 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -49,11 +49,35 @@ asm (
 "	.popsection				;"
 );
 
-void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx)
+void bpf_jit_build_fentry_stubs(u32 *image, u32 *fimage, struct codegen_context *ctx)
 {
 	int ool_stub_idx, long_branch_stub_idx;
+	int stub_sz;
 
 	/*
+	 * The dummy_tramp_addr field is placed at bottom of Long branch stub.
+	 * Align the mis-aligned dummy_tramp_addr field in the fimage.
+	 * The alignment NOP must appear before OOL stub, to make
+	 * ool_stub_idx & long_branch_stub_idx constant from end.
+	 *
+	 * The fimage can be non 8-byte aligned, so final alignment depends
+	 * on start of fimage and the stub's instruction count. The
+	 * stubs block has 11 instructions (with CONFIG_PPC_FTRACE_OUT_OF_LINE)
+	 * or 10 instructions (without) before dummy_tramp_addr field. Emit a
+	 * NOP if the address of dummy_tramp_addr is non aligned.
+	 *
+	 * In pass=0 when image==NULL, conservatively account for space
+	 * required to accommodate alignment NOP. In case final pass skips
+	 * emitting alignment NOP, the image buffer have 4 spare bytes and
+	 * jited_len signifies correct program size.
+	 */
+
+	stub_sz = IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE) ? 44 : 40;
+	if (!image || !IS_ALIGNED((unsigned long)fimage + ctx->idx*4 + stub_sz, SZL))
+		EMIT(PPC_RAW_NOP());
+
+	/*
+	 *	nop     // optional, for alignment of dummy_tramp_addr
 	 * Out-of-line stub:
 	 *	mflr	r0
 	 *	[b|bl]	tramp
@@ -70,44 +94,46 @@ void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx)
 
 	/*
 	 * Long branch stub:
-	 *	.long	<dummy_tramp_addr>
 	 *	mflr	r11
 	 *	bcl	20,31,$+4
-	 *	mflr	r12
-	 *	ld	r12, -8-SZL(r12)
+	 *	mflr	r12	// lr/r12 stores pc of current(this) inst.
+	 *	ld	r12, 20(r12) // offset(dummy_tramp_addr) from prev inst. is 20
 	 *	mtctr	r12
-	 *	mtlr	r11 // needed to retain ftrace ABI
+	 *	mtlr	r11	// needed to retain ftrace ABI
 	 *	bctr
+	 *	.long	<dummy_tramp_addr>  // SZL bytes aligned
 	 */
-	if (image)
-		*((unsigned long *)&image[ctx->idx]) = (unsigned long)dummy_tramp;
-	ctx->idx += SZL / 4;
 	long_branch_stub_idx = ctx->idx;
 	EMIT(PPC_RAW_MFLR(_R11));
 	EMIT(PPC_RAW_BCL4());
 	EMIT(PPC_RAW_MFLR(_R12));
-	EMIT(PPC_RAW_LL(_R12, _R12, -8-SZL));
+	EMIT(PPC_RAW_LL(_R12, _R12, 20));
 	EMIT(PPC_RAW_MTCTR(_R12));
 	EMIT(PPC_RAW_MTLR(_R11));
 	EMIT(PPC_RAW_BCTR());
 
+	if (image)
+		*((unsigned long *)&image[ctx->idx]) = (unsigned long)dummy_tramp;
+
+	ctx->idx += SZL / 4;
+
 	if (!bpf_jit_ool_stub) {
 		bpf_jit_ool_stub = (ctx->idx - ool_stub_idx) * 4;
 		bpf_jit_long_branch_stub = (ctx->idx - long_branch_stub_idx) * 4;
 	}
 }
 
-int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, long exit_addr)
+int bpf_jit_emit_exit_insn(u32 *image, u32 *fimage, struct codegen_context *ctx,
+							int tmp_reg, long exit_addr)
 {
-	if (!exit_addr || is_offset_in_branch_range(exit_addr - (ctx->idx * 4))) {
+	if (exit_addr && is_offset_in_branch_range(exit_addr - (long)(ctx->idx * 4))) {
 		PPC_JMP(exit_addr);
-	} else if (ctx->alt_exit_addr) {
-		if (WARN_ON(!is_offset_in_branch_range((long)ctx->alt_exit_addr - (ctx->idx * 4))))
-			return -1;
+	} else if (ctx->alt_exit_addr && is_offset_in_branch_range(
+			(long)(ctx->alt_exit_addr) - (long)(ctx->idx * 4))) {
 		PPC_JMP(ctx->alt_exit_addr);
 	} else {
 		ctx->alt_exit_addr = ctx->idx * 4;
-		bpf_jit_build_epilogue(image, ctx);
+		bpf_jit_build_epilogue(image, fimage, ctx);
 	}
 
 	return 0;
@@ -274,6 +300,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	 */
 	if (cgctx.seen & SEEN_TAILCALL || !is_offset_in_branch_range((long)cgctx.idx * 4)) {
 		cgctx.idx = 0;
+		cgctx.alt_exit_addr = 0;
 		if (bpf_jit_build_body(fp, NULL, NULL, &cgctx, addrs, 0, false))
 			goto out_err;
 	}
@@ -286,7 +313,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	 */
 	bpf_jit_build_prologue(NULL, &cgctx);
 	addrs[fp->len] = cgctx.idx * 4;
-	bpf_jit_build_epilogue(NULL, &cgctx);
+	bpf_jit_build_epilogue(NULL, NULL, &cgctx);
 
 	fixup_len = fp->aux->num_exentries * BPF_FIXUP_LEN * 4;
 	extable_len = fp->aux->num_exentries * sizeof(struct exception_table_entry);
@@ -306,10 +333,13 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	code_base = (u32 *)(image + FUNCTION_DESCR_SIZE);
 	fcode_base = (u32 *)(fimage + FUNCTION_DESCR_SIZE);
 
-	/* Code generation passes 1-2 */
-	for (pass = 1; pass < 3; pass++) {
+	/* Code generation passes 1-2+, loop until program size converges. */
+	for (pass = 1; pass <= CODEGEN_MAX_PASSES; pass++) {
+		u32 prev_proglen = proglen;
+
 		/* Now build the prologue, body code & epilogue for real. */
 		cgctx.idx = 0;
+		cgctx.exentry_idx = 0;
 		cgctx.alt_exit_addr = 0;
 		bpf_jit_build_prologue(code_base, &cgctx);
 		if (bpf_jit_build_body(fp, code_base, fcode_base, &cgctx, addrs, pass,
@@ -318,11 +348,26 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 			bpf_jit_binary_pack_free(fhdr, hdr);
 			goto out_err;
 		}
-		bpf_jit_build_epilogue(code_base, &cgctx);
+		addrs[fp->len] = cgctx.idx * 4;
+		bpf_jit_build_epilogue(code_base, fcode_base, &cgctx);
+
+		proglen = cgctx.idx * 4;
 
 		if (bpf_jit_enable > 1)
 			pr_info("Pass %d: shrink = %d, seen = 0x%x\n", pass,
-				proglen - (cgctx.idx * 4), cgctx.seen);
+				prev_proglen - proglen, cgctx.seen);
+
+		/* Check if program size has converged, but ensure minimum passes */
+		if (pass >= CODEGEN_MIN_PASSES && proglen == prev_proglen)
+			break;
+
+		if (pass == CODEGEN_MAX_PASSES && proglen != prev_proglen) {
+			pr_err("BPF JIT: Program did not converge after %d passes\n",
+								CODEGEN_MAX_PASSES);
+			bpf_arch_text_copy(&fhdr->size, &hdr->size, sizeof(hdr->size));
+			bpf_jit_binary_pack_free(fhdr, hdr);
+			goto out_err;
+		}
 	}
 
 	if (bpf_jit_enable > 1)
@@ -357,7 +402,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 				(void *)fimage + FUNCTION_DESCR_SIZE);
 
 out_addrs:
-		if (!image && priv_stack_ptr) {
+		if (!fp->jited && priv_stack_ptr) {
 			fp->aux->priv_stack_ptr = NULL;
 			free_percpu(priv_stack_ptr);
 		}
@@ -399,7 +444,7 @@ int bpf_add_extable_entry(struct bpf_prog *fp, u32 *image, u32 *fimage, int pass
 	u32 *fixup;
 
 	/* Populate extable entries only in the last pass */
-	if (pass != 2)
+	if (pass < CODEGEN_MIN_PASSES)
 		return 0;
 
 	if (!fp->aux->extable ||
@@ -739,7 +784,7 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte
 		 * Setting the tail_call_info in trampoline's frame
 		 * depending on if previous frame had value or reference.
 		 */
-		EMIT(PPC_RAW_CMPLWI(_R3, MAX_TAIL_CALL_CNT));
+		EMIT(PPC_RAW_CMPLLI(_R3, MAX_TAIL_CALL_CNT));
 		PPC_BCC_CONST_SHORT(COND_GT, 8);
 		EMIT(PPC_RAW_ADDI(_R3, _R4, -BPF_PPC_TAILCALL));
 
@@ -1265,6 +1310,7 @@ static void do_isync(void *info __maybe_unused)
  * bpf_func:
  *	[nop|b]	ool_stub
  * 2. Out-of-line stub:
+ *	nop	// optional nop for alignment
  * ool_stub:
  *	mflr	r0
  *	[b|bl]	<bpf_prog>/<long_branch_stub>
@@ -1272,14 +1318,14 @@ static void do_isync(void *info __maybe_unused)
  *	b	bpf_func + 4
  * 3. Long branch stub:
  * long_branch_stub:
- *	.long	<branch_addr>/<dummy_tramp>
  *	mflr	r11
  *	bcl	20,31,$+4
  *	mflr	r12
- *	ld	r12, -16(r12)
+ *	ld	r12, 20(r12)
  *	mtctr	r12
  *	mtlr	r11 // needed to retain ftrace ABI
  *	bctr
+ *	.long	<branch_addr>/<dummy_tramp>
  *
  * dummy_tramp is used to reduce synchronization requirements.
  *
@@ -1381,10 +1427,12 @@ int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type old_t,
 	 * 1. Update the address in the long branch stub:
 	 * If new_addr is out of range, we will have to use the long branch stub, so patch new_addr
 	 * here. Otherwise, revert to dummy_tramp, but only if we had patched old_addr here.
+	 *
+	 * dummy_tramp_addr moved to bottom of long branch stub.
 	 */
 	if ((new_addr && !is_offset_in_branch_range(new_addr - ip)) ||
 	    (old_addr && !is_offset_in_branch_range(old_addr - ip)))
-		ret = patch_ulong((void *)(bpf_func_end - bpf_jit_long_branch_stub - SZL),
+		ret = patch_ulong((void *)(bpf_func_end - SZL), /* SZL: dummy_tramp_addr offset */
 				  (new_addr && !is_offset_in_branch_range(new_addr - ip)) ?
 				  (unsigned long)new_addr : (unsigned long)dummy_tramp);
 	if (ret)
diff --git a/arch/powerpc/net/bpf_jit_comp32.c b/arch/powerpc/net/bpf_jit_comp32.c
index bfdc50740da8e..f5b9441cf46aa 100644
--- a/arch/powerpc/net/bpf_jit_comp32.c
+++ b/arch/powerpc/net/bpf_jit_comp32.c
@@ -229,7 +229,7 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx
 
 }
 
-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx)
 {
 	EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_0)));
 
@@ -237,7 +237,7 @@ void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
 
 	EMIT(PPC_RAW_BLR());
 
-	bpf_jit_build_fentry_stubs(image, ctx);
+	bpf_jit_build_fentry_stubs(image, fimage, ctx);
 }
 
 /* Relative offset needs to be calculated based on final image location */
@@ -1149,7 +1149,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
 			 * we'll just fall through to the epilogue.
 			 */
 			if (i != flen - 1) {
-				ret = bpf_jit_emit_exit_insn(image, ctx, _R0, exit_addr);
+				ret = bpf_jit_emit_exit_insn(image, fimage,
+								ctx, _R0, exit_addr);
 				if (ret)
 					return ret;
 			}
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index dab106cae22b5..e80312171aa74 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -276,7 +276,7 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
 		 */
 		EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), _R1, 0));
 		EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2), -(BPF_PPC_TAILCALL)));
-		EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
+		EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
 		PPC_BCC_CONST_SHORT(COND_GT, 8);
 		EMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2),
 								-(BPF_PPC_TAILCALL)));
@@ -398,7 +398,7 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx
 	}
 }
 
-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx)
 {
 	bpf_jit_emit_common_epilogue(image, ctx);
 
@@ -407,7 +407,7 @@ void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
 
 	EMIT(PPC_RAW_BLR());
 
-	bpf_jit_build_fentry_stubs(image, ctx);
+	bpf_jit_build_fentry_stubs(image, fimage, ctx);
 }
 
 /*
@@ -662,7 +662,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 	PPC_BCC_SHORT(COND_GE, out);
 
 	EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), _R1, bpf_jit_stack_tailcallinfo_offset(ctx)));
-	EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
+	EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
 	PPC_BCC_CONST_SHORT(COND_LE, 8);
 
 	/* dereference TMP_REG_1 */
@@ -672,7 +672,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 	 * if (tail_call_info == MAX_TAIL_CALL_CNT)
 	 *   goto out;
 	 */
-	EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
+	EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
 	PPC_BCC_SHORT(COND_EQ, out);
 
 	/*
@@ -707,7 +707,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 	 * tail_call_info.
 	 */
 	EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), _R1, bpf_jit_stack_tailcallinfo_offset(ctx)));
-	EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_2), MAX_TAIL_CALL_CNT));
+	EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_2), MAX_TAIL_CALL_CNT));
 	PPC_BCC_CONST_SHORT(COND_GT, 8);
 
 	/* First get address of tail_call_info */
@@ -1737,7 +1737,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
 			 * we'll just fall through to the epilogue.
 			 */
 			if (i != flen - 1) {
-				ret = bpf_jit_emit_exit_insn(image, ctx, tmp1_reg, exit_addr);
+				ret = bpf_jit_emit_exit_insn(image, fimage, ctx,
+								tmp1_reg, exit_addr);
 				if (ret)
 					return ret;
 			}
diff --git a/tools/testing/selftests/bpf/jit_disasm_helpers.c b/tools/testing/selftests/bpf/jit_disasm_helpers.c
index 3558fe10e28cf..b291d934dd1ab 100644
--- a/tools/testing/selftests/bpf/jit_disasm_helpers.c
+++ b/tools/testing/selftests/bpf/jit_disasm_helpers.c
@@ -179,9 +179,11 @@ int get_jited_program_text(int fd, char *text, size_t text_sz)
 	struct bpf_prog_info info = {};
 	__u32 info_len = sizeof(info);
 	__u32 jited_funcs, len, pc;
+	__u32 trunc_len = 0, disasm_len;
 	__u32 *func_lens = NULL;
 	FILE *text_out = NULL;
 	uint8_t *image = NULL;
+	char *triple = NULL;
 	int i, err = 0;
 
 	if (!llvm_initialized) {
@@ -225,9 +227,30 @@ int get_jited_program_text(int fd, char *text, size_t text_sz)
 	if (!ASSERT_OK(err, "bpf_prog_get_info_by_fd #2"))
 		goto out;
 
+	/*
+	 * last 8 bytes contains dummy_trampoline address in JIT
+	 * output on 64-bit and last 4 bytes on 32-bit powerpc,
+	 * which can't disassemble to a valid instruction.
+	 */
+	triple = LLVMGetDefaultTargetTriple();
+	if (triple) {
+		if (strstr(triple, "powerpc64") || strstr(triple, "ppc64"))
+			trunc_len = 8;
+		else if (strstr(triple, "powerpc") || strstr(triple, "ppc"))
+			trunc_len = 4;
+		LLVMDisposeMessage(triple);
+	}
+
 	for (pc = 0, i = 0; i < jited_funcs; ++i) {
 		fprintf(text_out, "func #%d:\n", i);
-		disasm_one_func(text_out, image + pc, func_lens[i]);
+
+		/*
+		 * Disabled JIT have zero func_lens, hence underflow
+		 */
+		disasm_len = func_lens[i] > trunc_len ?
+					func_lens[i] - trunc_len : 0;
+		disasm_one_func(text_out, image + pc, disasm_len);
+
 		fprintf(text_out, "\n");
 		pc += func_lens[i];
 	}
diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
index b0c441384f206..365008d1ed40c 100644
--- a/tools/testing/selftests/bpf/progs/bpf_misc.h
+++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
@@ -159,6 +159,7 @@
 #define __arch_riscv64		__arch("RISCV64")
 #define __arch_s390x		__arch("s390x")
 #define __arch_loongarch	__arch("LOONGARCH")
+#define __arch_powerpc64	__arch("POWERPC64")
 #define __caps_unpriv(caps)	__test_tag("test_caps_unpriv=" EXPAND_QUOTE(caps))
 #define __load_if_JITed()	__test_tag("load_mode=jited")
 #define __load_if_no_JITed()	__test_tag("load_mode=no_jited")
diff --git a/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c b/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c
index 48fa34d2959f4..9880ce4f1931a 100644
--- a/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c
+++ b/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c
@@ -91,6 +91,84 @@ __jited("	popq	%rax")
 __jited("	jmp	{{.*}}")		/* jump to tail call tgt   */
 __jited("L0:	leave")
 __jited("	{{(retq|jmp	0x)}}")		/* return or jump to rethunk */
+__arch_powerpc64
+/* program entry for main(), regular function prologue */
+__jited("	nop")
+__jited("...")                          /* ld 2, 16(13) absent with CONFIG_PPC_KERNEL_PCREL */
+__jited("	li 9, 0")
+__jited("	std 9, -8(1)")
+__jited("	mflr 0")
+__jited("	std 0, 16(1)")
+__jited("	stdu 1, {{.*}}(1)")
+/*
+ * load address and call sub() via count register
+ *
+ * Address materialization differs between PCREL and non-PCREL kernels.
+ * Skip the address generation sequence and verify only that the call
+ * target is loaded into CTR before branching.
+ */
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("	mtctr {{.*}}")
+__jited("...")
+__jited("	bctrl")
+__jited("	mr	8, 3")
+__jited("	li 8, 0")
+__jited("	addi 1, 1, {{.*}}")
+__jited("	ld 0, 16(1)")
+__jited("	mtlr 0")
+__jited("	mr	3, 8")
+__jited("	blr")
+__jited("...")
+__jited("func #1")
+/* subprogram entry for sub() */
+__jited("	nop")
+__jited("...")                          /* ld 2, 16(13) absent with CONFIG_PPC_KERNEL_PCREL */
+/* tail call prologue for subprogram */
+__jited("	ld 10, 0(1)")
+__jited("	ld 9, -8(10)")
+__jited("	cmpldi	9, 33")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	addi 9, 10, -8")
+__jited("	std 9, -8(1)")
+__jited("	lis {{.*}}, {{.*}}")
+__jited("	sldi {{.*}}, {{.*}}, 32")
+__jited("	oris {{.*}}, {{.*}}, {{.*}}")
+__jited("	ori {{.*}}, {{.*}}, {{.*}}")
+__jited("	li {{.*}}, 0")
+__jited("	lwz 9, {{.*}}({{.*}})")
+__jited("	slwi {{.*}}, {{.*}}, 0")
+__jited("	cmplw	{{.*}}, 9")
+__jited("	bf	0, {{.*}}")
+/* bpf_tail_call implementation */
+__jited("	ld 9, -8(1)")
+__jited("	cmpldi	9, 33")
+__jited("	bf	{{.*}}, {{.*}}")
+__jited("	ld 9, 0(9)")
+__jited("	cmpldi	9, 33")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	addi 9, 9, 1")
+__jited("	mulli 10, {{.*}}, 8")
+__jited("	add 10, 10, {{.*}}")
+__jited("	ld 10, {{.*}}(10)")
+__jited("	cmpldi	10, 0")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	ld 10, {{.*}}(10)")
+__jited("	addi 10, 10, {{.*}}")    /* offset depends on CONFIG_PPC_KERNEL_PCREL */
+__jited("	mtctr 10")
+__jited("	ld 10, -8(1)")
+__jited("	cmpldi	10, 33")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	addi 10, 1, -8")
+__jited("	std 9, 0(10)")
+__jited("	bctr")
+__jited("	mr	3, 8")
+__jited("	blr")
+
 SEC("tc")
 __naked int main(void)
 {
diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c
index 3ce32d134e2cc..01b1420097d27 100644
--- a/tools/testing/selftests/bpf/test_loader.c
+++ b/tools/testing/selftests/bpf/test_loader.c
@@ -378,6 +378,7 @@ enum arch {
 	ARCH_RISCV64	= 0x8,
 	ARCH_S390X	= 0x10,
 	ARCH_LOONGARCH	= 0x20,
+	ARCH_POWERPC64	= 0x40,
 };
 
 static int get_current_arch(void)
@@ -392,6 +393,8 @@ static int get_current_arch(void)
 	return ARCH_S390X;
 #elif defined(__loongarch__)
 	return ARCH_LOONGARCH;
+#elif defined(__powerpc64__)
+	return ARCH_POWERPC64;
 #endif
 	return ARCH_UNKNOWN;
 }
@@ -585,6 +588,8 @@ static int parse_test_spec(struct test_loader *tester,
 				arch = ARCH_S390X;
 			} else if (strcmp(val, "LOONGARCH") == 0) {
 				arch = ARCH_LOONGARCH;
+			} else if (strcmp(val, "POWERPC64") == 0) {
+				arch = ARCH_POWERPC64;
 			} else {
 				PRINT_FAIL("bad arch spec: '%s'\n", val);
 				err = -EINVAL;

3/2 2026/08/31 08:09 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 11304
							output: 29
							thoughts: 122
						

Thoughts:
**Analyzing the PowerPC BPF JIT Patch**

Okay, so this patch is digging into the PowerPC architecture, specifically focusing on the BPF JIT compilation aspects. I see it's touching `bpf_jit.h`, the compilation code itself (`bpf_jit_comp.c`, `bpf_jit_comp32.c`, `bpf_jit_comp64.c`), and some self-tests. That's a good sign; we need to verify all of these pieces work correctly with each other and the architecture's existing code.

My initial thought is to dive into the code and Kconfig files. First, I need to understand the configuration implications. Is there a new configuration option introduced? Has an existing option been changed, or is an existing option now required? I'll probably start by grepping or simply reading the relevant Kconfig files to get a lay of the land, to see what options this impacts. After that, I'll analyze the code changes.



4/2 2026/08/31 08:10 tool grepper
0m Args:
{
  "Expression": "BPF_JIT",
  "PathPrefix": "arch/powerpc"
}

Results:
{
  "Output": "arch/powerpc/Kconfig=118=config PPC\n--\narch/powerpc/Kconfig-182-\tselect ARCH_USE_QUEUED_RWLOCKS\t\tif PPC_QUEUED_SPINLOCKS\narch/powerpc/Kconfig:183:\tselect ARCH_WANT_DEFAULT_BPF_JIT\narch/powerpc/Kconfig-184-\tselect ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT\n--\narch/powerpc/Kconfig-246-\tselect HAVE_DYNAMIC_FTRACE_WITH_REGS\tif ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32\narch/powerpc/Kconfig:247:\tselect HAVE_EBPF_JIT\narch/powerpc/Kconfig-248-\tselect HAVE_EFFICIENT_UNALIGNED_ACCESS\n--\narch/powerpc/configs/mpc885_ads_defconfig=4=CONFIG_HIGH_RES_TIMERS=y\narch/powerpc/configs/mpc885_ads_defconfig:5:CONFIG_BPF_JIT=y\narch/powerpc/configs/mpc885_ads_defconfig-6-CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y\n--\narch/powerpc/configs/powernv_defconfig=94=CONFIG_DNS_RESOLVER=y\narch/powerpc/configs/powernv_defconfig:95:CONFIG_BPF_JIT=y\narch/powerpc/configs/powernv_defconfig-96-# CONFIG_WIRELESS is not set\n--\narch/powerpc/configs/ppc64_defconfig=7=CONFIG_BPF_SYSCALL=y\narch/powerpc/configs/ppc64_defconfig:8:CONFIG_BPF_JIT=y\narch/powerpc/configs/ppc64_defconfig-9-CONFIG_BPF_LSM=y\n--\narch/powerpc/net/Makefile-4-#\narch/powerpc/net/Makefile:5:obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_jit_comp$(BITS).o\narch/powerpc/net/Makefile-6-\narch/powerpc/net/Makefile=7=ifdef CONFIG_PPC64\narch/powerpc/net/Makefile:8:obj-$(CONFIG_BPF_JIT) += bpf_timed_may_goto.o\narch/powerpc/net/Makefile-9-endif\n--\narch/powerpc/net/bpf_jit.h-7- */\narch/powerpc/net/bpf_jit.h:8:#ifndef _BPF_JIT_H\narch/powerpc/net/bpf_jit.h:9:#define _BPF_JIT_H\narch/powerpc/net/bpf_jit.h-10-\n--\narch/powerpc/net/bpf_jit.h=167=struct codegen_context {\n--\narch/powerpc/net/bpf_jit.h-179-\tunsigned int stack_size;\narch/powerpc/net/bpf_jit.h:180:\tint b2p[MAX_BPF_JIT_REG + 3];\narch/powerpc/net/bpf_jit.h-181-\tunsigned int exentry_idx;\n--\narch/powerpc/net/bpf_jit_comp32.c-42-/* BPF register usage */\narch/powerpc/net/bpf_jit_comp32.c:43:#define TMP_REG\t\t\t(MAX_BPF_JIT_REG + 0)\narch/powerpc/net/bpf_jit_comp32.c-44-\n--\narch/powerpc/net/bpf_jit_comp64.c-70-/* BPF register usage */\narch/powerpc/net/bpf_jit_comp64.c:71:#define TMP_REG_1\t(MAX_BPF_JIT_REG + 0)\narch/powerpc/net/bpf_jit_comp64.c:72:#define TMP_REG_2\t(MAX_BPF_JIT_REG + 1)\narch/powerpc/net/bpf_jit_comp64.c:73:#define ARENA_VM_START  (MAX_BPF_JIT_REG + 2)\narch/powerpc/net/bpf_jit_comp64.c-74-\n"
}

5/2 2026/08/31 08:10 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 12765
							output: 32
							thoughts: 683
						

Thoughts:
**Analyzing a PowerPC BPF JIT Compiler Patch for Fuzzing Potential**

Okay, let's dive into this patch. My immediate thought is, "Is this fuzz-worthy?" It's touching the powerpc BPF JIT compiler – that's a key area. Anything that affects core architecture execution logic, especially when user-space interaction is involved via `bpf()` system calls, BPF program loading, verification, and JIT compilation on PowerPC (and can be run in QEMU, even better!), raises a flag.

Specifically, it looks like this patch is modifying the internals of the JIT compilation process. I see changes to multiple files: `bpf_jit.h`, `bpf_jit_comp.c`, and `bpf_jit_comp64.c`. I'm seeing updates to how the compiler handles things like multi-pass convergence, tail calls (using different compare instructions), fentry stubs, branch ranges and the exit instruction. This isn't just a minor tweak; this is substantial modification to critical parts of the JIT compilation. The addition of selftests for tail call JIT verification is another strong indicator that this is a complex area to consider.

I'm thinking, "Which functions are the most interesting to look at further?"  `bpf_int_jit_compile` is the main entry point for BPF JIT on PowerPC.  `bpf_arch_text_poke` is also here. Let me compile a list of non-static functions as a quick way to identify the key functions:

*   `bpf_int_jit_compile`
*   `bpf_arch_text_poke`
*   `bpf_jit_build_fentry_stubs`
*   `bpf_jit_build_epilogue`
*   `bpf_jit_emit_exit_insn`
*   `bpf_add_extable_entry`

Now, the next thing is to quickly check if `bpf_int_jit_compile` is static. Gotta see if it's externally accessible.



6/2 2026/08/31 08:10 tool grepper
0m Args:
{
  "Expression": "bpf_int_jit_compile",
  "PathPrefix": "arch/powerpc"
}

Results:
{
  "Output": "arch/powerpc/net/bpf_jit_comp.c=172=static void priv_stack_check_guard(void __percpu *priv_stack_ptr, int alloc_size,\n--\narch/powerpc/net/bpf_jit_comp.c-190-\narch/powerpc/net/bpf_jit_comp.c:191:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *fp)\narch/powerpc/net/bpf_jit_comp.c-192-{\n"
}

7/2 2026/08/31 08:10 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 14092
							output: 28
							thoughts: 31
						

Thoughts:
Here's my thinking process:

**Kconfig and BPF Integration Check**

Okay, so I need to figure out the Kconfig options that are going to be required for this. Specifically, I need to understand the dependencies and interactions between the networking code and the BPF (Berkeley Packet Filter) configuration. The best way to start is to check the relevant Makefiles and Kconfig files. My initial thought is to look at `arch/powerpc/net/Makefile`. I'm guessing this might have some architecture-specific considerations, and then I'll broaden the scope to include the general BPF Kconfig setup, because I'm betting that's where the core options are defined. This will give me a good baseline.



8/2 2026/08/31 08:10 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "config BPF_JIT",
  "PathPrefix": "init/"
}

Results:
{
  "error": "no matches"
}

9/2 2026/08/31 08:10 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 14318
							output: 21
							thoughts: 27
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating BPF Configuration Options**

Okay, time to dive into the kernel source. My primary goal is to locate the `CONFIG_BPF_JIT` and `CONFIG_BPF_SYSCALL` configurations. These are crucial, obviously, for understanding and potentially tweaking the BPF infrastructure. I need to see how these flags are set, where they're used, and what dependencies they have. I'm expecting to find them in the Kconfig files, likely under the networking or possibly security sub-trees. Finding these options will give me a good jumping-off point to assess the build-time configuration of BPF features in the target kernel. After locating them, I will assess where these flags are located in the build tree. The more context I have, the better I can understand the configuration landscape.



10/2 2026/08/31 08:10 tool grepper
0m Args:
{
  "Expression": "config BPF_JIT$"
}

Results:
{
  "Output": "kernel/bpf/Kconfig=27=config BPF_SYSCALL\n--\nkernel/bpf/Kconfig-41-\nkernel/bpf/Kconfig:42:config BPF_JIT\nkernel/bpf/Kconfig-43-\tbool \"Enable BPF Just In Time compiler\"\n"
}

11/2 2026/08/31 08:10 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 14641
							output: 34
							thoughts: 22
						

Thoughts:
Here's a summary of my thought process, as requested:

**Navigating the Kernel's BPF Configuration**

Okay, time to dive into this. Based on what I'm looking at, I need to get a handle on how BPF is configured within this kernel. Let's see... the most logical place to start would be the `kernel/bpf/Kconfig` file. I'm going to scan through that, specifically looking at the section, roughly between lines 27 and 60. That's usually where you find the key configuration options, dependencies, and descriptions related to a specific subsystem like BPF. Hopefully, I'll be able to quickly identify the crucial settings related to the functionality or issue I'm investigating. I'll be looking for things like whether BPF is enabled by default, any dependencies on other kernel features, and the different configuration variables that might be relevant. That should give me a solid foundation before I start poking around in the code.



12/2 2026/08/31 08:10 tool read-file
0m Args:
{
  "File": "kernel/bpf/Kconfig",
  "FirstLine": 25,
  "LineCount": 40
}

Results:
{
  "Contents": "  25:\tmenu \"BPF subsystem\"\n  26:\t\n  27:\tconfig BPF_SYSCALL\n  28:\t\tbool \"Enable bpf() system call\"\n  29:\t\tselect BPF\n  30:\t\tselect IRQ_WORK\n  31:\t\tselect NEED_TASKS_RCU\n  32:\t\tselect TASKS_TRACE_RCU\n  33:\t\tselect BINARY_PRINTF\n  34:\t\tselect NET_SOCK_MSG if NET\n  35:\t\tselect NET_XGRESS if NET\n  36:\t\tselect PAGE_POOL if NET\n  37:\t\tdefault n\n  38:\t\thelp\n  39:\t\t  Enable the bpf() system call that allows to manipulate BPF programs\n  40:\t\t  and maps via file descriptors.\n  41:\t\n  42:\tconfig BPF_JIT\n  43:\t\tbool \"Enable BPF Just In Time compiler\"\n  44:\t\tdepends on BPF\n  45:\t\tdepends on HAVE_CBPF_JIT || HAVE_EBPF_JIT\n  46:\t\tselect EXECMEM\n  47:\t\thelp\n  48:\t\t  BPF programs are normally handled by a BPF interpreter. This option\n  49:\t\t  allows the kernel to generate native code when a program is loaded\n  50:\t\t  into the kernel. This will significantly speed-up processing of BPF\n  51:\t\t  programs.\n  52:\t\n  53:\t\t  Note, an admin should enable this feature changing:\n  54:\t\t  /proc/sys/net/core/bpf_jit_enable\n  55:\t\t  /proc/sys/net/core/bpf_jit_harden   (optional)\n  56:\t\t  /proc/sys/net/core/bpf_jit_kallsyms (optional)\n  57:\t\n  58:\tconfig BPF_JIT_ALWAYS_ON\n  59:\t\tbool \"Permanently enable BPF JIT and remove BPF interpreter\"\n  60:\t\tdepends on BPF_SYSCALL \u0026\u0026 HAVE_EBPF_JIT \u0026\u0026 BPF_JIT\n  61:\t\thelp\n  62:\t\t  Enables BPF JIT and removes BPF interpreter to avoid speculative\n  63:\t\t  execution of BPF instructions by the interpreter.\n  64:\t\n"
}

13/2 2026/08/31 08:10 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 15490
							output: 34
							thoughts: 14
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into the PowerPC Network Makefile**

Okay, time to get to the heart of this powerpc network code. My immediate thought is, "Let's crack open `arch/powerpc/net/Makefile`." I know this is where the build process for the network-related drivers and modules for the PowerPC architecture will be defined. I'm expecting to see the standard GNU Make constructs: object file lists, source file dependencies, and likely some architecture-specific flags and targets. Given the PowerPC's history, I'm anticipating some interesting platform-specific conditional compilation and possible legacy code constructs that I'll need to sift through. This Makefile will give me a critical overview of how the networking stack is being integrated at the board level. Let's see if there are any surprises.



14/2 2026/08/31 08:10 tool read-file
0m Args:
{
  "File": "arch/powerpc/net/Makefile",
  "FirstLine": 1,
  "LineCount": 20
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0\n   2:\t#\n   3:\t# Arch-specific network modules\n   4:\t#\n   5:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_jit_comp$(BITS).o\n   6:\t\n   7:\tifdef CONFIG_PPC64\n   8:\tobj-$(CONFIG_BPF_JIT) += bpf_timed_may_goto.o\n   9:\tendif\n"
}

15/2 2026/08/31 08:10 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 15862
							output: 131
							thoughts: 530
						

Thoughts:
**My Assessment of the BPF JIT Compiler Patch for PowerPC**

Okay, so I've just been reviewing a patch and I need to determine its fuzzing potential. My thought process is as follows: first, I need to identify the key configuration options related to BPF JIT compilation, specifically `BPF_JIT`, `BPF_SYSCALL`, and the relevant PowerPC architecture flags like `PPC` and `PPC64`. These will be crucial for reproducing the target environment.

Next, I need to pinpoint the specific symbols that are modified by this patch. I see changes to several key functions: `bpf_int_jit_compile`, `bpf_arch_text_poke`, `bpf_jit_emit_exit_insn`, `bpf_jit_build_fentry_stubs`, `bpf_jit_build_epilogue`, and `bpf_add_extable_entry`. These are all strong indicators of core functionality being altered. I also checked which of these symbols are exported, or in the symbol table. It's important to understand the scope.

Based on this information, I've identified `bpf_int_jit_compile` and `bpf_arch_text_poke` as the main non-hot-path entry points for fuzzing. These are the functions I want to focus on. They are the initial entry points, and likely the places where a fuzzer can start to influence code execution.

Given these findings, I’m confident that this patch warrants fuzzing. The patch directly impacts the PowerPC BPF JIT compiler and will therefore need to be tested for stability, security, and correct operation. It's modifying code generation passes, addressing aspects like convergence, fentry stubs alignment and offsets, tail call comparisons on 64-bit architectures, exit instruction emission, extable handling, and the text poking mechanism. All of these changes have the potential to introduce subtle bugs. These changes directly affect JIT code generation and execution for BPF programs on PPC/PPC64 architecture, making it worth fuzzing via the BPF subsystem/syscall.

Therefore, I'm going to set the results to reflect this: I'll mark it as worth fuzzing (obviously). My reasoning will highlight that the patch affects JIT code generation and execution. I'll focus the fuzzing efforts on `bpf_int_jit_compile` and `bpf_arch_text_poke`. And the fuzzing environment needs the `BPF_JIT` and `BPF_SYSCALL` configurations enabled. I'm ready to call `set-results`.



16/2 2026/08/31 08:10 tool set-results
0m Args:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "bpf_arch_text_poke"
  ],
  "Reasoning": "The patch modifies the PowerPC BPF JIT compiler logic, including code generation multi-pass convergence, fentry stub alignment, text poking, exit instruction emission, and 64-bit tail call comparisons. These changes alter BPF program compilation and patching behavior on PowerPC and should be fuzzed.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "bpf_arch_text_poke"
  ],
  "Reasoning": "The patch modifies the PowerPC BPF JIT compiler logic, including code generation multi-pass convergence, fentry stub alignment, text poking, exit instruction emission, and 64-bit tail call comparisons. These changes alter BPF program compilation and patching behavior on PowerPC and should be fuzzed.",
  "WorthFuzzing": true
}

17/1 2026/08/31 08:10 action If
0m Args:
{
  "WorthFuzzing": true
}

Results:
null

18/2 2026/08/31 08:10 agent kmsan-evaluator
0m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch modifies the PowerPC BPF JIT compiler (arch/powerpc/net/bpf_jit*) and corresponding BPF selftests. The changes address multi-pass code generation convergence, alignment of fentry stubs/dummy trampoline address, branch range checks, and 64-bit register comparisons for tail calls.\n\nThere are no uninitialized heap/stack memory allocations, no conditional branches on uninitialized variables, and no kernel-to-userspace data leaks introduced or modified. Any potential risks related to JIT code generation or buffer sizing are handled by standard compiler verification, runtime execution tests, or KASAN, rather than KMSAN uninitialized memory tracking. Therefore, a dedicated KMSAN fuzzing session is not required.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit 7c6736e974bf332664fd028d4c169492062ba461
Author: syz-cluster <triage@syzkaller.com>
Date:   Mon Aug 31 08:09:33 2026 +0000

    syz-cluster: applied patch under review

diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index f32de8704d4d9..4da8bde92e1ef 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -14,6 +14,13 @@
 #include <asm/ppc-opcode.h>
 #include <linux/build_bug.h>
 
+/*
+ * We need at least 2 passes for proper code generation, and may need
+ * additional passes if code size changes between passes.
+ */
+#define CODEGEN_MIN_PASSES    2
+#define CODEGEN_MAX_PASSES    3
+
 #ifdef CONFIG_PPC64_ELF_ABI_V1
 #define FUNCTION_DESCR_SIZE	24
 #else
@@ -188,6 +195,12 @@ struct codegen_context {
 
 #define bpf_to_ppc(r)	(ctx->b2p[r])
 
+#ifdef CONFIG_PPC64
+#define PPC_RAW_CMPLLI(a, i)    PPC_RAW_CMPLDI(a, i)
+#else
+#define PPC_RAW_CMPLLI(a, i)    PPC_RAW_CMPLWI(a, i)
+#endif
+
 #ifdef CONFIG_PPC32
 #define BPF_FIXUP_LEN	3 /* Three instructions => 12 bytes */
 #else
@@ -214,10 +227,11 @@ int bpf_jit_emit_func_call_rel(u32 *image, u32 *fimage, struct codegen_context *
 int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct codegen_context *ctx,
 		       u32 *addrs, int pass, bool extra_pass);
 void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx);
-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx);
-void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx);
+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx);
+void bpf_jit_build_fentry_stubs(u32 *image, u32 *fimage, struct codegen_context *ctx);
 void bpf_jit_realloc_regs(struct codegen_context *ctx);
-int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, long exit_addr);
+int bpf_jit_emit_exit_insn(u32 *image, u32 *fimage, struct codegen_context *ctx, int tmp_reg,
+										long exit_addr);
 void prepare_for_fsession_fentry(u32 *image, struct codegen_context *ctx, int cookie_cnt,
 								int cookie_off, int retval_off);
 void store_func_meta(u32 *image, struct codegen_context *ctx, u64 func_meta, int func_meta_off);
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 7b07b43575f11..c2717f0d9cdd4 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -49,11 +49,35 @@ asm (
 "	.popsection				;"
 );
 
-void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx)
+void bpf_jit_build_fentry_stubs(u32 *image, u32 *fimage, struct codegen_context *ctx)
 {
 	int ool_stub_idx, long_branch_stub_idx;
+	int stub_sz;
 
 	/*
+	 * The dummy_tramp_addr field is placed at bottom of Long branch stub.
+	 * Align the mis-aligned dummy_tramp_addr field in the fimage.
+	 * The alignment NOP must appear before OOL stub, to make
+	 * ool_stub_idx & long_branch_stub_idx constant from end.
+	 *
+	 * The fimage can be non 8-byte aligned, so final alignment depends
+	 * on start of fimage and the stub's instruction count. The
+	 * stubs block has 11 instructions (with CONFIG_PPC_FTRACE_OUT_OF_LINE)
+	 * or 10 instructions (without) before dummy_tramp_addr field. Emit a
+	 * NOP if the address of dummy_tramp_addr is non aligned.
+	 *
+	 * In pass=0 when image==NULL, conservatively account for space
+	 * required to accommodate alignment NOP. In case final pass skips
+	 * emitting alignment NOP, the image buffer have 4 spare bytes and
+	 * jited_len signifies correct program size.
+	 */
+
+	stub_sz = IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE) ? 44 : 40;
+	if (!image || !IS_ALIGNED((unsigned long)fimage + ctx->idx*4 + stub_sz, SZL))
+		EMIT(PPC_RAW_NOP());
+
+	/*
+	 *	nop     // optional, for alignment of dummy_tramp_addr
 	 * Out-of-line stub:
 	 *	mflr	r0
 	 *	[b|bl]	tramp
@@ -70,44 +94,46 @@ void bpf_jit_build_fentry_stubs(u32 *image, struct codegen_context *ctx)
 
 	/*
 	 * Long branch stub:
-	 *	.long	<dummy_tramp_addr>
 	 *	mflr	r11
 	 *	bcl	20,31,$+4
-	 *	mflr	r12
-	 *	ld	r12, -8-SZL(r12)
+	 *	mflr	r12	// lr/r12 stores pc of current(this) inst.
+	 *	ld	r12, 20(r12) // offset(dummy_tramp_addr) from prev inst. is 20
 	 *	mtctr	r12
-	 *	mtlr	r11 // needed to retain ftrace ABI
+	 *	mtlr	r11	// needed to retain ftrace ABI
 	 *	bctr
+	 *	.long	<dummy_tramp_addr>  // SZL bytes aligned
 	 */
-	if (image)
-		*((unsigned long *)&image[ctx->idx]) = (unsigned long)dummy_tramp;
-	ctx->idx += SZL / 4;
 	long_branch_stub_idx = ctx->idx;
 	EMIT(PPC_RAW_MFLR(_R11));
 	EMIT(PPC_RAW_BCL4());
 	EMIT(PPC_RAW_MFLR(_R12));
-	EMIT(PPC_RAW_LL(_R12, _R12, -8-SZL));
+	EMIT(PPC_RAW_LL(_R12, _R12, 20));
 	EMIT(PPC_RAW_MTCTR(_R12));
 	EMIT(PPC_RAW_MTLR(_R11));
 	EMIT(PPC_RAW_BCTR());
 
+	if (image)
+		*((unsigned long *)&image[ctx->idx]) = (unsigned long)dummy_tramp;
+
+	ctx->idx += SZL / 4;
+
 	if (!bpf_jit_ool_stub) {
 		bpf_jit_ool_stub = (ctx->idx - ool_stub_idx) * 4;
 		bpf_jit_long_branch_stub = (ctx->idx - long_branch_stub_idx) * 4;
 	}
 }
 
-int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, long exit_addr)
+int bpf_jit_emit_exit_insn(u32 *image, u32 *fimage, struct codegen_context *ctx,
+							int tmp_reg, long exit_addr)
 {
-	if (!exit_addr || is_offset_in_branch_range(exit_addr - (ctx->idx * 4))) {
+	if (exit_addr && is_offset_in_branch_range(exit_addr - (long)(ctx->idx * 4))) {
 		PPC_JMP(exit_addr);
-	} else if (ctx->alt_exit_addr) {
-		if (WARN_ON(!is_offset_in_branch_range((long)ctx->alt_exit_addr - (ctx->idx * 4))))
-			return -1;
+	} else if (ctx->alt_exit_addr && is_offset_in_branch_range(
+			(long)(ctx->alt_exit_addr) - (long)(ctx->idx * 4))) {
 		PPC_JMP(ctx->alt_exit_addr);
 	} else {
 		ctx->alt_exit_addr = ctx->idx * 4;
-		bpf_jit_build_epilogue(image, ctx);
+		bpf_jit_build_epilogue(image, fimage, ctx);
 	}
 
 	return 0;
@@ -274,6 +300,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	 */
 	if (cgctx.seen & SEEN_TAILCALL || !is_offset_in_branch_range((long)cgctx.idx * 4)) {
 		cgctx.idx = 0;
+		cgctx.alt_exit_addr = 0;
 		if (bpf_jit_build_body(fp, NULL, NULL, &cgctx, addrs, 0, false))
 			goto out_err;
 	}
@@ -286,7 +313,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	 */
 	bpf_jit_build_prologue(NULL, &cgctx);
 	addrs[fp->len] = cgctx.idx * 4;
-	bpf_jit_build_epilogue(NULL, &cgctx);
+	bpf_jit_build_epilogue(NULL, NULL, &cgctx);
 
 	fixup_len = fp->aux->num_exentries * BPF_FIXUP_LEN * 4;
 	extable_len = fp->aux->num_exentries * sizeof(struct exception_table_entry);
@@ -306,10 +333,13 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	code_base = (u32 *)(image + FUNCTION_DESCR_SIZE);
 	fcode_base = (u32 *)(fimage + FUNCTION_DESCR_SIZE);
 
-	/* Code generation passes 1-2 */
-	for (pass = 1; pass < 3; pass++) {
+	/* Code generation passes 1-2+, loop until program size converges. */
+	for (pass = 1; pass <= CODEGEN_MAX_PASSES; pass++) {
+		u32 prev_proglen = proglen;
+
 		/* Now build the prologue, body code & epilogue for real. */
 		cgctx.idx = 0;
+		cgctx.exentry_idx = 0;
 		cgctx.alt_exit_addr = 0;
 		bpf_jit_build_prologue(code_base, &cgctx);
 		if (bpf_jit_build_body(fp, code_base, fcode_base, &cgctx, addrs, pass,
@@ -318,11 +348,26 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 			bpf_jit_binary_pack_free(fhdr, hdr);
 			goto out_err;
 		}
-		bpf_jit_build_epilogue(code_base, &cgctx);
+		addrs[fp->len] = cgctx.idx * 4;
+		bpf_jit_build_epilogue(code_base, fcode_base, &cgctx);
+
+		proglen = cgctx.idx * 4;
 
 		if (bpf_jit_enable > 1)
 			pr_info("Pass %d: shrink = %d, seen = 0x%x\n", pass,
-				proglen - (cgctx.idx * 4), cgctx.seen);
+				prev_proglen - proglen, cgctx.seen);
+
+		/* Check if program size has converged, but ensure minimum passes */
+		if (pass >= CODEGEN_MIN_PASSES && proglen == prev_proglen)
+			break;
+
+		if (pass == CODEGEN_MAX_PASSES && proglen != prev_proglen) {
+			pr_err("BPF JIT: Program did not converge after %d passes\n",
+								CODEGEN_MAX_PASSES);
+			bpf_arch_text_copy(&fhdr->size, &hdr->size, sizeof(hdr->size));
+			bpf_jit_binary_pack_free(fhdr, hdr);
+			goto out_err;
+		}
 	}
 
 	if (bpf_jit_enable > 1)
@@ -357,7 +402,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 				(void *)fimage + FUNCTION_DESCR_SIZE);
 
 out_addrs:
-		if (!image && priv_stack_ptr) {
+		if (!fp->jited && priv_stack_ptr) {
 			fp->aux->priv_stack_ptr = NULL;
 			free_percpu(priv_stack_ptr);
 		}
@@ -399,7 +444,7 @@ int bpf_add_extable_entry(struct bpf_prog *fp, u32 *image, u32 *fimage, int pass
 	u32 *fixup;
 
 	/* Populate extable entries only in the last pass */
-	if (pass != 2)
+	if (pass < CODEGEN_MIN_PASSES)
 		return 0;
 
 	if (!fp->aux->extable ||
@@ -739,7 +784,7 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte
 		 * Setting the tail_call_info in trampoline's frame
 		 * depending on if previous frame had value or reference.
 		 */
-		EMIT(PPC_RAW_CMPLWI(_R3, MAX_TAIL_CALL_CNT));
+		EMIT(PPC_RAW_CMPLLI(_R3, MAX_TAIL_CALL_CNT));
 		PPC_BCC_CONST_SHORT(COND_GT, 8);
 		EMIT(PPC_RAW_ADDI(_R3, _R4, -BPF_PPC_TAILCALL));
 
@@ -1265,6 +1310,7 @@ static void do_isync(void *info __maybe_unused)
  * bpf_func:
  *	[nop|b]	ool_stub
  * 2. Out-of-line stub:
+ *	nop	// optional nop for alignment
  * ool_stub:
  *	mflr	r0
  *	[b|bl]	<bpf_prog>/<long_branch_stub>
@@ -1272,14 +1318,14 @@ static void do_isync(void *info __maybe_unused)
  *	b	bpf_func + 4
  * 3. Long branch stub:
  * long_branch_stub:
- *	.long	<branch_addr>/<dummy_tramp>
  *	mflr	r11
  *	bcl	20,31,$+4
  *	mflr	r12
- *	ld	r12, -16(r12)
+ *	ld	r12, 20(r12)
  *	mtctr	r12
  *	mtlr	r11 // needed to retain ftrace ABI
  *	bctr
+ *	.long	<branch_addr>/<dummy_tramp>
  *
  * dummy_tramp is used to reduce synchronization requirements.
  *
@@ -1381,10 +1427,12 @@ int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type old_t,
 	 * 1. Update the address in the long branch stub:
 	 * If new_addr is out of range, we will have to use the long branch stub, so patch new_addr
 	 * here. Otherwise, revert to dummy_tramp, but only if we had patched old_addr here.
+	 *
+	 * dummy_tramp_addr moved to bottom of long branch stub.
 	 */
 	if ((new_addr && !is_offset_in_branch_range(new_addr - ip)) ||
 	    (old_addr && !is_offset_in_branch_range(old_addr - ip)))
-		ret = patch_ulong((void *)(bpf_func_end - bpf_jit_long_branch_stub - SZL),
+		ret = patch_ulong((void *)(bpf_func_end - SZL), /* SZL: dummy_tramp_addr offset */
 				  (new_addr && !is_offset_in_branch_range(new_addr - ip)) ?
 				  (unsigned long)new_addr : (unsigned long)dummy_tramp);
 	if (ret)
diff --git a/arch/powerpc/net/bpf_jit_comp32.c b/arch/powerpc/net/bpf_jit_comp32.c
index bfdc50740da8e..f5b9441cf46aa 100644
--- a/arch/powerpc/net/bpf_jit_comp32.c
+++ b/arch/powerpc/net/bpf_jit_comp32.c
@@ -229,7 +229,7 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx
 
 }
 
-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx)
 {
 	EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_0)));
 
@@ -237,7 +237,7 @@ void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
 
 	EMIT(PPC_RAW_BLR());
 
-	bpf_jit_build_fentry_stubs(image, ctx);
+	bpf_jit_build_fentry_stubs(image, fimage, ctx);
 }
 
 /* Relative offset needs to be calculated based on final image location */
@@ -1149,7 +1149,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
 			 * we'll just fall through to the epilogue.
 			 */
 			if (i != flen - 1) {
-				ret = bpf_jit_emit_exit_insn(image, ctx, _R0, exit_addr);
+				ret = bpf_jit_emit_exit_insn(image, fimage,
+								ctx, _R0, exit_addr);
 				if (ret)
 					return ret;
 			}
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index dab106cae22b5..e80312171aa74 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -276,7 +276,7 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
 		 */
 		EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), _R1, 0));
 		EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2), -(BPF_PPC_TAILCALL)));
-		EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
+		EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
 		PPC_BCC_CONST_SHORT(COND_GT, 8);
 		EMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2),
 								-(BPF_PPC_TAILCALL)));
@@ -398,7 +398,7 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx
 	}
 }
 
-void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
+void bpf_jit_build_epilogue(u32 *image, u32 *fimage, struct codegen_context *ctx)
 {
 	bpf_jit_emit_common_epilogue(image, ctx);
 
@@ -407,7 +407,7 @@ void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
 
 	EMIT(PPC_RAW_BLR());
 
-	bpf_jit_build_fentry_stubs(image, ctx);
+	bpf_jit_build_fentry_stubs(image, fimage, ctx);
 }
 
 /*
@@ -662,7 +662,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 	PPC_BCC_SHORT(COND_GE, out);
 
 	EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), _R1, bpf_jit_stack_tailcallinfo_offset(ctx)));
-	EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
+	EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
 	PPC_BCC_CONST_SHORT(COND_LE, 8);
 
 	/* dereference TMP_REG_1 */
@@ -672,7 +672,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 	 * if (tail_call_info == MAX_TAIL_CALL_CNT)
 	 *   goto out;
 	 */
-	EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
+	EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), MAX_TAIL_CALL_CNT));
 	PPC_BCC_SHORT(COND_EQ, out);
 
 	/*
@@ -707,7 +707,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 	 * tail_call_info.
 	 */
 	EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), _R1, bpf_jit_stack_tailcallinfo_offset(ctx)));
-	EMIT(PPC_RAW_CMPLWI(bpf_to_ppc(TMP_REG_2), MAX_TAIL_CALL_CNT));
+	EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_2), MAX_TAIL_CALL_CNT));
 	PPC_BCC_CONST_SHORT(COND_GT, 8);
 
 	/* First get address of tail_call_info */
@@ -1737,7 +1737,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
 			 * we'll just fall through to the epilogue.
 			 */
 			if (i != flen - 1) {
-				ret = bpf_jit_emit_exit_insn(image, ctx, tmp1_reg, exit_addr);
+				ret = bpf_jit_emit_exit_insn(image, fimage, ctx,
+								tmp1_reg, exit_addr);
 				if (ret)
 					return ret;
 			}
diff --git a/tools/testing/selftests/bpf/jit_disasm_helpers.c b/tools/testing/selftests/bpf/jit_disasm_helpers.c
index 3558fe10e28cf..b291d934dd1ab 100644
--- a/tools/testing/selftests/bpf/jit_disasm_helpers.c
+++ b/tools/testing/selftests/bpf/jit_disasm_helpers.c
@@ -179,9 +179,11 @@ int get_jited_program_text(int fd, char *text, size_t text_sz)
 	struct bpf_prog_info info = {};
 	__u32 info_len = sizeof(info);
 	__u32 jited_funcs, len, pc;
+	__u32 trunc_len = 0, disasm_len;
 	__u32 *func_lens = NULL;
 	FILE *text_out = NULL;
 	uint8_t *image = NULL;
+	char *triple = NULL;
 	int i, err = 0;
 
 	if (!llvm_initialized) {
@@ -225,9 +227,30 @@ int get_jited_program_text(int fd, char *text, size_t text_sz)
 	if (!ASSERT_OK(err, "bpf_prog_get_info_by_fd #2"))
 		goto out;
 
+	/*
+	 * last 8 bytes contains dummy_trampoline address in JIT
+	 * output on 64-bit and last 4 bytes on 32-bit powerpc,
+	 * which can't disassemble to a valid instruction.
+	 */
+	triple = LLVMGetDefaultTargetTriple();
+	if (triple) {
+		if (strstr(triple, "powerpc64") || strstr(triple, "ppc64"))
+			trunc_len = 8;
+		else if (strstr(triple, "powerpc") || strstr(triple, "ppc"))
+			trunc_len = 4;
+		LLVMDisposeMessage(triple);
+	}
+
 	for (pc = 0, i = 0; i < jited_funcs; ++i) {
 		fprintf(text_out, "func #%d:\n", i);
-		disasm_one_func(text_out, image + pc, func_lens[i]);
+
+		/*
+		 * Disabled JIT have zero func_lens, hence underflow
+		 */
+		disasm_len = func_lens[i] > trunc_len ?
+					func_lens[i] - trunc_len : 0;
+		disasm_one_func(text_out, image + pc, disasm_len);
+
 		fprintf(text_out, "\n");
 		pc += func_lens[i];
 	}
diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
index b0c441384f206..365008d1ed40c 100644
--- a/tools/testing/selftests/bpf/progs/bpf_misc.h
+++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
@@ -159,6 +159,7 @@
 #define __arch_riscv64		__arch("RISCV64")
 #define __arch_s390x		__arch("s390x")
 #define __arch_loongarch	__arch("LOONGARCH")
+#define __arch_powerpc64	__arch("POWERPC64")
 #define __caps_unpriv(caps)	__test_tag("test_caps_unpriv=" EXPAND_QUOTE(caps))
 #define __load_if_JITed()	__test_tag("load_mode=jited")
 #define __load_if_no_JITed()	__test_tag("load_mode=no_jited")
diff --git a/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c b/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c
index 48fa34d2959f4..9880ce4f1931a 100644
--- a/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c
+++ b/tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c
@@ -91,6 +91,84 @@ __jited("	popq	%rax")
 __jited("	jmp	{{.*}}")		/* jump to tail call tgt   */
 __jited("L0:	leave")
 __jited("	{{(retq|jmp	0x)}}")		/* return or jump to rethunk */
+__arch_powerpc64
+/* program entry for main(), regular function prologue */
+__jited("	nop")
+__jited("...")                          /* ld 2, 16(13) absent with CONFIG_PPC_KERNEL_PCREL */
+__jited("	li 9, 0")
+__jited("	std 9, -8(1)")
+__jited("	mflr 0")
+__jited("	std 0, 16(1)")
+__jited("	stdu 1, {{.*}}(1)")
+/*
+ * load address and call sub() via count register
+ *
+ * Address materialization differs between PCREL and non-PCREL kernels.
+ * Skip the address generation sequence and verify only that the call
+ * target is loaded into CTR before branching.
+ */
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("...")
+__jited("	mtctr {{.*}}")
+__jited("...")
+__jited("	bctrl")
+__jited("	mr	8, 3")
+__jited("	li 8, 0")
+__jited("	addi 1, 1, {{.*}}")
+__jited("	ld 0, 16(1)")
+__jited("	mtlr 0")
+__jited("	mr	3, 8")
+__jited("	blr")
+__jited("...")
+__jited("func #1")
+/* subprogram entry for sub() */
+__jited("	nop")
+__jited("...")                          /* ld 2, 16(13) absent with CONFIG_PPC_KERNEL_PCREL */
+/* tail call prologue for subprogram */
+__jited("	ld 10, 0(1)")
+__jited("	ld 9, -8(10)")
+__jited("	cmpldi	9, 33")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	addi 9, 10, -8")
+__jited("	std 9, -8(1)")
+__jited("	lis {{.*}}, {{.*}}")
+__jited("	sldi {{.*}}, {{.*}}, 32")
+__jited("	oris {{.*}}, {{.*}}, {{.*}}")
+__jited("	ori {{.*}}, {{.*}}, {{.*}}")
+__jited("	li {{.*}}, 0")
+__jited("	lwz 9, {{.*}}({{.*}})")
+__jited("	slwi {{.*}}, {{.*}}, 0")
+__jited("	cmplw	{{.*}}, 9")
+__jited("	bf	0, {{.*}}")
+/* bpf_tail_call implementation */
+__jited("	ld 9, -8(1)")
+__jited("	cmpldi	9, 33")
+__jited("	bf	{{.*}}, {{.*}}")
+__jited("	ld 9, 0(9)")
+__jited("	cmpldi	9, 33")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	addi 9, 9, 1")
+__jited("	mulli 10, {{.*}}, 8")
+__jited("	add 10, 10, {{.*}}")
+__jited("	ld 10, {{.*}}(10)")
+__jited("	cmpldi	10, 0")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	ld 10, {{.*}}(10)")
+__jited("	addi 10, 10, {{.*}}")    /* offset depends on CONFIG_PPC_KERNEL_PCREL */
+__jited("	mtctr 10")
+__jited("	ld 10, -8(1)")
+__jited("	cmpldi	10, 33")
+__jited("	bt	{{.*}}, {{.*}}")
+__jited("	addi 10, 1, -8")
+__jited("	std 9, 0(10)")
+__jited("	bctr")
+__jited("	mr	3, 8")
+__jited("	blr")
+
 SEC("tc")
 __naked int main(void)
 {
diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c
index 3ce32d134e2cc..01b1420097d27 100644
--- a/tools/testing/selftests/bpf/test_loader.c
+++ b/tools/testing/selftests/bpf/test_loader.c
@@ -378,6 +378,7 @@ enum arch {
 	ARCH_RISCV64	= 0x8,
 	ARCH_S390X	= 0x10,
 	ARCH_LOONGARCH	= 0x20,
+	ARCH_POWERPC64	= 0x40,
 };
 
 static int get_current_arch(void)
@@ -392,6 +393,8 @@ static int get_current_arch(void)
 	return ARCH_S390X;
 #elif defined(__loongarch__)
 	return ARCH_LOONGARCH;
+#elif defined(__powerpc64__)
+	return ARCH_POWERPC64;
 #endif
 	return ARCH_UNKNOWN;
 }
@@ -585,6 +588,8 @@ static int parse_test_spec(struct test_loader *tester,
 				arch = ARCH_S390X;
 			} else if (strcmp(val, "LOONGARCH") == 0) {
 				arch = ARCH_LOONGARCH;
+			} else if (strcmp(val, "POWERPC64") == 0) {
+				arch = ARCH_POWERPC64;
 			} else {
 				PRINT_FAIL("bad arch spec: '%s'\n", val);
 				err = -EINVAL;

19/3 2026/08/31 08:10 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 11301
							output: 179
							thoughts: 1244
						

Thoughts:
**KMSAN Assessment: PowerPC BPF JIT Compiler Patch**

Alright, let's break down this patch series. It appears to focus exclusively on improvements and fixes within the PowerPC BPF JIT compiler. The files touched are all within the `arch/powerpc/net/` directory, dealing with BPF JIT compilation, along with some accompanying selftests.

My initial scan reveals several key modifications: the introduction of `CODEGEN_MIN_PASSES` and `CODEGEN_MAX_PASSES`, adjustments to how fentry stubs are handled, specifically addressing alignment issues related to `dummy_tramp_addr` within the `fimage`, and fixes to the `exit_addr` branch range check. There's also an update to 64-bit comparison instructions for tail calls, and modifications to `bpf_arch_text_poke` to accommodate the new `dummy_tramp_addr` location. Plus, the selftests have been updated.

Thinking about KMSAN, it's worth noting that KMSAN itself is not supported on PowerPC, which is something I need to keep in mind. Let's make sure that regardless of arch, there are no uninitialized memory risks or kernel info-leaks to user space.

Now, let's apply the KMSAN rules. The changes are clearly self-contained within the PowerPC BPF JIT compiler and selftests, focusing on improving the JIT compilation process and ensuring correct operation. There's no modification of kernel structures being sent to user space, no conditional logic depending on uninitialized variables, and no allocation of complex data structures where uninitialized fields could be read later. I've looked at the functions modifying the JIT image buffer. The code writes dummy_tramp or NOPs to the JIT image buffer. Also the JIT buffers are allocated/freed by the binary pack allocator. No uninitialized struct fields, uninitialized stack reads, or info leaks to userspace.

Therefore, applying the KMSAN rules rigorously, `NeedsKMSAN` should definitely be set to `false`.

Here's my detailed reasoning: The patch is isolated to the PowerPC BPF JIT compiler and selftests. It resolves JIT code generation issues, addresses fentry trampoline alignment, corrects 64-bit tail call comparisons, and updates selftests. No kernel-to-user copies, uninitialized variable usage, or related memory leaks are introduced. Any potential bugs would be more related to jump target miscalculations or buffer bounds, not uninitialized memory tracking (and KSAN is not even supported on PowerPC anyway).

Time to prepare the tool call.



20/3 2026/08/31 08:11 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch modifies the PowerPC BPF JIT compiler (arch/powerpc/net/bpf_jit*) and corresponding BPF selftests. The changes address multi-pass code generation convergence, alignment of fentry stubs/dummy trampoline address, branch range checks, and 64-bit register comparisons for tail calls.\n\nThere are no uninitialized heap/stack memory allocations, no conditional branches on uninitialized variables, and no kernel-to-userspace data leaks introduced or modified. Any potential risks related to JIT code generation or buffer sizing are handled by standard compiler verification, runtime execution tests, or KASAN, rather than KMSAN uninitialized memory tracking. Therefore, a dedicated KMSAN fuzzing session is not required.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch modifies the PowerPC BPF JIT compiler (arch/powerpc/net/bpf_jit*) and corresponding BPF selftests. The changes address multi-pass code generation convergence, alignment of fentry stubs/dummy trampoline address, branch range checks, and 64-bit register comparisons for tail calls.\n\nThere are no uninitialized heap/stack memory allocations, no conditional branches on uninitialized variables, and no kernel-to-userspace data leaks introduced or modified. Any potential risks related to JIT code generation or buffer sizing are handled by standard compiler verification, runtime execution tests, or KASAN, rather than KMSAN uninitialized memory tracking. Therefore, a dedicated KMSAN fuzzing session is not required.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)