diff mbox series

[bpf-next] bpf, x86_64: fix JIT to dump the valid insn

Message ID 20221230113832.22938-1-xiangxia.m.yue@gmail.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series [bpf-next] bpf, x86_64: fix JIT to dump the valid insn | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-5 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-7 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-8 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-29 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-32 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-37 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_maps on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_progs on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-18 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_no_alu32 on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-21 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_progs_no_alu32_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-28 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-30 success Logs for test_progs_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-33 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-34 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-35 success Logs for test_verifier on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-36 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-38 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-26 success Logs for test_progs_no_alu32_parallel on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-31 success Logs for test_progs_parallel on s390x with gcc
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_maps on s390x with gcc
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 14 maintainers not CCed: yoshfuji@linux-ipv6.org mingo@redhat.com trix@redhat.com x86@kernel.org netdev@vger.kernel.org bp@alien8.de davem@davemloft.net llvm@lists.linux.dev tglx@linutronix.de dsahern@kernel.org dave.hansen@linux.intel.com ndesaulniers@google.com nathan@kernel.org hpa@zytor.com
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch warning WARNING: line length of 82 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tonghao Zhang Dec. 30, 2022, 11:38 a.m. UTC
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

With bpf_jit_binary_pack_finalize invoked, we copy
rw_header to header and then image/insn is valid.

Write a test BPF prog which include subprog:

$ llvm-objdump -d subprog.o
Disassembly of section .text:
0000000000000000 <subprog>:
       0:	18 01 00 00 73 75 62 70 00 00 00 00 72 6f 67 00	r1 = 29114459903653235 ll
       2:	7b 1a f8 ff 00 00 00 00	*(u64 *)(r10 - 8) = r1
       3:	bf a1 00 00 00 00 00 00	r1 = r10
       4:	07 01 00 00 f8 ff ff ff	r1 += -8
       5:	b7 02 00 00 08 00 00 00	r2 = 8
       6:	85 00 00 00 06 00 00 00	call 6
       7:	95 00 00 00 00 00 00 00	exit
Disassembly of section raw_tp/sys_enter:
0000000000000000 <entry>:
       0:	85 10 00 00 ff ff ff ff	call -1
       1:	b7 00 00 00 00 00 00 00	r0 = 0
       2:	95 00 00 00 00 00 00 00	exit

Without this patch, kernel print message:
[  580.775387] flen=8 proglen=51 pass=3 image=ffffffffa000c20c from=kprobe-load pid=1643
[  580.777236] JIT code: 00000000: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[  580.779037] JIT code: 00000010: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[  580.780767] JIT code: 00000020: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[  580.782568] JIT code: 00000030: cc cc cc

$ bpf_jit_disasm
51 bytes emitted from JIT compiler (pass:3, flen:8)
ffffffffa000c20c + <x>:
   0:	int3
   1:	int3
   2:	int3
   3:	int3
   4:	int3
   5:	int3
   ...

To fix this issue:
[  260.016071] flen=3 proglen=20 pass=1 image=ffffffffa000c11c from=kprobe-load pid=1568
[  260.018094] JIT code: 00000000: 0f 1f 44 00 00 66 90 55 48 89 e5 e8 38 00 00 00
[  260.020124] JIT code: 00000010: 31 c0 c9 c3
[  260.021229] flen=8 proglen=51 pass=1 image=ffffffffa000c164 from=kprobe-load pid=1568
[  260.023132] JIT code: 00000000: 0f 1f 44 00 00 66 90 55 48 89 e5 48 81 ec 08 00
[  260.025129] JIT code: 00000010: 00 00 48 bf 73 75 62 70 72 6f 67 00 48 89 7d f8
[  260.027199] JIT code: 00000020: 48 89 ef 48 83 c7 f8 be 08 00 00 00 e8 9e 19 1d
[  260.029226] JIT code: 00000030: e1 c9 c3

$ bpf_jit_disasm
51 bytes emitted from JIT compiler (pass:1, flen:8)
ffffffffa000c164 + <x>:
   0:	nopl   0x0(%rax,%rax,1)
   5:	xchg   %ax,%ax
   7:	push   %rbp
   8:	mov    %rsp,%rbp
   b:	sub    $0x8,%rsp
  12:	movabs $0x676f7270627573,%rdi
  1c:	mov    %rdi,-0x8(%rbp)
  20:	mov    %rbp,%rdi
  23:	add    $0xfffffffffffffff8,%rdi
  27:	mov    $0x8,%esi
  2c:	callq  0xffffffffe11d19cf
  31:	leaveq
  32:	retq

