qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 15/66] target/sh4: Implement do_unaligned_access for user-


From: Richard Henderson
Subject: Re: [PATCH v3 15/66] target/sh4: Implement do_unaligned_access for user-only
Date: Thu, 19 Aug 2021 09:21:55 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 8/19/21 5:46 AM, Peter Maydell wrote:
On Wed, 18 Aug 2021 at 20:26, 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;
          case EXCP_ATOMIC:
              cpu_exec_step_atomic(cs);
              arch_interrupt = false;

Doesn't this have to wait until after the later patches in the
series that implement the "actually don't worry about alignment
on most sh4 load/stores" ?

Hmm. I don't think that helps. The only thing that delaying this patch would do is hit the assert in cpu_unaligned_access() due to an alignment fault occurring but not having the do_unaligned_access hook set.

I think the real requirement is that the tcg/i386 patch that enforces the alignment is delayed until after all of the prctl patches.


r~



reply via email to

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