[lkml]   [2000]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
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
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 ... ;-)


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

--- 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)) {
+ if (alpha_fp_emul(regs.pc))
+ return;
/* 21264 (except pass 1) has precise exceptions. */
if (alpha_fp_emul(regs.pc - 4))
} else {
if (alpha_fp_emul_imprecise(&regs, write_mask))
@@ -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;
+ }
send_sig(SIGILL, current, 1);
 \ /
  Last update: 2005-03-22 13:56    [W:0.032 / U:13.444 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site