public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] selftests/bpf: Fix kprobe_multi_test/attach_override test
@ 2023-09-12 14:14 Jiri Olsa
  2023-09-12 14:57 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Olsa @ 2023-09-12 14:14 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo

We need to deny the attach_override test for arm64
and make it static.

Fixes: 7182e56411b9 ("selftests/bpf: Add kprobe_multi override test")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/testing/selftests/bpf/DENYLIST.aarch64               | 1 +
 tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64
index 7f768d335698..b32f962dee92 100644
--- a/tools/testing/selftests/bpf/DENYLIST.aarch64
+++ b/tools/testing/selftests/bpf/DENYLIST.aarch64
@@ -9,6 +9,7 @@ kprobe_multi_test/bench_attach                   # bpf_program__attach_kprobe_mu
 kprobe_multi_test/link_api_addrs                 # link_fd unexpected link_fd: actual -95 < expected 0
 kprobe_multi_test/link_api_syms                  # link_fd unexpected link_fd: actual -95 < expected 0
 kprobe_multi_test/skel_api                       # libbpf: failed to load BPF skeleton 'kprobe_multi': -3
+kprobe_multi_test/attach_override                # test_attach_override:FAIL:kprobe_multi_empty__open_and_load unexpected error: -22
 module_attach                                    # prog 'kprobe_multi': failed to auto-attach: -95
 fentry_test/fentry_many_args                     # fentry_many_args:FAIL:fentry_many_args_attach unexpected error: -524
 fexit_test/fexit_many_args                       # fexit_many_args:FAIL:fexit_many_args_attach unexpected error: -524
diff --git a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
index e05477b210a5..4041cfa670eb 100644
--- a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
+++ b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
@@ -454,7 +454,7 @@ static void test_kprobe_multi_bench_attach(bool kernel)
 	}
 }
 
-void test_attach_override(void)
+static void test_attach_override(void)
 {
 	struct kprobe_multi_override *skel = NULL;
 	struct bpf_link *link = NULL;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Fix kprobe_multi_test/attach_override test
  2023-09-12 14:14 [PATCH bpf] selftests/bpf: Fix kprobe_multi_test/attach_override test Jiri Olsa
@ 2023-09-12 14:57 ` Alexei Starovoitov
  2023-09-12 16:17   ` Andrii Nakryiko
  2023-09-12 17:45   ` Jiri Olsa
  0 siblings, 2 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2023-09-12 14:57 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo

On Tue, Sep 12, 2023 at 7:14 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> We need to deny the attach_override test for arm64
> and make it static.
>
> Fixes: 7182e56411b9 ("selftests/bpf: Add kprobe_multi override test")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/testing/selftests/bpf/DENYLIST.aarch64               | 1 +
>  tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64
> index 7f768d335698..b32f962dee92 100644
> --- a/tools/testing/selftests/bpf/DENYLIST.aarch64
> +++ b/tools/testing/selftests/bpf/DENYLIST.aarch64
> @@ -9,6 +9,7 @@ kprobe_multi_test/bench_attach                   # bpf_program__attach_kprobe_mu
>  kprobe_multi_test/link_api_addrs                 # link_fd unexpected link_fd: actual -95 < expected 0
>  kprobe_multi_test/link_api_syms                  # link_fd unexpected link_fd: actual -95 < expected 0
>  kprobe_multi_test/skel_api                       # libbpf: failed to load BPF skeleton 'kprobe_multi': -3
> +kprobe_multi_test/attach_override                # test_attach_override:FAIL:kprobe_multi_empty__open_and_load unexpected error: -22

why do we need this ?
Andrii, move of kconfig override into common should fix it, no?

>  module_attach                                    # prog 'kprobe_multi': failed to auto-attach: -95
>  fentry_test/fentry_many_args                     # fentry_many_args:FAIL:fentry_many_args_attach unexpected error: -524
>  fexit_test/fexit_many_args                       # fexit_many_args:FAIL:fexit_many_args_attach unexpected error: -524
> diff --git a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> index e05477b210a5..4041cfa670eb 100644
> --- a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> +++ b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> @@ -454,7 +454,7 @@ static void test_kprobe_multi_bench_attach(bool kernel)
>         }
>  }
>
> -void test_attach_override(void)
> +static void test_attach_override(void)
>  {
>         struct kprobe_multi_override *skel = NULL;
>         struct bpf_link *link = NULL;
> --
> 2.41.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Fix kprobe_multi_test/attach_override test
  2023-09-12 14:57 ` Alexei Starovoitov
@ 2023-09-12 16:17   ` Andrii Nakryiko
  2023-09-12 17:45   ` Jiri Olsa
  1 sibling, 0 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2023-09-12 16:17 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo

On Tue, Sep 12, 2023 at 7:57 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Tue, Sep 12, 2023 at 7:14 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > We need to deny the attach_override test for arm64
> > and make it static.
> >
> > Fixes: 7182e56411b9 ("selftests/bpf: Add kprobe_multi override test")
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/testing/selftests/bpf/DENYLIST.aarch64               | 1 +
> >  tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64
> > index 7f768d335698..b32f962dee92 100644
> > --- a/tools/testing/selftests/bpf/DENYLIST.aarch64
> > +++ b/tools/testing/selftests/bpf/DENYLIST.aarch64
> > @@ -9,6 +9,7 @@ kprobe_multi_test/bench_attach                   # bpf_program__attach_kprobe_mu
> >  kprobe_multi_test/link_api_addrs                 # link_fd unexpected link_fd: actual -95 < expected 0
> >  kprobe_multi_test/link_api_syms                  # link_fd unexpected link_fd: actual -95 < expected 0
> >  kprobe_multi_test/skel_api                       # libbpf: failed to load BPF skeleton 'kprobe_multi': -3
> > +kprobe_multi_test/attach_override                # test_attach_override:FAIL:kprobe_multi_empty__open_and_load unexpected error: -22
>
> why do we need this ?
> Andrii, move of kconfig override into common should fix it, no?

So my patch did indeed enable BPF_KPROBE_OVERRIDE=y on aarch64, but we
are now encountering "not supported" error somewhere:

test_attach_override:PASS:kprobe_multi_empty__open_and_load 0 nsec
libbpf: prog 'test_override': failed to attach: Operation not supported
test_attach_override:PASS:override_attached_bpf_fentry_test1 0 nsec
libbpf: prog 'test_override': failed to attach: Operation not supported
test_attach_override:FAIL:override_attached_should_fail_bio unexpected
error: -95

retsnoop should be able to point out where this is coming from, but
unfortunately I don't have aarch64 setup that allows me to run VMs (at
least not yet). So if Jiri has access to arm64 machine, please take a
look meanwhile.

