PERFORCE change 136430 for review

Randall R. Stewart rrs at FreeBSD.org
Fri Feb 29 19:47:48 UTC 2008


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

Change 136430 by rrs at rrs-mips2-jnpr on 2008/02/28 13:57:41

	Fix for pmap.c (and also some more debug available). Note
	       still need to find out who is setting P_G on pte entries
	       in non kernel map.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/mips/pmap.c#24 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/mips/mips/pmap.c#24 (text+ko) ====

@@ -618,7 +618,6 @@
 		return;
 	}
 	va = pmap_va_asid(pmap, va);
-
 	MachTLBUpdate(va, pte);
 }
 
@@ -1823,8 +1822,16 @@
 	if (wired)
 		newpte |= PG_W;
 
-	if (is_kernel_pmap(pmap))
-		newpte |= PG_G;
+	if (is_kernel_pmap(pmap)) {
+	         newpte |= PG_G;
+	} else {
+ 	        /* non kernel  map should
+		 * should never have the PG_G
+		 * bit on. FIX, need to find out
+		 * who is turning it on in callers.
+		 */
+	         newpte &= (~PG_G);
+	}
 
 	/*
 	 * if the mapping or permission bits are different, we need to
@@ -2861,8 +2868,9 @@
 	return addr;
 }
 
+int pmap_pid_dump(int pid);
 
-#if defined(PMAP_DEBUG)
+int
 pmap_pid_dump(int pid)
 {
 	pmap_t pmap;
@@ -2878,6 +2886,8 @@
 		if (p->p_vmspace) {
 			int i, j;
 
+			printf("vmspace is %p\n",
+			       p->p_vmspace);
 			index = 0;
 			pmap = vmspace_pmap(p->p_vmspace);
 			for (i = 0; i < NUSERPGTBLS; i++) {
@@ -2915,13 +2925,15 @@
 					}
 				}
 			}
+		} else {
+		  printf("Process pid:%d has no vm_space\n", pid);
 		}
+		break;
 	}
 	sx_sunlock(&allproc_lock);
 	return npte;
 }
 
-#endif
 
 #if defined(DEBUG)
 
@@ -3096,9 +3108,9 @@
 	while (tlbno <= last) {
 		MachTLBRead(tlbno, &tlb);
 		if (tlb.tlb_lo0 & PG_V || tlb.tlb_lo1 & PG_V) {
-			printf("TLB %2d vad 0x%08x ", tlbno, tlb.tlb_hi);
+			printf("TLB %2d vad 0x%08x ", tlbno, (tlb.tlb_hi & 0xffffff00));
 		} else {
-			printf("TLB*%2d vad 0x%08x ", tlbno, tlb.tlb_hi);
+			printf("TLB*%2d vad 0x%08x ", tlbno, (tlb.tlb_hi & 0xffffff00));
 		}
 		printf("0=0x%08x ", pfn_to_vad(tlb.tlb_lo0));
 		printf("%c", tlb.tlb_lo0 & PG_M ? 'M' : ' ');
@@ -3108,8 +3120,9 @@
 		printf("%c", tlb.tlb_lo1 & PG_M ? 'M' : ' ');
 		printf("%c", tlb.tlb_lo1 & PG_G ? 'G' : ' ');
 		printf(" atr %x ", (tlb.tlb_lo1 >> 3) & 7);
-		printf(" sz=%x\n", tlb.tlb_mask);
-
+		printf(" sz=%x pid=%x\n", tlb.tlb_mask,
+		       (tlb.tlb_hi & 0x000000ff)
+		       );
 		tlbno++;
 	}
 }


More information about the p4-projects mailing list