From bf81998fc0f34c5bb2ac5f4e81e43db48200efeb Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Fri, 22 Mar 2019 16:58:17 +0800 Subject: [PATCH] riscv: Fixup wrong clone's arguments define In linux kernel riscv select CLONE_BACKWARDS in linux/arch/riscv/Kconfig, and in linux/kernel/fork.c: ifdef CONFIG_CLONE_BACKWARDS SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, int __user *, parent_tidptr, unsigned long, tls, int __user *, child_tidptr) elif ... So we must make the riscv clone-arguments' sequence to be: define ARG_FLAGS 0 define ARG_STACK 1 define ARG_PTID 2 define ARG_TLS 3 define ARG_CTID 4 Signed-off-by: Guo Ren Reviewed-By: Dmitry V. Levin * clone.c [RISCV]: Use default definitions for ARG_* macros. * NEWS: Mention this fix. --- NEWS | 3 +++ clone.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 58949b33..cf63deae 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Noteworthy changes in release ?.? (????-??-??) ============================================== +* Bug fixes + * Fixed decoding of last two arguments of clone syscall on riscv. + Noteworthy changes in release 5.0 (2019-03-19) ============================================== diff --git a/clone.c b/clone.c index d37e580f..64c7e950 100644 --- a/clone.c +++ b/clone.c @@ -42,7 +42,7 @@ # define ARG_PTID 2 # define ARG_CTID ((current_personality != 1) ? 3 : 4) # define ARG_TLS ((current_personality != 1) ? 4 : 3) -#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV +#elif defined ALPHA || defined TILE || defined OR1K # define ARG_FLAGS 0 # define ARG_STACK 1 # define ARG_PTID 2 -- 2.40.0