Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Feb 2008 21:34:14 GMT
From:      "Randall R. Stewart" <rrs@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 136520 for review
Message-ID:  <200802292134.m1TLYEeo009298@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=136520

Change 136520 by rrs@rrs-mips2-jnpr on 2008/02/29 21:33:45

	Assure when we go to user mode the SX/UX and KX bits are off.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/mips/exception.S#17 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/mips/mips/exception.S#17 (text+ko) ====

@@ -512,8 +512,6 @@
 	mtlo	t0
 	mthi	t1
 	RESTORE_U_PCB_REG(a0, PC, k1)
-	.set noat
-	RESTORE_U_PCB_REG(AT, AST, k1)
 	RESTORE_U_PCB_REG(v0, V0, k1)
         _MTC0	a0, COP_0_EXC_PC	# set return address
 	RESTORE_U_PCB_REG(v1, V1, k1)
@@ -544,6 +542,13 @@
 	RESTORE_U_PCB_REG(k0, SR, k1)
 	RESTORE_U_PCB_REG(s8, S8, k1)
 	RESTORE_U_PCB_REG(ra, RA, k1)
+#ifdef TARGET_OCTEON
+	and k0, k0, ~(MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX)
+	or  k0, k0, MIPS_SR_INT_IE
+#endif
+	.set noat
+	RESTORE_U_PCB_REG(AT, AST, k1)
+
 /*
  * The restoration of the user SR must be done only after
  * k1 is no longer needed.  Otherwise, k1 will get clobbered after
@@ -630,6 +635,7 @@
 	GET_CPU_PCPU(k1)
 	lw	k1, PC_CURPCB(k1)
 	SAVE_U_PCB_REG(AT, AST, k1)
+	.set	at
 	SAVE_U_PCB_REG(v0, V0, k1)
 	SAVE_U_PCB_REG(v1, V1, k1)
 	SAVE_U_PCB_REG(a0, A0, k1)
@@ -676,7 +682,6 @@
 	la	gp, _C_LABEL(_gp)	# switch to kernel GP
 
 # Turn off fpu, disable interrupts, set kernel mode kernel mode, clear exception level.
-	.set	at
 	and	t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_INT_ENAB | SR_KSU_MASK)
 	mtc0	t0, COP_0_STATUS_REG
 	ITLBNOPFIX
@@ -738,9 +743,6 @@
  */
 	move	k1, a1
 
-	.set	noat
-
-	RESTORE_U_PCB_REG(AT, AST, k1)
 	RESTORE_U_PCB_REG(v0, V0, k1)
 	RESTORE_U_PCB_REG(v1, V1, k1)
 	RESTORE_U_PCB_REG(a0, A0, k1)
@@ -761,6 +763,12 @@
 	RESTORE_U_PCB_REG(k0, SR, k1)
 	RESTORE_U_PCB_REG(sp, SP, k1)
 	RESTORE_U_PCB_REG(ra, RA, k1)
+#ifdef TARGET_OCTEON
+	and k0, k0, ~(MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX)
+	or  k0, k0, MIPS_SR_INT_IE
+#endif
+	.set	noat
+	RESTORE_U_PCB_REG(AT, AST, k1)
 
 /*
  * The restoration of the user SR must be done only after



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802292134.m1TLYEeo009298>