b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From efaa17e53a750d5f0f4c138b507b1b104729ed67 Mon Sep 17 00:00:00 2001 |
| 2 | From: Petar Jovanovic <mips32r2@gmail.com> |
| 3 | Date: Mon, 24 Jun 2024 10:33:46 +0000 |
| 4 | Subject: mips: skip using shared syscall numbers for mips64 |
| 5 | |
| 6 | mips does not use shared syscall numbers, so we can not use |
| 7 | vki-scnums-shared-linux.h. |
| 8 | |
| 9 | This fixes KDE #444781. |
| 10 | |
| 11 | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> |
| 12 | Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com> |
| 13 | --- |
| 14 | coregrind/m_syswrap/syswrap-mips64-linux.c | 1 + |
| 15 | include/pub_tool_vkiscnums_asm.h | 1 - |
| 16 | include/vki/vki-scnums-mips64-linux.h | 98 ++++++++++++++++++++++ |
| 17 | 3 files changed, 99 insertions(+), 1 deletion(-) |
| 18 | |
| 19 | --- a/coregrind/m_syswrap/syswrap-mips64-linux.c |
| 20 | +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c |
| 21 | @@ -813,6 +813,7 @@ static SyscallTableEntry syscall_main_ta |
| 22 | LINX_ (__NR_pwritev2, sys_pwritev2), |
| 23 | LINX_ (__NR_syncfs, sys_syncfs), |
| 24 | LINXY (__NR_statx, sys_statx), |
| 25 | + GENX_ (__NR_rseq, sys_ni_syscall), |
| 26 | LINX_ (__NR_setns, sys_setns), |
| 27 | LINXY (__NR_io_uring_setup, sys_io_uring_setup), |
| 28 | LINXY (__NR_io_uring_enter, sys_io_uring_enter), |
| 29 | --- a/include/pub_tool_vkiscnums_asm.h |
| 30 | +++ b/include/pub_tool_vkiscnums_asm.h |
| 31 | @@ -70,7 +70,6 @@ |
| 32 | # include "vki/vki-scnums-shared-linux.h" |
| 33 | |
| 34 | #elif defined(VGP_mips64_linux) |
| 35 | -# include "vki/vki-scnums-shared-linux.h" |
| 36 | # include "vki/vki-scnums-mips64-linux.h" |
| 37 | |
| 38 | #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd) |
| 39 | --- a/include/vki/vki-scnums-mips64-linux.h |
| 40 | +++ b/include/vki/vki-scnums-mips64-linux.h |
| 41 | @@ -362,6 +362,45 @@ |
| 42 | #define __NR_pkey_alloc (__NR_Linux + 324) |
| 43 | #define __NR_pkey_free (__NR_Linux + 325) |
| 44 | #define __NR_statx (__NR_Linux + 326) |
| 45 | +#define __NR_rseq (__NR_Linux + 327) |
| 46 | +#define __NR_io_pgetevents (__NR_Linux + 328) |
| 47 | +#define __NR_pidfd_send_signal (__NR_Linux + 424) |
| 48 | +#define __NR_io_uring_setup (__NR_Linux + 425) |
| 49 | +#define __NR_io_uring_enter (__NR_Linux + 426) |
| 50 | +#define __NR_io_uring_register (__NR_Linux + 427) |
| 51 | +#define __NR_open_tree (__NR_Linux + 428) |
| 52 | +#define __NR_move_mount (__NR_Linux + 429) |
| 53 | +#define __NR_fsopen (__NR_Linux + 430) |
| 54 | +#define __NR_fsconfig (__NR_Linux + 431) |
| 55 | +#define __NR_fsmount (__NR_Linux + 432) |
| 56 | +#define __NR_fspick (__NR_Linux + 433) |
| 57 | +#define __NR_pidfd_open (__NR_Linux + 434) |
| 58 | +#define __NR_clone3 (__NR_Linux + 435) |
| 59 | +#define __NR_close_range (__NR_Linux + 436) |
| 60 | +#define __NR_openat2 (__NR_Linux + 437) |
| 61 | +#define __NR_pidfd_getfd (__NR_Linux + 438) |
| 62 | +#define __NR_faccessat2 (__NR_Linux + 439) |
| 63 | +#define __NR_process_madvise (__NR_Linux + 440) |
| 64 | +#define __NR_epoll_pwait2 (__NR_Linux + 441) |
| 65 | +#define __NR_mount_setattr (__NR_Linux + 442) |
| 66 | +#define __NR_quotactl_fd (__NR_Linux + 443) |
| 67 | +#define __NR_landlock_create_ruleset (__NR_Linux + 444) |
| 68 | +#define __NR_landlock_add_rule (__NR_Linux + 445) |
| 69 | +#define __NR_landlock_restrict_self (__NR_Linux + 446) |
| 70 | +#define __NR_process_mrelease (__NR_Linux + 448) |
| 71 | +#define __NR_futex_waitv (__NR_Linux + 449) |
| 72 | +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) |
| 73 | +#define __NR_cachestat (__NR_Linux + 451) |
| 74 | +#define __NR_fchmodat2 (__NR_Linux + 452) |
| 75 | +#define __NR_map_shadow_stack (__NR_Linux + 453) |
| 76 | +#define __NR_futex_wake (__NR_Linux + 454) |
| 77 | +#define __NR_futex_wait (__NR_Linux + 455) |
| 78 | +#define __NR_futex_requeue (__NR_Linux + 456) |
| 79 | +#define __NR_statmount (__NR_Linux + 457) |
| 80 | +#define __NR_listmount (__NR_Linux + 458) |
| 81 | +#define __NR_lsm_get_self_attr (__NR_Linux + 459) |
| 82 | +#define __NR_lsm_set_self_attr (__NR_Linux + 460) |
| 83 | +#define __NR_lsm_list_modules (__NR_Linux + 461) |
| 84 | |
| 85 | #elif defined(VGABI_N32) |
| 86 | |
| 87 | @@ -701,6 +740,65 @@ |
| 88 | #define __NR_pkey_alloc (__NR_Linux + 328) |
| 89 | #define __NR_pkey_free (__NR_Linux + 329) |
| 90 | #define __NR_statx (__NR_Linux + 330) |
| 91 | +#define __NR_rseq (__NR_Linux + 331) |
| 92 | +#define __NR_io_pgetevents (__NR_Linux + 332) |
| 93 | +#define __NR_clock_gettime64 (__NR_Linux + 403) |
| 94 | +#define __NR_clock_settime64 (__NR_Linux + 404) |
| 95 | +#define __NR_clock_adjtime64 (__NR_Linux + 405) |
| 96 | +#define __NR_clock_getres_time64 (__NR_Linux + 406) |
| 97 | +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) |
| 98 | +#define __NR_timer_gettime64 (__NR_Linux + 408) |
| 99 | +#define __NR_timer_settime64 (__NR_Linux + 409) |
| 100 | +#define __NR_timerfd_gettime64 (__NR_Linux + 410) |
| 101 | +#define __NR_timerfd_settime64 (__NR_Linux + 411) |
| 102 | +#define __NR_utimensat_time64 (__NR_Linux + 412) |
| 103 | +#define __NR_pselect6_time64 (__NR_Linux + 413) |
| 104 | +#define __NR_ppoll_time64 (__NR_Linux + 414) |
| 105 | +#define __NR_io_pgetevents_time64 (__NR_Linux + 416) |
| 106 | +#define __NR_recvmmsg_time64 (__NR_Linux + 417) |
| 107 | +#define __NR_mq_timedsend_time64 (__NR_Linux + 418) |
| 108 | +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) |
| 109 | +#define __NR_semtimedop_time64 (__NR_Linux + 420) |
| 110 | +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) |
| 111 | +#define __NR_futex_time64 (__NR_Linux + 422) |
| 112 | +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) |
| 113 | +#define __NR_pidfd_send_signal (__NR_Linux + 424) |
| 114 | +#define __NR_io_uring_setup (__NR_Linux + 425) |
| 115 | +#define __NR_io_uring_enter (__NR_Linux + 426) |
| 116 | +#define __NR_io_uring_register (__NR_Linux + 427) |
| 117 | +#define __NR_open_tree (__NR_Linux + 428) |
| 118 | +#define __NR_move_mount (__NR_Linux + 429) |
| 119 | +#define __NR_fsopen (__NR_Linux + 430) |
| 120 | +#define __NR_fsconfig (__NR_Linux + 431) |
| 121 | +#define __NR_fsmount (__NR_Linux + 432) |
| 122 | +#define __NR_fspick (__NR_Linux + 433) |
| 123 | +#define __NR_pidfd_open (__NR_Linux + 434) |
| 124 | +#define __NR_clone3 (__NR_Linux + 435) |
| 125 | +#define __NR_close_range (__NR_Linux + 436) |
| 126 | +#define __NR_openat2 (__NR_Linux + 437) |
| 127 | +#define __NR_pidfd_getfd (__NR_Linux + 438) |
| 128 | +#define __NR_faccessat2 (__NR_Linux + 439) |
| 129 | +#define __NR_process_madvise (__NR_Linux + 440) |
| 130 | +#define __NR_epoll_pwait2 (__NR_Linux + 441) |
| 131 | +#define __NR_mount_setattr (__NR_Linux + 442) |
| 132 | +#define __NR_quotactl_fd (__NR_Linux + 443) |
| 133 | +#define __NR_landlock_create_ruleset (__NR_Linux + 444) |
| 134 | +#define __NR_landlock_add_rule (__NR_Linux + 445) |
| 135 | +#define __NR_landlock_restrict_self (__NR_Linux + 446) |
| 136 | +#define __NR_process_mrelease (__NR_Linux + 448) |
| 137 | +#define __NR_futex_waitv (__NR_Linux + 449) |
| 138 | +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) |
| 139 | +#define __NR_cachestat (__NR_Linux + 451) |
| 140 | +#define __NR_fchmodat2 (__NR_Linux + 452) |
| 141 | +#define __NR_map_shadow_stack (__NR_Linux + 453) |
| 142 | +#define __NR_futex_wake (__NR_Linux + 454) |
| 143 | +#define __NR_futex_wait (__NR_Linux + 455) |
| 144 | +#define __NR_futex_requeue (__NR_Linux + 456) |
| 145 | +#define __NR_statmount (__NR_Linux + 457) |
| 146 | +#define __NR_listmount (__NR_Linux + 458) |
| 147 | +#define __NR_lsm_get_self_attr (__NR_Linux + 459) |
| 148 | +#define __NR_lsm_set_self_attr (__NR_Linux + 460) |
| 149 | +#define __NR_lsm_list_modules (__NR_Linux + 461) |
| 150 | |
| 151 | #else |
| 152 | #error unknown mips64 abi |