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/unicore32 | |
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/unicore32')
-rw-r--r-- | arch/unicore32/include/uapi/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/unicore32/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/unicore32/kernel/process.c | 11 | ||||
-rw-r--r-- | arch/unicore32/kernel/sys.c | 14 |
4 files changed, 7 insertions, 25 deletions
diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index d18a3be89b38..00cf5e286fca 100644 --- a/arch/unicore32/include/uapi/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h | |||
@@ -13,3 +13,4 @@ | |||
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 | 15 | #define __ARCH_WANT_SYS_EXECVE |
16 | #define __ARCH_WANT_SYS_CLONE | ||
diff --git a/arch/unicore32/kernel/entry.S b/arch/unicore32/kernel/entry.S index 7049350c790f..581630d91444 100644 --- a/arch/unicore32/kernel/entry.S +++ b/arch/unicore32/kernel/entry.S | |||
@@ -668,12 +668,6 @@ __cr_alignment: | |||
668 | #endif | 668 | #endif |
669 | .ltorg | 669 | .ltorg |
670 | 670 | ||
671 | ENTRY(sys_clone) | ||
672 | add ip, sp, #S_OFF | ||
673 | stw ip, [sp+], #4 | ||
674 | b __sys_clone | ||
675 | ENDPROC(sys_clone) | ||
676 | |||
677 | ENTRY(sys_rt_sigreturn) | 671 | ENTRY(sys_rt_sigreturn) |
678 | add r0, sp, #S_OFF | 672 | add r0, sp, #S_OFF |
679 | mov why, #0 @ prevent syscall restart handling | 673 | mov why, #0 @ prevent syscall restart handling |
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index a8fe265ce2c0..62bad9fed03e 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
@@ -262,26 +262,27 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); | |||
262 | 262 | ||
263 | int | 263 | int |
264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
265 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs) | 265 | unsigned long stk_sz, struct task_struct *p) |
266 | { | 266 | { |
267 | struct thread_info *thread = task_thread_info(p); | 267 | struct thread_info *thread = task_thread_info(p); |
268 | struct pt_regs *childregs = task_pt_regs(p); | 268 | struct pt_regs *childregs = task_pt_regs(p); |
269 | 269 | ||
270 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); | 270 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); |
271 | thread->cpu_context.sp = (unsigned long)childregs; | 271 | thread->cpu_context.sp = (unsigned long)childregs; |
272 | if (unlikely(!regs)) { | 272 | if (unlikely(p->flags & PF_KTHREAD)) { |
273 | thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread; | 273 | thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread; |
274 | thread->cpu_context.r4 = stack_start; | 274 | thread->cpu_context.r4 = stack_start; |
275 | thread->cpu_context.r5 = stk_sz; | 275 | thread->cpu_context.r5 = stk_sz; |
276 | memset(childregs, 0, sizeof(struct pt_regs)); | 276 | memset(childregs, 0, sizeof(struct pt_regs)); |
277 | } else { | 277 | } else { |
278 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | 278 | thread->cpu_context.pc = (unsigned long)ret_from_fork; |
279 | *childregs = *regs; | 279 | *childregs = *current_pt_regs(); |
280 | childregs->UCreg_00 = 0; | 280 | childregs->UCreg_00 = 0; |
281 | childregs->UCreg_sp = stack_start; | 281 | if (stack_start) |
282 | childregs->UCreg_sp = stack_start; | ||
282 | 283 | ||
283 | if (clone_flags & CLONE_SETTLS) | 284 | if (clone_flags & CLONE_SETTLS) |
284 | childregs->UCreg_16 = regs->UCreg_03; | 285 | childregs->UCreg_16 = childregs->UCreg_03; |
285 | } | 286 | } |
286 | return 0; | 287 | return 0; |
287 | } | 288 | } |
diff --git a/arch/unicore32/kernel/sys.c b/arch/unicore32/kernel/sys.c index 9680134b31f0..cfe79c9529b3 100644 --- a/arch/unicore32/kernel/sys.c +++ b/arch/unicore32/kernel/sys.c | |||
@@ -28,20 +28,6 @@ | |||
28 | #include <asm/syscalls.h> | 28 | #include <asm/syscalls.h> |
29 | #include <asm/cacheflush.h> | 29 | #include <asm/cacheflush.h> |
30 | 30 | ||
31 | /* Clone a task - this clones the calling program thread. | ||
32 | * This is called indirectly via a small wrapper | ||
33 | */ | ||
34 | asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
35 | void __user *parent_tid, void __user *child_tid, | ||
36 | struct pt_regs *regs) | ||
37 | { | ||
38 | if (!newsp) | ||
39 | newsp = regs->UCreg_sp; | ||
40 | |||
41 | return do_fork(clone_flags, newsp, regs, 0, | ||
42 | parent_tid, child_tid); | ||
43 | } | ||
44 | |||
45 | /* Note: used by the compat code even in 64-bit Linux. */ | 31 | /* Note: used by the compat code even in 64-bit Linux. */ |
46 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, | 32 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, |
47 | unsigned long, prot, unsigned long, flags, | 33 | unsigned long, prot, unsigned long, flags, |