* [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level
@ 2020-02-04 12:07 Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 1/9] linux-user: alpha: " Aleksandar Markovic
` (11 more replies)
0 siblings, 12 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel
Cc: Marek Vasut, Peter Maydell, Alistair Francis, Eduardo Habkost,
Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
Chris Wulff, Mark Cave-Ayland, laurent, Palmer Dabbelt,
amarkovic, Edgar E . Iglesias, Paolo Bonzini, Stafford Horne,
David Gibson, Artyom Tarasenko, Richard Henderson
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Hello, folks!
This series is a spin-off of another larger linux-user series
that become too large to handle, hence these patches related to
syscall numbers are now in this, separate, series.
Now that kernel 5.5 is released few days ago, it is time to
reflect what can be updated in linux-user for upcomming QEMU 5.0.
An obvoius kernel change we should take into account are new
system calls, and the foirst step is updating syscall numbers
mainteined within QEMU linux-user.
Regarding kernel syscal numbers there is good news and bad news.
The good news is that kernel developers decided to make future
syscall numbers much more synchonized accross architectures than
before. They already reached that state.
The bad news is that we in QEMU did not reach that state yet, since
we lag after kernel significantly.
The good news again is that we will reach that state if we update
syscall numbers accross the board now. This is the main intention
and motivation of this series.
The bad news again is that in order to update syscall numebrs we
need to be very careful at this moment. There are a number of new
syscalls added to the kernel recently that QEMU doesn't know about
at all. Significant number of new syscalls deal with 32/64-bit
compatibility, traditionally a problematic area in kernel, and in
QEMU as well. Moreover, some of the new syscalls are applicable to
32-bit architectures only.
This series covers updating syscall numbers defined in the following
files:
- linux-user/alpha/syscall_nr.h
- linux-user/arm/syscall_nr.h
- linux-user/m68k/syscall_nr.h
- linux-user/microblaze/syscall_nr.h
- linux-user/mips/cpu_loop.c
- linux-user/mips/syscall_nr.h
- linux-user/mips64/syscall_nr.h
- linux-user/sh4/syscall_nr.h
- linux-user/x86_64/syscall_nr.h
- linux-user/xtensa/syscall_nr.h
This series doesn't cover following files (since they use certain
proprietary rules for mapping between kernel source and qemu source,
I don't feel quite comfortable changing them - therefore I am asking
corresponding target maintainers or Lauren to update them, if
possible, before our 5.0 release):
- linux-user/aarch64/syscall_nr.h
- linux-user/i386/syscall_nr.h
- linux-user/nios2/syscall_nr.h
- linux-user/ppc/syscall_nr.h
- linux-user/riscv/syscall_nr.h
- linux-user/s390x/syscall_nr.h
- linux-user/sparc/syscall_nr.h
- linux-user/sparc64/syscall_nr.h
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Eduardo Habkost <ehabkost@redhat.com>
CC: Chris Wulff <crwulff@gmail.com>
CC: Marek Vasut <marex@denx.de>
CC: David Gibson <david@gibson.dropbear.id.au>
CC: Palmer Dabbelt <palmer@dabbelt.com>
CC: Alistair Francis <Alistair.Francis@wdc.com>
CC: Sagar Karandikar <sagark@eecs.berkeley.edu>
CC: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
CC: David Hildenbrand <david@redhat.com>
CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Artyom Tarasenko <atar4qemu@gmail.com>
This series also doesn't cover following files (since I can't find
corresponding kernel code - and I am also asking corresponding
target maintainers or Lauren to update them, if possible, before
our 5.0 release):
- linux-user/cris/cpu_loop.c
- linux-user/hppa/syscall_nr.h
- linux-user/openrisc/syscall_nr.h
- linux-user/tilegx/syscall_nr.h
CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Stafford Horne <shorne@gmail.com>
Again, I don't plan (I am really running out of time resources) to
work in a significant way on this issue any more, and I am asking
you guys other maintainers to help finish updating syscall numbers
before QEMU 5.0 release.
Once we do that, updating syscall numbers in QEMU should and will
be significantly easier.
Thanks in advance!
Truly yours,
Aleksandar
-----------------------------------------------------------------------
Aleksandar Markovic (9):
linux-user: alpha: Update syscall numbers to kernel 5.5 level
linux-user: arm: Update syscall numbers to kernel 5.5 level
linux-user: m68k: Update syscall numbers to kernel 5.5 level
linux-user: microblaze: Update syscall numbers to kernel 5.5 level
linux-user: mips: Update syscall numbers to kernel 5.5 level
linux-user: sh4: Update syscall numbers to kernel 5.5 level
linux-user: x86_64: Update syscall numbers to kernel 5.5 level
linux-user: xtensa: Update syscall numbers to kernel 5.5 level
linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count
linux-user/alpha/syscall_nr.h | 35 +++++++++++++++++
linux-user/arm/syscall_nr.h | 44 +++++++++++++++++++++
linux-user/m68k/syscall_nr.h | 50 +++++++++++++++++++++++-
linux-user/microblaze/syscall_nr.h | 45 ++++++++++++++++++++++
linux-user/mips/cpu_loop.c | 78 +++++++++++++++++++++++++++++++++++++-
linux-user/mips/syscall_nr.h | 45 ++++++++++++++++++++++
linux-user/mips64/syscall_nr.h | 13 +++++++
linux-user/sh4/syscall_nr.h | 48 +++++++++++++++++++++++
linux-user/x86_64/syscall_nr.h | 24 ++++++++++++
linux-user/xtensa/syscall_nr.h | 36 +++++++++++++++++-
10 files changed, 414 insertions(+), 4 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/9] linux-user: alpha: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 2/9] linux-user: arm: " Aleksandar Markovic
` (10 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: laurent, amarkovic, Richard Henderson
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update alpha syscall numbers based on Linux kernel v5.5.
CC: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/alpha/syscall_nr.h | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h
index 2e5541b..c29fc17 100644
--- a/linux-user/alpha/syscall_nr.h
+++ b/linux-user/alpha/syscall_nr.h
@@ -453,5 +453,40 @@
#define TARGET_NR_getrandom 511
#define TARGET_NR_memfd_create 512
#define TARGET_NR_execveat 513
+#define TARGET_NR_seccomp 514
+#define TARGET_NR_bpf 515
+#define TARGET_NR_userfaultfd 516
+#define TARGET_NR_membarrier 517
+#define TARGET_NR_mlock2 518
+#define TARGET_NR_copy_file_range 519
+#define TARGET_NR_preadv2 520
+#define TARGET_NR_pwritev2 521
+#define TARGET_NR_statx 522
+#define TARGET_NR_io_pgetevents 523
+#define TARGET_NR_pkey_mprotect 524
+#define TARGET_NR_pkey_alloc 525
+#define TARGET_NR_pkey_free 526
+#define TARGET_NR_rseq 527
+#define TARGET_NR_statfs64 528
+#define TARGET_NR_fstatfs64 529
+#define TARGET_NR_getegid 530
+#define TARGET_NR_geteuid 531
+#define TARGET_NR_getppid 532
+/*
+ * all other architectures have common numbers for new syscall, alpha
+ * is the exception.
+ */
+#define TARGET_NR_pidfd_send_signal 534
+#define TARGET_NR_io_uring_setup 535
+#define TARGET_NR_io_uring_enter 536
+#define TARGET_NR_io_uring_register 537
+#define TARGET_NR_open_tree 538
+#define TARGET_NR_move_mount 539
+#define TARGET_NR_fsopen 540
+#define TARGET_NR_fsconfig 541
+#define TARGET_NR_fsmount 542
+#define TARGET_NR_fspick 543
+#define TARGET_NR_pidfd_open 544
+/* 545 reserved for clone3 */
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/9] linux-user: arm: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 1/9] linux-user: alpha: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-12 21:18 ` Laurent Vivier
2020-02-04 12:07 ` [PATCH 3/9] linux-user: m68k: " Aleksandar Markovic
` (9 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update arm syscall numbers based on Linux kernel v5.5.
CC: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
linux-user/arm/syscall_nr.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_nr.h
index e7eda0d..6db9235 100644
--- a/linux-user/arm/syscall_nr.h
+++ b/linux-user/arm/syscall_nr.h
@@ -399,5 +399,49 @@
#define TARGET_NR_userfaultfd (388)
#define TARGET_NR_membarrier (389)
#define TARGET_NR_mlock2 (390)
+#define TARGET_NR_copy_file_range (391)
+#define TARGET_NR_preadv2 (392)
+#define TARGET_NR_pwritev2 (393)
+#define TARGET_NR_pkey_mprotect (394)
+#define TARGET_NR_pkey_alloc (395)
+#define TARGET_NR_pkey_free (396)
+#define TARGET_NR_statx (397)
+#define TARGET_NR_rseq (398)
+#define TARGET_NR_io_pgetevents (399)
+#define TARGET_NR_migrate_pages (400)
+#define TARGET_NR_kexec_file_load (401)
+/* 402 is unused */
+#define TARGET_NR_clock_gettime64 (403)
+#define TARGET_NR_clock_settime64 (404)
+#define TARGET_NR_clock_adjtime64 (405)
+#define TARGET_NR_clock_getres_time64 (406)
+#define TARGET_NR_clock_nanosleep_time64 (407)
+#define TARGET_NR_timer_gettime64 (408)
+#define TARGET_NR_timer_settime64 (409)
+#define TARGET_NR_timerfd_gettime64 (410)
+#define TARGET_NR_timerfd_settime64 (411)
+#define TARGET_NR_utimensat_time64 (412)
+#define TARGET_NR_pselect6_time64 (413)
+#define TARGET_NR_ppoll_time64 (414)
+#define TARGET_NR_io_pgetevents_time64 (416)
+#define TARGET_NR_recvmmsg_time64 (417)
+#define TARGET_NR_mq_timedsend_time64 (418)
+#define TARGET_NR_mq_timedreceive_time64 (419)
+#define TARGET_NR_semtimedop_time64 (420)
+#define TARGET_NR_rt_sigtimedwait_time64 (421)
+#define TARGET_NR_futex_time64 (422)
+#define TARGET_NR_sched_rr_get_interval_time64 (423)
+#define TARGET_NR_pidfd_send_signal (424)
+#define TARGET_NR_io_uring_setup (425)
+#define TARGET_NR_io_uring_enter (426)
+#define TARGET_NR_io_uring_register (427)
+#define TARGET_NR_open_tree (428)
+#define TARGET_NR_move_mount (429)
+#define TARGET_NR_fsopen (430)
+#define TARGET_NR_fsconfig (431)
+#define TARGET_NR_fsmount (432)
+#define TARGET_NR_fspick (433)
+#define TARGET_NR_pidfd_open (434)
+#define TARGET_NR_clone3 (435)
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/9] linux-user: m68k: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 1/9] linux-user: alpha: " Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 2/9] linux-user: arm: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 4/9] linux-user: microblaze: " Aleksandar Markovic
` (8 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update m68k syscall numbers based on Linux kernel v5.5.
CC: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/m68k/syscall_nr.h | 50 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/linux-user/m68k/syscall_nr.h b/linux-user/m68k/syscall_nr.h
index d33d8e9..01aee34 100644
--- a/linux-user/m68k/syscall_nr.h
+++ b/linux-user/m68k/syscall_nr.h
@@ -382,5 +382,53 @@
#define TARGET_NR_copy_file_range 376
#define TARGET_NR_preadv2 377
#define TARGET_NR_pwritev2 378
-
+#define TARGET_NR_statx 379
+#define TARGET_NR_seccomp 380
+#define TARGET_NR_pkey_mprotect 381
+#define TARGET_NR_pkey_alloc 382
+#define TARGET_NR_pkey_free 383
+#define TARGET_NR_rseq 384
+/* room for arch specific calls */
+#define TARGET_NR_semget 393
+#define TARGET_NR_semctl 394
+#define TARGET_NR_shmget 395
+#define TARGET_NR_shmctl 396
+#define TARGET_NR_shmat 397
+#define TARGET_NR_shmdt 398
+#define TARGET_NR_msgget 399
+#define TARGET_NR_msgsnd 400
+#define TARGET_NR_msgrcv 401
+#define TARGET_NR_msgctl 402
+#define TARGET_NR_clock_gettime64 403
+#define TARGET_NR_clock_settime64 404
+#define TARGET_NR_clock_adjtime64 405
+#define TARGET_NR_clock_getres_time64 406
+#define TARGET_NR_clock_nanosleep_time64 407
+#define TARGET_NR_timer_gettime64 408
+#define TARGET_NR_timer_settime64 409
+#define TARGET_NR_timerfd_gettime64 410
+#define TARGET_NR_timerfd_settime64 411
+#define TARGET_NR_utimensat_time64 412
+#define TARGET_NR_pselect6_time64 413
+#define TARGET_NR_ppoll_time64 414
+#define TARGET_NR_io_pgetevents_time64 416
+#define TARGET_NR_recvmmsg_time64 417
+#define TARGET_NR_mq_timedsend_time64 418
+#define TARGET_NR_mq_timedreceive_time64 419
+#define TARGET_NR_semtimedop_time64 420
+#define TARGET_NR_rt_sigtimedwait_time64 421
+#define TARGET_NR_futex_time64 422
+#define TARGET_NR_sched_rr_get_interval_time64 423
+#define TARGET_NR_pidfd_send_signal 424
+#define TARGET_NR_io_uring_setup 425
+#define TARGET_NR_io_uring_enter 426
+#define TARGET_NR_io_uring_register 427
+#define TARGET_NR_open_tree 428
+#define TARGET_NR_move_mount 429
+#define TARGET_NR_fsopen 430
+#define TARGET_NR_fsconfig 431
+#define TARGET_NR_fsmount 432
+#define TARGET_NR_fspick 433
+#define TARGET_NR_pidfd_open 434
+/* 435 reserved for clone3 */
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/9] linux-user: microblaze: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (2 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 3/9] linux-user: m68k: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 5/9] linux-user: mips: " Aleksandar Markovic
` (7 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Edgar E . Iglesias, laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update microblaze syscall numbers based on Linux kernel v5.5.
CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/microblaze/syscall_nr.h | 45 ++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/linux-user/microblaze/syscall_nr.h b/linux-user/microblaze/syscall_nr.h
index aa2eb93..ec1758e 100644
--- a/linux-user/microblaze/syscall_nr.h
+++ b/linux-user/microblaze/syscall_nr.h
@@ -393,5 +393,50 @@
#define TARGET_NR_memfd_create 386
#define TARGET_NR_bpf 387
#define TARGET_NR_execveat 388
+#define TARGET_NR_userfaultfd 389
+#define TARGET_NR_membarrier 390
+#define TARGET_NR_mlock2 391
+#define TARGET_NR_copy_file_range 392
+#define TARGET_NR_preadv2 393
+#define TARGET_NR_pwritev2 394
+#define TARGET_NR_pkey_mprotect 395
+#define TARGET_NR_pkey_alloc 396
+#define TARGET_NR_pkey_free 397
+#define TARGET_NR_statx 398
+#define TARGET_NR_io_pgetevents 399
+#define TARGET_NR_rseq 400
+/* 401 and 402 are unused */
+#define TARGET_NR_clock_gettime64 403
+#define TARGET_NR_clock_settime64 404
+#define TARGET_NR_clock_adjtime64 405
+#define TARGET_NR_clock_getres_time64 406
+#define TARGET_NR_clock_nanosleep_time64 407
+#define TARGET_NR_timer_gettime64 408
+#define TARGET_NR_timer_settime64 409
+#define TARGET_NR_timerfd_gettime64 410
+#define TARGET_NR_timerfd_settime64 411
+#define TARGET_NR_utimensat_time64 412
+#define TARGET_NR_pselect6_time64 413
+#define TARGET_NR_ppoll_time64 414
+#define TARGET_NR_io_pgetevents_time64 416
+#define TARGET_NR_recvmmsg_time64 417
+#define TARGET_NR_mq_timedsend_time64 418
+#define TARGET_NR_mq_timedreceive_time64 419
+#define TARGET_NR_semtimedop_time64 420
+#define TARGET_NR_rt_sigtimedwait_time64 421
+#define TARGET_NR_futex_time64 422
+#define TARGET_NR_sched_rr_get_interval_time64 423
+#define TARGET_NR_pidfd_send_signal 424
+#define TARGET_NR_io_uring_setup 425
+#define TARGET_NR_io_uring_enter 426
+#define TARGET_NR_io_uring_register 427
+#define TARGET_NR_open_tree 428
+#define TARGET_NR_move_mount 429
+#define TARGET_NR_fsopen 430
+#define TARGET_NR_fsconfig 431
+#define TARGET_NR_fsmount 432
+#define TARGET_NR_fspick 433
+#define TARGET_NR_pidfd_open 434
+#define TARGET_NR_clone3 435
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 5/9] linux-user: mips: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (3 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 4/9] linux-user: microblaze: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-12 21:09 ` Laurent Vivier
2020-02-04 12:07 ` [PATCH 6/9] linux-user: sh4: " Aleksandar Markovic
` (6 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Aurelien Jarno, Aleksandar Rikalo, laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update mips syscall numbers based on Linux kernel tag v5.5.
CC: Aurelien Jarno <aurelien@aurel32.net>
CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
linux-user/mips/cpu_loop.c | 78 +++++++++++++++++++++++++++++++++++++++++-
linux-user/mips/syscall_nr.h | 45 ++++++++++++++++++++++++
linux-user/mips64/syscall_nr.h | 13 +++++++
3 files changed, 135 insertions(+), 1 deletion(-)
diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
index 39915b3..b81479b 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,75 @@ 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_timer_gettime64, 2)
+ MIPS_SYS(sys_timer_settime64, 4)
+ MIPS_SYS(sys_timerfd_gettime64, 2) /* 410 */
+ MIPS_SYS(sys_timerfd_settime64, 4)
+ MIPS_SYS(sys_utimensat_time64, 4)
+ MIPS_SYS(sys_pselect6_time64, 6)
+ MIPS_SYS(sys_ppoll_time64, 5)
+ MIPS_SYSCALL_NUMBER_UNUSED, /* 415 */
+ MIPS_SYS(sys_io_pgetevents_time64, 6)
+ MIPS_SYS(sys_recvmmsg_time64, 5)
+ MIPS_SYS(sys_mq_timedsend_time64, 5)
+ MIPS_SYS(sys_mq_timedreceive_time64, 5)
+ MIPS_SYS(sys_semtimedop_time64, 4) /* 420 */
+ MIPS_SYS(sys_rt_sigtimedwait_time64, 4)
+ MIPS_SYS(sys_futex_time64, 6)
+ MIPS_SYS(sys_sched_rr_get_interval_time64, 2)
+ MIPS_SYS(sys_pidfd_send_signal, 4)
+ MIPS_SYS(sys_io_uring_setup, 2) /* 425 */
+ MIPS_SYS(sys_io_uring_enter, 6)
+ MIPS_SYS(sys_io_uring_register, 4)
+ MIPS_SYS(sys_open_tree, 3)
+ MIPS_SYS(sys_move_mount, 5)
+ MIPS_SYS(sys_fsopen, 2) /* 430 */
+ MIPS_SYS(sys_fsconfig, 5)
+ MIPS_SYS(sys_fsmount, 3)
+ MIPS_SYS(sys_fspick, 3)
+ MIPS_SYS(sys_pidfd_open, 2)
+ MIPS_SYS(sys_clone3, 2) /* 435 */
+
};
# undef MIPS_SYS
# endif /* O32 */
@@ -447,8 +517,14 @@ void cpu_loop(CPUMIPSState *env)
# ifdef TARGET_ABI_MIPSO32
syscall_num = env->active_tc.gpr[2] - 4000;
if (syscall_num >= sizeof(mips_syscall_args)) {
+ /* syscall_num is larger that any defined for MIPS O32 */
+ ret = -TARGET_ENOSYS;
+ } else if (mips_syscall_args[syscall_num] ==
+ MIPS_SYSCALL_NUMBER_UNUSED) {
+ /* syscall_num belongs to the range not defined for MIPS O32 */
ret = -TARGET_ENOSYS;
} else {
+ /* syscall_num is valid */
int nb_args;
abi_ulong sp_reg;
abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
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..c86943a 100644
--- a/linux-user/mips64/syscall_nr.h
+++ b/linux-user/mips64/syscall_nr.h
@@ -674,6 +674,19 @@
#define TARGET_NR_statx (TARGET_NR_Linux + 326)
#define TARGET_NR_rseq (TARGET_NR_Linux + 327)
#define TARGET_NR_io_pgetevents (TARGET_NR_Linux + 328)
+/* 329 through 423 are reserved to sync up with other architectures */
+#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
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/9] linux-user: sh4: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (4 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 5/9] linux-user: mips: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-12 20:38 ` Laurent Vivier
2020-02-04 12:07 ` [PATCH 7/9] linux-user: x86_64: " Aleksandar Markovic
` (5 subsequent siblings)
11 siblings, 1 reply; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Aurelien Jarno, laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update sh4 syscall numbers based on Linux kernel v5.5.
CC: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
linux-user/sh4/syscall_nr.h | 48 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/linux-user/sh4/syscall_nr.h b/linux-user/sh4/syscall_nr.h
index d53a2a0..8c21fcf 100644
--- a/linux-user/sh4/syscall_nr.h
+++ b/linux-user/sh4/syscall_nr.h
@@ -389,5 +389,53 @@
#define TARGET_NR_copy_file_range 380
#define TARGET_NR_preadv2 381
#define TARGET_NR_pwritev2 382
+#define TARGET_NR_statx 383
+#define TARGET_NR_pkey_mprotect 384
+#define TARGET_NR_pkey_alloc 385
+#define TARGET_NR_pkey_free 386
+#define TARGET_NR_rseq 387
+/* room for arch specific syscalls */
+#define TARGET_NR_semget 393
+#define TARGET_NR_semctl 394
+#define TARGET_NR_shmget 395
+#define TARGET_NR_shmctl 396
+#define TARGET_NR_shmat 397
+#define TARGET_NR_shmdt 398
+#define TARGET_NR_msgget 399
+#define TARGET_NR_msgsnd 400
+#define TARGET_NR_msgrcv 401
+#define TARGET_NR_msgctl 402
+#define TARGET_NR_clock_gettime64 403
+#define TARGET_NR_clock_settime64 404
+#define TARGET_NR_clock_adjtime64 405
+#define TARGET_NR_clock_getres_time64 406
+#define TARGET_NR_clock_nanosleep_time64 407
+#define TARGET_NR_timer_gettime64 408
+#define TARGET_NR_timer_settime64 409
+#define TARGET_NR_timerfd_gettime64 410
+#define TARGET_NR_timerfd_settime64 411
+#define TARGET_NR_utimensat_time64 412
+#define TARGET_NR_pselect6_time64 413
+#define TARGET_NR_ppoll_time64 414
+#define TARGET_NR_io_pgetevents_time64 416
+#define TARGET_NR_recvmmsg_time64 417
+#define TARGET_NR_mq_timedsend_time64 418
+#define TARGET_NR_mq_timedreceive_time64 419
+#define TARGET_NR_semtimedop_time64 420
+#define TARGET_NR_rt_sigtimedwait_time64 421
+#define TARGET_NR_futex_time64 422
+#define TARGET_NR_sched_rr_get_interval_time64 423
+#define TARGET_NR_pidfd_send_signal 424
+#define TARGET_NR_io_uring_setup 425
+#define TARGET_NR_io_uring_enter 426
+#define TARGET_NR_io_uring_register 427
+#define TARGET_NR_open_tree 428
+#define TARGET_NR_move_mount 429
+#define TARGET_NR_fsopen 430
+#define TARGET_NR_fsconfig 431
+#define TARGET_NR_fsmount 432
+#define TARGET_NR_fspick 433
+#define TARGET_NR_pidfd_open 434
+/* 435 reserved for clone3 */
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 7/9] linux-user: x86_64: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (5 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 6/9] linux-user: sh4: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 8/9] linux-user: xtensa: " Aleksandar Markovic
` (4 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Eduardo Habkost, laurent, amarkovic, Richard Henderson
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update x86_64 syscall numbers based on Linux kernel v5.5.
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/x86_64/syscall_nr.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/linux-user/x86_64/syscall_nr.h b/linux-user/x86_64/syscall_nr.h
index 9b6981e..e5d14ec 100644
--- a/linux-user/x86_64/syscall_nr.h
+++ b/linux-user/x86_64/syscall_nr.h
@@ -328,5 +328,29 @@
#define TARGET_NR_membarrier 324
#define TARGET_NR_mlock2 325
#define TARGET_NR_copy_file_range 326
+#define TARGET_NR_preadv2 327
+#define TARGET_NR_pwritev2 328
+#define TARGET_NR_pkey_mprotect 329
+#define TARGET_NR_pkey_alloc 330
+#define TARGET_NR_pkey_free 331
+#define TARGET_NR_statx 332
+#define TARGET_NR_io_pgetevents 333
+#define TARGET_NR_rseq 334
+/*
+ * don't use numbers 387 through 423, add new calls after the last
+ * 'common' entry
+ */
+#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
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 8/9] linux-user: xtensa: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (6 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 7/9] linux-user: x86_64: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 9/9] linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count Aleksandar Markovic
` (3 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Max Filippov, laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Update xtensa syscall numbers based on Linux kernel v5.5.
CC: Max Filippov <jcmvbkbc@gmail.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/xtensa/syscall_nr.h | 38 ++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/linux-user/xtensa/syscall_nr.h b/linux-user/xtensa/syscall_nr.h
index 27645be..3d19d0c 100644
--- a/linux-user/xtensa/syscall_nr.h
+++ b/linux-user/xtensa/syscall_nr.h
@@ -431,7 +431,41 @@
#define TARGET_NR_pkey_free 350
#define TARGET_NR_statx 351
-
-#define TARGET_NR_syscall_count 352
+#define TARGET_NR_rseq 352
+/* 353 through 402 are unassigned to sync up with generic numbers */
+#define TARGET_NR_clock_gettime64 403
+#define TARGET_NR_clock_settime64 404
+#define TARGET_NR_clock_adjtime64 405
+#define TARGET_NR_clock_getres_time64 406
+#define TARGET_NR_clock_nanosleep_time64 407
+#define TARGET_NR_timer_gettime64 408
+#define TARGET_NR_timer_settime64 409
+#define TARGET_NR_timerfd_gettime64 410
+#define TARGET_NR_timerfd_settime64 411
+#define TARGET_NR_utimensat_time64 412
+#define TARGET_NR_pselect6_time64 413
+#define TARGET_NR_ppoll_time64 414
+#define TARGET_NR_io_pgetevents_time64 416
+#define TARGET_NR_recvmmsg_time64 417
+#define TARGET_NR_mq_timedsend_time64 418
+#define TARGET_NR_mq_timedreceive_time64 419
+#define TARGET_NR_semtimedop_time64 420
+#define TARGET_NR_rt_sigtimedwait_time64 421
+#define TARGET_NR_futex_time64 422
+#define TARGET_NR_sched_rr_get_interval_time64 423
+#define TARGET_NR_pidfd_send_signal 424
+#define TARGET_NR_io_uring_setup 425
+#define TARGET_NR_io_uring_enter 426
+#define TARGET_NR_io_uring_register 427
+#define TARGET_NR_open_tree 428
+#define TARGET_NR_move_mount 429
+#define TARGET_NR_fsopen 430
+#define TARGET_NR_fsconfig 431
+#define TARGET_NR_fsmount 432
+#define TARGET_NR_fspick 433
+#define TARGET_NR_pidfd_open 434
+#define TARGET_NR_clone3 435
+
+#define TARGET_NR_syscall_count 436
#endif /* XTENSA_SYSCALL_NR_H */
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 9/9] linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (7 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 8/9] linux-user: xtensa: " Aleksandar Markovic
@ 2020-02-04 12:07 ` Aleksandar Markovic
2020-02-04 12:30 ` [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (2 subsequent siblings)
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Max Filippov, laurent, amarkovic
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Currently, there is no usage of TARGET_NR_syscall_count for target
xtensa, and there is no obvious indication if there is some planned
usage in future.
CC: Max Filippov <jcmvbkbc@gmail.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/xtensa/syscall_nr.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/linux-user/xtensa/syscall_nr.h b/linux-user/xtensa/syscall_nr.h
index 3d19d0c..39bff65 100644
--- a/linux-user/xtensa/syscall_nr.h
+++ b/linux-user/xtensa/syscall_nr.h
@@ -466,6 +466,4 @@
#define TARGET_NR_pidfd_open 434
#define TARGET_NR_clone3 435
-#define TARGET_NR_syscall_count 436
-
#endif /* XTENSA_SYSCALL_NR_H */
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (8 preceding siblings ...)
2020-02-04 12:07 ` [PATCH 9/9] linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count Aleksandar Markovic
@ 2020-02-04 12:30 ` Aleksandar Markovic
2020-02-05 21:29 ` Stafford Horne
2020-02-12 21:34 ` Laurent Vivier
11 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-04 12:30 UTC (permalink / raw)
To: Aleksandar Markovic
Cc: Marek Vasut, Peter Maydell, Eduardo Habkost, Sagar Karandikar,
David Hildenbrand, Bastian Koppelmann, Chris Wulff,
Mark Cave-Ayland, QEMU Developers, Laurent Vivier, Paolo Bonzini,
Alistair Francis, Aleksandar Markovic, Edgar E . Iglesias,
Palmer Dabbelt, Stafford Horne, Richard Henderson,
Artyom Tarasenko, David Gibson
On Tue, Feb 4, 2020 at 1:08 PM Aleksandar Markovic
<aleksandar.markovic@rt-rk.com> wrote:
>
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> Hello, folks!
>
> This series is a spin-off of another larger linux-user series
> that become too large to handle, hence these patches related to
> syscall numbers are now in this, separate, series.
>
I forgot to say that, compared to the previous larger linux-user
series, two new patches are added (arm and sh4 related), and
the remaining seven patches are identical (except that "R-b:"s
and "A-b:"s are added when needed).
Sincerely,
Aleksandar
> Now that kernel 5.5 is released few days ago, it is time to
> reflect what can be updated in linux-user for upcomming QEMU 5.0.
>
> An obvoius kernel change we should take into account are new
> system calls, and the foirst step is updating syscall numbers
> mainteined within QEMU linux-user.
>
> Regarding kernel syscal numbers there is good news and bad news.
>
> The good news is that kernel developers decided to make future
> syscall numbers much more synchonized accross architectures than
> before. They already reached that state.
>
> The bad news is that we in QEMU did not reach that state yet, since
> we lag after kernel significantly.
>
> The good news again is that we will reach that state if we update
> syscall numbers accross the board now. This is the main intention
> and motivation of this series.
>
> The bad news again is that in order to update syscall numebrs we
> need to be very careful at this moment. There are a number of new
> syscalls added to the kernel recently that QEMU doesn't know about
> at all. Significant number of new syscalls deal with 32/64-bit
> compatibility, traditionally a problematic area in kernel, and in
> QEMU as well. Moreover, some of the new syscalls are applicable to
> 32-bit architectures only.
>
> This series covers updating syscall numbers defined in the following
> files:
>
> - linux-user/alpha/syscall_nr.h
> - linux-user/arm/syscall_nr.h
> - linux-user/m68k/syscall_nr.h
> - linux-user/microblaze/syscall_nr.h
> - linux-user/mips/cpu_loop.c
> - linux-user/mips/syscall_nr.h
> - linux-user/mips64/syscall_nr.h
> - linux-user/sh4/syscall_nr.h
> - linux-user/x86_64/syscall_nr.h
> - linux-user/xtensa/syscall_nr.h
>
> This series doesn't cover following files (since they use certain
> proprietary rules for mapping between kernel source and qemu source,
> I don't feel quite comfortable changing them - therefore I am asking
> corresponding target maintainers or Lauren to update them, if
> possible, before our 5.0 release):
>
> - linux-user/aarch64/syscall_nr.h
> - linux-user/i386/syscall_nr.h
> - linux-user/nios2/syscall_nr.h
> - linux-user/ppc/syscall_nr.h
> - linux-user/riscv/syscall_nr.h
> - linux-user/s390x/syscall_nr.h
> - linux-user/sparc/syscall_nr.h
> - linux-user/sparc64/syscall_nr.h
>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> CC: Chris Wulff <crwulff@gmail.com>
> CC: Marek Vasut <marex@denx.de>
> CC: David Gibson <david@gibson.dropbear.id.au>
> CC: Palmer Dabbelt <palmer@dabbelt.com>
> CC: Alistair Francis <Alistair.Francis@wdc.com>
> CC: Sagar Karandikar <sagark@eecs.berkeley.edu>
> CC: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> CC: David Hildenbrand <david@redhat.com>
> CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> CC: Artyom Tarasenko <atar4qemu@gmail.com>
>
> This series also doesn't cover following files (since I can't find
> corresponding kernel code - and I am also asking corresponding
> target maintainers or Lauren to update them, if possible, before
> our 5.0 release):
>
> - linux-user/cris/cpu_loop.c
> - linux-user/hppa/syscall_nr.h
> - linux-user/openrisc/syscall_nr.h
> - linux-user/tilegx/syscall_nr.h
>
> CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Stafford Horne <shorne@gmail.com>
>
> Again, I don't plan (I am really running out of time resources) to
> work in a significant way on this issue any more, and I am asking
> you guys other maintainers to help finish updating syscall numbers
> before QEMU 5.0 release.
>
> Once we do that, updating syscall numbers in QEMU should and will
> be significantly easier.
>
> Thanks in advance!
>
> Truly yours,
> Aleksandar
>
> -----------------------------------------------------------------------
>
> Aleksandar Markovic (9):
> linux-user: alpha: Update syscall numbers to kernel 5.5 level
> linux-user: arm: Update syscall numbers to kernel 5.5 level
> linux-user: m68k: Update syscall numbers to kernel 5.5 level
> linux-user: microblaze: Update syscall numbers to kernel 5.5 level
> linux-user: mips: Update syscall numbers to kernel 5.5 level
> linux-user: sh4: Update syscall numbers to kernel 5.5 level
> linux-user: x86_64: Update syscall numbers to kernel 5.5 level
> linux-user: xtensa: Update syscall numbers to kernel 5.5 level
> linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count
>
> linux-user/alpha/syscall_nr.h | 35 +++++++++++++++++
> linux-user/arm/syscall_nr.h | 44 +++++++++++++++++++++
> linux-user/m68k/syscall_nr.h | 50 +++++++++++++++++++++++-
> linux-user/microblaze/syscall_nr.h | 45 ++++++++++++++++++++++
> linux-user/mips/cpu_loop.c | 78 +++++++++++++++++++++++++++++++++++++-
> linux-user/mips/syscall_nr.h | 45 ++++++++++++++++++++++
> linux-user/mips64/syscall_nr.h | 13 +++++++
> linux-user/sh4/syscall_nr.h | 48 +++++++++++++++++++++++
> linux-user/x86_64/syscall_nr.h | 24 ++++++++++++
> linux-user/xtensa/syscall_nr.h | 36 +++++++++++++++++-
> 10 files changed, 414 insertions(+), 4 deletions(-)
>
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (9 preceding siblings ...)
2020-02-04 12:30 ` [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
@ 2020-02-05 21:29 ` Stafford Horne
2020-02-12 21:34 ` Laurent Vivier
11 siblings, 0 replies; 18+ messages in thread
From: Stafford Horne @ 2020-02-05 21:29 UTC (permalink / raw)
To: Aleksandar Markovic
Cc: Marek Vasut, Peter Maydell, Alistair Francis, Eduardo Habkost,
Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
Chris Wulff, Mark Cave-Ayland, qemu-devel, laurent,
Palmer Dabbelt, amarkovic, Edgar E . Iglesias, Paolo Bonzini,
David Gibson, Artyom Tarasenko, Richard Henderson
On Tue, Feb 04, 2020 at 01:07:29PM +0100, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> This series also doesn't cover following files (since I can't find
> corresponding kernel code - and I am also asking corresponding
> target maintainers or Lauren to update them, if possible, before
> our 5.0 release):
OpenRISC is in the kernel under arch/openrisc and the syscall numbers we
user are just like other architectures, it's in:
linux/arch/openrisc/include/uapi/asm/unistd.h
This then includes the generic numbers:
linux/include/uapi/asm-generic/unistd.h
There are other architectures in the kernel, like arm64, risvc, nios2 using the
generic syscall numbers.
Should QEMU also have linux-user/generic/syscall_nr.h that mirrors the generic
file in linux? This way this could be maintained in just one place.
> - linux-user/cris/cpu_loop.c
> - linux-user/hppa/syscall_nr.h
> - linux-user/openrisc/syscall_nr.h
> - linux-user/tilegx/syscall_nr.h
>
> CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Stafford Horne <shorne@gmail.com>
>
> Again, I don't plan (I am really running out of time resources) to
> work in a significant way on this issue any more, and I am asking
> you guys other maintainers to help finish updating syscall numbers
> before QEMU 5.0 release.
I actually have a patch to add syscall numbers for openrisc which I am using to
test our new glibc port right now. I will clean if up and submit for review.
It looks like for 5.0 we would need to get changes in by March 23:
https://wiki.qemu.org/Planning/5.0
I'll try to aim to get my change up for review soon then.
-Stafford
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 6/9] linux-user: sh4: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 ` [PATCH 6/9] linux-user: sh4: " Aleksandar Markovic
@ 2020-02-12 20:38 ` Laurent Vivier
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Vivier @ 2020-02-12 20:38 UTC (permalink / raw)
To: Aleksandar Markovic, qemu-devel; +Cc: amarkovic, Aurelien Jarno
Le 04/02/2020 à 13:07, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> Update sh4 syscall numbers based on Linux kernel v5.5.
>
> CC: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
> linux-user/sh4/syscall_nr.h | 48 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/9] linux-user: mips: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 ` [PATCH 5/9] linux-user: mips: " Aleksandar Markovic
@ 2020-02-12 21:09 ` Laurent Vivier
2020-02-13 1:26 ` Aleksandar Markovic
0 siblings, 1 reply; 18+ messages in thread
From: Laurent Vivier @ 2020-02-12 21:09 UTC (permalink / raw)
To: Aleksandar Markovic, qemu-devel
Cc: Aleksandar Rikalo, amarkovic, Aurelien Jarno
Le 04/02/2020 à 13:07, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> Update mips syscall numbers based on Linux kernel tag v5.5.
>
> CC: Aurelien Jarno <aurelien@aurel32.net>
> CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
> linux-user/mips/cpu_loop.c | 78 +++++++++++++++++++++++++++++++++++++++++-
> linux-user/mips/syscall_nr.h | 45 ++++++++++++++++++++++++
> linux-user/mips64/syscall_nr.h | 13 +++++++
> 3 files changed, 135 insertions(+), 1 deletion(-)
>
> diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
> index 39915b3..b81479b 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,75 @@ 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_timer_gettime64, 2)
> + MIPS_SYS(sys_timer_settime64, 4)
> + MIPS_SYS(sys_timerfd_gettime64, 2) /* 410 */
> + MIPS_SYS(sys_timerfd_settime64, 4)
These have different names in the kernel:
clock_gettime64 403
clock_settime64 404
clock_adjtime64 405
clock_getres_time64 406
clock_nanosleep_time64 407
> + MIPS_SYS(sys_utimensat_time64, 4)
> + MIPS_SYS(sys_pselect6_time64, 6)
> + MIPS_SYS(sys_ppoll_time64, 5)
> + MIPS_SYSCALL_NUMBER_UNUSED, /* 415 */
> + MIPS_SYS(sys_io_pgetevents_time64, 6)
> + MIPS_SYS(sys_recvmmsg_time64, 5)
> + MIPS_SYS(sys_mq_timedsend_time64, 5)
> + MIPS_SYS(sys_mq_timedreceive_time64, 5)
> + MIPS_SYS(sys_semtimedop_time64, 4) /* 420 */
> + MIPS_SYS(sys_rt_sigtimedwait_time64, 4)
> + MIPS_SYS(sys_futex_time64, 6)
> + MIPS_SYS(sys_sched_rr_get_interval_time64, 2)
> + MIPS_SYS(sys_pidfd_send_signal, 4)
> + MIPS_SYS(sys_io_uring_setup, 2) /* 425 */
> + MIPS_SYS(sys_io_uring_enter, 6)
> + MIPS_SYS(sys_io_uring_register, 4)
> + MIPS_SYS(sys_open_tree, 3)
> + MIPS_SYS(sys_move_mount, 5)
> + MIPS_SYS(sys_fsopen, 2) /* 430 */
> + MIPS_SYS(sys_fsconfig, 5)
> + MIPS_SYS(sys_fsmount, 3)
> + MIPS_SYS(sys_fspick, 3)
> + MIPS_SYS(sys_pidfd_open, 2)
> + MIPS_SYS(sys_clone3, 2) /* 435 */
This comes from arch/mips/kernel/syscalls/syscall_o32.tbl for the
syscall number.
Where do you find the number of the arguments in the kernel?
> +
> };
> # undef MIPS_SYS
> # endif /* O32 */
> @@ -447,8 +517,14 @@ void cpu_loop(CPUMIPSState *env)
> # ifdef TARGET_ABI_MIPSO32
> syscall_num = env->active_tc.gpr[2] - 4000;
> if (syscall_num >= sizeof(mips_syscall_args)) {
> + /* syscall_num is larger that any defined for MIPS O32 */
> + ret = -TARGET_ENOSYS;
> + } else if (mips_syscall_args[syscall_num] ==
> + MIPS_SYSCALL_NUMBER_UNUSED) {
> + /* syscall_num belongs to the range not defined for MIPS O32 */
> ret = -TARGET_ENOSYS;
> } else {
> + /* syscall_num is valid */
> int nb_args;
> abi_ulong sp_reg;
> abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
> 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)
These values come from linux/arch/mips/kernel/syscalls/syscall_o32.tbl
> #endif
> diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
> index db40f69..c86943a 100644
> --- a/linux-user/mips64/syscall_nr.h
> +++ b/linux-user/mips64/syscall_nr.h
> @@ -674,6 +674,19 @@
> #define TARGET_NR_statx (TARGET_NR_Linux + 326)
> #define TARGET_NR_rseq (TARGET_NR_Linux + 327)
> #define TARGET_NR_io_pgetevents (TARGET_NR_Linux + 328)
> +/* 329 through 423 are reserved to sync up with other architectures */
> +#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
These values come from linux/arch/mips/kernel/syscalls/syscall_n64.tbl
So why don't you update the value for
arch/mips/kernel/syscalls/syscall_n32.tbl (also in mips64/syscall_nr.h,
enclosed in TARGET_ABI32)?
clock_gettime64 403
clock_settime64 404
clock_adjtime64 405
clock_getres_time64 406
clock_nanosleep_time64 407
timer_gettime64 408
timer_settime64 409
timerfd_gettime64 410
timerfd_settime64 411
utimensat_time64 412
pselect6_time64 413
ppoll_time64 414
io_pgetevents_time64 416
recvmmsg_time64 417
mq_timedsend_time64 418
mq_timedreceive_time64 419
semtimedop_time64 420
rt_sigtimedwait_time64 421
futex_time64 422
sched_rr_get_interval_time64 423
pidfd_send_signal 424
io_uring_setup 425
io_uring_enter 426
io_uring_register 427
open_tree 428
move_mount 429
fsopen 430
fsconfig 431
fsmount 432
fspick 433
pidfd_open 434
clone3 435
Thanks,
Laurent
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/9] linux-user: arm: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 ` [PATCH 2/9] linux-user: arm: " Aleksandar Markovic
@ 2020-02-12 21:18 ` Laurent Vivier
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Vivier @ 2020-02-12 21:18 UTC (permalink / raw)
To: Aleksandar Markovic, qemu-devel; +Cc: Peter Maydell, amarkovic
Le 04/02/2020 à 13:07, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> Update arm syscall numbers based on Linux kernel v5.5.
>
> CC: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
> linux-user/arm/syscall_nr.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_nr.h
> index e7eda0d..6db9235 100644
> --- a/linux-user/arm/syscall_nr.h
> +++ b/linux-user/arm/syscall_nr.h
> @@ -399,5 +399,49 @@
> #define TARGET_NR_userfaultfd (388)
> #define TARGET_NR_membarrier (389)
> #define TARGET_NR_mlock2 (390)
> +#define TARGET_NR_copy_file_range (391)
> +#define TARGET_NR_preadv2 (392)
> +#define TARGET_NR_pwritev2 (393)
> +#define TARGET_NR_pkey_mprotect (394)
> +#define TARGET_NR_pkey_alloc (395)
> +#define TARGET_NR_pkey_free (396)
> +#define TARGET_NR_statx (397)
> +#define TARGET_NR_rseq (398)
> +#define TARGET_NR_io_pgetevents (399)
> +#define TARGET_NR_migrate_pages (400)
> +#define TARGET_NR_kexec_file_load (401)
> +/* 402 is unused */
> +#define TARGET_NR_clock_gettime64 (403)
> +#define TARGET_NR_clock_settime64 (404)
> +#define TARGET_NR_clock_adjtime64 (405)
> +#define TARGET_NR_clock_getres_time64 (406)
> +#define TARGET_NR_clock_nanosleep_time64 (407)
> +#define TARGET_NR_timer_gettime64 (408)
> +#define TARGET_NR_timer_settime64 (409)
> +#define TARGET_NR_timerfd_gettime64 (410)
> +#define TARGET_NR_timerfd_settime64 (411)
> +#define TARGET_NR_utimensat_time64 (412)
> +#define TARGET_NR_pselect6_time64 (413)
> +#define TARGET_NR_ppoll_time64 (414)
> +#define TARGET_NR_io_pgetevents_time64 (416)
> +#define TARGET_NR_recvmmsg_time64 (417)
> +#define TARGET_NR_mq_timedsend_time64 (418)
> +#define TARGET_NR_mq_timedreceive_time64 (419)
> +#define TARGET_NR_semtimedop_time64 (420)
> +#define TARGET_NR_rt_sigtimedwait_time64 (421)
> +#define TARGET_NR_futex_time64 (422)
> +#define TARGET_NR_sched_rr_get_interval_time64 (423)
> +#define TARGET_NR_pidfd_send_signal (424)
> +#define TARGET_NR_io_uring_setup (425)
> +#define TARGET_NR_io_uring_enter (426)
> +#define TARGET_NR_io_uring_register (427)
> +#define TARGET_NR_open_tree (428)
> +#define TARGET_NR_move_mount (429)
> +#define TARGET_NR_fsopen (430)
> +#define TARGET_NR_fsconfig (431)
> +#define TARGET_NR_fsmount (432)
> +#define TARGET_NR_fspick (433)
> +#define TARGET_NR_pidfd_open (434)
> +#define TARGET_NR_clone3 (435)
>
> #endif
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
` (10 preceding siblings ...)
2020-02-05 21:29 ` Stafford Horne
@ 2020-02-12 21:34 ` Laurent Vivier
2020-02-13 0:28 ` Laurent Vivier
11 siblings, 1 reply; 18+ messages in thread
From: Laurent Vivier @ 2020-02-12 21:34 UTC (permalink / raw)
To: Aleksandar Markovic, qemu-devel
Cc: Marek Vasut, Peter Maydell, Eduardo Habkost, Sagar Karandikar,
David Hildenbrand, Bastian Koppelmann, Chris Wulff,
Mark Cave-Ayland, Paolo Bonzini, Alistair Francis, amarkovic,
Edgar E . Iglesias, Palmer Dabbelt, Stafford Horne,
Richard Henderson, Artyom Tarasenko, David Gibson
Le 04/02/2020 à 13:07, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> Hello, folks!
>
> This series is a spin-off of another larger linux-user series
> that become too large to handle, hence these patches related to
> syscall numbers are now in this, separate, series.
>
> Now that kernel 5.5 is released few days ago, it is time to
> reflect what can be updated in linux-user for upcomming QEMU 5.0.
>
> An obvoius kernel change we should take into account are new
> system calls, and the foirst step is updating syscall numbers
> mainteined within QEMU linux-user.
>
> Regarding kernel syscal numbers there is good news and bad news.
>
> The good news is that kernel developers decided to make future
> syscall numbers much more synchonized accross architectures than
> before. They already reached that state.
>
> The bad news is that we in QEMU did not reach that state yet, since
> we lag after kernel significantly.
>
> The good news again is that we will reach that state if we update
> syscall numbers accross the board now. This is the main intention
> and motivation of this series.
>
> The bad news again is that in order to update syscall numebrs we
> need to be very careful at this moment. There are a number of new
> syscalls added to the kernel recently that QEMU doesn't know about
> at all. Significant number of new syscalls deal with 32/64-bit
> compatibility, traditionally a problematic area in kernel, and in
> QEMU as well. Moreover, some of the new syscalls are applicable to
> 32-bit architectures only.
>
> This series covers updating syscall numbers defined in the following
> files:
>
> - linux-user/alpha/syscall_nr.h
> - linux-user/arm/syscall_nr.h
> - linux-user/m68k/syscall_nr.h
> - linux-user/microblaze/syscall_nr.h
> - linux-user/mips/cpu_loop.c
> - linux-user/mips/syscall_nr.h
> - linux-user/mips64/syscall_nr.h
> - linux-user/sh4/syscall_nr.h
> - linux-user/x86_64/syscall_nr.h
> - linux-user/xtensa/syscall_nr.h
>
> This series doesn't cover following files (since they use certain
> proprietary rules for mapping between kernel source and qemu source,
> I don't feel quite comfortable changing them - therefore I am asking
> corresponding target maintainers or Lauren to update them, if
> possible, before our 5.0 release):
>
> - linux-user/aarch64/syscall_nr.h
> - linux-user/i386/syscall_nr.h
> - linux-user/nios2/syscall_nr.h
> - linux-user/ppc/syscall_nr.h
> - linux-user/riscv/syscall_nr.h
> - linux-user/s390x/syscall_nr.h
> - linux-user/sparc/syscall_nr.h
> - linux-user/sparc64/syscall_nr.h
>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> CC: Chris Wulff <crwulff@gmail.com>
> CC: Marek Vasut <marex@denx.de>
> CC: David Gibson <david@gibson.dropbear.id.au>
> CC: Palmer Dabbelt <palmer@dabbelt.com>
> CC: Alistair Francis <Alistair.Francis@wdc.com>
> CC: Sagar Karandikar <sagark@eecs.berkeley.edu>
> CC: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> CC: David Hildenbrand <david@redhat.com>
> CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> CC: Artyom Tarasenko <atar4qemu@gmail.com>
>
> This series also doesn't cover following files (since I can't find
> corresponding kernel code - and I am also asking corresponding
> target maintainers or Lauren to update them, if possible, before
> our 5.0 release):
>
> - linux-user/cris/cpu_loop.c
> - linux-user/hppa/syscall_nr.h
> - linux-user/openrisc/syscall_nr.h
> - linux-user/tilegx/syscall_nr.h
>
> CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Stafford Horne <shorne@gmail.com>
>
> Again, I don't plan (I am really running out of time resources) to
> work in a significant way on this issue any more, and I am asking
> you guys other maintainers to help finish updating syscall numbers
> before QEMU 5.0 release.
>
> Once we do that, updating syscall numbers in QEMU should and will
> be significantly easier.
>
I think we should copy the syscall.tbl and syscallhdr.sh scripts from
the linux tree and update syscallhdr.sh to generate our syscall_nr.h
I think it can be done in an easy way for most of our targets, except
some like mips that mixes o32, n32, n64 and a special table inside
cpu_loop.c
I will merge your patches (please update the mips one) as the work is
already done but I will have a look to try to generate them for the next
time from the kernel tables.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level
2020-02-12 21:34 ` Laurent Vivier
@ 2020-02-13 0:28 ` Laurent Vivier
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Vivier @ 2020-02-13 0:28 UTC (permalink / raw)
To: Aleksandar Markovic, qemu-devel
Cc: Marek Vasut, Peter Maydell, Eduardo Habkost, Sagar Karandikar,
David Hildenbrand, Bastian Koppelmann, Chris Wulff,
Mark Cave-Ayland, Paolo Bonzini, Alistair Francis, amarkovic,
Edgar E . Iglesias, Palmer Dabbelt, Stafford Horne,
Richard Henderson, Artyom Tarasenko, David Gibson
Le 12/02/2020 à 22:34, Laurent Vivier a écrit :
> Le 04/02/2020 à 13:07, Aleksandar Markovic a écrit :
>> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>>
>> Hello, folks!
>>
>> This series is a spin-off of another larger linux-user series
>> that become too large to handle, hence these patches related to
>> syscall numbers are now in this, separate, series.
>>
>> Now that kernel 5.5 is released few days ago, it is time to
>> reflect what can be updated in linux-user for upcomming QEMU 5.0.
>>
>> An obvoius kernel change we should take into account are new
>> system calls, and the foirst step is updating syscall numbers
>> mainteined within QEMU linux-user.
>>
>> Regarding kernel syscal numbers there is good news and bad news.
>>
>> The good news is that kernel developers decided to make future
>> syscall numbers much more synchonized accross architectures than
>> before. They already reached that state.
>>
>> The bad news is that we in QEMU did not reach that state yet, since
>> we lag after kernel significantly.
>>
>> The good news again is that we will reach that state if we update
>> syscall numbers accross the board now. This is the main intention
>> and motivation of this series.
>>
>> The bad news again is that in order to update syscall numebrs we
>> need to be very careful at this moment. There are a number of new
>> syscalls added to the kernel recently that QEMU doesn't know about
>> at all. Significant number of new syscalls deal with 32/64-bit
>> compatibility, traditionally a problematic area in kernel, and in
>> QEMU as well. Moreover, some of the new syscalls are applicable to
>> 32-bit architectures only.
>>
>> This series covers updating syscall numbers defined in the following
>> files:
>>
>> - linux-user/alpha/syscall_nr.h
>> - linux-user/arm/syscall_nr.h
>> - linux-user/m68k/syscall_nr.h
>> - linux-user/microblaze/syscall_nr.h
>> - linux-user/mips/cpu_loop.c
>> - linux-user/mips/syscall_nr.h
>> - linux-user/mips64/syscall_nr.h
>> - linux-user/sh4/syscall_nr.h
>> - linux-user/x86_64/syscall_nr.h
>> - linux-user/xtensa/syscall_nr.h
>>
>> This series doesn't cover following files (since they use certain
>> proprietary rules for mapping between kernel source and qemu source,
>> I don't feel quite comfortable changing them - therefore I am asking
>> corresponding target maintainers or Lauren to update them, if
>> possible, before our 5.0 release):
>>
>> - linux-user/aarch64/syscall_nr.h
>> - linux-user/i386/syscall_nr.h
>> - linux-user/nios2/syscall_nr.h
>> - linux-user/ppc/syscall_nr.h
>> - linux-user/riscv/syscall_nr.h
>> - linux-user/s390x/syscall_nr.h
>> - linux-user/sparc/syscall_nr.h
>> - linux-user/sparc64/syscall_nr.h
>>
>> CC: Peter Maydell <peter.maydell@linaro.org>
>> CC: Paolo Bonzini <pbonzini@redhat.com>
>> CC: Richard Henderson <rth@twiddle.net>
>> CC: Eduardo Habkost <ehabkost@redhat.com>
>> CC: Chris Wulff <crwulff@gmail.com>
>> CC: Marek Vasut <marex@denx.de>
>> CC: David Gibson <david@gibson.dropbear.id.au>
>> CC: Palmer Dabbelt <palmer@dabbelt.com>
>> CC: Alistair Francis <Alistair.Francis@wdc.com>
>> CC: Sagar Karandikar <sagark@eecs.berkeley.edu>
>> CC: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>> CC: David Hildenbrand <david@redhat.com>
>> CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> CC: Artyom Tarasenko <atar4qemu@gmail.com>
>>
>> This series also doesn't cover following files (since I can't find
>> corresponding kernel code - and I am also asking corresponding
>> target maintainers or Lauren to update them, if possible, before
>> our 5.0 release):
>>
>> - linux-user/cris/cpu_loop.c
>> - linux-user/hppa/syscall_nr.h
>> - linux-user/openrisc/syscall_nr.h
>> - linux-user/tilegx/syscall_nr.h
>>
>> CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
>> CC: Richard Henderson <rth@twiddle.net>
>> CC: Stafford Horne <shorne@gmail.com>
>>
>> Again, I don't plan (I am really running out of time resources) to
>> work in a significant way on this issue any more, and I am asking
>> you guys other maintainers to help finish updating syscall numbers
>> before QEMU 5.0 release.
>>
>> Once we do that, updating syscall numbers in QEMU should and will
>> be significantly easier.
>>
>
> I think we should copy the syscall.tbl and syscallhdr.sh scripts from
> the linux tree and update syscallhdr.sh to generate our syscall_nr.h
I made a draft here:
https://github.com/vivier/qemu/commits/linux-user-syscalltbl
Thanks,
Laurent
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/9] linux-user: mips: Update syscall numbers to kernel 5.5 level
2020-02-12 21:09 ` Laurent Vivier
@ 2020-02-13 1:26 ` Aleksandar Markovic
0 siblings, 0 replies; 18+ messages in thread
From: Aleksandar Markovic @ 2020-02-13 1:26 UTC (permalink / raw)
To: Laurent Vivier
Cc: Aleksandar Markovic, Aurelien Jarno, Aleksandar Rikalo,
QEMU Developers, Aleksandar Markovic
On Wed, Feb 12, 2020 at 10:10 PM Laurent Vivier <laurent@vivier.eu> wrote:
>
> Le 04/02/2020 à 13:07, Aleksandar Markovic a écrit :
> > From: Aleksandar Markovic <amarkovic@wavecomp.com>
> >
> > Update mips syscall numbers based on Linux kernel tag v5.5.
> >
> > CC: Aurelien Jarno <aurelien@aurel32.net>
> > CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
> > Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> > ---
> > linux-user/mips/cpu_loop.c | 78 +++++++++++++++++++++++++++++++++++++++++-
> > linux-user/mips/syscall_nr.h | 45 ++++++++++++++++++++++++
> > linux-user/mips64/syscall_nr.h | 13 +++++++
> > 3 files changed, 135 insertions(+), 1 deletion(-)
> >
> > diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
> > index 39915b3..b81479b 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,75 @@ 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_timer_gettime64, 2)
> > + MIPS_SYS(sys_timer_settime64, 4)
> > + MIPS_SYS(sys_timerfd_gettime64, 2) /* 410 */
> > + MIPS_SYS(sys_timerfd_settime64, 4)
>
> These have different names in the kernel:
>
> clock_gettime64 403
> clock_settime64 404
> clock_adjtime64 405
> clock_getres_time64 406
> clock_nanosleep_time64 407
>
In fact, the whole range 403 - 407 was missing, names are good for
408-411, and all following them.
> > + MIPS_SYS(sys_utimensat_time64, 4)
> > + MIPS_SYS(sys_pselect6_time64, 6)
> > + MIPS_SYS(sys_ppoll_time64, 5)
> > + MIPS_SYSCALL_NUMBER_UNUSED, /* 415 */
> > + MIPS_SYS(sys_io_pgetevents_time64, 6)
> > + MIPS_SYS(sys_recvmmsg_time64, 5)
> > + MIPS_SYS(sys_mq_timedsend_time64, 5)
> > + MIPS_SYS(sys_mq_timedreceive_time64, 5)
> > + MIPS_SYS(sys_semtimedop_time64, 4) /* 420 */
> > + MIPS_SYS(sys_rt_sigtimedwait_time64, 4)
> > + MIPS_SYS(sys_futex_time64, 6)
> > + MIPS_SYS(sys_sched_rr_get_interval_time64, 2)
> > + MIPS_SYS(sys_pidfd_send_signal, 4)
> > + MIPS_SYS(sys_io_uring_setup, 2) /* 425 */
> > + MIPS_SYS(sys_io_uring_enter, 6)
> > + MIPS_SYS(sys_io_uring_register, 4)
> > + MIPS_SYS(sys_open_tree, 3)
> > + MIPS_SYS(sys_move_mount, 5)
> > + MIPS_SYS(sys_fsopen, 2) /* 430 */
> > + MIPS_SYS(sys_fsconfig, 5)
> > + MIPS_SYS(sys_fsmount, 3)
> > + MIPS_SYS(sys_fspick, 3)
> > + MIPS_SYS(sys_pidfd_open, 2)
> > + MIPS_SYS(sys_clone3, 2) /* 435 */
>
> This comes from arch/mips/kernel/syscalls/syscall_o32.tbl for the
> syscall number.
>
> Where do you find the number of the arguments in the kernel?
>
From strace repository:
https://github.com/strace/strace/blob/master/linux/syscallent-common.h
https://github.com/strace/strace/blob/master/linux/syscallent-common-32.h
> > +
> > };
> > # undef MIPS_SYS
> > # endif /* O32 */
> > @@ -447,8 +517,14 @@ void cpu_loop(CPUMIPSState *env)
> > # ifdef TARGET_ABI_MIPSO32
> > syscall_num = env->active_tc.gpr[2] - 4000;
> > if (syscall_num >= sizeof(mips_syscall_args)) {
> > + /* syscall_num is larger that any defined for MIPS O32 */
> > + ret = -TARGET_ENOSYS;
> > + } else if (mips_syscall_args[syscall_num] ==
> > + MIPS_SYSCALL_NUMBER_UNUSED) {
> > + /* syscall_num belongs to the range not defined for MIPS O32 */
> > ret = -TARGET_ENOSYS;
> > } else {
> > + /* syscall_num is valid */
> > int nb_args;
> > abi_ulong sp_reg;
> > abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
> > 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)
>
> These values come from linux/arch/mips/kernel/syscalls/syscall_o32.tbl
>
> > #endif
> > diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
> > index db40f69..c86943a 100644
> > --- a/linux-user/mips64/syscall_nr.h
> > +++ b/linux-user/mips64/syscall_nr.h
> > @@ -674,6 +674,19 @@
> > #define TARGET_NR_statx (TARGET_NR_Linux + 326)
> > #define TARGET_NR_rseq (TARGET_NR_Linux + 327)
> > #define TARGET_NR_io_pgetevents (TARGET_NR_Linux + 328)
> > +/* 329 through 423 are reserved to sync up with other architectures */
> > +#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
>
> These values come from linux/arch/mips/kernel/syscalls/syscall_n64.tbl
>
> So why don't you update the value for
> arch/mips/kernel/syscalls/syscall_n32.tbl (also in mips64/syscall_nr.h,
> enclosed in TARGET_ABI32)?
>
> clock_gettime64 403
> clock_settime64 404
> clock_adjtime64 405
> clock_getres_time64 406
> clock_nanosleep_time64 407
> timer_gettime64 408
> timer_settime64 409
> timerfd_gettime64 410
> timerfd_settime64 411
> utimensat_time64 412
> pselect6_time64 413
> ppoll_time64 414
> io_pgetevents_time64 416
> recvmmsg_time64 417
> mq_timedsend_time64 418
> mq_timedreceive_time64 419
> semtimedop_time64 420
> rt_sigtimedwait_time64 421
> futex_time64 422
> sched_rr_get_interval_time64 423
> pidfd_send_signal 424
> io_uring_setup 425
> io_uring_enter 426
> io_uring_register 427
> open_tree 428
> move_mount 429
> fsopen 430
> fsconfig 431
> fsmount 432
> fspick 433
> pidfd_open 434
> clone3 435
>
I am going to add all this.
I'll send v2 shortly.
Thanks,
Aleksandar
> Thanks,
> Laurent
>
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2020-02-13 1:27 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 12:07 [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 1/9] linux-user: alpha: " Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 2/9] linux-user: arm: " Aleksandar Markovic
2020-02-12 21:18 ` Laurent Vivier
2020-02-04 12:07 ` [PATCH 3/9] linux-user: m68k: " Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 4/9] linux-user: microblaze: " Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 5/9] linux-user: mips: " Aleksandar Markovic
2020-02-12 21:09 ` Laurent Vivier
2020-02-13 1:26 ` Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 6/9] linux-user: sh4: " Aleksandar Markovic
2020-02-12 20:38 ` Laurent Vivier
2020-02-04 12:07 ` [PATCH 7/9] linux-user: x86_64: " Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 8/9] linux-user: xtensa: " Aleksandar Markovic
2020-02-04 12:07 ` [PATCH 9/9] linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count Aleksandar Markovic
2020-02-04 12:30 ` [PATCH 0/9] linux-user: Update syscall numbers to kernel 5.5 level Aleksandar Markovic
2020-02-05 21:29 ` Stafford Horne
2020-02-12 21:34 ` Laurent Vivier
2020-02-13 0:28 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).