Message ID | 20200929235049.2533242-1-haoluo@google.com |
---|---|
Headers | show |
Series | bpf: BTF support for ksyms | expand |
Ah, this is the bug in pahole described in https://lkml.org/lkml/2020/8/20/1862. I proposed a fix [1] but it hasn't reached pahole's master branch. Let me ask Arnaldo to see if he is OK merging it. [1] https://www.spinics.net/lists/dwarves/msg00451.html On Tue, Sep 29, 2020 at 9:36 PM Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote: > > On Tue, Sep 29, 2020 at 4:50 PM Hao Luo <haoluo@google.com> wrote: > > > > v3 -> v4: > > - Rebasing > > - Cast bpf_[per|this]_cpu_ptr's parameter to void __percpu * before > > passing into per_cpu_ptr. > > Looks good, but doesn't work: > ./test_progs -t ksyms_btf > test_ksyms_btf:PASS:kallsyms_fopen 0 nsec > test_ksyms_btf:PASS:ksym_find 0 nsec > test_ksyms_btf:PASS:kallsyms_fopen 0 nsec > test_ksyms_btf:PASS:ksym_find 0 nsec > test_ksyms_btf:PASS:btf_exists 0 nsec > libbpf: extern (ksym) 'bpf_prog_active': incompatible types, expected > [4] int int, but kernel has [18729] var bpf_user_rnd_state > libbpf: failed to load object 'test_ksyms_btf' > libbpf: failed to load BPF skeleton 'test_ksyms_btf': -22 > test_ksyms_btf:FAIL:skel_open failed to open and load skeleton > #43 ksyms_btf:FAIL > > I have the latest pahole from master. Any ideas?
On Tue, Sep 29, 2020 at 11:48 PM Hao Luo <haoluo@google.com> wrote: > > Ah, this is the bug in pahole described in > https://lkml.org/lkml/2020/8/20/1862. I proposed a fix [1] but it > hasn't reached pahole's master branch. Let me ask Arnaldo to see if he > is OK merging it. > > [1] https://www.spinics.net/lists/dwarves/msg00451.html > > On Tue, Sep 29, 2020 at 9:36 PM Alexei Starovoitov > <alexei.starovoitov@gmail.com> wrote: > > > > On Tue, Sep 29, 2020 at 4:50 PM Hao Luo <haoluo@google.com> wrote: > > > > > > v3 -> v4: > > > - Rebasing > > > - Cast bpf_[per|this]_cpu_ptr's parameter to void __percpu * before > > > passing into per_cpu_ptr. I've rebased it myself and applied. Thanks Hao.
Thanks, Alexei and Andrii and other reviewers for the comments. It's a pleasure to work with you and contribute to bpf. Hao On Fri, Oct 2, 2020 at 3:16 PM Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote: > > On Tue, Sep 29, 2020 at 11:48 PM Hao Luo <haoluo@google.com> wrote: > > > > Ah, this is the bug in pahole described in > > https://lkml.org/lkml/2020/8/20/1862. I proposed a fix [1] but it > > hasn't reached pahole's master branch. Let me ask Arnaldo to see if he > > is OK merging it. > > > > [1] https://www.spinics.net/lists/dwarves/msg00451.html > > > > On Tue, Sep 29, 2020 at 9:36 PM Alexei Starovoitov > > <alexei.starovoitov@gmail.com> wrote: > > > > > > On Tue, Sep 29, 2020 at 4:50 PM Hao Luo <haoluo@google.com> wrote: > > > > > > > > v3 -> v4: > > > > - Rebasing > > > > - Cast bpf_[per|this]_cpu_ptr's parameter to void __percpu * before > > > > passing into per_cpu_ptr. > > I've rebased it myself and applied. Thanks Hao.
On Tue, Sep 29, 2020 at 4:50 PM Hao Luo <haoluo@google.com> wrote: > > - ret = replace_map_fd_with_map_ptr(env); > - if (ret < 0) > - goto skip_full_check; > - > if (bpf_prog_is_dev_bound(env->prog->aux)) { > ret = bpf_prog_offload_verifier_prep(env->prog); > if (ret) > @@ -11662,6 +11757,10 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, > if (ret) > goto skip_full_check; > > + ret = resolve_pseudo_ldimm64(env); > + if (ret < 0) > + goto skip_full_check; > + Hao, this change broke several tests in test_verifier: #21/u empty prog FAIL Unexpected error message! EXP: unknown opcode 00 RES: last insn is not an exit or jmp #656/u test5 ld_imm64 FAIL Unexpected error message! EXP: invalid bpf_ld_imm64 insn RES: last insn is not an exit or jmp #656/p test5 ld_imm64 FAIL Unexpected error message! EXP: invalid bpf_ld_imm64 insn RES: last insn is not an exit or jmp Please send a fix. Thanks