* [PATCH] linux-user/s390x: Save/restore fpc when handling a signal
@ 2022-08-17 12:39 Ilya Leoshkevich
2022-08-17 13:28 ` Richard Henderson
2022-09-27 9:22 ` Laurent Vivier
0 siblings, 2 replies; 3+ messages in thread
From: Ilya Leoshkevich @ 2022-08-17 12:39 UTC (permalink / raw)
To: Laurent Vivier
Cc: qemu-devel, Richard Henderson, David Hildenbrand,
Ilya Leoshkevich
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>
---
linux-user/s390x/signal.c | 2 ++
1 file changed, 2 insertions(+)
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]);
}
--
2.37.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] linux-user/s390x: Save/restore fpc when handling a signal
2022-08-17 12:39 [PATCH] linux-user/s390x: Save/restore fpc when handling a signal Ilya Leoshkevich
@ 2022-08-17 13:28 ` Richard Henderson
2022-09-27 9:22 ` Laurent Vivier
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2022-08-17 13:28 UTC (permalink / raw)
To: Ilya Leoshkevich, Laurent Vivier; +Cc: qemu-devel, David Hildenbrand
On 8/17/22 07:39, Ilya Leoshkevich wrote:
> 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>
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] linux-user/s390x: Save/restore fpc when handling a signal
2022-08-17 12:39 [PATCH] linux-user/s390x: Save/restore fpc when handling a signal Ilya Leoshkevich
2022-08-17 13:28 ` Richard Henderson
@ 2022-09-27 9:22 ` Laurent Vivier
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2022-09-27 9:22 UTC (permalink / raw)
To: Ilya Leoshkevich; +Cc: qemu-devel, Richard Henderson, David Hildenbrand
Le 17/08/2022 à 14:39, Ilya Leoshkevich a écrit :
> 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>
> ---
> linux-user/s390x/signal.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied to my linux-user-for-7.2 branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-27 9:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-17 12:39 [PATCH] linux-user/s390x: Save/restore fpc when handling a signal Ilya Leoshkevich
2022-08-17 13:28 ` Richard Henderson
2022-09-27 9:22 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).