Re: [PATCH] MIPS: Add get_thread_area syscall

From: Arnd Bergmann
Date: Fri Dec 13 2019 - 01:44:43 EST


On Fri, Dec 13, 2019 at 7:15 AM Guoyun Sun <sunguoyun@xxxxxxxxxxx> wrote:
>
> CRIU(https://criu.org/) tools will dump TLS(Thread Local Storage) by
> get_thread_area during checkpoint and restore TLS by set_thread_area during
> restore. without syscall get_thread_area, criu restore will fail on MIPS
> platform.because a variable with GCC __thread is invalid.
>
> The following function will be called when criu restore

> diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl
> index e7c5ab3..7da83d0 100644
> --- a/arch/mips/kernel/syscalls/syscall_n32.tbl
> +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
> @@ -374,3 +374,4 @@
> 433 n32 fspick sys_fspick
> 434 n32 pidfd_open sys_pidfd_open
> 435 n32 clone3 __sys_clone3
> +436 n32 get_thread_area sys_get_thread_area

Please use a number in the arch-specific range below 393. The numbers
at the bottom are meant for syscalls that are common for all
architectures.

Arnd