From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>
Cc: vladimir.murzin@arm.com, Puranjay Mohan <puranjay12@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will@kernel.org>,
bpf@vger.kernel.org,
Anshuman Khandual <anshuman.khandual@arm.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Rob Herring <robh@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Shuah Khan <shuah@kernel.org>, Breno Leitao <leitao@debian.org>,
Ravi Bangoria <ravi.bangoria@amd.com>,
Stephane Eranian <eranian@google.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Usama Arif <usama.arif@linux.dev>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, Andrii Nakryiko <andrii.nakryiko@gmail.com>
Subject: Re: [PATCH v6 0/3] arm64: Add BRBE support for bpf_get_branch_snapshot()
Date: Thu, 26 Nov 2026 18:02:14 +0000 [thread overview]
Message-ID: <20261126180214.GB809232@e132581.arm.com> (raw)
In-Reply-To: <5c7f4a5f-fe5e-4367-9c60-86f1818346e8@linaro.org>
On Thu, Nov 26, 2026 at 12:39:52PM +0000, James Clark wrote:
[...]
> > > > Mark, Will, you guys seems to be designated as maintainers for
> > > > drivers/perf/arm_brbe.c, can you please take a look and give your
> > > > feedback as well? This is important and useful feature for newer arm64
> > > > CPUs, it would be great to get access to this functionality that we
> > > > had on x86-64 side for a long while now. Please help get this upstream
> > > > or, if it's not in the right shape, guide Puranjay towards a better
> > > > implementation. Thank you!
...
> + Vladimir
>
> Hi Mark, Will, Vladimir,
>
> Any thoughts on this approach where NMIs need to be disabled? Alternatively
> we could do something like track where the PMU interrupts and BPF snapshots
> overlap and then discard the BRBE buffer and make sure they don't trample on
> each other etc, but it looks like it would be significantly more
> complicated.
Could we restrict bpf_get_branch_snapshot() on arm64 to a free-running
BRBE mode? On a given CPU, at least one active event would have to
request a branch stack, and every such event would have to be a
counting event.
This seems to fit in this series. The selftest opens a CPU-cycles event
with PERF_SAMPLE_BRANCH_STACK and sample_period = 0, then takes the
snapshot from an fexit program.
Counting events can still generate overflow interrupts for bookkeeping.
It requires to refactor the PMU driver to leave BRBCR_ELx.FZP clear so
an overflow doesn't freeze BRBE. The interrupt handler could service the
counters without touching BRBE and losing the branch records.
Thanks,
Leo
next prev parent reply other threads:[~2026-11-26 18:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 16:46 [PATCH v6 0/3] arm64: Add BRBE support for bpf_get_branch_snapshot() Puranjay Mohan
2026-08-10 16:46 ` [PATCH v6 1/3] arm64: Add raw variants of local_daif_save() and local_daif_restore() Puranjay Mohan
2026-08-10 16:46 ` [PATCH v6 2/3] perf/arm64: Add BRBE support for bpf_get_branch_snapshot() Puranjay Mohan
2026-08-10 16:56 ` sashiko-bot
2026-11-26 17:19 ` Leo Yan
2026-11-27 10:56 ` James Clark
2026-08-10 16:46 ` [PATCH v6 3/3] selftests/bpf: Adjust entry thresholds for ARM64 BRBE Puranjay Mohan
2026-09-01 13:45 ` [PATCH v6 0/3] arm64: Add BRBE support for bpf_get_branch_snapshot() Puranjay Mohan
2026-09-22 20:40 ` Andrii Nakryiko
2026-09-23 9:15 ` James Clark
2026-09-23 16:46 ` Andrii Nakryiko
2026-11-26 12:39 ` James Clark
2026-11-26 18:02 ` Leo Yan [this message]
2026-11-27 10:56 ` James Clark
2026-11-27 11:11 ` Leo Yan
2026-11-27 11:24 ` Leo Yan
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=20261126180214.GB809232@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=anshuman.khandual@arm.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=puranjay12@gmail.com \
--cc=ravi.bangoria@amd.com \
--cc=robh@kernel.org \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=usama.arif@linux.dev \
--cc=vladimir.murzin@arm.com \
--cc=will@kernel.org \
--cc=yonghong.song@linux.dev \
/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