Skip to content

Commit c7fff92

Browse files
committed
signal: Remove the generic __ARCH_SI_TRAPNO support
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>
1 parent 7de5f68 commit c7fff92

3 files changed

Lines changed: 0 additions & 24 deletions

File tree

arch/mips/include/uapi/asm/siginfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#ifndef _UAPI_ASM_SIGINFO_H
1111
#define _UAPI_ASM_SIGINFO_H
1212

13-
1413
#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15-
#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
1614

1715
#define __ARCH_HAS_SWAPPED_SIGINFO
1816

include/linux/sched/signal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,26 +298,18 @@ static inline void kernel_signal_stop(void)
298298

299299
schedule();
300300
}
301-
#ifdef __ARCH_SI_TRAPNO
302-
# define ___ARCH_SI_TRAPNO(_a1) , _a1
303-
#else
304-
# define ___ARCH_SI_TRAPNO(_a1)
305-
#endif
306301
#ifdef __ia64__
307302
# define ___ARCH_SI_IA64(_a1, _a2, _a3) , _a1, _a2, _a3
308303
#else
309304
# define ___ARCH_SI_IA64(_a1, _a2, _a3)
310305
#endif
311306

312307
int force_sig_fault_to_task(int sig, int code, void __user *addr
313-
___ARCH_SI_TRAPNO(int trapno)
314308
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
315309
, struct task_struct *t);
316310
int force_sig_fault(int sig, int code, void __user *addr
317-
___ARCH_SI_TRAPNO(int trapno)
318311
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr));
319312
int send_sig_fault(int sig, int code, void __user *addr
320-
___ARCH_SI_TRAPNO(int trapno)
321313
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
322314
, struct task_struct *t);
323315

kernel/signal.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,6 @@ void force_sigsegv(int sig)
16661666
}
16671667

16681668
int force_sig_fault_to_task(int sig, int code, void __user *addr
1669-
___ARCH_SI_TRAPNO(int trapno)
16701669
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
16711670
, struct task_struct *t)
16721671
{
@@ -1677,9 +1676,6 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr
16771676
info.si_errno = 0;
16781677
info.si_code = code;
16791678
info.si_addr = addr;
1680-
#ifdef __ARCH_SI_TRAPNO
1681-
info.si_trapno = trapno;
1682-
#endif
16831679
#ifdef __ia64__
16841680
info.si_imm = imm;
16851681
info.si_flags = flags;
@@ -1689,16 +1685,13 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr
16891685
}
16901686

16911687
int force_sig_fault(int sig, int code, void __user *addr
1692-
___ARCH_SI_TRAPNO(int trapno)
16931688
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr))
16941689
{
16951690
return force_sig_fault_to_task(sig, code, addr
1696-
___ARCH_SI_TRAPNO(trapno)
16971691
___ARCH_SI_IA64(imm, flags, isr), current);
16981692
}
16991693

17001694
int send_sig_fault(int sig, int code, void __user *addr
1701-
___ARCH_SI_TRAPNO(int trapno)
17021695
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
17031696
, struct task_struct *t)
17041697
{
@@ -1709,9 +1702,6 @@ int send_sig_fault(int sig, int code, void __user *addr
17091702
info.si_errno = 0;
17101703
info.si_code = code;
17111704
info.si_addr = addr;
1712-
#ifdef __ARCH_SI_TRAPNO
1713-
info.si_trapno = trapno;
1714-
#endif
17151705
#ifdef __ia64__
17161706
info.si_imm = imm;
17171707
info.si_flags = flags;
@@ -3283,10 +3273,6 @@ enum siginfo_layout siginfo_layout(unsigned sig, int si_code)
32833273
((sig == SIGFPE) ||
32843274
((sig == SIGTRAP) && (si_code == TRAP_UNK))))
32853275
layout = SIL_FAULT_TRAPNO;
3286-
#ifdef __ARCH_SI_TRAPNO
3287-
else if (layout == SIL_FAULT)
3288-
layout = SIL_FAULT_TRAPNO;
3289-
#endif
32903276
}
32913277
else if (si_code <= NSIGPOLL)
32923278
layout = SIL_POLL;

0 commit comments

Comments
 (0)