linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Wire up clone3 syscall
@ 2019-10-02 18:59 Paul Burton
  2019-10-02 19:29 ` Christian Brauner
  2019-10-02 22:53 ` Paul Burton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Burton @ 2019-10-02 18:59 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton, Christian Brauner

Wire up the new clone3 syscall for MIPS, using save_static_function() to
generate a wrapper that saves registers $s0-$s7 prior to invoking the
generic sys_clone3 function just like we do for plain old clone.

Tested atop 64r6el_defconfig using o32, n32 & n64 builds of the simple
test program from:

  https://lore.kernel.org/lkml/20190716130631.tohj4ub54md25dys@brauner.io/

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Christian Brauner <christian@brauner.io>
---

 arch/mips/include/asm/unistd.h            | 1 +
 arch/mips/kernel/syscall.c                | 1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl | 2 +-
 arch/mips/kernel/syscalls/syscall_n64.tbl | 2 +-
 arch/mips/kernel/syscalls/syscall_o32.tbl | 2 +-
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 071053ece677..5d70babfc9ee 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -52,6 +52,7 @@
 # endif
 #define __ARCH_WANT_SYS_FORK
 #define __ARCH_WANT_SYS_CLONE
+#define __ARCH_WANT_SYS_CLONE3
 
 /* whitelists for checksyscalls */
 #define __IGNORE_fadvise64_64
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index b0e25e913bdb..3f16f3823031 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -80,6 +80,7 @@ SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
 
 save_static_function(sys_fork);
 save_static_function(sys_clone);
+save_static_function(sys_clone3);
 
 SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
 {
diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl
index c9c879ec9b6d..e7c5ab38e403 100644
--- a/arch/mips/kernel/syscalls/syscall_n32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
@@ -373,4 +373,4 @@
 432	n32	fsmount				sys_fsmount
 433	n32	fspick				sys_fspick
 434	n32	pidfd_open			sys_pidfd_open
-# 435 reserved for clone3
+435	n32	clone3				__sys_clone3
diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl
index bbce9159caa1..13cd66581f3b 100644
--- a/arch/mips/kernel/syscalls/syscall_n64.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n64.tbl
@@ -349,4 +349,4 @@
 432	n64	fsmount				sys_fsmount
 433	n64	fspick				sys_fspick
 434	n64	pidfd_open			sys_pidfd_open
-# 435 reserved for clone3
+435	n64	clone3				__sys_clone3
diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl
index 9653591428ec..353539ea4140 100644
--- a/arch/mips/kernel/syscalls/syscall_o32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
@@ -422,4 +422,4 @@
 432	o32	fsmount				sys_fsmount
 433	o32	fspick				sys_fspick
 434	o32	pidfd_open			sys_pidfd_open
-# 435 reserved for clone3
+435	o32	clone3				__sys_clone3
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Wire up clone3 syscall
  2019-10-02 18:59 [PATCH] MIPS: Wire up clone3 syscall Paul Burton
@ 2019-10-02 19:29 ` Christian Brauner
  2019-10-02 22:53 ` Paul Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2019-10-02 19:29 UTC (permalink / raw)
  To: Paul Burton; +Cc: linux-mips, Paul Burton

On Wed, Oct 02, 2019 at 06:59:49PM +0000, Paul Burton wrote:
> Wire up the new clone3 syscall for MIPS, using save_static_function() to
> generate a wrapper that saves registers $s0-$s7 prior to invoking the
> generic sys_clone3 function just like we do for plain old clone.
> 
> Tested atop 64r6el_defconfig using o32, n32 & n64 builds of the simple
> test program from:
> 
>   https://lore.kernel.org/lkml/20190716130631.tohj4ub54md25dys@brauner.io/
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>
> Cc: Christian Brauner <christian@brauner.io>

Thank you, Paul!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Wire up clone3 syscall
  2019-10-02 18:59 [PATCH] MIPS: Wire up clone3 syscall Paul Burton
  2019-10-02 19:29 ` Christian Brauner
@ 2019-10-02 22:53 ` Paul Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Burton @ 2019-10-02 22:53 UTC (permalink / raw)
  To: Paul Burton; +Cc: linux-mips, Paul Burton, Christian Brauner, linux-mips

Hello,

Paul Burton wrote:
> Wire up the new clone3 syscall for MIPS, using save_static_function() to
> generate a wrapper that saves registers $s0-$s7 prior to invoking the
> generic sys_clone3 function just like we do for plain old clone.
> 
> Tested atop 64r6el_defconfig using o32, n32 & n64 builds of the simple
> test program from:
> 
>   https://lore.kernel.org/lkml/20190716130631.tohj4ub54md25dys@brauner.io/

Applied to mips-fixes.

> commit 0671c5b84e9e
> https://git.kernel.org/mips/c/0671c5b84e9e
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-02 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 18:59 [PATCH] MIPS: Wire up clone3 syscall Paul Burton
2019-10-02 19:29 ` Christian Brauner
2019-10-02 22:53 ` Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).