Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-28 Thread Jiri Olsa
On Sun, Jun 28, 2020 at 01:59:54PM -0700, Yonghong Song wrote: SNIP > > > > > > The corresponding BTF_ID definition here is: > > >BTF_ID_LIST(bpf_skb_output_btf_ids) > > >BTF_ID(struct, sk_buff) > > > > > > The bpf helper writer needs to ensure proper declarations > > > of BTF_IDs like

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-28 Thread Yonghong Song
On 6/28/20 1:16 PM, Jiri Olsa wrote: On Fri, Jun 26, 2020 at 02:36:37PM -0700, Yonghong Song wrote: SNIP - } - - t = btf_type_by_id(btf_vmlinux, t->type); - if (!btf_type_is_ptr(t)) - return -EFAULT; - t = btf_type_by_id(btf_vmlinux, t->type); - i

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-28 Thread Jiri Olsa
On Fri, Jun 26, 2020 at 02:36:37PM -0700, Yonghong Song wrote: SNIP > > - } > > - > > - t = btf_type_by_id(btf_vmlinux, t->type); > > - if (!btf_type_is_ptr(t)) > > - return -EFAULT; > > - t = btf_type_by_id(btf_vmlinux, t->type); > > - if (!btf_type_is_func_proto(t)) > > -

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-28 Thread Andrii Nakryiko
On Sun, Jun 28, 2020 at 11:50 AM Alexei Starovoitov wrote: > > On Fri, Jun 26, 2020 at 04:29:23PM -0700, Yonghong Song wrote: > > > > > > > > > > -int btf_resolve_helper_id(struct bpf_verifier_log *log, > > > > > - const struct bpf_func_proto *fn, int arg) > > > > > -{ > > >

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-28 Thread Alexei Starovoitov
On Fri, Jun 26, 2020 at 04:29:23PM -0700, Yonghong Song wrote: > > > > > > > > -int btf_resolve_helper_id(struct bpf_verifier_log *log, > > > > - const struct bpf_func_proto *fn, int arg) > > > > -{ > > > > - int *btf_id = &fn->btf_id[arg]; > > > > - int ret; > > > >

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-26 Thread Yonghong Song
On 6/26/20 2:40 PM, Andrii Nakryiko wrote: On Fri, Jun 26, 2020 at 2:37 PM Yonghong Song wrote: On 6/25/20 3:12 PM, Jiri Olsa wrote: Now when we moved the helpers btf_id arrays into .BTF_ids section, we can remove the code that resolve those IDs in runtime. Signed-off-by: Jiri Olsa ---

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-26 Thread Andrii Nakryiko
On Fri, Jun 26, 2020 at 2:37 PM Yonghong Song wrote: > > > > On 6/25/20 3:12 PM, Jiri Olsa wrote: > > Now when we moved the helpers btf_id arrays into .BTF_ids section, > > we can remove the code that resolve those IDs in runtime. > > > > Signed-off-by: Jiri Olsa > > --- > > kernel/bpf/btf.c |

Re: [PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-26 Thread Yonghong Song
On 6/25/20 3:12 PM, Jiri Olsa wrote: Now when we moved the helpers btf_id arrays into .BTF_ids section, we can remove the code that resolve those IDs in runtime. Signed-off-by: Jiri Olsa --- kernel/bpf/btf.c | 90 +--- 1 file changed, 8 insertio

[PATCH v4 bpf-next 05/14] bpf: Remove btf_id helpers resolving

2020-06-25 Thread Jiri Olsa
Now when we moved the helpers btf_id arrays into .BTF_ids section, we can remove the code that resolve those IDs in runtime. Signed-off-by: Jiri Olsa --- kernel/bpf/btf.c | 90 +--- 1 file changed, 8 insertions(+), 82 deletions(-) diff --git a/kernel/