netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andriin@fb.com>
To: <bpf@vger.kernel.org>, <netdev@vger.kernel.org>, <ast@fb.com>,
	<daniel@iogearbox.net>
Cc: <andrii.nakryiko@gmail.com>, <kernel-team@fb.com>,
	Andrii Nakryiko <andriin@fb.com>
Subject: [PATCH v3 bpf 0/9] Fix various issues with 32-bit libbpf
Date: Thu, 13 Aug 2020 13:49:36 -0700	[thread overview]
Message-ID: <20200813204945.1020225-1-andriin@fb.com> (raw)

This patch set contains fixes to libbpf, bpftool, and selftests that were
found while testing libbpf and selftests built in 32-bit mode. 64-bit nature
of BPF target and 32-bit host environment don't always mix together well
without extra care, so there were a bunch of problems discovered and fixed.

Each individual patch contains additional explanations, where necessary.

v2->v3:
  - don't give up if failed to determine ELF class;
v1->v2:
  - guess_ptr_sz -> determine_ptr_sz as per Alexei;
  - added pointer size determination by ELF class.

Andrii Nakryiko (9):
  tools/bpftool: fix compilation warnings in 32-bit mode
  selftest/bpf: fix compilation warnings in 32-bit mode
  libbpf: fix BTF-defined map-in-map initialization on 32-bit host
    arches
  libbpf: handle BTF pointer sizes more carefully
  selftests/bpf: fix btf_dump test cases on 32-bit arches
  libbpf: enforce 64-bitness of BTF for BPF object files
  selftests/bpf: correct various core_reloc 64-bit assumptions
  tools/bpftool: generate data section struct with conservative
    alignment
  selftests/bpf: make test_varlen work with 32-bit user-space arch

 tools/bpf/bpftool/btf_dumper.c                |  2 +-
 tools/bpf/bpftool/gen.c                       | 14 ++++
 tools/bpf/bpftool/link.c                      |  4 +-
 tools/bpf/bpftool/main.h                      | 10 ++-
 tools/bpf/bpftool/prog.c                      | 16 ++--
 tools/lib/bpf/btf.c                           | 83 ++++++++++++++++++-
 tools/lib/bpf/btf.h                           |  2 +
 tools/lib/bpf/btf_dump.c                      |  4 +-
 tools/lib/bpf/libbpf.c                        | 20 +++--
 tools/lib/bpf/libbpf.map                      |  2 +
 .../selftests/bpf/prog_tests/bpf_obj_id.c     |  8 +-
 .../selftests/bpf/prog_tests/btf_dump.c       | 27 ++++--
 .../selftests/bpf/prog_tests/core_extern.c    |  4 +-
 .../selftests/bpf/prog_tests/core_reloc.c     | 20 ++---
 .../selftests/bpf/prog_tests/fexit_bpf2bpf.c  |  6 +-
 .../selftests/bpf/prog_tests/flow_dissector.c |  2 +-
 .../selftests/bpf/prog_tests/global_data.c    |  6 +-
 .../selftests/bpf/prog_tests/prog_run_xattr.c |  2 +-
 .../selftests/bpf/prog_tests/skb_ctx.c        |  2 +-
 .../testing/selftests/bpf/prog_tests/varlen.c |  8 +-
 .../selftests/bpf/progs/core_reloc_types.h    | 69 ++++++++-------
 .../testing/selftests/bpf/progs/test_varlen.c |  6 +-
 tools/testing/selftests/bpf/test_btf.c        |  8 +-
 tools/testing/selftests/bpf/test_progs.h      |  5 ++
 24 files changed, 233 insertions(+), 97 deletions(-)

-- 
2.24.1


             reply	other threads:[~2020-08-13 21:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 20:49 Andrii Nakryiko [this message]
2020-08-13 20:49 ` [PATCH v3 bpf 1/9] tools/bpftool: fix compilation warnings in 32-bit mode Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 2/9] selftest/bpf: " Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 3/9] libbpf: fix BTF-defined map-in-map initialization on 32-bit host arches Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 4/9] libbpf: handle BTF pointer sizes more carefully Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 5/9] selftests/bpf: fix btf_dump test cases on 32-bit arches Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 6/9] libbpf: enforce 64-bitness of BTF for BPF object files Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 7/9] selftests/bpf: correct various core_reloc 64-bit assumptions Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 8/9] tools/bpftool: generate data section struct with conservative alignment Andrii Nakryiko
2020-08-13 20:49 ` [PATCH v3 bpf 9/9] selftests/bpf: make test_varlen work with 32-bit user-space arch Andrii Nakryiko
2020-08-14  0:08 ` [PATCH v3 bpf 0/9] Fix various issues with 32-bit libbpf Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200813204945.1020225-1-andriin@fb.com \
    --to=andriin@fb.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).