From: Will Deacon <will@kernel.org>
To: rostedt@goodmis.org, mhiramat@kernel.org, mark.rutland@arm.com,
catalin.marinas@arm.com, revest@chromium.org, olsajiri@gmail.com,
andrii@kernel.org, ast@kernel.org,
Feng Yang <yangfeng59949@163.com>
Cc: kernel-team@android.com, Will Deacon <will@kernel.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org
Subject: Re: [PATCH] tracing: Fix the bug where bpf_get_stackid returns -EFAULT on the ARM64
Date: Thu, 25 Sep 2025 16:32:02 +0100 [thread overview]
Message-ID: <175880516935.3262599.14788507714084459007.b4-ty@kernel.org> (raw)
In-Reply-To: <20250925020822.119302-1-yangfeng59949@163.com>
On Thu, 25 Sep 2025 10:08:22 +0800, Feng Yang wrote:
> When using bpf_program__attach_kprobe_multi_opts on ARM64 to hook a BPF program
> that contains the bpf_get_stackid function, the BPF program fails
> to obtain the stack trace and returns -EFAULT.
>
> This is because ftrace_partial_regs omits the configuration of the pstate register,
> leaving pstate at the default value of 0. When get_perf_callchain executes,
> it uses user_mode(regs) to determine whether it is in kernel mode.
> This leads to a misjudgment that the code is in user mode,
> so perf_callchain_kernel is not executed and the function returns directly.
> As a result, trace->nr becomes 0, and finally -EFAULT is returned.
>
> [...]
Applied to arm64 (for-next/core), thanks!
[1/1] tracing: Fix the bug where bpf_get_stackid returns -EFAULT on the ARM64
https://git.kernel.org/arm64/c/fd2f74f8f3d3
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
prev parent reply other threads:[~2025-09-25 15:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-25 2:08 Feng Yang
2025-09-25 3:33 ` Masami Hiramatsu
2025-09-25 7:14 ` Steven Rostedt
2025-09-25 6:50 ` Jiri Olsa
2025-09-25 15:32 ` Will Deacon [this message]
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=175880516935.3262599.14788507714084459007.b4-ty@kernel.org \
--to=will@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=olsajiri@gmail.com \
--cc=revest@chromium.org \
--cc=rostedt@goodmis.org \
--cc=yangfeng59949@163.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
all inboxes | Powered by JetHome®