svn commit: r224356 - stable/8/sys/sparc64/include

Marius Strobl marius at FreeBSD.org
Mon Jul 25 18:17:11 UTC 2011


Author: marius
Date: Mon Jul 25 18:17:11 2011
New Revision: 224356
URL: http://svn.freebsd.org/changeset/base/224356

Log:
  MFC: r223126 (partial)
  
  Don't include curcpu in the mask which is used as the IPI cookie as we
  have to ignore it when sending the IPI anyway. Actually I can't think of
  a good reason why this ever was done that way in the first place as it's
  not even usefull for debugging.

Modified:
  stable/8/sys/sparc64/include/smp.h

Modified: stable/8/sys/sparc64/include/smp.h
==============================================================================
--- stable/8/sys/sparc64/include/smp.h	Mon Jul 25 17:56:06 2011	(r224355)
+++ stable/8/sys/sparc64/include/smp.h	Mon Jul 25 18:17:11 2011	(r224356)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2001 Jake Burkholder.
+ * Copyright (c) 2007 - 2011 Marius Strobl <marius at FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -164,9 +165,9 @@ ipi_dcache_page_inval(void *func, vm_pad
 	sched_pin();
 	ica = &ipi_cache_args;
 	mtx_lock_spin(&ipi_mtx);
-	ica->ica_mask = all_cpus;
+	ica->ica_mask = PCPU_GET(other_cpus);
 	ica->ica_pa = pa;
-	cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica);
+	cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica);
 	return (&ica->ica_mask);
 }
 
@@ -180,9 +181,9 @@ ipi_icache_page_inval(void *func, vm_pad
 	sched_pin();
 	ica = &ipi_cache_args;
 	mtx_lock_spin(&ipi_mtx);
-	ica->ica_mask = all_cpus;
+	ica->ica_mask = PCPU_GET(other_cpus);
 	ica->ica_pa = pa;
-	cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica);
+	cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica);
 	return (&ica->ica_mask);
 }
 
@@ -196,7 +197,7 @@ ipi_rd(u_int cpu, void *func, u_long *va
 	sched_pin();
 	ira = &ipi_rd_args;
 	mtx_lock_spin(&ipi_mtx);
-	ira->ira_mask = 1 << cpu | PCPU_GET(cpumask);
+	ira->ira_mask = 1 << cpu;
 	ira->ira_val = val;
 	cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira);
 	return (&ira->ira_mask);
@@ -217,7 +218,7 @@ ipi_tlb_context_demap(struct pmap *pm)
 	}
 	ita = &ipi_tlb_args;
 	mtx_lock_spin(&ipi_mtx);
-	ita->ita_mask = cpus | PCPU_GET(cpumask);
+	ita->ita_mask = cpus;
 	ita->ita_pmap = pm;
 	cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap,
 	    (u_long)ita);
@@ -239,7 +240,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o
 	}
 	ita = &ipi_tlb_args;
 	mtx_lock_spin(&ipi_mtx);
-	ita->ita_mask = cpus | PCPU_GET(cpumask);
+	ita->ita_mask = cpus;
 	ita->ita_pmap = pm;
 	ita->ita_va = va;
 	cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita);
@@ -261,7 +262,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_
 	}
 	ita = &ipi_tlb_args;
 	mtx_lock_spin(&ipi_mtx);
-	ita->ita_mask = cpus | PCPU_GET(cpumask);
+	ita->ita_mask = cpus;
 	ita->ita_pmap = pm;
 	ita->ita_start = start;
 	ita->ita_end = end;
@@ -276,7 +277,6 @@ ipi_wait(void *cookie)
 	volatile cpumask_t *mask;
 
 	if ((mask = cookie) != NULL) {
-		atomic_clear_int(mask, PCPU_GET(cpumask));
 		while (*mask != 0)
 			;
 		mtx_unlock_spin(&ipi_mtx);


More information about the svn-src-stable-8 mailing list