From 8cddebd767c5059257022cfbc2ac53fd81c09c94 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 17 Oct 2012 02:26:48 -0400 Subject: um: don't bother with passing sp to do_fork() for fork(2)/vfork(2) copy_thread() on um will do the right thing when getting 0 for sp... Signed-off-by: Al Viro --- arch/um/kernel/syscall.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'arch/um') diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index a81f3705e90f..3a875226c8ef 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c @@ -16,23 +16,19 @@ long sys_fork(void) { - return do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), + return do_fork(SIGCHLD, 0, ¤t->thread.regs, 0, NULL, NULL); } long sys_vfork(void) { - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, - UPT_SP(¤t->thread.regs.regs), + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, ¤t->thread.regs, 0, NULL, NULL); } long sys_clone(unsigned long clone_flags, unsigned long newsp, void __user *parent_tid, void __user *child_tid) { - if (!newsp) - newsp = UPT_SP(¤t->thread.regs.regs); - return do_fork(clone_flags, newsp, ¤t->thread.regs, 0, parent_tid, child_tid); } -- cgit v1.2.2 From 2b067fc9dd143be5e0ee94bae0fbd28ea0a407f8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 29 Oct 2012 21:36:45 -0400 Subject: um: don't bother looking at regs in copy_thread() - current_pt_regs() is what we'll get Signed-off-by: Al Viro --- arch/um/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/um') diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index b6d699cdd557..c502c804e8bb 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -171,7 +171,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, p->thread = (struct thread_struct) INIT_THREAD; if (!kthread) { - memcpy(&p->thread.regs.regs, ®s->regs, + memcpy(&p->thread.regs.regs, current_pt_regs(), sizeof(p->thread.regs.regs)); PT_REGS_SET_SYSCALL_RETURN(&p->thread.regs, 0); if (sp != 0) -- cgit v1.2.2 From 1d4b4b2994b5fc208963c0b795291f8c1f18becf Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 22 Oct 2012 22:34:11 -0400 Subject: x86, um: switch to generic fork/vfork/clone Signed-off-by: Al Viro --- arch/um/kernel/syscall.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'arch/um') diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index 3a875226c8ef..c1d0ae069b53 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c @@ -14,25 +14,6 @@ #include #include -long sys_fork(void) -{ - return do_fork(SIGCHLD, 0, - ¤t->thread.regs, 0, NULL, NULL); -} - -long sys_vfork(void) -{ - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, - ¤t->thread.regs, 0, NULL, NULL); -} - -long sys_clone(unsigned long clone_flags, unsigned long newsp, - void __user *parent_tid, void __user *child_tid) -{ - return do_fork(clone_flags, newsp, ¤t->thread.regs, 0, parent_tid, - child_tid); -} - long old_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long offset) -- cgit v1.2.2 From afa86fc426ff7e7f5477f15da9c405d08d5cf790 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 22 Oct 2012 22:51:14 -0400 Subject: flagday: don't pass regs to copy_thread() Signed-off-by: Al Viro --- arch/um/kernel/process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/um') diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index c502c804e8bb..b462b13c5bae 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -161,8 +161,7 @@ void fork_handler(void) } int copy_thread(unsigned long clone_flags, unsigned long sp, - unsigned long arg, struct task_struct * p, - struct pt_regs *regs) + unsigned long arg, struct task_struct * p) { void (*handler)(void); int kthread = current->flags & PF_KTHREAD; -- cgit v1.2.2