public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Xu <dxu@dxuuu.xyz>
To: linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	fsverity@lists.linux.dev, andrii@kernel.org, olsajiri@gmail.com,
	quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org,
	eddyz87@gmail.com
Cc: kernel-team@meta.com
Subject: [PATCH bpf-next v4 00/12] bpf: Support dumping kfunc prototypes from BTF
Date: Sat,  8 Jun 2024 15:15:56 -0600	[thread overview]
Message-ID: <cover.1717881178.git.dxu@dxuuu.xyz> (raw)

This patchset enables both detecting as well as dumping compilable
prototypes for kfuncs.

The first commit instructs pahole to DECL_TAG kfuncs when available.
This requires v1.27 or newer. v1.27 is nearing release at time of
writing. Following this, users will be able to look at BTF inside
vmlinux (or modules) and check if the kfunc they want is available.

The final commit teaches bpftool how to dump kfunc prototypes. This
is done for developer convenience.

The rest of the commits are fixups to enable selftests to use the
newly dumped kfunc prototypes. With these, selftests will regularly
exercise the newly added codepaths.

=== Changelog ===
From v3:
* Teach selftests to use dumped prototypes

From v2:
* Update Makefile.btf with pahole flag
* More error checking
* Output formatting changes
* Drop already-merged commit

From v1:
* Add __weak annotation
* Use btf_dump for kfunc prototypes
* Update kernel bpf_rdonly_cast() signature

Daniel Xu (12):
  kbuild: bpf: Tell pahole to DECL_TAG kfuncs
  bpf: selftests: Fix bpf_iter_task_vma_new() prototype
  bpf: selftests: Fix fentry test kfunc prototypes
  bpf: selftests: Fix bpf_cpumask_first_zero() kfunc prototype
  bpf: selftests: Fix bpf_map_sum_elem_count() kfunc prototype
  bpf: selftests: Fix bpf_session_cookie() kfunc prototype
  bpf: selftests: Namespace struct_opt callbacks in bpf_dctcp
  bpf: verifier: Relax caller requirements for kfunc projection type
    args
  bpf: treewide: Align kfunc signatures to prog point-of-view
  bpf: selftests: nf: Opt out of using generated kfunc prototypes
  bpf: selftests: xfrm: Opt out of using generated kfunc prototypes
  bpftool: Support dumping kfunc prototypes from BTF

 fs/verity/measure.c                           |  3 +-
 include/linux/bpf.h                           |  8 +--
 kernel/bpf/crypto.c                           | 24 +++++---
 kernel/bpf/helpers.c                          | 39 +++++++++----
 kernel/bpf/verifier.c                         | 12 +++-
 kernel/trace/bpf_trace.c                      |  9 ++-
 net/core/filter.c                             | 32 +++++++----
 scripts/Makefile.btf                          |  2 +-
 tools/bpf/bpftool/btf.c                       | 55 +++++++++++++++++++
 .../testing/selftests/bpf/bpf_experimental.h  |  2 +-
 tools/testing/selftests/bpf/bpf_kfuncs.h      |  2 +-
 tools/testing/selftests/bpf/progs/bpf_dctcp.c | 36 ++++++------
 .../selftests/bpf/progs/get_func_ip_test.c    | 14 ++---
 .../selftests/bpf/progs/ip_check_defrag.c     | 10 ++--
 .../bpf/progs/kprobe_multi_session_cookie.c   |  2 +-
 .../selftests/bpf/progs/map_percpu_stats.c    |  2 +-
 .../selftests/bpf/progs/nested_trust_common.h |  2 +-
 .../testing/selftests/bpf/progs/test_bpf_nf.c |  1 +
 .../selftests/bpf/progs/test_bpf_nf_fail.c    |  1 +
 .../bpf/progs/verifier_netfilter_ctx.c        |  6 +-
 .../selftests/bpf/progs/xdp_synproxy_kern.c   |  1 +
 tools/testing/selftests/bpf/progs/xfrm_info.c |  1 +
 22 files changed, 183 insertions(+), 81 deletions(-)

-- 
2.44.0


             reply	other threads:[~2024-06-08 21:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08 21:15 Daniel Xu [this message]
2024-06-08 21:16 ` [PATCH bpf-next v4 09/12] bpf: treewide: Align kfunc signatures to prog point-of-view Daniel Xu
2024-06-08 21:23 ` [PATCH bpf-next v4 00/12] bpf: Support dumping kfunc prototypes from BTF Daniel Xu

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.1717881178.git.dxu@dxuuu.xyz \
    --to=dxu@dxuuu.xyz \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=fsverity@lists.linux.dev \
    --cc=kernel-team@meta.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=quentin@isovalent.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox