Subject: MIPS cpu_fork() runs kthreads at splhigh()
To: None <port-mips@netbsd.org>
From: Rafal Boni <rafal.boni@eDial.com>
List: port-mips
Date: 04/23/2001 13:54:50
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Content-Type: text/plain; charset=us-ascii

Folks:
	From my quick peek at the MIPS cpu_fork() code, it looks like it
	suffers from the same problems the Alpha and i386 cpu_fork()s did,
	namely that it runs all kthreads at splhigh().

	Attached is a patch that I believe should fix this.

Index: vm_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mips/mips/vm_machdep.c,v
retrieving revision 1.73
diff -b -u -r1.73 vm_machdep.c
- --- vm_machdep.c	2001/03/28 18:03:49	1.73
+++ vm_machdep.c	2001/04/23 17:51:26
@@ -60,6 +60,7 @@
 #include <mips/regnum.h>
 #include <mips/locore.h>
 #include <mips/pte.h>
+#include <mips/psl.h>
 #include <machine/cpu.h>
 
 #include "opt_ddb.h"
@@ -145,6 +146,7 @@
 	pcb->pcb_context[8] = (int)f - 24;		/* SP */
 	pcb->pcb_context[0] = (int)func;		/* S0 */
 	pcb->pcb_context[1] = (int)arg;			/* S1 */
+	pcb->pcb_context[11] = PSL_LOWIPL;		/* SR */
 }
 
 /*

Comments?
- --rafal

- ----
Rafal Boni                                               rafal.boni@eDial.com
 PGP key C7D3024C, print EA49 160D F5E4 C46A 9E91  524E 11E0 7133 C7D3 024C
    Need to get a hold of me?  http://800.eDial.com/rafal.boni@eDial.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: Exmh version 2.1.1 10/15/1999

iD8DBQE65GxqEeBxM8fTAkwRAk+JAKC6YpJ99Sxk2KMpxhXuVG2G0HPKHACePhpY
5I/ywuZvRshbDtQEhqDmKBM=
=uo1e
-----END PGP SIGNATURE-----