Re: [PATCH v2 1/2] linux-user/s390x: signal with SIGFPE on compare-and-trap

2021-07-09 Thread jonathan.albrecht
On 2021-07-09 10:37 am, Richard Henderson wrote: On 7/9/21 7:23 AM, jonathan.albrecht wrote: As a general comment, I think a single switch over DXC would be cleaner for both kernel and qemu.  It seems like giving different si_code for e.g. "0x40 IEEE division by zero" and "0x43 Simulated IEEE

Re: [PATCH v2 1/2] linux-user/s390x: signal with SIGFPE on compare-and-trap

2021-07-09 Thread Richard Henderson
On 7/9/21 7:23 AM, jonathan.albrecht wrote: As a general comment, I think a single switch over DXC would be cleaner for both kernel and qemu.  It seems like giving different si_code for e.g. "0x40 IEEE division by zero" and "0x43 Simulated IEEE division by zero" is actively incorrect. I went ov

Re: [PATCH v2 1/2] linux-user/s390x: signal with SIGFPE on compare-and-trap

2021-07-09 Thread jonathan.albrecht
On 2021-07-08 1:08 pm, Richard Henderson wrote: On 7/7/21 6:42 AM, Jonathan Albrecht wrote: +sig = TARGET_SIGFPE; +if ((n & 0x03) == 0) { +/* An IEEE exception, simulated or otherwise. */ if (n & 0x80) {

Re: [PATCH v2 1/2] linux-user/s390x: signal with SIGFPE on compare-and-trap

2021-07-08 Thread Richard Henderson
On 7/7/21 6:42 AM, Jonathan Albrecht wrote: +sig = TARGET_SIGFPE; +if ((n & 0x03) == 0) { +/* An IEEE exception, simulated or otherwise. */ if (n & 0x80) { n = TARGET_FPE_FLTINV;

[PATCH v2 1/2] linux-user/s390x: signal with SIGFPE on compare-and-trap

2021-07-07 Thread Jonathan Albrecht
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 an IEEE