All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Andrii Nakryiko <andrii@kernel.org>,
	David Vernet <void@manifault.com>,
	bpf@vger.kernel.org, Martin KaFai Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	 John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Stanislav Fomichev <sdf@google.com>,  Hao Luo <haoluo@google.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>
Subject: Re: [PATCHv4 bpf-next 08/10] selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier
Date: Wed, 17 May 2023 17:27:41 +0300	[thread overview]
Message-ID: <387a14cc12e30d713d388a23bb6d986bb16330ae.camel@gmail.com> (raw)
In-Reply-To: <CAEf4BzaLAZX_xVyRkavFiz+yLR057TuERcmsOc_amtjQCbHVoA@mail.gmail.com>

On Tue, 2023-05-16 at 14:45 -0700, Andrii Nakryiko wrote:
> On Mon, May 15, 2023 at 6:39 AM Jiri Olsa <jolsa@kernel.org> wrote:
> > 
> > Currently the test_verifier allows test to specify kfunc symbol
> > and search for it in the kernel BTF.
> > 
> > Adding the possibility to search for kfunc also in bpf_testmod
> > module when it's not found in kernel BTF.
> > 
> > To find bpf_testmod btf we need to get back SYS_ADMIN cap.
> > 
> > Acked-by: David Vernet <void@manifault.com>
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/testing/selftests/bpf/test_verifier.c | 161 +++++++++++++++++---
> >  1 file changed, 139 insertions(+), 22 deletions(-)
> > 
> 
> Eduard is working on migrating most (if not all) test_verifier tests
> into test_progs where we can use libbpf declarative functionality for
> things like this.
> 
> Eduard, can you please review this part? Would it make sense to just
> wait for the migration? If not, will there be anything involved to
> support something like this for the future migration?

Hi Andrii,

I'm not working on migrating remaining test_verifier tests
to test_progs/inline assembly at the moment.

Regarding this specific change, as far as I understand it is
necessary for the following tests:
- verifier/calls.c
- verifier/map_kptr.c
Both files can't be migrated at the moment.
I spent some time today debugging, but the reasons are
obscure and require further investigation.

As to this particular patch itself, I tested it locally and
it seems to work fine. None of the changes prohibit future
migration to inline assembly, should such migration happen.

Thanks,
Eduard

> 
> 
> > diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
> > index 285ea4aba194..71704a38cac3 100644
> > --- a/tools/testing/selftests/bpf/test_verifier.c
> > +++ b/tools/testing/selftests/bpf/test_verifier.c
> > @@ -874,8 +874,140 @@ static int create_map_kptr(void)
> >         return fd;
> >  }
> > 
> 
> [...]


  parent reply	other threads:[~2023-05-17 14:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 13:37 [PATCHv4 bpf-next 00/10] bpf: Move kernel test kfuncs into bpf_testmod Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 01/10] libbpf: Store zero fd to fd_array for loader kfunc relocation Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 02/10] selftests/bpf: Move kfunc exports to bpf_testmod/bpf_testmod_kfunc.h Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 03/10] selftests/bpf: Move test_progs helpers to testing_helpers object Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 04/10] selftests/bpf: Use only stdout in un/load_bpf_testmod functions Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 05/10] selftests/bpf: Do not unload bpf_testmod in load_bpf_testmod Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 06/10] selftests/bpf: Use un/load_bpf_testmod functions in tests Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 07/10] selftests/bpf: Load bpf_testmod for verifier test Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 08/10] selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier Jiri Olsa
2023-05-16 21:45   ` Andrii Nakryiko
2023-05-17  5:17     ` Alexei Starovoitov
2023-05-17 14:27     ` Eduard Zingerman [this message]
2023-05-17 16:51       ` Andrii Nakryiko
2023-05-15 13:37 ` [PATCHv4 bpf-next 09/10] selftests/bpf: Remove extern from kfuncs declarations Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 10/10] bpf: Move kernel test kfuncs to bpf_testmod Jiri Olsa
2023-05-16  2:22   ` David Vernet
2023-05-17  5:20 ` [PATCHv4 bpf-next 00/10] bpf: Move kernel test kfuncs into bpf_testmod patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=387a14cc12e30d713d388a23bb6d986bb16330ae.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=memxor@gmail.com \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=void@manifault.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.