All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2]  linux-user: generate syscall_nr.sh for RISC-V
@ 2020-02-20 23:18 ` Alistair Francis
  0 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-20 23:18 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv; +Cc: alistair.francis, palmer, laurent, alistair23

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.

Alistair Francis (2):
  linux-user: Protect more syscalls
  linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

 linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
 linux-user/strace.c           |   2 +
 linux-user/syscall.c          |  18 ++++
 3 files changed, 178 insertions(+), 2 deletions(-)

-- 
2.25.0



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

* [PATCH v1 0/2]  linux-user: generate syscall_nr.sh for RISC-V
@ 2020-02-20 23:18 ` Alistair Francis
  0 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-20 23:18 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv; +Cc: palmer, alistair.francis, alistair23, laurent

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.

Alistair Francis (2):
  linux-user: Protect more syscalls
  linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

 linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
 linux-user/strace.c           |   2 +
 linux-user/syscall.c          |  18 ++++
 3 files changed, 178 insertions(+), 2 deletions(-)

-- 
2.25.0



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

* [PATCH v1 1/2] linux-user: Protect more syscalls
  2020-02-20 23:18 ` Alistair Francis
@ 2020-02-20 23:18   ` Alistair Francis
  -1 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-20 23:18 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv; +Cc: alistair.francis, palmer, laurent, alistair23

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.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 linux-user/strace.c  |  2 ++
 linux-user/syscall.c | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 3d4d684450..2eb8ae3d31 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -770,6 +770,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)
 {
@@ -808,6 +809,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret)
 
     gemu_log("\n");
 }
+#endif
 
 UNUSED static struct flags access_flags[] = {
     FLAG_GENERIC(F_OK),
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c930577686..44632a7f6a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -738,8 +738,10 @@ safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
 safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
 safe_syscall4(int, openat, int, dirfd, const char *, pathname, \
               int, flags, mode_t, mode)
+#if defined(TARGET_NR_wait4)
 safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
               struct rusage *, rusage)
+#endif
 safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
               int, options, struct rusage *, rusage)
 safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp)
@@ -776,8 +778,10 @@ safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
               const struct timespec *, uts, size_t, sigsetsize)
 safe_syscall4(int, accept4, int, fd, struct sockaddr *, addr, socklen_t *, len,
               int, flags)
+#if defined(TARGET_NR_nanosleep)
 safe_syscall2(int, nanosleep, const struct timespec *, req,
               struct timespec *, rem)
+#endif
 #ifdef TARGET_NR_clock_nanosleep
 safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
               const struct timespec *, req, struct timespec *, rem)
@@ -1063,6 +1067,7 @@ static inline abi_long host_to_target_rusage(abi_ulong target_addr,
     return 0;
 }
 
+#ifdef TARGET_NR_setrlimit
 static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
 {
     abi_ulong target_rlim_swap;
@@ -1078,7 +1083,9 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
     
     return result;
 }
+#endif
 
+#if defined(TARGET_NR_getrlimit) || defined (TARGET_NR_ugetrlimit)
 static inline abi_ulong host_to_target_rlim(rlim_t rlim)
 {
     abi_ulong target_rlim_swap;
@@ -1092,6 +1099,7 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim)
     
     return result;
 }
