OSDN Git Service

bpf, riscv: Limit to 33 tail calls
authorPaul Chaignon <paul.chaignon@orange.com>
Mon, 9 Dec 2019 18:52:07 +0000 (19:52 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 11 Dec 2019 12:57:17 +0000 (13:57 +0100)
commit96bc4432f5ade1045521f3b247f516b1478166bd
treefdfa20e990e22c74004d58a1246f958112394b86
parent24dee0c7478d1a1e00abdf5625b7f921467325dc
bpf, riscv: Limit to 33 tail calls

All BPF JIT compilers except RISC-V's and MIPS' enforce a 33-tail calls
limit at runtime.  In addition, a test was recently added, in tailcalls2,
to check this limit.

This patch updates the tail call limit in RISC-V's JIT compiler to allow
33 tail calls.  I tested it using the above selftest on an emulated
RISCV64.

Fixes: 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G")
Reported-by: Mahshid Khezri <khezri.mahshid@gmail.com>
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Björn Töpel <bjorn.topel@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/966fe384383bf23a0ee1efe8d7291c78a3fb832b.1575916815.git.paul.chaignon@gmail.com
arch/riscv/net/bpf_jit_comp.c