PERFORCE change 96342 for review

Kip Macy kmacy at FreeBSD.org
Sat Apr 29 02:02:51 UTC 2006


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

Change 96342 by kmacy at kmacy_storage:sun4v_rwbuf on 2006/04/29 02:01:49

	handle alignment trap
	fix page mask generation in upgrade_demap
	do a series of putchars when we hit a condition we can't handle

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#43 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#43 (text+ko) ====

@@ -65,6 +65,10 @@
 
 #define PCB_REG %g6
 
+#define PUTCHAR(x) \
+	mov	x, %o0		; \
+	mov	CONS_WRITE, %o5	; \
+	ta	FAST_TRAP
 /*
  * Atomically set the reference bit in a tte.
  */
@@ -236,17 +240,12 @@
 	.endr
 	.endm
 
-
-	.macro	tl1_split
-	call	kdb_backtrace
-	.endm
-
 	.macro	tl1_setup	type
-	tl1_split
-	clr	%o1
-	set	trap, %o2
+	rdpr	%tt, %g3
+	sub	%g0, 1, %g4
+	set	trap, %g1
 	ba	%xcc, tl1_trap
-	 mov	\type | T_KERNEL, %o0
+	  mov	\type, %g2
 	.endm
 
 	.macro	tl1_gen		type
@@ -311,15 +310,12 @@
 	.endm
 
 	.macro	tl0_align
-	tl0_gen	T_RESERVED
-#if 0
 	GET_MMFSA_SCRATCH(%g1)		
 	mov	MMFSA_D_ADDR, %g3
 	mov	MMFSA_D_CTX,  %g7
 	ldxa	[%g1 + %g3]ASI_REAL, %g5
-	ba,pt	%xcc, tsb_miss_handler
-	  mov   T_DATA_PROTECTION, %g3
-#endif
+	ba,pt	%xcc, tl0_trap
+	  mov   T_MEM_ADDRESS_NOT_ALIGNED, %g3
 	.align	32
 	.endm
 	
@@ -1517,7 +1513,9 @@
 	cmp	%g2, %g4
 	bne,pt	%xcc, 10f
 	  nop
-	call	kdb_backtrace
+	PUTCHAR(0x5a)
+	PUTCHAR(0x5a)
+	PUTCHAR(0x5a)
 	MAGIC_TRAP_ON;MAGIC_TRAP_ON;MAGIC_EXIT	! die if all we're doing 
 						! is storing same data
 10:
@@ -1527,16 +1525,16 @@
 	stxa	%g4, [%g2]ASI_REAL			! store tag
 	stxa	%g5, [%g2 + %g7]ASI_REAL		! store data
 
-	! XXX the following intstruction should be replaced with a
-	! retry on HVs that do auto-demap
-ontario_demap_errata_patch:
+upgrade_demap:	
+	MAGIC_TRAP_ON
 	rdpr	%tt, %g5
 	cmp	%g5, T_DATA_PROTECTION
 	beq,pn	%xcc, demap_begin
 	  nop
+	MAGIC_TRAP_OFF
 	retry
 demap_begin:
-	sethi	%hi(PAGE_MASK), %g1
+	sethi	%hi(PAGE_SIZE), %g1
 	sub	%g1, 1, %g1		
 	and	%g6, %g1, %g2
 	andn	%g6, %g1, %g3
@@ -1550,6 +1548,7 @@
 	mov	%g5, %o0
 	mov	%g6, %o1
 	mov	%g7, %o2
+	MAGIC_TRAP_OFF
 	retry
 END(tsb_miss_handler)
 
@@ -1572,7 +1571,9 @@
  * Programming error
  */
 ENTRY(unsupported_fault_trap)
-	call kdb_backtrace	
+	PUTCHAR(0x5b)
+	PUTCHAR(0x5b)
+	PUTCHAR(0x5b)
 	MAGIC_TRAP_ON;MAGIC_TRAP_ON;MAGIC_EXIT
 END(unsupported_fault_trap)
 


More information about the p4-projects mailing list