]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/hppa: Copy instruction code into fr1 on FPU assist fault
authorHelge Deller <deller@gmx.de>
Sat, 17 May 2025 11:12:07 +0000 (13:12 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 25 May 2025 08:19:51 +0000 (11:19 +0300)
The hardware stores the instruction code in the lower bits of the FP
exception register #1 on FP assist traps.
This fixes the FP exception handler on Linux, as the Linux kernel uses
the value to decide on the correct signal which should be pushed into
userspace (see decode_fpu() in Linux kernel).

Signed-off-by: Helge Deller <deller@gmx.de>
(cherry picked from commit 923976dfe367b0bfed45ff660c369f3fe65604a7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/hppa/int_helper.c

index 7d48643bb63bc87a87b8bd6822d3df7fcbc745b2..191ae19404b767c6a8c1d79dba0010e7b7f1808c 100644 (file)
@@ -177,6 +177,10 @@ void hppa_cpu_do_interrupt(CPUState *cs)
                     }
                 }
                 env->cr[CR_IIR] = ldl_phys(cs->as, paddr);
+                if (i == EXCP_ASSIST) {
+                    /* stuff insn code into bits of FP exception register #1 */
+                    env->fr[0] |= (env->cr[CR_IIR] & 0x03ffffff);
+                }
             }
             break;