diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 15:22:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 15:22:13 -0500 |
commit | 9977d9b379cb77e0f67bd6f4563618106e58e11d (patch) | |
tree | 0191accfddf578edb52c69c933d64521e3dce297 /arch/tile/include | |
parent | cf4af01221579a4e895f43dbfc47598fbfc5a731 (diff) | |
parent | 541880d9a2c7871f6370071d55aa6662d329c51e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull big execve/kernel_thread/fork unification series from Al Viro:
"All architectures are converted to new model. Quite a bit of that
stuff is actually shared with architecture trees; in such cases it's
literally shared branch pulled by both, not a cherry-pick.
A lot of ugliness and black magic is gone (-3KLoC total in this one):
- kernel_thread()/kernel_execve()/sys_execve() redesign.
We don't do syscalls from kernel anymore for either kernel_thread()
or kernel_execve():
kernel_thread() is essentially clone(2) with callback run before we
return to userland, the callbacks either never return or do
successful do_execve() before returning.
kernel_execve() is a wrapper for do_execve() - it doesn't need to
do transition to user mode anymore.
As a result kernel_thread() and kernel_execve() are
arch-independent now - they live in kernel/fork.c and fs/exec.c
resp. sys_execve() is also in fs/exec.c and it's completely
architecture-independent.
- daemonize() is gone, along with its parts in fs/*.c
- struct pt_regs * is no longer passed to do_fork/copy_process/
copy_thread/do_execve/search_binary_handler/->load_binary/do_coredump.
- sys_fork()/sys_vfork()/sys_clone() unified; some architectures
still need wrappers (ones with callee-saved registers not saved in
pt_regs on syscall entry), but the main part of those suckers is in
kernel/fork.c now."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (113 commits)
do_coredump(): get rid of pt_regs argument
print_fatal_signal(): get rid of pt_regs argument
ptrace_signal(): get rid of unused arguments
get rid of ptrace_signal_deliver() arguments
new helper: signal_pt_regs()
unify default ptrace_signal_deliver
flagday: kill pt_regs argument of do_fork()
death to idle_regs()
don't pass regs to copy_process()
flagday: don't pass regs to copy_thread()
bfin: switch to generic vfork, get rid of pointless wrappers
xtensa: switch to generic clone()
openrisc: switch to use of generic fork and clone
unicore32: switch to generic clone(2)
score: switch to generic fork/vfork/clone
c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone()
take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h
mn10300: switch to generic fork/vfork/clone
h8300: switch to generic fork/vfork/clone
tile: switch to generic clone()
...
Conflicts:
arch/microblaze/include/asm/Kbuild
Diffstat (limited to 'arch/tile/include')
-rw-r--r-- | arch/tile/include/asm/compat.h | 15 | ||||
-rw-r--r-- | arch/tile/include/asm/elf.h | 1 | ||||
-rw-r--r-- | arch/tile/include/asm/processor.h | 6 | ||||
-rw-r--r-- | arch/tile/include/asm/switch_to.h | 5 | ||||
-rw-r--r-- | arch/tile/include/asm/syscalls.h | 13 | ||||
-rw-r--r-- | arch/tile/include/asm/unistd.h | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 3063e6fc8daa..ca61fb4296b3 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h | |||
@@ -275,18 +275,14 @@ extern int compat_setup_rt_frame(int sig, struct k_sigaction *ka, | |||
275 | struct compat_sigaction; | 275 | struct compat_sigaction; |
276 | struct compat_siginfo; | 276 | struct compat_siginfo; |
277 | struct compat_sigaltstack; | 277 | struct compat_sigaltstack; |
278 | long compat_sys_execve(const char __user *path, | ||
279 | compat_uptr_t __user *argv, | ||
280 | compat_uptr_t __user *envp, struct pt_regs *); | ||
281 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, | 278 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, |
282 | struct compat_sigaction __user *oact, | 279 | struct compat_sigaction __user *oact, |
283 | size_t sigsetsize); | 280 | size_t sigsetsize); |
284 | long compat_sys_rt_sigqueueinfo(int pid, int sig, | 281 | long compat_sys_rt_sigqueueinfo(int pid, int sig, |
285 | struct compat_siginfo __user *uinfo); | 282 | struct compat_siginfo __user *uinfo); |
286 | long compat_sys_rt_sigreturn(struct pt_regs *); | 283 | long compat_sys_rt_sigreturn(void); |
287 | long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, | 284 | long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, |
288 | struct compat_sigaltstack __user *uoss_ptr, | 285 | struct compat_sigaltstack __user *uoss_ptr); |
289 | struct pt_regs *); | ||
290 | long compat_sys_truncate64(char __user *filename, u32 dummy, u32 low, u32 high); | 286 | long compat_sys_truncate64(char __user *filename, u32 dummy, u32 low, u32 high); |
291 | long compat_sys_ftruncate64(unsigned int fd, u32 dummy, u32 low, u32 high); | 287 | long compat_sys_ftruncate64(unsigned int fd, u32 dummy, u32 low, u32 high); |
292 | long compat_sys_pread64(unsigned int fd, char __user *ubuf, size_t count, | 288 | long compat_sys_pread64(unsigned int fd, char __user *ubuf, size_t count, |
@@ -303,12 +299,7 @@ long compat_sys_fallocate(int fd, int mode, | |||
303 | long compat_sys_sched_rr_get_interval(compat_pid_t pid, | 299 | long compat_sys_sched_rr_get_interval(compat_pid_t pid, |
304 | struct compat_timespec __user *interval); | 300 | struct compat_timespec __user *interval); |
305 | 301 | ||
306 | /* These are the intvec_64.S trampolines. */ | 302 | /* Assembly trampoline to avoid clobbering r0. */ |
307 | long _compat_sys_execve(const char __user *path, | ||
308 | const compat_uptr_t __user *argv, | ||
309 | const compat_uptr_t __user *envp); | ||
310 | long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, | ||
311 | struct compat_sigaltstack __user *uoss_ptr); | ||
312 | long _compat_sys_rt_sigreturn(void); | 303 | long _compat_sys_rt_sigreturn(void); |
313 | 304 | ||
314 | #endif /* _ASM_TILE_COMPAT_H */ | 305 | #endif /* _ASM_TILE_COMPAT_H */ |
diff --git a/arch/tile/include/asm/elf.h b/arch/tile/include/asm/elf.h index f8ccf08f6934..b73e1039c911 100644 --- a/arch/tile/include/asm/elf.h +++ b/arch/tile/include/asm/elf.h | |||
@@ -148,6 +148,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, | |||
148 | #define compat_start_thread(regs, ip, usp) do { \ | 148 | #define compat_start_thread(regs, ip, usp) do { \ |
149 | regs->pc = ptr_to_compat_reg((void *)(ip)); \ | 149 | regs->pc = ptr_to_compat_reg((void *)(ip)); \ |
150 | regs->sp = ptr_to_compat_reg((void *)(usp)); \ | 150 | regs->sp = ptr_to_compat_reg((void *)(usp)); \ |
151 | single_step_execve(); \ | ||
151 | } while (0) | 152 | } while (0) |
152 | 153 | ||
153 | /* | 154 | /* |
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h index 8c4dd9ff91eb..2b70dfb1442e 100644 --- a/arch/tile/include/asm/processor.h +++ b/arch/tile/include/asm/processor.h | |||
@@ -211,6 +211,7 @@ static inline void start_thread(struct pt_regs *regs, | |||
211 | { | 211 | { |
212 | regs->pc = pc; | 212 | regs->pc = pc; |
213 | regs->sp = usp; | 213 | regs->sp = usp; |
214 | single_step_execve(); | ||
214 | } | 215 | } |
215 | 216 | ||
216 | /* Free all resources held by a thread. */ | 217 | /* Free all resources held by a thread. */ |
@@ -219,8 +220,6 @@ static inline void release_thread(struct task_struct *dead_task) | |||
219 | /* Nothing for now */ | 220 | /* Nothing for now */ |
220 | } | 221 | } |
221 | 222 | ||
222 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | ||
223 | |||
224 | extern int do_work_pending(struct pt_regs *regs, u32 flags); | 223 | extern int do_work_pending(struct pt_regs *regs, u32 flags); |
225 | 224 | ||
226 | 225 | ||
@@ -239,6 +238,9 @@ unsigned long get_wchan(struct task_struct *p); | |||
239 | #define KSTK_TOP(task) (task_ksp0(task) - STACK_TOP_DELTA) | 238 | #define KSTK_TOP(task) (task_ksp0(task) - STACK_TOP_DELTA) |
240 | #define task_pt_regs(task) \ | 239 | #define task_pt_regs(task) \ |
241 | ((struct pt_regs *)(task_ksp0(task) - KSTK_PTREGS_GAP) - 1) | 240 | ((struct pt_regs *)(task_ksp0(task) - KSTK_PTREGS_GAP) - 1) |
241 | #define current_pt_regs() \ | ||
242 | ((struct pt_regs *)((stack_pointer | (THREAD_SIZE - 1)) - \ | ||
243 | (KSTK_PTREGS_GAP - 1)) - 1) | ||
242 | #define task_sp(task) (task_pt_regs(task)->sp) | 244 | #define task_sp(task) (task_pt_regs(task)->sp) |
243 | #define task_pc(task) (task_pt_regs(task)->pc) | 245 | #define task_pc(task) (task_pt_regs(task)->pc) |
244 | /* Aliases for pc and sp (used in fs/proc/array.c) */ | 246 | /* Aliases for pc and sp (used in fs/proc/array.c) */ |
diff --git a/arch/tile/include/asm/switch_to.h b/arch/tile/include/asm/switch_to.h index 1d48c5fee8b7..b8f888cbe6b0 100644 --- a/arch/tile/include/asm/switch_to.h +++ b/arch/tile/include/asm/switch_to.h | |||
@@ -68,7 +68,10 @@ extern unsigned long get_switch_to_pc(void); | |||
68 | /* Support function for forking a new task. */ | 68 | /* Support function for forking a new task. */ |
69 | void ret_from_fork(void); | 69 | void ret_from_fork(void); |
70 | 70 | ||
71 | /* Called from ret_from_fork() when a new process starts up. */ | 71 | /* Support function for forking a new kernel thread. */ |
72 | void ret_from_kernel_thread(void *fn, void *arg); | ||
73 | |||
74 | /* Called from ret_from_xxx() when a new process starts up. */ | ||
72 | struct task_struct *sim_notify_fork(struct task_struct *prev); | 75 | struct task_struct *sim_notify_fork(struct task_struct *prev); |
73 | 76 | ||
74 | #endif /* !__ASSEMBLY__ */ | 77 | #endif /* !__ASSEMBLY__ */ |
diff --git a/arch/tile/include/asm/syscalls.h b/arch/tile/include/asm/syscalls.h index 06f0464cfed9..4c8462a62cb6 100644 --- a/arch/tile/include/asm/syscalls.h +++ b/arch/tile/include/asm/syscalls.h | |||
@@ -51,8 +51,7 @@ long sys_cacheflush(unsigned long addr, unsigned long len, | |||
51 | 51 | ||
52 | #ifndef __tilegx__ | 52 | #ifndef __tilegx__ |
53 | /* mm/fault.c */ | 53 | /* mm/fault.c */ |
54 | long sys_cmpxchg_badaddr(unsigned long address, struct pt_regs *); | 54 | long sys_cmpxchg_badaddr(unsigned long address); |
55 | long _sys_cmpxchg_badaddr(unsigned long address); | ||
56 | #endif | 55 | #endif |
57 | 56 | ||
58 | #ifdef CONFIG_COMPAT | 57 | #ifdef CONFIG_COMPAT |
@@ -63,14 +62,16 @@ long sys_truncate64(const char __user *path, loff_t length); | |||
63 | long sys_ftruncate64(unsigned int fd, loff_t length); | 62 | long sys_ftruncate64(unsigned int fd, loff_t length); |
64 | #endif | 63 | #endif |
65 | 64 | ||
65 | /* Provide versions of standard syscalls that use current_pt_regs(). */ | ||
66 | long sys_rt_sigreturn(void); | ||
67 | long sys_sigaltstack(const stack_t __user *, stack_t __user *); | ||
68 | #define sys_rt_sigreturn sys_rt_sigreturn | ||
69 | #define sys_sigaltstack sys_sigaltstack | ||
70 | |||
66 | /* These are the intvec*.S trampolines. */ | 71 | /* These are the intvec*.S trampolines. */ |
67 | long _sys_sigaltstack(const stack_t __user *, stack_t __user *); | ||
68 | long _sys_rt_sigreturn(void); | 72 | long _sys_rt_sigreturn(void); |
69 | long _sys_clone(unsigned long clone_flags, unsigned long newsp, | 73 | long _sys_clone(unsigned long clone_flags, unsigned long newsp, |
70 | void __user *parent_tid, void __user *child_tid); | 74 | void __user *parent_tid, void __user *child_tid); |
71 | long _sys_execve(const char __user *filename, | ||
72 | const char __user *const __user *argv, | ||
73 | const char __user *const __user *envp); | ||
74 | 75 | ||
75 | #include <asm-generic/syscalls.h> | 76 | #include <asm-generic/syscalls.h> |
76 | 77 | ||
diff --git a/arch/tile/include/asm/unistd.h b/arch/tile/include/asm/unistd.h index 6e032a0a268e..b51c6ee3cd6c 100644 --- a/arch/tile/include/asm/unistd.h +++ b/arch/tile/include/asm/unistd.h | |||
@@ -16,4 +16,6 @@ | |||
16 | #define __ARCH_WANT_SYS_LLSEEK | 16 | #define __ARCH_WANT_SYS_LLSEEK |
17 | #endif | 17 | #endif |
18 | #define __ARCH_WANT_SYS_NEWFSTATAT | 18 | #define __ARCH_WANT_SYS_NEWFSTATAT |
19 | #define __ARCH_WANT_SYS_EXECVE | ||
20 | #define __ARCH_WANT_SYS_CLONE | ||
19 | #include <uapi/asm/unistd.h> | 21 | #include <uapi/asm/unistd.h> |