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 2/4] alpha: stop storing the user stack pointer in pt_regs
Date: Sun, 11 Oct 2026 16:16:42 -0400 [thread overview]
Message-ID: <20261011-alpha-perf-regs-v3-v1-2-eaa625a39712@gmail.com> (raw)
In-Reply-To: <20261011-alpha-perf-regs-v3-v1-0-eaa625a39712@gmail.com>
Nothing reads pt_regs->usp now that user_stack_pointer() uses the PCB.
Drop the stores, which saves a PAL_rdusp call on every syscall, and
give the field back its old name.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
arch/alpha/include/uapi/asm/ptrace.h | 2 +-
arch/alpha/kernel/asm-offsets.c | 1 -
arch/alpha/kernel/entry.S | 5 -----
arch/alpha/kernel/traps.c | 8 --------
4 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/arch/alpha/include/uapi/asm/ptrace.h b/arch/alpha/include/uapi/asm/ptrace.h
index 9d86b2a1526e..72ed913a910f 100644
--- a/arch/alpha/include/uapi/asm/ptrace.h
+++ b/arch/alpha/include/uapi/asm/ptrace.h
@@ -43,7 +43,7 @@ struct pt_regs {
unsigned long trap_a1;
unsigned long trap_a2;
/* This makes the stack 16-byte aligned as GCC expects */
- unsigned long usp;
+ unsigned long __pad0;
/* These are saved by PAL-code: */
unsigned long ps;
unsigned long pc;
diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c
index c89792c86044..22ed3c975b1c 100644
--- a/arch/alpha/kernel/asm-offsets.c
+++ b/arch/alpha/kernel/asm-offsets.c
@@ -30,7 +30,6 @@ static void __used foo(void)
DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
- DEFINE(PT_REGS_USP, offsetof(struct pt_regs, usp));
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_SYSCALL_WORK, offsetof(struct thread_info, syscall_work));
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index bfa116d455fb..790389a15c3c 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -476,11 +476,6 @@ entSys:
ldq $1, 0($sp) /* syscall nr from saved r0 */
stq $1, 8($sp) /* regs->r1 = shadow syscall nr */
- mov $0, $8
- call_pal PAL_rdusp
- stq $0, PT_REGS_USP($sp)
- mov $8, $0
-
lda $8, 0x3fff
bic $sp, $8, $8
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index cfaef96c4ce8..5882c65b7ef1 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -30,12 +30,6 @@
#include "proto.h"
-static __always_inline void alpha_snapshot_usp(struct pt_regs *regs)
-{
- if (user_mode(regs))
- regs->usp = rdusp();
-}
-
void
dik_show_regs(struct pt_regs *regs, unsigned long *r9_15)
{
@@ -186,7 +180,6 @@ do_entArith(unsigned long summary, unsigned long write_mask,
{
long si_code = FPE_FLTINV;
- alpha_snapshot_usp(regs);
if (summary & 1) {
/* Software-completion summary bit is set, so try to
emulate the instruction. If the processor supports
@@ -208,7 +201,6 @@ do_entIF(unsigned long type, struct pt_regs *regs)
{
int signo, code;
- alpha_snapshot_usp(regs);
if (type == 3) { /* FEN fault */
/* Irritating users can call PAL_clrfen to disable the
FPU for the process. The kernel will then trap in
--
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 ` Matt Turner [this message]
2026-10-12 16:20 ` [PATCH 2/4] alpha: stop storing the user stack pointer in pt_regs Magnus Lindholm
2026-10-11 20:16 ` [PATCH 3/4] alpha: use user_stack_pointer() in KSTK_ESP() and dump_elf_thread() Matt Turner
2026-10-12 17:12 ` 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-2-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®