Messages in this thread Patch in this message | | | Date | Sun, 20 Feb 2000 23:19:40 +0100 (CET) | From | Carsten Jacobi <> | Subject | [PATCH] Trapping for Alpha EV4 machines |
| |
I have found a bug. I just don't know whether to blame the kernel or my processor, but now it works. The problem is, that EV4 machines seam to behave differently than EV5/6 during an illegal opcode or FP forced software handling trap. At least the code in arch/alpha/kernel/traps.c assumes that the PC is incremented when the exception handler is executed. This is not the case on my EV4-machine, and programs that used trapping math instructions (I got him on "cvttq/svm") just stuck: 1. The exception handler tried to handle the instruction that preceeded the instruction which caused the exception. 2. After the handling the PC was still pointing to the same insn so that the exception was caused over and over again. Thus the process using such an insn ate up the whole CPU power and didn't process! Unfortunately this instruction was located in the libgtk so that every program using gtk didn't work on my machine (Thanks tux now they do run 8-) ). Ok, anybody with an EV4-Alpha (for example Jensen) who shares the same experience with me? Or do I have a very exclusive/unique 21064 in my chassis ... ;-)
Carsten
PS.: I definitely know that the second call in the patchfile to "alpha_fp_emul" is corrected by the patch. I hope my change to the first call in the patch file is correct too, but I am not sure ...
--------------------------------------
Carsten Jacobi Kastanienweg 6, App.1317 52074 Aachen
Tel.: +49 241 878117 Fax : +49 241 878189 ISDN: +49 241 878190 E-Mail: carsten@jakes.kawo1.rwth-aachen.de
-------------------------------------- --- linux/arch/alpha/kernel/traps.c.old Tue Jan 4 19:12:11 2000 +++ linux/arch/alpha/kernel/traps.c Sun Feb 20 19:45:06 2000 @@ -336,9 +336,14 @@ /* Software-completion summary bit is set, so try to emulate the instruction. */ if (!amask(AMASK_PRECISE_TRAP)) { +#ifdef CONFIG_ALPHA_EV4 + if (alpha_fp_emul(regs.pc)) + return; +#else /* 21264 (except pass 1) has precise exceptions. */ if (alpha_fp_emul(regs.pc - 4)) return; +#endif } else { if (alpha_fp_emul_imprecise(®s, write_mask)) return; @@ -417,8 +422,13 @@ /* EV4 does not implement anything except normal rounding. Everything else will come here as an illegal instruction. Emulate them. */ - if (alpha_fp_emul(regs.pc - 4)) + if (alpha_fp_emul(regs.pc)) + { + /* Increment the PC so that the program in + user space continues */ + regs.pc += 4; return; + } } send_sig(SIGILL, current, 1); break;
| |