prctl: add decoding of PR_SVE_SET_VL and PR_SVE_GET_VL commands
These commands were introduced in Linux commit v4.15-rc1~110^2~9. * xlat/pr_sve_vl_flags.in: New file. * xlat/prctl_options.in: Likewise. * prctl.c: Include "xstring.h" and "xlat/pr_sve_vl_flags.h". [!PR_SVE_VL_LEN_MASK] (PR_SVE_VL_LEN_MASK): New macro constant. (sprint_sve_val): New function. (SYS_FUNC(prctl)): Add decoding for PR_SVE_GET_VL and PR_SVE_SET_VL commands. * NEWS: Mention it.
This commit is contained in:
parent
fd02ce4ff8
commit
beafdd36e1
2
NEWS
2
NEWS
@ -11,7 +11,7 @@ Noteworthy changes in release ?.?? (????-??-??)
|
||||
* 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_*,
|
||||
|
41
prctl.c
41
prctl.c
@ -33,6 +33,8 @@
|
||||
|
||||
#include <linux/prctl.h>
|
||||
|
||||
#include "xstring.h"
|
||||
|
||||
#include "xlat/prctl_options.h"
|
||||
#include "xlat/pr_cap_ambient.h"
|
||||
#include "xlat/pr_dumpable.h"
|
||||
@ -40,6 +42,7 @@
|
||||
#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"
|
||||
|
||||
@ -65,6 +68,11 @@ enum {
|
||||
|
||||
#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)
|
||||
{
|
||||
@ -74,6 +82,22 @@ 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];
|
||||
@ -184,6 +208,23 @@ SYS_FUNC(prctl)
|
||||
(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:
|
||||
|
2
xlat/pr_sve_vl_flags.in
Normal file
2
xlat/pr_sve_vl_flags.in
Normal file
@ -0,0 +1,2 @@
|
||||
PR_SVE_SET_VL_ONEXEC (1 << 18)
|
||||
PR_SVE_VL_INHERIT (1 << 17)
|
@ -44,4 +44,6 @@ PR_MPX_DISABLE_MANAGEMENT 44
|
||||
PR_SET_FP_MODE 45
|
||||
PR_GET_FP_MODE 46
|
||||
PR_CAP_AMBIENT 47
|
||||
PR_SVE_SET_VL 50
|
||||
PR_SVE_GET_VL 51
|
||||
PR_SET_VMA 0x53564d41
|
||||
|
Loading…
Reference in New Issue
Block a user