lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250714174505.GA3020098@e132581.arm.com>
Date: Mon, 14 Jul 2025 18:45:05 +0100
From: Leo Yan <leo.yan@....com>
To: Yonghong Song <yonghong.song@...ux.dev>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
	Ian Rogers <irogers@...gle.com>,
	James Clark <james.clark@...aro.org>,
	"Liang, Kan" <kan.liang@...ux.intel.com>,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Andrii Nakryiko <andrii@...nel.org>,
	Martin KaFai Lau <martin.lau@...ux.dev>,
	Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
	John Fastabend <john.fastabend@...il.com>,
	KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>,
	Hao Luo <haoluo@...gle.com>,
	Matt Bobrowski <mattbobrowski@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
	bpf@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
	Suzuki K Poulose <suzuki.poulose@....com>,
	Mike Leach <mike.leach@...aro.org>
Subject: Re: [PATCH v1 2/7] bpf: Add bpf_perf_event_aux_pause kfunc

Hi Yonghong,

Really sorry for the long delay. Now I am restarting this work.

On Mon, Dec 16, 2024 at 09:21:15AM -0800, Yonghong Song wrote:
> On 12/15/24 11:34 AM, Leo Yan wrote:
> > The bpf_perf_event_aux_pause kfunc will be used to control the Perf AUX
> > area to pause or resume.
> > 
> > An example use-case is attaching eBPF to Ftrace tracepoints.  When a
> > tracepoint is hit, the associated eBPF program will be executed.  The
> > eBPF program can invoke bpf_perf_event_aux_pause() to pause or resume
> > AUX trace.  This is useful for fine-grained tracing by combining
> > Perf and eBPF.
> > 
> > This commit implements the bpf_perf_event_aux_pause kfunc, and make it
> > pass the eBPF verifier.
> 
> The subject and commit message mentions to implement a kfunc,
> but actually you implemented a uapi helper. Please implement a kfunc
> instead (searching __bpf_kfunc in kernel/bpf directory).

After some research, my understanding is that kfunc is flexible for
exposing APIs via BTF, whereas BPF_CALL is typically used for core BPF
features - such as accessing BPF maps.

Coming back to this patch: it exposes a function with the following
definition:

  int bpf_perf_event_aux_pause(struct bpf_map *map, u64 flags, u32 pause);

I'm not certain whether using __bpf_kfunc is appropriate here, or if I
should stick to BPF_CALL to ensure support for accessing bpf_map
pointers?

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