Re: [PATCH] parisc: Wire up clone3 syscall

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 15, 2019 at 10:33:26PM +0200, Helge Deller wrote:
> Untested patch to wire up the clone3 syscall.

>From what I can see from your entry points the treatment for fork and
clone the relevant bit is:

	.macro	fork_like name
ENTRY_CFI(sys_\name\()_wrapper)
	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1
	ldo	TASK_REGS(%r1),%r1
	reg_save %r1
	mfctl	%cr27, %r28
	ldil	L%sys_\name, %r31
	be	R%sys_\name(%sr4,%r31)
	STREG	%r28, PT_CR27(%r1)
ENDPROC_CFI(sys_\name\()_wrapper)
	.endm

Which seems to be identical for fork(), vfork(), and clone().
So parisc doesn't seem to have to muck with any clone-specific args. If
that's the case things should be fine for clone3 on parisc. I only
expect issues for arches that need to shove around specific arguments
for clone.

> 
> Signed-off-by: Helge Deller <deller@xxxxxx>
> 
> diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
> index b0838dc4dfee..cd438e4150f6 100644
> --- a/arch/parisc/include/asm/unistd.h
> +++ b/arch/parisc/include/asm/unistd.h
> @@ -166,6 +166,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
>  #define __ARCH_WANT_SYS_FORK
>  #define __ARCH_WANT_SYS_VFORK
>  #define __ARCH_WANT_SYS_CLONE
> +#define __ARCH_WANT_SYS_CLONE3
>  #define __ARCH_WANT_COMPAT_SYS_SENDFILE
> 
>  #ifdef CONFIG_64BIT
> diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
> index 3e430590c1e1..d9d3387f7c47 100644
> --- a/arch/parisc/kernel/entry.S
> +++ b/arch/parisc/kernel/entry.S
> @@ -1732,6 +1732,7 @@ ENDPROC_CFI(sys_\name\()_wrapper)
>  	.endm
> 
>  fork_like clone
> +fork_like clone3
>  fork_like fork
>  fork_like vfork
> 
> diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl
> index 5022b9e179c2..670d1371aca1 100644
> --- a/arch/parisc/kernel/syscalls/syscall.tbl
> +++ b/arch/parisc/kernel/syscalls/syscall.tbl
> @@ -431,3 +431,4 @@
>  432	common	fsmount				sys_fsmount
>  433	common	fspick				sys_fspick
>  434	common	pidfd_open			sys_pidfd_open
> +435	common	clone3				sys_clone3_wrapper



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux