diff mbox series

[v2,10/15] linux-user/s390x: Set psw.mask properly for the signal handler

Message ID 20210428193408.233706-11-richard.henderson@linaro.org
State Superseded
Headers show
Series linux-user/s390x: some signal fixes | expand

Commit Message

Richard Henderson April 28, 2021, 7:34 p.m. UTC
Note that PSW_ADDR_{64,32} are called PSW_MASK_{EA,BA}
in the kernel source.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/s390x/signal.c | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.25.1

Comments

David Hildenbrand April 29, 2021, 7:20 a.m. UTC | #1
On 28.04.21 21:34, Richard Henderson wrote:
> Note that PSW_ADDR_{64,32} are called PSW_MASK_{EA,BA}

> in the kernel source.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>   linux-user/s390x/signal.c | 6 ++++++

>   1 file changed, 6 insertions(+)

> 

> diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c

> index 64a9eab097..17f617c655 100644

> --- a/linux-user/s390x/signal.c

> +++ b/linux-user/s390x/signal.c

> @@ -162,6 +162,9 @@ void setup_frame(int sig, struct target_sigaction *ka,

>   

>       /* Set up registers for signal handler */

>       env->regs[15] = frame_addr;

> +    /* Force default amode and default user address space control. */

> +    env->psw.mask = PSW_MASK_64 | PSW_MASK_32 | PSW_ASC_PRIMARY

> +                  | (env->psw.mask & ~PSW_MASK_ASC);

>       env->psw.addr = ka->_sa_handler;

>   

>       env->regs[2] = sig; //map_signal(sig);

> @@ -215,6 +218,9 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,

>   

>       /* Set up registers for signal handler */

>       env->regs[15] = frame_addr;

> +    /* Force default amode and default user address space control. */

> +    env->psw.mask = PSW_MASK_64 | PSW_MASK_32 | PSW_ASC_PRIMARY

> +                  | (env->psw.mask & ~PSW_MASK_ASC);

>       env->psw.addr = ka->_sa_handler;

>   

>       env->regs[2] = sig; //map_signal(sig);

> 


Reviewed-by: David Hildenbrand <david@redhat.com>


-- 
Thanks,

David / dhildenb
diff mbox series

Patch

diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c
index 64a9eab097..17f617c655 100644
--- a/linux-user/s390x/signal.c
+++ b/linux-user/s390x/signal.c
@@ -162,6 +162,9 @@  void setup_frame(int sig, struct target_sigaction *ka,
 
     /* Set up registers for signal handler */
     env->regs[15] = frame_addr;
+    /* Force default amode and default user address space control. */
+    env->psw.mask = PSW_MASK_64 | PSW_MASK_32 | PSW_ASC_PRIMARY
+                  | (env->psw.mask & ~PSW_MASK_ASC);
     env->psw.addr = ka->_sa_handler;
 
     env->regs[2] = sig; //map_signal(sig);
@@ -215,6 +218,9 @@  void setup_rt_frame(int sig, struct target_sigaction *ka,
 
     /* Set up registers for signal handler */
     env->regs[15] = frame_addr;
+    /* Force default amode and default user address space control. */
+    env->psw.mask = PSW_MASK_64 | PSW_MASK_32 | PSW_ASC_PRIMARY
+                  | (env->psw.mask & ~PSW_MASK_ASC);
     env->psw.addr = ka->_sa_handler;
 
     env->regs[2] = sig; //map_signal(sig);