Skip to content

Commit

Permalink
linux-user/s390x: Fix trace in restore_regs
Browse files Browse the repository at this point in the history
Directly reading sc->regs.psw.addr misses the bswap
that may be performed by __get_user.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210428193408.233706-6-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
rth7680 authored and vivier committed May 15, 2021
1 parent e6f960f commit bd45be9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions linux-user/s390x/signal.c
Expand Up @@ -232,16 +232,17 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,

static void restore_sigregs(CPUS390XState *env, target_sigregs *sc)
{
target_ulong prev_addr;
int i;

for (i = 0; i < 16; i++) {
__get_user(env->regs[i], &sc->regs.gprs[i]);
}

prev_addr = env->psw.addr;
__get_user(env->psw.mask, &sc->regs.psw.mask);
trace_user_s390x_restore_sigregs(env, (unsigned long long)sc->regs.psw.addr,
(unsigned long long)env->psw.addr);
__get_user(env->psw.addr, &sc->regs.psw.addr);
trace_user_s390x_restore_sigregs(env, env->psw.addr, prev_addr);

for (i = 0; i < 16; i++) {
__get_user(env->aregs[i], &sc->regs.acrs[i]);
Expand Down

0 comments on commit bd45be9

Please sign in to comment.