PERFORCE change 110621 for review

Oleksandr Tymoshenko gonzo at FreeBSD.org
Tue Nov 28 07:31:59 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=110621

Change 110621 by gonzo at gonzo_hq on 2006/11/28 15:31:06

	o Use top of md_realstack area as kernelland stack pointer
	o Check for user mode in TLBMiss vector to jump to proper 
	    generic exception.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/exception.S#15 edit

Differences ...

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

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/mips2/src/sys/mips/mips/exception.S#14 $
+ * $P4: //depot/projects/mips2/src/sys/mips/mips/exception.S#15 $
  */
 
 /*	$NetBSD: mipsX_subr.S,v 1.19 2005/12/11 12:18:09 christos Exp $	*/
@@ -268,6 +268,21 @@
 1:	.asciiz "ExceptionHandlerTable"
 	.text
 
+
+/* 
+ * This label should be right before GenericException to fall through
+ * the KSU_USER check
+ */
+slowfault:
+	.set	noat
+	mfc0	k0, MIPS_COP_0_STATUS
+	nop
+	and	k0, k0, MIPS_SR_KSU_USER
+	bne	k0, zero, _C_LABEL(UserGenericException)
+	nop
+	/* fall through to GenericEception */
+	.set	at
+
 LEAF(GenericException)
 	.set noat
 
@@ -437,7 +452,7 @@
 	eret
 
 tlbnotfound:
-	break
+	break ## TODO: change to panic call
 	eret
 VEND(TLBInvalidVector)
 	.data
@@ -464,9 +479,9 @@
 	lw	k1, 0(k1)
 
 	mfc0	k0, MIPS_COP_0_BAD_VADDR        # k0=bad address (again)
+	nop
 	beq	k1, zero, 7f                    # ==0 -- no page table
 	srl	k0, 10                          # k0=VPN (aka va>>10)
-	nop
 
 	andi	k0, k0, 0xff8			# k0=page tab offset
 	addu	k1, k1, k0			# k1=pte address
@@ -485,7 +500,9 @@
 5:
 	j	KVATLBMiss
 	nop
-7:	j	UserGenericException
+7:	
+	/* Use one jump instead of full check to reduce vector code size */
+	j	slowfault
 	nop
 
 VEND(TLBMissVector)
@@ -576,7 +593,6 @@
 1:	.asciiz "64-bit TLB Miss Vector"
 	.text
 
-
 LEAF(VCED)
 	.set noat
 	la	k0, panic
@@ -612,7 +628,7 @@
 	.mask	0x80000000, -4
 	lw	k1, pcpup
 	lw	k1, PC_CURTHREAD(k1)
-	lw	k1, TD_MD_REALSTACK(k1)		# load wired region 
+	lw	k1, TD_FRAME(k1)		# load td_frame in wired region 
 	la	k0, 1f
 	j	exception_save_registers
 	nop
@@ -678,7 +694,7 @@
 	.mask	0x80000000, -4
 	lw	k1, pcpup
 	lw	k1, PC_CURTHREAD(k1)
-	lw	k1, TD_MD_REALSTACK(k1)		# load wired region 
+	lw	k1, TD_FRAME(k1)		# load wired region 
 	la	k0, 1f
 	j	exception_save_registers
 	nop


More information about the p4-projects mailing list