Skip to content

Commit

Permalink
kill signal_pt_regs()
Browse files Browse the repository at this point in the history
Once upon at it was used on hot paths, but that had not been
true since 2013.  IOW, there's no point for arch-optimized
equivalent of task_pt_regs(current) - remaining two users are
not worth bothering with.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 23, 2022
1 parent 9abf231 commit 6a542d1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion arch/alpha/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#define current_pt_regs() \
((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1)
#define signal_pt_regs current_pt_regs

#define force_successful_syscall_return() (current_pt_regs()->r0 = 0)

Expand Down
2 changes: 1 addition & 1 deletion fs/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
static atomic_t core_dump_count = ATOMIC_INIT(0);
struct coredump_params cprm = {
.siginfo = siginfo,
.regs = signal_pt_regs(),
.regs = task_pt_regs(current),
.limit = rlimit(RLIMIT_CORE),
/*
* We must use the same mm->flags while dumping core to avoid
Expand Down
9 changes: 0 additions & 9 deletions include/linux/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,6 @@ static inline void user_single_step_report(struct pt_regs *regs)
#define current_pt_regs() task_pt_regs(current)
#endif

/*
* unlike current_pt_regs(), this one is equal to task_pt_regs(current)
* on *all* architectures; the only reason to have a per-arch definition
* is optimisation.
*/
#ifndef signal_pt_regs
#define signal_pt_regs() task_pt_regs(current)
#endif

#ifndef current_user_stack_pointer
#define current_user_stack_pointer() user_stack_pointer(current_pt_regs())
#endif
Expand Down
2 changes: 1 addition & 1 deletion kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ int send_signal_locked(int sig, struct kernel_siginfo *info,

static void print_fatal_signal(int signr)
{
struct pt_regs *regs = signal_pt_regs();
struct pt_regs *regs = task_pt_regs(current);
pr_info("potentially unexpected fatal signal %d.\n", signr);

#if defined(__i386__) && !defined(__arch_um__)
Expand Down

0 comments on commit 6a542d1

Please sign in to comment.