1. 18 9月, 2021 5 次提交
  2. 16 9月, 2021 1 次提交
  3. 15 9月, 2021 6 次提交
  4. 14 9月, 2021 1 次提交
    • A
      libbpf: Make libbpf_version.h non-auto-generated · 2f383041
      Andrii Nakryiko 提交于
      Turn previously auto-generated libbpf_version.h header into a normal
      header file. This prevents various tricky Makefile integration issues,
      simplifies the overall build process, but also allows to further extend
      it with some more versioning-related APIs in the future.
      
      To prevent accidental out-of-sync versions as defined by libbpf.map and
      libbpf_version.h, Makefile checks their consistency at build time.
      
      Simultaneously with this change bump libbpf.map to v0.6.
      
      Also undo adding libbpf's output directory into include path for
      kernel/bpf/preload, bpftool, and resolve_btfids, which is not necessary
      because libbpf_version.h is just a normal header like any other.
      
      Fixes: 0b46b755 ("libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations")
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20210913222309.3220849-1-andrii@kernel.org
      2f383041
  5. 10 9月, 2021 1 次提交
    • Q
      libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations · 0b46b755
      Quentin Monnet 提交于
      Introduce a macro LIBBPF_DEPRECATED_SINCE(major, minor, message) to prepare
      the deprecation of two API functions. This macro marks functions as deprecated
      when libbpf's version reaches the values passed as an argument.
      
      As part of this change libbpf_version.h header is added with recorded major
      (LIBBPF_MAJOR_VERSION) and minor (LIBBPF_MINOR_VERSION) libbpf version macros.
      They are now part of libbpf public API and can be relied upon by user code.
      libbpf_version.h is installed system-wide along other libbpf public headers.
      
      Due to this new build-time auto-generated header, in-kernel applications
      relying on libbpf (resolve_btfids, bpftool, bpf_preload) are updated to
      include libbpf's output directory as part of a list of include search paths.
      Better fix would be to use libbpf's make_install target to install public API
      headers, but that clean up is left out as a future improvement. The build
      changes were tested by building kernel (with KBUILD_OUTPUT and O= specified
      explicitly), bpftool, libbpf, selftests/bpf, and resolve_btfids builds. No
      problems were detected.
      
      Note that because of the constraints of the C preprocessor we have to write
      a few lines of macro magic for each version used to prepare deprecation (0.6
      for now).
      
      Also, use LIBBPF_DEPRECATED_SINCE() to schedule deprecation of
      btf__get_from_id() and btf__load(), which are replaced by
      btf__load_from_kernel_by_id() and btf__load_into_kernel(), respectively,
      starting from future libbpf v0.6. This is part of libbpf 1.0 effort ([0]).
      
        [0] Closes: https://github.com/libbpf/libbpf/issues/278Co-developed-by: NQuentin Monnet <quentin@isovalent.com>
      Co-developed-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20210908213226.1871016-1-andrii@kernel.org
      0b46b755
  6. 08 9月, 2021 3 次提交
  7. 01 9月, 2021 2 次提交
  8. 25 8月, 2021 1 次提交
  9. 17 8月, 2021 6 次提交
  10. 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
  11. 12 8月, 2021 1 次提交
  12. 07 8月, 2021 2 次提交
  13. 31 7月, 2021 1 次提交
  14. 30 7月, 2021 4 次提交
  15. 28 7月, 2021 2 次提交
  16. 27 7月, 2021 3 次提交