Skip to contentSkip to conversation

linux-user: generate syscall_nr.sh for RISC-V

PATCH Superseded Alistair Francis 3 participants 8 messages Mar 6, 2020 – Mar 8, 2020 RISC-V

v6 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v6 cover linux-user: generate syscall_nr.sh for RISC-V

This series updates the RISC-V syscall_nr.sh based on the 5.5 kernel.

There are two parts to this. One is just adding the new syscalls, the other part is updating the RV32 syscalls to match the fact that RV32 is a 64-bit time_t architectures (y2038) safe.

We need to make some changes to syscall.c to avoid warnings/errors during compliling with the new syscall.

I did some RV32 user space testing after applying these patches. I ran the glibc testsuite in userspace and I don't see any regressions.

v6:
- Split out futex patch and make it more robust
v5:
- Addres comments raised on v4
- Don't require 64-bit host for * _time64 functions

Alistair Francis (4):
linux-user: Protect more syscalls
linux-user/syscall: Add support for clock_gettime64/clock_settime64
linux-user: Support futex_time64
linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

 linux-user/riscv/syscall32_nr.h | 295 +++++++++++++++++++++++++++++++
 linux-user/riscv/syscall64_nr.h | 301 ++++++++++++++++++++++++++++++++
 linux-user/riscv/syscall_nr.h   | 294 +------------------------------
 linux-user/strace.c             |   2 +
 linux-user/syscall.c            | 199 +++++++++++++++++++--
 5 files changed, 783 insertions(+), 308 deletions(-)
 create mode 100644 linux-user/riscv/syscall32_nr.h
 create mode 100644 linux-user/riscv/syscall64_nr.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH v6 1/4 linux-user: Protect more syscalls

New y2038 safe 32-bit architectures (like RISC-V) don't support old syscalls with a 32-bit time_t. The kernel defines new *_time64 versions of these syscalls. Add some more #ifdefs to syscall.c in linux-user to allow us to compile without these old syscalls.

---
 linux-user/strace.c  |  2 ++
 linux-user/syscall.c | 68 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 69 insertions(+), 1 deletion(-)
linux-user/strace.c +2 -0
index 4f7130b2ff..6420ccd97b 100644
@@ -775,6 +775,7 @@ print_syscall_ret_newselect(const struct syscallname *name, abi_long ret)
 #define TARGET_TIME_OOP      3   /* leap second in progress */
 #define TARGET_TIME_WAIT     4   /* leap second has occurred */
 #define TARGET_TIME_ERROR    5   /* clock not synchronized */
+#ifdef TARGET_NR_adjtimex
 static void
 print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret)
 {
@@ -813,6 +814,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret)
 
     qemu_log("\n");
 }
+#endif
 
 UNUSED static struct flags access_flags[] = {
     FLAG_GENERIC(F_OK),
linux-user/syscall.c +67 -1

309 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by on v6 1/4
#2 lore raw

Re: [PATCH v6 1/4] linux-user: Protect more syscalls

Le 06/03/2020 à 19:24, Alistair Francis a écrit :

Quoted 11 lines

New y2038 safe 32-bit architectures (like RISC-V) don't support old syscalls with a 32-bit time_t. The kernel defines new *_time64 versions of these syscalls. Add some more #ifdefs to syscall.c in linux-user to allow us to compile without these old syscalls.

---
 linux-user/strace.c  |  2 ++
 linux-user/syscall.c | 68 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 69 insertions(+), 1 deletion(-)

...

Quoted 4 lines
linux-user/syscall.c +0 -0
index 8d27d10807..1a7df23440 100644

...

Quoted 1 line

#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)

You can remove this line ^^ as you check individually for each syscall below.

With that fixed:

#3 lore raw

PATCH v6 2/4 linux-user/syscall: Add support for clock_gettime64/clock_settime64

In reply to Alistair Francis

Add support for the clock_gettime64/clock_settime64 syscalls.

If your host is 64-bit or is 32-bit with the *_time64 syscall then the timespec will correctly be a 64-bit time_t. Otherwise the host will return a 32-bit time_t which will be rounded to 64-bits. This will be incorrect after y2038.

---
 linux-user/syscall.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
linux-user/syscall.c +39 -0
index 1a7df23440..0f219b26c1 100644
@@ -1231,6 +1231,22 @@ static inline abi_long target_to_host_timespec(struct timespec *host_ts,
 }
 #endif
 
+#if defined(TARGET_NR_clock_settime64)
+static inline abi_long target_to_host_timespec64(struct timespec *host_ts,
+                                                 abi_ulong target_addr)
+{
+    struct target__kernel_timespec *target_ts;
+
+    if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1)) {
+        return -TARGET_EFAULT;
+    }
+    __get_user(host_ts->tv_sec, &target_ts->tv_sec);
+    __get_user(host_ts->tv_nsec, &target_ts->tv_nsec);
+    unlock_user_struct(target_ts, target_addr, 0);
+    return 0;
+}
+#endif
+
 static inline abi_long host_to_target_timespec(abi_ulong target_addr,
                                                struct timespec *host_ts)
 {
@@ -11460,6 +11476,18 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return ret;
     }
 #endif
+#ifdef TARGET_NR_clock_settime64
+    case TARGET_NR_clock_settime64:
+    {
+        struct timespec ts;
+
+        ret = target_to_host_timespec64(&ts, arg2);
+        if (!is_error(ret)) {
+            ret = get_errno(clock_settime(arg1, &ts));
+        }
+        return ret;
+    }
+#endif
 #ifdef TARGET_NR_clock_gettime
     case TARGET_NR_clock_gettime:
     {
@@ -11471,6 +11499,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return ret;
     }
 #endif
