summaryrefslogtreecommitdiffstats
path: root/linux-user
diff options
context:
space:
mode:
authorIlya Leoshkevich2022-08-17 14:39:02 +0200
committerLaurent Vivier2022-09-27 13:19:05 +0200
commit2941e0fa050314cd200f24e3b99da61440b106ab (patch)
treeec5c5655b586452720a0645d4d44dc5102d5101b /linux-user
parentlinux-user: Don't assume 0 is not a valid host timer_t value (diff)
downloadqemu-2941e0fa050314cd200f24e3b99da61440b106ab.tar.gz
qemu-2941e0fa050314cd200f24e3b99da61440b106ab.tar.xz
qemu-2941e0fa050314cd200f24e3b99da61440b106ab.zip
linux-user/s390x: Save/restore fpc when handling a signal
Linux kernel does this in fpregs_store() and fpregs_load(), so qemu-user should do this as well. Found by running valgrind's none/tests/s390x/test_sig. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220817123902.585623-1-iii@linux.ibm.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/s390x/signal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c
index 4979c4b017..f72165576f 100644
--- a/linux-user/s390x/signal.c
+++ b/linux-user/s390x/signal.c
@@ -146,6 +146,7 @@ static void save_sigregs(CPUS390XState *env, target_sigregs *sregs)
* We have to store the fp registers to current->thread.fp_regs
* to merge them with the emulated registers.
*/
+ __put_user(env->fpc, &sregs->fpregs.fpc);
for (i = 0; i < 16; i++) {
__put_user(*get_freg(env, i), &sregs->fpregs.fprs[i]);
}
@@ -331,6 +332,7 @@ static void restore_sigregs(CPUS390XState *env, target_sigregs *sc)
for (i = 0; i < 16; i++) {
__get_user(env->aregs[i], &sc->regs.acrs[i]);
}
+ __get_user(env->fpc, &sc->fpregs.fpc);
for (i = 0; i < 16; i++) {
__get_user(*get_freg(env, i), &sc->fpregs.fprs[i]);
}