PERFORCE change 93690 for review

Kip Macy kmacy at FreeBSD.org
Tue Mar 21 05:21:27 UTC 2006


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

Change 93690 by kmacy at kmacy_storage:sun4vtmp on 2006/03/21 05:20:52

	track pcb's real address

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sparc64/sparc64/genassym.c#14 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/swtch.S#14 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sparc64/sparc64/genassym.c#14 (text+ko) ====

@@ -219,6 +219,9 @@
 ASSYM(PC_KWBUF_SP, offsetof(struct pcpu, pc_kwbuf_sp));
 ASSYM(PC_KWBUF, offsetof(struct pcpu, pc_kwbuf));
 ASSYM(PC_PMAP, offsetof(struct pcpu, pc_curpmap));
+ASSYM(PC_CURPCB_RA, offsetof(struct pcpu, pc_curpcb_ra));
+
+ASSYM(PCB_RA, offsetof(struct pcb, pcb_ra));
 #else
 ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx));
 ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max));
@@ -286,6 +289,10 @@
 ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
 ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
 ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
+
+
+
+
 ASSYM(PCB_FEF, PCB_FEF);
 
 ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));

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

@@ -49,6 +49,25 @@
 	 mov	%i1, %i0
 END(cpu_throw)
 
+
+ENTRY(pcb_ra_miss)
+       call    pmap_kextract
+          mov   PCB_REG, %o0
+        mov     %o0, %l0
+#ifdef DEBUG
+       ! sanity check lookup
+       brnz    %o0, 1f
+         nop
+       MAGIC_TRAP_ON
+       MAGIC_EXIT
+1:              
+#endif
+       ba,pt   %xcc, pcb_ra_uptodate 
+         stx   %l0, [PCB_REG + PCB_RA]
+END(pcb_ra_miss)	
+	
+	
+	
 /*
  * void cpu_switch(struct thread *old, struct thread *new)
  */
@@ -102,7 +121,7 @@
 	 * the current thread and pcb.
 	 */
 .Lsw1:
-#if KTR_COMPILE & KTR_PROC
+#if KTR_COMPILE & KTR_PROC & 0
 	CATR(KTR_PROC, "cpu_switch: new td=%p pc=%#lx fp=%#lx"
 	    , %g1, %g2, %g3, 7, 8, 9)
 	stx	%i0, [%g1 + KTR_PARM1]
@@ -128,19 +147,24 @@
 	 */
 	ldx	[PCB_REG + PCB_SP], %fp
 	ldx	[PCB_REG + PCB_PC], %i7
+	ldx	[PCB_REG + PCB_RA], %l0
 	sub	%fp, CCFSZ, %sp
 
-
+	brz	%l0, pcb_ra_miss
+	  nop
+pcb_ra_uptodate:	
+		
 	/*
 	 * Point to the pmaps of the new process, and of the last non-kernel
 	 * process to run.
 	 */
+	stx	%l0, [PCPU(CURPCB_RA)]
 	ldx	[%i0 + TD_PROC], %i2
 	ldx	[PCPU(PMAP)], %l2
 	ldx	[%i2 + P_VMSPACE], %i5
 	add	%i5, VM_PMAP, %i2
 
-#if KTR_COMPILE & KTR_PROC
+#if KTR_COMPILE & KTR_PROC & 0
 	CATR(KTR_PROC, "cpu_switch: new pmap=%p old pmap=%p"
 	    , %g1, %g2, %g3, 7, 8, 9)
 	stx	%i2, [%g1 + KTR_PARM1]


More information about the p4-projects mailing list