Skip to contentSkip to conversation

parisc: Wire up clone3 syscall

PATCH In review Helge Deller 2 participants 2 messages Jul 15, 2019 – Jul 16, 2019 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Wire up clone3 syscall

Untested patch to wire up the clone3 syscall.

arch/parisc/include/asm/unistd.h +1 -0
index b0838dc4dfee..cd438e4150f6 100644
@@ -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
arch/parisc/kernel/entry.S +1 -0
index 3e430590c1e1..d9d3387f7c47 100644
@@ -1732,6 +1732,7 @@ ENDPROC_CFI(sys_\name\()_wrapper)
 	.endm
 
 fork_like clone
+fork_like clone3
 fork_like fork
 fork_like vfork
 
arch/parisc/kernel/syscalls/syscall.tbl +1 -0
index 5022b9e179c2..670d1371aca1 100644
@@ -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
#1 lore raw
Quoted 1 line · Helge Deller

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.

Quoted 36 lines
arch/parisc/include/asm/unistd.h +1 -0
index b0838dc4dfee..cd438e4150f6 100644
@@ -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
arch/parisc/kernel/entry.S +1 -0
index 3e430590c1e1..d9d3387f7c47 100644
@@ -1732,6 +1732,7 @@ ENDPROC_CFI(sys_\name\()_wrapper)
 	.endm
 
 fork_like clone
+fork_like clone3
 fork_like fork
 fork_like vfork
 
arch/parisc/kernel/syscalls/syscall.tbl +1 -0
index 5022b9e179c2..670d1371aca1 100644
@@ -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