All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, joe@wand.net.nz, yhs@fb.com,
	andrii.nakryiko@gmail.com, kafai@fb.com,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH bpf-next v3 00/15] BPF support for global data
Date: Wed,  3 Apr 2019 20:22:51 +0200	[thread overview]
Message-ID: <cover.1554314902.git.daniel@iogearbox.net> (raw)

This series is a major rework of previously submitted libbpf
patches [0] in order to add global data support for BPF. The
kernel has been extended to add proper infrastructure that allows
for full .bss/.data/.rodata sections on BPF loader side based
upon feedback from LPC discussions [1]. Latter support is then
also added into libbpf in this series which allows for more
natural C-like programming of BPF programs. For more information
on loader, please refer to 'bpf, libbpf: support global data/bss/
rodata sections' patch in this series. Joint work with Joe Stringer.

Thanks a lot!


Note, here's the current state now updated with full BTF support
in bpftool to be able to inspect global data maps. I'm planning
to do one last round on the series (at latest end of week), so
don't apply yet. ;)

  rfc v3 -> v3:
   - Implement BTF support in kernel, libbpf, bpftool, add tests
   - Fix idx + off conversion (Andrii)
   - Document lower / higher bits for direct value access (Andrii)
   - Add tests with small value size (Andrii)
  v2 -> rfc v3:
   - Add index selection into ldimm64 (Andrii)
   - Fix missing fdput() (Jann)
   - Reject invalid flags in BPF_F_*_PROG (Jakub)
   - Complete rework of libbpf support, includes:
    - Add objname to map name (Stanislav)
    - Make .rodata map full read-only after setup (Andrii)
    - Merge relocation handling into single one (Andrii)
    - Store global maps into obj->maps array (Andrii, Alexei)
    - Debug message when skipping section (Andrii)
    - Reject non-static global data till we have
      semantics for sharing them (Yonghong, Andrii, Alexei)
    - More test cases and completely reworked prog test (Alexei)
   - Fixes, cleanups, etc all over the set
   - Not yet addressed:
    - Make BTF mandatory for these maps (Alexei)
    -> Waiting till BTF support for these lands first
  v1 -> v2:
    - Instead of 32-bit static data, implement full global
      data support (Alexei)

  [0] https://patchwork.ozlabs.org/cover/1040290/
  [1] http://vger.kernel.org/lpc-bpf2018.html#session-3

Daniel Borkmann (13):
  bpf: implement lookup-free direct value access for maps
  bpf: add program side {rd,wr}only support for maps
  bpf: add syscall side map lock support
  bpf: allow . char as part of the object name
  bpf: add specification for BTF Var and DataSec kinds
  bpf: kernel side support for BTF Var and DataSec
  bpf: allow for key-less BTF in array map
  bpf: sync {btf,bpf}.h uapi header from tools infrastructure
  bpf, libbpf: support global data/bss/rodata sections
  bpf, libbpf: add support for BTF Var and DataSec
  bpf: bpftool support for dumping data/bss/rodata sections
  bpf, selftest: test {rd,wr}only flags and direct value access
  bpf, selftest: add test cases for BTF Var and DataSec

Joe Stringer (2):
  bpf, libbpf: refactor relocation handling
  bpf, selftest: test global data/bss/rodata sections

 Documentation/bpf/btf.rst                          |  57 +++
 include/linux/bpf.h                                |  35 +-
 include/linux/bpf_verifier.h                       |   4 +
 include/linux/btf.h                                |   2 +
 include/uapi/linux/bpf.h                           |  24 +-
 include/uapi/linux/btf.h                           |  32 +-
 kernel/bpf/arraymap.c                              |  47 +-
 kernel/bpf/btf.c                                   | 400 ++++++++++++++-
 kernel/bpf/core.c                                  |   3 +-
 kernel/bpf/disasm.c                                |   5 +-
 kernel/bpf/hashtab.c                               |   6 +-
 kernel/bpf/local_storage.c                         |   8 +-
 kernel/bpf/lpm_trie.c                              |   6 +-
 kernel/bpf/queue_stack_maps.c                      |   6 +-
 kernel/bpf/syscall.c                               | 126 ++++-
 kernel/bpf/verifier.c                              | 155 ++++--
 tools/bpf/bpftool/btf_dumper.c                     |  59 +++
 tools/bpf/bpftool/map.c                            |  10 +-
 tools/bpf/bpftool/xlated_dumper.c                  |   6 +
 tools/include/linux/filter.h                       |  14 +
 tools/include/uapi/linux/bpf.h                     |  24 +-
 tools/include/uapi/linux/btf.h                     |  32 +-
 tools/lib/bpf/bpf.c                                |  10 +
 tools/lib/bpf/bpf.h                                |   1 +
 tools/lib/bpf/btf.c                                |  97 +++-
 tools/lib/bpf/btf.h                                |   3 +
 tools/lib/bpf/libbpf.c                             | 537 ++++++++++++++++----
 tools/lib/bpf/libbpf.h                             |   5 +
 tools/lib/bpf/libbpf.map                           |   7 +
 tools/testing/selftests/bpf/bpf_helpers.h          |   8 +-
 .../testing/selftests/bpf/prog_tests/global_data.c | 157 ++++++
 .../testing/selftests/bpf/progs/test_global_data.c | 106 ++++
 tools/testing/selftests/bpf/test_btf.c             | 552 ++++++++++++++++++++-
 tools/testing/selftests/bpf/test_verifier.c        |  53 +-
 .../testing/selftests/bpf/verifier/array_access.c  | 159 ++++++
 .../selftests/bpf/verifier/direct_value_access.c   | 262 ++++++++++
 36 files changed, 2812 insertions(+), 206 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/global_data.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_global_data.c
 create mode 100644 tools/testing/selftests/bpf/verifier/direct_value_access.c

-- 
2.9.5


             reply	other threads:[~2019-04-03 18:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 18:22 Daniel Borkmann [this message]
2019-04-03 18:22 ` [PATCH bpf-next v3 01/15] bpf: implement lookup-free direct value access for maps Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 02/15] bpf: add program side {rd,wr}only support " Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 03/15] bpf: add syscall side map lock support Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 04/15] bpf: allow . char as part of the object name Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 05/15] bpf: add specification for BTF Var and DataSec kinds Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 06/15] bpf: kernel side support for BTF Var and DataSec Daniel Borkmann
2019-04-04 19:20   ` Martin Lau
2019-04-05  7:03     ` Martin Lau
2019-04-05  7:44       ` Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 07/15] bpf: allow for key-less BTF in array map Daniel Borkmann
2019-04-03 18:22 ` [PATCH bpf-next v3 08/15] bpf: sync {btf,bpf}.h uapi header from tools infrastructure Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 09/15] bpf, libbpf: refactor relocation handling Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 10/15] bpf, libbpf: support global data/bss/rodata sections Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 11/15] bpf, libbpf: add support for BTF Var and DataSec Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 12/15] bpf: bpftool support for dumping data/bss/rodata sections Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 13/15] bpf, selftest: test {rd,wr}only flags and direct value access Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 14/15] bpf, selftest: test global data/bss/rodata sections Daniel Borkmann
2019-04-03 18:23 ` [PATCH bpf-next v3 15/15] bpf, selftest: add test cases for BTF Var and DataSec Daniel Borkmann

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=cover.1554314902.git.daniel@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=joe@wand.net.nz \
    --cc=kafai@fb.com \
    --cc=yhs@fb.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.