]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
LoongArch: BPF: Fix outdated tail call comments
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 25 Jun 2026 05:03:53 +0000 (13:03 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 25 Jun 2026 05:03:53 +0000 (13:03 +0800)
commit25d9127bb0e27275d55a5b3d0fd30b04bafffd5a
treec7745d247ddbd2d8365f485201845221449599d7
parentc2bd59bf44d6cd1a0bbb23a55e17b24bfb6b3df8
LoongArch: BPF: Fix outdated tail call comments

The current LoongArch BPF JIT implementation hardcodes the number of
prologue instructions skipped during a tail call as a magic number '7'
in the jirl instruction. However, the accompanying comment explaining
this offset is completely outdated. It inaccurately states that only
a single TCC initialization instruction is bypassed, but in reality,
multiple setup slots are skipped, so fix these outdated comments in
__build_epilogue().

While at it, refine the comments in build_prologue() to describe the
skipped setup slots (RA saving, fentry nops, and the TCC register slot)
using proper dynamic tracing context. Also, remove the magic number '7'
by introducing descriptive macros to formally define the prologue layout
and make the tail call jump offset self-documenting.

Fixes: 61319d15a560 ("LoongArch: BPF: Adjust the jump offset of tail calls")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/net/bpf_jit.c