On 12/20/21 22:41, Richard Henderson wrote: > Since the prctl constants are supposed to be generic, supply > any that are not provided by the host. > > Split out subroutines for PR_GET_FP_MODE, PR_SET_FP_MODE, > PR_GET_VL, PR_SET_VL, PR_RESET_KEYS, PR_SET_TAGGED_ADDR_CTRL, > PR_GET_TAGGED_ADDR_CTRL. Return EINVAL for guests that do > not support these options rather than pass them on to the host. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > linux-user/aarch64/target_prctl.h | 160 ++++++++++ > linux-user/aarch64/target_syscall.h | 23 -- > linux-user/alpha/target_prctl.h | 1 + > linux-user/arm/target_prctl.h | 1 + > linux-user/cris/target_prctl.h | 1 + > linux-user/hexagon/target_prctl.h | 1 + > linux-user/hppa/target_prctl.h | 1 + > linux-user/i386/target_prctl.h | 1 + > linux-user/m68k/target_prctl.h | 1 + > linux-user/microblaze/target_prctl.h | 1 + > linux-user/mips/target_prctl.h | 88 ++++++ > linux-user/mips/target_syscall.h | 6 - > linux-user/mips64/target_prctl.h | 1 + > linux-user/mips64/target_syscall.h | 6 - > linux-user/nios2/target_prctl.h | 1 + > linux-user/openrisc/target_prctl.h | 1 + > linux-user/ppc/target_prctl.h | 1 + > linux-user/riscv/target_prctl.h | 1 + > linux-user/s390x/target_prctl.h | 1 + > linux-user/sh4/target_prctl.h | 1 + > linux-user/sparc/target_prctl.h | 1 + > linux-user/x86_64/target_prctl.h | 1 + > linux-user/xtensa/target_prctl.h | 1 + > linux-user/syscall.c | 433 +++++++++------------------ > 24 files changed, 414 insertions(+), 320 deletions(-) > create mode 100644 linux-user/aarch64/target_prctl.h > create mode 100644 linux-user/alpha/target_prctl.h > create mode 100644 linux-user/arm/target_prctl.h > create mode 100644 linux-user/cris/target_prctl.h > create mode 100644 linux-user/hexagon/target_prctl.h > create mode 100644 linux-user/hppa/target_prctl.h > create mode 100644 linux-user/i386/target_prctl.h > create mode 100644 linux-user/m68k/target_prctl.h > create mode 100644 linux-user/microblaze/target_prctl.h > create mode 100644 linux-user/mips/target_prctl.h > create mode 100644 linux-user/mips64/target_prctl.h > create mode 100644 linux-user/nios2/target_prctl.h > create mode 100644 linux-user/openrisc/target_prctl.h > create mode 100644 linux-user/ppc/target_prctl.h > create mode 100644 linux-user/riscv/target_prctl.h > create mode 100644 linux-user/s390x/target_prctl.h > create mode 100644 linux-user/sh4/target_prctl.h > create mode 100644 linux-user/sparc/target_prctl.h > create mode 100644 linux-user/x86_64/target_prctl.h > create mode 100644 linux-user/xtensa/target_prctl.h
> +#include "target_prctl.h" > + > +static abi_long do_prctl_inval0(CPUArchState *env) > +{ > + return -TARGET_EINVAL; > +} > + > +static abi_long do_prctl_inval1(CPUArchState *env, abi_long arg2) > +{ > + return -TARGET_EINVAL; > +} > + > +#ifndef do_prctl_get_fp_mode > +#define do_prctl_get_fp_mode do_prctl_inval0 > +#endif > +#ifndef do_prctl_set_fp_mode > +#define do_prctl_set_fp_mode do_prctl_inval1 > +#endif > +#ifndef do_prctl_get_vl > +#define do_prctl_get_vl do_prctl_inval0 > +#endif > +#ifndef do_prctl_set_vl > +#define do_prctl_set_vl do_prctl_inval1 > +#endif > +#ifndef do_prctl_reset_keys > +#define do_prctl_reset_keys do_prctl_inval1 > +#endif > +#ifndef do_prctl_set_tagged_addr_ctrl > +#define do_prctl_set_tagged_addr_ctrl do_prctl_inval1 > +#endif > +#ifndef do_prctl_get_tagged_addr_ctrl > +#define do_prctl_get_tagged_addr_ctrl do_prctl_inval0 > +#endif Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>