From owner-svn-src-head@freebsd.org Wed Aug 12 09:43:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 949A499EA58; Wed, 12 Aug 2015 09:43:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85157802; Wed, 12 Aug 2015 09:43:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7C9hDKm051750; Wed, 12 Aug 2015 09:43:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7C9hDMj051748; Wed, 12 Aug 2015 09:43:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508120943.t7C9hDMj051748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Aug 2015 09:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286657 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2015 09:43:13 -0000 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 */