svn commit: r286657 - in head/sys: amd64/amd64 i386/i386

Konstantin Belousov kib at FreeBSD.org
Wed Aug 12 09:43:13 UTC 2015


Author: kib
Date: Wed Aug 12 09:43:12 2015
New Revision: 286657
URL: https://svnweb.freebsd.org/changeset/base/286657

Log:
  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

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

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Wed Aug 12 08:41:48 2015	(r286656)
+++ head/sys/amd64/amd64/mp_machdep.c	Wed Aug 12 09:43:12 2015	(r286657)
@@ -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();

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c	Wed Aug 12 08:41:48 2015	(r286656)
+++ head/sys/i386/i386/mp_machdep.c	Wed Aug 12 09:43:12 2015	(r286657)
@@ -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 */


More information about the svn-src-head mailing list