+#ifdef TARGET_NR_clock_gettime64
+    case TARGET_NR_clock_gettime64:
+    {
+        struct timespec ts;
+        ret = get_errno(clock_gettime(arg1, &ts));
+        if (!is_error(ret)) {
+            ret = host_to_target_timespec64(arg2, &ts);
+        }
+        return ret;
+    }
+#endif
 #ifdef TARGET_NR_clock_getres
     case TARGET_NR_clock_getres:
     {
Signature · 1 line
2.25.1
#4 lore raw

PATCH v6 3/4 linux-user: Support futex_time64

In reply to Alistair Francis

Add support for host and target futex_time64. If futex_time64 exists on the host we try that first before falling back to the standard futux syscall.

---
 linux-user/syscall.c | 98 ++++++++++++++++++++++++++++++++++++--------
 1 file changed, 80 insertions(+), 18 deletions(-)
linux-user/syscall.c +80 -18
index 0f219b26c1..8a50e2d3dc 100644
@@ -245,7 +245,12 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
 #define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
 #define __NR_sys_syslog __NR_syslog
-#define __NR_sys_futex __NR_futex
+#if defined(__NR_futex)
+# define __NR_sys_futex __NR_futex
+#endif
+#if defined(__NR_futex_time64)
+# define __NR_sys_futex_time64 __NR_futex_time64
+#endif
 #define __NR_sys_inotify_init __NR_inotify_init
 #define __NR_sys_inotify_add_watch __NR_inotify_add_watch
 #define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch
@@ -295,10 +300,15 @@ _syscall1(int,exit_group,int,error_code)
 #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
 _syscall1(int,set_tid_address,int *,tidptr)
 #endif
-#if defined(TARGET_NR_futex) && defined(__NR_futex)
+#if (defined(TARGET_NR_futex) || defined(TARGET_NR_futex_time64)) && \
+    defined(__NR_futex)
 _syscall6(int,sys_futex,int *,uaddr,int,op,int,val,
           const struct timespec *,timeout,int *,uaddr2,int,val3)
 #endif
+#if defined(TARGET_NR_futex_time64) && defined(__NR_futex_time64)
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,
+          const struct timespec *,timeout,int *,uaddr2,int,val3)
+#endif
 #define __NR_sys_sched_getaffinity __NR_sched_getaffinity
 _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
           unsigned long *, user_mask_ptr);
@@ -762,10 +772,14 @@ safe_syscall5(int, ppoll, struct pollfd *, ufds, unsigned int, nfds,
 safe_syscall6(int, epoll_pwait, int, epfd, struct epoll_event *, events,
               int, maxevents, int, timeout, const sigset_t *, sigmask,
               size_t, sigsetsize)
-#ifdef TARGET_NR_futex
+#if defined(__NR_futex)
 safe_syscall6(int,futex,int *,uaddr,int,op,int,val, \
               const struct timespec *,timeout,int *,uaddr2,int,val3)
 #endif
+#if defined(__NR_futex_time64)
+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
+              const struct timespec *,timeout,int *,uaddr2,int,val3)
+#endif
 safe_syscall2(int, rt_sigsuspend, sigset_t *, newset, size_t, sigsetsize)
 safe_syscall2(int, kill, pid_t, pid, int, sig)
 safe_syscall2(int, tkill, int, tid, int, sig)
@@ -1210,7 +1224,7 @@ static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr,
     return 0;
 }
 
-#if defined(TARGET_NR_futex) || \
+#if defined(TARGET_NR_futex) || defined(TARGET_NR_futex_time64) || \
     defined(TARGET_NR_rt_sigtimedwait) || \
     defined(TARGET_NR_pselect6) || defined(TARGET_NR_pselect6) || \
     defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \
@@ -6898,12 +6912,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
    futexes locally would make futexes shared between multiple processes
    tricky.  However they're probably useless because guest atomic
    operations won't work either.  */
