785 CPU bug -- BEWARE

Chris Torek chris at umcp-cs.UUCP
Wed Oct 23 02:54:57 AEST 1985


On our 785, this bug takes the form of computing the value 0x7dfffffc
on `extzv $0,$4,-4(r0),r0' instructions when r0 has the value 0x80000000.
Here is what I did to keep it from crashing our machine.  I also added

	options "AVOID_785_CPU_BUG"

to the conf file, of course.

RCS file: RCS/kern_exit.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c2 -r1.1 -r1.2
*** /tmp/,RCSt1008733	Tue Oct 22 12:52:03 1985
--- /tmp/,RCSt2008733	Tue Oct 22 12:52:05 1985
***************
*** 181,184
  {
  	struct rusage ru, *rup;
  
  	if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) {

--- 181,186 -----
  {
  	struct rusage ru, *rup;
+ #ifdef AVOID_785_CPU_BUG
+ 	int psl;
  
  	psl = u.u_ar0[PS];
***************
*** 182,185
  	struct rusage ru, *rup;
  
  	if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) {
  		u.u_error = wait1(0, (struct rusage *)0);

--- 184,193 -----
  	int psl;
  
+ 	psl = u.u_ar0[PS];
+ 	if ((psl & PSL_ALLCC) != PSL_ALLCC) {
+ 		u.u_error = wait1(0, (struct rusage *)0);
+ 		return;
+ 	}
+ #else
  	if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) {
  		u.u_error = wait1(0, (struct rusage *)0);
***************
*** 186,189
  		return;
  	}
  	rup = (struct rusage *)u.u_ar0[R1];
  	u.u_error = wait1(u.u_ar0[R0], &ru);

--- 194,198 -----
  		return;
  	}
+ #endif
  	rup = (struct rusage *)u.u_ar0[R1];
  	u.u_error = wait1(u.u_ar0[R0], &ru);

RCS file: RCS/kern_xxx.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c2 -r1.2 -r1.3
*** /tmp/,RCSt1008740	Tue Oct 22 12:52:11 1985
--- /tmp/,RCSt2008740	Tue Oct 22 12:52:13 1985
***************
*** 283,286
  	struct rusage ru;
  	struct vtimes *vtp, avt;
  
  	if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) {

--- 283,288 -----
  	struct rusage ru;
  	struct vtimes *vtp, avt;
+ #ifdef AVOID_785_CPU_BUG
+ 	int psl;
  
  	psl = u.u_ar0[PS];
***************
*** 284,287
  	struct vtimes *vtp, avt;
  
  	if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) {
  		u.u_error = wait1(0, (struct rusage *)0);

--- 286,295 -----
  	int psl;
  
+ 	psl = u.u_ar0[PS];
+ 	if ((psl & PSL_ALLCC) != PSL_ALLCC) {
+ 		u.u_error = wait1(0, (struct rusage *)0);
+ 		return;
+ 	}
+ #else
  	if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) {
  		u.u_error = wait1(0, (struct rusage *)0);
***************
*** 288,291
  		return;
  	}
  	vtp = (struct vtimes *)u.u_ar0[R1];
  	u.u_error = wait1(u.u_ar0[R0], &ru);

--- 296,300 -----
  		return;
  	}
+ #endif
  	vtp = (struct vtimes *)u.u_ar0[R1];
  	u.u_error = wait1(u.u_ar0[R0], &ru);
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list