mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] RISC-V JIT support for bpf_get_current_task/_btf
@ 2026-06-02 20:58 Varun R Mallya
  2026-06-02 20:58 ` [PATCH bpf-next 1/2] selftests/bpf: use host CPU features in JIT disassembler Varun R Mallya
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Varun R Mallya @ 2026-06-02 20:58 UTC (permalink / raw)
  To: bpf, linux-riscv, ast, daniel, andrii, eddyz87, memxor, bjorn,
	pjw, palmer, aou, puranjay, menglong8.dong
  Cc: martin.lau, song, yonghong.song, jolsa, pulehui, alex,
	linux-kernel, linux-kselftest, varunrmallya

These two patches add support for the bpf_get_current_task and
bpf_get_current_task_btf kfuncs in RISC-V JIT and add a selftest.

The first patch adds support for cpu and feature detection on
the JIT disassembly helper function as RISC-V JITed code was not
being disassembled using `LLVMCreateDisasm` as it was missing the
"+c" CPU feature and JITed code contained RISC-V Compressed (C)
Extension. This patch generalizes that to detect CPU features and
enables testing on more RISC-V JIT work ahead.

The second patch, which actually adds this support has been benchmarked
on QEMU RISC-V and shows significant improvements.
It was benchmarked using a simple loop inside a bpf program that ran
bpf_get_current_task() and execution time was measured. It used
bpf_prog_test_run_opts() to repeatedly trigger the BPF program. The loop
ran in 1 second intervals and it kept firing bpf_prog_test_run_opts() as
fast as possible until a second had elapsed and then reported statistics.

Varun R Mallya (2):
  selftests/bpf: use host CPU features in JIT disassembler
  bpf, riscv: inline bpf_get_current_task() and
    bpf_get_current_task_btf()

 arch/riscv/net/bpf_jit_comp64.c                     |  9 +++++++++
 tools/testing/selftests/bpf/jit_disasm_helpers.c    | 13 +++++++++++--
 .../selftests/bpf/progs/verifier_jit_inline.c       |  2 ++
 3 files changed, 22 insertions(+), 2 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-05 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-02 20:58 [PATCH bpf-next 0/2] RISC-V JIT support for bpf_get_current_task/_btf Varun R Mallya
2026-06-02 20:58 ` [PATCH bpf-next 1/2] selftests/bpf: use host CPU features in JIT disassembler Varun R Mallya
2026-06-03  7:21   ` Björn Töpel
2026-06-02 20:58 ` [PATCH bpf-next 2/2] bpf, riscv: inline bpf_get_current_task() and bpf_get_current_task_btf() Varun R Mallya
2026-06-03  7:16   ` Björn Töpel
2026-06-05 22:30 ` [PATCH bpf-next 0/2] RISC-V JIT support for bpf_get_current_task/_btf patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®