aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-20 21:05:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-20 21:05:28 -0500
commit54d46ea993744c5408e39ce0cb4851e13cbea716 (patch)
tree8e38fa92cc2ae72e0353c44e1e68be9bf5a7a058 /arch
parentf59dc2bb5a50b26ea751f9eac1c81e4cc7de5257 (diff)
parent50ececcfa7d1acee085b2c518cad495062db6379 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull signal handling cleanups from Al Viro: "sigaltstack infrastructure + conversion for x86, alpha and um, COMPAT_SYSCALL_DEFINE infrastructure. Note that there are several conflicts between "unify SS_ONSTACK/SS_DISABLE definitions" and UAPI patches in mainline; resolution is trivial - just remove definitions of SS_ONSTACK and SS_DISABLED from arch/*/uapi/asm/signal.h; they are all identical and include/uapi/linux/signal.h contains the unified variant." Fixed up conflicts as per Al. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: alpha: switch to generic sigaltstack new helpers: __save_altstack/__compat_save_altstack, switch x86 and um to those generic compat_sys_sigaltstack() introduce generic sys_sigaltstack(), switch x86 and um to it new helper: compat_user_stack_pointer() new helper: restore_altstack() unify SS_ONSTACK/SS_DISABLE definitions new helper: current_user_stack_pointer() missing user_stack_pointer() instances Bury the conditionals from kernel_thread/kernel_execve series COMPAT_SYSCALL_DEFINE: infrastructure
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig9
-rw-r--r--arch/alpha/Kconfig3
-rw-r--r--arch/alpha/include/asm/ptrace.h1
-rw-r--r--arch/alpha/include/asm/unistd.h1
-rw-r--r--arch/alpha/include/uapi/asm/signal.h6
-rw-r--r--arch/alpha/kernel/signal.c10
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/include/asm/unistd.h1
-rw-r--r--arch/arm/include/uapi/asm/signal.h7
-rw-r--r--arch/arm64/Kconfig2
-rw-r--r--arch/arm64/include/asm/compat.h5
-rw-r--r--arch/arm64/include/asm/unistd.h1
-rw-r--r--arch/avr32/Kconfig2
-rw-r--r--arch/avr32/include/asm/ptrace.h1
-rw-r--r--arch/avr32/include/asm/unistd.h1
-rw-r--r--arch/avr32/include/uapi/asm/signal.h6
-rw-r--r--arch/blackfin/Kconfig2
-rw-r--r--arch/blackfin/include/asm/ptrace.h1
-rw-r--r--arch/blackfin/include/asm/unistd.h1
-rw-r--r--arch/c6x/Kconfig2
-rw-r--r--arch/c6x/include/uapi/asm/unistd.h1
-rw-r--r--arch/cris/Kconfig2
-rw-r--r--arch/cris/include/asm/ptrace.h1
-rw-r--r--arch/cris/include/asm/unistd.h1
-rw-r--r--arch/cris/include/uapi/asm/signal.h6
-rw-r--r--arch/frv/Kconfig2
-rw-r--r--arch/frv/include/asm/unistd.h1
-rw-r--r--arch/h8300/Kconfig2
-rw-r--r--arch/h8300/include/asm/ptrace.h1
-rw-r--r--arch/h8300/include/asm/unistd.h1
-rw-r--r--arch/h8300/include/uapi/asm/signal.h6
-rw-r--r--arch/hexagon/Kconfig2
-rw-r--r--arch/hexagon/include/uapi/asm/unistd.h1
-rw-r--r--arch/ia64/Kconfig2
-rw-r--r--arch/ia64/include/asm/ptrace.h5
-rw-r--r--arch/ia64/include/asm/unistd.h1
-rw-r--r--arch/ia64/include/uapi/asm/signal.h6
-rw-r--r--arch/m32r/Kconfig2
-rw-r--r--arch/m32r/include/asm/ptrace.h1
-rw-r--r--arch/m32r/include/asm/unistd.h1
-rw-r--r--arch/m32r/include/uapi/asm/signal.h6
-rw-r--r--arch/m68k/Kconfig2
-rw-r--r--arch/m68k/include/asm/ptrace.h1
-rw-r--r--arch/m68k/include/asm/unistd.h1
-rw-r--r--arch/m68k/include/uapi/asm/signal.h6
-rw-r--r--arch/microblaze/Kconfig2
-rw-r--r--arch/microblaze/include/asm/ptrace.h1
-rw-r--r--arch/microblaze/include/asm/unistd.h1
-rw-r--r--arch/mips/Kconfig2
-rw-r--r--arch/mips/include/asm/ptrace.h1
-rw-r--r--arch/mips/include/asm/unistd.h1
-rw-r--r--arch/mips/include/uapi/asm/signal.h6
-rw-r--r--arch/mn10300/Kconfig2
-rw-r--r--arch/mn10300/include/asm/unistd.h1
-rw-r--r--arch/mn10300/include/uapi/asm/signal.h6
-rw-r--r--arch/openrisc/Kconfig2
-rw-r--r--arch/openrisc/include/uapi/asm/unistd.h1
-rw-r--r--arch/parisc/Kconfig2
-rw-r--r--arch/parisc/include/asm/unistd.h1
-rw-r--r--arch/parisc/include/uapi/asm/signal.h6
-rw-r--r--arch/powerpc/Kconfig2
-rw-r--r--arch/powerpc/include/asm/unistd.h1
-rw-r--r--arch/powerpc/include/uapi/asm/signal.h6
-rw-r--r--arch/s390/Kconfig2
-rw-r--r--arch/s390/include/asm/compat.h3
-rw-r--r--arch/s390/include/asm/unistd.h1
-rw-r--r--arch/s390/include/uapi/asm/signal.h6
-rw-r--r--arch/score/Kconfig2
-rw-r--r--arch/score/include/asm/ptrace.h1
-rw-r--r--arch/score/include/uapi/asm/unistd.h1
-rw-r--r--arch/sh/Kconfig2
-rw-r--r--arch/sh/include/asm/unistd.h1
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/include/asm/unistd.h1
-rw-r--r--arch/sparc/include/uapi/asm/signal.h6
-rw-r--r--arch/tile/Kconfig2
-rw-r--r--arch/tile/include/asm/ptrace.h1
-rw-r--r--arch/tile/include/asm/unistd.h1
-rw-r--r--arch/um/kernel/signal.c5
-rw-r--r--arch/unicore32/Kconfig2
-rw-r--r--arch/unicore32/include/asm/ptrace.h1
-rw-r--r--arch/unicore32/include/uapi/asm/unistd.h1
-rw-r--r--arch/x86/Kconfig3
-rw-r--r--arch/x86/ia32/ia32_signal.c55
-rw-r--r--arch/x86/ia32/ia32entry.S1
-rw-r--r--arch/x86/include/asm/ia32.h10
-rw-r--r--arch/x86/include/asm/ptrace.h7
-rw-r--r--arch/x86/include/asm/sys_ia32.h2
-rw-r--r--arch/x86/include/asm/syscalls.h3
-rw-r--r--arch/x86/include/asm/unistd.h1
-rw-r--r--arch/x86/include/uapi/asm/signal.h6
-rw-r--r--arch/x86/kernel/entry_32.S1
-rw-r--r--arch/x86/kernel/entry_64.S3
-rw-r--r--arch/x86/kernel/signal.c29
-rw-r--r--arch/x86/syscalls/syscall_32.tbl2
-rw-r--r--arch/x86/syscalls/syscall_64.tbl4
-rw-r--r--arch/x86/um/Kconfig3
-rw-r--r--arch/x86/um/asm/ptrace.h1
-rw-r--r--arch/x86/um/signal.c9
-rw-r--r--arch/x86/um/sys_call_table_32.c1
-rw-r--r--arch/x86/um/sys_call_table_64.c1
-rw-r--r--arch/xtensa/Kconfig2
-rw-r--r--arch/xtensa/include/asm/ptrace.h2
-rw-r--r--arch/xtensa/include/asm/unistd.h1
-rw-r--r--arch/xtensa/include/uapi/asm/signal.h6
105 files changed, 54 insertions, 309 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 8e9e3246b2b4..7f8f281f2585 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -291,12 +291,6 @@ config ARCH_WANT_OLD_COMPAT_IPC
291 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION 291 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
292 bool 292 bool
293 293
294config GENERIC_KERNEL_THREAD
295 bool
296
297config GENERIC_KERNEL_EXECVE
298 bool
299
300config HAVE_ARCH_SECCOMP_FILTER 294config HAVE_ARCH_SECCOMP_FILTER
301 bool 295 bool
302 help 296 help
@@ -362,6 +356,9 @@ config MODULES_USE_ELF_REL
362 Modules only use ELF REL relocations. Modules with ELF RELA 356 Modules only use ELF REL relocations. Modules with ELF RELA
363 relocations will give an error. 357 relocations will give an error.
364 358
359config GENERIC_SIGALTSTACK
360 bool
361
365# 362#
366# ABI hall of shame 363# ABI hall of shame
367# 364#
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 5dd7f5db24d4..9d5904cc7712 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -20,10 +20,9 @@ config ALPHA
20 select GENERIC_CMOS_UPDATE 20 select GENERIC_CMOS_UPDATE
21 select GENERIC_STRNCPY_FROM_USER 21 select GENERIC_STRNCPY_FROM_USER
22 select GENERIC_STRNLEN_USER 22 select GENERIC_STRNLEN_USER
23 select GENERIC_KERNEL_THREAD
24 select GENERIC_KERNEL_EXECVE
25 select HAVE_MOD_ARCH_SPECIFIC 23 select HAVE_MOD_ARCH_SPECIFIC
26 select MODULES_USE_ELF_RELA 24 select MODULES_USE_ELF_RELA
25 select GENERIC_SIGALTSTACK
27 help 26 help
28 The Alpha is a 64-bit general-purpose processor designed and 27 The Alpha is a 64-bit general-purpose processor designed and
29 marketed by the Digital Equipment Corporation of blessed memory, 28 marketed by the Digital Equipment Corporation of blessed memory,
diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h
index df9a6cd748d5..21128505ddbe 100644
--- a/arch/alpha/include/asm/ptrace.h
+++ b/arch/alpha/include/asm/ptrace.h
@@ -8,6 +8,7 @@
8#define user_mode(regs) (((regs)->ps & 8) != 0) 8#define user_mode(regs) (((regs)->ps & 8) != 0)
9#define instruction_pointer(regs) ((regs)->pc) 9#define instruction_pointer(regs) ((regs)->pc)
10#define profile_pc(regs) instruction_pointer(regs) 10#define profile_pc(regs) instruction_pointer(regs)
11#define current_user_stack_pointer() rdusp()
11 12
12#define task_pt_regs(task) \ 13#define task_pt_regs(task) \
13 ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) 14 ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
index d6069ff3b1c8..b3396ee039b7 100644
--- a/arch/alpha/include/asm/unistd.h
+++ b/arch/alpha/include/asm/unistd.h
@@ -15,7 +15,6 @@
15#define __ARCH_WANT_SYS_OLDUMOUNT 15#define __ARCH_WANT_SYS_OLDUMOUNT
16#define __ARCH_WANT_SYS_SIGPENDING 16#define __ARCH_WANT_SYS_SIGPENDING
17#define __ARCH_WANT_SYS_RT_SIGSUSPEND 17#define __ARCH_WANT_SYS_RT_SIGSUSPEND
18#define __ARCH_WANT_SYS_EXECVE
19#define __ARCH_WANT_SYS_FORK 18#define __ARCH_WANT_SYS_FORK
20#define __ARCH_WANT_SYS_VFORK 19#define __ARCH_WANT_SYS_VFORK
21#define __ARCH_WANT_SYS_CLONE 20#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/alpha/include/uapi/asm/signal.h b/arch/alpha/include/uapi/asm/signal.h
index 965bbfa59c65..dd4ca4bcbb4a 100644
--- a/arch/alpha/include/uapi/asm/signal.h
+++ b/arch/alpha/include/uapi/asm/signal.h
@@ -84,12 +84,6 @@ typedef unsigned long sigset_t;
84#define SA_ONESHOT SA_RESETHAND 84#define SA_ONESHOT SA_RESETHAND
85#define SA_NOMASK SA_NODEFER 85#define SA_NOMASK SA_NODEFER
86 86
87/*
88 * sigaltstack controls
89 */
90#define SS_ONSTACK 1
91#define SS_DISABLE 2
92
93#define MINSIGSTKSZ 4096 87#define MINSIGSTKSZ 4096
94#define SIGSTKSZ 16384 88#define SIGSTKSZ 16384
95 89
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 336393c9c11f..02d02c047f17 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -122,12 +122,6 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
122 return sigsuspend(&blocked); 122 return sigsuspend(&blocked);
123} 123}
124 124
125asmlinkage int
126sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
127{
128 return do_sigaltstack(uss, uoss, rdusp());
129}
130
131/* 125/*
132 * Do a signal return; undo the signal stack. 126 * Do a signal return; undo the signal stack.
133 */ 127 */
@@ -418,9 +412,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
418 err |= __put_user(0, &frame->uc.uc_flags); 412 err |= __put_user(0, &frame->uc.uc_flags);
419 err |= __put_user(0, &frame->uc.uc_link); 413 err |= __put_user(0, &frame->uc.uc_link);
420 err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask); 414 err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask);
421 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 415 err |= __save_altstack(&frame->uc.uc_stack, oldsp);
422 err |= __put_user(sas_ss_flags(oldsp), &frame->uc.uc_stack.ss_flags);
423 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
424 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, 416 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs,
425 set->sig[0], oldsp); 417 set->sig[0], oldsp);
426 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 418 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8c83d98424c7..f95ba14ae3d0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -12,8 +12,6 @@ config ARM
12 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 12 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
13 select GENERIC_IRQ_PROBE 13 select GENERIC_IRQ_PROBE
14 select GENERIC_IRQ_SHOW 14 select GENERIC_IRQ_SHOW
15 select GENERIC_KERNEL_THREAD
16 select GENERIC_KERNEL_EXECVE
17 select GENERIC_PCI_IOMAP 15 select GENERIC_PCI_IOMAP
18 select GENERIC_SMP_IDLE_THREAD 16 select GENERIC_SMP_IDLE_THREAD
19 select GENERIC_STRNCPY_FROM_USER 17 select GENERIC_STRNCPY_FROM_USER
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 7cd13cc62624..21a2700d2957 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -41,7 +41,6 @@
41#define __ARCH_WANT_OLD_READDIR 41#define __ARCH_WANT_OLD_READDIR
42#define __ARCH_WANT_SYS_SOCKETCALL 42#define __ARCH_WANT_SYS_SOCKETCALL
43#endif 43#endif
44#define __ARCH_WANT_SYS_EXECVE
45#define __ARCH_WANT_SYS_FORK 44#define __ARCH_WANT_SYS_FORK
46#define __ARCH_WANT_SYS_VFORK 45#define __ARCH_WANT_SYS_VFORK
47#define __ARCH_WANT_SYS_CLONE 46#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
index 921c57fdc52e..33073bdcf091 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -87,13 +87,6 @@ typedef unsigned long sigset_t;
87#define SA_NOMASK SA_NODEFER 87#define SA_NOMASK SA_NODEFER
88#define SA_ONESHOT SA_RESETHAND 88#define SA_ONESHOT SA_RESETHAND
89 89
90
91/*
92 * sigaltstack controls
93 */
94#define SS_ONSTACK 1
95#define SS_DISABLE 2
96
97#define MINSIGSTKSZ 2048 90#define MINSIGSTKSZ 2048
98#define SIGSTKSZ 8192 91#define SIGSTKSZ 8192
99 92
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index f9ccff915918..9c829b008261 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -8,8 +8,6 @@ config ARM64
8 select GENERIC_IOMAP 8 select GENERIC_IOMAP
9 select GENERIC_IRQ_PROBE 9 select GENERIC_IRQ_PROBE
10 select GENERIC_IRQ_SHOW 10 select GENERIC_IRQ_SHOW
11 select GENERIC_KERNEL_EXECVE
12 select GENERIC_KERNEL_THREAD
13 select GENERIC_SMP_IDLE_THREAD 11 select GENERIC_SMP_IDLE_THREAD
14 select GENERIC_TIME_VSYSCALL 12 select GENERIC_TIME_VSYSCALL
15 select HARDIRQS_SW_RESEND 13 select HARDIRQS_SW_RESEND
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index 37e610dc084e..d9ec40217a27 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -209,10 +209,11 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
209 return (u32)(unsigned long)uptr; 209 return (u32)(unsigned long)uptr;
210} 210}
211 211
212#define compat_user_stack_pointer() (current_pt_regs()->compat_sp)
213
212static inline void __user *arch_compat_alloc_user_space(long len) 214static inline void __user *arch_compat_alloc_user_space(long len)
213{ 215{
214 struct pt_regs *regs = task_pt_regs(current); 216 return (void __user *)compat_user_stack_pointer() - len;
215 return (void __user *)regs->compat_sp - len;
216} 217}
217 218
218struct compat_ipc64_perm { 219struct compat_ipc64_perm {
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 76fb7dd3350a..744087fb521c 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -28,6 +28,5 @@
28#define __ARCH_WANT_SYS_FORK 28#define __ARCH_WANT_SYS_FORK
29#define __ARCH_WANT_SYS_VFORK 29#define __ARCH_WANT_SYS_VFORK
30#endif 30#endif
31#define __ARCH_WANT_SYS_EXECVE
32#define __ARCH_WANT_SYS_CLONE 31#define __ARCH_WANT_SYS_CLONE
33#include <uapi/asm/unistd.h> 32#include <uapi/asm/unistd.h>
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index e40c9bd79143..2ae6591b3a55 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -17,8 +17,6 @@ config AVR32
17 select GENERIC_CLOCKEVENTS 17 select GENERIC_CLOCKEVENTS
18 select HAVE_MOD_ARCH_SPECIFIC 18 select HAVE_MOD_ARCH_SPECIFIC
19 select MODULES_USE_ELF_RELA 19 select MODULES_USE_ELF_RELA
20 select GENERIC_KERNEL_THREAD
21 select GENERIC_KERNEL_EXECVE
22 help 20 help
23 AVR32 is a high-performance 32-bit RISC microprocessor core, 21 AVR32 is a high-performance 32-bit RISC microprocessor core,
24 designed for cost-sensitive embedded applications, with particular 22 designed for cost-sensitive embedded applications, with particular
diff --git a/arch/avr32/include/asm/ptrace.h b/arch/avr32/include/asm/ptrace.h
index 8d3c412fc65f..630e4f9bf5f0 100644
--- a/arch/avr32/include/asm/ptrace.h
+++ b/arch/avr32/include/asm/ptrace.h
@@ -21,6 +21,7 @@
21#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER) 21#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
22#define instruction_pointer(regs) ((regs)->pc) 22#define instruction_pointer(regs) ((regs)->pc)
23#define profile_pc(regs) instruction_pointer(regs) 23#define profile_pc(regs) instruction_pointer(regs)
24#define user_stack_pointer(regs) ((regs)->sp)
24 25
25static __inline__ int valid_user_regs(struct pt_regs *regs) 26static __inline__ int valid_user_regs(struct pt_regs *regs)
26{ 27{
diff --git a/arch/avr32/include/asm/unistd.h b/arch/avr32/include/asm/unistd.h
index f05a9804e8e2..0bdf6371574e 100644
--- a/arch/avr32/include/asm/unistd.h
+++ b/arch/avr32/include/asm/unistd.h
@@ -39,7 +39,6 @@
39#define __ARCH_WANT_SYS_GETPGRP 39#define __ARCH_WANT_SYS_GETPGRP
40#define __ARCH_WANT_SYS_RT_SIGACTION 40#define __ARCH_WANT_SYS_RT_SIGACTION
41#define __ARCH_WANT_SYS_RT_SIGSUSPEND 41#define __ARCH_WANT_SYS_RT_SIGSUSPEND
42#define __ARCH_WANT_SYS_EXECVE
43#define __ARCH_WANT_SYS_FORK 42#define __ARCH_WANT_SYS_FORK
44#define __ARCH_WANT_SYS_VFORK 43#define __ARCH_WANT_SYS_VFORK
45#define __ARCH_WANT_SYS_CLONE 44#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/avr32/include/uapi/asm/signal.h b/arch/avr32/include/uapi/asm/signal.h
index eb46f61adb7d..1b77a93eff50 100644
--- a/arch/avr32/include/uapi/asm/signal.h
+++ b/arch/avr32/include/uapi/asm/signal.h
@@ -89,12 +89,6 @@ typedef unsigned long sigset_t;
89#define SA_NOMASK SA_NODEFER 89#define SA_NOMASK SA_NODEFER
90#define SA_ONESHOT SA_RESETHAND 90#define SA_ONESHOT SA_RESETHAND
91 91
92/*
93 * sigaltstack controls
94 */
95#define SS_ONSTACK 1
96#define SS_DISABLE 2
97
98#define MINSIGSTKSZ 2048 92#define MINSIGSTKSZ 2048
99#define SIGSTKSZ 8192 93#define SIGSTKSZ 8192
100 94
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index ab9ff4075f4d..b6f3ad5441c5 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -45,8 +45,6 @@ config BLACKFIN
45 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS 45 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
46 select HAVE_MOD_ARCH_SPECIFIC 46 select HAVE_MOD_ARCH_SPECIFIC
47 select MODULES_USE_ELF_RELA 47 select MODULES_USE_ELF_RELA
48 select GENERIC_KERNEL_THREAD
49 select GENERIC_KERNEL_EXECVE
50 48
51config GENERIC_CSUM 49config GENERIC_CSUM
52 def_bool y 50 def_bool y
diff --git a/arch/blackfin/include/asm/ptrace.h b/arch/blackfin/include/asm/ptrace.h
index 14ea93388c05..c00491594b46 100644
--- a/arch/blackfin/include/asm/ptrace.h
+++ b/arch/blackfin/include/asm/ptrace.h
@@ -17,6 +17,7 @@
17#define arch_has_single_step() (1) 17#define arch_has_single_step() (1)
18/* common code demands this function */ 18/* common code demands this function */
19#define ptrace_disable(child) user_disable_single_step(child) 19#define ptrace_disable(child) user_disable_single_step(child)
20#define current_user_stack_pointer() rdusp()
20 21
21extern int is_user_addr_valid(struct task_struct *child, 22extern int is_user_addr_valid(struct task_struct *child,
22 unsigned long start, unsigned long len); 23 unsigned long start, unsigned long len);
diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h
index 17eb748e9c54..e943cb130048 100644
--- a/arch/blackfin/include/asm/unistd.h
+++ b/arch/blackfin/include/asm/unistd.h
@@ -20,7 +20,6 @@
20#define __ARCH_WANT_SYS_NICE 20#define __ARCH_WANT_SYS_NICE
21#define __ARCH_WANT_SYS_RT_SIGACTION 21#define __ARCH_WANT_SYS_RT_SIGACTION
22#define __ARCH_WANT_SYS_RT_SIGSUSPEND 22#define __ARCH_WANT_SYS_RT_SIGSUSPEND
23#define __ARCH_WANT_SYS_EXECVE
24#define __ARCH_WANT_SYS_VFORK 23#define __ARCH_WANT_SYS_VFORK
25 24
26/* 25/*
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index 66eab3703c75..f6a3648f5ec3 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -17,8 +17,6 @@ config C6X
17 select OF 17 select OF
18 select OF_EARLY_FLATTREE 18 select OF_EARLY_FLATTREE
19 select GENERIC_CLOCKEVENTS 19 select GENERIC_CLOCKEVENTS
20 select GENERIC_KERNEL_THREAD
21 select GENERIC_KERNEL_EXECVE
22 select MODULES_USE_ELF_RELA 20 select MODULES_USE_ELF_RELA
23 21
24config MMU 22config MMU
diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h
index f3987a8703d9..e7d09a614d10 100644
--- a/arch/c6x/include/uapi/asm/unistd.h
+++ b/arch/c6x/include/uapi/asm/unistd.h
@@ -14,7 +14,6 @@
14 * more details. 14 * more details.
15 */ 15 */
16 16
17#define __ARCH_WANT_SYS_EXECVE
18#define __ARCH_WANT_SYS_CLONE 17#define __ARCH_WANT_SYS_CLONE
19 18
20/* Use the standard ABI for syscalls. */ 19/* Use the standard ABI for syscalls. */
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 0cac6a49f230..c59a01dd9c0c 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -49,8 +49,6 @@ config CRIS
49 select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 49 select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
50 select GENERIC_CMOS_UPDATE 50 select GENERIC_CMOS_UPDATE
51 select MODULES_USE_ELF_RELA 51 select MODULES_USE_ELF_RELA
52 select GENERIC_KERNEL_THREAD
53 select GENERIC_KERNEL_EXECVE
54 select CLONE_BACKWARDS2 52 select CLONE_BACKWARDS2
55 53
56config HZ 54config HZ
diff --git a/arch/cris/include/asm/ptrace.h b/arch/cris/include/asm/ptrace.h
index 2de84d7061c7..9e788d04a4ef 100644
--- a/arch/cris/include/asm/ptrace.h
+++ b/arch/cris/include/asm/ptrace.h
@@ -9,5 +9,6 @@
9#define PTRACE_SETREGS 13 9#define PTRACE_SETREGS 13
10 10
11#define profile_pc(regs) instruction_pointer(regs) 11#define profile_pc(regs) instruction_pointer(regs)
12#define current_user_stack_pointer() rdusp()
12 13
13#endif /* _CRIS_PTRACE_H */ 14#endif /* _CRIS_PTRACE_H */
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h
index 89680f9eac0d..6d062bdf92d4 100644
--- a/arch/cris/include/asm/unistd.h
+++ b/arch/cris/include/asm/unistd.h
@@ -32,7 +32,6 @@
32#define __ARCH_WANT_SYS_SIGPROCMASK 32#define __ARCH_WANT_SYS_SIGPROCMASK
33#define __ARCH_WANT_SYS_RT_SIGACTION 33#define __ARCH_WANT_SYS_RT_SIGACTION
34#define __ARCH_WANT_SYS_RT_SIGSUSPEND 34#define __ARCH_WANT_SYS_RT_SIGSUSPEND
35#define __ARCH_WANT_SYS_EXECVE
36#define __ARCH_WANT_SYS_FORK 35#define __ARCH_WANT_SYS_FORK
37#define __ARCH_WANT_SYS_VFORK 36#define __ARCH_WANT_SYS_VFORK
38#define __ARCH_WANT_SYS_CLONE 37#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/cris/include/uapi/asm/signal.h b/arch/cris/include/uapi/asm/signal.h
index 21624948a96d..ce42fa7c32ad 100644
--- a/arch/cris/include/uapi/asm/signal.h
+++ b/arch/cris/include/uapi/asm/signal.h
@@ -83,12 +83,6 @@ typedef unsigned long sigset_t;
83 83
84#define SA_RESTORER 0x04000000 84#define SA_RESTORER 0x04000000
85 85
86/*
87 * sigaltstack controls
88 */
89#define SS_ONSTACK 1
90#define SS_DISABLE 2
91
92#define MINSIGSTKSZ 2048 86#define MINSIGSTKSZ 2048
93#define SIGSTKSZ 8192 87#define SIGSTKSZ 8192
94 88
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index df2eb4bd9fa2..9d262645f667 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -12,8 +12,6 @@ config FRV
12 select ARCH_HAVE_NMI_SAFE_CMPXCHG 12 select ARCH_HAVE_NMI_SAFE_CMPXCHG
13 select GENERIC_CPU_DEVICES 13 select GENERIC_CPU_DEVICES
14 select ARCH_WANT_IPC_PARSE_VERSION 14 select ARCH_WANT_IPC_PARSE_VERSION
15 select GENERIC_KERNEL_THREAD
16 select GENERIC_KERNEL_EXECVE
17 15
18config ZONE_DMA 16config ZONE_DMA
19 bool 17 bool
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h
index 1807d8ea8cb5..d685da17f5fb 100644
--- a/arch/frv/include/asm/unistd.h
+++ b/arch/frv/include/asm/unistd.h
@@ -29,7 +29,6 @@
29#define __ARCH_WANT_SYS_SIGPROCMASK 29#define __ARCH_WANT_SYS_SIGPROCMASK
30#define __ARCH_WANT_SYS_RT_SIGACTION 30#define __ARCH_WANT_SYS_RT_SIGACTION
31#define __ARCH_WANT_SYS_RT_SIGSUSPEND 31#define __ARCH_WANT_SYS_RT_SIGSUSPEND
32#define __ARCH_WANT_SYS_EXECVE
33#define __ARCH_WANT_SYS_FORK 32#define __ARCH_WANT_SYS_FORK
34#define __ARCH_WANT_SYS_VFORK 33#define __ARCH_WANT_SYS_VFORK
35#define __ARCH_WANT_SYS_CLONE 34#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 0ae445087607..2d2efb653ee0 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -9,8 +9,6 @@ config H8300
9 select GENERIC_IRQ_SHOW 9 select GENERIC_IRQ_SHOW
10 select GENERIC_CPU_DEVICES 10 select GENERIC_CPU_DEVICES
11 select MODULES_USE_ELF_RELA 11 select MODULES_USE_ELF_RELA
12 select GENERIC_KERNEL_THREAD
13 select GENERIC_KERNEL_EXECVE
14 12
15config SYMBOL_PREFIX 13config SYMBOL_PREFIX
16 string 14 string
diff --git a/arch/h8300/include/asm/ptrace.h b/arch/h8300/include/asm/ptrace.h
index 79c9a91e75ef..c1826b95c5ca 100644
--- a/arch/h8300/include/asm/ptrace.h
+++ b/arch/h8300/include/asm/ptrace.h
@@ -28,5 +28,6 @@
28#define current_pt_regs() ((struct pt_regs *) \ 28#define current_pt_regs() ((struct pt_regs *) \
29 (THREAD_SIZE + (unsigned long)current_thread_info()) - 1) 29 (THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
30#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0) 30#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
31#define current_user_stack_pointer() rdusp()
31#endif /* __ASSEMBLY__ */ 32#endif /* __ASSEMBLY__ */
32#endif /* _H8300_PTRACE_H */ 33#endif /* _H8300_PTRACE_H */
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h
index 8215518b3f9f..aa38105959fb 100644
--- a/arch/h8300/include/asm/unistd.h
+++ b/arch/h8300/include/asm/unistd.h
@@ -31,7 +31,6 @@
31#define __ARCH_WANT_SYS_SIGPROCMASK 31#define __ARCH_WANT_SYS_SIGPROCMASK
32#define __ARCH_WANT_SYS_RT_SIGACTION 32#define __ARCH_WANT_SYS_RT_SIGACTION
33#define __ARCH_WANT_SYS_RT_SIGSUSPEND 33#define __ARCH_WANT_SYS_RT_SIGSUSPEND
34#define __ARCH_WANT_SYS_EXECVE
35#define __ARCH_WANT_SYS_FORK 34#define __ARCH_WANT_SYS_FORK
36#define __ARCH_WANT_SYS_VFORK 35#define __ARCH_WANT_SYS_VFORK
37#define __ARCH_WANT_SYS_CLONE 36#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/h8300/include/uapi/asm/signal.h b/arch/h8300/include/uapi/asm/signal.h
index 913729e581e8..af3a6c37fee6 100644
--- a/arch/h8300/include/uapi/asm/signal.h
+++ b/arch/h8300/include/uapi/asm/signal.h
@@ -82,12 +82,6 @@ typedef unsigned long sigset_t;
82 82
83#define SA_RESTORER 0x04000000 83#define SA_RESTORER 0x04000000
84 84
85/*
86 * sigaltstack controls
87 */
88#define SS_ONSTACK 1
89#define SS_DISABLE 2
90
91#define MINSIGSTKSZ 2048 85#define MINSIGSTKSZ 2048
92#define SIGSTKSZ 8192 86#define SIGSTKSZ 8192
93 87
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
index e418803b6c8e..0744f7d7b1fd 100644
--- a/arch/hexagon/Kconfig
+++ b/arch/hexagon/Kconfig
@@ -31,8 +31,6 @@ config HEXAGON
31 select GENERIC_CLOCKEVENTS 31 select GENERIC_CLOCKEVENTS
32 select GENERIC_CLOCKEVENTS_BROADCAST 32 select GENERIC_CLOCKEVENTS_BROADCAST
33 select MODULES_USE_ELF_RELA 33 select MODULES_USE_ELF_RELA
34 select GENERIC_KERNEL_THREAD
35 select GENERIC_KERNEL_EXECVE
36 ---help--- 34 ---help---
37 Qualcomm Hexagon is a processor architecture designed for high 35 Qualcomm Hexagon is a processor architecture designed for high
38 performance and low power across a wide variety of applications. 36 performance and low power across a wide variety of applications.
diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h
index 2af81533bd0f..4a87cc47075c 100644
--- a/arch/hexagon/include/uapi/asm/unistd.h
+++ b/arch/hexagon/include/uapi/asm/unistd.h
@@ -27,7 +27,6 @@
27 */ 27 */
28 28
29#define sys_mmap2 sys_mmap_pgoff 29#define sys_mmap2 sys_mmap_pgoff
30#define __ARCH_WANT_SYS_EXECVE
31#define __ARCH_WANT_SYS_CLONE 30#define __ARCH_WANT_SYS_CLONE
32 31
33#include <asm-generic/unistd.h> 32#include <asm-generic/unistd.h>
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 670600468128..3279646120e3 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -42,8 +42,6 @@ config IA64
42 select GENERIC_TIME_VSYSCALL_OLD 42 select GENERIC_TIME_VSYSCALL_OLD
43 select HAVE_MOD_ARCH_SPECIFIC 43 select HAVE_MOD_ARCH_SPECIFIC
44 select MODULES_USE_ELF_RELA 44 select MODULES_USE_ELF_RELA
45 select GENERIC_KERNEL_THREAD
46 select GENERIC_KERNEL_EXECVE
47 default y 45 default y
48 help 46 help
49 The Itanium Processor Family is Intel's 64-bit successor to 47 The Itanium Processor Family is Intel's 64-bit successor to
diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h
index b0e973649cb9..845143990a1d 100644
--- a/arch/ia64/include/asm/ptrace.h
+++ b/arch/ia64/include/asm/ptrace.h
@@ -78,6 +78,11 @@ static inline long regs_return_value(struct pt_regs *regs)
78 unsigned long __ip = instruction_pointer(regs); \ 78 unsigned long __ip = instruction_pointer(regs); \
79 (__ip & ~3UL) + ((__ip & 3UL) << 2); \ 79 (__ip & ~3UL) + ((__ip & 3UL) << 2); \
80}) 80})
81/*
82 * Why not default? Because user_stack_pointer() on ia64 gives register
83 * stack backing store instead...
84 */
85#define current_user_stack_pointer() (current_pt_regs()->r12)
81 86
82 /* given a pointer to a task_struct, return the user's pt_regs */ 87 /* given a pointer to a task_struct, return the user's pt_regs */
83# define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) 88# define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index 1574bca86138..8b3ff2f5b861 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -29,7 +29,6 @@
29 29
30#define __ARCH_WANT_SYS_RT_SIGACTION 30#define __ARCH_WANT_SYS_RT_SIGACTION
31#define __ARCH_WANT_SYS_RT_SIGSUSPEND 31#define __ARCH_WANT_SYS_RT_SIGSUSPEND
32#define __ARCH_WANT_SYS_EXECVE
33 32
34#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) 33#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
35 34
diff --git a/arch/ia64/include/uapi/asm/signal.h b/arch/ia64/include/uapi/asm/signal.h
index e531c424434c..c0ea2855e96b 100644
--- a/arch/ia64/include/uapi/asm/signal.h
+++ b/arch/ia64/include/uapi/asm/signal.h
@@ -79,12 +79,6 @@
79#define SA_RESTORER 0x04000000 79#define SA_RESTORER 0x04000000
80 80
81/* 81/*
82 * sigaltstack controls
83 */
84#define SS_ONSTACK 1
85#define SS_DISABLE 2
86
87/*
88 * The minimum stack size needs to be fairly large because we want to 82 * The minimum stack size needs to be fairly large because we want to
89 * be sure that an app compiled for today's CPUs will continue to run 83 * be sure that an app compiled for today's CPUs will continue to run
90 * on all future CPU models. The CPU model matters because the signal 84 * on all future CPU models. The CPU model matters because the signal
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 5183f43a2cf7..f807721e19a5 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -15,8 +15,6 @@ config M32R
15 select GENERIC_ATOMIC64 15 select GENERIC_ATOMIC64
16 select ARCH_USES_GETTIMEOFFSET 16 select ARCH_USES_GETTIMEOFFSET
17 select MODULES_USE_ELF_RELA 17 select MODULES_USE_ELF_RELA
18 select GENERIC_KERNEL_THREAD
19 select GENERIC_KERNEL_EXECVE
20 18
21config SBUS 19config SBUS
22 bool 20 bool
diff --git a/arch/m32r/include/asm/ptrace.h b/arch/m32r/include/asm/ptrace.h
index ba487c554dbb..fa58ccfff865 100644
--- a/arch/m32r/include/asm/ptrace.h
+++ b/arch/m32r/include/asm/ptrace.h
@@ -32,6 +32,7 @@ extern void init_debug_traps(struct task_struct *);
32 32
33#define instruction_pointer(regs) ((regs)->bpc) 33#define instruction_pointer(regs) ((regs)->bpc)
34#define profile_pc(regs) instruction_pointer(regs) 34#define profile_pc(regs) instruction_pointer(regs)
35#define user_stack_pointer(regs) ((regs)->spu)
35 36
36extern void withdraw_debug_trap(struct pt_regs *regs); 37extern void withdraw_debug_trap(struct pt_regs *regs);
37 38
diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h
index 1eade32082b8..79b063caec85 100644
--- a/arch/m32r/include/asm/unistd.h
+++ b/arch/m32r/include/asm/unistd.h
@@ -22,7 +22,6 @@
22#define __ARCH_WANT_SYS_OLDUMOUNT 22#define __ARCH_WANT_SYS_OLDUMOUNT
23#define __ARCH_WANT_SYS_RT_SIGACTION 23#define __ARCH_WANT_SYS_RT_SIGACTION
24#define __ARCH_WANT_SYS_RT_SIGSUSPEND 24#define __ARCH_WANT_SYS_RT_SIGSUSPEND
25#define __ARCH_WANT_SYS_EXECVE
26#define __ARCH_WANT_SYS_CLONE 25#define __ARCH_WANT_SYS_CLONE
27#define __ARCH_WANT_SYS_FORK 26#define __ARCH_WANT_SYS_FORK
28#define __ARCH_WANT_SYS_VFORK 27#define __ARCH_WANT_SYS_VFORK
diff --git a/arch/m32r/include/uapi/asm/signal.h b/arch/m32r/include/uapi/asm/signal.h
index ef9788fda2ef..54acacb1f1f7 100644
--- a/arch/m32r/include/uapi/asm/signal.h
+++ b/arch/m32r/include/uapi/asm/signal.h
@@ -84,12 +84,6 @@ typedef unsigned long sigset_t;
84 84
85#define SA_RESTORER 0x04000000 85#define SA_RESTORER 0x04000000
86 86
87/*
88 * sigaltstack controls
89 */
90#define SS_ONSTACK 1
91#define SS_DISABLE 2
92
93#define MINSIGSTKSZ 2048 87#define MINSIGSTKSZ 2048
94#define SIGSTKSZ 8192 88#define SIGSTKSZ 8192
95 89
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 953a7ba5d050..6710084e072a 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -15,8 +15,6 @@ config M68K
15 select FPU if MMU 15 select FPU if MMU
16 select ARCH_WANT_IPC_PARSE_VERSION 16 select ARCH_WANT_IPC_PARSE_VERSION
17 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE 17 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
18 select GENERIC_KERNEL_THREAD
19 select GENERIC_KERNEL_EXECVE
20 select HAVE_MOD_ARCH_SPECIFIC 18 select HAVE_MOD_ARCH_SPECIFIC
21 select MODULES_USE_ELF_REL 19 select MODULES_USE_ELF_REL
22 select MODULES_USE_ELF_RELA 20 select MODULES_USE_ELF_RELA
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h
index 0f717045bdde..a45cb6894ad3 100644
--- a/arch/m68k/include/asm/ptrace.h
+++ b/arch/m68k/include/asm/ptrace.h
@@ -15,6 +15,7 @@
15#define profile_pc(regs) instruction_pointer(regs) 15#define profile_pc(regs) instruction_pointer(regs)
16#define current_pt_regs() \ 16#define current_pt_regs() \
17 (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1 17 (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1
18#define current_user_stack_pointer() rdusp()
18 19
19#define arch_has_single_step() (1) 20#define arch_has_single_step() (1)
20 21
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index a021d67cdd72..847994ce6804 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -31,7 +31,6 @@
31#define __ARCH_WANT_SYS_SIGPROCMASK 31#define __ARCH_WANT_SYS_SIGPROCMASK
32#define __ARCH_WANT_SYS_RT_SIGACTION 32#define __ARCH_WANT_SYS_RT_SIGACTION
33#define __ARCH_WANT_SYS_RT_SIGSUSPEND 33#define __ARCH_WANT_SYS_RT_SIGSUSPEND
34#define __ARCH_WANT_SYS_EXECVE
35#define __ARCH_WANT_SYS_FORK 34#define __ARCH_WANT_SYS_FORK
36#define __ARCH_WANT_SYS_VFORK 35#define __ARCH_WANT_SYS_VFORK
37 36
diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h
index 2b450f311bd9..cba6f858bb46 100644
--- a/arch/m68k/include/uapi/asm/signal.h
+++ b/arch/m68k/include/uapi/asm/signal.h
@@ -80,12 +80,6 @@ typedef unsigned long sigset_t;
80#define SA_NOMASK SA_NODEFER 80#define SA_NOMASK SA_NODEFER
81#define SA_ONESHOT SA_RESETHAND 81#define SA_ONESHOT SA_RESETHAND
82 82
83/*
84 * sigaltstack controls
85 */
86#define SS_ONSTACK 1
87#define SS_DISABLE 2
88
89#define MINSIGSTKSZ 2048 83#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192 84#define SIGSTKSZ 8192
91 85
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 4bcf89148f3c..ba3b7c8c04b8 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -26,8 +26,6 @@ config MICROBLAZE
26 select GENERIC_ATOMIC64 26 select GENERIC_ATOMIC64
27 select GENERIC_CLOCKEVENTS 27 select GENERIC_CLOCKEVENTS
28 select MODULES_USE_ELF_RELA 28 select MODULES_USE_ELF_RELA
29 select GENERIC_KERNEL_THREAD
30 select GENERIC_KERNEL_EXECVE
31 select CLONE_BACKWARDS 29 select CLONE_BACKWARDS
32 30
33config SWAP 31config SWAP
diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h
index 3732bcf186fd..5b18ec124e51 100644
--- a/arch/microblaze/include/asm/ptrace.h
+++ b/arch/microblaze/include/asm/ptrace.h
@@ -16,6 +16,7 @@
16 16
17#define instruction_pointer(regs) ((regs)->pc) 17#define instruction_pointer(regs) ((regs)->pc)
18#define profile_pc(regs) instruction_pointer(regs) 18#define profile_pc(regs) instruction_pointer(regs)
19#define user_stack_pointer(regs) ((regs)->r1)
19 20
20static inline long regs_return_value(struct pt_regs *regs) 21static inline long regs_return_value(struct pt_regs *regs)
21{ 22{
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
index 99e23937a31a..a5f06ac97113 100644
--- a/arch/microblaze/include/asm/unistd.h
+++ b/arch/microblaze/include/asm/unistd.h
@@ -35,7 +35,6 @@
35#define __ARCH_WANT_SYS_SIGPROCMASK 35#define __ARCH_WANT_SYS_SIGPROCMASK
36#define __ARCH_WANT_SYS_RT_SIGACTION 36#define __ARCH_WANT_SYS_RT_SIGACTION
37#define __ARCH_WANT_SYS_RT_SIGSUSPEND 37#define __ARCH_WANT_SYS_RT_SIGSUSPEND
38#define __ARCH_WANT_SYS_EXECVE
39#define __ARCH_WANT_SYS_CLONE 38#define __ARCH_WANT_SYS_CLONE
40#define __ARCH_WANT_SYS_VFORK 39#define __ARCH_WANT_SYS_VFORK
41#ifdef CONFIG_MMU 40#ifdef CONFIG_MMU
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d971d1586f1c..b7dc39c6c849 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -41,8 +41,6 @@ config MIPS
41 select HAVE_MOD_ARCH_SPECIFIC 41 select HAVE_MOD_ARCH_SPECIFIC
42 select MODULES_USE_ELF_REL 42 select MODULES_USE_ELF_REL
43 select MODULES_USE_ELF_RELA if 64BIT 43 select MODULES_USE_ELF_RELA if 64BIT
44 select GENERIC_KERNEL_THREAD
45 select GENERIC_KERNEL_EXECVE
46 44
47menu "Machine selection" 45menu "Machine selection"
48 46
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index cec5e125f7e4..a3186f2bb8a0 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs)
49 49
50#define instruction_pointer(regs) ((regs)->cp0_epc) 50#define instruction_pointer(regs) ((regs)->cp0_epc)
51#define profile_pc(regs) instruction_pointer(regs) 51#define profile_pc(regs) instruction_pointer(regs)
52#define user_stack_pointer(r) ((r)->regs[29])
52 53
53extern asmlinkage void syscall_trace_enter(struct pt_regs *regs); 54extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
54extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); 55extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index b306e2081cad..9e47cc11aa26 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -20,7 +20,6 @@
20#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 20#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64
21#define __ARCH_WANT_OLD_READDIR 21#define __ARCH_WANT_OLD_READDIR
22#define __ARCH_WANT_SYS_ALARM 22#define __ARCH_WANT_SYS_ALARM
23#define __ARCH_WANT_SYS_EXECVE
24#define __ARCH_WANT_SYS_GETHOSTNAME 23#define __ARCH_WANT_SYS_GETHOSTNAME
25#define __ARCH_WANT_SYS_IPC 24#define __ARCH_WANT_SYS_IPC
26#define __ARCH_WANT_SYS_PAUSE 25#define __ARCH_WANT_SYS_PAUSE
diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h
index 3f1237c6c80e..770732cb8d03 100644
--- a/arch/mips/include/uapi/asm/signal.h
+++ b/arch/mips/include/uapi/asm/signal.h
@@ -86,12 +86,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
86 86
87#define SA_RESTORER 0x04000000 /* Only for o32 */ 87#define SA_RESTORER 0x04000000 /* Only for o32 */
88 88
89/*
90 * sigaltstack controls
91 */
92#define SS_ONSTACK 1
93#define SS_DISABLE 2
94
95#define MINSIGSTKSZ 2048 89#define MINSIGSTKSZ 2048
96#define SIGSTKSZ 8192 90#define SIGSTKSZ 8192
97 91
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 72471744a912..aa03f2e13385 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -8,8 +8,6 @@ config MN10300
8 select HAVE_ARCH_KGDB 8 select HAVE_ARCH_KGDB
9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER 9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
10 select GENERIC_CLOCKEVENTS 10 select GENERIC_CLOCKEVENTS
11 select GENERIC_KERNEL_THREAD
12 select GENERIC_KERNEL_EXECVE
13 select MODULES_USE_ELF_RELA 11 select MODULES_USE_ELF_RELA
14 12
15config AM33_2 13config AM33_2
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h
index cabf8ba73b27..e6d2ed4ba68f 100644
--- a/arch/mn10300/include/asm/unistd.h
+++ b/arch/mn10300/include/asm/unistd.h
@@ -43,7 +43,6 @@
43#define __ARCH_WANT_SYS_SIGPROCMASK 43#define __ARCH_WANT_SYS_SIGPROCMASK
44#define __ARCH_WANT_SYS_RT_SIGACTION 44#define __ARCH_WANT_SYS_RT_SIGACTION
45#define __ARCH_WANT_SYS_RT_SIGSUSPEND 45#define __ARCH_WANT_SYS_RT_SIGSUSPEND
46#define __ARCH_WANT_SYS_EXECVE
47#define __ARCH_WANT_SYS_FORK 46#define __ARCH_WANT_SYS_FORK
48#define __ARCH_WANT_SYS_VFORK 47#define __ARCH_WANT_SYS_VFORK
49#define __ARCH_WANT_SYS_CLONE 48#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/mn10300/include/uapi/asm/signal.h b/arch/mn10300/include/uapi/asm/signal.h
index 08dcd6a85618..f423a08d7eeb 100644
--- a/arch/mn10300/include/uapi/asm/signal.h
+++ b/arch/mn10300/include/uapi/asm/signal.h
@@ -92,12 +92,6 @@ typedef unsigned long sigset_t;
92 92
93#define SA_RESTORER 0x04000000 93#define SA_RESTORER 0x04000000
94 94
95/*
96 * sigaltstack controls
97 */
98#define SS_ONSTACK 1
99#define SS_DISABLE 2
100
101#define MINSIGSTKSZ 2048 95#define MINSIGSTKSZ 2048
102#define SIGSTKSZ 8192 96#define SIGSTKSZ 8192
103 97
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index ec37e185d20d..0ac66f67521f 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -22,8 +22,6 @@ config OPENRISC
22 select GENERIC_STRNCPY_FROM_USER 22 select GENERIC_STRNCPY_FROM_USER
23 select GENERIC_STRNLEN_USER 23 select GENERIC_STRNLEN_USER
24 select MODULES_USE_ELF_RELA 24 select MODULES_USE_ELF_RELA
25 select GENERIC_KERNEL_THREAD
26 select GENERIC_KERNEL_EXECVE
27 25
28config MMU 26config MMU
29 def_bool y 27 def_bool y
diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h
index 5082b8066325..ce40b71df006 100644
--- a/arch/openrisc/include/uapi/asm/unistd.h
+++ b/arch/openrisc/include/uapi/asm/unistd.h
@@ -20,7 +20,6 @@
20 20
21#define sys_mmap2 sys_mmap_pgoff 21#define sys_mmap2 sys_mmap_pgoff
22 22
23#define __ARCH_WANT_SYS_EXECVE
24#define __ARCH_WANT_SYS_FORK 23#define __ARCH_WANT_SYS_FORK
25#define __ARCH_WANT_SYS_CLONE 24#define __ARCH_WANT_SYS_CLONE
26 25
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index e688a2be30f6..b77feffbadea 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -22,8 +22,6 @@ config PARISC
22 select GENERIC_STRNCPY_FROM_USER 22 select GENERIC_STRNCPY_FROM_USER
23 select HAVE_MOD_ARCH_SPECIFIC 23 select HAVE_MOD_ARCH_SPECIFIC
24 select MODULES_USE_ELF_RELA 24 select MODULES_USE_ELF_RELA
25 select GENERIC_KERNEL_THREAD
26 select GENERIC_KERNEL_EXECVE
27 select CLONE_BACKWARDS 25 select CLONE_BACKWARDS
28 26
29 help 27 help
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index 1efef41659c9..3043194547cd 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -163,7 +163,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
163#define __ARCH_WANT_SYS_RT_SIGACTION 163#define __ARCH_WANT_SYS_RT_SIGACTION
164#define __ARCH_WANT_SYS_RT_SIGSUSPEND 164#define __ARCH_WANT_SYS_RT_SIGSUSPEND
165#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 165#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
166#define __ARCH_WANT_SYS_EXECVE
167#define __ARCH_WANT_SYS_FORK 166#define __ARCH_WANT_SYS_FORK
168#define __ARCH_WANT_SYS_VFORK 167#define __ARCH_WANT_SYS_VFORK
169#define __ARCH_WANT_SYS_CLONE 168#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
index b1ddaa243376..a2fa297196bc 100644
--- a/arch/parisc/include/uapi/asm/signal.h
+++ b/arch/parisc/include/uapi/asm/signal.h
@@ -71,12 +71,6 @@
71 71
72#define SA_RESTORER 0x04000000 /* obsolete -- ignored */ 72#define SA_RESTORER 0x04000000 /* obsolete -- ignored */
73 73
74/*
75 * sigaltstack controls
76 */
77#define SS_ONSTACK 1
78#define SS_DISABLE 2
79
80#define MINSIGSTKSZ 2048 74#define MINSIGSTKSZ 2048
81#define SIGSTKSZ 8192 75#define SIGSTKSZ 8192
82 76
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 951a517a1a0f..17903f1f356b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -141,10 +141,8 @@ config PPC
141 select GENERIC_CLOCKEVENTS 141 select GENERIC_CLOCKEVENTS
142 select GENERIC_STRNCPY_FROM_USER 142 select GENERIC_STRNCPY_FROM_USER
143 select GENERIC_STRNLEN_USER 143 select GENERIC_STRNLEN_USER
144 select GENERIC_KERNEL_THREAD
145 select HAVE_MOD_ARCH_SPECIFIC 144 select HAVE_MOD_ARCH_SPECIFIC
146 select MODULES_USE_ELF_RELA 145 select MODULES_USE_ELF_RELA
147 select GENERIC_KERNEL_EXECVE
148 select CLONE_BACKWARDS 146 select CLONE_BACKWARDS
149 147
150config EARLY_PRINTK 148config EARLY_PRINTK
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index 29365e15ed7c..1d4864a40e35 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -56,7 +56,6 @@
56#define __ARCH_WANT_COMPAT_SYS_SENDFILE 56#define __ARCH_WANT_COMPAT_SYS_SENDFILE
57#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL 57#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
58#endif 58#endif
59#define __ARCH_WANT_SYS_EXECVE
60#define __ARCH_WANT_SYS_FORK 59#define __ARCH_WANT_SYS_FORK
61#define __ARCH_WANT_SYS_VFORK 60#define __ARCH_WANT_SYS_VFORK
62#define __ARCH_WANT_SYS_CLONE 61#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h
index 48fa8d3f2f9a..e079fb39d5bc 100644
--- a/arch/powerpc/include/uapi/asm/signal.h
+++ b/arch/powerpc/include/uapi/asm/signal.h
@@ -85,12 +85,6 @@ typedef struct {
85 85
86#define SA_RESTORER 0x04000000U 86#define SA_RESTORER 0x04000000U
87 87
88/*
89 * sigaltstack controls
90 */
91#define SS_ONSTACK 1
92#define SS_DISABLE 2
93
94#define MINSIGSTKSZ 2048 88#define MINSIGSTKSZ 2048
95#define SIGSTKSZ 8192 89#define SIGSTKSZ 8192
96 90
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 32425af9d68d..b5ea38c25647 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -137,8 +137,6 @@ config S390
137 select GENERIC_CLOCKEVENTS 137 select GENERIC_CLOCKEVENTS
138 select KTIME_SCALAR if 32BIT 138 select KTIME_SCALAR if 32BIT
139 select HAVE_ARCH_SECCOMP_FILTER 139 select HAVE_ARCH_SECCOMP_FILTER
140 select GENERIC_KERNEL_THREAD
141 select GENERIC_KERNEL_EXECVE
142 select HAVE_MOD_ARCH_SPECIFIC 140 select HAVE_MOD_ARCH_SPECIFIC
143 select MODULES_USE_ELF_RELA 141 select MODULES_USE_ELF_RELA
144 select CLONE_BACKWARDS2 142 select CLONE_BACKWARDS2
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 18cd6b592650..f8c6df6cd1f0 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -7,6 +7,9 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/thread_info.h> 8#include <linux/thread_info.h>
9 9
10#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
11#define __SC_DELOUSE(t,v) (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v))
12
10#define PSW32_MASK_PER 0x40000000UL 13#define PSW32_MASK_PER 0x40000000UL
11#define PSW32_MASK_DAT 0x04000000UL 14#define PSW32_MASK_DAT 0x04000000UL
12#define PSW32_MASK_IO 0x02000000UL 15#define PSW32_MASK_IO 0x02000000UL
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
index 086bb8eaf6ab..636530872516 100644
--- a/arch/s390/include/asm/unistd.h
+++ b/arch/s390/include/asm/unistd.h
@@ -53,7 +53,6 @@
53# define __ARCH_WANT_COMPAT_SYS_TIME 53# define __ARCH_WANT_COMPAT_SYS_TIME
54# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 54# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
55# endif 55# endif
56#define __ARCH_WANT_SYS_EXECVE
57#define __ARCH_WANT_SYS_FORK 56#define __ARCH_WANT_SYS_FORK
58#define __ARCH_WANT_SYS_VFORK 57#define __ARCH_WANT_SYS_VFORK
59#define __ARCH_WANT_SYS_CLONE 58#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/s390/include/uapi/asm/signal.h b/arch/s390/include/uapi/asm/signal.h
index 8c6a49e392ee..2f43cfbf5f1a 100644
--- a/arch/s390/include/uapi/asm/signal.h
+++ b/arch/s390/include/uapi/asm/signal.h
@@ -90,12 +90,6 @@ typedef unsigned long sigset_t;
90 90
91#define SA_RESTORER 0x04000000 91#define SA_RESTORER 0x04000000
92 92
93/*
94 * sigaltstack controls
95 */
96#define SS_ONSTACK 1
97#define SS_DISABLE 2
98
99#define MINSIGSTKSZ 2048 93#define MINSIGSTKSZ 2048
100#define SIGSTKSZ 8192 94#define SIGSTKSZ 8192
101 95
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index 45893390c7dd..3b1482e7afac 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -13,8 +13,6 @@ config SCORE
13 select GENERIC_CLOCKEVENTS 13 select GENERIC_CLOCKEVENTS
14 select HAVE_MOD_ARCH_SPECIFIC 14 select HAVE_MOD_ARCH_SPECIFIC
15 select MODULES_USE_ELF_REL 15 select MODULES_USE_ELF_REL
16 select GENERIC_KERNEL_THREAD
17 select GENERIC_KERNEL_EXECVE
18 select CLONE_BACKWARDS 16 select CLONE_BACKWARDS
19 17
20choice 18choice
diff --git a/arch/score/include/asm/ptrace.h b/arch/score/include/asm/ptrace.h
index 78fc538db84c..abc279d96b73 100644
--- a/arch/score/include/asm/ptrace.h
+++ b/arch/score/include/asm/ptrace.h
@@ -13,6 +13,7 @@ struct task_struct;
13 13
14#define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc) 14#define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc)
15#define profile_pc(regs) instruction_pointer(regs) 15#define profile_pc(regs) instruction_pointer(regs)
16#define user_stack_pointer(r) ((unsigned long)(r)->regs[0])
16 17
17extern void do_syscall_trace(struct pt_regs *regs, int entryexit); 18extern void do_syscall_trace(struct pt_regs *regs, int entryexit);
18extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); 19extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
diff --git a/arch/score/include/uapi/asm/unistd.h b/arch/score/include/uapi/asm/unistd.h
index 56001c93095a..9cb4260a5f3e 100644
--- a/arch/score/include/uapi/asm/unistd.h
+++ b/arch/score/include/uapi/asm/unistd.h
@@ -4,7 +4,6 @@
4#define __ARCH_WANT_SYSCALL_NO_FLAGS 4#define __ARCH_WANT_SYSCALL_NO_FLAGS
5#define __ARCH_WANT_SYSCALL_OFF_T 5#define __ARCH_WANT_SYSCALL_OFF_T
6#define __ARCH_WANT_SYSCALL_DEPRECATED 6#define __ARCH_WANT_SYSCALL_DEPRECATED
7#define __ARCH_WANT_SYS_EXECVE
8#define __ARCH_WANT_SYS_CLONE 7#define __ARCH_WANT_SYS_CLONE
9#define __ARCH_WANT_SYS_FORK 8#define __ARCH_WANT_SYS_FORK
10#define __ARCH_WANT_SYS_VFORK 9#define __ARCH_WANT_SYS_VFORK
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 8451317eed58..babc2b826c5c 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -40,8 +40,6 @@ config SUPERH
40 select GENERIC_STRNLEN_USER 40 select GENERIC_STRNLEN_USER
41 select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER 41 select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
42 select MODULES_USE_ELF_RELA 42 select MODULES_USE_ELF_RELA
43 select GENERIC_KERNEL_THREAD
44 select GENERIC_KERNEL_EXECVE
45 help 43 help
46 The SuperH is a RISC processor targeted for use in embedded systems 44 The SuperH is a RISC processor targeted for use in embedded systems
47 and consumer electronics; it was also used in the Sega Dreamcast 45 and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h
index 43d3f26b2eab..012004ed3330 100644
--- a/arch/sh/include/asm/unistd.h
+++ b/arch/sh/include/asm/unistd.h
@@ -28,7 +28,6 @@
28# define __ARCH_WANT_SYS_SIGPENDING 28# define __ARCH_WANT_SYS_SIGPENDING
29# define __ARCH_WANT_SYS_SIGPROCMASK 29# define __ARCH_WANT_SYS_SIGPROCMASK
30# define __ARCH_WANT_SYS_RT_SIGACTION 30# define __ARCH_WANT_SYS_RT_SIGACTION
31# define __ARCH_WANT_SYS_EXECVE
32# define __ARCH_WANT_SYS_FORK 31# define __ARCH_WANT_SYS_FORK
33# define __ARCH_WANT_SYS_VFORK 32# define __ARCH_WANT_SYS_VFORK
34# define __ARCH_WANT_SYS_CLONE 33# define __ARCH_WANT_SYS_CLONE
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 0c7d365fa402..9f2edb5c5551 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -41,8 +41,6 @@ config SPARC
41 select GENERIC_STRNCPY_FROM_USER 41 select GENERIC_STRNCPY_FROM_USER
42 select GENERIC_STRNLEN_USER 42 select GENERIC_STRNLEN_USER
43 select MODULES_USE_ELF_RELA 43 select MODULES_USE_ELF_RELA
44 select GENERIC_KERNEL_THREAD
45 select GENERIC_KERNEL_EXECVE
46 44
47config SPARC32 45config SPARC32
48 def_bool !64BIT 46 def_bool !64BIT
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h
index 497386a7ed28..87ce24c5eb95 100644
--- a/arch/sparc/include/asm/unistd.h
+++ b/arch/sparc/include/asm/unistd.h
@@ -47,7 +47,6 @@
47#define __ARCH_WANT_COMPAT_SYS_SENDFILE 47#define __ARCH_WANT_COMPAT_SYS_SENDFILE
48#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL 48#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
49#endif 49#endif
50#define __ARCH_WANT_SYS_EXECVE
51 50
52/* 51/*
53 * "Conditional" syscalls 52 * "Conditional" syscalls
diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h
index 1a041892538f..c4ffd6c97106 100644
--- a/arch/sparc/include/uapi/asm/signal.h
+++ b/arch/sparc/include/uapi/asm/signal.h
@@ -147,12 +147,6 @@ struct sigstack {
147#define SIG_UNBLOCK 0x02 /* for unblocking signals */ 147#define SIG_UNBLOCK 0x02 /* for unblocking signals */
148#define SIG_SETMASK 0x04 /* for setting the signal mask */ 148#define SIG_SETMASK 0x04 /* for setting the signal mask */
149 149
150/*
151 * sigaltstack controls
152 */
153#define SS_ONSTACK 1
154#define SS_DISABLE 2
155
156#define MINSIGSTKSZ 4096 150#define MINSIGSTKSZ 4096
157#define SIGSTKSZ 16384 151#define SIGSTKSZ 16384
158 152
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index ea7f61e8bc9e..875d008828b8 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -21,8 +21,6 @@ config TILE
21 select ARCH_HAVE_NMI_SAFE_CMPXCHG 21 select ARCH_HAVE_NMI_SAFE_CMPXCHG
22 select GENERIC_CLOCKEVENTS 22 select GENERIC_CLOCKEVENTS
23 select MODULES_USE_ELF_RELA 23 select MODULES_USE_ELF_RELA
24 select GENERIC_KERNEL_THREAD
25 select GENERIC_KERNEL_EXECVE
26 24
27# FIXME: investigate whether we need/want these options. 25# FIXME: investigate whether we need/want these options.
28# select HAVE_IOREMAP_PROT 26# select HAVE_IOREMAP_PROT
diff --git a/arch/tile/include/asm/ptrace.h b/arch/tile/include/asm/ptrace.h
index 5ce052e16b7b..2e83fc1b9467 100644
--- a/arch/tile/include/asm/ptrace.h
+++ b/arch/tile/include/asm/ptrace.h
@@ -35,6 +35,7 @@ typedef unsigned long pt_reg_t;
35 35
36#define instruction_pointer(regs) ((regs)->pc) 36#define instruction_pointer(regs) ((regs)->pc)
37#define profile_pc(regs) instruction_pointer(regs) 37#define profile_pc(regs) instruction_pointer(regs)
38#define user_stack_pointer(regs) ((regs)->sp)
38 39
39/* Does the process account for user or for system time? */ 40/* Does the process account for user or for system time? */
40#define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL) 41#define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL)
diff --git a/arch/tile/include/asm/unistd.h b/arch/tile/include/asm/unistd.h
index fe841e7d4963..6ac21034f69a 100644
--- a/arch/tile/include/asm/unistd.h
+++ b/arch/tile/include/asm/unistd.h
@@ -17,6 +17,5 @@
17#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL 17#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
18#endif 18#endif
19#define __ARCH_WANT_SYS_NEWFSTATAT 19#define __ARCH_WANT_SYS_NEWFSTATAT
20#define __ARCH_WANT_SYS_EXECVE
21#define __ARCH_WANT_SYS_CLONE 20#define __ARCH_WANT_SYS_CLONE
22#include <uapi/asm/unistd.h> 21#include <uapi/asm/unistd.h>
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index db18eb6124e1..48ccf718e290 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -132,8 +132,3 @@ long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
132 siginitset(&blocked, mask); 132 siginitset(&blocked, mask);
133 return sigsuspend(&blocked); 133 return sigsuspend(&blocked);
134} 134}
135
136long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
137{
138 return do_sigaltstack(uss, uoss, PT_REGS_SP(&current->thread.regs));
139}
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index c4fbb21e802b..60651df5f952 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -16,8 +16,6 @@ config UNICORE32
16 select ARCH_WANT_FRAME_POINTERS 16 select ARCH_WANT_FRAME_POINTERS
17 select GENERIC_IOMAP 17 select GENERIC_IOMAP
18 select MODULES_USE_ELF_REL 18 select MODULES_USE_ELF_REL
19 select GENERIC_KERNEL_THREAD
20 select GENERIC_KERNEL_EXECVE
21 help 19 help
22 UniCore-32 is 32-bit Instruction Set Architecture, 20 UniCore-32 is 32-bit Instruction Set Architecture,
23 including a series of low-power-consumption RISC chip 21 including a series of low-power-consumption RISC chip
diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h
index 726749dab52f..9df53d991c78 100644
--- a/arch/unicore32/include/asm/ptrace.h
+++ b/arch/unicore32/include/asm/ptrace.h
@@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs)
54} 54}
55 55
56#define instruction_pointer(regs) ((regs)->UCreg_pc) 56#define instruction_pointer(regs) ((regs)->UCreg_pc)
57#define user_stack_pointer(regs) ((regs)->UCreg_sp)
57 58
58#endif /* __ASSEMBLY__ */ 59#endif /* __ASSEMBLY__ */
59#endif 60#endif
diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h
index 00cf5e286fca..d4cc4559d848 100644
--- a/arch/unicore32/include/uapi/asm/unistd.h
+++ b/arch/unicore32/include/uapi/asm/unistd.h
@@ -12,5 +12,4 @@
12 12
13/* Use the standard ABI for syscalls. */ 13/* Use the standard ABI for syscalls. */
14#include <asm-generic/unistd.h> 14#include <asm-generic/unistd.h>
15#define __ARCH_WANT_SYS_EXECVE
16#define __ARCH_WANT_SYS_CLONE 15#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 97f8c5ad8c2d..79795af59810 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -110,11 +110,10 @@ config X86
110 select GENERIC_STRNLEN_USER 110 select GENERIC_STRNLEN_USER
111 select HAVE_CONTEXT_TRACKING if X86_64 111 select HAVE_CONTEXT_TRACKING if X86_64
112 select HAVE_IRQ_TIME_ACCOUNTING 112 select HAVE_IRQ_TIME_ACCOUNTING
113 select GENERIC_KERNEL_THREAD
114 select GENERIC_KERNEL_EXECVE
115 select MODULES_USE_ELF_REL if X86_32 113 select MODULES_USE_ELF_REL if X86_32
116 select MODULES_USE_ELF_RELA if X86_64 114 select MODULES_USE_ELF_RELA if X86_64
117 select CLONE_BACKWARDS if X86_32 115 select CLONE_BACKWARDS if X86_32
116 select GENERIC_SIGALTSTACK
118 117
119config INSTRUCTION_DECODER 118config INSTRUCTION_DECODER
120 def_bool y 119 def_bool y
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index efc6a958b71d..a1daf4a65009 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -136,52 +136,6 @@ asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask)
136 return sigsuspend(&blocked); 136 return sigsuspend(&blocked);
137} 137}
138 138
139asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
140 stack_ia32_t __user *uoss_ptr,
141 struct pt_regs *regs)
142{
143 stack_t uss, uoss;
144 int ret, err = 0;
145 mm_segment_t seg;
146
147 if (uss_ptr) {
148 u32 ptr;
149
150 memset(&uss, 0, sizeof(stack_t));
151 if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t)))
152 return -EFAULT;
153
154 get_user_try {
155 get_user_ex(ptr, &uss_ptr->ss_sp);
156 get_user_ex(uss.ss_flags, &uss_ptr->ss_flags);
157 get_user_ex(uss.ss_size, &uss_ptr->ss_size);
158 } get_user_catch(err);
159
160 if (err)
161 return -EFAULT;
162 uss.ss_sp = compat_ptr(ptr);
163 }
164 seg = get_fs();
165 set_fs(KERNEL_DS);
166 ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL),
167 (stack_t __force __user *) &uoss, regs->sp);
168 set_fs(seg);
169 if (ret >= 0 && uoss_ptr) {
170 if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
171 return -EFAULT;
172
173 put_user_try {
174 put_user_ex(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp);
175 put_user_ex(uoss.ss_flags, &uoss_ptr->ss_flags);
176 put_user_ex(uoss.ss_size, &uoss_ptr->ss_size);
177 } put_user_catch(err);
178
179 if (err)
180 ret = -EFAULT;
181 }
182 return ret;
183}
184
185/* 139/*
186 * Do a signal return; undo the signal stack. 140 * Do a signal return; undo the signal stack.
187 */ 141 */
@@ -292,7 +246,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
292 struct rt_sigframe_ia32 __user *frame; 246 struct rt_sigframe_ia32 __user *frame;
293 sigset_t set; 247 sigset_t set;
294 unsigned int ax; 248 unsigned int ax;
295 struct pt_regs tregs;
296 249
297 frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4); 250 frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4);
298 251
@@ -306,8 +259,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
306 if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) 259 if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
307 goto badframe; 260 goto badframe;
308 261
309 tregs = *regs; 262 if (compat_restore_altstack(&frame->uc.uc_stack))
310 if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT)
311 goto badframe; 263 goto badframe;
312 264
313 return ax; 265 return ax;
@@ -515,10 +467,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
515 else 467 else
516 put_user_ex(0, &frame->uc.uc_flags); 468 put_user_ex(0, &frame->uc.uc_flags);
517 put_user_ex(0, &frame->uc.uc_link); 469 put_user_ex(0, &frame->uc.uc_link);
518 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 470 err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);
519 put_user_ex(sas_ss_flags(regs->sp),
520 &frame->uc.uc_stack.ss_flags);
521 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
522 471
523 if (ka->sa.sa_flags & SA_RESTORER) 472 if (ka->sa.sa_flags & SA_RESTORER)
524 restorer = ka->sa.sa_restorer; 473 restorer = ka->sa.sa_restorer;
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 32e6f05ddaaa..102ff7cb3e41 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -464,7 +464,6 @@ GLOBAL(\label)
464 464
465 PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi 465 PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
466 PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi 466 PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
467 PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
468 PTREGSCALL stub32_execve, compat_sys_execve, %rcx 467 PTREGSCALL stub32_execve, compat_sys_execve, %rcx
469 PTREGSCALL stub32_fork, sys_fork, %rdi 468 PTREGSCALL stub32_fork, sys_fork, %rdi
470 PTREGSCALL stub32_vfork, sys_vfork, %rdi 469 PTREGSCALL stub32_vfork, sys_vfork, %rdi
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h
index e6232773ce49..4c6da2e4bb1d 100644
--- a/arch/x86/include/asm/ia32.h
+++ b/arch/x86/include/asm/ia32.h
@@ -29,16 +29,10 @@ struct old_sigaction32 {
29 unsigned int sa_restorer; /* Another 32 bit pointer */ 29 unsigned int sa_restorer; /* Another 32 bit pointer */
30}; 30};
31 31
32typedef struct sigaltstack_ia32 {
33 unsigned int ss_sp;
34 int ss_flags;
35 unsigned int ss_size;
36} stack_ia32_t;
37
38struct ucontext_ia32 { 32struct ucontext_ia32 {
39 unsigned int uc_flags; 33 unsigned int uc_flags;
40 unsigned int uc_link; 34 unsigned int uc_link;
41 stack_ia32_t uc_stack; 35 compat_stack_t uc_stack;
42 struct sigcontext_ia32 uc_mcontext; 36 struct sigcontext_ia32 uc_mcontext;
43 compat_sigset_t uc_sigmask; /* mask last for extensibility */ 37 compat_sigset_t uc_sigmask; /* mask last for extensibility */
44}; 38};
@@ -46,7 +40,7 @@ struct ucontext_ia32 {
46struct ucontext_x32 { 40struct ucontext_x32 {
47 unsigned int uc_flags; 41 unsigned int uc_flags;
48 unsigned int uc_link; 42 unsigned int uc_link;
49 stack_ia32_t uc_stack; 43 compat_stack_t uc_stack;
50 unsigned int uc__pad0; /* needed for alignment */ 44 unsigned int uc__pad0; /* needed for alignment */
51 struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */ 45 struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
52 compat_sigset_t uc_sigmask; /* mask last for extensibility */ 46 compat_sigset_t uc_sigmask; /* mask last for extensibility */
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 03ca442d8f0d..942a08623a1a 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -133,6 +133,13 @@ static inline bool user_64bit_mode(struct pt_regs *regs)
133 return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs; 133 return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;
134#endif 134#endif
135} 135}
136
137#define current_user_stack_pointer() this_cpu_read(old_rsp)
138/* ia32 vs. x32 difference */
139#define compat_user_stack_pointer() \
140 (test_thread_flag(TIF_IA32) \
141 ? current_pt_regs()->sp \
142 : this_cpu_read(old_rsp))
136#endif 143#endif
137 144
138#ifdef CONFIG_X86_32 145#ifdef CONFIG_X86_32
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index c76fae4d90be..31f61f96e0fb 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -69,8 +69,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned,
69 69
70/* ia32/ia32_signal.c */ 70/* ia32/ia32_signal.c */
71asmlinkage long sys32_sigsuspend(int, int, old_sigset_t); 71asmlinkage long sys32_sigsuspend(int, int, old_sigset_t);
72asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *,
73 stack_ia32_t __user *, struct pt_regs *);
74asmlinkage long sys32_sigreturn(struct pt_regs *); 72asmlinkage long sys32_sigreturn(struct pt_regs *);
75asmlinkage long sys32_rt_sigreturn(struct pt_regs *); 73asmlinkage long sys32_rt_sigreturn(struct pt_regs *);
76 74
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 2f8374718aa3..58b7e3eac0ae 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -25,9 +25,6 @@ asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);
25 25
26/* kernel/signal.c */ 26/* kernel/signal.c */
27long sys_rt_sigreturn(struct pt_regs *); 27long sys_rt_sigreturn(struct pt_regs *);
28long sys_sigaltstack(const stack_t __user *, stack_t __user *,
29 struct pt_regs *);
30
31 28
32/* kernel/tls.c */ 29/* kernel/tls.c */
33asmlinkage int sys_set_thread_area(struct user_desc __user *); 30asmlinkage int sys_set_thread_area(struct user_desc __user *);
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h
index 1003e69a40d9..a0790e07ba65 100644
--- a/arch/x86/include/asm/unistd.h
+++ b/arch/x86/include/asm/unistd.h
@@ -48,7 +48,6 @@
48# define __ARCH_WANT_SYS_TIME 48# define __ARCH_WANT_SYS_TIME
49# define __ARCH_WANT_SYS_UTIME 49# define __ARCH_WANT_SYS_UTIME
50# define __ARCH_WANT_SYS_WAITPID 50# define __ARCH_WANT_SYS_WAITPID
51# define __ARCH_WANT_SYS_EXECVE
52# define __ARCH_WANT_SYS_FORK 51# define __ARCH_WANT_SYS_FORK
53# define __ARCH_WANT_SYS_VFORK 52# define __ARCH_WANT_SYS_VFORK
54# define __ARCH_WANT_SYS_CLONE 53# define __ARCH_WANT_SYS_CLONE
diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h
index 0818f9a8e889..aa7d6ae39e0e 100644
--- a/arch/x86/include/uapi/asm/signal.h
+++ b/arch/x86/include/uapi/asm/signal.h
@@ -87,12 +87,6 @@ typedef unsigned long sigset_t;
87 87
88#define SA_RESTORER 0x04000000 88#define SA_RESTORER 0x04000000
89 89
90/*
91 * sigaltstack controls
92 */
93#define SS_ONSTACK 1
94#define SS_DISABLE 2
95
96#define MINSIGSTKSZ 2048 90#define MINSIGSTKSZ 2048
97#define SIGSTKSZ 8192 91#define SIGSTKSZ 8192
98 92
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c763116c5359..ff84d5469d77 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -739,7 +739,6 @@ ENTRY(ptregs_##name) ; \
739ENDPROC(ptregs_##name) 739ENDPROC(ptregs_##name)
740 740
741PTREGSCALL1(iopl) 741PTREGSCALL1(iopl)
742PTREGSCALL2(sigaltstack)
743PTREGSCALL0(sigreturn) 742PTREGSCALL0(sigreturn)
744PTREGSCALL0(rt_sigreturn) 743PTREGSCALL0(rt_sigreturn)
745PTREGSCALL2(vm86) 744PTREGSCALL2(vm86)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 70641aff0c25..07a7a04529bc 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -864,7 +864,6 @@ END(stub_\func)
864 FORK_LIKE clone 864 FORK_LIKE clone
865 FORK_LIKE fork 865 FORK_LIKE fork
866 FORK_LIKE vfork 866 FORK_LIKE vfork
867 PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
868 PTREGSCALL stub_iopl, sys_iopl, %rsi 867 PTREGSCALL stub_iopl, sys_iopl, %rsi
869 868
870ENTRY(ptregscall_common) 869ENTRY(ptregscall_common)
@@ -913,8 +912,6 @@ ENTRY(stub_rt_sigreturn)
913END(stub_rt_sigreturn) 912END(stub_rt_sigreturn)
914 913
915#ifdef CONFIG_X86_X32_ABI 914#ifdef CONFIG_X86_X32_ABI
916 PTREGSCALL stub_x32_sigaltstack, sys32_sigaltstack, %rdx
917
918ENTRY(stub_x32_rt_sigreturn) 915ENTRY(stub_x32_rt_sigreturn)
919 CFI_STARTPROC 916 CFI_STARTPROC
920 addq $8, %rsp 917 addq $8, %rsp
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index fbbb604313a2..d6bf1f34a6e9 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -364,10 +364,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
364 else 364 else
365 put_user_ex(0, &frame->uc.uc_flags); 365 put_user_ex(0, &frame->uc.uc_flags);
366 put_user_ex(0, &frame->uc.uc_link); 366 put_user_ex(0, &frame->uc.uc_link);
367 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 367 err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
368 put_user_ex(sas_ss_flags(regs->sp),
369 &frame->uc.uc_stack.ss_flags);
370 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
371 368
372 /* Set up to return from userspace. */ 369 /* Set up to return from userspace. */
373 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); 370 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
@@ -414,7 +411,6 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
414 struct rt_sigframe __user *frame; 411 struct rt_sigframe __user *frame;
415 void __user *fp = NULL; 412 void __user *fp = NULL;
416 int err = 0; 413 int err = 0;
417 struct task_struct *me = current;
418 414
419 frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp); 415 frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp);
420 416
@@ -433,10 +429,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
433 else 429 else
434 put_user_ex(0, &frame->uc.uc_flags); 430 put_user_ex(0, &frame->uc.uc_flags);
435 put_user_ex(0, &frame->uc.uc_link); 431 put_user_ex(0, &frame->uc.uc_link);
436 put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 432 err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
437 put_user_ex(sas_ss_flags(regs->sp),
438 &frame->uc.uc_stack.ss_flags);
439 put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
440 433
441 /* Set up to return from userspace. If provided, use a stub 434 /* Set up to return from userspace. If provided, use a stub
442 already in userspace. */ 435 already in userspace. */
@@ -503,10 +496,7 @@ static int x32_setup_rt_frame(int sig, struct k_sigaction *ka,
503 else 496 else
504 put_user_ex(0, &frame->uc.uc_flags); 497 put_user_ex(0, &frame->uc.uc_flags);
505 put_user_ex(0, &frame->uc.uc_link); 498 put_user_ex(0, &frame->uc.uc_link);
506 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 499 err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);
507 put_user_ex(sas_ss_flags(regs->sp),
508 &frame->uc.uc_stack.ss_flags);
509 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
510 put_user_ex(0, &frame->uc.uc__pad0); 500 put_user_ex(0, &frame->uc.uc__pad0);
511 501
512 if (ka->sa.sa_flags & SA_RESTORER) { 502 if (ka->sa.sa_flags & SA_RESTORER) {
@@ -603,13 +593,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
603} 593}
604#endif /* CONFIG_X86_32 */ 594#endif /* CONFIG_X86_32 */
605 595
606long
607sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
608 struct pt_regs *regs)
609{
610 return do_sigaltstack(uss, uoss, regs->sp);
611}
612
613/* 596/*
614 * Do a signal return; undo the signal stack. 597 * Do a signal return; undo the signal stack.
615 */ 598 */
@@ -659,7 +642,7 @@ long sys_rt_sigreturn(struct pt_regs *regs)
659 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) 642 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
660 goto badframe; 643 goto badframe;
661 644
662 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) 645 if (restore_altstack(&frame->uc.uc_stack))
663 goto badframe; 646 goto badframe;
664 647
665 return ax; 648 return ax;
@@ -865,7 +848,6 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs)
865 struct rt_sigframe_x32 __user *frame; 848 struct rt_sigframe_x32 __user *frame;
866 sigset_t set; 849 sigset_t set;
867 unsigned long ax; 850 unsigned long ax;
868 struct pt_regs tregs;
869 851
870 frame = (struct rt_sigframe_x32 __user *)(regs->sp - 8); 852 frame = (struct rt_sigframe_x32 __user *)(regs->sp - 8);
871 853
@@ -879,8 +861,7 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs)
879 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) 861 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
880 goto badframe; 862 goto badframe;
881 863
882 tregs = *regs; 864 if (compat_restore_altstack(&frame->uc.uc_stack))
883 if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT)
884 goto badframe; 865 goto badframe;
885 866
886 return ax; 867 return ax;
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 05f404f53f59..28e3fa9056ea 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -192,7 +192,7 @@
192183 i386 getcwd sys_getcwd 192183 i386 getcwd sys_getcwd
193184 i386 capget sys_capget 193184 i386 capget sys_capget
194185 i386 capset sys_capset 194185 i386 capset sys_capset
195186 i386 sigaltstack ptregs_sigaltstack stub32_sigaltstack 195186 i386 sigaltstack sys_sigaltstack compat_sys_sigaltstack
196187 i386 sendfile sys_sendfile sys32_sendfile 196187 i386 sendfile sys_sendfile sys32_sendfile
197188 i386 getpmsg 197188 i386 getpmsg
198189 i386 putpmsg 198189 i386 putpmsg
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
index 7c58c84b7bc8..dc97328bd90a 100644
--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/arch/x86/syscalls/syscall_64.tbl
@@ -137,7 +137,7 @@
137128 64 rt_sigtimedwait sys_rt_sigtimedwait 137128 64 rt_sigtimedwait sys_rt_sigtimedwait
138129 64 rt_sigqueueinfo sys_rt_sigqueueinfo 138129 64 rt_sigqueueinfo sys_rt_sigqueueinfo
139130 common rt_sigsuspend sys_rt_sigsuspend 139130 common rt_sigsuspend sys_rt_sigsuspend
140131 64 sigaltstack stub_sigaltstack 140131 64 sigaltstack sys_sigaltstack
141132 common utime sys_utime 141132 common utime sys_utime
142133 common mknod sys_mknod 142133 common mknod sys_mknod
143134 64 uselib 143134 64 uselib
@@ -338,7 +338,7 @@
338522 x32 rt_sigpending sys32_rt_sigpending 338522 x32 rt_sigpending sys32_rt_sigpending
339523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait 339523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait
340524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo 340524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo
341525 x32 sigaltstack stub_x32_sigaltstack 341525 x32 sigaltstack compat_sys_sigaltstack
342526 x32 timer_create compat_sys_timer_create 342526 x32 timer_create compat_sys_timer_create
343527 x32 mq_notify compat_sys_mq_notify 343527 x32 mq_notify compat_sys_mq_notify
344528 x32 kexec_load compat_sys_kexec_load 344528 x32 kexec_load compat_sys_kexec_load
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 983997041963..53c90fd412d1 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -13,8 +13,7 @@ endmenu
13config UML_X86 13config UML_X86
14 def_bool y 14 def_bool y
15 select GENERIC_FIND_FIRST_BIT 15 select GENERIC_FIND_FIRST_BIT
16 select GENERIC_KERNEL_THREAD 16 select GENERIC_SIGALTSTACK
17 select GENERIC_KERNEL_EXECVE
18 17
19config 64BIT 18config 64BIT
20 bool "64-bit kernel" if SUBARCH = "x86" 19 bool "64-bit kernel" if SUBARCH = "x86"
diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h
index 755133258c45..54f8102ccde5 100644
--- a/arch/x86/um/asm/ptrace.h
+++ b/arch/x86/um/asm/ptrace.h
@@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code,
86 unsigned long __user *addr); 86 unsigned long __user *addr);
87 87
88#endif 88#endif
89#define user_stack_pointer(regs) PT_REGS_SP(regs)
89#endif /* __UM_X86_PTRACE_H */ 90#endif /* __UM_X86_PTRACE_H */
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index bdaa08cfbcf4..71cef48ea5cd 100644
--- a/arch/x86/um/signal.c
+++ b/arch/x86/um/signal.c
@@ -342,9 +342,7 @@ static int copy_ucontext_to_user(struct ucontext __user *uc,
342{ 342{
343 int err = 0; 343 int err = 0;
344 344
345 err |= put_user(current->sas_ss_sp, &uc->uc_stack.ss_sp); 345 err |= __save_altstack(&uc->uc_stack, sp);
346 err |= put_user(sas_ss_flags(sp), &uc->uc_stack.ss_flags);
347 err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size);
348 err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, 0); 346 err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, 0);
349 err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set)); 347 err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set));
350 return err; 348 return err;
@@ -529,10 +527,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
529 /* Create the ucontext. */ 527 /* Create the ucontext. */
530 err |= __put_user(0, &frame->uc.uc_flags); 528 err |= __put_user(0, &frame->uc.uc_flags);
531 err |= __put_user(0, &frame->uc.uc_link); 529 err |= __put_user(0, &frame->uc.uc_link);
532 err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 530 err |= __save_altstack(&frame->uc.uc_stack, PT_REGS_SP(regs));
533 err |= __put_user(sas_ss_flags(PT_REGS_SP(regs)),
534 &frame->uc.uc_stack.ss_flags);
535 err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
536 err |= copy_sc_to_user(&frame->uc.uc_mcontext, &frame->fpstate, regs, 531 err |= copy_sc_to_user(&frame->uc.uc_mcontext, &frame->fpstate, regs,
537 set->sig[0]); 532 set->sig[0]);
538 err |= __put_user(&frame->fpstate, &frame->uc.uc_mcontext.fpstate); 533 err |= __put_user(&frame->fpstate, &frame->uc.uc_mcontext.fpstate);
diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c
index 812e98c098e4..a0c3b0d1a122 100644
--- a/arch/x86/um/sys_call_table_32.c
+++ b/arch/x86/um/sys_call_table_32.c
@@ -27,7 +27,6 @@
27#define ptregs_iopl sys_iopl 27#define ptregs_iopl sys_iopl
28#define ptregs_vm86old sys_vm86old 28#define ptregs_vm86old sys_vm86old
29#define ptregs_vm86 sys_vm86 29#define ptregs_vm86 sys_vm86
30#define ptregs_sigaltstack sys_sigaltstack
31 30
32#define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; 31#define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ;
33#include <asm/syscalls_32.h> 32#include <asm/syscalls_32.h>
diff --git a/arch/x86/um/sys_call_table_64.c b/arch/x86/um/sys_call_table_64.c
index 170bd926a69c..f2f0723070ca 100644
--- a/arch/x86/um/sys_call_table_64.c
+++ b/arch/x86/um/sys_call_table_64.c
@@ -31,7 +31,6 @@
31#define stub_fork sys_fork 31#define stub_fork sys_fork
32#define stub_vfork sys_vfork 32#define stub_vfork sys_vfork
33#define stub_execve sys_execve 33#define stub_execve sys_execve
34#define stub_sigaltstack sys_sigaltstack
35#define stub_rt_sigreturn sys_rt_sigreturn 34#define stub_rt_sigreturn sys_rt_sigreturn
36 35
37#define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat) 36#define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat)
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 73d34e77c39c..5aab1acabf1c 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -13,8 +13,6 @@ config XTENSA
13 select GENERIC_CPU_DEVICES 13 select GENERIC_CPU_DEVICES
14 select MODULES_USE_ELF_RELA 14 select MODULES_USE_ELF_RELA
15 select GENERIC_PCI_IOMAP 15 select GENERIC_PCI_IOMAP
16 select GENERIC_KERNEL_THREAD
17 select GENERIC_KERNEL_EXECVE
18 select ARCH_WANT_OPTIONAL_GPIOLIB 16 select ARCH_WANT_OPTIONAL_GPIOLIB
19 select CLONE_BACKWARDS 17 select CLONE_BACKWARDS
20 select IRQ_DOMAIN 18 select IRQ_DOMAIN
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h
index 58bf6fd3f913..682b1deac1f2 100644
--- a/arch/xtensa/include/asm/ptrace.h
+++ b/arch/xtensa/include/asm/ptrace.h
@@ -63,6 +63,8 @@ struct pt_regs {
63# define profile_pc(regs) instruction_pointer(regs) 63# define profile_pc(regs) instruction_pointer(regs)
64# endif 64# endif
65 65
66#define user_stack_pointer(regs) ((regs)->areg[1])
67
66#else /* __ASSEMBLY__ */ 68#else /* __ASSEMBLY__ */
67 69
68# include <asm/asm-offsets.h> 70# include <asm/asm-offsets.h>
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h
index e002dbcc88b6..eb63ea87815c 100644
--- a/arch/xtensa/include/asm/unistd.h
+++ b/arch/xtensa/include/asm/unistd.h
@@ -1,7 +1,6 @@
1#ifndef _XTENSA_UNISTD_H 1#ifndef _XTENSA_UNISTD_H
2#define _XTENSA_UNISTD_H 2#define _XTENSA_UNISTD_H
3 3
4#define __ARCH_WANT_SYS_EXECVE
5#define __ARCH_WANT_SYS_CLONE 4#define __ARCH_WANT_SYS_CLONE
6#include <uapi/asm/unistd.h> 5#include <uapi/asm/unistd.h>
7 6
diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h
index b88ce96f2af9..dacf716dd3e0 100644
--- a/arch/xtensa/include/uapi/asm/signal.h
+++ b/arch/xtensa/include/uapi/asm/signal.h
@@ -97,12 +97,6 @@ typedef struct {
97 97
98#define SA_RESTORER 0x04000000 98#define SA_RESTORER 0x04000000
99 99
100/*
101 * sigaltstack controls
102 */
103#define SS_ONSTACK 1
104#define SS_DISABLE 2
105
106#define MINSIGSTKSZ 2048 100#define MINSIGSTKSZ 2048
107#define SIGSTKSZ 8192 101#define SIGSTKSZ 8192
108 102