qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-6.2 12/43] target/sh4: Implement do_unaligned_access for


From: Peter Maydell
Subject: Re: [PATCH for-6.2 12/43] target/sh4: Implement do_unaligned_access for user-only
Date: Thu, 29 Jul 2021 14:52:16 +0100

On Thu, 29 Jul 2021 at 02:01, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  linux-user/sh4/cpu_loop.c | 8 ++++++++
>  target/sh4/cpu.c          | 2 +-
>  target/sh4/op_helper.c    | 3 ---
>  3 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c
> index 222ed1c670..21d97250a8 100644
> --- a/linux-user/sh4/cpu_loop.c
> +++ b/linux-user/sh4/cpu_loop.c
> @@ -71,6 +71,14 @@ void cpu_loop(CPUSH4State *env)
>              info._sifields._sigfault._addr = env->tea;
>              queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
>              break;
> +        case 0xe0:
> +        case 0x100:
> +            info.si_signo = TARGET_SIGBUS;
> +            info.si_errno = 0;
> +            info.si_code = TARGET_BUS_ADRALN;
> +            info._sifields._sigfault._addr = env->tea;
> +            queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
> +            break;

sh4 kernel default for unaligned accesses seems to be "warn and fixup",
not SIGBUS, unless the user changes that by writing to /proc/cpu/alignment
or the process changes it via prctl().

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]