summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-08-12 09:43:12 +0000
committerkib <kib@FreeBSD.org>2015-08-12 09:43:12 +0000
commitbff0ec5bef3ded3c67c6216c640936ddc7ecc6cc (patch)
tree3ba70608cf6f80a0055a84464c4fdc84661a9d2e /sys
parentaa4ad58f86b7a49c39a2491f4738a26a72687ef6 (diff)
downloadFreeBSD-src-bff0ec5bef3ded3c67c6216c640936ddc7ecc6cc.zip
FreeBSD-src-bff0ec5bef3ded3c67c6216c640936ddc7ecc6cc.tar.gz
AP should load aps_ready with acquire semantic to see BSP updates to
the SMP structures, synchronized with the load by release store in release_aps(). The change is formal, x86 strong memory model implicitely provided the guarantees. Discussed with: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/mp_machdep.c2
-rw-r--r--sys/i386/i386/mp_machdep.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 0562ca4..3c0a923 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -282,7 +282,7 @@ init_secondary(void)
mp_naps++;
/* Spin until the BSP releases the AP's. */
- while (!aps_ready)
+ while (atomic_load_acq_int(&aps_ready) == 0)
ia32_pause();
init_secondary_tail();
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 4812cb0..93845ef 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -291,7 +291,7 @@ init_secondary(void)
CHECK_WRITE(0x39, 6);
/* Spin until the BSP releases the AP's. */
- while (!aps_ready)
+ while (atomic_load_acq_int(&aps_ready) == 0)
ia32_pause();
/* BSP may have changed PTD while we were waiting */
OpenPOWER on IntegriCloud