1. 06 10月, 2021 1 次提交
    • K
      libbpf: Support kernel module function calls · 9dbe6015
      Kumar Kartikeya Dwivedi 提交于
      This patch adds libbpf support for kernel module function call support.
      The fd_array parameter is used during BPF program load to pass module
      BTFs referenced by the program. insn->off is set to index into this
      array, but starts from 1, because insn->off as 0 is reserved for
      btf_vmlinux.
      
      We try to use existing insn->off for a module, since the kernel limits
      the maximum distinct module BTFs for kfuncs to 256, and also because
      index must never exceed the maximum allowed value that can fit in
      insn->off (INT16_MAX). In the future, if kernel interprets signed offset
      as unsigned for kfunc calls, this limit can be increased to UINT16_MAX.
      
      Also introduce a btf__find_by_name_kind_own helper to start searching
      from module BTF's start id when we know that the BTF ID is not present
      in vmlinux BTF (in find_ksym_btf_id).
      Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20211002011757.311265-7-memxor@gmail.com
      9dbe6015
  2. 02 10月, 2021 1 次提交
  3. 30 9月, 2021 1 次提交
  4. 29 9月, 2021 7 次提交
  5. 28 9月, 2021 1 次提交
  6. 22 9月, 2021 3 次提交
  7. 18 9月, 2021 4 次提交
  8. 15 9月, 2021 5 次提交
  9. 08 9月, 2021 1 次提交
  10. 17 8月, 2021 4 次提交
  11. 14 8月, 2021 1 次提交
    • H
      libbpf: Support weak typed ksyms. · 2211c825
      Hao Luo 提交于
      Currently weak typeless ksyms have default value zero, when they don't
      exist in the kernel. However, weak typed ksyms are rejected by libbpf
      if they can not be resolved. This means that if a bpf object contains
      the declaration of a nonexistent weak typed ksym, it will be rejected
      even if there is no program that references the symbol.
      
      Nonexistent weak typed ksyms can also default to zero just like
      typeless ones. This allows programs that access weak typed ksyms to be
      accepted by verifier, if the accesses are guarded. For example,
      
      extern const int bpf_link_fops3 __ksym __weak;
      
      /* then in BPF program */
      
      if (&bpf_link_fops3) {
         /* use bpf_link_fops3 */
      }
      
      If actual use of nonexistent typed ksym is not guarded properly,
      verifier would see that register is not PTR_TO_BTF_ID and wouldn't
      allow to use it for direct memory reads or passing it to BPF helpers.
      Signed-off-by: NHao Luo <haoluo@google.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210812003819.2439037-1-haoluo@google.com
      2211c825
  12. 31 7月, 2021 1 次提交
  13. 30 7月, 2021 3 次提交
  14. 28 7月, 2021 2 次提交
  15. 27 7月, 2021 4 次提交
  16. 24 7月, 2021 1 次提交