From owner-svn-src-head@freebsd.org Fri Jul 6 10:13:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BFA91039A00; Fri, 6 Jul 2018 10:13:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00DE677BA3; Fri, 6 Jul 2018 10:13:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D719F27396; Fri, 6 Jul 2018 10:13:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66ADgXd087548; Fri, 6 Jul 2018 10:13:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66ADgbJ087546; Fri, 6 Jul 2018 10:13:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201807061013.w66ADgbJ087546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 6 Jul 2018 10:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336025 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 336025 X-SVN-Commit-Repository: base 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.27 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: Fri, 06 Jul 2018 10:13:43 -0000 Author: hselasky Date: Fri Jul 6 10:13:42 2018 New Revision: 336025 URL: https://svnweb.freebsd.org/changeset/base/336025 Log: Make sure kernel modules built by default are portable between UP and SMP systems by extending defined(SMP) to include defined(KLD_MODULE). This is a regression issue after r335873 . Discussed with: mmacy@ Sponsored by: Mellanox Technologies Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 (r336024) +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 (r336025) @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_ * For userland, always use lock prefixes so that the binaries will run * on both SMP and !SMP systems. */ -#if defined(SMP) || !defined(_KERNEL) +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) #define MPLOCKED "lock ; " #else #define MPLOCKED @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int v) */ #define OFFSETOF_MONITORBUF 0x100 -#if defined(SMP) +#if defined(SMP) || defined(KLD_MODULE) static __inline void __storeload_barrier(void) { Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 (r336024) +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 (r336025) @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile uint64_t *, uint64_t * For userland, always use lock prefixes so that the binaries will run * on both SMP and !SMP systems. */ -#if defined(SMP) || !defined(_KERNEL) +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) #define MPLOCKED "lock ; " #else #define MPLOCKED @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) */ #if defined(_KERNEL) -#if defined(SMP) +#if defined(SMP) || defined(KLD_MODULE) #define __storeload_barrier() __mbk() #else /* _KERNEL && UP */ #define __storeload_barrier() __compiler_membar()