From: Matt Turner <mattst88@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>,
Magnus Lindholm <linmag7@gmail.com>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, linux-perf-users@vger.kernel.org,
Matt Turner <mattst88@gmail.com>
Subject: [PATCH 3/4] alpha: use user_stack_pointer() in KSTK_ESP() and dump_elf_thread()
Date: Sun, 11 Oct 2026 16:16:43 -0400 [thread overview]
Message-ID: <20261011-alpha-perf-regs-v3-v1-3-eaa625a39712@gmail.com> (raw)
In-Reply-To: <20261011-alpha-perf-regs-v3-v1-0-eaa625a39712@gmail.com>
Both open-code the same PCB lookup.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
arch/alpha/include/asm/processor.h | 3 +--
arch/alpha/kernel/process.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h
index c461a26d47b3..73251cd671e0 100644
--- a/arch/alpha/include/asm/processor.h
+++ b/arch/alpha/include/asm/processor.h
@@ -43,8 +43,7 @@ unsigned long __get_wchan(struct task_struct *p);
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
-#define KSTK_ESP(tsk) \
- ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
+#define KSTK_ESP(tsk) user_stack_pointer(task_pt_regs(tsk))
#define cpu_relax() barrier()
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 06522451f018..7861c9e767b7 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -318,7 +318,7 @@ dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti)
dest[27] = pt->r27;
dest[28] = pt->r28;
dest[29] = pt->gp;
- dest[30] = ti == current_thread_info() ? rdusp() : ti->pcb.usp;
+ dest[30] = user_stack_pointer(pt);
dest[31] = pt->pc;
/* Once upon a time this was the PS value. Which is stupid
--
2.55.0
next prev parent reply other threads:[~2026-10-11 20:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 20:16 [PATCH 0/4] alpha: perf register sampling and user stack dumps Matt Turner
2026-10-11 20:16 ` [PATCH 1/4] alpha: fix stale user_stack_pointer() Matt Turner
2026-10-12 16:18 ` Magnus Lindholm
2026-10-11 20:16 ` [PATCH 2/4] alpha: stop storing the user stack pointer in pt_regs Matt Turner
2026-10-12 16:20 ` Magnus Lindholm
2026-10-11 20:16 ` Matt Turner [this message]
2026-10-12 17:12 ` [PATCH 3/4] alpha: use user_stack_pointer() in KSTK_ESP() and dump_elf_thread() Magnus Lindholm
2026-10-11 20:16 ` [PATCH 4/4] alpha: add HAVE_PERF_REGS and HAVE_PERF_USER_STACK_DUMP support Matt Turner
2026-10-12 17:34 ` Magnus Lindholm
2026-10-11 21:47 ` [PATCH 0/4] alpha: perf register sampling and user stack dumps Ian Rogers
2026-10-12 15:51 ` Magnus Lindholm
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=20261011-alpha-perf-regs-v3-v1-3-eaa625a39712@gmail.com \
--to=mattst88@gmail.com \
--cc=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=richard.henderson@linaro.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®