-#if defined(TARGET_NR_futex)
+#if defined(TARGET_NR_futex) || defined(TARGET_NR_futex_time64)
 static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
                     target_ulong uaddr2, int val3)
 {
     struct timespec ts, *pts;
-    int base_op;
+    int base_op, err = -ENOSYS;
 
     /* ??? We assume FUTEX_* constants are the same on both host
        and target.  */
@@ -6915,18 +6929,49 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
     switch (base_op) {
     case FUTEX_WAIT:
     case FUTEX_WAIT_BITSET:
+#ifdef __NR_futex_time64
+        struct __kernel_timespec ts64, *pts64;
+
         if (timeout) {
-            pts = &ts;
-            target_to_host_timespec(pts, timeout);
+            pts64 = &ts64;
+            target_to_host_timespec64(pts64, timeout);
         } else {
-            pts = NULL;
+            pts64 = NULL;
+        }
+
+        err = get_errno(safe_futex_time64(g2h(uaddr), op, tswap32(val),
+                         pts64, NULL, val3));
+#endif
+#ifdef __NR_futex
+        if (err == -ENOSYS) {
+            if (timeout) {
+                pts = &ts;
+                target_to_host_timespec(pts, timeout);
+            } else {
+                pts = NULL;
+            }
+            return get_errno(safe_futex(g2h(uaddr), op, tswap32(val),
+                             pts, NULL, val3));
         }
-        return get_errno(safe_futex(g2h(uaddr), op, tswap32(val),
-                         pts, NULL, val3));
+#endif
     case FUTEX_WAKE:
-        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+#ifdef __NR_futex_time64
+        err = get_errno(safe_futex_time64(g2h(uaddr), op, val, NULL, NULL, 0));
+#endif
+#ifdef __NR_futex
+        if (err == -ENOSYS) {
+            return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+        }
+#endif
     case FUTEX_FD:
-        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+#ifdef __NR_futex_time64
+        err = get_errno(safe_futex_time64(g2h(uaddr), op, val, NULL, NULL, 0));
+#endif
+#ifdef __NR_futex
+        if (err == -ENOSYS) {
+            return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+        }
+#endif
     case FUTEX_REQUEUE:
     case FUTEX_CMP_REQUEUE:
     case FUTEX_WAKE_OP:
@@ -6935,12 +6980,25 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
            But the prototype takes a `struct timespec *'; insert casts
            to satisfy the compiler.  We do not need to tswap TIMEOUT
            since it's not compared to guest memory.  */
+#ifdef __NR_futex_time64
+        struct __kernel_timespec *pts64;
+        pts64 = (struct __kernel_timespec *)(uintptr_t) timeout;
+        ret = get_errno(safe_futex_time64(g2h(uaddr), op, val, pts64,
+                                   g2h(uaddr2),
+                                   (base_op == FUTEX_CMP_REQUEUE
+                                    ? tswap32(val3)
+                                    : val3)));
+#endif
+#ifdef __NR_futex
         pts = (struct timespec *)(uintptr_t) timeout;
-        return get_errno(safe_futex(g2h(uaddr), op, val, pts,
-                                    g2h(uaddr2),
-                                    (base_op == FUTEX_CMP_REQUEUE
-                                     ? tswap32(val3)
-                                     : val3)));
+        if (err == -ENOSYS) {
+            return get_errno(safe_futex(g2h(uaddr), op, val, pts,
+                                      g2h(uaddr2),
+                                      (base_op == FUTEX_CMP_REQUEUE
+                                       ? tswap32(val3)
+                                       : val3)));
+        }
+#endif
     default:
         return -TARGET_ENOSYS;
     }
@@ -11599,6 +11657,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_futex:
         return do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
 #endif
+#ifdef TARGET_NR_futex_time64
+    case TARGET_NR_futex_time64:
+        return do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
+#endif
 #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
     case TARGET_NR_inotify_init:
         ret = get_errno(sys_inotify_init());
Signature · 1 line
2.25.1
#5 lore raw

Re: [PATCH v6 3/4] linux-user: Support futex_time64

Le 06/03/2020 à 19:24, Alistair Francis a écrit :

Quoted 3 lines

Add support for host and target futex_time64. If futex_time64 exists on the host we try that first before falling back to the standard futux syscall.

In fact there are two definitions for futex: one to use as system call in TARGET_NR_exit (sys_futex) and one to use to translate TARGET_NR_futex (see d509eeb13c9c ("linux-user: Use safe_syscall for futex syscall")).

We also rely on the system timespec definition, so I'm not sure anymore we can use both 32bit and 64bit host syscalls (it's more complicated than I expected...)

Quoted 10 lines
---
 linux-user/syscall.c | 98 ++++++++++++++++++++++++++++++++++++--------
 1 file changed, 80 insertions(+), 18 deletions(-)
linux-user/syscall.c +0 -0
index 0f219b26c1..8a50e2d3dc 100644

linux-user/syscall.c static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ · line 253

Quoted 10 lines
linux-user/syscall.c +6 -1
@@ -245,7 +245,12 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
 #define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
 #define __NR_sys_syslog __NR_syslog
-#define __NR_sys_futex __NR_futex
+#if defined(__NR_futex)
+# define __NR_sys_futex __NR_futex
+#endif
+#if defined(__NR_futex_time64)
+# define __NR_sys_futex_time64 __NR_futex_time64
+#endif

As you don't use futex_time64() in TARGET_NR_exit, you don't need to define it.

Quoted 7 lines
linux-user/syscall.c +0 -0
 #define __NR_sys_inotify_init __NR_inotify_init
 #define __NR_sys_inotify_add_watch __NR_inotify_add_watch
 #define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch
@@ -295,10 +300,15 @@ _syscall1(int,exit_group,int,error_code)
 #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
 _syscall1(int,set_tid_address,int *,tidptr)
 #endif

linux-user/syscall.c _syscall1(int,exit_group,int,error_code) · line 311

Quoted 10 lines
linux-user/syscall.c +6 -1
-#if defined(TARGET_NR_futex) && defined(__NR_futex)
+#if (defined(TARGET_NR_futex) || defined(TARGET_NR_futex_time64)) && \
+    defined(__NR_futex)
 _syscall6(int,sys_futex,int *,uaddr,int,op,int,val,
           const struct timespec *,timeout,int *,uaddr2,int,val3)
 #endif
+#if defined(TARGET_NR_futex_time64) && defined(__NR_futex_time64)
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,
+          const struct timespec *,timeout,int *,uaddr2,int,val3)
+#endif

We don't need them as the sys_ version are not used in TARGET_NR_futex and TARGET_NR_futex_time64...

Quoted 6 lines
linux-user/syscall.c +0 -0
 #define __NR_sys_sched_getaffinity __NR_sched_getaffinity
 _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
           unsigned long *, user_mask_ptr);
@@ -762,10 +772,14 @@ safe_syscall5(int, ppoll, struct pollfd *, ufds, unsigned int, nfds,
 safe_syscall6(int, epoll_pwait, int, epfd, struct epoll_event *, events,
               int, maxevents, int, timeout, const sigset_t *, sigmask,

linux-user/syscall.c safe_syscall5(int, ppoll, struct pollfd *, ufds, unsigned int, nfds, · line 782

Quoted 10 lines
linux-user/syscall.c +5 -1
               size_t, sigsetsize)
-#ifdef TARGET_NR_futex
+#if defined(__NR_futex)
 safe_syscall6(int,futex,int *,uaddr,int,op,int,val, \
               const struct timespec *,timeout,int *,uaddr2,int,val3)
 #endif
+#if defined(__NR_futex_time64)
+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
+              const struct timespec *,timeout,int *,uaddr2,int,val3)
+#endif

... we use these ones, the safe_ version.

Quoted 29 lines
linux-user/syscall.c +3 -3
 safe_syscall2(int, rt_sigsuspend, sigset_t *, newset, size_t, sigsetsize)
 safe_syscall2(int, kill, pid_t, pid, int, sig)
 safe_syscall2(int, tkill, int, tid, int, sig)
@@ -1210,7 +1224,7 @@ static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr,
     return 0;
 }
 
-#if defined(TARGET_NR_futex) || \
+#if defined(TARGET_NR_futex) || defined(TARGET_NR_futex_time64) || \
     defined(TARGET_NR_rt_sigtimedwait) || \
     defined(TARGET_NR_pselect6) || defined(TARGET_NR_pselect6) || \
     defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \
@@ -6898,12 +6912,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
    futexes locally would make futexes shared between multiple processes
    tricky.  However they're probably useless because guest atomic
    operations won't work either.  */
-#if defined(TARGET_NR_futex)
+#if defined(TARGET_NR_futex) || defined(TARGET_NR_futex_time64)
 static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
                     target_ulong uaddr2, int val3)
 {
     struct timespec ts, *pts;
-    int base_op;
+    int base_op, err = -ENOSYS;
 
     /* ??? We assume FUTEX_* constants are the same on both host
        and target.  */
@@ -6915,18 +6929,49 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
     switch (base_op) {

linux-user/syscall.c static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, · line 6937

Quoted 10 lines
linux-user/syscall.c +5 -2
     case FUTEX_WAIT:
     case FUTEX_WAIT_BITSET:
+#ifdef __NR_futex_time64
+        struct __kernel_timespec ts64, *pts64;
+
         if (timeout) {
-            pts = &ts;
-            target_to_host_timespec(pts, timeout);
+            pts64 = &ts64;
+            target_to_host_timespec64(pts64, timeout);

We use __kernel_timespec with a function that takes timespec. If system defines __NR_futex_time64 we can guess it uses the 64bit version of timespec but I'm not sure compiler is happy with that.

Moreover you guess timeout is the target 64bit version and you don't know that.

linux-user/syscall.c static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, · line 6949

Quoted 13 lines
linux-user/syscall.c +11 -1
         } else {
-            pts = NULL;
+            pts64 = NULL;
+        }
+
+        err = get_errno(safe_futex_time64(g2h(uaddr), op, tswap32(val),
+                         pts64, NULL, val3));
+#endif
+#ifdef __NR_futex
+        if (err == -ENOSYS) {
+            if (timeout) {
+                pts = &ts;
+                target_to_host_timespec(pts, timeout);

But if __NR_futex_time64 is defined, we guessed timespec is 64bit, so it cannot be used with target_to_host_timespec().

You guess timeout is the target 32bit version and you don't know that:
you must pass the syscall number (TARGET_NR_futex and TARGET_NR_futex_time64) to use the good version of the target structure.

target_to_host_timespec64() is to use with the 64bit _target_ syscall, target_to_host_timespec() with the 32bit _target_ syscall.

To ease the translation you should decorelate target and host syscalls. To ease the definition of this function you should rely on the system timespec definition (it appears to be complicated to support both syscalls because of the timespec definition).

Something like:

static int do_safe_futex(int *uaddr, int op, int val,
const struct timespec *timeout, int *uaddr2, int val3)
{
#if HOST_LONG_BITS == 64

#if defined(__NR_futex)
    /* always a 64-bit time_t, it doesn't define _time64 version  */
    return get_errno(safe_futex(uaddr, op, val, timeout, uaddr2, val3));
#endif
#else
#if defined(__NR_futex_time64)
    if (sizeof(timeout->tv_sec) == 8) {
        /* _time64 function on 32bit arch */
        return get_errno(safe_futex_time64(uaddr, op, val, timeout,
uaddr2, val3));
    }
#endif
#if defined(__NR_futex)
    /* old function on 32bit arch */
    return get_errno(safe_futex(uaddr, op, val, timeout, uaddr2, val3));
#endif
#endif
    return -TARGET_ENOSYS;
}

and use it as-is in do_futex() and define a do_futex_time64() that use it with target_to_host_timespec64() (or add a parameter to do_futex() to select timespec type).

You should also define a do_sys_futex() to use with TARGET_NR_exit.

Quoted 64 lines
linux-user/syscall.c +40 -9
+            } else {
+                pts = NULL;
+            }
+            return get_errno(safe_futex(g2h(uaddr), op, tswap32(val),
+                             pts, NULL, val3));
         }
-        return get_errno(safe_futex(g2h(uaddr), op, tswap32(val),
-                         pts, NULL, val3));
+#endif
     case FUTEX_WAKE:
-        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+#ifdef __NR_futex_time64
+        err = get_errno(safe_futex_time64(g2h(uaddr), op, val, NULL, NULL, 0));
+#endif
+#ifdef __NR_futex
+        if (err == -ENOSYS) {
+            return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+        }
+#endif
     case FUTEX_FD:
-        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+#ifdef __NR_futex_time64
+        err = get_errno(safe_futex_time64(g2h(uaddr), op, val, NULL, NULL, 0));
+#endif
+#ifdef __NR_futex
+        if (err == -ENOSYS) {
+            return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+        }
+#endif
     case FUTEX_REQUEUE:
     case FUTEX_CMP_REQUEUE:
     case FUTEX_WAKE_OP:
@@ -6935,12 +6980,25 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
            But the prototype takes a `struct timespec *'; insert casts
            to satisfy the compiler.  We do not need to tswap TIMEOUT
            since it's not compared to guest memory.  */
+#ifdef __NR_futex_time64
+        struct __kernel_timespec *pts64;
+        pts64 = (struct __kernel_timespec *)(uintptr_t) timeout;
+        ret = get_errno(safe_futex_time64(g2h(uaddr), op, val, pts64,
+                                   g2h(uaddr2),
+                                   (base_op == FUTEX_CMP_REQUEUE
+                                    ? tswap32(val3)
+                                    : val3)));
+#endif
+#ifdef __NR_futex
         pts = (struct timespec *)(uintptr_t) timeout;
-        return get_errno(safe_futex(g2h(uaddr), op, val, pts,
-                                    g2h(uaddr2),
-                                    (base_op == FUTEX_CMP_REQUEUE
-                                     ? tswap32(val3)
-                                     : val3)));
+        if (err == -ENOSYS) {
+            return get_errno(safe_futex(g2h(uaddr), op, val, pts,
+                                      g2h(uaddr2),
+                                      (base_op == FUTEX_CMP_REQUEUE
+                                       ? tswap32(val3)
+                                       : val3)));
+        }
+#endif
     default:
         return -TARGET_ENOSYS;
     }

linux-user/syscall.c static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, · line 11662

Quoted 6 lines
linux-user/syscall.c +3 -0
@@ -11599,6 +11657,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_futex:
         return do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
 #endif
+#ifdef TARGET_NR_futex_time64
+    case TARGET_NR_futex_time64:
+        return do_futex(arg1, arg2, arg3, arg4, arg5, arg6);

How do you know if arg4 is target_kernel_timespec (64bit) or target_timespec (32bit) in the function?

So you should define a do_futex64() function or pass the the syscall number to the function.

linux-user/syscall.c static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, · line 11666

Quoted 5 lines
linux-user/syscall.c +1 -0
+#endif
 #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
     case TARGET_NR_inotify_init:
         ret = get_errno(sys_inotify_init());

Thanks,
Laurent

#6 lore raw

PATCH v6 4/4 linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

In reply to Alistair Francis
---
 linux-user/riscv/syscall32_nr.h | 295 +++++++++++++++++++++++++++++++
 linux-user/riscv/syscall64_nr.h | 301 ++++++++++++++++++++++++++++++++
 linux-user/riscv/syscall_nr.h   | 294 +------------------------------
 3 files changed, 598 insertions(+), 292 deletions(-)
 create mode 100644 linux-user/riscv/syscall32_nr.h
 create mode 100644 linux-user/riscv/syscall64_nr.h
linux-user/riscv/syscall32_nr.h new file +295 -0
new file mode 100644
index 0000000000..4fef73e954
@@ -0,0 +1,295 @@
+/*
+ * This file contains the system call numbers.
+ */
+#ifndef LINUX_USER_RISCV_SYSCALL32_NR_H
+#define LINUX_USER_RISCV_SYSCALL32_NR_H
+
+#define TARGET_NR_io_setup 0
+#define TARGET_NR_io_destroy 1
+#define TARGET_NR_io_submit 2
+#define TARGET_NR_io_cancel 3
+#define TARGET_NR_setxattr 5
+#define TARGET_NR_lsetxattr 6
+#define TARGET_NR_fsetxattr 7
+#define TARGET_NR_getxattr 8
+#define TARGET_NR_lgetxattr 9
+#define TARGET_NR_fgetxattr 10
+#define TARGET_NR_listxattr 11
+#define TARGET_NR_llistxattr 12
+#define TARGET_NR_flistxattr 13
+#define TARGET_NR_removexattr 14
+#define TARGET_NR_lremovexattr 15
+#define TARGET_NR_fremovexattr 16
+#define TARGET_NR_getcwd 17
+#define TARGET_NR_lookup_dcookie 18
+#define TARGET_NR_eventfd2 19
+#define TARGET_NR_epoll_create1 20
+#define TARGET_NR_epoll_ctl 21
+#define TARGET_NR_epoll_pwait 22
+#define TARGET_NR_dup 23
+#define TARGET_NR_dup3 24
+#define TARGET_NR_fcntl64 25
+#define TARGET_NR_inotify_init1 26
+#define TARGET_NR_inotify_add_watch 27
+#define TARGET_NR_inotify_rm_watch 28
+#define TARGET_NR_ioctl 29
+#define TARGET_NR_ioprio_set 30
+#define TARGET_NR_ioprio_get 31
+#define TARGET_NR_flock 32
+#define TARGET_NR_mknodat 33
+#define TARGET_NR_mkdirat 34
+#define TARGET_NR_unlinkat 35
+#define TARGET_NR_symlinkat 36
+#define TARGET_NR_linkat 37
+#define TARGET_NR_umount2 39
+#define TARGET_NR_mount 40
+#define TARGET_NR_pivot_root 41
+#define TARGET_NR_nfsservctl 42
+#define TARGET_NR_statfs64 43
+#define TARGET_NR_fstatfs64 44
+#define TARGET_NR_truncate64 45
+#define TARGET_NR_ftruncate64 46
+#define TARGET_NR_fallocate 47
+#define TARGET_NR_faccessat 48
+#define TARGET_NR_chdir 49
+#define TARGET_NR_fchdir 50
+#define TARGET_NR_chroot 51
+#define TARGET_NR_fchmod 52
+#define TARGET_NR_fchmodat 53
+#define TARGET_NR_fchownat 54
+#define TARGET_NR_fchown 55
+#define TARGET_NR_openat 56
+#define TARGET_NR_close 57
+#define TARGET_NR_vhangup 58
+#define TARGET_NR_pipe2 59
+#define TARGET_NR_quotactl 60
+#define TARGET_NR_getdents64 61
+#define TARGET_NR_llseek 62
+#define TARGET_NR_read 63
+#define TARGET_NR_write 64
+#define TARGET_NR_readv 65
+#define TARGET_NR_writev 66
+#define TARGET_NR_pread64 67
+#define TARGET_NR_pwrite64 68
+#define TARGET_NR_preadv 69
+#define TARGET_NR_pwritev 70
+#define TARGET_NR_sendfile64 71
+#define TARGET_NR_signalfd4 74
+#define TARGET_NR_vmsplice 75
+#define TARGET_NR_splice 76
+#define TARGET_NR_tee 77
+#define TARGET_NR_readlinkat 78
+#define TARGET_NR_fstatat64 79
+#define TARGET_NR_fstat64 80
+#define TARGET_NR_sync 81
+#define TARGET_NR_fsync 82
+#define TARGET_NR_fdatasync 83
+#define TARGET_NR_sync_file_range 84
+#define TARGET_NR_timerfd_create 85
+#define TARGET_NR_acct 89
+#define TARGET_NR_capget 90
+#define TARGET_NR_capset 91
+#define TARGET_NR_personality 92
+#define TARGET_NR_exit 93
+#define TARGET_NR_exit_group 94
+#define TARGET_NR_waitid 95
+#define TARGET_NR_set_tid_address 96
+#define TARGET_NR_unshare 97
+#define TARGET_NR_set_robust_list 99
+#define TARGET_NR_get_robust_list 100
+#define TARGET_NR_getitimer 102
+#define TARGET_NR_setitimer 103
+#define TARGET_NR_kexec_load 104
+#define TARGET_NR_init_module 105
+#define TARGET_NR_delete_module 106
+#define TARGET_NR_timer_create 107
+#define TARGET_NR_timer_getoverrun 109
+#define TARGET_NR_timer_delete 111
+#define TARGET_NR_syslog 116
+#define TARGET_NR_ptrace 117
+#define TARGET_NR_sched_setparam 118
+#define TARGET_NR_sched_setscheduler 119
+#define TARGET_NR_sched_getscheduler 120
+#define TARGET_NR_sched_getparam 121
+#define TARGET_NR_sched_setaffinity 122
+#define TARGET_NR_sched_getaffinity 123
+#define TARGET_NR_sched_yield 124
+#define TARGET_NR_sched_get_priority_max 125
+#define TARGET_NR_sched_get_priority_min 126
+#define TARGET_NR_restart_syscall 128
+#define TARGET_NR_kill 129
+#define TARGET_NR_tkill 130
+#define TARGET_NR_tgkill 131
+#define TARGET_NR_sigaltstack 132
+#define TARGET_NR_rt_sigsuspend 133
+#define TARGET_NR_rt_sigaction 134
+#define TARGET_NR_rt_sigprocmask 135
+#define TARGET_NR_rt_sigpending 136
+#define TARGET_NR_rt_sigqueueinfo 138
+#define TARGET_NR_rt_sigreturn 139
+#define TARGET_NR_setpriority 140
+#define TARGET_NR_getpriority 141
+#define TARGET_NR_reboot 142
+#define TARGET_NR_setregid 143
+#define TARGET_NR_setgid 144
+#define TARGET_NR_setreuid 145
+#define TARGET_NR_setuid 146
+#define TARGET_NR_setresuid 147
+#define TARGET_NR_getresuid 148
+#define TARGET_NR_setresgid 149
+#define TARGET_NR_getresgid 150
+#define TARGET_NR_setfsuid 151
+#define TARGET_NR_setfsgid 152
+#define TARGET_NR_times 153
+#define TARGET_NR_setpgid 154
+#define TARGET_NR_getpgid 155
+#define TARGET_NR_getsid 156
+#define TARGET_NR_setsid 157
+#define TARGET_NR_getgroups 158
+#define TARGET_NR_setgroups 159
+#define TARGET_NR_uname 160
+#define TARGET_NR_sethostname 161
+#define TARGET_NR_setdomainname 162
+#define TARGET_NR_getrlimit 163
+#define TARGET_NR_setrlimit 164
+#define TARGET_NR_getrusage 165
+#define TARGET_NR_umask 166
+#define TARGET_NR_prctl 167
+#define TARGET_NR_getcpu 168
+#define TARGET_NR_getpid 172
+#define TARGET_NR_getppid 173
+#define TARGET_NR_getuid 174
+#define TARGET_NR_geteuid 175
+#define TARGET_NR_getgid 176
+#define TARGET_NR_getegid 177
+#define TARGET_NR_gettid 178
+#define TARGET_NR_sysinfo 179
+#define TARGET_NR_mq_open 180
+#define TARGET_NR_mq_unlink 181
+#define TARGET_NR_mq_notify 184
+#define TARGET_NR_mq_getsetattr 185
+#define TARGET_NR_msgget 186
+#define TARGET_NR_msgctl 187
+#define TARGET_NR_msgrcv 188
+#define TARGET_NR_msgsnd 189
+#define TARGET_NR_semget 190
+#define TARGET_NR_semctl 191
+#define TARGET_NR_semop 193
+#define TARGET_NR_shmget 194
+#define TARGET_NR_shmctl 195
+#define TARGET_NR_shmat 196
+#define TARGET_NR_shmdt 197
+#define TARGET_NR_socket 198
+#define TARGET_NR_socketpair 199
+#define TARGET_NR_bind 200
+#define TARGET_NR_listen 201
+#define TARGET_NR_accept 202
+#define TARGET_NR_connect 203
+#define TARGET_NR_getsockname 204
+#define TARGET_NR_getpeername 205
+#define TARGET_NR_sendto 206
+#define TARGET_NR_recvfrom 207
+#define TARGET_NR_setsockopt 208
+#define TARGET_NR_getsockopt 209
+#define TARGET_NR_shutdown 210
+#define TARGET_NR_sendmsg 211
+#define TARGET_NR_recvmsg 212
+#define TARGET_NR_readahead 213
+#define TARGET_NR_brk 214
+#define TARGET_NR_munmap 215
+#define TARGET_NR_mremap 216
+#define TARGET_NR_add_key 217
+#define TARGET_NR_request_key 218
+#define TARGET_NR_keyctl 219
+#define TARGET_NR_clone 220
+#define TARGET_NR_execve 221
+#define TARGET_NR_mmap2 222
+#define TARGET_NR_fadvise64_64 223
+#define TARGET_NR_swapon 224
+#define TARGET_NR_swapoff 225
+#define TARGET_NR_mprotect 226
+#define TARGET_NR_msync 227
+#define TARGET_NR_mlock 228
+#define TARGET_NR_munlock 229
+#define TARGET_NR_mlockall 230
+#define TARGET_NR_munlockall 231
+#define TARGET_NR_mincore 232
+#define TARGET_NR_madvise 233
+#define TARGET_NR_remap_file_pages 234
+#define TARGET_NR_mbind 235
+#define TARGET_NR_get_mempolicy 236
+#define TARGET_NR_set_mempolicy 237
+#define TARGET_NR_migrate_pages 238
+#define TARGET_NR_move_pages 239
+#define TARGET_NR_rt_tgsigqueueinfo 240
+#define TARGET_NR_perf_event_open 241
+#define TARGET_NR_accept4 242
+#define TARGET_NR_arch_specific_syscall 244
+#define TARGET_NR_riscv_flush_icache (TARGET_NR_arch_specific_syscall + 15)
+#define TARGET_NR_prlimit64 261
+#define TARGET_NR_fanotify_init 262
+#define TARGET_NR_fanotify_mark 263
+#define TARGET_NR_name_to_handle_at 264
+#define TARGET_NR_open_by_handle_at 265
+#define TARGET_NR_syncfs 267
+#define TARGET_NR_setns 268
+#define TARGET_NR_sendmmsg 269
+#define TARGET_NR_process_vm_readv 270
+#define TARGET_NR_process_vm_writev 271
+#define TARGET_NR_kcmp 272
+#define TARGET_NR_finit_module 273
+#define TARGET_NR_sched_setattr 274
+#define TARGET_NR_sched_getattr 275
+#define TARGET_NR_renameat2 276
+#define TARGET_NR_seccomp 277
+#define TARGET_NR_getrandom 278
+#define TARGET_NR_memfd_create 279
+#define TARGET_NR_bpf 280
+#define TARGET_NR_execveat 281
+#define TARGET_NR_userfaultfd 282
+#define TARGET_NR_membarrier 283
+#define TARGET_NR_mlock2 284
+#define TARGET_NR_copy_file_range 285
+#define TARGET_NR_preadv2 286
+#define TARGET_NR_pwritev2 287
+#define TARGET_NR_pkey_mprotect 288
+#define TARGET_NR_pkey_alloc 289
+#define TARGET_NR_pkey_free 290
+#define TARGET_NR_statx 291
+#define TARGET_NR_rseq 293
+#define TARGET_NR_kexec_file_load 294
+#define TARGET_NR_clock_gettime64 403
+#define TARGET_NR_clock_settime64 404
+#define TARGET_NR_clock_adjtime64 405
+#define TARGET_NR_clock_getres_time64 406
+#define TARGET_NR_clock_nanosleep_time64 407
+#define TARGET_NR_timer_gettime64 408
+#define TARGET_NR_timer_settime64 409
+#define TARGET_NR_timerfd_gettime64 410
+#define TARGET_NR_timerfd_settime64 411
+#define TARGET_NR_utimensat_time64 412
+#define TARGET_NR_pselect6_time64 413
+#define TARGET_NR_ppoll_time64 414
+#define TARGET_NR_io_pgetevents_time64 416
+#define TARGET_NR_recvmmsg_time64 417
+#define TARGET_NR_mq_timedsend_time64 418
+#define TARGET_NR_mq_timedreceive_time64 419
+#define TARGET_NR_semtimedop_time64 420
+#define TARGET_NR_rt_sigtimedwait_time64 421
+#define TARGET_NR_futex_time64 422
+#define TARGET_NR_sched_rr_get_interval_time64 423
+#define TARGET_NR_pidfd_send_signal 424
+#define TARGET_NR_io_uring_setup 425
+#define TARGET_NR_io_uring_enter 426
+#define TARGET_NR_io_uring_register 427
+#define TARGET_NR_open_tree 428
+#define TARGET_NR_move_mount 429
+#define TARGET_NR_fsopen 430
+#define TARGET_NR_fsconfig 431
+#define TARGET_NR_fsmount 432
+#define TARGET_NR_fspick 433
+#define TARGET_NR_pidfd_open 434
+#define TARGET_NR_clone3 435
+#define TARGET_NR_syscalls 436
+
+#endif /* LINUX_USER_RISCV_SYSCALL32_NR_H */
linux-user/riscv/syscall64_nr.h new file +301 -0

301 lines not on this page · raw message

linux-user/riscv/syscall_nr.h +2 -292

302 lines not on this page · raw message

Signature · 1 line
2.25.1
#7 lore raw
In reply to Alistair Francis
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [PATCH v6 0/4] linux-user: generate syscall_nr.sh for RISC-V
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
6c8b2a5 linux-user/riscv: Update the syscall_nr's to the 5.5 kernel a8c3505 linux-user: Support futex_time64
5020c23 linux-user/syscall: Add support for clock_gettime64/clock_settime64 2229302 linux-user: Protect more syscalls

=== OUTPUT BEGIN ===
1/4 Checking commit 22293021a06b (linux-user: Protect more syscalls)
2/4 Checking commit 5020c2382b9e (linux-user/syscall: Add support for clock_gettime64/clock_settime64) 3/4 Checking commit a8c3505c6ff4 (linux-user: Support futex_time64)
WARNING: architecture specific defines should be avoided
#23: FILE: linux-user/syscall.c:248:
+#if defined(__NR_futex)

WARNING: architecture specific defines should be avoided #26: FILE: linux-user/syscall.c:251:
+#if defined(__NR_futex_time64)

WARNING: architecture specific defines should be avoided #42: FILE: linux-user/syscall.c:308:
+#if defined(TARGET_NR_futex_time64) && defined(__NR_futex_time64)

ERROR: space required after that ',' (ctx:VxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

              ^

ERROR: space required after that ',' (ctx:VxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

                               ^

ERROR: space required after that ',' (ctx:OxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

                                     ^

ERROR: space required after that ',' (ctx:VxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

                                           ^

ERROR: space required after that ',' (ctx:VxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

                                               ^

ERROR: space required after that ',' (ctx:VxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

                                                  ^

ERROR: space required after that ',' (ctx:VxV) #43: FILE: linux-user/syscall.c:309:
+_syscall6(int,sys_futex_time64,int *,uaddr,int,op,int,val,

                                                      ^

ERROR: space required after that ',' (ctx:OxV)
#44: FILE: linux-user/syscall.c:310:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                  ^

ERROR: space required after that ',' (ctx:VxV)
#44: FILE: linux-user/syscall.c:310:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                          ^

ERROR: space required after that ',' (ctx:OxV)
#44: FILE: linux-user/syscall.c:310:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                                ^

ERROR: space required after that ',' (ctx:VxV)
#44: FILE: linux-user/syscall.c:310:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                                       ^

ERROR: space required after that ',' (ctx:VxV)
#44: FILE: linux-user/syscall.c:310:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                                           ^

WARNING: architecture specific defines should be avoided #54: FILE: linux-user/syscall.c:775:
+#if defined(__NR_futex)

WARNING: architecture specific defines should be avoided #58: FILE: linux-user/syscall.c:779:
+#if defined(__NR_futex_time64)

ERROR: space required after that ',' (ctx:VxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                  ^

ERROR: space required after that ',' (ctx:VxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                               ^

ERROR: space required after that ',' (ctx:OxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                                     ^

ERROR: space required after that ',' (ctx:VxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                                           ^

ERROR: space required after that ',' (ctx:VxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                                               ^

ERROR: space required after that ',' (ctx:VxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                                                  ^

ERROR: space required after that ',' (ctx:VxV)
#59: FILE: linux-user/syscall.c:780:

+safe_syscall6(int,futex_time64,int *,uaddr,int,op,int,val, \
                                                      ^

ERROR: space required after that ',' (ctx:OxV)
#60: FILE: linux-user/syscall.c:781:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                      ^

ERROR: space required after that ',' (ctx:VxV)
#60: FILE: linux-user/syscall.c:781:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                              ^

ERROR: space required after that ',' (ctx:OxV)
#60: FILE: linux-user/syscall.c:781:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                                    ^

ERROR: space required after that ',' (ctx:VxV)
#60: FILE: linux-user/syscall.c:781:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                                           ^

ERROR: space required after that ',' (ctx:VxV)
#60: FILE: linux-user/syscall.c:781:
+ const struct timespec *,timeout,int *,uaddr2,int,val3)

                                                               ^

WARNING: architecture specific defines should be avoided #93: FILE: linux-user/syscall.c:6932:
+#ifdef __NR_futex_time64

WARNING: architecture specific defines should be avoided #111: FILE: linux-user/syscall.c:6945:
+#ifdef __NR_futex

WARNING: architecture specific defines should be avoided #125: FILE: linux-user/syscall.c:6958:
+#ifdef __NR_futex_time64

WARNING: architecture specific defines should be avoided #128: FILE: linux-user/syscall.c:6961:
+#ifdef __NR_futex

WARNING: architecture specific defines should be avoided #135: FILE: linux-user/syscall.c:6967:
+#ifdef __NR_futex_time64

WARNING: architecture specific defines should be avoided #138: FILE: linux-user/syscall.c:6970:
+#ifdef __NR_futex

WARNING: architecture specific defines should be avoided #150: FILE: linux-user/syscall.c:6983:
+#ifdef __NR_futex_time64

WARNING: architecture specific defines should be avoided #159: FILE: linux-user/syscall.c:6992:
+#ifdef __NR_futex

total: 24 errors, 13 warnings, 162 lines checked

Patch 3/4 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

4/4 Checking commit 6c8b2a5ad0ed (linux-user/riscv: Update the syscall_nr's to the 5.5 kernel)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#12:
new file mode 100644

total: 0 errors, 1 warnings, 898 lines checked

Patch 4/4 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]