$ bpf_jit_disasm
20 bytes emitted from JIT compiler (pass:1, flen:3)
ffffffffa000c11c + <x>:
   0:	nopl   0x0(%rax,%rax,1)
   5:	xchg   %ax,%ax
   7:	push   %rbp
   8:	mov    %rsp,%rbp
   b:	callq  0x0000000000000048
  10:	xor    %eax,%eax
  12:	leaveq
  13:	retq

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Song Liu <song@kernel.org>
Cc: Yonghong Song <yhs@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Stanislav Fomichev <sdf@google.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Hou Tao <houtao1@huawei.com>
---
 arch/x86/net/bpf_jit_comp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Alexei Starovoitov Dec. 30, 2022, 4:56 p.m. UTC | #1
On Fri, Dec 30, 2022 at 3:38 AM <xiangxia.m.yue@gmail.com> wrote:
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> With bpf_jit_binary_pack_finalize invoked, we copy
> rw_header to header and then image/insn is valid.
>
> Write a test BPF prog which include subprog:
>
> $ llvm-objdump -d subprog.o
> Disassembly of section .text:
> 0000000000000000 <subprog>:
>        0:       18 01 00 00 73 75 62 70 00 00 00 00 72 6f 67 00 r1 = 29114459903653235 ll
>        2:       7b 1a f8 ff 00 00 00 00 *(u64 *)(r10 - 8) = r1
>        3:       bf a1 00 00 00 00 00 00 r1 = r10
>        4:       07 01 00 00 f8 ff ff ff r1 += -8
>        5:       b7 02 00 00 08 00 00 00 r2 = 8
>        6:       85 00 00 00 06 00 00 00 call 6
>        7:       95 00 00 00 00 00 00 00 exit
> Disassembly of section raw_tp/sys_enter:
> 0000000000000000 <entry>:
>        0:       85 10 00 00 ff ff ff ff call -1
>        1:       b7 00 00 00 00 00 00 00 r0 = 0
>        2:       95 00 00 00 00 00 00 00 exit
>
> Without this patch, kernel print message:
> [  580.775387] flen=8 proglen=51 pass=3 image=ffffffffa000c20c from=kprobe-load pid=1643
> [  580.777236] JIT code: 00000000: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> [  580.779037] JIT code: 00000010: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> [  580.780767] JIT code: 00000020: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> [  580.782568] JIT code: 00000030: cc cc cc
>
> $ bpf_jit_disasm
> 51 bytes emitted from JIT compiler (pass:3, flen:8)
> ffffffffa000c20c + <x>:
>    0:   int3
>    1:   int3
>    2:   int3
>    3:   int3
>    4:   int3
>    5:   int3
>    ...
>
> To fix this issue:
> [  260.016071] flen=3 proglen=20 pass=1 image=ffffffffa000c11c from=kprobe-load pid=1568
> [  260.018094] JIT code: 00000000: 0f 1f 44 00 00 66 90 55 48 89 e5 e8 38 00 00 00
> [  260.020124] JIT code: 00000010: 31 c0 c9 c3
> [  260.021229] flen=8 proglen=51 pass=1 image=ffffffffa000c164 from=kprobe-load pid=1568
> [  260.023132] JIT code: 00000000: 0f 1f 44 00 00 66 90 55 48 89 e5 48 81 ec 08 00
> [  260.025129] JIT code: 00000010: 00 00 48 bf 73 75 62 70 72 6f 67 00 48 89 7d f8
> [  260.027199] JIT code: 00000020: 48 89 ef 48 83 c7 f8 be 08 00 00 00 e8 9e 19 1d
> [  260.029226] JIT code: 00000030: e1 c9 c3
>
> $ bpf_jit_disasm
> 51 bytes emitted from JIT compiler (pass:1, flen:8)
> ffffffffa000c164 + <x>:
>    0:   nopl   0x0(%rax,%rax,1)
>    5:   xchg   %ax,%ax
>    7:   push   %rbp
>    8:   mov    %rsp,%rbp
>    b:   sub    $0x8,%rsp
>   12:   movabs $0x676f7270627573,%rdi
>   1c:   mov    %rdi,-0x8(%rbp)
>   20:   mov    %rbp,%rdi
>   23:   add    $0xfffffffffffffff8,%rdi
>   27:   mov    $0x8,%esi
>   2c:   callq  0xffffffffe11d19cf
>   31:   leaveq
>   32:   retq
>
> $ bpf_jit_disasm
> 20 bytes emitted from JIT compiler (pass:1, flen:3)
> ffffffffa000c11c + <x>:
>    0:   nopl   0x0(%rax,%rax,1)
>    5:   xchg   %ax,%ax
>    7:   push   %rbp
>    8:   mov    %rsp,%rbp
>    b:   callq  0x0000000000000048
>   10:   xor    %eax,%eax
>   12:   leaveq
>   13:   retq
>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Andrii Nakryiko <andrii@kernel.org>
> Cc: Martin KaFai Lau <martin.lau@linux.dev>
> Cc: Song Liu <song@kernel.org>
> Cc: Yonghong Song <yhs@fb.com>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: KP Singh <kpsingh@kernel.org>
> Cc: Stanislav Fomichev <sdf@google.com>
> Cc: Hao Luo <haoluo@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Hou Tao <houtao1@huawei.com>
> ---
>  arch/x86/net/bpf_jit_comp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
> index 36ffe67ad6e5..4e017102cc16 100644
> --- a/arch/x86/net/bpf_jit_comp.c
> +++ b/arch/x86/net/bpf_jit_comp.c
> @@ -2543,9 +2543,6 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
>                 cond_resched();
>         }
>
> -       if (bpf_jit_enable > 1)
> -               bpf_jit_dump(prog->len, proglen, pass + 1, image);
> -
>         if (image) {
>                 if (!prog->is_func || extra_pass) {
>                         /*
> @@ -2561,6 +2558,9 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
>                                 goto out_image;
>                         }
>
> +                       if (bpf_jit_enable > 1)
> +                               bpf_jit_dump(prog->len, proglen, pass + 1, image);
> +

bpf_jit_enable==2 is broken.
Please delete it from everywhere including docs.
Use bpftool prog dump instead.
Tonghao Zhang Jan. 3, 2023, 2:41 a.m. UTC | #2
On Sat, Dec 31, 2022 at 12:56 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Fri, Dec 30, 2022 at 3:38 AM <xiangxia.m.yue@gmail.com> wrote:
> >
> > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >
> > With bpf_jit_binary_pack_finalize invoked, we copy
> > rw_header to header and then image/insn is valid.
> >
> > Write a test BPF prog which include subprog:
> >
> > $ llvm-objdump -d subprog.o
> > Disassembly of section .text:
> > 0000000000000000 <subprog>:
> >        0:       18 01 00 00 73 75 62 70 00 00 00 00 72 6f 67 00 r1 = 29114459903653235 ll
> >        2:       7b 1a f8 ff 00 00 00 00 *(u64 *)(r10 - 8) = r1
> >        3:       bf a1 00 00 00 00 00 00 r1 = r10
> >        4:       07 01 00 00 f8 ff ff ff r1 += -8
> >        5:       b7 02 00 00 08 00 00 00 r2 = 8
> >        6:       85 00 00 00 06 00 00 00 call 6
> >        7:       95 00 00 00 00 00 00 00 exit
> > Disassembly of section raw_tp/sys_enter:
> > 0000000000000000 <entry>:
> >        0:       85 10 00 00 ff ff ff ff call -1
> >        1:       b7 00 00 00 00 00 00 00 r0 = 0
> >        2:       95 00 00 00 00 00 00 00 exit
> >
> > Without this patch, kernel print message:
> > [  580.775387] flen=8 proglen=51 pass=3 image=ffffffffa000c20c from=kprobe-load pid=1643
> > [  580.777236] JIT code: 00000000: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> > [  580.779037] JIT code: 00000010: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> > [  580.780767] JIT code: 00000020: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> > [  580.782568] JIT code: 00000030: cc cc cc
> >
> > $ bpf_jit_disasm
> > 51 bytes emitted from JIT compiler (pass:3, flen:8)
> > ffffffffa000c20c + <x>:
> >    0:   int3
> >    1:   int3
> >    2:   int3
> >    3:   int3
> >    4:   int3
> >    5:   int3
> >    ...
> >
> > To fix this issue:
> > [  260.016071] flen=3 proglen=20 pass=1 image=ffffffffa000c11c from=kprobe-load pid=1568
> > [  260.018094] JIT code: 00000000: 0f 1f 44 00 00 66 90 55 48 89 e5 e8 38 00 00 00
> > [  260.020124] JIT code: 00000010: 31 c0 c9 c3
> > [  260.021229] flen=8 proglen=51 pass=1 image=ffffffffa000c164 from=kprobe-load pid=1568
> > [  260.023132] JIT code: 00000000: 0f 1f 44 00 00 66 90 55 48 89 e5 48 81 ec 08 00
> > [  260.025129] JIT code: 00000010: 00 00 48 bf 73 75 62 70 72 6f 67 00 48 89 7d f8
> > [  260.027199] JIT code: 00000020: 48 89 ef 48 83 c7 f8 be 08 00 00 00 e8 9e 19 1d
> > [  260.029226] JIT code: 00000030: e1 c9 c3
> >
> > $ bpf_jit_disasm
> > 51 bytes emitted from JIT compiler (pass:1, flen:8)
> > ffffffffa000c164 + <x>:
> >    0:   nopl   0x0(%rax,%rax,1)
> >    5:   xchg   %ax,%ax
> >    7:   push   %rbp
> >    8:   mov    %rsp,%rbp
> >    b:   sub    $0x8,%rsp
> >   12:   movabs $0x676f7270627573,%rdi
> >   1c:   mov    %rdi,-0x8(%rbp)
> >   20:   mov    %rbp,%rdi
> >   23:   add    $0xfffffffffffffff8,%rdi
> >   27:   mov    $0x8,%esi
> >   2c:   callq  0xffffffffe11d19cf
> >   31:   leaveq
> >   32:   retq
> >
> > $ bpf_jit_disasm
> > 20 bytes emitted from JIT compiler (pass:1, flen:3)
> > ffffffffa000c11c + <x>:
> >    0:   nopl   0x0(%rax,%rax,1)
> >    5:   xchg   %ax,%ax
> >    7:   push   %rbp
> >    8:   mov    %rsp,%rbp
> >    b:   callq  0x0000000000000048
> >   10:   xor    %eax,%eax
> >   12:   leaveq
> >   13:   retq
> >
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > Cc: Alexei Starovoitov <ast@kernel.org>
> > Cc: Daniel Borkmann <daniel@iogearbox.net>
> > Cc: Andrii Nakryiko <andrii@kernel.org>
> > Cc: Martin KaFai Lau <martin.lau@linux.dev>
> > Cc: Song Liu <song@kernel.org>
> > Cc: Yonghong Song <yhs@fb.com>
> > Cc: John Fastabend <john.fastabend@gmail.com>
> > Cc: KP Singh <kpsingh@kernel.org>
> > Cc: Stanislav Fomichev <sdf@google.com>
> > Cc: Hao Luo <haoluo@google.com>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Hou Tao <houtao1@huawei.com>
> > ---
> >  arch/x86/net/bpf_jit_comp.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
> > index 36ffe67ad6e5..4e017102cc16 100644
> > --- a/arch/x86/net/bpf_jit_comp.c
> > +++ b/arch/x86/net/bpf_jit_comp.c
> > @@ -2543,9 +2543,6 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
> >                 cond_resched();
> >         }
> >
> > -       if (bpf_jit_enable > 1)
> > -               bpf_jit_dump(prog->len, proglen, pass + 1, image);
> > -
> >         if (image) {
> >                 if (!prog->is_func || extra_pass) {
> >                         /*
> > @@ -2561,6 +2558,9 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
> >                                 goto out_image;
> >                         }
> >
> > +                       if (bpf_jit_enable > 1)
> > +                               bpf_jit_dump(prog->len, proglen, pass + 1, image);
> > +
>
> bpf_jit_enable==2 is broken.
> Please delete it from everywhere including docs.
> Use bpftool prog dump instead.
Thanks, send v2 soon.
diff mbox series

Patch

diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 36ffe67ad6e5..4e017102cc16 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -2543,9 +2543,6 @@  struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 		cond_resched();
 	}
 
-	if (bpf_jit_enable > 1)
-		bpf_jit_dump(prog->len, proglen, pass + 1, image);
-
 	if (image) {
 		if (!prog->is_func || extra_pass) {
 			/*
@@ -2561,6 +2558,9 @@  struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 				goto out_image;
 			}
 
+			if (bpf_jit_enable > 1)
+				bpf_jit_dump(prog->len, proglen, pass + 1, image);
+
 			bpf_tail_call_direct_fixup(prog);
 		} else {
 			jit_data->addrs = addrs;