* Improvements
* IPv6 addresses shown in socket information in -yy mode are now printed
in brackets.
- * Enhanced decoding of ptrace syscall.
+ * Enhanced decoding of prctl and ptrace syscalls.
* Enhanced NETLINK_ROUTE protocol decoding.
* Updated lists of signal codes.
* Updated lists of BPF_*, BTN_*, ETH_P_*, INET_DIAG_BC_*, KEY_*, POLL*, RWF_*,
#include <linux/prctl.h>
+#include "xstring.h"
+
#include "xlat/prctl_options.h"
#include "xlat/pr_cap_ambient.h"
#include "xlat/pr_dumpable.h"
#include "xlat/pr_mce_kill.h"
#include "xlat/pr_mce_kill_policy.h"
#include "xlat/pr_set_mm.h"
+#include "xlat/pr_sve_vl_flags.h"
#include "xlat/pr_tsc.h"
#include "xlat/pr_unalign_flags.h"
#include "xlat/cap.h"
+#ifndef PR_SVE_VL_LEN_MASK
+# define PR_SVE_VL_LEN_MASK 0xffff
+#endif
+
+
static void
print_prctl_args(struct tcb *tcp, const unsigned int first)
{
tprintf(", %#" PRI_klx, tcp->u_arg[i]);
}
+static char *
+sprint_sve_val(kernel_ulong_t arg)
+{
+ static char out[sizeof("PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|0x") +
+ sizeof(kernel_ulong_t) * 2];
+
+ kernel_ulong_t vl = arg & PR_SVE_VL_LEN_MASK;
+ kernel_ulong_t flags = arg & ~PR_SVE_VL_LEN_MASK;
+ const char *flags_str = sprintflags("", pr_sve_vl_flags, flags);
+
+ xsprintf(out, "%s%s%#" PRI_klx,
+ flags_str ?: "", flags_str ? "|" : "", vl);
+
+ return out;
+}
+
SYS_FUNC(prctl)
{
const unsigned int option = tcp->u_arg[0];
(kernel_ulong_t) tcp->u_rval);
return RVAL_STR;
+ case PR_SVE_SET_VL:
+ if (entering(tcp)) {
+ tprintf(", %s", sprint_sve_val(arg2));
+ return 0;
+ }
+ ATTRIBUTE_FALLTHROUGH;
+
+ case PR_SVE_GET_VL:
+ if (entering(tcp))
+ break;
+ if (syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+
+ tcp->auxstr = sprint_sve_val(tcp->u_rval);
+
+ return RVAL_STR;
+
/* PR_TASK_PERF_EVENTS_* take no arguments. */
case PR_TASK_PERF_EVENTS_DISABLE:
case PR_TASK_PERF_EVENTS_ENABLE: