diff options
author | Eduard Zingerman <eddyz87@gmail.com> | 2024-07-22 16:38:37 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-07-29 15:05:05 -0700 |
commit | 91b7fbf3936f5c27d1673264dc24a713290e2165 (patch) | |
tree | ebabfbc28ab41c57b9684db2bd8e588ae4fbc4b7 /tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c | |
parent | 5b5f51bff1b66cedb62b5ba74a1878341204e057 (diff) |
bpf, x86, riscv, arm: no_caller_saved_registers for bpf_get_smp_processor_id()
The function bpf_get_smp_processor_id() is processed in a different
way, depending on the arch:
- on x86 verifier replaces call to bpf_get_smp_processor_id() with a
sequence of instructions that modify only r0;
- on riscv64 jit replaces call to bpf_get_smp_processor_id() with a
sequence of instructions that modify only r0;
- on arm64 jit replaces call to bpf_get_smp_processor_id() with a
sequence of instructions that modify only r0 and tmp registers.
These rewrites satisfy attribute no_caller_saved_registers contract.
Allow rewrite of no_caller_saved_registers patterns for
bpf_get_smp_processor_id() in order to use this function as a canary
for no_caller_saved_registers tests.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20240722233844.1406874-4-eddyz87@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/tcp_hdr_options.c')
0 files changed, 0 insertions, 0 deletions