[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/6] linux-user: Split out do_prctl and subroutines
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/6] linux-user: Split out do_prctl and subroutines |
Date: |
Mon, 20 Dec 2021 23:35:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
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.henderson@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é <f4bug@amsat.org>
- [PATCH 0/6] linux-user: prctl improvements, Richard Henderson, 2021/12/20
- [PATCH 3/6] linux-user: Add code for PR_GET/SET_UNALIGN, Richard Henderson, 2021/12/20
- [PATCH 1/6] linux-user: Split out do_prctl and subroutines, Richard Henderson, 2021/12/20
- [PATCH 2/6] linux-user: Disable more prctl subcodes, Richard Henderson, 2021/12/20
- [PATCH 4/6] target/alpha: Implement prctl_unalign_sigbus, Richard Henderson, 2021/12/20
- [PATCH 5/6] target/hppa: Implement prctl_unalign_sigbus, Richard Henderson, 2021/12/20
- [PATCH 6/6] target/sh4: Implement prctl_unalign_sigbus, Richard Henderson, 2021/12/20