+#endif
 
 static inline int target_to_host_resource(int code)
 {
@@ -8584,6 +8592,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#if defined(TARGET_NR_gettimeofday)
     case TARGET_NR_gettimeofday:
         {
             struct timeval tv;
@@ -8594,6 +8603,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
+#if defined(TARGET_NR_settimeofday)
     case TARGET_NR_settimeofday:
         {
             struct timeval tv, *ptv = NULL;
@@ -8615,6 +8626,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             return get_errno(settimeofday(ptv, ptz));
         }
+#endif
 #if defined(TARGET_NR_select)
     case TARGET_NR_select:
 #if defined(TARGET_WANT_NI_OLD_SELECT)
@@ -9260,6 +9272,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
                           arg6, arg7, arg8, 0);
 #endif
+#if defined(TARGET_NR_wait4)
     case TARGET_NR_wait4:
         {
             int status;
@@ -9287,6 +9300,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
 #ifdef TARGET_NR_swapoff
     case TARGET_NR_swapoff:
         if (!(p = lock_user_string(arg1)))
@@ -9431,6 +9445,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return do_vm86(cpu_env, arg1, arg2);
 #endif
 #endif
+#if defined(TARGET_NR_adjtimex)
     case TARGET_NR_adjtimex:
         {
             struct timex host_buf;
@@ -9446,6 +9461,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
 #if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
     case TARGET_NR_clock_adjtime:
         {
@@ -9971,6 +9987,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#if defined(TARGET_NR_nanosleep)
     case TARGET_NR_nanosleep:
         {
             struct timespec req, rem;
@@ -9981,6 +9998,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
     case TARGET_NR_prctl:
         switch (arg1) {
         case PR_GET_PDEATHSIG:
-- 
2.25.0



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

* [PATCH v1 1/2] linux-user: Protect more syscalls
@ 2020-02-20 23:18   ` Alistair Francis
  0 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-20 23:18 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv; +Cc: palmer, alistair.francis, alistair23, laurent

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.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 linux-user/strace.c  |  2 ++
 linux-user/syscall.c | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 3d4d684450..2eb8ae3d31 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -770,6 +770,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)
 {
@@ -808,6 +809,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret)
 
     gemu_log("\n");
 }
+#endif
 
 UNUSED static struct flags access_flags[] = {
     FLAG_GENERIC(F_OK),
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c930577686..44632a7f6a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -738,8 +738,10 @@ safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
 safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
 safe_syscall4(int, openat, int, dirfd, const char *, pathname, \
               int, flags, mode_t, mode)
+#if defined(TARGET_NR_wait4)
 safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
               struct rusage *, rusage)
+#endif
 safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
               int, options, struct rusage *, rusage)
 safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp)
@@ -776,8 +778,10 @@ safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
               const struct timespec *, uts, size_t, sigsetsize)
 safe_syscall4(int, accept4, int, fd, struct sockaddr *, addr, socklen_t *, len,
               int, flags)
+#if defined(TARGET_NR_nanosleep)
 safe_syscall2(int, nanosleep, const struct timespec *, req,
               struct timespec *, rem)
+#endif
 #ifdef TARGET_NR_clock_nanosleep
 safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
               const struct timespec *, req, struct timespec *, rem)
@@ -1063,6 +1067,7 @@ static inline abi_long host_to_target_rusage(abi_ulong target_addr,
     return 0;
 }
 
+#ifdef TARGET_NR_setrlimit
 static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
 {
     abi_ulong target_rlim_swap;
@@ -1078,7 +1083,9 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
     
     return result;
 }
+#endif
 
+#if defined(TARGET_NR_getrlimit) || defined (TARGET_NR_ugetrlimit)
 static inline abi_ulong host_to_target_rlim(rlim_t rlim)
 {
     abi_ulong target_rlim_swap;
@@ -1092,6 +1099,7 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim)
     
     return result;
 }
+#endif
 
 static inline int target_to_host_resource(int code)
 {
@@ -8584,6 +8592,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#if defined(TARGET_NR_gettimeofday)
     case TARGET_NR_gettimeofday:
         {
             struct timeval tv;
@@ -8594,6 +8603,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
+#if defined(TARGET_NR_settimeofday)
     case TARGET_NR_settimeofday:
         {
             struct timeval tv, *ptv = NULL;
@@ -8615,6 +8626,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             return get_errno(settimeofday(ptv, ptz));
         }
+#endif
 #if defined(TARGET_NR_select)
     case TARGET_NR_select:
 #if defined(TARGET_WANT_NI_OLD_SELECT)
@@ -9260,6 +9272,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
                           arg6, arg7, arg8, 0);
 #endif
+#if defined(TARGET_NR_wait4)
     case TARGET_NR_wait4:
         {
             int status;
@@ -9287,6 +9300,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
 #ifdef TARGET_NR_swapoff
     case TARGET_NR_swapoff:
         if (!(p = lock_user_string(arg1)))
@@ -9431,6 +9445,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return do_vm86(cpu_env, arg1, arg2);
 #endif
 #endif
+#if defined(TARGET_NR_adjtimex)
     case TARGET_NR_adjtimex:
         {
             struct timex host_buf;
@@ -9446,6 +9461,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
 #if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
     case TARGET_NR_clock_adjtime:
         {
@@ -9971,6 +9987,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#if defined(TARGET_NR_nanosleep)
     case TARGET_NR_nanosleep:
         {
             struct timespec req, rem;
@@ -9981,6 +9998,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
+#endif
     case TARGET_NR_prctl:
         switch (arg1) {
         case PR_GET_PDEATHSIG:
-- 
2.25.0



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

* [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
  2020-02-20 23:18 ` Alistair Francis
@ 2020-02-20 23:18   ` Alistair Francis
  -1 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-20 23:18 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv; +Cc: alistair.francis, palmer, laurent, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
 1 file changed, 158 insertions(+), 2 deletions(-)

diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
index 5c87282209..b2b071969b 100644
--- a/linux-user/riscv/syscall_nr.h
+++ b/linux-user/riscv/syscall_nr.h
@@ -10,7 +10,10 @@
 #define TARGET_NR_io_destroy 1
 #define TARGET_NR_io_submit 2
 #define TARGET_NR_io_cancel 3
+#ifndef TARGET_RISCV32
 #define TARGET_NR_io_getevents 4
+#endif
+
 #define TARGET_NR_setxattr 5
 #define TARGET_NR_lsetxattr 6
 #define TARGET_NR_fsetxattr 7
@@ -23,12 +26,17 @@
 #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
 #ifdef TARGET_RISCV32
@@ -36,27 +44,35 @@
 #else
 #define TARGET_NR_fcntl 25
 #endif
+
 #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_renameat 38
+
 #define TARGET_NR_umount2 39
 #define TARGET_NR_mount 40
 #define TARGET_NR_pivot_root 41
+
 #define TARGET_NR_nfsservctl 42
+
 #define TARGET_NR_statfs 43
 #define TARGET_NR_fstatfs 44
 #define TARGET_NR_truncate 45
 #define TARGET_NR_ftruncate 46
+
 #define TARGET_NR_fallocate 47
 #define TARGET_NR_faccessat 48
 #define TARGET_NR_chdir 49
@@ -69,9 +85,13 @@
 #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
+
 #ifdef TARGET_RISCV32
 #define TARGET_NR__llseek 62
 #else
@@ -85,53 +105,91 @@
 #define TARGET_NR_pwrite64 68
 #define TARGET_NR_preadv 69
 #define TARGET_NR_pwritev 70
+
 #define TARGET_NR_sendfile 71
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_pselect6 72
 #define TARGET_NR_ppoll 73
+#endif
+
 #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_newfstatat 79
 #define TARGET_NR_fstat 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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_timerfd_settime 86
 #define TARGET_NR_timerfd_gettime 87
+#endif
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_utimensat 88
+#endif
+
 #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
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_futex 98
+#endif
 #define TARGET_NR_set_robust_list 99
 #define TARGET_NR_get_robust_list 100
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_nanosleep 101
+#endif
+
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_timer_gettime 108
+#endif
 #define TARGET_NR_timer_getoverrun 109
+#ifndef TARGET_RISCV32
 #define TARGET_NR_timer_settime 110
+#endif
 #define TARGET_NR_timer_delete 111
+#ifndef TARGET_RISCV32
 #define TARGET_NR_clock_settime 112
 #define TARGET_NR_clock_gettime 113
 #define TARGET_NR_clock_getres 114
 #define TARGET_NR_clock_nanosleep 115
+#endif
+
 #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
@@ -141,7 +199,10 @@
 #define TARGET_NR_sched_yield 124
 #define TARGET_NR_sched_get_priority_max 125
 #define TARGET_NR_sched_get_priority_min 126
+#ifndef TARGET_RISCV32
 #define TARGET_NR_sched_rr_get_interval 127
+#endif
+
 #define TARGET_NR_restart_syscall 128
 #define TARGET_NR_kill 129
 #define TARGET_NR_tkill 130
@@ -151,9 +212,12 @@
 #define TARGET_NR_rt_sigaction 134
 #define TARGET_NR_rt_sigprocmask 135
 #define TARGET_NR_rt_sigpending 136
+#ifndef TARGET_RISCV32
 #define TARGET_NR_rt_sigtimedwait 137
+#endif
 #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
@@ -177,15 +241,23 @@
 #define TARGET_NR_uname 160
 #define TARGET_NR_sethostname 161
 #define TARGET_NR_setdomainname 162
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_getrlimit 163
 #define TARGET_NR_setrlimit 164
+#endif
+
 #define TARGET_NR_getrusage 165
 #define TARGET_NR_umask 166
 #define TARGET_NR_prctl 167
 #define TARGET_NR_getcpu 168
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_gettimeofday 169
 #define TARGET_NR_settimeofday 170
 #define TARGET_NR_adjtimex 171
+#endif
+
 #define TARGET_NR_getpid 172
 #define TARGET_NR_getppid 173
 #define TARGET_NR_getuid 174
@@ -194,24 +266,34 @@
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_mq_timedsend 182
 #define TARGET_NR_mq_timedreceive 183
+#endif
 #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
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_semtimedop 192
+#endif
 #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
@@ -227,15 +309,20 @@
 #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
+
 #ifdef TARGET_RISCV32
 #define TARGET_NR_mmap2 222
 #define TARGET_NR_fadvise64_64 223
@@ -243,6 +330,7 @@
 #define TARGET_NR_mmap 222
 #define TARGET_NR_fadvise64 223
 #endif
+
 #define TARGET_NR_swapon 224
 #define TARGET_NR_swapoff 225
 #define TARGET_NR_mprotect 226
@@ -259,18 +347,29 @@
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_recvmmsg 243
+#endif
+
 #define TARGET_NR_arch_specific_syscall 244
+
+#define TARGET_NR_riscv_flush_icache TARGET_NR_arch_specific_syscall + 15
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_wait4 260
+#endif
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_clock_adjtime 266
+#endif
 #define TARGET_NR_syncfs 267
 #define TARGET_NR_setns 268
 #define TARGET_NR_sendmmsg 269
@@ -296,10 +395,67 @@
 #define TARGET_NR_pkey_alloc 289
 #define TARGET_NR_pkey_free 290
 #define TARGET_NR_statx 291
+#ifndef TARGET_RISCV32
 #define TARGET_NR_io_pgetevents 292
+#endif
 #define TARGET_NR_rseq 293
 #define TARGET_NR_kexec_file_load 294
 
-#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
+#ifdef TARGET_RISCV32
+#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
+#endif
+
+#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 (TARGET_NR_clone3 + 1)
+
+/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit
+ * ones for RV32. This is based on the list used by glibc. */
+#ifdef TARGET_RISCV32
+#define TARGET_NR_futex TARGET_NR_futex_time64
+#define TARGET_NR_rt_sigtimedwait TARGET_NR_rt_sigtimedwait_time64
+#define TARGET_NR_ppoll TARGET_NR_ppoll_time64
+#define TARGET_NR_utimensat TARGET_NR_utimensat_time64
+#define TARGET_NR_pselect6 TARGET_NR_pselect6_time64
+#define TARGET_NR_recvmmsg TARGET_NR_recvmmsg_time64
+#define TARGET_NR_semtimedop TARGET_NR_semtimedop_time64
+#define TARGET_NR_mq_timedreceive TARGET_NR_mq_timedreceive_time64
+#define TARGET_NR_mq_timedsend TARGET_NR_mq_timedsend_time64
+#define TARGET_NR_clock_getres TARGET_NR_clock_getres_time64
+#define TARGET_NR_timerfd_settime TARGET_NR_timerfd_settime64
+#define TARGET_NR_timerfd_gettime TARGET_NR_timerfd_gettime64
+#define TARGET_NR_sched_rr_get_interval TARGET_NR_sched_rr_get_interval_time64
+#define TARGET_NR_clock_adjtime TARGET_NR_clock_adjtime64
+#endif
 
 #endif
-- 
2.25.0



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

* [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
@ 2020-02-20 23:18   ` Alistair Francis
  0 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-20 23:18 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv; +Cc: palmer, alistair.francis, alistair23, laurent

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
 1 file changed, 158 insertions(+), 2 deletions(-)

diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
index 5c87282209..b2b071969b 100644
--- a/linux-user/riscv/syscall_nr.h
+++ b/linux-user/riscv/syscall_nr.h
@@ -10,7 +10,10 @@
 #define TARGET_NR_io_destroy 1
 #define TARGET_NR_io_submit 2
 #define TARGET_NR_io_cancel 3
+#ifndef TARGET_RISCV32
 #define TARGET_NR_io_getevents 4
+#endif
+
 #define TARGET_NR_setxattr 5
 #define TARGET_NR_lsetxattr 6
 #define TARGET_NR_fsetxattr 7
@@ -23,12 +26,17 @@
 #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
 #ifdef TARGET_RISCV32
@@ -36,27 +44,35 @@
 #else
 #define TARGET_NR_fcntl 25
 #endif
+
 #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_renameat 38
+
 #define TARGET_NR_umount2 39
 #define TARGET_NR_mount 40
 #define TARGET_NR_pivot_root 41
+
 #define TARGET_NR_nfsservctl 42
+
 #define TARGET_NR_statfs 43
 #define TARGET_NR_fstatfs 44
 #define TARGET_NR_truncate 45
 #define TARGET_NR_ftruncate 46
+
 #define TARGET_NR_fallocate 47
 #define TARGET_NR_faccessat 48
 #define TARGET_NR_chdir 49
@@ -69,9 +85,13 @@
 #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
+
 #ifdef TARGET_RISCV32
 #define TARGET_NR__llseek 62
 #else
@@ -85,53 +105,91 @@
 #define TARGET_NR_pwrite64 68
 #define TARGET_NR_preadv 69
 #define TARGET_NR_pwritev 70
+
 #define TARGET_NR_sendfile 71
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_pselect6 72
 #define TARGET_NR_ppoll 73
+#endif
+
 #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_newfstatat 79
 #define TARGET_NR_fstat 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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_timerfd_settime 86
 #define TARGET_NR_timerfd_gettime 87
+#endif
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_utimensat 88
+#endif
+
 #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
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_futex 98
+#endif
 #define TARGET_NR_set_robust_list 99
 #define TARGET_NR_get_robust_list 100
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_nanosleep 101
+#endif
+
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_timer_gettime 108
+#endif
 #define TARGET_NR_timer_getoverrun 109
+#ifndef TARGET_RISCV32
 #define TARGET_NR_timer_settime 110
+#endif
 #define TARGET_NR_timer_delete 111
+#ifndef TARGET_RISCV32
 #define TARGET_NR_clock_settime 112
 #define TARGET_NR_clock_gettime 113
 #define TARGET_NR_clock_getres 114
 #define TARGET_NR_clock_nanosleep 115
+#endif
+
 #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
@@ -141,7 +199,10 @@
 #define TARGET_NR_sched_yield 124
 #define TARGET_NR_sched_get_priority_max 125
 #define TARGET_NR_sched_get_priority_min 126
+#ifndef TARGET_RISCV32
 #define TARGET_NR_sched_rr_get_interval 127
+#endif
+
 #define TARGET_NR_restart_syscall 128
 #define TARGET_NR_kill 129
 #define TARGET_NR_tkill 130
@@ -151,9 +212,12 @@
 #define TARGET_NR_rt_sigaction 134
 #define TARGET_NR_rt_sigprocmask 135
 #define TARGET_NR_rt_sigpending 136
+#ifndef TARGET_RISCV32
 #define TARGET_NR_rt_sigtimedwait 137
+#endif
 #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
@@ -177,15 +241,23 @@
 #define TARGET_NR_uname 160
 #define TARGET_NR_sethostname 161
 #define TARGET_NR_setdomainname 162
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_getrlimit 163
 #define TARGET_NR_setrlimit 164
+#endif
+
 #define TARGET_NR_getrusage 165
 #define TARGET_NR_umask 166
 #define TARGET_NR_prctl 167
 #define TARGET_NR_getcpu 168
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_gettimeofday 169
 #define TARGET_NR_settimeofday 170
 #define TARGET_NR_adjtimex 171
+#endif
+
 #define TARGET_NR_getpid 172
 #define TARGET_NR_getppid 173
 #define TARGET_NR_getuid 174
@@ -194,24 +266,34 @@
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_mq_timedsend 182
 #define TARGET_NR_mq_timedreceive 183
+#endif
 #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
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_semtimedop 192
+#endif
 #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
@@ -227,15 +309,20 @@
 #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
+
 #ifdef TARGET_RISCV32
 #define TARGET_NR_mmap2 222
 #define TARGET_NR_fadvise64_64 223
@@ -243,6 +330,7 @@
 #define TARGET_NR_mmap 222
 #define TARGET_NR_fadvise64 223
 #endif
+
 #define TARGET_NR_swapon 224
 #define TARGET_NR_swapoff 225
 #define TARGET_NR_mprotect 226
@@ -259,18 +347,29 @@
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_recvmmsg 243
+#endif
+
 #define TARGET_NR_arch_specific_syscall 244
+
+#define TARGET_NR_riscv_flush_icache TARGET_NR_arch_specific_syscall + 15
+
+#ifndef TARGET_RISCV32
 #define TARGET_NR_wait4 260
+#endif
 #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
+#ifndef TARGET_RISCV32
 #define TARGET_NR_clock_adjtime 266
+#endif
 #define TARGET_NR_syncfs 267
 #define TARGET_NR_setns 268
 #define TARGET_NR_sendmmsg 269
@@ -296,10 +395,67 @@
 #define TARGET_NR_pkey_alloc 289
 #define TARGET_NR_pkey_free 290
 #define TARGET_NR_statx 291
+#ifndef TARGET_RISCV32
 #define TARGET_NR_io_pgetevents 292
+#endif
 #define TARGET_NR_rseq 293
 #define TARGET_NR_kexec_file_load 294
 
-#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
+#ifdef TARGET_RISCV32
+#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
+#endif
+
+#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 (TARGET_NR_clone3 + 1)
+
+/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit
+ * ones for RV32. This is based on the list used by glibc. */
+#ifdef TARGET_RISCV32
+#define TARGET_NR_futex TARGET_NR_futex_time64
+#define TARGET_NR_rt_sigtimedwait TARGET_NR_rt_sigtimedwait_time64
+#define TARGET_NR_ppoll TARGET_NR_ppoll_time64
+#define TARGET_NR_utimensat TARGET_NR_utimensat_time64
+#define TARGET_NR_pselect6 TARGET_NR_pselect6_time64
+#define TARGET_NR_recvmmsg TARGET_NR_recvmmsg_time64
+#define TARGET_NR_semtimedop TARGET_NR_semtimedop_time64
+#define TARGET_NR_mq_timedreceive TARGET_NR_mq_timedreceive_time64
+#define TARGET_NR_mq_timedsend TARGET_NR_mq_timedsend_time64
+#define TARGET_NR_clock_getres TARGET_NR_clock_getres_time64
+#define TARGET_NR_timerfd_settime TARGET_NR_timerfd_settime64
+#define TARGET_NR_timerfd_gettime TARGET_NR_timerfd_gettime64
+#define TARGET_NR_sched_rr_get_interval TARGET_NR_sched_rr_get_interval_time64
+#define TARGET_NR_clock_adjtime TARGET_NR_clock_adjtime64
+#endif
 
 #endif
-- 
2.25.0



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

* Re: [PATCH v1 0/2]  linux-user: generate syscall_nr.sh for RISC-V
  2020-02-20 23:18 ` Alistair Francis
@ 2020-02-20 23:31   ` no-reply
  -1 siblings, 0 replies; 14+ messages in thread
From: no-reply @ 2020-02-20 23:31 UTC (permalink / raw)
  To: alistair.francis
  Cc: qemu-riscv, qemu-devel, laurent, alistair.francis, alistair23, palmer

Patchew URL: https://patchew.org/QEMU/cover.1582240656.git.alistair.francis@wdc.com/



Hi,

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

Subject: [PATCH v1 0/2]  linux-user: generate syscall_nr.sh for RISC-V
Message-id: cover.1582240656.git.alistair.francis@wdc.com
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 ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/cover.1582240656.git.alistair.francis@wdc.com -> patchew/cover.1582240656.git.alistair.francis@wdc.com
Switched to a new branch 'test'
a8f95ff linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
8f319fe linux-user: Protect more syscalls

=== OUTPUT BEGIN ===
1/2 Checking commit 8f319fe4044f (linux-user: Protect more syscalls)
ERROR: space prohibited between function name and open parenthesis '('
#75: FILE: linux-user/syscall.c:1088:
+#if defined(TARGET_NR_getrlimit) || defined (TARGET_NR_ugetrlimit)

total: 1 errors, 0 warnings, 121 lines checked

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

2/2 Checking commit a8f95ff78d20 (linux-user/riscv: Update the syscall_nr's to the 5.5 kernel)
WARNING: Block comments use a leading /* on a separate line
#377: FILE: linux-user/riscv/syscall_nr.h:442:
+/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit

WARNING: Block comments use a trailing */ on a separate line
#378: FILE: linux-user/riscv/syscall_nr.h:443:
+ * ones for RV32. This is based on the list used by glibc. */

total: 0 errors, 2 warnings, 370 lines checked

Patch 2/2 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/cover.1582240656.git.alistair.francis@wdc.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v1 0/2]  linux-user: generate syscall_nr.sh for RISC-V
@ 2020-02-20 23:31   ` no-reply
  0 siblings, 0 replies; 14+ messages in thread
From: no-reply @ 2020-02-20 23:31 UTC (permalink / raw)
  To: alistair.francis
  Cc: qemu-devel, qemu-riscv, alistair.francis, palmer, laurent, alistair23

Patchew URL: https://patchew.org/QEMU/cover.1582240656.git.alistair.francis@wdc.com/



Hi,

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

Subject: [PATCH v1 0/2]  linux-user: generate syscall_nr.sh for RISC-V
Message-id: cover.1582240656.git.alistair.francis@wdc.com
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 ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/cover.1582240656.git.alistair.francis@wdc.com -> patchew/cover.1582240656.git.alistair.francis@wdc.com
Switched to a new branch 'test'
a8f95ff linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
8f319fe linux-user: Protect more syscalls

=== OUTPUT BEGIN ===
1/2 Checking commit 8f319fe4044f (linux-user: Protect more syscalls)
ERROR: space prohibited between function name and open parenthesis '('
#75: FILE: linux-user/syscall.c:1088:
+#if defined(TARGET_NR_getrlimit) || defined (TARGET_NR_ugetrlimit)

total: 1 errors, 0 warnings, 121 lines checked

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

2/2 Checking commit a8f95ff78d20 (linux-user/riscv: Update the syscall_nr's to the 5.5 kernel)
WARNING: Block comments use a leading /* on a separate line
#377: FILE: linux-user/riscv/syscall_nr.h:442:
+/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit

WARNING: Block comments use a trailing */ on a separate line
#378: FILE: linux-user/riscv/syscall_nr.h:443:
+ * ones for RV32. This is based on the list used by glibc. */

total: 0 errors, 2 warnings, 370 lines checked

Patch 2/2 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/cover.1582240656.git.alistair.francis@wdc.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v1 1/2] linux-user: Protect more syscalls
  2020-02-20 23:18   ` Alistair Francis
@ 2020-02-21  8:55     ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-21  8:55 UTC (permalink / raw)
  To: Alistair Francis, qemu-devel, qemu-riscv; +Cc: alistair23, palmer, laurent

On 2/21/20 12:18 AM, Alistair Francis wrote:
> 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.
> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>   linux-user/strace.c  |  2 ++
>   linux-user/syscall.c | 18 ++++++++++++++++++
>   2 files changed, 20 insertions(+)
> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 3d4d684450..2eb8ae3d31 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -770,6 +770,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)
>   {
> @@ -808,6 +809,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret)
>   
>       gemu_log("\n");
>   }
> +#endif
>   
>   UNUSED static struct flags access_flags[] = {
>       FLAG_GENERIC(F_OK),
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index c930577686..44632a7f6a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -738,8 +738,10 @@ safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
>   safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
>   safe_syscall4(int, openat, int, dirfd, const char *, pathname, \
>                 int, flags, mode_t, mode)
> +#if defined(TARGET_NR_wait4)
>   safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
>                 struct rusage *, rusage)
> +#endif
>   safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
>                 int, options, struct rusage *, rusage)
>   safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp)
> @@ -776,8 +778,10 @@ safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
>                 const struct timespec *, uts, size_t, sigsetsize)
>   safe_syscall4(int, accept4, int, fd, struct sockaddr *, addr, socklen_t *, len,
>                 int, flags)
> +#if defined(TARGET_NR_nanosleep)
>   safe_syscall2(int, nanosleep, const struct timespec *, req,
>                 struct timespec *, rem)
> +#endif
>   #ifdef TARGET_NR_clock_nanosleep
>   safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
>                 const struct timespec *, req, struct timespec *, rem)
> @@ -1063,6 +1067,7 @@ static inline abi_long host_to_target_rusage(abi_ulong target_addr,
>       return 0;
>   }
>   
> +#ifdef TARGET_NR_setrlimit
>   static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
>   {
>       abi_ulong target_rlim_swap;
> @@ -1078,7 +1083,9 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
>       
>       return result;
>   }
> +#endif
>   
> +#if defined(TARGET_NR_getrlimit) || defined (TARGET_NR_ugetrlimit)
>   static inline abi_ulong host_to_target_rlim(rlim_t rlim)
>   {
>       abi_ulong target_rlim_swap;
> @@ -1092,6 +1099,7 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim)
>       
>       return result;
>   }
> +#endif
>   
>   static inline int target_to_host_resource(int code)
>   {
> @@ -8584,6 +8592,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#if defined(TARGET_NR_gettimeofday)
>       case TARGET_NR_gettimeofday:
>           {
>               struct timeval tv;
> @@ -8594,6 +8603,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
> +#if defined(TARGET_NR_settimeofday)
>       case TARGET_NR_settimeofday:
>           {
>               struct timeval tv, *ptv = NULL;
> @@ -8615,6 +8626,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>   
>               return get_errno(settimeofday(ptv, ptz));
>           }
> +#endif
>   #if defined(TARGET_NR_select)
>       case TARGET_NR_select:
>   #if defined(TARGET_WANT_NI_OLD_SELECT)
> @@ -9260,6 +9272,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>           return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
>                             arg6, arg7, arg8, 0);
>   #endif
> +#if defined(TARGET_NR_wait4)
>       case TARGET_NR_wait4:
>           {
>               int status;
> @@ -9287,6 +9300,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
>   #ifdef TARGET_NR_swapoff
>       case TARGET_NR_swapoff:
>           if (!(p = lock_user_string(arg1)))
> @@ -9431,6 +9445,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>           return do_vm86(cpu_env, arg1, arg2);
>   #endif
>   #endif
> +#if defined(TARGET_NR_adjtimex)
>       case TARGET_NR_adjtimex:
>           {
>               struct timex host_buf;
> @@ -9446,6 +9461,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
>   #if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
>       case TARGET_NR_clock_adjtime:
>           {
> @@ -9971,6 +9987,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#if defined(TARGET_NR_nanosleep)
>       case TARGET_NR_nanosleep:
>           {
>               struct timespec req, rem;
> @@ -9981,6 +9998,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
>       case TARGET_NR_prctl:
>           switch (arg1) {
>           case PR_GET_PDEATHSIG:
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v1 1/2] linux-user: Protect more syscalls
@ 2020-02-21  8:55     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-21  8:55 UTC (permalink / raw)
  To: Alistair Francis, qemu-devel, qemu-riscv; +Cc: palmer, laurent, alistair23

On 2/21/20 12:18 AM, Alistair Francis wrote:
> 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.
> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>   linux-user/strace.c  |  2 ++
>   linux-user/syscall.c | 18 ++++++++++++++++++
>   2 files changed, 20 insertions(+)
> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 3d4d684450..2eb8ae3d31 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -770,6 +770,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)
>   {
> @@ -808,6 +809,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret)
>   
>       gemu_log("\n");
>   }
> +#endif
>   
>   UNUSED static struct flags access_flags[] = {
>       FLAG_GENERIC(F_OK),
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index c930577686..44632a7f6a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -738,8 +738,10 @@ safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
>   safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
>   safe_syscall4(int, openat, int, dirfd, const char *, pathname, \
>                 int, flags, mode_t, mode)
> +#if defined(TARGET_NR_wait4)
>   safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
>                 struct rusage *, rusage)
> +#endif
>   safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
>                 int, options, struct rusage *, rusage)
>   safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp)
> @@ -776,8 +778,10 @@ safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
>                 const struct timespec *, uts, size_t, sigsetsize)
>   safe_syscall4(int, accept4, int, fd, struct sockaddr *, addr, socklen_t *, len,
>                 int, flags)
> +#if defined(TARGET_NR_nanosleep)
>   safe_syscall2(int, nanosleep, const struct timespec *, req,
>                 struct timespec *, rem)
> +#endif
>   #ifdef TARGET_NR_clock_nanosleep
>   safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
>                 const struct timespec *, req, struct timespec *, rem)
> @@ -1063,6 +1067,7 @@ static inline abi_long host_to_target_rusage(abi_ulong target_addr,
>       return 0;
>   }
>   
> +#ifdef TARGET_NR_setrlimit
>   static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
>   {
>       abi_ulong target_rlim_swap;
> @@ -1078,7 +1083,9 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim)
>       
>       return result;
>   }
> +#endif
>   
> +#if defined(TARGET_NR_getrlimit) || defined (TARGET_NR_ugetrlimit)
>   static inline abi_ulong host_to_target_rlim(rlim_t rlim)
>   {
>       abi_ulong target_rlim_swap;
> @@ -1092,6 +1099,7 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim)
>       
>       return result;
>   }
> +#endif
>   
>   static inline int target_to_host_resource(int code)
>   {
> @@ -8584,6 +8592,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#if defined(TARGET_NR_gettimeofday)
>       case TARGET_NR_gettimeofday:
>           {
>               struct timeval tv;
> @@ -8594,6 +8603,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
> +#if defined(TARGET_NR_settimeofday)
>       case TARGET_NR_settimeofday:
>           {
>               struct timeval tv, *ptv = NULL;
> @@ -8615,6 +8626,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>   
>               return get_errno(settimeofday(ptv, ptz));
>           }
> +#endif
>   #if defined(TARGET_NR_select)
>       case TARGET_NR_select:
>   #if defined(TARGET_WANT_NI_OLD_SELECT)
> @@ -9260,6 +9272,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>           return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
>                             arg6, arg7, arg8, 0);
>   #endif
> +#if defined(TARGET_NR_wait4)
>       case TARGET_NR_wait4:
>           {
>               int status;
> @@ -9287,6 +9300,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
>   #ifdef TARGET_NR_swapoff
>       case TARGET_NR_swapoff:
>           if (!(p = lock_user_string(arg1)))
> @@ -9431,6 +9445,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>           return do_vm86(cpu_env, arg1, arg2);
>   #endif
>   #endif
> +#if defined(TARGET_NR_adjtimex)
>       case TARGET_NR_adjtimex:
>           {
>               struct timex host_buf;
> @@ -9446,6 +9461,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
>   #if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
>       case TARGET_NR_clock_adjtime:
>           {
> @@ -9971,6 +9987,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#if defined(TARGET_NR_nanosleep)
>       case TARGET_NR_nanosleep:
>           {
>               struct timespec req, rem;
> @@ -9981,6 +9998,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               }
>           }
>           return ret;
> +#endif
>       case TARGET_NR_prctl:
>           switch (arg1) {
>           case PR_GET_PDEATHSIG:
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
  2020-02-20 23:18   ` Alistair Francis
@ 2020-02-22 11:29     ` Laurent Vivier
  -1 siblings, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2020-02-22 11:29 UTC (permalink / raw)
  To: Alistair Francis, qemu-devel, qemu-riscv; +Cc: alistair23, palmer

Le 21/02/2020 à 00:18, Alistair Francis a écrit :
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
>  1 file changed, 158 insertions(+), 2 deletions(-)

Could you avoid to add blanck lines: this makes review more difficult
and patch bigger for nothing.

Perhaps it would be easier too to have two files, one for 32bit and one
for 64 bit and a syscall_nr.h like this:

#ifdef TARGET_RISCV32
#include "syscall32_nr.h"
#else
#include "syscall64_nr.h"
#endif

Thanks,
Laurent

> diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
> index 5c87282209..b2b071969b 100644
> --- a/linux-user/riscv/syscall_nr.h
> +++ b/linux-user/riscv/syscall_nr.h
> @@ -10,7 +10,10 @@
>  #define TARGET_NR_io_destroy 1
>  #define TARGET_NR_io_submit 2
>  #define TARGET_NR_io_cancel 3
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_io_getevents 4
> +#endif
> +
>  #define TARGET_NR_setxattr 5
>  #define TARGET_NR_lsetxattr 6
>  #define TARGET_NR_fsetxattr 7
> @@ -23,12 +26,17 @@
>  #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
>  #ifdef TARGET_RISCV32
> @@ -36,27 +44,35 @@
>  #else
>  #define TARGET_NR_fcntl 25
>  #endif
> +
>  #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_renameat 38
> +
>  #define TARGET_NR_umount2 39
>  #define TARGET_NR_mount 40
>  #define TARGET_NR_pivot_root 41
> +
>  #define TARGET_NR_nfsservctl 42
> +
>  #define TARGET_NR_statfs 43
>  #define TARGET_NR_fstatfs 44
>  #define TARGET_NR_truncate 45
>  #define TARGET_NR_ftruncate 46
> +
>  #define TARGET_NR_fallocate 47
>  #define TARGET_NR_faccessat 48
>  #define TARGET_NR_chdir 49
> @@ -69,9 +85,13 @@
>  #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
> +
>  #ifdef TARGET_RISCV32
>  #define TARGET_NR__llseek 62
>  #else
> @@ -85,53 +105,91 @@
>  #define TARGET_NR_pwrite64 68
>  #define TARGET_NR_preadv 69
>  #define TARGET_NR_pwritev 70
> +
>  #define TARGET_NR_sendfile 71
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_pselect6 72
>  #define TARGET_NR_ppoll 73
> +#endif
> +
>  #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_newfstatat 79
>  #define TARGET_NR_fstat 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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_timerfd_settime 86
>  #define TARGET_NR_timerfd_gettime 87
> +#endif
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_utimensat 88
> +#endif
> +
>  #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
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_futex 98
> +#endif
>  #define TARGET_NR_set_robust_list 99
>  #define TARGET_NR_get_robust_list 100
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_nanosleep 101
> +#endif
> +
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_timer_gettime 108
> +#endif
>  #define TARGET_NR_timer_getoverrun 109
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_timer_settime 110
> +#endif
>  #define TARGET_NR_timer_delete 111
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_clock_settime 112
>  #define TARGET_NR_clock_gettime 113
>  #define TARGET_NR_clock_getres 114
>  #define TARGET_NR_clock_nanosleep 115
> +#endif
> +
>  #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
> @@ -141,7 +199,10 @@
>  #define TARGET_NR_sched_yield 124
>  #define TARGET_NR_sched_get_priority_max 125
>  #define TARGET_NR_sched_get_priority_min 126
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_sched_rr_get_interval 127
> +#endif
> +
>  #define TARGET_NR_restart_syscall 128
>  #define TARGET_NR_kill 129
>  #define TARGET_NR_tkill 130
> @@ -151,9 +212,12 @@
>  #define TARGET_NR_rt_sigaction 134
>  #define TARGET_NR_rt_sigprocmask 135
>  #define TARGET_NR_rt_sigpending 136
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_rt_sigtimedwait 137
> +#endif
>  #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
> @@ -177,15 +241,23 @@
>  #define TARGET_NR_uname 160
>  #define TARGET_NR_sethostname 161
>  #define TARGET_NR_setdomainname 162
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_getrlimit 163
>  #define TARGET_NR_setrlimit 164
> +#endif
> +
>  #define TARGET_NR_getrusage 165
>  #define TARGET_NR_umask 166
>  #define TARGET_NR_prctl 167
>  #define TARGET_NR_getcpu 168
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_gettimeofday 169
>  #define TARGET_NR_settimeofday 170
>  #define TARGET_NR_adjtimex 171
> +#endif
> +
>  #define TARGET_NR_getpid 172
>  #define TARGET_NR_getppid 173
>  #define TARGET_NR_getuid 174
> @@ -194,24 +266,34 @@
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_mq_timedsend 182
>  #define TARGET_NR_mq_timedreceive 183
> +#endif
>  #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
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_semtimedop 192
> +#endif
>  #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
> @@ -227,15 +309,20 @@
>  #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
> +
>  #ifdef TARGET_RISCV32
>  #define TARGET_NR_mmap2 222
>  #define TARGET_NR_fadvise64_64 223
> @@ -243,6 +330,7 @@
>  #define TARGET_NR_mmap 222
>  #define TARGET_NR_fadvise64 223
>  #endif
> +
>  #define TARGET_NR_swapon 224
>  #define TARGET_NR_swapoff 225
>  #define TARGET_NR_mprotect 226
> @@ -259,18 +347,29 @@
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_recvmmsg 243
> +#endif
> +
>  #define TARGET_NR_arch_specific_syscall 244
> +
> +#define TARGET_NR_riscv_flush_icache TARGET_NR_arch_specific_syscall + 15
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_wait4 260
> +#endif
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_clock_adjtime 266
> +#endif
>  #define TARGET_NR_syncfs 267
>  #define TARGET_NR_setns 268
>  #define TARGET_NR_sendmmsg 269
> @@ -296,10 +395,67 @@
>  #define TARGET_NR_pkey_alloc 289
>  #define TARGET_NR_pkey_free 290
>  #define TARGET_NR_statx 291
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_io_pgetevents 292
> +#endif
>  #define TARGET_NR_rseq 293
>  #define TARGET_NR_kexec_file_load 294
>  
> -#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
> +#ifdef TARGET_RISCV32
> +#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
> +#endif
> +
> +#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 (TARGET_NR_clone3 + 1)
> +
> +/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit
> + * ones for RV32. This is based on the list used by glibc. */
> +#ifdef TARGET_RISCV32
> +#define TARGET_NR_futex TARGET_NR_futex_time64
> +#define TARGET_NR_rt_sigtimedwait TARGET_NR_rt_sigtimedwait_time64
> +#define TARGET_NR_ppoll TARGET_NR_ppoll_time64
> +#define TARGET_NR_utimensat TARGET_NR_utimensat_time64
> +#define TARGET_NR_pselect6 TARGET_NR_pselect6_time64
> +#define TARGET_NR_recvmmsg TARGET_NR_recvmmsg_time64
> +#define TARGET_NR_semtimedop TARGET_NR_semtimedop_time64
> +#define TARGET_NR_mq_timedreceive TARGET_NR_mq_timedreceive_time64
> +#define TARGET_NR_mq_timedsend TARGET_NR_mq_timedsend_time64
> +#define TARGET_NR_clock_getres TARGET_NR_clock_getres_time64
> +#define TARGET_NR_timerfd_settime TARGET_NR_timerfd_settime64
> +#define TARGET_NR_timerfd_gettime TARGET_NR_timerfd_gettime64
> +#define TARGET_NR_sched_rr_get_interval TARGET_NR_sched_rr_get_interval_time64
> +#define TARGET_NR_clock_adjtime TARGET_NR_clock_adjtime64
> +#endif
>  
>  #endif
> 



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

* Re: [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
@ 2020-02-22 11:29     ` Laurent Vivier
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2020-02-22 11:29 UTC (permalink / raw)
  To: Alistair Francis, qemu-devel, qemu-riscv; +Cc: palmer, alistair23

Le 21/02/2020 à 00:18, Alistair Francis a écrit :
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
>  1 file changed, 158 insertions(+), 2 deletions(-)

Could you avoid to add blanck lines: this makes review more difficult
and patch bigger for nothing.

Perhaps it would be easier too to have two files, one for 32bit and one
for 64 bit and a syscall_nr.h like this:

#ifdef TARGET_RISCV32
#include "syscall32_nr.h"
#else
#include "syscall64_nr.h"
#endif

Thanks,
Laurent

> diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
> index 5c87282209..b2b071969b 100644
> --- a/linux-user/riscv/syscall_nr.h
> +++ b/linux-user/riscv/syscall_nr.h
> @@ -10,7 +10,10 @@
>  #define TARGET_NR_io_destroy 1
>  #define TARGET_NR_io_submit 2
>  #define TARGET_NR_io_cancel 3
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_io_getevents 4
> +#endif
> +
>  #define TARGET_NR_setxattr 5
>  #define TARGET_NR_lsetxattr 6
>  #define TARGET_NR_fsetxattr 7
> @@ -23,12 +26,17 @@
>  #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
>  #ifdef TARGET_RISCV32
> @@ -36,27 +44,35 @@
>  #else
>  #define TARGET_NR_fcntl 25
>  #endif
> +
>  #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_renameat 38
> +
>  #define TARGET_NR_umount2 39
>  #define TARGET_NR_mount 40
>  #define TARGET_NR_pivot_root 41
> +
>  #define TARGET_NR_nfsservctl 42
> +
>  #define TARGET_NR_statfs 43
>  #define TARGET_NR_fstatfs 44
>  #define TARGET_NR_truncate 45
>  #define TARGET_NR_ftruncate 46
> +
>  #define TARGET_NR_fallocate 47
>  #define TARGET_NR_faccessat 48
>  #define TARGET_NR_chdir 49
> @@ -69,9 +85,13 @@
>  #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
> +
>  #ifdef TARGET_RISCV32
>  #define TARGET_NR__llseek 62
>  #else
> @@ -85,53 +105,91 @@
>  #define TARGET_NR_pwrite64 68
>  #define TARGET_NR_preadv 69
>  #define TARGET_NR_pwritev 70
> +
>  #define TARGET_NR_sendfile 71
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_pselect6 72
>  #define TARGET_NR_ppoll 73
> +#endif
> +
>  #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_newfstatat 79
>  #define TARGET_NR_fstat 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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_timerfd_settime 86
>  #define TARGET_NR_timerfd_gettime 87
> +#endif
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_utimensat 88
> +#endif
> +
>  #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
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_futex 98
> +#endif
>  #define TARGET_NR_set_robust_list 99
>  #define TARGET_NR_get_robust_list 100
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_nanosleep 101
> +#endif
> +
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_timer_gettime 108
> +#endif
>  #define TARGET_NR_timer_getoverrun 109
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_timer_settime 110
> +#endif
>  #define TARGET_NR_timer_delete 111
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_clock_settime 112
>  #define TARGET_NR_clock_gettime 113
>  #define TARGET_NR_clock_getres 114
>  #define TARGET_NR_clock_nanosleep 115
> +#endif
> +
>  #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
> @@ -141,7 +199,10 @@
>  #define TARGET_NR_sched_yield 124
>  #define TARGET_NR_sched_get_priority_max 125
>  #define TARGET_NR_sched_get_priority_min 126
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_sched_rr_get_interval 127
> +#endif
> +
>  #define TARGET_NR_restart_syscall 128
>  #define TARGET_NR_kill 129
>  #define TARGET_NR_tkill 130
> @@ -151,9 +212,12 @@
>  #define TARGET_NR_rt_sigaction 134
>  #define TARGET_NR_rt_sigprocmask 135
>  #define TARGET_NR_rt_sigpending 136
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_rt_sigtimedwait 137
> +#endif
>  #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
> @@ -177,15 +241,23 @@
>  #define TARGET_NR_uname 160
>  #define TARGET_NR_sethostname 161
>  #define TARGET_NR_setdomainname 162
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_getrlimit 163
>  #define TARGET_NR_setrlimit 164
> +#endif
> +
>  #define TARGET_NR_getrusage 165
>  #define TARGET_NR_umask 166
>  #define TARGET_NR_prctl 167
>  #define TARGET_NR_getcpu 168
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_gettimeofday 169
>  #define TARGET_NR_settimeofday 170
>  #define TARGET_NR_adjtimex 171
> +#endif
> +
>  #define TARGET_NR_getpid 172
>  #define TARGET_NR_getppid 173
>  #define TARGET_NR_getuid 174
> @@ -194,24 +266,34 @@
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_mq_timedsend 182
>  #define TARGET_NR_mq_timedreceive 183
> +#endif
>  #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
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_semtimedop 192
> +#endif
>  #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
> @@ -227,15 +309,20 @@
>  #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
> +
>  #ifdef TARGET_RISCV32
>  #define TARGET_NR_mmap2 222
>  #define TARGET_NR_fadvise64_64 223
> @@ -243,6 +330,7 @@
>  #define TARGET_NR_mmap 222
>  #define TARGET_NR_fadvise64 223
>  #endif
> +
>  #define TARGET_NR_swapon 224
>  #define TARGET_NR_swapoff 225
>  #define TARGET_NR_mprotect 226
> @@ -259,18 +347,29 @@
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_recvmmsg 243
> +#endif
> +
>  #define TARGET_NR_arch_specific_syscall 244
> +
> +#define TARGET_NR_riscv_flush_icache TARGET_NR_arch_specific_syscall + 15
> +
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_wait4 260
> +#endif
>  #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
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_clock_adjtime 266
> +#endif
>  #define TARGET_NR_syncfs 267
>  #define TARGET_NR_setns 268
>  #define TARGET_NR_sendmmsg 269
> @@ -296,10 +395,67 @@
>  #define TARGET_NR_pkey_alloc 289
>  #define TARGET_NR_pkey_free 290
>  #define TARGET_NR_statx 291
> +#ifndef TARGET_RISCV32
>  #define TARGET_NR_io_pgetevents 292
> +#endif
>  #define TARGET_NR_rseq 293
>  #define TARGET_NR_kexec_file_load 294
>  
> -#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
> +#ifdef TARGET_RISCV32
> +#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
> +#endif
> +
> +#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 (TARGET_NR_clone3 + 1)
> +
> +/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit
> + * ones for RV32. This is based on the list used by glibc. */
> +#ifdef TARGET_RISCV32
> +#define TARGET_NR_futex TARGET_NR_futex_time64
> +#define TARGET_NR_rt_sigtimedwait TARGET_NR_rt_sigtimedwait_time64
> +#define TARGET_NR_ppoll TARGET_NR_ppoll_time64
> +#define TARGET_NR_utimensat TARGET_NR_utimensat_time64
> +#define TARGET_NR_pselect6 TARGET_NR_pselect6_time64
> +#define TARGET_NR_recvmmsg TARGET_NR_recvmmsg_time64
> +#define TARGET_NR_semtimedop TARGET_NR_semtimedop_time64
> +#define TARGET_NR_mq_timedreceive TARGET_NR_mq_timedreceive_time64
> +#define TARGET_NR_mq_timedsend TARGET_NR_mq_timedsend_time64
> +#define TARGET_NR_clock_getres TARGET_NR_clock_getres_time64
> +#define TARGET_NR_timerfd_settime TARGET_NR_timerfd_settime64
> +#define TARGET_NR_timerfd_gettime TARGET_NR_timerfd_gettime64
> +#define TARGET_NR_sched_rr_get_interval TARGET_NR_sched_rr_get_interval_time64
> +#define TARGET_NR_clock_adjtime TARGET_NR_clock_adjtime64
> +#endif
>  
>  #endif
> 



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

* Re: [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
  2020-02-22 11:29     ` Laurent Vivier
@ 2020-02-24 19:30       ` Alistair Francis
  -1 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-24 19:30 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: open list:RISC-V, Palmer Dabbelt, Alistair Francis,
	qemu-devel@nongnu.org Developers

On Sat, Feb 22, 2020 at 3:29 AM Laurent Vivier <laurent@vivier.eu> wrote:
>
> Le 21/02/2020 à 00:18, Alistair Francis a écrit :
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
> >  1 file changed, 158 insertions(+), 2 deletions(-)
>
> Could you avoid to add blanck lines: this makes review more difficult
> and patch bigger for nothing.
>
> Perhaps it would be easier too to have two files, one for 32bit and one
> for 64 bit and a syscall_nr.h like this:
>
> #ifdef TARGET_RISCV32
> #include "syscall32_nr.h"
> #else
> #include "syscall64_nr.h"
> #endif

Works for me, fixed in v2.

Alistair

>
> Thanks,
> Laurent
>
> > diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
> > index 5c87282209..b2b071969b 100644
> > --- a/linux-user/riscv/syscall_nr.h
> > +++ b/linux-user/riscv/syscall_nr.h
> > @@ -10,7 +10,10 @@
> >  #define TARGET_NR_io_destroy 1
> >  #define TARGET_NR_io_submit 2
> >  #define TARGET_NR_io_cancel 3
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_io_getevents 4
> > +#endif
> > +
> >  #define TARGET_NR_setxattr 5
> >  #define TARGET_NR_lsetxattr 6
> >  #define TARGET_NR_fsetxattr 7
> > @@ -23,12 +26,17 @@
> >  #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
> >  #ifdef TARGET_RISCV32
> > @@ -36,27 +44,35 @@
> >  #else
> >  #define TARGET_NR_fcntl 25
> >  #endif
> > +
> >  #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_renameat 38
> > +
> >  #define TARGET_NR_umount2 39
> >  #define TARGET_NR_mount 40
> >  #define TARGET_NR_pivot_root 41
> > +
> >  #define TARGET_NR_nfsservctl 42
> > +
> >  #define TARGET_NR_statfs 43
> >  #define TARGET_NR_fstatfs 44
> >  #define TARGET_NR_truncate 45
> >  #define TARGET_NR_ftruncate 46
> > +
> >  #define TARGET_NR_fallocate 47
> >  #define TARGET_NR_faccessat 48
> >  #define TARGET_NR_chdir 49
> > @@ -69,9 +85,13 @@
> >  #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
> > +
> >  #ifdef TARGET_RISCV32
> >  #define TARGET_NR__llseek 62
> >  #else
> > @@ -85,53 +105,91 @@
> >  #define TARGET_NR_pwrite64 68
> >  #define TARGET_NR_preadv 69
> >  #define TARGET_NR_pwritev 70
> > +
> >  #define TARGET_NR_sendfile 71
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_pselect6 72
> >  #define TARGET_NR_ppoll 73
> > +#endif
> > +
> >  #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_newfstatat 79
> >  #define TARGET_NR_fstat 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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_timerfd_settime 86
> >  #define TARGET_NR_timerfd_gettime 87
> > +#endif
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_utimensat 88
> > +#endif
> > +
> >  #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
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_futex 98
> > +#endif
> >  #define TARGET_NR_set_robust_list 99
> >  #define TARGET_NR_get_robust_list 100
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_nanosleep 101
> > +#endif
> > +
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_timer_gettime 108
> > +#endif
> >  #define TARGET_NR_timer_getoverrun 109
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_timer_settime 110
> > +#endif
> >  #define TARGET_NR_timer_delete 111
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_clock_settime 112
> >  #define TARGET_NR_clock_gettime 113
> >  #define TARGET_NR_clock_getres 114
> >  #define TARGET_NR_clock_nanosleep 115
> > +#endif
> > +
> >  #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
> > @@ -141,7 +199,10 @@
> >  #define TARGET_NR_sched_yield 124
> >  #define TARGET_NR_sched_get_priority_max 125
> >  #define TARGET_NR_sched_get_priority_min 126
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_sched_rr_get_interval 127
> > +#endif
> > +
> >  #define TARGET_NR_restart_syscall 128
> >  #define TARGET_NR_kill 129
> >  #define TARGET_NR_tkill 130
> > @@ -151,9 +212,12 @@
> >  #define TARGET_NR_rt_sigaction 134
> >  #define TARGET_NR_rt_sigprocmask 135
> >  #define TARGET_NR_rt_sigpending 136
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_rt_sigtimedwait 137
> > +#endif
> >  #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
> > @@ -177,15 +241,23 @@
> >  #define TARGET_NR_uname 160
> >  #define TARGET_NR_sethostname 161
> >  #define TARGET_NR_setdomainname 162
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_getrlimit 163
> >  #define TARGET_NR_setrlimit 164
> > +#endif
> > +
> >  #define TARGET_NR_getrusage 165
> >  #define TARGET_NR_umask 166
> >  #define TARGET_NR_prctl 167
> >  #define TARGET_NR_getcpu 168
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_gettimeofday 169
> >  #define TARGET_NR_settimeofday 170
> >  #define TARGET_NR_adjtimex 171
> > +#endif
> > +
> >  #define TARGET_NR_getpid 172
> >  #define TARGET_NR_getppid 173
> >  #define TARGET_NR_getuid 174
> > @@ -194,24 +266,34 @@
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_mq_timedsend 182
> >  #define TARGET_NR_mq_timedreceive 183
> > +#endif
> >  #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
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_semtimedop 192
> > +#endif
> >  #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
> > @@ -227,15 +309,20 @@
> >  #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
> > +
> >  #ifdef TARGET_RISCV32
> >  #define TARGET_NR_mmap2 222
> >  #define TARGET_NR_fadvise64_64 223
> > @@ -243,6 +330,7 @@
> >  #define TARGET_NR_mmap 222
> >  #define TARGET_NR_fadvise64 223
> >  #endif
> > +
> >  #define TARGET_NR_swapon 224
> >  #define TARGET_NR_swapoff 225
> >  #define TARGET_NR_mprotect 226
> > @@ -259,18 +347,29 @@
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_recvmmsg 243
> > +#endif
> > +
> >  #define TARGET_NR_arch_specific_syscall 244
> > +
> > +#define TARGET_NR_riscv_flush_icache TARGET_NR_arch_specific_syscall + 15
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_wait4 260
> > +#endif
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_clock_adjtime 266
> > +#endif
> >  #define TARGET_NR_syncfs 267
> >  #define TARGET_NR_setns 268
> >  #define TARGET_NR_sendmmsg 269
> > @@ -296,10 +395,67 @@
> >  #define TARGET_NR_pkey_alloc 289
> >  #define TARGET_NR_pkey_free 290
> >  #define TARGET_NR_statx 291
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_io_pgetevents 292
> > +#endif
> >  #define TARGET_NR_rseq 293
> >  #define TARGET_NR_kexec_file_load 294
> >
> > -#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
> > +#ifdef TARGET_RISCV32
> > +#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
> > +#endif
> > +
> > +#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 (TARGET_NR_clone3 + 1)
> > +
> > +/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit
> > + * ones for RV32. This is based on the list used by glibc. */
> > +#ifdef TARGET_RISCV32
> > +#define TARGET_NR_futex TARGET_NR_futex_time64
> > +#define TARGET_NR_rt_sigtimedwait TARGET_NR_rt_sigtimedwait_time64
> > +#define TARGET_NR_ppoll TARGET_NR_ppoll_time64
> > +#define TARGET_NR_utimensat TARGET_NR_utimensat_time64
> > +#define TARGET_NR_pselect6 TARGET_NR_pselect6_time64
> > +#define TARGET_NR_recvmmsg TARGET_NR_recvmmsg_time64
> > +#define TARGET_NR_semtimedop TARGET_NR_semtimedop_time64
> > +#define TARGET_NR_mq_timedreceive TARGET_NR_mq_timedreceive_time64
> > +#define TARGET_NR_mq_timedsend TARGET_NR_mq_timedsend_time64
> > +#define TARGET_NR_clock_getres TARGET_NR_clock_getres_time64
> > +#define TARGET_NR_timerfd_settime TARGET_NR_timerfd_settime64
> > +#define TARGET_NR_timerfd_gettime TARGET_NR_timerfd_gettime64
> > +#define TARGET_NR_sched_rr_get_interval TARGET_NR_sched_rr_get_interval_time64
> > +#define TARGET_NR_clock_adjtime TARGET_NR_clock_adjtime64
> > +#endif
> >
> >  #endif
> >
>


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

* Re: [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel
@ 2020-02-24 19:30       ` Alistair Francis
  0 siblings, 0 replies; 14+ messages in thread
From: Alistair Francis @ 2020-02-24 19:30 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Alistair Francis, qemu-devel@nongnu.org Developers,
	open list:RISC-V, Palmer Dabbelt

On Sat, Feb 22, 2020 at 3:29 AM Laurent Vivier <laurent@vivier.eu> wrote:
>
> Le 21/02/2020 à 00:18, Alistair Francis a écrit :
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  linux-user/riscv/syscall_nr.h | 160 +++++++++++++++++++++++++++++++++-
> >  1 file changed, 158 insertions(+), 2 deletions(-)
>
> Could you avoid to add blanck lines: this makes review more difficult
> and patch bigger for nothing.
>
> Perhaps it would be easier too to have two files, one for 32bit and one
> for 64 bit and a syscall_nr.h like this:
>
> #ifdef TARGET_RISCV32
> #include "syscall32_nr.h"
> #else
> #include "syscall64_nr.h"
> #endif

Works for me, fixed in v2.

Alistair

>
> Thanks,
> Laurent
>
> > diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
> > index 5c87282209..b2b071969b 100644
> > --- a/linux-user/riscv/syscall_nr.h
> > +++ b/linux-user/riscv/syscall_nr.h
> > @@ -10,7 +10,10 @@
> >  #define TARGET_NR_io_destroy 1
> >  #define TARGET_NR_io_submit 2
> >  #define TARGET_NR_io_cancel 3
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_io_getevents 4
> > +#endif
> > +
> >  #define TARGET_NR_setxattr 5
> >  #define TARGET_NR_lsetxattr 6
> >  #define TARGET_NR_fsetxattr 7
> > @@ -23,12 +26,17 @@
> >  #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
> >  #ifdef TARGET_RISCV32
> > @@ -36,27 +44,35 @@
> >  #else
> >  #define TARGET_NR_fcntl 25
> >  #endif
> > +
> >  #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_renameat 38
> > +
> >  #define TARGET_NR_umount2 39
> >  #define TARGET_NR_mount 40
> >  #define TARGET_NR_pivot_root 41
> > +
> >  #define TARGET_NR_nfsservctl 42
> > +
> >  #define TARGET_NR_statfs 43
> >  #define TARGET_NR_fstatfs 44
> >  #define TARGET_NR_truncate 45
> >  #define TARGET_NR_ftruncate 46
> > +
> >  #define TARGET_NR_fallocate 47
> >  #define TARGET_NR_faccessat 48
> >  #define TARGET_NR_chdir 49
> > @@ -69,9 +85,13 @@
> >  #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
> > +
> >  #ifdef TARGET_RISCV32
> >  #define TARGET_NR__llseek 62
> >  #else
> > @@ -85,53 +105,91 @@
> >  #define TARGET_NR_pwrite64 68
> >  #define TARGET_NR_preadv 69
> >  #define TARGET_NR_pwritev 70
> > +
> >  #define TARGET_NR_sendfile 71
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_pselect6 72
> >  #define TARGET_NR_ppoll 73
> > +#endif
> > +
> >  #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_newfstatat 79
> >  #define TARGET_NR_fstat 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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_timerfd_settime 86
> >  #define TARGET_NR_timerfd_gettime 87
> > +#endif
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_utimensat 88
> > +#endif
> > +
> >  #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
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_futex 98
> > +#endif
> >  #define TARGET_NR_set_robust_list 99
> >  #define TARGET_NR_get_robust_list 100
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_nanosleep 101
> > +#endif
> > +
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_timer_gettime 108
> > +#endif
> >  #define TARGET_NR_timer_getoverrun 109
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_timer_settime 110
> > +#endif
> >  #define TARGET_NR_timer_delete 111
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_clock_settime 112
> >  #define TARGET_NR_clock_gettime 113
> >  #define TARGET_NR_clock_getres 114
> >  #define TARGET_NR_clock_nanosleep 115
> > +#endif
> > +
> >  #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
> > @@ -141,7 +199,10 @@
> >  #define TARGET_NR_sched_yield 124
> >  #define TARGET_NR_sched_get_priority_max 125
> >  #define TARGET_NR_sched_get_priority_min 126
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_sched_rr_get_interval 127
> > +#endif
> > +
> >  #define TARGET_NR_restart_syscall 128
> >  #define TARGET_NR_kill 129
> >  #define TARGET_NR_tkill 130
> > @@ -151,9 +212,12 @@
> >  #define TARGET_NR_rt_sigaction 134
> >  #define TARGET_NR_rt_sigprocmask 135
> >  #define TARGET_NR_rt_sigpending 136
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_rt_sigtimedwait 137
> > +#endif
> >  #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
> > @@ -177,15 +241,23 @@
> >  #define TARGET_NR_uname 160
> >  #define TARGET_NR_sethostname 161
> >  #define TARGET_NR_setdomainname 162
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_getrlimit 163
> >  #define TARGET_NR_setrlimit 164
> > +#endif
> > +
> >  #define TARGET_NR_getrusage 165
> >  #define TARGET_NR_umask 166
> >  #define TARGET_NR_prctl 167
> >  #define TARGET_NR_getcpu 168
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_gettimeofday 169
> >  #define TARGET_NR_settimeofday 170
> >  #define TARGET_NR_adjtimex 171
> > +#endif
> > +
> >  #define TARGET_NR_getpid 172
> >  #define TARGET_NR_getppid 173
> >  #define TARGET_NR_getuid 174
> > @@ -194,24 +266,34 @@
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_mq_timedsend 182
> >  #define TARGET_NR_mq_timedreceive 183
> > +#endif
> >  #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
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_semtimedop 192
> > +#endif
> >  #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
> > @@ -227,15 +309,20 @@
> >  #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
> > +
> >  #ifdef TARGET_RISCV32
> >  #define TARGET_NR_mmap2 222
> >  #define TARGET_NR_fadvise64_64 223
> > @@ -243,6 +330,7 @@
> >  #define TARGET_NR_mmap 222
> >  #define TARGET_NR_fadvise64 223
> >  #endif
> > +
> >  #define TARGET_NR_swapon 224
> >  #define TARGET_NR_swapoff 225
> >  #define TARGET_NR_mprotect 226
> > @@ -259,18 +347,29 @@
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_recvmmsg 243
> > +#endif
> > +
> >  #define TARGET_NR_arch_specific_syscall 244
> > +
> > +#define TARGET_NR_riscv_flush_icache TARGET_NR_arch_specific_syscall + 15
> > +
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_wait4 260
> > +#endif
> >  #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
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_clock_adjtime 266
> > +#endif
> >  #define TARGET_NR_syncfs 267
> >  #define TARGET_NR_setns 268
> >  #define TARGET_NR_sendmmsg 269
> > @@ -296,10 +395,67 @@
> >  #define TARGET_NR_pkey_alloc 289
> >  #define TARGET_NR_pkey_free 290
> >  #define TARGET_NR_statx 291
> > +#ifndef TARGET_RISCV32
> >  #define TARGET_NR_io_pgetevents 292
> > +#endif
> >  #define TARGET_NR_rseq 293
> >  #define TARGET_NR_kexec_file_load 294
> >
> > -#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
> > +#ifdef TARGET_RISCV32
> > +#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
> > +#endif
> > +
> > +#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 (TARGET_NR_clone3 + 1)
> > +
> > +/* Alias some of the older pre 64-bit time_t syscalls to the 64-bit
> > + * ones for RV32. This is based on the list used by glibc. */
> > +#ifdef TARGET_RISCV32
> > +#define TARGET_NR_futex TARGET_NR_futex_time64
> > +#define TARGET_NR_rt_sigtimedwait TARGET_NR_rt_sigtimedwait_time64
> > +#define TARGET_NR_ppoll TARGET_NR_ppoll_time64
> > +#define TARGET_NR_utimensat TARGET_NR_utimensat_time64
> > +#define TARGET_NR_pselect6 TARGET_NR_pselect6_time64
> > +#define TARGET_NR_recvmmsg TARGET_NR_recvmmsg_time64
> > +#define TARGET_NR_semtimedop TARGET_NR_semtimedop_time64
> > +#define TARGET_NR_mq_timedreceive TARGET_NR_mq_timedreceive_time64
> > +#define TARGET_NR_mq_timedsend TARGET_NR_mq_timedsend_time64
> > +#define TARGET_NR_clock_getres TARGET_NR_clock_getres_time64
> > +#define TARGET_NR_timerfd_settime TARGET_NR_timerfd_settime64
> > +#define TARGET_NR_timerfd_gettime TARGET_NR_timerfd_gettime64
> > +#define TARGET_NR_sched_rr_get_interval TARGET_NR_sched_rr_get_interval_time64
> > +#define TARGET_NR_clock_adjtime TARGET_NR_clock_adjtime64
> > +#endif
> >
> >  #endif
> >
>


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

end of thread, other threads:[~2020-02-24 19:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 23:18 [PATCH v1 0/2] linux-user: generate syscall_nr.sh for RISC-V Alistair Francis
2020-02-20 23:18 ` Alistair Francis
2020-02-20 23:18 ` [PATCH v1 1/2] linux-user: Protect more syscalls Alistair Francis
2020-02-20 23:18   ` Alistair Francis
2020-02-21  8:55   ` Philippe Mathieu-Daudé
2020-02-21  8:55     ` Philippe Mathieu-Daudé
2020-02-20 23:18 ` [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel Alistair Francis
2020-02-20 23:18   ` Alistair Francis
2020-02-22 11:29   ` Laurent Vivier
2020-02-22 11:29     ` Laurent Vivier
2020-02-24 19:30     ` Alistair Francis
2020-02-24 19:30       ` Alistair Francis
2020-02-20 23:31 ` [PATCH v1 0/2] linux-user: generate syscall_nr.sh for RISC-V no-reply
2020-02-20 23:31   ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.