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
This commit is contained in:
Tycho Nightingale 2020-10-13 18:28:48 +00:00
parent 47e2650ea4
commit 42360f5c5b

View File

@ -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)