selftests/bpf: Mark uprobe trigger functions with nocf_check attribute
authorJiri Olsa <jolsa@kernel.org>
Fri, 22 Mar 2024 13:49:36 +0000 (14:49 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 22 Mar 2024 17:01:17 +0000 (10:01 -0700)
commitaf8d27bf15c8d68c60d830552055fcdba5b5f045
tree1cf13aac3cf073e16278b5a97614019bca93123e
parent1684d6eb99e480ff653af60e20ff5e7e55e69ccd
selftests/bpf: Mark uprobe trigger functions with nocf_check attribute

Some distros seem to enable the -fcf-protection=branch by default,
which breaks our setup on first instruction of uprobe trigger
functions and place there endbr64 instruction.

Marking them with nocf_check attribute to skip that.

Ignoring unknown attribute warning in gcc for bench objects, because
nocf_check can be used only when -fcf-protection=branch is enabled,
otherwise we get a warning and break compilation.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240322134936.1075395-1-jolsa@kernel.org
tools/include/linux/compiler.h
tools/testing/selftests/bpf/benchs/bench_trigger.c