selftests/bpf: Fix get_func_ip offset test for CONFIG_X86_KERNEL_IBT
authorJiri Olsa <jolsa@kernel.org>
Mon, 26 Sep 2022 15:33:40 +0000 (17:33 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Sep 2022 03:30:40 +0000 (20:30 -0700)
commit738c345b74b8d11edd01b6cee5628c6b8368d8ea
tree4257dcd090e4aa3d9c55551abd6762aa9fdff21a
parent0e253f7e558a3e250902ba2034091e0185448836
selftests/bpf: Fix get_func_ip offset test for CONFIG_X86_KERNEL_IBT

With CONFIG_X86_KERNEL_IBT enabled the test for kprobe with offset
won't work because of the extra endbr instruction.

As suggested by Andrii adding CONFIG_X86_KERNEL_IBT detection
and using appropriate offset value based on that.

Also removing test7 program, because it does the same as test6.

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220926153340.1621984-7-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c
tools/testing/selftests/bpf/progs/get_func_ip_test.c