aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTycho Nightingale <tychon@FreeBSD.org>2020-10-13 18:28:48 +0000
committerTycho Nightingale <tychon@FreeBSD.org>2020-10-13 18:28:48 +0000
commit42360f5c5b575b3f4098110fc8dfd2f4d11b6481 (patch)
treed10770ec509e709c49ed220353ff1cf0a40c0042
parent47e2650ea4ff1d7d603b6b1c53b8cb6789532210 (diff)
downloadsrc-42360f5c5b575b3f4098110fc8dfd2f4d11b6481.tar.gz
src-42360f5c5b575b3f4098110fc8dfd2f4d11b6481.zip
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
Notes
Notes: svn path=/head/; revision=366678
-rw-r--r--sys/amd64/amd64/mp_machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 308f2fc2a292..fb6a12278177 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -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)