Thread (2 messages) flat view 2 messages, 2 authors, 8d ago

Re: [PATCH v11 3/8] selftests/bpf: Fixing powerpc JIT disassembly failure

From: bot+bpf-ci@kernel.org
Date: 2026-08-07 12:59:43
Also in: bpf, linux-kselftest, stable

quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/bpf/jit_disasm_helpers.c b/tools/testing/selftests/bpf/jit_disasm_helpers.c
index 3558fe10e28cf..c4aa1d69d3bbf 100644
--- a/tools/testing/selftests/bpf/jit_disasm_helpers.c
+++ b/tools/testing/selftests/bpf/jit_disasm_helpers.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -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) {
+
This isn't a bug, but are the two new blank lines inside this loop
intentional? Dropping them would keep the diff to just the truncation
logic and match how the loops in disasm_one_func() are laid out.
 		fprintf(text_out, "func #%d:\n", 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];
 	}
selftests/bpf: Fixing powerpc JIT disassembly failure
This isn't a bug, but would the subject read better in the imperative
mood, "selftests/bpf: Fix powerpc JIT disassembly failure", to match
the rest of the series?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/31176427801
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help