Currently when a compare-and-trap instruction is executed, qemu will
always raise a SIGILL signal. On real hardware, a SIGFPE is raised.
Change the PGM_DATA case in cpu_loop to follow the behavior in
linux kernel /arch/s390/kernel/traps.c.
* Only raise SIGILL if DXC == 0
* If DXC matches a non-simulated IEEE exception, raise SIGFPE with
correct si_code
* Raise SIGFPE with si_code == 0 for everything else
When applied on20210705210434.45824-2-iii@linux.ibm.com, this fixes
crashes in the java jdk such as the linked bug.
Buglink:https://bugs.launchpad.net/qemu/+bug/1920913
Resolves:https://gitlab.com/qemu-project/qemu/-/issues/319
Signed-off-by: Jonathan Albrecht<jonathan.albrecht@linux.vnet.ibm.com>
---
linux-user/s390x/cpu_loop.c | 54 +++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 20 deletions(-)