Commit 1d4b4b29 authored by Al Viro's avatar Al Viro
Browse files

x86, um: switch to generic fork/vfork/clone



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 71613c3b
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -14,25 +14,6 @@
#include <asm/uaccess.h>
#include <asm/unistd.h>

long sys_fork(void)
{
	return do_fork(SIGCHLD, 0,
		      &current->thread.regs, 0, NULL, NULL);
}

long sys_vfork(void)
{
	return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
		      &current->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, &current->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)
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ config X86
	select GENERIC_KERNEL_EXECVE
	select MODULES_USE_ELF_REL if X86_32
	select MODULES_USE_ELF_RELA if X86_64
	select CLONE_BACKWARDS if X86_32

config INSTRUCTION_DECODER
	def_bool y
+6 −1
Original line number Diff line number Diff line
@@ -467,10 +467,15 @@ GLOBAL(\label)
	PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
	PTREGSCALL stub32_execve, compat_sys_execve, %rcx
	PTREGSCALL stub32_fork, sys_fork, %rdi
	PTREGSCALL stub32_clone, sys32_clone, %rdx
	PTREGSCALL stub32_vfork, sys_vfork, %rdi
	PTREGSCALL stub32_iopl, sys_iopl, %rsi

	ALIGN
GLOBAL(stub32_clone)
	leaq sys_clone(%rip),%rax
	mov	%r8, %rcx
	jmp  ia32_ptregs_common	

	ALIGN
ia32_ptregs_common:
	popq %r11
+0 −11
Original line number Diff line number Diff line
@@ -385,17 +385,6 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
	return ret;
}

asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
			    struct pt_regs *regs)
{
	void __user *parent_tid = (void __user *)regs->dx;
	void __user *child_tid = (void __user *)regs->di;

	if (!newsp)
		newsp = regs->sp;
	return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
}

/*
 * Some system calls that need sign extended arguments. This could be
 * done by a generic wrapper.
+0 −2
Original line number Diff line number Diff line
@@ -54,8 +54,6 @@ asmlinkage long sys32_pwrite(unsigned int, const char __user *, u32, u32, u32);
asmlinkage long sys32_personality(unsigned long);
asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32);

asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);

long sys32_lseek(unsigned int, int, unsigned int);
long sys32_kill(int, int);
long sys32_fadvise64_64(int, __u32, __u32, __u32, __u32, int);
Loading