From 42360f5c5b575b3f4098110fc8dfd2f4d11b6481 Mon Sep 17 00:00:00 2001 From: Tycho Nightingale Date: Tue, 13 Oct 2020 18:28:48 +0000 Subject: [PATCH] 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 --- sys/amd64/amd64/mp_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 308f2fc2a29..fb6a1227817 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)