On 3/24/21 8:14 AM, Andreas Krebbel wrote:
The part I actually needed to fix was in setup_rt_frame and there the fix is 
correct I think since
here we do use 'frame' which is the host address.

While doing that change I also stumbled upon the other location in setup_frame. 
There it is using
frame_addr for doing the same thing. There as you say adding h2g is wrong.

Here just the change which I think is needed:

diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c
index ecfa2a14a9..7fba1c7999 100644
--- a/linux-user/s390x/signal.c
+++ b/linux-user/s390x/signal.c
@@ -213,7 +213,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
      if (ka->sa_flags & TARGET_SA_RESTORER) {
          env->regs[14] = (unsigned long) ka->sa_restorer | PSW_ADDR_AMODE;
      } else {
-        env->regs[14] = (unsigned long) frame->retcode | PSW_ADDR_AMODE;
+        env->regs[14] = (unsigned long) h2g(frame->retcode) | PSW_ADDR_AMODE;

Correct, though I think the formulation using frame_addr is more obvious.

Unrelated, but all the uses of "unsigned long" are wrong -- they should be target_ulong.


r~

Reply via email to