Re: 32-bit zext JIT efficiency (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-05-03 Thread Jiong Wang
Jiong Wang writes: >> > if you can craft a test that shows patch_insn issue before your set, >> > then it's ok to hack bpf_fill_scale1 to use alu64. >> >> As described above, does the test_verifier 732 + jit blinding looks >> convincing? >> >> > I would also prefer to go with option 2 (new zext

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-05-01 Thread Jiong Wang
> > if you can craft a test that shows patch_insn issue before your set, > > then it's ok to hack bpf_fill_scale1 to use alu64. > > As described above, does the test_verifier 732 + jit blinding looks > convincing? > > > I would also prefer to go with option 2 (new zext insn) for JITs. > > Got it.

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-29 Thread Edward Cree
On 27/04/2019 04:11, Alexei Starovoitov wrote: > instead of converting all insns into lists of 1 before all patching > it can be done on demand: > convert from insn to list only when patching is needed. Makes sense. > Patched insn becomes a pointer to a block of new insns. > We have reserved opcode

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-28 Thread Jiong Wang
> On 27 Apr 2019, at 04:05, Alexei Starovoitov > wrote: > > On Fri, Apr 26, 2019 at 02:06:33PM +0100, Jiong Wang wrote: >> >>> Note that bpf_patch_insn_single() is calling bpf_adj_branches() twice too. >>> And dead_code + convert_ctx + fixup_bpf_calls are calling >>> bpf_patch_insn_single(

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-26 Thread Alexei Starovoitov
On Fri, Apr 26, 2019 at 03:50:33PM +0100, Edward Cree wrote: > On 26/04/2019 14:06, Jiong Wang wrote: > > Alexei Starovoitov writes: > >> Note that bpf_patch_insn_single() is calling bpf_adj_branches() twice too. > >> And dead_code + convert_ctx + fixup_bpf_calls are calling > >> bpf_patch_insn_sin

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-26 Thread Alexei Starovoitov
On Fri, Apr 26, 2019 at 02:06:33PM +0100, Jiong Wang wrote: > > Alexei Starovoitov writes: > > > On Thu, Apr 25, 2019 at 08:25:44AM +0100, Jiong Wang wrote: > >> > >> Alexei Starovoitov writes: > >> > >> > On Thu, Apr 25, 2019 at 12:07:06AM +0100, Jiong Wang wrote: > >> >> > >> >> Alexei Staro

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-26 Thread Edward Cree
On 26/04/2019 14:06, Jiong Wang wrote: > Alexei Starovoitov writes: >> Note that bpf_patch_insn_single() is calling bpf_adj_branches() twice too. >> And dead_code + convert_ctx + fixup_bpf_calls are calling >> bpf_patch_insn_single() a lot. >> How about before dead_code pass we convert the program

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-26 Thread Jiong Wang
Alexei Starovoitov writes: > On Thu, Apr 25, 2019 at 08:25:44AM +0100, Jiong Wang wrote: >> >> Alexei Starovoitov writes: >> >> > On Thu, Apr 25, 2019 at 12:07:06AM +0100, Jiong Wang wrote: >> >> >> >> Alexei Starovoitov writes: >> >> >> >> > Add two tests to check that sequence of 1024 jump

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-25 Thread Alexei Starovoitov
On Thu, Apr 25, 2019 at 08:25:44AM +0100, Jiong Wang wrote: > > Alexei Starovoitov writes: > > > On Thu, Apr 25, 2019 at 12:07:06AM +0100, Jiong Wang wrote: > >> > >> Alexei Starovoitov writes: > >> > >> > Add two tests to check that sequence of 1024 jumps is verifiable. > >> > > >> > Signed-of

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-25 Thread Jiong Wang
> On 25 Apr 2019, at 08:25, Jiong Wang wrote: > > > Alexei Starovoitov writes: > >> On Thu, Apr 25, 2019 at 12:07:06AM +0100, Jiong Wang wrote: >>> >>> Alexei Starovoitov writes: >>> Add two tests to check that sequence of 1024 jumps is verifiable. Signed-off-by: Alexei Star

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-25 Thread Jiong Wang
Alexei Starovoitov writes: > On Thu, Apr 25, 2019 at 12:07:06AM +0100, Jiong Wang wrote: >> >> Alexei Starovoitov writes: >> >> > Add two tests to check that sequence of 1024 jumps is verifiable. >> > >> > Signed-off-by: Alexei Starovoitov >> > --- >> > tools/testing/selftests/bpf/test_verif

Re: 32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-24 Thread Alexei Starovoitov
On Thu, Apr 25, 2019 at 12:07:06AM +0100, Jiong Wang wrote: > > Alexei Starovoitov writes: > > > Add two tests to check that sequence of 1024 jumps is verifiable. > > > > Signed-off-by: Alexei Starovoitov > > --- > > tools/testing/selftests/bpf/test_verifier.c | 70 > > to

32-bit zext time complexity (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-04-24 Thread Jiong Wang
Alexei Starovoitov writes: > Add two tests to check that sequence of 1024 jumps is verifiable. > > Signed-off-by: Alexei Starovoitov > --- > tools/testing/selftests/bpf/test_verifier.c | 70 > tools/testing/selftests/bpf/verifier/scale.c | 18 + I am rebasing 32-bit o

Re: [PATCH bpf-next] selftests/bpf: two scale tests

2019-04-16 Thread Daniel Borkmann
On 04/12/2019 11:41 PM, Alexei Starovoitov wrote: > Add two tests to check that sequence of 1024 jumps is verifiable. > > Signed-off-by: Alexei Starovoitov Applied, thanks!

Re: [PATCH bpf-next] selftests/bpf: two scale tests

2019-04-14 Thread Song Liu
On Fri, Apr 12, 2019 at 4:32 PM Alexei Starovoitov wrote: > > On Fri, Apr 12, 2019 at 04:24:51PM -0700, Song Liu wrote: > > On Fri, Apr 12, 2019 at 2:41 PM Alexei Starovoitov wrote: > > > > > > Add two tests to check that sequence of 1024 jumps is verifiable. > > > > > > Signed-off-by: Alexei Sta

Re: [PATCH bpf-next] selftests/bpf: two scale tests

2019-04-12 Thread Alexei Starovoitov
On Fri, Apr 12, 2019 at 04:24:51PM -0700, Song Liu wrote: > On Fri, Apr 12, 2019 at 2:41 PM Alexei Starovoitov wrote: > > > > Add two tests to check that sequence of 1024 jumps is verifiable. > > > > Signed-off-by: Alexei Starovoitov > > Acked-by: Song Liu > > Shall we add a test that go beyon

Re: [PATCH bpf-next] selftests/bpf: two scale tests

2019-04-12 Thread Song Liu
On Fri, Apr 12, 2019 at 2:41 PM Alexei Starovoitov wrote: > > Add two tests to check that sequence of 1024 jumps is verifiable. > > Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Shall we add a test that go beyond the 1M limit? > --- > tools/testing/selftests/bpf/test_verifier.c | 70

[PATCH bpf-next] selftests/bpf: two scale tests

2019-04-12 Thread Alexei Starovoitov
Add two tests to check that sequence of 1024 jumps is verifiable. Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/test_verifier.c | 70 tools/testing/selftests/bpf/verifier/scale.c | 18 + 2 files changed, 88 insertions(+) create mode 100644 tools/tes