]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Remove struct bpf_verifier_env argument from print_bpf_insn
authorJiri Olsa <jolsa@kernel.org>
Fri, 23 Mar 2018 10:41:28 +0000 (11:41 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 23 Mar 2018 16:38:57 +0000 (17:38 +0100)
commitae9fbe7b36d8908e03a45334db7d6ae0bf647f20
tree1fde4260003a96f264a8daaac78df085958af838
parente9e8c02d4dbd1aa782c8e93b1c875a30a4ed3607
bpf: Remove struct bpf_verifier_env argument from print_bpf_insn

We use print_bpf_insn in user space (bpftool and soon perf),
so it'd be nice to keep it generic and strip it off the kernel
struct bpf_verifier_env argument.

This argument can be safely removed, because its users can
use the struct bpf_insn_cbs::private_data to pass it.

By changing the argument type  we can no longer have clean
'verbose' alias to 'bpf_verifier_log_write' in verifier.c.
Instead  we're adding the  'verbose' cb_print callback and
removing the alias.

This way we have new cb_print callback in place, and all
the 'verbose(env, ...) calls in verifier.c will cleanly
cast to 'verbose(void *, ...)' so no other change is
needed.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/disasm.c
kernel/bpf/disasm.h
kernel/bpf/verifier.c