Re: [PATCHv4 bpf-next 08/10] selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2023-05-16 at 14:45 -0700, Andrii Nakryiko wrote:
> On Mon, May 15, 2023 at 6:39 AM Jiri Olsa <jolsa@xxxxxxxxxx> 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@xxxxxxxxxxxxx>
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > ---
> >  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;
> >  }
> > 
> 
> [...]






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux