diff options
author | Puranjay Mohan <puranjay12@gmail.com> | 2024-02-01 12:52:25 +0000 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-02-27 13:54:17 -0800 |
commit | 22fc0e80aeb5c0c1377e6c02d7248f8fbf5df7fc (patch) | |
tree | 4a75076e5895a08e735de95e9e5c0ba31d21f4c9 /tools | |
parent | e74cb1b422131615a0fe3bedd4ab2e38b7442d10 (diff) | |
download | linux-stable-22fc0e80aeb5c0c1377e6c02d7248f8fbf5df7fc.tar.gz linux-stable-22fc0e80aeb5c0c1377e6c02d7248f8fbf5df7fc.tar.bz2 linux-stable-22fc0e80aeb5c0c1377e6c02d7248f8fbf5df7fc.zip |
bpf, arm64: support exceptions
The prologue generation code has been modified to make the callback
program use the stack of the program marked as exception boundary where
callee-saved registers are already pushed.
As the bpf_throw function never returns, if it clobbers any callee-saved
registers, they would remain clobbered. So, the prologue of the
exception-boundary program is modified to push R23 and R24 as well,
which the callback will then recover in its epilogue.
The Procedure Call Standard for the Arm 64-bit Architecture[1] states
that registers r19 to r28 should be saved by the callee. BPF programs on
ARM64 already save all callee-saved registers except r23 and r24. This
patch adds an instruction in prologue of the program to save these
two registers and another instruction in the epilogue to recover them.
These extra instructions are only added if bpf_throw() is used. Otherwise
the emitted prologue/epilogue remains unchanged.
[1] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Link: https://lore.kernel.org/r/20240201125225.72796-3-puranjay12@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/DENYLIST.aarch64 | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64 index 5c2cc7e8c5d0..0445ac38bc07 100644 --- a/tools/testing/selftests/bpf/DENYLIST.aarch64 +++ b/tools/testing/selftests/bpf/DENYLIST.aarch64 @@ -1,6 +1,5 @@ bpf_cookie/multi_kprobe_attach_api # kprobe_multi_link_api_subtest:FAIL:fentry_raw_skel_load unexpected error: -3 bpf_cookie/multi_kprobe_link_api # kprobe_multi_link_api_subtest:FAIL:fentry_raw_skel_load unexpected error: -3 -exceptions # JIT does not support calling kfunc bpf_throw: -524 fexit_sleep # The test never returns. The remaining tests cannot start. kprobe_multi_bench_attach # needs CONFIG_FPROBE kprobe_multi_test # needs CONFIG_FPROBE |