From: Eugene Syromyatnikov Date: Sat, 19 Nov 2016 20:10:01 +0000 (+0300) Subject: prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options X-Git-Tag: v4.15~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10922d31125629ea7bb88ccdbc4a5e7fe6767a19;p=strace prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options * xlat/pr_fp_mode.in: New file. * prctl.c: Include "xlat/pr_fp_mode.h". (SYS_FUNC(prctl)): Add handling for PR_SET_FP_MODE and PR_GET_FP_MODE options. --- diff --git a/prctl.c b/prctl.c index 450b399e..32b79d78 100644 --- a/prctl.c +++ b/prctl.c @@ -34,6 +34,7 @@ #include "xlat/prctl_options.h" #include "xlat/pr_cap_ambient.h" +#include "xlat/pr_fp_mode.h" #include "xlat/pr_mce_kill.h" #include "xlat/pr_mce_kill_policy.h" #include "xlat/pr_set_mm.h" @@ -165,6 +166,15 @@ SYS_FUNC(prctl) } break; + case PR_GET_FP_MODE: + if (entering(tcp)) + break; + if (syserror(tcp) || tcp->u_rval == 0) + return 0; + tcp->auxstr = sprintflags("", pr_fp_mode, + (unsigned long) 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: @@ -311,6 +321,11 @@ SYS_FUNC(prctl) (unsigned long) tcp->u_rval); return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL; + case PR_SET_FP_MODE: + tprints(", "); + printflags(pr_fp_mode, arg2, "PR_FP_MODE_???"); + return RVAL_DECODED; + case PR_GET_NO_NEW_PRIVS: case PR_GET_THP_DISABLE: case PR_MPX_DISABLE_MANAGEMENT: diff --git a/xlat/pr_fp_mode.in b/xlat/pr_fp_mode.in new file mode 100644 index 00000000..8f144546 --- /dev/null +++ b/xlat/pr_fp_mode.in @@ -0,0 +1,2 @@ +PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ +PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */