signal: Remove the generic __ARCH_SI_TRAPNO support
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 30 Apr 2021 22:53:38 +0000 (17:53 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 23 Jul 2021 18:14:13 +0000 (13:14 -0500)
Now that __ARCH_SI_TRAPNO is no longer set by any architecture remove
all of the code it enabled from the kernel.

On alpha and sparc a more explict approach of using
send_sig_fault_trapno or force_sig_fault_trapno in the very limited
circumstances where si_trapno was set to a non-zero value.

The generic support that is being removed always set si_trapno on all
fault signals.  With only SIGILL ILL_ILLTRAP on sparc and SIGFPE and
SIGTRAP TRAP_UNK on alpla providing si_trapno values asking all senders
of fault signals to provide an si_trapno value does not make sense.

Making si_trapno an ordinary extension of the fault siginfo layout has
enabled the architecture generic implementation of SIGTRAP TRAP_PERF,
and enables other faulting signals to grow architecture generic
senders as well.

v1: https://lkml.kernel.org/r/m18s4zs7nu.fsf_-_@fess.ebiederm.org
v2: https://lkml.kernel.org/r/20210505141101.11519-8-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/87bl73xx6x.fsf_-_@disp2133
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/mips/include/uapi/asm/siginfo.h
include/linux/sched/signal.h
kernel/signal.c

index c34c7eef0a1c17e2aee907433c9979dd0b93b7c7..8cb8bd061a6847be81706b3e6fc6cc83ab52ef52 100644 (file)
@@ -10,9 +10,7 @@
 #ifndef _UAPI_ASM_SIGINFO_H
 #define _UAPI_ASM_SIGINFO_H
 
-
 #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
-#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ...  */
 
 #define __ARCH_HAS_SWAPPED_SIGINFO
 
index 6657184cef07aa1a0ebb96c2b8a0c22c19455955..928e0025d3580d3e33e156233998a18fdcdc731a 100644 (file)
@@ -298,11 +298,6 @@ static inline void kernel_signal_stop(void)
 
        schedule();
 }
-#ifdef __ARCH_SI_TRAPNO
-# define ___ARCH_SI_TRAPNO(_a1) , _a1
-#else
-# define ___ARCH_SI_TRAPNO(_a1)
-#endif
 #ifdef __ia64__
 # define ___ARCH_SI_IA64(_a1, _a2, _a3) , _a1, _a2, _a3
 #else
@@ -310,14 +305,11 @@ static inline void kernel_signal_stop(void)
 #endif
 
 int force_sig_fault_to_task(int sig, int code, void __user *addr
-       ___ARCH_SI_TRAPNO(int trapno)
        ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
        , struct task_struct *t);
 int force_sig_fault(int sig, int code, void __user *addr
-       ___ARCH_SI_TRAPNO(int trapno)
        ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr));
 int send_sig_fault(int sig, int code, void __user *addr
-       ___ARCH_SI_TRAPNO(int trapno)
        ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
        , struct task_struct *t);
 
index ae06a424aa720e9544ef21a62bcdec3924725f15..2181423e562ac77be6b2756aac14b7ac464a5ec7 100644 (file)
@@ -1666,7 +1666,6 @@ void force_sigsegv(int sig)
 }
 
 int force_sig_fault_to_task(int sig, int code, void __user *addr
-       ___ARCH_SI_TRAPNO(int trapno)
        ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
        , struct task_struct *t)
 {
@@ -1677,9 +1676,6 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr
        info.si_errno = 0;
        info.si_code  = code;
        info.si_addr  = addr;
-#ifdef __ARCH_SI_TRAPNO
-       info.si_trapno = trapno;
-#endif
 #ifdef __ia64__
        info.si_imm = imm;
        info.si_flags = flags;
@@ -1689,16 +1685,13 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr
 }
 
 int force_sig_fault(int sig, int code, void __user *addr
-       ___ARCH_SI_TRAPNO(int trapno)
        ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr))
 {
        return force_sig_fault_to_task(sig, code, addr
-                                      ___ARCH_SI_TRAPNO(trapno)
                                       ___ARCH_SI_IA64(imm, flags, isr), current);
 }
 
 int send_sig_fault(int sig, int code, void __user *addr
-       ___ARCH_SI_TRAPNO(int trapno)
        ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
        , struct task_struct *t)
 {
@@ -1709,9 +1702,6 @@ int send_sig_fault(int sig, int code, void __user *addr
        info.si_errno = 0;
        info.si_code  = code;
        info.si_addr  = addr;
-#ifdef __ARCH_SI_TRAPNO
-       info.si_trapno = trapno;
-#endif
 #ifdef __ia64__
        info.si_imm = imm;
        info.si_flags = flags;
@@ -3283,10 +3273,6 @@ enum siginfo_layout siginfo_layout(unsigned sig, int si_code)
                                 ((sig == SIGFPE) ||
                                  ((sig == SIGTRAP) && (si_code == TRAP_UNK))))
                                layout = SIL_FAULT_TRAPNO;
-#ifdef __ARCH_SI_TRAPNO
-                       else if (layout == SIL_FAULT)
-                               layout = SIL_FAULT_TRAPNO;
-#endif
                }
                else if (si_code <= NSIGPOLL)
                        layout = SIL_POLL;