svn commit: r366678 - head/sys/amd64/amd64

Tycho Nightingale tychon at FreeBSD.org
Tue Oct 13 18:28:49 UTC 2020


Author: tychon
Date: Tue Oct 13 18:28:48 2020
New Revision: 366678
URL: https://svnweb.freebsd.org/changeset/base/366678

Log:
  eliminate possible race in parallel TLB shootdown IPI
  
  On the target side TLB shootdown IPI handler, prevent the compiler
  from performing a forward store optimization which may mask a
  subsequent update to the scoreboard by the initiator.
  
  Reported by:	Max Laier, Anton Rang
  Discussed with:	kib
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/amd64/amd64/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Tue Oct 13 18:04:19 2020	(r366677)
+++ head/sys/amd64/amd64/mp_machdep.c	Tue Oct 13 18:28:48 2020	(r366678)
@@ -1094,7 +1094,7 @@ invlop_handler(void)
 	for (;;) {
 		for (initiator_cpu_id = 0; initiator_cpu_id <= mp_maxid;
 		    initiator_cpu_id++) {
-			if (scoreboard[initiator_cpu_id] == 0)
+			if (atomic_load_int(&scoreboard[initiator_cpu_id]) == 0)
 				break;
 		}
 		if (initiator_cpu_id > mp_maxid)


More information about the svn-src-head mailing list