Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2006 05:02:41 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 93432 for review
Message-ID:  <200603170502.k2H52fke043597@repoman.freebsd.org>

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

Change 93432 by kmacy@kmacy_storage:sun4v_work on 2006/03/17 05:02:34

	handle additional tl1 register spill/fill trap
	turn timer on
	include opt_simulator.h is hypervisorvar.h

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/hypervisorvar.h#4 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#32 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/machdep.c#11 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/wbuf.S#5 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/hypervisorvar.h#4 (text+ko) ====

@@ -287,7 +287,7 @@
 #define	HVIO_FIRE_PERFREG_PCIE_LNK_CNT1	14
 #define	HVIO_FIRE_PERFREG_PCIE_LNK_CNT2	15
 
-
+#include "opt_simulator.h"
 
 #ifdef SIMULATOR
 #define MAGIC_TRAP_ON	ta	0x77

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

@@ -50,19 +50,9 @@
 #include <machine/mmu.h>
 
 #define PMAP_DEBUG
-#if 1
-#define SPILL_FILL_MAGIC_TRAP_ON	nop
-#define SPILL_FILL_MAGIC_TRAP_OFF	nop
-#define MAGIC_TRAP_ON	ta	0x77
-#define MAGIC_TRAP_OFF	ta	0x78
-#define MAGIC_EXIT	ta	0x71
-/*#define MAGIC_TRAP_OFF	nop */ 
-#else
+
 #define SPILL_FILL_MAGIC_TRAP_ON	nop
 #define SPILL_FILL_MAGIC_TRAP_OFF	nop
-#define MAGIC_TRAP_ON	nop
-#define MAGIC_TRAP_OFF	nop
-#endif
 
 #define REGSIZE         8
 
@@ -503,8 +493,6 @@
 	.endm
 
 	.macro	spill_64bit_tt1_secondary_so1
-	MAGIC_TRAP_ON
-	MAGIC_EXIT
 	ba,a,pt %xcc, fault_64bit_so1
 	  nop
 	.align 128
@@ -531,13 +519,13 @@
 	.endm		
 		
 	.macro	tl0_pil_entry level, mask
-#if 0
+#if 1
 	set	\mask, %g1
 	clr	%g2
 	clr	%g3
 	ba	%xcc, tl0_intr
 	  mov	\level, %g4
-#endif
+#else
 	mov	1, %g2
 	sllx	%g2, \level, %g1
 	sllx	%g2, 16, %g3
@@ -545,6 +533,7 @@
 	or	%g2, %g3, %g2
 	wr	%g2, %g0, %clear_softint
 	retry
+#endif
 	.align	32
 	.endm
 

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/machdep.c#11 (text+ko) ====

@@ -419,7 +419,6 @@
 	 * Initialize the message buffer (after setting trap table).
 	 */
 
-	printf("msgbuf_init\n");
 	msgbufinit(msgbufp, MSGBUF_SIZE);
 
 	mutex_init();
@@ -516,6 +515,8 @@
 #ifdef notyet
 	sf.sf_si.si_addr = (void *)tf->tf_sfar; /* XXX */
 #else
+	printf("sendsig %d to %s\n", sig, p->p_comm);
+	hv_magic_trap_on();
 	__asm __volatile("ta 0x71");
 #endif
 	/* Copy the sigframe out to the user's stack. */

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

@@ -81,8 +81,23 @@
 END(fault_64bit_so0)
 
 ENTRY(fault_64bit_so1)
-	MAGIC_TRAP_ON	
-	MAGIC_EXIT	
+	/* XXX need to use physical addresses */
+	GET_PCB(%g6)
+	ld	[%g6 + PCB_NSAVED], %g2
+	add	%g2, 1, %g3
+	stx	%g3, [%g6 + PCB_NSAVED]
+
+	sll	%g2, PTR_SHIFT, %g4
+	add	%g6, PCB_RWSP, %g3
+	stx	%sp, [%g3 + %g4]
+	sll	%g2, RW_SHIFT, %g4
+	add	%g4, %g6, %g4
+	add	%g4, PCB_RW, %g3
+	SAVE_WINDOW(%g3)
+	saved
+	set	tl0_trap, %g5
+	wrpr	%g5, %tnpc
+	done
 END(fault_64bit_so1)
 
 ENTRY(fault_32bit_fn0)



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