From: "tip-bot2 for Jens Remus" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Jens Remus <jremus@linux.ibm.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] unwind_user: Enhance comments on get CFA, FP, and RA
Date: Wed, 17 Dec 2025 12:38:05 -0000 [thread overview]
Message-ID: <176597508521.510.9459757707168769746.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20251208160352.1363040-2-jremus@linux.ibm.com>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 2d6ad925fb2386f3ee1d26f5022f7ea71bbc1541
Gitweb: https://git.kernel.org/tip/2d6ad925fb2386f3ee1d26f5022f7ea71bbc1541
Author: Jens Remus <jremus@linux.ibm.com>
AuthorDate: Mon, 08 Dec 2025 17:03:49 +01:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
unwind_user: Enhance comments on get CFA, FP, and RA
Move the comment "Get the Canonical Frame Address (CFA)" to the top
of the sequence of statements that actually get the CFA. Reword the
comment "Find the Return Address (RA)" to "Get ...", as the statements
actually get the RA. Add a respective comment to the statements that
get the FP. This will be useful once future commits extend the logic
to get the RA and FP.
While at it align the comment on the "stack going in wrong direction"
check to the following one on the "address is word aligned" check.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251208160352.1363040-2-jremus@linux.ibm.com
---
kernel/unwind/user.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/unwind/user.c b/kernel/unwind/user.c
index 39e2707..0ca434f 100644
--- a/kernel/unwind/user.c
+++ b/kernel/unwind/user.c
@@ -31,6 +31,7 @@ static int unwind_user_next_common(struct unwind_user_state *state,
{
unsigned long cfa, fp, ra;
+ /* Get the Canonical Frame Address (CFA) */
if (frame->use_fp) {
if (state->fp < state->sp)
return -EINVAL;
@@ -38,11 +39,9 @@ static int unwind_user_next_common(struct unwind_user_state *state,
} else {
cfa = state->sp;
}
-
- /* Get the Canonical Frame Address (CFA) */
cfa += frame->cfa_off;
- /* stack going in wrong direction? */
+ /* Make sure that stack is not going in wrong direction */
if (cfa <= state->sp)
return -EINVAL;
@@ -50,10 +49,11 @@ static int unwind_user_next_common(struct unwind_user_state *state,
if (cfa & (state->ws - 1))
return -EINVAL;
- /* Find the Return Address (RA) */
+ /* Get the Return Address (RA) */
if (get_user_word(&ra, cfa, frame->ra_off, state->ws))
return -EINVAL;
+ /* Get the Frame Pointer (FP) */
if (frame->fp_off && get_user_word(&fp, cfa, frame->fp_off, state->ws))
return -EINVAL;
next prev parent reply other threads:[~2025-12-17 12:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 16:03 [PATCH v4 0/4] unwind_user: Cleanups Jens Remus
2025-12-08 16:03 ` [PATCH v4 1/4] unwind_user: Enhance comments on get CFA, FP, and RA Jens Remus
2025-12-17 12:38 ` tip-bot2 for Jens Remus [this message]
2025-12-08 16:03 ` [PATCH v4 2/4] unwind_user/fp: Use dummies instead of ifdef Jens Remus
2025-12-17 12:38 ` [tip: perf/core] " tip-bot2 for Jens Remus
2025-12-08 16:03 ` [PATCH v4 3/4] x86/unwind_user: Guard unwind_user_word_size() by UNWIND_USER Jens Remus
2025-12-17 12:38 ` [tip: perf/core] " tip-bot2 for Jens Remus
2025-12-08 16:03 ` [PATCH v4 4/4] x86/unwind_user: Simplify unwind_user_word_size() Jens Remus
2025-12-17 12:38 ` [tip: perf/core] " tip-bot2 for Jens Remus
2025-12-08 19:36 ` [PATCH v4 0/4] unwind_user: Cleanups Peter Zijlstra
2025-12-09 9:10 ` Jens Remus
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=176597508521.510.9459757707168769746.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jremus@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.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®