linux-user: Add code for PR_GET/SET_UNALIGN

This requires extra work for each target, but adds the
common syscall code, and the necessary flag in CPUState.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211227150127.2659293-4-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Richard Henderson 2021-12-27 07:01:24 -08:00 committed by Laurent Vivier
parent 220717a6f4
commit 6e8dcacd08
4 changed files with 56 additions and 7 deletions

View file

@ -6378,6 +6378,12 @@ static abi_long do_prctl_inval1(CPUArchState *env, abi_long arg2)
#ifndef do_prctl_get_tagged_addr_ctrl
#define do_prctl_get_tagged_addr_ctrl do_prctl_inval0
#endif
#ifndef do_prctl_get_unalign
#define do_prctl_get_unalign do_prctl_inval1
#endif
#ifndef do_prctl_set_unalign
#define do_prctl_set_unalign do_prctl_inval1
#endif
static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
abi_long arg3, abi_long arg4, abi_long arg5)
@ -6441,6 +6447,11 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
}
return do_prctl_get_tagged_addr_ctrl(env);
case PR_GET_UNALIGN:
return do_prctl_get_unalign(env, arg2);
case PR_SET_UNALIGN:
return do_prctl_set_unalign(env, arg2);
case PR_GET_DUMPABLE:
case PR_SET_DUMPABLE:
case PR_GET_KEEPCAPS:
@ -6483,8 +6494,6 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
case PR_SET_THP_DISABLE:
case PR_GET_TSC:
case PR_SET_TSC:
case PR_GET_UNALIGN:
case PR_SET_UNALIGN:
/* Disable to prevent the target disabling stuff we need. */
return -TARGET_EINVAL;