[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/6] linux-user: Add code for PR_GET/SET_UNALIGN
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 3/6] linux-user: Add code for PR_GET/SET_UNALIGN |
Date: |
Mon, 20 Dec 2021 23:31:24 +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:
> 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>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> include/hw/core/cpu.h | 3 +++
> linux-user/generic/target_prctl_unalign.h | 27 +++++++++++++++++++++++
> cpu.c | 20 ++++++++++++-----
> linux-user/syscall.c | 13 +++++++++--
> 4 files changed, 56 insertions(+), 7 deletions(-)
> create mode 100644 linux-user/generic/target_prctl_unalign.h
>
> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> index e948e81f1a..76ab3b851c 100644
> --- a/include/hw/core/cpu.h
> +++ b/include/hw/core/cpu.h
> @@ -413,6 +413,9 @@ struct CPUState {
>
> bool ignore_memory_transaction_failures;
>
> + /* Used for user-only emulation of prctl(PR_SET_UNALIGN). */
> + bool prctl_unalign_sigbus;
Could we forward-declare a UserEmuCPUState structure in this file,
use it here:
struct UserEmuCPUState *user_cpu;
and declare it in include/hw/core/useremu-cpu.h (or better name)
restricted to user emulation?
I'd rather not mix sys/user emu specific fields in CPUState.
Can be done later of course, so:
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