[6049] in Athena Bugs

home help back first fref pref prev next nref lref last post

RT kernel sys/ca/mc881.c

daemon@ATHENA.MIT.EDU (John Carr)
Sun Sep 16 23:30:15 1990

To: bugs@ATHENA.MIT.EDU
Date: Sun, 16 Sep 90 23:30:04 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>


The function mc881_abort() in the RT kernel can enter an infinite loop.  Since
this function is run at raised priority in kernel mode, this hangs the
machine.

The fix is to put a timeout in the first loop in this function:

    if (ior(IOIM2+IOIM_CPS)&IOIM_CPS_68881_BUSY) {	/* If the 881 is busy */
	do {
	    i = MC_CIR_READ_16(MC_CIR_RESPONSE);
	} while ((i&MC_RESPONSE_CA)
		&& ((i&MC_RESPONSE_NULL_MASK) == MC_RESPONSE_NULL_VALUE));
    }

should read something like:

    if (ior(IOIM2+IOIM_CPS)&IOIM_CPS_68881_BUSY) {	/* If the 881 is busy */
	int j = 1000000;
	do {
	    i = MC_CIR_READ_16(MC_CIR_RESPONSE);
	} while ((i&MC_RESPONSE_CA)
		&& ((i&MC_RESPONSE_NULL_MASK) == MC_RESPONSE_NULL_VALUE)
		&& j-- > 0);
	if(j == 0) panic("mc881_abort timeout");
    }

I don't know if the panic is needed or if it is safe to continue.

I will attempt to demonstrate this to anyone who is interested (but not on my
machine).  It can be done from an unprivileged user mode program.


home help back first fref pref prev next nref lref last post