]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user/s390x: Fix trace in restore_regs
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 28 Apr 2021 19:33:58 +0000 (12:33 -0700)
committerLaurent Vivier <laurent@vivier.eu>
Sat, 15 May 2021 19:44:38 +0000 (21:44 +0200)
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>
linux-user/s390x/signal.c

index e455a9818dea01e11860baddbb63192ff2eac156..dcc6f7bc027470fb1579bd76729a04fdda1e4182 100644 (file)
@@ -232,16 +232,17 @@ give_sigsegv:
 
 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]);