From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
x86@kernel.org, Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Josh Poimboeuf <jpoimboe@kernel.org>
Subject: Re: [PATCH v2 1/2] unwind_user/x86: Enable frame pointer unwinding on x86
Date: Tue, 23 Sep 2025 12:51:30 +0200 [thread overview]
Message-ID: <20250923105130.GG3419281@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250827193828.347397433@kernel.org>
On Wed, Aug 27, 2025 at 03:36:45PM -0400, Steven Rostedt wrote:
> From: Josh Poimboeuf <jpoimboe@kernel.org>
>
> Use ARCH_INIT_USER_FP_FRAME to describe how frame pointers are unwound
> on x86, and enable CONFIG_HAVE_UNWIND_USER_FP accordingly so the
> unwind_user interfaces can be used.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/include/asm/unwind_user.h | 11 +++++++++++
> 2 files changed, 12 insertions(+)
> create mode 100644 arch/x86/include/asm/unwind_user.h
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 58d890fe2100..8f94c58d4de8 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -299,6 +299,7 @@ config X86
> select HAVE_SYSCALL_TRACEPOINTS
> select HAVE_UACCESS_VALIDATION if HAVE_OBJTOOL
> select HAVE_UNSTABLE_SCHED_CLOCK
> + select HAVE_UNWIND_USER_FP if X86_64
> select HAVE_USER_RETURN_NOTIFIER
> select HAVE_GENERIC_VDSO
> select VDSO_GETRANDOM if X86_64
> diff --git a/arch/x86/include/asm/unwind_user.h b/arch/x86/include/asm/unwind_user.h
> new file mode 100644
> index 000000000000..8597857bf896
> --- /dev/null
> +++ b/arch/x86/include/asm/unwind_user.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_X86_UNWIND_USER_H
> +#define _ASM_X86_UNWIND_USER_H
> +
> +#define ARCH_INIT_USER_FP_FRAME \
> + .cfa_off = (s32)sizeof(long) * 2, \
> + .ra_off = (s32)sizeof(long) * -1, \
> + .fp_off = (s32)sizeof(long) * -2, \
> + .use_fp = true,
> +
> +#endif /* _ASM_X86_UNWIND_USER_H */
Moo, and now you have me look at unwind/user.c:
/* Make sure that the address is word aligned */
shift = sizeof(long) == 4 ? 2 : 3;
if (cfa & ((1 << shift) - 1))
return -EINVAL;
Isn't that just:
if (cfa & (sizeof(long) - 1))
?
Let me go add a patch to clean that up...
next prev parent reply other threads:[~2025-09-23 10:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 19:36 [PATCH v2 0/2] x86: Enable the deferred unwinding infrastructure Steven Rostedt
2025-08-27 19:36 ` [PATCH v2 1/2] unwind_user/x86: Enable frame pointer unwinding on x86 Steven Rostedt
2025-09-23 10:51 ` Peter Zijlstra [this message]
2025-09-23 12:20 ` Steven Rostedt
2025-10-29 9:36 ` [tip: perf/core] " tip-bot2 for Josh Poimboeuf
2025-08-27 19:36 ` [PATCH v2 2/2] unwind deferred/x86: Do not defer stack tracing for compat tasks Steven Rostedt
2025-09-23 10:45 ` Peter Zijlstra
2025-09-23 11:42 ` Peter Zijlstra
2025-09-23 12:16 ` Steven Rostedt
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=20250923105130.GG3419281@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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®