diff options
author | Leon Hwang <hffilwlqm@gmail.com> | 2024-07-14 20:39:01 +0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-07-29 12:53:38 -0700 |
commit | 66ff4d61dc124eafe9efaeaef696a09b7f236da2 (patch) | |
tree | f840577a99c2dd0872339fa21963657475369ce8 /tools/testing/selftests/bpf/prog_tests/tailcalls.c | |
parent | 116e04ba1459fc08f80cf27b8c9f9f188be0fcb2 (diff) | |
download | linux-66ff4d61dc124eafe9efaeaef696a09b7f236da2.tar.gz linux-66ff4d61dc124eafe9efaeaef696a09b7f236da2.tar.bz2 linux-66ff4d61dc124eafe9efaeaef696a09b7f236da2.zip |
bpf, arm64: Fix tailcall hierarchy
This patch fixes a tailcall issue caused by abusing the tailcall in
bpf2bpf feature on arm64 like the way of "bpf, x64: Fix tailcall
hierarchy".
On arm64, when a tail call happens, it uses tail_call_cnt_ptr to
increment tail_call_cnt, too.
At the prologue of main prog, it has to initialize tail_call_cnt and
prepare tail_call_cnt_ptr.
At the prologue of subprog, it pushes x26 register twice, and does not
initialize tail_call_cnt.
At the epilogue, it pops x26 twice, no matter whether it is main prog or
subprog.
Fixes: d4609a5d8c70 ("bpf, arm64: Keep tail call count across bpf2bpf calls")
Acked-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
Link: https://lore.kernel.org/r/20240714123902.32305-3-hffilwlqm@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tailcalls.c')
0 files changed, 0 insertions, 0 deletions