diff options
| author | Chenghao Duan <duanchenghao@kylinos.cn> | 2025-12-31 15:19:21 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-08 10:17:13 +0100 |
| commit | a6493ebd6dd5160764fb8d784a0e28b14b8a4d7b (patch) | |
| tree | fb5334c8352807b58eb5fff3dcf77f2d27b458ca /arch | |
| parent | 85fdef3dcc1007ba8619589fa38014628f88854f (diff) | |
| download | linux-a6493ebd6dd5160764fb8d784a0e28b14b8a4d7b.tar.gz linux-a6493ebd6dd5160764fb8d784a0e28b14b8a4d7b.tar.bz2 linux-a6493ebd6dd5160764fb8d784a0e28b14b8a4d7b.zip | |
LoongArch: BPF: Adjust the jump offset of tail calls
commit 61319d15a56093358c6822d30659fe2941f589f1 upstream.
Call the next bpf prog and skip the first instruction of TCC
initialization.
A total of 7 instructions are skipped:
'move t0, ra' 1 inst
'move_imm + jirl' 5 inst
'addid REG_TCC, zero, 0' 1 inst
Relevant test cases: the tailcalls test item in selftests/bpf.
Cc: stable@vger.kernel.org
Fixes: 677e6123e3d2 ("LoongArch: BPF: Disable trampoline for kernel module function trace")
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/loongarch/net/bpf_jit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c index 39753ce2d017..95c214e2cf09 100644 --- a/arch/loongarch/net/bpf_jit.c +++ b/arch/loongarch/net/bpf_jit.c @@ -239,7 +239,7 @@ static void __build_epilogue(struct jit_ctx *ctx, bool is_tail_call) * Call the next bpf prog and skip the first instruction * of TCC initialization. */ - emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T3, 6); + emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T3, 7); } } |
