Subject: panic: MachEmulateBranch: Non-branch
To: None <port-pmax@NetBSD.ORG>
From: Ben Cottrell <benco@ucsee.EECS.Berkeley.EDU>
List: port-pmax
Date: 09/03/1996 12:02:28
I'm using a kernel from source supped a few days ago, but the problem has
existed for a while. My machine is a DS3100.

What happens is this: I'm running a program that uses floating point a lot--
I can get it most repeatably when my friend runs povray--and it panics with
the message "MachEmulateBranch: Non-branch". Then it goes into an infinite
loop printing a whole bunch of stuff about fp_intr over and over again,
which I haven't succeeded in transcribing. The reset switch doesn't work;
I have to power-cycle to get it to reboot.

A little poking around shows that the panic is on line 1167 of
arch/pmax/pmax/trap.c. The trap() function calls MachEmulateBranch on
line 608, but only if causeReg is negative (has the high bit set).
MachEmulateBranch, in turn, panics if the opcode it trapped on was neither
JR nor JALR (jump-register and jump-and-link-register), which makes sense
if the instruction had to do with floating-point.

I'm almost at the point of taking out that panic and replacing it with
code to send a SIGFPE back to the process, but it just doesn't make sense
that trap() is detecting the trap as a syscall (line 594). It seems like
type might be getting set incorrectly on line 413? And what is the
significance of causeReg being negative? That's beyond my knowledge of
the MIPS architecture, unfortunately.

Anyone have any ideas? Has anyone else had similar problems?

Thanks,
	~Ben