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 <i...@bsdimp.com>
> Signed-off-by: Richard Henderson <richard.hender...@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é <f4...@amsat.org>

Reply via email to