PERFORCE change 98101 for review

Kip Macy kmacy at FreeBSD.org
Mon May 29 14:57:41 PDT 2006


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

Change 98101 by kmacy at kmacy_storage:sun4v_work on 2006/05/29 21:56:06

	don't send shootdowns to cpus we don't own

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#60 edit

Differences ...

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

@@ -1144,7 +1144,7 @@
 
 	int i, cpu_count;
 	u_int cpus;
-	cpumask_t cpumask, active;
+	cpumask_t cpumask, active, curactive;
 	cpumask_t active_total, ackmask;
 	uint16_t *cpulist;
 
@@ -1154,7 +1154,8 @@
 
 	cpumask = PCPU_GET(cpumask);
 	cpulist = PCPU_GET(cpulist);
-	
+	curactive = 0;
+
 	if (rdpr(pil) != 14)
 		panic("pil %ld != 14", rdpr(pil));
 
@@ -1175,14 +1176,16 @@
 #endif
 		active_total = active = PCPU_GET(other_cpus);
 
-	if (active_total == 0)
+	if (active == 0)
 		goto done;
+	
  retry:
 	
-	for (cpu_count = 0, i = 0, cpus = active; i < 32 && cpus; i++, cpus = (cpus>>1)) {
+	for (i = curactive = cpu_count = 0, cpus = active; i < mp_ncpus && cpus; i++, cpus = (cpus>>1)) {
 		if ((cpus & 0x1) == 0)
 			continue;
-
+		
+		curactive |= (1 << i);
 		cpulist[cpu_count] = (uint16_t)i;
 		cpu_count++;
 	}
@@ -1191,15 +1194,15 @@
 	cpu_ipi_selected(cpu_count, cpulist, (uint64_t)func, (uint64_t)arg1, 
 			 (uint64_t)arg2, (uint64_t *)&ackmask);
 
-	while (ackmask != active) {
+	while (ackmask != curactive) {
 		DELAY(1);
 		i++;
-		if (i > 1000000) 
-			panic(" ackmask=0x%x active=0x%x\n", ackmask, active);
+		if (i > 100000000) 
+			panic(" ackmask=0x%x active=0x%x\n", ackmask, curactive);
 
 	}
 
-	active_total |= active;
+	active_total |= curactive;
 	if ((active = (pmap->pm_tlbactive & ~(active_total|cpumask))) != 0) 
 		goto retry;
 


More information about the p4-projects mailing list