Based upon patch from Alexandru Croitor.
382563 MIPS MSA ASE support
382998 xml-socket doesn't work
383275 massif valgrind: m_xarray.c:162 (ensureSpaceXA): Assertion '!xa->arr' failed
+383723 Fix missing kevent_qos syscall (macOS 10.11)
384096 Mention AddrCheck at Memcheck's command line option --undef-value-errors=no
384230 vex x86->IR: unhandled instruction bytes: 0x67 0xE8 0xAB 0x68
384526 reduce number of spill instructions generated by VEX register allocator v3
#endif
// 373
#if DARWIN_VERS >= DARWIN_10_11
-// NYI kevent_qos // 374
+DECL_TEMPLATE(darwin, kevent_qos); // 374
#endif /* DARWIN_VERS >= DARWIN_10_11 */
#if DARWIN_VERS >= DARWIN_10_13
// NYI kevent_id // 375
#if DARWIN_VERS >= DARWIN_10_11
+PRE(kevent_qos)
+{
+ PRINT("kevent_qos( %ld, %#lx, %ld, %#lx, %ld, %#lx, %ld, %ld )",
+ SARG1, ARG2, SARG3, ARG4, SARG5, ARG6, SARG7, ARG8);
+ PRE_REG_READ8(int,"kevent_qos",
+ int,kq,
+ const struct vki_kevent_qos_s *,changelist,
+ int,nchanges,
+ struct vki_kevent_qos_s *,eventlist,
+ int,nevents,
+ void*,data_out,
+ size_t*,data_available,
+ unsigned int,flags);
+
+ if (ARG3) PRE_MEM_READ ("kevent_qos(changelist)",
+ ARG2, ARG3 * sizeof(struct vki_kevent_qos_s));
+ if (ARG5) PRE_MEM_WRITE("kevent_qos(eventlist)",
+ ARG4, ARG5 * sizeof(struct vki_kevent_qos_s));
+ if (ARG7) PRE_MEM_WRITE("kevent_qos(data_out)",
+ ARG6, ARG7 * sizeof(void*));
+
+ *flags |= SfMayBlock;
+}
+
+POST(kevent_qos)
+{
+ PRINT("kevent_qos ret %ld dst %#lx (%zu)", RES, ARG4, sizeof(struct vki_kevent_qos_s));
+ if (RES > 0) {
+ ML_(sync_mappings)("after", "kevent_qos", 0);
+ POST_MEM_WRITE(ARG4, RES * sizeof(struct vki_kevent_qos_s));
+ }
+}
+
+
PRE(pselect)
{
*flags |= SfMayBlock;
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(372)), // ???
#endif
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(373)), // ???
+#if DARWIN_VERS < DARWIN_10_11
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(374)), // ???
+#endif
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(375)), // ???
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(376)), // ???
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(377)), // ???
#endif
#if DARWIN_VERS >= DARWIN_10_11
// _____(__NR_kdebug_trace_string), // 178
-// _____(__NR_kevent_qos), // 374
+ MACXY(__NR_kevent_qos, kevent_qos), // 374
MACX_(__NR_pselect, pselect), // 394
// _____(__NR_netagent_trigger), // 490
// _____(__NR_stack_snapshot_with_config), // 491
#define vki_kevent kevent
#define vki_kevent64 kevent64_s
+// xnu_root/bsd/sys/event.h
+
+struct vki_kevent_qos_s {
+ uint64_t ident; /* identifier for this event */
+ int16_t filter; /* filter for event */
+ uint16_t flags; /* general flags */
+ int32_t qos; /* quality of service */
+ uint64_t udata; /* opaque user data identifier */
+ uint32_t fflags; /* filter-specific flags */
+ uint32_t xflags; /* extra filter-specific flags */
+ int64_t data; /* filter-specific data */
+ uint64_t ext[4]; /* filter-specific extensions */
+};
#include <sys/ev.h>
// __NR_workq_open 367
// __NR_workq_ops 368
- GO_UNIMP(369-379, "unused");
+ GO_UNIMP(369-373, "unused");
+
+#if DARWIN_VERS >= DARWIN_10_11
+ {
+ long args[8] = { x0+8, x0+0xffffffee, x0+1, x0+1, x0+1, x0+1, x0+1, x0+1 };
+ GO(__NR_kevent_qos, 374, "1s 8m");
+ SY(__NR_kevent_qos, args+x0); FAIL;
+ }
+#endif /* DARWIN_VERS >= DARWIN_10_11 */
+
+ GO_UNIMP(375-379, "unused");
// __NR___mac_execve 380
// __NR___mac_syscall 381
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
-(369-379): unused
+(369-373): unused
+-----------------------------------------------------
+-----------------------------------------------------
+x2000176(374): __NR_kevent_qos 1s 8m
+-----------------------------------------------------
+Syscall param kevent_qos(changelist) contains uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:669)
+
+Syscall param kevent_qos(nchanges) contains uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:669)
+
+Syscall param kevent_qos(data_available) contains uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:669)
+
+Syscall param kevent_qos(flags) contains uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:669)
+
+Syscall param kevent_qos(changelist) points to uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:669)
+ Address 0x........ is on thread 1's stack
+ in frame #1, created by main (scalar.c:12)
+
+Syscall param kevent_qos(eventlist) points to unaddressable byte(s)
+ ...
+ by 0x........: main (scalar.c:669)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+-----------------------------------------------------
+(375-379): unused
-----------------------------------------------------
-----------------------------------------------------
x200018a(394): __NR_pselect 1s 6m
-----------------------------------------------------
Syscall param pselect(readfds) contains uninitialised byte(s)
...
- by 0x........: main (scalar.c:684)
+ by 0x........: main (scalar.c:694)
Syscall param pselect(writefds) contains uninitialised byte(s)
...
- by 0x........: main (scalar.c:684)
+ by 0x........: main (scalar.c:694)
Syscall param pselect(readfds) points to uninitialised byte(s)
...
- by 0x........: main (scalar.c:684)
+ by 0x........: main (scalar.c:694)
Address 0x........ is on thread 1's stack
in frame #1, created by main (scalar.c:12)
Syscall param pselect(writefds) points to unaddressable byte(s)
...
- by 0x........: main (scalar.c:684)
+ by 0x........: main (scalar.c:694)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
Syscall param pselect(exceptfds) points to unaddressable byte(s)
...
- by 0x........: main (scalar.c:684)
+ by 0x........: main (scalar.c:694)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------