summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/exceptions.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/exceptions.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/exceptions.c b/tools/testing/selftests/bpf/prog_tests/exceptions.c
index 516f4a13013c..639866ce09a9 100644
--- a/tools/testing/selftests/bpf/prog_tests/exceptions.c
+++ b/tools/testing/selftests/bpf/prog_tests/exceptions.c
@@ -55,6 +55,7 @@ static void test_exceptions_success(void)
RUN_SUCCESS(exception_ext, 0);
RUN_SUCCESS(exception_ext_mod_cb_runtime, 35);
RUN_SUCCESS(exception_throw_subprog, 1);
+ RUN_SUCCESS(exception_throw_subprog_stack_cb, 0x1234);
RUN_SUCCESS(exception_assert_nz_gfunc, 1);
RUN_SUCCESS(exception_assert_zero_gfunc, 1);
RUN_SUCCESS(exception_assert_neg_gfunc, 1);
@@ -83,6 +84,14 @@ static void test_exceptions_success(void)
RUN_SUCCESS(exception_assert_range_with, 1);
RUN_SUCCESS(exception_bad_assert_range, 0);
RUN_SUCCESS(exception_bad_assert_range_with, 10);
+ RUN_SUCCESS(exception_throw_from_void_global, 11);
+
+ if (skel->rodata->has_stack_arg) {
+ RUN_SUCCESS(exception_throw_stack_arg, 56);
+ RUN_SUCCESS(exception_throw_after_stack_arg, 56);
+ RUN_SUCCESS(exception_throw_subprog_stack_arg, 56);
+ RUN_SUCCESS(exception_throw_subprog_after_stack_arg, 56);
+ }
#define RUN_EXT(load_ret, attach_err, expr, msg, after_link) \
{ \
@@ -127,7 +136,7 @@ static void test_exceptions_success(void)
bpf_program__fd(skel->progs.exception_ext_mod_cb_runtime),
"exception_cb_mod"), "set_attach_target"))
goto done;
- }), "FENTRY/FEXIT programs cannot attach to exception callback", 0);
+ }), "Tracing programs cannot attach to exception callback", 0);
if (test__start_subtest("throwing fentry -> exception_cb"))
RUN_EXT(-EINVAL, true, ({
@@ -137,7 +146,7 @@ static void test_exceptions_success(void)
bpf_program__fd(skel->progs.exception_ext_mod_cb_runtime),
"exception_cb_mod"), "set_attach_target"))
goto done;
- }), "FENTRY/FEXIT programs cannot attach to exception callback", 0);
+ }), "Tracing programs cannot attach to exception callback", 0);
if (test__start_subtest("non-throwing fexit -> exception_cb"))
RUN_EXT(-EINVAL, true, ({
@@ -147,7 +156,7 @@ static void test_exceptions_success(void)
bpf_program__fd(skel->progs.exception_ext_mod_cb_runtime),
"exception_cb_mod"), "set_attach_target"))
goto done;
- }), "FENTRY/FEXIT programs cannot attach to exception callback", 0);
+ }), "Tracing programs cannot attach to exception callback", 0);
if (test__start_subtest("throwing fexit -> exception_cb"))
RUN_EXT(-EINVAL, true, ({
@@ -157,7 +166,7 @@ static void test_exceptions_success(void)
bpf_program__fd(skel->progs.exception_ext_mod_cb_runtime),
"exception_cb_mod"), "set_attach_target"))
goto done;
- }), "FENTRY/FEXIT programs cannot attach to exception callback", 0);
+ }), "Tracing programs cannot attach to exception callback", 0);
if (test__start_subtest("throwing extension (with custom cb) -> exception_cb"))
RUN_EXT(-EINVAL, true, ({