Re: [PATCH v2 5/9] linux-user: mips: Update syscall numbers to kernel 5.5 level

2020-02-13 Thread Aleksandar Markovic

 > > + MIPS_SYS(sys_clock_gettime64, 2)
> > + MIPS_SYS(sys_clock_settime64, 4)
> > + MIPS_SYS(sys_clock_adjtime64, 2) /* 405 */
> > + MIPS_SYS(sys_clock_getres_time64, 4)
>
> According to
> https://github.com/strace/strace/blob/master/linux/syscallent-common-32.h:
>
> [BASE_NR + 406] = { 2, 0, SEN(clock_getres_time64),
> "clock_getres_time64" },
>

404 also has the same problem, I am going to fix both.

Thanks,
Aleksandar

>
> once fixed you can add my
>
> Reviewed-by: Laurent Vivier 


 


Re: [PATCH v2 5/9] linux-user: mips: Update syscall numbers to kernel 5.5 level

2020-02-13 Thread Laurent Vivier
Le 13/02/2020 à 02:46, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic 
> 
> Update mips syscall numbers based on Linux kernel tag v5.5.
> 
> CC: Aurelien Jarno 
> CC: Aleksandar Rikalo 
> Signed-off-by: Aleksandar Markovic 
> ---
>  linux-user/mips/syscall_nr.h   | 45 +++
>  linux-user/mips64/syscall_nr.h | 50 -
>  linux-user/mips/cpu_loop.c | 83 
> +-
>  3 files changed, 175 insertions(+), 3 deletions(-)
> 
...
> diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
> index 39915b3..a2c72fa 100644
> --- a/linux-user/mips/cpu_loop.c
> +++ b/linux-user/mips/cpu_loop.c
> @@ -25,8 +25,9 @@
>  #include "internal.h"
>  
>  # ifdef TARGET_ABI_MIPSO32
> +#  define MIPS_SYSCALL_NUMBER_UNUSED -1
>  #  define MIPS_SYS(name, args) args,
> -static const uint8_t mips_syscall_args[] = {
> +static const int8_t mips_syscall_args[] = {
>  MIPS_SYS(sys_syscall, 8)/* 4000 */
>  MIPS_SYS(sys_exit   , 1)
>  MIPS_SYS(sys_fork   , 0)
> @@ -390,6 +391,80 @@ static const uint8_t mips_syscall_args[] = {
>  MIPS_SYS(sys_copy_file_range, 6) /* 360 */
>  MIPS_SYS(sys_preadv2, 6)
>  MIPS_SYS(sys_pwritev2, 6)
> +MIPS_SYS(sys_pkey_mprotect, 4)
> +MIPS_SYS(sys_pkey_alloc, 2)
> +MIPS_SYS(sys_pkey_free, 1) /* 365 */
> +MIPS_SYS(sys_statx, 5)
> +MIPS_SYS(sys_rseq, 4)
> +MIPS_SYS(sys_io_pgetevents, 6)
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,/* 370 */
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,/* 375 */
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,/* 380 */
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,/* 385 */
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,/* 390 */
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYSCALL_NUMBER_UNUSED,
> +MIPS_SYS(sys_semget, 3)
> +MIPS_SYS(sys_semctl, 4)
> +MIPS_SYS(sys_shmget, 3)/* 395 */
> +MIPS_SYS(sys_shmctl, 3)
> +MIPS_SYS(sys_shmat, 3)
> +MIPS_SYS(sys_shmdt, 1)
> +MIPS_SYS(sys_msgget, 2)
> +MIPS_SYS(sys_msgsnd, 4)/* 400 */
> +MIPS_SYS(sys_msgrcv, 5)
> +MIPS_SYS(sys_msgctl, 3)
> +MIPS_SYS(sys_clock_gettime64, 2)
> +MIPS_SYS(sys_clock_settime64, 4)
> +MIPS_SYS(sys_clock_adjtime64, 2)   /* 405 */
> +MIPS_SYS(sys_clock_getres_time64, 4)

According to
https://github.com/strace/strace/blob/master/linux/syscallent-common-32.h:

[BASE_NR + 406] = { 2,  0,  SEN(clock_getres_time64),
"clock_getres_time64"   },

once fixed you can add my

Reviewed-by: Laurent Vivier 



[PATCH v2 5/9] linux-user: mips: Update syscall numbers to kernel 5.5 level

2020-02-12 Thread Aleksandar Markovic
From: Aleksandar Markovic 

Update mips syscall numbers based on Linux kernel tag v5.5.

CC: Aurelien Jarno 
CC: Aleksandar Rikalo 
Signed-off-by: Aleksandar Markovic 
---
 linux-user/mips/syscall_nr.h   | 45 +++
 linux-user/mips64/syscall_nr.h | 50 -
 linux-user/mips/cpu_loop.c | 83 +-
 3 files changed, 175 insertions(+), 3 deletions(-)

diff --git a/linux-user/mips/syscall_nr.h b/linux-user/mips/syscall_nr.h
index 7fa7fa5..0be3af1 100644
--- a/linux-user/mips/syscall_nr.h
+++ b/linux-user/mips/syscall_nr.h
@@ -376,5 +376,50 @@
 #define TARGET_NR_statx (TARGET_NR_Linux + 366)
 #define TARGET_NR_rseq  (TARGET_NR_Linux + 367)
 #define TARGET_NR_io_pgetevents (TARGET_NR_Linux + 368)
+/* room for arch specific calls */
+#define TARGET_NR_semget(TARGET_NR_Linux + 393)
+#define TARGET_NR_semctl(TARGET_NR_Linux + 394)
+#define TARGET_NR_shmget(TARGET_NR_Linux + 395)
+#define TARGET_NR_shmctl(TARGET_NR_Linux + 396)
+#define TARGET_NR_shmat (TARGET_NR_Linux + 397)
+#define TARGET_NR_shmdt (TARGET_NR_Linux + 398)
+#define TARGET_NR_msgget(TARGET_NR_Linux + 399)
+#define TARGET_NR_msgsnd(TARGET_NR_Linux + 400)
+#define TARGET_NR_msgrcv(TARGET_NR_Linux + 401)
+#define TARGET_NR_msgctl(TARGET_NR_Linux + 402)
+/* 403-423 common for 32-bit archs */
+#define TARGET_NR_clock_gettime64  (TARGET_NR_Linux + 403)
+#define TARGET_NR_clock_settime64  (TARGET_NR_Linux + 404)
+#define TARGET_NR_clock_adjtime64  (TARGET_NR_Linux + 405)
+#define TARGET_NR_clock_getres_time64  (TARGET_NR_Linux + 406)
+#define TARGET_NR_clock_nanosleep_time64   (TARGET_NR_Linux + 407)
+#define TARGET_NR_timer_gettime64  (TARGET_NR_Linux + 408)
+#define TARGET_NR_timer_settime64  (TARGET_NR_Linux + 409)
+#define TARGET_NR_timerfd_gettime64(TARGET_NR_Linux + 410)
+#define TARGET_NR_timerfd_settime64(TARGET_NR_Linux + 411)
+#define TARGET_NR_utimensat_time64 (TARGET_NR_Linux + 412)
+#define TARGET_NR_pselect6_time64  (TARGET_NR_Linux + 413)
+#define TARGET_NR_ppoll_time64 (TARGET_NR_Linux + 414)
+#define TARGET_NR_io_pgetevents_time64 (TARGET_NR_Linux + 416)
+#define TARGET_NR_recvmmsg_time64  (TARGET_NR_Linux + 417)
+#define TARGET_NR_mq_timedsend_time64  (TARGET_NR_Linux + 418)
+#define TARGET_NR_mq_timedreceive_time64   (TARGET_NR_Linux + 419)
+#define TARGET_NR_semtimedop_time64(TARGET_NR_Linux + 420)
+#define TARGET_NR_rt_sigtimedwait_time64   (TARGET_NR_Linux + 421)
+#define TARGET_NR_futex_time64 (TARGET_NR_Linux + 422)
+#define TARGET_NR_sched_rr_get_interval_time64 (TARGET_NR_Linux + 423)
+/* 424 onwards common for all archs */
+#define TARGET_NR_pidfd_send_signal(TARGET_NR_Linux + 424)
+#define TARGET_NR_io_uring_setup   (TARGET_NR_Linux + 425)
+#define TARGET_NR_io_uring_enter   (TARGET_NR_Linux + 426)
+#define TARGET_NR_io_uring_register(TARGET_NR_Linux + 427)
+#define TARGET_NR_open_tree(TARGET_NR_Linux + 428)
+#define TARGET_NR_move_mount   (TARGET_NR_Linux + 429)
+#define TARGET_NR_fsopen   (TARGET_NR_Linux + 430)
+#define TARGET_NR_fsconfig (TARGET_NR_Linux + 431)
+#define TARGET_NR_fsmount  (TARGET_NR_Linux + 432)
+#define TARGET_NR_fspick   (TARGET_NR_Linux + 433)
+#define TARGET_NR_pidfd_open   (TARGET_NR_Linux + 434)
+#define TARGET_NR_clone3   (TARGET_NR_Linux + 435)
 
 #endif
diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
index db40f69..6e23e9f 100644
--- a/linux-user/mips64/syscall_nr.h
+++ b/linux-user/mips64/syscall_nr.h
@@ -339,6 +339,39 @@
 #define TARGET_NR_statx (TARGET_NR_Linux + 330)
 #define TARGET_NR_rseq  (TARGET_NR_Linux + 331)
 #define TARGET_NR_io_pgetevents (TARGET_NR_Linux + 332)
+/* 333 through 402 are unassigned to sync up with generic numbers */
+#define TARGET_NR_clock_gettime64   (TARGET_NR_Linux + 403)
+#define TARGET_NR_clock_settime64   (TARGET_NR_Linux + 404)
+#define TARGET_NR_clock_adjtime64   (TARGET_NR_Linux + 405)
+#define TARGET_NR_clock_getres_time64   (TARGET_NR_Linux + 406)
+#define TARGET_NR_clock_nanosleep_time64 (TARGET_NR_Linux + 407)
+#define TARGET_NR_timer_gettime64   (TARGET_NR_Linux + 408)
+#define TARGET_NR_timer_settime64   (TARGET_NR_Linux + 409)
+#define TARGET_NR_timerfd_gettime64 (TARGET_NR_Linux + 410)
+#define TARGET_NR_timerfd_settime64 (TARGET_NR_Linux + 411)
+#define TARGET_NR_utimensat_time64