diff options
author | Paul Burton <paul.burton@mips.com> | 2019-10-02 14:59:49 -0400 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-10-02 17:06:41 -0400 |
commit | 0671c5b84e9e0a6d42d22da9b5d093787ac1c5f3 (patch) | |
tree | 92310d7be641e7173eba924016b6d0345cb85c18 | |
parent | 0228ecf6128c92b47eadd2ac270c5574d9150c09 (diff) |
MIPS: Wire up clone3 syscall
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>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: linux-mips@vger.kernel.org
-rw-r--r-- | arch/mips/include/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/mips/kernel/syscall.c | 1 | ||||
-rw-r--r-- | arch/mips/kernel/syscalls/syscall_n32.tbl | 2 | ||||
-rw-r--r-- | arch/mips/kernel/syscalls/syscall_n64.tbl | 2 | ||||
-rw-r--r-- | 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 @@ | |||
52 | # endif | 52 | # endif |
53 | #define __ARCH_WANT_SYS_FORK | 53 | #define __ARCH_WANT_SYS_FORK |
54 | #define __ARCH_WANT_SYS_CLONE | 54 | #define __ARCH_WANT_SYS_CLONE |
55 | #define __ARCH_WANT_SYS_CLONE3 | ||
55 | 56 | ||
56 | /* whitelists for checksyscalls */ | 57 | /* whitelists for checksyscalls */ |
57 | #define __IGNORE_fadvise64_64 | 58 | #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, | |||
80 | 80 | ||
81 | save_static_function(sys_fork); | 81 | save_static_function(sys_fork); |
82 | save_static_function(sys_clone); | 82 | save_static_function(sys_clone); |
83 | save_static_function(sys_clone3); | ||
83 | 84 | ||
84 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) | 85 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) |
85 | { | 86 | { |
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 @@ | |||
373 | 432 n32 fsmount sys_fsmount | 373 | 432 n32 fsmount sys_fsmount |
374 | 433 n32 fspick sys_fspick | 374 | 433 n32 fspick sys_fspick |
375 | 434 n32 pidfd_open sys_pidfd_open | 375 | 434 n32 pidfd_open sys_pidfd_open |
376 | # 435 reserved for clone3 | 376 | 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 @@ | |||
349 | 432 n64 fsmount sys_fsmount | 349 | 432 n64 fsmount sys_fsmount |
350 | 433 n64 fspick sys_fspick | 350 | 433 n64 fspick sys_fspick |
351 | 434 n64 pidfd_open sys_pidfd_open | 351 | 434 n64 pidfd_open sys_pidfd_open |
352 | # 435 reserved for clone3 | 352 | 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 @@ | |||
422 | 432 o32 fsmount sys_fsmount | 422 | 432 o32 fsmount sys_fsmount |
423 | 433 o32 fspick sys_fspick | 423 | 433 o32 fspick sys_fspick |
424 | 434 o32 pidfd_open sys_pidfd_open | 424 | 434 o32 pidfd_open sys_pidfd_open |
425 | # 435 reserved for clone3 | 425 | 435 o32 clone3 __sys_clone3 |