We need to understand if bpf_override_return() never worked, or Jiri's
change with addrs_check_error_injection_list added breaks something.
And then act accordingly (either denylist the test, or fix the bug).

>
> >  module_attach                                    # prog 'kprobe_multi': failed to auto-attach: -95
> >  fentry_test/fentry_many_args                     # fentry_many_args:FAIL:fentry_many_args_attach unexpected error: -524
> >  fexit_test/fexit_many_args                       # fexit_many_args:FAIL:fexit_many_args_attach unexpected error: -524
> > diff --git a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> > index e05477b210a5..4041cfa670eb 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> > @@ -454,7 +454,7 @@ static void test_kprobe_multi_bench_attach(bool kernel)
> >         }
> >  }
> >
> > -void test_attach_override(void)
> > +static void test_attach_override(void)
> >  {
> >         struct kprobe_multi_override *skel = NULL;
> >         struct bpf_link *link = NULL;
> > --
> > 2.41.0
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Fix kprobe_multi_test/attach_override test
  2023-09-12 14:57 ` Alexei Starovoitov
  2023-09-12 16:17   ` Andrii Nakryiko
@ 2023-09-12 17:45   ` Jiri Olsa
  1 sibling, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2023-09-12 17:45 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo

On Tue, Sep 12, 2023 at 07:57:40AM -0700, Alexei Starovoitov wrote:
> On Tue, Sep 12, 2023 at 7:14 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > We need to deny the attach_override test for arm64
> > and make it static.
> >
> > Fixes: 7182e56411b9 ("selftests/bpf: Add kprobe_multi override test")
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/testing/selftests/bpf/DENYLIST.aarch64               | 1 +
> >  tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64
> > index 7f768d335698..b32f962dee92 100644
> > --- a/tools/testing/selftests/bpf/DENYLIST.aarch64
> > +++ b/tools/testing/selftests/bpf/DENYLIST.aarch64
> > @@ -9,6 +9,7 @@ kprobe_multi_test/bench_attach                   # bpf_program__attach_kprobe_mu
> >  kprobe_multi_test/link_api_addrs                 # link_fd unexpected link_fd: actual -95 < expected 0
> >  kprobe_multi_test/link_api_syms                  # link_fd unexpected link_fd: actual -95 < expected 0
> >  kprobe_multi_test/skel_api                       # libbpf: failed to load BPF skeleton 'kprobe_multi': -3
> > +kprobe_multi_test/attach_override                # test_attach_override:FAIL:kprobe_multi_empty__open_and_load unexpected error: -22
> 
> why do we need this ?
> Andrii, move of kconfig override into common should fix it, no?

the test creates kprobe_multi link, so it needs fprobe,
which is still not enabled in arm

but I miread the error.. there's some other issue with
override helper on arm

also the missing static fix is needed

jirka

> 
> >  module_attach                                    # prog 'kprobe_multi': failed to auto-attach: -95
> >  fentry_test/fentry_many_args                     # fentry_many_args:FAIL:fentry_many_args_attach unexpected error: -524
> >  fexit_test/fexit_many_args                       # fexit_many_args:FAIL:fexit_many_args_attach unexpected error: -524
> > diff --git a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> > index e05477b210a5..4041cfa670eb 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
> > @@ -454,7 +454,7 @@ static void test_kprobe_multi_bench_attach(bool kernel)
> >         }
> >  }
> >
> > -void test_attach_override(void)
> > +static void test_attach_override(void)
> >  {
> >         struct kprobe_multi_override *skel = NULL;
> >         struct bpf_link *link = NULL;
> > --
> > 2.41.0
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-12 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12 14:14 [PATCH bpf] selftests/bpf: Fix kprobe_multi_test/attach_override test Jiri Olsa
2023-09-12 14:57 ` Alexei Starovoitov
2023-09-12 16:17   ` Andrii Nakryiko
2023-09-12 17:45   ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox