[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 46/66] linux-user: Split out do_prctl and subroutines
|
From: |
Peter Maydell |
|
Subject: |
Re: [PATCH v3 46/66] linux-user: Split out do_prctl and subroutines |
|
Date: |
Thu, 19 Aug 2021 17:06:44 +0100 |
On Wed, 18 Aug 2021 at 20:39, Richard Henderson
<richard.henderson@linaro.org> 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_syscall.h | 23 -
> linux-user/mips/target_syscall.h | 6 -
> linux-user/mips64/target_syscall.h | 6 -
> linux-user/syscall.c | 644 ++++++++++++++++------------
> +static abi_long do_prctl_get_fp_mode(CPUArchState *env)
> +{
> +#ifdef TARGET_MIPS
> + abi_long ret = 0;
> +
> + if (env->CP0_Status & (1 << CP0St_FR)) {
> + ret |= PR_FP_MODE_FR;
> + }
> + if (env->CP0_Config5 & (1 << CP0C5_FRE)) {
> + ret |= PR_FP_MODE_FRE;
> + }
> + return ret;
> +#else
> + return -TARGET_EINVAL;
> +#endif
> +}
If we're going to refactor the prctl code, I think it would be
better to have architecture-specific prctl handling in
linux-user/$ARCH/prctl.c files rather than lots of target ifdefs
in syscall.c...
thanks
-- PMM
- [PATCH v3 41/66] target/arm: Use cpu_*_mmu instead of helper_*_mmu, (continued)
- [PATCH v3 41/66] target/arm: Use cpu_*_mmu instead of helper_*_mmu, Richard Henderson, 2021/08/18
- [PATCH v3 42/66] tcg: Move helper_*_mmu decls to tcg/tcg-ldst.h, Richard Henderson, 2021/08/18
- [PATCH v3 43/66] tcg: Add helper_unaligned_{ld, st} for user-only sigbus, Richard Henderson, 2021/08/18
- [PATCH v3 45/66] tests/tcg/multiarch: Add sigbus.c, Richard Henderson, 2021/08/18
- [PATCH v3 44/66] tcg/i386: Support raising sigbus for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 47/66] linux-user: Disable more prctl subcodes, Richard Henderson, 2021/08/18
- [PATCH v3 46/66] linux-user: Split out do_prctl and subroutines, Richard Henderson, 2021/08/18
- Re: [PATCH v3 46/66] linux-user: Split out do_prctl and subroutines,
Peter Maydell <=
- [PATCH v3 48/66] hw/core/cpu: Re-sort the non-pointers to the end of CPUClass, Richard Henderson, 2021/08/18
- [PATCH v3 49/66] linux-user: Add code for PR_GET/SET_UNALIGN, Richard Henderson, 2021/08/18
- [PATCH v3 52/66] target/alpha: Reorg fp memory operations, Richard Henderson, 2021/08/18
- [PATCH v3 53/66] target/alpha: Reorg integer memory operations, Richard Henderson, 2021/08/18
- [PATCH v3 51/66] hw/core/cpu: Add prctl-unalign-sigbus property for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 50/66] hw/core/cpu: Move cpu properties to cpu-sysemu.c, Richard Henderson, 2021/08/18