Skip to content

Commit 679450c

Browse files
hdellerMichael Tokarev
authored andcommitted
target/hppa: Copy instruction code into fr1 on FPU assist fault
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 <[email protected]> (cherry picked from commit 923976d) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 8a48520 commit 679450c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

target/hppa/int_helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ void hppa_cpu_do_interrupt(CPUState *cs)
177177
}
178178
}
179179
env->cr[CR_IIR] = ldl_phys(cs->as, paddr);
180+
if (i == EXCP_ASSIST) {
181+
/* stuff insn code into bits of FP exception register #1 */
182+
env->fr[0] |= (env->cr[CR_IIR] & 0x03ffffff);
183+
}
180184
}
181185
break;
182186

0 commit comments

Comments
 (0)