From owner-svn-src-head@freebsd.org Sun May 29 00:10:25 2016 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 3A39AB4ED42; Sun, 29 May 2016 00:10:25 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id F053E16A7; Sun, 29 May 2016 00:10:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T0AOno060627; Sun, 29 May 2016 00:10:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T0AOYU060626; Sun, 29 May 2016 00:10:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605290010.u4T0AOYU060626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 May 2016 00:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300918 - head/share/mk 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.22 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: Sun, 29 May 2016 00:10:25 -0000 Author: bdrewery Date: Sun May 29 00:10:23 2016 New Revision: 300918 URL: https://svnweb.freebsd.org/changeset/base/300918 Log: External GCC: Ensure our libstdc++ symlink to libc++ is found. Similar to r300917, the search path for our symlink hack must come before the =/usr/lib search path. This fixes the atf-check build after r300886. Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 28 23:10:07 2016 (r300917) +++ head/share/mk/bsd.sys.mk Sun May 29 00:10:23 2016 (r300918) @@ -190,9 +190,6 @@ CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} .if ${CFLAGS:M-nostdinc} == "" CFLAGS+= -isystem =/usr/include .endif -# Add in sysroot/usr/lib to ensure that it comes before /usr/local/lib -# from ports compilers. -LDFLAGS+= -L=/usr/lib # We want to force building the system with our in-tree libc++. Note that # this also requires a symlink in OBJDIR/lib/libc++/libstdc++.so to # sysroot/usr/lib/libc++.so. @@ -205,6 +202,9 @@ CXXFLAGS+= -std=c++11 \ CXX+= -isystem =/usr/include/c++/v1 LDFLAGS+= -L${OBJTOP}/lib/libc++ .endif +# Add in sysroot/usr/lib to ensure that it comes before /usr/local/lib +# from ports compilers. +LDFLAGS+= -L=/usr/lib .endif # --sysroot .endif # X_COMPILER_TYPE == gcc From owner-svn-src-head@freebsd.org Sun May 29 00:40:30 2016 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 A6AB0B4FAAF; Sun, 29 May 2016 00:40:30 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 5B2181DCB; Sun, 29 May 2016 00:40:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T0eTkD071867; Sun, 29 May 2016 00:40:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T0eTv7071865; Sun, 29 May 2016 00:40:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605290040.u4T0eTv7071865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 May 2016 00:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300919 - in head: cddl/usr.sbin/zfsd sys/cddl/contrib/opensolaris/uts/common/sys 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.22 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: Sun, 29 May 2016 00:40:30 -0000 Author: bdrewery Date: Sun May 29 00:40:29 2016 New Revision: 300919 URL: https://svnweb.freebsd.org/changeset/base/300919 Log: Avoid more literal-suffix errors with C++11 Modified: head/cddl/usr.sbin/zfsd/case_file.cc head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h Modified: head/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.cc Sun May 29 00:10:23 2016 (r300918) +++ head/cddl/usr.sbin/zfsd/case_file.cc Sun May 29 00:40:29 2016 (r300919) @@ -455,7 +455,7 @@ CaseFile::ActivateSpare() { zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); if (zhp == NULL) { syslog(LOG_ERR, "CaseFile::ActivateSpare: Could not find pool " - "for pool_guid %"PRIu64".", (uint64_t)m_poolGUID); + "for pool_guid %" PRIu64".", (uint64_t)m_poolGUID); return (false); } poolname = zpool_get_name(zhp); @@ -639,7 +639,7 @@ CaseFile::DeSerializeSelector(const stru uint64_t vdevGUID; if (dirEntry->d_type == DT_REG - && sscanf(dirEntry->d_name, "pool_%"PRIu64"_vdev_%"PRIu64".case", + && sscanf(dirEntry->d_name, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case", &poolGUID, &vdevGUID) == 2) return (1); return (0); @@ -657,7 +657,7 @@ CaseFile::DeSerializeFile(const char *fi uint64_t vdevGUID; nvlist_t *vdevConf; - sscanf(fileName, "pool_%"PRIu64"_vdev_%"PRIu64".case", + sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case", &poolGUID, &vdevGUID); existingCaseFile = Find(Guid(poolGUID), Guid(vdevGUID)); if (existingCaseFile != NULL) { @@ -999,7 +999,7 @@ CaseFile::Replace(const char* vdev_type, zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); if (zhp == NULL) { syslog(LOG_ERR, "CaseFile::Replace: could not find pool for " - "pool_guid %"PRIu64".", (uint64_t)m_poolGUID); + "pool_guid %" PRIu64 ".", (uint64_t)m_poolGUID); return (false); } poolname = zpool_get_name(zhp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h Sun May 29 00:10:23 2016 (r300918) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h Sun May 29 00:40:29 2016 (r300919) @@ -76,8 +76,8 @@ extern "C" { #define SUNW_VENDOR "SUNW" #define SE_USR_PUB "usr:" #define SE_KERN_PUB "kern:" -#define SUNW_KERN_PUB SUNW_VENDOR":"SE_KERN_PUB -#define SUNW_USR_PUB SUNW_VENDOR":"SE_USR_PUB +#define SUNW_KERN_PUB SUNW_VENDOR ":" SE_KERN_PUB +#define SUNW_USR_PUB SUNW_VENDOR ":" SE_USR_PUB /* * Event header and attribute value limits From owner-svn-src-head@freebsd.org Sun May 29 01:15:38 2016 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 94523B50988; Sun, 29 May 2016 01:15:38 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 5FDF21C27; Sun, 29 May 2016 01:15:38 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T1Fbb2086480; Sun, 29 May 2016 01:15:37 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T1FalQ086467; Sun, 29 May 2016 01:15:36 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605290115.u4T1FalQ086467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 29 May 2016 01:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300921 - in head: lib/libcrypt lib/libmd sbin/md5 sys/crypto/skein sys/crypto/skein/amd64 sys/modules/crypto 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.22 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: Sun, 29 May 2016 01:15:38 -0000 Author: allanjude Date: Sun May 29 01:15:36 2016 New Revision: 300921 URL: https://svnweb.freebsd.org/changeset/base/300921 Log: Import the skein hashing algorithm, based on the threefish block cipher Connect it to userland (libmd, libcrypt, sbin/md5) and kernel (crypto.ko) Support for skein as a ZFS checksum algorithm was introduced in r289422 but is disconnected because FreeBSD lacked a Skein implementation. A further commit will enable it in ZFS. Reviewed by: cem Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D6166 Added: head/lib/libmd/skein.3 (contents, props changed) head/lib/libmd/skeindriver.c (contents, props changed) head/sys/crypto/skein/ - copied from r300820, vendor-sys/skein/dist/Optimized_64bit/ head/sys/crypto/skein/amd64/ head/sys/crypto/skein/amd64/skein_block_asm.s - copied unchanged from r300822, vendor-sys/skein/dist/Additional_Implementations/skein_block_x64.s head/sys/crypto/skein/skein_freebsd.h (contents, props changed) Deleted: head/sys/crypto/skein/SHA3api_ref.c head/sys/crypto/skein/SHA3api_ref.h head/sys/crypto/skein/brg_endian.h head/sys/crypto/skein/brg_types.h Modified: head/lib/libcrypt/Makefile head/lib/libmd/Makefile head/lib/libmd/mdX.3 head/lib/libmd/ripemd.3 head/lib/libmd/sha.3 head/lib/libmd/sha256.3 head/lib/libmd/sha512.3 head/sbin/md5/Makefile head/sbin/md5/md5.c head/sys/crypto/skein/skein.c (contents, props changed) head/sys/crypto/skein/skein.h (contents, props changed) head/sys/crypto/skein/skein_block.c (contents, props changed) head/sys/crypto/skein/skein_iv.h (contents, props changed) head/sys/crypto/skein/skein_port.h (contents, props changed) head/sys/modules/crypto/Makefile Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libcrypt/Makefile Sun May 29 01:15:36 2016 (r300921) @@ -10,16 +10,25 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 5 LIB= crypt -.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 +.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 ${.CURDIR}/../../sys/crypto/skein SRCS= crypt.c misc.c \ crypt-md5.c md5c.c \ crypt-nthash.c md4c.c \ crypt-sha256.c sha256c.c \ - crypt-sha512.c sha512c.c + crypt-sha512.c sha512c.c \ + skein.c skein_block.c MAN= crypt.3 MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3 CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil \ - -I${.CURDIR}/../../sys/crypto/sha2 + -I${.CURDIR}/../../sys/crypto/sha2 -I${.CURDIR}/../../sys/crypto/skein + +# Use assembly optimized skein if available +.if exists(${MACHINE_ARCH}/skein_block_asm.s) +.PATH: ${.CURDIR}/../../sys/crypto/skein/${MACHINE_ARCH} +SRCS += skein_block_asm.s +CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +ACFLAGS += -DELF -Wa,--noexecstack +.endif # Pull in the strong crypto, if it is present. .if exists(${.CURDIR}/../../secure/lib/libcrypt) && ${MK_CRYPT} != "no" @@ -34,7 +43,10 @@ CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BL SHA512_224_Init SHA512_224_Final SHA512_224_Update \ SHA512_256_Init SHA512_256_Final SHA512_256_Update \ SHA384_Init SHA384_Final SHA384_Update \ - SHA512_Init SHA512_Final SHA512_Update + SHA512_Init SHA512_Final SHA512_Update \ + SKEIN256_Init SKEIN256_Final SKEIN256_Update \ + SKEIN512_Init SKEIN512_Final SKEIN512_Update \ + SKEIN1024_Init SKEIN1024_Final SKEIN1024_Update CFLAGS+= -D${sym}=__${sym} .endfor Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libmd/Makefile Sun May 29 01:15:36 2016 (r300921) @@ -9,12 +9,15 @@ SRCS= md4c.c md5c.c md4hl.c md5hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ sha256c.c sha256hl.c \ sha384hl.c \ - sha512c.c sha512hl.c sha512thl.c -INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h sha512t.h + sha512c.c sha512hl.c sha512thl.c \ + skein.c skein_block.c \ + skein256hl.c skein512hl.c skein1024hl.c +INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h sha512t.h \ + skein.h skein_port.h skein_freebsd.h skein_iv.h WARNS?= 0 -MAN+= md4.3 md5.3 ripemd.3 sha.3 sha256.3 sha512.3 +MAN+= md4.3 md5.3 ripemd.3 sha.3 sha256.3 sha512.3 skein.3 MLINKS+=md4.3 MD4Init.3 md4.3 MD4Update.3 md4.3 MD4Final.3 MLINKS+=md4.3 MD4End.3 md4.3 MD4File.3 md4.3 MD4FileChunk.3 MLINKS+=md4.3 MD4Data.3 @@ -47,11 +50,27 @@ MLINKS+=sha512.3 SHA512_256_Init.3 sha5 MLINKS+=sha512.3 SHA512_256_Final.3 sha512.3 SHA512_256_End.3 MLINKS+=sha512.3 SHA512_256_File.3 sha512.3 SHA512_256_FileChunk.3 MLINKS+=sha512.3 SHA512_256_Data.3 +MLINKS+=skein.3 SKEIN256_Init.3 skein.3 SKEIN256_Update.3 +MLINKS+=skein.3 SKEIN256_Final.3 skein.3 SKEIN256_End.3 +MLINKS+=skein.3 SKEIN256_File.3 skein.3 SKEIN256_FileChunk.3 +MLINKS+=skein.3 SKEIN256_Data.3 skein.3 skein256.3 +MLINKS+=skein.3 SKEIN512_Init.3 skein.3 SKEIN512_Update.3 +MLINKS+=skein.3 SKEIN512_Final.3 skein.3 SKEIN512_End.3 +MLINKS+=skein.3 SKEIN512_File.3 skein.3 SKEIN512_FileChunk.3 +MLINKS+=skein.3 SKEIN512_Data.3 skein.3 skein512.3 +MLINKS+=skein.3 SKEIN1024_Init.3 skein.3 SKEIN1024_Update.3 +MLINKS+=skein.3 SKEIN1024_Final.3 skein.3 SKEIN1024_End.3 +MLINKS+=skein.3 SKEIN1024_File.3 skein.3 SKEIN1024_FileChunk.3 +MLINKS+=skein.3 SKEIN1024_Data.3 skein.3 skein1024.3 + CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \ rmd160.ref rmd160hl.c rmddriver \ sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \ sha256.ref sha256hl.c sha384hl.c sha384.ref \ - sha512.ref sha512hl.c sha512t256.ref sha512thl.c + sha512.ref sha512hl.c sha512t256.ref sha512thl.c \ + skein256hl.c skein512hl.c skein1024hl.c \ + skein256.ref skein512.ref skein1024.ref \ + skeindriver # Define WEAK_REFS to provide weak aliases for libmd symbols # @@ -60,8 +79,10 @@ CLEANFILES+= md[245]hl.c md[245].ref md[ # * macros are used to rename symbols to libcrypt internal names # * no weak aliases are generated CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys/crypto/sha2 +CFLAGS+= -I${.CURDIR}/../../sys/crypto/skein CFLAGS+= -DWEAK_REFS .PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 +.PATH: ${.CURDIR}/../../sys/crypto/skein ${.CURDIR}/../../sys/crypto/skein/${MACHINE_ARCH} .if exists(${MACHINE_ARCH}/sha.S) SRCS+= sha.S @@ -71,7 +92,11 @@ CFLAGS+= -DSHA1_ASM SRCS+= rmd160.S CFLAGS+= -DRMD160_ASM .endif -.if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) +.if exists(${MACHINE_ARCH}/skein_block_asm.s) +SRCS+= skein_block_asm.s +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +.endif +.if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || exists(${MACHINE_ARCH}/skein_block_asm.s) ACFLAGS+= -DELF -Wa,--noexecstack .endif @@ -124,6 +149,25 @@ rmd160hl.c: mdXhl.c -e 's/RIPEMD160__/RIPEMD160_/g' \ ${.ALLSRC}) > ${.TARGET} +skein256hl.c: mdXhl.c + (echo '#define LENGTH 32'; \ + sed -e 's/mdX/skein/g' -e 's/MDX/SKEIN256_/g' \ + -e 's/SKEIN256__/SKEIN256_/g' \ + ${.ALLSRC}) > ${.TARGET} + +skein512hl.c: mdXhl.c + (echo '#define LENGTH 64'; \ + sed -e 's/mdX/skein/g' -e 's/MDX/SKEIN512_/g' \ + -e 's/SKEIN512__/SKEIN512_/g' \ + ${.ALLSRC}) > ${.TARGET} + +skein1024hl.c: mdXhl.c + (echo '#define LENGTH 128'; \ + sed -e 's/mdX/skein/g' -e 's/MDX/SKEIN1024_/g' \ + -e 's/SKEIN1024__/SKEIN1024_/g' \ + ${.ALLSRC}) > ${.TARGET} + + .for i in 2 4 5 md${i}.3: ${.CURDIR}/mdX.3 sed -e "s/mdX/md${i}/g" -e "s/MDX/MD${i}/g" ${.ALLSRC} > ${.TARGET} @@ -250,8 +294,51 @@ rmd160.ref: @echo 'RIPEMD160 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ '9b752e45573d4b39f4dbd3323cab82bf63326bfb' >> ${.TARGET} +skein256.ref: + echo 'SKEIN256 test suite:' > ${.TARGET} + @echo 'SKEIN256 ("") = c8877087da56e072870daa843f176e9453115929094c3a40c463a196c29bf7ba' >> ${.TARGET} + @echo 'SKEIN256 ("abc") = 258bdec343b9fde1639221a5ae0144a96e552e5288753c5fec76c05fc2fc1870' >> ${.TARGET} + @echo 'SKEIN256 ("message digest") =' \ + '4d2ce0062b5eb3a4db95bc1117dd8aa014f6cd50fdc8e64f31f7d41f9231e488' >> ${.TARGET} + @echo 'SKEIN256 ("abcdefghijklmnopqrstuvwxyz") =' \ + '46d8440685461b00e3ddb891b2ecc6855287d2bd8834a95fb1c1708b00ea5e82' >> ${.TARGET} + @echo 'SKEIN256 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + '7c5eb606389556b33d34eb2536459528dc0af97adbcd0ce273aeb650f598d4b2' >> ${.TARGET} + @echo 'SKEIN256 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + '4def7a7e5464a140ae9c3a80279fbebce4bd00f9faad819ab7e001512f67a10d' >> ${.TARGET} + +skein512.ref: + echo 'SKEIN512 test suite:' > ${.TARGET} + @echo 'SKEIN512 ("") =' \ + 'bc5b4c50925519c290cc634277ae3d6257212395cba733bbad37a4af0fa06af41fca7903d06564fea7a2d3730dbdb80c1f85562dfcc070334ea4d1d9e72cba7a' >> ${.TARGET} + @echo 'SKEIN512 ("abc") =' \ + '8f5dd9ec798152668e35129496b029a960c9a9b88662f7f9482f110b31f9f93893ecfb25c009baad9e46737197d5630379816a886aa05526d3a70df272d96e75' >> ${.TARGET} + @echo 'SKEIN512 ("message digest") =' \ + '15b73c158ffb875fed4d72801ded0794c720b121c0c78edf45f900937e6933d9e21a3a984206933d504b5dbb2368000411477ee1b204c986068df77886542fcc' >> ${.TARGET} + @echo 'SKEIN512 ("abcdefghijklmnopqrstuvwxyz") =' \ + '23793ad900ef12f9165c8080da6fdfd2c8354a2929b8aadf83aa82a3c6470342f57cf8c035ec0d97429b626c4d94f28632c8f5134fd367dca5cf293d2ec13f8c' >> ${.TARGET} + @echo 'SKEIN512 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + '0c6bed927e022f5ddcf81877d42e5f75798a9f8fd3ede3d83baac0a2f364b082e036c11af35fe478745459dd8f5c0b73efe3c56ba5bb2009208d5a29cc6e469c' >> ${.TARGET} + @echo 'SKEIN512 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + '2ca9fcffb3456f297d1b5f407014ecb856f0baac8eb540f534b1f187196f21e88f31103128c2f03fcc9857d7a58eb66f9525e2302d88833ee069295537a434ce' >> ${.TARGET} + +skein1024.ref: + echo 'SKEIN1024 test suite:' > ${.TARGET} + @echo 'SKEIN1024 ("") =' \ + '0fff9563bb3279289227ac77d319b6fff8d7e9f09da1247b72a0a265cd6d2a62645ad547ed8193db48cff847c06494a03f55666d3b47eb4c20456c9373c86297d630d5578ebd34cb40991578f9f52b18003efa35d3da6553ff35db91b81ab890bec1b189b7f52cb2a783ebb7d823d725b0b4a71f6824e88f68f982eefc6d19c6' >> ${.TARGET} + @echo 'SKEIN1024 ("abc") =' \ + '35a599a0f91abcdb4cb73c19b8cb8d947742d82c309137a7caed29e8e0a2ca7a9ff9a90c34c1908cc7e7fd99bb15032fb86e76df21b72628399b5f7c3cc209d7bb31c99cd4e19465622a049afbb87c03b5ce3888d17e6e667279ec0aa9b3e2712624c01b5f5bbe1a564220bdcf6990af0c2539019f313fdd7406cca3892a1f1f' >> ${.TARGET} + @echo 'SKEIN1024 ("message digest") =' \ + 'ea891f5268acd0fac97467fc1aa89d1ce8681a9992a42540e53babee861483110c2d16f49e73bac27653ff173003e40cfb08516cd34262e6af95a5d8645c9c1abb3e813604d508b8511b30f9a5c1b352aa0791c7d2f27b2706dccea54bc7de6555b5202351751c3299f97c09cf89c40f67187e2521c0fad82b30edbb224f0458' >> ${.TARGET} + @echo 'SKEIN1024 ("abcdefghijklmnopqrstuvwxyz") =' \ + 'f23d95c2a25fbcd0e797cd058fec39d3c52d2b5afd7a9af1df934e63257d1d3dcf3246e7329c0f1104c1e51e3d22e300507b0c3b9f985bb1f645ef49835080536becf83788e17fed09c9982ba65c3cb7ffe6a5f745b911c506962adf226e435c42f6f6bc08d288f9c810e807e3216ef444f3db22744441deefa4900982a1371f' >> ${.TARGET} + @echo 'SKEIN1024 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + 'cf3889e8a8d11bfd3938055d7d061437962bc5eac8ae83b1b71c94be201b8cf657fdbfc38674997a008c0c903f56a23feb3ae30e012377f1cfa080a9ca7fe8b96138662653fb3335c7d06595bf8baf65e215307532094cfdfa056bd8052ab792a3944a2adaa47b30335b8badb8fe9eb94fe329cdca04e58bbc530f0af709f469' >> ${.TARGET} + @echo 'SKEIN1024 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + 'cf21a613620e6c119eca31fdfaad449a8e02f95ca256c21d2a105f8e4157048f9fe1e897893ea18b64e0e37cb07d5ac947f27ba544caf7cbc1ad094e675aed77a366270f7eb7f46543bccfa61c526fd628408058ed00ed566ac35a9761d002e629c4fb0d430b2f4ad016fcc49c44d2981c4002da0eecc42144160e2eaea4855a' >> ${.TARGET} + test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha384.ref \ - sha512.ref sha512t256.ref + sha512.ref sha512t256.ref skein256.ref skein512.ref skein1024.ref @${ECHO} if any of these test fail, the code produces wrong results @${ECHO} and should NOT be used. ${CC} ${CFLAGS} ${LDFLAGS} -DMD=4 -o mddriver ${.CURDIR}/mddriver.c libmd.a @@ -284,5 +371,15 @@ test: md4.ref md5.ref sha0.ref rmd160.re ./shadriver | cmp sha512t256.ref - @${ECHO} SHA-512t256 passed test -rm -f shadriver + ${CC} ${CFLAGS} ${LDFLAGS} -DSKEIN=256 -o skeindriver ${.CURDIR}/skeindriver.c libmd.a + ./skeindriver | cmp skein256.ref - + @${ECHO} SKEIN256 passed test + ${CC} ${CFLAGS} ${LDFLAGS} -DSKEIN=512 -o skeindriver ${.CURDIR}/skeindriver.c libmd.a + ./skeindriver | cmp skein512.ref - + @${ECHO} SKEIN512 passed test + ${CC} ${CFLAGS} ${LDFLAGS} -DSKEIN=1024 -o skeindriver ${.CURDIR}/skeindriver.c libmd.a + ./skeindriver | cmp skein1024.ref - + @${ECHO} SKEIN1024 passed test + -rm -f skeindriver .include Modified: head/lib/libmd/mdX.3 ============================================================================== --- head/lib/libmd/mdX.3 Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libmd/mdX.3 Sun May 29 01:15:36 2016 (r300921) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 1999 +.Dd April 26, 2016 .Dt MDX 3 .Os .Sh NAME @@ -145,7 +145,11 @@ argument is non-null it must point to at .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , -.Xr sha 3 +.Xr ripemd 3 , +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 , +.Xr skein 3 .Rs .%A R. Rivest .%T The MD4 Message-Digest Algorithm Modified: head/lib/libmd/ripemd.3 ============================================================================== --- head/lib/libmd/ripemd.3 Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libmd/ripemd.3 Sun May 29 01:15:36 2016 (r300921) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd March 28, 2014 +.Dd April 26, 2016 .Dt RIPEMD 3 .Os .Sh NAME @@ -125,7 +125,10 @@ argument is non-null it must point to at .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , -.Xr sha 3 +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 , +.Xr skein 3 .Sh HISTORY These functions appeared in .Fx 4.0 . Modified: head/lib/libmd/sha.3 ============================================================================== --- head/lib/libmd/sha.3 Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libmd/sha.3 Sun May 29 01:15:36 2016 (r300921) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd March 28, 2014 +.Dd April 26, 2016 .Dt SHA 3 .Os .Sh NAME @@ -157,7 +157,9 @@ argument is non-null it must point to at .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , -.Xr sha256 3 +.Xr sha256 3 , +.Xr sha512 3 , +.Xr skein 3 .Sh HISTORY These functions appeared in .Fx 4.0 . Modified: head/lib/libmd/sha256.3 ============================================================================== --- head/lib/libmd/sha256.3 Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libmd/sha256.3 Sun May 29 01:15:36 2016 (r300921) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd March 28, 2014 +.Dd April 26, 2016 .Dt SHA256 3 .Os .Sh NAME @@ -123,7 +123,10 @@ argument is non-null it must point to at .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , -.Xr sha 3 +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 , +.Xr skein 3 .Sh HISTORY These functions appeared in .Fx 6.0 . Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Sun May 29 01:15:15 2016 (r300920) +++ head/lib/libmd/sha512.3 Sun May 29 01:15:36 2016 (r300921) @@ -192,7 +192,10 @@ string which represents the 256 bits in .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , -.Xr sha 3 +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 , +.Xr skein 3 .Sh HISTORY These functions appeared in .Fx 9.0 . Added: head/lib/libmd/skein.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libmd/skein.3 Sun May 29 01:15:36 2016 (r300921) @@ -0,0 +1,214 @@ +.\"- +.\" Copyright (c) 2016 Allan Jude +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 28, 2016 +.Dt SKEIN 3 +.Os +.Sh NAME +.Nm SKEIN256_Init , +.Nm SKEIN256_Update , +.Nm SKEIN256_Final , +.Nm SKEIN256_End , +.Nm SKEIN256_File , +.Nm SKEIN256_FileChunk , +.Nm SKEIN256_Data , +.Nm SKEIN512_Init , +.Nm SKEIN512_Update , +.Nm SKEIN512_Final , +.Nm SKEIN512_End , +.Nm SKEIN512_File , +.Nm SKEIN512_FileChunk , +.Nm SKEIN512_Data , +.Nm SKEIN1024_Init , +.Nm SKEIN1024_Update , +.Nm SKEIN1024_Final , +.Nm SKEIN1024_End , +.Nm SKEIN1024_File , +.Nm SKEIN1024_FileChunk , +.Nm SKEIN1024_Data +.Nd calculate the ``SKEIN'' family of message digests +.Sh LIBRARY +.Lb libmd +.Sh SYNOPSIS +.In sys/types.h +.In skein.h +.Ft void +.Fn SKEIN256_Init "SKEIN256_CTX *context" +.Ft void +.Fn SKEIN256_Update "SKEIN256_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SKEIN256_Final "unsigned char digest[32]" "SKEIN256_CTX *context" +.Ft "char *" +.Fn SKEIN256_End "SKEIN256_CTX *context" "char *buf" +.Ft "char *" +.Fn SKEIN256_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SKEIN256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SKEIN256_Data "const unsigned char *data" "unsigned int len" "char *buf" +.Ft void +.Fn SKEIN512_Init "SKEIN512_CTX *context" +.Ft void +.Fn SKEIN512_Update "SKEIN512_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SKEIN512_Final "unsigned char digest[64]" "SKEIN512_CTX *context" +.Ft "char *" +.Fn SKEIN512_End "SKEIN512_CTX *context" "char *buf" +.Ft "char *" +.Fn SKEIN512_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SKEIN512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SKEIN512_Data "const unsigned char *data" "unsigned int len" "char *buf" +.Ft void +.Fn SKEIN1024_Init "SKEIN1024_CTX *context" +.Ft void +.Fn SKEIN1024_Update "SKEIN1024_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SKEIN1024_Final "unsigned char digest[128]" "SKEIN1024_CTX *context" +.Ft "char *" +.Fn SKEIN1024_End "SKEIN1024_CTX *context" "char *buf" +.Ft "char *" +.Fn SKEIN1024_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SKEIN1024_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SKEIN1024_Data "const unsigned char *data" "unsigned int len" "char *buf" +.Sh DESCRIPTION +.Li Skein +is a new family of cryptographic hash functions based on the +.Li Threefish +large-block cipher. +Its design combines speed, security, simplicity, and a great deal of +flexibility in a modular package that is easy to analyze. +.Li Skein +is defined for three different internal state sizes\(em256 bits, 512 bits, and +1024 bits\(emand any output size. +This allows Skein to be a drop-in replacement for the entire SHA family +of hash functions. +.Pp +The +.Fn SKEIN256_Init , +.Fn SKEIN256_Update , +and +.Fn SKEIN256_Final +functions are the core functions. +Allocate an +.Vt SKEIN256_CTX , +initialize it with +.Fn SKEIN256_Init , +run over the data with +.Fn SKEIN256_Update , +and finally extract the result using +.Fn SKEIN256_Final . +.Pp +.Fn SKEIN256_End +is a wrapper for +.Fn SKEIN256_Final +which converts the return value to a 33-character +(including the terminating '\e0') +.Tn ASCII +string which represents the 256 bits in hexadecimal. +.Pp +.Fn SKEIN256_File +calculates the digest of a file, and uses +.Fn SKEIN256_End +to return the result. +If the file cannot be opened, a null pointer is returned. +.Fn SKEIN256_FileChunk +is similar to +.Fn SKEIN256_File , +but it only calculates the digest over a byte-range of the file specified, +starting at +.Fa offset +and spanning +.Fa length +bytes. +If the +.Fa length +parameter is specified as 0, or more than the length of the remaining part +of the file, +.Fn SKEIN256_FileChunk +calculates the digest from +.Fa offset +to the end of file. +.Fn SKEIN256_Data +calculates the digest of a chunk of data in memory, and uses +.Fn SKEIN256_End +to return the result. +.Pp +When using +.Fn SKEIN256_End , +.Fn SKEIN256_File , +or +.Fn SKEIN256_Data , +the +.Fa buf +argument can be a null pointer, in which case the returned string +is allocated with +.Xr malloc 3 +and subsequently must be explicitly deallocated using +.Xr free 3 +after use. +If the +.Fa buf +argument is non-null it must point to at least 33 characters of buffer space. +.Pp +The +.Li SKEIN512_ +and +.Li SKEIN1024_ +functions are similar to the +.Li SKEIN256_ +functions except they produce a 512-bit, 65 character, +or 1024-bit, 129 character, output. +.Sh SEE ALSO +.Xr md4 3 , +.Xr md5 3 , +.Xr ripemd 3 , +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 +.Sh HISTORY +These functions appeared in +.Fx 11.0 . +.Sh AUTHORS +.An -nosplit +The core hash routines were imported from version 1.3 of the optimized +Skein reference implementation written by +.An Doug Whiting +as submitted to the NSA SHA-3 contest. +The algorithms were developed by +.An Niels Ferguson , +.An Stefan Lucks , +.An Bruce Schneier , +.An Doug Whiting , +.An Mihir Bellare , +.An Tadayoshi Kohno , +.An Jon Callas, +and +.An Jesse Walker . Added: head/lib/libmd/skeindriver.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libmd/skeindriver.c Sun May 29 01:15:36 2016 (r300921) @@ -0,0 +1,68 @@ +/* SKEINDRIVER.C - test driver for SKEIN */ + +/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All rights + * reserved. + * + * RSA Data Security, Inc. makes no representations concerning either the + * merchantability of this software or the suitability of this software for + * any particular purpose. It is provided "as is" without express or implied + * warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include + +#include "skein.h" + +/* The following makes SKEIN default to SKEIN512 if it has not already been + * defined with C compiler flags. */ +#ifndef SKEIN +#define SKEIN 512 +#endif + +#if SKEIN == 256 +#undef SKEIN_Data +#define SKEIN_Data SKEIN256_Data +#elif SKEIN == 512 +#undef SKEIN_Data +#define SKEIN_Data SKEIN512_Data +#elif SKEIN == 1024 +#undef SKEIN_Data +#define SKEIN_Data SKEIN1024_Data +#endif + +/* Digests a string and prints the result. */ +static void +SKEINString(char *string) +{ + char buf[2*128 + 1]; + + printf("SKEIN%d (\"%s\") = %s\n", + SKEIN, string, SKEIN_Data(string, strlen(string), buf)); +} + +/* Digests a reference suite of strings and prints the results. */ +int +main(void) +{ + printf("SKEIN%d test suite:\n", SKEIN); + + SKEINString(""); + SKEINString("abc"); + SKEINString("message digest"); + SKEINString("abcdefghijklmnopqrstuvwxyz"); + SKEINString("ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz0123456789"); + SKEINString("1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890"); + + return 0; +} Modified: head/sbin/md5/Makefile ============================================================================== --- head/sbin/md5/Makefile Sun May 29 01:15:15 2016 (r300920) +++ head/sbin/md5/Makefile Sun May 29 01:15:36 2016 (r300921) @@ -9,14 +9,20 @@ LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha256 \ ${BINDIR}/md5 ${BINDIR}/sha384 \ ${BINDIR}/md5 ${BINDIR}/sha512 \ - ${BINDIR}/md5 ${BINDIR}/sha512t256 + ${BINDIR}/md5 ${BINDIR}/sha512t256 \ + ${BINDIR}/md5 ${BINDIR}/skein256 \ + ${BINDIR}/md5 ${BINDIR}/skein512 \ + ${BINDIR}/md5 ${BINDIR}/skein1024 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ md5.1 sha256.1 \ md5.1 sha384.1 \ md5.1 sha512.1 \ - md5.1 sha512t256.1 + md5.1 sha512t256.1 \ + md5.1 skein256.1 \ + md5.1 skein512.1 \ + md5.1 skein1024.1 LIBADD= md Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Sun May 29 01:15:15 2016 (r300920) +++ head/sbin/md5/md5.c Sun May 29 01:15:36 2016 (r300921) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -61,6 +62,9 @@ extern const char *SHA384_TestOutput[MDT extern const char *SHA512_TestOutput[MDTESTCOUNT]; extern const char *SHA512t256_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; +extern const char *SKEIN256_TestOutput[MDTESTCOUNT]; +extern const char *SKEIN512_TestOutput[MDTESTCOUNT]; +extern const char *SKEIN1024_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { const char *progname; @@ -87,12 +91,15 @@ typedef union { SHA384_CTX sha384; SHA512_CTX sha512; RIPEMD160_CTX ripemd160; + SKEIN256_CTX skein256; + SKEIN512_CTX skein512; + SKEIN1024_CTX skein1024; } DIGEST_CTX; /* max(MD5_DIGEST_LENGTH, SHA_DIGEST_LENGTH, SHA256_DIGEST_LENGTH, SHA512_DIGEST_LENGTH, - RIPEMD160_DIGEST_LENGTH)*2+1 */ -#define HEX_DIGEST_LENGTH 129 + RIPEMD160_DIGEST_LENGTH, SKEIN1024_DIGEST_LENGTH)*2+1 */ +#define HEX_DIGEST_LENGTH 257 /* algorithm function table */ @@ -117,7 +124,16 @@ static const struct Algorithm_t Algorith &SHA512_256_Data, &SHA512_256_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, - (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } + (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File }, + { "skein256", "Skein256", &SKEIN256_TestOutput, + (DIGEST_Init*)&SKEIN256_Init, (DIGEST_Update*)&SKEIN256_Update, + (DIGEST_End*)&SKEIN256_End, &SKEIN256_Data, &SKEIN256_File }, + { "skein512", "Skein512", &SKEIN512_TestOutput, + (DIGEST_Init*)&SKEIN512_Init, (DIGEST_Update*)&SKEIN512_Update, + (DIGEST_End*)&SKEIN512_End, &SKEIN512_Data, &SKEIN512_File }, + { "skein1024", "Skein1024", &SKEIN1024_TestOutput, + (DIGEST_Init*)&SKEIN1024_Init, (DIGEST_Update*)&SKEIN1024_Update, + (DIGEST_End*)&SKEIN1024_End, &SKEIN1024_Data, &SKEIN1024_File } }; static void @@ -286,8 +302,8 @@ MDTimeTrial(const Algorithm_t *alg) printf(" done\n"); printf("Digest = %s", p); printf("\nTime = %f seconds\n", seconds); - printf("Speed = %f bytes/second\n", - (float) TEST_BLOCK_LEN * (float) TEST_BLOCK_COUNT / seconds); + printf("Speed = %f MiB/second\n", (float) TEST_BLOCK_LEN * + (float) TEST_BLOCK_COUNT / seconds / (1 << 20)); } /* * Digests a reference suite of strings and prints the results. @@ -382,6 +398,39 @@ const char *RIPEMD160_TestOutput[MDTESTC "5feb69c6bf7c29d95715ad55f57d8ac5b2b7dd32" }; +const char *SKEIN256_TestOutput[MDTESTCOUNT] = { + "c8877087da56e072870daa843f176e9453115929094c3a40c463a196c29bf7ba", + "7fba44ff1a31d71a0c1f82e6e82fb5e9ac6c92a39c9185b9951fed82d82fe635", + "258bdec343b9fde1639221a5ae0144a96e552e5288753c5fec76c05fc2fc1870", + "4d2ce0062b5eb3a4db95bc1117dd8aa014f6cd50fdc8e64f31f7d41f9231e488", + "46d8440685461b00e3ddb891b2ecc6855287d2bd8834a95fb1c1708b00ea5e82", + "7c5eb606389556b33d34eb2536459528dc0af97adbcd0ce273aeb650f598d4b2", + "4def7a7e5464a140ae9c3a80279fbebce4bd00f9faad819ab7e001512f67a10d", + "d9c017dbe355f318d036469eb9b5fbe129fc2b5786a9dc6746a516eab6fe0126" +}; + +const char *SKEIN512_TestOutput[MDTESTCOUNT] = { + "bc5b4c50925519c290cc634277ae3d6257212395cba733bbad37a4af0fa06af41fca7903d06564fea7a2d3730dbdb80c1f85562dfcc070334ea4d1d9e72cba7a", + "b1cd8d33f61b3737adfd59bb13ad82f4a9548e92f22956a8976cca3fdb7fee4fe91698146c4197cec85d38b83c5d93bdba92c01fd9a53870d0c7f967bc62bdce", + "8f5dd9ec798152668e35129496b029a960c9a9b88662f7f9482f110b31f9f93893ecfb25c009baad9e46737197d5630379816a886aa05526d3a70df272d96e75", + "15b73c158ffb875fed4d72801ded0794c720b121c0c78edf45f900937e6933d9e21a3a984206933d504b5dbb2368000411477ee1b204c986068df77886542fcc", + "23793ad900ef12f9165c8080da6fdfd2c8354a2929b8aadf83aa82a3c6470342f57cf8c035ec0d97429b626c4d94f28632c8f5134fd367dca5cf293d2ec13f8c", + "0c6bed927e022f5ddcf81877d42e5f75798a9f8fd3ede3d83baac0a2f364b082e036c11af35fe478745459dd8f5c0b73efe3c56ba5bb2009208d5a29cc6e469c", + "2ca9fcffb3456f297d1b5f407014ecb856f0baac8eb540f534b1f187196f21e88f31103128c2f03fcc9857d7a58eb66f9525e2302d88833ee069295537a434ce", + "1131f2aaa0e97126c9314f9f968cc827259bbfabced2943bb8c9274448998fb3b78738b4580dd500c76105fd3c03e465e1414f2c29664286b1f79d3e51128125" +}; + +const char *SKEIN1024_TestOutput[MDTESTCOUNT] = { + "0fff9563bb3279289227ac77d319b6fff8d7e9f09da1247b72a0a265cd6d2a62645ad547ed8193db48cff847c06494a03f55666d3b47eb4c20456c9373c86297d630d5578ebd34cb40991578f9f52b18003efa35d3da6553ff35db91b81ab890bec1b189b7f52cb2a783ebb7d823d725b0b4a71f6824e88f68f982eefc6d19c6", + "6ab4c4ba9814a3d976ec8bffa7fcc638ceba0544a97b3c98411323ffd2dc936315d13dc93c13c4e88cda6f5bac6f2558b2d8694d3b6143e40d644ae43ca940685cb37f809d3d0550c56cba8036dee729a4f8fb960732e59e64d57f7f7710f8670963cdcdc95b41daab4855fcf8b6762a64b173ee61343a2c7689af1d293eba97", + "35a599a0f91abcdb4cb73c19b8cb8d947742d82c309137a7caed29e8e0a2ca7a9ff9a90c34c1908cc7e7fd99bb15032fb86e76df21b72628399b5f7c3cc209d7bb31c99cd4e19465622a049afbb87c03b5ce3888d17e6e667279ec0aa9b3e2712624c01b5f5bbe1a564220bdcf6990af0c2539019f313fdd7406cca3892a1f1f", + "ea891f5268acd0fac97467fc1aa89d1ce8681a9992a42540e53babee861483110c2d16f49e73bac27653ff173003e40cfb08516cd34262e6af95a5d8645c9c1abb3e813604d508b8511b30f9a5c1b352aa0791c7d2f27b2706dccea54bc7de6555b5202351751c3299f97c09cf89c40f67187e2521c0fad82b30edbb224f0458", + "f23d95c2a25fbcd0e797cd058fec39d3c52d2b5afd7a9af1df934e63257d1d3dcf3246e7329c0f1104c1e51e3d22e300507b0c3b9f985bb1f645ef49835080536becf83788e17fed09c9982ba65c3cb7ffe6a5f745b911c506962adf226e435c42f6f6bc08d288f9c810e807e3216ef444f3db22744441deefa4900982a1371f", + "cf3889e8a8d11bfd3938055d7d061437962bc5eac8ae83b1b71c94be201b8cf657fdbfc38674997a008c0c903f56a23feb3ae30e012377f1cfa080a9ca7fe8b96138662653fb3335c7d06595bf8baf65e215307532094cfdfa056bd8052ab792a3944a2adaa47b30335b8badb8fe9eb94fe329cdca04e58bbc530f0af709f469", + "cf21a613620e6c119eca31fdfaad449a8e02f95ca256c21d2a105f8e4157048f9fe1e897893ea18b64e0e37cb07d5ac947f27ba544caf7cbc1ad094e675aed77a366270f7eb7f46543bccfa61c526fd628408058ed00ed566ac35a9761d002e629c4fb0d430b2f4ad016fcc49c44d2981c4002da0eecc42144160e2eaea4855a", + "e6799b78db54085a2be7ff4c8007f147fa88d326abab30be0560b953396d8802feee9a15419b48a467574e9283be15685ca8a079ee52b27166b64dd70b124b1d4e4f6aca37224c3f2685e67e67baef9f94b905698adc794a09672aba977a61b20966912acdb08c21a2c37001785355dc884751a21f848ab36e590331ff938138" +}; + static void MDTestSuite(const Algorithm_t *alg) { Copied: head/sys/crypto/skein/amd64/skein_block_asm.s (from r300822, vendor-sys/skein/dist/Additional_Implementations/skein_block_x64.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/skein/amd64/skein_block_asm.s Sun May 29 01:15:36 2016 (r300921, copy of r300822, vendor-sys/skein/dist/Additional_Implementations/skein_block_x64.s) @@ -0,0 +1,1328 @@ +# +#---------------------------------------------------------------- +# 64-bit x86 assembler code (gnu as) for Skein block functions +# +# Author: Doug Whiting, Hifn/Exar +# +# This code is released to the public domain. +#---------------------------------------------------------------- +# + .text + .altmacro + .psize 0,128 #list file has no page boundaries +# +_MASK_ALL_ = (256+512+1024) #all three algorithm bits +_MAX_FRAME_ = 240 +# +################# +.ifndef SKEIN_USE_ASM +_USE_ASM_ = _MASK_ALL_ +.else +_USE_ASM_ = SKEIN_USE_ASM +.endif +################# +.ifndef SKEIN_LOOP #configure loop unrolling +_SKEIN_LOOP = 2 #default is fully unrolled for 256/512, twice for 1024 +.else +_SKEIN_LOOP = SKEIN_LOOP + .irp _NN_,%_SKEIN_LOOP #only display loop unrolling if default changed on command line +.print "+++ SKEIN_LOOP = \_NN_" + .endr +.endif +# the unroll counts (0 --> fully unrolled) +SKEIN_UNROLL_256 = (_SKEIN_LOOP / 100) % 10 +SKEIN_UNROLL_512 = (_SKEIN_LOOP / 10) % 10 +SKEIN_UNROLL_1024 = (_SKEIN_LOOP ) % 10 +# +SKEIN_ASM_UNROLL = 0 + .irp _NN_,256,512,1024 + .if (SKEIN_UNROLL_\_NN_) == 0 +SKEIN_ASM_UNROLL = SKEIN_ASM_UNROLL + \_NN_ + .endif + .endr +################# +# +.ifndef SKEIN_ROUNDS +ROUNDS_256 = 72 +ROUNDS_512 = 72 +ROUNDS_1024 = 80 +.else +ROUNDS_256 = 8*((((SKEIN_ROUNDS / 100) + 5) % 10) + 5) +ROUNDS_512 = 8*((((SKEIN_ROUNDS / 10) + 5) % 10) + 5) +ROUNDS_1024 = 8*((((SKEIN_ROUNDS ) + 5) % 10) + 5) +# only display rounds if default size is changed on command line +.irp _NN_,256,512,1024 + .if _USE_ASM_ && \_NN_ + .irp _RR_,%(ROUNDS_\_NN_) + .if _NN_ < 1024 +.print "+++ SKEIN_ROUNDS_\_NN_ = \_RR_" + .else +.print "+++ SKEIN_ROUNDS_\_NN_ = \_RR_" + .endif + .endr + .endif +.endr +.endif +################# +# +.ifdef SKEIN_CODE_SIZE +_SKEIN_CODE_SIZE = (1) +.else +.ifdef SKEIN_PERF #use code size if SKEIN_PERF is defined +_SKEIN_CODE_SIZE = (1) +.else +_SKEIN_CODE_SIZE = (0) +.endif +.endif +# +################# +# +.ifndef SKEIN_DEBUG +_SKEIN_DEBUG = 0 +.else +_SKEIN_DEBUG = 1 +.endif +################# +# +# define offsets of fields in hash context structure +# +HASH_BITS = 0 #bits of hash output +BCNT = 8 + HASH_BITS #number of bytes in BUFFER[] +TWEAK = 8 + BCNT #tweak values[0..1] +X_VARS = 16 + TWEAK #chaining vars +# +#(Note: buffer[] in context structure is NOT needed here :-) +# +KW_PARITY = 0x1BD11BDAA9FC1A22 #overall parity of key schedule words +FIRST_MASK = ~ (1 << 6) +FIRST_MASK64= ~ (1 << 62) +# +# rotation constants for Skein +# +RC_256_0_0 = 14 +RC_256_0_1 = 16 + +RC_256_1_0 = 52 +RC_256_1_1 = 57 + +RC_256_2_0 = 23 +RC_256_2_1 = 40 + +RC_256_3_0 = 5 +RC_256_3_1 = 37 + +RC_256_4_0 = 25 +RC_256_4_1 = 33 + +RC_256_5_0 = 46 +RC_256_5_1 = 12 + +RC_256_6_0 = 58 +RC_256_6_1 = 22 + +RC_256_7_0 = 32 +RC_256_7_1 = 32 + +RC_512_0_0 = 46 +RC_512_0_1 = 36 +RC_512_0_2 = 19 +RC_512_0_3 = 37 + +RC_512_1_0 = 33 +RC_512_1_1 = 27 +RC_512_1_2 = 14 +RC_512_1_3 = 42 + +RC_512_2_0 = 17 +RC_512_2_1 = 49 +RC_512_2_2 = 36 +RC_512_2_3 = 39 + +RC_512_3_0 = 44 +RC_512_3_1 = 9 +RC_512_3_2 = 54 +RC_512_3_3 = 56 + +RC_512_4_0 = 39 +RC_512_4_1 = 30 +RC_512_4_2 = 34 +RC_512_4_3 = 24 + +RC_512_5_0 = 13 +RC_512_5_1 = 50 +RC_512_5_2 = 10 +RC_512_5_3 = 17 + +RC_512_6_0 = 25 +RC_512_6_1 = 29 +RC_512_6_2 = 39 +RC_512_6_3 = 43 + +RC_512_7_0 = 8 +RC_512_7_1 = 35 +RC_512_7_2 = 56 +RC_512_7_3 = 22 + +RC_1024_0_0 = 24 +RC_1024_0_1 = 13 +RC_1024_0_2 = 8 +RC_1024_0_3 = 47 +RC_1024_0_4 = 8 +RC_1024_0_5 = 17 +RC_1024_0_6 = 22 +RC_1024_0_7 = 37 + +RC_1024_1_0 = 38 +RC_1024_1_1 = 19 +RC_1024_1_2 = 10 +RC_1024_1_3 = 55 +RC_1024_1_4 = 49 +RC_1024_1_5 = 18 +RC_1024_1_6 = 23 +RC_1024_1_7 = 52 + +RC_1024_2_0 = 33 +RC_1024_2_1 = 4 +RC_1024_2_2 = 51 +RC_1024_2_3 = 13 +RC_1024_2_4 = 34 +RC_1024_2_5 = 41 +RC_1024_2_6 = 59 +RC_1024_2_7 = 17 + +RC_1024_3_0 = 5 +RC_1024_3_1 = 20 +RC_1024_3_2 = 48 +RC_1024_3_3 = 41 +RC_1024_3_4 = 47 +RC_1024_3_5 = 28 +RC_1024_3_6 = 16 +RC_1024_3_7 = 25 + +RC_1024_4_0 = 41 +RC_1024_4_1 = 9 +RC_1024_4_2 = 37 +RC_1024_4_3 = 31 +RC_1024_4_4 = 12 +RC_1024_4_5 = 47 +RC_1024_4_6 = 44 +RC_1024_4_7 = 30 + +RC_1024_5_0 = 16 +RC_1024_5_1 = 34 +RC_1024_5_2 = 56 +RC_1024_5_3 = 51 +RC_1024_5_4 = 4 +RC_1024_5_5 = 53 +RC_1024_5_6 = 42 +RC_1024_5_7 = 41 + +RC_1024_6_0 = 31 +RC_1024_6_1 = 44 +RC_1024_6_2 = 47 +RC_1024_6_3 = 46 +RC_1024_6_4 = 19 +RC_1024_6_5 = 42 +RC_1024_6_6 = 44 +RC_1024_6_7 = 25 + +RC_1024_7_0 = 9 +RC_1024_7_1 = 48 +RC_1024_7_2 = 35 +RC_1024_7_3 = 52 +RC_1024_7_4 = 23 +RC_1024_7_5 = 31 +RC_1024_7_6 = 37 +RC_1024_7_7 = 20 +# +# Input: reg +# Output: <<< RC_BlkSize_roundNum_mixNum, BlkSize=256/512/1024 +# +.macro RotL64 reg,BLK_SIZE,ROUND_NUM,MIX_NUM +_RCNT_ = RC_\BLK_SIZE&_\ROUND_NUM&_\MIX_NUM + .if _RCNT_ #is there anything to do? + rolq $_RCNT_,%\reg + .endif +.endm +# +#---------------------------------------------------------------- +# +# MACROS: define local vars and configure stack +# +#---------------------------------------------------------------- +# declare allocated space on the stack +.macro StackVar localName,localSize +\localName = _STK_OFFS_ +_STK_OFFS_ = _STK_OFFS_+(\localSize) +.endm #StackVar +# +#---------------------------------------------------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun May 29 01:15:16 2016 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 F07A2B50929; Sun, 29 May 2016 01:15:16 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id C1B6F1AC5; Sun, 29 May 2016 01:15:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T1FFgF086412; Sun, 29 May 2016 01:15:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T1FFYI086411; Sun, 29 May 2016 01:15:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605290115.u4T1FFYI086411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 May 2016 01:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300920 - head/usr.bin/xlint/llib 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.22 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: Sun, 29 May 2016 01:15:17 -0000 Author: bdrewery Date: Sun May 29 01:15:15 2016 New Revision: 300920 URL: https://svnweb.freebsd.org/changeset/base/300920 Log: Fix with external GCC after r300886. Somehow the /usr/include path got lost in this particular case. Just pass it along from --sysroot as was already done for DIRDEPS_BUILD. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/xlint/llib/Makefile Modified: head/usr.bin/xlint/llib/Makefile ============================================================================== --- head/usr.bin/xlint/llib/Makefile Sun May 29 00:40:29 2016 (r300919) +++ head/usr.bin/xlint/llib/Makefile Sun May 29 01:15:15 2016 (r300920) @@ -16,6 +16,15 @@ llib-lstdc.ln: llib-lstdc .include -.if ${MK_DIRDEPS_BUILD} == "yes" +.if !empty(STAGE_INCLUDEDIR) LINTFLAGS+= -I${STAGE_INCLUDEDIR} +.else +.if ${CFLAGS:M--sysroot=*} != "" +_sysroot?= ${CFLAGS:M--sysroot=*:[1]:C,^--sysroot=,,} +.elif ${CC:M--sysroot=*} != "" +_sysroot?= ${CC:M--sysroot=*:[1]:C,^--sysroot=,,} +.endif +.if !empty(_sysroot) +LINTFLAGS+= -I${_sysroot}/usr/include +.endif .endif From owner-svn-src-head@freebsd.org Sun May 29 01:52:06 2016 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 B3631B52C2F; Sun, 29 May 2016 01:52:06 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 80F6011CD; Sun, 29 May 2016 01:52:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T1q5Y6002865; Sun, 29 May 2016 01:52:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T1q5T9002864; Sun, 29 May 2016 01:52:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290152.u4T1q5T9002864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 01:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300927 - head/sys/dev/ixl 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.22 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: Sun, 29 May 2016 01:52:06 -0000 Author: ngie Date: Sun May 29 01:52:05 2016 New Revision: 300927 URL: https://svnweb.freebsd.org/changeset/base/300927 Log: Delete duplicate declaration for i40e_blink_phy_link_led(..) It was already declared on line 90 Differential Revision: https://reviews.freebsd.org/D6570 Reported by: gcc Reviewed by: sbruno Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ixl/i40e_prototype.h Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Sun May 29 01:45:15 2016 (r300926) +++ head/sys/dev/ixl/i40e_prototype.h Sun May 29 01:52:05 2016 (r300927) @@ -501,6 +501,4 @@ enum i40e_status_code i40e_read_phy_regi enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); -enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, - u32 time, u32 interval); #endif /* _I40E_PROTOTYPE_H_ */ From owner-svn-src-head@freebsd.org Sun May 29 01:39:17 2016 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 70AECB4FE10; Sun, 29 May 2016 01:39:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 409C91E6F; Sun, 29 May 2016 01:39:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id b124so53277829pfb.0; Sat, 28 May 2016 18:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=NvKLgBLMtvOV6WnMAfShzFURSdA4Uh/pZxTUQJbSctw=; b=XmY0dS9+TZ2MqboDyrtQMZ+QV3LDOKXvp+fpbyQ+4eZjannowbNj9G2fH+v4/slny8 UzTG5vpXTOAS4yHsPcEWHwxnPo5SCcDzObZjK34XoTOeXK4gbccnyg0t8xU6yx/YJomE 1Pd3AKtZ23e5WGSwTUQ12+9GjQBLny2u0TIHY5ZYK950+KeEV7nJDdyjPQv/crFF4rCe yFFilVl/lexXP2/BG1fDTpfYwH+96Il9bc6ySKkoEh3lF7qHO1oHJHuUrAlPhRodb6Tx ELBtxu1/1mpbi7LFMeYx6S/oNrM9Us6Won+A/AVIFkLjS4e8DnURzqoaFBLpXXewgYR4 yceA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=NvKLgBLMtvOV6WnMAfShzFURSdA4Uh/pZxTUQJbSctw=; b=gcGgR/8+jMUW0+LVn0y3PvXbFeBqyw7x6HYVMrcXP1wwmIhS//pvNFGMydIl17dnLl r0kDM4j5b18aE4DcK1TrmGZ26rEu9wztVqakdW+MK04p55KJdVooF/9wybUxbMSeNGfb LLWJQZscgowFRleg0dw6Ro9aQ3xwxCIwjIGL6qKIWGfTNfdUxeUfdnrIDy2yRkNaUdcB aKpCCoccqDdNm+Gdi2mPbasH3bqDc3v4bOeJvIJSDNTniS8qyLjmY2vvvQhduGALnvV4 T2hGaCUBf2HxjenddUt/V+IaBVFkpphp9/qsTX+YW6nge6DmqvH8R8RLE7B8YQrsn49q XQGQ== X-Gm-Message-State: ALyK8tJhnxQm4eQyWYehuNnqT0HglTU28Sv4sc8Az+sA0xygPcbRcHjDMu+mTCV7C5siug== X-Received: by 10.98.43.210 with SMTP id r201mr34752402pfr.9.1464485956657; Sat, 28 May 2016 18:39:16 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id 66sm23162106pfb.64.2016.05.28.18.39.15 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2016 18:39:16 -0700 (PDT) Subject: Re: svn commit: r300922 - head/etc/mtree Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9CA5A877-4329-4327-AEA8-13259266B979"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605290138.u4T1cCXG095786@repo.freebsd.org> Date: Sat, 28 May 2016 18:39:13 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <7D20215F-1BD4-4198-9AB6-C908227AE882@gmail.com> References: <201605290138.u4T1cCXG095786@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 01:39:17 -0000 --Apple-Mail=_9CA5A877-4329-4327-AEA8-13259266B979 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On May 28, 2016, at 18:38, Garrett Cooper wrote: > > Author: ngie > Date: Sun May 29 01:38:12 2016 > New Revision: 300922 > URL: https://svnweb.freebsd.org/changeset/base/300922 > > Log: > Fix "make installworld" with MK_CDDL == no after r300906 by This should read, "!= no" >_>.. --Apple-Mail=_9CA5A877-4329-4327-AEA8-13259266B979 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXSkhBAAoJEPWDqSZpMIYVfBoP/jehs8dr5OSzlsfy2+hStyyR p5mHMyxakxwkASzC+hnOhd4rrGTPUc0oVoGwJONI/CJVnWNX3/1JcLcpJ1N6pVg5 ecoKeeVE7j5IH1S0qwgLWAe55+ZIQWqQCTiyRKtwftZBgmCM9U2eWf+zJx50LBCk BELySRSUdBxWXwcXmqbuGmOCnO0h1Wo2eugVEH2fbK4SiwRF6fwkujJgP5SEjb4+ bYPiT6giRi8qTZP1ClohlFMy6iTE/8ro/AXNf9rlzQKd03baKQ/toG33p4X5HVR3 vskqzZ5AjU51g0Bal+lv4G12/OmuClklvQV6Q0opFIIw9k6vpoU/N6o0gONzx/XN Uq+jXONeyGFPznnNQUburzGPoxNKXVtyoCybS4vlo1+2v77CLOmkX+/j4821TTxO RA14P3ir7gt69g1M4cALh9YtDyKYmfMHUUmXsyOjEqCCNAKKqPCMnMDDSiUYjvyV FsZ65Uj9shKzk8UpsnWxaOpom+Hw5aHoBFMHydGAaWjt+kKkyXmkvlA1nqapEr1q A2alLERXKJV/1BONJHhiJxj6zFluaH9Tgwxk4w4uRHwtwhbfa74uK+syeIA21sHt Pi35Nrl3PULEjjLZ5ex9ddZkDtxUTAz1WitpjS4JPAH/otSLJkLvqNaSTY1R7fr9 LgUVfY22yT/OB3EaqkNF =AJV4 -----END PGP SIGNATURE----- --Apple-Mail=_9CA5A877-4329-4327-AEA8-13259266B979-- From owner-svn-src-head@freebsd.org Sun May 29 03:44:38 2016 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 87C80B4F49C; Sun, 29 May 2016 03:44:38 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 5693B1262; Sun, 29 May 2016 03:44:38 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T3ib5N045735; Sun, 29 May 2016 03:44:37 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T3iboV045734; Sun, 29 May 2016 03:44:37 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605290344.u4T3iboV045734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 29 May 2016 03:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300933 - head/sbin/ifconfig 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.22 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: Sun, 29 May 2016 03:44:38 -0000 Author: allanjude Date: Sun May 29 03:44:37 2016 New Revision: 300933 URL: https://svnweb.freebsd.org/changeset/base/300933 Log: Add Documentation for missing ifconfig(8) flags autoconf / -autoconf deprecated / -deprecated pltime vltime PR: 209822 Submitted by: Sevan Janiyan MFC after: 2 weeks Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sun May 29 03:42:50 2016 (r300932) +++ head/sbin/ifconfig/ifconfig.8 Sun May 29 03:44:37 2016 (r300933) @@ -635,6 +635,10 @@ controls whether this flag is set by def .It Cm -accept_rtadv Clear a flag .Cm accept_rtadv . +.It Cm autoconf +Set a flag to accept router advertisements on an interface. +.It Fl autoconf +Disable autoconfiguration. .It Cm no_radr Set a flag to control whether routers from which the system accepts Router Advertisement messages will be added to the Default Router List @@ -707,12 +711,20 @@ Note that the address family keyword .Dq Li inet6 is needed for them: .Bl -tag -width indent +.It Cm deprecated +Set the IPv6 deprecated address bit. +.It Fl deprecated +Clear the IPv6 deprecated address bit. +.It Cm pltime Ar n +Set preferred lifetime for the address. .It Cm prefer_source Set a flag to prefer address as a candidate of the source address for outgoing packets. .It Cm -prefer_source Clear a flag .Cm prefer_source . +.It Cm vltime Ar n +Set valid lifetime for the address. .El .Pp The following parameters are specific to cloning From owner-svn-src-head@freebsd.org Sun May 29 03:47:21 2016 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 EA88EB4F7A3; Sun, 29 May 2016 03:47:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BED9E1682; Sun, 29 May 2016 03:47:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id g64so54037369pfb.2; Sat, 28 May 2016 20:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=tOmhjE5pOYEBknuS2/pGgKAO23G7UsmL1DcarZUmN9s=; b=NE3GGdPLPaZiKKwKahG+9F1AX4i1wRzlIQuwvE5lJM/efnve+Mv59H9/JRNZ1R26Kc M7eUlEW/e4QK1BcfDp0F4jUIvPrf+0lsR+frxMuQeiDJIJwfSn05DE84gfm17YRXVYaO +fdFtCbgF7JZQCTD0SIBgeyPyrq+wYXjwRtUBSfXNXcTO6yKKo3BLrDHYrvIfHWTowFy nbpgDALQ6PIcj3rY0w0IGN4NP0P7EC4+JCqu5jyRFV5GZFf1MS02uUa8DyY4J9ZsTW0m PByAEyyr4n1sMasiKi8URiQI/8IcMsxZQg9SiE/TGRwA33OwpB0uSBp83yDzwfxeElSo ZeIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=tOmhjE5pOYEBknuS2/pGgKAO23G7UsmL1DcarZUmN9s=; b=iN1z5DJ9HsHW8WiPeF9ZYZaOwPxP0b4w3NVcwhw5//uLCwQOA7Z2w+aX4qA9pM9y5z d5Xxsp5cy88AH1qwA2jSrGnW19JpGvMzJg58JZtLFXzsTvigLBcgDEcrkysU6vIPNM9A 9hSiXVDDDT797dy4Y5jsPr0iE1CFdBsOBqxahomXdZYbyiVbJknF5Gp6ma2fwHwm6+OK QfEyyAhdQEXYn7/3SjG+UAUF9wnp11nC+fSrnfKgh5+J6+kxzty3CT6p7y0HNeEep8e6 aobrrzBOn2S5NTMLqSvOaJvhL0vRYHvLlsTVEQyXQi56lXO0FSLY6aNIC31Y24JnlSYq S+MA== X-Gm-Message-State: ALyK8tJgPjpTyn6EDI26J36avZskEE+b4R2gicnYj+6EajRfCGthsrMdE5JB8rKS4tBT4g== X-Received: by 10.98.8.146 with SMTP id 18mr31731038pfi.14.1464493641262; Sat, 28 May 2016 20:47:21 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id p13sm23528042pfj.58.2016.05.28.20.47.20 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2016 20:47:20 -0700 (PDT) Subject: Re: svn commit: r300932 - head/usr.sbin/rpcbind Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <7c4e662d-069c-114e-c9d1-320a6571bc89@FreeBSD.org> Date: Sat, 28 May 2016 20:47:17 -0700 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <7EF99230-228E-49CD-B924-4B594E90ECDF@gmail.com> References: <201605290342.u4T3gpUB045575@repo.freebsd.org> <7c4e662d-069c-114e-c9d1-320a6571bc89@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 03:47:22 -0000 --Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 28, 2016, at 20:44, Bryan Drewery wrote: >=20 > On 5/28/2016 8:42 PM, Garrett Cooper wrote: >> Author: ngie >> Date: Sun May 29 03:42:50 2016 >> New Revision: 300932 >> URL: https://svnweb.freebsd.org/changeset/base/300932 >>=20 >> Log: >> Catch malloc(3) errors and socket(2) errors >>=20 >> - malloc failing will result in a delayed segfault >> - socket failing will result in delayed failures with setsockopt >>=20 >> Exit in the event that either of these high-level conditions are = met. >>=20 >> Reported by: Coverity >> CID: 976288, 976321, 976858 >> Sponsored by: EMC / Isilon Storage Division >>=20 >> Modified: >> head/usr.sbin/rpcbind/util.c >>=20 >> Modified: head/usr.sbin/rpcbind/util.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/usr.sbin/rpcbind/util.c Sun May 29 02:59:03 2016 = (r300931) >> +++ head/usr.sbin/rpcbind/util.c Sun May 29 03:42:50 2016 = (r300932) >> @@ -336,6 +336,7 @@ network_init(void) >> if (local_in4 =3D=3D NULL) { >> if (debugging) >> fprintf(stderr, "can't alloc local ip4 = addr\n"); >> + exit(1); >> } >> memcpy(local_in4, res->ai_addr, sizeof *local_in4); >> } >> @@ -351,6 +352,7 @@ network_init(void) >> if (local_in6 =3D=3D NULL) { >> if (debugging) >> fprintf(stderr, "can't alloc local ip6 = addr\n"); >> + exit(1); >=20 > Did something meaningful get printed before this on hitting this = error, > without debug? Nope. It just crashed.. I=E2=80=99ve briefly thought about it, and I = think that err/errx would be better. I=E2=80=99ll run some more = tests/fix some more Coverity issues in the area, and send it out for CR. Thanks, -Ngie --Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXSmZGAAoJEPWDqSZpMIYVy88QAL934+0lNAnbhPwWWm5YFWoJ aegRSBIUbPpnQhyklftVNmNq1Z7EuNtb0WYHenNEi7HnPVUoYTf/ZMS3+KK/PUnU /weB31Evv2yVcRU3pblNiUkahm8kxnRAy/7qHkBTarFPn3oIQ5i8CHRvmo+olhdr +v7neqz/7bWMn2Cw45aSaAo9RAN0Ew4saeAJwmZlNd4i4ZSwT4b3a/gRtmVLErDZ PYPDB6ola1m+X0vx6zXYRFKQV1pXWMb+bsT4dPyyO/fmvirHhdaac0IbJxLHDkHC 8VOmORKb52qLpgqp/ZRPPX3Dnq3DpM/sB9P+5Ru/PkpI693H5Qc3YR1St/8j+a+l 7Y6a3OSSbCZs1EK2GDx664WNZi0ZS0Go5tVmpaxiqk6ki/norUkNdIS9gn+7Mgn+ TZRsTN9s8udPGAb576ceuF2f7Txt4IsKvxHwvuDXVA/WHtOdPt8IMGsuT+d24yUM gWmPi5Ss4TQ6zHCUDP+77tvUUFHhfU5O5cP+VdVagG86crE2pOq1lpQ4wDznt3zM 2gGkQZR3AerfigwW1ARzkbUjxPnCXW1oRJJYvZF1z1Abcp4kWmUibUVgA46np7Ff 14/98UTfOSOePsl61HjyVJLDBP9jQApTjAwfqeI1PR3lmYcGs43lLR6aMos/Sk2r hC3F23RIii2B0m4gauP4 =413+ -----END PGP SIGNATURE----- --Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8-- From owner-svn-src-head@freebsd.org Sun May 29 04:47:11 2016 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 69AD5B4F0C6; Sun, 29 May 2016 04:47:11 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 1145B18D3; Sun, 29 May 2016 04:47:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T4lATh069044; Sun, 29 May 2016 04:47:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T4lAKE069043; Sun, 29 May 2016 04:47:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290447.u4T4lAKE069043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300938 - head/tools/build/mk 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.22 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: Sun, 29 May 2016 04:47:11 -0000 Author: ngie Date: Sun May 29 04:47:10 2016 New Revision: 300938 URL: https://svnweb.freebsd.org/changeset/base/300938 Log: Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run sa(8) is conditionally installed based on MK_ACCT != no today MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:43:24 2016 (r300937) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:47:10 2016 (r300938) @@ -12,6 +12,33 @@ OLD_FILES+=usr/sbin/accton OLD_FILES+=usr/sbin/sa OLD_FILES+=usr/share/man/man8/accton.8.gz OLD_FILES+=usr/share/man/man8/sa.8.gz +OLD_FILES+=usr/tests/usr.sbin/sa/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/sa/legacy_test +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa .endif .if ${MK_ACPI} == no From owner-svn-src-head@freebsd.org Sun May 29 07:01:13 2016 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 ABF1CB5138E; Sun, 29 May 2016 07:01:13 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 6F3F7132B; Sun, 29 May 2016 07:01:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T71CBn017159; Sun, 29 May 2016 07:01:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T71ClZ017158; Sun, 29 May 2016 07:01:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290701.u4T71ClZ017158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 07:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300947 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 07:01:13 -0000 Author: ngie Date: Sun May 29 07:01:12 2016 New Revision: 300947 URL: https://svnweb.freebsd.org/changeset/base/300947 Log: Staticize variables only used in rpcbind.c This is some low hanging fruit necessary for making this WARNS?= 6 clean MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/rpcbind.c Modified: head/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.c Sun May 29 06:46:17 2016 (r300946) +++ head/usr.sbin/rpcbind/rpcbind.c Sun May 29 07:01:12 2016 (r300947) @@ -85,7 +85,7 @@ rpcblist_ptr list_rbl; /* A list of vers #define RPCBINDDLOCK "/var/run/rpcbind.lock" -int runasdaemon = 0; +static int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; #ifdef LIBWRAP @@ -93,12 +93,12 @@ int libwrap = 0; #endif int verboselog = 0; -char **hosts = NULL; -struct sockaddr **bound_sa; -int ipv6_only = 0; -int nhosts = 0; -int on = 1; -int rpcbindlockfd; +static char **hosts = NULL; +static struct sockaddr **bound_sa; +static int ipv6_only = 0; +static int nhosts = 0; +static int on = 1; +static int rpcbindlockfd; #ifdef WARMSTART /* Local Variable */ From owner-svn-src-head@freebsd.org Sun May 29 03:01:16 2016 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 20863B4F339; Sun, 29 May 2016 03:01:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E487319F4; Sun, 29 May 2016 03:01:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id f144so40693442pfa.3; Sat, 28 May 2016 20:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=FTsAtD4rg+MtTw181gjg4WeJJeITf2dW+tJNyLiTgHo=; b=ubqVYsZKwgFyPrA0mhgaDOLjG05eW6yCyz6mkK9IGx39Xsyc6bI7pV2P1F70l5ntZu hiVbj3Kj7yHrYEfsvJZeoiQ34CK0Nr5wamo1P1VaOCld1vuCellhrR2Qd7BXJpb57njA uc7jYCyEqTsyT6cPQBun5cdZetFyySq4PPahphqkjXMpJhjDLnrQU2nICHKssZcUba4g RFiHEGKhlDKcPxZqQWSwzhoqBJLJ6mabH3YLBQrrm9CvwI+GaynVoz3oaSyjtAbkCpNZ 7vK4YERl+UUzIkuWvfR/zY1DoeUMYhV4hZnlQ1S591KF+Fg2r9Cx4/9g9cx/vM6oMUFL lf/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=FTsAtD4rg+MtTw181gjg4WeJJeITf2dW+tJNyLiTgHo=; b=X0ucWuW5uY76KJjT9RTGu12ECEQYAl7jop5v6vEqMcV7bUuh0r5YfbIaNwNSdMcxO3 LDX1E1t8RD+5nM46H02YveX26M3dtnGNaYFESxN+iJ7hLympsORlbPfTAUPn8mizRPoL URop8bjPOZux60TDWZsarC/QSIpxp/YCnRHnbcrzRiMBsdGKbJ6kGTQPoTkgRfxeT6rn qezxwvirRCBBqd/shzgw0exe4/V2vLuSK2ueGU3GrAxjh5dtZmVGSe1NHMVCfAcWGQGy IxdG2ynz2YbxVD9n5DjY+2ut9N2yss5PW+yUFoKBsF+bIimu62Ro2et31OMUWwVevZrz piyg== X-Gm-Message-State: ALyK8tJotxVctybipORnWyRxsVusP2r9fSbW/rfxBBMAJNRZVl30xX+FqkAI+dScC6tFyg== X-Received: by 10.98.192.83 with SMTP id x80mr6977520pff.88.1464490875386; Sat, 28 May 2016 20:01:15 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id cc6sm37889982pac.5.2016.05.28.20.01.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2016 20:01:14 -0700 (PDT) Subject: Re: svn commit: r300931 - head/etc/rc.d Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F339854E-F512-4CAE-902D-31B59E93E6AE"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605290259.u4T2x3ZL025803@repo.freebsd.org> Date: Sat, 28 May 2016 20:01:11 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201605290259.u4T2x3ZL025803@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 03:01:16 -0000 --Apple-Mail=_F339854E-F512-4CAE-902D-31B59E93E6AE Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On May 28, 2016, at 19:59, Garrett Cooper wrote: > > Author: ngie > Date: Sun May 29 02:59:03 2016 > New Revision: 300931 > URL: https://svnweb.freebsd.org/changeset/base/300931 > > Log: > Make netif REQUIRE hostid > > As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before > hostid, and the MAC address generated for any bridge devices will be > non-deterministic. Make the MAC address generated be deterministic for > bridge devices by explicitly REQUIRE'ing hostid. > > This fixes up the rest of the PR, inadvertently committed in r299844 > > MFC after: 1 week > PR: 195188 Reported by: Guy Yur --Apple-Mail=_F339854E-F512-4CAE-902D-31B59E93E6AE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXSlt4AAoJEPWDqSZpMIYVYR4P/ijFihsWRWXkDf7tbfXUpFdg HXgyoNpTcnLNg+86UnMDX0JLr9JFflNNQmmwqZ19Fu2ntxi8/aDgxvV5Q7Oyk8de 9yVx/mJPalgAMuOAW2tSVK1mh/x1mAaCKqvnUl130HnGjvklD2sEOFr9KV92hR9q zycWK/71b4/Wl1UjL7kdbDpf/Zru7020fxBdZg8IytJElU0S3sEqHCiLsrbJzxv9 G1SWTzfOyk7kcLBXye9ybI1PUO4DRfJYJwVLvVx43HARmNgYI8fPBAO/HVkXAPog 3IE6ZaBRQtoIL+Z3Zp2vd+C0f7r2MusYJk5ck4MuigOVKbBmbcbZJJ1PP1gJhM3V q38N6Y5ACBcMUjeL/KT4aN6n1SfD4VXSkjhSp7Gy2wPfaOYxNeAaaEe6Aqy7ADVe YlCZIOJO8aeN9hBMjQrbToe1SMLJPvf00PVC2dM8nbmYq9SUtIvZXWx2MV9hDSaH hrT/vkpOzB1y5vLlbXy/bX12ZgracmMhTDu3VHajqRhXqkGQiMjgOOjL71bLMjbB lA5jsqfs9EN4vHmOTSC6slnG9idc18t6dCIeSm/18TEzRv8CGAz9+dM75dggA/ta NrZ0kcIShSu0OABY2yNdob0KDyYlJgu9N/AUha4xCRzC9DWA/ePyB9I2eAHbkZUl JLkP+iKXsghaant+QPAZ =lSNc -----END PGP SIGNATURE----- --Apple-Mail=_F339854E-F512-4CAE-902D-31B59E93E6AE-- From owner-svn-src-head@freebsd.org Sun May 29 01:49:45 2016 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 D9F72B52949; Sun, 29 May 2016 01:49:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA0C1F36; Sun, 29 May 2016 01:49:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id 62so8983125pfd.1; Sat, 28 May 2016 18:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=rkY6gD1llDhS7596GJFAavpyiebX7tdfUJVw76OXx/Y=; b=WU4Iw/NY/n3YuShaK1SvV9jXsbHhuFYcrkBzSOsq/Z2KKNukZG/8+oPt3lfmIpcYoF Ff1vTC71l70vn01J8gONdmlbQO88GpubYsKygmVka9AQQ2SIWoFfl94+WGW3xrSgx176 /29flqAVLMKiZWPHjI39VPuWl3Vwr/5UBZzNkO0owbhgbfiplctyWZUUtrOCyLUb46OP YTKjAjCvVCrPsGfXpKn2GeuJSleIrz4DoPLpptmCASqq6qKKfNxGI97lVlZgEYDroTyV Jaiay9L0wjkoJrvYp1vBFJJD+uTAgMZHvaEzckiGsrYfVqI6qTsH3krd2EAjd6HOM/me UfOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=rkY6gD1llDhS7596GJFAavpyiebX7tdfUJVw76OXx/Y=; b=hEf56I07m8916MEeNRmJOPpITYgt56L8Qe7Etw9id5NRBY00CH9bKeBfY38aatRAev /gpZDKzTgvuPkG4H54fscgq9wI7vuWdgJ2dcy9Rxb9PMJuvM93mr0h238faMiwC+vwqi Na+oVUTsUhc8Aua1yFmIVhkY7tKvD4POVknzmmLIMZ8UmSJ0Li+MBhLuZ2gdDbfQD5Hh 1vK3AYM7qIkHLG6oACVgWQzLXj3EVG26J/1Vez7qAaQOf3jXh3tQgdmBMD+BXx29A9Y8 8YkRhfagV1IfWmLZAISsmcy7sFVxxzmEG8ChEBr7tGDzWBUczs9k5BL9u2t7psZzaS7R CIig== X-Gm-Message-State: ALyK8tIQj2a13iBy1TMqgMxVE2iZed9uEVbV5V+B2xTLjkG80QZ59bP6laoPPog3a0GTkg== X-Received: by 10.98.101.198 with SMTP id z189mr24660847pfb.63.1464486585163; Sat, 28 May 2016 18:49:45 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id ut1sm37722057pac.46.2016.05.28.18.49.44 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2016 18:49:44 -0700 (PDT) Subject: Re: svn commit: r300922 - head/etc/mtree Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BE31EE32-CAD5-44A4-BF7B-7F9DE1CECD3C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Sat, 28 May 2016 18:49:41 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <62262954-A973-43FB-BA56-7EFF68DC5616@gmail.com> References: <201605290138.u4T1cCXG095786@repo.freebsd.org> <7D20215F-1BD4-4198-9AB6-C908227AE882@gmail.com> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 01:49:46 -0000 --Apple-Mail=_BE31EE32-CAD5-44A4-BF7B-7F9DE1CECD3C Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252 > On May 28, 2016, at 18:45, Bryan Drewery wrote: > > On 5/28/16 6:39 PM, Ngie Cooper (yaneurabeya) wrote: >> >>> On May 28, 2016, at 18:38, Garrett Cooper wrote: >>> >>> Author: ngie >>> Date: Sun May 29 01:38:12 2016 >>> New Revision: 300922 >>> URL: https://svnweb.freebsd.org/changeset/base/300922 >>> >>> Log: >>> Fix "make installworld" with MK_CDDL == no after r300906 by >> >> This should read, "!= no" >_>.. > > Pointyhat to: ngie For the commit message, yeah... --Apple-Mail=_BE31EE32-CAD5-44A4-BF7B-7F9DE1CECD3C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXSkq2AAoJEPWDqSZpMIYVli4P/i1SH3ziBiC7pBeH2IHHhIpE KOsdJMng2pBAIH1ha4lqJEtDQ914mu0T5cvgNyybBmP37riEErg9e1Dd5tQdbVHE eqY3AunUJvhF7iWgnmHkhfLxWfaiBkyPeFuTYlX8qWZXZ3pqfAIAFHS27pF3fhvy k+FjC865jekA5qewVRxt0vfA8tNSkVqeIqH6pA+3NO9abFG36+XjIGRaLtPGNY3z fiwwpCUnbB5jkcnEnBWDToVni9vQmGp5KscwuquF1hmcOG3dMhKuuh3FYMpEvc9v Vh7xw38HXZnQgDDEa+5hcfGQMfmQUUPEaIcnB+fawUxBIqhdZO/lKHR6qiSed4sv 2oSUgbt2zLBRv+mREYleZUcLRtBtrM1IMK8ckd7DwUypxvlG3QlWSYiASjgmIB8+ y9K8LZt6wL/2xlSAG9zXw1C2rtVxjW2h6gyRx6EBu71bBPeNex6578XlLvmCHFV8 VxrQzO6Zh4fDar45/XSiiIzjLzlu5vVVTMtjQNDLOMvVA9lb6tskyR6/kedQ2H5A CwcIbPRHOrtGQ5mg4ylkA9NFkP9mLz25qo66MhPAME/vwmYqf3WNTKJbMvhL5r/t rF5HpVN7L3lfMXzZaW6f+MZRG6qtwe5tieSgf/SaFkGqozbxps/0eJN5o/0o8qZk PzUNnxwuXySsnhJCi2fM =05KZ -----END PGP SIGNATURE----- --Apple-Mail=_BE31EE32-CAD5-44A4-BF7B-7F9DE1CECD3C-- From owner-svn-src-head@freebsd.org Sun May 29 01:43:31 2016 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 D1EEDB5235D; Sun, 29 May 2016 01:43:31 +0000 (UTC) (envelope-from phil@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 mx1.freebsd.org (Postfix) with ESMTPS id 9D4F416E5; Sun, 29 May 2016 01:43:31 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T1hUvj099457; Sun, 29 May 2016 01:43:30 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T1hTER099436; Sun, 29 May 2016 01:43:29 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201605290143.u4T1hTER099436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Sun, 29 May 2016 01:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300925 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved lib/libxo 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.22 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: Sun, 29 May 2016 01:43:32 -0000 Author: phil Date: Sun May 29 01:43:28 2016 New Revision: 300925 URL: https://svnweb.freebsd.org/changeset/base/300925 Log: Submitted by: phil Reviewed by: sjg (mentor) Approved by: sjg Modified: head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/doc/libxo.txt head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo_buf.h head/contrib/libxo/libxo/xo_encoder.c head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/tests/core/saved/test_03.E.out head/contrib/libxo/tests/core/saved/test_03.H.out head/contrib/libxo/tests/core/saved/test_03.HIPx.out head/contrib/libxo/tests/core/saved/test_03.HP.out head/contrib/libxo/tests/core/saved/test_03.J.out head/contrib/libxo/tests/core/saved/test_03.JP.out head/contrib/libxo/tests/core/saved/test_03.T.out head/contrib/libxo/tests/core/saved/test_03.X.out head/contrib/libxo/tests/core/saved/test_03.XP.out head/contrib/libxo/tests/core/test_03.c head/lib/libxo/add.man head/lib/libxo/xo_config.h Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/configure.ac Sun May 29 01:43:28 2016 (r300925) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.6.1], [phil@juniper.net]) +AC_INIT([libxo], [0.6.2], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/doc/libxo-manual.html Sun May 29 01:43:28 2016 (r300925) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "April 2016"; + content: "May 2016"; } @top-center { @@ -22009,7 +22009,7 @@ jQuery(function ($) { -April 15, 2016 +May 28, 2016

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

@@ -22739,7 +22739,7 @@ jQuery(function ($) { make make test sudo make install -

The following sections will walk thru each of these steps with additional details and options, but the above directions should be all that's needed.

+

The following sections will walk through each of these steps with additional details and options, but the above directions should be all that's needed.

Section Contents:

  • Section 1.1.2.1
  • @@ -23087,7 +23087,7 @@ jQuery(function ($) { xo_emit("{L:Free}{D::}{P: }{:free/%u} {U:Blocks}\n", free_blocks);

    When a role is not provided, the "value" role is used as the default.

    -

    Roles and modifiers can also use more verbose names, when preceeded by a comma:

    +

    Roles and modifiers can also use more verbose names, when preceded by a comma:

         EXAMPLE:
             xo_emit("{,label:Free}{,decoration::}{,padding:   }"
    @@ -23444,7 +23444,7 @@ jQuery(function ($) {
     
     
     
    -

    Roles and modifiers can also use more verbose names, when preceeded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") means the field has a label role (text that describes the next field) and should be followed by a colon ('c') and a space ('w'). The modifier string "Vkq" (or ":key,quote") means the field has a value role (the default role), that it is a key for the current instance, and that the value should be quoted when encoded for JSON.

    +

    Roles and modifiers can also use more verbose names, when preceded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") means the field has a label role (text that describes the next field) and should be followed by a colon ('c') and a space ('w'). The modifier string "Vkq" (or ":key,quote") means the field has a value role (the default role), that it is a key for the current instance, and that the value should be quoted when encoded for JSON.

    Section Contents:

    • Section 2.2.2.1
    • @@ -23688,7 +23688,7 @@ jQuery(function ($) {
    • a '#' character, indicating the output value should be prefixed with '0x', typically to indicate a base 16 (hex) value.
    • a minus sign ('‑'), indicating the output value should be padded on the right instead of the left.
    • a leading zero ('0') indicating the output value should be padded on the left with zeroes instead of spaces (' ').
    • -
    • one or more digits ('0' - '9') indicating the minimum width of the argument. If the width in columns of the output value is less that the minumum width, the value will be padded to reach the minimum.
    • +
    • one or more digits ('0' - '9') indicating the minimum width of the argument. If the width in columns of the output value is less than the minimum width, the value will be padded to reach the minimum.
    • a period followed by one or more digits indicating the maximum number of bytes which will be examined for a string argument, or the maximum width for a non-string argument. When handling ASCII strings this functions as the field width but for multi-byte characters, a single character may be composed of multiple bytes. xo_emit will never dereference memory beyond the given number of bytes.
    • a second period followed by one or more digits indicating the maximum width for a string argument. This modifier cannot be given for non-string arguments.
    • one or more 'h' characters, indicating shorter input data.
    • Modified: head/contrib/libxo/doc/libxo.txt ============================================================================== --- head/contrib/libxo/doc/libxo.txt Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/doc/libxo.txt Sun May 29 01:43:28 2016 (r300925) @@ -155,7 +155,7 @@ explained in detail in the rest of this make test sudo make install -The following sections will walk thru each of these steps with +The following sections will walk through each of these steps with additional details and options, but the above directions should be all that's needed. @@ -469,7 +469,7 @@ content. The roles are listed below; on When a role is not provided, the "value" role is used as the default. -Roles and modifiers can also use more verbose names, when preceeded by +Roles and modifiers can also use more verbose names, when preceded by a comma: EXAMPLE: @@ -720,7 +720,7 @@ particular output styles: | w | white | A blank (" ") is appended after the label | |---+---------------+--------------------------------------------------| -Roles and modifiers can also use more verbose names, when preceeded by +Roles and modifiers can also use more verbose names, when preceded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") means the field has a label role (text that describes the next field) and should be followed by a colon ('c') and a space ('w'). The @@ -986,8 +986,8 @@ the right instead of the left. - a leading zero ('0') indicating the output value should be padded on the left with zeroes instead of spaces (' '). - one or more digits ('0' - '9') indicating the minimum width of the -argument. If the width in columns of the output value is less that -the minumum width, the value will be padded to reach the minimum. +argument. If the width in columns of the output value is less than +the minimum width, the value will be padded to reach the minimum. - a period followed by one or more digits indicating the maximum number of bytes which will be examined for a string argument, or the maximum width for a non-string argument. When handling ASCII strings this Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/libxo/libxo.c Sun May 29 01:43:28 2016 (r300925) @@ -56,7 +56,7 @@ * (end of word, middle of word, etc) and many that affect characters * previously emitted. Without content, it can't hope to tell us. * But it's the only standard tool we've got, so we use it. We would - * use wcswidth() but it typically just loops thru adding the results + * use wcswidth() but it typically just loops through adding the results * of wcwidth() calls in an entirely unhelpful way. * * Even then, there are many poor implementations (macosx), so we have @@ -97,7 +97,7 @@ /* * Three styles of specifying thread-local variables are supported. - * configure.ac has the brains to run each possibility thru the + * configure.ac has the brains to run each possibility through the * compiler and see what works; we are left to define the THREAD_LOCAL * macro to the right value. Most toolchains (clang, gcc) use * "before", but some (borland) use "after" and I've heard of some @@ -988,7 +988,7 @@ xo_vsnprintf (xo_handle_t *xop, xo_buffe } /* - * Print some data thru the handle. + * Print some data through the handle. */ static int xo_printf_v (xo_handle_t *xop, const char *fmt, va_list vap) @@ -1251,7 +1251,7 @@ xo_buf_append_locale (xo_handle_t *xop, cols += xo_buf_append_locale_from_utf8(xop, xbp, cp, slen); - /* Next time thru, we'll start at the next character */ + /* Next time through, we'll start at the next character */ cp += slen - 1; sp = cp + 1; } @@ -2816,7 +2816,7 @@ xo_format_string (xo_handle_t *xop, xo_b * but if we did the work ourselves, then we need to do it. */ int delta = xfp->xf_width[XF_WIDTH_MIN] - cols; - if (!xo_buf_has_room(xbp, delta)) + if (!xo_buf_has_room(xbp, xfp->xf_width[XF_WIDTH_MIN])) goto bail; /* @@ -3328,7 +3328,7 @@ xo_do_format_field (xo_handle_t *xop, xo case XO_STYLE_XML: if (flags & XFF_TRIM_WS) columns = rc = xo_trim_ws(xbp, rc); - /* fall thru */ + /* FALLTHRU */ case XO_STYLE_HTML: rc = xo_escape_xml(xbp, rc, (flags & XFF_ATTR)); break; @@ -3687,7 +3687,7 @@ xo_buf_append_div (xo_handle_t *xop, con if (flags & XFF_ENCODE_ONLY) { /* - * Even if this is encode-only, we need to go thru the + * Even if this is encode-only, we need to go through the * work of formatting it to make sure the args are cleared * from xo_vap. */ @@ -5342,7 +5342,7 @@ xo_gettext_finish_numbering_fields (xo_h } /* - * The format string uses field numbers, so we need to whiffle thru it + * The format string uses field numbers, so we need to whiffle through it * and make sure everything's sane and lovely. */ static int @@ -6128,6 +6128,12 @@ xo_do_emit_fields (xo_handle_t *xop, xo_ XOIF_CLEAR(xop, XOIF_REORDER); + /* + * If we've got enough data, flush it. + */ + if (xo_buf_offset(&xop->xo_data) > XO_BUF_HIGH_WATER) + flush = 1; + /* If we don't have an anchor, write the text out */ if (flush && !XOIF_ISSET(xop, XOIF_ANCHOR)) { if (xo_write(xop) < 0) @@ -6988,7 +6994,7 @@ xo_do_close_leaf_list (xo_handle_t *xop, case XO_STYLE_ENCODER: rc = xo_encoder_handle(xop, XO_OP_CLOSE_LEAF_LIST, name, NULL); - /*fallthru*/ + /* FALLTHRU */ default: xo_depth_change(xop, name, -1, 0, XSS_CLOSE_LEAF_LIST, XSF_LIST); @@ -7780,9 +7786,9 @@ xo_parse_args (int argc, char **argv) } cp = argv[i] + sizeof(libxo_opt) - 1; - if (*cp == 0) { + if (*cp == '\0') { cp = argv[++i]; - if (cp == 0) { + if (cp == NULL) { xo_warnx("missing libxo option"); return -1; } @@ -7879,7 +7885,7 @@ xo_set_version_h (xo_handle_t *xop, cons } /* - * Set the version number for the API content being carried thru + * Set the version number for the API content being carried through * the xo handle. */ void Modified: head/contrib/libxo/libxo/xo_buf.h ============================================================================== --- head/contrib/libxo/libxo/xo_buf.h Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/libxo/xo_buf.h Sun May 29 01:43:28 2016 (r300925) @@ -19,8 +19,8 @@ #ifndef XO_BUF_H #define XO_BUF_H -#define XO_BUFSIZ (8*1024) /* Initial buffer size */ - +#define XO_BUFSIZ (8*1024) /* Initial buffer size */ +#define XO_BUF_HIGH_WATER (XO_BUFSIZ - 512) /* When to auto-flush */ /* * xo_buffer_t: a memory buffer that can be grown as needed. We * use them for building format strings and output data. Modified: head/contrib/libxo/libxo/xo_encoder.c ============================================================================== --- head/contrib/libxo/libxo/xo_encoder.c Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/libxo/xo_encoder.c Sun May 29 01:43:28 2016 (r300925) @@ -313,7 +313,7 @@ xo_encoder_init (xo_handle_t *xop, const /* * A couple of function varieties here, to allow for multiple - * use cases. This varient is for when the main program knows + * use cases. This variant is for when the main program knows * its own encoder needs. */ xo_handle_t * Modified: head/contrib/libxo/libxo/xo_format.5 ============================================================================== --- head/contrib/libxo/libxo/xo_format.5 Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/libxo/xo_format.5 Sun May 29 01:43:28 2016 (r300925) @@ -116,7 +116,7 @@ The roles are listed below; only one rol .Pp When a role is not provided, the "value" role is used as the default. .Pp -Roles and modifiers can also use more verbose names, when preceeded by +Roles and modifiers can also use more verbose names, when preceded by a comma: .Bd -literal -offset indent EXAMPLE: @@ -380,7 +380,7 @@ The modifier string "Vkq" means the field has a value role, that it is a key for the current instance, and that the value should be quoted when encoded for JSON. .Pp -Roles and modifiers can also use more verbose names, when preceeded by +Roles and modifiers can also use more verbose names, when preceded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") means the field has a label role (text that describes the next field) Modified: head/contrib/libxo/tests/core/saved/test_03.E.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.E.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.E.out Sun May 29 01:43:28 2016 (r300925) @@ -1,6 +1,18 @@ op create: [] [] op open_container: [employees] [] op open_list: [employee] [] +op close_list: [employee] [] +op string: [extra] [] +op open_list: [memory] [] +op open_instance: [memory] [] +op string: [type] [name] +op content: [in-use] [12345] +op content: [memory-use] [54321] +op string: [high-use] [-] +op content: [requests] [32145] +op close_instance: [memory] [] +op close_list: [memory] [] +op open_list: [employee] [] op open_instance: [employee] [] op string: [first-name] [Terry] op string: [last-name] [Jones] Modified: head/contrib/libxo/tests/core/saved/test_03.H.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.H.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.H.out Sun May 29 01:43:28 2016 (r300925) @@ -1 +1 @@ -
      Terry
      Jones
      works in dept #
      660
      Leslie
      Patterson
      works in dept #
      341
      Ashley
      Smith
      works in dept #
      1440
      \ No newline at end of file +
      [
      ]
      Type
      InUse
      MemUse
      HighUse
      Requests
      Size(s)
      name
      12345
      54321
      K
      -
      32145
      Terry
      Jones
      works in dept #
      660
      Leslie
      Patterson
      works in dept #
      341
      Ashley
      Smith
      works in dept #
      1440
      done
      \ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_03.HIPx.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.HIPx.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.HIPx.out Sun May 29 01:43:28 2016 (r300925) @@ -1,4 +1,35 @@
      +
      [
      +
      +
      ]
      +
      +
      +
      Type
      +
      +
      InUse
      +
      +
      MemUse
      +
      +
      HighUse
      +
      +
      Requests
      +
      +
      Size(s)
      +
      +
      +
      name
      +
      +
      12345
      +
      +
      54321
      +
      K
      +
      +
      -
      +
      +
      32145
      +
      +
      +
      Terry
      Jones
      @@ -19,3 +50,6 @@
      works in dept #
      1440
      +
      +
      done
      +
      Modified: head/contrib/libxo/tests/core/saved/test_03.HP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.HP.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.HP.out Sun May 29 01:43:28 2016 (r300925) @@ -1,4 +1,35 @@
      +
      [
      +
      +
      ]
      +
      +
      +
      Type
      +
      +
      InUse
      +
      +
      MemUse
      +
      +
      HighUse
      +
      +
      Requests
      +
      +
      Size(s)
      +
      +
      +
      name
      +
      +
      12345
      +
      +
      54321
      +
      K
      +
      +
      -
      +
      +
      32145
      +
      +
      +
      Terry
      Jones
      @@ -19,3 +50,6 @@
      works in dept #
      1440
      +
      +
      done
      +
      Modified: head/contrib/libxo/tests/core/saved/test_03.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.J.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.J.out Sun May 29 01:43:28 2016 (r300925) @@ -1,2 +1,2 @@ -{"employees": {"employee": [{"first-name":"Terry","last-name":"Jones","department":660}, {"first-name":"Leslie","last-name":"Patterson","department":341}, {"first-name":"Ashley","last-name":"Smith","department":1440}]} +{"employees": {"employee": [],"extra":"", "memory": [{"type":"name","in-use":12345,"memory-use":54321,"high-use":"-","requests":32145}], "employee": [{"first-name":"Terry","last-name":"Jones","department":660}, {"first-name":"Leslie","last-name":"Patterson","department":341}, {"first-name":"Ashley","last-name":"Smith","department":1440}]} } Modified: head/contrib/libxo/tests/core/saved/test_03.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.JP.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.JP.out Sun May 29 01:43:28 2016 (r300925) @@ -1,6 +1,18 @@ { "employees": { "employee": [ + ], + "extra": "", + "memory": [ + { + "type": "name", + "in-use": 12345, + "memory-use": 54321, + "high-use": "-", + "requests": 32145 + } + ], + "employee": [ { "first-name": "Terry", "last-name": "Jones", Modified: head/contrib/libxo/tests/core/saved/test_03.T.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.T.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.T.out Sun May 29 01:43:28 2016 (r300925) @@ -1,3 +1,7 @@ +[] + Type InUse MemUse HighUse Requests Size(s) + name 12345 54321K - 32145 Terry Jones works in dept #660 Leslie Patterson works in dept #341 Ashley Smith works in dept #1440 +done Modified: head/contrib/libxo/tests/core/saved/test_03.X.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.X.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.X.out Sun May 29 01:43:28 2016 (r300925) @@ -1 +1 @@ -TerryJones660LesliePatterson341AshleySmith1440 \ No newline at end of file +name1234554321-32145TerryJones660LesliePatterson341AshleySmith1440 \ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_03.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_03.XP.out Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/saved/test_03.XP.out Sun May 29 01:43:28 2016 (r300925) @@ -1,4 +1,12 @@ + + + name + 12345 + 54321 + - + 32145 + Terry Jones Modified: head/contrib/libxo/tests/core/test_03.c ============================================================================== --- head/contrib/libxo/tests/core/test_03.c Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/tests/core/test_03.c Sun May 29 01:43:28 2016 (r300925) @@ -25,6 +25,9 @@ int info_count = (sizeof(info) / sizeof( int main (int argc, char **argv) { + unsigned opt_count = 1; + unsigned opt_extra = 0; + struct employee { const char *e_first; const char *e_last; @@ -34,24 +37,68 @@ main (int argc, char **argv) { "Leslie", "Patterson", 341 }, { "Ashley", "Smith", 1440 }, { NULL, NULL } - }, *ep = employees; + }, *ep; argc = xo_parse_args(argc, argv); if (argc < 0) return 1; + for (argc = 1; argv[argc]; argc++) { + if (strcmp(argv[argc], "count") == 0) { + if (argv[argc + 1]) + opt_count = atoi(argv[++argc]); + } else if (strcmp(argv[argc], "extra") == 0) { + if (argv[argc + 1]) + opt_extra = atoi(argv[++argc]); + } + } + xo_set_info(NULL, info, info_count); xo_open_container("employees"); xo_open_list("employee"); - for ( ; ep->e_first; ep++) { - xo_open_instance("employee"); - xo_emit("{:first-name} {:last-name} works in dept #{:department/%u}\n", - ep->e_first, ep->e_last, ep->e_dept); - xo_close_instance("employee"); + xo_emit("[{:extra/%*s}]\n", opt_extra, ""); + + xo_emit("{T:/%13s} {T:/%5s} {T:/%6s} {T:/%7s} {T:/%8s} {T:Size(s)}\n", + "Type", "InUse", "MemUse", "HighUse", "Requests"); + xo_open_list("memory"); + xo_open_instance("memory"); + +#define PRIu64 "llu" +#define TO_ULL(_x) ((unsigned long long) _x) + xo_emit("{k:type/%13s} {:in-use/%5" PRIu64 "} " + "{:memory-use/%5" PRIu64 "}{U:K} {:high-use/%7s} " + "{:requests/%8" PRIu64 "} ", + "name", TO_ULL(12345), TO_ULL(54321), "-", TO_ULL(32145)); + + int first = 1, i; +#if 0 + xo_open_list("size"); + for (i = 0; i < 32; i++) { + if (!first) + xo_emit(","); + xo_emit("{l:size/%d}", 1 << (i + 4)); + first = 0; + } + xo_close_list("size"); +#endif + xo_close_instance("memory"); + xo_emit("\n"); + xo_close_list("memory"); + + while (opt_count-- != 0) { + for (ep = employees; ep->e_first; ep++) { + xo_open_instance("employee"); + xo_emit("{:first-name} {:last-name} works in " + "dept #{:department/%u}\n", + ep->e_first, ep->e_last, ep->e_dept); + xo_close_instance("employee"); + } } + xo_emit("done\n"); + xo_close_list("employee"); xo_close_container("employees"); Modified: head/lib/libxo/add.man ============================================================================== --- head/lib/libxo/add.man Sun May 29 01:40:48 2016 (r300924) +++ head/lib/libxo/add.man Sun May 29 01:43:28 2016 (r300925) @@ -3,10 +3,10 @@ .Fx uses .Nm libxo -version 0.6.1. +version 0.6.2. Complete documentation can be found on github: .Bd -literal -offset indent -http://juniper.github.io/libxo/0.6.1/libxo\-manual.html +http://juniper.github.io/libxo/0.6.2/libxo\-manual.html .Ed .Pp .Nm libxo Modified: head/lib/libxo/xo_config.h ============================================================================== --- head/lib/libxo/xo_config.h Sun May 29 01:40:48 2016 (r300924) +++ head/lib/libxo/xo_config.h Sun May 29 01:43:28 2016 (r300925) @@ -183,16 +183,16 @@ /* #undef LIBXO_TEXT_ONLY */ /* Version number as dotted value */ -#define LIBXO_VERSION "0.6.1" +#define LIBXO_VERSION "0.6.2" /* Version number extra information */ #define LIBXO_VERSION_EXTRA "" /* Version number as a number */ -#define LIBXO_VERSION_NUMBER 6001 +#define LIBXO_VERSION_NUMBER 6002 /* Version number as string */ -#define LIBXO_VERSION_STRING "6001" +#define LIBXO_VERSION_STRING "6002" /* Enable local wcwidth implementation */ #define LIBXO_WCWIDTH 1 @@ -210,7 +210,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 0.6.1" +#define PACKAGE_STRING "libxo 0.6.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -219,7 +219,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.6.1" +#define PACKAGE_VERSION "0.6.2" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -233,7 +233,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.6.1" +#define VERSION "0.6.2" /* Retain hash bucket size */ /* #undef XO_RETAIN_SIZE */ From owner-svn-src-head@freebsd.org Sun May 29 07:39:57 2016 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 899B7B4E4CB; Sun, 29 May 2016 07:39:57 +0000 (UTC) (envelope-from mmel@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 mx1.freebsd.org (Postfix) with ESMTPS id 5A2AA144E; Sun, 29 May 2016 07:39:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T7duas031674; Sun, 29 May 2016 07:39:56 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T7du6d031673; Sun, 29 May 2016 07:39:56 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201605290739.u4T7du6d031673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 29 May 2016 07:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300951 - head/sys/arm/arm 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.22 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: Sun, 29 May 2016 07:39:57 -0000 Author: mmel Date: Sun May 29 07:39:56 2016 New Revision: 300951 URL: https://svnweb.freebsd.org/changeset/base/300951 Log: ARM GIC: Allow to setup interrupt without configuration data. In some cases, like for PCI devices, only interrupt numbers are enumerated from HW. In this case, use INTR_foo_CONFORM as level and trigger values. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Sun May 29 07:29:35 2016 (r300950) +++ head/sys/arm/arm/gic.c Sun May 29 07:39:56 2016 (r300951) @@ -1128,8 +1128,11 @@ arm_gic_setup_intr(device_t dev, struct if (gi->gi_irq != irq) return (EINVAL); - } else - return (ENOTSUP); + } else { + irq = gi->gi_irq; + pol = INTR_POLARITY_CONFORM; + trig = INTR_TRIGGER_CONFORM; + } /* Compare config if this is not first setup. */ if (isrc->isrc_handlers != 0) { From owner-svn-src-head@freebsd.org Sun May 29 04:02:03 2016 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 6CCFAB506CB; Sun, 29 May 2016 04:02:03 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 34AB412A6; Sun, 29 May 2016 04:02:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T422Fl050938; Sun, 29 May 2016 04:02:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T422FC050937; Sun, 29 May 2016 04:02:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290402.u4T422FC050937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300934 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 04:02:03 -0000 Author: ngie Date: Sun May 29 04:02:02 2016 New Revision: 300934 URL: https://svnweb.freebsd.org/changeset/base/300934 Log: Plug leak with ifp by calling freeifaddrs after calling getifaddrs MFC after: 1 week Obtained from: NetBSD v1.18 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Sun May 29 03:44:37 2016 (r300933) +++ head/usr.sbin/rpcbind/util.c Sun May 29 04:02:02 2016 (r300934) @@ -393,6 +393,7 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } + freeifaddrs(ifp); #endif /* close(s); */ From owner-svn-src-head@freebsd.org Sun May 29 03:44:46 2016 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 3CB80B4F4B7; Sun, 29 May 2016 03:44:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0609E1390; Sun, 29 May 2016 03:44:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id B82D21AE2; Sun, 29 May 2016 03:44:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 629C81E7B3; Sun, 29 May 2016 03:44:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id FT7zEPHQwlzj; Sun, 29 May 2016 03:44:42 +0000 (UTC) Subject: Re: svn commit: r300932 - head/usr.sbin/rpcbind DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 410D91E7AE To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605290342.u4T3gpUB045575@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <7c4e662d-069c-114e-c9d1-320a6571bc89@FreeBSD.org> Date: Sat, 28 May 2016 20:44:46 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605290342.u4T3gpUB045575@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BoeIgGDBPsdGG3jn6wrrDFnGUegbQF7tV" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 03:44:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BoeIgGDBPsdGG3jn6wrrDFnGUegbQF7tV Content-Type: multipart/mixed; boundary="RoNEPexakSpcJq7tDO4S52VWxpvbn5xmt" From: Bryan Drewery To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7c4e662d-069c-114e-c9d1-320a6571bc89@FreeBSD.org> Subject: Re: svn commit: r300932 - head/usr.sbin/rpcbind References: <201605290342.u4T3gpUB045575@repo.freebsd.org> In-Reply-To: <201605290342.u4T3gpUB045575@repo.freebsd.org> --RoNEPexakSpcJq7tDO4S52VWxpvbn5xmt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/28/2016 8:42 PM, Garrett Cooper wrote: > Author: ngie > Date: Sun May 29 03:42:50 2016 > New Revision: 300932 > URL: https://svnweb.freebsd.org/changeset/base/300932 >=20 > Log: > Catch malloc(3) errors and socket(2) errors > =20 > - malloc failing will result in a delayed segfault > - socket failing will result in delayed failures with setsockopt > =20 > Exit in the event that either of these high-level conditions are met.= > =20 > Reported by: Coverity > CID: 976288, 976321, 976858 > Sponsored by: EMC / Isilon Storage Division >=20 > Modified: > head/usr.sbin/rpcbind/util.c >=20 > Modified: head/usr.sbin/rpcbind/util.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/rpcbind/util.c Sun May 29 02:59:03 2016 (r300931) > +++ head/usr.sbin/rpcbind/util.c Sun May 29 03:42:50 2016 (r300932) > @@ -336,6 +336,7 @@ network_init(void) > if (local_in4 =3D=3D NULL) { > if (debugging) > fprintf(stderr, "can't alloc local ip4 addr\n"); > + exit(1); > } > memcpy(local_in4, res->ai_addr, sizeof *local_in4); > } > @@ -351,6 +352,7 @@ network_init(void) > if (local_in6 =3D=3D NULL) { > if (debugging) > fprintf(stderr, "can't alloc local ip6 addr\n"); > + exit(1); Did something meaningful get printed before this on hitting this error, without debug? > } > memcpy(local_in6, res->ai_addr, sizeof *local_in6); > } > @@ -365,6 +367,11 @@ network_init(void) > inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); > =20 > s =3D socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); > + if (s =3D=3D -1) { > + if (debugging) > + fprintf(stderr, "couldn't create ip6 socket"); > + exit(1); > + } > =20 > /* > * Loop through all interfaces. For each IPv6 multicast-capable >=20 --=20 Regards, Bryan Drewery --RoNEPexakSpcJq7tDO4S52VWxpvbn5xmt-- --BoeIgGDBPsdGG3jn6wrrDFnGUegbQF7tV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXSmWuAAoJEDXXcbtuRpfPMb8H/1GO+38HfA/JQlZI9LfBS+DV /F/Taa+i7BxEFNBqV3m0ZSANuWou24fPW3n1pZDLoqhazZo6fqsRQojYCEMMAImz oucBnnAniZvQwnI66aYzAAUKJEroLzHb4VWa4atkMbMloEFzPW/bzn9nXzyEb7SA fftULWP+CrwNXi4eGI2YpAyzcpsbHACQCou3yBwO0mRFPeoclDlNwIwvdg+m0/xD Ci8HwpvkmTKhuLERRNNlIGK+VLqVZOIgwcFr+iudab7YqGDb5hgsa/DI/fi+ggVY KB1MG3sHn8OSeB7J+twW7cc3ej/xC5PIlcozEz/N8MuneD8ojFW/9pJXIR49IWI= =ZlrK -----END PGP SIGNATURE----- --BoeIgGDBPsdGG3jn6wrrDFnGUegbQF7tV-- From owner-svn-src-head@freebsd.org Sun May 29 04:30:55 2016 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 05AC7B50132; Sun, 29 May 2016 04:30:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E8C7E1ABB; Sun, 29 May 2016 04:30:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E321B1EC5; Sun, 29 May 2016 04:30:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9DA5A1E869; Sun, 29 May 2016 04:30:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id X3TkpDkohWch; Sun, 29 May 2016 04:30:47 +0000 (UTC) Subject: Re: svn commit: r300926 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CCBBE1E863 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605290145.u4T1jFOX099601@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <73c7c1db-d753-e065-1b51-acc5f3f8c137@FreeBSD.org> Date: Sat, 28 May 2016 21:30:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605290145.u4T1jFOX099601@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 04:30:55 -0000 On 5/28/16 6:45 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Sun May 29 01:45:15 2016 > New Revision: 300926 > URL: https://svnweb.freebsd.org/changeset/base/300926 > > Log: > Libcompat: Set build tools in environment rather than make overrides. > Sigh. I just realized this breaks the build for users who put CC= in their make.conf. I'm just going to revert all of work leading up to this and implement the original fix differently. > This allows the CXX hack in r300917 for external GCC to work for > the lib32 build. It is also the same pattern as the native > build uses by adding the tools into CROSSENV for external > toolchain, rather than make overrides. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/Makefile.libcompat > > Modified: head/Makefile.libcompat > ============================================================================== > --- head/Makefile.libcompat Sun May 29 01:43:28 2016 (r300925) > +++ head/Makefile.libcompat Sun May 29 01:45:15 2016 (r300926) > @@ -17,7 +17,7 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} > .endif > LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ > MACHINE_CPU="i686 mmx sse sse2" > -LIB32WMAKEFLAGS= \ > +LIB32WMAKEENV+= \ > AS="${XAS} --32" \ > LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ > OBJCOPY="${XOBJCOPY}" > @@ -29,7 +29,7 @@ LIB32CPUFLAGS= -mcpu=powerpc > LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} > .endif > LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc > -LIB32WMAKEFLAGS= \ > +LIB32WMAKEENV+= \ > LD="${XLD} -m elf32ppc_fbsd" \ > OBJCOPY="${XOBJCOPY}" > .endif > @@ -84,9 +84,11 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L > # Don't rebuild build-tools targets during normal build. > LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA_CMP > .endif > -LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ > +LIBCOMPATWMAKEENV+= \ > + CC="${XCC} ${LIBCOMPATCFLAGS}" \ > CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ > - CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ > + CPP="${XCPP} ${LIBCOMPATCFLAGS}" > +LIBCOMPATWMAKEFLAGS+= \ > DESTDIR=${LIBCOMPATTMP} \ > -DNO_CPU_CFLAGS \ > MK_CTF=no \ > -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Sun May 29 06:01:19 2016 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 8BD2FB52259; Sun, 29 May 2016 06:01:19 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 597B81A96; Sun, 29 May 2016 06:01:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T61IxF097149; Sun, 29 May 2016 06:01:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T61I33097148; Sun, 29 May 2016 06:01:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290601.u4T61I33097148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 06:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300942 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 06:01:19 -0000 Author: ngie Date: Sun May 29 06:01:18 2016 New Revision: 300942 URL: https://svnweb.freebsd.org/changeset/base/300942 Log: Remove a useless if (x != NULL) check before calling free on allocated_uaddr MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/check_bound.c Modified: head/usr.sbin/rpcbind/check_bound.c ============================================================================== --- head/usr.sbin/rpcbind/check_bound.c Sun May 29 05:55:21 2016 (r300941) +++ head/usr.sbin/rpcbind/check_bound.c Sun May 29 06:01:18 2016 (r300942) @@ -219,8 +219,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch fprintf(stderr, "mergeaddr: uaddr = %s, merged uaddr = %s\n", uaddr, m_uaddr); #endif - if (allocated_uaddr != NULL) - free(allocated_uaddr); + free(allocated_uaddr); return (m_uaddr); } From owner-svn-src-head@freebsd.org Sun May 29 04:18:48 2016 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 4DBB1B536F2; Sun, 29 May 2016 04:18:48 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 1B72410EA; Sun, 29 May 2016 04:18:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T4IlNa057644; Sun, 29 May 2016 04:18:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T4IlWI057643; Sun, 29 May 2016 04:18:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290418.u4T4IlWI057643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300935 - head/usr.sbin/rpc.statd 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.22 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: Sun, 29 May 2016 04:18:48 -0000 Author: ngie Date: Sun May 29 04:18:47 2016 New Revision: 300935 URL: https://svnweb.freebsd.org/changeset/base/300935 Log: Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call exit as a hint to static analysis tools MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpc.statd/statd.c Modified: head/usr.sbin/rpc.statd/statd.c ============================================================================== --- head/usr.sbin/rpc.statd/statd.c Sun May 29 04:02:02 2016 (r300934) +++ head/usr.sbin/rpc.statd/statd.c Sun May 29 04:18:47 2016 (r300935) @@ -72,9 +72,9 @@ static int create_service(struct netconf static void complete_service(struct netconfig *nconf, char *port_str); static void clearout_service(void); static void handle_sigchld(int sig); -void out_of_mem(void); +void out_of_mem(void) __dead2; -static void usage(void); +static void usage(void) __dead2; int main(int argc, char **argv) @@ -613,7 +613,7 @@ clearout_service(void) } static void -usage() +usage(void) { fprintf(stderr, "usage: rpc.statd [-d] [-h ] [-p ]\n"); exit(1); @@ -647,7 +647,7 @@ static void handle_sigchld(int sig __unu * Out of memory, fatal */ void -out_of_mem() +out_of_mem(void) { syslog(LOG_ERR, "out of memory"); From owner-svn-src-head@freebsd.org Sun May 29 04:50:50 2016 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 6DC90B4F39F; Sun, 29 May 2016 04:50:50 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 3B88F1C15; Sun, 29 May 2016 04:50:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T4onxg069587; Sun, 29 May 2016 04:50:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T4onMi069586; Sun, 29 May 2016 04:50:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290450.u4T4onMi069586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300939 - head/bin/ls/tests 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.22 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: Sun, 29 May 2016 04:50:50 -0000 Author: ngie Date: Sun May 29 04:50:49 2016 New Revision: 300939 URL: https://svnweb.freebsd.org/changeset/base/300939 Log: Use require.progs with bc instead of require.files with /usr/bin/bc This will make things more flexible if the program path changes in the future, and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/bin/ls/tests/ls_tests.sh Modified: head/bin/ls/tests/ls_tests.sh ============================================================================== --- head/bin/ls/tests/ls_tests.sh Sun May 29 04:47:10 2016 (r300938) +++ head/bin/ls/tests/ls_tests.sh Sun May 29 04:50:49 2016 (r300939) @@ -535,7 +535,7 @@ atf_test_case h_flag h_flag_head() { atf_set "descr" "Verify that -h prints out the humanized units for file sizes with ls -l" - atf_set "require.files" "/usr/bin/bc" + atf_set "require.progs" "bc" } h_flag_body() From owner-svn-src-head@freebsd.org Sun May 29 04:56:50 2016 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 0A025B4F902; Sun, 29 May 2016 04:56:50 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id CDC321F22; Sun, 29 May 2016 04:56:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T4unrx073193; Sun, 29 May 2016 04:56:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T4un3r073192; Sun, 29 May 2016 04:56:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290456.u4T4un3r073192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300940 - head/tools/build/mk 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.22 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: Sun, 29 May 2016 04:56:50 -0000 Author: ngie Date: Sun May 29 04:56:48 2016 New Revision: 300940 URL: https://svnweb.freebsd.org/changeset/base/300940 Log: Remove yacc and the yacc tests if MK_TOOLCHAIN == no yacc's install is conditional based on MK_TOOLCHAIN != no MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:50:49 2016 (r300939) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:56:48 2016 (r300940) @@ -8009,6 +8009,7 @@ OLD_FILES+=usr/share/man/man1/ul.1.gz .if ${MK_TOOLCHAIN} == no OLD_FILES+=usr/bin/addr2line OLD_FILES+=usr/bin/as +OLD_FILES+=usr/bin/byacc OLD_FILES+=usr/bin/cc OLD_FILES+=usr/bin/c88 OLD_FILES+=usr/bin/c++ @@ -8020,6 +8021,7 @@ OLD_FILES+=usr/bin/readelf OLD_FILES+=usr/bin/size OLD_FILES+=usr/bin/strings OLD_FILES+=usr/bin/strip +OLD_FILES+=usr/bin/yacc OLD_FILES+=usr/share/man/man1/addr2line.1.gz OLD_FILES+=usr/share/man/man1/c++filt.1.gz OLD_FILES+=usr/share/man/man1/nm.1.gz @@ -8031,6 +8033,314 @@ OLD_FILES+=usr/share/man/man1/strip.1.gz OLD_FILES+=usr/bin/objcopy OLD_FILES+=usr/share/man/man1/objcopy.1.gz .endif +OLD_FILES+=usr/tests/usr.bin/yacc/Kyuafile +OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y +OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc1.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc2.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc3.y +OLD_FILES+=usr/tests/usr.bin/yacc/code_calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/code_debug.y +OLD_FILES+=usr/tests/usr.bin/yacc/code_error.y +OLD_FILES+=usr/tests/usr.bin/yacc/empty.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit1.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit2.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit3.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit4.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit5.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax1.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax10.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax11.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax12.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax13.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax14.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax15.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax16.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax17.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax18.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax19.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax2.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax20.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax21.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax22.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax23.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax24.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax25.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax26.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax27.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax3.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax4.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax5.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax6.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax7.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax7a.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax7b.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax8.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax8a.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax9.y +OLD_FILES+=usr/tests/usr.bin/yacc/error.y +OLD_FILES+=usr/tests/usr.bin/yacc/grammar.y +OLD_FILES+=usr/tests/usr.bin/yacc/inherit0.y +OLD_FILES+=usr/tests/usr.bin/yacc/inherit1.y +OLD_FILES+=usr/tests/usr.bin/yacc/inherit2.y +OLD_FILES+=usr/tests/usr.bin/yacc/ok_syntax1.y +OLD_FILES+=usr/tests/usr.bin/yacc/pure_calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/pure_error.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc2.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc3.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc4.y +OLD_FILES+=usr/tests/usr.bin/yacc/run_test +OLD_FILES+=usr/tests/usr.bin/yacc/varsyntax_calc1.y +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_b.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_b.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_l.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_l.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc2.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc2.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc2.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc2.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc3.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc3.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc3.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc3.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_calc.code.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_calc.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_calc.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_calc.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_calc.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_error.code.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_error.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_error.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_error.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/code_error.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/empty.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/empty.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/empty.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/empty.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax1.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax1.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax10.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax10.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax10.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax10.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax11.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax11.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax11.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax11.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax12.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax12.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax12.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax12.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax13.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax13.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax13.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax13.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax14.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax14.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax14.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax14.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax15.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax15.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax15.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax15.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax16.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax16.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax16.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax16.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax17.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax17.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax17.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax17.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax18.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax18.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax18.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax18.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax19.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax19.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax19.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax19.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax2.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax2.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax2.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax2.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax20.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax20.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax20.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax20.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax21.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax21.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax21.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax21.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax22.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax22.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax22.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax22.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax23.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax23.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax23.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax23.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax24.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax24.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax24.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax24.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax25.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax25.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax25.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax25.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax26.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax26.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax26.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax26.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax27.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax27.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax27.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax27.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax3.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax3.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax3.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax3.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax4.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax4.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax4.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax4.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax5.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax5.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax5.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax5.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax6.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax6.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax6.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax6.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7a.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7a.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7a.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7a.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7b.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7b.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7b.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax7b.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8a.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8a.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8a.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax8a.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax9.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax9.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax9.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/err_syntax9.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/error.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/error.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/error.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/error.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/grammar.dot +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/grammar.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/grammar.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/grammar.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/grammar.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/help.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/help.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_b_opt.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_b_opt.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_b_opt1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_b_opt1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_code_c.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_code_c.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_defines.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_defines.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_graph.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_graph.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_include.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_include.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_opts.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_opts.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_output.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_output.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_output1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_output1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_output2.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_output2.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_p_opt.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_p_opt.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_p_opt1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_p_opt1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_verbose.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/no_verbose.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/nostdin.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/nostdin.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/ok_syntax1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/ok_syntax1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/ok_syntax1.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/ok_syntax1.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_calc.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_calc.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_calc.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_calc.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_error.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_error.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_error.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/pure_error.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc-s.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc-s.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc-s.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc-s.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2-s.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2-s.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2-s.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2-s.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc2.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3-s.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3-s.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3-s.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3-s.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc3.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4-s.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4-s.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4-s.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4-s.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/quote_calc4.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/rename_debug.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/rename_debug.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/rename_debug.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/rename_debug.i +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/rename_debug.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc_tests +OLD_DIRS+=usr/tests/usr.bin/yacc .endif .if ${MK_TOOLCHAIN} == no || ${MK_ELFCOPY_AS_OBJCOPY} != no OLD_FILES+=usr/bin/elfcopy From owner-svn-src-head@freebsd.org Sun May 29 05:55:22 2016 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 AD8B2B51CEF; Sun, 29 May 2016 05:55:22 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 7F2731513; Sun, 29 May 2016 05:55:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T5tLKF094730; Sun, 29 May 2016 05:55:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T5tLT9094729; Sun, 29 May 2016 05:55:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290555.u4T5tLT9094729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 05:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300941 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 05:55:22 -0000 Author: ngie Date: Sun May 29 05:55:21 2016 New Revision: 300941 URL: https://svnweb.freebsd.org/changeset/base/300941 Log: Don't leak res in network_init(..) Call freeaddrinfo on it after it's been used MFC after: 1 week Reported by: Coverity CID: 1225050 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Sun May 29 04:56:48 2016 (r300940) +++ head/usr.sbin/rpcbind/util.c Sun May 29 05:55:21 2016 (r300941) @@ -396,6 +396,7 @@ network_init(void) freeifaddrs(ifp); #endif + freeaddrinfo(res); /* close(s); */ } From owner-svn-src-head@freebsd.org Sun May 29 06:20:17 2016 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 88BFAB511E5; Sun, 29 May 2016 06:20:17 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 46B8A14A7; Sun, 29 May 2016 06:20:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T6KGkO002318; Sun, 29 May 2016 06:20:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T6KFjT002312; Sun, 29 May 2016 06:20:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605290620.u4T6KFjT002312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 May 2016 06:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk 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.22 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: Sun, 29 May 2016 06:20:17 -0000 Author: bdrewery Date: Sun May 29 06:20:15 2016 New Revision: 300943 URL: https://svnweb.freebsd.org/changeset/base/300943 Log: GCC External: Revert r300886, r300904, r300917, r300918 The fix in r300873 is mostly enough. A fix for lib32 will be committed.separately. Modified: head/Makefile.inc1 head/Makefile.libcompat head/lib/libc++/Makefile head/lib/libcxxrt/Makefile head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun May 29 06:01:18 2016 (r300942) +++ head/Makefile.inc1 Sun May 29 06:20:15 2016 (r300943) @@ -527,7 +527,13 @@ TARGET_ABI= gnueabihf TARGET_ABI= gnueabi .endif .endif -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "clang" +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +# GCC requires -isystem and -L when using a cross-compiler. +XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib +# Force using libc++ for external GCC. +XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${WORLDTMP}/../lib/libc++ +.else TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sun May 29 06:01:18 2016 (r300942) +++ head/Makefile.libcompat Sun May 29 06:20:15 2016 (r300943) @@ -17,7 +17,7 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ MACHINE_CPU="i686 mmx sse sse2" -LIB32WMAKEENV+= \ +LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ OBJCOPY="${XOBJCOPY}" @@ -29,7 +29,7 @@ LIB32CPUFLAGS= -mcpu=powerpc LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc -LIB32WMAKEENV+= \ +LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" \ OBJCOPY="${XOBJCOPY}" .endif @@ -72,6 +72,13 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +# GCC requires -isystem when using a cross-compiler. +LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include +# Force using libc++ for external GCC. +LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ +.endif # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ @@ -84,11 +91,9 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L # Don't rebuild build-tools targets during normal build. LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA_CMP .endif -LIBCOMPATWMAKEENV+= \ - CC="${XCC} ${LIBCOMPATCFLAGS}" \ +LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ - CPP="${XCPP} ${LIBCOMPATCFLAGS}" -LIBCOMPATWMAKEFLAGS+= \ + CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ MK_CTF=no \ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Sun May 29 06:01:18 2016 (r300942) +++ head/lib/libc++/Makefile Sun May 29 06:20:15 2016 (r300943) @@ -63,7 +63,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOME .endfor WARNS= 0 -CFLAGS+= -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT +CFLAGS+= -isystem ${HDRDIR} -isystem ${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Sun May 29 06:01:18 2016 (r300942) +++ head/lib/libcxxrt/Makefile Sun May 29 06:20:15 2016 (r300943) @@ -21,7 +21,7 @@ SRCS+= libelftc_dem_gnu3.c\ guard.cc WARNS= 0 -CFLAGS+= -I${SRCDIR} -nostdinc++ +CFLAGS+= -isystem ${SRCDIR} -nostdinc++ .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sun May 29 06:01:18 2016 (r300942) +++ head/share/mk/bsd.compiler.mk Sun May 29 06:20:15 2016 (r300943) @@ -108,10 +108,8 @@ ccache-print-options: .PHONY # CC and COMPILER_* settings here. _exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ ${X_}COMPILER_FREEBSD_VERSION -# Handle importing cached vars, but not for X_ vars. -.if ${X_} == "" -_cc_hash= ${${cc}}${MACHINE}${PATH} -_cc_hash:= ${_cc_hash:hash} +${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} +${X_}_cc_hash:= ${${X_}_cc_hash:hash} # Only import if none of the vars are set somehow else. _can_export= yes .for var in ${_exported_vars} @@ -121,12 +119,11 @@ _can_export= no .endfor .if ${_can_export} == yes .for var in ${_exported_vars} -.if defined(${var}.${_cc_hash}) -${var}= ${${var}.${_cc_hash}} +.if defined(${var}.${${X_}_cc_hash}) +${var}= ${${var}.${${X_}_cc_hash}} .endif .endfor .endif -.endif # ${X_} == "" .if ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) .if ${MACHINE} == "common" @@ -186,14 +183,9 @@ X_COMPILER_FEATURES= ${COMPILER_FEATURES # Export the values so sub-makes don't have to look them up again, using the # hash key computed above. .for var in ${_exported_vars} -.if ${X_} == "" -${var}.${_cc_hash}:= ${${var}} -.export-env ${var}.${_cc_hash} -.undef ${var}.${_cc_hash} -.else -# Always export X_ vars. -.export-env ${var} -.endif +${var}.${${X_}_cc_hash}:= ${${var}} +.export-env ${var}.${${X_}_cc_hash} +.undef ${var}.${${X_}_cc_hash} .endfor .endif # ${cc} == "CC" || !empty(XCC) Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun May 29 06:01:18 2016 (r300942) +++ head/share/mk/bsd.sys.mk Sun May 29 06:20:15 2016 (r300943) @@ -178,36 +178,6 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} -# Special handling for external GCC. -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "gcc" -# GCC's --sysroot support for a cross-compiler without a default -# TARGET_SYSTEM_ROOT does not add sysroot/usr/include in or the C++ -# include path of sysroot/usr/include/c++/v1. They need to be added in -# when not using -nostdinc/-nostdinc++. This is not a problem with a -# non-cross-compiler external GCC or the in-tree cross-compiler GCC which -# has a default TARGET_SYSTEM_ROOT. -.if ${CC:M--sysroot=*} || ${CFLAGS:M--sysroot=*} -.if ${CFLAGS:M-nostdinc} == "" -CFLAGS+= -isystem =/usr/include -.endif -# We want to force building the system with our in-tree libc++. Note that -# this also requires a symlink in OBJDIR/lib/libc++/libstdc++.so to -# sysroot/usr/lib/libc++.so. -.if ${CXXFLAGS:M-nostdinc++} == "" && ${CXXFLAGS:M-nostdlib} == "" -CXXFLAGS+= -std=c++11 \ - -nostdinc++ -# Need to ensure this path comes before the above -isystem =/usr/include. -# CXXFLAGS is CFLAGS with extra added in, so there's no way to fix the -# ordering otherwise. -CXX+= -isystem =/usr/include/c++/v1 -LDFLAGS+= -L${OBJTOP}/lib/libc++ -.endif -# Add in sysroot/usr/lib to ensure that it comes before /usr/local/lib -# from ports compilers. -LDFLAGS+= -L=/usr/lib -.endif # --sysroot -.endif # X_COMPILER_TYPE == gcc - .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs. .if !make(all) && make(install) && empty(.MAKE.MODE:Mmeta) From owner-svn-src-head@freebsd.org Sun May 29 06:29:23 2016 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 87595B51A42; Sun, 29 May 2016 06:29:23 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 575871E82; Sun, 29 May 2016 06:29:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T6TMhM005865; Sun, 29 May 2016 06:29:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T6TMMC005864; Sun, 29 May 2016 06:29:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290629.u4T6TMMC005864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 06:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300945 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 06:29:23 -0000 Author: ngie Date: Sun May 29 06:29:22 2016 New Revision: 300945 URL: https://svnweb.freebsd.org/changeset/base/300945 Log: Remove unnecessary caller_uaddr != NULL test before calling free on it MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Sun May 29 06:20:36 2016 (r300944) +++ head/usr.sbin/rpcbind/util.c Sun May 29 06:29:22 2016 (r300945) @@ -293,8 +293,7 @@ found: ret = taddr2uaddr(nconf, &tbuf); freeit: - if (caller_uaddr != NULL) - free(caller_uaddr); + free(caller_uaddr); if (hint_nbp != NULL) { free(hint_nbp->buf); free(hint_nbp); From owner-svn-src-head@freebsd.org Sun May 29 06:20:37 2016 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 D1A33B51203; Sun, 29 May 2016 06:20:37 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 9F28916D0; Sun, 29 May 2016 06:20:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T6Karx002373; Sun, 29 May 2016 06:20:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T6Kaig002372; Sun, 29 May 2016 06:20:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605290620.u4T6Kaig002372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 May 2016 06:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300944 - head 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.22 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: Sun, 29 May 2016 06:20:37 -0000 Author: bdrewery Date: Sun May 29 06:20:36 2016 New Revision: 300944 URL: https://svnweb.freebsd.org/changeset/base/300944 Log: Libcompat: Swap CXX/CFLAGS. This is the same as done for the native build in r300770 to ensure that the libc++ build reads from SYSROOT/usr/include/c++/v1 before reading from SYSROOT/usr/include. Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sun May 29 06:20:15 2016 (r300943) +++ head/Makefile.libcompat Sun May 29 06:20:36 2016 (r300944) @@ -92,7 +92,7 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA_CMP .endif LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ - CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ + CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \ CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ From owner-svn-src-head@freebsd.org Sun May 29 07:23:58 2016 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 46644B5146B; Sun, 29 May 2016 07:23:58 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 082941286; Sun, 29 May 2016 07:23:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T7Nvh0027656; Sun, 29 May 2016 07:23:57 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T7Nvvk027654; Sun, 29 May 2016 07:23:57 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605290723.u4T7Nvvk027654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 29 May 2016 07:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300949 - head/sys/netpfil/ipfw 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.22 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: Sun, 29 May 2016 07:23:58 -0000 Author: truckman Date: Sun May 29 07:23:56 2016 New Revision: 300949 URL: https://svnweb.freebsd.org/changeset/base/300949 Log: Cast some expressions that multiply a long long constant by a floating point constant to int64_t. This avoids the runtime conversion of the the other operand in a set of comparisons from int64_t to floating point and doing the comparisions in floating point. Suggested by: lidl Submitted by: Rasool Al-Saadi MFC after: 2 weeks (with r300779) Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c head/sys/netpfil/ipfw/dn_sched_fq_pie.c Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:14:51 2016 (r300948) +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:23:56 2016 (r300949) @@ -244,17 +244,17 @@ calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob< PIE_MAX_PROB * 0.000001) + if (prob < (int64_t)(PIE_MAX_PROB * 0.000001)) p >>= 11 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.00001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.00001)) p >>= 9 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.0001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.0001)) p >>= 7 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.001)) p >>= 5 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.01) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 3 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.1) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 1 + PIE_FIX_POINT_BITS+12; else p >>= PIE_FIX_POINT_BITS+12; Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_fq_pie.c Sun May 29 07:14:51 2016 (r300948) +++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c Sun May 29 07:23:56 2016 (r300949) @@ -407,17 +407,17 @@ fq_calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob< PIE_MAX_PROB * 0.000001) + if (prob < (int64_t)(PIE_MAX_PROB * 0.000001)) p >>= 11 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.00001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.00001)) p >>= 9 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.0001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.0001)) p >>= 7 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.001)) p >>= 5 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.01) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 3 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.1) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 1 + PIE_FIX_POINT_BITS+12; else p >>= PIE_FIX_POINT_BITS+12; From owner-svn-src-head@freebsd.org Sun May 29 08:04:22 2016 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 AB941B4FE2E; Sun, 29 May 2016 08:04:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 764B81BE1; Sun, 29 May 2016 08:04:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-42-169.carlnfd1.nsw.optusnet.com.au [110.21.42.169]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id ED2E81A5DED; Sun, 29 May 2016 17:31:39 +1000 (AEST) Date: Sun, 29 May 2016 17:31:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300935 - head/usr.sbin/rpc.statd In-Reply-To: <201605290418.u4T4IlWI057643@repo.freebsd.org> Message-ID: <20160529171235.A1958@besplex.bde.org> References: <201605290418.u4T4IlWI057643@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=M8SwUHEs c=1 sm=1 tr=0 a=kDyANCGC9fy361NNEb9EQQ==:117 a=kDyANCGC9fy361NNEb9EQQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=___x2QKLYJCSEN0yLm8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 08:04:22 -0000 On Sun, 29 May 2016, Garrett Cooper wrote: > Log: > Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call exit > as a hint to static analysis tools This is bogus for usage() since it is static so only very broken static analyis tools can't see its full details. > Modified: head/usr.sbin/rpc.statd/statd.c > ============================================================================== > --- head/usr.sbin/rpc.statd/statd.c Sun May 29 04:02:02 2016 (r300934) > +++ head/usr.sbin/rpc.statd/statd.c Sun May 29 04:18:47 2016 (r300935) > @@ -72,9 +72,9 @@ static int create_service(struct netconf > static void complete_service(struct netconfig *nconf, char *port_str); > static void clearout_service(void); > static void handle_sigchld(int sig); > -void out_of_mem(void); > +void out_of_mem(void) __dead2; This is even more bogus: - out_of_mem() is public, and this adds __dead2 in the one place that clearly doesn't need it - the declarartions are unsorted internally and externally. Prototypes for public functions belong in a header file. Some are already there, but this one is unsorted into the middle of static ones - however, perhaps this function should be static. It is only directly referenced in this file. I don't know if it is also referenced in some other utility or rpc generated code. If so, then these are probably missing the __dead2. > -static void usage(void); > +static void usage(void) __dead2; There are also many lexical (indentation) style bugs near here, in all of the newer prototypes starting with handle_sigchld(). > > int > main(int argc, char **argv) > @@ -613,7 +613,7 @@ clearout_service(void) > } > > static void > -usage() > +usage(void) Perhaps Coverity was just complaining about this K&R definition. No change was needed, since there is a prototype in scope. Bruce From owner-svn-src-head@freebsd.org Sun May 29 08:01:09 2016 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 9F7FBB4FAC3; Sun, 29 May 2016 08:01:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 66BF716C0; Sun, 29 May 2016 08:01:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-42-169.carlnfd1.nsw.optusnet.com.au [110.21.42.169]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 8EA4B421683; Sun, 29 May 2016 18:00:58 +1000 (AEST) Date: Sun, 29 May 2016 18:00:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Don Lewis cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300949 - head/sys/netpfil/ipfw In-Reply-To: <201605290723.u4T7Nvvk027654@repo.freebsd.org> Message-ID: <20160529173603.G2146@besplex.bde.org> References: <201605290723.u4T7Nvvk027654@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=kDyANCGC9fy361NNEb9EQQ==:117 a=kDyANCGC9fy361NNEb9EQQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=EowK929v9maM7jh68bYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 08:01:09 -0000 On Sun, 29 May 2016, Don Lewis wrote: > Log: > Cast some expressions that multiply a long long constant by a > floating point constant to int64_t. This avoids the runtime > conversion of the the other operand in a set of comparisons from > int64_t to floating point and doing the comparisions in floating > point. > > Suggested by: lidl > Submitted by: Rasool Al-Saadi > MFC after: 2 weeks (with r300779) Compilers are still permitted to (and perhaps even required to) evaluate FP constant expressions at runtime (to get rounding and/or exception flags right). They probably don't in practice, but it is unclear what happens for -O0 and the rules for rounding are too hard to understand. > Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c > ============================================================================== > --- head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:14:51 2016 (r300948) > +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:23:56 2016 (r300949) > @@ -244,17 +244,17 @@ calculate_drop_prob(void *x) > p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; > > /* auto-tune drop probability */ > - if (prob< PIE_MAX_PROB * 0.000001) > + if (prob < (int64_t)(PIE_MAX_PROB * 0.000001)) > p >>= 11 + PIE_FIX_POINT_BITS+12; > + else if (prob < (int64_t)(PIE_MAX_PROB * 0.00001)) > p >>= 9 + PIE_FIX_POINT_BITS+12; Why not just divide by integer powers of 10? This might not give a suitably monotonic/continuous scaling at the endpoints, but it is unclear if the FP gives that either even if we are more careful with the rounding mode. A table of endpoints could be used to get precise control. Then FP can be used more safely, since it is clear that constants in tables must be evaluated at compile time. > ... Similarly for all cases. Bruce From owner-svn-src-head@freebsd.org Sun May 29 01:38:13 2016 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 48A51B4FCB5; Sun, 29 May 2016 01:38:13 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 1A1F11D34; Sun, 29 May 2016 01:38:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T1cC5g095787; Sun, 29 May 2016 01:38:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T1cCXG095786; Sun, 29 May 2016 01:38:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290138.u4T1cCXG095786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 01:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300922 - head/etc/mtree 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.22 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: Sun, 29 May 2016 01:38:13 -0000 Author: ngie Date: Sun May 29 01:38:12 2016 New Revision: 300922 URL: https://svnweb.freebsd.org/changeset/base/300922 Log: Fix "make installworld" with MK_CDDL == no after r300906 by adding a missing entry for ${TESTSBASE}/cddl/sbin X-MFC with: r300906 Pointyhat to: asomers Reported by: Shawn Webb Sponsored by: EMC / Isilon Storage Division Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun May 29 01:15:36 2016 (r300921) +++ head/etc/mtree/BSD.tests.dist Sun May 29 01:38:12 2016 (r300922) @@ -48,6 +48,8 @@ cddl lib .. + sbin + .. usr.bin .. usr.sbin From owner-svn-src-head@freebsd.org Sun May 29 01:45:38 2016 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 D2FBDB52547; Sun, 29 May 2016 01:45:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BAB751AFD; Sun, 29 May 2016 01:45:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id B40FB14CD; Sun, 29 May 2016 01:45:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6C37A1E5EB; Sun, 29 May 2016 01:45:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id X7yoGXn5C2MP; Sun, 29 May 2016 01:45:36 +0000 (UTC) Subject: Re: svn commit: r300922 - head/etc/mtree DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B85591E5E4 To: "Ngie Cooper (yaneurabeya)" , Garrett Cooper References: <201605290138.u4T1cCXG095786@repo.freebsd.org> <7D20215F-1BD4-4198-9AB6-C908227AE882@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Sat, 28 May 2016 18:45:34 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <7D20215F-1BD4-4198-9AB6-C908227AE882@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Picg4SUIn2oEDrsVtB84XHjDQ5nFGIMJJ" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 01:45:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Picg4SUIn2oEDrsVtB84XHjDQ5nFGIMJJ Content-Type: multipart/mixed; boundary="WIK1Q4NnVd6WhXhKWg4bkJ8oXTji8fwqi" From: Bryan Drewery To: "Ngie Cooper (yaneurabeya)" , Garrett Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r300922 - head/etc/mtree References: <201605290138.u4T1cCXG095786@repo.freebsd.org> <7D20215F-1BD4-4198-9AB6-C908227AE882@gmail.com> In-Reply-To: <7D20215F-1BD4-4198-9AB6-C908227AE882@gmail.com> --WIK1Q4NnVd6WhXhKWg4bkJ8oXTji8fwqi Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 5/28/16 6:39 PM, Ngie Cooper (yaneurabeya) wrote: >=20 >> On May 28, 2016, at 18:38, Garrett Cooper wrote: >> >> Author: ngie >> Date: Sun May 29 01:38:12 2016 >> New Revision: 300922 >> URL: https://svnweb.freebsd.org/changeset/base/300922 >> >> Log: >> Fix "make installworld" with MK_CDDL =3D=3D no after r300906 by >=20 > This should read, "!=3D no" >_>.. >=20 Pointyhat to: ngie --=20 Regards, Bryan Drewery --WIK1Q4NnVd6WhXhKWg4bkJ8oXTji8fwqi-- --Picg4SUIn2oEDrsVtB84XHjDQ5nFGIMJJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXSkm/AAoJEDXXcbtuRpfPeRcIALSKgGYo7OuQSLUdn7rYuRWt gXIBjADUd3ZGQNFZGXTzqfWdMnvDDKCpmwgTOo9E8Yrcqa6ML6TrQaBKoBBpHhzG thABjHep0KJgnq3JF17swIYvFOiXU1AhYiWdEpniNamAhNPVqDa8wPZtP5Y7+Y1d GfyLzuL0wr/5H09EGHVkWuoUrDBDKhYfarg4SPtRhQHwchMmhnSMG0OSYB+s52Dl h9cra2+RtEWHpHc+NWZTvlwJD3sAFnGmPRjun6DLP2Lpuxy6aDyY8ACg5DuKjcEj y/DjzKeITmxeq05Yg80WzBD81YAilVhuw/AiCvRTokiWYU0eALhs5PVgYX5FP1c= =+suz -----END PGP SIGNATURE----- --Picg4SUIn2oEDrsVtB84XHjDQ5nFGIMJJ-- From owner-svn-src-head@freebsd.org Sun May 29 01:45:16 2016 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 93DE6B524F5; Sun, 29 May 2016 01:45:16 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 657FB19BC; Sun, 29 May 2016 01:45:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T1jFG2099602; Sun, 29 May 2016 01:45:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T1jFOX099601; Sun, 29 May 2016 01:45:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605290145.u4T1jFOX099601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 May 2016 01:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300926 - head 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.22 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: Sun, 29 May 2016 01:45:16 -0000 Author: bdrewery Date: Sun May 29 01:45:15 2016 New Revision: 300926 URL: https://svnweb.freebsd.org/changeset/base/300926 Log: Libcompat: Set build tools in environment rather than make overrides. This allows the CXX hack in r300917 for external GCC to work for the lib32 build. It is also the same pattern as the native build uses by adding the tools into CROSSENV for external toolchain, rather than make overrides. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sun May 29 01:43:28 2016 (r300925) +++ head/Makefile.libcompat Sun May 29 01:45:15 2016 (r300926) @@ -17,7 +17,7 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ MACHINE_CPU="i686 mmx sse sse2" -LIB32WMAKEFLAGS= \ +LIB32WMAKEENV+= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ OBJCOPY="${XOBJCOPY}" @@ -29,7 +29,7 @@ LIB32CPUFLAGS= -mcpu=powerpc LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc -LIB32WMAKEFLAGS= \ +LIB32WMAKEENV+= \ LD="${XLD} -m elf32ppc_fbsd" \ OBJCOPY="${XOBJCOPY}" .endif @@ -84,9 +84,11 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L # Don't rebuild build-tools targets during normal build. LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA_CMP .endif -LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ +LIBCOMPATWMAKEENV+= \ + CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ - CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ + CPP="${XCPP} ${LIBCOMPATCFLAGS}" +LIBCOMPATWMAKEFLAGS+= \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ MK_CTF=no \ From owner-svn-src-head@freebsd.org Sun May 29 03:42:52 2016 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 2010BB4F327; Sun, 29 May 2016 03:42:52 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id E2074112E; Sun, 29 May 2016 03:42:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T3gpkC045576; Sun, 29 May 2016 03:42:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T3gpUB045575; Sun, 29 May 2016 03:42:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290342.u4T3gpUB045575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 03:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300932 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 03:42:52 -0000 Author: ngie Date: Sun May 29 03:42:50 2016 New Revision: 300932 URL: https://svnweb.freebsd.org/changeset/base/300932 Log: Catch malloc(3) errors and socket(2) errors - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. Reported by: Coverity CID: 976288, 976321, 976858 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Sun May 29 02:59:03 2016 (r300931) +++ head/usr.sbin/rpcbind/util.c Sun May 29 03:42:50 2016 (r300932) @@ -336,6 +336,7 @@ network_init(void) if (local_in4 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip4 addr\n"); + exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); } @@ -351,6 +352,7 @@ network_init(void) if (local_in6 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip6 addr\n"); + exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); } @@ -365,6 +367,11 @@ network_init(void) inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (s == -1) { + if (debugging) + fprintf(stderr, "couldn't create ip6 socket"); + exit(1); + } /* * Loop through all interfaces. For each IPv6 multicast-capable From owner-svn-src-head@freebsd.org Sun May 29 02:59:04 2016 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 A0769B52FA7; Sun, 29 May 2016 02:59:04 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 6DEBD115C; Sun, 29 May 2016 02:59:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T2x3aD025804; Sun, 29 May 2016 02:59:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T2x3ZL025803; Sun, 29 May 2016 02:59:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290259.u4T2x3ZL025803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 02:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300931 - head/etc/rc.d 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.22 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: Sun, 29 May 2016 02:59:04 -0000 Author: ngie Date: Sun May 29 02:59:03 2016 New Revision: 300931 URL: https://svnweb.freebsd.org/changeset/base/300931 Log: Make netif REQUIRE hostid As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before hostid, and the MAC address generated for any bridge devices will be non-deterministic. Make the MAC address generated be deterministic for bridge devices by explicitly REQUIRE'ing hostid. This fixes up the rest of the PR, inadvertently committed in r299844 MFC after: 1 week PR: 195188 Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/netif Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sun May 29 02:24:51 2016 (r300930) +++ head/etc/rc.d/netif Sun May 29 02:59:03 2016 (r300931) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: hostid ipfilter ipfs # KEYWORD: nojailvnet . /etc/rc.subr From owner-svn-src-head@freebsd.org Sun May 29 04:39:21 2016 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 CC0ADB5089B; Sun, 29 May 2016 04:39:21 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 80C0B1FD7; Sun, 29 May 2016 04:39:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T4dKWo065356; Sun, 29 May 2016 04:39:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T4dKVo065355; Sun, 29 May 2016 04:39:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290439.u4T4dKVo065355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300936 - head/tools/build/mk 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.22 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: Sun, 29 May 2016 04:39:21 -0000 Author: ngie Date: Sun May 29 04:39:20 2016 New Revision: 300936 URL: https://svnweb.freebsd.org/changeset/base/300936 Log: Remove the calendar tests if MK_CALENDAR == no when "make delete-old" is run MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:18:47 2016 (r300935) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:39:20 2016 (r300936) @@ -851,6 +851,39 @@ OLD_FILES+=usr/share/calendar/uk_UA.KOI8 OLD_DIRS+=usr/share/calendar/uk_UA.KOI8-U OLD_DIRS+=usr/share/calendar OLD_FILES+=usr/share/man/man1/calendar.1.gz +OLD_FILES+=usr/tests/usr.bin/calendar/Kyuafile +OLD_FILES+=usr/tests/usr.bin/calendar/calendar.calibrate +OLD_FILES+=usr/tests/usr.bin/calendar/legacy_test +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.sh +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-7.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-7.out +OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no From owner-svn-src-head@freebsd.org Sun May 29 04:43:25 2016 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 6AC77B50CE7; Sun, 29 May 2016 04:43:25 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 3861B145E; Sun, 29 May 2016 04:43:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T4hO2r068848; Sun, 29 May 2016 04:43:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T4hOln068847; Sun, 29 May 2016 04:43:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605290443.u4T4hOln068847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 04:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300937 - head/tools/build/mk 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.22 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: Sun, 29 May 2016 04:43:25 -0000 Author: ngie Date: Sun May 29 04:43:24 2016 New Revision: 300937 URL: https://svnweb.freebsd.org/changeset/base/300937 Log: Remove the etcupdate tests if MK_RCS == no when "make delete-old" is run etcupdate is conditionally installed based on MK_RCS != no today MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:39:20 2016 (r300936) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:43:24 2016 (r300937) @@ -6792,6 +6792,15 @@ OLD_FILES+=usr/share/man/man1/rcsmerge.1 OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz OLD_FILES+=usr/share/man/man8/etcupdate.8.gz +OLD_FILES+=usr/tests/usr.sbin/etcupdate/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/etcupdate/always_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/conflicts_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/fbsdid_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/ignore_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/preworld_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tests_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tzsetup_test +OLD_DIRS+=usr/tests/usr.sbin/etcupdate .endif #.if ${MK_RESCUE} == no From owner-svn-src-head@freebsd.org Sun May 29 07:29:36 2016 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 86A9AB5196B; Sun, 29 May 2016 07:29:36 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 57C541863; Sun, 29 May 2016 07:29:36 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4T7TZKd027886; Sun, 29 May 2016 07:29:35 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4T7TZG6027884; Sun, 29 May 2016 07:29:35 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605290729.u4T7TZG6027884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 29 May 2016 07:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300950 - in head/sys: conf modules/dummynet 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.22 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: Sun, 29 May 2016 07:29:36 -0000 Author: truckman Date: Sun May 29 07:29:35 2016 New Revision: 300950 URL: https://svnweb.freebsd.org/changeset/base/300950 Log: Now that PIE is free of runtime floating point, revert r300853 to reconnect PIE to the build. Modified: head/sys/conf/files head/sys/modules/dummynet/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 29 07:23:56 2016 (r300949) +++ head/sys/conf/files Sun May 29 07:29:35 2016 (r300950) @@ -3824,9 +3824,11 @@ netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm netpfil/ipfw/dn_aqm_codel.c optional inet dummynet +netpfil/ipfw/dn_aqm_pie.c optional inet dummynet netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet netpfil/ipfw/dn_sched_fq_codel.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_pie.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet netpfil/ipfw/dn_sched_qfq.c optional inet dummynet netpfil/ipfw/dn_sched_rr.c optional inet dummynet Modified: head/sys/modules/dummynet/Makefile ============================================================================== --- head/sys/modules/dummynet/Makefile Sun May 29 07:23:56 2016 (r300949) +++ head/sys/modules/dummynet/Makefile Sun May 29 07:29:35 2016 (r300950) @@ -4,9 +4,9 @@ KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c -SRCS+= dn_aqm_codel.c +SRCS+= dn_aqm_codel.c dn_aqm_pie.c SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c -SRCS+= dn_sched_prio.c dn_sched_fq_codel.c +SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c SRCS+= opt_inet6.h .include From owner-svn-src-head@freebsd.org Sun May 29 10:39:28 2016 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 2437AB52192 for ; Sun, 29 May 2016 10:39:28 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9DB01F6E for ; Sun, 29 May 2016 10:39:27 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x232.google.com with SMTP id o16so141948080ywd.2 for ; Sun, 29 May 2016 03:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=LvHWgfBPWbgzqtnnBRuVZCVittn/r3Yy0mQ6/QxmD18=; b=JcRVmkqdThU2hqWCMKtsiWHalOhP1uOfYNl3bmy2+6xufgWjMEhbe5yf/tqqa1NYxf K73yZt4seEDZN89W1YtxN+0iO+kmAm8CaULnBbd162nqCMVEPbavn5y+NqC0PHVMRD3t H0rD1lzxh0hk1LDbfFPV1h3QWQD+/OQAXFT7znpH9dWgHrR+yAW/WIB01nICFdun8UTF Cp9wa7lGBKuxyxqIhQi3VTGf7L8y2dShmBWPHJrFNOsUw1crB0vSv9M32uEGi1n9NVSq +xZ1p57cfX3k1uqLpmQzxzMLgGiFod+WgfKchFlUUnD6yC1aUVlJpsQ4Nbfd8O48IsDp l0Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=LvHWgfBPWbgzqtnnBRuVZCVittn/r3Yy0mQ6/QxmD18=; b=QlAgJBzzTD+K+XPf+5mKaDp1za3UfiU8/s1AGGiW8CtmERlT94/SOGyDmSnQGMLL00 QXCUW8FVSzEcj8u+vSLY4Rj/8M5tJft1kqAgvafS3z5Tcnya8uv+MJhhB734mWmIK8qk Tnd/ICHAE0c4L4OeYZYPRGDiDzrPxKvvXudz3A9PaFaa9fUoBM1eGxI7nVpBbQ95ddT5 qJimMddrrps1EFRsmlUpc72X5H3MGyNeUkM4YkrHretW6QH0jwBz6usZovIu/1GtU3io 5JvYluUUSGiWiRseN3agqK25H7bwMxFOMOrz2pL7Gf8cuDZpiOH8k12m1ZSYXm1flIKe Rfpg== X-Gm-Message-State: ALyK8tL9Ub442/q3tQsiRoG7CUvppYDbDfpSZ1jzrCcE46LhY5+EVC1/LOl9Gtu9Me/BhRLwEGx8oLLG0t+RDw== MIME-Version: 1.0 X-Received: by 10.129.53.70 with SMTP id c67mr14846757ywa.149.1464518367068; Sun, 29 May 2016 03:39:27 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Sun, 29 May 2016 03:39:27 -0700 (PDT) In-Reply-To: <20160529171235.A1958@besplex.bde.org> References: <201605290418.u4T4IlWI057643@repo.freebsd.org> <20160529171235.A1958@besplex.bde.org> Date: Sun, 29 May 2016 12:39:27 +0200 Message-ID: Subject: Re: svn commit: r300935 - head/usr.sbin/rpc.statd From: Ed Schouten To: Bruce Evans Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 10:39:28 -0000 Hi Bruce, Garrett, 2016-05-29 9:31 GMT+02:00 Bruce Evans : > On Sun, 29 May 2016, Garrett Cooper wrote: > >> Log: >> Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call >> exit >> as a hint to static analysis tools > > This is bogus for usage() since it is static so only very broken static > analyis tools can't see its full details. Exactly. I think it's important to keep in mind what the intent of this attribute is: to pass compiler optimization state across compilation units. For static functions, this has absolutely no meaning. Also, as we already live in the year 2016, please use the following construct in case you really want to mark this function as no-return: #include static noreturn void usage(void) { ... } In public header files where you likely don't want to pollute the namespace, use _Noreturn instead. Thanks, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sun May 29 10:41:28 2016 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 990A5B5232D; Sun, 29 May 2016 10:41:28 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 69DD211C7; Sun, 29 May 2016 10:41:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TAfRof097742; Sun, 29 May 2016 10:41:27 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TAfRO3097741; Sun, 29 May 2016 10:41:27 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605291041.u4TAfRO3097741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 29 May 2016 10:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300952 - head/usr.sbin/services_mkdb 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.22 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: Sun, 29 May 2016 10:41:28 -0000 Author: ed Date: Sun May 29 10:41:27 2016 New Revision: 300952 URL: https://svnweb.freebsd.org/changeset/base/300952 Log: Invoke the dirname() function in a POSIX compliant way. POSIX requires that the argument of dirname() is of type "char *". In other words, the input buffer can be modified by the function to store the directory name. Pull a copy of the string before calling dirname(). We don't care about freeing up the memory afterwards, as this is done at the very bottom of main(), right before the program terminates. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D6628 Modified: head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 07:39:56 2016 (r300951) +++ head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 10:41:27 2016 (r300952) @@ -92,7 +92,7 @@ main(int argc, char *argv[]) size_t cnt = 0; StringList *sl, ***svc; size_t port, proto; - char *dbname_dir; + char *dbname_dir, *dbname_dirbuf; int dbname_dir_fd = -1; setprogname(argv[0]); @@ -172,7 +172,8 @@ main(int argc, char *argv[]) * fsync() to the directory where file lies */ if (rename(tname, dbname) == -1 || - (dbname_dir = dirname(dbname)) == NULL || + (dbname_dirbuf = strdup(dbname)) == NULL || + (dbname_dir = dirname(dbname_dirbuf)) == NULL || (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || fsync(dbname_dir_fd) != 0) { if (dbname_dir_fd != -1) From owner-svn-src-head@freebsd.org Sun May 29 11:54:10 2016 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 893F5B538BA; Sun, 29 May 2016 11:54:10 +0000 (UTC) (envelope-from ache@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 mx1.freebsd.org (Postfix) with ESMTPS id 5FFE61D04; Sun, 29 May 2016 11:54:10 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TBs9RA026881; Sun, 29 May 2016 11:54:09 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TBs9Yo026880; Sun, 29 May 2016 11:54:09 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201605291154.u4TBs9Yo026880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 29 May 2016 11:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300953 - head/lib/libc/stdlib 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.22 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: Sun, 29 May 2016 11:54:10 -0000 Author: ache Date: Sun May 29 11:54:09 2016 New Revision: 300953 URL: https://svnweb.freebsd.org/changeset/base/300953 Log: 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading harder. 2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case (non default) from negative seeds. 3) Don't check for valid "type" range in setstate(), it is always valid as calculated. Instead add a check that rear pointer not exceeed end pointer. MFC after: 1 week Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Sun May 29 10:41:27 2016 (r300952) +++ head/lib/libc/stdlib/random.c Sun May 29 11:54:09 2016 (r300953) @@ -137,11 +137,7 @@ __FBSDID("$FreeBSD$"); */ #define MAX_TYPES 5 /* max number of types above */ -#ifdef USE_WEAK_SEEDING -#define NSHUFF 0 -#else /* !USE_WEAK_SEEDING */ #define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ -#endif /* !USE_WEAK_SEEDING */ static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; @@ -162,23 +158,12 @@ static const int seps [MAX_TYPES] = { SE static uint32_t randtbl[DEG_3 + 1] = { TYPE_3, -#ifdef USE_WEAK_SEEDING -/* Historic implementation compatibility */ -/* The random sequences do not vary much with the seed */ - 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, - 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, - 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, - 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, - 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, - 0x27fb47b9, -#else /* !USE_WEAK_SEEDING */ - 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05, - 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454, - 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471, - 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1, - 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41, - 0xf3bec5da -#endif /* !USE_WEAK_SEEDING */ + 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, + 0x696f5c16, 0x878f1ff5, 0x52d9c07f, 0x916a06cd, 0xb50b3a20, 0x2776970a, + 0xee4eb2a6, 0xe94640ec, 0xb1d65612, 0x9d1ed968, 0x1043f6b7, 0xa3432a76, + 0x17eacbb9, 0x3c09e2eb, 0x4f8c2b3, 0x708a1f57, 0xee341814, 0x95d0e4d2, + 0xb06f216c, 0x8bd2e72e, 0x8f7c38d7, 0xcfc6a8fc, 0x2a59495, 0xa20d2a69, + 0xe29d12d1 }; /* @@ -215,16 +200,8 @@ static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; static inline uint32_t -good_rand(int32_t x) +good_rand(uint32_t ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return (1103515245 * x + 12345); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * wihout overflowing 31 bits: @@ -233,18 +210,17 @@ good_rand(int32_t x) * Park and Miller, Communications of the ACM, vol. 31, no. 10, * October 1988, p. 1195. */ - int32_t hi, lo; + int32_t hi, lo, x; - /* Can't be initialized with 0, so use another value. */ - if (x == 0) - x = 123459876; + /* Transform to [1, 0x7ffffffe] range. */ + x = (ctx % 0x7ffffffe) + 1; hi = x / 127773; lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - return (x); -#endif /* !USE_WEAK_SEEDING */ + /* Transform to [0, 0x7ffffffd] range. */ + return (x - 1); } /* @@ -404,16 +380,8 @@ setstate(char *arg_state) uint32_t rear = new_state[0] / MAX_TYPES; char *ostate = (char *)(&state[-1]); - switch(type) { - case TYPE_0: - case TYPE_1: - case TYPE_2: - case TYPE_3: - case TYPE_4: - break; - default: + if (type != TYPE_0 && rear >= degrees[type]) return (NULL); - } if (rand_type == TYPE_0) state[-1] = rand_type; else @@ -455,7 +423,7 @@ random(void) if (rand_type == TYPE_0) { i = state[0]; - state[0] = i = (good_rand(i)) & 0x7fffffff; + state[0] = i = good_rand(i); } else { /* * Use local variables rather than static variables for speed. From owner-svn-src-head@freebsd.org Sun May 29 12:21:55 2016 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 454A2B4E7AF; Sun, 29 May 2016 12:21:55 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 168F51E0D; Sun, 29 May 2016 12:21:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TCLsSZ037752; Sun, 29 May 2016 12:21:54 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TCLsOT037751; Sun, 29 May 2016 12:21:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605291221.u4TCLsOT037751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 29 May 2016 12:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300955 - head/include 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.22 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: Sun, 29 May 2016 12:21:55 -0000 Author: ed Date: Sun May 29 12:21:54 2016 New Revision: 300955 URL: https://svnweb.freebsd.org/changeset/base/300955 Log: Fix style of the libgen.h header. - Remove unneeded declarations of removed/unimplemented features. - Add missing tab after #define. - Add missing ! before trailing comment. Modified: head/include/libgen.h Modified: head/include/libgen.h ============================================================================== --- head/include/libgen.h Sun May 29 12:16:58 2016 (r300954) +++ head/include/libgen.h Sun May 29 12:21:54 2016 (r300955) @@ -29,22 +29,14 @@ */ #ifndef _LIBGEN_H_ -#define _LIBGEN_H_ +#define _LIBGEN_H_ #include __BEGIN_DECLS - char *basename(const char *); char *basename_r(const char *, char *); char *dirname(const char *); -#if 0 -char *regcmp(const char *, ...); -char *regex(const char *, const char *, ...); - -extern char *__loc1; -#endif - __END_DECLS -#endif /* _LIBGEN_H_ */ +#endif /* !_LIBGEN_H_ */ From owner-svn-src-head@freebsd.org Sun May 29 13:57:07 2016 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 5E1A4B5122B; Sun, 29 May 2016 13:57:07 +0000 (UTC) (envelope-from ache@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 mx1.freebsd.org (Postfix) with ESMTPS id 1E9501E43; Sun, 29 May 2016 13:57:07 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TDv6oB071841; Sun, 29 May 2016 13:57:06 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TDv6No071840; Sun, 29 May 2016 13:57:06 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201605291357.u4TDv6No071840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 29 May 2016 13:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300956 - head/lib/libc/stdlib 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.22 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: Sun, 29 May 2016 13:57:07 -0000 Author: ache Date: Sun May 29 13:57:06 2016 New Revision: 300956 URL: https://svnweb.freebsd.org/changeset/base/300956 Log: 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. 2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones. 3) Use POSIX argument types for visible functions (cosmetic). MFC after: 1 week Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Sun May 29 12:21:54 2016 (r300955) +++ head/lib/libc/stdlib/rand.c Sun May 29 13:57:06 2016 (r300956) @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); static int do_rand(unsigned long *ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * without overflowing 31 bits: @@ -66,48 +58,34 @@ do_rand(unsigned long *ctx) */ long hi, lo, x; - /* Must be in [1, 0x7ffffffe] range at this point. */ - hi = *ctx / 127773; - lo = *ctx % 127773; + /* Transform to [1, 0x7ffffffe] range. */ + x = (*ctx % 0x7ffffffe) + 1; + hi = x / 127773; + lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - *ctx = x; /* Transform to [0, 0x7ffffffd] range. */ - return (x - 1); -#endif /* !USE_WEAK_SEEDING */ + x--; + *ctx = x; + return (x); } int -rand_r(unsigned int *ctx) +rand_r(unsigned *ctx) { u_long val; int r; -#ifdef USE_WEAK_SEEDING val = *ctx; -#else - /* Transform to [1, 0x7ffffffe] range. */ - val = (*ctx % 0x7ffffffe) + 1; -#endif r = do_rand(&val); - -#ifdef USE_WEAK_SEEDING - *ctx = (unsigned int)val; -#else - *ctx = (unsigned int)(val - 1); -#endif + *ctx = (unsigned)val; return (r); } -static u_long next = -#ifdef USE_WEAK_SEEDING - 1; -#else - 2; -#endif +static u_long next = 1; int rand(void) @@ -116,13 +94,9 @@ rand(void) } void -srand(u_int seed) +srand(unsigned seed) { next = seed; -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffffffe] range. */ - next = (next % 0x7ffffffe) + 1; -#endif } @@ -144,10 +118,6 @@ sranddev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; sysctl(mib, 2, (void *)&next, &len, NULL, 0); -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffffffe] range. */ - next = (next % 0x7ffffffe) + 1; -#endif } From owner-svn-src-head@freebsd.org Sun May 29 14:16:25 2016 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 A2DA7B51824; Sun, 29 May 2016 14:16:25 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id 6EE1A1B23; Sun, 29 May 2016 14:16:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TEGOeX079836; Sun, 29 May 2016 14:16:24 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TEGOZE079829; Sun, 29 May 2016 14:16:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605291416.u4TEGOZE079829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 29 May 2016 14:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300957 - head/lib/libc/sys 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.22 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: Sun, 29 May 2016 14:16:25 -0000 Author: jilles Date: Sun May 29 14:16:23 2016 New Revision: 300957 URL: https://svnweb.freebsd.org/changeset/base/300957 Log: _umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes. Modified: head/lib/libc/sys/_umtx_op.2 head/lib/libc/sys/thr_exit.2 head/lib/libc/sys/thr_kill.2 head/lib/libc/sys/thr_new.2 head/lib/libc/sys/thr_self.2 head/lib/libc/sys/thr_set_name.2 Modified: head/lib/libc/sys/_umtx_op.2 ============================================================================== --- head/lib/libc/sys/_umtx_op.2 Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/_umtx_op.2 Sun May 29 14:16:23 2016 (r300957) @@ -257,7 +257,7 @@ are defined, in addition to the common f .It Dv URWLOCK_PREFER_READER If specified, immediately grant read lock requests when .Dv urwlock -is already read-locked, even in presence of the unsatisfied write +is already read-locked, even in presence of unsatisfied write lock requests. By default, if there is a write lock waiter, further read requests are not granted, to prevent unfair write lock waiter starvation. @@ -387,7 +387,7 @@ variant which returns an error rather th be obtained. Also, .Fn _umtx_op -provides requests which explicitely put the thread to sleep. +provides requests which explicitly put the thread to sleep. .Pp Wakes need to know which threads to make runnable, so sleeping threads are grouped into containers called @@ -399,12 +399,12 @@ Note that the .Em physical address is used, which means that same variable mapped multiple times will give one key value. -This mechanism enables the construction of the +This mechanism enables the construction of .Em process-shared locks. .Pp A related attribute of the key is shareability. -Some requests always interpet keys as private for the current process, +Some requests always interpret keys as private for the current process, creating sleep queues with the scope of the current process even if the memory is shared. Others either select the shareability automatically from the @@ -435,7 +435,8 @@ the queue are selected. The .Em robust umutexes are provided as a substrate for a userspace library to implement -POSIX robust mutexes. +.Tn POSIX +robust mutexes. A robust umutex must have the .Dv UMUTEX_ROBUST flag set. @@ -524,13 +525,13 @@ argument is compared with the If they are equal, the requesting thread is put to interruptible sleep until woken up or the optionally specified timeout expires. .Pp -The comparision and sleep are atomic. +The comparison and sleep are atomic. In other words, if another thread writes a new value to .Dv *obj and then issues .Dv UMTX_OP_WAKE , the request is guaranteed to not miss the wakeup, -which might otherwise happen between comparision and blocking. +which might otherwise happen between comparison and blocking. .Pp The physical address of memory where the .Fa *obj @@ -599,7 +600,7 @@ contention indicator, and provides the a lock entrance semantic. .Pp If the lock cannot be obtained immediately because another thread owns -the lock, the current thread is put into sleep, with +the lock, the current thread is put to sleep, with .Dv UMUTEX_CONTESTED bit set before. Upon wake up, the lock conditions are re-tested. @@ -668,7 +669,9 @@ New ceiling value. .It Fa uaddr Address of a variable of type .Vt uint32_t . -If not NULL, after the successful update the previous ceiling value is +If not +.Dv NULL +and the update was successful, the previous ceiling value is written to the location pointed to by .Fa uaddr . .El @@ -685,7 +688,9 @@ member of the after which the umutex is unlocked. .Pp The locking does not adhere to the priority protect protocol, -to confirm with the POSIX requirements for the +to conform to the +.Tn POSIX +requirements for the .Xr pthread_mutex_setprioceiling 3 interface. .It Dv UMTX_OP_CV_WAIT @@ -769,7 +774,8 @@ If the flag is supplied, the timeout specifies absolute time value, otherwise it denotes a relative time interval. .Pp -The request is not restartable. An unblocked signal delivered during +The request is not restartable. +An unblocked signal delivered during the wait always results in sleep interruption and .Er EINTR error. @@ -845,7 +851,7 @@ If the .Dv URWLOCK_WRITE_OWNER bit is set in the word .Dv rw_state , -the lock was granted to a writer which has not yet relinguished +the lock was granted to a writer which has not yet relinquished its ownership. In this case the current thread is put to sleep until it makes sense to retry. @@ -959,7 +965,7 @@ Same as .Dv UMTX_OP_WAKE , but unconditionally select the process-private sleep queue. .It Dv UMTX_OP_MUTEX_WAIT -Wait for the mutex availability. +Wait for mutex availability. The arguments to the request are: .Bl -tag -width "It Fa obj" .It Fa obj @@ -986,12 +992,12 @@ priority inherited protocol mutexes. Optionally, a timeout for the request may be specified. .Pp .Pp -The request with a timeout specified is not restartable. +A request with a timeout specified is not restartable. An unblocked signal delivered during the wait always results in sleep interruption and .Er EINTR error. -The request without a timeout automatically restarts if the signal disposition +A request without a timeout automatically restarts if the signal disposition requested restart via the .Dv SA_RESTART flag in @@ -999,7 +1005,7 @@ flag in member .Dv sa_flags . .It Dv UMTX_OP_NWAKE_PRIVATE -Wake up a batch of sleeping thread. +Wake up a batch of sleeping threads. The arguments to the request are: .Bl -tag -width "It Fa obj" .It Fa obj @@ -1016,7 +1022,7 @@ wakes up all threads waiting on the sleep queue with the key being the byte addressed by the array element. .It Dv UMTX_OP_MUTEX_WAKE -Check if the normal umutex is unlocked and wake up a waiter. +Check if a normal umutex is unlocked and wake up a waiter. The arguments for the request are: .Bl -tag -width "It Fa obj" .It Fa obj @@ -1036,7 +1042,7 @@ if any. Only normal mutexes are supported by the request. The sleep queue is always one for a normal mutex type. .It Dv UMTX_OP_MUTEX_WAKE2 -Check if the umutex is unlocked and wake up a waiter. +Check if a umutex is unlocked and wake up a waiter. The arguments for the request are: .Bl -tag -width "It Fa obj" .It Fa obj @@ -1048,7 +1054,7 @@ The umutex flags. The request does not read the .Dv m_flags member of the -.Vt struct umutex , +.Vt struct umutex ; instead, the .Fa val argument supplies flag information, in particular, to determine the @@ -1064,8 +1070,7 @@ one waiter but the mutex is owned by a t bit is set in the .Dv m_owner word of the -.Vt struct umutex -the request operates upon. +.Vt struct umutex . .It Dv UMTX_OP_SEM2_WAIT Wait until semaphore is available. The arguments to the request are: @@ -1076,12 +1081,12 @@ Pointer to the semaphore (of type .El Put the requesting thread onto a sleep queue if the semaphore counter is zero. -If thread is put to sleep, the +If the thread is put to sleep, the .Dv USEM_HAS_WAITERS bit is set in the .Dv _count word to indicate waiters. -Function returns either due to +The function returns either due to .Dv _count indicating the semaphore is available (non-zero count due to post), or due to a wakeup. @@ -1096,7 +1101,7 @@ interruption and .Er EINTR error. .It Dv UMTX_OP_SEM2_WAKE -Wake up waiters on the semaphore lock. +Wake up waiters on semaphore lock. The arguments to the request are: .Bl -tag -width "It Fa obj" .It Fa obj @@ -1112,7 +1117,9 @@ bit was set in the .Dv _count word, and the last sleeping thread was woken up, the bit is cleared. .It Dv UMTX_OP_SHM -Manage the anonymous POSIX shared objects (see +Manage anonymous +.Tn POSIX +shared memory objects (see .Xr shm_open 2 ) , which can be attached to a byte of physical memory, mapped into the process address space. @@ -1126,7 +1133,7 @@ argument specifies the sub-request of th request: .Bl -tag -width "Dv UMTX_SHM_DESTROY" .It Dv UMTX_SHM_CREAT -Creates the POSIX anonymous memory shared object, which can be looked up +Creates the anonymous shared memory object, which can be looked up with the specified key .Fa uaddr. If the object associated with the @@ -1143,7 +1150,7 @@ Same as request, but if there is no shared memory object associated with the specified key .Fa uaddr , -an error is returned, and new object is not created. +an error is returned, and no new object is created. .It Dv UMTX_SHM_DESTROY De-associate the shared object with the specified key .Fa uaddr. @@ -1158,7 +1165,7 @@ This request is an optimization of the .Dv UMTX_SHM_LOOKUP request. It is cheaper when only the liveness of the associated object is asked -for, since the file descriptor is not installed in the process fd table +for, since no file descriptor is installed in the process fd table on success. .El .Pp @@ -1212,7 +1219,7 @@ The kernel inspects the in addition to walking the shared and private lists. Also, the mutex pointed to by .Dv robust_inact_offset -is handled more loosly at the thread termination time, +is handled more loosely at the thread termination time, than other mutexes on the list. That mutex is allowed to be not owned by the current thread, in which case list processing is continued. @@ -1233,7 +1240,7 @@ The .Dv UMTX_SHM_CREAT and .Dv UMTX_SHM_LOOKUP -return a POSIX shared memory file descriptor on success. +return a shared memory file descriptor on success. On error \-1 is returned, and the .Va errno variable is set to indicate the error. @@ -1326,15 +1333,15 @@ and .Dv UMTX_SHM_ALIVE sub-requests of the .Dv UMTX_OP_SHM -request, there is no shared object associated with the provided key. +request, there is no shared memory object associated with the provided key. .It Bq Er ENOMEM The .Dv UMTX_SHM_CREAT sub-request of the .Dv UMTX_OP_SHM -request cannot be satisfied, because allocation of the shared object +request cannot be satisfied, because allocation of the shared memory object would exceed the -.Dv RLIMIT_UMXP +.Dv RLIMIT_UMTXP resource limit, see .Xr setrlimit 2 . .It Bq Er EAGAIN @@ -1358,7 +1365,7 @@ specified in absolute time may be restar .It Bq Er ERESTART A signal was delivered during wait, for a restartable operation. Mutex lock requests without timeout specified are restartable. -The error is typically not returned to userspace code, restart +The error is not returned to userspace code since restart is handled by usual adjustment of the instruction counter. .El .Sh BUGS @@ -1374,7 +1381,7 @@ implementation is only vulnerable to thi a shared mutex. A possible fix for the current implementation is to strengthen the checks for shared mutexes before terminating them, in particular, verifying -that the mutex memory is mapped from the POSIX shared object, allocated +that the mutex memory is mapped from a shared memory object allocated by the .Dv UMTX_OP_SHM request. @@ -1402,5 +1409,5 @@ system call is non-standard and is used .Lb libthr to implement .St -p1003.1-2001 -.Xr pthread(3) +.Xr pthread 3 functionality. Modified: head/lib/libc/sys/thr_exit.2 ============================================================================== --- head/lib/libc/sys/thr_exit.2 Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/thr_exit.2 Sun May 29 14:16:23 2016 (r300957) @@ -47,18 +47,20 @@ system call terminates the current kerne .Pp If the .Fa state -argument is not NULL, the location pointed to by the argument is -updated with an arbitrary non-zero value, and +argument is not +.Dv NULL , +the location pointed to by the argument is +updated with an arbitrary non-zero value, and an .Xr _umtx_op 2 .Dv UMTX_OP_WAKE operation is consequently performed on the location. .Pp -Attempts to terminate last thread in the process are silently ignored. +Attempts to terminate the last thread in the process are silently ignored. Use .Xr _exit 2 syscall to terminate the process. .Sh RETURN VALUES -The function does not return any values. +The function does not return a value. A return from the function indicates that the calling thread was the last one in the process. .Sh SEE ALSO @@ -72,9 +74,9 @@ last one in the process. .Sh STANDARDS The .Fn thr_exit -system call is non-standard and is used by the +system call is non-standard and is used by .Lb libthr to implement .St -p1003.1-2001 -.Xr pthread(3) +.Xr pthread 3 functionality. Modified: head/lib/libc/sys/thr_kill.2 ============================================================================== --- head/lib/libc/sys/thr_kill.2 Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/thr_kill.2 Sun May 29 14:16:23 2016 (r300957) @@ -33,7 +33,7 @@ .Os .Sh NAME .Nm thr_kill -.Nd send signal to the thread +.Nd send signal to thread .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -72,7 +72,7 @@ The .Fa sig argument defines the delivered signal. It must be a valid signal number or zero. -In the later case no signal is actually send, and the call is used to +In the latter case no signal is actually sent, and the call is used to verify the liveness of the thread. .Pp The signal is delivered with @@ -127,5 +127,5 @@ system calls are non-standard and are us .Lb libthr to implement .St -p1003.1-2001 -.Xr pthread(3) +.Xr pthread 3 functionality. Modified: head/lib/libc/sys/thr_new.2 ============================================================================== --- head/lib/libc/sys/thr_new.2 Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/thr_new.2 Sun May 29 14:16:23 2016 (r300957) @@ -52,7 +52,7 @@ The machine context for the new thread i context, including coprocessor state. FPU state and specific machine registers are excluded from the copy. These are set according to ABI requirements and syscall parameters. -The FPU state for new thread is reinitialized to clean. +The FPU state for the new thread is reinitialized to clean. .Pp The .Fa param @@ -77,22 +77,22 @@ struct thr_param { and contains the following fields: .Bl -tag -width ".Va parent_tid" .It Va start_func -The pointer to the thread entry function. -Kernel arranges for the new thread to start executing the function +Pointer to the thread entry function. +The kernel arranges for the new thread to start executing the function upon the first return to userspace. .It Va arg Opaque argument supplied to the entry function. .It Va stack_base Stack base address. The stack must be allocated by the caller. -On some architectures, the ABI might require that system put information +On some architectures, the ABI might require that the system put information on the stack to ensure the execution environment for .Va start_func . .It Va stack_size Stack size. .It Va tls_base TLS base address. -The value of TLS base is loaded to the ABI-defined machine register +The value of TLS base is loaded into the ABI-defined machine register in the new thread context. .It Va tls_size TLS size. @@ -113,9 +113,9 @@ issuing the syscall, while .Va parent_tid is used by the thread creator. -The later is separate from the +The latter is separate from .Va child_tid -because new thread might exit and free its thread data before parent +because the new thread might exit and free its thread data before the parent has a chance to execute far enough to access it. .It Va flags Thread creation flags. @@ -132,7 +132,9 @@ The flag is not currently implemented. .El .It Va rtp Real-time scheduling priority for the new thread. -May be NULL if thread should inherit the priority from the +May be +.Dv NULL +to inherit the priority from the creating thread. .El .Pp @@ -184,14 +186,16 @@ initial data on the stack. .It Bq Er EINVAL The .Fa param_size -argument specifies negative value, or its value is greater than the +argument specifies a negative value, or the value is greater than the largest .Fa struct param size the kernel can interpret. .It Bq Er EINVAL The .Fa rtp -member is not NULL, but specifies invalid scheduling parameters. +member is not +.Dv NULL +and specifies invalid scheduling parameters. .It Bq Er EINVAL The specified TLS base is invalid. .It Bq Er EPROCLIM @@ -224,5 +228,5 @@ system call is non-standard and is used .Lb libthr to implement .St -p1003.1-2001 -.Xr pthread(3) +.Xr pthread 3 functionality. Modified: head/lib/libc/sys/thr_self.2 ============================================================================== --- head/lib/libc/sys/thr_self.2 Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/thr_self.2 Sun May 29 14:16:23 2016 (r300957) @@ -80,9 +80,9 @@ argument is not valid. .Sh STANDARDS The .Fn thr_self -system call is non-standard and is used by the +system call is non-standard and is used by .Lb libthr to implement .St -p1003.1-2001 -.Xr pthread(3) +.Xr pthread 3 functionality. Modified: head/lib/libc/sys/thr_set_name.2 ============================================================================== --- head/lib/libc/sys/thr_set_name.2 Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/thr_set_name.2 Sun May 29 14:16:23 2016 (r300957) @@ -45,7 +45,7 @@ The .Fn thr_set_name sets the user-visible name for the kernel thread with the identifier .Va id -in the current process, to the NULL-terminated string +in the current process, to the NUL-terminated string .Va name . The thread name can be seen in the output of the .Xr ps 1 @@ -92,5 +92,5 @@ does not exist in the current process. .Sh STANDARDS The .Fn thr_new -system call is non-standard and is used by the +system call is non-standard and is used by .Lb libthr . From owner-svn-src-head@freebsd.org Sun May 29 15:02:57 2016 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 2A0F4B53569; Sun, 29 May 2016 15:02:57 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id EE81313BF; Sun, 29 May 2016 15:02:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TF2u0c098185; Sun, 29 May 2016 15:02:56 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TF2uOm098184; Sun, 29 May 2016 15:02:56 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605291502.u4TF2uOm098184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 29 May 2016 15:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300958 - head/lib/libc/sys 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.22 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: Sun, 29 May 2016 15:02:57 -0000 Author: jilles Date: Sun May 29 15:02:55 2016 New Revision: 300958 URL: https://svnweb.freebsd.org/changeset/base/300958 Log: _umtx_op(2): Note deprecation of UMTX_OP_MUTEX_WAKE. Modified: head/lib/libc/sys/_umtx_op.2 Modified: head/lib/libc/sys/_umtx_op.2 ============================================================================== --- head/lib/libc/sys/_umtx_op.2 Sun May 29 14:16:23 2016 (r300957) +++ head/lib/libc/sys/_umtx_op.2 Sun May 29 15:02:55 2016 (r300958) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2016 +.Dd May 29, 2016 .Dt _UMTX_OP 2 .Os .Sh NAME @@ -1041,6 +1041,20 @@ with the byte addressed by the if any. Only normal mutexes are supported by the request. The sleep queue is always one for a normal mutex type. +.Pp +This request is deprecated in favor of +.Dv UMTX_OP_MUTEX_WAKE2 +since mutexes using it cannot synchronize their own destruction. +That is, the +.Dv m_owner +word has already been set to +.Dv UMUTEX_UNOWNED +when this request is made, +so that another thread can lock, unlock and destroy the mutex +(if no other thread uses the mutex afterwards). +Clearing the +.Dv UMUTEX_CONTESTED +bit may then modify freed memory. .It Dv UMTX_OP_MUTEX_WAKE2 Check if a umutex is unlocked and wake up a waiter. The arguments for the request are: From owner-svn-src-head@freebsd.org Sun May 29 15:46:21 2016 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 06E38B531B4; Sun, 29 May 2016 15:46:21 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id CAF771E25; Sun, 29 May 2016 15:46:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TFkJU3013117; Sun, 29 May 2016 15:46:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TFkJrc013116; Sun, 29 May 2016 15:46:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605291546.u4TFkJrc013116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 29 May 2016 15:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300959 - head/sys/vm 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.22 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: Sun, 29 May 2016 15:46:21 -0000 Author: kib Date: Sun May 29 15:46:19 2016 New Revision: 300959 URL: https://svnweb.freebsd.org/changeset/base/300959 Log: Do not leak the vm object lock when swap reservation failed, in vm_object_coalesce(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun May 29 15:02:55 2016 (r300958) +++ head/sys/vm/vm_object.c Sun May 29 15:46:19 2016 (r300959) @@ -2123,6 +2123,7 @@ vm_object_coalesce(vm_object_t prev_obje */ if (!reserved && !swap_reserve_by_cred(ptoa(next_size), prev_object->cred)) { + VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } prev_object->charge += ptoa(next_size); From owner-svn-src-head@freebsd.org Sun May 29 15:56:23 2016 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 B5C12B53627; Sun, 29 May 2016 15:56:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F17516EC; Sun, 29 May 2016 15:56:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4TFuHQT092566 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 29 May 2016 18:56:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4TFuHQT092566 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4TFuHQV092565; Sun, 29 May 2016 18:56:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 29 May 2016 18:56:17 +0300 From: Konstantin Belousov To: Jilles Tjoelker , emaste@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300957 - head/lib/libc/sys Message-ID: <20160529155617.GK38613@kib.kiev.ua> References: <201605291416.u4TEGOZE079829@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605291416.u4TEGOZE079829@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 15:56:23 -0000 On Sun, May 29, 2016 at 02:16:24PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Sun May 29 14:16:23 2016 > New Revision: 300957 > URL: https://svnweb.freebsd.org/changeset/base/300957 > > Log: > _umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes. I must say thanks both to Ed Maste and to you for making my original text tolerable for the native English readers. From owner-svn-src-head@freebsd.org Sun May 29 16:10:03 2016 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 224DFB53A28; Sun, 29 May 2016 16:10:03 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id D98D01E1B; Sun, 29 May 2016 16:10:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TGA2Rk020813; Sun, 29 May 2016 16:10:02 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TGA2cJ020812; Sun, 29 May 2016 16:10:02 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605291610.u4TGA2cJ020812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 29 May 2016 16:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300960 - head/contrib/binutils/include 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.22 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: Sun, 29 May 2016 16:10:03 -0000 Author: ed Date: Sun May 29 16:10:01 2016 New Revision: 300960 URL: https://svnweb.freebsd.org/changeset/base/300960 Log: Replace local prototype of basename() with an inclusion of . libiberty currently defines the prototype for basename() itself instead of using . It still uses the BSD-style prototype instead of the POSIX one, meaning that if FreeBSD would switch over to the POSIX one, you wouldn't be able to use libiberty.h and libgen.h in a single source file. It turns out that kgdb does this. Patch up libiberty to just include . I'm currently talking to upstream to see whether we can come up with a more complete solution that could be integrated, but for our unmaintained copy of GDB in base, let's just apply the simplest workaround possible. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D6631 Modified: head/contrib/binutils/include/libiberty.h Modified: head/contrib/binutils/include/libiberty.h ============================================================================== --- head/contrib/binutils/include/libiberty.h Sun May 29 15:46:19 2016 (r300959) +++ head/contrib/binutils/include/libiberty.h Sun May 29 16:10:01 2016 (r300960) @@ -102,7 +102,7 @@ extern int writeargv PARAMS ((char **, F is 1, we found it so don't provide any declaration at all. */ #if !HAVE_DECL_BASENAME #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) -extern char *basename (const char *); +#include #else /* Do not allow basename to be used if there is no prototype seen. We either need to use the above prototype or have one from From owner-svn-src-head@freebsd.org Sun May 29 16:16:08 2016 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 06502B53E59; Sun, 29 May 2016 16:16:08 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F13D314C0; Sun, 29 May 2016 16:16:07 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F083810AF; Sun, 29 May 2016 16:16:07 +0000 (UTC) Date: Sun, 29 May 2016 16:16:07 +0000 From: Alexey Dokuchaev To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300914 - head/share/timedef Message-ID: <20160529161607.GA18028@FreeBSD.org> References: <201605282126.u4SLQo6j001372@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605282126.u4SLQo6j001372@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 16:16:08 -0000 On Sat, May 28, 2016 at 09:26:50PM +0000, Baptiste Daroussin wrote: > New Revision: 300914 > URL: https://svnweb.freebsd.org/changeset/base/300914 > > Log: > Readd week day to default dates > > Requested by: many OK, so it means I no longer have to use LC_TIME=ja_JP.UTF-8 to get those? Nice, thank you. ./danfe From owner-svn-src-head@freebsd.org Sun May 29 16:39:29 2016 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 39BBCB53425; Sun, 29 May 2016 16:39:29 +0000 (UTC) (envelope-from ache@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 mx1.freebsd.org (Postfix) with ESMTPS id 0BFD714C2; Sun, 29 May 2016 16:39:28 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TGdSn1032145; Sun, 29 May 2016 16:39:28 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TGdSwq032144; Sun, 29 May 2016 16:39:28 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201605291639.u4TGdSwq032144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 29 May 2016 16:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300965 - head/lib/libc/stdlib 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.22 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: Sun, 29 May 2016 16:39:29 -0000 Author: ache Date: Sun May 29 16:39:28 2016 New Revision: 300965 URL: https://svnweb.freebsd.org/changeset/base/300965 Log: Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no reason to add "& 0x7fffffff" here. MFC after: 1 week Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 (r300964) +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 (r300965) @@ -430,7 +430,7 @@ random(void) */ f = fptr; r = rptr; *f += *r; - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ + i = *f >> 1; /* chucking least random bit */ if (++f >= end_ptr) { f = state; ++r; From owner-svn-src-head@freebsd.org Sun May 29 16:48:19 2016 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 DCDD8B53613; Sun, 29 May 2016 16:48:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A85021A79; Sun, 29 May 2016 16:48:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22c.google.com with SMTP id b65so240744618oia.1; Sun, 29 May 2016 09:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=U9LkKh45HX6P1vyAhE1HsCSNrskyFyOGXD7nWPvZyjM=; b=Ati72K4c4hYrmDvGbTopR20wSmAW1h5QqTI8E7Q2nx6cjbuXXMGlYUJLW6w+ylmy58 Vw2nXls6Ge+GbXfdjVlSi36La/8BiWeBa8w51SVXmTWbxBT4VEKy6sqTiyj4FUY6o92b B5ypesLZosllggcLqkTPS6tf+g0pn3wHAbYUYSH5ufXm3V30nezsAM5woqfe853P//5l V4+YfaLyH8d031uUlsfY1X5FgS/HGkFG+w0Iv+N6KKnFGkqMBUUHFtyYlYLfCNyTn0FM qWeZz6rNG8c+DG/g1wv4tnrjG3y2ca+kin9dAcuWgSF4qeoPtxF3opzCO6gsSrNT45JP wgDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=U9LkKh45HX6P1vyAhE1HsCSNrskyFyOGXD7nWPvZyjM=; b=PkpFup9VlhVPluFY0401F+vVg/XvGH/FYC7BYmdBtpMogvo4GkWvakb+4DeOXgHDE/ SL1D7ullPeM+CwjDTFyVV9BkkHs1i9Ji18h6wIQDZ90GEjPw5BBvMv46srPAUCRf1Ipu OoRe9/tV+Oe772SZSUL4wXOn/8s/iq8dgQ1pVO2V2Y31Jrm7vbUdPpdTMpX2jJpIBv7r OoMwICrSfpAZtkZ+utSsSgV8pl95RSVivLQYjL/cWun3NIt00lUN4Q5ikzCwiYgPFlFc gTgApgcx8xyoLuW25HhSGde29U6rtfYgHt1pUgpwVmw8/KjV12Tko5PEKFJWAcd+2vu1 DHsA== X-Gm-Message-State: ALyK8tLipCkyWpoZQFiBN0ifenx4zToNzBKuzv33nGjxVg6WoymE6ZU5lAYze0u2KlYg1vGTyTxks4toqdi7uA== MIME-Version: 1.0 X-Received: by 10.202.212.19 with SMTP id l19mr15668671oig.182.1464540498935; Sun, 29 May 2016 09:48:18 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Sun, 29 May 2016 09:48:18 -0700 (PDT) In-Reply-To: <201605291041.u4TAfRO3097741@repo.freebsd.org> References: <201605291041.u4TAfRO3097741@repo.freebsd.org> Date: Sun, 29 May 2016 10:48:18 -0600 X-Google-Sender-Auth: _D3b4VOGF4dXOEZwRfDtXL5Ag40 Message-ID: Subject: Re: svn commit: r300952 - head/usr.sbin/services_mkdb From: Alan Somers To: Ed Schouten Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 16:48:20 -0000 On Sun, May 29, 2016 at 4:41 AM, Ed Schouten wrote: > Author: ed > Date: Sun May 29 10:41:27 2016 > New Revision: 300952 > URL: https://svnweb.freebsd.org/changeset/base/300952 > > Log: > Invoke the dirname() function in a POSIX compliant way. > > POSIX requires that the argument of dirname() is of type "char *". In > other words, the input buffer can be modified by the function to store > the directory name. > > Pull a copy of the string before calling dirname(). We don't care about > freeing up the memory afterwards, as this is done at the very bottom of > main(), right before the program terminates. > > Reviewed by: bapt > Differential Revision: https://reviews.freebsd.org/D6628 > > Modified: > head/usr.sbin/services_mkdb/services_mkdb.c > > Modified: head/usr.sbin/services_mkdb/services_mkdb.c > ============================================================================== > --- head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 07:39:56 2016 (r300951) > +++ head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 10:41:27 2016 (r300952) > @@ -92,7 +92,7 @@ main(int argc, char *argv[]) > size_t cnt = 0; > StringList *sl, ***svc; > size_t port, proto; > - char *dbname_dir; > + char *dbname_dir, *dbname_dirbuf; > int dbname_dir_fd = -1; > > setprogname(argv[0]); > @@ -172,7 +172,8 @@ main(int argc, char *argv[]) > * fsync() to the directory where file lies > */ > if (rename(tname, dbname) == -1 || > - (dbname_dir = dirname(dbname)) == NULL || > + (dbname_dirbuf = strdup(dbname)) == NULL || > + (dbname_dir = dirname(dbname_dirbuf)) == NULL || > (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || > fsync(dbname_dir_fd) != 0) { > if (dbname_dir_fd != -1) > Even though the program is about to exit, it's worth freeing the memory just to make Coverity shut up. -Alan From owner-svn-src-head@freebsd.org Sun May 29 17:26:42 2016 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 215BDB54023; Sun, 29 May 2016 17:26:42 +0000 (UTC) (envelope-from cperciva@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 mx1.freebsd.org (Postfix) with ESMTPS id CF2E81C82; Sun, 29 May 2016 17:26:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4THQfG2050261; Sun, 29 May 2016 17:26:41 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4THQf15050259; Sun, 29 May 2016 17:26:41 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201605291726.u4THQf15050259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 29 May 2016 17:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300966 - head/sys/crypto/sha2 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.22 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: Sun, 29 May 2016 17:26:42 -0000 Author: cperciva Date: Sun May 29 17:26:40 2016 New Revision: 300966 URL: https://svnweb.freebsd.org/changeset/base/300966 Log: Retune SHA2 code for improved performance on CPUs with more ILP and a preference for memory load instructions over large code footprints with embedded immediate variables. On amd64 CPUs from 2007-2008 there is not a significant change, but amd64 CPUs from 2009-2010 get roughly 10% more throughput with this code; amd64 CPUs from 2011-2012 get roughly 15% more throughput; and AMD64 CPUs from 2013-2015 get 20-25% more throughput. The Raspberry Pi 2 increases its throughput by 6-8%. Sponsored by: Tarsnap Backup Inc. Performance tested by: allanjude MFC after: 3 weeks Modified: head/sys/crypto/sha2/sha256c.c head/sys/crypto/sha2/sha512c.c Modified: head/sys/crypto/sha2/sha256c.c ============================================================================== --- head/sys/crypto/sha2/sha256c.c Sun May 29 16:39:28 2016 (r300965) +++ head/sys/crypto/sha2/sha256c.c Sun May 29 17:26:40 2016 (r300966) @@ -78,6 +78,26 @@ be32dec_vect(uint32_t *dst, const unsign #endif /* BYTE_ORDER != BIG_ENDIAN */ +/* SHA256 round constants. */ +static const uint32_t K[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + /* Elementary functions used by SHA256 */ #define Ch(x, y, z) ((x & (y ^ z)) ^ z) #define Maj(x, y, z) ((x & (y | z)) | (y & z)) @@ -90,18 +110,21 @@ be32dec_vect(uint32_t *dst, const unsign /* SHA256 round function */ #define RND(a, b, c, d, e, f, g, h, k) \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; + h += S1(e) + Ch(e, f, g) + k; \ + d += h; \ + h += S0(a) + Maj(a, b, c); /* Adjusted round function for rotating state */ -#define RNDr(S, W, i, k) \ +#define RNDr(S, W, i, ii) \ RND(S[(64 - i) % 8], S[(65 - i) % 8], \ S[(66 - i) % 8], S[(67 - i) % 8], \ S[(68 - i) % 8], S[(69 - i) % 8], \ S[(70 - i) % 8], S[(71 - i) % 8], \ - W[i] + k) + W[i + ii] + K[i + ii]) + +/* Message schedule computation */ +#define MSCH(W, ii, i) \ + W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii] /* * SHA256 block compression function. The 256-bit state is transformed via @@ -112,82 +135,52 @@ SHA256_Transform(uint32_t * state, const { uint32_t W[64]; uint32_t S[8]; - uint32_t t0, t1; int i; - /* 1. Prepare message schedule W. */ + /* 1. Prepare the first part of the message schedule W. */ be32dec_vect(W, block, 64); - for (i = 16; i < 64; i++) - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; /* 2. Initialize working variables. */ memcpy(S, state, 32); /* 3. Mix. */ - RNDr(S, W, 0, 0x428a2f98); - RNDr(S, W, 1, 0x71374491); - RNDr(S, W, 2, 0xb5c0fbcf); - RNDr(S, W, 3, 0xe9b5dba5); - RNDr(S, W, 4, 0x3956c25b); - RNDr(S, W, 5, 0x59f111f1); - RNDr(S, W, 6, 0x923f82a4); - RNDr(S, W, 7, 0xab1c5ed5); - RNDr(S, W, 8, 0xd807aa98); - RNDr(S, W, 9, 0x12835b01); - RNDr(S, W, 10, 0x243185be); - RNDr(S, W, 11, 0x550c7dc3); - RNDr(S, W, 12, 0x72be5d74); - RNDr(S, W, 13, 0x80deb1fe); - RNDr(S, W, 14, 0x9bdc06a7); - RNDr(S, W, 15, 0xc19bf174); - RNDr(S, W, 16, 0xe49b69c1); - RNDr(S, W, 17, 0xefbe4786); - RNDr(S, W, 18, 0x0fc19dc6); - RNDr(S, W, 19, 0x240ca1cc); - RNDr(S, W, 20, 0x2de92c6f); - RNDr(S, W, 21, 0x4a7484aa); - RNDr(S, W, 22, 0x5cb0a9dc); - RNDr(S, W, 23, 0x76f988da); - RNDr(S, W, 24, 0x983e5152); - RNDr(S, W, 25, 0xa831c66d); - RNDr(S, W, 26, 0xb00327c8); - RNDr(S, W, 27, 0xbf597fc7); - RNDr(S, W, 28, 0xc6e00bf3); - RNDr(S, W, 29, 0xd5a79147); - RNDr(S, W, 30, 0x06ca6351); - RNDr(S, W, 31, 0x14292967); - RNDr(S, W, 32, 0x27b70a85); - RNDr(S, W, 33, 0x2e1b2138); - RNDr(S, W, 34, 0x4d2c6dfc); - RNDr(S, W, 35, 0x53380d13); - RNDr(S, W, 36, 0x650a7354); - RNDr(S, W, 37, 0x766a0abb); - RNDr(S, W, 38, 0x81c2c92e); - RNDr(S, W, 39, 0x92722c85); - RNDr(S, W, 40, 0xa2bfe8a1); - RNDr(S, W, 41, 0xa81a664b); - RNDr(S, W, 42, 0xc24b8b70); - RNDr(S, W, 43, 0xc76c51a3); - RNDr(S, W, 44, 0xd192e819); - RNDr(S, W, 45, 0xd6990624); - RNDr(S, W, 46, 0xf40e3585); - RNDr(S, W, 47, 0x106aa070); - RNDr(S, W, 48, 0x19a4c116); - RNDr(S, W, 49, 0x1e376c08); - RNDr(S, W, 50, 0x2748774c); - RNDr(S, W, 51, 0x34b0bcb5); - RNDr(S, W, 52, 0x391c0cb3); - RNDr(S, W, 53, 0x4ed8aa4a); - RNDr(S, W, 54, 0x5b9cca4f); - RNDr(S, W, 55, 0x682e6ff3); - RNDr(S, W, 56, 0x748f82ee); - RNDr(S, W, 57, 0x78a5636f); - RNDr(S, W, 58, 0x84c87814); - RNDr(S, W, 59, 0x8cc70208); - RNDr(S, W, 60, 0x90befffa); - RNDr(S, W, 61, 0xa4506ceb); - RNDr(S, W, 62, 0xbef9a3f7); - RNDr(S, W, 63, 0xc67178f2); + for (i = 0; i < 64; i += 16) { + RNDr(S, W, 0, i); + RNDr(S, W, 1, i); + RNDr(S, W, 2, i); + RNDr(S, W, 3, i); + RNDr(S, W, 4, i); + RNDr(S, W, 5, i); + RNDr(S, W, 6, i); + RNDr(S, W, 7, i); + RNDr(S, W, 8, i); + RNDr(S, W, 9, i); + RNDr(S, W, 10, i); + RNDr(S, W, 11, i); + RNDr(S, W, 12, i); + RNDr(S, W, 13, i); + RNDr(S, W, 14, i); + RNDr(S, W, 15, i); + + if (i == 48) + break; + MSCH(W, 0, i); + MSCH(W, 1, i); + MSCH(W, 2, i); + MSCH(W, 3, i); + MSCH(W, 4, i); + MSCH(W, 5, i); + MSCH(W, 6, i); + MSCH(W, 7, i); + MSCH(W, 8, i); + MSCH(W, 9, i); + MSCH(W, 10, i); + MSCH(W, 11, i); + MSCH(W, 12, i); + MSCH(W, 13, i); + MSCH(W, 14, i); + MSCH(W, 15, i); + } /* 4. Mix local working variables into global state */ for (i = 0; i < 8; i++) @@ -205,22 +198,29 @@ static unsigned char PAD[64] = { static void SHA256_Pad(SHA256_CTX * ctx) { - unsigned char len[8]; - uint32_t r, plen; - - /* - * Convert length to a vector of bytes -- we do this now rather - * than later because the length will change after we pad. - */ - be64enc(len, ctx->count); + size_t r; - /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ + /* Figure out how many bytes we have buffered. */ r = (ctx->count >> 3) & 0x3f; - plen = (r < 56) ? (56 - r) : (120 - r); - SHA256_Update(ctx, PAD, (size_t)plen); - /* Add the terminating bit-count */ - SHA256_Update(ctx, len, 8); + /* Pad to 56 mod 64, transforming if we finish a block en route. */ + if (r < 56) { + /* Pad to 56 mod 64. */ + memcpy(&ctx->buf[r], PAD, 56 - r); + } else { + /* Finish the current block and mix. */ + memcpy(&ctx->buf[r], PAD, 64 - r); + SHA256_Transform(ctx->state, ctx->buf); + + /* The start of the final block is all zeroes. */ + memset(&ctx->buf[0], 0, 56); + } + + /* Add the terminating bit-count. */ + be64enc(&ctx->buf[56], ctx->count); + + /* Mix in the final block. */ + SHA256_Transform(ctx->state, ctx->buf); } /* SHA-256 initialization. Begins a SHA-256 operation. */ Modified: head/sys/crypto/sha2/sha512c.c ============================================================================== --- head/sys/crypto/sha2/sha512c.c Sun May 29 16:39:28 2016 (r300965) +++ head/sys/crypto/sha2/sha512c.c Sun May 29 17:26:40 2016 (r300966) @@ -81,6 +81,50 @@ be64dec_vect(uint64_t *dst, const unsign #endif /* BYTE_ORDER != BIG_ENDIAN */ +/* SHA512 round constants. */ +static const uint64_t K[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL +}; + /* Elementary functions used by SHA512 */ #define Ch(x, y, z) ((x & (y ^ z)) ^ z) #define Maj(x, y, z) ((x & (y | z)) | (y & z)) @@ -93,18 +137,21 @@ be64dec_vect(uint64_t *dst, const unsign /* SHA512 round function */ #define RND(a, b, c, d, e, f, g, h, k) \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; + h += S1(e) + Ch(e, f, g) + k; \ + d += h; \ + h += S0(a) + Maj(a, b, c); /* Adjusted round function for rotating state */ -#define RNDr(S, W, i, k) \ +#define RNDr(S, W, i, ii) \ RND(S[(80 - i) % 8], S[(81 - i) % 8], \ S[(82 - i) % 8], S[(83 - i) % 8], \ S[(84 - i) % 8], S[(85 - i) % 8], \ S[(86 - i) % 8], S[(87 - i) % 8], \ - W[i] + k) + W[i + ii] + K[i + ii]) + +/* Message schedule computation */ +#define MSCH(W, ii, i) \ + W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii] /* * SHA512 block compression function. The 512-bit state is transformed via @@ -115,98 +162,52 @@ SHA512_Transform(uint64_t * state, const { uint64_t W[80]; uint64_t S[8]; - uint64_t t0, t1; int i; - /* 1. Prepare message schedule W. */ + /* 1. Prepare the first part of the message schedule W. */ be64dec_vect(W, block, SHA512_BLOCK_LENGTH); - for (i = 16; i < 80; i++) - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; /* 2. Initialize working variables. */ memcpy(S, state, SHA512_DIGEST_LENGTH); /* 3. Mix. */ - RNDr(S, W, 0, 0x428a2f98d728ae22ULL); - RNDr(S, W, 1, 0x7137449123ef65cdULL); - RNDr(S, W, 2, 0xb5c0fbcfec4d3b2fULL); - RNDr(S, W, 3, 0xe9b5dba58189dbbcULL); - RNDr(S, W, 4, 0x3956c25bf348b538ULL); - RNDr(S, W, 5, 0x59f111f1b605d019ULL); - RNDr(S, W, 6, 0x923f82a4af194f9bULL); - RNDr(S, W, 7, 0xab1c5ed5da6d8118ULL); - RNDr(S, W, 8, 0xd807aa98a3030242ULL); - RNDr(S, W, 9, 0x12835b0145706fbeULL); - RNDr(S, W, 10, 0x243185be4ee4b28cULL); - RNDr(S, W, 11, 0x550c7dc3d5ffb4e2ULL); - RNDr(S, W, 12, 0x72be5d74f27b896fULL); - RNDr(S, W, 13, 0x80deb1fe3b1696b1ULL); - RNDr(S, W, 14, 0x9bdc06a725c71235ULL); - RNDr(S, W, 15, 0xc19bf174cf692694ULL); - RNDr(S, W, 16, 0xe49b69c19ef14ad2ULL); - RNDr(S, W, 17, 0xefbe4786384f25e3ULL); - RNDr(S, W, 18, 0x0fc19dc68b8cd5b5ULL); - RNDr(S, W, 19, 0x240ca1cc77ac9c65ULL); - RNDr(S, W, 20, 0x2de92c6f592b0275ULL); - RNDr(S, W, 21, 0x4a7484aa6ea6e483ULL); - RNDr(S, W, 22, 0x5cb0a9dcbd41fbd4ULL); - RNDr(S, W, 23, 0x76f988da831153b5ULL); - RNDr(S, W, 24, 0x983e5152ee66dfabULL); - RNDr(S, W, 25, 0xa831c66d2db43210ULL); - RNDr(S, W, 26, 0xb00327c898fb213fULL); - RNDr(S, W, 27, 0xbf597fc7beef0ee4ULL); - RNDr(S, W, 28, 0xc6e00bf33da88fc2ULL); - RNDr(S, W, 29, 0xd5a79147930aa725ULL); - RNDr(S, W, 30, 0x06ca6351e003826fULL); - RNDr(S, W, 31, 0x142929670a0e6e70ULL); - RNDr(S, W, 32, 0x27b70a8546d22ffcULL); - RNDr(S, W, 33, 0x2e1b21385c26c926ULL); - RNDr(S, W, 34, 0x4d2c6dfc5ac42aedULL); - RNDr(S, W, 35, 0x53380d139d95b3dfULL); - RNDr(S, W, 36, 0x650a73548baf63deULL); - RNDr(S, W, 37, 0x766a0abb3c77b2a8ULL); - RNDr(S, W, 38, 0x81c2c92e47edaee6ULL); - RNDr(S, W, 39, 0x92722c851482353bULL); - RNDr(S, W, 40, 0xa2bfe8a14cf10364ULL); - RNDr(S, W, 41, 0xa81a664bbc423001ULL); - RNDr(S, W, 42, 0xc24b8b70d0f89791ULL); - RNDr(S, W, 43, 0xc76c51a30654be30ULL); - RNDr(S, W, 44, 0xd192e819d6ef5218ULL); - RNDr(S, W, 45, 0xd69906245565a910ULL); - RNDr(S, W, 46, 0xf40e35855771202aULL); - RNDr(S, W, 47, 0x106aa07032bbd1b8ULL); - RNDr(S, W, 48, 0x19a4c116b8d2d0c8ULL); - RNDr(S, W, 49, 0x1e376c085141ab53ULL); - RNDr(S, W, 50, 0x2748774cdf8eeb99ULL); - RNDr(S, W, 51, 0x34b0bcb5e19b48a8ULL); - RNDr(S, W, 52, 0x391c0cb3c5c95a63ULL); - RNDr(S, W, 53, 0x4ed8aa4ae3418acbULL); - RNDr(S, W, 54, 0x5b9cca4f7763e373ULL); - RNDr(S, W, 55, 0x682e6ff3d6b2b8a3ULL); - RNDr(S, W, 56, 0x748f82ee5defb2fcULL); - RNDr(S, W, 57, 0x78a5636f43172f60ULL); - RNDr(S, W, 58, 0x84c87814a1f0ab72ULL); - RNDr(S, W, 59, 0x8cc702081a6439ecULL); - RNDr(S, W, 60, 0x90befffa23631e28ULL); - RNDr(S, W, 61, 0xa4506cebde82bde9ULL); - RNDr(S, W, 62, 0xbef9a3f7b2c67915ULL); - RNDr(S, W, 63, 0xc67178f2e372532bULL); - RNDr(S, W, 64, 0xca273eceea26619cULL); - RNDr(S, W, 65, 0xd186b8c721c0c207ULL); - RNDr(S, W, 66, 0xeada7dd6cde0eb1eULL); - RNDr(S, W, 67, 0xf57d4f7fee6ed178ULL); - RNDr(S, W, 68, 0x06f067aa72176fbaULL); - RNDr(S, W, 69, 0x0a637dc5a2c898a6ULL); - RNDr(S, W, 70, 0x113f9804bef90daeULL); - RNDr(S, W, 71, 0x1b710b35131c471bULL); - RNDr(S, W, 72, 0x28db77f523047d84ULL); - RNDr(S, W, 73, 0x32caab7b40c72493ULL); - RNDr(S, W, 74, 0x3c9ebe0a15c9bebcULL); - RNDr(S, W, 75, 0x431d67c49c100d4cULL); - RNDr(S, W, 76, 0x4cc5d4becb3e42b6ULL); - RNDr(S, W, 77, 0x597f299cfc657e2aULL); - RNDr(S, W, 78, 0x5fcb6fab3ad6faecULL); - RNDr(S, W, 79, 0x6c44198c4a475817ULL); + for (i = 0; i < 80; i += 16) { + RNDr(S, W, 0, i); + RNDr(S, W, 1, i); + RNDr(S, W, 2, i); + RNDr(S, W, 3, i); + RNDr(S, W, 4, i); + RNDr(S, W, 5, i); + RNDr(S, W, 6, i); + RNDr(S, W, 7, i); + RNDr(S, W, 8, i); + RNDr(S, W, 9, i); + RNDr(S, W, 10, i); + RNDr(S, W, 11, i); + RNDr(S, W, 12, i); + RNDr(S, W, 13, i); + RNDr(S, W, 14, i); + RNDr(S, W, 15, i); + + if (i == 64) + break; + MSCH(W, 0, i); + MSCH(W, 1, i); + MSCH(W, 2, i); + MSCH(W, 3, i); + MSCH(W, 4, i); + MSCH(W, 5, i); + MSCH(W, 6, i); + MSCH(W, 7, i); + MSCH(W, 8, i); + MSCH(W, 9, i); + MSCH(W, 10, i); + MSCH(W, 11, i); + MSCH(W, 12, i); + MSCH(W, 13, i); + MSCH(W, 14, i); + MSCH(W, 15, i); + } /* 4. Mix local working variables into global state */ for (i = 0; i < 8; i++) @@ -228,22 +229,29 @@ static unsigned char PAD[SHA512_BLOCK_LE static void SHA512_Pad(SHA512_CTX * ctx) { - unsigned char len[16]; - uint64_t r, plen; - - /* - * Convert length to a vector of bytes -- we do this now rather - * than later because the length will change after we pad. - */ - be64enc_vect(len, ctx->count, 16); + size_t r; - /* Add 1--128 bytes so that the resulting length is 112 mod 128 */ + /* Figure out how many bytes we have buffered. */ r = (ctx->count[1] >> 3) & 0x7f; - plen = (r < 112) ? (112 - r) : (240 - r); - SHA512_Update(ctx, PAD, (size_t)plen); - /* Add the terminating bit-count */ - SHA512_Update(ctx, len, 16); + /* Pad to 112 mod 128, transforming if we finish a block en route. */ + if (r < 112) { + /* Pad to 112 mod 128. */ + memcpy(&ctx->buf[r], PAD, 112 - r); + } else { + /* Finish the current block and mix. */ + memcpy(&ctx->buf[r], PAD, 128 - r); + SHA512_Transform(ctx->state, ctx->buf); + + /* The start of the final block is all zeroes. */ + memset(&ctx->buf[0], 0, 112); + } + + /* Add the terminating bit-count. */ + be64enc_vect(&ctx->buf[112], ctx->count, 16); + + /* Mix in the final block. */ + SHA512_Transform(ctx->state, ctx->buf); } /* SHA-512 initialization. Begins a SHA-512 operation. */ From owner-svn-src-head@freebsd.org Sun May 29 17:32:20 2016 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 431A9B541DE; Sun, 29 May 2016 17:32:20 +0000 (UTC) (envelope-from dim@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 mx1.freebsd.org (Postfix) with ESMTPS id 0EEB31105; Sun, 29 May 2016 17:32:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4THWJlF053820; Sun, 29 May 2016 17:32:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4THWJMD053819; Sun, 29 May 2016 17:32:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605291732.u4THWJMD053819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 29 May 2016 17:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300967 - head/sys/sys 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.22 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: Sun, 29 May 2016 17:32:20 -0000 Author: dim Date: Sun May 29 17:32:19 2016 New Revision: 300967 URL: https://svnweb.freebsd.org/changeset/base/300967 Log: Stop exposing the C11 _Atomic() macro in , when compiling for C++. It clashes with the one in libc++'s header. (Previously, the _Atomic() macro was defined in , which is only for use with C11, but for various reasons it was moved to its current location in r251804.) Discussed with: bdrewery, ed MFC after: 2 weeks Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun May 29 17:26:40 2016 (r300966) +++ head/sys/sys/cdefs.h Sun May 29 17:32:19 2016 (r300967) @@ -275,7 +275,8 @@ #define _Alignof(x) __alignof(x) #endif -#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) +#if !defined(__cplusplus) && !__has_extension(c_atomic) && \ + !__has_extension(cxx_atomic) /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. From owner-svn-src-head@freebsd.org Sun May 29 17:33:50 2016 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 D82F1B54239; Sun, 29 May 2016 17:33:50 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 99B1F13A9; Sun, 29 May 2016 17:33:50 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4THXn2c053933; Sun, 29 May 2016 17:33:49 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4THXn93053932; Sun, 29 May 2016 17:33:49 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605291733.u4THXn93053932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 29 May 2016 17:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300968 - head/sys/arm/arm 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.22 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: Sun, 29 May 2016 17:33:50 -0000 Author: zbb Date: Sun May 29 17:33:49 2016 New Revision: 300968 URL: https://svnweb.freebsd.org/changeset/base/300968 Log: Fix debug_monitor code for older ARMs (ARM11) - Enable monitor mode prior to accessing watchpoint registers for v6, v6.1 architectures. - Fix configuration scheme for v6, v6.1 and v7 Debug Archs - Enable monitor unconditionally and for good instead of enabling and disabling it (needed for single stepping on on v6/v6.1) Tested on RPI-B and Arndale Differential Revision: https://reviews.freebsd.org/D6008 Modified: head/sys/arm/arm/debug_monitor.c Modified: head/sys/arm/arm/debug_monitor.c ============================================================================== --- head/sys/arm/arm/debug_monitor.c Sun May 29 17:32:19 2016 (r300967) +++ head/sys/arm/arm/debug_monitor.c Sun May 29 17:33:49 2016 (r300968) @@ -82,8 +82,6 @@ static boolean_t dbg_ossr; /* OS Save an static uint32_t dbg_watchpoint_num; static uint32_t dbg_breakpoint_num; -static int dbg_ref_count_mme; /* Times monitor mode was enabled */ - /* ID_DFR0 - Debug Feature Register 0 */ #define ID_DFR0_CP_DEBUG_M_SHIFT 0 #define ID_DFR0_CP_DEBUG_M_MASK (0xF << ID_DFR0_CP_DEBUG_M_SHIFT) @@ -250,6 +248,13 @@ dbg_wb_write_reg(int reg, int n, uint32_ boolean_t kdb_cpu_pc_is_singlestep(db_addr_t pc) { + /* + * XXX: If the platform fails to enable its debug arch. + * there will be no stepping capabilities + * (SOFTWARE_SSTEP is not defined for __ARM_ARCH >= 6). + */ + if (!dbg_capable) + return (FALSE); if (dbg_find_slot(DBG_TYPE_BREAKPOINT, pc) != ~0U) return (TRUE); @@ -265,6 +270,9 @@ kdb_cpu_set_singlestep(void) uint32_t wcr; u_int i; + if (!dbg_capable) + return; + /* * Disable watchpoints, e.g. stepping over watched instruction will * trigger break exception instead of single-step exception and locks @@ -295,6 +303,9 @@ kdb_cpu_clear_singlestep(void) uint32_t wvr, wcr; u_int i; + if (!dbg_capable) + return; + dbg_remove_breakpoint(DBG_BKPT_BT_SLOT); dbg_remove_breakpoint(DBG_BKPT_BNT_SLOT); @@ -572,34 +583,6 @@ dbg_enable_monitor(void) } static int -dbg_disable_monitor(void) -{ - uint32_t dbg_dscr; - - if (!dbg_monitor_is_enabled()) - return (0); - - dbg_dscr = cp14_dbgdscrint_get(); - switch (dbg_model) { - case ID_DFR0_CP_DEBUG_M_V6: - case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */ - dbg_dscr &= ~DBGSCR_MDBG_EN; - cp14_dbgdscr_v6_set(dbg_dscr); - break; - case ID_DFR0_CP_DEBUG_M_V7: /* fall through */ - case ID_DFR0_CP_DEBUG_M_V7_1: - dbg_dscr &= ~DBGSCR_MDBG_EN; - cp14_dbgdscr_v7_set(dbg_dscr); - break; - default: - return (ENXIO); - } - isb(); - - return (0); -} - -static int dbg_setup_xpoint(struct dbg_wb_conf *conf) { struct pcpu *pcpu; @@ -702,13 +685,6 @@ dbg_setup_xpoint(struct dbg_wb_conf *con dbg_wb_write_reg(reg_addr, i, addr); dbg_wb_write_reg(reg_ctrl, i, ctrl); - err = dbg_enable_monitor(); - if (err != 0) - return (err); - - /* Increment monitor enable counter */ - dbg_ref_count_mme++; - /* * Save watchpoint settings for all CPUs. * We don't need to do the same with breakpoints since HW breakpoints @@ -775,19 +751,6 @@ dbg_remove_xpoint(struct dbg_wb_conf *co dbg_wb_write_reg(reg_ctrl, i, 0); dbg_wb_write_reg(reg_addr, i, 0); - /* Decrement monitor enable counter */ - dbg_ref_count_mme--; - if (dbg_ref_count_mme < 0) - dbg_ref_count_mme = 0; - - atomic_thread_fence_rel(); - - if (dbg_ref_count_mme == 0) { - err = dbg_disable_monitor(); - if (err != 0) - return (err); - } - /* * Save watchpoint settings for all CPUs. * We don't need to do the same with breakpoints since HW breakpoints @@ -827,7 +790,7 @@ dbg_get_ossr(void) { switch (dbg_model) { - case ID_DFR0_CP_DEBUG_M_V6_1: + case ID_DFR0_CP_DEBUG_M_V7: if ((cp14_dbgoslsr_get() & DBGOSLSR_OSLM0) != 0) return (TRUE); @@ -844,10 +807,8 @@ dbg_arch_supported(void) { switch (dbg_model) { -#ifdef not_yet case ID_DFR0_CP_DEBUG_M_V6: case ID_DFR0_CP_DEBUG_M_V6_1: -#endif case ID_DFR0_CP_DEBUG_M_V7: case ID_DFR0_CP_DEBUG_M_V7_1: /* fall through */ return (TRUE); @@ -889,9 +850,16 @@ dbg_reset_state(void) switch (dbg_model) { case ID_DFR0_CP_DEBUG_M_V6: - /* v6 Debug logic reset upon power-up */ - return (0); - case ID_DFR0_CP_DEBUG_M_V6_1: + case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */ + /* + * Arch needs monitor mode selected and enabled + * to be able to access breakpoint/watchpoint registers. + */ + err = dbg_enable_monitor(); + if (err != 0) + return (err); + goto vectr_clr; + case ID_DFR0_CP_DEBUG_M_V7: /* Is core power domain powered up? */ if ((cp14_dbgprsr_get() & DBGPRSR_PU) == 0) err = ENXIO; @@ -902,8 +870,6 @@ dbg_reset_state(void) if (dbg_ossr) goto vectr_clr; break; - case ID_DFR0_CP_DEBUG_M_V7: - break; case ID_DFR0_CP_DEBUG_M_V7_1: /* Is double lock set? */ if ((cp14_dbgosdlr_get() & DBGPRSR_DLK) != 0) @@ -998,8 +964,11 @@ dbg_monitor_init(void) err = dbg_reset_state(); if (err == 0) { - dbg_capable = TRUE; - return; + err = dbg_enable_monitor(); + if (err == 0) { + dbg_capable = TRUE; + return; + } } db_printf("HW Breakpoints/Watchpoints not enabled on CPU%d\n", @@ -1050,21 +1019,6 @@ dbg_resume_dbreg(void) dbg_wb_write_reg(DBG_REG_BASE_WCR, i, d->dbg_wcr[i]); } - if ((dbg_ref_count_mme > 0) && !dbg_monitor_is_enabled()) { - err = dbg_enable_monitor(); - if (err != 0) { - panic("%s: Failed to enable Debug Monitor " - "on CPU%d", __func__, cpuid); - } - } - if ((dbg_ref_count_mme == 0) && dbg_monitor_is_enabled()) { - err = dbg_disable_monitor(); - if (err != 0) { - panic("%s: Failed to disable Debug Monitor " - "on CPU%d", __func__, cpuid); - } - } - PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); break; } From owner-svn-src-head@freebsd.org Sun May 29 17:35:39 2016 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 A6096B5429D; Sun, 29 May 2016 17:35:39 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 6901916B7; Sun, 29 May 2016 17:35:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4THZc1e054042; Sun, 29 May 2016 17:35:38 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4THZcFc054039; Sun, 29 May 2016 17:35:38 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605291735.u4THZcFc054039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 29 May 2016 17:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300969 - in head/sys/arm: arm include 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.22 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: Sun, 29 May 2016 17:35:39 -0000 Author: zbb Date: Sun May 29 17:35:38 2016 New Revision: 300969 URL: https://svnweb.freebsd.org/changeset/base/300969 Log: Improve ARM debug_monitor for SMP machines - Reset debug architecture and enable monitor for secondary CPUs in init_secondary() rather than when configuring watchpoint, etc. - Disable HW debugging capabilities when one of the CPU cores fails to set up. - Use dbg_capable() in a more atomic manner to avoid any mismatch between CPUs. Differential Revision: https://reviews.freebsd.org/D6009 Modified: head/sys/arm/arm/debug_monitor.c head/sys/arm/arm/mp_machdep.c head/sys/arm/include/debug_monitor.h Modified: head/sys/arm/arm/debug_monitor.c ============================================================================== --- head/sys/arm/arm/debug_monitor.c Sun May 29 17:33:49 2016 (r300968) +++ head/sys/arm/arm/debug_monitor.c Sun May 29 17:35:38 2016 (r300969) @@ -72,9 +72,8 @@ static boolean_t dbg_check_slot_free(enu static int dbg_remove_xpoint(struct dbg_wb_conf *); static int dbg_setup_xpoint(struct dbg_wb_conf *); -static boolean_t dbg_capable; /* Indicates that machine is capable of using +static int dbg_capable_var; /* Indicates that machine is capable of using HW watchpoints/breakpoints */ -static boolean_t dbg_ready[MAXCPU]; /* Debug arch. reset performed on this CPU */ static uint32_t dbg_model; /* Debug Arch. Model */ static boolean_t dbg_ossr; /* OS Save and Restore implemented */ @@ -245,6 +244,13 @@ dbg_wb_write_reg(int reg, int n, uint32_ isb(); } +static __inline boolean_t +dbg_capable(void) +{ + + return (atomic_cmpset_int(&dbg_capable_var, 0, 0) == 0); +} + boolean_t kdb_cpu_pc_is_singlestep(db_addr_t pc) { @@ -253,7 +259,7 @@ kdb_cpu_pc_is_singlestep(db_addr_t pc) * there will be no stepping capabilities * (SOFTWARE_SSTEP is not defined for __ARM_ARCH >= 6). */ - if (!dbg_capable) + if (!dbg_capable()) return (FALSE); if (dbg_find_slot(DBG_TYPE_BREAKPOINT, pc) != ~0U) @@ -270,7 +276,7 @@ kdb_cpu_set_singlestep(void) uint32_t wcr; u_int i; - if (!dbg_capable) + if (!dbg_capable()) return; /* @@ -303,7 +309,7 @@ kdb_cpu_clear_singlestep(void) uint32_t wvr, wcr; u_int i; - if (!dbg_capable) + if (!dbg_capable()) return; dbg_remove_breakpoint(DBG_BKPT_BT_SLOT); @@ -423,7 +429,7 @@ dbg_show_watchpoint(void) boolean_t is_enabled; int i; - if (!dbg_capable) { + if (!dbg_capable()) { db_printf("Architecture does not support HW " "breakpoints/watchpoints\n"); return; @@ -591,24 +597,15 @@ dbg_setup_xpoint(struct dbg_wb_conf *con uint32_t cr_size, cr_priv, cr_access; uint32_t reg_ctrl, reg_addr, ctrl, addr; boolean_t is_bkpt; - u_int cpuid, cpu; + u_int cpu; u_int i; - int err; - if (!dbg_capable) + if (!dbg_capable()) return (ENXIO); is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); typestr = is_bkpt ? "breakpoint" : "watchpoint"; - cpuid = PCPU_GET(cpuid); - if (!dbg_ready[cpuid]) { - err = dbg_reset_state(); - if (err != 0) - return (err); - dbg_ready[cpuid] = TRUE; - } - if (is_bkpt) { if (dbg_breakpoint_num == 0) { db_printf("Breakpoints not supported on this architecture\n"); @@ -698,7 +695,7 @@ dbg_setup_xpoint(struct dbg_wb_conf *con d->dbg_wvr[i] = addr; d->dbg_wcr[i] = ctrl; /* Skip update command for the current CPU */ - if (cpu != cpuid) + if (cpu != PCPU_GET(cpuid)) pcpu->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; } } @@ -715,23 +712,13 @@ dbg_remove_xpoint(struct dbg_wb_conf *co struct dbreg *d; uint32_t reg_ctrl, reg_addr, addr; boolean_t is_bkpt; - u_int cpuid, cpu; + u_int cpu; u_int i; - int err; - if (!dbg_capable) + if (!dbg_capable()) return (ENXIO); is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); - - cpuid = PCPU_GET(cpuid); - if (!dbg_ready[cpuid]) { - err = dbg_reset_state(); - if (err != 0) - return (err); - dbg_ready[cpuid] = TRUE; - } - addr = conf->address; if (is_bkpt) { @@ -764,7 +751,7 @@ dbg_remove_xpoint(struct dbg_wb_conf *co d->dbg_wvr[i] = 0; d->dbg_wcr[i] = 0; /* Skip update command for the current CPU */ - if (cpu != cpuid) + if (cpu != PCPU_GET(cpuid)) pcpu->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; } /* Ensure all data is written before waking other CPUs */ @@ -966,7 +953,7 @@ dbg_monitor_init(void) if (err == 0) { err = dbg_enable_monitor(); if (err == 0) { - dbg_capable = TRUE; + atomic_set_int(&dbg_capable_var, 1); return; } } @@ -978,18 +965,50 @@ dbg_monitor_init(void) CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); void +dbg_monitor_init_secondary(void) +{ + u_int cpuid; + int err; + /* + * This flag is set on the primary CPU + * and its meaning is valid for other CPUs too. + */ + if (!dbg_capable()) + return; + + cpuid = PCPU_GET(cpuid); + + err = dbg_reset_state(); + if (err != 0) { + /* + * Something is very wrong. + * WPs/BPs will not work correctly on this CPU. + */ + KASSERT(0, ("%s: Failed to reset Debug Architecture " + "state on CPU%d", __func__, cpuid)); + /* Disable HW debug capabilities for all CPUs */ + atomic_set_int(&dbg_capable_var, 0); + return; + } + err = dbg_enable_monitor(); + if (err != 0) { + KASSERT(0, ("%s: Failed to enable Debug Monitor" + " on CPU%d", __func__, cpuid)); + atomic_set_int(&dbg_capable_var, 0); + } +} + +void dbg_resume_dbreg(void) { struct dbreg *d; - u_int cpuid; u_int i; - int err; /* * This flag is set on the primary CPU * and its meaning is valid for other CPUs too. */ - if (!dbg_capable) + if (!dbg_capable()) return; atomic_thread_fence_acq(); @@ -997,21 +1016,6 @@ dbg_resume_dbreg(void) switch (PCPU_GET(dbreg_cmd)) { case PC_DBREG_CMD_LOAD: d = (struct dbreg *)PCPU_PTR(dbreg); - cpuid = PCPU_GET(cpuid); - - /* Reset Debug Architecture State if not done earlier */ - if (!dbg_ready[cpuid]) { - err = dbg_reset_state(); - if (err != 0) { - /* - * Something is very wrong. - * WPs/BPs will not work correctly in this CPU. - */ - panic("%s: Failed to reset Debug Architecture " - "state on CPU%d", __func__, cpuid); - } - dbg_ready[cpuid] = TRUE; - } /* Restore watchpoints */ for (i = 0; i < dbg_watchpoint_num; i++) { Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sun May 29 17:33:49 2016 (r300968) +++ head/sys/arm/arm/mp_machdep.c Sun May 29 17:35:38 2016 (r300969) @@ -23,6 +23,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +#include "opt_ddb.h" +#include "opt_smp.h" + #include __FBSDID("$FreeBSD$"); #include @@ -60,8 +63,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "opt_smp.h" - extern struct pcpu __pcpu[]; /* used to hold the AP's until we are ready to release them */ struct mtx ap_boot_mtx; @@ -176,6 +177,9 @@ init_secondary(int cpu) pcpu_init(pc, cpu, sizeof(struct pcpu)); dpcpu_init(dpcpu[cpu - 1], cpu); +#if __ARM_ARCH >= 6 && defined(DDB) + dbg_monitor_init_secondary(); +#endif /* Signal our startup to BSP */ atomic_add_rel_32(&mp_naps, 1); Modified: head/sys/arm/include/debug_monitor.h ============================================================================== --- head/sys/arm/include/debug_monitor.h Sun May 29 17:33:49 2016 (r300968) +++ head/sys/arm/include/debug_monitor.h Sun May 29 17:35:38 2016 (r300969) @@ -45,6 +45,7 @@ enum dbg_access_t { #if __ARM_ARCH >= 6 void dbg_monitor_init(void); +void dbg_monitor_init_secondary(void); void dbg_show_watchpoint(void); int dbg_setup_watchpoint(db_expr_t, db_expr_t, enum dbg_access_t); int dbg_remove_watchpoint(db_expr_t, db_expr_t); @@ -69,7 +70,10 @@ static __inline void dbg_monitor_init(void) { } - +static __inline void +dbg_monitor_init_secondary(void) +{ +} static __inline void dbg_resume_dbreg(void) { From owner-svn-src-head@freebsd.org Sun May 29 18:25:13 2016 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 7D364B54AA3; Sun, 29 May 2016 18:25:13 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id 56D1F1EC3; Sun, 29 May 2016 18:25:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TIPCks072773; Sun, 29 May 2016 18:25:12 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TIPCBq072768; Sun, 29 May 2016 18:25:12 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605291825.u4TIPCBq072768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 29 May 2016 18:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300970 - in head: lib/libthr share/man/man3 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.22 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: Sun, 29 May 2016 18:25:13 -0000 Author: jilles Date: Sun May 29 18:25:11 2016 New Revision: 300970 URL: https://svnweb.freebsd.org/changeset/base/300970 Log: Remove non-history libkse references and fix PTHREAD_PROCESSES_PRIVATE typo. Modified: head/lib/libthr/libthr.3 head/share/man/man3/pthread_barrier_destroy.3 head/share/man/man3/pthread_barrierattr.3 head/share/man/man3/pthread_condattr.3 head/share/man/man3/pthread_spin_init.3 Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Sun May 29 17:35:38 2016 (r300969) +++ head/lib/libthr/libthr.3 Sun May 29 18:25:11 2016 (r300970) @@ -47,9 +47,7 @@ library provides a 1:1 implementation of library interfaces for application threading. It has been optimized for use by applications expecting system scope thread -semantics, and can provide significant performance improvements -compared to -.Lb libkse . +semantics. .Pp The library is tightly integrated with the run-time link editor .Xr ld-elf.so.1 1 Modified: head/share/man/man3/pthread_barrier_destroy.3 ============================================================================== --- head/share/man/man3/pthread_barrier_destroy.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_barrier_destroy.3 Sun May 29 18:25:11 2016 (r300970) @@ -75,9 +75,7 @@ argument to .Fn pthread_barrier_init . Once the threads have been released the barrier will be reset. .Sh IMPLEMENTATION NOTES -In both -.Lb libkse -and +In .Lb libthr the .Dv PTHREAD_BARRIER_SERIAL_THREAD Modified: head/share/man/man3/pthread_barrierattr.3 ============================================================================== --- head/share/man/man3/pthread_barrierattr.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_barrierattr.3 Sun May 29 18:25:11 2016 (r300970) @@ -137,11 +137,9 @@ barriers does not fully conform to .St -p1003.2 because the process-shared attribute is ignored in -.Lb libthr , -and in -.Lb libkse ; +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_barrierattr_setpshared , it will return Modified: head/share/man/man3/pthread_condattr.3 ============================================================================== --- head/share/man/man3/pthread_condattr.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_condattr.3 Sun May 29 18:25:11 2016 (r300970) @@ -167,7 +167,7 @@ does not fully conform to .St -p1003.2 because the process-shared attribute is ignored; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_condattr_setpshared , it will return Modified: head/share/man/man3/pthread_spin_init.3 ============================================================================== --- head/share/man/man3/pthread_spin_init.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_spin_init.3 Sun May 29 18:25:11 2016 (r300970) @@ -129,10 +129,8 @@ does not fully conform to because the .Fa pshared argument is ignored in -.Lb libthr , -and in -.Lb libkse +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified, it returns .Er EINVAL . From owner-svn-src-head@freebsd.org Sun May 29 19:35:56 2016 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 7F6E6B53995; Sun, 29 May 2016 19:35:56 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 5A175133C; Sun, 29 May 2016 19:35:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TJZtqs098776; Sun, 29 May 2016 19:35:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TJZtXr098774; Sun, 29 May 2016 19:35:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605291935.u4TJZtXr098774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 29 May 2016 19:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300971 - head/lib/libthr/thread 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.22 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: Sun, 29 May 2016 19:35:56 -0000 Author: kib Date: Sun May 29 19:35:55 2016 New Revision: 300971 URL: https://svnweb.freebsd.org/changeset/base/300971 Log: Stop inlining the struct ucond definition into struct pthread_cond. This avoids unneccessary casts and make the calls to _thr_ucond_*() functions less questionable. The c_spare field was not included into struct pthread_cond, so the change modifies libthr ABI for shared condvars. But since an off-page does not legitimately contains any other data past the struct pthread_cond, the change keeps shared condvars from pre- and post- changed libthr compatible. Also note that the whole struct ucond was never copied in or out by kernel. For private condvars, the privately allocated memory was never exposed outside libthr. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_cond.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Sun May 29 18:25:11 2016 (r300970) +++ head/lib/libthr/thread/thr_cond.c Sun May 29 19:35:55 2016 (r300971) @@ -69,18 +69,18 @@ __weak_reference(_pthread_cond_destroy, __weak_reference(_pthread_cond_signal, pthread_cond_signal); __weak_reference(_pthread_cond_broadcast, pthread_cond_broadcast); -#define CV_PSHARED(cvp) (((cvp)->__flags & USYNC_PROCESS_SHARED) != 0) +#define CV_PSHARED(cvp) (((cvp)->kcond.c_flags & USYNC_PROCESS_SHARED) != 0) static void cond_init_body(struct pthread_cond *cvp, const struct pthread_cond_attr *cattr) { if (cattr == NULL) { - cvp->__clock_id = CLOCK_REALTIME; + cvp->kcond.c_clockid = CLOCK_REALTIME; } else { if (cattr->c_pshared) - cvp->__flags |= USYNC_PROCESS_SHARED; - cvp->__clock_id = cattr->c_clockid; + cvp->kcond.c_flags |= USYNC_PROCESS_SHARED; + cvp->kcond.c_clockid = cattr->c_clockid; } } @@ -205,9 +205,8 @@ cond_wait_kernel(struct pthread_cond *cv if (cancel) _thr_cancel_enter2(curthread, 0); - error = _thr_ucond_wait((struct ucond *)&cvp->__has_kern_waiters, - (struct umutex *)&mp->m_lock, abstime, CVWAIT_ABSTIME | - CVWAIT_CLOCKID); + error = _thr_ucond_wait(&cvp->kcond, &mp->m_lock, abstime, + CVWAIT_ABSTIME | CVWAIT_CLOCKID); if (cancel) _thr_cancel_leave(curthread, 0); @@ -292,7 +291,7 @@ cond_wait_user(struct pthread_cond *cvp, if (cancel) _thr_cancel_enter2(curthread, 0); - error = _thr_sleep(curthread, cvp->__clock_id, abstime); + error = _thr_sleep(curthread, cvp->kcond.c_clockid, abstime); if (cancel) _thr_cancel_leave(curthread, 0); @@ -349,8 +348,7 @@ cond_wait_common(pthread_cond_t *cond, p if (curthread->attr.sched_policy != SCHED_OTHER || (mp->m_lock.m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT | - USYNC_PROCESS_SHARED)) != 0 || - (cvp->__flags & USYNC_PROCESS_SHARED) != 0) + USYNC_PROCESS_SHARED)) != 0 || CV_PSHARED(cvp)) return (cond_wait_kernel(cvp, mp, abstime, cancel)); else return (cond_wait_user(cvp, mp, abstime, cancel)); @@ -413,7 +411,7 @@ cond_signal_common(pthread_cond_t *cond) pshared = CV_PSHARED(cvp); - _thr_ucond_signal((struct ucond *)&cvp->__has_kern_waiters); + _thr_ucond_signal(&cvp->kcond); if (pshared || cvp->__has_user_waiters == 0) return (0); @@ -496,7 +494,7 @@ cond_broadcast_common(pthread_cond_t *co pshared = CV_PSHARED(cvp); - _thr_ucond_broadcast((struct ucond *)&cvp->__has_kern_waiters); + _thr_ucond_broadcast(&cvp->kcond); if (pshared || cvp->__has_user_waiters == 0) return (0); Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sun May 29 18:25:11 2016 (r300970) +++ head/lib/libthr/thread/thr_private.h Sun May 29 19:35:55 2016 (r300971) @@ -190,9 +190,7 @@ struct pthread_mutex_attr { struct pthread_cond { __uint32_t __has_user_waiters; - __uint32_t __has_kern_waiters; - __uint32_t __flags; - __uint32_t __clock_id; + struct ucond kcond; }; struct pthread_cond_attr { From owner-svn-src-head@freebsd.org Sun May 29 19:46:35 2016 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 9C321B53CD9; Sun, 29 May 2016 19:46:35 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id 6D738199C; Sun, 29 May 2016 19:46:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TJkYdR002603; Sun, 29 May 2016 19:46:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TJkYXf002602; Sun, 29 May 2016 19:46:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605291946.u4TJkYXf002602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 29 May 2016 19:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300972 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 19:46:35 -0000 Author: markj Date: Sun May 29 19:46:34 2016 New Revision: 300972 URL: https://svnweb.freebsd.org/changeset/base/300972 Log: Fix rpcbind init after r300941. - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Sun May 29 19:35:55 2016 (r300971) +++ head/usr.sbin/rpcbind/util.c Sun May 29 19:46:34 2016 (r300972) @@ -338,6 +338,7 @@ network_init(void) exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); + freeaddrinfo(res); } #ifdef INET6 @@ -354,6 +355,7 @@ network_init(void) exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); + freeaddrinfo(res); } /* @@ -395,7 +397,6 @@ network_init(void) freeifaddrs(ifp); #endif - freeaddrinfo(res); /* close(s); */ } From owner-svn-src-head@freebsd.org Sun May 29 20:02:54 2016 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 9C287B54025; Sun, 29 May 2016 20:02:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71CFB115D; Sun, 29 May 2016 20:02:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f54.google.com with SMTP id e62so24609610ita.1; Sun, 29 May 2016 13:02:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=io04YlPYUKiX/BeNQuLhcbDEm4vbt0OdY3eI/AobXZQ=; b=FZRqMSE/Kumoti4uqtnyogCi/S04iPJczhGdQBvEqY17PJSgqOankRO9xd/Y398Uhk JY2AiAzoJZ5HibSmI8Xe616wBFryB/g+2brxrz971V6SHCYqHLQz+Q4hKJAkcIB8l6iX MNWjBUzizCSMnAfVIpzzVaMklI2V63/wlf66akL+s+5w7O4HWKrNTbrvTZqq9mZ7FuAK rf5qC7fxg+osAtq9dK+1LVUFPtjJs55PjhtFw5P6rhmssgnkyUYOwaBiFkJaWF74CIVJ +1uAzhZt7srE87Ax6WSvT5c87J1mppF4HgRJg33fKeaYa+UrgA64hDvxFFJ39w9RdQfY vQWA== X-Gm-Message-State: ALyK8tL41qkouzyNO5+OmxxZvogw1fIa8AlKPGvJuP5WSyi8zfZbvwEQrDD9WJxOhWk77A== X-Received: by 10.36.58.75 with SMTP id m72mr5303190itm.96.1464550774266; Sun, 29 May 2016 12:39:34 -0700 (PDT) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com. [209.85.214.41]) by smtp.gmail.com with ESMTPSA id d74sm6045987ith.13.2016.05.29.12.39.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 May 2016 12:39:34 -0700 (PDT) Received: by mail-it0-f41.google.com with SMTP id z123so20190225itg.0; Sun, 29 May 2016 12:39:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.158.133 with SMTP id p127mr5273315itd.97.1464550773590; Sun, 29 May 2016 12:39:33 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Sun, 29 May 2016 12:39:33 -0700 (PDT) In-Reply-To: <201605291639.u4TGdSwq032144@repo.freebsd.org> References: <201605291639.u4TGdSwq032144@repo.freebsd.org> Date: Sun, 29 May 2016 12:39:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300965 - head/lib/libc/stdlib From: Conrad Meyer To: "Andrey A. Chernov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 20:02:54 -0000 Does clang actually generate different code with this change? On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: > Author: ache > Date: Sun May 29 16:39:28 2016 > New Revision: 300965 > URL: https://svnweb.freebsd.org/changeset/base/300965 > > Log: > Micro optimize: C standard guarantees that right shift for unsigned value > fills left bits with zero, and we have exact 32bit unsigned value > (uint32_t), so there is no reason to add "& 0x7fffffff" here. > > MFC after: 1 week > > Modified: > head/lib/libc/stdlib/random.c > > Modified: head/lib/libc/stdlib/random.c > ============================================================================== > --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 (r300964) > +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 (r300965) > @@ -430,7 +430,7 @@ random(void) > */ > f = fptr; r = rptr; > *f += *r; > - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ > + i = *f >> 1; /* chucking least random bit */ > if (++f >= end_ptr) { > f = state; > ++r; > From owner-svn-src-head@freebsd.org Sun May 29 20:28:03 2016 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 F20F3B543C0; Sun, 29 May 2016 20:28:02 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id BFBBB1BA3; Sun, 29 May 2016 20:28:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TKS1oF017187; Sun, 29 May 2016 20:28:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TKS1iJ017186; Sun, 29 May 2016 20:28:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605292028.u4TKS1iJ017186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 29 May 2016 20:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300973 - head/usr.sbin/rpcbind 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.22 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: Sun, 29 May 2016 20:28:03 -0000 Author: ngie Date: Sun May 29 20:28:01 2016 New Revision: 300973 URL: https://svnweb.freebsd.org/changeset/base/300973 Log: Follow up to r300932 In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately MFC after: 6 days X-MFC with: r300932 Reported by: O. Hartmann Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Sun May 29 19:46:34 2016 (r300972) +++ head/usr.sbin/rpcbind/util.c Sun May 29 20:28:01 2016 (r300973) @@ -371,7 +371,7 @@ network_init(void) if (s == -1) { if (debugging) fprintf(stderr, "couldn't create ip6 socket"); - exit(1); + goto done_inet6; } /* @@ -394,6 +394,7 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } +done_inet6: freeifaddrs(ifp); #endif From owner-svn-src-head@freebsd.org Sun May 29 20:54:17 2016 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 993D0B54A5B; Sun, 29 May 2016 20:54:17 +0000 (UTC) (envelope-from dim@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 mx1.freebsd.org (Postfix) with ESMTPS id 51A631B6F; Sun, 29 May 2016 20:54:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TKsG1X027895; Sun, 29 May 2016 20:54:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TKsGHU027894; Sun, 29 May 2016 20:54:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605292054.u4TKsGHU027894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 29 May 2016 20:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300974 - head/contrib/llvm/lib/Transforms/Vectorize 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.22 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: Sun, 29 May 2016 20:54:17 -0000 Author: dim Date: Sun May 29 20:54:16 2016 New Revision: 300974 URL: https://svnweb.freebsd.org/changeset/base/300974 Log: Pull in r269908 from upstream llvm trunk (by James Molloy): [VectorUtils] Fix nasty use-after-free In truncateToMinimalBitwidths() we were RAUW'ing an instruction then erasing it. However, that intruction could be cached in the map we're iterating over. The first check is "I->use_empty()" which in most cases would return true, as the (deleted) object was RAUW'd first so would have zero use count. However in some cases the object could have been polluted or written over and this wouldn't be the case. Also it makes valgrind, asan and traditionalists who don't like their compiler to crash sad. No testcase as there are no externally visible symptoms apart from a crash if the stars align. Fixes PR26509. This should fix crashes when building a number of ports on arm64. Reported by: andrew Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun May 29 20:28:01 2016 (r300973) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun May 29 20:54:16 2016 (r300974) @@ -3161,10 +3161,11 @@ void InnerLoopVectorizer::truncateToMini // truncated version of `I` and reextend its result. InstCombine runs // later and will remove any ext/trunc pairs. // + SmallPtrSet Erased; for (auto &KV : MinBWs) { VectorParts &Parts = WidenMap.get(KV.first); for (Value *&I : Parts) { - if (I->use_empty()) + if (Erased.count(I) || I->use_empty()) continue; Type *OriginalTy = I->getType(); Type *ScalarTruncatedTy = IntegerType::get(OriginalTy->getContext(), @@ -3238,6 +3239,7 @@ void InnerLoopVectorizer::truncateToMini Value *Res = B.CreateZExtOrTrunc(NewI, OriginalTy); I->replaceAllUsesWith(Res); cast(I)->eraseFromParent(); + Erased.insert(I); I = Res; } } From owner-svn-src-head@freebsd.org Sun May 29 21:16:59 2016 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 D48CAB53429 for ; Sun, 29 May 2016 21:16:59 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 688AC1D47 for ; Sun, 29 May 2016 21:16:59 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f49.google.com with SMTP id k98so65128826lfi.1 for ; Sun, 29 May 2016 14:16:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=sbsTSmb8qNT4t6K63om8E39+nWgDeIi1SPXLSdwDNGI=; b=jOLuAyjp1n9wlcQeRf/nNj+ELQvUK1N1beBBPqIUBGGvahY4NP9ql7VRyBJpkYQ2FH dEUinHBkWBwZeVEARCw+oGzj4glMDNKv2nzw8L6xonYgAEMuy0M5fiN39xvEegy0g6Ig PP9Q7FNi7s59Ep8AZ+jrrBIkPTuVhr2lr+1kLUl7ADD9iaGCqRWpOufPzx1NMT/L92c8 WUQtXXGYsvJfIeZKBXipDcRHT0RDKlpbE1GX19R67xRPg+a04zylt13ViL7Rh/OlIv+K 0zdElJa7t+8ZtU0HoIfgdnwvk0XXfeNs38gtZPnm1WBhAPccnO+PpQA3qdgDF5w1FUtf MugQ== X-Gm-Message-State: ALyK8tL1QPpkqDmjrZc41UQWp65sa2M05v7B7duqKcWSm4cUzB17CPDhKiXafpSqGNa0AA== X-Received: by 10.25.40.144 with SMTP id o138mr6289295lfo.160.1464553256117; Sun, 29 May 2016 13:20:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id u202sm1712654lja.12.2016.05.29.13.20.55 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 13:20:55 -0700 (PDT) Subject: Re: svn commit: r300965 - head/lib/libc/stdlib To: cem@FreeBSD.org References: <201605291639.u4TGdSwq032144@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Sun, 29 May 2016 23:20:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 21:16:59 -0000 On 29.05.2016 22:39, Conrad Meyer wrote: > Does clang actually generate different code with this change? Yes, without -O it generates andl $2147483647, ... With -O nothing is changed. In general, it can be not clang and I see no point to left junk code in any case. > > On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: >> Author: ache >> Date: Sun May 29 16:39:28 2016 >> New Revision: 300965 >> URL: https://svnweb.freebsd.org/changeset/base/300965 >> >> Log: >> Micro optimize: C standard guarantees that right shift for unsigned value >> fills left bits with zero, and we have exact 32bit unsigned value >> (uint32_t), so there is no reason to add "& 0x7fffffff" here. >> >> MFC after: 1 week >> >> Modified: >> head/lib/libc/stdlib/random.c >> >> Modified: head/lib/libc/stdlib/random.c >> ============================================================================== >> --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 (r300964) >> +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 (r300965) >> @@ -430,7 +430,7 @@ random(void) >> */ >> f = fptr; r = rptr; >> *f += *r; >> - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ >> + i = *f >> 1; /* chucking least random bit */ >> if (++f >= end_ptr) { >> f = state; >> ++r; >> > From owner-svn-src-head@freebsd.org Sun May 29 21:53:19 2016 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 33AAEB53E85; Sun, 29 May 2016 21:53:19 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DFF321EF2; Sun, 29 May 2016 21:53:17 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 432AF25D37D1; Sun, 29 May 2016 21:53:07 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1E120D1F811; Sun, 29 May 2016 21:53:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id lsL1oKcYjVcq; Sun, 29 May 2016 21:53:05 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:5fe:490c:ad69:b14f] (unknown [IPv6:fde9:577b:c1a9:4410:5fe:490c:ad69:b14f]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 98FF8D1F7F5; Sun, 29 May 2016 21:53:04 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300973 - head/usr.sbin/rpcbind From: "Bjoern A. Zeeb" In-Reply-To: <201605292028.u4TKS1iJ017186@repo.freebsd.org> Date: Sun, 29 May 2016 21:52:59 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9E1A1DDD-974B-481B-B659-BC099C5C0262@lists.zabbadoz.net> References: <201605292028.u4TKS1iJ017186@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 21:53:19 -0000 > On 29 May 2016, at 20:28 , Garrett Cooper wrote: >=20 > Author: ngie > Date: Sun May 29 20:28:01 2016 > New Revision: 300973 > URL: https://svnweb.freebsd.org/changeset/base/300973 >=20 > Log: > Follow up to r300932 >=20 > In the event MK_INET6 !=3D no in userspace, but is disabled in the > kernel, or if there aren't any IPv6 addresses configured in userspace > (for lo0 and all physical interfaces), rpcbind would terminate > immediately instead of silently failing on >=20 > Skip over the IPv6 block to its respective cleanup with freeifaddrs = if > creating the socket failed instead of terminating rpcbind immediately Stupid question (without me looking at the code): what does it do in = case I have no IPv4 support in the kernel anymore (as I do on some = machines)? /bz From owner-svn-src-head@freebsd.org Sun May 29 22:16:58 2016 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 047B6B54354; Sun, 29 May 2016 22:16:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA8FA1F55; Sun, 29 May 2016 22:16:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id g64so58438277pfb.2; Sun, 29 May 2016 15:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IrYtQXCZZXtAiWqBxUQRdd1DXsyRuRnKecGwtqSOibA=; b=o6q4tWHT8Nlh8fdtMBo6FzX9nNh5lar4P2XKD9ue4s3zgoGFUM12O3l6Du324Hej+H cpqtbd5VtKKucKvjF0mw9aN8uTNQiLsWdOXSfbAqps6vmS7cq0Qk2V/8x9ubNVpUbA6O xFQA1YwmgzFtoYOhWOsP8gu7ykZFvoPYHfNR+yDYZGxA5hynwT0c6Q7IevWa04Xn/dnZ UTt2fNknjGHe5+hs5Y/BG4z6saJ6XRP/ZX0kzwrn9zlbQgEm3OmzSwRD3mvsDf6ucEa3 2mV5z+eOmz0MVQGh/iez00iabArIv9rtK6//TeZespJ7QUOOYHuIUDIkGkZcOIDaXSlA Md7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IrYtQXCZZXtAiWqBxUQRdd1DXsyRuRnKecGwtqSOibA=; b=kgishIeGyZqTlJrAzwnw3MRLtt0+BhbGr+Hw6FjBxPXTfgptrVdZXOs/mDY+TAXIZ5 /WKSdUmOaf1kHH+DFwmXiYaOHnYoFMuICB9x1R6VzEhktrhhjwyqLJfEWMibsvcOilH0 uIayGK1lxV431DgjBX2trGUznXb+TsJ2neRnxwEVoCGQXBfQakOeImBOSVZXuWQaVzAT fpc6Cmuay7E0eJOejaW9Npn9k9r7RZx3mKIEwR6Xt9xb1xYWqDCImisidpNmbuptj2ev x+NClHW2ZvTm1L9AF14ehBbqdfRvJIC/tEdvfb1VxgJELLo3j4V73OA9GIOMrl4SgU6o DRbw== X-Gm-Message-State: ALyK8tIBhewjy7bgfXBjCuqSHM6qfgORz3Z3fFGFhI5BYV4aWF9aGQN8Y6pAj7+XiRcr/A== X-Received: by 10.98.1.6 with SMTP id 6mr41618292pfb.155.1464560217354; Sun, 29 May 2016 15:16:57 -0700 (PDT) Received: from [21.183.163.76] ([172.56.42.229]) by smtp.gmail.com with ESMTPSA id b19sm27831493pfb.55.2016.05.29.15.16.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 15:16:56 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r300973 - head/usr.sbin/rpcbind From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: <9E1A1DDD-974B-481B-B659-BC099C5C0262@lists.zabbadoz.net> Date: Sun, 29 May 2016 15:16:55 -0700 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8A6B49EA-4551-4F7C-8332-C6E5B59A4F28@gmail.com> References: <201605292028.u4TKS1iJ017186@repo.freebsd.org> <9E1A1DDD-974B-481B-B659-BC099C5C0262@lists.zabbadoz.net> To: "Bjoern A. Zeeb" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 29 May 2016 22:16:58 -0000 > On May 29, 2016, at 14:52, Bjoern A. Zeeb = wrote: >=20 >=20 >> On 29 May 2016, at 20:28 , Garrett Cooper wrote: >>=20 >> Author: ngie >> Date: Sun May 29 20:28:01 2016 >> New Revision: 300973 >> URL: https://svnweb.freebsd.org/changeset/base/300973 >>=20 >> Log: >> Follow up to r300932 >>=20 >> In the event MK_INET6 !=3D no in userspace, but is disabled in the >> kernel, or if there aren't any IPv6 addresses configured in userspace >> (for lo0 and all physical interfaces), rpcbind would terminate >> immediately instead of silently failing on >>=20 >> Skip over the IPv6 block to its respective cleanup with freeifaddrs if >> creating the socket failed instead of terminating rpcbind immediately >=20 > Stupid question (without me looking at the code): what does it do in case= I have no IPv4 support in the kernel anymore (as I do on some machines)? The socket call only applied to IPv6. It intentionally sets the multicast ad= dress and leaks the socket, which causes coverity to note the leak as fd is l= ocal to the function. I'll definite try out this case as well tonight.. init_transport(..) (anothe= r function in rpcbind that uses rpc(3) under the covers) was not working und= er certain edge cases with some changes I had put up for CR. I feel like I wandered into another blackberry bramble patch with rpc(3). I h= ave some ideas for refactoring rpcbind and friends to ease maintenance that I= 'll work on after 11.0-RELEASE hits. Thanks! -Ngie= From owner-svn-src-head@freebsd.org Sun May 29 22:27:44 2016 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 3C34CB544F8; Sun, 29 May 2016 22:27:44 +0000 (UTC) (envelope-from bapt@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 mx1.freebsd.org (Postfix) with ESMTPS id D39C2164E; Sun, 29 May 2016 22:27:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TMRgA4061509; Sun, 29 May 2016 22:27:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TMRgdL061508; Sun, 29 May 2016 22:27:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605292227.u4TMRgdL061508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 29 May 2016 22:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300975 - head/tools/tools/locale/tools 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.22 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: Sun, 29 May 2016 22:27:44 -0000 Author: bapt Date: Sun May 29 22:27:42 2016 New Revision: 300975 URL: https://svnweb.freebsd.org/changeset/base/300975 Log: Add more hacks to correct CLDR data For Russian: - Convert AM/PM which are badly formatted in CLDR to replace it by the proper cyrillic - Add a dependency on Text::Iconv so non unicode get the proper encoding for AM/PM - fix the date format having 'r.,' and convert it to 'r.' (also fixed in Bulgarian) For All: - Use complete Day of Week instead of the abbreviated one Reported by: ache Modified: head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sun May 29 20:54:16 2016 (r300974) +++ head/tools/tools/locale/tools/cldr2def.pl Sun May 29 22:27:42 2016 (r300975) @@ -5,6 +5,7 @@ use strict; use File::Copy; use XML::Parser; use Tie::IxHash; +use Text::Iconv; use Data::Dumper; use Getopt::Long; use Digest::SHA qw(sha1_hex); @@ -69,6 +70,7 @@ my %callback = ( cformat => \&callback_cformat, dtformat => \&callback_dtformat, cbabmon => \&callback_abmon, + cbampm => \&callback_ampm, data => undef, ); @@ -183,7 +185,7 @@ if ($TYPE eq "timedef") { "t_fmt" => "s", "d_fmt" => "s", "c_fmt" => " "as", + "am_pm" => " "s", "d_t_fmt" => " "new("utf-8", "$enc"); + + if ($nl eq 'ru_RU') { + if ($enc eq 'UTF-8') { + $s = 'дп;пп'; + } else { + $s = $converter->convert("дп;пп"); + } + } + return $s; +} + sub callback_cformat { my $s = shift; + my $nl = $callback{data}{l} . "_" . $callback{data}{c}; + + $s =~ s/\.,/\./; $s =~ s/ %Z//; $s =~ s/ %z//; - $s =~ s/^"(%B %e, )/"%a, $1/; - $s =~ s/^"(%e %B )/"%a $1/; + $s =~ s/^"(%B %e, )/"%A, $1/; + $s =~ s/^"(%e %B )/"%A $1/; return $s; }; @@ -211,8 +232,9 @@ sub callback_dtformat { if ($nl eq 'ja_JP') { $s =~ s/(> )(%H)/$1%A $2/; } - $s =~ s/^"(%B %e, )/"%a, $1/; - $s =~ s/^"(%e %B )/"%a $1/; + $s =~ s/\.,/\./; + $s =~ s/^"(%B %e, )/"%A, $1/; + $s =~ s/^"(%e %B )/"%A $1/; return $s; }; From owner-svn-src-head@freebsd.org Sun May 29 22:28:44 2016 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 6DE51B5454F; Sun, 29 May 2016 22:28:44 +0000 (UTC) (envelope-from bapt@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 mx1.freebsd.org (Postfix) with ESMTPS id 3E55717C2; Sun, 29 May 2016 22:28:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TMShK5061638; Sun, 29 May 2016 22:28:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TMSdtR061594; Sun, 29 May 2016 22:28:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605292228.u4TMSdtR061594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 29 May 2016 22:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300976 - head/share/timedef 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.22 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: Sun, 29 May 2016 22:28:44 -0000 Author: bapt Date: Sun May 29 22:28:39 2016 New Revision: 300976 URL: https://svnweb.freebsd.org/changeset/base/300976 Log: Regenerate timedef: For Russian: - Convert AM/PM which are badly formatted in CLDR to replace it by the proper cyrillic - Add a dependency on Text::Iconv so non unicode get the proper encoding for AM/PM - fix the date format having 'r.,' and convert it to 'r.' (also fixed in Bulgarian) For All: - Use complete Day of Week instead of the abbreviated one Reported by: ache Modified: head/share/timedef/am_ET.UTF-8.src head/share/timedef/be_BY.CP1131.src head/share/timedef/be_BY.CP1251.src head/share/timedef/be_BY.ISO8859-5.src head/share/timedef/be_BY.UTF-8.src head/share/timedef/bg_BG.CP1251.src head/share/timedef/bg_BG.UTF-8.src head/share/timedef/ca_IT.ISO8859-15.src head/share/timedef/ca_IT.UTF-8.src head/share/timedef/el_GR.ISO8859-7.src head/share/timedef/el_GR.UTF-8.src head/share/timedef/en_CA.UTF-8.src head/share/timedef/en_GB.UTF-8.src head/share/timedef/en_HK.UTF-8.src head/share/timedef/en_IE.UTF-8.src head/share/timedef/en_PH.UTF-8.src head/share/timedef/en_SG.UTF-8.src head/share/timedef/en_US.UTF-8.src head/share/timedef/fr_BE.ISO8859-15.src head/share/timedef/fr_BE.UTF-8.src head/share/timedef/fr_CA.ISO8859-15.src head/share/timedef/fr_CA.UTF-8.src head/share/timedef/fr_CH.ISO8859-15.src head/share/timedef/fr_CH.UTF-8.src head/share/timedef/fr_FR.ISO8859-15.src head/share/timedef/fr_FR.UTF-8.src head/share/timedef/hi_IN.ISCII-DEV.src head/share/timedef/hi_IN.UTF-8.src head/share/timedef/hy_AM.ARMSCII-8.src head/share/timedef/hy_AM.UTF-8.src head/share/timedef/it_CH.ISO8859-15.src head/share/timedef/it_CH.UTF-8.src head/share/timedef/it_IT.ISO8859-15.src head/share/timedef/it_IT.UTF-8.src head/share/timedef/kk_Cyrl_KZ.UTF-8.src head/share/timedef/nl_BE.UTF-8.src head/share/timedef/nl_NL.UTF-8.src head/share/timedef/pl_PL.ISO8859-2.src head/share/timedef/pl_PL.UTF-8.src head/share/timedef/ro_RO.ISO8859-2.src head/share/timedef/ro_RO.UTF-8.src head/share/timedef/ru_RU.CP1251.src head/share/timedef/ru_RU.CP866.src head/share/timedef/ru_RU.ISO8859-5.src head/share/timedef/ru_RU.KOI8-R.src head/share/timedef/ru_RU.UTF-8.src head/share/timedef/sv_FI.ISO8859-15.src head/share/timedef/sv_FI.UTF-8.src head/share/timedef/sv_SE.ISO8859-15.src head/share/timedef/sv_SE.UTF-8.src head/share/timedef/tr_TR.ISO8859-9.src head/share/timedef/tr_TR.UTF-8.src head/share/timedef/uk_UA.CP1251.src head/share/timedef/uk_UA.ISO8859-5.src head/share/timedef/uk_UA.KOI8-U.src head/share/timedef/uk_UA.UTF-8.src Modified: head/share/timedef/am_ET.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1131.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1251.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.ISO8859-5.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/bg_BG.CP1251.src ============================================================================== --- head/share/timedef/bg_BG.CP1251.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/bg_BG.CP1251.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %e.%m.%y г. # # c_fmt -%a %e %B %Y ã., %H:%M:%S +%A %e %B %Y ã. %H:%M:%S # # AM/PM ïð.îá. ñë.îá. # # date_fmt -%a %e %B %Y ã., %H:%M:%S %Z +%A %e %B %Y ã. %H:%M:%S %Z # # Long month names (without case ending) ÿíóàðè Modified: head/share/timedef/bg_BG.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/ca_IT.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ca_IT.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ dissabte %e/%m/%y # # c_fmt -%a %e %B de %Y, %H:%M:%S +%A %e %B de %Y, %H:%M:%S # # AM/PM a. m. p. m. # # date_fmt -%a %e %B de %Y, %H:%M:%S %Z +%A %e %B de %Y, %H:%M:%S %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/ca_IT.UTF-8.src ============================================================================== --- head/share/timedef/ca_IT.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ca_IT.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ dissabte %e/%m/%y # # c_fmt -%a %e %B de %Y, %H:%M:%S +%A %e %B de %Y, %H:%M:%S # # AM/PM a. m. p. m. # # date_fmt -%a %e %B de %Y, %H:%M:%S %Z +%A %e %B de %Y, %H:%M:%S %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/el_GR.ISO8859-7.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/el_GR.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/en_CA.UTF-8.src ============================================================================== --- head/share/timedef/en_CA.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_CA.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %Y-%m-%d # # c_fmt -%a, %B %e, %Y at %I:%M:%S %p +%A, %B %e, %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%a, %B %e, %Y at %I:%M:%S %p %Z +%A, %B %e, %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_GB.UTF-8.src ============================================================================== --- head/share/timedef/en_GB.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_GB.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%a %e %B %Y at %H:%M:%S +%A %e %B %Y at %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%a %e %B %Y at %H:%M:%S %Z +%A %e %B %Y at %H:%M:%S %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_HK.UTF-8.src ============================================================================== --- head/share/timedef/en_HK.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_HK.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %e/%m/%Y # # c_fmt -%a %e %B %Y at %I:%M:%S %p +%A %e %B %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%a %e %B %Y at %I:%M:%S %p %Z +%A %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_IE.UTF-8.src ============================================================================== --- head/share/timedef/en_IE.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_IE.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%a %e %B %Y at %I:%M:%S %p +%A %e %B %Y at %I:%M:%S %p # # AM/PM a.m. p.m. # # date_fmt -%a %e %B %Y at %I:%M:%S %p %Z +%A %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_PH.UTF-8.src ============================================================================== --- head/share/timedef/en_PH.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_PH.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%a %e %B %Y at %I:%M:%S %p +%A %e %B %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%a %e %B %Y at %I:%M:%S %p %Z +%A %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_SG.UTF-8.src ============================================================================== --- head/share/timedef/en_SG.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_SG.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %e/%m/%y # # c_fmt -%a %e %B %Y at %I:%M:%S %p +%A %e %B %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%a %e %B %Y at %I:%M:%S %p %Z +%A %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_US.UTF-8.src ============================================================================== --- head/share/timedef/en_US.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/en_US.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Saturday %m/%e/%y # # c_fmt -%a, %B %e, %Y at %I:%M:%S %p +%A, %B %e, %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%a, %B %e, %Y at %I:%M:%S %p %Z +%A, %B %e, %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/fr_BE.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_BE.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_BE.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %e/%m/%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_BE.UTF-8.src ============================================================================== --- head/share/timedef/fr_BE.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_BE.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %e/%m/%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CA.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_CA.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_CA.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %y-%m-%d # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CA.UTF-8.src ============================================================================== --- head/share/timedef/fr_CA.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_CA.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %y-%m-%d # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CH.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_CH.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_CH.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %d.%m.%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CH.UTF-8.src ============================================================================== --- head/share/timedef/fr_CH.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_CH.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %d.%m.%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_FR.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_FR.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_FR.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %d/%m/%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_FR.UTF-8.src ============================================================================== --- head/share/timedef/fr_FR.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/fr_FR.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ samedi %d/%m/%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/hi_IN.ISCII-DEV.src ============================================================================== --- head/share/timedef/hi_IN.ISCII-DEV.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/hi_IN.ISCII-DEV.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %e/%m/%y # # c_fmt -%a %e %B %Y ³å %I:%M:%S %p +%A %e %B %Y ³å %I:%M:%S %p # # AM/PM ÈÞÏèÔÚØèÆ ¤ÈÏÚØèÆ # # date_fmt -%a %e %B %Y ³å %I:%M:%S %p %Z +%A %e %B %Y ³å %I:%M:%S %p %Z # # Long month names (without case ending) ºÆÔÏÜ Modified: head/share/timedef/hi_IN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/hy_AM.ARMSCII-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/hy_AM.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/it_CH.ISO8859-15.src ============================================================================== --- head/share/timedef/it_CH.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/it_CH.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sabato %d.%m.%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/it_CH.UTF-8.src ============================================================================== --- head/share/timedef/it_CH.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/it_CH.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sabato %d.%m.%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/it_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/it_IT.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/it_IT.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sabato %d/%m/%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/it_IT.UTF-8.src ============================================================================== --- head/share/timedef/it_IT.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/it_IT.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sabato %d/%m/%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/kk_Cyrl_KZ.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/nl_BE.UTF-8.src ============================================================================== --- head/share/timedef/nl_BE.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/nl_BE.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ zaterdag %e/%m/%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/nl_NL.UTF-8.src ============================================================================== --- head/share/timedef/nl_NL.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/nl_NL.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ zaterdag %d-%m-%y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/pl_PL.ISO8859-2.src ============================================================================== --- head/share/timedef/pl_PL.ISO8859-2.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/pl_PL.ISO8859-2.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sobota %d.%m.%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) styczeñ Modified: head/share/timedef/pl_PL.UTF-8.src ============================================================================== --- head/share/timedef/pl_PL.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/pl_PL.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sobota %d.%m.%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) styczeÅ„ Modified: head/share/timedef/ro_RO.ISO8859-2.src ============================================================================== --- head/share/timedef/ro_RO.ISO8859-2.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ro_RO.ISO8859-2.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sâmbãtã %d.%m.%Y # # c_fmt -%a %e %B %Y, %H:%M:%S +%A %e %B %Y, %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%a %e %B %Y, %H:%M:%S %Z +%A %e %B %Y, %H:%M:%S %Z # # Long month names (without case ending) ianuarie Modified: head/share/timedef/ro_RO.UTF-8.src ============================================================================== --- head/share/timedef/ro_RO.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ro_RO.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ sâmbătă %d.%m.%Y # # c_fmt -%a %e %B %Y, %H:%M:%S +%A %e %B %Y, %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%a %e %B %Y, %H:%M:%S %Z +%A %e %B %Y, %H:%M:%S %Z # # Long month names (without case ending) ianuarie Modified: head/share/timedef/ru_RU.CP1251.src ============================================================================== --- head/share/timedef/ru_RU.CP1251.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ru_RU.CP1251.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y ã., %H:%M:%S +%A %e %B %Y ã. %H:%M:%S # # AM/PM -AM -PM +äï +ïï # # date_fmt -%a %e %B %Y ã., %H:%M:%S %Z +%A %e %B %Y ã. %H:%M:%S %Z # # Long month names (without case ending) ÿíâàðü Modified: head/share/timedef/ru_RU.CP866.src ============================================================================== --- head/share/timedef/ru_RU.CP866.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ru_RU.CP866.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y £., %H:%M:%S +%A %e %B %Y £. %H:%M:%S # # AM/PM -AM -PM +¤¯ +¯¯ # # date_fmt -%a %e %B %Y £., %H:%M:%S %Z +%A %e %B %Y £. %H:%M:%S %Z # # Long month names (without case ending) ï­¢ àì Modified: head/share/timedef/ru_RU.ISO8859-5.src ============================================================================== --- head/share/timedef/ru_RU.ISO8859-5.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ru_RU.ISO8859-5.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y Ó., %H:%M:%S +%A %e %B %Y Ó. %H:%M:%S # # AM/PM -AM -PM +Ôß +ßß # # date_fmt -%a %e %B %Y Ó., %H:%M:%S %Z +%A %e %B %Y Ó. %H:%M:%S %Z # # Long month names (without case ending) ïÝÒÐàì Modified: head/share/timedef/ru_RU.KOI8-R.src ============================================================================== --- head/share/timedef/ru_RU.KOI8-R.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ru_RU.KOI8-R.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y Ç., %H:%M:%S +%A %e %B %Y Ç. %H:%M:%S # # AM/PM -AM -PM +ÄÐ +ÐÐ # # date_fmt -%a %e %B %Y Ç., %H:%M:%S %Z +%A %e %B %Y Ç. %H:%M:%S %Z # # Long month names (without case ending) ÑÎ×ÁÒØ Modified: head/share/timedef/ru_RU.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/sv_FI.ISO8859-15.src ============================================================================== --- head/share/timedef/sv_FI.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/sv_FI.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ lördag %d-%m-%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/sv_FI.UTF-8.src ============================================================================== --- head/share/timedef/sv_FI.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/sv_FI.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ lördag %d-%m-%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/sv_SE.ISO8859-15.src ============================================================================== --- head/share/timedef/sv_SE.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/sv_SE.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ lördag %Y-%m-%d # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/sv_SE.UTF-8.src ============================================================================== --- head/share/timedef/sv_SE.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/sv_SE.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ lördag %Y-%m-%d # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/tr_TR.ISO8859-9.src ============================================================================== --- head/share/timedef/tr_TR.ISO8859-9.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/tr_TR.ISO8859-9.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Cumartesi %e.%m.%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM ÖÖ ÖS # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) Ocak Modified: head/share/timedef/tr_TR.UTF-8.src ============================================================================== --- head/share/timedef/tr_TR.UTF-8.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/tr_TR.UTF-8.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ Cumartesi %e.%m.%Y # # c_fmt -%a %e %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM ÖÖ ÖS # # date_fmt -%a %e %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) Ocak Modified: head/share/timedef/uk_UA.CP1251.src ============================================================================== --- head/share/timedef/uk_UA.CP1251.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/uk_UA.CP1251.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y ð. %H:%M:%S +%A %e %B %Y ð. %H:%M:%S # # AM/PM äï ïï # # date_fmt -%a %e %B %Y ð. %H:%M:%S %Z +%A %e %B %Y ð. %H:%M:%S %Z # # Long month names (without case ending) ñ³÷åíü Modified: head/share/timedef/uk_UA.ISO8859-5.src ============================================================================== --- head/share/timedef/uk_UA.ISO8859-5.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/uk_UA.ISO8859-5.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y à. %H:%M:%S +%A %e %B %Y à. %H:%M:%S # # AM/PM Ôß ßß # # date_fmt -%a %e %B %Y à. %H:%M:%S %Z +%A %e %B %Y à. %H:%M:%S %Z # # Long month names (without case ending) áöçÕÝì Modified: head/share/timedef/uk_UA.KOI8-U.src ============================================================================== --- head/share/timedef/uk_UA.KOI8-U.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/uk_UA.KOI8-U.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%a %e %B %Y Ò. %H:%M:%S +%A %e %B %Y Ò. %H:%M:%S # # AM/PM ÄÐ ÐÐ # # date_fmt -%a %e %B %Y Ò. %H:%M:%S %Z +%A %e %B %Y Ò. %H:%M:%S %Z # # Long month names (without case ending) Ó¦ÞÅÎØ Modified: head/share/timedef/uk_UA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-head@freebsd.org Mon May 30 02:09:20 2016 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 892E2B51A05; Mon, 30 May 2016 02:09:20 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id 5A09B1E6F; Mon, 30 May 2016 02:09:20 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U29Jaq042264; Mon, 30 May 2016 02:09:19 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U29J4b042263; Mon, 30 May 2016 02:09:19 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201605300209.u4U29J4b042263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 30 May 2016 02:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300980 - head 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.22 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: Mon, 30 May 2016 02:09:20 -0000 Author: lidl Date: Mon May 30 02:09:19 2016 New Revision: 300980 URL: https://svnweb.freebsd.org/changeset/base/300980 Log: Remove extraneous altq header files At some point during stable/10, the headers altq_codel.h and altq_fairq.h where added to /usr/include/altq, before all of altq was moved to /usr/include/net/altq. Reviewed by: rpaulo Approved by: rpaulo Differential Revision: https://reviews.freebsd.org/D6596 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 30 01:21:44 2016 (r300979) +++ head/ObsoleteFiles.inc Mon May 30 02:09:19 2016 (r300980) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20160523: remove extranous ALTQ files +OLD_FILES+=usr/include/altq/altq_codel.h +OLD_FILES+=usr/include/altq/altq_fairq.h # 20160519: remove DTrace Toolkit from base OLD_FILES+=usr/share/dtrace/toolkit/execsnoop OLD_FILES+=usr/share/dtrace/toolkit/hotkernel From owner-svn-src-head@freebsd.org Mon May 30 02:17:24 2016 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 71CB3B51B7A; Mon, 30 May 2016 02:17:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF311260; Mon, 30 May 2016 02:17:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-42-169.carlnfd1.nsw.optusnet.com.au [110.21.42.169]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A4DED1A4618; Mon, 30 May 2016 12:17:21 +1000 (AEST) Date: Mon, 30 May 2016 12:17:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Andrey A. Chernov" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300956 - head/lib/libc/stdlib In-Reply-To: <201605291357.u4TDv6No071840@repo.freebsd.org> Message-ID: <20160530110541.I924@besplex.bde.org> References: <201605291357.u4TDv6No071840@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=kDyANCGC9fy361NNEb9EQQ==:117 a=kDyANCGC9fy361NNEb9EQQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=ybn9vhf7jueot6_Cs1oA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 02:17:24 -0000 On Sun, 29 May 2016, Andrey A. Chernov wrote: > Log: > 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes > reading hard. Good. > 2) Instead of doing range transformation in each and every function here, > do it single time directly in do_rand(). One "mod" operation overhead is not > a big deal, but the code looks nicer and possible future functions additions > or PRNG change do not miss range transformations neither have unneeded ones. The whole implementation is silly. It is manually optimized for 1980's compilers. More below. > 3) Use POSIX argument types for visible functions (cosmetic). Not sure I like type changes. > Modified: head/lib/libc/stdlib/rand.c > ============================================================================== > --- head/lib/libc/stdlib/rand.c Sun May 29 12:21:54 2016 (r300955) > +++ head/lib/libc/stdlib/rand.c Sun May 29 13:57:06 2016 (r300956) > @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); > static int > do_rand(unsigned long *ctx) > { > -#ifdef USE_WEAK_SEEDING > -/* > - * Historic implementation compatibility. > - * The random sequences do not vary much with the seed, > - * even with overflowing. > - */ > - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); This is a good implementation of a not very good LCG, made very bad by botching RAND_MAX. The magic numbers except for RAND_MAX are copied from the example in the C90 spec. I think they are good enough there. The comment in at least the C99 spec says "// RAND_MAX assumed to be 32767". This means that these magic numbers were chosen to work with this value of RAND_MAX. (unsigned) longs are used to give a period much longer than RAND_MAX and for technical reasons. Taking the modulo to many fewer bits than the minimum of 32 for an unsigned long then disguises the linearity. The BSD version almost completly breaks this on arches with 32 bit longs by taking the modulo to 31 bits (mod 32 bits would give complete breakage). Arches with 64-bit longs accidentally work a bit better, by the coefficients are poorly chosen -- they should be 64 bits and the arithmetic 128 bits. > -#else /* !USE_WEAK_SEEDING */ > /* > * Compute x = (7^5 * x) mod (2^31 - 1) > * without overflowing 31 bits: These coefficients are probably better, but they are still basically 32-bit ones and thus not very good for more than a 15-bit RAND_MAX, and the details of the calculation are excessively optimized for 1980's compilers and 32-bit uintmax_t. This can be written as x = (1687 * x) % 2147483647 (with some care about type sizes and signedness and overflow. It then looks like an even worse LCG than the botched C90 one, at least with the botch making its internals more visible. E.g., when x = 1, the first couple of iterations don't even involve the linear term in 31 bits. Even 1980's compiler technology was not far from reducing the division to a multiplication. The LCG expression would then reduce to (uintN_t)(A * x + B) where N is either 32 or 64. Perhaps N needs to be 64 even with the small coeefficients, due to the divisor being large and not a power of 2. But if we have 64-bit arithmetic, then we can choose much better coefficients than the C90 32-bit ones or the ACM barely 16-bit ones, and uses A * x + B directly, giving a 64-bit period, and have a chance of our 31-bit RAND_MAX finally working. > @@ -66,48 +58,34 @@ do_rand(unsigned long *ctx) > */ > long hi, lo, x; > > - /* Must be in [1, 0x7ffffffe] range at this point. */ > - hi = *ctx / 127773; > - lo = *ctx % 127773; > + /* Transform to [1, 0x7ffffffe] range. */ > + x = (*ctx % 0x7ffffffe) + 1; > + hi = x / 127773; > + lo = x % 127773; > x = 16807 * lo - 2836 * hi; > if (x < 0) > x += 0x7fffffff; This does the division more magically but more slowly than the compiler would do. It uses one division and one remainder, and doesn't use the newfangled (late 1980's) ldiv() function to explicitly try to reduce these to one hardware divrem operation. But compilers can easily do this reduction. I think compilers can't easily (or perhaps at all) reduce to an A * x + B expression. It isn't clear if using signed long here makes things easier or harder for compilers. The algorithm is special to avoid overflow with signed longs, but it the compiler might not understand this. Then -fwrapv would inhibit it from doing much reduction, and -fno-wrapv is just complicated. > - *ctx = x; > /* Transform to [0, 0x7ffffffd] range. */ > - return (x - 1); > -#endif /* !USE_WEAK_SEEDING */ > + x--; > + *ctx = x; > + return (x); > } > > > int > -rand_r(unsigned int *ctx) > +rand_r(unsigned *ctx) You didn't change the type, but fixed a style bug (the verbose spelling of "unsigned") :-). It is interesting that the style bug is missing in POSIX. I thought that standards mostly got this wrong. Actually, POSIX almost never uses the verbose spelling. In the a 2001 draft, it has just 2 instances of "unsigned int" and these are not in literal code. It only has 260 lines matching "unsigned". The plain unsigned type is harder to grep for and it occurs in surprisingly few prototypes (maybe 10-20). C99 uses the verbose variant more, but has no functions except srand() taking an unsigned arg, so C99 ends up with only 6 instances of "unsigned int" on the same line and 4 of those are related to srand(). It is a smaller style bug to spell "unsigned" as itself. "unsigned" is spelled u_int in KNF. This is more descriptive in less space, and is closer to the newer standard uintN_t. Man pages and headers must use a standard name, but the implementation should use u_int (but don't churn it to do this). > { > u_long val; This part was already in KNF, so using "unsigned int" was not even consistently non-KNF. The style bugs were not in the 4.4BSD-Lite* version. It is simpler than possible. Just 5 lines for the USE_WEAK_SEEDING version of rand(), and 6 for srand() (1 extra for K&R style). > @@ -116,13 +94,9 @@ rand(void) > } > > void > -srand(u_int seed) > +srand(unsigned seed) > { > next = seed; > -#ifndef USE_WEAK_SEEDING > - /* Transform to [1, 0x7ffffffe] range. */ > - next = (next % 0x7ffffffe) + 1; > -#endif > } Churning alread occurred (not counting the ifdef) :-(. 4.4BSD-Lite* uses the KNF spelling here. > @@ -144,10 +118,6 @@ sranddev(void) > mib[0] = CTL_KERN; > mib[1] = KERN_ARND; > sysctl(mib, 2, (void *)&next, &len, NULL, 0); > -#ifndef USE_WEAK_SEEDING > - /* Transform to [1, 0x7ffffffe] range. */ > - next = (next % 0x7ffffffe) + 1; > -#endif > } I think is right to remove this micro-optimization. Adjustments can probably all be folded into the final expression. The final expression is now so pessimized that an extra addition in it won't make it much worse. Bruce From owner-svn-src-head@freebsd.org Mon May 30 03:09:53 2016 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 87A29B53500; Mon, 30 May 2016 03:09:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 18B8B1ABC; Mon, 30 May 2016 03:09:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-42-169.carlnfd1.nsw.optusnet.com.au [110.21.42.169]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 075A9D42F26; Mon, 30 May 2016 13:09:28 +1000 (AEST) Date: Mon, 30 May 2016 13:09:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: "Andrey A. Chernov" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300965 - head/lib/libc/stdlib In-Reply-To: Message-ID: <20160530122100.X924@besplex.bde.org> References: <201605291639.u4TGdSwq032144@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=kDyANCGC9fy361NNEb9EQQ==:117 a=kDyANCGC9fy361NNEb9EQQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=mDnqfD46IR0aj72RSGUA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 03:09:53 -0000 On Sun, 29 May 2016, Conrad Meyer wrote: > Does clang actually generate different code with this change? It should, on exotic arches. > On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: >> Log: >> Micro optimize: C standard guarantees that right shift for unsigned value >> fills left bits with zero, and we have exact 32bit unsigned value >> (uint32_t), so there is no reason to add "& 0x7fffffff" here. Using uint32_t at all is an unportable pessimization. On exotic arches that don't have native uint32_t registers, a theoretically perfect implementation wouldn't implement uint32_t. This would expose the brokenness of broken code, so a practical implementation would emulate uint32_t so that the broken code would just run slower for arithmetic and much slower for locked memory operations. uint32_t might be implemented not very slowly using 128-bit integer registers, or more slowly using the 53-bit mantissa part of an IEEE double precision floating point register. If uint32_t is emulated, then the compiler is forced to act as if the code uses a longer type and does "& 0xffffffff" after every operation. Thes extra operations can only be combined sometimes. More careful code can use a minimal number of this or similar "&" operations. In checksum calculations, one "&" at the end is usually enough. >> Modified: head/lib/libc/stdlib/random.c random.c was mostly written before uint32_t was standard, so it used u_long and long. Perhaps it wasn't careful enough with the "&"s to actually work unless u_long is precisely uint32_t and long is normal 2's complement with benign overflow. Anyway, it was "fixed" (unimproved) using s/u_long/uint32_/ in most places where the API/ABI doesn't require longs (there is 1 dubious long left in a comment). The correct fix is s/u_long/uint_fast32_t in most places and s/u_long/uint_least32_t/ in some places and then fix any missing "&"'s. The "fast" and "least" types always exist, unlike the fixed-width types, and using them asks for time/space efficiency instead of emulated fixed-width. On non-exotic arches, fast == least == fixed-width, so the correct substitution works as a quick fix even with missing "&"s. It is not necessary to use the newfangled standard integer types to fix this here, since correct use of long types would work (they give 32 bits), but long is wasteful if it actually 64 bits or longer. Even larger problems are looming with uintmax_t. Any code that is careful enough to use it is likely to break or be bloated if it is expanded. This is just like using u_long in old random(). >> ============================================================================== >> --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 (r300964) >> +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 (r300965) >> @@ -430,7 +430,7 @@ random(void) >> */ >> f = fptr; r = rptr; >> *f += *r; >> - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ >> + i = *f >> 1; /* chucking least random bit */ This gives an "&" to restore in the version with correct substitutions. It also breaks the indentation. (This file mostly indents comments to the right of code to column 40, but column 48 was used here and now column 32 is used.) >> if (++f >= end_ptr) { >> f = state; >> ++r; Bruce From owner-svn-src-head@freebsd.org Mon May 30 03:31:39 2016 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 1A704B53AC9; Mon, 30 May 2016 03:31:39 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id B501218B0; Mon, 30 May 2016 03:31:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U3VbWg075257; Mon, 30 May 2016 03:31:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U3Vbqh075256; Mon, 30 May 2016 03:31:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300331.u4U3Vbqh075256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 03:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300981 - head/sys/netinet 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.22 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: Mon, 30 May 2016 03:31:39 -0000 Author: sephe Date: Mon May 30 03:31:37 2016 New Revision: 300981 URL: https://svnweb.freebsd.org/changeset/base/300981 Log: tcp: Don't prematurely drop receiving-only connections If the connection was persistent and receiving-only, several (12) sporadic device insufficient buffers would cause the connection be dropped prematurely: Upon ENOBUFS in tcp_output() for an ACK, retransmission timer is started. No one will stop this retransmission timer for receiving- only connection, so the retransmission timer promises to expire and t_rxtshift is promised to be increased. And t_rxtshift will not be reset to 0, since no RTT measurement will be done for receiving-only connection. If this receiving-only connection lived long enough (e.g. >350sec, given the RTO starts from 200ms), and it suffered 12 sporadic device insufficient buffers, i.e. t_rxtshift >= 12, this receiving-only connection would be dropped prematurely by the retransmission timer. We now assert that for data segments, SYNs or FINs either rexmit or persist timer was wired upon ENOBUFS. And don't set rexmit timer for other cases, i.e. ENOBUFS upon ACKs. Discussed with: lstewart, hiren, jtl, Mike Karels MFC after: 3 weeks Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5872 Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon May 30 02:09:19 2016 (r300980) +++ head/sys/netinet/tcp_output.c Mon May 30 03:31:37 2016 (r300981) @@ -130,6 +130,16 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, send &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); +/* + * Make sure that either retransmit or persist timer is set for SYN, FIN and + * non-ACK. + */ +#define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags) \ + KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\ + tcp_timer_active((tp), TT_REXMT) || \ + tcp_timer_active((tp), TT_PERSIST), \ + ("neither rexmt nor persist timer is set")) + static void inline hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, long len, int tso); @@ -1545,9 +1555,7 @@ timer: tp->t_softerror = error; return (error); case ENOBUFS: - if (!tcp_timer_active(tp, TT_REXMT) && - !tcp_timer_active(tp, TT_PERSIST)) - tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); + TCP_XMIT_TIMER_ASSERT(tp, len, flags); tp->snd_cwnd = tp->t_maxseg; return (0); case EMSGSIZE: From owner-svn-src-head@freebsd.org Mon May 30 04:48:07 2016 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 577FEB51947; Mon, 30 May 2016 04:48:07 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 20C971462; Mon, 30 May 2016 04:48:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U4m6jT001448; Mon, 30 May 2016 04:48:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U4m6NW001446; Mon, 30 May 2016 04:48:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300448.u4U4m6NW001446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 04:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300982 - head/sys/sys 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.22 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: Mon, 30 May 2016 04:48:07 -0000 Author: sephe Date: Mon May 30 04:48:06 2016 New Revision: 300982 URL: https://svnweb.freebsd.org/changeset/base/300982 Log: mbuf: Add a flag for M_HASHTYPE_ to indicate the type has hash properties This flag has not been used, and drivers setting M_HASHTYPE_OPAQUE have not been converted as of this commit. Reviewed by: hps, gallatin (early version) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6406 Modified: head/sys/sys/mbuf.h head/sys/sys/param.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon May 30 03:31:37 2016 (r300981) +++ head/sys/sys/mbuf.h Mon May 30 04:48:06 2016 (r300982) @@ -318,30 +318,41 @@ struct mbuf { * * Most NICs support RSS, which provides ordering and explicit affinity, and * use the hash m_flag bits to indicate what header fields were covered by - * the hash. M_HASHTYPE_OPAQUE can be set by non-RSS cards or configurations - * that provide an opaque flow identifier, allowing for ordering and - * distribution without explicit affinity. + * the hash. M_HASHTYPE_OPAQUE and M_HASHTYPE_OPAQUE_HASH can be set by non- + * RSS cards or configurations that provide an opaque flow identifier, allowing + * for ordering and distribution without explicit affinity. Additionally, + * M_HASHTYPE_OPAQUE_HASH indicates that the flow identifier has hash + * properties. */ +#define M_HASHTYPE_HASHPROP 0x80 /* has hash properties */ +#define M_HASHTYPE_HASH(t) (M_HASHTYPE_HASHPROP | (t)) /* Microsoft RSS standard hash types */ #define M_HASHTYPE_NONE 0 -#define M_HASHTYPE_RSS_IPV4 1 /* IPv4 2-tuple */ -#define M_HASHTYPE_RSS_TCP_IPV4 2 /* TCPv4 4-tuple */ -#define M_HASHTYPE_RSS_IPV6 3 /* IPv6 2-tuple */ -#define M_HASHTYPE_RSS_TCP_IPV6 4 /* TCPv6 4-tuple */ -#define M_HASHTYPE_RSS_IPV6_EX 5 /* IPv6 2-tuple + ext hdrs */ -#define M_HASHTYPE_RSS_TCP_IPV6_EX 6 /* TCPv6 4-tiple + ext hdrs */ +#define M_HASHTYPE_RSS_IPV4 M_HASHTYPE_HASH(1) /* IPv4 2-tuple */ +#define M_HASHTYPE_RSS_TCP_IPV4 M_HASHTYPE_HASH(2) /* TCPv4 4-tuple */ +#define M_HASHTYPE_RSS_IPV6 M_HASHTYPE_HASH(3) /* IPv6 2-tuple */ +#define M_HASHTYPE_RSS_TCP_IPV6 M_HASHTYPE_HASH(4) /* TCPv6 4-tuple */ +#define M_HASHTYPE_RSS_IPV6_EX M_HASHTYPE_HASH(5) /* IPv6 2-tuple + + * ext hdrs */ +#define M_HASHTYPE_RSS_TCP_IPV6_EX M_HASHTYPE_HASH(6) /* TCPv6 4-tiple + + * ext hdrs */ /* Non-standard RSS hash types */ -#define M_HASHTYPE_RSS_UDP_IPV4 7 /* IPv4 UDP 4-tuple */ -#define M_HASHTYPE_RSS_UDP_IPV4_EX 8 /* IPv4 UDP 4-tuple + ext hdrs */ -#define M_HASHTYPE_RSS_UDP_IPV6 9 /* IPv6 UDP 4-tuple */ -#define M_HASHTYPE_RSS_UDP_IPV6_EX 10 /* IPv6 UDP 4-tuple + ext hdrs */ - -#define M_HASHTYPE_OPAQUE 255 /* ordering, not affinity */ +#define M_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_HASH(7) /* IPv4 UDP 4-tuple*/ +#define M_HASHTYPE_RSS_UDP_IPV4_EX M_HASHTYPE_HASH(8) /* IPv4 UDP 4-tuple + + * ext hdrs */ +#define M_HASHTYPE_RSS_UDP_IPV6 M_HASHTYPE_HASH(9) /* IPv6 UDP 4-tuple*/ +#define M_HASHTYPE_RSS_UDP_IPV6_EX M_HASHTYPE_HASH(10)/* IPv6 UDP 4-tuple + + * ext hdrs */ + +#define M_HASHTYPE_OPAQUE 63 /* ordering, not affinity */ +#define M_HASHTYPE_OPAQUE_HASH M_HASHTYPE_HASH(M_HASHTYPE_OPAQUE) + /* ordering+hash, not affinity*/ #define M_HASHTYPE_CLEAR(m) ((m)->m_pkthdr.rsstype = 0) #define M_HASHTYPE_GET(m) ((m)->m_pkthdr.rsstype) #define M_HASHTYPE_SET(m, v) ((m)->m_pkthdr.rsstype = (v)) #define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v)) +#define M_HASHTYPE_ISHASH(m) (M_HASHTYPE_GET(m) & M_HASHTYPE_HASHPROP) /* * COS/QOS class and quality of service tags. Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon May 30 03:31:37 2016 (r300981) +++ head/sys/sys/param.h Mon May 30 04:48:06 2016 (r300982) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100114 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100115 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon May 30 05:03:37 2016 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 490FBB51E8F for ; Mon, 30 May 2016 05:03:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAAA41D9C for ; Mon, 30 May 2016 05:03:36 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f46.google.com with SMTP id w16so55190646lfd.2 for ; Sun, 29 May 2016 22:03:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Wa6v8yU9G59Ge/tCrv9mCBVmrltzn870JPvtvbQKBsU=; b=UmjXINSuEUAc0GFisT+aObZv/+hAQDginxH82g/FaLMJiJ/f/Q1Jre690VJdd9A2Z8 GvA51Qb6i4p2+Ga3O+B3WiTg7P6Ce8eII0F7Hpmw4lbZK7jj7OJn3jWTjTd1FmV8JAvt quwSo1ufWgRgDWdT2RUwnV4ntDmDFIt4xT3sHnz7UM67Db8OzAumom9ISkyC9Ve5zaXX ed5RN9b9U2w58Lk0PBzah/i63F+/M/8swESfhxlaivtU/PzwwJ3V8nCQ2aaKmS2iv+V2 EcUkurwoKLlOtZSH6crHAady9pvoYyfkCiQnYdvKYayLQOqtY/FWd4UA3spK5TmoKS+t sN6A== X-Gm-Message-State: ALyK8tKbdew7PyBjmWbs8qpRdFHsxIfWfD+o+OvYcx/NCTDpkaHXB1xAOzYkH0ng+bIulg== X-Received: by 10.25.34.79 with SMTP id i76mr6664945lfi.208.1464584613423; Sun, 29 May 2016 22:03:33 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id a76sm4458480lfa.11.2016.05.29.22.03.32 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 22:03:32 -0700 (PDT) Subject: Re: svn commit: r300956 - head/lib/libc/stdlib To: Bruce Evans References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 30 May 2016 08:03:30 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160530110541.I924@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 05:03:37 -0000 On 30.05.2016 5:17, Bruce Evans wrote: > On Sun, 29 May 2016, Andrey A. Chernov wrote: > >> Log: >> 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and >> makes >> reading hard. > > Good. > >> 2) Instead of doing range transformation in each and every function >> here, >> do it single time directly in do_rand(). One "mod" operation overhead >> is not >> a big deal, but the code looks nicer and possible future functions >> additions >> or PRNG change do not miss range transformations neither have >> unneeded ones. > > The whole implementation is silly. It is manually optimized for 1980's > compilers. More below. > >> 3) Use POSIX argument types for visible functions (cosmetic). > > Not sure I like type changes. > >> Modified: head/lib/libc/stdlib/rand.c >> ============================================================================== >> >> --- head/lib/libc/stdlib/rand.c Sun May 29 12:21:54 2016 (r300955) >> +++ head/lib/libc/stdlib/rand.c Sun May 29 13:57:06 2016 (r300956) >> @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); >> static int >> do_rand(unsigned long *ctx) >> { >> -#ifdef USE_WEAK_SEEDING >> -/* >> - * Historic implementation compatibility. >> - * The random sequences do not vary much with the seed, >> - * even with overflowing. >> - */ >> - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + >> 1)); > > This is a good implementation of a not very good LCG, made very bad by > botching RAND_MAX. The magic numbers except for RAND_MAX are copied > from the example in the C90 spec. I think they are good enough there. > The comment in at least the C99 spec says "// RAND_MAX assumed to be > 32767". This means that these magic numbers were chosen to work with > this value of RAND_MAX. (unsigned) longs are used to give a period > much longer than RAND_MAX and for technical reasons. Taking the modulo > to many fewer bits than the minimum of 32 for an unsigned long then > disguises the linearity. The BSD version almost completly breaks this > on arches with 32 bit longs by taking the modulo to 31 bits (mod 32 bits > would give complete breakage). Arches with 64-bit longs accidentally > work a bit better, by the coefficients are poorly chosen -- they should > be 64 bits and the arithmetic 128 bits. > >> -#else /* !USE_WEAK_SEEDING */ >> /* >> * Compute x = (7^5 * x) mod (2^31 - 1) >> * without overflowing 31 bits: > > These coefficients are probably better, but they are still basically > 32-bit ones and thus not very good for more than a 15-bit RAND_MAX, > and the details of the calculation are excessively optimized for 1980's > compilers and 32-bit uintmax_t. > > This can be written as x = (1687 * x) % 2147483647 (with some care about > type sizes and signedness and overflow. It then looks like an even worse > LCG than the botched C90 one, at least with the botch making its internals > more visible. E.g., when x = 1, the first couple of iterations don't even > involve the linear term in 31 bits. > > Even 1980's compiler technology was not far from reducing the division > to a multiplication. The LCG expression would then reduce to > (uintN_t)(A * x + B) where N is either 32 or 64. Perhaps N needs to > be 64 even with the small coeefficients, due to the divisor being large > and not a power of 2. But if we have 64-bit arithmetic, then we can > choose much better coefficients than the C90 32-bit ones or the ACM > barely 16-bit ones, and uses A * x + B directly, giving a 64-bit period, > and have a chance of our 31-bit RAND_MAX finally working. > >> @@ -66,48 +58,34 @@ do_rand(unsigned long *ctx) >> */ >> long hi, lo, x; >> >> - /* Must be in [1, 0x7ffffffe] range at this point. */ >> - hi = *ctx / 127773; >> - lo = *ctx % 127773; >> + /* Transform to [1, 0x7ffffffe] range. */ >> + x = (*ctx % 0x7ffffffe) + 1; >> + hi = x / 127773; >> + lo = x % 127773; >> x = 16807 * lo - 2836 * hi; >> if (x < 0) >> x += 0x7fffffff; > > This does the division more magically but more slowly than the compiler > would do. It uses one division and one remainder, and doesn't use > the newfangled (late 1980's) ldiv() function to explicitly try to > reduce these to one hardware divrem operation. But compilers can > easily do this reduction. I think compilers can't easily (or perhaps > at all) reduce to an A * x + B expression. It isn't clear if using > signed long here makes things easier or harder for compilers. The > algorithm is special to avoid overflow with signed longs, but it the > compiler might not understand this. Then -fwrapv would inhibit it > from doing much reduction, and -fno-wrapv is just complicated. > >> - *ctx = x; >> /* Transform to [0, 0x7ffffffd] range. */ >> - return (x - 1); >> -#endif /* !USE_WEAK_SEEDING */ >> + x--; >> + *ctx = x; >> + return (x); >> } >> >> >> int >> -rand_r(unsigned int *ctx) >> +rand_r(unsigned *ctx) > > You didn't change the type, but fixed a style bug (the verbose spelling > of "unsigned") :-). It is interesting that the style bug is missing in > POSIX. I thought that standards mostly got this wrong. Actually, POSIX > almost never uses the verbose spelling. In the a 2001 draft, it has just > 2 instances of "unsigned int" and these are not in literal code. It only > has 260 lines matching "unsigned". The plain unsigned type is harder to > grep for and it occurs in surprisingly few prototypes (maybe 10-20). > > C99 uses the verbose variant more, but has no functions except srand() > taking an unsigned arg, so C99 ends up with only 6 instances of > "unsigned int" on the same line and 4 of those are related to srand(). > > It is a smaller style bug to spell "unsigned" as itself. "unsigned" is > spelled u_int in KNF. This is more descriptive in less space, and is > closer to the newer standard uintN_t. Man pages and headers must use > a standard name, but the implementation should use u_int (but don't > churn it to do this). > >> { >> u_long val; > > This part was already in KNF, so using "unsigned int" was not even > consistently non-KNF. > > The style bugs were not in the 4.4BSD-Lite* version. It is simpler > than possible. Just 5 lines for the USE_WEAK_SEEDING version of > rand(), and 6 for srand() (1 extra for K&R style). > >> @@ -116,13 +94,9 @@ rand(void) >> } >> >> void >> -srand(u_int seed) >> +srand(unsigned seed) >> { >> next = seed; >> -#ifndef USE_WEAK_SEEDING >> - /* Transform to [1, 0x7ffffffe] range. */ >> - next = (next % 0x7ffffffe) + 1; >> -#endif >> } > > Churning alread occurred (not counting the ifdef) :-(. 4.4BSD-Lite* uses > the KNF spelling here. > >> @@ -144,10 +118,6 @@ sranddev(void) >> mib[0] = CTL_KERN; >> mib[1] = KERN_ARND; >> sysctl(mib, 2, (void *)&next, &len, NULL, 0); >> -#ifndef USE_WEAK_SEEDING >> - /* Transform to [1, 0x7ffffffe] range. */ >> - next = (next % 0x7ffffffe) + 1; >> -#endif >> } > > I think is right to remove this micro-optimization. Adjustments can > probably all be folded into the final expression. The final expression > is now so pessimized that an extra addition in it won't make it much > worse. > > Bruce > Perhaps you can find some ideas, answers and PRNG comparison in the original paper: http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf While technically equal, having KNF arg types internally and exposing POSIX ones via headers and docs as you suggest leading to harder eye catching, which makes things even worse when POSIX decide to change arg type. clang -O uses single "idivl" calculating both quotient and reminder for current code, but for ldiv(3) case call/storage/additional calcs overhead will be added. ldiv(3) does not reduce anything, see stdlib/ldiv.c From owner-svn-src-head@freebsd.org Mon May 30 05:21:25 2016 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 E2B5EB540FC; Mon, 30 May 2016 05:21:25 +0000 (UTC) (envelope-from jamie@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 mx1.freebsd.org (Postfix) with ESMTPS id B7066130C; Mon, 30 May 2016 05:21:25 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U5LOGC012613; Mon, 30 May 2016 05:21:24 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U5LOEw012611; Mon, 30 May 2016 05:21:24 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201605300521.u4U5LOEw012611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 30 May 2016 05:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300983 - in head: lib/libc/sys sys/kern 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.22 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: Mon, 30 May 2016 05:21:26 -0000 Author: jamie Date: Mon May 30 05:21:24 2016 New Revision: 300983 URL: https://svnweb.freebsd.org/changeset/base/300983 Log: Mark jail(2), and the sysctls that it (and only it) uses as deprecated. jail(8) has long used jail_set(2), and those sysctl only cause confusion. Modified: head/lib/libc/sys/jail.2 head/sys/kern/kern_jail.c Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Mon May 30 04:48:06 2016 (r300982) +++ head/lib/libc/sys/jail.2 Mon May 30 05:21:24 2016 (r300983) @@ -106,7 +106,7 @@ pointers can be set to an arrays of IPv4 the prison, or NULL if none. IPv4 addresses must be in network byte order. .Pp -This is equivalent to the +This is equivalent to, and deprecated in favor of, the .Fn jail_set system call (see below), with the parameters .Va path , Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon May 30 04:48:06 2016 (r300982) +++ head/sys/kern/kern_jail.c Mon May 30 05:21:24 2016 (r300983) @@ -4276,7 +4276,7 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vn #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, - "Number of IP addresses a jail may have at most per address family"); + "Number of IP addresses a jail may have at most per address family (deprecated)"); #endif /* @@ -4316,59 +4316,59 @@ sysctl_jail_default_allow(SYSCTL_HANDLER SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", - "Processes in jail can set their hostnames"); + "Processes in jail can set their hostnames (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", - "Processes in jail are limited to creating UNIX/IP/route sockets only"); + "Processes in jail are limited to creating UNIX/IP/route sockets only (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", - "Processes in jail can use System V IPC primitives"); + "Processes in jail can use System V IPC primitives (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", - "Prison root can create raw sockets"); + "Prison root can create raw sockets (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", - "Processes in jail can alter system file flags"); + "Processes in jail can alter system file flags (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", - "Processes in jail can mount/unmount jail-friendly file systems"); + "Processes in jail can mount/unmount jail-friendly file systems (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_devfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_DEVFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the devfs file system"); + "Processes in jail can mount the devfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_fdescfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_FDESCFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the fdescfs file system"); + "Processes in jail can mount the fdescfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_nullfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_NULLFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the nullfs file system"); + "Processes in jail can mount the nullfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_procfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the procfs file system"); + "Processes in jail can mount the procfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_linprocfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_LINPROCFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the linprocfs file system"); + "Processes in jail can mount the linprocfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_linsysfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_LINSYSFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the linsysfs file system"); + "Processes in jail can mount the linsysfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_tmpfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_TMPFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the tmpfs file system"); + "Processes in jail can mount the tmpfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_zfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_ZFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the zfs file system"); + "Processes in jail can mount the zfs file system (deprecated)"); static int sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) @@ -4389,13 +4389,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, en CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &jail_default_enforce_statfs, offsetof(struct prison, pr_enforce_statfs), sysctl_jail_default_level, "I", - "Processes in jail cannot see all mounted file systems"); + "Processes in jail cannot see all mounted file systems (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), sysctl_jail_default_level, "I", - "Ruleset for the devfs filesystem in jail"); + "Ruleset for the devfs filesystem in jail (deprecated)"); /* * Nodes to describe jail parameters. Maximum length of string parameters From owner-svn-src-head@freebsd.org Mon May 30 05:22:04 2016 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 11188B54214; Mon, 30 May 2016 05:22:04 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7BE0173E; Mon, 30 May 2016 05:22:03 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-225-151.lns20.per1.internode.on.net [121.45.225.151]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u4U5LtK4027730 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 29 May 2016 22:21:59 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r299393 - in head: . share/mk To: John Baldwin , Hans Petter Selasky References: <201605102232.u4AMWNvp000287@repo.freebsd.org> <08cfa0ac-ad92-c8f9-2141-e72088b17d41@selasky.org> <6335113.N7gIF2Maer@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Julian Elischer Message-ID: Date: Mon, 30 May 2016 13:21:50 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <6335113.N7gIF2Maer@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 05:22:04 -0000 On 27/05/2016 2:28 AM, John Baldwin wrote: > On Wednesday, May 25, 2016 03:27:07 PM Hans Petter Selasky wrote: >> On 05/11/16 00:32, John Baldwin wrote: >>> Author: jhb >>> Date: Tue May 10 22:32:23 2016 >>> New Revision: 299393 >>> URL: https://svnweb.freebsd.org/changeset/base/299393 >>> >>> Log: >>> Change the default installation directory for modules to /boot/modules. >>> >>> Kernel installs always override KMODDIR when installing modules, so >>> this default setting is only used for standalone module builds. Many >>> out-of-tree modules manually override KMODDIR already to avoid placing >>> modules in /boot/kernel. This now makes that behavior the default. >>> >>> Discussed on: arch@ >>> Reviewed by: imp >>> Relnotes: yes >>> >> Just a small nit: >> >> There is a comment in bsd.own.mk which needs updating too: >> >>> # >>> # KMODDIR Base path for loadable kernel modules >>> # (see kld(4)). [/boot/kernel] > Oops, thanks. Fixed. the comment should also mention it does not cover in-tree modules. From owner-svn-src-head@freebsd.org Mon May 30 06:42:00 2016 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 E10CFB54FA6 for ; Mon, 30 May 2016 06:42:00 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 854F71AF2 for ; Mon, 30 May 2016 06:42:00 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f54.google.com with SMTP id k98so68151253lfi.1 for ; Sun, 29 May 2016 23:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=l3LfpkoOsV7MzQ/bOYIIOcL3/EWIgWG9klD6f7jjQh8=; b=CH1Z5xPUdjRJm3ni2XWI43OBnxFRLHEGQa+LlDwc718fxifvdbrlD3eU9NmRRhk4ou I+xLHhC+s+OEUEkOaC75ihb9kqqhXiQfczIFhuXJkboq+uCmXzUvQpXBE1uz2kI86VVd SJxfdV0sA5i+ZXoROYztK9XewqG5RADNFgeNk8cZWVm9QJB/qrb+2Ec7pCpBFL8kfGkU goqiEs9FpQUGxpwHJgQbKLRMPTVr5ne3c+hp8hRlbQ3s43RPvtflQWv0ekfdwt2F/tnm gk7H8HjO8Wr/igiLZ1HoFmf4nbbzJpSTS4tgsqHoKNkYdnYSv3LH0XsRtjOOWx2vsX5y 9rbQ== X-Gm-Message-State: ALyK8tKWWxkm9Nhhc7JnmvMwP+T4ekr83mcSPKJ4/EG3DAAAQ6ILQ7Bk7xdKPT347kzC2A== X-Received: by 10.25.26.18 with SMTP id a18mr7809126lfa.219.1464590196879; Sun, 29 May 2016 23:36:36 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id g69sm2126158ljg.25.2016.05.29.23.36.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 23:36:36 -0700 (PDT) Subject: Re: svn commit: r300965 - head/lib/libc/stdlib To: Bruce Evans , Conrad Meyer References: <201605291639.u4TGdSwq032144@repo.freebsd.org> <20160530122100.X924@besplex.bde.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> Date: Mon, 30 May 2016 09:36:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160530122100.X924@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 06:42:01 -0000 On 30.05.2016 6:09, Bruce Evans wrote: > On Sun, 29 May 2016, Conrad Meyer wrote: > >> Does clang actually generate different code with this change? > > It should, on exotic arches. > >> On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov >> wrote: >>> Log: >>> Micro optimize: C standard guarantees that right shift for unsigned >>> value >>> fills left bits with zero, and we have exact 32bit unsigned value >>> (uint32_t), so there is no reason to add "& 0x7fffffff" here. > > Using uint32_t at all is an unportable pessimization. On exotic arches > that don't have native uint32_t registers, a theoretically perfect > implementation wouldn't implement uint32_t. This would expose the > brokenness of broken code, so a practical implementation would emulate > uint32_t so that the broken code would just run slower for arithmetic > and much slower for locked memory operations. > > uint32_t might be implemented not very slowly using 128-bit integer > registers, or more slowly using the 53-bit mantissa part of an IEEE > double precision floating point register. > > If uint32_t is emulated, then the compiler is forced to act as if the > code uses a longer type and does "& 0xffffffff" after every operation. > Thes extra operations can only be combined sometimes. More careful > code can use a minimal number of this or similar "&" operations. In > checksum calculations, one "&" at the end is usually enough. > >>> Modified: head/lib/libc/stdlib/random.c > > random.c was mostly written before uint32_t was standard, so it used > u_long and long. Perhaps it wasn't careful enough with the "&"s to > actually work unless u_long is precisely uint32_t and long is normal > 2's complement with benign overflow. > > Anyway, it was "fixed" (unimproved) using s/u_long/uint32_/ in most > places where the API/ABI doesn't require longs (there is 1 dubious > long left in a comment). The correct fix is s/u_long/uint_fast32_t > in most places and s/u_long/uint_least32_t/ in some places and then > fix any missing "&"'s. The "fast" and "least" types always exist, > unlike the fixed-width types, and using them asks for time/space > efficiency instead of emulated fixed-width. > > On non-exotic arches, fast == least == fixed-width, so the correct > substitution works as a quick fix even with missing "&"s. > > It is not necessary to use the newfangled standard integer types to > fix this here, since correct use of long types would work (they give > 32 bits), but long is wasteful if it actually 64 bits or longer. > > Even larger problems are looming with uintmax_t. Any code that is > careful enough to use it is likely to break or be bloated if it is > expanded. This is just like using u_long in old random(). > >>> ============================================================================== >>> >>> --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 >>> 2016 (r300964) >>> +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 >>> 2016 (r300965) >>> @@ -430,7 +430,7 @@ random(void) >>> */ >>> f = fptr; r = rptr; >>> *f += *r; >>> - i = (*f >> 1) & 0x7fffffff; /* chucking least >>> random bit */ >>> + i = *f >> 1; /* chucking least random bit */ > > This gives an "&" to restore in the version with correct substitutions. > > It also breaks the indentation. (This file mostly indents comments to the > right of code to column 40, but column 48 was used here and now column 32 > is used.) > >>> if (++f >= end_ptr) { >>> f = state; >>> ++r; > > Bruce > I don't introduce uint32_t and int32_t here and don't have a slightest idea of which types will be better to change them. F.e. *f += *r; suppose unsigned 32bit overflow which don't naturally happens for large types. Assigning uint32_t to some large type then clip it to smaller after calculation - all of that can produce more code than save for calculation itself. From owner-svn-src-head@freebsd.org Mon May 30 06:44:11 2016 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 ECC00B54FE7; Mon, 30 May 2016 06:44:11 +0000 (UTC) (envelope-from dim@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 mx1.freebsd.org (Postfix) with ESMTPS id BA8F81BB1; Mon, 30 May 2016 06:44:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U6iAwk045852; Mon, 30 May 2016 06:44:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U6iAvD045851; Mon, 30 May 2016 06:44:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605300644.u4U6iAvD045851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 30 May 2016 06:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300984 - head/lib/clang/include/clang/Basic 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.22 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: Mon, 30 May 2016 06:44:12 -0000 Author: dim Date: Mon May 30 06:44:10 2016 New Revision: 300984 URL: https://svnweb.freebsd.org/changeset/base/300984 Log: Bump __FreeBSD_cc_version after r300974. Modified: head/lib/clang/include/clang/Basic/Version.inc Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Mon May 30 05:21:24 2016 (r300983) +++ head/lib/clang/include/clang/Basic/Version.inc Mon May 30 06:44:10 2016 (r300984) @@ -9,4 +9,4 @@ #define SVN_REVISION "262564" -#define FREEBSD_CC_VERSION 1100002U +#define FREEBSD_CC_VERSION 1100003U From owner-svn-src-head@freebsd.org Mon May 30 06:49:03 2016 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 718D3B5407C; Mon, 30 May 2016 06:49:03 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 253551D6A; Mon, 30 May 2016 06:49:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U6n2cS046053; Mon, 30 May 2016 06:49:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U6n2jI046051; Mon, 30 May 2016 06:49:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300649.u4U6n2jI046051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 06:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300985 - head/sys/dev/bge 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.22 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: Mon, 30 May 2016 06:49:03 -0000 Author: sephe Date: Mon May 30 06:49:01 2016 New Revision: 300985 URL: https://svnweb.freebsd.org/changeset/base/300985 Log: bge: Support 5717 C0, which is almost same as 5720 A0 PR: 209758 Obtained from: DragonFlyBSD d79f5d8f5fe94cd6769207b2901422977d502bc0 MFC after: 1 week Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon May 30 06:44:10 2016 (r300984) +++ head/sys/dev/bge/if_bge.c Mon May 30 06:49:01 2016 (r300985) @@ -171,6 +171,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5715 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5717C }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5719 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, @@ -311,6 +312,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, + { BGE_CHIPID_BCM5717_C0, "BCM5717 C0" }, { BGE_CHIPID_BCM5719_A0, "BCM5719 A0" }, { BGE_CHIPID_BCM5720_A0, "BCM5720 A0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, @@ -2699,6 +2701,7 @@ bge_chipid(device_t dev) */ switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5717C: case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: @@ -2727,6 +2730,8 @@ bge_chipid(device_t dev) default: id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); } + if (id == BGE_CHIPID_BCM5717_C0) + id = BGE_CHIPID_BCM5720_A0; } return (id); } Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Mon May 30 06:44:10 2016 (r300984) +++ head/sys/dev/bge/if_bgereg.h Mon May 30 06:49:01 2016 (r300985) @@ -329,6 +329,7 @@ #define BGE_CHIPID_BCM57780_A1 0x57780001 #define BGE_CHIPID_BCM5717_A0 0x05717000 #define BGE_CHIPID_BCM5717_B0 0x05717100 +#define BGE_CHIPID_BCM5717_C0 0x05717200 #define BGE_CHIPID_BCM5719_A0 0x05719000 #define BGE_CHIPID_BCM5720_A0 0x05720000 #define BGE_CHIPID_BCM5762_A0 0x05762000 @@ -2452,6 +2453,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5715 0x1678 #define BCOM_DEVICEID_BCM5715S 0x1679 #define BCOM_DEVICEID_BCM5717 0x1655 +#define BCOM_DEVICEID_BCM5717C 0x1665 #define BCOM_DEVICEID_BCM5718 0x1656 #define BCOM_DEVICEID_BCM5719 0x1657 #define BCOM_DEVICEID_BCM5720_PP 0x1658 /* Not released to public. */ From owner-svn-src-head@freebsd.org Mon May 30 07:50:58 2016 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 9F64EB54F76; Mon, 30 May 2016 07:50:58 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 6D6821BE8; Mon, 30 May 2016 07:50:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U7ovH1067708; Mon, 30 May 2016 07:50:57 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U7ovxL067707; Mon, 30 May 2016 07:50:57 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605300750.u4U7ovxL067707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 30 May 2016 07:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300986 - head/include 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.22 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: Mon, 30 May 2016 07:50:58 -0000 Author: ed Date: Mon May 30 07:50:57 2016 New Revision: 300986 URL: https://svnweb.freebsd.org/changeset/base/300986 Log: Add missing declaration of ino_t. POSIX requires that provides ino_t in the XSI case. In our case, this wasn't being exposed, as d_ino is a macro that expands to d_fileno that is an uint32_t, not an ino_t. Modified: head/include/dirent.h Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Mon May 30 06:49:01 2016 (r300985) +++ head/include/dirent.h Mon May 30 07:50:57 2016 (r300986) @@ -38,15 +38,23 @@ * the getdirentries(2) system call. */ #include +#include #include #if __XSI_VISIBLE + +#ifndef _INO_T_DECLARED +typedef __ino_t ino_t; +#define _INO_T_DECLARED +#endif + /* * XXX this is probably illegal in the __XSI_VISIBLE case, but brings us closer * to the specification. */ #define d_ino d_fileno /* backward and XSI compatibility */ -#endif + +#endif /* __XSI_VISIBLE */ #if __BSD_VISIBLE From owner-svn-src-head@freebsd.org Mon May 30 08:25:10 2016 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 49384B4EF27; Mon, 30 May 2016 08:25:10 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 0A7BF1EAC; Mon, 30 May 2016 08:25:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U8P9M1082126; Mon, 30 May 2016 08:25:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U8P9Qx082125; Mon, 30 May 2016 08:25:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300825.u4U8P9Qx082125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 08:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300987 - head/sys/dev/hyperv/vmbus 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.22 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: Mon, 30 May 2016 08:25:10 -0000 Author: sephe Date: Mon May 30 08:25:09 2016 New Revision: 300987 URL: https://svnweb.freebsd.org/changeset/base/300987 Log: hyperv/et: Fix STIMER0 operations. - Make sure that STIMER0 is disabled before writting to it, since writing to an enabled STIMER will result in undefined behaviour. - It is unnecessary to reconfigure STIMER0 upon each et_start(). - Make sure that MSR_HV_REF_TIME_COUNT will not return 0, since writing 0 to STIMER_COUNT will disable the target STIMER. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6573 Modified: head/sys/dev/hyperv/vmbus/hv_et.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 07:50:57 2016 (r300986) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 08:25:09 2016 (r300987) @@ -61,40 +61,27 @@ __FBSDID("$FreeBSD$"); static struct eventtimer *et; -static inline uint64_t +static __inline uint64_t sbintime2tick(sbintime_t time) { struct timespec val; val = sbttots(time); - return val.tv_sec * HV_TIMER_FREQUENCY + val.tv_nsec / 100; + return (val.tv_sec * HV_TIMER_FREQUENCY) + (val.tv_nsec / 100); } static int hv_et_start(struct eventtimer *et, sbintime_t firsttime, sbintime_t periodtime) { - uint64_t current, config; - - config = MSR_HV_STIMER_CFG_AUTOEN | MSR_HV_STIMER0_CFG_SINT; + uint64_t current; current = rdmsr(MSR_HV_TIME_REF_COUNT); current += sbintime2tick(firsttime); - - wrmsr(MSR_HV_STIMER0_CONFIG, config); wrmsr(MSR_HV_STIMER0_COUNT, current); return (0); } -static int -hv_et_stop(struct eventtimer *et) -{ - wrmsr(MSR_HV_STIMER0_CONFIG, 0); - wrmsr(MSR_HV_STIMER0_COUNT, 0); - - return (0); -} - void hv_et_intr(struct trapframe *frame) { @@ -130,6 +117,31 @@ hv_et_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } +static void +vmbus_et_config(void *arg __unused) +{ + /* + * Make sure that STIMER0 is really disabled before writing + * to STIMER0_CONFIG. + * + * "Writing to the configuration register of a timer that + * is already enabled may result in undefined behaviour." + */ + for (;;) { + uint64_t val; + + /* Stop counting, and this also implies disabling STIMER0 */ + wrmsr(MSR_HV_STIMER0_COUNT, 0); + + val = rdmsr(MSR_HV_STIMER0_CONFIG); + if ((val & MSR_HV_STIMER_CFG_ENABLE) == 0) + break; + cpu_spinwait(); + } + wrmsr(MSR_HV_STIMER0_CONFIG, + MSR_HV_STIMER_CFG_AUTOEN | MSR_HV_STIMER0_CFG_SINT); +} + static int hv_et_attach(device_t dev) { @@ -143,9 +155,16 @@ hv_et_attach(device_t dev) et->et_min_period = HV_MIN_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); et->et_max_period = HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); et->et_start = hv_et_start; - et->et_stop = hv_et_stop; et->et_priv = dev; + /* + * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will + * not return 0, since writing 0 to STIMER0_COUNT will disable + * STIMER0. + */ + DELAY(100); + smp_rendezvous(NULL, vmbus_et_config, NULL, NULL); + return (et_register(et)); } From owner-svn-src-head@freebsd.org Mon May 30 08:42:36 2016 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 B7236B533B3; Mon, 30 May 2016 08:42:36 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 73E7F182A; Mon, 30 May 2016 08:42:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U8gZuO089348; Mon, 30 May 2016 08:42:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U8gZgE089343; Mon, 30 May 2016 08:42:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300842.u4U8gZgE089343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 08:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300988 - head/sys/dev/hyperv/vmbus 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.22 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: Mon, 30 May 2016 08:42:36 -0000 Author: sephe Date: Mon May 30 08:42:35 2016 New Revision: 300988 URL: https://svnweb.freebsd.org/changeset/base/300988 Log: hyperv/vmbus: Move SINT settings to vmbus_var.h While I'm here remove the event timer's dependency on hv_vmbus_priv.h MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6574 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 30 08:25:09 2016 (r300987) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 30 08:42:35 2016 (r300988) @@ -337,7 +337,7 @@ vmbus_event_proc(struct vmbus_softc *sc, * On Host with Win8 or above, the event page can be checked directly * to get the id of the channel that has the pending interrupt. */ - event = VMBUS_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; + event = VMBUS_PCPU_GET(sc, event_flag, cpu) + VMBUS_SINT_MESSAGE; vmbus_event_flags_proc(event->flagsul, VMBUS_PCPU_GET(sc, event_flag_cnt, cpu)); } @@ -347,7 +347,7 @@ vmbus_event_proc_compat(struct vmbus_sof { hv_vmbus_synic_event_flags *event; - event = VMBUS_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; + event = VMBUS_PCPU_GET(sc, event_flag, cpu) + VMBUS_SINT_MESSAGE; if (atomic_testandclear_int(&event->flags32[0], 0)) { vmbus_event_flags_proc( hv_vmbus_g_connection.recv_interrupt_page, Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 08:25:09 2016 (r300987) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 08:42:35 2016 (r300988) @@ -37,16 +37,16 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #define HV_TIMER_FREQUENCY (10 * 1000 * 1000LL) /* 100ns period */ #define HV_MAX_DELTA_TICKS 0xffffffffLL #define HV_MIN_DELTA_TICKS 1LL #define MSR_HV_STIMER0_CFG_SINT \ - ((((uint64_t)HV_VMBUS_TIMER_SINT) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ + ((((uint64_t)VMBUS_SINT_TIMER) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ MSR_HV_STIMER_CFG_SINT_MASK) /* @@ -83,7 +83,7 @@ hv_et_start(struct eventtimer *et, sbint } void -hv_et_intr(struct trapframe *frame) +vmbus_et_intr(struct trapframe *frame) { struct trapframe *oldframe; struct thread *td; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 30 08:25:09 2016 (r300987) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 30 08:42:35 2016 (r300988) @@ -80,7 +80,7 @@ vmbus_msg_task(void *xsc, int pending __ struct vmbus_softc *sc = xsc; hv_vmbus_message *msg; - msg = VMBUS_PCPU_GET(sc, message, curcpu) + HV_VMBUS_MESSAGE_SINT; + msg = VMBUS_PCPU_GET(sc, message, curcpu) + VMBUS_SINT_MESSAGE; for (;;) { const hv_vmbus_channel_msg_table_entry *entry; hv_vmbus_channel_msg_header *hdr; @@ -144,14 +144,14 @@ hv_vmbus_isr(struct vmbus_softc *sc, str /* Check if there are actual msgs to be process */ msg_base = VMBUS_PCPU_GET(sc, message, cpu); - msg = msg_base + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ + msg = msg_base + VMBUS_SINT_TIMER; if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { msg->header.message_type = HV_MESSAGE_TYPE_NONE; /* call intrrupt handler of event timer */ - hv_et_intr(frame); + vmbus_et_intr(frame); /* * Make sure the write to message_type (ie set to @@ -175,7 +175,7 @@ hv_vmbus_isr(struct vmbus_softc *sc, str } } - msg = msg_base + HV_VMBUS_MESSAGE_SINT; + msg = msg_base + VMBUS_SINT_MESSAGE; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { taskqueue_enqueue(VMBUS_PCPU_GET(sc, message_tq, cpu), VMBUS_PCPU_PTR(sc, message_task, cpu)); @@ -254,7 +254,7 @@ vmbus_synic_setup(void *xsc) /* * Configure and unmask SINT for message and event flags. */ - sint = MSR_HV_SINT0 + HV_VMBUS_MESSAGE_SINT; + sint = MSR_HV_SINT0 + VMBUS_SINT_MESSAGE; orig = rdmsr(sint); val = sc->vmbus_idtvec | MSR_HV_SINT_AUTOEOI | (orig & MSR_HV_SINT_RSVD_MASK); @@ -263,7 +263,7 @@ vmbus_synic_setup(void *xsc) /* * Configure and unmask SINT for timer. */ - sint = MSR_HV_SINT0 + HV_VMBUS_TIMER_SINT; + sint = MSR_HV_SINT0 + VMBUS_SINT_TIMER; orig = rdmsr(sint); val = sc->vmbus_idtvec | MSR_HV_SINT_AUTOEOI | (orig & MSR_HV_SINT_RSVD_MASK); @@ -292,14 +292,14 @@ vmbus_synic_teardown(void *arg) /* * Mask message and event flags SINT. */ - sint = MSR_HV_SINT0 + HV_VMBUS_MESSAGE_SINT; + sint = MSR_HV_SINT0 + VMBUS_SINT_MESSAGE; orig = rdmsr(sint); wrmsr(sint, orig | MSR_HV_SINT_MASKED); /* * Mask timer SINT. */ - sint = MSR_HV_SINT0 + HV_VMBUS_TIMER_SINT; + sint = MSR_HV_SINT0 + VMBUS_SINT_TIMER; orig = rdmsr(sint); wrmsr(sint, orig | MSR_HV_SINT_MASKED); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 30 08:25:09 2016 (r300987) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 30 08:42:35 2016 (r300988) @@ -189,8 +189,6 @@ enum { HV_VMBUS_EVENT_PORT_ID = 2, HV_VMBUS_MONITOR_CONNECTION_ID = 3, HV_VMBUS_MONITOR_PORT_ID = 3, - HV_VMBUS_MESSAGE_SINT = 2, - HV_VMBUS_TIMER_SINT = 4, }; #define HV_PRESENT_BIT 0x80000000 @@ -542,12 +540,6 @@ int hv_vmbus_disconnect(void); int hv_vmbus_post_message(void *buffer, size_t buf_size); int hv_vmbus_set_event(hv_vmbus_channel *channel); -/** - * Event Timer interfaces - */ -void hv_et_init(void); -void hv_et_intr(struct trapframe*); - /* Wait for device creation */ void vmbus_scan(void); Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon May 30 08:25:09 2016 (r300987) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon May 30 08:42:35 2016 (r300988) @@ -31,8 +31,21 @@ #include #include +#include + #include +/* + * NOTE: DO NOT CHANGE THIS. + */ +#define VMBUS_SINT_MESSAGE 2 +/* + * NOTE: + * - DO NOT set it to the same value as VMBUS_SINT_MESSAGE. + * - DO NOT set it to 0. + */ +#define VMBUS_SINT_TIMER 4 + struct vmbus_pcpu_data { u_long *intr_cnt; /* Hyper-V interrupt counter */ struct vmbus_message *message; /* shared messages */ @@ -78,8 +91,13 @@ vmbus_get_device(void) #define VMBUS_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field #define VMBUS_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field +struct hv_vmbus_channel; +struct trapframe; + void vmbus_on_channel_open(const struct hv_vmbus_channel *); void vmbus_event_proc(struct vmbus_softc *, int); void vmbus_event_proc_compat(struct vmbus_softc *, int); +void vmbus_et_intr(struct trapframe *); + #endif /* !_VMBUS_VAR_H_ */ From owner-svn-src-head@freebsd.org Mon May 30 08:50:35 2016 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 3454EB53501; Mon, 30 May 2016 08:50:35 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id E787C1B3A; Mon, 30 May 2016 08:50:34 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U8oYQD089710; Mon, 30 May 2016 08:50:34 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U8oYOp089709; Mon, 30 May 2016 08:50:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300850.u4U8oYOp089709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 08:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300989 - head/sys/dev/hyperv/vmbus 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.22 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: Mon, 30 May 2016 08:50:35 -0000 Author: sephe Date: Mon May 30 08:50:33 2016 New Revision: 300989 URL: https://svnweb.freebsd.org/changeset/base/300989 Log: hyperv/et: Make sure only one event timer will be registered This nullifies the need to use softc. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6591 Modified: head/sys/dev/hyperv/vmbus/hv_et.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 08:42:35 2016 (r300988) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 08:50:33 2016 (r300989) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); CPUID_HV_MSR_SYNIC | \ CPUID_HV_MSR_SYNTIMER) -static struct eventtimer *et; +static struct eventtimer vmbus_et; static __inline uint64_t sbintime2tick(sbintime_t time) @@ -88,12 +88,12 @@ vmbus_et_intr(struct trapframe *frame) struct trapframe *oldframe; struct thread *td; - if (et->et_active) { + if (vmbus_et.et_active) { td = curthread; td->td_intr_nesting_level++; oldframe = td->td_intr_frame; td->td_intr_frame = frame; - et->et_event_cb(et, et->et_arg); + vmbus_et.et_event_cb(&vmbus_et, vmbus_et.et_arg); td->td_intr_frame = oldframe; td->td_intr_nesting_level--; } @@ -102,7 +102,8 @@ vmbus_et_intr(struct trapframe *frame) static void hv_et_identify(driver_t *driver, device_t parent) { - if (device_find_child(parent, "hv_et", -1) != NULL || + if (device_get_unit(parent) != 0 || + device_find_child(parent, "hv_et", -1) != NULL || (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) return; @@ -145,17 +146,17 @@ vmbus_et_config(void *arg __unused) static int hv_et_attach(device_t dev) { - /* XXX: need allocate SINT and remove global et */ - et = device_get_softc(dev); + /* TODO: use independent IDT vector */ - et->et_name = "Hyper-V"; - et->et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; - et->et_quality = 1000; - et->et_frequency = HV_TIMER_FREQUENCY; - et->et_min_period = HV_MIN_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); - et->et_max_period = HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); - et->et_start = hv_et_start; - et->et_priv = dev; + vmbus_et.et_name = "Hyper-V"; + vmbus_et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; + vmbus_et.et_quality = 1000; + vmbus_et.et_frequency = HV_TIMER_FREQUENCY; + vmbus_et.et_min_period = + HV_MIN_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); + vmbus_et.et_max_period = + HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); + vmbus_et.et_start = hv_et_start; /* * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will @@ -165,13 +166,13 @@ hv_et_attach(device_t dev) DELAY(100); smp_rendezvous(NULL, vmbus_et_config, NULL, NULL); - return (et_register(et)); + return (et_register(&vmbus_et)); } static int hv_et_detach(device_t dev) { - return (et_deregister(et)); + return (et_deregister(&vmbus_et)); } static device_method_t hv_et_methods[] = { @@ -186,7 +187,7 @@ static device_method_t hv_et_methods[] = static driver_t hv_et_driver = { "hv_et", hv_et_methods, - sizeof(struct eventtimer) + 0 }; static devclass_t hv_et_devclass; From owner-svn-src-head@freebsd.org Mon May 30 09:05:26 2016 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 1BB63B53B98; Mon, 30 May 2016 09:05:26 +0000 (UTC) (envelope-from grembo@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 mx1.freebsd.org (Postfix) with ESMTPS id CFAEE1447; Mon, 30 May 2016 09:05:25 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U95Pdb096801; Mon, 30 May 2016 09:05:25 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U95Ph3096800; Mon, 30 May 2016 09:05:25 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201605300905.u4U95Ph3096800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Mon, 30 May 2016 09:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300990 - head/sys/dev/ichiic 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.22 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: Mon, 30 May 2016 09:05:26 -0000 Author: grembo (ports committer) Date: Mon May 30 09:05:24 2016 New Revision: 300990 URL: https://svnweb.freebsd.org/changeset/base/300990 Log: Fix ig4 operation for certain machines Some machine BIOSes use the I2C bus and leave it in a state that causes interrupts to not work properly due to a pending interrupt having been latched. Refactor the code a bit to clear pending interrupts when I2C is enabled. This fixes the primary problem. Also fix a possible race condition in the interrupt handler where the interrupt was being cleared after reading the status instead of before. Reported by: pfg Reviewed by: jhb Approved by: jhb Obtained from: DragonFly BSD Differential Revision: https://reviews.freebsd.org/D6586 Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Mon May 30 08:50:33 2016 (r300989) +++ head/sys/dev/ichiic/ig4_iic.c Mon May 30 09:05:24 2016 (r300990) @@ -108,6 +108,17 @@ set_controller(ig4iic_softc_t *sc, uint3 int error; uint32_t v; + /* + * When the controller is enabled, interrupt on STOP detect + * or receive character ready and clear pending interrupts. + */ + if (ctl & IG4_I2C_ENABLE) { + reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET | + IG4_INTR_RX_FULL); + reg_read(sc, IG4_REG_CLR_INTR); + } else + reg_write(sc, IG4_REG_INTR_MASK, 0); + reg_write(sc, IG4_REG_I2C_EN, ctl); error = SMB_ETIMEOUT; @@ -553,11 +564,6 @@ ig4iic_attach(ig4iic_softc_t *sc) reg_write(sc, IG4_REG_RESETS, IG4_RESETS_DEASSERT); #endif - /* - * Interrupt on STOP detect or receive character ready - */ - reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET | - IG4_INTR_RX_FULL); mtx_lock(&sc->io_lock); if (set_controller(sc, 0)) device_printf(sc->dev, "controller error during attach-1\n"); @@ -574,7 +580,8 @@ ig4iic_attach(ig4iic_softc_t *sc) sc->enum_hook.ich_func = ig4iic_start; sc->enum_hook.ich_arg = sc->dev; - /* We have to wait until interrupts are enabled. I2C read and write + /* + * We have to wait until interrupts are enabled. I2C read and write * only works if the interrupts are available. */ if (config_intrhook_establish(&sc->enum_hook) != 0) @@ -628,7 +635,6 @@ ig4iic_detach(ig4iic_softc_t *sc) sc->smb = NULL; sc->intr_handle = NULL; reg_write(sc, IG4_REG_INTR_MASK, 0); - reg_read(sc, IG4_REG_CLR_INTR); set_controller(sc, 0); mtx_unlock(&sc->io_lock); @@ -917,6 +923,7 @@ ig4iic_intr(void *cookie) mtx_lock(&sc->io_lock); /* reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET);*/ + reg_read(sc, IG4_REG_CLR_INTR); status = reg_read(sc, IG4_REG_I2C_STA); while (status & IG4_STATUS_RX_NOTEMPTY) { sc->rbuf[sc->rnext & IG4_RBUFMASK] = @@ -924,7 +931,6 @@ ig4iic_intr(void *cookie) ++sc->rnext; status = reg_read(sc, IG4_REG_I2C_STA); } - reg_read(sc, IG4_REG_CLR_INTR); wakeup(sc); mtx_unlock(&sc->io_lock); } From owner-svn-src-head@freebsd.org Mon May 30 09:18:14 2016 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 44D83B5403A; Mon, 30 May 2016 09:18:14 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 1296A1CDC; Mon, 30 May 2016 09:18:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U9ID9R000577; Mon, 30 May 2016 09:18:13 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U9ID65000576; Mon, 30 May 2016 09:18:13 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605300918.u4U9ID65000576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 30 May 2016 09:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300991 - head/sys/sys 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.22 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: Mon, 30 May 2016 09:18:14 -0000 Author: ed Date: Mon May 30 09:18:12 2016 New Revision: 300991 URL: https://svnweb.freebsd.org/changeset/base/300991 Log: Add missing restrict keywords to lio_listio(). Modified: head/sys/sys/aio.h Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Mon May 30 09:05:24 2016 (r300990) +++ head/sys/sys/aio.h Mon May 30 09:18:12 2016 (r300991) @@ -205,7 +205,8 @@ int aio_write(struct aiocb *); * "acb_list" is an array of "nacb_listent" I/O control blocks. * when all I/Os are complete, the optional signal "sig" is sent. */ -int lio_listio(int, struct aiocb * const [], int, struct sigevent *); +int lio_listio(int, struct aiocb *__restrict const *__restrict, int, + struct sigevent *); /* * Get completion status From owner-svn-src-head@freebsd.org Mon May 30 09:20:09 2016 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 ABC15B540C3; Mon, 30 May 2016 09:20:09 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 833FC1E77; Mon, 30 May 2016 09:20:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U9K8Qi000705; Mon, 30 May 2016 09:20:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U9K8iu000702; Mon, 30 May 2016 09:20:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300920.u4U9K8iu000702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 09:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300992 - head/sys/dev/hyperv/vmbus 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.22 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: Mon, 30 May 2016 09:20:09 -0000 Author: sephe Date: Mon May 30 09:20:08 2016 New Revision: 300992 URL: https://svnweb.freebsd.org/changeset/base/300992 Log: hyperv: Move timer frequency definition to common place. And cleanup event timer period settings. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6597 Modified: head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hyperv_var.h Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:18:12 2016 (r300991) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:20:08 2016 (r300992) @@ -41,10 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define HV_TIMER_FREQUENCY (10 * 1000 * 1000LL) /* 100ns period */ -#define HV_MAX_DELTA_TICKS 0xffffffffLL -#define HV_MIN_DELTA_TICKS 1LL - #define MSR_HV_STIMER0_CFG_SINT \ ((((uint64_t)VMBUS_SINT_TIMER) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ MSR_HV_STIMER_CFG_SINT_MASK) @@ -67,7 +63,8 @@ sbintime2tick(sbintime_t time) struct timespec val; val = sbttots(time); - return (val.tv_sec * HV_TIMER_FREQUENCY) + (val.tv_nsec / 100); + return (val.tv_sec * HYPERV_TIMER_FREQ) + + (val.tv_nsec / HYPERV_TIMER_NS_FACTOR); } static int @@ -151,11 +148,9 @@ hv_et_attach(device_t dev) vmbus_et.et_name = "Hyper-V"; vmbus_et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; vmbus_et.et_quality = 1000; - vmbus_et.et_frequency = HV_TIMER_FREQUENCY; - vmbus_et.et_min_period = - HV_MIN_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); - vmbus_et.et_max_period = - HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); + vmbus_et.et_frequency = HYPERV_TIMER_FREQ; + vmbus_et.et_min_period = (0x00000001ULL << 32) / HYPERV_TIMER_FREQ; + vmbus_et.et_max_period = (0xfffffffeULL << 32) / HYPERV_TIMER_FREQ; vmbus_et.et_start = hv_et_start; /* Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 30 09:18:12 2016 (r300991) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 30 09:20:08 2016 (r300992) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define HV_NANOSECONDS_PER_SEC 1000000000L - #define HYPERV_FREEBSD_BUILD 0ULL #define HYPERV_FREEBSD_VERSION ((uint64_t)__FreeBSD_version) #define HYPERV_FREEBSD_OSID 0ULL @@ -87,7 +85,7 @@ static struct timecounter hyperv_timecou .tc_get_timecount = hyperv_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = 0xffffffff, - .tc_frequency = HV_NANOSECONDS_PER_SEC/100, + .tc_frequency = HYPERV_TIMER_FREQ, .tc_name = "Hyper-V", .tc_quality = 2000, .tc_flags = 0, Modified: head/sys/dev/hyperv/vmbus/hyperv_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_var.h Mon May 30 09:18:12 2016 (r300991) +++ head/sys/dev/hyperv/vmbus/hyperv_var.h Mon May 30 09:20:08 2016 (r300992) @@ -29,6 +29,12 @@ #ifndef _HYPERV_VAR_H_ #define _HYPERV_VAR_H_ +#ifndef NANOSEC +#define NANOSEC 1000000000ULL +#endif +#define HYPERV_TIMER_NS_FACTOR 100ULL +#define HYPERV_TIMER_FREQ (NANOSEC / HYPERV_TIMER_NS_FACTOR) + extern u_int hyperv_features; extern u_int hyperv_recommends; From owner-svn-src-head@freebsd.org Mon May 30 09:35:38 2016 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 00F01B5454D; Mon, 30 May 2016 09:35:38 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id CEAEF183E; Mon, 30 May 2016 09:35:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U9ZbB0008034; Mon, 30 May 2016 09:35:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U9ZbMj008033; Mon, 30 May 2016 09:35:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300935.u4U9ZbMj008033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 09:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300993 - head/sys/dev/hyperv/vmbus 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.22 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: Mon, 30 May 2016 09:35:38 -0000 Author: sephe Date: Mon May 30 09:35:36 2016 New Revision: 300993 URL: https://svnweb.freebsd.org/changeset/base/300993 Log: hyperv/et: Device renaming; consistent w/ other Hyper-V utils While I'm here, prefix function names w/ vmbus, since unlike Hyper-V timecounter, Hyper-V event timer will not work w/o vmbus. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6598 Modified: head/sys/dev/hyperv/vmbus/hv_et.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:20:08 2016 (r300992) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:35:36 2016 (r300993) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define VMBUS_ET_NAME "hvet" + #define MSR_HV_STIMER0_CFG_SINT \ ((((uint64_t)VMBUS_SINT_TIMER) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ MSR_HV_STIMER_CFG_SINT_MASK) @@ -58,7 +60,7 @@ __FBSDID("$FreeBSD$"); static struct eventtimer vmbus_et; static __inline uint64_t -sbintime2tick(sbintime_t time) +hyperv_sbintime2count(sbintime_t time) { struct timespec val; @@ -68,12 +70,13 @@ sbintime2tick(sbintime_t time) } static int -hv_et_start(struct eventtimer *et, sbintime_t firsttime, sbintime_t periodtime) +vmbus_et_start(struct eventtimer *et __unused, sbintime_t first, + sbintime_t period __unused) { uint64_t current; current = rdmsr(MSR_HV_TIME_REF_COUNT); - current += sbintime2tick(firsttime); + current += hyperv_sbintime2count(first); wrmsr(MSR_HV_STIMER0_COUNT, current); return (0); @@ -97,18 +100,18 @@ vmbus_et_intr(struct trapframe *frame) } static void -hv_et_identify(driver_t *driver, device_t parent) +vmbus_et_identify(driver_t *driver, device_t parent) { if (device_get_unit(parent) != 0 || - device_find_child(parent, "hv_et", -1) != NULL || + device_find_child(parent, VMBUS_ET_NAME, -1) != NULL || (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) return; - device_add_child(parent, "hv_et", -1); + device_add_child(parent, VMBUS_ET_NAME, -1); } static int -hv_et_probe(device_t dev) +vmbus_et_probe(device_t dev) { device_set_desc(dev, "Hyper-V event timer"); @@ -141,7 +144,7 @@ vmbus_et_config(void *arg __unused) } static int -hv_et_attach(device_t dev) +vmbus_et_attach(device_t dev) { /* TODO: use independent IDT vector */ @@ -151,7 +154,7 @@ hv_et_attach(device_t dev) vmbus_et.et_frequency = HYPERV_TIMER_FREQ; vmbus_et.et_min_period = (0x00000001ULL << 32) / HYPERV_TIMER_FREQ; vmbus_et.et_max_period = (0xfffffffeULL << 32) / HYPERV_TIMER_FREQ; - vmbus_et.et_start = hv_et_start; + vmbus_et.et_start = vmbus_et_start; /* * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will @@ -165,26 +168,26 @@ hv_et_attach(device_t dev) } static int -hv_et_detach(device_t dev) +vmbus_et_detach(device_t dev) { return (et_deregister(&vmbus_et)); } -static device_method_t hv_et_methods[] = { - DEVMETHOD(device_identify, hv_et_identify), - DEVMETHOD(device_probe, hv_et_probe), - DEVMETHOD(device_attach, hv_et_attach), - DEVMETHOD(device_detach, hv_et_detach), +static device_method_t vmbus_et_methods[] = { + DEVMETHOD(device_identify, vmbus_et_identify), + DEVMETHOD(device_probe, vmbus_et_probe), + DEVMETHOD(device_attach, vmbus_et_attach), + DEVMETHOD(device_detach, vmbus_et_detach), DEVMETHOD_END }; -static driver_t hv_et_driver = { - "hv_et", - hv_et_methods, +static driver_t vmbus_et_driver = { + VMBUS_ET_NAME, + vmbus_et_methods, 0 }; -static devclass_t hv_et_devclass; -DRIVER_MODULE(hv_et, vmbus, hv_et_driver, hv_et_devclass, NULL, 0); +static devclass_t vmbus_et_devclass; +DRIVER_MODULE(hv_et, vmbus, vmbus_et_driver, vmbus_et_devclass, NULL, NULL); MODULE_VERSION(hv_et, 1); From owner-svn-src-head@freebsd.org Mon May 30 09:44:18 2016 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 56809B54854; Mon, 30 May 2016 09:44:18 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 1A7F31E15; Mon, 30 May 2016 09:44:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U9iHiN011549; Mon, 30 May 2016 09:44:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U9iHu0011548; Mon, 30 May 2016 09:44:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300944.u4U9iHu0011548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 09:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300994 - head/sys/dev/hyperv/vmbus 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.22 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: Mon, 30 May 2016 09:44:18 -0000 Author: sephe Date: Mon May 30 09:44:17 2016 New Revision: 300994 URL: https://svnweb.freebsd.org/changeset/base/300994 Log: hyperv/et: Allow Hyper-V event timer be disabled MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6599 Modified: head/sys/dev/hyperv/vmbus/hv_et.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:35:36 2016 (r300993) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:44:17 2016 (r300994) @@ -113,6 +113,9 @@ vmbus_et_identify(driver_t *driver, devi static int vmbus_et_probe(device_t dev) { + if (resource_disabled(VMBUS_ET_NAME, 0)) + return (ENXIO); + device_set_desc(dev, "Hyper-V event timer"); return (BUS_PROBE_NOWILDCARD); From owner-svn-src-head@freebsd.org Mon May 30 11:18:40 2016 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 823CBB54F77; Mon, 30 May 2016 11:18:40 +0000 (UTC) (envelope-from tuexen@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 mx1.freebsd.org (Postfix) with ESMTPS id 5477119A8; Mon, 30 May 2016 11:18:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UBIdXr044857; Mon, 30 May 2016 11:18:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UBIdjM044856; Mon, 30 May 2016 11:18:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605301118.u4UBIdjM044856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 30 May 2016 11:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300995 - head/sys/netinet 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.22 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: Mon, 30 May 2016 11:18:40 -0000 Author: tuexen Date: Mon May 30 11:18:39 2016 New Revision: 300995 URL: https://svnweb.freebsd.org/changeset/base/300995 Log: Fix a byte order issue for the scope stored in the SCTP cookie. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon May 30 09:44:17 2016 (r300994) +++ head/sys/netinet/sctp_output.c Mon May 30 11:18:39 2016 (r300995) @@ -5686,7 +5686,7 @@ do_a_abort: { stc.addr_type = SCTP_IPV6_ADDRESS; memcpy(&stc.address, &src6->sin6_addr, sizeof(struct in6_addr)); - stc.scope_id = in6_getscope(&src6->sin6_addr); + stc.scope_id = ntohs(in6_getscope(&src6->sin6_addr)); if (sctp_is_address_on_local_host(src, vrf_id)) { stc.loopback_scope = 1; stc.local_scope = 0; From owner-svn-src-head@freebsd.org Mon May 30 13:37:12 2016 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 EB279B5389F; Mon, 30 May 2016 13:37:12 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id A7F681187; Mon, 30 May 2016 13:37:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UDbBMh096371; Mon, 30 May 2016 13:37:11 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UDbBI9096370; Mon, 30 May 2016 13:37:11 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605301337.u4UDbBI9096370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 30 May 2016 13:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300996 - head/include 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.22 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: Mon, 30 May 2016 13:37:13 -0000 Author: ed Date: Mon May 30 13:37:11 2016 New Revision: 300996 URL: https://svnweb.freebsd.org/changeset/base/300996 Log: Add missing types and constants to . According to POSIX, the netdb.h header must also provide in_addr_t and in_port_t. It should also provide IPPORT_RESERVED. Copy over the necessary bits from to achieve that. Modified: head/include/netdb.h Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Mon May 30 11:18:39 2016 (r300995) +++ head/include/netdb.h Mon May 30 13:37:11 2016 (r300996) @@ -60,6 +60,16 @@ #include #include +#ifndef _IN_ADDR_T_DECLARED +typedef __uint32_t in_addr_t; +#define _IN_ADDR_T_DECLARED +#endif + +#ifndef _IN_PORT_T_DECLARED +typedef __uint16_t in_port_t; +#define _IN_PORT_T_DECLARED +#endif + #ifndef _SIZE_T_DECLARED typedef __size_t size_t; #define _SIZE_T_DECLARED @@ -131,6 +141,8 @@ struct addrinfo { struct addrinfo *ai_next; /* next structure in linked list */ }; +#define IPPORT_RESERVED 1024 + /* * Error return codes from gethostbyname() and gethostbyaddr() * (left in h_errno). From owner-svn-src-head@freebsd.org Mon May 30 13:51:29 2016 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 03187B53DEC; Mon, 30 May 2016 13:51:29 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id B05E11AFA; Mon, 30 May 2016 13:51:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UDpR2q002902; Mon, 30 May 2016 13:51:27 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UDpRVp002899; Mon, 30 May 2016 13:51:27 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605301351.u4UDpRVp002899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 30 May 2016 13:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300997 - in head: include lib/libc/gen 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.22 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: Mon, 30 May 2016 13:51:29 -0000 Author: ed Date: Mon May 30 13:51:27 2016 New Revision: 300997 URL: https://svnweb.freebsd.org/changeset/base/300997 Log: Fix the signature of the psignal() function. POSIX 2008 added the psignal() function which has already been part of the BSDs for a long time. The only difference is, the POSIX version uses an 'int' for the signal number, unlike our version which uses an 'unsigned int'. Fix up the function to use an 'int'. This should not affect the ABI. Modified: head/include/signal.h head/lib/libc/gen/psignal.3 head/lib/libc/gen/psignal.c Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Mon May 30 13:37:11 2016 (r300996) +++ head/include/signal.h Mon May 30 13:51:27 2016 (r300997) @@ -113,7 +113,7 @@ int siginterrupt(int, int); #endif #if __POSIX_VISIBLE >= 200809 -void psignal(unsigned int, const char *); +void psignal(int, const char *); #endif #if __BSD_VISIBLE Modified: head/lib/libc/gen/psignal.3 ============================================================================== --- head/lib/libc/gen/psignal.3 Mon May 30 13:37:11 2016 (r300996) +++ head/lib/libc/gen/psignal.3 Mon May 30 13:51:27 2016 (r300997) @@ -28,7 +28,7 @@ .\" @(#)psignal.3 8.2 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd February 4, 2011 +.Dd May 30, 2016 .Dt PSIGNAL 3 .Os .Sh NAME @@ -42,7 +42,7 @@ .Sh SYNOPSIS .In signal.h .Ft void -.Fn psignal "unsigned sig" "const char *s" +.Fn psignal "int sig" "const char *s" .Vt extern const char * const sys_siglist[] ; .Vt extern const char * const sys_signame[] ; .In string.h Modified: head/lib/libc/gen/psignal.c ============================================================================== --- head/lib/libc/gen/psignal.c Mon May 30 13:37:11 2016 (r300996) +++ head/lib/libc/gen/psignal.c Mon May 30 13:51:27 2016 (r300997) @@ -44,11 +44,11 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" void -psignal(unsigned int sig, const char *s) +psignal(int sig, const char *s) { const char *c; - if (sig < NSIG) + if (sig >= 0 && sig < NSIG) c = sys_siglist[sig]; else c = "Unknown signal"; From owner-svn-src-head@freebsd.org Mon May 30 16:19:02 2016 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 413F5B54DF1 for ; Mon, 30 May 2016 16:19:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm36-vm2.bullet.mail.bf1.yahoo.com (nm36-vm2.bullet.mail.bf1.yahoo.com [72.30.238.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 019E21478 for ; Mon, 30 May 2016 16:19:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1464624757; bh=T1ajSTfScZ6IBwC8XMQvMczWGK2xlF6o5dLS2NhSCrk=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=IsLvLPErN1K6wECduhCepGa85qrq/67lHlsxPZOX70W1qupy4elSitIiGBQ+KFvXlZBoBLH8njpNpg6djpv47oLAle6gH9mB4m0y0yBeO5O3aBa1drWEkg7BZ8M2vCYIqlXGmwY/oDcdP+OEt4qAtEKIS2VPKOyxyHdP0kxlSP7ZJnv2NVe7TyJz8hW+aG6bu5TnoCCEu06HueooW23zRu/5TyeVIp3RE30rHXz2FRA43XWBGVWv54XswHCuXlK3crYNOAzIt6lR/cQbB9byto3apavlxvJFsbJcWM0waGU3ZZ9htxQl/fQGLj6auzjg5b99SO7ZH5FSXfweh88keg== Received: from [66.196.81.172] by nm36.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2016 16:12:37 -0000 Received: from [98.139.211.161] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2016 16:12:37 -0000 Received: from [127.0.0.1] by smtp218.mail.bf1.yahoo.com with NNFMP; 30 May 2016 16:12:37 -0000 X-Yahoo-Newman-Id: 595864.95835.bm@smtp218.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dT5lFmQVM1nsVVQ3bhD7tufuKOQgXztEOBLZLiaiQEhnbMq lRqize_cn.k00KuNTziGG4rH7vluVyyW7O1_N5xxPnTKKdXvBwiGVlM05jgz n2gOoF9a6FAvoGWNlJImbgkMgG.m3sUtd4ko67UcjnpCaRdOTdzoV9syrMBo lAYEWoPFVHrZkCPCQnIBEJdpHdg5B_QEUybpZanZbdmRSFOhKR3tY_QCWDg4 KEY3hx4aYAAFm591kNbqVD7aNfM2JvA4Uf1noxv.UShIzJW.yLcXUp.SriY9 1meuuX.q7YZy9tDsAo2tlkkpCqzErE_lRvnGNX5nTKrtaMhh76lVf.DTzvhB cW9fExqfzG70wcxGnt8T5B0PoC3axlivm._IWgRnZr00kcYcGdxIdanqeMuR aAG1gIYjjmKlxNgZgR48DzDw_uE1nqCCyPyklr9R_67JxBLU4Xdei2z.B8iA wRnuqbl0NMU7RhBrTmnBBBe4ZsdbheNNXwautAzuwUWx2Cz98PZQQBr6kFdv bBRxhLl6TfcPlDKRcBdrrJZJg6HvXEYku X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300956 - head/lib/libc/stdlib To: Bruce Evans , "Andrey A. Chernov" References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: Date: Mon, 30 May 2016 11:12:54 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160530110541.I924@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 16:19:02 -0000 (Interesting discussion) On 05/29/16 21:17, Bruce Evans wrote: > On Sun, 29 May 2016, Andrey A. Chernov wrote: > >> Log: >> 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and >> makes >> reading hard. > > Good. > >> 2) Instead of doing range transformation in each and every function >> here, >> do it single time directly in do_rand(). One "mod" operation overhead >> is not >> a big deal, but the code looks nicer and possible future functions >> additions >> or PRNG change do not miss range transformations neither have >> unneeded ones. > > The whole implementation is silly. It is manually optimized for 1980's > compilers. More below. > >> 3) Use POSIX argument types for visible functions (cosmetic). > > Not sure I like type changes. > >> Modified: head/lib/libc/stdlib/rand.c >> ============================================================================== >> >> --- head/lib/libc/stdlib/rand.c Sun May 29 12:21:54 2016 (r300955) >> +++ head/lib/libc/stdlib/rand.c Sun May 29 13:57:06 2016 (r300956) >> @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); >> static int >> do_rand(unsigned long *ctx) >> { >> -#ifdef USE_WEAK_SEEDING >> -/* >> - * Historic implementation compatibility. >> - * The random sequences do not vary much with the seed, >> - * even with overflowing. >> - */ >> - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + >> 1)); > > This is a good implementation of a not very good LCG, made very bad by > botching RAND_MAX. The magic numbers except for RAND_MAX are copied > from the example in the C90 spec. I think they are good enough there. > The comment in at least the C99 spec says "// RAND_MAX assumed to be > 32767". This means that these magic numbers were chosen to work with > this value of RAND_MAX. (unsigned) longs are used to give a period > much longer than RAND_MAX and for technical reasons. Taking the modulo > to many fewer bits than the minimum of 32 for an unsigned long then > disguises the linearity. The BSD version almost completly breaks this > on arches with 32 bit longs by taking the modulo to 31 bits (mod 32 bits > would give complete breakage). Arches with 64-bit longs accidentally > work a bit better, by the coefficients are poorly chosen -- they should > be 64 bits and the arithmetic 128 bits. > FWIW, there are coefficients for a 64 bit LCG here: http://nuclear.llnl.gov/CNP/rng/rngman/node4.html It would be interesting to have a LCG optimized for modern platforms, even if we cannot produce more than 31 bits due to the standards. Pedro. From owner-svn-src-head@freebsd.org Mon May 30 16:26:35 2016 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 3B6FEB540F8; Mon, 30 May 2016 16:26:35 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 0B3421CCB; Mon, 30 May 2016 16:26:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UGQYjM059485; Mon, 30 May 2016 16:26:34 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UGQYtO059484; Mon, 30 May 2016 16:26:34 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605301626.u4UGQYtO059484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 30 May 2016 16:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300998 - head/include 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.22 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: Mon, 30 May 2016 16:26:35 -0000 Author: ed Date: Mon May 30 16:26:34 2016 New Revision: 300998 URL: https://svnweb.freebsd.org/changeset/base/300998 Log: Add missing va_list to . It looks like va_list should always be defined when XSI is enabled. It moved over to the POSIX base in the 2008 edition. Modified: head/include/wchar.h Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Mon May 30 13:51:27 2016 (r300997) +++ head/include/wchar.h Mon May 30 16:26:34 2016 (r300998) @@ -76,6 +76,13 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE +#ifndef _VA_LIST_DECLARED +typedef __va_list va_list; +#define _VA_LIST_DECLARED +#endif +#endif + #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED typedef ___wchar_t wchar_t; From owner-svn-src-head@freebsd.org Mon May 30 16:38:55 2016 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 243FFB543A0; Mon, 30 May 2016 16:38:55 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDAE61388; Mon, 30 May 2016 16:38:54 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id f144so53235373pfa.3; Mon, 30 May 2016 09:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:from:subject:date:to; bh=ln2eIGRhzw5PHGHknG86u1WIaGuZTYmNQCtKf+4RpyI=; b=HHtq/+dtHIu8s82I8fXUFwdu9RffyJM9RP3IJXdCAVSQ6c4Hp9WFH8GmSEGeHviUjE u6nBWHsvX4qN6pgY4geJjDTfpoonjOSlVOB0r5IprCsvjbgyn8wHHeIEwoPEPQZShhkg SdaNrjA0daO3Tj+l+ncb4QDT/Q1loPbTvn0jIAZbCTBEGqoU38wHE4TM5LMmZYEEqL/0 rx311kB5bpfS3TIPAZJevcsvaBn8gxy6mkhfzzY13r/ATr0sOoQxGheJtJfuGWyBZo3I xig1akI1JjIgRIDVn27SoZ5onqxpSQtbKZmOMyNTAk+BI7mLSi491H23ZOn1crhl47+T R8Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:from:subject:date:to; bh=ln2eIGRhzw5PHGHknG86u1WIaGuZTYmNQCtKf+4RpyI=; b=J7LZPfF3jP+ohBiVvaogNMw+e4ZErwsVZNo6UpagGq+cq0xIlD+o2Ir37+SWRcSvjw oRcF2kw1t3okog8Y8eFrUBmLhlleUDhAE6dzkUPzYBltSjI5N1++SMx/MYIfl/8pERts HxQu9sF1sCehTtmtFbS/C24q2bxmqDDxXBISYJAxPZ3MIy7fFqVgom6VnHmqGWsk8uiS 7vDN6tvagm4oFqVVJYhg7W0ZOB2iGDcsieXrqmaFIZlmra9/+iCGu5gkHy7xEwl1YedY xEhKeOc5xsIdcIWoO2m31s98UMhz4iVarRLXXbdiyXLtDN8OJ2r8Q5Ud6NGxC9Iz9o9L akLA== X-Gm-Message-State: ALyK8tKz4JexzlzHU7VPvzb63O/uxrdn9eZDBDbBfr6UIqGGdCQUcSRPDtW04ZNcxxNvaA== X-Received: by 10.98.79.73 with SMTP id d70mr47528073pfb.120.1464626334392; Mon, 30 May 2016 09:38:54 -0700 (PDT) Received: from [25.88.35.112] (S0106d4ca6d8943b0.gv.shawcable.net. [24.68.134.59]) by smtp.gmail.com with ESMTPSA id n10sm48672019pax.18.2016.05.30.09.38.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 May 2016 09:38:53 -0700 (PDT) Message-ID: <574c6c9d.0a50420a.c102b.1d0e@mx.google.com> MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r300998 - head/include Date: Mon, 30 May 2016 09:38:58 -0700 To: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Cy Schubert Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 16:38:55 -0000 This looks like it could be MFCable. Can it be? Sent from my cellphone, tiny keyboard in use, ~Cy -----Original Message----- From: Ed Schouten Sent: 30/05/2016 09:26 To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: svn commit: r300998 - head/include Author: ed Date: Mon May 30 16:26:34 2016 New Revision: 300998 URL: https://svnweb.freebsd.org/changeset/base/300998 Log: Add missing va_list to . =20 It looks like va_list should always be defined when XSI is enabled. It moved over to the POSIX base in the 2008 edition. Modified: head/include/wchar.h Modified: head/include/wchar.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/include/wchar.h Mon May 30 13:51:27 2016 (r300997) +++ head/include/wchar.h Mon May 30 16:26:34 2016 (r300998) @@ -76,6 +76,13 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif =20 +#if __POSIX_VISIBLE >=3D 200809 || __XSI_VISIBLE +#ifndef _VA_LIST_DECLARED +typedef __va_list va_list; +#define _VA_LIST_DECLARED +#endif +#endif + #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED typedef ___wchar_t wchar_t; From owner-svn-src-head@freebsd.org Mon May 30 16:52:24 2016 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 AB365B54A3B; Mon, 30 May 2016 16:52:24 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 7A61110FF; Mon, 30 May 2016 16:52:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UGqN9M070542; Mon, 30 May 2016 16:52:23 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UGqNeu070540; Mon, 30 May 2016 16:52:23 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605301652.u4UGqNeu070540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 30 May 2016 16:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300999 - in head: include lib/libc/db/man 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.22 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: Mon, 30 May 2016 16:52:24 -0000 Author: ed Date: Mon May 30 16:52:23 2016 New Revision: 300999 URL: https://svnweb.freebsd.org/changeset/base/300999 Log: Let dbm's datum::dptr use the right type. According to POSIX, it should use void *, not char *. Unfortunately, the dsize field also has the wrong type. It should be size_t. I'm not going to change that, as that will break the ABI. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D6647 Modified: head/include/ndbm.h head/lib/libc/db/man/dbm.3 Modified: head/include/ndbm.h ============================================================================== --- head/include/ndbm.h Mon May 30 16:26:34 2016 (r300998) +++ head/include/ndbm.h Mon May 30 16:52:23 2016 (r300999) @@ -52,7 +52,7 @@ #define DBM_SUFFIX ".db" typedef struct { - char *dptr; + void *dptr; int dsize; } datum; Modified: head/lib/libc/db/man/dbm.3 ============================================================================== --- head/lib/libc/db/man/dbm.3 Mon May 30 16:26:34 2016 (r300998) +++ head/lib/libc/db/man/dbm.3 Mon May 30 16:52:23 2016 (r300999) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2015 +.Dd May 30, 2016 .Dt DBM 3 .Os .Sh NAME @@ -66,7 +66,7 @@ is declared in .In ndbm.h : .Bd -literal typedef struct { - char *dptr; + void *dptr; int dsize; } datum; .Ed From owner-svn-src-head@freebsd.org Mon May 30 17:23:44 2016 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 12505B5519A for ; Mon, 30 May 2016 17:23:44 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D61F01F91 for ; Mon, 30 May 2016 17:23:43 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x235.google.com with SMTP id o16so167475640ywd.2 for ; Mon, 30 May 2016 10:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Gt3hE2bgHz7xhfgd4Vo7ksTOQcZtUGkPeq/Q1PzmROA=; b=Eisl29wR3TL3U3uK1cvTth82VDiznhZQeukviGoXD87ojMaX0b3XgH+fKE19yRHifJ VFr93RdMNjzsN6G6d8BtLY25/S6dNTIFCAJg/2p5F8Yz9geX5sYyNCa/5AjHNjsrbQra mE/aFZjv/LAkjhasR7nNOt+oYBsKQKbPOMpb9zvcHYALGjeDHowz+LFeLsSCq8X8oWD3 2Sg6anxvvn7s8hn7luZRphIhUaMrF8jdjMvnKIN3/7mEL135BeudEJ3of2toaJAEs9Jo qdRJU7D7xUd4bHjgTW8pFEXv9jLNmRg+DJn98fKi2EnbLB4fuGMbrJYzBn5emBba6kVb YwnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Gt3hE2bgHz7xhfgd4Vo7ksTOQcZtUGkPeq/Q1PzmROA=; b=IHlp020345W+GSiswJg9vtfDtBjKG4jJBxN4d5PcnTahz8xN0I9bDgDokRyoo83uOD FRkcv0NFKymAhjA8WxWuyu8vcVwcCvOnbgC8G7B5Q0hXjD5edGtCeQ7oXB44DyY0VMeP w68AF21zeU5nRtYBWuXpGcvBrIMJT/xDGNcCX0S7DLzBkxUyLb7bhGx/+0eZ5dNzQ7O1 ZQkKmbE7guM/vy56Ls3JjGVC7qQBk5I44RunspJlpfbGQaQaThNCO+x8PnzaJnFFFf4m PVJj5poGB7QxNUA/q4AQEg2IbXG3jFy1yFr8WTYRTlW+AwuzdUpqTgJ4bAcMGPXZtjwX L24w== X-Gm-Message-State: ALyK8tIV1OE6hUfW7szShbd037jxSJir/HtcgBqdu6dT3Xef1iwU1kteMtQB7bO/vlBbv9RC+PuBoI8BA/YZzg== MIME-Version: 1.0 X-Received: by 10.129.56.68 with SMTP id f65mr17680243ywa.240.1464629022891; Mon, 30 May 2016 10:23:42 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Mon, 30 May 2016 10:23:42 -0700 (PDT) In-Reply-To: <574c6c9d.0a50420a.c102b.1d0e@mx.google.com> References: <574c6c9d.0a50420a.c102b.1d0e@mx.google.com> Date: Mon, 30 May 2016 19:23:42 +0200 Message-ID: Subject: Re: svn commit: r300998 - head/include From: Ed Schouten To: Cy Schubert Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Cy Schubert Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 17:23:44 -0000 Hi Cy, 2016-05-30 18:38 GMT+02:00 Cy Schubert : > This looks like it could be MFCable. Can it be? It can be MFCed easily. The reason why I haven't chosen to do this explicitly, is because this is not a bug that caused some build to fail. I'm writing a bunch of scripts to do automated tests of POSIX header file conformance and this just happened to pop up. Do you want me to MFC it? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon May 30 17:58:01 2016 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 F04D0B55608; Mon, 30 May 2016 17:58:00 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B51C81EFC; Mon, 30 May 2016 17:58:00 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: by mail-pa0-x22b.google.com with SMTP id um11so11426207pab.0; Mon, 30 May 2016 10:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:from:subject:date:to:cc; bh=/H2AIGaLKcI+HWQUE1h/d/b8cNH6oWAXpkMGl8WZyt0=; b=U+M5wYk9gzzFnw07BxFRbDdbuE1jT40oeQ7TLkLmcDesn3L1Fr6uW+qTZ6Dq8oyOK1 n83+i9oVboVCciNYiOt6vBcA+U0bHgeu042kBuEucrwNpvCP1aswkpM0ESkMRPGtBh4x MJDVca1rUsEuST1JGOpwJQWqoON4SCTb2hUhEDCErsnwKmR7VSIFnMKk5rfg0rPqztnw O7TZsYbzsrhtNZ4S9I4Cd5nMmPrI6XJWuKazoIHI2Eg2PfGXqaf5L7/V/RaO7944VY9t t7xp2IIak5KvAnYwEyJRtyCjPyO91CjRQIlJnpzuJpIkGrcbeW9uZ6GVMVTob8ImdCU2 dSJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:from:subject:date:to:cc; bh=/H2AIGaLKcI+HWQUE1h/d/b8cNH6oWAXpkMGl8WZyt0=; b=cat4aGqoapn0d4xevjC8zvOgK9mF0EGByb2c4Y3GcSiHA1i6EY0IWqOSBt51R2f5dy 9zrYmEogaMaI4DjnSGBDE0zspiWU8qstkm0PoHdmynFgiQ2i3+0wmxZd/PiZfrAzoxAi 1gNb5KUbZD9NisjAOMYKsjvwm3zt6cEmEd2cT0AH+seQnzr9fYfOZqDA5UV7CFzJHLuS 4l3qZeBqMK3NwSxs9hdsBKzbQYbOVf8kDAJRP1+PdVZsdFByFOH2BqK0f9XHFEVFbivW rT9cRmrMlhHbXkEcvqSrnTtrBRzzn8FpPD2tOv+qj8d3M1JH7gB1E0Yt3ihYzZNR3jPs 4Low== X-Gm-Message-State: ALyK8tL+Q8kJNGYAlPjIHS6MM/irw7zVB3UBF8dVABJXz9xLaKjpxlm573zr2OufFeKn7A== X-Received: by 10.66.101.241 with SMTP id fj17mr48210398pab.59.1464631080009; Mon, 30 May 2016 10:58:00 -0700 (PDT) Received: from [25.88.35.112] (S0106d4ca6d8943b0.gv.shawcable.net. [24.68.134.59]) by smtp.gmail.com with ESMTPSA id z125sm25153922pfb.27.2016.05.30.10.57.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 May 2016 10:57:59 -0700 (PDT) Message-ID: <574c7f27.8365620a.113b0.ffff91d5@mx.google.com> MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r300998 - head/include Date: Mon, 30 May 2016 10:58:04 -0700 To: Ed Schouten CC: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Cy Schubert Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 17:58:01 -0000 I figured that since it brought the header file closer to POSIX conformance= (I consider that a bug fix), it might be a good candidate. It's your choic= e though. Sent from my cellphone, tiny keyboard in use, ~Cy -----Original Message----- From: Ed Schouten Sent: 30/05/2016 10:23 To: Cy Schubert Cc: Ed Schouten; src-committers@freebsd.org; svn-src-all@freebsd.org; svn-s= rc-head@freebsd.org; Cy Schubert Subject: Re: svn commit: r300998 - head/include Hi Cy, 2016-05-30 18:38 GMT+02:00 Cy Schubert : > This looks like it could be MFCable. Can it be? It can be MFCed easily. The reason why I haven't chosen to do this explicitly, is because this is not a bug that caused some build to fail. I'm writing a bunch of scripts to do automated tests of POSIX header file conformance and this just happened to pop up. Do you want me to MFC it? --=20 Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon May 30 18:02:10 2016 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 4307FB55831 for ; Mon, 30 May 2016 18:02:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm47-vm1.bullet.mail.bf1.yahoo.com (nm47-vm1.bullet.mail.bf1.yahoo.com [216.109.115.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9DE716A9 for ; Mon, 30 May 2016 18:02:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1464630929; bh=kecs6c/CJxNvXmLo4fV8+6PaN1PVPmPO1gM3H9SBPp4=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=rrZVaC62PwcW+vLfHfDqaMOC4U2w0wy+3AuAFcZ22Hz05XW8eUHioH6yWaVoDoMbmaXPEOsiwGIfZu8ZDWkvcukoOEewXHPWejixXzsb9C4zMKFKa4duvFQU4qgRbU6fLam96ocEhGv4WvSsQv8R4hgjpyrrNKrsoDFPObGxeoR4o9Bjn+y1wd/DgpDFY/G1IZjU3tStbr8lpabxKPH1NnAKO1FMv5lenJR8VDcBgLD5Zr3FXcbimSMUlwLBjqPaniZQ7e0hWEzVbT0mAwPpUzD8HwKDzohw1JcnIfz2uD4/3iFMJX2WsSD4xPVGQltp+f3QfeS3Q0jMnE51nebquQ== Received: from [66.196.81.173] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2016 17:55:29 -0000 Received: from [68.142.230.65] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2016 17:55:29 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 30 May 2016 17:55:29 -0000 X-Yahoo-Newman-Id: 190673.20614.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gEqhnHIVM1nWua02VIBYkBqjAkMOnFXcQANbA46VQVSHRd8 KFDtZSlsrpf2RD39ZGAxyFCCkzzuWa8x3oHI_iIsYoNs10H_21wYHlBIDK.l 1ped7O4sNm3SvLVqsnKlaWy82F4zuhB5OiPgqfFTmgcXm888PmgwRWoxD.P_ nVOgH0XkUjb_0.Icn_6bOn5llKELkwEHq7.CfYkbjMoczf9Is07r4Hh4FZWo Mna0yWvGuUFISPPODOQnRDnjN4YP9iAhJB6n0PnP1FBJyqNt_9yfQrxa8dzl w8jr7nhA_eMcs10zRaO8gyerGoKfDU4Pt31CT.aMHp06KzrnkQGz93YkRHdf 3Pxx_wA9hdUIVAKMrb1Vgy6fM..yMKiaPI5Tnwc6QVVrwKZuObrTDsqfp5NE kEn98vV2k7xWlLCdAOG6weNxQH.yZ0WCEEf0LZG6a7Df6xNK0PcjAWBXeTtN J2yQUHKbj1jJ4MZm2qbVu_NNQQfflb9lBqDUTyYMweUgIkf15XX9H3ile4e_ e0VG9pXeQ8cztyO1QLfGtlDLMYoaRd0Ne X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300999 - in head: include lib/libc/db/man To: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605301652.u4UGqNeu070540@repo.freebsd.org> From: Pedro Giffuni Message-ID: <574C7E89.3080102@FreeBSD.org> Date: Mon, 30 May 2016 12:55:21 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201605301652.u4UGqNeu070540@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 18:02:10 -0000 On 30/05/2016 11:52, Ed Schouten wrote: > Author: ed > Date: Mon May 30 16:52:23 2016 > New Revision: 300999 > URL: https://svnweb.freebsd.org/changeset/base/300999 > > Log: > Let dbm's datum::dptr use the right type. > > According to POSIX, it should use void *, not char *. Unfortunately, the > dsize field also has the wrong type. It should be size_t. I'm not going > to change that, as that will break the ABI. IMHO, just before a new release is the perfect time to break the ABI, and POSIX is a good reason to do it. Pedro. From owner-svn-src-head@freebsd.org Mon May 30 18:24:24 2016 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 B2BC4B55EE5; Mon, 30 May 2016 18:24:24 +0000 (UTC) (envelope-from tuexen@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 mx1.freebsd.org (Postfix) with ESMTPS id 844AC1501; Mon, 30 May 2016 18:24:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UIONR9003711; Mon, 30 May 2016 18:24:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UIONWZ003709; Mon, 30 May 2016 18:24:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605301824.u4UIONWZ003709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 30 May 2016 18:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301000 - in head/sys: netinet netinet6 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.22 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: Mon, 30 May 2016 18:24:24 -0000 Author: tuexen Date: Mon May 30 18:24:23 2016 New Revision: 301000 URL: https://svnweb.freebsd.org/changeset/base/301000 Log: Add PR_CONNREQUIRED for SOCK_STREAM sockets using SCTP. This is required to signal connetion setup on non-blocking sockets via becoming writable. This still allows for implicit connection setup. MFC after: 1 week Modified: head/sys/netinet/in_proto.c head/sys/netinet6/in6_proto.c Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon May 30 16:52:23 2016 (r300999) +++ head/sys/netinet/in_proto.c Mon May 30 18:24:23 2016 (r301000) @@ -176,7 +176,7 @@ struct protosw inetsw[] = { .pr_type = SOCK_STREAM, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD, .pr_input = sctp_input, .pr_ctlinput = sctp_ctlinput, .pr_ctloutput = sctp_ctloutput, Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon May 30 16:52:23 2016 (r300999) +++ head/sys/netinet6/in6_proto.c Mon May 30 18:24:23 2016 (r301000) @@ -207,7 +207,7 @@ struct protosw inet6sw[] = { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, From owner-svn-src-head@freebsd.org Mon May 30 19:25:02 2016 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 F3D1EB54FD9; Mon, 30 May 2016 19:25:01 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id C51AB18B7; Mon, 30 May 2016 19:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UJP0BE026440; Mon, 30 May 2016 19:25:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UJP0cO026439; Mon, 30 May 2016 19:25:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605301925.u4UJP0cO026439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 30 May 2016 19:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301001 - head/lib/libdevdctl 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.22 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: Mon, 30 May 2016 19:25:02 -0000 Author: pfg Date: Mon May 30 19:25:00 2016 New Revision: 301001 URL: https://svnweb.freebsd.org/changeset/base/301001 Log: libdevdctl: minor spelling fixes. Modified: head/lib/libdevdctl/event.h Modified: head/lib/libdevdctl/event.h ============================================================================== --- head/lib/libdevdctl/event.h Mon May 30 18:24:23 2016 (r301000) +++ head/lib/libdevdctl/event.h Mon May 30 19:25:00 2016 (r301001) @@ -170,7 +170,7 @@ public: Type GetType() const; /** - * Get the orginal DevdCtl event string for this event. + * Get the original DevdCtl event string for this event. * * \return The DevdCtl event string. */ @@ -267,7 +267,7 @@ protected: * \note Although stored by reference (since m_nvPairs can * never be NULL), the NVPairMap referenced by this field * is dynamically allocated and owned by this event object. - * m_nvPairs must be deleted at event desctruction. + * m_nvPairs must be deleted at event destruction. */ NVPairMap &m_nvPairs; From owner-svn-src-head@freebsd.org Mon May 30 19:30:42 2016 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 8ED88B55145; Mon, 30 May 2016 19:30:42 +0000 (UTC) (envelope-from rene@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 mx1.freebsd.org (Postfix) with ESMTPS id 5E1511C9A; Mon, 30 May 2016 19:30:42 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UJUf6o026671; Mon, 30 May 2016 19:30:41 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UJUfQK026670; Mon, 30 May 2016 19:30:41 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201605301930.u4UJUfQK026670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Mon, 30 May 2016 19:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301002 - head/share/misc 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.22 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: Mon, 30 May 2016 19:30:42 -0000 Author: rene (doc,ports committer) Date: Mon May 30 19:30:41 2016 New Revision: 301002 URL: https://svnweb.freebsd.org/changeset/base/301002 Log: share/misc/organization.dot: list myself as the new portmgr-secretary Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Mon May 30 19:25:00 2016 (r301001) +++ head/share/misc/organization.dot Mon May 30 19:30:41 2016 (r301002) @@ -31,7 +31,7 @@ doccommitters [label="Doc/www Committers doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nerwin, mat, swills,\nmiwi"] -portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nculot"] +portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, junovitch, miwi, rea, sbz, simon, swills, zi"] From owner-svn-src-head@freebsd.org Mon May 30 19:32:57 2016 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 D8507B553AE; Mon, 30 May 2016 19:32:57 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id A84BD119C; Mon, 30 May 2016 19:32:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UJWu10029958; Mon, 30 May 2016 19:32:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UJWuOi029957; Mon, 30 May 2016 19:32:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605301932.u4UJWuOi029957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 30 May 2016 19:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301003 - head/cddl/usr.sbin/zfsd 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.22 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: Mon, 30 May 2016 19:32:57 -0000 Author: pfg Date: Mon May 30 19:32:56 2016 New Revision: 301003 URL: https://svnweb.freebsd.org/changeset/base/301003 Log: zfsd: minor spelling fix. Modified: head/cddl/usr.sbin/zfsd/callout.h Modified: head/cddl/usr.sbin/zfsd/callout.h ============================================================================== --- head/cddl/usr.sbin/zfsd/callout.h Mon May 30 19:30:41 2016 (r301002) +++ head/cddl/usr.sbin/zfsd/callout.h Mon May 30 19:32:56 2016 (r301003) @@ -109,7 +109,7 @@ public: * * \param interval Timeval indicating the time which must elapse * before this callout fires. - * \param func Pointer to the callback funtion + * \param func Pointer to the callback function * \param arg Argument pointer to pass to callback function * * \return Cancellation status. From owner-svn-src-head@freebsd.org Mon May 30 19:59:52 2016 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 C0C18B55B76; Mon, 30 May 2016 19:59:52 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 79A271EFB; Mon, 30 May 2016 19:59:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UJxp1U037685; Mon, 30 May 2016 19:59:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UJxp0o037683; Mon, 30 May 2016 19:59:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605301959.u4UJxp0o037683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 30 May 2016 19:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301004 - head/etc/rc.d 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.22 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: Mon, 30 May 2016 19:59:52 -0000 Author: ngie Date: Mon May 30 19:59:51 2016 New Revision: 301004 URL: https://svnweb.freebsd.org/changeset/base/301004 Log: Fix circular dependency created after r287197 between ldconfig and mountcritremote ldconfig is already required by mountcritremote indirectly, as noted by rcorder: > rcorder: Circular dependency on provision `mountcritremote' in file `ldconfig'. Having mountcritremote REQUIRE ldconfig breaks dependency ordering. Making the ldconfig hints be conditionally regenerated from mountcritremote when remote filesystems are mounted is done after this change, similar to cleanvar being conditionally called after the change. Differential Revision: https://reviews.freebsd.org/D6621 PR: 202726 Reviewed by: jilles Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/ldconfig head/etc/rc.d/mountcritremote Modified: head/etc/rc.d/ldconfig ============================================================================== --- head/etc/rc.d/ldconfig Mon May 30 19:32:56 2016 (r301003) +++ head/etc/rc.d/ldconfig Mon May 30 19:59:51 2016 (r301004) @@ -4,7 +4,7 @@ # # PROVIDE: ldconfig -# REQUIRE: mountcritremote FILESYSTEMS +# REQUIRE: FILESYSTEMS # BEFORE: DAEMON . /etc/rc.subr Modified: head/etc/rc.d/mountcritremote ============================================================================== --- head/etc/rc.d/mountcritremote Mon May 30 19:32:56 2016 (r301003) +++ head/etc/rc.d/mountcritremote Mon May 30 19:59:51 2016 (r301004) @@ -35,12 +35,15 @@ mountcritremote_precmd() mountcritremote_start() { + local mounted_remote_filesystem=false + # Mount nfs filesystems. # case "`/sbin/mount -d -a -t nfs`" in '') ;; *) + mounted_remote_filesystem=true echo -n 'Mounting NFS filesystems:' mount -a -t nfs echo '.' @@ -64,6 +67,7 @@ mountcritremote_start() case "`mount -d -a -t ${fstype}`" in *mount_${fstype}*) + mounted_remote_filesystem=true echo -n "Mounting ${fsdecr} filesystems:" mount -a -t ${fstype} echo '.' @@ -71,9 +75,15 @@ mountcritremote_start() esac done - # Cleanup /var again just in case it's a network mount. - /etc/rc.d/cleanvar quietreload - rm -f /var/run/clean_var /var/spool/lock/clean_var + if $mounted_remote_filesystem; then + # Cleanup /var again just in case it's a network mount. + /etc/rc.d/cleanvar quietreload + rm -f /var/run/clean_var /var/spool/lock/clean_var + + # Regenerate the ldconfig hints in case there are additional + # library paths on remote file systems + /etc/rc.d/ldconfig quietstart + fi } load_rc_config $name From owner-svn-src-head@freebsd.org Mon May 30 20:41:56 2016 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 BF028B532C7; Mon, 30 May 2016 20:41:56 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 8CD51130A; Mon, 30 May 2016 20:41:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UKftO8055452; Mon, 30 May 2016 20:41:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UKftNS055451; Mon, 30 May 2016 20:41:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605302041.u4UKftNS055451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 30 May 2016 20:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301005 - head/usr.sbin/keyserv 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.22 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: Mon, 30 May 2016 20:41:56 -0000 Author: pfg Date: Mon May 30 20:41:55 2016 New Revision: 301005 URL: https://svnweb.freebsd.org/changeset/base/301005 Log: keyserv(1): drop useless comparison. Comparing a character array against NULL serves no purpose. In any case we are always asigning a value just before using the value so obviate the comparison altogether. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D6651 CID: 1008422 Modified: head/usr.sbin/keyserv/crypt_server.c Modified: head/usr.sbin/keyserv/crypt_server.c ============================================================================== --- head/usr.sbin/keyserv/crypt_server.c Mon May 30 19:59:51 2016 (r301004) +++ head/usr.sbin/keyserv/crypt_server.c Mon May 30 20:41:55 2016 (r301005) @@ -180,12 +180,13 @@ void load_des(warn, libpath) { char dlpath[MAXPATHLEN]; - if (libpath == NULL) { - snprintf(dlpath, sizeof(dlpath), "%s/%s", _PATH_USRLIB, LIBCRYPTO); - } else + if (libpath == NULL) + snprintf(dlpath, sizeof(dlpath), "%s/%s", _PATH_USRLIB, + LIBCRYPTO); + else snprintf(dlpath, sizeof(dlpath), "%s", libpath); - if (dlpath != NULL && (dlhandle = dlopen(dlpath, 0444)) != NULL) + if ((dlhandle = dlopen(dlpath, 0444)) != NULL) _my_crypt = (int (*)())dlsym(dlhandle, "_des_crypt"); if (_my_crypt == NULL) { From owner-svn-src-head@freebsd.org Mon May 30 20:51:52 2016 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 88E5DB535D4; Mon, 30 May 2016 20:51:52 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 5A6011BD1; Mon, 30 May 2016 20:51:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UKppVZ059761; Mon, 30 May 2016 20:51:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UKpp5Z059760; Mon, 30 May 2016 20:51:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605302051.u4UKpp5Z059760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 30 May 2016 20:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301006 - head/sys/sys 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.22 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: Mon, 30 May 2016 20:51:52 -0000 Author: emaste Date: Mon May 30 20:51:51 2016 New Revision: 301006 URL: https://svnweb.freebsd.org/changeset/base/301006 Log: Add and correct MIPS relocation types The correct names for R_MIPS_GOT_HI16 and R_MIPS_GOT_LO16 have a _ after GOT. The nonstandard names (R_MIPS_GOTHI16, R_MIPS_GOTLO16) in the FreeBSD elf_common.h header also had incorrect values and were not used in the tree, so just remove them. Add other MIPS relocation types found in FreeBSD/mips64 object files. Reviewed by: imp, jmallett MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6561 Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Mon May 30 20:41:55 2016 (r301005) +++ head/sys/sys/elf_common.h Mon May 30 20:51:51 2016 (r301006) @@ -1037,10 +1037,16 @@ typedef struct { #define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ #define R_MIPS_GPREL32 12 /* GP relative 32 bit */ #define R_MIPS_64 18 /* Direct 64 bit */ -#define R_MIPS_GOTHI16 21 /* GOT HI 16 bit */ -#define R_MIPS_GOTLO16 22 /* GOT LO 16 bit */ +#define R_MIPS_GOT_DISP 19 +#define R_MIPS_GOT_PAGE 20 +#define R_MIPS_GOT_OFST 21 +#define R_MIPS_GOT_HI16 22 /* GOT HI 16 bit */ +#define R_MIPS_GOT_LO16 23 /* GOT LO 16 bit */ +#define R_MIPS_SUB 24 #define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ #define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ +#define R_MIPS_JALR 37 +#define R_MIPS_TLS_GD 42 #define R_PPC_NONE 0 /* No relocation. */ #define R_PPC_ADDR32 1 From owner-svn-src-head@freebsd.org Mon May 30 21:41:41 2016 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 47296B4F31F; Mon, 30 May 2016 21:41:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 258771301; Mon, 30 May 2016 21:41:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4ULfVWU029594; Mon, 30 May 2016 14:41:35 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605302141.u4ULfVWU029594@gw.catspoiler.org> Date: Mon, 30 May 2016 14:41:31 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300949 - head/sys/netpfil/ipfw To: brde@optusnet.com.au cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160529173603.G2146@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 21:41:41 -0000 On 29 May, Bruce Evans wrote: > On Sun, 29 May 2016, Don Lewis wrote: > >> Log: >> Cast some expressions that multiply a long long constant by a >> floating point constant to int64_t. This avoids the runtime >> conversion of the the other operand in a set of comparisons from >> int64_t to floating point and doing the comparisions in floating >> point. >> >> Suggested by: lidl >> Submitted by: Rasool Al-Saadi >> MFC after: 2 weeks (with r300779) > > Compilers are still permitted to (and perhaps even required to) > evaluate FP constant expressions at runtime (to get rounding and/or > exception flags right). They probably don't in practice, but it is > unclear what happens for -O0 and the rules for rounding are too hard > to understand. > >> Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c >> ============================================================================== >> --- head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:14:51 2016 (r300948) >> +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:23:56 2016 (r300949) >> @@ -244,17 +244,17 @@ calculate_drop_prob(void *x) >> p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; >> >> /* auto-tune drop probability */ >> - if (prob< PIE_MAX_PROB * 0.000001) >> + if (prob < (int64_t)(PIE_MAX_PROB * 0.000001)) >> p >>= 11 + PIE_FIX_POINT_BITS+12; >> + else if (prob < (int64_t)(PIE_MAX_PROB * 0.00001)) >> p >>= 9 + PIE_FIX_POINT_BITS+12; > > Why not just divide by integer powers of 10? > > This might not give a suitably monotonic/continuous scaling at the > endpoints, but it is unclear if the FP gives that either even if we > are more careful with the rounding mode. > > A table of endpoints could be used to get precise control. Then FP > can be used more safely, since it is clear that constants in tables > must be evaluated at compile time. > >> ... > > Similarly for all cases. Thanks. I've passed this upstream. From owner-svn-src-head@freebsd.org Mon May 30 22:41:29 2016 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 7E6CCB4FC70; Mon, 30 May 2016 22:41:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4328D1A46; Mon, 30 May 2016 22:41:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4UMfIWZ029756; Mon, 30 May 2016 15:41:22 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605302241.u4UMfIWZ029756@gw.catspoiler.org> Date: Mon, 30 May 2016 15:41:18 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300952 - head/usr.sbin/services_mkdb To: asomers@freebsd.org cc: ed@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 30 May 2016 22:41:29 -0000 On 29 May, Alan Somers wrote: > On Sun, May 29, 2016 at 4:41 AM, Ed Schouten wrote: >> Author: ed >> Date: Sun May 29 10:41:27 2016 >> New Revision: 300952 >> URL: https://svnweb.freebsd.org/changeset/base/300952 >> >> Log: >> Invoke the dirname() function in a POSIX compliant way. >> >> POSIX requires that the argument of dirname() is of type "char *". In >> other words, the input buffer can be modified by the function to store >> the directory name. >> >> Pull a copy of the string before calling dirname(). We don't care about >> freeing up the memory afterwards, as this is done at the very bottom of >> main(), right before the program terminates. >> >> Reviewed by: bapt >> Differential Revision: https://reviews.freebsd.org/D6628 >> >> Modified: >> head/usr.sbin/services_mkdb/services_mkdb.c >> >> Modified: head/usr.sbin/services_mkdb/services_mkdb.c >> ============================================================================== >> --- head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 07:39:56 2016 (r300951) >> +++ head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 10:41:27 2016 (r300952) >> @@ -92,7 +92,7 @@ main(int argc, char *argv[]) >> size_t cnt = 0; >> StringList *sl, ***svc; >> size_t port, proto; >> - char *dbname_dir; >> + char *dbname_dir, *dbname_dirbuf; >> int dbname_dir_fd = -1; >> >> setprogname(argv[0]); >> @@ -172,7 +172,8 @@ main(int argc, char *argv[]) >> * fsync() to the directory where file lies >> */ >> if (rename(tname, dbname) == -1 || >> - (dbname_dir = dirname(dbname)) == NULL || >> + (dbname_dirbuf = strdup(dbname)) == NULL || >> + (dbname_dir = dirname(dbname_dirbuf)) == NULL || >> (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || >> fsync(dbname_dir_fd) != 0) { >> if (dbname_dir_fd != -1) >> > > Even though the program is about to exit, it's worth freeing the > memory just to make Coverity shut up. I usually don't bother in that situation because it's not worth the added code complexity. In Coverity, I'll mark them as a bug, set the severity to insignficant, and set action to ignore. The situation is different if I think the code might get used elsewhere and the memory could be wasted for a longer period of time. I've also run into situations where there is a real downside to doing this sort of cleanup before calling exit(). Generally this is with a process that has allocated some sort of large data structure in memory over a long period of time, especially if the process has grown larger than physical RAM and is partially resident in swap. It's maddening to watch the process page madly for an extended period of time as it chases pointers all of ther place and calls free() zillions of times when it would be so much faster to just call exit(). Adding more RAM may not be an option in such cases, since I've had to endure this on machines that had the maximum amount of RAM that they could hold. From owner-svn-src-head@freebsd.org Tue May 31 00:23:30 2016 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 D8BF2B5312C; Tue, 31 May 2016 00:23:30 +0000 (UTC) (envelope-from wblock@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 mx1.freebsd.org (Postfix) with ESMTPS id AB3E81DEC; Tue, 31 May 2016 00:23:30 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V0NTvq036000; Tue, 31 May 2016 00:23:29 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V0NTfg035999; Tue, 31 May 2016 00:23:29 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201605310023.u4V0NTfg035999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Tue, 31 May 2016 00:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301007 - head/bin/sh 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.22 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: Tue, 31 May 2016 00:23:30 -0000 Author: wblock (doc committer) Date: Tue May 31 00:23:29 2016 New Revision: 301007 URL: https://svnweb.freebsd.org/changeset/base/301007 Log: Clarify the explanations for the hostname and FQDN entries. MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Mon May 30 20:51:51 2016 (r301006) +++ head/bin/sh/sh.1 Tue May 31 00:23:29 2016 (r301007) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 24, 2016 +.Dd May 30, 2016 .Dt SH 1 .Os .Sh NAME @@ -1403,9 +1403,9 @@ may include any of the following formatt which are replaced by the given information: .Bl -tag -width indent .It Li \eH -The fully-qualified hostname. +This system's fully-qualified hostname (FQDN). .It Li \eh -The local hostname. +This system's hostname. .It Li \eW The final component of the current working directory. .It Li \ew From owner-svn-src-head@freebsd.org Tue May 31 03:42:33 2016 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 ABB33B55529; Tue, 31 May 2016 03:42:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 396C11196; Tue, 31 May 2016 03:42:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 357E93C8334; Tue, 31 May 2016 13:42:23 +1000 (AEST) Date: Tue, 31 May 2016 13:42:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300965 - head/lib/libc/stdlib In-Reply-To: <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> Message-ID: <20160531130326.G1052@besplex.bde.org> References: <201605291639.u4TGdSwq032144@repo.freebsd.org> <20160530122100.X924@besplex.bde.org> <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=jRzFTlLwY2iwN68wQYsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 03:42:33 -0000 On Mon, 30 May 2016, Andrey Chernov wrote: > On 30.05.2016 6:09, Bruce Evans wrote: >> ... The correct fix is s/u_long/uint_fast32_t >> in most places and s/u_long/uint_least32_t/ in some places and then >> fix any missing "&"'s. The "fast" and "least" types always exist, >> unlike the fixed-width types, and using them asks for time/space >> efficiency instead of emulated fixed-width. >> ... [That was the correct fix for longs long ago, not your change here.] >>>> ============================================================================== >>>> >>>> --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 >>>> 2016 (r300964) >>>> +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 >>>> 2016 (r300965) >>>> @@ -430,7 +430,7 @@ random(void) >>>> */ >>>> f = fptr; r = rptr; >>>> *f += *r; >>>> - i = (*f >> 1) & 0x7fffffff; /* chucking least >>>> random bit */ >>>> + i = *f >> 1; /* chucking least random bit */ >> >> This gives an "&" to restore in the version with correct substitutions. >> >> It also breaks the indentation. (This file mostly indents comments to the >> right of code to column 40, but column 48 was used here and now column 32 >> is used.) >> >>>> if (++f >= end_ptr) { >>>> f = state; >>>> ++r; > > I don't introduce uint32_t and int32_t here and don't have a slightest > idea of which types will be better to change them. F.e. *f += *r; > suppose unsigned 32bit overflow which don't naturally happens for large > types. Assigning uint32_t to some large type then clip it to smaller > after calculation - all of that can produce more code than save for > calculation itself. Er, I already said which types are better -- [u]int_fast32_t here. For *f += *r, it is then quite possible that clipping doesn't occur. The calculations should be done as much as possible in the natural register width and clipped only once at the end if possible. Here I think the addition gives only 1 extra bit and the right shift in the next bit immediately removes 1 bit and that is all the calculation does so it is not possible to combine masking steps. I have considerable experience using wide registers optimally in i386 (i387) FP code in libm. Without SSE, FP calculations can only be done in the i387. Clipping the extra precision after every step was only about 5 times slower on old CPUs with 0 or 1 pipelines, but it is serveral times slower than that with more pipelines. C has poor bindings related to this. It requires clipping after every cast and assignment. This is too slow, so gcc and clang don't do it. To get code that is both cast and correct, it is best to use float_t and double_t a lot, so that almost all calculations are done in the wide registers. This corresponds to using int_fastN_t instead of intN_t, int or long. Clipping steps are still unfortunately necessary to match APIs and ABIs, and very rarely to discard extra bits because they are really not wanted. With SSE, clipping after every step is only 2-3 times slower, but it is not necessary to widen for any step. However, not widening gives less accuracy in most cases. Bruce From owner-svn-src-head@freebsd.org Tue May 31 04:09:18 2016 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 5529CB558CF; Tue, 31 May 2016 04:09:18 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 26A551C58; Tue, 31 May 2016 04:09:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V49HRU018046; Tue, 31 May 2016 04:09:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V49HKk018045; Tue, 31 May 2016 04:09:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605310409.u4V49HKk018045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 04:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301008 - head/sys/dev/ath 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.22 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: Tue, 31 May 2016 04:09:18 -0000 Author: adrian Date: Tue May 31 04:09:17 2016 New Revision: 301008 URL: https://svnweb.freebsd.org/changeset/base/301008 Log: [ath] add BTCOEX debug section; modify DPRINTF() to take a no-arg format string. Tested: * QCA9565, STA mode Modified: head/sys/dev/ath/if_ath_debug.h Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Tue May 31 00:23:29 2016 (r301007) +++ head/sys/dev/ath/if_ath_debug.h Tue May 31 04:09:17 2016 (r301008) @@ -69,6 +69,7 @@ enum { ATH_DEBUG_NODE_PWRSAVE = 0x800000000ULL, /* node powersave */ ATH_DEBUG_DIVERSITY = 0x1000000000ULL, /* Diversity logic */ ATH_DEBUG_PWRSAVE = 0x2000000000ULL, + ATH_DEBUG_BTCOEX = 0x4000000000ULL, /* BT Coex */ ATH_DEBUG_ANY = 0xffffffffffffffffULL }; @@ -92,9 +93,9 @@ enum { extern uint64_t ath_debug; #define IFF_DUMPPKTS(sc, m) (sc->sc_debug & (m)) -#define DPRINTF(sc, m, fmt, ...) do { \ +#define DPRINTF(sc, m, ...) do { \ if (sc->sc_debug & (m)) \ - device_printf(sc->sc_dev, fmt, __VA_ARGS__); \ + device_printf(sc->sc_dev, __VA_ARGS__); \ } while (0) #define KEYPRINTF(sc, ix, hk, mac) do { \ if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \ From owner-svn-src-head@freebsd.org Tue May 31 04:10:17 2016 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 3D715B55933; Tue, 31 May 2016 04:10:17 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id E87E11DC8; Tue, 31 May 2016 04:10:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4AGpA018162; Tue, 31 May 2016 04:10:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4AGAa018161; Tue, 31 May 2016 04:10:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310410.u4V4AGAa018161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 04:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301009 - head/sys/dev/hyperv/vmbus 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.22 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: Tue, 31 May 2016 04:10:17 -0000 Author: sephe Date: Tue May 31 04:10:15 2016 New Revision: 301009 URL: https://svnweb.freebsd.org/changeset/base/301009 Log: hyperv/vmbus: Process event timer before checking events And update comment. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6600 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 04:09:17 2016 (r301008) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 04:10:15 2016 (r301009) @@ -124,33 +124,22 @@ handled: } } -/** - * @brief Interrupt filter routine for VMBUS. - * - * The purpose of this routine is to determine the type of VMBUS protocol - * message to process - an event or a channel message. - */ static inline int hv_vmbus_isr(struct vmbus_softc *sc, struct trapframe *frame, int cpu) { hv_vmbus_message *msg, *msg_base; - /* - * The Windows team has advised that we check for events - * before checking for messages. This is the way they do it - * in Windows when running as a guest in Hyper-V - */ - sc->vmbus_event_proc(sc, cpu); - - /* Check if there are actual msgs to be process */ msg_base = VMBUS_PCPU_GET(sc, message, cpu); - /* we call eventtimer process the message */ + /* + * Check event timer. + * + * TODO: move this to independent IDT vector. + */ msg = msg_base + VMBUS_SINT_TIMER; if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { msg->header.message_type = HV_MESSAGE_TYPE_NONE; - /* call intrrupt handler of event timer */ vmbus_et_intr(frame); /* @@ -175,8 +164,20 @@ hv_vmbus_isr(struct vmbus_softc *sc, str } } + /* + * Check events. Hot path for network and storage I/O data; high rate. + * + * NOTE: + * As recommended by the Windows guest fellows, we check events before + * checking messages. + */ + sc->vmbus_event_proc(sc, cpu); + + /* + * Check messages. Mainly management stuffs; ultra low rate. + */ msg = msg_base + VMBUS_SINT_MESSAGE; - if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { + if (__predict_false(msg->header.message_type != HV_MESSAGE_TYPE_NONE)) { taskqueue_enqueue(VMBUS_PCPU_GET(sc, message_tq, cpu), VMBUS_PCPU_PTR(sc, message_task, cpu)); } From owner-svn-src-head@freebsd.org Tue May 31 04:12:16 2016 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 68858B55B2E; Tue, 31 May 2016 04:12:16 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 425AB11F8; Tue, 31 May 2016 04:12:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4CFPM021525; Tue, 31 May 2016 04:12:15 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4CEh4021513; Tue, 31 May 2016 04:12:14 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605310412.u4V4CEh4021513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 31 May 2016 04:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys ... 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.22 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: Tue, 31 May 2016 04:12:16 -0000 Author: allanjude Date: Tue May 31 04:12:14 2016 New Revision: 301010 URL: https://svnweb.freebsd.org/changeset/base/301010 Log: Connect the SHA-512t256 and Skein hashing algorithms to ZFS Support for the new hashing algorithms in ZFS was introduced in r289422 However it was disconnected because FreeBSD lacked implementations of SHA-512 (truncated to 256 bits), and Skein. These implementations were introduced in r300921 and r300966 respectively This commit connects them to ZFS and enabled these new checksum algorithms This new algorithms are not supported by the boot blocks, so do not use them on your root dataset if you boot from ZFS. Relnotes: yes Sponsored by: ScaleEngine Inc. Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c head/sys/conf/files head/sys/crypto/skein/skein_port.h head/sys/modules/zfs/Makefile Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue May 31 04:12:14 2016 (r301010) @@ -232,8 +232,6 @@ zpool_feature_init(void) "org.open-zfs:large_blocks", "large_blocks", "Support for blocks larger than 128KB.", ZFEATURE_FLAG_PER_DATASET, large_blocks_deps); - -#ifdef illumos zfeature_register(SPA_FEATURE_SHA512, "org.illumos:sha512", "sha512", "SHA-512/256 hash algorithm.", @@ -242,6 +240,8 @@ zpool_feature_init(void) "org.illumos:skein", "skein", "Skein hash algorithm.", ZFEATURE_FLAG_PER_DATASET, NULL); + +#ifdef illumos zfeature_register(SPA_FEATURE_EDONR, "org.illumos:edonr", "edonr", "Edon-R hash algorithm.", Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue May 31 04:12:14 2016 (r301010) @@ -52,9 +52,9 @@ typedef enum spa_feature { SPA_FEATURE_BOOKMARKS, SPA_FEATURE_FS_SS_LIMIT, SPA_FEATURE_LARGE_BLOCKS, -#ifdef illumos SPA_FEATURE_SHA512, SPA_FEATURE_SKEIN, +#ifdef illumos SPA_FEATURE_EDONR, #endif SPA_FEATURES Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue May 31 04:12:14 2016 (r301010) @@ -72,9 +72,9 @@ zfs_prop_init(void) { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 }, { "sha256", ZIO_CHECKSUM_SHA256 }, { "noparity", ZIO_CHECKSUM_NOPARITY }, -#ifdef illumos { "sha512", ZIO_CHECKSUM_SHA512 }, { "skein", ZIO_CHECKSUM_SKEIN }, +#ifdef illumos { "edonr", ZIO_CHECKSUM_EDONR }, #endif { NULL } @@ -87,13 +87,13 @@ zfs_prop_init(void) { "sha256", ZIO_CHECKSUM_SHA256 }, { "sha256,verify", ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY }, -#ifdef illumos { "sha512", ZIO_CHECKSUM_SHA512 }, { "sha512,verify", ZIO_CHECKSUM_SHA512 | ZIO_CHECKSUM_VERIFY }, { "skein", ZIO_CHECKSUM_SKEIN }, { "skein,verify", ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY }, +#ifdef illumos { "edonr,verify", ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY }, #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Tue May 31 04:12:14 2016 (r301010) @@ -74,6 +74,7 @@ ZFS_COMMON_OBJS += \ rrwlock.o \ sa.o \ sha256.o \ + skein_zfs.o \ spa.o \ spa_config.o \ spa_errlog.o \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Tue May 31 04:12:14 2016 (r301010) @@ -29,8 +29,10 @@ #include #ifdef _KERNEL #include +#include #else #include +#include #endif /*ARGSUSED*/ @@ -58,17 +60,16 @@ zio_checksum_SHA256(const void *buf, uin zcp->zc_word[3] = BE_64(tmp.zc_word[3]); } -#ifdef illumos /*ARGSUSED*/ void zio_checksum_SHA512_native(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { - SHA2_CTX ctx; + SHA512_CTX ctx; - SHA2Init(SHA512_256, &ctx); - SHA2Update(&ctx, buf, size); - SHA2Final(zcp, &ctx); + SHA512_256_Init(&ctx); + SHA512_256_Update(&ctx, buf, size); + SHA512_256_Final((unsigned char *)zcp, &ctx); } /*ARGSUSED*/ @@ -84,4 +85,3 @@ zio_checksum_SHA512_byteswap(const void zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); } -#endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c Tue May 31 04:12:14 2016 (r301010) @@ -23,7 +23,11 @@ */ #include #include -#include +#ifdef _KERNEL +#include +#else +#include +#endif /* * Computes a native 256-bit skein MAC checksum. Please note that this Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue May 31 04:12:14 2016 (r301010) @@ -82,9 +82,9 @@ enum zio_checksum { ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, ZIO_CHECKSUM_NOPARITY, -#ifdef illumos ZIO_CHECKSUM_SHA512, ZIO_CHECKSUM_SKEIN, +#ifdef illumos ZIO_CHECKSUM_EDONR, #endif ZIO_CHECKSUM_FUNCTIONS Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h Tue May 31 04:12:14 2016 (r301010) @@ -82,7 +82,6 @@ extern zio_checksum_info_t zio_checksum_ * Checksum routines. */ extern zio_checksum_t zio_checksum_SHA256; -#ifdef illumos extern zio_checksum_t zio_checksum_SHA512_native; extern zio_checksum_t zio_checksum_SHA512_byteswap; @@ -92,6 +91,7 @@ extern zio_checksum_t zio_checksum_skein extern zio_checksum_tmpl_init_t zio_checksum_skein_tmpl_init; extern zio_checksum_tmpl_free_t zio_checksum_skein_tmpl_free; +#ifdef illumos /* Edon-R */ extern zio_checksum_t zio_checksum_edonr_native; extern zio_checksum_t zio_checksum_edonr_byteswap; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Tue May 31 04:10:15 2016 (r301009) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Tue May 31 04:12:14 2016 (r301010) @@ -123,7 +123,6 @@ zio_checksum_info_t zio_checksum_table[Z NULL, NULL, ZCHECKSUM_FLAG_EMBEDDED, "zilog2"}, {{zio_checksum_off, zio_checksum_off}, NULL, NULL, 0, "noparity"}, -#ifdef illumos {{zio_checksum_SHA512_native, zio_checksum_SHA512_byteswap}, NULL, NULL, ZCHECKSUM_FLAG_METADATA | ZCHECKSUM_FLAG_DEDUP | ZCHECKSUM_FLAG_NOPWRITE, "sha512"}, @@ -131,6 +130,7 @@ zio_checksum_info_t zio_checksum_table[Z zio_checksum_skein_tmpl_init, zio_checksum_skein_tmpl_free, ZCHECKSUM_FLAG_METADATA | ZCHECKSUM_FLAG_DEDUP | ZCHECKSUM_FLAG_SALTED | ZCHECKSUM_FLAG_NOPWRITE, "skein"}, +#ifdef illumos {{zio_checksum_edonr_native, zio_checksum_edonr_byteswap}, zio_checksum_edonr_tmpl_init, zio_checksum_edonr_tmpl_free, ZCHECKSUM_FLAG_METADATA | ZCHECKSUM_FLAG_SALTED | @@ -145,7 +145,6 @@ zio_checksum_info_t zio_checksum_table[Z spa_feature_t zio_checksum_to_feature(enum zio_checksum cksum) { -#ifdef illumos VERIFY((cksum & ~ZIO_CHECKSUM_MASK) == 0); switch (cksum) { @@ -153,10 +152,11 @@ zio_checksum_to_feature(enum zio_checksu return (SPA_FEATURE_SHA512); case ZIO_CHECKSUM_SKEIN: return (SPA_FEATURE_SKEIN); +#ifdef illumos case ZIO_CHECKSUM_EDONR: return (SPA_FEATURE_EDONR); - } #endif + } return (SPA_FEATURE_NONE); } Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 31 04:10:15 2016 (r301009) +++ head/sys/conf/files Tue May 31 04:12:14 2016 (r301010) @@ -197,6 +197,7 @@ cddl/contrib/opensolaris/uts/common/fs/z cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c optional zfs compile-with "${ZFS_C}" @@ -577,6 +578,8 @@ crypto/sha1.c optional carp | crypto | crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random !random_loadable | \ sctp | zfs crypto/sha2/sha512c.c optional crypto | geom_bde | ipsec | zfs +crypto/skein/skein.c optional crypto | zfs +crypto/skein/skein_block.c optional crypto | zfs crypto/siphash/siphash.c optional inet | inet6 crypto/siphash/siphash_test.c optional inet | inet6 ddb/db_access.c optional ddb Modified: head/sys/crypto/skein/skein_port.h ============================================================================== --- head/sys/crypto/skein/skein_port.h Tue May 31 04:10:15 2016 (r301009) +++ head/sys/crypto/skein/skein_port.h Tue May 31 04:12:14 2016 (r301010) @@ -19,7 +19,9 @@ #include #include +#ifndef _OPENSOLARIS_SYS_TYPES_H_ /* Avoid redefining this typedef */ typedef unsigned int uint_t; /* native unsigned integer */ +#endif typedef u_int8_t u08b_t; /* 8-bit unsigned integer */ typedef u_int32_t uint_32t; /* 32-bit unsigned integer */ typedef u_int64_t u64b_t; /* 64-bit unsigned integer */ Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Tue May 31 04:10:15 2016 (r301009) +++ head/sys/modules/zfs/Makefile Tue May 31 04:12:14 2016 (r301010) @@ -70,6 +70,9 @@ SRCS+= zutil.c .PATH: ${SYSDIR}/crypto/sha2 SRCS+= sha256c.c sha512c.c +.PATH: ${SYSDIR}/crypto/skein +SRCS+= skein.c skein_block.c + .PATH: ${SUNW}/common/zfs .include "${SUNW}/uts/common/Makefile.files" .PATH: ${SUNW}/uts/common/fs/zfs From owner-svn-src-head@freebsd.org Tue May 31 04:12:57 2016 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 32254B55C0B; Tue, 31 May 2016 04:12:57 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 02AE3143F; Tue, 31 May 2016 04:12:56 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4CuYJ021605; Tue, 31 May 2016 04:12:56 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4Cul9021604; Tue, 31 May 2016 04:12:56 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605310412.u4V4Cul9021604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 31 May 2016 04:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301011 - head/sys/sys 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.22 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: Tue, 31 May 2016 04:12:57 -0000 Author: allanjude Date: Tue May 31 04:12:55 2016 New Revision: 301011 URL: https://svnweb.freebsd.org/changeset/base/301011 Log: Bump __FreeBSD_version for ZFS's support for SHA-512t256 and Skein Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue May 31 04:12:14 2016 (r301010) +++ head/sys/sys/param.h Tue May 31 04:12:55 2016 (r301011) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100115 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100116 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue May 31 04:17:19 2016 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 2DF78B55CFF; Tue, 31 May 2016 04:17:19 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id DA707175F; Tue, 31 May 2016 04:17:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4HIaV021895; Tue, 31 May 2016 04:17:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4HIXl021894; Tue, 31 May 2016 04:17:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605310417.u4V4HIXl021894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 04:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301012 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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: Tue, 31 May 2016 04:17:19 -0000 Author: adrian Date: Tue May 31 04:17:17 2016 New Revision: 301012 URL: https://svnweb.freebsd.org/changeset/base/301012 Log: [ath] ensure the right methods / options get overridden for MCI bluetooth coex It turns out that the srev checks can't be done in the early attach in ar9300_freebsd.c, because the poweron and srev check hasn't yet happened. So: * Re-add the MCI overrides in attach * Add QCA9565 (Aphrodite) check for the LNA diversity stuff. Tested: * QCA9565, STA mode + bluetooth Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Tue May 31 04:12:55 2016 (r301011) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Tue May 31 04:17:17 2016 (r301012) @@ -723,10 +723,10 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC #if ATH_SUPPORT_MCI if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) { -#if 0 - ah->ah_bt_coex_set_weights = ar9300_mci_bt_coex_set_weights; - ah->ah_bt_coex_disable = ar9300_mci_bt_coex_disable; - ah->ah_bt_coex_enable = ar9300_mci_bt_coex_enable; +#if 1 + ah->ah_btCoexSetWeights = ar9300_mci_bt_coex_set_weights; + ah->ah_btCoexDisable = ar9300_mci_bt_coex_disable; + ah->ah_btCoexEnable = ar9300_mci_bt_coex_enable; #endif ahp->ah_mci_ready = AH_FALSE; ahp->ah_mci_bt_state = MCI_BT_SLEEP; @@ -3033,7 +3033,7 @@ ar9300_fill_capability_info(struct ath_h /* XXX is this a flag, or a chainmask number? */ p_cap->halApmEnable = !! ar9300_eeprom_get(ahp, EEP_CHAIN_MASK_REDUCE); #if ATH_ANT_DIV_COMB - if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON_11_OR_LATER(ah)) { + if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON_11_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { if (ahp->ah_diversity_control == HAL_ANT_VARIABLE) { u_int8_t ant_div_control1 = ar9300_eeprom_get(ahp, EEP_ANTDIV_control); From owner-svn-src-head@freebsd.org Tue May 31 04:35:27 2016 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 7AEEFB55188; Tue, 31 May 2016 04:35:27 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 4773112B0; Tue, 31 May 2016 04:35:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4ZQJa029892; Tue, 31 May 2016 04:35:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4ZQgx029891; Tue, 31 May 2016 04:35:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605310435.u4V4ZQgx029891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 04:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301013 - head/sys/dev/ath/ath_hal 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.22 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: Tue, 31 May 2016 04:35:27 -0000 Author: adrian Date: Tue May 31 04:35:26 2016 New Revision: 301013 URL: https://svnweb.freebsd.org/changeset/base/301013 Log: [ath_hal] add bluetooth coexistence definitions for both legacy and MCI. The legacy bits are just from ah.h; the MCI bits are from the ar9300 HAL "freebsd" extras. A subsequent commit will include ah_btcoex.h into ah.h and remove the older defintions. Added: head/sys/dev/ath/ath_hal/ah_btcoex.h (contents, props changed) Added: head/sys/dev/ath/ath_hal/ah_btcoex.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_btcoex.h Tue May 31 04:35:26 2016 (r301013) @@ -0,0 +1,503 @@ +/* + * Copyright (c) 2014 Qualcomm Atheros, Inc. + * All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef __ATH_HAL_BTCOEX_H__ +#define __ATH_HAL_BTCOEX_H__ + +/* + * General BT coexistence definitions. + */ +typedef enum { + HAL_BT_MODULE_CSR_BC4 = 0, /* CSR BlueCore v4 */ + HAL_BT_MODULE_JANUS = 1, /* Kite + Valkyrie combo */ + HAL_BT_MODULE_HELIUS = 2, /* Kiwi + Valkyrie combo */ + HAL_MAX_BT_MODULES +} HAL_BT_MODULE; + +typedef struct { + HAL_BT_MODULE bt_module; + u_int8_t bt_coex_config; + u_int8_t bt_gpio_bt_active; + u_int8_t bt_gpio_bt_priority; + u_int8_t bt_gpio_wlan_active; + u_int8_t bt_active_polarity; + HAL_BOOL bt_single_ant; + u_int8_t bt_dutyCycle; + u_int8_t bt_isolation; + u_int8_t bt_period; +} HAL_BT_COEX_INFO; + +typedef enum { + HAL_BT_COEX_MODE_LEGACY = 0, /* legacy rx_clear mode */ + HAL_BT_COEX_MODE_UNSLOTTED = 1, /* untimed/unslotted mode */ + HAL_BT_COEX_MODE_SLOTTED = 2, /* slotted mode */ + HAL_BT_COEX_MODE_DISALBED = 3, /* coexistence disabled */ +} HAL_BT_COEX_MODE; + +typedef enum { + HAL_BT_COEX_CFG_NONE, /* No bt coex enabled */ + HAL_BT_COEX_CFG_2WIRE_2CH, /* 2-wire with 2 chains */ + HAL_BT_COEX_CFG_2WIRE_CH1, /* 2-wire with ch1 */ + HAL_BT_COEX_CFG_2WIRE_CH0, /* 2-wire with ch0 */ + HAL_BT_COEX_CFG_3WIRE, /* 3-wire */ + HAL_BT_COEX_CFG_MCI /* MCI */ +} HAL_BT_COEX_CFG; + +typedef enum { + HAL_BT_COEX_SET_ACK_PWR = 0, /* Change ACK power setting */ + HAL_BT_COEX_LOWER_TX_PWR, /* Change transmit power */ + HAL_BT_COEX_ANTENNA_DIVERSITY, /* Enable RX diversity for Kite */ + HAL_BT_COEX_MCI_MAX_TX_PWR, /* Set max tx power for concurrent tx */ + HAL_BT_COEX_MCI_FTP_STOMP_RX, /* Use a different weight for stomp low */ +} HAL_BT_COEX_SET_PARAMETER; + +/* + * MCI specific coexistence definitions. + */ + +#define HAL_BT_COEX_FLAG_LOW_ACK_PWR 0x00000001 +#define HAL_BT_COEX_FLAG_LOWER_TX_PWR 0x00000002 +/* Check Rx Diversity is allowed */ +#define HAL_BT_COEX_FLAG_ANT_DIV_ALLOW 0x00000004 +/* Check Diversity is on or off */ +#define HAL_BT_COEX_FLAG_ANT_DIV_ENABLE 0x00000008 + +#define HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE 0x0b +/* main: LNA1, alt: LNA2 */ +#define HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE 0x09 +#define HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_A 0x04 +#define HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_A 0x09 +#define HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B 0x02 +#define HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B 0x06 + +#define HAL_BT_COEX_ISOLATION_FOR_NO_COEX 30 + +#define HAL_BT_COEX_ANT_DIV_SWITCH_COM 0x66666666 + +#define HAL_BT_COEX_HELIUS_CHAINMASK 0x02 + +#define HAL_BT_COEX_LOW_ACK_POWER 0x0 +#define HAL_BT_COEX_HIGH_ACK_POWER 0x3f3f3f + +typedef enum { + HAL_BT_COEX_NO_STOMP = 0, + HAL_BT_COEX_STOMP_ALL, + HAL_BT_COEX_STOMP_LOW, + HAL_BT_COEX_STOMP_NONE, + HAL_BT_COEX_STOMP_ALL_FORCE, + HAL_BT_COEX_STOMP_LOW_FORCE, +} HAL_BT_COEX_STOMP_TYPE; + +typedef struct { + /* extend rx_clear after tx/rx to protect the burst (in usec). */ + u_int8_t bt_time_extend; + + /* + * extend rx_clear as long as txsm is + * transmitting or waiting for ack. + */ + HAL_BOOL bt_txstate_extend; + + /* + * extend rx_clear so that when tx_frame + * is asserted, rx_clear will drop. + */ + HAL_BOOL bt_txframe_extend; + + /* + * coexistence mode + */ + HAL_BT_COEX_MODE bt_mode; + + /* + * treat BT high priority traffic as + * a quiet collision + */ + HAL_BOOL bt_quiet_collision; + + /* + * invert rx_clear as WLAN_ACTIVE + */ + HAL_BOOL bt_rxclear_polarity; + + /* + * slotted mode only. indicate the time in usec + * from the rising edge of BT_ACTIVE to the time + * BT_PRIORITY can be sampled to indicate priority. + */ + u_int8_t bt_priority_time; + + /* + * slotted mode only. indicate the time in usec + * from the rising edge of BT_ACTIVE to the time + * BT_PRIORITY can be sampled to indicate tx/rx and + * BT_FREQ is sampled. + */ + u_int8_t bt_first_slot_time; + + /* + * slotted mode only. rx_clear and bt_ant decision + * will be held the entire time that BT_ACTIVE is asserted, + * otherwise the decision is made before every slot boundary. + */ + HAL_BOOL bt_hold_rxclear; +} HAL_BT_COEX_CONFIG; + +#define HAL_BT_COEX_FLAG_LOW_ACK_PWR 0x00000001 +#define HAL_BT_COEX_FLAG_LOWER_TX_PWR 0x00000002 +#define HAL_BT_COEX_FLAG_ANT_DIV_ALLOW 0x00000004 /* Check Rx Diversity is allowed */ +#define HAL_BT_COEX_FLAG_ANT_DIV_ENABLE 0x00000008 /* Check Diversity is on or off */ +#define HAL_BT_COEX_FLAG_MCI_MAX_TX_PWR 0x00000010 +#define HAL_BT_COEX_FLAG_MCI_FTP_STOMP_RX 0x00000020 + +#define HAL_MCI_FLAG_DISABLE_TIMESTAMP 0x00000001 /* Disable time stamp */ + +typedef enum mci_message_header { + MCI_LNA_CTRL = 0x10, /* len = 0 */ + MCI_CONT_NACK = 0x20, /* len = 0 */ + MCI_CONT_INFO = 0x30, /* len = 4 */ + MCI_CONT_RST = 0x40, /* len = 0 */ + MCI_SCHD_INFO = 0x50, /* len = 16 */ + MCI_CPU_INT = 0x60, /* len = 4 */ + MCI_SYS_WAKING = 0x70, /* len = 0 */ + MCI_GPM = 0x80, /* len = 16 */ + MCI_LNA_INFO = 0x90, /* len = 1 */ + MCI_LNA_STATE = 0x94, + MCI_LNA_TAKE = 0x98, + MCI_LNA_TRANS = 0x9c, + MCI_SYS_SLEEPING = 0xa0, /* len = 0 */ + MCI_REQ_WAKE = 0xc0, /* len = 0 */ + MCI_DEBUG_16 = 0xfe, /* len = 2 */ + MCI_REMOTE_RESET = 0xff /* len = 16 */ +} MCI_MESSAGE_HEADER; + +/* Default remote BT device MCI COEX version */ +#define MCI_GPM_COEX_MAJOR_VERSION_DEFAULT 3 +#define MCI_GPM_COEX_MINOR_VERSION_DEFAULT 0 +/* Local WLAN MCI COEX version */ +#define MCI_GPM_COEX_MAJOR_VERSION_WLAN 3 +#define MCI_GPM_COEX_MINOR_VERSION_WLAN 0 + +typedef enum mci_gpm_subtype { + MCI_GPM_BT_CAL_REQ = 0, + MCI_GPM_BT_CAL_GRANT = 1, + MCI_GPM_BT_CAL_DONE = 2, + MCI_GPM_WLAN_CAL_REQ = 3, + MCI_GPM_WLAN_CAL_GRANT = 4, + MCI_GPM_WLAN_CAL_DONE = 5, + MCI_GPM_COEX_AGENT = 0x0C, + MCI_GPM_RSVD_PATTERN = 0xFE, + MCI_GPM_RSVD_PATTERN32 = 0xFEFEFEFE, + MCI_GPM_BT_DEBUG = 0xFF +} MCI_GPM_SUBTYPE_T; + +typedef enum mci_gpm_coex_opcode { + MCI_GPM_COEX_VERSION_QUERY = 0, + MCI_GPM_COEX_VERSION_RESPONSE = 1, + MCI_GPM_COEX_STATUS_QUERY = 2, + MCI_GPM_COEX_HALT_BT_GPM = 3, + MCI_GPM_COEX_WLAN_CHANNELS = 4, + MCI_GPM_COEX_BT_PROFILE_INFO = 5, + MCI_GPM_COEX_BT_STATUS_UPDATE = 6, + MCI_GPM_COEX_BT_UPDATE_FLAGS = 7 +} MCI_GPM_COEX_OPCODE_T; + +typedef enum mci_gpm_coex_query_type { + /* WLAN information */ + MCI_GPM_COEX_QUERY_WLAN_ALL_INFO = 0x01, + /* BT information */ + MCI_GPM_COEX_QUERY_BT_ALL_INFO = 0x01, + MCI_GPM_COEX_QUERY_BT_TOPOLOGY = 0x02, + MCI_GPM_COEX_QUERY_BT_DEBUG = 0x04 +} MCI_GPM_COEX_QUERY_TYPE_T; + +typedef enum mci_gpm_coex_halt_bt_gpm { + MCI_GPM_COEX_BT_GPM_UNHALT = 0, + MCI_GPM_COEX_BT_GPM_HALT = 1 +} MCI_GPM_COEX_HALT_BT_GPM_T; + +typedef enum mci_gpm_coex_profile_type { + MCI_GPM_COEX_PROFILE_UNKNOWN = 0, + MCI_GPM_COEX_PROFILE_RFCOMM = 1, + MCI_GPM_COEX_PROFILE_A2DP = 2, + MCI_GPM_COEX_PROFILE_HID = 3, + MCI_GPM_COEX_PROFILE_BNEP = 4, + MCI_GPM_COEX_PROFILE_VOICE = 5, + MCI_GPM_COEX_PROFILE_MAX +} MCI_GPM_COEX_PROFILE_TYPE_T; + +typedef enum mci_gpm_coex_profile_state { + MCI_GPM_COEX_PROFILE_STATE_END = 0, + MCI_GPM_COEX_PROFILE_STATE_START = 1 +} MCI_GPM_COEX_PROFILE_STATE_T; + +typedef enum mci_gpm_coex_profile_role { + MCI_GPM_COEX_PROFILE_SLAVE = 0, + MCI_GPM_COEX_PROFILE_MASTER = 1 +} MCI_GPM_COEX_PROFILE_ROLE_T; + +typedef enum mci_gpm_coex_bt_status_type { + MCI_GPM_COEX_BT_NONLINK_STATUS = 0, + MCI_GPM_COEX_BT_LINK_STATUS = 1 +} MCI_GPM_COEX_BT_STATUS_TYPE_T; + +typedef enum mci_gpm_coex_bt_status_state { + MCI_GPM_COEX_BT_NORMAL_STATUS = 0, + MCI_GPM_COEX_BT_CRITICAL_STATUS = 1 +} MCI_GPM_COEX_BT_STATUS_STATE_T; + +#define MCI_GPM_INVALID_PROFILE_HANDLE 0xff + +typedef enum mci_gpm_coex_bt_updata_flags_op { + MCI_GPM_COEX_BT_FLAGS_READ = 0x00, + MCI_GPM_COEX_BT_FLAGS_SET = 0x01, + MCI_GPM_COEX_BT_FLAGS_CLEAR = 0x02 +} MCI_GPM_COEX_BT_FLAGS_OP_T; + +/* MCI GPM/Coex opcode/type definitions */ +enum { + MCI_GPM_COEX_W_GPM_PAYLOAD = 1, + MCI_GPM_COEX_B_GPM_TYPE = 4, + MCI_GPM_COEX_B_GPM_OPCODE = 5, + /* MCI_GPM_WLAN_CAL_REQ, MCI_GPM_WLAN_CAL_DONE */ + MCI_GPM_WLAN_CAL_W_SEQUENCE = 2, + /* MCI_GPM_COEX_VERSION_QUERY */ + /* MCI_GPM_COEX_VERSION_RESPONSE */ + MCI_GPM_COEX_B_MAJOR_VERSION = 6, + MCI_GPM_COEX_B_MINOR_VERSION = 7, + /* MCI_GPM_COEX_STATUS_QUERY */ + MCI_GPM_COEX_B_BT_BITMAP = 6, + MCI_GPM_COEX_B_WLAN_BITMAP = 7, + /* MCI_GPM_COEX_HALT_BT_GPM */ + MCI_GPM_COEX_B_HALT_STATE = 6, + /* MCI_GPM_COEX_WLAN_CHANNELS */ + MCI_GPM_COEX_B_CHANNEL_MAP = 6, + /* MCI_GPM_COEX_BT_PROFILE_INFO */ + MCI_GPM_COEX_B_PROFILE_TYPE = 6, + MCI_GPM_COEX_B_PROFILE_LINKID = 7, + MCI_GPM_COEX_B_PROFILE_STATE = 8, + MCI_GPM_COEX_B_PROFILE_ROLE = 9, + MCI_GPM_COEX_B_PROFILE_RATE = 10, + MCI_GPM_COEX_B_PROFILE_VOTYPE = 11, + MCI_GPM_COEX_H_PROFILE_T = 12, + MCI_GPM_COEX_B_PROFILE_W = 14, + MCI_GPM_COEX_B_PROFILE_A = 15, + /* MCI_GPM_COEX_BT_STATUS_UPDATE */ + MCI_GPM_COEX_B_STATUS_TYPE = 6, + MCI_GPM_COEX_B_STATUS_LINKID = 7, + MCI_GPM_COEX_B_STATUS_STATE = 8, + /* MCI_GPM_COEX_BT_UPDATE_FLAGS */ + MCI_GPM_COEX_B_BT_FLAGS_OP = 10, + MCI_GPM_COEX_W_BT_FLAGS = 6 +}; + +#define MCI_GPM_RECYCLE(_p_gpm) \ + { \ + *(((u_int32_t *)(_p_gpm)) + MCI_GPM_COEX_W_GPM_PAYLOAD) = MCI_GPM_RSVD_PATTERN32; \ + } +#define MCI_GPM_TYPE(_p_gpm) \ + (*(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) & 0xff) +#define MCI_GPM_OPCODE(_p_gpm) \ + (*(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_OPCODE) & 0xff) + +#define MCI_GPM_SET_CAL_TYPE(_p_gpm, _cal_type) \ + { \ + *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) = (_cal_type) & 0xff; \ + } +#define MCI_GPM_SET_TYPE_OPCODE(_p_gpm, _type, _opcode) \ + { \ + *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) = (_type) & 0xff; \ + *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_OPCODE) = (_opcode) & 0xff; \ + } +#define MCI_GPM_IS_CAL_TYPE(_type) ((_type) <= MCI_GPM_WLAN_CAL_DONE) + +#define MCI_NUM_BT_CHANNELS 79 + +#define MCI_GPM_SET_CHANNEL_BIT(_p_gpm, _bt_chan) \ + { \ + if (_bt_chan < MCI_NUM_BT_CHANNELS) { \ + *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_CHANNEL_MAP + \ + (_bt_chan / 8)) |= 1 << (_bt_chan & 7); \ + } \ + } + +#define MCI_GPM_CLR_CHANNEL_BIT(_p_gpm, _bt_chan) \ + { \ + if (_bt_chan < MCI_NUM_BT_CHANNELS) { \ + *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_CHANNEL_MAP + \ + (_bt_chan / 8)) &= ~(1 << (_bt_chan & 7)); \ + } \ + } + +#define HAL_MCI_INTERRUPT_SW_MSG_DONE 0x00000001 +#define HAL_MCI_INTERRUPT_CPU_INT_MSG 0x00000002 +#define HAL_MCI_INTERRUPT_RX_CHKSUM_FAIL 0x00000004 +#define HAL_MCI_INTERRUPT_RX_INVALID_HDR 0x00000008 +#define HAL_MCI_INTERRUPT_RX_HW_MSG_FAIL 0x00000010 +#define HAL_MCI_INTERRUPT_RX_SW_MSG_FAIL 0x00000020 +#define HAL_MCI_INTERRUPT_TX_HW_MSG_FAIL 0x00000080 +#define HAL_MCI_INTERRUPT_TX_SW_MSG_FAIL 0x00000100 +#define HAL_MCI_INTERRUPT_RX_MSG 0x00000200 +#define HAL_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE 0x00000400 +#define HAL_MCI_INTERRUPT_CONT_INFO_TIMEOUT 0x80000000 +#define HAL_MCI_INTERRUPT_MSG_FAIL_MASK ( HAL_MCI_INTERRUPT_RX_HW_MSG_FAIL | \ + HAL_MCI_INTERRUPT_RX_SW_MSG_FAIL | \ + HAL_MCI_INTERRUPT_TX_HW_MSG_FAIL | \ + HAL_MCI_INTERRUPT_TX_SW_MSG_FAIL ) + +#define HAL_MCI_INTERRUPT_RX_MSG_REMOTE_RESET 0x00000001 +#define HAL_MCI_INTERRUPT_RX_MSG_LNA_CONTROL 0x00000002 +#define HAL_MCI_INTERRUPT_RX_MSG_CONT_NACK 0x00000004 +#define HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO 0x00000008 +#define HAL_MCI_INTERRUPT_RX_MSG_CONT_RST 0x00000010 +#define HAL_MCI_INTERRUPT_RX_MSG_SCHD_INFO 0x00000020 +#define HAL_MCI_INTERRUPT_RX_MSG_CPU_INT 0x00000040 +#define HAL_MCI_INTERRUPT_RX_MSG_GPM 0x00000100 +#define HAL_MCI_INTERRUPT_RX_MSG_LNA_INFO 0x00000200 +#define HAL_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING 0x00000400 +#define HAL_MCI_INTERRUPT_RX_MSG_SYS_WAKING 0x00000800 +#define HAL_MCI_INTERRUPT_RX_MSG_REQ_WAKE 0x00001000 +#define HAL_MCI_INTERRUPT_RX_MSG_MONITOR (HAL_MCI_INTERRUPT_RX_MSG_LNA_CONTROL | \ + HAL_MCI_INTERRUPT_RX_MSG_LNA_INFO | \ + HAL_MCI_INTERRUPT_RX_MSG_CONT_NACK | \ + HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO | \ + HAL_MCI_INTERRUPT_RX_MSG_CONT_RST) + +typedef enum mci_bt_state { + MCI_BT_SLEEP, + MCI_BT_AWAKE, + MCI_BT_CAL_START, + MCI_BT_CAL +} MCI_BT_STATE_T; + +/* Type of state query */ +typedef enum mci_state_type { + HAL_MCI_STATE_ENABLE, + HAL_MCI_STATE_INIT_GPM_OFFSET, + HAL_MCI_STATE_NEXT_GPM_OFFSET, + HAL_MCI_STATE_LAST_GPM_OFFSET, + HAL_MCI_STATE_BT, + HAL_MCI_STATE_SET_BT_SLEEP, + HAL_MCI_STATE_SET_BT_AWAKE, + HAL_MCI_STATE_SET_BT_CAL_START, + HAL_MCI_STATE_SET_BT_CAL, + HAL_MCI_STATE_LAST_SCHD_MSG_OFFSET, + HAL_MCI_STATE_REMOTE_SLEEP, + HAL_MCI_STATE_CONT_RSSI_POWER, + HAL_MCI_STATE_CONT_PRIORITY, + HAL_MCI_STATE_CONT_TXRX, + HAL_MCI_STATE_RESET_REQ_WAKE, + HAL_MCI_STATE_SEND_WLAN_COEX_VERSION, + HAL_MCI_STATE_SET_BT_COEX_VERSION, + HAL_MCI_STATE_SEND_WLAN_CHANNELS, + HAL_MCI_STATE_SEND_VERSION_QUERY, + HAL_MCI_STATE_SEND_STATUS_QUERY, + HAL_MCI_STATE_NEED_FLUSH_BT_INFO, + HAL_MCI_STATE_SET_CONCUR_TX_PRI, + HAL_MCI_STATE_RECOVER_RX, + HAL_MCI_STATE_NEED_FTP_STOMP, + HAL_MCI_STATE_NEED_TUNING, + HAL_MCI_STATE_SHARED_CHAIN_CONCUR_TX, + HAL_MCI_STATE_DEBUG, + HAL_MCI_STATE_MAX +} HAL_MCI_STATE_TYPE; + +#define HAL_MCI_STATE_DEBUG_REQ_BT_DEBUG 1 + +#define HAL_MCI_BT_MCI_FLAGS_UPDATE_CORR 0x00000002 +#define HAL_MCI_BT_MCI_FLAGS_UPDATE_HDR 0x00000004 +#define HAL_MCI_BT_MCI_FLAGS_UPDATE_PLD 0x00000008 +#define HAL_MCI_BT_MCI_FLAGS_LNA_CTRL 0x00000010 +#define HAL_MCI_BT_MCI_FLAGS_DEBUG 0x00000020 +#define HAL_MCI_BT_MCI_FLAGS_SCHED_MSG 0x00000040 +#define HAL_MCI_BT_MCI_FLAGS_CONT_MSG 0x00000080 +#define HAL_MCI_BT_MCI_FLAGS_COEX_GPM 0x00000100 +#define HAL_MCI_BT_MCI_FLAGS_CPU_INT_MSG 0x00000200 +#define HAL_MCI_BT_MCI_FLAGS_MCI_MODE 0x00000400 +#define HAL_MCI_BT_MCI_FLAGS_EGRET_MODE 0x00000800 +#define HAL_MCI_BT_MCI_FLAGS_JUPITER_MODE 0x00001000 +#define HAL_MCI_BT_MCI_FLAGS_OTHER 0x00010000 + +#define HAL_MCI_DEFAULT_BT_MCI_FLAGS 0x00011dde +/* + HAL_MCI_BT_MCI_FLAGS_UPDATE_CORR = 1 + HAL_MCI_BT_MCI_FLAGS_UPDATE_HDR = 1 + HAL_MCI_BT_MCI_FLAGS_UPDATE_PLD = 1 + HAL_MCI_BT_MCI_FLAGS_LNA_CTRL = 1 + HAL_MCI_BT_MCI_FLAGS_DEBUG = 0 + HAL_MCI_BT_MCI_FLAGS_SCHED_MSG = 1 + HAL_MCI_BT_MCI_FLAGS_CONT_MSG = 1 + HAL_MCI_BT_MCI_FLAGS_COEX_GPM = 1 + HAL_MCI_BT_MCI_FLAGS_CPU_INT_MSG = 0 + HAL_MCI_BT_MCI_FLAGS_MCI_MODE = 1 + HAL_MCI_BT_MCI_FLAGS_EGRET_MODE = 1 + HAL_MCI_BT_MCI_FLAGS_JUPITER_MODE = 1 + HAL_MCI_BT_MCI_FLAGS_OTHER = 1 +*/ + +#define HAL_MCI_TOGGLE_BT_MCI_FLAGS \ + ( HAL_MCI_BT_MCI_FLAGS_UPDATE_CORR | \ + HAL_MCI_BT_MCI_FLAGS_UPDATE_HDR | \ + HAL_MCI_BT_MCI_FLAGS_UPDATE_PLD | \ + HAL_MCI_BT_MCI_FLAGS_MCI_MODE ) + +#define HAL_MCI_2G_FLAGS_CLEAR_MASK 0x00000000 +#define HAL_MCI_2G_FLAGS_SET_MASK HAL_MCI_TOGGLE_BT_MCI_FLAGS +#define HAL_MCI_2G_FLAGS HAL_MCI_DEFAULT_BT_MCI_FLAGS + +#define HAL_MCI_5G_FLAGS_CLEAR_MASK HAL_MCI_TOGGLE_BT_MCI_FLAGS +#define HAL_MCI_5G_FLAGS_SET_MASK 0x00000000 +#define HAL_MCI_5G_FLAGS (HAL_MCI_DEFAULT_BT_MCI_FLAGS & \ + ~HAL_MCI_TOGGLE_BT_MCI_FLAGS) + +#define HAL_MCI_GPM_NOMORE 0 +#define HAL_MCI_GPM_MORE 1 +#define HAL_MCI_GPM_INVALID 0xffffffff + +#define ATH_AIC_MAX_BT_CHANNEL 79 + +/* + * Default value for Jupiter is 0x00002201 + * Default value for Aphrodite is 0x00002282 + */ +#define ATH_MCI_CONFIG_CONCUR_TX 0x00000003 +#define ATH_MCI_CONFIG_MCI_OBS_MCI 0x00000004 +#define ATH_MCI_CONFIG_MCI_OBS_TXRX 0x00000008 +#define ATH_MCI_CONFIG_MCI_OBS_BT 0x00000010 +#define ATH_MCI_CONFIG_DISABLE_MCI_CAL 0x00000020 +#define ATH_MCI_CONFIG_DISABLE_OSLA 0x00000040 +#define ATH_MCI_CONFIG_DISABLE_FTP_STOMP 0x00000080 +#define ATH_MCI_CONFIG_AGGR_THRESH 0x00000700 +#define ATH_MCI_CONFIG_AGGR_THRESH_S 8 +#define ATH_MCI_CONFIG_DISABLE_AGGR_THRESH 0x00000800 +#define ATH_MCI_CONFIG_CLK_DIV 0x00003000 +#define ATH_MCI_CONFIG_CLK_DIV_S 12 +#define ATH_MCI_CONFIG_DISABLE_TUNING 0x00004000 +#define ATH_MCI_CONFIG_MCI_WEIGHT_DBG 0x40000000 +#define ATH_MCI_CONFIG_DISABLE_MCI 0x80000000 + +#define ATH_MCI_CONFIG_MCI_OBS_MASK ( ATH_MCI_CONFIG_MCI_OBS_MCI | \ + ATH_MCI_CONFIG_MCI_OBS_TXRX | \ + ATH_MCI_CONFIG_MCI_OBS_BT ) +#define ATH_MCI_CONFIG_MCI_OBS_GPIO 0x0000002F + +#define ATH_MCI_CONCUR_TX_SHARED_CHN 0x01 +#define ATH_MCI_CONCUR_TX_UNSHARED_CHN 0x02 +#define ATH_MCI_CONCUR_TX_DEBUG 0x03 + +#endif From owner-svn-src-head@freebsd.org Tue May 31 04:44:01 2016 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 9375AB5532D; Tue, 31 May 2016 04:44:01 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 654AB186E; Tue, 31 May 2016 04:44:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4i0Sb033716; Tue, 31 May 2016 04:44:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4i05d033714; Tue, 31 May 2016 04:44:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605310444.u4V4i05d033714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 04:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301014 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal 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.22 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: Tue, 31 May 2016 04:44:01 -0000 Author: adrian Date: Tue May 31 04:44:00 2016 New Revision: 301014 URL: https://svnweb.freebsd.org/changeset/base/301014 Log: [ath_hal] migrate the bluetooth definitions out from ah.h / ar9300_freebsd_inc.h. The eventual MCI driver side of things needs the MCI bits to live in the HAL API so we can get to them. Tested: * QCA9565, STA mode + bluetooth Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h Tue May 31 04:35:26 2016 (r301013) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h Tue May 31 04:44:00 2016 (r301014) @@ -161,23 +161,6 @@ struct dfs_bin5pulse { u_int32_t b5_rssimargin; /* rssi threshold margin. In Turbo Mode HW reports rssi 3dB */ }; -#if 0 -/* SPECTRAL SCAN defines begin */ -typedef struct { - u_int16_t ss_fft_period; /* Skip interval for FFT reports */ - u_int16_t ss_period; /* Spectral scan period */ - u_int16_t ss_count; /* # of reports to return from ss_active */ - u_int16_t ss_short_report;/* Set to report ony 1 set of FFT results */ - u_int8_t radar_bin_thresh_sel; - u_int16_t ss_spectral_pri; /* are we doing a noise power cal ? */ - int8_t ss_nf_cal[AH_MAX_CHAINS*2]; /* nf calibrated values for ctl+ext from eeprom */ - int8_t ss_nf_pwr[AH_MAX_CHAINS*2]; /* nf pwr values for ctl+ext from eeprom */ - int32_t ss_nf_temp_data; /* temperature data taken during nf scan */ -} HAL_SPECTRAL_PARAM; -#define HAL_SPECTRAL_PARAM_NOVAL 0xFFFF -#define HAL_SPECTRAL_PARAM_ENABLE 0x8000 /* Enable/Disable if applicable */ -#endif - /* * Noise power data definitions * units are: 4 x dBm - NOISE_PWR_DATA_OFFSET (e.g. -25 = (-25/4 - 90) = -96.25 dBm) @@ -199,13 +182,6 @@ typedef struct halvowstats { u_int32_t ext_cycle_count; } HAL_VOWSTATS; -#define HAL_BT_COEX_FLAG_LOW_ACK_PWR 0x00000001 -#define HAL_BT_COEX_FLAG_LOWER_TX_PWR 0x00000002 -#define HAL_BT_COEX_FLAG_ANT_DIV_ALLOW 0x00000004 /* Check Rx Diversity is allowed */ -#define HAL_BT_COEX_FLAG_ANT_DIV_ENABLE 0x00000008 /* Check Diversity is on or off */ -#define HAL_BT_COEX_FLAG_MCI_MAX_TX_PWR 0x00000010 -#define HAL_BT_COEX_FLAG_MCI_FTP_STOMP_RX 0x00000020 - /* * Weight table configurations. */ @@ -260,339 +236,6 @@ typedef struct halvowstats { #define HAL_MCI_FLAG_DISABLE_TIMESTAMP 0x00000001 /* Disable time stamp */ -typedef enum mci_message_header { - MCI_LNA_CTRL = 0x10, /* len = 0 */ - MCI_CONT_NACK = 0x20, /* len = 0 */ - MCI_CONT_INFO = 0x30, /* len = 4 */ - MCI_CONT_RST = 0x40, /* len = 0 */ - MCI_SCHD_INFO = 0x50, /* len = 16 */ - MCI_CPU_INT = 0x60, /* len = 4 */ - MCI_SYS_WAKING = 0x70, /* len = 0 */ - MCI_GPM = 0x80, /* len = 16 */ - MCI_LNA_INFO = 0x90, /* len = 1 */ - MCI_LNA_STATE = 0x94, - MCI_LNA_TAKE = 0x98, - MCI_LNA_TRANS = 0x9c, - MCI_SYS_SLEEPING = 0xa0, /* len = 0 */ - MCI_REQ_WAKE = 0xc0, /* len = 0 */ - MCI_DEBUG_16 = 0xfe, /* len = 2 */ - MCI_REMOTE_RESET = 0xff /* len = 16 */ -} MCI_MESSAGE_HEADER; - -/* Default remote BT device MCI COEX version */ -#define MCI_GPM_COEX_MAJOR_VERSION_DEFAULT 3 -#define MCI_GPM_COEX_MINOR_VERSION_DEFAULT 0 -/* Local WLAN MCI COEX version */ -#define MCI_GPM_COEX_MAJOR_VERSION_WLAN 3 -#define MCI_GPM_COEX_MINOR_VERSION_WLAN 0 - -typedef enum mci_gpm_subtype { - MCI_GPM_BT_CAL_REQ = 0, - MCI_GPM_BT_CAL_GRANT = 1, - MCI_GPM_BT_CAL_DONE = 2, - MCI_GPM_WLAN_CAL_REQ = 3, - MCI_GPM_WLAN_CAL_GRANT = 4, - MCI_GPM_WLAN_CAL_DONE = 5, - MCI_GPM_COEX_AGENT = 0x0C, - MCI_GPM_RSVD_PATTERN = 0xFE, - MCI_GPM_RSVD_PATTERN32 = 0xFEFEFEFE, - MCI_GPM_BT_DEBUG = 0xFF -} MCI_GPM_SUBTYPE_T; - -typedef enum mci_gpm_coex_opcode { - MCI_GPM_COEX_VERSION_QUERY = 0, - MCI_GPM_COEX_VERSION_RESPONSE = 1, - MCI_GPM_COEX_STATUS_QUERY = 2, - MCI_GPM_COEX_HALT_BT_GPM = 3, - MCI_GPM_COEX_WLAN_CHANNELS = 4, - MCI_GPM_COEX_BT_PROFILE_INFO = 5, - MCI_GPM_COEX_BT_STATUS_UPDATE = 6, - MCI_GPM_COEX_BT_UPDATE_FLAGS = 7 -} MCI_GPM_COEX_OPCODE_T; - -typedef enum mci_gpm_coex_query_type { - /* WLAN information */ - MCI_GPM_COEX_QUERY_WLAN_ALL_INFO = 0x01, - /* BT information */ - MCI_GPM_COEX_QUERY_BT_ALL_INFO = 0x01, - MCI_GPM_COEX_QUERY_BT_TOPOLOGY = 0x02, - MCI_GPM_COEX_QUERY_BT_DEBUG = 0x04 -} MCI_GPM_COEX_QUERY_TYPE_T; - -typedef enum mci_gpm_coex_halt_bt_gpm { - MCI_GPM_COEX_BT_GPM_UNHALT = 0, - MCI_GPM_COEX_BT_GPM_HALT = 1 -} MCI_GPM_COEX_HALT_BT_GPM_T; - -typedef enum mci_gpm_coex_profile_type { - MCI_GPM_COEX_PROFILE_UNKNOWN = 0, - MCI_GPM_COEX_PROFILE_RFCOMM = 1, - MCI_GPM_COEX_PROFILE_A2DP = 2, - MCI_GPM_COEX_PROFILE_HID = 3, - MCI_GPM_COEX_PROFILE_BNEP = 4, - MCI_GPM_COEX_PROFILE_VOICE = 5, - MCI_GPM_COEX_PROFILE_MAX -} MCI_GPM_COEX_PROFILE_TYPE_T; - -typedef enum mci_gpm_coex_profile_state { - MCI_GPM_COEX_PROFILE_STATE_END = 0, - MCI_GPM_COEX_PROFILE_STATE_START = 1 -} MCI_GPM_COEX_PROFILE_STATE_T; - -typedef enum mci_gpm_coex_profile_role { - MCI_GPM_COEX_PROFILE_SLAVE = 0, - MCI_GPM_COEX_PROFILE_MASTER = 1 -} MCI_GPM_COEX_PROFILE_ROLE_T; - -typedef enum mci_gpm_coex_bt_status_type { - MCI_GPM_COEX_BT_NONLINK_STATUS = 0, - MCI_GPM_COEX_BT_LINK_STATUS = 1 -} MCI_GPM_COEX_BT_STATUS_TYPE_T; - -typedef enum mci_gpm_coex_bt_status_state { - MCI_GPM_COEX_BT_NORMAL_STATUS = 0, - MCI_GPM_COEX_BT_CRITICAL_STATUS = 1 -} MCI_GPM_COEX_BT_STATUS_STATE_T; - -#define MCI_GPM_INVALID_PROFILE_HANDLE 0xff - -typedef enum mci_gpm_coex_bt_updata_flags_op { - MCI_GPM_COEX_BT_FLAGS_READ = 0x00, - MCI_GPM_COEX_BT_FLAGS_SET = 0x01, - MCI_GPM_COEX_BT_FLAGS_CLEAR = 0x02 -} MCI_GPM_COEX_BT_FLAGS_OP_T; - -/* MCI GPM/Coex opcode/type definitions */ -enum { - MCI_GPM_COEX_W_GPM_PAYLOAD = 1, - MCI_GPM_COEX_B_GPM_TYPE = 4, - MCI_GPM_COEX_B_GPM_OPCODE = 5, - /* MCI_GPM_WLAN_CAL_REQ, MCI_GPM_WLAN_CAL_DONE */ - MCI_GPM_WLAN_CAL_W_SEQUENCE = 2, - /* MCI_GPM_COEX_VERSION_QUERY */ - /* MCI_GPM_COEX_VERSION_RESPONSE */ - MCI_GPM_COEX_B_MAJOR_VERSION = 6, - MCI_GPM_COEX_B_MINOR_VERSION = 7, - /* MCI_GPM_COEX_STATUS_QUERY */ - MCI_GPM_COEX_B_BT_BITMAP = 6, - MCI_GPM_COEX_B_WLAN_BITMAP = 7, - /* MCI_GPM_COEX_HALT_BT_GPM */ - MCI_GPM_COEX_B_HALT_STATE = 6, - /* MCI_GPM_COEX_WLAN_CHANNELS */ - MCI_GPM_COEX_B_CHANNEL_MAP = 6, - /* MCI_GPM_COEX_BT_PROFILE_INFO */ - MCI_GPM_COEX_B_PROFILE_TYPE = 6, - MCI_GPM_COEX_B_PROFILE_LINKID = 7, - MCI_GPM_COEX_B_PROFILE_STATE = 8, - MCI_GPM_COEX_B_PROFILE_ROLE = 9, - MCI_GPM_COEX_B_PROFILE_RATE = 10, - MCI_GPM_COEX_B_PROFILE_VOTYPE = 11, - MCI_GPM_COEX_H_PROFILE_T = 12, - MCI_GPM_COEX_B_PROFILE_W = 14, - MCI_GPM_COEX_B_PROFILE_A = 15, - /* MCI_GPM_COEX_BT_STATUS_UPDATE */ - MCI_GPM_COEX_B_STATUS_TYPE = 6, - MCI_GPM_COEX_B_STATUS_LINKID = 7, - MCI_GPM_COEX_B_STATUS_STATE = 8, - /* MCI_GPM_COEX_BT_UPDATE_FLAGS */ - MCI_GPM_COEX_B_BT_FLAGS_OP = 10, - MCI_GPM_COEX_W_BT_FLAGS = 6 -}; - -#define MCI_GPM_RECYCLE(_p_gpm) \ - { \ - *(((u_int32_t *)(_p_gpm)) + MCI_GPM_COEX_W_GPM_PAYLOAD) = MCI_GPM_RSVD_PATTERN32; \ - } -#define MCI_GPM_TYPE(_p_gpm) \ - (*(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) & 0xff) -#define MCI_GPM_OPCODE(_p_gpm) \ - (*(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_OPCODE) & 0xff) - -#define MCI_GPM_SET_CAL_TYPE(_p_gpm, _cal_type) \ - { \ - *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) = (_cal_type) & 0xff; \ - } -#define MCI_GPM_SET_TYPE_OPCODE(_p_gpm, _type, _opcode) \ - { \ - *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) = (_type) & 0xff; \ - *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_OPCODE) = (_opcode) & 0xff; \ - } -#define MCI_GPM_IS_CAL_TYPE(_type) ((_type) <= MCI_GPM_WLAN_CAL_DONE) - -#define MCI_NUM_BT_CHANNELS 79 - -#define MCI_GPM_SET_CHANNEL_BIT(_p_gpm, _bt_chan) \ - { \ - if (_bt_chan < MCI_NUM_BT_CHANNELS) { \ - *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_CHANNEL_MAP + \ - (_bt_chan / 8)) |= 1 << (_bt_chan & 7); \ - } \ - } - -#define MCI_GPM_CLR_CHANNEL_BIT(_p_gpm, _bt_chan) \ - { \ - if (_bt_chan < MCI_NUM_BT_CHANNELS) { \ - *(((u_int8_t *)(_p_gpm)) + MCI_GPM_COEX_B_CHANNEL_MAP + \ - (_bt_chan / 8)) &= ~(1 << (_bt_chan & 7)); \ - } \ - } - -#define HAL_MCI_INTERRUPT_SW_MSG_DONE 0x00000001 -#define HAL_MCI_INTERRUPT_CPU_INT_MSG 0x00000002 -#define HAL_MCI_INTERRUPT_RX_CHKSUM_FAIL 0x00000004 -#define HAL_MCI_INTERRUPT_RX_INVALID_HDR 0x00000008 -#define HAL_MCI_INTERRUPT_RX_HW_MSG_FAIL 0x00000010 -#define HAL_MCI_INTERRUPT_RX_SW_MSG_FAIL 0x00000020 -#define HAL_MCI_INTERRUPT_TX_HW_MSG_FAIL 0x00000080 -#define HAL_MCI_INTERRUPT_TX_SW_MSG_FAIL 0x00000100 -#define HAL_MCI_INTERRUPT_RX_MSG 0x00000200 -#define HAL_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE 0x00000400 -#define HAL_MCI_INTERRUPT_CONT_INFO_TIMEOUT 0x80000000 -#define HAL_MCI_INTERRUPT_MSG_FAIL_MASK ( HAL_MCI_INTERRUPT_RX_HW_MSG_FAIL | \ - HAL_MCI_INTERRUPT_RX_SW_MSG_FAIL | \ - HAL_MCI_INTERRUPT_TX_HW_MSG_FAIL | \ - HAL_MCI_INTERRUPT_TX_SW_MSG_FAIL ) - -#define HAL_MCI_INTERRUPT_RX_MSG_REMOTE_RESET 0x00000001 -#define HAL_MCI_INTERRUPT_RX_MSG_LNA_CONTROL 0x00000002 -#define HAL_MCI_INTERRUPT_RX_MSG_CONT_NACK 0x00000004 -#define HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO 0x00000008 -#define HAL_MCI_INTERRUPT_RX_MSG_CONT_RST 0x00000010 -#define HAL_MCI_INTERRUPT_RX_MSG_SCHD_INFO 0x00000020 -#define HAL_MCI_INTERRUPT_RX_MSG_CPU_INT 0x00000040 -#define HAL_MCI_INTERRUPT_RX_MSG_GPM 0x00000100 -#define HAL_MCI_INTERRUPT_RX_MSG_LNA_INFO 0x00000200 -#define HAL_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING 0x00000400 -#define HAL_MCI_INTERRUPT_RX_MSG_SYS_WAKING 0x00000800 -#define HAL_MCI_INTERRUPT_RX_MSG_REQ_WAKE 0x00001000 -#define HAL_MCI_INTERRUPT_RX_MSG_MONITOR (HAL_MCI_INTERRUPT_RX_MSG_LNA_CONTROL | \ - HAL_MCI_INTERRUPT_RX_MSG_LNA_INFO | \ - HAL_MCI_INTERRUPT_RX_MSG_CONT_NACK | \ - HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO | \ - HAL_MCI_INTERRUPT_RX_MSG_CONT_RST) - -typedef enum mci_bt_state { - MCI_BT_SLEEP, - MCI_BT_AWAKE, - MCI_BT_CAL_START, - MCI_BT_CAL -} MCI_BT_STATE_T; - -/* Type of state query */ -typedef enum mci_state_type { - HAL_MCI_STATE_ENABLE, - HAL_MCI_STATE_INIT_GPM_OFFSET, - HAL_MCI_STATE_NEXT_GPM_OFFSET, - HAL_MCI_STATE_LAST_GPM_OFFSET, - HAL_MCI_STATE_BT, - HAL_MCI_STATE_SET_BT_SLEEP, - HAL_MCI_STATE_SET_BT_AWAKE, - HAL_MCI_STATE_SET_BT_CAL_START, - HAL_MCI_STATE_SET_BT_CAL, - HAL_MCI_STATE_LAST_SCHD_MSG_OFFSET, - HAL_MCI_STATE_REMOTE_SLEEP, - HAL_MCI_STATE_CONT_RSSI_POWER, - HAL_MCI_STATE_CONT_PRIORITY, - HAL_MCI_STATE_CONT_TXRX, - HAL_MCI_STATE_RESET_REQ_WAKE, - HAL_MCI_STATE_SEND_WLAN_COEX_VERSION, - HAL_MCI_STATE_SET_BT_COEX_VERSION, - HAL_MCI_STATE_SEND_WLAN_CHANNELS, - HAL_MCI_STATE_SEND_VERSION_QUERY, - HAL_MCI_STATE_SEND_STATUS_QUERY, - HAL_MCI_STATE_NEED_FLUSH_BT_INFO, - HAL_MCI_STATE_SET_CONCUR_TX_PRI, - HAL_MCI_STATE_RECOVER_RX, - HAL_MCI_STATE_NEED_FTP_STOMP, - HAL_MCI_STATE_NEED_TUNING, - HAL_MCI_STATE_SHARED_CHAIN_CONCUR_TX, - HAL_MCI_STATE_DEBUG, - HAL_MCI_STATE_MAX -} HAL_MCI_STATE_TYPE; - -#define HAL_MCI_STATE_DEBUG_REQ_BT_DEBUG 1 - -#define HAL_MCI_BT_MCI_FLAGS_UPDATE_CORR 0x00000002 -#define HAL_MCI_BT_MCI_FLAGS_UPDATE_HDR 0x00000004 -#define HAL_MCI_BT_MCI_FLAGS_UPDATE_PLD 0x00000008 -#define HAL_MCI_BT_MCI_FLAGS_LNA_CTRL 0x00000010 -#define HAL_MCI_BT_MCI_FLAGS_DEBUG 0x00000020 -#define HAL_MCI_BT_MCI_FLAGS_SCHED_MSG 0x00000040 -#define HAL_MCI_BT_MCI_FLAGS_CONT_MSG 0x00000080 -#define HAL_MCI_BT_MCI_FLAGS_COEX_GPM 0x00000100 -#define HAL_MCI_BT_MCI_FLAGS_CPU_INT_MSG 0x00000200 -#define HAL_MCI_BT_MCI_FLAGS_MCI_MODE 0x00000400 -#define HAL_MCI_BT_MCI_FLAGS_EGRET_MODE 0x00000800 -#define HAL_MCI_BT_MCI_FLAGS_JUPITER_MODE 0x00001000 -#define HAL_MCI_BT_MCI_FLAGS_OTHER 0x00010000 - -#define HAL_MCI_DEFAULT_BT_MCI_FLAGS 0x00011dde -/* - HAL_MCI_BT_MCI_FLAGS_UPDATE_CORR = 1 - HAL_MCI_BT_MCI_FLAGS_UPDATE_HDR = 1 - HAL_MCI_BT_MCI_FLAGS_UPDATE_PLD = 1 - HAL_MCI_BT_MCI_FLAGS_LNA_CTRL = 1 - HAL_MCI_BT_MCI_FLAGS_DEBUG = 0 - HAL_MCI_BT_MCI_FLAGS_SCHED_MSG = 1 - HAL_MCI_BT_MCI_FLAGS_CONT_MSG = 1 - HAL_MCI_BT_MCI_FLAGS_COEX_GPM = 1 - HAL_MCI_BT_MCI_FLAGS_CPU_INT_MSG = 0 - HAL_MCI_BT_MCI_FLAGS_MCI_MODE = 1 - HAL_MCI_BT_MCI_FLAGS_EGRET_MODE = 1 - HAL_MCI_BT_MCI_FLAGS_JUPITER_MODE = 1 - HAL_MCI_BT_MCI_FLAGS_OTHER = 1 -*/ - -#define HAL_MCI_TOGGLE_BT_MCI_FLAGS \ - ( HAL_MCI_BT_MCI_FLAGS_UPDATE_CORR | \ - HAL_MCI_BT_MCI_FLAGS_UPDATE_HDR | \ - HAL_MCI_BT_MCI_FLAGS_UPDATE_PLD | \ - HAL_MCI_BT_MCI_FLAGS_MCI_MODE ) - -#define HAL_MCI_2G_FLAGS_CLEAR_MASK 0x00000000 -#define HAL_MCI_2G_FLAGS_SET_MASK HAL_MCI_TOGGLE_BT_MCI_FLAGS -#define HAL_MCI_2G_FLAGS HAL_MCI_DEFAULT_BT_MCI_FLAGS - -#define HAL_MCI_5G_FLAGS_CLEAR_MASK HAL_MCI_TOGGLE_BT_MCI_FLAGS -#define HAL_MCI_5G_FLAGS_SET_MASK 0x00000000 -#define HAL_MCI_5G_FLAGS (HAL_MCI_DEFAULT_BT_MCI_FLAGS & \ - ~HAL_MCI_TOGGLE_BT_MCI_FLAGS) - -#define HAL_MCI_GPM_NOMORE 0 -#define HAL_MCI_GPM_MORE 1 -#define HAL_MCI_GPM_INVALID 0xffffffff - -#define ATH_AIC_MAX_BT_CHANNEL 79 - -/* - * Default value for Jupiter is 0x00002201 - * Default value for Aphrodite is 0x00002282 - */ -#define ATH_MCI_CONFIG_CONCUR_TX 0x00000003 -#define ATH_MCI_CONFIG_MCI_OBS_MCI 0x00000004 -#define ATH_MCI_CONFIG_MCI_OBS_TXRX 0x00000008 -#define ATH_MCI_CONFIG_MCI_OBS_BT 0x00000010 -#define ATH_MCI_CONFIG_DISABLE_MCI_CAL 0x00000020 -#define ATH_MCI_CONFIG_DISABLE_OSLA 0x00000040 -#define ATH_MCI_CONFIG_DISABLE_FTP_STOMP 0x00000080 -#define ATH_MCI_CONFIG_AGGR_THRESH 0x00000700 -#define ATH_MCI_CONFIG_AGGR_THRESH_S 8 -#define ATH_MCI_CONFIG_DISABLE_AGGR_THRESH 0x00000800 -#define ATH_MCI_CONFIG_CLK_DIV 0x00003000 -#define ATH_MCI_CONFIG_CLK_DIV_S 12 -#define ATH_MCI_CONFIG_DISABLE_TUNING 0x00004000 -#define ATH_MCI_CONFIG_MCI_WEIGHT_DBG 0x40000000 -#define ATH_MCI_CONFIG_DISABLE_MCI 0x80000000 - -#define ATH_MCI_CONFIG_MCI_OBS_MASK ( ATH_MCI_CONFIG_MCI_OBS_MCI | \ - ATH_MCI_CONFIG_MCI_OBS_TXRX | \ - ATH_MCI_CONFIG_MCI_OBS_BT ) -#define ATH_MCI_CONFIG_MCI_OBS_GPIO 0x0000002F - -#define ATH_MCI_CONCUR_TX_SHARED_CHN 0x01 -#define ATH_MCI_CONCUR_TX_UNSHARED_CHN 0x02 -#define ATH_MCI_CONCUR_TX_DEBUG 0x03 - /* * The values below come from the system team test result. * For Jupiter, BT tx power level is from 0(-20dBm) to 6(4dBm). Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue May 31 04:35:26 2016 (r301013) +++ head/sys/dev/ath/ath_hal/ah.h Tue May 31 04:44:00 2016 (r301014) @@ -1097,137 +1097,7 @@ typedef enum { /* * BT Co-existence definitions */ -typedef enum { - HAL_BT_MODULE_CSR_BC4 = 0, /* CSR BlueCore v4 */ - HAL_BT_MODULE_JANUS = 1, /* Kite + Valkyrie combo */ - HAL_BT_MODULE_HELIUS = 2, /* Kiwi + Valkyrie combo */ - HAL_MAX_BT_MODULES -} HAL_BT_MODULE; - -typedef struct { - HAL_BT_MODULE bt_module; - u_int8_t bt_coex_config; - u_int8_t bt_gpio_bt_active; - u_int8_t bt_gpio_bt_priority; - u_int8_t bt_gpio_wlan_active; - u_int8_t bt_active_polarity; - HAL_BOOL bt_single_ant; - u_int8_t bt_dutyCycle; - u_int8_t bt_isolation; - u_int8_t bt_period; -} HAL_BT_COEX_INFO; - -typedef enum { - HAL_BT_COEX_MODE_LEGACY = 0, /* legacy rx_clear mode */ - HAL_BT_COEX_MODE_UNSLOTTED = 1, /* untimed/unslotted mode */ - HAL_BT_COEX_MODE_SLOTTED = 2, /* slotted mode */ - HAL_BT_COEX_MODE_DISALBED = 3, /* coexistence disabled */ -} HAL_BT_COEX_MODE; - -typedef enum { - HAL_BT_COEX_CFG_NONE, /* No bt coex enabled */ - HAL_BT_COEX_CFG_2WIRE_2CH, /* 2-wire with 2 chains */ - HAL_BT_COEX_CFG_2WIRE_CH1, /* 2-wire with ch1 */ - HAL_BT_COEX_CFG_2WIRE_CH0, /* 2-wire with ch0 */ - HAL_BT_COEX_CFG_3WIRE, /* 3-wire */ - HAL_BT_COEX_CFG_MCI /* MCI */ -} HAL_BT_COEX_CFG; - -typedef enum { - HAL_BT_COEX_SET_ACK_PWR = 0, /* Change ACK power setting */ - HAL_BT_COEX_LOWER_TX_PWR, /* Change transmit power */ - HAL_BT_COEX_ANTENNA_DIVERSITY, /* Enable RX diversity for Kite */ - HAL_BT_COEX_MCI_MAX_TX_PWR, /* Set max tx power for concurrent tx */ - HAL_BT_COEX_MCI_FTP_STOMP_RX, /* Use a different weight for stomp low */ -} HAL_BT_COEX_SET_PARAMETER; - -#define HAL_BT_COEX_FLAG_LOW_ACK_PWR 0x00000001 -#define HAL_BT_COEX_FLAG_LOWER_TX_PWR 0x00000002 -/* Check Rx Diversity is allowed */ -#define HAL_BT_COEX_FLAG_ANT_DIV_ALLOW 0x00000004 -/* Check Diversity is on or off */ -#define HAL_BT_COEX_FLAG_ANT_DIV_ENABLE 0x00000008 - -#define HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE 0x0b -/* main: LNA1, alt: LNA2 */ -#define HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE 0x09 -#define HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_A 0x04 -#define HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_A 0x09 -#define HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B 0x02 -#define HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B 0x06 - -#define HAL_BT_COEX_ISOLATION_FOR_NO_COEX 30 - -#define HAL_BT_COEX_ANT_DIV_SWITCH_COM 0x66666666 - -#define HAL_BT_COEX_HELIUS_CHAINMASK 0x02 - -#define HAL_BT_COEX_LOW_ACK_POWER 0x0 -#define HAL_BT_COEX_HIGH_ACK_POWER 0x3f3f3f - -typedef enum { - HAL_BT_COEX_NO_STOMP = 0, - HAL_BT_COEX_STOMP_ALL, - HAL_BT_COEX_STOMP_LOW, - HAL_BT_COEX_STOMP_NONE, - HAL_BT_COEX_STOMP_ALL_FORCE, - HAL_BT_COEX_STOMP_LOW_FORCE, -} HAL_BT_COEX_STOMP_TYPE; - -typedef struct { - /* extend rx_clear after tx/rx to protect the burst (in usec). */ - u_int8_t bt_time_extend; - - /* - * extend rx_clear as long as txsm is - * transmitting or waiting for ack. - */ - HAL_BOOL bt_txstate_extend; - - /* - * extend rx_clear so that when tx_frame - * is asserted, rx_clear will drop. - */ - HAL_BOOL bt_txframe_extend; - - /* - * coexistence mode - */ - HAL_BT_COEX_MODE bt_mode; - - /* - * treat BT high priority traffic as - * a quiet collision - */ - HAL_BOOL bt_quiet_collision; - - /* - * invert rx_clear as WLAN_ACTIVE - */ - HAL_BOOL bt_rxclear_polarity; - - /* - * slotted mode only. indicate the time in usec - * from the rising edge of BT_ACTIVE to the time - * BT_PRIORITY can be sampled to indicate priority. - */ - u_int8_t bt_priority_time; - - /* - * slotted mode only. indicate the time in usec - * from the rising edge of BT_ACTIVE to the time - * BT_PRIORITY can be sampled to indicate tx/rx and - * BT_FREQ is sampled. - */ - u_int8_t bt_first_slot_time; - - /* - * slotted mode only. rx_clear and bt_ant decision - * will be held the entire time that BT_ACTIVE is asserted, - * otherwise the decision is made before every slot boundary. - */ - HAL_BOOL bt_hold_rxclear; -} HAL_BT_COEX_CONFIG; +#include "ath_hal/ah_btcoex.h" struct hal_bb_panic_info { u_int32_t status; From owner-svn-src-head@freebsd.org Tue May 31 04:47:54 2016 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 DA0F6B5546F; Tue, 31 May 2016 04:47:54 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id B373C1C54; Tue, 31 May 2016 04:47:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4lrcK033986; Tue, 31 May 2016 04:47:53 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4lr2x033980; Tue, 31 May 2016 04:47:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310447.u4V4lr2x033980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 04:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301015 - in head/sys: dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 x86/include 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.22 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: Tue, 31 May 2016 04:47:55 -0000 Author: sephe Date: Tue May 31 04:47:53 2016 New Revision: 301015 URL: https://svnweb.freebsd.org/changeset/base/301015 Log: hyperv/vmbus: Rename ISR functions MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6601 Modified: head/sys/dev/hyperv/vmbus/amd64/hv_vector.S head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/i386/hv_vector.S head/sys/dev/hyperv/vmbus/vmbus_var.h head/sys/x86/include/apicvar.h Modified: head/sys/dev/hyperv/vmbus/amd64/hv_vector.S ============================================================================== --- head/sys/dev/hyperv/vmbus/amd64/hv_vector.S Tue May 31 04:44:00 2016 (r301014) +++ head/sys/dev/hyperv/vmbus/amd64/hv_vector.S Tue May 31 04:47:53 2016 (r301015) @@ -37,10 +37,10 @@ */ .text SUPERALIGN_TEXT -IDTVEC(hv_vmbus_callback) +IDTVEC(vmbus_isr) PUSH_FRAME FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi - call hv_vector_handler + call vmbus_handle_intr MEXITCOUNT jmp doreti Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 04:44:00 2016 (r301014) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 04:47:53 2016 (r301015) @@ -72,7 +72,7 @@ struct vmbus_softc *vmbus_sc; static char *vmbus_ids[] = { "VMBUS", NULL }; -extern inthand_t IDTVEC(hv_vmbus_callback); +extern inthand_t IDTVEC(vmbus_isr); static void vmbus_msg_task(void *xsc, int pending __unused) @@ -124,8 +124,8 @@ handled: } } -static inline int -hv_vmbus_isr(struct vmbus_softc *sc, struct trapframe *frame, int cpu) +static __inline int +vmbus_handle_intr1(struct vmbus_softc *sc, struct trapframe *frame, int cpu) { hv_vmbus_message *msg, *msg_base; @@ -186,7 +186,7 @@ hv_vmbus_isr(struct vmbus_softc *sc, str } void -hv_vector_handler(struct trapframe *trap_frame) +vmbus_handle_intr(struct trapframe *trap_frame) { struct vmbus_softc *sc = vmbus_get_softc(); int cpu = curcpu; @@ -201,7 +201,7 @@ hv_vector_handler(struct trapframe *trap */ (*VMBUS_PCPU_GET(sc, intr_cnt, cpu))++; - hv_vmbus_isr(sc, trap_frame, cpu); + vmbus_handle_intr1(sc, trap_frame, cpu); /* * Enable preemption. @@ -411,7 +411,7 @@ vmbus_intr_setup(struct vmbus_softc *sc) * All Hyper-V ISR required resources are setup, now let's find a * free IDT vector for Hyper-V ISR and set it up. */ - sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); + sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(vmbus_isr)); if (sc->vmbus_idtvec < 0) { device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); return ENXIO; Modified: head/sys/dev/hyperv/vmbus/i386/hv_vector.S ============================================================================== --- head/sys/dev/hyperv/vmbus/i386/hv_vector.S Tue May 31 04:44:00 2016 (r301014) +++ head/sys/dev/hyperv/vmbus/i386/hv_vector.S Tue May 31 04:47:53 2016 (r301015) @@ -37,13 +37,13 @@ */ .text SUPERALIGN_TEXT -IDTVEC(hv_vmbus_callback) +IDTVEC(vmbus_isr) PUSH_FRAME SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp - call hv_vector_handler + call vmbus_handle_intr add $4, %esp MEXITCOUNT jmp doreti Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 31 04:44:00 2016 (r301014) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 31 04:47:53 2016 (r301015) @@ -97,6 +97,7 @@ struct trapframe; void vmbus_on_channel_open(const struct hv_vmbus_channel *); void vmbus_event_proc(struct vmbus_softc *, int); void vmbus_event_proc_compat(struct vmbus_softc *, int); +void vmbus_handle_intr(struct trapframe *); void vmbus_et_intr(struct trapframe *); Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Tue May 31 04:44:00 2016 (r301014) +++ head/sys/x86/include/apicvar.h Tue May 31 04:47:53 2016 (r301015) @@ -455,7 +455,6 @@ void lapic_handle_cmc(void); void lapic_handle_error(void); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); -void hv_vector_handler(struct trapframe *frame); extern int x2apic_mode; extern int lapic_eoi_suppression; From owner-svn-src-head@freebsd.org Tue May 31 04:59:01 2016 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 4D2C2B55620; Tue, 31 May 2016 04:59:01 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 0FD7B104F; Tue, 31 May 2016 04:59:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V4x00t037828; Tue, 31 May 2016 04:59:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V4x0Ln037827; Tue, 31 May 2016 04:59:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605310459.u4V4x0Ln037827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 04:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301016 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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: Tue, 31 May 2016 04:59:01 -0000 Author: adrian Date: Tue May 31 04:59:00 2016 New Revision: 301016 URL: https://svnweb.freebsd.org/changeset/base/301016 Log: [ath_hal] add QCA9565 and MCI related registers. This is required for upcoming MCI fixes. Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h Tue May 31 04:47:53 2016 (r301015) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h Tue May 31 04:59:00 2016 (r301016) @@ -2855,6 +2855,9 @@ enum { #define AR_BTCOEX_WL_WEIGHTS3 AR_WLAN_COEX_OFFSET(BTCOEX_WL_WEIGHTS3) #define AR_BTCOEX_MAX_TXPWR(_x) (AR_WLAN_COEX_OFFSET(BTCOEX_MAX_TXPWR) + ((_x) << 2)) #define AR_BTCOEX_WL_LNA AR_WLAN_COEX_OFFSET(BTCOEX_WL_LNA) +#define AR_BTCOEX_WL_LNA_TIMEOUT 0x003FFFFF +#define AR_BTCOEX_WL_LNA_TIMEOUT_S 0 + #define AR_BTCOEX_RFGAIN_CTRL AR_WLAN_COEX_OFFSET(BTCOEX_RFGAIN_CTRL) #define AR_BTCOEX_CTRL2 AR_WLAN_COEX_OFFSET(BTCOEX_CTRL2) @@ -2887,6 +2890,32 @@ enum { #define AR_BTCOEX_CTRL3_CONT_INFO_TIMEOUT 0x00000FFF #define AR_BTCOEX_CTRL3_CONT_INFO_TIMEOUT_S 0 +/* QCA9565 */ + +#define AR_BTCOEX_WL_LNADIV 0x1a64 +#define AR_BTCOEX_WL_LNADIV_PREDICTED_PERIOD 0x00003FFF +#define AR_BTCOEX_WL_LNADIV_PREDICTED_PERIOD_S 0 +#define AR_BTCOEX_WL_LNADIV_DPDT_IGNORE_PRIORITY 0x00004000 +#define AR_BTCOEX_WL_LNADIV_DPDT_IGNORE_PRIORITY_S 14 +#define AR_BTCOEX_WL_LNADIV_FORCE_ON 0x00008000 +#define AR_BTCOEX_WL_LNADIV_FORCE_ON_S 15 +#define AR_BTCOEX_WL_LNADIV_MODE_OPTION 0x00030000 +#define AR_BTCOEX_WL_LNADIV_MODE_OPTION_S 16 +#define AR_BTCOEX_WL_LNADIV_MODE 0x007c0000 +#define AR_BTCOEX_WL_LNADIV_MODE_S 18 +#define AR_BTCOEX_WL_LNADIV_ALLOWED_TX_ANTDIV_WL_TX_REQ 0x00800000 +#define AR_BTCOEX_WL_LNADIV_ALLOWED_TX_ANTDIV_WL_TX_REQ_S 23 +#define AR_BTCOEX_WL_LNADIV_DISABLE_TX_ANTDIV_ENABLE 0x01000000 +#define AR_BTCOEX_WL_LNADIV_DISABLE_TX_ANTDIV_ENABLE_S 24 +#define AR_BTCOEX_WL_LNADIV_CONTINUOUS_BT_ACTIVE_PROTECT 0x02000000 +#define AR_BTCOEX_WL_LNADIV_CONTINUOUS_BT_ACTIVE_PROTECT_S 25 +#define AR_BTCOEX_WL_LNADIV_BT_INACTIVE_THRESHOLD 0xFC000000 +#define AR_BTCOEX_WL_LNADIV_BT_INACTIVE_THRESHOLD_S 26 + +#define AR_MCI_MISC 0x1a74 +#define AR_MCI_MISC_HW_FIX_EN 0x00000001 +#define AR_MCI_MISC_HW_FIX_EN_S 0 + /****************************************************************************** * WLAN BT Global Register Map ******************************************************************************/ From owner-svn-src-head@freebsd.org Tue May 31 05:01:44 2016 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 4E239B556D7; Tue, 31 May 2016 05:01:44 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 1F29012E3; Tue, 31 May 2016 05:01:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V51hjK039277; Tue, 31 May 2016 05:01:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V51hxX039276; Tue, 31 May 2016 05:01:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310501.u4V51hxX039276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 05:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301017 - head/sys/dev/hyperv/vmbus/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.22 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: Tue, 31 May 2016 05:01:44 -0000 Author: sephe Date: Tue May 31 05:01:43 2016 New Revision: 301017 URL: https://svnweb.freebsd.org/changeset/base/301017 Log: hyperv/vmbus: Indentation cleanup No functional changes. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6602 Modified: head/sys/dev/hyperv/vmbus/i386/hv_vector.S Modified: head/sys/dev/hyperv/vmbus/i386/hv_vector.S ============================================================================== --- head/sys/dev/hyperv/vmbus/i386/hv_vector.S Tue May 31 04:59:00 2016 (r301016) +++ head/sys/dev/hyperv/vmbus/i386/hv_vector.S Tue May 31 05:01:43 2016 (r301017) @@ -35,15 +35,15 @@ * This is the Hyper-V vmbus channel direct callback interrupt. * Only used when it is running on Hyper-V. */ - .text - SUPERALIGN_TEXT + .text + SUPERALIGN_TEXT IDTVEC(vmbus_isr) - PUSH_FRAME - SET_KERNEL_SREGS - cld - FAKE_MCOUNT(TF_EIP(%esp)) - pushl %esp - call vmbus_handle_intr - add $4, %esp - MEXITCOUNT - jmp doreti + PUSH_FRAME + SET_KERNEL_SREGS + cld + FAKE_MCOUNT(TF_EIP(%esp)) + pushl %esp + call vmbus_handle_intr + add $4, %esp + MEXITCOUNT + jmp doreti From owner-svn-src-head@freebsd.org Tue May 31 05:08:37 2016 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 9E79EB55865 for ; Tue, 31 May 2016 05:08:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5400118E5 for ; Tue, 31 May 2016 05:08:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f68.google.com with SMTP id h68so8696028lfh.3 for ; Mon, 30 May 2016 22:08:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WocoCFMQv1T0yYeu22QGPc7uVuoFbJQXMVJW4pkqHng=; b=Ixk5TZ45Fwk73VHYCWl8JetSvjXiTuiMMqY4+v53DmkUxkG0Ui3Ikclw8xcmRrz++K KTMLvJd1JSa7Sfk0uYG4Wxfd7JmpqPp42fL5OEo0NWOm7wbt6mBXX6kP17gzts4TwY/i bT8E4TI0GCxrXjFryM7A3oWj0LP/YN4fACVKb5PZSB8RTGfw0UhEWuVEdVvKUFI0tmdm 01FCqRtCrI6cgwpNtD1Dxz4DfYK58kUgJNX/VqKyaygwav/R/O5LAif5pE5zCIf4Nwix K4tShjWnKEenvozIYErZhqk522RRXtNasmZReaWAKk1MPVbcJmVzfy8rTRELZLG/Xk8+ wYrQ== X-Gm-Message-State: ALyK8tJxlcWZDBW/4WH+W4HAx/A7kO3poGEoqADyZrECYbTp6Q3iOVRx7pPZ1TMLZlDKPw== X-Received: by 10.25.142.196 with SMTP id q187mr2874535lfd.11.1464670206237; Mon, 30 May 2016 21:50:06 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id f129sm5070556lff.10.2016.05.30.21.50.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 May 2016 21:50:05 -0700 (PDT) Subject: Re: svn commit: r300965 - head/lib/libc/stdlib To: Bruce Evans References: <201605291639.u4TGdSwq032144@repo.freebsd.org> <20160530122100.X924@besplex.bde.org> <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> <20160531130326.G1052@besplex.bde.org> Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Tue, 31 May 2016 07:50:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531130326.G1052@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 05:08:37 -0000 On 31.05.2016 6:42, Bruce Evans wrote: > > Er, I already said which types are better -- [u]int_fast32_t here. [u]int_fast32_t have _at_least_ 32 bits. int32_t in the initial PRNG can be changed since does not overflow and involve several calculations, but uint_fast32_t is needed just for two operations: *f += *r; i = (*f >> 1) & 0x7fffffff; We need to assign values from uint32_t to uint_fast32_t (since array size can't be changed), do this single operation fast and store them back into array of uint32_t. I doubt that much gain can comes from it and even pessimization in some cases. Better let compiler do its job here. From owner-svn-src-head@freebsd.org Tue May 31 05:10:21 2016 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 D0325B558AC; Tue, 31 May 2016 05:10:21 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id A2195195B; Tue, 31 May 2016 05:10:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V5AKcb041814; Tue, 31 May 2016 05:10:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V5AKfw041813; Tue, 31 May 2016 05:10:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310510.u4V5AKfw041813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 05:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301018 - head/sys/dev/hyperv/vmbus 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.22 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: Tue, 31 May 2016 05:10:21 -0000 Author: sephe Date: Tue May 31 05:10:20 2016 New Revision: 301018 URL: https://svnweb.freebsd.org/changeset/base/301018 Log: hyperv/vmbus: Move global vmbus id array to stack. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6603 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:01:43 2016 (r301017) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:10:20 2016 (r301018) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); struct vmbus_softc *vmbus_sc; -static char *vmbus_ids[] = { "VMBUS", NULL }; - extern inthand_t IDTVEC(vmbus_isr); static void @@ -569,7 +567,9 @@ hv_vmbus_child_device_unregister(struct static int vmbus_probe(device_t dev) { - if (ACPI_ID_PROBE(device_get_parent(dev), dev, vmbus_ids) == NULL || + char *id[] = { "VMBUS", NULL }; + + if (ACPI_ID_PROBE(device_get_parent(dev), dev, id) == NULL || device_get_unit(dev) != 0 || vm_guest != VM_GUEST_HV || (hyperv_features & CPUID_HV_MSR_SYNIC) == 0) return (ENXIO); From owner-svn-src-head@freebsd.org Tue May 31 05:18:57 2016 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 85075B55A0D; Tue, 31 May 2016 05:18:57 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 358A71D4F; Tue, 31 May 2016 05:18:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V5Iu19045760; Tue, 31 May 2016 05:18:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V5IufJ045757; Tue, 31 May 2016 05:18:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310518.u4V5IufJ045757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 05:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301019 - head/sys/dev/hyperv/vmbus 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.22 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: Tue, 31 May 2016 05:18:57 -0000 Author: sephe Date: Tue May 31 05:18:55 2016 New Revision: 301019 URL: https://svnweb.freebsd.org/changeset/base/301019 Log: hyperv/vmbus: Redefine SynIC message. - Avoid unnecessary indirection. - Avoid bit fields. - Use __packed. Reviewed by: Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6636 Added: head/sys/dev/hyperv/vmbus/vmbus_reg.h (contents, props changed) Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:10:20 2016 (r301018) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:18:55 2016 (r301019) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -76,7 +77,7 @@ static void vmbus_msg_task(void *xsc, int pending __unused) { struct vmbus_softc *sc = xsc; - hv_vmbus_message *msg; + volatile struct vmbus_message *msg; msg = VMBUS_PCPU_GET(sc, message, curcpu) + VMBUS_SINT_MESSAGE; for (;;) { @@ -84,10 +85,12 @@ vmbus_msg_task(void *xsc, int pending __ hv_vmbus_channel_msg_header *hdr; hv_vmbus_channel_msg_type msg_type; - if (msg->header.message_type == HV_MESSAGE_TYPE_NONE) + if (msg->msg_type == VMBUS_MSGTYPE_NONE) break; /* no message */ - hdr = (hv_vmbus_channel_msg_header *)msg->u.payload; + /* XXX: update messageHandler interface */ + hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, + msg->msg_data); msg_type = hdr->message_type; if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) { @@ -99,20 +102,20 @@ vmbus_msg_task(void *xsc, int pending __ if (entry->messageHandler) entry->messageHandler(hdr); handled: - msg->header.message_type = HV_MESSAGE_TYPE_NONE; + msg->msg_type = VMBUS_MSGTYPE_NONE; /* - * Make sure the write to message_type (ie set to - * HV_MESSAGE_TYPE_NONE) happens before we read the - * message_pending and EOMing. Otherwise, the EOMing will - * not deliver any more messages - * since there is no empty slot + * Make sure the write to msg_type (i.e. set to + * VMBUS_MSGTYPE_NONE) happens before we read the + * msg_flags and EOMing. Otherwise, the EOMing will + * not deliver any more messages since there is no + * empty slot * * NOTE: * mb() is used here, since atomic_thread_fence_seq_cst() * will become compiler fence on UP kernel. */ mb(); - if (msg->header.message_flags.u.message_pending) { + if (msg->msg_flags & VMBUS_MSGFLAG_PENDING) { /* * This will cause message queue rescan to possibly * deliver another msg from the hypervisor @@ -125,7 +128,8 @@ handled: static __inline int vmbus_handle_intr1(struct vmbus_softc *sc, struct trapframe *frame, int cpu) { - hv_vmbus_message *msg, *msg_base; + volatile struct vmbus_message *msg; + struct vmbus_message *msg_base; msg_base = VMBUS_PCPU_GET(sc, message, cpu); @@ -135,25 +139,24 @@ vmbus_handle_intr1(struct vmbus_softc *s * TODO: move this to independent IDT vector. */ msg = msg_base + VMBUS_SINT_TIMER; - if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { - msg->header.message_type = HV_MESSAGE_TYPE_NONE; + if (msg->msg_type == VMBUS_MSGTYPE_TIMER_EXPIRED) { + msg->msg_type = VMBUS_MSGTYPE_NONE; vmbus_et_intr(frame); /* - * Make sure the write to message_type (ie set to - * HV_MESSAGE_TYPE_NONE) happens before we read the - * message_pending and EOMing. Otherwise, the EOMing will - * not deliver any more messages - * since there is no empty slot + * Make sure the write to msg_type (i.e. set to + * VMBUS_MSGTYPE_NONE) happens before we read the + * msg_flags and EOMing. Otherwise, the EOMing will + * not deliver any more messages since there is no + * empty slot * * NOTE: * mb() is used here, since atomic_thread_fence_seq_cst() * will become compiler fence on UP kernel. */ mb(); - - if (msg->header.message_flags.u.message_pending) { + if (msg->msg_flags & VMBUS_MSGFLAG_PENDING) { /* * This will cause message queue rescan to possibly * deliver another msg from the hypervisor @@ -175,7 +178,7 @@ vmbus_handle_intr1(struct vmbus_softc *s * Check messages. Mainly management stuffs; ultra low rate. */ msg = msg_base + VMBUS_SINT_MESSAGE; - if (__predict_false(msg->header.message_type != HV_MESSAGE_TYPE_NONE)) { + if (__predict_false(msg->msg_type != VMBUS_MSGTYPE_NONE)) { taskqueue_enqueue(VMBUS_PCPU_GET(sc, message_tq, cpu), VMBUS_PCPU_PTR(sc, message_task, cpu)); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue May 31 05:10:20 2016 (r301018) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue May 31 05:18:55 2016 (r301019) @@ -251,44 +251,9 @@ typedef union _hv_vmbus_port_id { } u ; } hv_vmbus_port_id; -/* - * Define synthetic interrupt controller message flag - */ -typedef union { - uint8_t as_uint8_t; - struct { - uint8_t message_pending:1; - uint8_t reserved:7; - } u; -} hv_vmbus_msg_flags; - typedef uint64_t hv_vmbus_partition_id; /* - * Define synthetic interrupt controller message header - */ -typedef struct { - hv_vmbus_msg_type message_type; - uint8_t payload_size; - hv_vmbus_msg_flags message_flags; - uint8_t reserved[2]; - union { - hv_vmbus_partition_id sender; - hv_vmbus_port_id port; - } u; -} hv_vmbus_msg_header; - -/* - * Define synthetic interrupt controller message format - */ -typedef struct vmbus_message { - hv_vmbus_msg_header header; - union { - uint64_t payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; - } u ; -} hv_vmbus_message; - -/* * Maximum channels is determined by the size of the interrupt * page which is PAGE_SIZE. 1/2 of PAGE_SIZE is for * send endpoint interrupt and the other is receive Added: head/sys/dev/hyperv/vmbus/vmbus_reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/vmbus_reg.h Tue May 31 05:18:55 2016 (r301019) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VMBUS_REG_H_ +#define _VMBUS_REG_H_ + +#include + +/* + * Hyper-V SynIC message format. + */ + +#define VMBUS_MSG_DSIZE_MAX 240 +#define VMBUS_MSG_SIZE 256 + +struct vmbus_message { + uint32_t msg_type; /* VMBUS_MSGTYPE_ */ + uint8_t msg_dsize; /* data size */ + uint8_t msg_flags; /* VMBUS_MSGFLAG_ */ + uint16_t msg_rsvd; + uint64_t msg_id; + uint8_t msg_data[VMBUS_MSG_DSIZE_MAX]; +} __packed; +CTASSERT(sizeof(struct vmbus_message) == VMBUS_MSG_SIZE); + +#define VMBUS_MSGTYPE_NONE 0 +#define VMBUS_MSGTYPE_TIMER_EXPIRED 0x80000010 + +#define VMBUS_MSGFLAG_PENDING 0x01 + +#endif /* !_VMBUS_REG_H_ */ From owner-svn-src-head@freebsd.org Tue May 31 05:34:48 2016 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 25AF2B55D68; Tue, 31 May 2016 05:34:48 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id EABB8185B; Tue, 31 May 2016 05:34:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V5YlE8053092; Tue, 31 May 2016 05:34:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V5YlHx053091; Tue, 31 May 2016 05:34:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310534.u4V5YlHx053091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 05:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301020 - head/sys/dev/hyperv/vmbus 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.22 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: Tue, 31 May 2016 05:34:48 -0000 Author: sephe Date: Tue May 31 05:34:46 2016 New Revision: 301020 URL: https://svnweb.freebsd.org/changeset/base/301020 Log: hyperv/vmbus: White space cleanup No functional changes MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6637 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:18:55 2016 (r301019) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:34:46 2016 (r301020) @@ -455,16 +455,19 @@ vmbus_read_ivar(device_t dev, device_t c switch (index) { case HV_VMBUS_IVAR_TYPE: - *result = (uintptr_t) &child_dev_ctx->class_id; + *result = (uintptr_t)&child_dev_ctx->class_id; return (0); + case HV_VMBUS_IVAR_INSTANCE: - *result = (uintptr_t) &child_dev_ctx->device_id; + *result = (uintptr_t)&child_dev_ctx->device_id; return (0); + case HV_VMBUS_IVAR_DEVCTX: - *result = (uintptr_t) child_dev_ctx; + *result = (uintptr_t)child_dev_ctx; return (0); + case HV_VMBUS_IVAR_NODE: - *result = (uintptr_t) child_dev_ctx->device; + *result = (uintptr_t)child_dev_ctx->device; return (0); } return (ENOENT); From owner-svn-src-head@freebsd.org Tue May 31 05:44:00 2016 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 A7AE5B55EBC; Tue, 31 May 2016 05:44:00 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 667CE1C65; Tue, 31 May 2016 05:44:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V5hxhf056705; Tue, 31 May 2016 05:43:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V5hxYB056701; Tue, 31 May 2016 05:43:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310543.u4V5hxYB056701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 05:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301021 - in head/sys/dev/hyperv: include utilities vmbus 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.22 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: Tue, 31 May 2016 05:44:00 -0000 Author: sephe Date: Tue May 31 05:43:59 2016 New Revision: 301021 URL: https://svnweb.freebsd.org/changeset/base/301021 Log: hyperv: Move guid2str from vmbus file to hyperv file - Use uint8_t for GUID byte array. - Define GUID string length. - Break long lines. - Nuke unnecessary stack variable. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6640 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Tue May 31 05:34:46 2016 (r301020) +++ head/sys/dev/hyperv/include/hyperv.h Tue May 31 05:43:59 2016 (r301021) @@ -121,10 +121,12 @@ typedef uint8_t hv_bool_uint8_t; HV_ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT ) typedef struct hv_guid { - unsigned char data[16]; + uint8_t data[16]; } __packed hv_guid; -int snprintf_hv_guid(char *, size_t, const hv_guid *); +#define HYPERV_GUID_STRLEN 40 + +int hyperv_guid2str(const struct hv_guid *, char *, size_t); #define HV_NIC_GUID \ .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, \ Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Tue May 31 05:34:46 2016 (r301020) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Tue May 31 05:43:59 2016 (r301021) @@ -307,7 +307,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ char if_name[4]; - char buf[39]; + char buf[HYPERV_GUID_STRLEN]; device_t *devs; int devcnt; @@ -335,10 +335,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru /* Trying to find GUID of Network Device */ hv_dev = sc->hn_dev_obj; - snprintf_hv_guid(buf, sizeof(buf), &hv_dev->device_id); + hyperv_guid2str(&hv_dev->device_id, buf, sizeof(buf)); sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); - if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { + if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, + HYPERV_GUID_STRLEN - 1) == 0) { strcpy((char *)umsg->body.kvp_ip_val.adapter_id, if_name); break; } Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Tue May 31 05:34:46 2016 (r301020) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Tue May 31 05:43:59 2016 (r301021) @@ -202,6 +202,18 @@ hv_vmbus_signal_event(void *con_id) return (status); } +int +hyperv_guid2str(const struct hv_guid *guid, char *buf, size_t sz) +{ + const uint8_t *d = guid->data; + + return snprintf(buf, sz, "%02x%02x%02x%02x-" + "%02x%02x-%02x%02x-%02x%02x-" + "%02x%02x%02x%02x%02x%02x", + d[3], d[2], d[1], d[0], + d[5], d[4], d[7], d[6], d[8], d[9], + d[10], d[11], d[12], d[13], d[14], d[15]); +} static bool hyperv_identify(void) Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:34:46 2016 (r301020) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 31 05:43:59 2016 (r301021) @@ -490,18 +490,18 @@ vmbus_write_ivar(device_t dev, device_t static int vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) { - char guidbuf[40]; struct hv_device *dev_ctx = device_get_ivars(child); + char guidbuf[HYPERV_GUID_STRLEN]; if (dev_ctx == NULL) return (0); strlcat(buf, "classid=", buflen); - snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); + hyperv_guid2str(&dev_ctx->class_id, guidbuf, sizeof(guidbuf)); strlcat(buf, guidbuf, buflen); strlcat(buf, " deviceid=", buflen); - snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); + hyperv_guid2str(&dev_ctx->device_id, guidbuf, sizeof(guidbuf)); strlcat(buf, guidbuf, buflen); return (0); @@ -526,30 +526,19 @@ hv_vmbus_child_device_create(hv_guid typ } int -snprintf_hv_guid(char *buf, size_t sz, const hv_guid *guid) -{ - int cnt; - const unsigned char *d = guid->data; - - cnt = snprintf(buf, sz, - "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", - d[3], d[2], d[1], d[0], d[5], d[4], d[7], d[6], - d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); - return (cnt); -} - -int hv_vmbus_child_device_register(struct hv_device *child_dev) { - device_t child; + device_t child, parent; + parent = vmbus_get_device(); if (bootverbose) { - char name[40]; - snprintf_hv_guid(name, sizeof(name), &child_dev->class_id); - printf("VMBUS: Class ID: %s\n", name); + char name[HYPERV_GUID_STRLEN]; + + hyperv_guid2str(&child_dev->class_id, name, sizeof(name)); + device_printf(parent, "add device, classid: %s\n", name); } - child = device_add_child(vmbus_get_device(), NULL, -1); + child = device_add_child(parent, NULL, -1); child_dev->device = child; device_set_ivars(child, child_dev); From owner-svn-src-head@freebsd.org Tue May 31 05:53:13 2016 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 E354EB550C0; Tue, 31 May 2016 05:53:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id AC53F117B; Tue, 31 May 2016 05:53:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A31F2D64FE1; Tue, 31 May 2016 15:53:05 +1000 (AEST) Date: Tue, 31 May 2016 15:53:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300965 - head/lib/libc/stdlib In-Reply-To: Message-ID: <20160531152438.S1534@besplex.bde.org> References: <201605291639.u4TGdSwq032144@repo.freebsd.org> <20160530122100.X924@besplex.bde.org> <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> <20160531130326.G1052@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Jp1r1I4GX9VPI0hR0fIA:9 a=8koyKKvalQC48CK6:21 a=xtXk7xc7YLWh467y:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 05:53:14 -0000 On Tue, 31 May 2016, Andrey Chernov wrote: > On 31.05.2016 6:42, Bruce Evans wrote: >> >> Er, I already said which types are better -- [u]int_fast32_t here. > > [u]int_fast32_t have _at_least_ 32 bits. int32_t in the initial PRNG can > be changed since does not overflow and involve several calculations, but > uint_fast32_t is needed just for two operations: I think you mean a native uint32_t is needed for 2 operations. > *f += *r; > i = (*f >> 1) & 0x7fffffff; This takes 2 operations (add and shift) with native uint32_t. It takes 4 logical operations (maybe more physically, or less after optimization) with emulated uint32_t (add, mask to 32 bits (maybe move to another register to do this), shift, mask to 32 bits). When you write the final mask explicitly, it is to 31 bits and optimizing this away is especially easy in both cases. > We need to assign values from uint32_t to uint_fast32_t (since array > size can't be changed), FP code using double_t is similar: data in tables should normally be in doubles since double_t might be too much larger; data in function parameters is almost always in doubles since APIs are deficient and don't even support double_t as an arg; then it is best to assign to a double_t variable since if you just use the double then expressions using it will promote it to double_t but it is too easy to lose this expansion too early. It takes extra variables and a little more code for the assignments, but the extra variables are optimized away in cases where there is no expansion. > do this single operation fast and store them > back into array of uint32_t. I doubt that much gain can comes from it > and even pessimization in some cases. Better let compiler do its job here. It's never a pessimization if the compiler does its job. It is good to practice this on a simple 2-step operation. Think of a multi-step operation where each step requires clipping to 32 bits. Using uint32_t for the calculation is just a concise way of writing "& 0xffffffff" after every step (even ones that don't need it). It is difficult and sometimes impossible for the compiler to optimize away these masks across a large number of steps. Sometimes this is easy for the programmer. Bruce From owner-svn-src-head@freebsd.org Tue May 31 06:00:19 2016 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 4E525B55197; Tue, 31 May 2016 06:00:19 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 1BA6E1394; Tue, 31 May 2016 06:00:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V60Iw4060695; Tue, 31 May 2016 06:00:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V60Ipv060694; Tue, 31 May 2016 06:00:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605310600.u4V60Ipv060694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 31 May 2016 06:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301022 - head/sys/dev/hyperv/utilities 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.22 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: Tue, 31 May 2016 06:00:19 -0000 Author: sephe Date: Tue May 31 06:00:18 2016 New Revision: 301022 URL: https://svnweb.freebsd.org/changeset/base/301022 Log: hyperv/kvp: Use if_xname. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6641 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Tue May 31 05:43:59 2016 (r301021) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Tue May 31 06:00:18 2016 (r301022) @@ -58,7 +58,10 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include #include +#include #include #include @@ -306,7 +309,6 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru int UNUSED_FLAG = 1; struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ - char if_name[4]; char buf[HYPERV_GUID_STRLEN]; device_t *devs; @@ -336,11 +338,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru hv_dev = sc->hn_dev_obj; hyperv_guid2str(&hv_dev->device_id, buf, sizeof(buf)); - sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, HYPERV_GUID_STRLEN - 1) == 0) { - strcpy((char *)umsg->body.kvp_ip_val.adapter_id, if_name); + strlcpy((char *)umsg->body.kvp_ip_val.adapter_id, + sc->hn_ifp->if_xname, MAX_ADAPTER_ID_SIZE); break; } } From owner-svn-src-head@freebsd.org Tue May 31 06:24:11 2016 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 2DF55B557BB; Tue, 31 May 2016 06:24:11 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id F2EA31F31; Tue, 31 May 2016 06:24:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V6OAEr071388; Tue, 31 May 2016 06:24:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V6OAYi071387; Tue, 31 May 2016 06:24:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605310624.u4V6OAYi071387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 31 May 2016 06:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301023 - head/sys/boot/geli 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.22 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: Tue, 31 May 2016 06:24:11 -0000 Author: ngie Date: Tue May 31 06:24:09 2016 New Revision: 301023 URL: https://svnweb.freebsd.org/changeset/base/301023 Log: Add missing libc includes to fix -Wimplicit-function-declaration warnings MFC after: 2 weeks Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/geli/geliboot_crypto.c Modified: head/sys/boot/geli/geliboot_crypto.c ============================================================================== --- head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:00:18 2016 (r301022) +++ head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:24:09 2016 (r301023) @@ -27,6 +27,10 @@ * $FreeBSD$ */ +#include +#include +#include + #include "geliboot.h" int From owner-svn-src-head@freebsd.org Tue May 31 06:31:59 2016 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 EA98AB5591E; Tue, 31 May 2016 06:31:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C62F512FC; Tue, 31 May 2016 06:31:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.home.us.delphij.net (unknown [IPv6:2601:646:9b80:c0a9:d18b:aaca:6b34:b814]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 47FF8CD44; Mon, 30 May 2016 23:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1464676313; x=1464690713; bh=MfKXOcN8k4NzVnc55X9gKRZqMAhOI1eltl7+W1s0PMA=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=fOcwWAzZtpz5mc7y91qF4Yub2p9gvVHw8ivdPnH/y61Hsz8oIIpT5u6Squ0VuGAr9 ajpDcgDMzKyah7iaOXvrymnhmdICfYoE8FPkIo4X88woaltASwnyPASaVf2FMGNTba Za3cvMYDjnm9mKritMTsWOTtj3V6UTZPtP8WlcN8= Subject: Re: svn commit: r301023 - head/sys/boot/geli To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605310624.u4V6OAYi071387@repo.freebsd.org> Cc: d@delphij.net, Allan Jude From: Xin Li Message-ID: <31d1323b-cb13-9a90-8b25-430fdbc1d225@delphij.net> Date: Mon, 30 May 2016 23:31:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605310624.u4V6OAYi071387@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3KalNdK6TM0hUh0rgiuR2Bj2SpsJDWHNA" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 06:32:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3KalNdK6TM0hUh0rgiuR2Bj2SpsJDWHNA Content-Type: multipart/mixed; boundary="8c5pqQjh5u0PStkRWdp8Lrn6BXaVTitai" From: Xin Li To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: d@delphij.net, Allan Jude Message-ID: <31d1323b-cb13-9a90-8b25-430fdbc1d225@delphij.net> Subject: Re: svn commit: r301023 - head/sys/boot/geli References: <201605310624.u4V6OAYi071387@repo.freebsd.org> In-Reply-To: <201605310624.u4V6OAYi071387@repo.freebsd.org> --8c5pqQjh5u0PStkRWdp8Lrn6BXaVTitai Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/30/16 23:24, Garrett Cooper wrote: > Author: ngie > Date: Tue May 31 06:24:09 2016 > New Revision: 301023 > URL: https://svnweb.freebsd.org/changeset/base/301023 >=20 > Log: > Add missing libc includes to fix -Wimplicit-function-declaration warn= ings > =20 > MFC after: 2 weeks > Reported by: clang > Sponsored by: EMC / Isilon Storage Division >=20 > Modified: > head/sys/boot/geli/geliboot_crypto.c >=20 > Modified: head/sys/boot/geli/geliboot_crypto.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:00:18 2016 (r301= 022) > +++ head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:24:09 2016 (r301= 023) > @@ -27,6 +27,10 @@ > * $FreeBSD$ > */ > =20 > +#include > +#include > +#include > + > #include "geliboot.h" This is wrong, you shouldn't use standard C library in freestanding environment. It seems that libstand.h is explicitly excluded, why? (in geliboot.h, allanjude cc'ed): %%% /* AES-XTS implementation */ #define _STAND #define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ #include %%% Cheers, --8c5pqQjh5u0PStkRWdp8Lrn6BXaVTitai-- --3KalNdK6TM0hUh0rgiuR2Bj2SpsJDWHNA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIbBAEBCgAGBQJXTS/XAAoJEJW2GBstM+nsfNEP+Of3Td8mbIgcBHCfNlXaqHKy RVTckLPVP9eybJEH9L0FXORQC+jPNxWOlMp31s/Mr/3RgKzxSVypiTiLjWh9q6l1 p8CD4GrjkcqYAVcdw3cu7NS6HrAjKQkR0QJoZBNC2dX00DTtQYWudOzYCBxPZQC6 zr3f1+Pmo4jw9MB1/CIn1cxbhUUv5Txdz3yWfD1J/EVNoxQUvgVjEo/Dp3W/swcX T+e4E/paFFWddiTGpff9B9d6n8GE4PaRnsPIHVXLWkCbp7f4PuIlhBf56dls9yxQ ysrX5icZGpew4bQpaaYbn/SG9F0n6XuU/SdA5HTmtK4EaLZvmD38pc8WzW1AH+ey iHdhJC2F1r20jTPqPx8pdb5zZdNW3bPdDJ5Ouqsz537F13/99QH4yPK+nj0s52KF qpvGJMDHQHgGt/gE8OBlltqJb33khlc5Srulp1A7Wk6l7FDA5VG+JDucrVjvv0O0 xBf5KEuoKqSnb7YqgfS2Q6Hxf8MCmnoEBImZW05NnSjqI6N2lWl4ksu0ELkogdfP hVZBOSI976N6NzUa529/jzPSZosW6v8eyS7j3VL1DxvRqcMDvsTgTWBQ9gjNT1II OIimo9l6EpkilXySEVSXJf/rV1C5Q5XQukfTw1w+ZzsDH0+mm8cnm46xMsDWl7my WwFKWR500ubgzKKtxi4= =3XIz -----END PGP SIGNATURE----- --3KalNdK6TM0hUh0rgiuR2Bj2SpsJDWHNA-- From owner-svn-src-head@freebsd.org Tue May 31 06:45:20 2016 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 BA11FB55C8E; Tue, 31 May 2016 06:45:20 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 7D9501A59; Tue, 31 May 2016 06:45:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V6jJQ8078505; Tue, 31 May 2016 06:45:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V6jJdF078504; Tue, 31 May 2016 06:45:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605310645.u4V6jJdF078504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 06:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301024 - head/sbin/swapon 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.22 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: Tue, 31 May 2016 06:45:20 -0000 Author: ed Date: Tue May 31 06:45:19 2016 New Revision: 301024 URL: https://svnweb.freebsd.org/changeset/base/301024 Log: Stop using the non-standard basename_r() function. This change makes the code use the POSIX basename() function. It has the advantage that (if implemented correctly), it also imposes no restrict on the pathname length. Notice that I haven't added any error handling to the strdup() call. It looks like none of the other calls to strdup() and malloc() performed by this utility do it either. Reviewed by: hrs Differential Revision: https://reviews.freebsd.org/D6626 Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Tue May 31 06:24:09 2016 (r301023) +++ head/sbin/swapon/swapon.c Tue May 31 06:45:19 2016 (r301024) @@ -216,7 +216,7 @@ main(int argc, char **argv) static const char * swap_on_off(const char *name, int doingall, char *mntops) { - char base[PATH_MAX]; + char *base, *basebuf; /* Swap on vnode-backed md(4) device. */ if (mntops != NULL && @@ -227,17 +227,23 @@ swap_on_off(const char *name, int doinga strncmp(MD_NAME, name, sizeof(MD_NAME)) == 0)) return (swap_on_off_md(name, mntops, doingall)); - basename_r(name, base); + basebuf = strdup(name); + base = basename(basebuf); /* Swap on encrypted device by GEOM_BDE. */ - if (fnmatch("*.bde", base, 0) == 0) + if (fnmatch("*.bde", base, 0) == 0) { + free(basebuf); return (swap_on_off_gbde(name, doingall)); + } /* Swap on encrypted device by GEOM_ELI. */ - if (fnmatch("*.eli", base, 0) == 0) + if (fnmatch("*.eli", base, 0) == 0) { + free(basebuf); return (swap_on_off_geli(name, mntops, doingall)); + } /* Swap on special file. */ + free(basebuf); return (swap_on_off_sfile(name, doingall)); } From owner-svn-src-head@freebsd.org Tue May 31 07:07:06 2016 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 AC5D0B55138; Tue, 31 May 2016 07:07:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 7608E143F; Tue, 31 May 2016 07:07:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id C9949781BD6; Tue, 31 May 2016 16:48:32 +1000 (AEST) Date: Tue, 31 May 2016 16:48:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300956 - head/lib/libc/stdlib In-Reply-To: Message-ID: <20160531155327.I1534@besplex.bde.org> References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=lahBRLA8AAAA:8 a=WnojKENl3ujvECYsoUsA:9 a=CjuIK1q_8ugA:10 a=vmqOMGAk8PMA:10 a=scM_vJrj1NO3ah21njXL:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 07:07:06 -0000 On Mon, 30 May 2016, Andrey Chernov wrote: > On 30.05.2016 5:17, Bruce Evans wrote: >> ... >> Even 1980's compiler technology was not far from reducing the division >> to a multiplication. The LCG expression would then reduce to >> (uintN_t)(A * x + B) where N is either 32 or 64. Perhaps N needs to >> be 64 even with the small coeefficients, due to the divisor being large >> and not a power of 2. But if we have 64-bit arithmetic, then we can >> choose much better coefficients than the C90 32-bit ones or the ACM >> barely 16-bit ones, and uses A * x + B directly, giving a 64-bit period, >> and have a chance of our 31-bit RAND_MAX finally working. > > Perhaps you can find some ideas, answers and PRNG comparison in the > original paper: > http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf The ones with Mersenne primes and tweaked Mersenne primes in the reference (lanl?) given by pfg@ seem OK. I like a simple power of 2 modulus. I once always used fancy prime pairs for hash tables but found that 1 prime and 1 power of 2 works better. Hashing isn't much affected by a few bad cases and I think the fancy primes just hide the bad cases better. > While technically equal, having KNF arg types internally and exposing > POSIX ones via headers and docs as you suggest leading to harder eye > catching, which makes things even worse when POSIX decide to change arg > type. The kernel uses different (often wrong) types internally, and now misnames all entry points for syscalls with a sys_ prefix for bogus namespace reasons. > clang -O uses single "idivl" calculating both quotient and reminder for > current code, but for ldiv(3) case call/storage/additional calcs > overhead will be added. ldiv(3) does not reduce anything, see stdlib/ldiv.c The extern functions give lots of overhead. Sometimes they get replaced automatically by builtins, so it is unclear when the extern functions are actually used. ldiv.c compiles to idivl for the division part but has lots of extras for the fixups. The fixups do nothing except waste time on most hardware/cstd combinations. IIRC, C99 requires direct division to have the same poor rounding rules as idiv(), so idiv() is not really needed in C99 and the fixups in it are negatively needed. The builtins know what is needed so they don't do the fixups in the usual case that the hardware follows the poor rounding rules. Bruce From owner-svn-src-head@freebsd.org Tue May 31 07:20:42 2016 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 57F45B552A6 for ; Tue, 31 May 2016 07:20:42 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD7791B08 for ; Tue, 31 May 2016 07:20:41 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f68.google.com with SMTP id 65so16044734lfq.1 for ; Tue, 31 May 2016 00:20:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=QRgzNES30yyAu8fGoBkIXvFKUUDLsBQKrrXUIp5+aIc=; b=NgwtNss9cWdl+qtxt1NGgpNdKq0R7k6BoMG2r4mTsn8LiyS95uUbvMp4TLSv3dEnxM d1JQqNekgfuEwr4xv+e0qWHdAomHcvPyhZ8/6vUqZLbP4dXnWdWq4TmYc60fBCe3PKA5 6LjO29jHKRJGeqUkBOXWF1bTVjR0DYP8oY1LQsV5CHHe49jTntcqsZ6mfEixq1G4J/VA BHsSF5yrwTJUbQenhbAeYFNfVxel1emZCWcbvEn/QQ2rve5ehkvdrf0+ykJZT+PZFXdI t+1F7IQPU4Xo0mKCN4pEmUERgiOGymni3crs9d8s9GyBVRdPLkry4Xgd/mVAuGo+jafS bzMA== X-Gm-Message-State: ALyK8tKaS6qlYJfAXchPXRLmq0yewQHkCJgYSDn95u+aP+pXmxHZTHXrbpB03GFCmisNmQ== X-Received: by 10.25.90.1 with SMTP id o1mr9193265lfb.193.1464679239576; Tue, 31 May 2016 00:20:39 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id n13sm1789264lfb.33.2016.05.31.00.20.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2016 00:20:38 -0700 (PDT) Subject: Re: svn commit: r300965 - head/lib/libc/stdlib To: Bruce Evans References: <201605291639.u4TGdSwq032144@repo.freebsd.org> <20160530122100.X924@besplex.bde.org> <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> <20160531130326.G1052@besplex.bde.org> <20160531152438.S1534@besplex.bde.org> Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <20864fad-e698-31cb-1e52-52db60850356@freebsd.org> Date: Tue, 31 May 2016 10:20:37 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531152438.S1534@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 07:20:42 -0000 On 31.05.2016 8:53, Bruce Evans wrote: > On Tue, 31 May 2016, Andrey Chernov wrote: > >> On 31.05.2016 6:42, Bruce Evans wrote: >>> >>> Er, I already said which types are better -- [u]int_fast32_t here. >> >> [u]int_fast32_t have _at_least_ 32 bits. int32_t in the initial PRNG can >> be changed since does not overflow and involve several calculations, but >> uint_fast32_t is needed just for two operations: > > I think you mean a native uint32_t is needed for 2 operations. > >> *f += *r; >> i = (*f >> 1) & 0x7fffffff; > > This takes 2 operations (add and shift) with native uint32_t. It takes 4 > logical operations (maybe more physically, or less after optimization) > with emulated uint32_t (add, mask to 32 bits (maybe move to another > register to do this), shift, mask to 32 bits). When you write the final > mask explicitly, it is to 31 bits and optimizing this away is especially > easy in both cases. > >> We need to assign values from uint32_t to uint_fast32_t (since array >> size can't be changed), > > FP code using double_t is similar: data in tables should normally be > in doubles since double_t might be too much larger; data in function > parameters is almost always in doubles since APIs are deficient and > don't even support double_t as an arg; then it is best to assign to > a double_t variable since if you just use the double then expressions > using it will promote it to double_t but it is too easy to lose this > expansion too early. It takes extra variables and a little more code > for the assignments, but the extra variables are optimized away in > cases where there is no expansion. > >> do this single operation fast and store them >> back into array of uint32_t. I doubt that much gain can comes from it >> and even pessimization in some cases. Better let compiler do its job >> here. > > It's never a pessimization if the compiler does its job. > > It is good to practice this on a simple 2-step operation. Think of a > multi-step operation where each step requires clipping to 32 bits. > Using uint32_t for the calculation is just a concise way of writing > "& 0xffffffff" after every step (even ones that don't need it). It > is difficult and sometimes impossible for the compiler to optimize > away these masks across a large number of steps. Sometimes this is > easy for the programmer. The biggest problem so far is that fast types for [u]int32_t are exact _the_same_ as not fast for i386 and amd64, see /usr/include/x86/_types.h Without any gain on major platforms I don't think this change is needed. From owner-svn-src-head@freebsd.org Tue May 31 07:50:00 2016 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 A659FB55B91; Tue, 31 May 2016 07:50:00 +0000 (UTC) (envelope-from trasz@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 mx1.freebsd.org (Postfix) with ESMTPS id 801E71B16; Tue, 31 May 2016 07:50:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V7nxpH000299; Tue, 31 May 2016 07:49:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V7nxaB000298; Tue, 31 May 2016 07:49:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605310749.u4V7nxaB000298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 May 2016 07:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301025 - head/usr.bin/iscsictl 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.22 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: Tue, 31 May 2016 07:50:00 -0000 Author: trasz Date: Tue May 31 07:49:59 2016 New Revision: 301025 URL: https://svnweb.freebsd.org/changeset/base/301025 Log: Make iscsictl(8) error messages more consistent. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Tue May 31 06:45:19 2016 (r301024) +++ head/usr.bin/iscsictl/iscsictl.c Tue May 31 07:49:59 2016 (r301025) @@ -837,10 +837,6 @@ main(int argc, char **argv) if (session_id == -1) xo_errx(1, "-M requires -i"); - if (discovery_host != NULL) - xo_errx(1, "-M and -d are mutually exclusive"); - if (aflag != 0) - xo_errx(1, "-M and -a are mutually exclusive"); if (nickname != NULL) { if (portal != NULL) xo_errx(1, "-n and -p and mutually exclusive"); @@ -852,6 +848,10 @@ main(int argc, char **argv) xo_errx(1, "-n and -s and mutually exclusive"); } + if (aflag != 0) + xo_errx(1, "-a cannot be used with -M"); + if (discovery_host != NULL) + xo_errx(1, "-d cannot be used with -M"); if (rflag != 0) xo_errx(1, "-r cannot be used with -M"); if (vflag != 0) @@ -860,13 +860,6 @@ main(int argc, char **argv) xo_errx(1, "-w cannot be used with -M"); } else if (Rflag != 0) { - if (user != NULL) - xo_errx(1, "-R and -u are mutually exclusive"); - if (secret != NULL) - xo_errx(1, "-R and -s are mutually exclusive"); - if (discovery_host != NULL) - xo_errx(1, "-R and -d are mutually exclusive"); - if (aflag != 0) { if (portal != NULL) xo_errx(1, "-a and -p and mutually exclusive"); @@ -883,10 +876,16 @@ main(int argc, char **argv) xo_errx(1, "must specify either -a, -n, -t, or -p"); } + if (discovery_host != NULL) + xo_errx(1, "-d cannot be used with -R"); if (session_id != -1) xo_errx(1, "-i cannot be used with -R"); if (rflag != 0) xo_errx(1, "-r cannot be used with -R"); + if (user != NULL) + xo_errx(1, "-u cannot be used with -R"); + if (secret != NULL) + xo_errx(1, "-s cannot be used with -R"); if (vflag != 0) xo_errx(1, "-v cannot be used with -R"); if (timeout != -1) @@ -895,23 +894,22 @@ main(int argc, char **argv) } else { assert(Lflag != 0); + if (discovery_host != NULL) + xo_errx(1, "-d cannot be used with -L"); + if (session_id != -1) + xo_errx(1, "-i cannot be used with -L"); + if (nickname != NULL) + xo_errx(1, "-n cannot be used with -L"); if (portal != NULL) - xo_errx(1, "-L and -p and mutually exclusive"); + xo_errx(1, "-p cannot be used with -L"); + if (rflag != 0) + xo_errx(1, "-r cannot be used with -L"); if (target != NULL) - xo_errx(1, "-L and -t and mutually exclusive"); + xo_errx(1, "-t cannot be used with -L"); if (user != NULL) - xo_errx(1, "-L and -u and mutually exclusive"); + xo_errx(1, "-u cannot be used with -L"); if (secret != NULL) - xo_errx(1, "-L and -s and mutually exclusive"); - if (nickname != NULL) - xo_errx(1, "-L and -n and mutually exclusive"); - if (discovery_host != NULL) - xo_errx(1, "-L and -d and mutually exclusive"); - if (rflag != 0) - xo_errx(1, "-L and -r and mutually exclusive"); - - if (session_id != -1) - xo_errx(1, "-i cannot be used with -L"); + xo_errx(1, "-s cannot be used with -L"); } iscsi_fd = open(ISCSI_PATH, O_RDWR); From owner-svn-src-head@freebsd.org Tue May 31 07:53:22 2016 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 7063CB55DAF for ; Tue, 31 May 2016 07:53:22 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 040BD1EFB for ; Tue, 31 May 2016 07:53:21 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f66.google.com with SMTP id h68so9043964lfh.3 for ; Tue, 31 May 2016 00:53:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:cc:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=i3HXDPLH0AGwsEvAknWZwSYB4KkY/QtS4fsH6X0msJM=; b=Y0jHh3T2+Y39HV++9vGzS5vNmPzvZh6XEKRyKAPT5d1PaWZRBD8Df7wNflzYWqrXHD sNQ+PNHlNYWtPsgk+mLrSIOrGiw3ntbgcZVwKLAYjBQEdU6OLLO2oxyKkQaAZjG7sNBZ 9ds7RX6VedVFtBm8LTVGXSEhBH76F9jU/HF5VgJliRShiRkhY/J4dKfnKRNnXQi+KSj4 IfU9osCEocpxDVUNHzMx27cn7H+ceqg+zhUCrZyU0WVzi+dHk10g+3YrEeiEtIFdEwph uQ7m/5EyCWIALJjnJs8yUD7s2n6sd/7N4seHL76OygYZPKz+G4VdFtwbo3dDfOc1/YS0 32sw== X-Gm-Message-State: ALyK8tK90/DZtcCrgKdSksDxyRXj64FrNlvfSIxueLXdnijmOQX9haBdEQoXNxaT0PMJcA== X-Received: by 10.25.150.129 with SMTP id y123mr10522528lfd.168.1464681199758; Tue, 31 May 2016 00:53:19 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id yf9sm5077404lbb.34.2016.05.31.00.53.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2016 00:53:19 -0700 (PDT) Subject: Re: svn commit: r300956 - head/lib/libc/stdlib References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> <20160531155327.I1534@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Bruce Evans , pfg@freebsd.org From: Andrey Chernov Message-ID: Date: Tue, 31 May 2016 10:53:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531155327.I1534@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 07:53:22 -0000 On 31.05.2016 9:48, Bruce Evans wrote: >> Perhaps you can find some ideas, answers and PRNG comparison in the >> original paper: >> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf > > The ones with Mersenne primes and tweaked Mersenne primes in the reference > (lanl?) given by pfg@ seem OK. It should be again correctly implemented to not overflow 64bit (as any other 64bit generator too). Moreover, it have visible patterns in the low order bits. This one from the same site is better http://nuclear.llnl.gov/CNP/rng/rngman/node7.html but still have some pattern too and 61-bit. Next one does not suffer from the pattern at all http://nuclear.llnl.gov/CNP/rng/rngman/node8.html but is 2^64-2^10+1. You can download SPRNG library implementing all of them here: http://www.sprng.org/RNG/ For me it is overcomplicated. >> clang -O uses single "idivl" calculating both quotient and reminder for >> current code, but for ldiv(3) case call/storage/additional calcs >> overhead will be added. ldiv(3) does not reduce anything, see >> stdlib/ldiv.c > > The extern functions give lots of overhead. Sometimes they get replaced > automatically by builtins, so it is unclear when the extern functions are > actually used. ldiv.c compiles to idivl for the division part but has > lots of extras for the fixups. The fixups do nothing except waste time > on most hardware/cstd combinations. IIRC, C99 requires direct division > to have the same poor rounding rules as idiv(), so idiv() is not really > needed in C99 and the fixups in it are negatively needed. The builtins > know what is needed so they don't do the fixups in the usual case that > the hardware follows the poor rounding rules. We don't have ldiv() builtin in any cae. For fixups, see full explanation in the comment of stdlib/div.c From owner-svn-src-head@freebsd.org Tue May 31 08:07:42 2016 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 2CFD9B5534A; Tue, 31 May 2016 08:07:42 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id F1FC8173F; Tue, 31 May 2016 08:07:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V87fGr007616; Tue, 31 May 2016 08:07:41 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V87f1K007615; Tue, 31 May 2016 08:07:41 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605310807.u4V87f1K007615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 08:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301026 - head/sys/sys 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.22 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: Tue, 31 May 2016 08:07:42 -0000 Author: ed Date: Tue May 31 08:07:40 2016 New Revision: 301026 URL: https://svnweb.freebsd.org/changeset/base/301026 Log: Let define struct timespec. POSIX 2004 doesn't require that this header defines struct timespec, but does allow it. For FreeBSD, we would at least need a forward declaration for sched_rr_get_interval(). POSIX 2008 is a bit more demanding, as it now requires that it is declared. Remove the old forward declaration and include the _timespec.h header. This should conform to both POSIX 2004 and 2008 now. Modified: head/sys/sys/sched.h Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Tue May 31 07:49:59 2016 (r301025) +++ head/sys/sys/sched.h Tue May 31 08:07:40 2016 (r301026) @@ -222,6 +222,7 @@ struct sched_param { */ #ifndef _KERNEL #include +#include #include #ifndef _PID_T_DECLARED @@ -229,8 +230,6 @@ typedef __pid_t pid_t; #define _PID_T_DECLARED #endif -struct timespec; - __BEGIN_DECLS int sched_get_priority_max(int); int sched_get_priority_min(int); From owner-svn-src-head@freebsd.org Tue May 31 08:27:40 2016 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 C11F3B5594E; Tue, 31 May 2016 08:27:40 +0000 (UTC) (envelope-from des@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 mx1.freebsd.org (Postfix) with ESMTPS id 810631F0D; Tue, 31 May 2016 08:27:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V8RdQ9015084; Tue, 31 May 2016 08:27:39 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V8RdC8015083; Tue, 31 May 2016 08:27:39 GMT (envelope-from des@FreeBSD.org) Message-Id: <201605310827.u4V8RdC8015083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 31 May 2016 08:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301027 - head/lib/libfetch 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.22 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: Tue, 31 May 2016 08:27:40 -0000 Author: des Date: Tue May 31 08:27:39 2016 New Revision: 301027 URL: https://svnweb.freebsd.org/changeset/base/301027 Log: r169386 (PR 112515) was incomplete: it treated 307 as an error except in verbose mode, and did not handle 308 at all. r241840 (PR 172451) added support for 308, but with the same bug. Correctly handle both by recognizing them as redirects in all places where we check the HTTP result code. PR: 112515 173451 209546 Submitted by: novel@ MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Tue May 31 08:07:40 2016 (r301026) +++ head/lib/libfetch/http.c Tue May 31 08:27:39 2016 (r301027) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ || (xyz) == HTTP_MOVED_TEMP \ || (xyz) == HTTP_TEMP_REDIRECT \ + || (xyz) == HTTP_PERM_REDIRECT \ || (xyz) == HTTP_USE_PROXY \ || (xyz) == HTTP_SEE_OTHER) @@ -1767,6 +1768,8 @@ http_request_body(struct url *URL, const break; case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: + case HTTP_TEMP_REDIRECT: + case HTTP_PERM_REDIRECT: case HTTP_SEE_OTHER: case HTTP_USE_PROXY: /* From owner-svn-src-head@freebsd.org Tue May 31 08:31:36 2016 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 26434B55C63; Tue, 31 May 2016 08:31:36 +0000 (UTC) (envelope-from trasz@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 mx1.freebsd.org (Postfix) with ESMTPS id E7E84133E; Tue, 31 May 2016 08:31:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V8VZIK017918; Tue, 31 May 2016 08:31:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V8VZIp017917; Tue, 31 May 2016 08:31:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605310831.u4V8VZIp017917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 May 2016 08:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301028 - head/etc/rc.d 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.22 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: Tue, 31 May 2016 08:31:36 -0000 Author: trasz Date: Tue May 31 08:31:34 2016 New Revision: 301028 URL: https://svnweb.freebsd.org/changeset/base/301028 Log: Cosmetics: add missing space after the ':' in etc/rc.d/random. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/random Modified: head/etc/rc.d/random ============================================================================== --- head/etc/rc.d/random Tue May 31 08:27:39 2016 (r301027) +++ head/etc/rc.d/random Tue May 31 08:31:34 2016 (r301028) @@ -44,12 +44,12 @@ random_start() { if [ ${harvest_mask} -gt 0 ]; then - echo -n 'Setting up harvesting:' + echo -n 'Setting up harvesting: ' ${SYSCTL} kern.random.harvest.mask=${harvest_mask} > /dev/null ${SYSCTL_N} kern.random.harvest.mask_symbolic fi - echo -n 'Feeding entropy:' + echo -n 'Feeding entropy: ' if [ ! -w /dev/random ] ; then warn "/dev/random is not writeable" From owner-svn-src-head@freebsd.org Tue May 31 08:36:41 2016 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 4116AB55D17; Tue, 31 May 2016 08:36:41 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 0AB1B175F; Tue, 31 May 2016 08:36:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V8aeRJ018714; Tue, 31 May 2016 08:36:40 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V8aebk018713; Tue, 31 May 2016 08:36:40 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605310836.u4V8aebk018713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 08:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301029 - head/sys/x86/include 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.22 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: Tue, 31 May 2016 08:36:41 -0000 Author: ed Date: Tue May 31 08:36:39 2016 New Revision: 301029 URL: https://svnweb.freebsd.org/changeset/base/301029 Log: Add missing dependency on . This header uses __INT_MIN and __INT_MAX, which is provided by . This is needed to make 's WCHAR_MIN and WCHAR_MAX work without including other headers as well. Modified: head/sys/x86/include/_types.h Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Tue May 31 08:31:34 2016 (r301028) +++ head/sys/x86/include/_types.h Tue May 31 08:36:39 2016 (r301029) @@ -43,6 +43,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + #define __NO_STRICT_ALIGNMENT /* From owner-svn-src-head@freebsd.org Tue May 31 08:38:25 2016 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 581B6B55E38; Tue, 31 May 2016 08:38:25 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 29AC41A1B; Tue, 31 May 2016 08:38:25 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V8cO97018811; Tue, 31 May 2016 08:38:24 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V8cO9I018810; Tue, 31 May 2016 08:38:24 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605310838.u4V8cO9I018810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 08:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301030 - head/sys/x86/include 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.22 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: Tue, 31 May 2016 08:38:25 -0000 Author: ed Date: Tue May 31 08:38:24 2016 New Revision: 301030 URL: https://svnweb.freebsd.org/changeset/base/301030 Log: Add missing dependency on . In r227474, this header file was changed to define SIG_ATOMIC_{MIN,MAX} in terms of LONG_{MIN,MAX}. Unlike all of the definitions in this header file, LONG_{MIN,MAX} is provided by . Remove the dependency on by using __LONG_{MIN,MAX} instead and including . This change is needed to make SIG_ATOMIC_{MIN,MAX} work without including any other header files. Modified: head/sys/x86/include/_stdint.h Modified: head/sys/x86/include/_stdint.h ============================================================================== --- head/sys/x86/include/_stdint.h Tue May 31 08:36:39 2016 (r301029) +++ head/sys/x86/include/_stdint.h Tue May 31 08:38:24 2016 (r301030) @@ -40,6 +40,8 @@ #ifndef _MACHINE__STDINT_H_ #define _MACHINE__STDINT_H_ +#include + #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) #define INT8_C(c) (c) @@ -167,8 +169,8 @@ #define PTRDIFF_MAX INT64_MAX /* Limits of sig_atomic_t. */ -#define SIG_ATOMIC_MIN LONG_MIN -#define SIG_ATOMIC_MAX LONG_MAX +#define SIG_ATOMIC_MIN __LONG_MIN +#define SIG_ATOMIC_MAX __LONG_MAX /* Limit of size_t. */ #define SIZE_MAX UINT64_MAX From owner-svn-src-head@freebsd.org Tue May 31 09:00:42 2016 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 A324AB55514; Tue, 31 May 2016 09:00:42 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (mail.torek.net [96.90.199.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A142133D; Tue, 31 May 2016 09:00:41 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.14.9/8.14.9) with ESMTP id u4V8VBg1081055; Tue, 31 May 2016 01:31:11 -0700 (PDT) (envelope-from torek@torek.net) Message-Id: <201605310831.u4V8VBg1081055@elf.torek.net> From: Chris Torek To: Ed Schouten cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301024 - head/sbin/swapon In-reply-to: Your message of "Tue, 31 May 2016 06:45:19 -0000." <201605310645.u4V6jJdF078504@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <81053.1464683471.1@elf.torek.net> Date: Tue, 31 May 2016 01:31:11 -0700 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (elf.torek.net [127.0.0.1]); Tue, 31 May 2016 01:31:11 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 09:00:42 -0000 > This change makes the code use the POSIX basename() function. It has the > advantage that (if implemented correctly), it also imposes no restrict > on the pathname length. I'm not sure what the parenthetic remark "if implemented correctly" means, but libc basename() has this in it: char * basename(const char *path) { static char *bname = NULL; if (bname == NULL) { bname = (char *)malloc(MAXPATHLEN); if (bname == NULL) return (NULL); } return (basename_r(path, bname)); } which means that it is not only not thread-safe, it also imposes restrictions on pathname length. I recently wrote a pair of can-be-thread-safe yet can-be- unlimited-path-length yet can-be-backwards-compatible basename and dirname functions (I tested to see if they produced the same errno's and oddball outputs like for dirname("///")). I'll toss them in here in case anyone has some enthusiasm for fixing the mess. Of course they are equally non-standard, unless we can convince a future POSIX committee or something. (I also wrote some halfway useable reentrant getpw* and getgr* functions but they need more thought and do not play well with nsswitch so I am not including them here. NB: rfuncs.h just contains declarations for these reentrant r_* functions.) Chris ------- /* * Copyright 2016 Chris Torek * All rights reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted providing that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #include #include #include #include #include "rfuncs.h" /* * This is essentially a clone of the BSD basename_r function, * which is like POSIX basename() but puts the result in a user * supplied buffer. * * In BSD basename_r, the buffer must be least MAXPATHLEN bytes * long. In our case we take the size of the buffer as an argument. * * Note that it's impossible in general to do this without * a temporary buffer since basename("foo/bar") is "bar", * but basename("foo/bar/") is still "bar" -- no trailing * slash is allowed. * * The return value is your supplied buffer , or NULL if * the length of the basename of the supplied equals or * exceeds your indicated . * * As a special but useful case, if you supply NULL for the * argument, we allocate the buffer dynamically to match the * basename, i.e., the result is basically strdup()ed for you. * In this case is ignored (recommended: pass 0 here). */ char * r_basename(const char *path, char *buf, size_t bufsize) { const char *endp, *comp; size_t len; /* * NULL or empty path means ".". This is perhaps overly * forgiving but matches libc basename_r(), and avoids * breaking the code below. */ if (path == NULL || *path == '\0') { comp = "."; len = 1; } else { /* * Back up over any trailing slashes. If we reach * the top of the path and it's still a trailing * slash, it's also a leading slash and the entire * path is just "/" (or "//", or "///", etc). */ endp = path + strlen(path) - 1; while (*endp == '/' && endp > path) endp--; /* Invariant: *endp != '/' || endp == path */ if (*endp == '/') { /* then endp==path and hence entire path is "/" */ comp = "/"; len = 1; } else { /* * We handled empty strings earlier, and * we just proved *endp != '/'. Hence * we have a non-empty basename, ending * at endp. * * Back up one path name component. The * part between these two is the basename. * * Note that we only stop backing up when * either comp==path, or comp[-1] is '/'. * * Suppose path[0] is '/'. Then, since *endp * is *not* '/', we had comp>path initially, and * stopped backing up because we found a '/' * (perhaps path[0], perhaps a later '/'). * * Or, suppose path[0] is NOT '/'. Then, * either there are no '/'s at all and * comp==path, or comp[-1] is '/'. * * In all cases, we want all bytes from *comp * to *endp, inclusive. */ comp = endp; while (comp > path && comp[-1] != '/') comp--; len = (size_t)(endp - comp + 1); } } if (buf == NULL) { buf = malloc(len + 1); if (buf == NULL) return (NULL); } else { if (len >= bufsize) { errno = ENAMETOOLONG; return (NULL); } } memcpy(buf, comp, len); buf[len] = '\0'; return (buf); } /* * This is much like POSIX dirname(), but is reentrant. * * We examine a path, find the directory portion, and copy that * to a user supplied buffer of the given size . * * Note that dirname("/foo/bar/") is "/foo", dirname("/foo") is "/", * and dirname("////") is "/". However, dirname("////foo/bar") is * "////foo" (we do not resolve these leading slashes away -- this * matches the BSD libc behavior). * * The return value is your supplied buffer , or NULL if * the length of the dirname of the supplied equals or * exceeds your indicated . * * As a special but useful case, if you supply NULL for the * argument, we allocate the buffer dynamically to match the * dirname, i.e., the result is basically strdup()ed for you. * In this case is ignored (recommended: pass 0 here). */ char * r_dirname(const char *path, char *buf, size_t bufsize) { const char *endp, *dirpart; size_t len; /* * NULL or empty path means ".". This is perhaps overly * forgiving but matches libc dirname(), and avoids breaking * the code below. */ if (path == NULL || *path == '\0') { dirpart = "."; len = 1; } else { /* * Back up over any trailing slashes, then back up * one path name, then back up over more slashes. * In all cases, stop as soon as endp==path so * that we do not back out of the buffer entirely. * * The first loop takes care of trailing slashes * in names like "/foo/bar//" (where the dirname * part is to be "/foo"), the second strips out * the non-dir-name part, and the third leaves us * pointing to the end of the directory component. * * If the entire name is of the form "/foo" or * "//foo" (or "/foo/", etc, but we already * handled trailing slashes), we end up pointing * to the leading "/", which is what we want; but * if it is of the form "foo" (or "foo/", etc) we * point to a non-slash. So, if (and only if) * endp==path AND *endp is not '/', the dirname is * ".", but in all cases, the LENGTH of the * dirname is (endp-path+1). */ endp = path + strlen(path) - 1; while (endp > path && *endp == '/') endp--; while (endp > path && *endp != '/') endp--; while (endp > path && *endp == '/') endp--; len = (size_t)(endp - path + 1); if (endp == path && *endp != '/') dirpart = "."; else dirpart = path; } if (buf == NULL) { buf = malloc(len + 1); if (buf == NULL) return (NULL); } else { if (len >= bufsize) { errno = ENAMETOOLONG; return (NULL); } } memcpy(buf, dirpart, len); buf[len] = '\0'; return (buf); } From owner-svn-src-head@freebsd.org Tue May 31 09:15:23 2016 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 284BAB558AD; Tue, 31 May 2016 09:15:23 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 003E61D45; Tue, 31 May 2016 09:15:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V9FMa1033618; Tue, 31 May 2016 09:15:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V9FLMK033613; Tue, 31 May 2016 09:15:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605310915.u4V9FLMK033613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 09:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301031 - in head/sys: arm64/cavium dev/pci 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.22 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: Tue, 31 May 2016 09:15:23 -0000 Author: andrew Date: Tue May 31 09:15:21 2016 New Revision: 301031 URL: https://svnweb.freebsd.org/changeset/base/301031 Log: Mark the ThunderX and generic PCI drivers as cache-coherent when we know this to be the case. This will mean we don't try and handle the cache in bus_dmamap_sync when it is not needed. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6605 Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/arm64/cavium/thunder_pcie_pem.h head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Tue May 31 08:38:24 2016 (r301030) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Tue May 31 09:15:21 2016 (r301031) @@ -119,6 +119,7 @@ thunder_pcie_fdt_attach(device_t dev) sc = device_get_softc(dev); thunder_pcie_identify_ecam(dev, &sc->ecam); + sc->coherent = 1; return (pci_host_generic_attach(dev)); } Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Tue May 31 08:38:24 2016 (r301030) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Tue May 31 09:15:21 2016 (r301031) @@ -137,6 +137,7 @@ static int thunder_pem_get_id(device_t, static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); +static bus_dma_tag_t thunder_pem_get_dma_tag(device_t, device_t); static int thunder_pem_detach(device_t); static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); static int thunder_pem_link_init(struct thunder_pem_softc *); @@ -176,6 +177,8 @@ static device_method_t thunder_pem_metho DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_dma_tag, thunder_pem_get_dma_tag), + /* pcib interface */ DEVMETHOD(pcib_maxslots, thunder_pem_maxslots), DEVMETHOD(pcib_read_config, thunder_pem_read_config), @@ -331,6 +334,15 @@ thunder_pem_adjust_resource(device_t dev return (rman_adjust_resource(res, start, end)); } +static bus_dma_tag_t +thunder_pem_get_dma_tag(device_t dev, device_t child) +{ + struct thunder_pem_softc *sc; + + sc = device_get_softc(dev); + return (sc->dmat); +} + static int thunder_pem_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) @@ -766,6 +778,21 @@ thunder_pem_attach(device_t dev) sc->reg_bst = rman_get_bustag(sc->reg); sc->reg_bsh = rman_get_bushandle(sc->reg); + /* Create the parent DMA tag to pass down the coherent flag */ + error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ + 1, 0, /* alignment, bounds */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dmat); + if (error != 0) + return (error); + /* Map SLI, do it only once */ if (!sli0_s2m_regx_base) { bus_space_map(sc->reg_bst, SLIX_S2M_REGX_ACC, Modified: head/sys/arm64/cavium/thunder_pcie_pem.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.h Tue May 31 08:38:24 2016 (r301030) +++ head/sys/arm64/cavium/thunder_pcie_pem.h Tue May 31 09:15:21 2016 (r301031) @@ -39,6 +39,7 @@ struct thunder_pem_softc { struct resource *reg; bus_space_tag_t reg_bst; bus_space_handle_t reg_bsh; + bus_dma_tag_t dmat; struct pcie_range ranges[MAX_RANGES_TUPLES]; struct rman mem_rman; struct rman io_rman; Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Tue May 31 08:38:24 2016 (r301030) +++ head/sys/dev/pci/pci_host_generic.c Tue May 31 09:15:21 2016 (r301031) @@ -181,6 +181,29 @@ pci_host_generic_attach(device_t dev) if (generic_pcie_ofw_bus_attach(dev) != 0) return (ENXIO); + node = ofw_bus_get_node(dev); + if (sc->coherent == 0) { + sc->coherent = OF_hasprop(node, "dma-coherent"); + } + //if (bootverbose) + device_printf(dev, "Bus is%s cache-coherent\n", + sc->coherent ? "" : " not"); + + /* Create the parent DMA tag to pass down the coherent flag */ + error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ + 1, 0, /* alignment, bounds */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ + sc->coherent ? BUS_DMA_COHERENT : 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dmat); + if (error != 0) + return (error); + rid = 0; sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->res == NULL) { @@ -232,7 +255,6 @@ pci_host_generic_attach(device_t dev) } } - node = ofw_bus_get_node(dev); ofw_bus_setup_iinfo(node, &sc->pci_iinfo, sizeof(cell_t)); device_add_child(dev, "pci", -1); @@ -682,6 +704,15 @@ generic_pcie_deactivate_resource(device_ return (res); } +static bus_dma_tag_t +generic_pcie_get_dma_tag(device_t dev, device_t child) +{ + struct generic_pcie_softc *sc; + + sc = device_get_softc(dev); + return (sc->dmat); +} + static int generic_pcie_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) @@ -798,6 +829,8 @@ static device_method_t generic_pcie_meth DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_dma_tag, generic_pcie_get_dma_tag), + /* pcib interface */ DEVMETHOD(pcib_maxslots, generic_pcie_maxslots), DEVMETHOD(pcib_route_interrupt, generic_pcie_route_interrupt), Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Tue May 31 08:38:24 2016 (r301030) +++ head/sys/dev/pci/pci_host_generic.h Tue May 31 09:15:21 2016 (r301031) @@ -49,6 +49,7 @@ struct pcie_range { struct generic_pcie_softc { struct pcie_range ranges[MAX_RANGES_TUPLES]; int nranges; + int coherent; struct rman mem_rman; struct rman io_rman; struct resource *res; @@ -58,6 +59,7 @@ struct generic_pcie_softc { bus_space_handle_t bsh; device_t dev; bus_space_handle_t ioh; + bus_dma_tag_t dmat; #ifdef FDT struct ofw_bus_iinfo pci_iinfo; #endif From owner-svn-src-head@freebsd.org Tue May 31 09:24:18 2016 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 11EB8B55D43; Tue, 31 May 2016 09:24:18 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id D804F1443; Tue, 31 May 2016 09:24:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V9OHku037342; Tue, 31 May 2016 09:24:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V9OHUT037341; Tue, 31 May 2016 09:24:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605310924.u4V9OHUT037341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 09:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301032 - head/sys/dev/pci 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.22 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: Tue, 31 May 2016 09:24:18 -0000 Author: andrew Date: Tue May 31 09:24:16 2016 New Revision: 301032 URL: https://svnweb.freebsd.org/changeset/base/301032 Log: Move a device_printf under bootverbose where it should have been. Reported by: bz Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Tue May 31 09:15:21 2016 (r301031) +++ head/sys/dev/pci/pci_host_generic.c Tue May 31 09:24:16 2016 (r301032) @@ -185,7 +185,7 @@ pci_host_generic_attach(device_t dev) if (sc->coherent == 0) { sc->coherent = OF_hasprop(node, "dma-coherent"); } - //if (bootverbose) + if (bootverbose) device_printf(dev, "Bus is%s cache-coherent\n", sc->coherent ? "" : " not"); From owner-svn-src-head@freebsd.org Tue May 31 09:58:52 2016 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 88228B5463B; Tue, 31 May 2016 09:58:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 28F271693; Tue, 31 May 2016 09:58:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id DD3517805FF; Tue, 31 May 2016 19:58:48 +1000 (AEST) Date: Tue, 31 May 2016 19:58:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300956 - head/lib/libc/stdlib In-Reply-To: Message-ID: <20160531185907.Y2047@besplex.bde.org> References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> <20160531155327.I1534@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=lahBRLA8AAAA:8 a=i2mCBWboAAAA:8 a=YcMFh1NDAAAA:8 a=HTCe4BXcai_nrORYvSwA:9 a=CjuIK1q_8ugA:10 a=5cIw-q_vxBcA:10 a=hQ8eJWA_F3oA:10 a=vmqOMGAk8PMA:10 a=scM_vJrj1NO3ah21njXL:22 a=rcnv4SZFDOS18o934fMY:22 a=XzeFQDB4FLgTs7H1q4LV:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 09:58:52 -0000 On Tue, 31 May 2016, Andrey Chernov wrote: > On 31.05.2016 9:48, Bruce Evans wrote: >>> Perhaps you can find some ideas, answers and PRNG comparison in the >>> original paper: >>> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf >> >> The ones with Mersenne primes and tweaked Mersenne primes in the reference >> (lanl?) given by pfg@ seem OK. > > It should be again correctly implemented to not overflow 64bit (as any > other 64bit generator too). > > Moreover, it have visible patterns in the low order bits. This one from > the same site is better > http://nuclear.llnl.gov/CNP/rng/rngman/node7.html > but still have some pattern too and 61-bit. Next one does not suffer > from the pattern at all > http://nuclear.llnl.gov/CNP/rng/rngman/node8.html > but is 2^64-2^10+1. That's the tweaked Mersenne prime one. Surely there is a pattern in the bits for all of these, and the better ones just hide the pattern better from normal uses and tests? Isn't it well known that the lower bits have more patterns so shouldn't be used? This depends on whether the implementation exposes all its bits. Since the rand() specification and FreeBSD man pages don't say anything about this, it is a bug in the implementation to expose all its bits. The implementation is handicapped by using only 32 bits internally but wanting RAND_MAX to be almost 32 bits. > You can download SPRNG library implementing all of them here: > http://www.sprng.org/RNG/ > For me it is overcomplicated. The general case is certainly too complicated. It would let the user specify all the parameters for the LCG and generate optimal code for the choice on the fly. Maybe also change the parameters with the seed. But even most implementors don't know how to choose the parameters. That's just for the not so good LCG family of RNGs. >>> clang -O uses single "idivl" calculating both quotient and reminder for >>> current code, but for ldiv(3) case call/storage/additional calcs >>> overhead will be added. ldiv(3) does not reduce anything, see >>> stdlib/ldiv.c >> >> The extern functions give lots of overhead. Sometimes they get replaced >> automatically by builtins, so it is unclear when the extern functions are >> actually used. ldiv.c compiles to idivl for the division part but has >> lots of extras for the fixups. The fixups do nothing except waste time >> on most hardware/cstd combinations. IIRC, C99 requires direct division >> to have the same poor rounding rules as idiv(), so idiv() is not really >> needed in C99 and the fixups in it are negatively needed. The builtins >> know what is needed so they don't do the fixups in the usual case that >> the hardware follows the poor rounding rules. > > We don't have ldiv() builtin in any cae. Apparently integer division is too fundamental to be a builtin. strings -a `which clang` | grep builtin.*div on amd64 gives 47 builtins for division, but none seem to be for integer division. gcc-3.3 has just 4, all for SSE FP division. > For fixups, see full > explanation in the comment of stdlib/div.c That was what I was complaining about. div.c is for C90 (misspelled "ANSI"). div.c hasn't caught up with C99. C99 broke this by changing the rules for integer division to disallow correct rounding for and require consistently incorrect rounding. Correct rounding for a positive divisor is towards minus infinity so that the remainder is not negative. This is modulo arithmetic and has good algebraic properties. C99 requires rounding minus infinity, at least for positive divisors, under the extension "reliable integer division". In C90, the rounding is implementation- defined, so it may be correct, but it is "unreliable" since it can be anything. In C90, div() is specified as giving "reliable" division, and that is what the fixups implement. This now wastes time to change nothing. If the hardware does correct rounding, then the compiler already had to do the fixup and id should have produced good MD code for this. The C code then adds not so good MI code. Bruce From owner-svn-src-head@freebsd.org Tue May 31 11:30:37 2016 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 636F9B532C6 for ; Tue, 31 May 2016 11:30:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A725174B for ; Tue, 31 May 2016 11:30:36 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f44.google.com with SMTP id b73so65591647lfb.3 for ; Tue, 31 May 2016 04:30:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=iT3De0gtpJLWVTyX3yOdeumV/EguIK1YExdF91qp7/U=; b=hhr4NiyJt2woyYoLlfEarIrKldYwM7+5E36EPU27AntTDg8DXvhd74skbHTQor6mqH OfAlnylx10u6qqAErdiqA3+5IeiX9156c4AGnNxd4W4USC60h8fVIPpyz6tM7jZ/3eTT tFXAJ5J31amD5ROLC736WzgKN1+21EaYEGuw9coNALgwcocY3i35HjjLn++6Q36yfNfI 9UDgRAaOkdATd1ZbsJB+UiN+8U6rBs/U4OE9WcYQ1SJWGptHRGYeLIy2ylsaxm+P5cri NWg6dVOeBJKdrDiEAAYKVmBR8pFAIW7EwG2nqAbr1ItjyCDh/PNpMonPlAEHwBqAAbf3 gE3w== X-Gm-Message-State: ALyK8tLsNtAhs77zrm+dakGfMcVp2FgbxH2ycJiXlTdHfQngPiM48bjxlw9+R48Lok/wQA== X-Received: by 10.46.33.96 with SMTP id h93mr7910434ljh.45.1464694228874; Tue, 31 May 2016 04:30:28 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id x5sm2149508lbo.41.2016.05.31.04.30.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2016 04:30:28 -0700 (PDT) Subject: Re: svn commit: r300956 - head/lib/libc/stdlib To: Bruce Evans References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> <20160531155327.I1534@besplex.bde.org> <20160531185907.Y2047@besplex.bde.org> Cc: pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Tue, 31 May 2016 14:30:27 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531185907.Y2047@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 11:30:37 -0000 On 31.05.2016 12:58, Bruce Evans wrote: > On Tue, 31 May 2016, Andrey Chernov wrote: > >> On 31.05.2016 9:48, Bruce Evans wrote: >>>> Perhaps you can find some ideas, answers and PRNG comparison in the >>>> original paper: >>>> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf >>> >>> The ones with Mersenne primes and tweaked Mersenne primes in the >>> reference >>> (lanl?) given by pfg@ seem OK. >> >> It should be again correctly implemented to not overflow 64bit (as any >> other 64bit generator too). >> >> Moreover, it have visible patterns in the low order bits. This one from >> the same site is better >> http://nuclear.llnl.gov/CNP/rng/rngman/node7.html >> but still have some pattern too and 61-bit. Next one does not suffer >> from the pattern at all >> http://nuclear.llnl.gov/CNP/rng/rngman/node8.html >> but is 2^64-2^10+1. > > That's the tweaked Mersenne prime one. > > Surely there is a pattern in the bits for all of these, and the better > ones just hide the pattern better from normal uses and tests? Excepting bad first one from pfg@ http://nuclear.llnl.gov/CNP/rng/rngman/node4.html as I understand, they not hide (i.e. drop) the pattern but mix it with other part in calculations, it cause whole range reduced. >> You can download SPRNG library implementing all of them here: >> http://www.sprng.org/RNG/ >> For me it is overcomplicated. > > The general case is certainly too complicated. It would let the user > specify all the parameters for the LCG and generate optimal code for > the choice on the fly. Maybe also change the parameters with the seed. > But even most implementors don't know how to choose the parameters. > That's just for the not so good LCG family of RNGs. All mentioned PRNGs with exact parameters (info.h) can be found in the subdirs under SRC, f.e. lcg64 or pmlcfg. They are still looks complicated and use GMP Bignum library for calculations. >> For fixups, see full >> explanation in the comment of stdlib/div.c > > That was what I was complaining about. div.c is for C90 (misspelled > "ANSI"). div.c hasn't caught up with C99. C99 broke this by changing > the rules for integer division to disallow correct rounding for and > require consistently incorrect rounding. Correct rounding for a > positive divisor is towards minus infinity so that the remainder is > not negative. This is modulo arithmetic and has good algebraic > properties. C99 requires rounding minus infinity, at least for positive > divisors, under the extension "reliable integer division". In C90, > the rounding is implementation- defined, so it may be correct, but it > is "unreliable" since it can be anything. > > In C90, div() is specified as giving "reliable" division, and that is > what the fixups implement. This now wastes time to change nothing. > If the hardware does correct rounding, then the compiler already > had to do the fixup and id should have produced good MD code for this. > The C code then adds not so good MI code. It seems POSIX says nothing about any fixup and negative results: "These functions shall compute the quotient and remainder of the division of the numerator numer by the denominator denom. If the division is inexact, the resulting quotient is the long integer (for the ldiv( ) function) or long long integer (for the lldiv( ) function) of lesser magnitude that is the nearest to the algebraic quotient. If the result cannot be represented, the behavior is undefined; otherwise, quot * denom+rem shall equal numer." Does it mean that this fixup should be removed? From owner-svn-src-head@freebsd.org Tue May 31 11:32:09 2016 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 04467B53351; Tue, 31 May 2016 11:32:09 +0000 (UTC) (envelope-from trasz@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 mx1.freebsd.org (Postfix) with ESMTPS id C4DB41ACB; Tue, 31 May 2016 11:32:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VBW8l5084846; Tue, 31 May 2016 11:32:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VBW7Dc084836; Tue, 31 May 2016 11:32:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605311132.u4VBW7Dc084836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 May 2016 11:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301033 - in head: sys/dev/iscsi usr.bin/iscsictl 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.22 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: Tue, 31 May 2016 11:32:09 -0000 Author: trasz Date: Tue May 31 11:32:07 2016 New Revision: 301033 URL: https://svnweb.freebsd.org/changeset/base/301033 Log: Add "iscsictl -e". Among other things, it makes it possible to perform discovery without attaching to the targets ("iscsictl -Ad ... -e off"), and then attach to selected ones ("iscsictl -Mi ... -e on"). PR: 204129 MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6633 Modified: head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi_ioctl.h head/usr.bin/iscsictl/iscsi.conf.5 head/usr.bin/iscsictl/iscsictl.8 head/usr.bin/iscsictl/iscsictl.c head/usr.bin/iscsictl/iscsictl.h head/usr.bin/iscsictl/parse.y head/usr.bin/iscsictl/token.l Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue May 31 09:24:16 2016 (r301032) +++ head/sys/dev/iscsi/iscsi.c Tue May 31 11:32:07 2016 (r301033) @@ -406,6 +406,11 @@ iscsi_maintenance_thread_reconnect(struc KASSERT(STAILQ_EMPTY(&is->is_postponed), ("destroying session with postponed PDUs")); + if (is->is_conf.isc_enable == 0 && is->is_conf.isc_discovery == 0) { + ISCSI_SESSION_UNLOCK(is); + return; + } + /* * Request immediate reconnection from iscsid(8). */ @@ -549,6 +554,9 @@ iscsi_callout(void *context) callout_schedule(&is->is_callout, 1 * hz); + if (is->is_conf.isc_enable == 0) + goto out; + is->is_timeout++; if (is->is_waiting_for_iscsid) { @@ -1311,6 +1319,11 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof for (;;) { TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { ISCSI_SESSION_LOCK(is); + if (is->is_conf.isc_enable == 0 && + is->is_conf.isc_discovery == 0) { + ISCSI_SESSION_UNLOCK(is); + continue; + } if (is->is_waiting_for_iscsid) break; ISCSI_SESSION_UNLOCK(is); @@ -1826,17 +1839,22 @@ iscsi_ioctl_session_add(struct iscsi_sof callout_reset(&is->is_callout, 1 * hz, iscsi_callout, is); TAILQ_INSERT_TAIL(&sc->sc_sessions, is, is_next); + ISCSI_SESSION_LOCK(is); /* - * Trigger immediate reconnection. + * Don't notify iscsid(8) if the session is disabled and it's not + * a discovery session, */ - ISCSI_SESSION_LOCK(is); + if (is->is_conf.isc_enable == 0 && is->is_conf.isc_discovery == 0) { + ISCSI_SESSION_UNLOCK(is); + sx_xunlock(&sc->sc_lock); + return (0); + } + is->is_waiting_for_iscsid = true; strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason)); ISCSI_SESSION_UNLOCK(is); cv_signal(&sc->sc_cv); - sx_xunlock(&sc->sc_lock); - return (0); } Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Tue May 31 09:24:16 2016 (r301032) +++ head/sys/dev/iscsi/iscsi_ioctl.h Tue May 31 11:32:07 2016 (r301033) @@ -67,7 +67,8 @@ struct iscsi_session_conf { int isc_data_digest; int isc_iser; char isc_offload[ISCSI_OFFLOAD_LEN]; - int isc_spare[2]; + int isc_enable; + int isc_spare[1]; }; /* Modified: head/usr.bin/iscsictl/iscsi.conf.5 ============================================================================== --- head/usr.bin/iscsictl/iscsi.conf.5 Tue May 31 09:24:16 2016 (r301032) +++ head/usr.bin/iscsictl/iscsi.conf.5 Tue May 31 11:32:07 2016 (r301033) @@ -125,6 +125,14 @@ must be defined. Discovery sessions result in the initiator connecting to all the targets returned by SendTargets iSCSI discovery with the defined .Sy TargetAddress . +.It Cm Enable +Enable or disable the session. +State can be either +.Qq Ar On , +or +.Qq Ar Off . +Default is +.Qq Ar On . .It Cm Offload Name of selected iSCSI hardware offload driver. Default is Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Tue May 31 09:24:16 2016 (r301032) +++ head/usr.bin/iscsictl/iscsictl.8 Tue May 31 11:32:07 2016 (r301033) @@ -40,11 +40,13 @@ .Op Fl u Ar user Fl s Ar secret .Op Fl w Ar timeout .Op Fl r +.Op Fl e Cm on | off .Nm .Fl A .Fl d Ar discovery-host .Op Fl u Ar user Fl s Ar secret .Op Fl r +.Op Fl e Cm on | off .Nm .Fl A .Fl a Op Fl c Ar path @@ -58,6 +60,7 @@ .Op Fl t Ar target .Op Fl u Ar user .Op Fl s Ar secret +.Op Fl e Cm on | off .Nm .Fl M .Fl i Ar session-id @@ -110,6 +113,10 @@ Target host name or address used for Sen When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, and the temporary discovery session will be removed. +.It Fl e +Enable or disable the session. +This is ignored for discovery sessions, but gets passed down to normal +sessions they add. .It Fl i Session ID, as displayed by .Nm @@ -189,6 +196,12 @@ utility exits 0 on success, and >0 if an Attach to target iqn.2012-06.com.example:target0, served by 192.168.1.1: .Dl Nm Fl A Fl t Ar iqn.2012-06.com.example:target0 Fl p Ar 192.168.1.1 .Pp +Perform discovery on 192.168.1.1, and add disabled sessions for each +discovered target; use +.Nm -M -e on +to connect them: +.Dl Nm Fl A Fl d Ar 192.168.1.1 Fl e Ar off +.Pp Disconnect all iSCSI sessions: .Dl Nm Fl Ra .Sh SEE ALSO Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Tue May 31 09:24:16 2016 (r301032) +++ head/usr.bin/iscsictl/iscsictl.c Tue May 31 11:32:07 2016 (r301033) @@ -98,7 +98,6 @@ target_delete(struct target *targ) free(targ); } - static char * default_initiator_name(void) { @@ -152,6 +151,23 @@ valid_hex(const char ch) } } +int +parse_enable(const char *enable) +{ + if (enable == NULL) + return (ENABLE_UNSPECIFIED); + + if (strcasecmp(enable, "on") == 0 || + strcasecmp(enable, "yes") == 0) + return (ENABLE_ON); + + if (strcasecmp(enable, "off") == 0 || + strcasecmp(enable, "no") == 0) + return (ENABLE_OFF); + + return (ENABLE_UNSPECIFIED); +} + bool valid_iscsi_name(const char *name) { @@ -325,6 +341,8 @@ conf_from_target(struct iscsi_session_co sizeof(conf->isc_mutual_secret)); if (targ->t_session_type == SESSION_TYPE_DISCOVERY) conf->isc_discovery = 1; + if (targ->t_enable != ENABLE_OFF) + conf->isc_enable = 1; if (targ->t_protocol == PROTOCOL_ISER) conf->isc_iser = 1; if (targ->t_offload != NULL) @@ -371,7 +389,7 @@ kernel_modify(int iscsi_fd, unsigned int static void kernel_modify_some(int iscsi_fd, unsigned int session_id, const char *target, - const char *target_addr, const char *user, const char *secret) + const char *target_addr, const char *user, const char *secret, int enable) { struct iscsi_session_state *states = NULL; struct iscsi_session_state *state; @@ -421,6 +439,10 @@ kernel_modify_some(int iscsi_fd, unsigne strlcpy(conf->isc_user, user, sizeof(conf->isc_user)); if (secret != NULL) strlcpy(conf->isc_secret, secret, sizeof(conf->isc_secret)); + if (enable == ENABLE_ON) + conf->isc_enable = 1; + else if (enable == ENABLE_OFF) + conf->isc_enable = 0; memset(&ism, 0, sizeof(ism)); ism.ism_session_id = session_id; @@ -527,6 +549,9 @@ kernel_list(int iscsi_fd, const struct t xo_emit("{L:/%-18s}{V:type/%s}\n", "Session type:", conf->isc_discovery ? "Discovery" : "Normal"); + xo_emit("{L:/%-18s}{V:enable/%s}\n", + "Enable:", + conf->isc_enable ? "Yes" : "No"); xo_emit("{L:/%-18s}{V:state/%s}\n", "Session state:", state->iss_connected ? "Connected" : "Disconnected"); @@ -575,6 +600,8 @@ kernel_list(int iscsi_fd, const struct t } else { if (conf->isc_discovery) { xo_emit("{V:state}\n", "Discovery"); + } else if (conf->isc_enable == 0) { + xo_emit("{V:state}\n", "Disabled"); } else if (state->iss_connected) { xo_emit("{V:state}: ", "Connected"); print_periphs(state->iss_id); @@ -653,13 +680,13 @@ usage(void) { fprintf(stderr, "usage: iscsictl -A -p portal -t target " - "[-u user -s secret] [-w timeout]\n"); + "[-u user -s secret] [-w timeout] [-e on | off]\n"); fprintf(stderr, " iscsictl -A -d discovery-host " - "[-u user -s secret]\n"); + "[-u user -s secret] [-e on | off]\n"); fprintf(stderr, " iscsictl -A -a [-c path]\n"); fprintf(stderr, " iscsictl -A -n nickname [-c path]\n"); fprintf(stderr, " iscsictl -M -i session-id [-p portal] " - "[-t target] [-u user] [-s secret]\n"); + "[-t target] [-u user] [-s secret] [-e on | off]\n"); fprintf(stderr, " iscsictl -M -i session-id -n nickname " "[-c path]\n"); fprintf(stderr, " iscsictl -R [-p portal] [-t target]\n"); @@ -687,8 +714,8 @@ main(int argc, char **argv) rflag = 0, vflag = 0; const char *conf_path = DEFAULT_CONFIG_PATH; char *nickname = NULL, *discovery_host = NULL, *portal = NULL, - *target = NULL, *user = NULL, *secret = NULL; - int timeout = -1; + *target = NULL, *user = NULL, *secret = NULL; + int timeout = -1, enable = ENABLE_UNSPECIFIED; long long session_id = -1; char *end; int ch, error, iscsi_fd, retval, saved_errno; @@ -699,7 +726,7 @@ main(int argc, char **argv) argc = xo_parse_args(argc, argv); xo_open_container("iscsictl"); - while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:rt:u:s:vw:")) != -1) { + while ((ch = getopt(argc, argv, "AMRLac:d:e:i:n:p:rt:u:s:vw:")) != -1) { switch (ch) { case 'A': Aflag = 1; @@ -722,6 +749,13 @@ main(int argc, char **argv) case 'd': discovery_host = optarg; break; + case 'e': + enable = parse_enable(optarg); + if (enable == ENABLE_UNSPECIFIED) { + xo_errx(1, "invalid argument to -e, " + "must be either \"on\" or \"off\""); + } + break; case 'i': session_id = strtol(optarg, &end, 10); if ((size_t)(end - optarg) != strlen(optarg)) @@ -781,6 +815,8 @@ main(int argc, char **argv) */ if (Aflag != 0) { if (aflag != 0) { + if (enable != ENABLE_UNSPECIFIED) + xo_errx(1, "-a and -e and mutually exclusive"); if (portal != NULL) xo_errx(1, "-a and -p and mutually exclusive"); if (target != NULL) @@ -796,6 +832,8 @@ main(int argc, char **argv) if (rflag != 0) xo_errx(1, "-a and -r and mutually exclusive"); } else if (nickname != NULL) { + if (enable != ENABLE_UNSPECIFIED) + xo_errx(1, "-n and -e and mutually exclusive"); if (portal != NULL) xo_errx(1, "-n and -p and mutually exclusive"); if (target != NULL) @@ -838,6 +876,8 @@ main(int argc, char **argv) xo_errx(1, "-M requires -i"); if (nickname != NULL) { + if (enable != ENABLE_UNSPECIFIED) + xo_errx(1, "-n and -e and mutually exclusive"); if (portal != NULL) xo_errx(1, "-n and -p and mutually exclusive"); if (target != NULL) @@ -878,6 +918,8 @@ main(int argc, char **argv) if (discovery_host != NULL) xo_errx(1, "-d cannot be used with -R"); + if (enable != ENABLE_UNSPECIFIED) + xo_errx(1, "-e cannot be used with -R"); if (session_id != -1) xo_errx(1, "-i cannot be used with -R"); if (rflag != 0) @@ -946,7 +988,7 @@ main(int argc, char **argv) failed += kernel_list(iscsi_fd, targ, vflag); } else if (Mflag != 0) { kernel_modify_some(iscsi_fd, session_id, target, portal, - user, secret); + user, secret, enable); } else { if (Aflag != 0 && target != NULL) { if (valid_iscsi_name(target) == false) @@ -965,6 +1007,7 @@ main(int argc, char **argv) targ->t_session_type = SESSION_TYPE_NORMAL; targ->t_address = portal; } + targ->t_enable = enable; if (rflag != 0) targ->t_protocol = PROTOCOL_ISER; targ->t_user = user; Modified: head/usr.bin/iscsictl/iscsictl.h ============================================================================== --- head/usr.bin/iscsictl/iscsictl.h Tue May 31 09:24:16 2016 (r301032) +++ head/usr.bin/iscsictl/iscsictl.h Tue May 31 11:32:07 2016 (r301033) @@ -58,6 +58,10 @@ #define PROTOCOL_ISCSI 1 #define PROTOCOL_ISER 2 +#define ENABLE_UNSPECIFIED 0 +#define ENABLE_ON 1 +#define ENABLE_OFF 2 + struct target { TAILQ_ENTRY(target) t_next; struct conf *t_conf; @@ -71,6 +75,7 @@ struct target { int t_data_digest; int t_auth_method; int t_session_type; + int t_enable; int t_protocol; char *t_offload; char *t_user; @@ -113,5 +118,6 @@ void print_periphs(int session_id); char *checked_strdup(const char *); bool valid_iscsi_name(const char *name); +int parse_enable(const char *enable); #endif /* !ISCSICTL_H */ Modified: head/usr.bin/iscsictl/parse.y ============================================================================== --- head/usr.bin/iscsictl/parse.y Tue May 31 09:24:16 2016 (r301032) +++ head/usr.bin/iscsictl/parse.y Tue May 31 11:32:07 2016 (r301033) @@ -56,7 +56,7 @@ extern void yyrestart(FILE *); %} -%token AUTH_METHOD HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS +%token AUTH_METHOD ENABLE HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS %token INITIATOR_NAME INITIATOR_ADDRESS INITIATOR_ALIAS USER SECRET %token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL OFFLOAD %token IGNORED EQUALS OPENING_BRACKET CLOSING_BRACKET @@ -118,6 +118,8 @@ target_entry: | session_type | + enable + | offload | protocol @@ -253,6 +255,17 @@ session_type: SESSION_TYPE EQUALS STR } ; +enable: ENABLE EQUALS STR + { + if (target->t_enable != ENABLE_UNSPECIFIED) + xo_errx(1, "duplicated enable at line %d", lineno); + target->t_enable = parse_enable($3); + if (target->t_enable == ENABLE_UNSPECIFIED) + xo_errx(1, "invalid enable at line %d; " + "must be either \"on\" or \"off\"", lineno); + } + ; + offload: OFFLOAD EQUALS STR { if (target->t_offload != NULL) Modified: head/usr.bin/iscsictl/token.l ============================================================================== --- head/usr.bin/iscsictl/token.l Tue May 31 09:24:16 2016 (r301032) +++ head/usr.bin/iscsictl/token.l Tue May 31 11:32:07 2016 (r301033) @@ -62,6 +62,7 @@ tgtChapName { return MUTUAL_USER; } tgtChapSecret { return MUTUAL_SECRET; } AuthMethod { return AUTH_METHOD; } SessionType { return SESSION_TYPE; } +enable { return ENABLE; } protocol { return PROTOCOL; } offload { return OFFLOAD; } port { return IGNORED; } From owner-svn-src-head@freebsd.org Tue May 31 11:32:10 2016 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 51B39B53357; Tue, 31 May 2016 11:32:10 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 2306E1AD2; Tue, 31 May 2016 11:32:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VBW93V084905; Tue, 31 May 2016 11:32:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VBW90m084904; Tue, 31 May 2016 11:32:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311132.u4VBW90m084904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 11:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301034 - head/sys/cddl/dev/dtrace/aarch64 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.22 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: Tue, 31 May 2016 11:32:10 -0000 Author: andrew Date: Tue May 31 11:32:09 2016 New Revision: 301034 URL: https://svnweb.freebsd.org/changeset/base/301034 Log: Set oldfp so the check for fp == oldfp works as expected. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Tue May 31 11:32:07 2016 (r301033) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Tue May 31 11:32:09 2016 (r301034) @@ -119,7 +119,7 @@ dtrace_getustack_common(uint64_t *pcstac volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; int ret = 0; - uintptr_t oldfp; + uintptr_t oldfp = fp; ASSERT(pcstack == NULL || pcstack_limit > 0); @@ -168,6 +168,8 @@ dtrace_getustack_common(uint64_t *pcstac *flags &= ~CPU_DTRACE_FAULT; break; } + + oldfp = fp; } return (ret); From owner-svn-src-head@freebsd.org Tue May 31 11:42:00 2016 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 71806B53502; Tue, 31 May 2016 11:42:00 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (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 AF9F010C2; Tue, 31 May 2016 11:41:59 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=3Zv1k5jhCR2UOcgeubM5nzxtHNGdjm5yXHF2GO7qunA=; b=SdW0EHde2uxrQ3whqb8X5bxnCG27YGOcTAeha0DDJZstA3pPihRQ0pYdQ6klAZK0U10CawL2ByeC2/EskjwBLGWOa7GZBFQRqVOYv4NWNRmIjw/hxb3SeCMEo6AhVnSBoxl/trroaVjd5YqiqspashZcROKFm7+v89QI/2wXGYA=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1b7i3Y-0009hi-Ku ; Tue, 31 May 2016 14:41:56 +0300 Date: Tue, 31 May 2016 14:41:55 +0300 From: Ivan Klymenko To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys ... Message-ID: <20160531144155.7e96c5a5@nonamehost.local> In-Reply-To: <201605310412.u4V4CEh4021513@repo.freebsd.org> References: <201605310412.u4V4CEh4021513@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 11:42:00 -0000 On Tue, 31 May 2016 04:12:14 +0000 (UTC) Allan Jude wrote: > Author: allanjude > Date: Tue May 31 04:12:14 2016 > New Revision: 301010 > URL: https://svnweb.freebsd.org/changeset/base/301010 > > Log: > Connect the SHA-512t256 and Skein hashing algorithms to ZFS > > Support for the new hashing algorithms in ZFS was introduced in > r289422 However it was disconnected because FreeBSD lacked > implementations of SHA-512 (truncated to 256 bits), and Skein. > > These implementations were introduced in r300921 and r300966 > respectively > This commit connects them to ZFS and enabled these new checksum > algorithms > This new algorithms are not supported by the boot blocks, so do not > use them on your root dataset if you boot from ZFS. > Hello. Tell me please, who is now the fastest of these algorithms? What remains of the available algorithms checksum algorithm by default? Thanks. From owner-svn-src-head@freebsd.org Tue May 31 12:29:22 2016 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 CDD9BB5482F; Tue, 31 May 2016 12:29:22 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 9F5F11B17; Tue, 31 May 2016 12:29:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VCTLIc003682; Tue, 31 May 2016 12:29:21 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VCTL3D003681; Tue, 31 May 2016 12:29:21 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311229.u4VCTL3D003681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 12:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301035 - head/include 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.22 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: Tue, 31 May 2016 12:29:22 -0000 Author: ed Date: Tue May 31 12:29:21 2016 New Revision: 301035 URL: https://svnweb.freebsd.org/changeset/base/301035 Log: Make strfmon_l() work without requiring the use of . The strfmon_l() function provided by is also part of POSIX 2008's , so it should be exposed by default. Change the check used in to be similar to the one that's part of , where we both test for __POSIX_VISIBLE and _XLOCALE_H_. Modified: head/include/monetary.h Modified: head/include/monetary.h ============================================================================== --- head/include/monetary.h Tue May 31 11:32:09 2016 (r301034) +++ head/include/monetary.h Tue May 31 12:29:21 2016 (r301035) @@ -43,7 +43,7 @@ typedef __ssize_t ssize_t; #endif __BEGIN_DECLS -#ifdef _XLOCALE_H_ +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) #include #endif ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...); From owner-svn-src-head@freebsd.org Tue May 31 13:25:32 2016 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 7F35FB559F9 for ; Tue, 31 May 2016 13:25:32 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 111F01BC8 for ; Tue, 31 May 2016 13:25:31 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id s64so66452391lfe.0 for ; Tue, 31 May 2016 06:25:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=m2iDKW35cnqo8f1HhqVWr1epwLt5isAaJvw/OoGJ3bU=; b=l4qciTapJHnrT5iGfHfOlkVqx3Hf1XHfkEtSQuzV84hIe/u8sAewKZ5JYk9cwrsx9J okwHyLGCRaZPDYS2JBQdp6s4LQ82KAfhUTTCm8pgAeMi9hoqjJXDmn9e9FJqKCnJRVPA A4gENwgyc/E/TUaXfygEDpYRTN70Se2LHU6LUQw0wxnekXibXw3GKLDh8lo7+vW5Bn/C Hvl/dBmC8bfR5eGD+xBue9DfdFeuTuOC+aEKbL5XoGpXNixWgOCVxWNmYTgwEjwtRzCA EarEPICHPfYbXWPcDwPaxWy1iqfM/NdtGeaY/8FRKLhbfW0DlbXbbVhCG5fXFPZxBk5X KzHw== X-Gm-Message-State: ALyK8tK+9m9z6KVFsl0orF/ZDeaXru0Lr33l41Jwb/e/mye5wnTWYenrib6/WMhV/KHxZw== X-Received: by 10.46.71.213 with SMTP id u204mr7752844lja.15.1464701124424; Tue, 31 May 2016 06:25:24 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id u188sm2654669lja.11.2016.05.31.06.25.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2016 06:25:23 -0700 (PDT) Subject: Re: svn commit: r300956 - head/lib/libc/stdlib To: Bruce Evans References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> <20160531155327.I1534@besplex.bde.org> <20160531185907.Y2047@besplex.bde.org> Cc: pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <92189e8c-8434-9b54-acf9-9909e647a0db@freebsd.org> Date: Tue, 31 May 2016 16:25:22 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 13:25:32 -0000 This implementation of shifts&xors 32-bit and 64-bit PRNGs looks more reliable than Mersenne primes and don't use Bignums: http://wwwmaths.anu.edu.au/~brent/ftp/random/xorgens305.tar.gz PDF article inside. On 31.05.2016 14:30, Andrey Chernov wrote: > On 31.05.2016 12:58, Bruce Evans wrote: >> On Tue, 31 May 2016, Andrey Chernov wrote: >> >>> On 31.05.2016 9:48, Bruce Evans wrote: >>>>> Perhaps you can find some ideas, answers and PRNG comparison in the >>>>> original paper: >>>>> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf >>>> >>>> The ones with Mersenne primes and tweaked Mersenne primes in the >>>> reference >>>> (lanl?) given by pfg@ seem OK. >>> >>> It should be again correctly implemented to not overflow 64bit (as any >>> other 64bit generator too). >>> >>> Moreover, it have visible patterns in the low order bits. This one from >>> the same site is better >>> http://nuclear.llnl.gov/CNP/rng/rngman/node7.html >>> but still have some pattern too and 61-bit. Next one does not suffer >>> from the pattern at all >>> http://nuclear.llnl.gov/CNP/rng/rngman/node8.html >>> but is 2^64-2^10+1. >> >> That's the tweaked Mersenne prime one. >> >> Surely there is a pattern in the bits for all of these, and the better >> ones just hide the pattern better from normal uses and tests? > > Excepting bad first one from pfg@ > http://nuclear.llnl.gov/CNP/rng/rngman/node4.html > as I understand, they not hide (i.e. drop) the pattern but mix it with > other part in calculations, it cause whole range reduced. > >>> You can download SPRNG library implementing all of them here: >>> http://www.sprng.org/RNG/ >>> For me it is overcomplicated. >> >> The general case is certainly too complicated. It would let the user >> specify all the parameters for the LCG and generate optimal code for >> the choice on the fly. Maybe also change the parameters with the seed. >> But even most implementors don't know how to choose the parameters. >> That's just for the not so good LCG family of RNGs. > > All mentioned PRNGs with exact parameters (info.h) can be found in the > subdirs under SRC, f.e. lcg64 or pmlcfg. They are still looks > complicated and use GMP Bignum library for calculations. From owner-svn-src-head@freebsd.org Tue May 31 13:31:20 2016 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 DEA82B55BAC; Tue, 31 May 2016 13:31:20 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id AC49C1ED9; Tue, 31 May 2016 13:31:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VDVJTg026327; Tue, 31 May 2016 13:31:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VDVJsx026326; Tue, 31 May 2016 13:31:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311331.u4VDVJsx026326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 13:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301037 - head/sys/x86/include 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.22 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: Tue, 31 May 2016 13:31:21 -0000 Author: ed Date: Tue May 31 13:31:19 2016 New Revision: 301037 URL: https://svnweb.freebsd.org/changeset/base/301037 Log: Implement _ALIGN() using internal integer types. The existing version depends on register_t and uintptr_t, which are only available when including headers such as . As this macro is used by , for example, it should be written in such a way that it doesn't depend on those types. Modified: head/sys/x86/include/_align.h Modified: head/sys/x86/include/_align.h ============================================================================== --- head/sys/x86/include/_align.h Tue May 31 12:39:54 2016 (r301036) +++ head/sys/x86/include/_align.h Tue May 31 13:31:19 2016 (r301037) @@ -46,7 +46,7 @@ * for all data types (int, long, ...). The result is unsigned int * and must be cast to any desired pointer type. */ -#define _ALIGNBYTES (sizeof(register_t) - 1) -#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) +#define _ALIGNBYTES (sizeof(__register_t) - 1) +#define _ALIGN(p) (((__uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #endif /* !_X86_INCLUDE__ALIGN_H_ */ From owner-svn-src-head@freebsd.org Tue May 31 13:32:34 2016 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 780C5B55D5B; Tue, 31 May 2016 13:32:34 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id 489B211C5; Tue, 31 May 2016 13:32:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VDWXg0028940; Tue, 31 May 2016 13:32:33 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VDWXAo028939; Tue, 31 May 2016 13:32:33 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311332.u4VDWXAo028939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 13:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301038 - head/sys/sys 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.22 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: Tue, 31 May 2016 13:32:34 -0000 Author: ed Date: Tue May 31 13:32:33 2016 New Revision: 301038 URL: https://svnweb.freebsd.org/changeset/base/301038 Log: Make CMSG_*() work without having NULL available. The is not supposed to declare NULL, according to POSIX. Our implementation complies with that, meaning that we need to make sure that CMSG_*() doesn't use it. Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Tue May 31 13:31:19 2016 (r301037) +++ head/sys/sys/socket.h Tue May 31 13:32:33 2016 (r301038) @@ -500,7 +500,7 @@ struct sockcred { /* given pointer to struct cmsghdr, return pointer to next cmsghdr */ #define CMSG_NXTHDR(mhdr, cmsg) \ - ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \ + ((char *)(cmsg) == (char *)0 ? CMSG_FIRSTHDR(mhdr) : \ ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \ _ALIGN(sizeof(struct cmsghdr)) > \ (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \ @@ -515,7 +515,7 @@ struct sockcred { #define CMSG_FIRSTHDR(mhdr) \ ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ (struct cmsghdr *)(mhdr)->msg_control : \ - (struct cmsghdr *)NULL) + (struct cmsghdr *)0) #if __BSD_VISIBLE /* RFC 2292 additions */ From owner-svn-src-head@freebsd.org Tue May 31 13:32:37 2016 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 5CB35B55D73 for ; Tue, 31 May 2016 13:32:37 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD2411C9 for ; Tue, 31 May 2016 13:32:36 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 52785 invoked by uid 89); 31 May 2016 13:32:35 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 31 May 2016 13:32:32 -0000 Received: (qmail 64305 invoked by uid 89); 31 May 2016 07:28:30 -0000 Received: by simscan 1.3.1 ppid: 64295, pid: 64299, t: 0.0048s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 31 May 2016 07:28:30 -0000 Received: (qmail 28870 invoked by uid 89); 31 May 2016 07:28:30 -0000 Received: by simscan 1.4.0 ppid: 28843, pid: 28863, t: 1.0305s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 31 May 2016 07:28:29 -0000 From: Jan Beich To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys ... References: <201605310412.u4V4CEh4021513@repo.freebsd.org> Date: Tue, 31 May 2016 09:28:10 +0200 In-Reply-To: <201605310412.u4V4CEh4021513@repo.freebsd.org> (Allan Jude's message of "Tue, 31 May 2016 04:12:14 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 13:32:37 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Allan Jude writes: > Author: allanjude > Date: Tue May 31 04:12:14 2016 > New Revision: 301010 > URL: https://svnweb.freebsd.org/changeset/base/301010 > > Log: > Connect the SHA-512t256 and Skein hashing algorithms to ZFS >=20=20=20 > Support for the new hashing algorithms in ZFS was introduced in r289422 > However it was disconnected because FreeBSD lacked implementations of > SHA-512 (truncated to 256 bits), and Skein. >=20=20=20 > These implementations were introduced in r300921 and r300966 respective= ly >=20=20=20 > This commit connects them to ZFS and enabled these new checksum algorit= hms >=20=20=20 > This new algorithms are not supported by the boot blocks, so do not use= them > on your root dataset if you boot from ZFS. Can you document the feature and booting caveat in zpool-features(7) manpag= e? And Illumos seems to limit booting support to pools vs. datasets. Booting off of pools using skein is NOT supported -- any attempt to enable skein on a root pool will fail with an error. https://illumos.org/man/5/zpool-features --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJXTT0KXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bJUIH/i4tRaUsLYYmt4hUBVHEMXkm 7OUOdyll25wHPBtYBbF/n5SiBa3ndMDleD1sVdtpHM4Ep4xObs0YeJ+au9/slOZr aLCjNBKFY5A90BwsD2OKIclcxeq7ZfoT+TIotaMAWIWfv+z/KS4R527oNARq3jAo Hun026/4YXwW4ZF7oPrsLDJrXRhI0myaIRoj6Gg2NnnUVLUj3hhJB4KMFt6zDv+L n32bEG3FwtGA7kSGH0BcmFK3AruFD/vZP33+DJku95rbkSLIOpDXbBbXuQj42uTF nJC8r4nC153qwjQMB+6FBVSvpP8aDnUZlvbAckUzGh5oDrNQH7g1hHX1NXBHoq8= =YOVp -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Tue May 31 14:17:57 2016 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 A8DE5B54B6F; Tue, 31 May 2016 14:17:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 3DCA71F21; Tue, 31 May 2016 14:17:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 2088B1A2FFB; Wed, 1 Jun 2016 00:17:47 +1000 (AEST) Date: Wed, 1 Jun 2016 00:17:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300956 - head/lib/libc/stdlib In-Reply-To: Message-ID: <20160531224808.F3933@besplex.bde.org> References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> <20160531155327.I1534@besplex.bde.org> <20160531185907.Y2047@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=YcMFh1NDAAAA:8 a=q67_N1wWW2dDZDP7g5AA:9 a=CjuIK1q_8ugA:10 a=XzeFQDB4FLgTs7H1q4LV:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 14:17:57 -0000 On Tue, 31 May 2016, Andrey Chernov wrote: > On 31.05.2016 12:58, Bruce Evans wrote: >> On Tue, 31 May 2016, Andrey Chernov wrote: > ... >>> You can download SPRNG library implementing all of them here: >>> http://www.sprng.org/RNG/ >>> For me it is overcomplicated. >> >> The general case is certainly too complicated. It would let the user >> specify all the parameters for the LCG and generate optimal code for >> the choice on the fly. Maybe also change the parameters with the seed. >> But even most implementors don't know how to choose the parameters. >> That's just for the not so good LCG family of RNGs. > > All mentioned PRNGs with exact parameters (info.h) can be found in the > subdirs under SRC, f.e. lcg64 or pmlcfg. They are still looks > complicated and use GMP Bignum library for calculations. Our rand should use just 1, and it is dangerous to change RAND_MAX again, but can we even change the sequences? Something might depend on reproducing the old sequences. >>> For fixups, see full >>> explanation in the comment of stdlib/div.c >> >> That was what I was complaining about. div.c is for C90 (misspelled >> "ANSI"). div.c hasn't caught up with C99. C99 broke this by changing >> ... >> >> In C90, div() is specified as giving "reliable" division, and that is >> what the fixups implement. This now wastes time to change nothing. >> If the hardware does correct rounding, then the compiler already >> had to do the fixup and id should have produced good MD code for this. >> The C code then adds not so good MI code. > > It seems POSIX says nothing about any fixup and negative results: > "These functions shall compute the quotient and remainder of the > division of the numerator numer by the denominator denom. If the > division is inexact, the resulting quotient is the long integer (for the > ldiv( ) function) or long long integer (for the lldiv( ) function) of > lesser magnitude that is the nearest to the algebraic quotient. If the > result cannot be represented, the behavior is undefined; otherwise, quot > * denom+rem shall equal numer." This uses the same not so good wording as C90. "algebraic" means "in the field of ordinary rational numbers", not in a general algebraic object. Then we use the ordering property of the rationals, so we're closer to analysis than algebra. POSIX doesn't define the division operator, and the difference is only there, except for bugs in the wording. In C90, the rounding can go either way so the fixup is needed, but in C99 and C11 the division operator is intended to be specified to do the same rounding as div() used to be specified to do, but with the unimproved wording "the result [of division] is the algebraic quotient with any fractional part discarded". C99 and C11 remove the special wording for div(). This removes all ordering requirements from the standard (1 was moved to a footnote), so C has "unreliable" division again, depending on the unspecified choice of sign for the fractional part. > Does it mean that this fixup should be removed? Just ifdef it for < C99. This corresponds to removing the special wording in >= C99. Bruce From owner-svn-src-head@freebsd.org Tue May 31 14:25:51 2016 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 4C112B54F2E for ; Tue, 31 May 2016 14:25:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE9351715 for ; Tue, 31 May 2016 14:25:50 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f67.google.com with SMTP id h68so10226696lfh.3 for ; Tue, 31 May 2016 07:25:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=f2L4cbsIbE9S9KVWOSszu+Y9Xp0WMEQLqqf3JXmzMdM=; b=dZw85+skNscQoKkat2ytEZw0w2Qe9NDfd44TxPunw+V9KxBdPmKhn7WIYfkl8eyXN6 J8M0ebjBJ/zVcIHxVUcEP7p17o6R0r8Y1luVY7JV4bqnmVu0HCuImtcthkKQgzfQqgrv K56TTLVeN/2CCQ6L3DMYowCSrPxL9dVSfPvhd0RE849xEmCcxzEzOYvHCpYsrGb8Tymi TI2U0tL7PMNiX78A6tnBpb5N/nFFr1N0/lln+uSlLMDxtDg9jWxSWgopy/fz6vSUpSxu CFmVJ5frsTwBi+LvZbLSkHIAY+LLkUY7SxRfISaveLZu1dCHZZulO8ump5D+6/KG8LpS C+mQ== X-Gm-Message-State: ALyK8tJuRKMtFDxjwNpcEDpcCdaCiVe33itzZkepSB9axBJkteAOgWVidOwYsR4TDeBIgg== X-Received: by 10.25.161.132 with SMTP id k126mr4156074lfe.101.1464704748383; Tue, 31 May 2016 07:25:48 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id d202sm1868729lfe.36.2016.05.31.07.25.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2016 07:25:47 -0700 (PDT) Subject: Re: svn commit: r300956 - head/lib/libc/stdlib To: Bruce Evans References: <201605291357.u4TDv6No071840@repo.freebsd.org> <20160530110541.I924@besplex.bde.org> <20160531155327.I1534@besplex.bde.org> <20160531185907.Y2047@besplex.bde.org> <20160531224808.F3933@besplex.bde.org> Cc: pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <4f2f6e12-a50e-5463-75a4-6bb8d91350ae@freebsd.org> Date: Tue, 31 May 2016 17:25:46 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531224808.F3933@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 14:25:51 -0000 On 31.05.2016 17:17, Bruce Evans wrote: > Our rand should use just 1, and it is dangerous to change RAND_MAX again, > but can we even change the sequences? Something might depend on > reproducing the old sequences. This question already arises many times. The sequence must be reproducible during program runtime only, it is impossible to change implementation at all otherwise. If someone needs something always reproducible it needs to implement their own PRNG. From owner-svn-src-head@freebsd.org Tue May 31 14:40:26 2016 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 32BF3B55516 for ; Tue, 31 May 2016 14:40:26 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F08F311A9 for ; Tue, 31 May 2016 14:40:25 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22a.google.com with SMTP id x189so190263117ywe.3 for ; Tue, 31 May 2016 07:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=+i0J8tM2a6NRYsbCBYsmgRYtBEOC8jcnuvaGJcZjMH4=; b=ftJqkqOfccT/vpoBC5hJ6QIsqF5riChuKO2HtClw5F760sQFQflTE9sWnz69w4eIFy g0vYIBxta+qJj69gSbwFxQBx2etWk8uuknBypLUp1LAgy+i/jqT74LSz7jgmNixHqbN7 vNp9Ecgx1IrBeH+uihsHa2VSizOLR4WsNnxkQyTiuKhWqYhLd+UwP/Qm2KATjPH65GEc hTz7p6Q3LL/xO6Rlzk+2WmN3Kb5Jb1Dl0Qe7AE2ubPEv9Z5pfG/Zk3RmYe0JUOQdL6qf rOTT6gyxANfw3X5udn2T810Xi96fD5ze3FBzu7thxFQzQM4tWMa5VaWgc6/a8oVt7ZzF pbcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=+i0J8tM2a6NRYsbCBYsmgRYtBEOC8jcnuvaGJcZjMH4=; b=JPCmJnbmDJfzkoEarIg9YcQ3mjk0z7C1gvSwTaYQ+7IReiNgF/eg/KXhcgPua53KyD gHk7r2xRM+FVO7wnX+OPuytt9dpPcgxYTjaaPTVQ8p8U68gTH8hzQu/EdWfSIHuz9fsB V/18cZpEPvDvSN1gY6fjAMUpGS3lOVwhMopyIegXKapZKVwz9OAA7EiD6soSyv9f0BmO vUsb0Ob5tGnripoQB4FKT1oFyxbTmZ0Tb7QzAhem7/SWI65ea1NrU9E7KIfvVW7sWIYe r2qaZX9TuBRsciSnQWqrMtRN1lYCzEeuCQhiu0bczMcnYGeMZqQSq2smF13YNC+FTPjS 1biA== X-Gm-Message-State: ALyK8tJBCWGI2oOa9d9n7qaQvWQpVrNv7pMbB+grd0J4mom2VXBJxq3jm6Ttu3qIsOutoctNiKSpVsXD1E4M1Q== MIME-Version: 1.0 X-Received: by 10.129.53.70 with SMTP id c67mr21900602ywa.149.1464705624932; Tue, 31 May 2016 07:40:24 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Tue, 31 May 2016 07:40:24 -0700 (PDT) In-Reply-To: <574C7E89.3080102@FreeBSD.org> References: <201605301652.u4UGqNeu070540@repo.freebsd.org> <574C7E89.3080102@FreeBSD.org> Date: Tue, 31 May 2016 16:40:24 +0200 Message-ID: Subject: Re: svn commit: r300999 - in head: include lib/libc/db/man From: Ed Schouten To: Pedro Giffuni Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 14:40:26 -0000 2016-05-30 19:55 GMT+02:00 Pedro Giffuni : > IMHO, just before a new release is the perfect time to break the ABI, and > POSIX > is a good reason to do it. I thought about it a bit more and switching this over to size_t will only cause breakage on 64-bit big endian platforms. On 32-bit systems this would have no effect. On 64-bit little endian systems, we'd still load the bottom four bytes, which is all right. We could use symbol versioning to deal with this, but I don't think it's worth the effort. I've sent out a code review to both of you: https://reviews.freebsd.org/D6660 If anyone wants to share their thoughts on the proposed change, feel free to leave a comment. I'll hold off for a couple of days before submitting. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Tue May 31 14:45:02 2016 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 47C7EB55A6D; Tue, 31 May 2016 14:45:02 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 2C44F1A28; Tue, 31 May 2016 14:45:01 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 711D5D06C; Tue, 31 May 2016 14:44:55 +0000 (UTC) Subject: Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys ... To: Ivan Klymenko References: <201605310412.u4V4CEh4021513@repo.freebsd.org> <20160531144155.7e96c5a5@nonamehost.local> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <10b10f89-0212-2a9d-06ed-6477ef658962@freebsd.org> Date: Tue, 31 May 2016 10:44:54 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531144155.7e96c5a5@nonamehost.local> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 14:45:02 -0000 On 2016-05-31 07:41, Ivan Klymenko wrote: > On Tue, 31 May 2016 04:12:14 +0000 (UTC) > Allan Jude wrote: > >> Author: allanjude >> Date: Tue May 31 04:12:14 2016 >> New Revision: 301010 >> URL: https://svnweb.freebsd.org/changeset/base/301010 >> >> Log: >> Connect the SHA-512t256 and Skein hashing algorithms to ZFS >> >> Support for the new hashing algorithms in ZFS was introduced in >> r289422 However it was disconnected because FreeBSD lacked >> implementations of SHA-512 (truncated to 256 bits), and Skein. >> >> These implementations were introduced in r300921 and r300966 >> respectively >> This commit connects them to ZFS and enabled these new checksum >> algorithms >> This new algorithms are not supported by the boot blocks, so do not >> use them on your root dataset if you boot from ZFS. >> > > Hello. > > Tell me please, who is now the fastest of these algorithms? > > What remains of the available algorithms checksum algorithm by default? > > Thanks. > None of the old checksums were removed This means the available checksums are (from fastest to slowest): off (bad idea) fletcher2 (not recommended, weak) fletcher4 (default) edon-r (not implemented, possibly insecure) skein sha512 sha256 -- Allan Jude From owner-svn-src-head@freebsd.org Tue May 31 15:05:51 2016 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 CB677B55048; Tue, 31 May 2016 15:05:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8160F1447; Tue, 31 May 2016 15:05:51 +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 u4VF5oTN062757; Tue, 31 May 2016 15:05:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VF5oai062756; Tue, 31 May 2016 15:05:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605311505.u4VF5oai062756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 31 May 2016 15:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301039 - head/sys/dev/sound/usb 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.22 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: Tue, 31 May 2016 15:05:51 -0000 Author: hselasky Date: Tue May 31 15:05:50 2016 New Revision: 301039 URL: https://svnweb.freebsd.org/changeset/base/301039 Log: Add support for simplex USB MIDI devices, which only provide BULK or INTERRUPT endpoints for moving data in one direction, like the KeyRig 49 from M-Audio. Requested by: Ivan Klymenko MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue May 31 13:32:33 2016 (r301038) +++ head/sys/dev/sound/usb/uaudio.c Tue May 31 15:05:50 2016 (r301039) @@ -657,6 +657,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UMIDI_TX_BUFFER, + .flags = {.no_pipe_ok = 1}, .callback = &umidi_bulk_write_callback, }, @@ -665,7 +666,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 4, /* bytes */ - .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,}, + .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1}, .callback = &umidi_bulk_read_callback, }, }; @@ -5754,7 +5755,16 @@ umidi_start_write(struct usb_fifo *fifo) { struct umidi_chan *chan = usb_fifo_softc(fifo); - usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]); + if (chan->xfer[UMIDI_TX_TRANSFER] == NULL) { + uint8_t buf[1]; + int actlen; + do { + /* dump data */ + usb_fifo_get_data_linear(fifo, buf, 1, &actlen, 0); + } while (actlen > 0); + } else { + usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]); + } } static void @@ -5872,6 +5882,11 @@ umidi_probe(device_t dev) DPRINTF("error=%s\n", usbd_errstr(error)); goto detach; } + if (chan->xfer[UMIDI_TX_TRANSFER] == NULL && + chan->xfer[UMIDI_RX_TRANSFER] == NULL) { + DPRINTF("no BULK or INTERRUPT MIDI endpoint(s) found\n"); + goto detach; + } /* * Some USB MIDI device makers couldn't resist using @@ -5885,7 +5900,8 @@ umidi_probe(device_t dev) * and 64-byte maximum packet sizes for full-speed bulk * endpoints and 512 bytes for high-speed bulk endpoints." */ - if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER])) + if (chan->xfer[UMIDI_TX_TRANSFER] != NULL && + usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER])) chan->single_command = 1; if (chan->single_command != 0) From owner-svn-src-head@freebsd.org Tue May 31 15:27:34 2016 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 A4E2EB557F8; Tue, 31 May 2016 15:27:34 +0000 (UTC) (envelope-from trasz@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 mx1.freebsd.org (Postfix) with ESMTPS id 657FE10E0; Tue, 31 May 2016 15:27:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VFRXK0069963; Tue, 31 May 2016 15:27:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VFRXeo069961; Tue, 31 May 2016 15:27:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605311527.u4VFRXeo069961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 May 2016 15:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301040 - head/sys/kern 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.22 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: Tue, 31 May 2016 15:27:34 -0000 Author: trasz Date: Tue May 31 15:27:33 2016 New Revision: 301040 URL: https://svnweb.freebsd.org/changeset/base/301040 Log: Cosmetics - add missing space after ellipses in shutdown messages. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_shutdown.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue May 31 15:05:50 2016 (r301039) +++ head/sys/kern/kern_shutdown.c Tue May 31 15:27:33 2016 (r301040) @@ -804,7 +804,7 @@ kproc_shutdown(void *arg, int howto) return; p = (struct proc *)arg; - printf("Waiting (max %d seconds) for system process `%s' to stop...", + printf("Waiting (max %d seconds) for system process `%s' to stop... ", kproc_shutdown_wait, p->p_comm); error = kproc_suspend(p, kproc_shutdown_wait * hz); @@ -824,7 +824,7 @@ kthread_shutdown(void *arg, int howto) return; td = (struct thread *)arg; - printf("Waiting (max %d seconds) for system thread `%s' to stop...", + printf("Waiting (max %d seconds) for system thread `%s' to stop... ", kproc_shutdown_wait, td->td_name); error = kthread_suspend(td, kproc_shutdown_wait * hz); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue May 31 15:05:50 2016 (r301039) +++ head/sys/kern/vfs_subr.c Tue May 31 15:27:33 2016 (r301040) @@ -2103,7 +2103,7 @@ sched_sync(void) if (syncer_state != SYNCER_RUNNING && starttime != time_uptime) { if (first_printf) { - printf("\nSyncing disks, vnodes remaining..."); + printf("\nSyncing disks, vnodes remaining... "); first_printf = 0; } printf("%d ", net_worklist_len); From owner-svn-src-head@freebsd.org Tue May 31 15:28:15 2016 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 83F70B55860; Tue, 31 May 2016 15:28:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 1B78F1275; Tue, 31 May 2016 15:28:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id E608FD482E3; Wed, 1 Jun 2016 01:27:36 +1000 (AEST) Date: Wed, 1 Jun 2016 01:27:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301037 - head/sys/x86/include In-Reply-To: <201605311331.u4VDVJsx026326@repo.freebsd.org> Message-ID: <20160601002420.E4290@besplex.bde.org> References: <201605311331.u4VDVJsx026326@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=601Tv2UmQkKc8qJsVvkA:9 a=TZs5M-pYK4HSh4mO:21 a=4OdDGVmxTXIp9jHn:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 15:28:15 -0000 On Tue, 31 May 2016, Ed Schouten wrote: > Log: > Implement _ALIGN() using internal integer types. > > The existing version depends on register_t and uintptr_t, which are only > available when including headers such as . As this macro is > used by , for example, it should be written in such a way > that it doesn't depend on those types. It was originally carefully written to not have this dependency. This was broken by merging the amd64 and i386 versions. > Modified: head/sys/x86/include/_align.h > ============================================================================== > --- head/sys/x86/include/_align.h Tue May 31 12:39:54 2016 (r301036) > +++ head/sys/x86/include/_align.h Tue May 31 13:31:19 2016 (r301037) > @@ -46,7 +46,7 @@ > * for all data types (int, long, ...). The result is unsigned int > * and must be cast to any desired pointer type. > */ The comment is still broken. It still hard-codes the i386 type, so is wrong for amd64. The orginaly i386 version spelled "unsigned" verbosely as "unsigned int" in the comment but not in the code. The code now uses __uintptr_t. My version uses the following old fixes: X diff -u2 param.h~ param.h X --- param.h~ Thu Apr 8 23:21:42 2004 X +++ param.h Thu Apr 8 23:21:43 2004 X @@ -40,20 +40,12 @@ X /* X * Round p (pointer or byte index) up to a correctly-aligned value X - * for all data types (int, long, ...). The result is unsigned int X - * and must be cast to any desired pointer type. X + * for all data types (int, long, ...). The result is compatible with X + * uintptr_t and must be cast to any desired pointer type. X */ X -#ifndef _ALIGNBYTES X #define _ALIGNBYTES (sizeof(int) - 1) X -#endif X -#ifndef _ALIGN X #define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) X -#endif X ... The fixes here are: - don't say what the type is. Only say that it is compatible with something - say it is compatible with uintptr_t and don't just echo the implementation's use of unsigned. -current already uses __uintptr_t in the code. - the verbose spelling goes away as a side effect - remove ifdefs. Redefinition with the same value is harmless, and the ifdefs just break detection of incorrect redefinitions. The original amd64 version was more broken here. It used u_long throughout that looks better, but is broken since u_long is in the application namespace. The comment is also broken on arm64. Plain arm was changed recently. It now has slightly better but unnecessarily different wording in the comment. mips uses u_long consistently, but that is probably a type mismatch with size_t. powerpc has the same 2 bugs as x86 had before this fix. riscv only has the wrong comment like arm64 (if it is 64 bits) sparc64 only has the wrong comment. > -#define _ALIGNBYTES (sizeof(register_t) - 1) > -#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) > +#define _ALIGNBYTES (sizeof(__register_t) - 1) > +#define _ALIGN(p) (((__uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) > > #endif /* !_X86_INCLUDE__ALIGN_H_ */ The existence of this file is another bug. The original version was carefully written to live in , although that requires complications to avoid namespace pollution in . Now with the merged amd64 and i386, it takes 2 extra include files instead of only 1 extra just to define 2 macros. First there is which just points here; then there is . Misimplementations like that are one reason for bloated build times (bloat for kernels with no modules since FreeBSD-4 is approximately 3 times in kernel size, 6 times in .depend/number of #include's, and more than 6 for build times. Over nfs mounted without -cto, build times are almost proportional to the number of #include statements unless you have a fast network and break +cto using large -j. is too large and complicated to merge, so with the alignment macros back in it, they have to be duplicated. This is a feature. They can use unsigned [long], so you can see what the types are without decoding 10 layers of nested includes and ifdefs. Bruce From owner-svn-src-head@freebsd.org Tue May 31 16:03:59 2016 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 74969B5679A; Tue, 31 May 2016 16:03:59 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCC761DC0; Tue, 31 May 2016 16:03:58 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: by mail-lf0-x234.google.com with SMTP id b73so71320295lfb.3; Tue, 31 May 2016 09:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=tonzwofdne68kTXpNKcwjGdYqBK1iQEHeLPA/VOihks=; b=ZUzgDwpVy2VmbsTx5qPy8uKXgY/oQmsnKLXwkz99MQ4gfwZXdGwHZ8pulPe07vaTu9 q8zoApA60yyvrbKL3AG7ydp+YdFnbCGFiJpTsHmoHN28ps0kdLCXThA+81klJa4hZFwu OGxoxN0cQoVZQm2bQ1BJjvtWM95fQcGCYuzghvm6Rtsksig4W8HYAUM/OZaL8oHYPPtk lSUhtTy5B8XguJhFiFRJ49o8MTp967u14DipTjTofho3/2eIm3kebjhnyLGbKNLO8cOW I4XeXcBvoiivwndWecuT0sQZumOI22Laod6LW1BFo/65ra0+J2RhLBRsS/J9Y1k3/S44 zSrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=tonzwofdne68kTXpNKcwjGdYqBK1iQEHeLPA/VOihks=; b=QZjLOoBICEQy7eqnFTgOzYZxmQ2/q2XNgLrsNMN6d1XXPq9yRnFWt5excbJawtHKza kWyS5wYR8TMzQcKcN6X0ekWKI3RZT0mHhLsPstlA1KXCEIql23Oy/ZqKZUmfxsLUfNRU K8npYTuJHmwxR59ls9J5b5qh4rWjtTr3oNZXFccUoH4xsS/fZxHtSXcFX9s/oE+jjDRL oRGRyVMuU2iMlNJTbEkc/wflpl3wVr/cEAiyocSq3XO8d8R01WAF5zrTo++qGf4XVHmp TYJao/b3odYTUAazeAEj1OfvQRUei64Sgf60epJ2UtO+hBM+2pTzSmMpPaUiyZ8Utow8 91Fw== X-Gm-Message-State: ALyK8tKaNuae3qMdIdSNRFitKGTgZAVBLR/7GK4xNGKxEuM+1heorX+lMUbfVdCiOuv3mvzBtAYnmLP9hZTqdw== MIME-Version: 1.0 X-Received: by 10.25.134.2 with SMTP id i2mr7588239lfd.1.1464710636713; Tue, 31 May 2016 09:03:56 -0700 (PDT) Sender: mahrens@gmail.com Received: by 10.114.93.199 with HTTP; Tue, 31 May 2016 09:03:56 -0700 (PDT) In-Reply-To: <10b10f89-0212-2a9d-06ed-6477ef658962@freebsd.org> References: <201605310412.u4V4CEh4021513@repo.freebsd.org> <20160531144155.7e96c5a5@nonamehost.local> <10b10f89-0212-2a9d-06ed-6477ef658962@freebsd.org> Date: Tue, 31 May 2016 09:03:56 -0700 X-Google-Sender-Auth: PynjUX6CKAq_fnqk7XB-m7-XPNo Message-ID: Subject: Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys ... From: Matthew Ahrens To: Allan Jude Cc: Ivan Klymenko , "src-committers@freebsd.org" , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 16:03:59 -0000 On Tue, May 31, 2016 at 7:44 AM, Allan Jude wrote: > On 2016-05-31 07:41, Ivan Klymenko wrote: > > On Tue, 31 May 2016 04:12:14 +0000 (UTC) > > Allan Jude wrote: > > > >> Author: allanjude > >> Date: Tue May 31 04:12:14 2016 > >> New Revision: 301010 > >> URL: https://svnweb.freebsd.org/changeset/base/301010 > >> > >> Log: > >> Connect the SHA-512t256 and Skein hashing algorithms to ZFS > >> > >> Support for the new hashing algorithms in ZFS was introduced in > >> r289422 However it was disconnected because FreeBSD lacked > >> implementations of SHA-512 (truncated to 256 bits), and Skein. > >> > >> These implementations were introduced in r300921 and r300966 > >> respectively > >> This commit connects them to ZFS and enabled these new checksum > >> algorithms > >> This new algorithms are not supported by the boot blocks, so do not > >> use them on your root dataset if you boot from ZFS. > >> > > > > Hello. > > > > Tell me please, who is now the fastest of these algorithms? > > > > What remains of the available algorithms checksum algorithm by default? > > > > Thanks. > > > > None of the old checksums were removed > This means the available checksums are (from fastest to slowest): > > off (bad idea) > fletcher2 (not recommended, weak) > fletcher4 (default) > edon-r (not implemented, possibly insecure) > To be clear, all of the above are (possibly) insecure. Edon-R and fletcher4 are not used for dedup, so they doesn't need to be secure. Edon-R can be used for nop-write, which also doesn't need to be secure, it just needs to prevent accidental hash collisions (intentional ones are fine, because they only mess up the block being written, and if you can write then by definition you can arbitrarily modify the block being written). That said, even intentional collisions with Edon-R would be nontrivial, because of the secret salt. This is documented in the zpool-features manpage: edonr GUID org.illumos:edonr READ-ONLY COMPATIBLE no DEPENDENCIES none This feature enables the use of the Edon-R hash algorithm for checksum, including for nopwrite (if compression is also enabled, an overwrite of a block whose checksum matches the data being written will be ignored). In an abundance of caution, Edon-R can not be used with dedup (without verification). Edon-R is a very high-performance hash algorithm that was part of the NIST SHA-3 competition. It provides extremely high hash performance (over 350% faster than SHA-256), but was not selected because of its unsuitability as a general purpose secure hash algorithm. This implementation utilizes the new salted checksumming functionality in ZFS, which means that the checksum is pre-seeded with a secret 256-bit random key (stored on the pool) before being fed the data block to be checksummed. Thus the produced checksums are unique to a given pool, blocking hash collision attacks on systems with dedup. --matt > skein > sha512 > sha256 > > -- > Allan Jude > > From owner-svn-src-head@freebsd.org Tue May 31 16:05:55 2016 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 AAE46B5682F; Tue, 31 May 2016 16:05:55 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 7BA9D1F66; Tue, 31 May 2016 16:05:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VG5sF3084705; Tue, 31 May 2016 16:05:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VG5st3084704; Tue, 31 May 2016 16:05:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605311605.u4VG5st3084704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 16:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301041 - head/sys/dev/ath/ath_hal 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.22 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: Tue, 31 May 2016 16:05:55 -0000 Author: adrian Date: Tue May 31 16:05:54 2016 New Revision: 301041 URL: https://svnweb.freebsd.org/changeset/base/301041 Log: [ath_hal] reserve a HAL_TXDESC_ bit for azimuth TX timestamp requests. Modified: head/sys/dev/ath/ath_hal/ah_desc.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Tue May 31 15:27:33 2016 (r301040) +++ head/sys/dev/ath/ath_hal/ah_desc.h Tue May 31 16:05:54 2016 (r301041) @@ -280,7 +280,8 @@ struct ath_desc_status { #define HAL_TXDESC_EXT_AND_CTL 0x0100 /* send on ext + ctl channels (11n) */ #define HAL_TXDESC_VMF 0x0200 /* virtual more frag */ #define HAL_TXDESC_LOWRXCHAIN 0x0400 /* switch to low RX chain */ -#define HAL_TXDESC_LDPC 0x1000 +#define HAL_TXDESC_LDPC 0x1000 /* Set LDPC TX for all rates */ +#define HAL_TXDESC_HWTS 0x2000 /* Request Azimuth Timestamp in TX payload */ /* flags passed to rx descriptor setup methods */ #define HAL_RXDESC_INTREQ 0x0020 /* enable per-descriptor interrupt */ From owner-svn-src-head@freebsd.org Tue May 31 16:07:16 2016 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 ABB32B56893; Tue, 31 May 2016 16:07:16 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 7DA0A1100; Tue, 31 May 2016 16:07:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VG7FlY084796; Tue, 31 May 2016 16:07:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VG7FTc084795; Tue, 31 May 2016 16:07:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605311607.u4VG7FTc084795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 16:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301042 - head/sys/dev/ath/ath_hal/ar5416 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.22 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: Tue, 31 May 2016 16:07:16 -0000 Author: adrian Date: Tue May 31 16:07:15 2016 New Revision: 301042 URL: https://svnweb.freebsd.org/changeset/base/301042 Log: [ath_hal] add support for setting the azimuth timestamp in the outgoing TX payload. FYI: This is an unsupported/deprecated feature of the 11n hardware. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue May 31 16:05:54 2016 (r301041) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue May 31 16:07:15 2016 (r301042) @@ -352,6 +352,7 @@ ar5416SetupTxDesc(struct ath_hal *ah, st /* * XXX For now, just assume that this isn't a HT40 frame. + * It'll get over-ridden by the multi-rate TX power setup. */ if (AH5212(ah)->ah_tpcEnabled) { txPower = ar5416GetTxRatePower(ah, txRate0, @@ -368,6 +369,7 @@ ar5416SetupTxDesc(struct ath_hal *ah, st ; ads->ds_ctl1 = (type << AR_FrameType_S) | (flags & HAL_TXDESC_NOACK ? AR_NoAck : 0) + | (flags & HAL_TXDESC_HWTS ? AR_InsertTS : 0) ; ads->ds_ctl2 = SM(txTries0, AR_XmitDataTries0) | (flags & HAL_TXDESC_DURENA ? AR_DurUpdateEn : 0) @@ -450,6 +452,10 @@ ar5416SetupXTxDesc(struct ath_hal *ah, s return AH_TRUE; } +/* + * XXX TODO: Figure out if AR_InsertTS is required on all sub-frames + * of a TX descriptor. + */ HAL_BOOL ar5416FillTxDesc(struct ath_hal *ah, struct ath_desc *ds, HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int descId, From owner-svn-src-head@freebsd.org Tue May 31 16:08:08 2016 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 32684B568E8; Tue, 31 May 2016 16:08:08 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id DE3E31289; Tue, 31 May 2016 16:08:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VG87Mk084871; Tue, 31 May 2016 16:08:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VG86om084869; Tue, 31 May 2016 16:08:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605311608.u4VG86om084869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 31 May 2016 16:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301043 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal 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.22 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: Tue, 31 May 2016 16:08:08 -0000 Author: adrian Date: Tue May 31 16:08:06 2016 New Revision: 301043 URL: https://svnweb.freebsd.org/changeset/base/301043 Log: [ath_hal] rename the MCI state info routine. It's not /really/ "get state". Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Tue May 31 16:07:15 2016 (r301042) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Tue May 31 16:08:06 2016 (r301043) @@ -303,6 +303,15 @@ ar9300_attach_freebsd_ops(struct ath_hal /* MCI bluetooth functions */ if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) { + /* + * Note: these are done in attach too for now, because + * at this point we haven't yet setup the mac/bb revision + * values, so this code is effectively NULL. + * However, I'm leaving this here so people digging + * into the code (a) see the MCI bits here, and (b) + * are now told they should look elsewhere for + * these methods. + */ ah->ah_btCoexSetWeights = ar9300_mci_bt_coex_set_weights; ah->ah_btCoexDisable = ar9300_mci_bt_coex_disable; ah->ah_btCoexEnable = ar9300_mci_bt_coex_enable; @@ -310,7 +319,7 @@ ar9300_attach_freebsd_ops(struct ath_hal ah->ah_btMciSetup = ar9300_mci_setup; ah->ah_btMciSendMessage = ar9300_mci_send_message; ah->ah_btMciGetInterrupt = ar9300_mci_get_interrupt; - ah->ah_btMciGetState = ar9300_mci_state; + ah->ah_btMciState = ar9300_mci_state; ah->ah_btMciDetach = ar9300_mci_detach; /* LNA diversity functions */ Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue May 31 16:07:15 2016 (r301042) +++ head/sys/dev/ath/ath_hal/ah.h Tue May 31 16:08:06 2016 (r301043) @@ -1513,7 +1513,7 @@ struct ath_hal { HAL_BOOL, HAL_BOOL); uint32_t __ahdecl(*ah_btMciGetInterrupt)(struct ath_hal *, uint32_t *, uint32_t *); - uint32_t __ahdecl(*ah_btMciGetState)(struct ath_hal *, + uint32_t __ahdecl(*ah_btMciState)(struct ath_hal *, uint32_t, uint32_t *); void __ahdecl(*ah_btMciDetach)(struct ath_hal *); From owner-svn-src-head@freebsd.org Tue May 31 16:28:57 2016 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 62AD2B56EA8; Tue, 31 May 2016 16:28:57 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 2FECA13CD; Tue, 31 May 2016 16:28:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VGSuxK092855; Tue, 31 May 2016 16:28:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VGSuMt092854; Tue, 31 May 2016 16:28:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311628.u4VGSuMt092854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 16:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301045 - head/sys/arm64/arm64 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.22 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: Tue, 31 May 2016 16:28:57 -0000 Author: andrew Date: Tue May 31 16:28:56 2016 New Revision: 301045 URL: https://svnweb.freebsd.org/changeset/base/301045 Log: Enable setting BF_COHERENT on DMA tags. This allows the kernel to start using the cache handling functions. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Tue May 31 16:23:56 2016 (r301044) +++ head/sys/arm64/arm64/busdma_bounce.c Tue May 31 16:28:56 2016 (r301045) @@ -184,10 +184,8 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->map_count = 0; newtag->segments = NULL; -#ifdef notyet if ((flags & BUS_DMA_COHERENT) != 0) newtag->bounce_flags |= BF_COHERENT; -#endif if (parent != NULL) { if ((newtag->common.filter != NULL || From owner-svn-src-head@freebsd.org Tue May 31 16:56:31 2016 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 D6D28B5586A; Tue, 31 May 2016 16:56:31 +0000 (UTC) (envelope-from glebius@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 mx1.freebsd.org (Postfix) with ESMTPS id A84861EF2; Tue, 31 May 2016 16:56:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VGuUxh004643; Tue, 31 May 2016 16:56:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VGuU2i004639; Tue, 31 May 2016 16:56:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605311656.u4VGuU2i004639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 31 May 2016 16:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301053 - in head/sys: compat/linux kern 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.22 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: Tue, 31 May 2016 16:56:31 -0000 Author: glebius Date: Tue May 31 16:56:30 2016 New Revision: 301053 URL: https://svnweb.freebsd.org/changeset/base/301053 Log: Fix kernel stack disclosures in the Linux and 4.3BSD compat layers. Submitted by: CTurt Security: SA-16:20 Security: SA-16:21 Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_misc.c head/sys/kern/vfs_syscalls.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Tue May 31 16:55:50 2016 (r301052) +++ head/sys/compat/linux/linux_ioctl.c Tue May 31 16:56:30 2016 (r301053) @@ -916,6 +916,8 @@ linux_ioctl_termio(struct thread *td, st case LINUX_TIOCGSERIAL: { struct linux_serial_struct lss; + + bzero(&lss, sizeof(lss)); lss.type = LINUX_PORT_16550A; lss.flags = 0; lss.close_delay = 0; Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue May 31 16:55:50 2016 (r301052) +++ head/sys/compat/linux/linux_misc.c Tue May 31 16:56:30 2016 (r301053) @@ -149,6 +149,7 @@ linux_sysinfo(struct thread *td, struct int i, j; struct timespec ts; + bzero(&sysinfo, sizeof(sysinfo)); getnanouptime(&ts); if (ts.tv_nsec != 0) ts.tv_sec++; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue May 31 16:55:50 2016 (r301052) +++ head/sys/kern/vfs_syscalls.c Tue May 31 16:56:30 2016 (r301053) @@ -2068,6 +2068,7 @@ cvtstat(st, ost) struct ostat *ost; { + bzero(ost, sizeof(*ost)); ost->st_dev = st->st_dev; ost->st_ino = st->st_ino; ost->st_mode = st->st_mode; From owner-svn-src-head@freebsd.org Tue May 31 17:23:28 2016 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 55C7AB57F0F; Tue, 31 May 2016 17:23:28 +0000 (UTC) (envelope-from remko@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 mx1.freebsd.org (Postfix) with ESMTPS id 285831832; Tue, 31 May 2016 17:23:28 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VHNRgj015780; Tue, 31 May 2016 17:23:27 GMT (envelope-from remko@FreeBSD.org) Received: (from remko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VHNRcA015779; Tue, 31 May 2016 17:23:27 GMT (envelope-from remko@FreeBSD.org) Message-Id: <201605311723.u4VHNRcA015779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: remko set sender to remko@FreeBSD.org using -f From: Remko Lodder Date: Tue, 31 May 2016 17:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301058 - head/share/misc 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.22 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: Tue, 31 May 2016 17:23:28 -0000 Author: remko Date: Tue May 31 17:23:27 2016 New Revision: 301058 URL: https://svnweb.freebsd.org/changeset/base/301058 Log: Update the Security Team member list with the actual members. Discussed with: glebius Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Tue May 31 17:15:57 2016 (r301057) +++ head/share/misc/organization.dot Tue May 31 17:23:27 2016 (r301058) @@ -33,7 +33,7 @@ portscommitters [label="Ports Committers portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nerwin, mat, swills,\nmiwi"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] -secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] +secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, junovitch, miwi, rea, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] From owner-svn-src-head@freebsd.org Tue May 31 18:04:17 2016 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 ADD90B56636; Tue, 31 May 2016 18:04:17 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 4F75318F2; Tue, 31 May 2016 18:04:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VI4Gxh030423; Tue, 31 May 2016 18:04:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VI4GN3030422; Tue, 31 May 2016 18:04:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605311804.u4VI4GN3030422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 31 May 2016 18:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301061 - head/sys/dev/sfxge/common 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.22 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: Tue, 31 May 2016 18:04:17 -0000 Author: arybchik Date: Tue May 31 18:04:16 2016 New Revision: 301061 URL: https://svnweb.freebsd.org/changeset/base/301061 Log: sfxge(4): regenerate MCDI headers from firmwaresrc .yml Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Tue May 31 17:49:47 2016 (r301060) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Tue May 31 18:04:16 2016 (r301061) @@ -5115,16 +5115,20 @@ #define MC_CMD_POLL_BIST_MEM_BUS_MC 0x0 /* enum: CSR IREG bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_CSR 0x1 -/* enum: RX DPCPU bus. */ +/* enum: RX0 DPCPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2 /* enum: TX0 DPCPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3 /* enum: TX1 DPCPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4 -/* enum: RX DICPU bus. */ +/* enum: RX0 DICPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5 /* enum: TX DICPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6 +/* enum: RX1 DPCPU bus. */ +#define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX1 0x7 +/* enum: RX1 DICPU bus. */ +#define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX1 0x8 /* Pattern written to RAM / register */ #define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16 /* Actual value read from RAM / register */ @@ -6094,6 +6098,8 @@ #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1 #define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1 +#define MC_CMD_NVRAM_INFO_OUT_CMAC_LBN 6 +#define MC_CMD_NVRAM_INFO_OUT_CMAC_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7 #define MC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16 @@ -6887,6 +6893,8 @@ * the command will fail with MC_CMD_ERR_FILTERS_PRESENT. */ #define MC_CMD_WORKAROUND_BUG26807 0x6 +/* enum: Bug 61265 work around (broken EVQ TMR writes). */ +#define MC_CMD_WORKAROUND_BUG61265 0x7 /* 0 = disable the workaround indicated by TYPE; any non-zero value = enable * the workaround */ @@ -7865,8 +7873,10 @@ #define NVRAM_PARTITION_TYPE_SPARE_1 0x1100 /* enum: Spare partition 2 */ #define NVRAM_PARTITION_TYPE_SPARE_2 0x1200 -/* enum: Spare partition 3 */ -#define NVRAM_PARTITION_TYPE_SPARE_3 0x1300 +/* enum: Manufacturing partition. Used during manufacture to pass information + * between XJTAG and Manftest. + */ +#define NVRAM_PARTITION_TYPE_MANUFACTURING 0x1300 /* enum: Spare partition 4 */ #define NVRAM_PARTITION_TYPE_SPARE_4 0x1400 /* enum: Spare partition 5 */ @@ -7901,6 +7911,8 @@ #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM 0x40 /* enum: Network Access Control */ #define LICENSED_APP_ID_NETWORK_ACCESS_CONTROL 0x80 +/* enum: TCP Direct */ +#define LICENSED_APP_ID_TCP_DIRECT 0x100 #define LICENSED_APP_ID_ID_LBN 0 #define LICENSED_APP_ID_ID_WIDTH 32 @@ -7957,6 +7969,12 @@ #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_WIDTH 1 #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_LBN 7 #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_WIDTH 1 +#define LICENSED_V3_APPS_TCP_DIRECT_LBN 8 +#define LICENSED_V3_APPS_TCP_DIRECT_WIDTH 1 +#define LICENSED_V3_APPS_LOW_LATENCY_LBN 9 +#define LICENSED_V3_APPS_LOW_LATENCY_WIDTH 1 +#define LICENSED_V3_APPS_SOLARCAPTURE_TAP_LBN 10 +#define LICENSED_V3_APPS_SOLARCAPTURE_TAP_WIDTH 1 #define LICENSED_V3_APPS_MASK_LBN 0 #define LICENSED_V3_APPS_MASK_WIDTH 64 @@ -7985,6 +8003,8 @@ #define LICENSED_V3_FEATURES_TX_SNIFF_WIDTH 1 #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_LBN 8 #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_WIDTH 1 +#define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_LBN 9 +#define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_WIDTH 1 #define LICENSED_V3_FEATURES_MASK_LBN 0 #define LICENSED_V3_FEATURES_MASK_WIDTH 64 @@ -8142,6 +8162,109 @@ /* Only valid if INTRFLAG was true */ #define MC_CMD_INIT_EVQ_OUT_IRQ_OFST 0 +/* MC_CMD_INIT_EVQ_V2_IN msgrequest */ +#define MC_CMD_INIT_EVQ_V2_IN_LENMIN 44 +#define MC_CMD_INIT_EVQ_V2_IN_LENMAX 548 +#define MC_CMD_INIT_EVQ_V2_IN_LEN(num) (36+8*(num)) +/* Size, in entries */ +#define MC_CMD_INIT_EVQ_V2_IN_SIZE_OFST 0 +/* Desired instance. Must be set to a specific instance, which is a function + * local queue index. + */ +#define MC_CMD_INIT_EVQ_V2_IN_INSTANCE_OFST 4 +/* The initial timer value. The load value is ignored if the timer mode is DIS. + */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_LOAD_OFST 8 +/* The reload value is ignored in one-shot modes */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_RELOAD_OFST 12 +/* tbd */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAGS_OFST 16 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_LBN 0 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_LBN 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_LBN 2 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_LBN 3 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_LBN 4 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_LBN 5 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_LBN 6 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LBN 7 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_WIDTH 4 +/* enum: All initialisation flags specified by host. */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_MANUAL 0x0 +/* enum: MEDFORD only. Certain initialisation flags specified by host may be + * over-ridden by firmware based on licenses and firmware variant in order to + * provide the lowest latency achievable. See + * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags. + */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY 0x1 +/* enum: MEDFORD only. Certain initialisation flags specified by host may be + * over-ridden by firmware based on licenses and firmware variant in order to + * provide the best throughput achievable. See + * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags. + */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT 0x2 +/* enum: MEDFORD only. Certain initialisation flags may be over-ridden by + * firmware based on licenses and firmware variant. See + * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags. + */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO 0x3 +#define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_OFST 20 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_DIS 0x0 +/* enum: Immediate */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_IMMED_START 0x1 +/* enum: Triggered */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_TRIG_START 0x2 +/* enum: Hold-off */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF 0x3 +/* Target EVQ for wakeups if in wakeup mode. */ +#define MC_CMD_INIT_EVQ_V2_IN_TARGET_EVQ_OFST 24 +/* Target interrupt if in interrupting mode (note union with target EVQ). Use + * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test + * purposes. + */ +#define MC_CMD_INIT_EVQ_V2_IN_IRQ_NUM_OFST 24 +/* Event Counter Mode. */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_OFST 28 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_DIS 0x0 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RX 0x1 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_TX 0x2 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RXTX 0x3 +/* Event queue packet count threshold. */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_THRSHLD_OFST 32 +/* 64-bit address of 4k of 4k-aligned host memory buffer */ +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_OFST 36 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LEN 8 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LO_OFST 36 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_HI_OFST 40 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MINNUM 1 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MAXNUM 64 + +/* MC_CMD_INIT_EVQ_V2_OUT msgresponse */ +#define MC_CMD_INIT_EVQ_V2_OUT_LEN 8 +/* Only valid if INTRFLAG was true */ +#define MC_CMD_INIT_EVQ_V2_OUT_IRQ_OFST 0 +/* Actual configuration applied on the card */ +#define MC_CMD_INIT_EVQ_V2_OUT_FLAGS_OFST 4 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_LBN 0 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_LBN 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_LBN 2 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_LBN 3 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_WIDTH 1 + /* QUEUE_CRC_MODE structuredef */ #define QUEUE_CRC_MODE_LEN 1 #define QUEUE_CRC_MODE_MODE_LBN 0 @@ -8206,8 +8329,8 @@ #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1 #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9 #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1 -#define MC_CMD_INIT_RXQ_IN_FLAG_FORCE_EV_MERGING_LBN 10 -#define MC_CMD_INIT_RXQ_IN_FLAG_FORCE_EV_MERGING_WIDTH 1 +#define MC_CMD_INIT_RXQ_IN_UNUSED_LBN 10 +#define MC_CMD_INIT_RXQ_IN_UNUSED_WIDTH 1 /* Owner ID to use if in buffer mode (zero if physical) */ #define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20 /* The port ID associated with the v-adaptor which should contain this DMAQ. */ @@ -10427,6 +10550,12 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_LBN 4 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -11600,7 +11729,7 @@ #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMIN 12 #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMAX 252 #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LEN(num) (0+12*(num)) -/* Raw buffer table entries, laid out as BUFTBL_ENTRY. */ +/* Raw buffer table entries, layed out as BUFTBL_ENTRY. */ #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_OFST 0 #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_LEN 12 #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MINNUM 1 @@ -13013,29 +13142,39 @@ #define MC_CMD_0xd4_PRIVILEGE_CTG SRIOV_CTG_GENERAL /* MC_CMD_LICENSED_V3_VALIDATE_APP_IN msgrequest */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 72 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 62 +/* challenge for validation (384 bits) */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 48 /* application ID expressed as a single bit mask */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_OFST 48 #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LEN 8 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 0 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 4 -/* challenge for validation */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 8 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 64 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 48 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 52 +/* MAC address of the calling client MC_CMD_ERR_EPERM is returned if the + * calling client is not allowed to use this MAC address. + */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_MACADDR_OFST 56 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_MACADDR_LEN 6 /* MC_CMD_LICENSED_V3_VALIDATE_APP_OUT msgresponse */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 72 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 104 +/* validation response to challenge in the form of ECDSA signature consisting + * of two 384-bit integers, r and s, in big-endian order. The signature signs a + * SHA-384 digest of a message constructed from the concatenation of the input + * message and the remaining fields of this output message, e.g. challenge[48 + * bytes] ... expiry_time[4 bytes] ... + */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_LEN 96 /* application expiry time */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_OFST 96 /* application expiry units */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_OFST 4 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_OFST 100 /* enum: expiry units are accounting units */ #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_ACC 0x0 /* enum: expiry units are calendar days */ #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_DAYS 0x1 -/* validation response to challenge */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_OFST 8 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_LEN 64 /***********************************/ @@ -13066,6 +13205,71 @@ /***********************************/ +/* MC_CMD_LICENSING_V3_TEMPORARY + * Perform operations to support installation of a single temporary license in + * the adapter, in addition to those found in the licensing partition. See + * SF-116124-SW for an overview of how this could be used. The license is + * stored in MC persistent data and so will survive a MC reboot, but will be + * erased when the adapter is power cycled + */ +#define MC_CMD_LICENSING_V3_TEMPORARY 0xd6 +#undef MC_CMD_0xd6_PRIVILEGE_CTG + +#define MC_CMD_0xd6_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_LEN 4 +/* operation code */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_OP_OFST 0 +/* enum: install a new license, overwriting any existing temporary license. + * This is an asynchronous operation owing to the time taken to validate an + * ECDSA license + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_SET 0x0 +/* enum: clear the license immediately rather than waiting for the next power + * cycle + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_CLEAR 0x1 +/* enum: get the status of the asynchronous MC_CMD_LICENSING_V3_TEMPORARY_SET + * operation + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS 0x2 + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN_SET msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LEN 164 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_OP_OFST 0 +/* ECDSA license and signature */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_OFST 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_LEN 160 + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_LEN 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_OP_OFST 0 + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_LEN 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_OP_OFST 0 + +/* MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS msgresponse */ +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LEN 12 +/* status code */ +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_STATUS_OFST 0 +/* enum: finished validating and installing license */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_OK 0x0 +/* enum: license validation and installation in progress */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_IN_PROGRESS 0x1 +/* enum: licensing error. More specific error messages are not provided to + * avoid exposing details of the licensing system to the client + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_ERROR 0x2 +/* bitmask of licensed features */ +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_OFST 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LEN 8 +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LO_OFST 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_HI_OFST 8 + + +/***********************************/ /* MC_CMD_SET_PORT_SNIFF_CONFIG * Configure RX port sniffing for the physical port associated with the calling * function. Only a privileged function may change the port sniffing @@ -13414,6 +13618,8 @@ #define MC_CMD_GET_WORKAROUNDS_OUT_BUG42008 0x20 /* enum: Bug 26807 features present in firmware (multicast filter chaining) */ #define MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 0x40 +/* enum: Bug 61265 work around (broken EVQ TMR writes). */ +#define MC_CMD_GET_WORKAROUNDS_OUT_BUG61265 0x80 /***********************************/ @@ -14342,19 +14548,15 @@ #define MC_CMD_0x118_PRIVILEGE_CTG SRIOV_CTG_ADMIN /* MC_CMD_RX_BALANCING_IN msgrequest */ -#define MC_CMD_RX_BALANCING_IN_LEN 4 +#define MC_CMD_RX_BALANCING_IN_LEN 16 /* The RX port whose upconverter table will be modified */ #define MC_CMD_RX_BALANCING_IN_PORT_OFST 0 -#define MC_CMD_RX_BALANCING_IN_PORT_LEN 1 /* The VLAN priority associated to the table index and vFIFO */ -#define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 1 -#define MC_CMD_RX_BALANCING_IN_PRIORITY_LEN 1 +#define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 4 /* The resulting bit of SRC^DST for indexing the table */ -#define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 2 -#define MC_CMD_RX_BALANCING_IN_SRC_DST_LEN 1 +#define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 8 /* The RX engine to which the vFIFO in the table entry will point to */ -#define MC_CMD_RX_BALANCING_IN_ENG_OFST 3 -#define MC_CMD_RX_BALANCING_IN_ENG_LEN 1 +#define MC_CMD_RX_BALANCING_IN_ENG_OFST 12 /* MC_CMD_RX_BALANCING_OUT msgresponse */ #define MC_CMD_RX_BALANCING_OUT_LEN 0 @@ -14368,6 +14570,9 @@ * available to host software. */ #define MC_CMD_TSA_BIND 0x119 +#undef MC_CMD_0x119_PRIVILEGE_CTG + +#define MC_CMD_0x119_PRIVILEGE_CTG SRIOV_CTG_ADMIN /* MC_CMD_TSA_BIND_IN msgrequest: Protocol operation code */ #define MC_CMD_TSA_BIND_IN_LEN 4 @@ -14431,9 +14636,11 @@ #define MC_CMD_TSA_BIND_IN_SET_KEY_DATKEY_MAXNUM 248 /* MC_CMD_TSA_BIND_IN_UNBIND msgrequest: Asks for the un-binding procedure */ -#define MC_CMD_TSA_BIND_IN_UNBIND_LEN 6 +#define MC_CMD_TSA_BIND_IN_UNBIND_LEN 10 +/* The operation requested. */ +#define MC_CMD_TSA_BIND_IN_UNBIND_OP_OFST 0 /* TSAN unique identifier for the network adapter */ -#define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_OFST 0 +#define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_OFST 4 #define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_LEN 6 /* MC_CMD_TSA_BIND_OUT_GET_ID msgresponse */ @@ -14550,4 +14757,291 @@ #define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_MINNUM 1 #define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_MAXNUM 248 + +/***********************************/ +/* MC_CMD_NVRAM_PRIVATE_APPEND + * Append a single TLV to the MC_USAGE_TLV partition. Returns MC_CMD_ERR_EEXIST + * if the tag is already present. + */ +#define MC_CMD_NVRAM_PRIVATE_APPEND 0x11c +#undef MC_CMD_0x11c_PRIVILEGE_CTG + +#define MC_CMD_0x11c_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_NVRAM_PRIVATE_APPEND_IN msgrequest */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMIN 9 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMAX 252 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LEN(num) (8+1*(num)) +/* The tag to be appended */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_TAG_OFST 0 +/* The length of the data */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENGTH_OFST 4 +/* The data to be contained in the TLV structure */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_OFST 8 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_LEN 1 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MINNUM 1 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MAXNUM 244 + +/* MC_CMD_NVRAM_PRIVATE_APPEND_OUT msgresponse */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_XPM_VERIFY_CONTENTS + * Verify that the contents of the XPM memory is correct (Medford only). This + * is used during manufacture to check that the XPM memory has been programmed + * correctly at ATE. + */ +#define MC_CMD_XPM_VERIFY_CONTENTS 0x11b +#undef MC_CMD_0x11b_PRIVILEGE_CTG + +#define MC_CMD_0x11b_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_XPM_VERIFY_CONTENTS_IN msgrequest */ +#define MC_CMD_XPM_VERIFY_CONTENTS_IN_LEN 4 +/* Data type to be checked */ +#define MC_CMD_XPM_VERIFY_CONTENTS_IN_DATA_TYPE_OFST 0 + +/* MC_CMD_XPM_VERIFY_CONTENTS_OUT msgresponse */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMIN 12 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMAX 252 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LEN(num) (12+1*(num)) +/* Number of sectors found (test builds only) */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_SECTORS_OFST 0 +/* Number of bytes found (test builds only) */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_BYTES_OFST 4 +/* Length of signature */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIG_LENGTH_OFST 8 +/* Signature */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_OFST 12 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_LEN 1 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MINNUM 0 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MAXNUM 240 + + +/***********************************/ +/* MC_CMD_SET_EVQ_TMR + * Update the timer load, timer reload and timer mode values for a given EVQ. + * The requested timer values (in TMR_LOAD_REQ_NS and TMR_RELOAD_REQ_NS) will + * be rounded up to the granularity supported by the hardware, then truncated + * to the range supported by the hardware. The resulting value after the + * rounding and truncation will be returned to the caller (in TMR_LOAD_ACT_NS + * and TMR_RELOAD_ACT_NS). + */ +#define MC_CMD_SET_EVQ_TMR 0x120 +#undef MC_CMD_0x120_PRIVILEGE_CTG + +#define MC_CMD_0x120_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_SET_EVQ_TMR_IN msgrequest */ +#define MC_CMD_SET_EVQ_TMR_IN_LEN 16 +/* Function-relative queue instance */ +#define MC_CMD_SET_EVQ_TMR_IN_INSTANCE_OFST 0 +/* Requested value for timer load (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS_OFST 4 +/* Requested value for timer reload (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS_OFST 8 +/* Timer mode. Meanings as per EVQ_TMR_REG.TC_TIMER_VAL */ +#define MC_CMD_SET_EVQ_TMR_IN_TMR_MODE_OFST 12 +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_DIS 0x0 /* enum */ +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_IMMED_START 0x1 /* enum */ +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_TRIG_START 0x2 /* enum */ +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_INT_HLDOFF 0x3 /* enum */ + +/* MC_CMD_SET_EVQ_TMR_OUT msgresponse */ +#define MC_CMD_SET_EVQ_TMR_OUT_LEN 8 +/* Actual value for timer load (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_OUT_TMR_LOAD_ACT_NS_OFST 0 +/* Actual value for timer reload (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_OUT_TMR_RELOAD_ACT_NS_OFST 4 + + +/***********************************/ +/* MC_CMD_GET_EVQ_TMR_PROPERTIES + * Query properties about the event queue timers. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES 0x122 +#undef MC_CMD_0x122_PRIVILEGE_CTG + +#define MC_CMD_0x122_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_GET_EVQ_TMR_PROPERTIES_IN msgrequest */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_IN_LEN 0 + +/* MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT msgresponse */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_LEN 36 +/* Reserved for future use. */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_FLAGS_OFST 0 +/* For timers updated via writes to EVQ_TMR_REG, this is the time interval (in + * nanoseconds) for each increment of the timer load/reload count. The + * requested duration of a timer is this value multiplied by the timer + * load/reload count. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_NS_PER_COUNT_OFST 4 +/* For timers updated via writes to EVQ_TMR_REG, this is the maximum value + * allowed for timer load/reload counts. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_MAX_COUNT_OFST 8 +/* For timers updated via writes to EVQ_TMR_REG, timer load/reload counts not a + * multiple of this step size will be rounded in an implementation defined + * manner. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_STEP_OFST 12 +/* Maximum timer duration (in nanoseconds) for timers updated via MCDI. Only + * meaningful if MC_CMD_SET_EVQ_TMR is implemented. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_MAX_NS_OFST 16 +/* Timer durations requested via MCDI that are not a multiple of this step size + * will be rounded up. Only meaningful if MC_CMD_SET_EVQ_TMR is implemented. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_STEP_NS_OFST 20 +/* For timers updated using the bug35388 workaround, this is the time interval + * (in nanoseconds) for each increment of the timer load/reload count. The + * requested duration of a timer is this value multiplied by the timer + * load/reload count. This field is only meaningful if the bug35388 workaround + * is enabled. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_NS_PER_COUNT_OFST 24 +/* For timers updated using the bug35388 workaround, this is the maximum value + * allowed for timer load/reload counts. This field is only meaningful if the + * bug35388 workaround is enabled. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_MAX_COUNT_OFST 28 +/* For timers updated using the bug35388 workaround, timer load/reload counts + * not a multiple of this step size will be rounded in an implementation + * defined manner. This field is only meaningful if the bug35388 workaround is + * enabled. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_STEP_OFST 32 + + +/***********************************/ +/* MC_CMD_ALLOCATE_TX_VFIFO_CP + * When we use the TX_vFIFO_ULL mode, we can allocate common pools using the + * non used switch buffers. + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP 0x11d +#undef MC_CMD_0x11d_PRIVILEGE_CTG + +#define MC_CMD_0x11d_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN msgrequest */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_LEN 20 +/* Desired instance. Must be set to a specific instance, which is a function + * local queue index. + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INSTANCE_OFST 0 +/* Will the common pool be used as TX_vFIFO_ULL (1) */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_MODE_OFST 4 +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_ENABLED 0x1 /* enum */ +/* enum: Using this interface without TX_vFIFO_ULL is not supported for now */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_DISABLED 0x0 +/* Number of buffers to reserve for the common pool */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_SIZE_OFST 8 +/* TX datapath to which the Common Pool is connected to. */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INGRESS_OFST 12 +/* enum: Extracts information from function */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1 +/* Network port or RX Engine to which the common pool connects. */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_EGRESS_OFST 16 +/* enum: Extracts information from function */ +/* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT0 0x0 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT1 0x1 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT2 0x2 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT3 0x3 /* enum */ +/* enum: To enable Switch loopback with Rx engine 0 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE0 0x4 +/* enum: To enable Switch loopback with Rx engine 1 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE1 0x5 + +/* MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT msgresponse */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_LEN 4 +/* ID of the common pool allocated */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_CP_ID_OFST 0 + + +/***********************************/ +/* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO + * When we use the TX_vFIFO_ULL mode, we can allocate vFIFOs using the + * previously allocated common pools. + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO 0x11e +#undef MC_CMD_0x11e_PRIVILEGE_CTG + +#define MC_CMD_0x11e_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN msgrequest */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LEN 20 +/* Common pool previously allocated to which the new vFIFO will be associated + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_CP_OFST 0 +/* Port or RX engine to associate the vFIFO egress */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_EGRESS_OFST 4 +/* enum: Extracts information from common pool */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_USE_CP_VALUE -0x1 +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT0 0x0 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT1 0x1 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT2 0x2 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT3 0x3 /* enum */ +/* enum: To enable Switch loopback with Rx engine 0 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE0 0x4 +/* enum: To enable Switch loopback with Rx engine 1 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE1 0x5 +/* Minimum number of buffers that the pool must have */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_SIZE_OFST 8 +/* enum: Do not check the space available */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_NO_MINIMUM 0x0 +/* Will the vFIFO be used as TX_vFIFO_ULL */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_MODE_OFST 12 +/* Network priority of the vFIFO,if applicable */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PRIORITY_OFST 16 +/* enum: Search for the lowest unused priority */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LOWEST_AVAILABLE -0x1 + +/* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT msgresponse */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_LEN 8 +/* Short vFIFO ID */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_VID_OFST 0 +/* Network priority of the vFIFO */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_PRIORITY_OFST 4 + + +/***********************************/ +/* MC_CMD_TEARDOWN_TX_VFIFO_VF + * This interface clears the configuration of the given vFIFO and leaves it + * ready to be re-used. + */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF 0x11f +#undef MC_CMD_0x11f_PRIVILEGE_CTG + +#define MC_CMD_0x11f_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_TEARDOWN_TX_VFIFO_VF_IN msgrequest */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_LEN 4 +/* Short vFIFO ID */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_VFIFO_OFST 0 + +/* MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT msgresponse */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_DEALLOCATE_TX_VFIFO_CP + * This interface clears the configuration of the given common pool and leaves + * it ready to be re-used. + */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP 0x121 +#undef MC_CMD_0x121_PRIVILEGE_CTG + +#define MC_CMD_0x121_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN msgrequest */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_LEN 4 +/* Common pool ID given when pool allocated */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_POOL_ID_OFST 0 + +/* MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT msgresponse */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT_LEN 0 + #endif /* _SIENA_MC_DRIVER_PCOL_H */ From owner-svn-src-head@freebsd.org Tue May 31 17:30:09 2016 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 C4BF0B58644; Tue, 31 May 2016 17:30:09 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 945E510A8; Tue, 31 May 2016 17:30:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VHU8dA016049; Tue, 31 May 2016 17:30:08 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VHU8Z4016044; Tue, 31 May 2016 17:30:08 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605311730.u4VHU8Z4016044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 31 May 2016 17:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301059 - head/sbin/ifconfig 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.22 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: Tue, 31 May 2016 17:30:09 -0000 Author: allanjude Date: Tue May 31 17:30:08 2016 New Revision: 301059 URL: https://svnweb.freebsd.org/changeset/base/301059 Log: ifconfig(8) now supports some output formatting options specified by the -f flag or IFCONFIG_FORMAT environment variable, the user can request that inet4 subnet masks be printed in CIDR or dotted-quad notation, in addition to the traditional hex output. inet6 prefixes can be printed in CIDR as well. For more documentation see the ifconfig(8) man page. PR: 169072 Requested by: seanc, marcel, brd, many others Reviewed by: gnn, jhb (earlier version) Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2856 Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Tue May 31 17:23:27 2016 (r301058) +++ head/sbin/ifconfig/af_inet.c Tue May 31 17:30:08 2016 (r301059) @@ -54,11 +54,14 @@ static const char rcsid[] = static struct in_aliasreq in_addreq; static struct ifreq in_ridreq; +static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ +extern char *f_inet, *f_addr; static void in_status(int s __unused, const struct ifaddrs *ifa) { struct sockaddr_in *sin, null_sin; + int error, n_flags; memset(&null_sin, 0, sizeof(null_sin)); @@ -66,19 +69,47 @@ in_status(int s __unused, const struct i if (sin == NULL) return; - printf("\tinet %s ", inet_ntoa(sin->sin_addr)); + if (f_addr != NULL && strcmp(f_addr, "fqdn") == 0) + n_flags = 0; + else if (f_addr != NULL && strcmp(f_addr, "host") == 0) + n_flags = NI_NOFQDN; + else + n_flags = NI_NUMERICHOST; + + error = getnameinfo((struct sockaddr *)sin, sin->sin_len, addr_buf, + sizeof(addr_buf), NULL, 0, n_flags); + + if (error) + inet_ntop(AF_INET, &sin->sin_addr, addr_buf, sizeof(addr_buf)); + + printf("\tinet %s", addr_buf); if (ifa->ifa_flags & IFF_POINTOPOINT) { sin = (struct sockaddr_in *)ifa->ifa_dstaddr; if (sin == NULL) sin = &null_sin; - printf("--> %s ", inet_ntoa(sin->sin_addr)); + printf(" --> %s ", inet_ntoa(sin->sin_addr)); } sin = (struct sockaddr_in *)ifa->ifa_netmask; if (sin == NULL) sin = &null_sin; - printf("netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); + if (f_inet != NULL && strcmp(f_inet, "cidr") == 0) { + int cidr = 32; + unsigned long smask; + + smask = ntohl(sin->sin_addr.s_addr); + while ((smask & 1) == 0) { + smask = smask >> 1; + cidr--; + if (cidr == 0) + break; + } + printf("/%d ", cidr); + } else if (f_inet != NULL && strcmp(f_inet, "dotted") == 0) + printf(" netmask %s ", inet_ntoa(sin->sin_addr)); + else + printf(" netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); if (ifa->ifa_flags & IFF_BROADCAST) { sin = (struct sockaddr_in *)ifa->ifa_broadaddr; Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Tue May 31 17:23:27 2016 (r301058) +++ head/sbin/ifconfig/af_inet6.c Tue May 31 17:30:08 2016 (r301059) @@ -65,6 +65,7 @@ static int ip6lifetime; static int prefix(void *, int); static char *sec2str(time_t); static int explicit_prefix = 0; +extern char *f_inet6, *f_addr, *f_scope; extern void setnd6flags(const char *, int, int, const struct afswtch *); extern void setnd6defif(const char *, int, int, const struct afswtch *); @@ -172,9 +173,10 @@ in6_status(int s __unused, const struct struct in6_ifreq ifr6; int s6; u_int32_t flags6; + const u_int16_t *a; struct in6_addrlifetime lifetime; struct timespec now; - int error; + int error, n_flags, i; clock_gettime(CLOCK_MONOTONIC_FAST, &now); @@ -206,12 +208,30 @@ in6_status(int s __unused, const struct lifetime = ifr6.ifr_ifru.ifru_lifetime; close(s6); - error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, addr_buf, - sizeof(addr_buf), NULL, 0, NI_NUMERICHOST); - if (error != 0) - inet_ntop(AF_INET6, &sin->sin6_addr, addr_buf, - sizeof(addr_buf)); - printf("\tinet6 %s ", addr_buf); + if (f_addr != NULL && strcmp(f_addr, "full") == 0) { + a = (const u_int16_t *)&sin->sin6_addr; + printf("\tinet6 "); + for (i = 0; i < 8; i++) { + printf("%04hx", ntohs(*(a + i))); + if (i < 7) + printf(":"); + } + } else { + if (f_addr != NULL && strcmp(f_addr, "fqdn") == 0) + n_flags = 0; + else if (f_addr != NULL && strcmp(f_addr, "host") == 0) + n_flags = NI_NOFQDN; + else + n_flags = NI_NUMERICHOST; + error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, + addr_buf, sizeof(addr_buf), NULL, 0, + n_flags); + if (error != 0 || + (f_scope != NULL && strcmp(f_scope, "none") == 0)) + inet_ntop(AF_INET6, &sin->sin6_addr, addr_buf, + sizeof(addr_buf)); + printf("\tinet6 %s", addr_buf); + } if (ifa->ifa_flags & IFF_POINTOPOINT) { sin = (struct sockaddr_in6 *)ifa->ifa_dstaddr; @@ -229,15 +249,19 @@ in6_status(int s __unused, const struct if (error != 0) inet_ntop(AF_INET6, &sin->sin6_addr, addr_buf, sizeof(addr_buf)); - printf("--> %s ", addr_buf); + printf(" --> %s ", addr_buf); } } sin = (struct sockaddr_in6 *)ifa->ifa_netmask; if (sin == NULL) sin = &null_sin; - printf("prefixlen %d ", prefix(&sin->sin6_addr, - sizeof(struct in6_addr))); + if (f_inet6 != NULL && strcmp(f_inet6, "cidr") == 0) + printf("/%d ", prefix(&sin->sin6_addr, + sizeof(struct in6_addr))); + else + printf(" prefixlen %d ", prefix(&sin->sin6_addr, + sizeof(struct in6_addr))); if ((flags6 & IN6_IFF_ANYCAST) != 0) printf("anycast "); @@ -256,7 +280,8 @@ in6_status(int s __unused, const struct if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0) printf("prefer_source "); - if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) + if ((f_scope == NULL || strcmp(f_scope, "none") != 0) && + ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) printf("scopeid 0x%x ", ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); Modified: head/sbin/ifconfig/af_link.c ============================================================================== --- head/sbin/ifconfig/af_link.c Tue May 31 17:23:27 2016 (r301058) +++ head/sbin/ifconfig/af_link.c Tue May 31 17:30:08 2016 (r301059) @@ -51,19 +51,31 @@ static const char rcsid[] = static struct ifreq link_ridreq; +extern char *f_ether; + static void link_status(int s __unused, const struct ifaddrs *ifa) { /* XXX no const 'cuz LLADDR is defined wrong */ struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; + char *ether_format; + int i; if (sdl != NULL && sdl->sdl_alen > 0) { if ((sdl->sdl_type == IFT_ETHER || sdl->sdl_type == IFT_L2VLAN || sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) - printf("\tether %s\n", - ether_ntoa((struct ether_addr *)LLADDR(sdl))); + if (f_ether != NULL && strcmp(f_ether, "dash") == 0) { + ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl)); + for (i = 0; i < strlen(ether_format); i++) { + if (ether_format[i] == ':') + ether_format[i] = '-'; + } + printf("\tether %s\n", ether_format); + } else + printf("\tether %s\n", + ether_ntoa((struct ether_addr *)LLADDR(sdl))); else { int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Tue May 31 17:23:27 2016 (r301058) +++ head/sbin/ifconfig/ifconfig.8 Tue May 31 17:30:08 2016 (r301059) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd November 6, 2015 +.Dd May 29, 2016 .Dt IFCONFIG 8 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nd configure network interface parameters .Sh SYNOPSIS .Nm +.Op Fl f Ar type:format Ns Op Ar ,type:format .Op Fl L .Op Fl k .Op Fl m @@ -194,6 +195,102 @@ for example, List the interfaces in the given group. .El .Pp +The output format of +.Nm +can be controlled using the +.Fl f +flag or the +.Ev IFCONFIG_FORMAT +environment variable. +The format is specified as a comma separated list of +.Sy type:format +pairs. +See the +.Sx EXAMPLES +section for more information. +The +.Sy types +and their associated +.Sy format +strings are: +.Bl -tag -width scope +.It Sy addr +Adjust the display of inet and inet6 addresses +.Bl -tag -width default +.It Sy default +Display inet and inet6 addresses in the default format, +.Sy numeric +.It Sy fqdn +Display inet and inet6 addresses as fully qualified domain names +.Pq FQDN +.It Sy full +Display inet6 addresses without suppressing zeroes. +Only applicable to inet6 +.It Sy host +Display inet and inet6 addresses as unqualified hostnames +.It Sy numeric +Display inet and inet6 addresses in numeric format +.El +.It Sy ether +Adjust the display of link-level ethernet (MAC) addresses +.Bl -tag -width default +.It Sy colon +Separate address segments with a colon +.It Sy dash +Separate address segments with a dash +.It Sy default +Display ethernet addresses in the default format, +.Sy colon +.El +.It Sy inet +Adjust the display of inet address subnet masks: +.Bl -tag -width default +.It Sy cidr +Display subnet masks in CIDR notation, for example: +.br +10.0.0.0/8 or 203.0.113.224/26 +.It Sy default +Display subnet masks in the default format, +.Sy hex +.It Sy dotted +Display subnet masks in dotted quad notation, for example: +.br +255.255.0.0 or 255.255.255.192 +.It Sy hex +Display subnet masks in hexidecimal, for example: +.br +0xffff0000 or 0xffffffc0 +.El +.It Sy inet6 +Adjust the display of inet6 address prefixes (subnet masks): +.Bl -tag -width default +.It Sy cidr +Display subnet prefix in CIDR notation, for example: +.br +::1/128 or fe80::1%lo0/64 +.It Sy default +Display subnet prefix in the default format +.Sy numeric +.It Sy numeric +Display subnet prefix in integer format, for example: +.br +prefixlen 64 +.El +.It Sy scope +Controls the display of the interface scope as part of the address. +Only applicable to inet6 addresses. +.Bl -tag -width default +.It Sy default +The interface scope and scopeid are included in the address, for example: +.br +inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7 +.It Sy none +The interface scope and scopeid are not displayed, for example: +.br +inet6 fe80::1 prefixlen 64 +.El +.El +.Pp The following parameters may be set with .Nm : .Bl -tag -width indent @@ -2855,6 +2952,9 @@ Destroy the software network interface Display available wireless networks using .Li wlan0 : .Dl # ifconfig wlan0 list scan +.Pp +Display inet and inet6 address subnet masks in CIDR notation +.Dl # ifconfig -f inet:cidr,inet6:cidr .Sh DIAGNOSTICS Messages indicating the specified interface does not exist, the requested address is unknown, or the user is not privileged and Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue May 31 17:23:27 2016 (r301058) +++ head/sbin/ifconfig/ifconfig.c Tue May 31 17:30:08 2016 (r301059) @@ -98,6 +98,9 @@ int printifname = 0; int supmedia = 0; int printkeys = 0; /* Print keying material for interfaces. */ +/* Formatter Strings */ +char *f_inet, *f_inet6, *f_ether, *f_addr, *f_scope; + static int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp); static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, @@ -143,8 +146,8 @@ usage(void) } fprintf(stderr, - "usage: ifconfig %sinterface address_family [address [dest_address]]\n" - " [parameters]\n" + "usage: ifconfig [-f type:format] %sinterface address_family\n" + " [address [dest_address]] [parameters]\n" " ifconfig interface create\n" " ifconfig -a %s[-d] [-m] [-u] [-v] [address_family]\n" " ifconfig -l [-d] [-u] [address_family]\n" @@ -243,6 +246,52 @@ cmpifaddrs(struct ifaddrs *a, struct ifa return (0); } +static void freeformat(void) +{ + + if (f_inet != NULL) + free(f_inet); + if (f_inet6 != NULL) + free(f_inet6); + if (f_ether != NULL) + free(f_ether); + if (f_addr != NULL) + free(f_addr); + if (f_scope != NULL) + free(f_scope); +} + +static void setformat(char *input) +{ + char *formatstr, *category, *modifier; + + formatstr = strdup(input); + while ((category = strsep(&formatstr, ",")) != NULL) { + modifier = strchr(category, ':'); + if (modifier == NULL || modifier[1] == '\0') { + warnx("Skipping invalid format specification: %s\n", + category); + continue; + } + + /* Split the string on the separator, then seek past it */ + modifier[0] = '\0'; + modifier++; + + if (strcmp(category, "addr") == 0) + f_addr = strdup(modifier); + else if (strcmp(category, "ether") == 0) + f_ether = strdup(modifier); + else if (strcmp(category, "inet") == 0) + f_inet = strdup(modifier); + else if (strcmp(category, "inet6") == 0) + f_inet6 = strdup(modifier); + else if (strcmp(category, "scope") == 0) + f_scope = strdup(modifier); + } + free(formatstr); +} + #undef ORDERS_SIZE static struct ifaddrs * @@ -315,7 +364,7 @@ main(int argc, char *argv[]) struct ifaddrs *ifap, *sifap, *ifa; struct ifreq paifr; const struct sockaddr_dl *sdl; - char options[1024], *cp, *namecp = NULL; + char options[1024], *cp, *envformat, *namecp = NULL; struct ifa_queue q = TAILQ_HEAD_INITIALIZER(q); struct ifa_order_elt *cur, *tmp; const char *ifname; @@ -323,7 +372,12 @@ main(int argc, char *argv[]) size_t iflen; all = downonly = uponly = namesonly = noload = verbose = 0; - + f_inet = f_inet6 = f_ether = f_addr = f_scope = NULL; + + envformat = getenv("IFCONFIG_FORMAT"); + if (envformat != NULL) + setformat(envformat); + /* * Ensure we print interface name when expected to, * even if we terminate early due to error. @@ -331,7 +385,7 @@ main(int argc, char *argv[]) atexit(printifnamemaybe); /* Parse leading line options */ - strlcpy(options, "adklmnuv", sizeof(options)); + strlcpy(options, "f:adklmnuv", sizeof(options)); for (p = opts; p != NULL; p = p->next) strlcat(options, p->opt, sizeof(options)); while ((c = getopt(argc, argv, options)) != -1) { @@ -342,6 +396,11 @@ main(int argc, char *argv[]) case 'd': /* restrict scan to "down" interfaces */ downonly++; break; + case 'f': + if (optarg == NULL) + usage(); + setformat(optarg); + break; case 'k': printkeys++; break; @@ -539,6 +598,7 @@ main(int argc, char *argv[]) printf("\n"); freeifaddrs(ifap); + freeformat(); exit(0); } From owner-svn-src-head@freebsd.org Tue May 31 17:49:48 2016 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 B46DCB5A152; Tue, 31 May 2016 17:49:48 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 86E9516E8; Tue, 31 May 2016 17:49:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VHnlcu023106; Tue, 31 May 2016 17:49:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VHnlSK023105; Tue, 31 May 2016 17:49:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311749.u4VHnlSK023105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 17:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301060 - head/sys/arm/arm 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.22 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: Tue, 31 May 2016 17:49:48 -0000 Author: andrew Date: Tue May 31 17:49:47 2016 New Revision: 301060 URL: https://svnweb.freebsd.org/changeset/base/301060 Log: Bin interrupts to the correct CPU when we boot on a non-zero CPU. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue May 31 17:30:08 2016 (r301059) +++ head/sys/arm/arm/gic.c Tue May 31 17:49:47 2016 (r301060) @@ -968,7 +968,7 @@ gic_bind(struct arm_gic_softc *sc, u_int for (mask = 0, cpu = 0; cpu < end; cpu++) if (CPU_ISSET(cpu, cpus)) - mask |= 1 << cpu; + mask |= 1 << arm_gic_map[cpu]; gic_d_write_1(sc, GICD_ITARGETSR(0) + irq, mask); return (0); From owner-svn-src-head@freebsd.org Tue May 31 18:15:19 2016 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 DBF8AB5A0DB; Tue, 31 May 2016 18:15:19 +0000 (UTC) (envelope-from skreuzer@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 mx1.freebsd.org (Postfix) with ESMTPS id ACF251454; Tue, 31 May 2016 18:15:19 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIFIIS035159; Tue, 31 May 2016 18:15:18 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIFIi8035158; Tue, 31 May 2016 18:15:18 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605311815.u4VIFIi8035158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 31 May 2016 18:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301063 - head/release/doc/en_US.ISO8859-1/relnotes 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.22 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: Tue, 31 May 2016 18:15:20 -0000 Author: skreuzer (doc,ports committer) Date: Tue May 31 18:15:18 2016 New Revision: 301063 URL: https://svnweb.freebsd.org/changeset/base/301063 Log: Document r300906, ZFS fault management daemon Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 31 18:05:17 2016 (r301062) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 31 18:15:18 2016 (r301063) @@ -1554,6 +1554,11 @@ code has been updated to take ashift into account when gathering buffers to be written to the l2arc device. + + The zfsd daemon has been added, + which manages hotspares and replements in drive slots that publish + physical paths. From owner-svn-src-head@freebsd.org Tue May 31 18:05:18 2016 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 F10BEB5678C; Tue, 31 May 2016 18:05:18 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id C333F1B2B; Tue, 31 May 2016 18:05:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VI5HVG030512; Tue, 31 May 2016 18:05:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VI5HAR030511; Tue, 31 May 2016 18:05:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311805.u4VI5HAR030511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 18:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301062 - head/sys/arm/arm 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.22 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: Tue, 31 May 2016 18:05:19 -0000 Author: andrew Date: Tue May 31 18:05:17 2016 New Revision: 301062 URL: https://svnweb.freebsd.org/changeset/base/301062 Log: arm_gic_map is a mask not the CPUs ID, there is no need to shift it. Pointy-hat to: andrew Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue May 31 18:04:16 2016 (r301061) +++ head/sys/arm/arm/gic.c Tue May 31 18:05:17 2016 (r301062) @@ -968,7 +968,7 @@ gic_bind(struct arm_gic_softc *sc, u_int for (mask = 0, cpu = 0; cpu < end; cpu++) if (CPU_ISSET(cpu, cpus)) - mask |= 1 << arm_gic_map[cpu]; + mask |= arm_gic_map[cpu]; gic_d_write_1(sc, GICD_ITARGETSR(0) + irq, mask); return (0); From owner-svn-src-head@freebsd.org Tue May 31 18:30:34 2016 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 593A9B5B60C; Tue, 31 May 2016 18:30:34 +0000 (UTC) (envelope-from skreuzer@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 mx1.freebsd.org (Postfix) with ESMTPS id 273AF1D45; Tue, 31 May 2016 18:30:34 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIUXsg038981; Tue, 31 May 2016 18:30:33 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIUXk3038980; Tue, 31 May 2016 18:30:33 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605311830.u4VIUXk3038980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 31 May 2016 18:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301064 - head/release/doc/en_US.ISO8859-1/relnotes 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.22 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: Tue, 31 May 2016 18:30:34 -0000 Author: skreuzer (doc,ports committer) Date: Tue May 31 18:30:33 2016 New Revision: 301064 URL: https://svnweb.freebsd.org/changeset/base/301064 Log: Document r300240, net.inet.tcp.ecn.enable now is a three way setting Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 31 18:15:18 2016 (r301063) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 31 18:30:33 2016 (r301064) @@ -1734,6 +1734,43 @@ The network stack has been updated to fix handling of IPv6 On-Link redirects. + + The net.inet.tcp.ecn.enable sysctl mib has been + changed from a binary off/on control to a three way setting. + + + + + + + + Value + Description + + + + + + 0 + Totally disable ECN. + + + + 1 + Enable ECN if incoming connections request it. Outgoing + connections will request ECN. + + + + 2 + Enable ECN if incoming connections request it. Outgoing + conections will not request ECN. + + + + + + From owner-svn-src-head@freebsd.org Tue May 31 18:45:53 2016 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 DE28CB5B62B; Tue, 31 May 2016 18:45:53 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id B9BDB1A5B; Tue, 31 May 2016 18:45:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIjqSP046384; Tue, 31 May 2016 18:45:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIjqJC046383; Tue, 31 May 2016 18:45:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311845.u4VIjqJC046383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 18:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301070 - head/sys/arm64/arm64 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.22 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: Tue, 31 May 2016 18:45:54 -0000 Author: andrew Date: Tue May 31 18:45:52 2016 New Revision: 301070 URL: https://svnweb.freebsd.org/changeset/base/301070 Log: Allow the kernel to boot on a CPU where the devicetree has numbered it with a non-zero ID. To do this we increment the cpuid of any CPUs with a smaller devicetree ID by one to stop them conflicting with the boot CPU. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Tue May 31 18:44:33 2016 (r301069) +++ head/sys/arm64/arm64/mp_machdep.c Tue May 31 18:45:52 2016 (r301070) @@ -119,6 +119,13 @@ static uint32_t cpu_reg[MAXCPU][2]; #endif static device_t cpu_list[MAXCPU]; +/* + * Not all systems boot from the first CPU in the device tree. To work around + * this we need to find which CPU we have booted from so when we later + * enable the secondary CPUs we skip this one. + */ +static int cpu0 = -1; + void mpentry(unsigned long cpuid); void init_secondary(uint64_t); @@ -486,6 +493,7 @@ cpu_init_fdt(u_int id, phandle_t node, u uint64_t target_cpu; struct pcpu *pcpup; vm_paddr_t pa; + u_int cpuid; int err; /* Check we are able to start this cpu */ @@ -502,16 +510,19 @@ cpu_init_fdt(u_int id, phandle_t node, u #endif /* We are already running on cpu 0 */ - if (id == 0) + if (id == cpu0) return (1); + cpuid = id; + if (cpuid < cpu0) + cpuid++; - pcpup = &__pcpu[id]; - pcpu_init(pcpup, id, sizeof(struct pcpu)); + pcpup = &__pcpu[cpuid]; + pcpu_init(pcpup, cpuid, sizeof(struct pcpu)); - dpcpu[id - 1] = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, + dpcpu[cpuid - 1] = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO); - dpcpu_init(dpcpu[id - 1], id); + dpcpu_init(dpcpu[cpuid - 1], id); target_cpu = reg[0]; if (addr_size == 2) { @@ -519,21 +530,23 @@ cpu_init_fdt(u_int id, phandle_t node, u target_cpu |= reg[1]; } - printf("Starting CPU %u (%lx)\n", id, target_cpu); + printf("Starting CPU %u (%lx)\n", cpuid, target_cpu); pa = pmap_extract(kernel_pmap, (vm_offset_t)mpentry); - err = psci_cpu_on(target_cpu, pa, id); + err = psci_cpu_on(target_cpu, pa, cpuid); if (err != PSCI_RETVAL_SUCCESS) { /* Panic here if INVARIANTS are enabled */ - KASSERT(0, ("Failed to start CPU %u (%lx)\n", id, target_cpu)); + KASSERT(0, ("Failed to start CPU %u (%lx)\n", id, + target_cpu)); pcpu_destroy(pcpup); - kmem_free(kernel_arena, (vm_offset_t)dpcpu[id - 1], DPCPU_SIZE); - dpcpu[id - 1] = NULL; + kmem_free(kernel_arena, (vm_offset_t)dpcpu[cpuid - 1], + DPCPU_SIZE); + dpcpu[cpuid - 1] = NULL; /* Notify the user that the CPU failed to start */ printf("Failed to start CPU %u (%lx)\n", id, target_cpu); } else - CPU_SET(id, &all_cpus); + CPU_SET(cpuid, &all_cpus); return (1); } @@ -551,6 +564,7 @@ cpu_mp_start(void) switch(cpu_enum_method) { #ifdef FDT case CPUS_FDT: + KASSERT(cpu0 >= 0, ("Current CPU was not found")); ofw_cpu_early_foreach(cpu_init_fdt, true); break; #endif @@ -565,13 +579,34 @@ cpu_mp_announce(void) { } +static boolean_t +cpu_find_cpu0_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) +{ + uint64_t mpidr_fdt, mpidr_reg; + + if (cpu0 < 0) { + mpidr_fdt = reg[0]; + if (addr_size == 2) { + mpidr_fdt <<= 32; + mpidr_fdt |= reg[1]; + } + + mpidr_reg = READ_SPECIALREG(mpidr_el1); + + if ((mpidr_reg & 0xff00fffffful) == mpidr_fdt) + cpu0 = id; + } + + return (TRUE); +} + void cpu_mp_setmaxid(void) { #ifdef FDT int cores; - cores = ofw_cpu_early_foreach(NULL, false); + cores = ofw_cpu_early_foreach(cpu_find_cpu0_fdt, false); if (cores > 0) { cores = MIN(cores, MAXCPU); if (bootverbose) From owner-svn-src-head@freebsd.org Tue May 31 18:31:18 2016 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 71BB7B5B745; Tue, 31 May 2016 18:31:18 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 3C5681F50; Tue, 31 May 2016 18:31:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIVHZ9039393; Tue, 31 May 2016 18:31:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIVH46039378; Tue, 31 May 2016 18:31:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605311831.u4VIVH46039378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 31 May 2016 18:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301065 - head/sys/dev/sfxge 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.22 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: Tue, 31 May 2016 18:31:18 -0000 Author: arybchik Date: Tue May 31 18:31:17 2016 New Revision: 301065 URL: https://svnweb.freebsd.org/changeset/base/301065 Log: sfxge(4): zero should be used as RxQ label in SW event The buggy code was using the rxq index but should use the evq label associated with the rxq. It was missed in r298735. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D6661 Modified: head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue May 31 18:30:33 2016 (r301064) +++ head/sys/dev/sfxge/sfxge_rx.c Tue May 31 18:31:17 2016 (r301065) @@ -175,13 +175,17 @@ sfxge_rx_post_refill(void *arg) struct sfxge_softc *sc; unsigned int index; struct sfxge_evq *evq; + unsigned int label; uint16_t magic; sc = rxq->sc; index = rxq->index; evq = sc->evq[index]; - magic = SFXGE_MAGIC_RX_QREFILL | index; + label = 0; + KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, + ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); + magic = SFXGE_MAGIC_RX_QREFILL | label; /* This is guaranteed due to the start/stop order of rx and ev */ KASSERT(evq->init_state == SFXGE_EVQ_STARTED, From owner-svn-src-head@freebsd.org Tue May 31 18:32:59 2016 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 0D701B5B8E7; Tue, 31 May 2016 18:32:59 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id CD40613CC; Tue, 31 May 2016 18:32:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIWvW8042339; Tue, 31 May 2016 18:32:57 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIWvLp042336; Tue, 31 May 2016 18:32:57 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311832.u4VIWvLp042336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 18:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301066 - in head: include lib/libc/db/hash lib/libc/db/man 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.22 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: Tue, 31 May 2016 18:32:59 -0000 Author: ed Date: Tue May 31 18:32:57 2016 New Revision: 301066 URL: https://svnweb.freebsd.org/changeset/base/301066 Log: Fix prototype of dbm_open(). The last argument of dbm_open() should be a mode_t according to POSIX; not an int. Reviewed by: pfg, kib Differential Revision: https://reviews.freebsd.org/D6650 Modified: head/include/ndbm.h head/lib/libc/db/hash/ndbm.c head/lib/libc/db/man/dbm.3 Modified: head/include/ndbm.h ============================================================================== --- head/include/ndbm.h Tue May 31 18:31:17 2016 (r301065) +++ head/include/ndbm.h Tue May 31 18:32:57 2016 (r301066) @@ -70,7 +70,7 @@ datum dbm_firstkey(DBM *); long dbm_forder(DBM *, datum); #endif datum dbm_nextkey(DBM *); -DBM *dbm_open(const char *, int, int); +DBM *dbm_open(const char *, int, mode_t); int dbm_store(DBM *, datum, datum, int); #if __BSD_VISIBLE int dbm_dirfno(DBM *); Modified: head/lib/libc/db/hash/ndbm.c ============================================================================== --- head/lib/libc/db/hash/ndbm.c Tue May 31 18:31:17 2016 (r301065) +++ head/lib/libc/db/hash/ndbm.c Tue May 31 18:32:57 2016 (r301066) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); * NULL on failure */ extern DBM * -dbm_open(const char *file, int flags, int mode) +dbm_open(const char *file, int flags, mode_t mode) { HASHINFO info; char path[MAXPATHLEN]; Modified: head/lib/libc/db/man/dbm.3 ============================================================================== --- head/lib/libc/db/man/dbm.3 Tue May 31 18:31:17 2016 (r301065) +++ head/lib/libc/db/man/dbm.3 Tue May 31 18:32:57 2016 (r301066) @@ -34,7 +34,7 @@ .In fcntl.h .In ndbm.h .Ft DBM * -.Fn dbm_open "const char *base" "int flags" "int mode" +.Fn dbm_open "const char *base" "int flags" "mode_t mode" .Ft void .Fn dbm_close "DBM *db" .Ft int From owner-svn-src-head@freebsd.org Tue May 31 18:34:41 2016 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 0D2E4B5BA35; Tue, 31 May 2016 18:34:41 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id BA2A517A9; Tue, 31 May 2016 18:34:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIYdOr042458; Tue, 31 May 2016 18:34:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIYdBQ042456; Tue, 31 May 2016 18:34:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605311834.u4VIYdBQ042456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 31 May 2016 18:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301067 - head/sys/dev/sfxge 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.22 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: Tue, 31 May 2016 18:34:41 -0000 Author: arybchik Date: Tue May 31 18:34:39 2016 New Revision: 301067 URL: https://svnweb.freebsd.org/changeset/base/301067 Log: sfxge(4): move definition of the SW events to sfxge.h Tx flush done event is defined and Rx-specific header is not a good place for it. Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_rx.h Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue May 31 18:32:57 2016 (r301066) +++ head/sys/dev/sfxge/sfxge.h Tue May 31 18:34:39 2016 (r301067) @@ -113,6 +113,26 @@ #define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ + +#define SFXGE_MAGIC_RESERVED 0x8000 + +#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 +#define SFXGE_MAGIC_DMAQ_LABEL_MASK \ + ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) + +#define SFXGE_MAGIC_RX_QFLUSH_DONE \ + (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) + +#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ + (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) + +#define SFXGE_MAGIC_RX_QREFILL \ + (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) + +#define SFXGE_MAGIC_TX_QFLUSH_DONE \ + (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) + + enum sfxge_evq_state { SFXGE_EVQ_UNINITIALIZED = 0, SFXGE_EVQ_INITIALIZED, Modified: head/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.h Tue May 31 18:32:57 2016 (r301066) +++ head/sys/dev/sfxge/sfxge_rx.h Tue May 31 18:34:39 2016 (r301067) @@ -43,24 +43,6 @@ #define SFXGE_LRO 1 #endif -#define SFXGE_MAGIC_RESERVED 0x8000 - -#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 -#define SFXGE_MAGIC_DMAQ_LABEL_MASK \ - ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) - -#define SFXGE_MAGIC_RX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - -#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ - (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - -#define SFXGE_MAGIC_RX_QREFILL \ - (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - -#define SFXGE_MAGIC_TX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - #define SFXGE_RX_SCALE_MAX EFX_MAXRSS struct sfxge_rx_sw_desc { From owner-svn-src-head@freebsd.org Tue May 31 19:17:34 2016 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 2A1D1B5BC64; Tue, 31 May 2016 19:17:34 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id EF50E18A4; Tue, 31 May 2016 19:17:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VJHXml057378; Tue, 31 May 2016 19:17:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VJHXFC057377; Tue, 31 May 2016 19:17:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311917.u4VJHXFC057377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 19:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301072 - head/sys/arm64/arm64 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.22 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: Tue, 31 May 2016 19:17:34 -0000 Author: andrew Date: Tue May 31 19:17:32 2016 New Revision: 301072 URL: https://svnweb.freebsd.org/changeset/base/301072 Log: dpcpu_init should have also passed in the calculated cpuid, not the devicetree ID. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Tue May 31 19:05:41 2016 (r301071) +++ head/sys/arm64/arm64/mp_machdep.c Tue May 31 19:17:32 2016 (r301072) @@ -522,7 +522,7 @@ cpu_init_fdt(u_int id, phandle_t node, u dpcpu[cpuid - 1] = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO); - dpcpu_init(dpcpu[cpuid - 1], id); + dpcpu_init(dpcpu[cpuid - 1], cpuid); target_cpu = reg[0]; if (addr_size == 2) { From owner-svn-src-head@freebsd.org Tue May 31 21:22:21 2016 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 B89D4B5BB89; Tue, 31 May 2016 21:22:21 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 882C21DD3; Tue, 31 May 2016 21:22:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VLMK2M005098; Tue, 31 May 2016 21:22:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VLMJqQ005087; Tue, 31 May 2016 21:22:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605312122.u4VLMJqQ005087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 31 May 2016 21:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301079 - in head: share/mk sys/conf 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.22 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: Tue, 31 May 2016 21:22:21 -0000 Author: bdrewery Date: Tue May 31 21:22:19 2016 New Revision: 301079 URL: https://svnweb.freebsd.org/changeset/base/301079 Log: WITH_META_MODE: Mitigate switching from without to with META_MODE. Adding .META to targets-to-build will ensure that they will rebuild if there is no .meta file. Adding it to all SUFFIXES and objects ensures that at least objects will rebuild if there is no .meta file. This will be reverted if bmake's behavior changes to rebuild on missing .meta files. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.info.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.man.mk head/share/mk/bsd.nls.mk head/share/mk/bsd.prog.mk head/share/mk/sys.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/bsd.dep.mk Tue May 31 21:22:19 2016 (r301079) @@ -92,7 +92,7 @@ OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} # Lexical analyzers .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c -${_LC}: ${_LSRC} +${_LC}: ${_LSRC} ${OP_META} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC} SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} @@ -107,6 +107,7 @@ SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES+= ${_YC} .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) .ORDER: ${_YC} y.tab.h +${_YC}: ${OP_META} ${_YC} y.tab.h: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} cp y.tab.c ${_YC} @@ -114,13 +115,14 @@ CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h .ORDER: ${_YC} ${_YH} +${_YC}: ${OP_META} ${_YC} ${_YH}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} SRCS+= ${_YH} CLEANFILES+= ${_YH} .endfor .else -${_YC}: ${_YSRC} +${_YC}: ${_YSRC} ${OP_META} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC} @@ -134,20 +136,20 @@ CFLAGS+= -I${.OBJDIR} .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} SRCS+= ${_D}.h -${_D}.h: ${_DSRC} +${_D}.h: ${_DSRC} ${OP_META} ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC} SRCS:= ${SRCS:S/^${_DSRC}$//} OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o -${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} +${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} ${OP_META} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po -${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} +${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} ${OP_META} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} -${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} +${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} ${OP_META} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .endif @@ -243,7 +245,7 @@ DPSRCS+= ${SRCS} # A .depend file will only be generated if there are commands in # beforedepend/_EXTRADEPEND/afterdepend. The target is kept # to allow 'make depend' to generate files. -${DEPENDFILE}: ${DPSRCS} +${DEPENDFILE}: ${DPSRCS} ${OP_META} .if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE}) rm -f ${DEPENDFILE} .endif Modified: head/share/mk/bsd.info.mk ============================================================================== --- head/share/mk/bsd.info.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/bsd.info.mk Tue May 31 21:22:19 2016 (r301079) @@ -86,18 +86,18 @@ DVIPS2ASCII?= dvips2ascii .SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html -.texi.info .texinfo.info: +.texi.info .texinfo.info: ${OP_META} ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \ -o ${.TARGET} -.texi.dvi .texinfo.dvi: +.texi.dvi .texinfo.dvi: ${OP_META} TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \ ${TEX} ${.IMPSRC} > ${.IMPSRC:T:R}-la.texi TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \ ${TEX} ${.IMPSRC:T:R}-la.texi ${.TARGET}.new mv -f ${.TARGET}.new ${.TARGET} -.dvi.ps: +.dvi.ps: ${OP_META} ${DVIPS} -o ${.TARGET} ${.IMPSRC} -.info.html: +.info.html: ${OP_META} ${INFO2HTML} ${.IMPSRC} ${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET} @@ -133,7 +133,7 @@ all: ${IFILES} .endif .for x in ${IFILENS} -${x:S/$/${ICOMPRESS_EXT}/}: ${x} +${x:S/$/${ICOMPRESS_EXT}/}: ${x} ${OP_META} ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET} .endfor @@ -158,7 +158,7 @@ ${x:S/$/-install/}: .if defined(SRCS) CLEANFILES+= ${INFO}.texi -${INFO}.texi: ${SRCS} +${INFO}.texi: ${SRCS} ${OP_META} cat ${.ALLSRC} > ${.TARGET} .endif Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/bsd.lib.mk Tue May 31 21:22:19 2016 (r301079) @@ -91,55 +91,55 @@ PICFLAG=-fpic PO_FLAG=-pg -.c.o: +.c.o: ${OP_META} ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.c.po: +.c.po: ${OP_META} ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.c.So: +.c.So: ${OP_META} ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.cc.o .C.o .cpp.o .cxx.o: +.cc.o .C.o .cpp.o .cxx.o: ${OP_META} ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.cc.po .C.po .cpp.po .cxx.po: +.cc.po .C.po .cpp.po .cxx.po: ${OP_META} ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.cc.So .C.So .cpp.So .cxx.So: +.cc.So .C.So .cpp.So .cxx.So: ${OP_META} ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.f.po: +.f.po: ${OP_META} ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} ${CTFCONVERT_CMD} -.f.So: +.f.So: ${OP_META} ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} ${CTFCONVERT_CMD} -.s.po .s.So: +.s.po .s.So: ${OP_META} ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} ${CTFCONVERT_CMD} -.asm.po: +.asm.po: ${OP_META} ${CC:N${CCACHE_BIN}} -x assembler-with-cpp -DPROF ${PO_CFLAGS} \ ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.asm.So: +.asm.So: ${OP_META} ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.S.po: +.S.po: ${OP_META} ${CC:N${CCACHE_BIN}} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ -o ${.TARGET} ${CTFCONVERT_CMD} -.S.So: +.S.So: ${OP_META} ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} @@ -183,7 +183,7 @@ CLEANFILES+= ${OBJS} ${STATICOBJS} .if defined(LIB) && !empty(LIB) _LIBS= lib${LIB_PRIVATE}${LIB}.a -lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} +lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} ${OP_META} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} @@ -198,7 +198,7 @@ POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o= DEPENDOBJS+= ${POBJS} CLEANFILES+= ${POBJS} -lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} +lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} ${OP_META} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${POBJS} | tsort -q` ${ARADD} @@ -230,7 +230,7 @@ ${SHLIB_NAME_FULL}: beforelinking .if defined(SHLIB_LINK) .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) -${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} +${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} ${OP_META} sed -e 's,@@SHLIB@@,${_SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LIBDIR},g' \ ${.ALLSRC} > ${.TARGET} @@ -241,7 +241,7 @@ CLEANFILES+= ${SHLIB_LINK:R}.ld CLEANFILES+= ${SHLIB_LINK} .endif -${SHLIB_NAME_FULL}: ${SOBJS} +${SHLIB_NAME_FULL}: ${SOBJS} ${OP_META} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) @@ -256,11 +256,11 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .if ${MK_DEBUG_FILES} != "no" CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug -${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OP_META} ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} -${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} +${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} ${OP_META} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} .endif .endif #defined(SHLIB_NAME) @@ -268,7 +268,7 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a -lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} ${OP_META} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} @@ -281,7 +281,7 @@ _LIBS+= ${LINTLIB} LINTOBJS+= ${SRCS:M*.c:.c=.ln} CLEANFILES+= ${LINTOBJS} -${LINTLIB}: ${LINTOBJS} +${LINTLIB}: ${LINTOBJS} ${OP_META} @${ECHO} building lint library ${.TARGET} @rm -f ${.TARGET} ${LINT} ${LINTLIBFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/bsd.man.mk Tue May 31 21:22:19 2016 (r301079) @@ -99,7 +99,7 @@ ${__target}: ${__page} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __target in ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} all-man: ${__target} -${__target}: ${__page} +${__target}: ${__page} ${OP_META} ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} > ${.TARGET} .endfor .endif @@ -112,7 +112,7 @@ CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g} .for __page in ${MAN} .for __target in ${__page:T:S/$/${CATEXT}/g} all-man: ${__target} -${__target}: ${__page} +${__target}: ${__page} ${OP_META} ${MANDOC_CMD} ${.ALLSRC} > ${.TARGET} .endfor .endfor @@ -148,7 +148,7 @@ CLEANFILES+= ${MAN:T:S/$/${CATEXT}${MCOM .for __page in ${MAN} .for __target in ${__page:T:S/$/${MCOMPRESS_EXT}/} all-man: ${__target} -${__target}: ${__page} +${__target}: ${__page} ${OP_META} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MCOMPRESS_CMD} > ${.TARGET} .else @@ -158,7 +158,7 @@ ${__target}: ${__page} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __target in ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/} all-man: ${__target} -${__target}: ${__page} +${__target}: ${__page} ${OP_META} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} | ${MCOMPRESS_CMD} > ${.TARGET} .else Modified: head/share/mk/bsd.nls.mk ============================================================================== --- head/share/mk/bsd.nls.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/bsd.nls.mk Tue May 31 21:22:19 2016 (r301079) @@ -42,7 +42,7 @@ NLSSRCFILES_${file}?= ${NLSSRCFILES} .endif .if defined(NLSSRCFILES_${file}) NLSSRCDIR_${file}?= ${NLSSRCDIR} -${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//} +${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//} ${OP_META} @rm -f ${.TARGET} cat ${.ALLSRC} > ${.TARGET} CLEANFILES+= ${file}.msg Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/bsd.prog.mk Tue May 31 21:22:19 2016 (r301079) @@ -90,7 +90,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} beforelinking: ${OBJS} ${PROG_FULL}: beforelinking .endif -${PROG_FULL}: ${OBJS} +${PROG_FULL}: ${OBJS} ${OP_META} .if defined(PROG_CXX) ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ ${OBJS} ${LDADD} @@ -122,7 +122,7 @@ OBJS+= ${PROG}.o beforelinking: ${OBJS} ${PROG_FULL}: beforelinking .endif -${PROG_FULL}: ${OBJS} +${PROG_FULL}: ${OBJS} ${OP_META} .if defined(PROG_CXX) ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ ${OBJS} ${LDADD} @@ -138,11 +138,11 @@ ${PROG_FULL}: ${OBJS} .endif # !defined(SRCS) .if ${MK_DEBUG_FILES} != "no" -${PROG}: ${PROG_FULL} ${PROGNAME}.debug +${PROG}: ${PROG_FULL} ${PROGNAME}.debug ${OP_META} ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ ${PROG_FULL} ${.TARGET} -${PROGNAME}.debug: ${PROG_FULL} +${PROGNAME}.debug: ${PROG_FULL} ${OP_META} ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} .endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue May 31 21:21:32 2016 (r301078) +++ head/share/mk/sys.mk Tue May 31 21:22:19 2016 (r301079) @@ -58,6 +58,9 @@ META_MODE+= nofilemon META_MODE?= normal .export META_MODE .MAKE.MODE?= ${META_MODE} +.if ${.MAKE.MODE:Mmeta*} != "" +OP_META= .META +.endif .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed @@ -286,99 +289,99 @@ YFLAGS ?= -d # non-Posix rule set -.sh: +.sh: ${OP_META} cp -f ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} -.c.ln: +.c.ln: ${OP_META} ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ touch ${.TARGET} -.cc.ln .C.ln .cpp.ln .cxx.ln: +.cc.ln .C.ln .cpp.ln .cxx.ln: ${OP_META} ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \ touch ${.TARGET} -.c: +.c: ${OP_META} ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} ${CTFCONVERT_CMD} -.c.o: +.c.o: ${OP_META} ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.cc .cpp .cxx .C: +.cc .cpp .cxx .C: ${OP_META} ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} -.cc.o .cpp.o .cxx.o .C.o: +.cc.o .cpp.o .cxx.o .C.o: ${OP_META} ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.m.o: +.m.o: ${OP_META} ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.p.o: +.p.o: ${OP_META} ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.e .r .F .f: +.e .r .F .f: ${OP_META} ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \ -o ${.TARGET} -.e.o .r.o .F.o .f.o: +.e.o .r.o .F.o .f.o: ${OP_META} ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.S.o: +.S.o: ${OP_META} ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.asm.o: +.asm.o: ${OP_META} ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ -o ${.TARGET} ${CTFCONVERT_CMD} -.s.o: +.s.o: ${OP_META} ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} ${CTFCONVERT_CMD} # XXX not -j safe -.y.o: +.y.o: ${OP_META} ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} rm -f y.tab.c ${CTFCONVERT_CMD} -.l.o: +.l.o: ${OP_META} ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} rm -f ${.PREFIX}.tmp.c ${CTFCONVERT_CMD} # XXX not -j safe -.y.c: +.y.c: ${OP_META} ${YACC} ${YFLAGS} ${.IMPSRC} mv y.tab.c ${.TARGET} -.l.c: +.l.c: ${OP_META} ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET} -.s.out .c.out .o.out: +.s.out .c.out .o.out: ${OP_META} ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} ${CTFCONVERT_CMD} -.f.out .F.out .r.out .e.out: +.f.out .F.out .r.out .e.out: ${OP_META} ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ ${LDLIBS} -o ${.TARGET} rm -f ${.PREFIX}.o ${CTFCONVERT_CMD} # XXX not -j safe -.y.out: +.y.out: ${OP_META} ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} rm -f y.tab.c ${CTFCONVERT_CMD} -.l.out: +.l.out: ${OP_META} ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} rm -f ${.PREFIX}.tmp.c Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue May 31 21:21:32 2016 (r301078) +++ head/sys/conf/kern.post.mk Tue May 31 21:22:19 2016 (r301079) @@ -108,10 +108,10 @@ modules-all modules-depend: modules-obj FULLKERNEL= ${KERNEL_KO} .else FULLKERNEL= ${KERNEL_KO}.full -${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.debug +${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.debug ${OP_META} ${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.debug \ ${FULLKERNEL} ${.TARGET} -${KERNEL_KO}.debug: ${FULLKERNEL} +${KERNEL_KO}.debug: ${FULLKERNEL} ${OP_META} ${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET} install.debug reinstall.debug: gdbinit cd ${.CURDIR}; ${MAKE} ${.TARGET:R} @@ -127,7 +127,7 @@ gdbinit: .endif .endif -${FULLKERNEL}: ${SYSTEM_DEP} vers.o +${FULLKERNEL}: ${SYSTEM_DEP} vers.o ${OP_META} @rm -f ${.TARGET} @echo linking ${.TARGET} ${SYSTEM_LD} @@ -150,9 +150,9 @@ LNFILES= ${CFILES:T:S/.c$/.ln/} .for mfile in ${MFILES} # XXX the low quality .m.o rules gnerated by config are normally used # instead of the .m.c rules here. -${mfile:T:S/.m$/.c/}: ${mfile} +${mfile:T:S/.m$/.c/}: ${mfile} ${OP_META} ${AWK} -f $S/tools/makeobjops.awk ${mfile} -c -${mfile:T:S/.m$/.h/}: ${mfile} +${mfile:T:S/.m$/.h/}: ${mfile} ${OP_META} ${AWK} -f $S/tools/makeobjops.awk ${mfile} -h .endfor @@ -172,18 +172,18 @@ lint: ${LNFILES} # dynamic references. We could probably do a '-Bforcedynamic' mode like # in the a.out ld. For now, this works. HACK_EXTRA_FLAGS?= -shared -hack.So: Makefile +hack.So: Makefile ${OP_META} :> hack.c ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So rm -f hack.c -assym.s: $S/kern/genassym.sh genassym.o +assym.s: $S/kern/genassym.sh genassym.o ${OP_META} NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} -genassym.o: $S/$M/$M/genassym.c +genassym.o: $S/$M/$M/genassym.c ${OP_META} ${CC} -c ${CFLAGS:N-fno-common} $S/$M/$M/genassym.c -${SYSTEM_OBJS} genassym.o vers.o: opt_global.h +${SYSTEM_OBJS} genassym.o vers.o: opt_global.h ${OP_META} # Skip reading .depend when not needed to speed up tree-walks # and simple lookups. @@ -260,7 +260,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}:N .NOPATH: .depend ${DEPENDFILES_OBJS} -.depend: .PRECIOUS ${SRCS} +.depend: .PRECIOUS ${SRCS} ${OP_META} _ILINKS= machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" @@ -339,26 +339,26 @@ kernel-reinstall: ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/ .endif -config.o env.o hints.o vers.o vnode_if.o: +config.o env.o hints.o vers.o vnode_if.o: ${OP_META} ${NORMAL_C} ${NORMAL_CTFCONVERT} -config.ln env.ln hints.ln vers.ln vnode_if.ln: +config.ln env.ln hints.ln vers.ln vnode_if.ln: ${OP_META} ${NORMAL_LINT} -vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} +vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} ${OP_META} MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT} -vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src +vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src ${OP_META} ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: $S/tools/vnode_if.awk \ - $S/kern/vnode_if.src -vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h + $S/kern/vnode_if.src ${OP_META} +vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h ${OP_META} ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -h -vnode_if_newproto.h: +vnode_if_newproto.h: ${OP_META} ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -p -vnode_if_typedef.h: +vnode_if_typedef.h: ${OP_META} ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -q .if ${MFS_IMAGE:Uno} != "no" @@ -367,7 +367,7 @@ vnode_if_typedef.h: # via linking. Make sure the contents are in the mfs section and rename the # start/end/size variables to __start_mfs, __stop_mfs, and mfs_size, # respectively. -embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} +embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} ${OP_META} ${OBJCOPY} --input-target binary \ --output-target ${EMBEDFS_FORMAT.${MACHINE_ARCH}} \ --binary-architecture ${EMBEDFS_ARCH.${MACHINE_ARCH}} \ Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue May 31 21:21:32 2016 (r301078) +++ head/sys/conf/kern.pre.mk Tue May 31 21:22:19 2016 (r301079) @@ -22,6 +22,7 @@ _srcconf_included_: # The kernel build always occurs in the object directory which is .CURDIR. .if ${.MAKE.MODE:Unormal:Mmeta} .MAKE.MODE+= curdirOk=yes +OP_META= .META .endif # Can be overridden by makeoptions or /etc/make.conf Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 31 21:21:32 2016 (r301078) +++ head/sys/conf/kmod.mk Tue May 31 21:22:19 2016 (r301079) @@ -149,7 +149,7 @@ CTFFLAGS+= -g .endif .if defined(FIRMWS) -${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk +${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk ${OP_META} ${AWK} -f ${SYSDIR}/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \ ${FIRMWARE_LICENSE:C/.+/-l/}${FIRMWARE_LICENSE} @@ -157,7 +157,7 @@ SRCS+= ${KMOD:S/$/.c/} CLEANFILES+= ${KMOD:S/$/.c/} .for _firmw in ${FIRMWS} -${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} +${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} ${OP_META} @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} @if [ -e ${_firmw:C/\:.*$//} ]; then \ ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ @@ -188,15 +188,15 @@ PROG= ${KMOD}.ko FULLPROG= ${PROG} .else FULLPROG= ${PROG}.full -${PROG}: ${FULLPROG} ${PROG}.debug +${PROG}: ${FULLPROG} ${PROG}.debug ${OP_META} ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROG}.debug \ ${FULLPROG} ${.TARGET} -${PROG}.debug: ${FULLPROG} +${PROG}.debug: ${FULLPROG} ${OP_META} ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET} .endif .if ${__KLD_SHARED} == yes -${FULLPROG}: ${KMOD}.kld +${FULLPROG}: ${KMOD}.kld ${OP_META} .if ${MACHINE_CPUARCH} != "aarch64" ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld .else @@ -219,9 +219,9 @@ CLEANFILES+= export_syms .endif .if ${__KLD_SHARED} == yes -${KMOD}.kld: ${OBJS} +${KMOD}.kld: ${OBJS} ${OP_META} .else -${FULLPROG}: ${OBJS} +${FULLPROG}: ${OBJS} ${OP_META} .endif ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} .if ${MK_CTF} != "no" @@ -397,16 +397,16 @@ _MATCHES=${_MFILES:${_MATCH}} CLEANFILES+= ${_i} .endif .endfor # _i -.m.c: ${SYSDIR}/tools/makeobjops.awk +.m.c: ${SYSDIR}/tools/makeobjops.awk ${OP_META} ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c -.m.h: ${SYSDIR}/tools/makeobjops.awk +.m.h: ${SYSDIR}/tools/makeobjops.awk ${OP_META} ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h .for _i in mii pccard .if !empty(SRCS:M${_i}devs.h) CLEANFILES+= ${_i}devs.h -${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs +${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs ${OP_META} ${AWK} -f ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs .endif .endfor # _i @@ -415,8 +415,9 @@ ${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h CLEANFILES+= bhnd_nvram_map.h bhnd_nvram_map.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \ ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ - ${SYSDIR}/dev/bhnd/nvram/nvram_map -bhnd_nvram_map.h: + ${SYSDIR}/dev/bhnd/nvram/nvram_map \ + ${OP_META} +bhnd_nvram_map.h: ${OP_META} sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map -h .endif @@ -425,27 +426,28 @@ bhnd_nvram_map.h: CLEANFILES+= bhnd_nvram_map_data.h bhnd_nvram_map_data.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \ ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ - ${SYSDIR}/dev/bhnd/nvram/nvram_map -bhnd_nvram_map_data.h: + ${SYSDIR}/dev/bhnd/nvram/nvram_map \ + ${OP_META} +bhnd_nvram_map_data.h: ${OP_META} sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map -d .endif .if !empty(SRCS:Musbdevs.h) CLEANFILES+= usbdevs.h -usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs +usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs ${OP_META} ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -h .endif .if !empty(SRCS:Musbdevs_data.h) CLEANFILES+= usbdevs_data.h -usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs +usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs ${OP_META} ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d .endif .if !empty(SRCS:Macpi_quirks.h) CLEANFILES+= acpi_quirks.h -acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks +acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks ${OP_META} ${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks .endif @@ -455,10 +457,10 @@ assym.s: genassym.o .if defined(KERNBUILDDIR) genassym.o: opt_global.h .endif -assym.s: ${SYSDIR}/kern/genassym.sh +assym.s: ${SYSDIR}/kern/genassym.sh ${OP_META} sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c -genassym.o: ${SRCS:Mopt_*.h} +genassym.o: ${SRCS:Mopt_*.h} ${OP_META} ${CC} -c ${CFLAGS:N-fno-common} \ ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c .endif From owner-svn-src-head@freebsd.org Tue May 31 18:44:35 2016 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 0A498B5B4E2; Tue, 31 May 2016 18:44:35 +0000 (UTC) (envelope-from ache@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 mx1.freebsd.org (Postfix) with ESMTPS id CEDEF17AE; Tue, 31 May 2016 18:44:34 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIiYTe046277; Tue, 31 May 2016 18:44:34 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIiXNX046275; Tue, 31 May 2016 18:44:33 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201605311844.u4VIiXNX046275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Tue, 31 May 2016 18:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301069 - head/lib/libc/locale 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.22 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: Tue, 31 May 2016 18:44:35 -0000 Author: ache Date: Tue May 31 18:44:33 2016 New Revision: 301069 URL: https://svnweb.freebsd.org/changeset/base/301069 Log: For EILSEQ case in mbsnrtowcs() and wcsnrtombs() update src to point to the character after the one this conversion stopped at. PR: 209907 Submitted by: Roel Standaert (partially) MFC after: 3 days Modified: head/lib/libc/locale/ascii.c head/lib/libc/locale/none.c Modified: head/lib/libc/locale/ascii.c ============================================================================== --- head/lib/libc/locale/ascii.c Tue May 31 18:40:47 2016 (r301068) +++ head/lib/libc/locale/ascii.c Tue May 31 18:44:33 2016 (r301069) @@ -143,6 +143,7 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d nchr = 0; while (len-- > 0 && nms-- > 0) { if (*s & 0x80) { + *src = s; errno = EILSEQ; return ((size_t)-1); } @@ -177,6 +178,7 @@ _ascii_wcsnrtombs(char * __restrict dst, nchr = 0; while (len-- > 0 && nwc-- > 0) { if (*s < 0 || *s > 127) { + *src = s; errno = EILSEQ; return ((size_t)-1); } Modified: head/lib/libc/locale/none.c ============================================================================== --- head/lib/libc/locale/none.c Tue May 31 18:40:47 2016 (r301068) +++ head/lib/libc/locale/none.c Tue May 31 18:44:33 2016 (r301069) @@ -174,6 +174,7 @@ _none_wcsnrtombs(char * __restrict dst, nchr = 0; while (len-- > 0 && nwc-- > 0) { if (*s < 0 || *s > UCHAR_MAX) { + *src = s; errno = EILSEQ; return ((size_t)-1); } From owner-svn-src-head@freebsd.org Tue May 31 19:19:22 2016 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 6E1CFB5BE7C; Tue, 31 May 2016 19:19:22 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 3BC241BAF; Tue, 31 May 2016 19:19:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VJJL3j057481; Tue, 31 May 2016 19:19:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VJJLFQ057480; Tue, 31 May 2016 19:19:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605311919.u4VJJLFQ057480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 31 May 2016 19:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301073 - head/sys/conf 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.22 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: Tue, 31 May 2016 19:19:22 -0000 Author: andrew Date: Tue May 31 19:19:21 2016 New Revision: 301073 URL: https://svnweb.freebsd.org/changeset/base/301073 Log: Attach the generic USB OHCI driver to the arm64 build. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue May 31 19:17:32 2016 (r301072) +++ head/sys/conf/files.arm64 Tue May 31 19:19:21 2016 (r301073) @@ -74,6 +74,8 @@ dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220 +dev/usb/controller/generic_ohci.c optional ohci fdt +dev/usb/controller/generic_usb_if.m optional ohci fdt dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov From owner-svn-src-head@freebsd.org Tue May 31 19:05:43 2016 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 3E6DCB54F58; Tue, 31 May 2016 19:05:43 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id E5D4B1CA5; Tue, 31 May 2016 19:05:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VJ5gaE053767; Tue, 31 May 2016 19:05:42 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VJ5geL053766; Tue, 31 May 2016 19:05:42 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311905.u4VJ5geL053766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 19:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301071 - head/sys/sys 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.22 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: Tue, 31 May 2016 19:05:43 -0000 Author: ed Date: Tue May 31 19:05:41 2016 New Revision: 301071 URL: https://svnweb.freebsd.org/changeset/base/301071 Log: Improve POSIX conformance of . - This header file has always depended on pthread_t, pthread_attr_t, struct timespec, size_t and uid_t. Only as of POSIX 2008, these dependencies have been states explicitly. They should now be defined. - In our implementation, struct sigevent::sigev_notify_attributes has type "void *" instead of "pthread_attr_t *". My guess is that this was done to prevent pulling in the pthread types, but this can easily be avoided by using the underlying structure types. Modified: head/sys/sys/signal.h Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Tue May 31 18:45:52 2016 (r301070) +++ head/sys/sys/signal.h Tue May 31 19:05:41 2016 (r301071) @@ -45,6 +45,23 @@ #include /* __MINSIGSTKSZ */ #include /* sig_atomic_t; trap codes; sigcontext */ +#if __POSIX_VISIBLE >= 200809 + +#include +#include + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + +#ifndef _UID_T_DECLARED +typedef __uid_t uid_t; +#define _UID_T_DECLARED +#endif + +#endif /* __POSIX_VISIBLE >= 200809 */ + /* * System defined signals. */ @@ -160,6 +177,9 @@ union sigval { #endif #if __POSIX_VISIBLE >= 199309 + +struct pthread_attr; + struct sigevent { int sigev_notify; /* Notification type */ int sigev_signo; /* Signal number */ @@ -168,7 +188,7 @@ struct sigevent { __lwpid_t _threadid; struct { void (*_function)(union sigval); - void *_attribute; /* pthread_attr_t * */ + struct pthread_attr **_attribute; } _sigev_thread; unsigned short _kevent_flags; long __spare__[8]; @@ -190,6 +210,7 @@ struct sigevent { #define SIGEV_KEVENT 3 /* Generate a kevent. */ #define SIGEV_THREAD_ID 4 /* Send signal to a kernel thread. */ #endif + #endif /* __POSIX_VISIBLE >= 199309 */ #if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE From owner-svn-src-head@freebsd.org Tue May 31 18:50:04 2016 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 29F5CB5BA7A; Tue, 31 May 2016 18:50:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 018B51EC4; Tue, 31 May 2016 18:50:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 505DCB989; Tue, 31 May 2016 14:50:02 -0400 (EDT) From: John Baldwin To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301059 - head/sbin/ifconfig Date: Tue, 31 May 2016 11:36:19 -0700 Message-ID: <2442602.d45z1euH3Q@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605311730.u4VHU8Z4016044@repo.freebsd.org> References: <201605311730.u4VHU8Z4016044@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 31 May 2016 14:50:02 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 18:50:04 -0000 On Tuesday, May 31, 2016 05:30:08 PM Allan Jude wrote: > Author: allanjude > Date: Tue May 31 17:30:08 2016 > New Revision: 301059 > URL: https://svnweb.freebsd.org/changeset/base/301059 > > Log: > ifconfig(8) now supports some output formatting options > > specified by the -f flag or IFCONFIG_FORMAT environment variable, the user > can request that inet4 subnet masks be printed in CIDR or dotted-quad > notation, in addition to the traditional hex output. > inet6 prefixes can be printed in CIDR as well. > > For more documentation see the ifconfig(8) man page. ... and there was much rejoicing! Are you brave enough to set a default IFCONFIG_FORMAT in the root shell startup files? -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 31 19:24:34 2016 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 29982B5764E; Tue, 31 May 2016 19:24:34 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id F030A2000; Tue, 31 May 2016 19:24:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VJOXDn060907; Tue, 31 May 2016 19:24:33 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VJOXBI060906; Tue, 31 May 2016 19:24:33 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311924.u4VJOXBI060906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 19:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301074 - head/sys/sys 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.22 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: Tue, 31 May 2016 19:24:34 -0000 Author: ed Date: Tue May 31 19:24:32 2016 New Revision: 301074 URL: https://svnweb.freebsd.org/changeset/base/301074 Log: Add missing dependency on . The SHMLBA definition provided by this header file is defined as PAGE_SIZE. PAGE_SIZE is only available when is included. Modified: head/sys/sys/shm.h Modified: head/sys/sys/shm.h ============================================================================== --- head/sys/sys/shm.h Tue May 31 19:19:21 2016 (r301073) +++ head/sys/sys/shm.h Tue May 31 19:24:32 2016 (r301074) @@ -43,6 +43,8 @@ #include #include +#include + #define SHM_RDONLY 010000 /* Attach read-only (else read-write) */ #define SHM_RND 020000 /* Round attach address to SHMLBA */ #define SHMLBA PAGE_SIZE /* Segment low boundary address multiple */ From owner-svn-src-head@freebsd.org Tue May 31 20:10:13 2016 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 0B67CB58BC7; Tue, 31 May 2016 20:10:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E17C61809; Tue, 31 May 2016 20:10:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 01802B989; Tue, 31 May 2016 16:10:12 -0400 (EDT) From: John Baldwin To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301070 - head/sys/arm64/arm64 Date: Tue, 31 May 2016 12:48:48 -0700 Message-ID: <2110242.ihAnphvYLg@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605311845.u4VIjqJC046383@repo.freebsd.org> References: <201605311845.u4VIjqJC046383@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 31 May 2016 16:10:12 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 20:10:13 -0000 On Tuesday, May 31, 2016 06:45:52 PM Andrew Turner wrote: > Author: andrew > Date: Tue May 31 18:45:52 2016 > New Revision: 301070 > URL: https://svnweb.freebsd.org/changeset/base/301070 > > Log: > Allow the kernel to boot on a CPU where the devicetree has numbered it with > a non-zero ID. To do this we increment the cpuid of any CPUs with a smaller > devicetree ID by one to stop them conflicting with the boot CPU. > > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation It's a bit more friendly if you can have FreeBSD CPU IDs still represent the topology of the system if possible. On x86 we don't always boot from CPU 0 either (in fact, it's an election system so that the APIC ID of the BSP can vary from boot to boot). What we do however, is add CPUs from the same core, then package first after the BSP and then add remaining CPUs as we normally would. For x86, the first thread in a package is always chosen as the BSP, so this is implemented by starting at the APIC ID of the BSP and assigning CPU IDs to increasing APIC IDs and eventually wrapping back around to APIC ID 0 to add CPUs from "earlier" packages if we did not boot from package 0. However, this means that if you have a system with dual quad-core CPUs, CPUs 0-3 are always one package and 4-7 are always the other, regardless of which package is used for booting. Initially the x86 code did not do that but just skipped over the BSP when adding APs (so something similar I think to what you've done here), but that meant that when the second package won the boot-time election, CPUs 0,5-7 were on one package and 1-4 were on another package. -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 31 18:40:49 2016 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 0295EB5B0C0; Tue, 31 May 2016 18:40:49 +0000 (UTC) (envelope-from vangyzen@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 mx1.freebsd.org (Postfix) with ESMTPS id C43071CBD; Tue, 31 May 2016 18:40:48 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VIeltw045319; Tue, 31 May 2016 18:40:47 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VIelqT045318; Tue, 31 May 2016 18:40:47 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605311840.u4VIelqT045318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 31 May 2016 18:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301068 - head/etc/rc.d 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.22 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: Tue, 31 May 2016 18:40:49 -0000 Author: vangyzen Date: Tue May 31 18:40:47 2016 New Revision: 301068 URL: https://svnweb.freebsd.org/changeset/base/301068 Log: Fix indentation in dhclient rc.d script Modified: head/etc/rc.d/dhclient Modified: head/etc/rc.d/dhclient ============================================================================== --- head/etc/rc.d/dhclient Tue May 31 18:34:39 2016 (r301067) +++ head/etc/rc.d/dhclient Tue May 31 18:40:47 2016 (r301068) @@ -30,7 +30,7 @@ dhclient_pre_check() else debug "$msg" fi - exit 1 + exit 1 fi } From owner-svn-src-head@freebsd.org Tue May 31 21:16:35 2016 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 C13A3B5B69D; Tue, 31 May 2016 21:16:35 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id 9B2031781; Tue, 31 May 2016 21:16:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VLGYNQ001582; Tue, 31 May 2016 21:16:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VLGYlN001577; Tue, 31 May 2016 21:16:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605312116.u4VLGYlN001577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 31 May 2016 21:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301077 - head/share/man/man3 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.22 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: Tue, 31 May 2016 21:16:35 -0000 Author: jilles Date: Tue May 31 21:16:34 2016 New Revision: 301077 URL: https://svnweb.freebsd.org/changeset/base/301077 Log: Remove mentions that PTHREAD_PROCESS_SHARED is not supported from man pages. Also add support for process-shared synchronization objects to the HISTORY sections where they already exist. Modified: head/share/man/man3/pthread_barrierattr.3 head/share/man/man3/pthread_condattr.3 head/share/man/man3/pthread_rwlock_init.3 head/share/man/man3/pthread_rwlockattr_setpshared.3 head/share/man/man3/pthread_spin_init.3 Modified: head/share/man/man3/pthread_barrierattr.3 ============================================================================== --- head/share/man/man3/pthread_barrierattr.3 Tue May 31 21:09:42 2016 (r301076) +++ head/share/man/man3/pthread_barrierattr.3 Tue May 31 21:16:34 2016 (r301077) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2004 +.Dd May 31, 2016 .Dt PTHREAD_BARRIERATTR 3 .Os .Sh NAME @@ -131,16 +131,5 @@ and in .Lb libthr in .Fx 5.3 . -.Sh BUGS -The implementation of -barriers -does not fully conform to -.St -p1003.2 -because the process-shared attribute is ignored in -.Lb libthr ; -if any value other than -.Dv PTHREAD_PROCESS_PRIVATE -is specified in a call to -.Fn pthread_barrierattr_setpshared , -it will return -.Er EINVAL . +Support for process-shared barriers appeared in +.Fx 11.0 . Modified: head/share/man/man3/pthread_condattr.3 ============================================================================== --- head/share/man/man3/pthread_condattr.3 Tue May 31 21:09:42 2016 (r301076) +++ head/share/man/man3/pthread_condattr.3 Tue May 31 21:16:34 2016 (r301077) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd May 9, 2010 +.Dd May 31, 2016 .Dt PTHREAD_CONDATTR 3 .Os .Sh NAME @@ -160,15 +160,3 @@ and .Fn pthread_condattr_destroy functions conform to .St -p1003.1-96 -.Sh BUGS -The implementation of -condition variables -does not fully conform to -.St -p1003.2 -because the process-shared attribute is ignored; -if any value other than -.Dv PTHREAD_PROCESS_PRIVATE -is specified in a call to -.Fn pthread_condattr_setpshared , -it will return -.Er EINVAL . Modified: head/share/man/man3/pthread_rwlock_init.3 ============================================================================== --- head/share/man/man3/pthread_rwlock_init.3 Tue May 31 21:09:42 2016 (r301076) +++ head/share/man/man3/pthread_rwlock_init.3 Tue May 31 21:16:34 2016 (r301077) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 1998 +.Dd May 31, 2016 .Dt PTHREAD_RWLOCK_INIT 3 .Os .Sh NAME @@ -98,5 +98,3 @@ The .Fn pthread_rwlock_init function first appeared in .Fx 3.0 . -.Sh BUGS -The PTHREAD_PROCESS_SHARED attribute is not supported. Modified: head/share/man/man3/pthread_rwlockattr_setpshared.3 ============================================================================== --- head/share/man/man3/pthread_rwlockattr_setpshared.3 Tue May 31 21:09:42 2016 (r301076) +++ head/share/man/man3/pthread_rwlockattr_setpshared.3 Tue May 31 21:16:34 2016 (r301077) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 1998 +.Dd May 31, 2016 .Dt PTHREAD_RWLOCKATTR_SETPSHARED 3 .Os .Sh NAME @@ -88,7 +88,5 @@ The .Fn pthread_rwlockattr_setpshared function first appeared in .Fx 3.0 . -.Sh BUGS -The -.Dv PTHREAD_PROCESS_SHARED -attribute is not supported. +Support for process-shared read/write locks appeared in +.Fx 11.0 . Modified: head/share/man/man3/pthread_spin_init.3 ============================================================================== --- head/share/man/man3/pthread_spin_init.3 Tue May 31 21:09:42 2016 (r301076) +++ head/share/man/man3/pthread_spin_init.3 Tue May 31 21:16:34 2016 (r301077) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2004 +.Dd May 31, 2016 .Dt PTHREAD_SPIN_INIT 3 .Os .Sh NAME @@ -121,16 +121,5 @@ and in .Lb libthr in .Fx 5.3 . -.Sh BUGS -The implementation of -.Fn pthread_spin_init -does not fully conform to -.St -p1003.2 -because the -.Fa pshared -argument is ignored in -.Lb libthr ; -if any value other than -.Dv PTHREAD_PROCESS_PRIVATE -is specified, it returns -.Er EINVAL . +Support for process-shared spinlocks appeared in +.Fx 11.0 . From owner-svn-src-head@freebsd.org Tue May 31 21:09:44 2016 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 F1AC6B5B0D6; Tue, 31 May 2016 21:09:43 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id C22F41028; Tue, 31 May 2016 21:09:43 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VL9g7L097949; Tue, 31 May 2016 21:09:42 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VL9gbi097946; Tue, 31 May 2016 21:09:42 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605312109.u4VL9gbi097946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 31 May 2016 21:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301076 - head/share/man/man3 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.22 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: Tue, 31 May 2016 21:09:44 -0000 Author: jilles Date: Tue May 31 21:09:42 2016 New Revision: 301076 URL: https://svnweb.freebsd.org/changeset/base/301076 Log: Fix typo ESRC -> ESRCH in pthread man pages. Modified: head/share/man/man3/pthread_attr_get_np.3 head/share/man/man3/pthread_resume_np.3 head/share/man/man3/pthread_suspend_np.3 Modified: head/share/man/man3/pthread_attr_get_np.3 ============================================================================== --- head/share/man/man3/pthread_attr_get_np.3 Tue May 31 20:54:42 2016 (r301075) +++ head/share/man/man3/pthread_attr_get_np.3 Tue May 31 21:09:42 2016 (r301076) @@ -93,7 +93,7 @@ function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for one of given parameters. -.It Bq Er ESRC +.It Bq Er ESRCH No thread could be found corresponding to that specified by the given thread ID. .El Modified: head/share/man/man3/pthread_resume_np.3 ============================================================================== --- head/share/man/man3/pthread_resume_np.3 Tue May 31 20:54:42 2016 (r301075) +++ head/share/man/man3/pthread_resume_np.3 Tue May 31 21:09:42 2016 (r301076) @@ -57,7 +57,7 @@ function will fail if: The value specified by the .Fa tid argument is invalid. -.It Bq Er ESRC +.It Bq Er ESRCH No thread could be found corresponding to the thread ID specified by the .Fa tid argument. Modified: head/share/man/man3/pthread_suspend_np.3 ============================================================================== --- head/share/man/man3/pthread_suspend_np.3 Tue May 31 20:54:42 2016 (r301075) +++ head/share/man/man3/pthread_suspend_np.3 Tue May 31 21:09:42 2016 (r301076) @@ -63,7 +63,7 @@ An attempt was made to suspend the curre The value specified by the .Fa tid argument is invalid. -.It Bq Er ESRC +.It Bq Er ESRCH No thread could be found corresponding to the thread ID specified by the .Fa tid argument. From owner-svn-src-head@freebsd.org Tue May 31 21:23:58 2016 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 38EAEB5BC9B; Tue, 31 May 2016 21:23:58 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 09F8C1F30; Tue, 31 May 2016 21:23:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VLNvBn005203; Tue, 31 May 2016 21:23:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VLNvw1005202; Tue, 31 May 2016 21:23:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605312123.u4VLNvw1005202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 31 May 2016 21:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301080 - head/cddl/usr.sbin/zfsd 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.22 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: Tue, 31 May 2016 21:23:58 -0000 Author: pfg Date: Tue May 31 21:23:57 2016 New Revision: 301080 URL: https://svnweb.freebsd.org/changeset/base/301080 Log: zfsd: Remove a redundant semicolon, Modified: head/cddl/usr.sbin/zfsd/vdev_iterator.cc Modified: head/cddl/usr.sbin/zfsd/vdev_iterator.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/vdev_iterator.cc Tue May 31 21:22:19 2016 (r301079) +++ head/cddl/usr.sbin/zfsd/vdev_iterator.cc Tue May 31 21:23:57 2016 (r301080) @@ -118,7 +118,7 @@ VdevIterator::Next() */ m_vdevQueue.insert(m_vdevQueue.begin(), vdevChildren, vdevChildren + numChildren); - }; + } return (vdevConfig); } From owner-svn-src-head@freebsd.org Tue May 31 20:54:43 2016 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 78764B583F2; Tue, 31 May 2016 20:54:43 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 52F9A16BB; Tue, 31 May 2016 20:54:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VKsgTe094006; Tue, 31 May 2016 20:54:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VKsgAu094003; Tue, 31 May 2016 20:54:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605312054.u4VKsgAu094003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 31 May 2016 20:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301075 - head/sys/dev/sfxge 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.22 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: Tue, 31 May 2016 20:54:43 -0000 Author: arybchik Date: Tue May 31 20:54:42 2016 New Revision: 301075 URL: https://svnweb.freebsd.org/changeset/base/301075 Log: sfxge(4): avoid code duplication in SW events definition Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D6662 Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue May 31 19:24:32 2016 (r301074) +++ head/sys/dev/sfxge/sfxge.h Tue May 31 20:54:42 2016 (r301075) @@ -120,18 +120,15 @@ #define SFXGE_MAGIC_DMAQ_LABEL_MASK \ ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) -#define SFXGE_MAGIC_RX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - -#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ - (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - -#define SFXGE_MAGIC_RX_QREFILL \ - (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) - -#define SFXGE_MAGIC_TX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +enum sfxge_sw_ev { + SFXGE_SW_EV_RX_QFLUSH_DONE = 1, + SFXGE_SW_EV_RX_QFLUSH_FAILED, + SFXGE_SW_EV_RX_QREFILL, + SFXGE_SW_EV_TX_QFLUSH_DONE, +}; +#define SFXGE_SW_EV_MAGIC(_sw_ev) \ + (SFXGE_MAGIC_RESERVED | ((_sw_ev) << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) enum sfxge_evq_state { SFXGE_EVQ_UNINITIALIZED = 0, Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Tue May 31 19:24:32 2016 (r301074) +++ head/sys/dev/sfxge/sfxge_ev.c Tue May 31 20:54:42 2016 (r301075) @@ -230,7 +230,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); - magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label; + magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE) | label; KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq not started")); @@ -264,7 +264,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); - magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label; + magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED) | label; KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq not started")); @@ -355,7 +355,7 @@ sfxge_ev_txq_flush_done(void *arg, uint3 label = txq->type; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); - magic = SFXGE_MAGIC_TX_QFLUSH_DONE | label; + magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE) | label; KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq not started")); @@ -380,19 +380,19 @@ sfxge_ev_software(void *arg, uint16_t ma magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK; switch (magic) { - case SFXGE_MAGIC_RX_QFLUSH_DONE: + case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE): sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label)); break; - case SFXGE_MAGIC_RX_QFLUSH_FAILED: + case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED): sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label)); break; - case SFXGE_MAGIC_RX_QREFILL: + case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QREFILL): sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label)); break; - case SFXGE_MAGIC_TX_QFLUSH_DONE: { + case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE): { struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue May 31 19:24:32 2016 (r301074) +++ head/sys/dev/sfxge/sfxge_rx.c Tue May 31 20:54:42 2016 (r301075) @@ -185,7 +185,7 @@ sfxge_rx_post_refill(void *arg) label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); - magic = SFXGE_MAGIC_RX_QREFILL | label; + magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QREFILL) | label; /* This is guaranteed due to the start/stop order of rx and ev */ KASSERT(evq->init_state == SFXGE_EVQ_STARTED, From owner-svn-src-head@freebsd.org Tue May 31 21:24:45 2016 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 3EEDAB5BD0C; Tue, 31 May 2016 21:24:45 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (mail.torek.net [96.90.199.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10102112F; Tue, 31 May 2016 21:24:44 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.14.9/8.14.9) with ESMTP id u4VLOhnI085631; Tue, 31 May 2016 14:24:43 -0700 (PDT) (envelope-from torek@torek.net) Message-Id: <201605312124.u4VLOhnI085631@elf.torek.net> From: Chris Torek To: Bruce Evans cc: Andrey Chernov , pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300956 - head/lib/libc/stdlib In-reply-to: Your message of "Tue, 31 May 2016 19:58:47 +1000." <20160531185907.Y2047@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <85629.1464729883.1@elf.torek.net> Date: Tue, 31 May 2016 14:24:43 -0700 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (elf.torek.net [127.0.0.1]); Tue, 31 May 2016 14:24:43 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 21:24:45 -0000 >That was what I was complaining about. div.c is for C90 (misspelled >"ANSI"). It wasn't misspelled when I wrote it. :-) The 1989 ANSI C standard was formally ratified in Dec 1989, and the draft was pretty firm by the time I wrote the code (which I am sure was also 1989, despite the 1990 copyright; we added or updated all the copyrights at the last minute, for net-2). ISO's quick adoption, and hence the name C90, post-date all of that. >... div.c hasn't caught up with C99. C99 broke this by changing >the rules for integer division to disallow correct rounding for and >require consistently incorrect rounding. Specifically, C99 requires truncation towards zero, so that (-1)/2 = 0 (not -1) and 1/(-2) = 0 (not -1). You (and I) might prefer (-1)/2 = -1, but most CPU "integer divide" ops provide the other result (so that "x >> 1" and "x / 2" are different when x is negative: "x >> 1" sign extends so that (-1)>>1 == -1). C90 (and C99) both require div() and ldiv() to behave like most CPUs, this this truncation-towards-zero behavior, which makes the two functions kind of pointless in C99. >Correct rounding for a >positive divisor is towards minus infinity so that the remainder is >not negative. This is modulo arithmetic and has good algebraic >properties. C99 requires rounding minus infinity, at least for positive >divisors, under the extension "reliable integer division". Did you state this backwards? For integer divison I see: When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded.[105] If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a; otherwise, the behavior of both a/b and a%b is undefined. which (as footnote 105 notes) is "truncation towards zero", so that (-1)/2 is 0 and not -1. >In C90, >the rounding is implementation-defined, so it may be correct, but it >is "unreliable" since it can be anything. > >In C90, div() is specified as giving "reliable" division, and that is >what the fixups implement. This now wastes time to change nothing. Right -- as long as the compiler must meet C99 rules, div.c can just use the / and % operators. Chris From owner-svn-src-head@freebsd.org Tue May 31 21:34:04 2016 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 5133BB586CB; Tue, 31 May 2016 21:34:04 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id ECAD81B33; Tue, 31 May 2016 21:34:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VLY3kT008955; Tue, 31 May 2016 21:34:03 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VLY3QO008954; Tue, 31 May 2016 21:34:03 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605312134.u4VLY3QO008954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 21:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301081 - head/sys/sys 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.22 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: Tue, 31 May 2016 21:34:04 -0000 Author: ed Date: Tue May 31 21:34:02 2016 New Revision: 301081 URL: https://svnweb.freebsd.org/changeset/base/301081 Log: Make RLIM_INFINITY usable without including . By using __uint64_t instead of uint64_t, this constant can also be used if is included on its own. Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Tue May 31 21:23:57 2016 (r301080) +++ head/sys/sys/resource.h Tue May 31 21:34:02 2016 (r301081) @@ -108,7 +108,7 @@ struct __wrusage { #define RLIM_NLIMITS 15 /* number of resource limits */ -#define RLIM_INFINITY ((rlim_t)(((uint64_t)1 << 63) - 1)) +#define RLIM_INFINITY ((rlim_t)(((__uint64_t)1 << 63) - 1)) /* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */ From owner-svn-src-head@freebsd.org Tue May 31 21:58:10 2016 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 42D79B56114; Tue, 31 May 2016 21:58:10 +0000 (UTC) (envelope-from jmcneill@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 mx1.freebsd.org (Postfix) with ESMTPS id 14D141A90; Tue, 31 May 2016 21:58:10 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VLw9T3016944; Tue, 31 May 2016 21:58:09 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VLw9Mx016943; Tue, 31 May 2016 21:58:09 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605312158.u4VLw9Mx016943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Tue, 31 May 2016 21:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301082 - head/sys/arm/allwinner 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.22 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: Tue, 31 May 2016 21:58:10 -0000 Author: jmcneill Date: Tue May 31 21:58:09 2016 New Revision: 301082 URL: https://svnweb.freebsd.org/changeset/base/301082 Log: Fix a crash while iterating compat strings when no match is found. Spotted by: ian Modified: head/sys/arm/allwinner/aw_ccu.c Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Tue May 31 21:34:02 2016 (r301081) +++ head/sys/arm/allwinner/aw_ccu.c Tue May 31 21:58:09 2016 (r301082) @@ -192,7 +192,7 @@ aw_ccu_search_compatible(void) phandle_t root; root = OF_finddevice("/"); - for (compat = compat_data; compat_data->ocd_str != NULL; compat++) + for (compat = compat_data; compat->ocd_str != NULL; compat++) if (fdt_is_compatible(root, compat->ocd_str)) break; From owner-svn-src-head@freebsd.org Tue May 31 22:37:12 2016 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 64794B569B4; Tue, 31 May 2016 22:37:12 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 31DF21BF3; Tue, 31 May 2016 22:37:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VMbBrk031171; Tue, 31 May 2016 22:37:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VMbBKJ031170; Tue, 31 May 2016 22:37:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605312237.u4VMbBKJ031170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 31 May 2016 22:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301083 - head/share/mk 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.22 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: Tue, 31 May 2016 22:37:12 -0000 Author: bdrewery Date: Tue May 31 22:37:11 2016 New Revision: 301083 URL: https://svnweb.freebsd.org/changeset/base/301083 Log: WITH_META_MODE: Require filemon(4) be loaded. Since META_MODE is being sold and used as a working incremental build, it won't make much sense if filemon data is excluded. There is no way to recover from that in a subsequent build. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue May 31 21:58:09 2016 (r301082) +++ head/share/mk/sys.mk Tue May 31 22:37:11 2016 (r301083) @@ -52,6 +52,9 @@ META_MODE+= meta verbose META_MODE+= silent=yes .endif .if !exists(/dev/filemon) +.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) +.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. +.endif META_MODE+= nofilemon .endif .endif From owner-svn-src-head@freebsd.org Tue May 31 23:08:45 2016 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 2007FB55116; Tue, 31 May 2016 23:08:45 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id CB7BF19EE; Tue, 31 May 2016 23:08:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VN8if4042362; Tue, 31 May 2016 23:08:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VN8hjB042358; Tue, 31 May 2016 23:08:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605312308.u4VN8hjB042358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 31 May 2016 23:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301084 - in head: share/mk sys/conf 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.22 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: Tue, 31 May 2016 23:08:45 -0000 Author: bdrewery Date: Tue May 31 23:08:43 2016 New Revision: 301084 URL: https://svnweb.freebsd.org/changeset/base/301084 Log: WITH_META_MODE: Resolve SYSDIR to avoid changed build commands. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.kmod.mk head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Tue May 31 22:37:11 2016 (r301083) +++ head/share/mk/bsd.kmod.mk Tue May 31 23:08:43 2016 (r301084) @@ -4,7 +4,7 @@ .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) -SYSDIR= ${_dir} +SYSDIR= ${_dir:tA} .endif .endfor .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue May 31 22:37:11 2016 (r301083) +++ head/sys/conf/kern.post.mk Tue May 31 23:08:43 2016 (r301084) @@ -12,7 +12,7 @@ .if defined(DESTDIR) MKMODULESENV+= DESTDIR="${DESTDIR}" .endif -SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;} +SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;:tA} MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}" .if defined(CONF_CFLAGS) Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 31 22:37:11 2016 (r301083) +++ head/sys/conf/kmod.mk Tue May 31 23:08:43 2016 (r301084) @@ -269,7 +269,7 @@ ${OBJS}: ${_link} # Search for kernel source tree in standard places. .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) -SYSDIR= ${_dir} +SYSDIR= ${_dir:tA} .endif .endfor .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) From owner-svn-src-head@freebsd.org Tue May 31 23:12:44 2016 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 D3EC5B552AC; Tue, 31 May 2016 23:12:44 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id A52101DDB; Tue, 31 May 2016 23:12:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VNChW4045746; Tue, 31 May 2016 23:12:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VNChIK045745; Tue, 31 May 2016 23:12:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605312312.u4VNChIK045745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 31 May 2016 23:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301085 - head/sys/conf 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.22 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: Tue, 31 May 2016 23:12:44 -0000 Author: bdrewery Date: Tue May 31 23:12:43 2016 New Revision: 301085 URL: https://svnweb.freebsd.org/changeset/base/301085 Log: Add missed updates for r301079 and r301084. Modified: head/sys/conf/dtb.mk Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Tue May 31 23:08:43 2016 (r301084) +++ head/sys/conf/dtb.mk Tue May 31 23:12:43 2016 (r301085) @@ -34,7 +34,7 @@ # Search for kernel source tree in standard places. .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) -SYSDIR= ${_dir} +SYSDIR= ${_dir:tA} .endif .endfor .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) @@ -51,7 +51,7 @@ all: ${DTB} .if defined(DTS) .for _dts in ${DTS} -${_dts:R:S/$/.dtb/}: ${_dts} +${_dts:R:S/$/.dtb/}: ${_dts} ${OP_META} @echo Generating ${.TARGET} from ${_dts} @${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR} CLEANFILES+=${_dts:R:S/$/.dtb/} From owner-svn-src-head@freebsd.org Tue May 31 23:14:17 2016 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 1B18FB55331; Tue, 31 May 2016 23:14:17 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id DC6C61F6F; Tue, 31 May 2016 23:14:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VNEGYH045836; Tue, 31 May 2016 23:14:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VNEGtm045835; Tue, 31 May 2016 23:14:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605312314.u4VNEGtm045835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 31 May 2016 23:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301086 - head/sys/conf 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.22 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: Tue, 31 May 2016 23:14:17 -0000 Author: bdrewery Date: Tue May 31 23:14:15 2016 New Revision: 301086 URL: https://svnweb.freebsd.org/changeset/base/301086 Log: Define SYSDIR earlier since the defined(FIRMWS) block depends on it. It uses it in a dependency, which won't work if it is not yet defined. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 31 23:12:43 2016 (r301085) +++ head/sys/conf/kmod.mk Tue May 31 23:14:15 2016 (r301086) @@ -76,6 +76,16 @@ OBJCOPY?= objcopy .include .include "config.mk" +# Search for kernel source tree in standard places. +.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys +.if !defined(SYSDIR) && exists(${_dir}/kern/) +SYSDIR= ${_dir:tA} +.endif +.endfor +.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) +.error "can't find kernel source tree" +.endif + .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m # amd64 and mips use direct linking for kmod, all others use shared binaries @@ -266,16 +276,6 @@ ${OBJS}: ${_link} .endif .endfor -# Search for kernel source tree in standard places. -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys -.if !defined(SYSDIR) && exists(${_dir}/kern/) -SYSDIR= ${_dir:tA} -.endif -.endfor -.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) -.error "can't find kernel source tree" -.endif - .NOPATH: ${_ILINKS} ${_ILINKS}: From owner-svn-src-head@freebsd.org Tue May 31 23:26:47 2016 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 64640B557E3; Tue, 31 May 2016 23:26:47 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 1DD671749; Tue, 31 May 2016 23:26:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VNQk4O049520; Tue, 31 May 2016 23:26:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VNQkho049517; Tue, 31 May 2016 23:26:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605312326.u4VNQkho049517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 31 May 2016 23:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301087 - in head: cddl/usr.sbin/zfsd lib/libdevdctl 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.22 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: Tue, 31 May 2016 23:26:47 -0000 Author: asomers Date: Tue May 31 23:26:45 2016 New Revision: 301087 URL: https://svnweb.freebsd.org/changeset/base/301087 Log: Coverity fixes for r300906 lib/libdevdctl/consumer.cc In Consumer::DisconnectFromDevd, don't close the socket if it's already closed. cddl/usr.sbin/zfsd/case_file.cc lib/libdevdctl/consumer.h Delete dead code leftover from before devd(8) gained SOCK_SEQPACKET support Reported by: Coverity CID: 1356155, 1356169 Sponsored by: Spectra Logic Corp Modified: head/cddl/usr.sbin/zfsd/case_file.cc head/lib/libdevdctl/consumer.cc head/lib/libdevdctl/consumer.h Modified: head/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.cc Tue May 31 23:14:15 2016 (r301086) +++ head/cddl/usr.sbin/zfsd/case_file.cc Tue May 31 23:26:45 2016 (r301087) @@ -83,7 +83,6 @@ using std::setfill; using std::setw; using DevdCtl::Event; -using DevdCtl::EventBuffer; using DevdCtl::EventFactory; using DevdCtl::EventList; using DevdCtl::Guid; Modified: head/lib/libdevdctl/consumer.cc ============================================================================== --- head/lib/libdevdctl/consumer.cc Tue May 31 23:14:15 2016 (r301086) +++ head/lib/libdevdctl/consumer.cc Tue May 31 23:26:45 2016 (r301087) @@ -129,10 +129,10 @@ Consumer::ConnectToDevd() void Consumer::DisconnectFromDevd() { - if (m_devdSockFD != -1) + if (m_devdSockFD != -1) { syslog(LOG_INFO, "Disconnecting from devd."); - - close(m_devdSockFD); + close(m_devdSockFD); + } m_devdSockFD = -1; } Modified: head/lib/libdevdctl/consumer.h ============================================================================== --- head/lib/libdevdctl/consumer.h Tue May 31 23:14:15 2016 (r301086) +++ head/lib/libdevdctl/consumer.h Tue May 31 23:26:45 2016 (r301087) @@ -44,8 +44,6 @@ namespace DevdCtl /*=========================== Forward Declarations ===========================*/ class Event; -class EventBuffer; -class FDReader; /*============================ Class Declarations ============================*/ /*----------------------------- DevdCtl::Consumer ----------------------------*/ @@ -139,16 +137,6 @@ protected: */ int m_devdSockFD; - /** - * Reader tied to the devd socket. - */ - FDReader *m_reader; - - /** - * Default EventBuffer connected to m_reader. - */ - EventBuffer *m_eventBuffer; - EventFactory m_eventFactory; /** Queued events for replay. */ From owner-svn-src-head@freebsd.org Tue May 31 23:40:22 2016 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 860D4B55A73; Tue, 31 May 2016 23:40:22 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 572ED1D44; Tue, 31 May 2016 23:40:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VNeLhi053411; Tue, 31 May 2016 23:40:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VNeLjr053409; Tue, 31 May 2016 23:40:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605312340.u4VNeLjr053409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 31 May 2016 23:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301088 - head/sys/conf 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.22 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: Tue, 31 May 2016 23:40:22 -0000 Author: bdrewery Date: Tue May 31 23:40:21 2016 New Revision: 301088 URL: https://svnweb.freebsd.org/changeset/base/301088 Log: WITH_META_MDE: Fix machine/include and x86/include issues. - Fixes 'ln: File exists' errors. - Fixes creating include directories in the source directory as well. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue May 31 23:26:45 2016 (r301087) +++ head/sys/conf/kern.post.mk Tue May 31 23:40:21 2016 (r301088) @@ -285,7 +285,7 @@ ${_ILINKS}: path=${S}/${.TARGET}/include ;; \ esac ; \ ${ECHO} ${.TARGET} "->" $$path ; \ - ln -s $$path ${.TARGET} + ln -fhs $$path ${.TARGET} # .depend needs include links so we remove them only together. kernel-cleandepend: .PHONY Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 31 23:26:45 2016 (r301087) +++ head/sys/conf/kmod.mk Tue May 31 23:40:21 2016 (r301088) @@ -287,7 +287,7 @@ ${_ILINKS}: esac ; \ path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ - ln -sf $$path ${.TARGET:T} + ln -fhs $$path ${.TARGET:T} CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} From owner-svn-src-head@freebsd.org Wed Jun 1 00:32:33 2016 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 EDA1DB57B43; Wed, 1 Jun 2016 00:32:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id D1FBC18BA; Wed, 1 Jun 2016 00:32:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id E9324D5BE; Wed, 1 Jun 2016 00:32:32 +0000 (UTC) Subject: Re: svn commit: r301023 - head/sys/boot/geli To: Xin Li , Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605310624.u4V6OAYi071387@repo.freebsd.org> <31d1323b-cb13-9a90-8b25-430fdbc1d225@delphij.net> Cc: d@delphij.net From: Allan Jude Message-ID: <7085dc80-f4ce-9a78-7153-0bf4995cabd4@freebsd.org> Date: Tue, 31 May 2016 20:32:32 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <31d1323b-cb13-9a90-8b25-430fdbc1d225@delphij.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 00:32:34 -0000 On 2016-05-31 02:31, Xin Li wrote: > > > On 5/30/16 23:24, Garrett Cooper wrote: >> Author: ngie >> Date: Tue May 31 06:24:09 2016 >> New Revision: 301023 >> URL: https://svnweb.freebsd.org/changeset/base/301023 >> >> Log: >> Add missing libc includes to fix -Wimplicit-function-declaration warnings >> >> MFC after: 2 weeks >> Reported by: clang >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/boot/geli/geliboot_crypto.c >> >> Modified: head/sys/boot/geli/geliboot_crypto.c >> ============================================================================== >> --- head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:00:18 2016 (r301022) >> +++ head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:24:09 2016 (r301023) >> @@ -27,6 +27,10 @@ >> * $FreeBSD$ >> */ >> >> +#include >> +#include >> +#include >> + >> #include "geliboot.h" > > This is wrong, you shouldn't use standard C library in freestanding > environment. > > It seems that libstand.h is explicitly excluded, why? (in geliboot.h, > allanjude cc'ed): > > %%% > /* AES-XTS implementation */ > #define _STAND > #define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ > #include > > %%% > > Cheers, > The boot loader uses sys/common/util.h to avoid needing all of libstand in size sensitive files like boot2 (7kb) and zfsboot (64kb). If you then pull in stand.h or string.h, you get conflicting definitions of the functions like printf and bcmp. The manual defines for STAND_H, _STRING_H_, _STDIO_H_, etc, are there to block those files being included by existing library we use, like opencrypto and geli. Since these are included before geliboot.h, and only compiled into the libgeliboot.a archive, it would seem to work, although it is probably confusing to anyone trying to read the code. -- Allan Jude From owner-svn-src-head@freebsd.org Wed Jun 1 01:43:48 2016 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 127F3B55AC1; Wed, 1 Jun 2016 01:43:48 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id B1AE912E9; Wed, 1 Jun 2016 01:43:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u511hkqd000219; Wed, 1 Jun 2016 01:43:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u511hkge000218; Wed, 1 Jun 2016 01:43:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010143.u511hkge000218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 01:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301089 - head/sys/dev/ath/ath_hal 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.22 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, 01 Jun 2016 01:43:48 -0000 Author: adrian Date: Wed Jun 1 01:43:46 2016 New Revision: 301089 URL: https://svnweb.freebsd.org/changeset/base/301089 Log: [ath_hal] add extra MCI definitions used by the later chips (QCA9565/Aphrodite). Obtained from: Linux ath9k Modified: head/sys/dev/ath/ath_hal/ah_btcoex.h Modified: head/sys/dev/ath/ath_hal/ah_btcoex.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_btcoex.h Tue May 31 23:40:21 2016 (r301088) +++ head/sys/dev/ath/ath_hal/ah_btcoex.h Wed Jun 1 01:43:46 2016 (r301089) @@ -488,6 +488,17 @@ typedef enum mci_state_type { #define ATH_MCI_CONFIG_CLK_DIV 0x00003000 #define ATH_MCI_CONFIG_CLK_DIV_S 12 #define ATH_MCI_CONFIG_DISABLE_TUNING 0x00004000 +#define ATH_MCI_CONFIG_DISABLE_AIC 0x00008000 +#define ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN 0x007f0000 +#define ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN_S 16 +#define ATH_MCI_CONFIG_NO_QUIET_ACK 0x00800000 +#define ATH_MCI_CONFIG_NO_QUIET_ACK_S 23 +#define ATH_MCI_CONFIG_ANT_ARCH 0x07000000 +#define ATH_MCI_CONFIG_ANT_ARCH_S 24 +#define ATH_MCI_CONFIG_FORCE_QUIET_ACK 0x08000000 +#define ATH_MCI_CONFIG_FORCE_QUIET_ACK_S 27 +#define ATH_MCI_CONFIG_FORCE_2CHAIN_ACK 0x10000000 +#define ATH_MCI_CONFIG_MCI_STAT_DBG 0x20000000 #define ATH_MCI_CONFIG_MCI_WEIGHT_DBG 0x40000000 #define ATH_MCI_CONFIG_DISABLE_MCI 0x80000000 @@ -496,6 +507,16 @@ typedef enum mci_state_type { ATH_MCI_CONFIG_MCI_OBS_BT ) #define ATH_MCI_CONFIG_MCI_OBS_GPIO 0x0000002F +#define ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_NON_SHARED 0x00 +#define ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED 0x01 +#define ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_NON_SHARED 0x02 +#define ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_SHARED 0x03 +#define ATH_MCI_ANT_ARCH_3_ANT 0x04 + +#define MCI_ANT_ARCH_PA_LNA_SHARED(c) \ + ((MS(c, ATH_MCI_CONFIG_ANT_ARCH) == ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED) || \ + (MS(c, ATH_MCI_CONFIG_ANT_ARCH) == ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_SHARED)) + #define ATH_MCI_CONCUR_TX_SHARED_CHN 0x01 #define ATH_MCI_CONCUR_TX_UNSHARED_CHN 0x02 #define ATH_MCI_CONCUR_TX_DEBUG 0x03 From owner-svn-src-head@freebsd.org Wed Jun 1 02:19:32 2016 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 7A4B0B5603D for ; Wed, 1 Jun 2016 02:19:32 +0000 (UTC) (envelope-from 0100015509c21dee-dc913825-b7aa-4dbf-a518-e606e7f47f75-000000@amazonses.com) Received: from a8-237.smtp-out.amazonses.com (a8-237.smtp-out.amazonses.com [54.240.8.237]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41FED1ED8 for ; Wed, 1 Jun 2016 02:19:31 +0000 (UTC) (envelope-from 0100015509c21dee-dc913825-b7aa-4dbf-a518-e606e7f47f75-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1464747564; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=TEF59BL9KJ2qeIr4ow1r7IALSQCgfeIGyIkCL3ORPPU=; b=g1qgaJaJ38lcgZPNHsPMGidqegW8rVmT2IoLfPvWvrbBuz/l2pqsixf9oYOgR7tO MtB4BizQVZ2v49oELw1EIMz5zTqS48yVZ4khPExVC0lTeDkIniHzpC9z8kR+F6jvxIM z0/mduq3tWSvM9IM9ywwH84bsTZCeAa4yCOB57dI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1464747564; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=TEF59BL9KJ2qeIr4ow1r7IALSQCgfeIGyIkCL3ORPPU=; b=zXuxJVfhXBkp3z0vw8QC/YoQJaTU+1SmHEJx+vzCVBihCDOyhYmdvMTu2s6YBXxa 9lRTodgNoxaeBb5/TKMUMUlrVH5RHOEfs/LaxmJAdQ3ckx3CHTHVgYYuzaLebei53U4 gA7UQBrnsAQqCLa06KvIBcdMrmWiXo5XKHhlupDw= Subject: Re: svn commit: r294773 - in head/etc: . defaults periodic/daily rc.d To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601260706.u0Q76iWk015311@repo.freebsd.org> From: Colin Percival Message-ID: <0100015509c21dee-dc913825-b7aa-4dbf-a518-e606e7f47f75-000000@email.amazonses.com> Date: Wed, 1 Jun 2016 02:19:24 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201601260706.u0Q76iWk015311@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2016.06.01-54.240.8.237 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 02:19:32 -0000 On 01/25/16 23:06, Cy Schubert wrote: > Author: cy > Date: Tue Jan 26 07:06:44 2016 > New Revision: 294773 > URL: https://svnweb.freebsd.org/changeset/base/294773 > > Log: > Add support for automatic leap-second file updates. > [...] > Added: head/etc/periodic/daily/480.leapfile-ntpd > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Jan 26 07:06:44 2016 (r294773) > [...] > + case "$daily_ntpd_avoid_congestion" in > + [Yy][Ee][Ss]) > + # Avoid dogpiling > + (sleep $(jot -r 1 0 86400); service ntpd fetch) & > + ;; > + *) > + service ntpd fetch > + ;; Can we change this to 'service ntpd onefetch'? If someone turns on this periodic script, I think it's safe to assume that they want it to run, even if they don't have ntpd running. (In my case, I have some systems where `ntpd -q` runs from cron but I don't want to leave the daemon running continuously.) -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Wed Jun 1 02:30:08 2016 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 0E3D0B56237; Wed, 1 Jun 2016 02:30:08 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id BAE0B1326; Wed, 1 Jun 2016 02:30:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u512U62j014945; Wed, 1 Jun 2016 02:30:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u512U6AK014944; Wed, 1 Jun 2016 02:30:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606010230.u512U6AK014944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 Jun 2016 02:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301090 - head/usr.bin/mkimg 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.22 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, 01 Jun 2016 02:30:08 -0000 Author: markj Date: Wed Jun 1 02:30:06 2016 New Revision: 301090 URL: https://svnweb.freebsd.org/changeset/base/301090 Log: mkimg: Indicate that input file pages are unlikely to be reused. mkimg(1) uses a swap file to back input file chunks. When the output file is being written out, blocks of the swap file are mapped and their contents copied. This causes the backing VM pages to enter the active queue, and when the output file is large relative to system memory (as is generally the case), can result in a shortfall of inactive memory. This causes the pagedaemon to aggressively scan the active queue and swap out process memory in an attempt to meet the shortfall. Because mkimg's input files are typically the intermediate result of some build process, there's no need to push them all through the active queue. Use madvise(2) to indicate that the backing pages may be reclaimed in preference to active pages. In the case of the swap file, these pages will be freed as soon as mkimg exits anyway. When using mkimg on a desktop-class system with large amounts of dirty process memory, this change substantially improves mkimg runtime and reduces swap usage. Reviewed by: marcel MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6654 Modified: head/usr.bin/mkimg/image.c Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Wed Jun 1 01:43:46 2016 (r301089) +++ head/usr.bin/mkimg/image.c Wed Jun 1 02:30:06 2016 (r301090) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -315,6 +316,8 @@ image_file_unmap(void *buffer, size_t sz unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz; sz = (sz + unit - 1) & ~(unit - 1); + if (madvise(buffer, sz, MADV_DONTNEED) != 0) + warn("madvise"); munmap(buffer, sz); return (0); } From owner-svn-src-head@freebsd.org Wed Jun 1 03:17:37 2016 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 E8A2CB56ADB; Wed, 1 Jun 2016 03:17:37 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id B5D581A4B; Wed, 1 Jun 2016 03:17:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513HaNH033749; Wed, 1 Jun 2016 03:17:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513HaqS033748; Wed, 1 Jun 2016 03:17:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010317.u513HaqS033748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301091 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 03:17:38 -0000 Author: adrian Date: Wed Jun 1 03:17:36 2016 New Revision: 301091 URL: https://svnweb.freebsd.org/changeset/base/301091 Log: [ath_hal] add extra debugging for MCI interrupts. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Wed Jun 1 02:30:06 2016 (r301090) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Wed Jun 1 03:17:36 2016 (r301091) @@ -389,6 +389,8 @@ ar9300_get_pending_interrupts( if (int_rx_msg & AR_MCI_INTERRUPT_RX_MSG_CONT_INFO) { ahp->ah_mci_cont_status = OS_REG_READ(ah, AR_MCI_CONT_STATUS); + HALDEBUG(ah, HAL_DEBUG_BT_COEX, + "(MCI) cont_status=0x%08x\n", ahp->ah_mci_cont_status); } OS_REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_RAW, int_rx_msg); From owner-svn-src-head@freebsd.org Wed Jun 1 03:20:56 2016 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 B1C47B56BD9; Wed, 1 Jun 2016 03:20:56 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 85DFA1C6E; Wed, 1 Jun 2016 03:20:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513Ktbt034546; Wed, 1 Jun 2016 03:20:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513Ktc3034545; Wed, 1 Jun 2016 03:20:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010320.u513Ktc3034545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301092 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 03:20:56 -0000 Author: adrian Date: Wed Jun 1 03:20:55 2016 New Revision: 301092 URL: https://svnweb.freebsd.org/changeset/base/301092 Log: [ath_hal] add QCA9565 bluteooth antenna control. This configures the LNA antenna diversity control, which should be on if wlan owns the LNA for bluetooth coexistence. Otherwise, make sure it's off. I think this is eventually intended to allow 1-antenna bluetooth + wifi setups for QCA9565, but I'm not sure where that's actually configured in ath9k. Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Wed Jun 1 03:17:36 2016 (r301091) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Wed Jun 1 03:20:55 2016 (r301092) @@ -1643,6 +1643,10 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at u_int32_t xlan_gpio_cfg; u_int8_t i; + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: use_bt_ant_enable=%d\n", + __func__, ahp->ah_lna_div_use_bt_ant_enable); + + /* XXX TODO: only if rx_gain_idx == 0 */ if (AR_SREV_POSEIDON(ah)) { xlan_gpio_cfg = ah->ah_config.ath_hal_ext_lna_ctl_gpio; if (xlan_gpio_cfg) { @@ -1733,7 +1737,7 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at AR_PHY_SWITCH_CHAIN_2, AR_SWITCH_TABLE_ALL, value); } } - if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah)) { + if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) { value = ar9300_eeprom_get(ahp, EEP_ANTDIV_control); /* main_lnaconf, alt_lnaconf, main_tb, alt_tb */ regval = OS_REG_READ(ah, AR_PHY_MC_GAIN_CTRL); @@ -1747,6 +1751,29 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at if ( AR_SREV_POSEIDON(ah) && (ahp->ah_lna_div_use_bt_ant_enable == TRUE) ) { regval |= ANT_DIV_ENABLE; } + if (AR_SREV_APHRODITE(ah)) { + if (ahp->ah_lna_div_use_bt_ant_enable) { + regval |= (1 << MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT); + + OS_REG_SET_BIT(ah, AR_PHY_RESTART, + RESTART__ENABLE_ANT_FAST_DIV_M2FLAG__MASK); + + /* Force WLAN LNA diversity ON */ + OS_REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, + AR_BTCOEX_WL_LNADIV_FORCE_ON); + } else { + regval &= ~(1 << MULTICHAIN_GAIN_CTRL__ENABLE_ANT_DIV_LNADIV__SHIFT); + regval &= ~(1 << MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT); + + OS_REG_CLR_BIT(ah, AR_PHY_MC_GAIN_CTRL, + (1 << MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT)); + + /* Force WLAN LNA diversity OFF */ + OS_REG_CLR_BIT(ah, AR_BTCOEX_WL_LNADIV, + AR_BTCOEX_WL_LNADIV_FORCE_ON); + } + } + #endif /* ATH_ANT_DIV_COMB */ OS_REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); @@ -1756,7 +1783,8 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at regval |= ((value >> 7) & 0x1) << BBB_SIG_DETECT__ENABLE_ANT_FAST_DIV__SHIFT; #if ATH_ANT_DIV_COMB - if ( AR_SREV_POSEIDON(ah) && (ahp->ah_lna_div_use_bt_ant_enable == TRUE) ) { + if ((AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) + && (ahp->ah_lna_div_use_bt_ant_enable == TRUE) ) { regval |= FAST_DIV_ENABLE; } #endif /* ATH_ANT_DIV_COMB */ From owner-svn-src-head@freebsd.org Wed Jun 1 03:21:24 2016 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 5F928B56C32; Wed, 1 Jun 2016 03:21:24 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 2FABD1EE8; Wed, 1 Jun 2016 03:21:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513LNeL034610; Wed, 1 Jun 2016 03:21:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513LNjZ034609; Wed, 1 Jun 2016 03:21:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010321.u513LNjZ034609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301093 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 03:21:24 -0000 Author: adrian Date: Wed Jun 1 03:21:23 2016 New Revision: 301093 URL: https://svnweb.freebsd.org/changeset/base/301093 Log: [ath_hal] Allow the BT antenna diversity option to be enabled for QCA9565. Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed Jun 1 03:20:55 2016 (r301092) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed Jun 1 03:21:23 2016 (r301093) @@ -2457,11 +2457,13 @@ static void ar9300_bt_coex_antenna_diversity(struct ath_hal *ah, u_int32_t value) { struct ath_hal_9300 *ahp = AH9300(ah); -#if ATH_ANT_DIV_COMB +#if ATH_ANT_DIV_COMB //struct ath_hal_private *ahpriv = AH_PRIVATE(ah); const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; #endif + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called, value=%d\n", __func__, value); + if (ahp->ah_bt_coex_flag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW) { if (ahp->ah_diversity_control == HAL_ANT_VARIABLE) @@ -2494,7 +2496,7 @@ ar9300_bt_coex_set_parameter(struct ath_ break; case HAL_BT_COEX_ANTENNA_DIVERSITY: - if (AR_SREV_POSEIDON(ah)) { + if (AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) { ahp->ah_bt_coex_flag |= HAL_BT_COEX_FLAG_ANT_DIV_ALLOW; if (value) { ahp->ah_bt_coex_flag |= HAL_BT_COEX_FLAG_ANT_DIV_ENABLE; From owner-svn-src-head@freebsd.org Wed Jun 1 03:24:54 2016 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 6CCA7B56E65; Wed, 1 Jun 2016 03:24:54 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 4477011CC; Wed, 1 Jun 2016 03:24:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513OrM5037301; Wed, 1 Jun 2016 03:24:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513OrYq037300; Wed, 1 Jun 2016 03:24:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010324.u513OrYq037300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301094 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 03:24:54 -0000 Author: adrian Date: Wed Jun 1 03:24:53 2016 New Revision: 301094 URL: https://svnweb.freebsd.org/changeset/base/301094 Log: [ath_hal] add support for QCA9565 for configuring the bluetooth antenna LNA diversity. Notably, this also sets AR_BTCOEX_WL_LNADIV to FORCE_ON, so LNA diversity is always enabled and under control of the wifi chip. Tested: * QCA9565, STA + bluetooth mode Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Wed Jun 1 03:21:23 2016 (r301093) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Wed Jun 1 03:24:53 2016 (r301094) @@ -5340,6 +5340,9 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM ar9300_set_smart_antenna(ah, ahp->ah_smartantenna_enable); + if (AR_SREV_APHRODITE(ah) && ahp->ah_lna_div_use_bt_ant_enable) + OS_REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); + if (ahp->ah_skip_rx_iq_cal && !is_scan) { /* restore RX Cal result if existing */ ar9300_rx_iq_cal_restore(ah); @@ -6385,6 +6388,9 @@ ar9300_ant_ctrl_set_lna_div_use_bt_ant(s struct ath_hal_private *ahpriv = AH_PRIVATE(ah); HAL_CAPABILITIES *pcap = &ahpriv->ah_caps; + HALDEBUG(ah, HAL_DEBUG_RESET | HAL_DEBUG_BT_COEX, + "%s: called; enable=%d\n", __func__, enable); + if (AR_SREV_POSEIDON(ah)) { // Make sure this scheme is only used for WB225(Astra) ahp->ah_lna_div_use_bt_ant_enable = enable; @@ -6454,10 +6460,35 @@ ar9300_ant_ctrl_set_lna_div_use_bt_ant(s } return AH_TRUE; - } else { + } else if (AR_SREV_APHRODITE(ah)) { + ahp->ah_lna_div_use_bt_ant_enable = enable; + if (enable) { + OS_REG_SET_BIT(ah, AR_PHY_MC_GAIN_CTRL, ANT_DIV_ENABLE); + OS_REG_SET_BIT(ah, AR_PHY_MC_GAIN_CTRL, (1 << MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT)); + OS_REG_SET_BIT(ah, AR_PHY_CCK_DETECT, AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + OS_REG_SET_BIT(ah, AR_PHY_RESTART, RESTART__ENABLE_ANT_FAST_DIV_M2FLAG__MASK); + OS_REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); + } else { + OS_REG_CLR_BIT(ah, AR_PHY_MC_GAIN_CTRL, ANT_DIV_ENABLE); + OS_REG_CLR_BIT(ah, AR_PHY_MC_GAIN_CTRL, (1 << MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT)); + OS_REG_CLR_BIT(ah, AR_PHY_CCK_DETECT, AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + OS_REG_CLR_BIT(ah, AR_PHY_RESTART, RESTART__ENABLE_ANT_FAST_DIV_M2FLAG__MASK); + OS_REG_CLR_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); + + regval = OS_REG_READ(ah, AR_PHY_MC_GAIN_CTRL); + regval &= (~(MULTICHAIN_GAIN_CTRL__ANT_DIV_MAIN_LNACONF__MASK | + MULTICHAIN_GAIN_CTRL__ANT_DIV_ALT_LNACONF__MASK | + MULTICHAIN_GAIN_CTRL__ANT_DIV_ALT_GAINTB__MASK | + MULTICHAIN_GAIN_CTRL__ANT_DIV_MAIN_GAINTB__MASK)); + regval |= (HAL_ANT_DIV_COMB_LNA1 << + MULTICHAIN_GAIN_CTRL__ANT_DIV_MAIN_LNACONF__SHIFT); + regval |= (HAL_ANT_DIV_COMB_LNA2 << + MULTICHAIN_GAIN_CTRL__ANT_DIV_ALT_LNACONF__SHIFT); + + OS_REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); + } return AH_TRUE; } - - /* XXX TODO: Add AR9565 support? */ + return AH_TRUE; } #endif /* ATH_ANT_DIV_COMB */ From owner-svn-src-head@freebsd.org Wed Jun 1 03:27:35 2016 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 0F6D7B56EED; Wed, 1 Jun 2016 03:27:35 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id B9A9C13A9; Wed, 1 Jun 2016 03:27:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513RXO6037434; Wed, 1 Jun 2016 03:27:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513RXq0037433; Wed, 1 Jun 2016 03:27:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010327.u513RXq0037433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301095 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 03:27:35 -0000 Author: adrian Date: Wed Jun 1 03:27:33 2016 New Revision: 301095 URL: https://svnweb.freebsd.org/changeset/base/301095 Log: [ath_hal] add MCI bits from ath9k for QCA9565 * Add extra debugging - the weights debugging is really useful to ensure things are programmed into the wlan coexistence table. The weights are what traffic priority each of the various modes get (tx, tx-high-priority, rx-beacon, etc) if they're all zero, things work very poorly. * Add in coex init routines from ath9k for AR9462 and QCA9565 1ANT and 2ANT. This control things like beacon stomping, ACK handling, antennas, PA/LNA shared, etc. * Some ancillary bits. TODO: * There's some conditional stuff around MCI_ANT_ARCH_PA_LNA_SHARED() in ath9k which doesn't always enable force-on LNA. That'll have to be examined and merged in as appropriate. Obtained from: linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Wed Jun 1 03:24:53 2016 (r301094) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Wed Jun 1 03:27:33 2016 (r301095) @@ -73,6 +73,10 @@ void ar9300_mci_osla_setup(struct ath_ha if (!(ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_DISABLE_AGGR_THRESH)) { + + if (AR_SREV_APHRODITE(ah)) + OS_REG_RMW_FIELD(ah, AR_MCI_MISC, AR_MCI_MISC_HW_FIX_EN, 1); + thresh = MS(ah->ah_config.ath_hal_mci_config, ATH_MCI_CONFIG_AGGR_THRESH); OS_REG_RMW_FIELD(ah, AR_BTCOEX_CTRL, @@ -147,11 +151,11 @@ static int32_t ar9300_mci_wait_for_inter } if (time_out <= 0) { - HALDEBUG(ah, HAL_DEBUG_BT_COEX, + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) %s: Wait for Reg0x%08x = 0x%08x timeout.\n", __func__, address, bit_position); HALDEBUG(ah, HAL_DEBUG_BT_COEX, - "(MCI) INT_RAW = 0x%08x, RX_MSG_RAW = 0x%08x", + "(MCI) INT_RAW = 0x%08x, RX_MSG_RAW = 0x%08x\n", OS_REG_READ(ah, AR_MCI_INTERRUPT_RAW), OS_REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_RAW)); time_out = 0; @@ -450,6 +454,9 @@ void ar9300_mci_2g5g_switch(struct ath_h void ar9300_mci_mute_bt(struct ath_hal *ah) { + + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called\n", __func__); + /* disable all MCI messages */ OS_REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, 0xFFFF0000); OS_REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, 0xFFFFFFFF); @@ -488,10 +495,13 @@ static void ar9300_mci_observation_set_u OS_REG_WRITE(ah, AR_PHY_TEST, 0x00080000); // a360 OS_REG_WRITE(ah, AR_PHY_TEST_CTL_STATUS, 0xe0000000); // a364 */ + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called; config=0x%08x\n", + __func__, ah->ah_config.ath_hal_mci_config); if (ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_MCI_OBS_MCI) { + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_MCI\n", __func__); ar9300_gpio_cfg_output(ah, 3, HAL_GPIO_OUTPUT_MUX_AS_MCI_WLAN_DATA); ar9300_gpio_cfg_output(ah, 2, HAL_GPIO_OUTPUT_MUX_AS_MCI_WLAN_CLK); ar9300_gpio_cfg_output(ah, 1, HAL_GPIO_OUTPUT_MUX_AS_MCI_BT_DATA); @@ -500,6 +510,7 @@ static void ar9300_mci_observation_set_u else if (ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_MCI_OBS_TXRX) { + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_TXRX\n", __func__); ar9300_gpio_cfg_output(ah, 3, HAL_GPIO_OUTPUT_MUX_AS_WL_IN_TX); ar9300_gpio_cfg_output(ah, 2, HAL_GPIO_OUTPUT_MUX_AS_WL_IN_RX); ar9300_gpio_cfg_output(ah, 1, HAL_GPIO_OUTPUT_MUX_AS_BT_IN_TX); @@ -509,6 +520,7 @@ static void ar9300_mci_observation_set_u else if (ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_MCI_OBS_BT) { + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_BT\n", __func__); ar9300_gpio_cfg_output(ah, 3, HAL_GPIO_OUTPUT_MUX_AS_BT_IN_TX); ar9300_gpio_cfg_output(ah, 2, HAL_GPIO_OUTPUT_MUX_AS_BT_IN_RX); ar9300_gpio_cfg_output(ah, 1, HAL_GPIO_OUTPUT_MUX_AS_MCI_BT_DATA); @@ -913,6 +925,68 @@ void ar9300_mci_enable_interrupt(struct AR_MCI_INTERRUPT_RX_MSG_DEFAULT); } +static void ar9300_mci_set_btcoex_ctrl_9565_1ANT(struct ath_hal *ah) +{ + uint32_t regval; + + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called\n", __func__); + regval = SM(1, AR_BTCOEX_CTRL_JUPITER_MODE) | + SM(1, AR_BTCOEX_CTRL_WBTIMER_EN) | + SM(1, AR_BTCOEX_CTRL_PA_SHARED) | + SM(1, AR_BTCOEX_CTRL_LNA_SHARED) | + SM(1, AR_BTCOEX_CTRL_NUM_ANTENNAS) | + SM(1, AR_BTCOEX_CTRL_RX_CHAIN_MASK) | + SM(0, AR_BTCOEX_CTRL_1_CHAIN_ACK) | + SM(0, AR_BTCOEX_CTRL_1_CHAIN_BCN) | + SM(0, AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN); + + OS_REG_RMW_FIELD(ah, AR_BTCOEX_CTRL2, + AR_BTCOEX_CTRL2_TX_CHAIN_MASK, 0x1); + OS_REG_WRITE(ah, AR_BTCOEX_CTRL, regval); +} + +static void ar9300_mci_set_btcoex_ctrl_9565_2ANT(struct ath_hal *ah) +{ + uint32_t regval; + + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called\n", __func__); + regval = SM(1, AR_BTCOEX_CTRL_JUPITER_MODE) | + SM(1, AR_BTCOEX_CTRL_WBTIMER_EN) | + SM(0, AR_BTCOEX_CTRL_PA_SHARED) | + SM(0, AR_BTCOEX_CTRL_LNA_SHARED) | + SM(2, AR_BTCOEX_CTRL_NUM_ANTENNAS) | + SM(1, AR_BTCOEX_CTRL_RX_CHAIN_MASK) | + SM(0, AR_BTCOEX_CTRL_1_CHAIN_ACK) | + SM(0, AR_BTCOEX_CTRL_1_CHAIN_BCN) | + SM(0, AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN); + + OS_REG_RMW_FIELD(ah, AR_BTCOEX_CTRL2, + AR_BTCOEX_CTRL2_TX_CHAIN_MASK, 0x0); + OS_REG_WRITE(ah, AR_BTCOEX_CTRL, regval); +} + +static void ar9300_mci_set_btcoex_ctrl_9462(struct ath_hal *ah) +{ + uint32_t regval; + + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called\n", __func__); + regval = SM(1, AR_BTCOEX_CTRL_JUPITER_MODE) | + SM(1, AR_BTCOEX_CTRL_WBTIMER_EN) | + SM(1, AR_BTCOEX_CTRL_PA_SHARED) | + SM(1, AR_BTCOEX_CTRL_LNA_SHARED) | + SM(2, AR_BTCOEX_CTRL_NUM_ANTENNAS) | + SM(3, AR_BTCOEX_CTRL_RX_CHAIN_MASK) | + SM(0, AR_BTCOEX_CTRL_1_CHAIN_ACK) | + SM(0, AR_BTCOEX_CTRL_1_CHAIN_BCN) | + SM(0, AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN); + + if (AR_SREV_JUPITER_10(ah)) { + regval |= SM(1, AR_BTCOEX_CTRL_SPDT_ENABLE_10); + } + + OS_REG_WRITE(ah, AR_BTCOEX_CTRL, regval); +} + void ar9300_mci_reset(struct ath_hal *ah, HAL_BOOL en_int, HAL_BOOL is_2g, HAL_BOOL is_full_sleep) { @@ -945,21 +1019,17 @@ void ar9300_mci_reset(struct ath_hal *ah * To avoid MCI state machine be affected by incoming remote MCI messages, * MCI mode will be enabled later, right before reset the MCI TX and RX. */ - regval = SM(1, AR_BTCOEX_CTRL_JUPITER_MODE) | - SM(1, AR_BTCOEX_CTRL_WBTIMER_EN) | - SM(1, AR_BTCOEX_CTRL_PA_SHARED) | - SM(1, AR_BTCOEX_CTRL_LNA_SHARED) | - SM(2, AR_BTCOEX_CTRL_NUM_ANTENNAS) | - SM(3, AR_BTCOEX_CTRL_RX_CHAIN_MASK) | - SM(0, AR_BTCOEX_CTRL_1_CHAIN_ACK) | - SM(0, AR_BTCOEX_CTRL_1_CHAIN_BCN) | - SM(0, AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN); - - if (AR_SREV_JUPITER_10(ah)) { - regval |= SM(1, AR_BTCOEX_CTRL_SPDT_ENABLE_10); + if (AR_SREV_APHRODITE(ah)) { + uint8_t ant = MS(ah->ah_config.ath_hal_mci_config, + ATH_MCI_CONFIG_ANT_ARCH); + if (ant == ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED) + ar9300_mci_set_btcoex_ctrl_9565_1ANT(ah); + else + ar9300_mci_set_btcoex_ctrl_9565_2ANT(ah); + } else { + ar9300_mci_set_btcoex_ctrl_9462(ah); } - OS_REG_WRITE(ah, AR_BTCOEX_CTRL, regval); if (is_2g && (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) && !(ah->ah_config.ath_hal_mci_config & @@ -982,6 +1052,9 @@ void ar9300_mci_reset(struct ath_hal *ah OS_REG_RMW_FIELD(ah, AR_PCU_MISC, AR_PCU_BT_ANT_PREVENT_RX, 0); + /* Set the time out to 3.125ms (5 BT slots) */ + OS_REG_RMW_FIELD(ah, AR_BTCOEX_WL_LNA, AR_BTCOEX_WL_LNA_TIMEOUT, 0x3D090); + if (ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_CONCUR_TX) { u_int8_t i; u_int32_t const *pmax_tx_pwr; @@ -1342,8 +1415,8 @@ ar9300_mci_state(struct ath_hal *ah, u_i if (AH_PRIVATE(ah)->ah_caps.halMciSupport && ahp->ah_mci_ready) { value = OS_REG_READ(ah, AR_BTCOEX_CTRL); if ((value == 0xdeadbeef) || (value == 0xffffffff)) { - // HALDEBUG(ah, HAL_DEBUG_BT_COEX, - // "(MCI) BTCOEX_CTRL = 0xdeadbeef\n"); + HALDEBUG(ah, HAL_DEBUG_BT_COEX, + "(MCI) BTCOEX_CTRL = 0xdeadbeef\n"); value = 0; } } @@ -1745,6 +1818,8 @@ void ar9300_mci_bt_coex_set_weights(stru // struct ath_hal_private *ahpriv = AH_PRIVATE(ah); u_int32_t tx_priority = 0; + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: stomp_type=%d\n", __func__, stomp_type); + switch (stomp_type) { case HAL_BT_COEX_STOMP_ALL: ahp->ah_bt_coex_wlan_weight[0] = JUPITER_STOMP_ALL_WLAN_WGHT0; @@ -1828,16 +1903,16 @@ void ar9300_mci_bt_coex_set_weights(stru ahp->ah_bt_coex_wlan_weight[3] |= SM(tx_priority, MCI_CONCUR_TX_WLAN_WGHT3_MASK2); } - if (ah->ah_config.ath_hal_mci_config & - ATH_MCI_CONFIG_MCI_WEIGHT_DBG) - { +// if (ah->ah_config.ath_hal_mci_config & +// ATH_MCI_CONFIG_MCI_WEIGHT_DBG) +// { HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Set weights: 0x%08x 0x%08x 0x%08x 0x%08x\n", ahp->ah_bt_coex_wlan_weight[0], ahp->ah_bt_coex_wlan_weight[1], ahp->ah_bt_coex_wlan_weight[2], ahp->ah_bt_coex_wlan_weight[3]); - } +// } } void ar9300_mci_bt_coex_disable(struct ath_hal *ah) @@ -1865,6 +1940,16 @@ int ar9300_mci_bt_coex_enable(struct ath { struct ath_hal_9300 *ahp = AH9300(ah); + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) %s: called\n", __func__); + + HALDEBUG(ah, HAL_DEBUG_BT_COEX, + "(MCI) Write weights: 0x%08x 0x%08x 0x%08x 0x%08x\n", + ahp->ah_bt_coex_wlan_weight[0], + ahp->ah_bt_coex_wlan_weight[1], + ahp->ah_bt_coex_wlan_weight[2], + ahp->ah_bt_coex_wlan_weight[3]); + + /* Mainly change the WLAN weight table */ OS_REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, ahp->ah_bt_coex_wlan_weight[0]); OS_REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS1, ahp->ah_bt_coex_wlan_weight[1]); From owner-svn-src-head@freebsd.org Wed Jun 1 03:36:32 2016 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 B753DB5809E; Wed, 1 Jun 2016 03:36:32 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 79AC119DB; Wed, 1 Jun 2016 03:36:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513aVs8040956; Wed, 1 Jun 2016 03:36:31 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513aV7s040954; Wed, 1 Jun 2016 03:36:31 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606010336.u513aV7s040954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 1 Jun 2016 03:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301096 - in head/cddl/contrib/opensolaris/cmd: zfs zpool 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.22 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, 01 Jun 2016 03:36:32 -0000 Author: allanjude Date: Wed Jun 1 03:36:31 2016 New Revision: 301096 URL: https://svnweb.freebsd.org/changeset/base/301096 Log: Update zfs(8) and zpool-features(7) man pages with new hashing algorithms Sponsored by: ScaleEngine Inc. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Jun 1 03:27:33 2016 (r301095) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Jun 1 03:36:31 2016 (r301096) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2015 +.Dd May 31, 2016 .Dt ZFS 8 .Os .Sh NAME @@ -940,7 +940,7 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity | sha512 | skein Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, @@ -957,6 +957,16 @@ not be used by any other dataset. Disabling checksums is .Em NOT a recommended practice. +The +.Sy sha512 , +and +.Sy skein +checksum algorithms require enabling the appropriate features on the pool. +Please see +.Xr zpool-features 7 +for more information on these algorithms. +.Pp +Changing this property affects only newly-written data. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle | Cm lz4 Controls the compression algorithm used for this dataset. Setting compression to @@ -1036,7 +1046,7 @@ Changing this property only affects newl property at file system creation time by using the .Fl o Cm copies= Ns Ar N option. -.It Sy dedup Ns = Ns Cm on | off | verify | sha256 Ns Op Cm ,verify +.It Sy dedup Ns = Ns Cm on | off | verify | sha256 Ns Oo Cm ,verify Oc | Sy sha512 Ns Oo Cm ,verify Oc | Sy skein Ns Oo Cm ,verify Oc Configures deduplication for a dataset. The default value is .Cm off . The default deduplication checksum is Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Jun 1 03:27:33 2016 (r301095) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Jun 1 03:36:31 2016 (r301096) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2014 +.Dd May 31, 2016 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -454,6 +454,97 @@ Please note that booting from datasets t supported by the .Fx boot loader. +.It Sy sha512 +.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:sha512" +.It GUID Ta org.illumos:sha512 +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +The +.Sy sha512 +feature enables the use of the SHA-512/256 truncated hash algorithm +.Pq FIPS 180-4 +for checksum and dedup. +The native 64-bit arithmetic of SHA-512 provides an approximate 50% +performance boost over SHA-256 on 64-bit hardware and is thus a good +minimum-change replacement candidate for systems where hash performance is +important, but these systems cannot for whatever reason utilize the faster +.Sy skein +algorithms. +.Pp +When the +.Sy sha512 +feature is set to +.Sy enabled , +the administrator can turn on the +.Sysha512 +checksum on any dataset using the +.Dl # zfs set checksum=sha512 Ar dataset +command. +This feature becomes +.Sy active +once a +.Sy checksum +property has been set to +.Sy sha512 , +and will return to being +.Sy enabled +once all filesystems that have ever had their checksum set to +.Sy sha512 +are destroyed. +.Pp +Booting off of a pools utilizing SHA-512/256 is +.Em NOT +yet supported. +.It Sy skein +.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:skein" +.It GUID Ta org.illumos:skein +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +The +.Sy skein +feature enables the use of the Skein hash algorithm for checksum and dedup. +Skein is a high-performance secure hash algorithm that was a finalist in the +NIST SHA-3 competition. +It provides a very high security margin and high performance on 64-bit hardware +.Pq 80% faster than SHA-256 . +This implementation also utilizes the new salted checksumming functionality in +ZFS, which means that the checksum is pre-seeded with a secret 256-bit random +key +.Pq stored on the pool +before being fed the data block to be checksummed. +Thus the produced checksums are unique to a given pool, preventing hash +collision attacks on systems with dedup. +.Pp +When the +.Sy skein +feature is set to +.Sy enabled , +the administrator can turn on the +.Sy skein +checksum on any dataset using the +.Dl # zfs set checksum=skein Ar dataset +command. +This feature becomes +.Sy active +once a +.Sy checksum +property has been set to +.Sy skein , +and will return to being +.Sy enabled +once all filesystems that have ever had their checksum set to +.Sy skein +are destroyed. +.Pp +Booting off of pools using +.Sy skein +is +.Em NOT +supported. .El .Sh SEE ALSO .Xr zpool 8 From owner-svn-src-head@freebsd.org Wed Jun 1 03:49:23 2016 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 4B18AB582B5; Wed, 1 Jun 2016 03:49:23 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 1F359101E; Wed, 1 Jun 2016 03:49:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513nM4F045022; Wed, 1 Jun 2016 03:49:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513nM1I045021; Wed, 1 Jun 2016 03:49:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010349.u513nM1I045021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301097 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 03:49:23 -0000 Author: adrian Date: Wed Jun 1 03:49:22 2016 New Revision: 301097 URL: https://svnweb.freebsd.org/changeset/base/301097 Log: [ath_hal] implement shared PA handling checks, based on ath9k. These are apparently conditional on there being a shared PA/LNA, which at least on AR9462/QCA9535 devices I have isn't a thing. I'm .. not yet sure which devices it /is/ a thing, so I'll come back to that. Tested: * QCA9565 STA + bluetooth Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Wed Jun 1 03:36:31 2016 (r301096) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Wed Jun 1 03:49:22 2016 (r301097) @@ -472,9 +472,11 @@ void ar9300_mci_mute_bt(struct ath_hal * * 1. reset not after resuming from full sleep * 2. before reset MCI RX, to quiet BT and avoid MCI RX misalignment */ - HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send LNA take\n"); - ar9300_mci_send_lna_take(ah, AH_TRUE); - OS_DELAY(5); + if (MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config)) { + HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send LNA take\n"); + ar9300_mci_send_lna_take(ah, AH_TRUE); + OS_DELAY(5); + } HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send sys sleeping\n"); ar9300_mci_send_sys_sleeping(ah, AH_TRUE); } @@ -498,7 +500,7 @@ static void ar9300_mci_observation_set_u HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called; config=0x%08x\n", __func__, ah->ah_config.ath_hal_mci_config); - if (ah->ah_config.ath_hal_mci_config & + if (ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_MCI_OBS_MCI) { HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_MCI\n", __func__); @@ -846,7 +848,9 @@ static void ar9300_mci_prep_interface(st AR_MCI_INTERRUPT_RX_MSG_CONT_RST); OS_REG_WRITE(ah, AR_MCI_INTERRUPT_RAW, AR_MCI_INTERRUPT_BT_PRI); - if (AR_SREV_JUPITER_10(ah) || ahp->ah_mci_coex_is_2g) { + if (AR_SREV_JUPITER_10(ah) || + (ahp->ah_mci_coex_is_2g && + MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config))) { /* Send LNA_TRANS */ HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) %s: Send LNA_TRANS to BT\n", __func__); @@ -856,8 +860,8 @@ static void ar9300_mci_prep_interface(st } if (AR_SREV_JUPITER_10(ah) || - (ahp->ah_mci_coex_is_2g && !ahp->ah_mci_coex_2g5g_update)) - { + (ahp->ah_mci_coex_is_2g && !ahp->ah_mci_coex_2g5g_update && + MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config))) { if (ar9300_mci_wait_for_interrupt(ah, AR_MCI_INTERRUPT_RX_MSG_RAW, AR_MCI_INTERRUPT_RX_MSG_LNA_INFO, mci_timeout)) { HALDEBUG(ah, HAL_DEBUG_BT_COEX, @@ -1153,7 +1157,11 @@ void ar9300_mci_reset(struct ath_hal *ah OS_REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, (SM(0xe801, AR_MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR) | SM(0x0000, AR_MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM))); - OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE); + if (MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config)) { + OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE); + } else { + OS_REG_SET_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE); + } if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { ar9300_mci_observation_set_up(ah); From owner-svn-src-head@freebsd.org Wed Jun 1 04:18:56 2016 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 66FAFB5891A; Wed, 1 Jun 2016 04:18:56 +0000 (UTC) (envelope-from gjb@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 mx1.freebsd.org (Postfix) with ESMTPS id 394C21078; Wed, 1 Jun 2016 04:18:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u514ItG6055990; Wed, 1 Jun 2016 04:18:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u514Itdd055989; Wed, 1 Jun 2016 04:18:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606010418.u514Itdd055989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jun 2016 04:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301101 - head/release/tools 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.22 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, 01 Jun 2016 04:18:56 -0000 Author: gjb Date: Wed Jun 1 04:18:55 2016 New Revision: 301101 URL: https://svnweb.freebsd.org/changeset/base/301101 Log: Turn off nfsv4acls for arm/armv6 builds, which has an impact on performance, especially with SD cards on certain SoCs. Requested by: trasz Discussed with: ian, kientzle MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Wed Jun 1 04:07:33 2016 (r301100) +++ head/release/tools/arm.subr Wed Jun 1 04:18:55 2016 (r301101) @@ -72,7 +72,6 @@ arm_create_disk() { chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a - chroot ${CHROOTDIR} tunefs -N enable /dev/${mddev}s2a return 0 } From owner-svn-src-head@freebsd.org Wed Jun 1 04:37:44 2016 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 B1B6FB58DEF; Wed, 1 Jun 2016 04:37:44 +0000 (UTC) (envelope-from cy@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 mx1.freebsd.org (Postfix) with ESMTPS id 83E871BE6; Wed, 1 Jun 2016 04:37:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u514bh8k063350; Wed, 1 Jun 2016 04:37:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u514bhg3063349; Wed, 1 Jun 2016 04:37:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606010437.u514bhg3063349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 Jun 2016 04:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301102 - head/etc/periodic/daily 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.22 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, 01 Jun 2016 04:37:44 -0000 Author: cy Date: Wed Jun 1 04:37:43 2016 New Revision: 301102 URL: https://svnweb.freebsd.org/changeset/base/301102 Log: Don't rely on $ntpd_enable to periodically fetch the latest leapfile. Suggested by: cperciva MFC after: 1 week Modified: head/etc/periodic/daily/480.leapfile-ntpd Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Wed Jun 1 04:18:55 2016 (r301101) +++ head/etc/periodic/daily/480.leapfile-ntpd Wed Jun 1 04:37:43 2016 (r301102) @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd fetch) & + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & ;; *) - service ntpd fetch + service ntpd onefetch ;; esac ;; From owner-svn-src-head@freebsd.org Wed Jun 1 04:38:10 2016 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 665A0B58E40; Wed, 1 Jun 2016 04:38:10 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8421D45; Wed, 1 Jun 2016 04:38:09 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 7xurbBSDKEWlr7xusbmAKL; Tue, 31 May 2016 22:38:03 -0600 X-Authority-Analysis: v=2.2 cv=P7p4vWIu c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=yrkiwgmsf1kA:10 a=B8ibFTVmAAAA:8 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=5uTLzFdV9kutCDn2kaoA:9 a=xvSgdcfEVHFitugM1GHH:22 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E4FE213782; Tue, 31 May 2016 21:38:00 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u514c0r7091181; Tue, 31 May 2016 21:38:00 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606010438.u514c0r7091181@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Colin Percival cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294773 - in head/etc: . defaults periodic/daily rc.d In-Reply-To: Message from Colin Percival of "Wed, 01 Jun 2016 02:19:28 -0000." <0100015509c22d19-fb9e2052-3ab3-4f80-b697-273cebbedcb5-000000@email.amazonses.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 31 May 2016 21:38:00 -0700 X-CMAE-Envelope: MS4wfL8G/xdr4PNnT3s1V3/UyvKDidwUu4Mem2iQ8sYqxOFwAmrnmI6MepvMMSTANl366KQjwpN5RCBwBq/zxYf4+JGyIMfBeT5bJuoGw9ZRW5B/kQRYahnJ gCCY5jE1evUc+VWVGc5bo6XWVuQOsC+nVhM5bEV68KuYyh5b/7PEI/XyFSFaRj/hAl/ZOS8mWhH0Ed+6+cazr9siqHwzsl4hwr4seJXA8GMTuSXRVzE0HFMs 7A2R7cIAWoCOoTQ0o8rHn7dOfPMe6AWiddEt20Wh74FXTYHJR0PPFRbjbhgsDOPA3e/y2iujG8VEde2+zmC3/Q== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 04:38:10 -0000 In message <0100015509c22d19-fb9e2052-3ab3-4f80-b697-273cebbedcb5-000000@ema il. amazonses.com>, Colin Percival writes: > On 01/25/16 23:06, Cy Schubert wrote: > > Author: cy > > Date: Tue Jan 26 07:06:44 2016 > > New Revision: 294773 > > URL: https://svnweb.freebsd.org/changeset/base/294773 > > > > Log: > > Add support for automatic leap-second file updates. > > [...] > > Added: head/etc/periodic/daily/480.leapfile-ntpd > > =========================================================================== > === > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Jan 26 07:06:44 201 > 6 (r294773) > > [...] > > + case "$daily_ntpd_avoid_congestion" in > > + [Yy][Ee][Ss]) > > + # Avoid dogpiling > > + (sleep $(jot -r 1 0 86400); service ntpd fetch) & > > + ;; > > + *) > > + service ntpd fetch > > + ;; > > Can we change this to 'service ntpd onefetch'? If someone turns on this > periodic script, I think it's safe to assume that they want it to run, > even if they don't have ntpd running. (In my case, I have some systems > where `ntpd -q` runs from cron but I don't want to leave the daemon running > continuously.) Sounds good. Committed. Thanks for the suggestion. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 1 05:15:12 2016 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 A8F5EB58835; Wed, 1 Jun 2016 05:15:12 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 7661B1F9D; Wed, 1 Jun 2016 05:15:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u515FBcE077790; Wed, 1 Jun 2016 05:15:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u515FBMK077789; Wed, 1 Jun 2016 05:15:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606010515.u515FBMK077789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 1 Jun 2016 05:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301103 - head/sys/dev/bge 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.22 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, 01 Jun 2016 05:15:12 -0000 Author: sephe Date: Wed Jun 1 05:15:11 2016 New Revision: 301103 URL: https://svnweb.freebsd.org/changeset/base/301103 Log: bge: Force chipid to 5720 A0 for 5717 C0 in an early place Discussed with: yongari MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Jun 1 04:37:43 2016 (r301102) +++ head/sys/dev/bge/if_bge.c Wed Jun 1 05:15:11 2016 (r301103) @@ -2700,8 +2700,11 @@ bge_chipid(device_t dev) * registers. */ switch (pci_get_device(dev)) { - case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5717C: + /* 5717 C0 seems to belong to 5720 line. */ + id = BGE_CHIPID_BCM5720_A0; + break; + case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: @@ -2730,8 +2733,6 @@ bge_chipid(device_t dev) default: id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); } - if (id == BGE_CHIPID_BCM5717_C0) - id = BGE_CHIPID_BCM5720_A0; } return (id); } From owner-svn-src-head@freebsd.org Wed Jun 1 06:51:20 2016 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 EF1A1B5E740; Wed, 1 Jun 2016 06:51:20 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id C7A691AC9; Wed, 1 Jun 2016 06:51:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u516pKPA011745; Wed, 1 Jun 2016 06:51:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u516pJ4B011742; Wed, 1 Jun 2016 06:51:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606010651.u516pJ4B011742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 1 Jun 2016 06:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301105 - head/sys/dev/sfxge 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.22 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, 01 Jun 2016 06:51:21 -0000 Author: arybchik Date: Wed Jun 1 06:51:19 2016 New Revision: 301105 URL: https://svnweb.freebsd.org/changeset/base/301105 Log: sfxge(4): cope with code duplication on SW events composition Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D6666 Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Wed Jun 1 06:18:34 2016 (r301104) +++ head/sys/dev/sfxge/sfxge.h Wed Jun 1 06:51:19 2016 (r301105) @@ -130,6 +130,26 @@ enum sfxge_sw_ev { #define SFXGE_SW_EV_MAGIC(_sw_ev) \ (SFXGE_MAGIC_RESERVED | ((_sw_ev) << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +static inline uint16_t +sfxge_sw_ev_mk_magic(enum sfxge_sw_ev sw_ev, unsigned int label) +{ + KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, + ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); + return SFXGE_SW_EV_MAGIC(sw_ev) | label; +} + +static inline uint16_t +sfxge_sw_ev_rxq_magic(enum sfxge_sw_ev sw_ev, struct sfxge_rxq *rxq) +{ + return sfxge_sw_ev_mk_magic(sw_ev, 0); +} + +static inline uint16_t +sfxge_sw_ev_txq_magic(enum sfxge_sw_ev sw_ev, struct sfxge_txq *txq) +{ + return sfxge_sw_ev_mk_magic(sw_ev, txq->type); +} + enum sfxge_evq_state { SFXGE_EVQ_UNINITIALIZED = 0, SFXGE_EVQ_INITIALIZED, Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Wed Jun 1 06:18:34 2016 (r301104) +++ head/sys/dev/sfxge/sfxge_ev.c Wed Jun 1 06:51:19 2016 (r301105) @@ -207,7 +207,6 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 struct sfxge_softc *sc; struct sfxge_rxq *rxq; unsigned int index; - unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; @@ -226,11 +225,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 } evq = sc->evq[index]; - - label = 0; - KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, - ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); - magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE) | label; + magic = sfxge_sw_ev_rxq_magic(SFXGE_SW_EV_RX_QFLUSH_DONE, rxq); KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq not started")); @@ -246,7 +241,6 @@ sfxge_ev_rxq_flush_failed(void *arg, uin struct sfxge_softc *sc; struct sfxge_rxq *rxq; unsigned int index; - unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; @@ -260,11 +254,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin /* Resend a software event on the correct queue */ index = rxq->index; evq = sc->evq[index]; - - label = 0; - KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, - ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); - magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED) | label; + magic = sfxge_sw_ev_rxq_magic(SFXGE_SW_EV_RX_QFLUSH_FAILED, rxq); KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq not started")); @@ -331,7 +321,6 @@ sfxge_ev_txq_flush_done(void *arg, uint3 struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_txq *txq; - unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; @@ -351,11 +340,7 @@ sfxge_ev_txq_flush_done(void *arg, uint3 /* Resend a software event on the correct queue */ evq = sc->evq[txq->evq_index]; - - label = txq->type; - KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, - ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); - magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE) | label; + magic = sfxge_sw_ev_txq_magic(SFXGE_SW_EV_TX_QFLUSH_DONE, txq); KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq not started")); Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Wed Jun 1 06:18:34 2016 (r301104) +++ head/sys/dev/sfxge/sfxge_rx.c Wed Jun 1 06:51:19 2016 (r301105) @@ -175,17 +175,12 @@ sfxge_rx_post_refill(void *arg) struct sfxge_softc *sc; unsigned int index; struct sfxge_evq *evq; - unsigned int label; uint16_t magic; sc = rxq->sc; index = rxq->index; evq = sc->evq[index]; - - label = 0; - KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, - ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); - magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QREFILL) | label; + magic = sfxge_sw_ev_rxq_magic(SFXGE_SW_EV_RX_QREFILL, rxq); /* This is guaranteed due to the start/stop order of rx and ev */ KASSERT(evq->init_state == SFXGE_EVQ_STARTED, From owner-svn-src-head@freebsd.org Wed Jun 1 06:51:46 2016 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 1186AB5E8BE; Wed, 1 Jun 2016 06:51:46 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id C3A971C54; Wed, 1 Jun 2016 06:51:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u516piGB012450; Wed, 1 Jun 2016 06:51:44 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u516piB4012444; Wed, 1 Jun 2016 06:51:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606010651.u516piB4012444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 1 Jun 2016 06:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301106 - head/sys/dev/hyperv/vmbus 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.22 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, 01 Jun 2016 06:51:46 -0000 Author: sephe Date: Wed Jun 1 06:51:44 2016 New Revision: 301106 URL: https://svnweb.freebsd.org/changeset/base/301106 Log: hyperv/vmbus: Redefine event flags. - Nuke unnecessary union. - Avoid convoluted macro indirection. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6671 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_reg.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 1 06:51:19 2016 (r301105) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 1 06:51:44 2016 (r301106) @@ -33,6 +33,7 @@ #include #include +#include #include /* @@ -713,8 +714,8 @@ hv_vmbus_release_unattached_channels(voi } hv_vmbus_free_vmbus_channel(channel); } - bzero(hv_vmbus_g_connection.channels, - sizeof(hv_vmbus_channel*) * HV_CHANNEL_MAX_COUNT); + bzero(hv_vmbus_g_connection.channels, + sizeof(hv_vmbus_channel*) * VMBUS_CHAN_MAX); mtx_unlock(&hv_vmbus_g_connection.channel_lock); } Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 1 06:51:19 2016 (r301105) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 1 06:51:44 2016 (r301106) @@ -39,6 +39,7 @@ #include #include +#include #include /* @@ -209,8 +210,7 @@ hv_vmbus_connect(void) M_DEVBUF, M_WAITOK | M_ZERO); hv_vmbus_g_connection.channels = malloc(sizeof(hv_vmbus_channel*) * - HV_CHANNEL_MAX_COUNT, - M_DEVBUF, M_WAITOK | M_ZERO); + VMBUS_CHAN_MAX, M_DEVBUF, M_WAITOK | M_ZERO); /* * Find the highest vmbus version number we can support. */ @@ -292,20 +292,20 @@ hv_vmbus_disconnect(void) } static __inline void -vmbus_event_flags_proc(unsigned long *event_flags, int flag_cnt) +vmbus_event_flags_proc(volatile u_long *event_flags, int flag_cnt) { int f; for (f = 0; f < flag_cnt; ++f) { uint32_t rel_id_base; - unsigned long flags; + u_long flags; int bit; if (event_flags[f] == 0) continue; flags = atomic_swap_long(&event_flags[f], 0); - rel_id_base = f << HV_CHANNEL_ULONG_SHIFT; + rel_id_base = f << VMBUS_EVTFLAG_SHIFT; while ((bit = ffsl(flags)) != 0) { struct hv_vmbus_channel *channel; @@ -331,27 +331,27 @@ vmbus_event_flags_proc(unsigned long *ev void vmbus_event_proc(struct vmbus_softc *sc, int cpu) { - hv_vmbus_synic_event_flags *event; + struct vmbus_evtflags *eventf; /* * On Host with Win8 or above, the event page can be checked directly * to get the id of the channel that has the pending interrupt. */ - event = VMBUS_PCPU_GET(sc, event_flag, cpu) + VMBUS_SINT_MESSAGE; - vmbus_event_flags_proc(event->flagsul, - VMBUS_PCPU_GET(sc, event_flag_cnt, cpu)); + eventf = VMBUS_PCPU_GET(sc, event_flags, cpu) + VMBUS_SINT_MESSAGE; + vmbus_event_flags_proc(eventf->evt_flags, + VMBUS_PCPU_GET(sc, event_flags_cnt, cpu)); } void vmbus_event_proc_compat(struct vmbus_softc *sc __unused, int cpu) { - hv_vmbus_synic_event_flags *event; + struct vmbus_evtflags *eventf; - event = VMBUS_PCPU_GET(sc, event_flag, cpu) + VMBUS_SINT_MESSAGE; - if (atomic_testandclear_int(&event->flags32[0], 0)) { + eventf = VMBUS_PCPU_GET(sc, event_flags, cpu) + VMBUS_SINT_MESSAGE; + if (atomic_testandclear_long(&eventf->evt_flags[0], 0)) { vmbus_event_flags_proc( hv_vmbus_g_connection.recv_interrupt_page, - HV_MAX_NUM_CHANNELS_SUPPORTED >> HV_CHANNEL_ULONG_SHIFT); + VMBUS_CHAN_MAX_COMPAT >> VMBUS_EVTFLAG_SHIFT); } } @@ -414,8 +414,8 @@ vmbus_on_channel_open(const struct hv_vm volatile int *flag_cnt_ptr; int flag_cnt; - flag_cnt = (chan->offer_msg.child_rel_id / HV_CHANNEL_ULONG_LEN) + 1; - flag_cnt_ptr = VMBUS_PCPU_PTR(vmbus_get_softc(), event_flag_cnt, + flag_cnt = (chan->offer_msg.child_rel_id / VMBUS_EVTFLAG_LEN) + 1; + flag_cnt_ptr = VMBUS_PCPU_PTR(vmbus_get_softc(), event_flags_cnt, chan->target_cpu); for (;;) { Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jun 1 06:51:19 2016 (r301105) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jun 1 06:51:44 2016 (r301106) @@ -248,8 +248,8 @@ vmbus_synic_setup(void *xsc) */ orig = rdmsr(MSR_HV_SIEFP); val = MSR_HV_SIEFP_ENABLE | (orig & MSR_HV_SIEFP_RSVD_MASK) | - ((VMBUS_PCPU_GET(sc, event_flag_dma.hv_paddr, cpu) >> PAGE_SHIFT) << - MSR_HV_SIEFP_PGSHIFT); + ((VMBUS_PCPU_GET(sc, event_flags_dma.hv_paddr, cpu) + >> PAGE_SHIFT) << MSR_HV_SIEFP_PGSHIFT); wrmsr(MSR_HV_SIEFP, val); @@ -339,11 +339,11 @@ vmbus_dma_alloc(struct vmbus_softc *sc) ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, - VMBUS_PCPU_PTR(sc, event_flag_dma, cpu), + VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); if (ptr == NULL) return ENOMEM; - VMBUS_PCPU_GET(sc, event_flag, cpu) = ptr; + VMBUS_PCPU_GET(sc, event_flags, cpu) = ptr; } return 0; } @@ -360,11 +360,11 @@ vmbus_dma_free(struct vmbus_softc *sc) VMBUS_PCPU_GET(sc, message, cpu)); VMBUS_PCPU_GET(sc, message, cpu) = NULL; } - if (VMBUS_PCPU_GET(sc, event_flag, cpu) != NULL) { + if (VMBUS_PCPU_GET(sc, event_flags, cpu) != NULL) { hyperv_dmamem_free( - VMBUS_PCPU_PTR(sc, event_flag_dma, cpu), - VMBUS_PCPU_GET(sc, event_flag, cpu)); - VMBUS_PCPU_GET(sc, event_flag, cpu) = NULL; + VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), + VMBUS_PCPU_GET(sc, event_flags, cpu)); + VMBUS_PCPU_GET(sc, event_flags, cpu) = NULL; } } } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 1 06:51:19 2016 (r301105) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 1 06:51:44 2016 (r301106) @@ -51,28 +51,6 @@ typedef uint16_t hv_vmbus_status; #define HV_ANY_VP (0xFFFFFFFF) /* - * Synthetic interrupt controller flag constants. - */ - -#define HV_EVENT_FLAGS_COUNT (256 * 8) -#define HV_EVENT_FLAGS_BYTE_COUNT (256) -#define HV_EVENT_FLAGS_DWORD_COUNT (256 / sizeof(uint32_t)) -#define HV_EVENT_FLAGS_ULONG_COUNT (256 / sizeof(unsigned long)) - -/** - * max channel count <== event_flags_dword_count * bit_of_dword - */ -#ifdef __LP64__ -#define HV_CHANNEL_ULONG_LEN (64) -#define HV_CHANNEL_ULONG_SHIFT (6) -#else -#define HV_CHANNEL_ULONG_LEN (32) -#define HV_CHANNEL_ULONG_SHIFT (5) -#endif -#define HV_CHANNEL_DWORD_LEN (32) -#define HV_CHANNEL_MAX_COUNT \ - ((HV_EVENT_FLAGS_DWORD_COUNT) * HV_CHANNEL_DWORD_LEN) -/* * MessageId: HV_STATUS_INSUFFICIENT_BUFFERS * MessageText: * You did not supply enough message buffers to send a message. @@ -195,9 +173,6 @@ enum { #define HV_HYPERCALL_PARAM_ALIGN sizeof(uint64_t) -struct vmbus_message; -union vmbus_event_flags; - /* * Define hypervisor message types */ @@ -254,21 +229,6 @@ typedef union _hv_vmbus_port_id { typedef uint64_t hv_vmbus_partition_id; /* - * Maximum channels is determined by the size of the interrupt - * page which is PAGE_SIZE. 1/2 of PAGE_SIZE is for - * send endpoint interrupt and the other is receive - * endpoint interrupt. - * - * Note: (PAGE_SIZE >> 1) << 3 allocates 16348 channels - */ -#define HV_MAX_NUM_CHANNELS (PAGE_SIZE >> 1) << 3 - -/* - * (The value here must be in multiple of 32) - */ -#define HV_MAX_NUM_CHANNELS_SUPPORTED 256 - -/* * VM Bus connection states */ typedef enum { @@ -391,16 +351,6 @@ typedef struct { } hv_vmbus_input_post_message; /* - * Define the synthetic interrupt controller event flags format - */ -typedef union vmbus_event_flags { - uint8_t flags8[HV_EVENT_FLAGS_BYTE_COUNT]; - uint32_t flags32[HV_EVENT_FLAGS_DWORD_COUNT]; - unsigned long flagsul[HV_EVENT_FLAGS_ULONG_COUNT]; -} hv_vmbus_synic_event_flags; -CTASSERT(sizeof(hv_vmbus_synic_event_flags) == HV_EVENT_FLAGS_BYTE_COUNT); - -/* * Declare the various hypercall operations */ typedef enum { Modified: head/sys/dev/hyperv/vmbus/vmbus_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_reg.h Wed Jun 1 06:51:19 2016 (r301105) +++ head/sys/dev/hyperv/vmbus/vmbus_reg.h Wed Jun 1 06:51:44 2016 (r301106) @@ -53,4 +53,30 @@ CTASSERT(sizeof(struct vmbus_message) == #define VMBUS_MSGFLAG_PENDING 0x01 +/* + * Hyper-V SynIC event flags + */ + +#ifdef __LP64__ +#define VMBUS_EVTFLAGS_MAX 32 +#define VMBUS_EVTFLAG_SHIFT 6 +#else +#define VMBUS_EVTFLAGS_MAX 64 +#define VMBUS_EVTFLAG_SHIFT 5 +#endif +#define VMBUS_EVTFLAG_LEN (1 << VMBUS_EVTFLAG_SHIFT) +#define VMBUS_EVTFLAGS_SIZE 256 + +struct vmbus_evtflags { + u_long evt_flags[VMBUS_EVTFLAGS_MAX]; +} __packed; +CTASSERT(sizeof(struct vmbus_evtflags) == VMBUS_EVTFLAGS_SIZE); + +/* + * Channel + */ + +#define VMBUS_CHAN_MAX_COMPAT 256 +#define VMBUS_CHAN_MAX (VMBUS_EVTFLAG_LEN * VMBUS_EVTFLAGS_MAX) + #endif /* !_VMBUS_REG_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Jun 1 06:51:19 2016 (r301105) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Jun 1 06:51:44 2016 (r301106) @@ -50,12 +50,12 @@ struct vmbus_pcpu_data { u_long *intr_cnt; /* Hyper-V interrupt counter */ struct vmbus_message *message; /* shared messages */ uint32_t vcpuid; /* virtual cpuid */ - int event_flag_cnt; /* # of event flags */ - union vmbus_event_flags *event_flag; /* shared event flags */ + int event_flags_cnt;/* # of event flags */ + struct vmbus_evtflags *event_flags; /* shared event flags */ /* Rarely used fields */ struct hyperv_dma message_dma; /* busdma glue */ - struct hyperv_dma event_flag_dma; /* busdma glue */ + struct hyperv_dma event_flags_dma;/* busdma glue */ struct taskqueue *event_tq; /* event taskq */ struct taskqueue *message_tq; /* message taskq */ struct task message_task; /* message task */ From owner-svn-src-head@freebsd.org Wed Jun 1 06:18:36 2016 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 12961B5D40C; Wed, 1 Jun 2016 06:18:36 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id D80C51DFC; Wed, 1 Jun 2016 06:18:35 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u516IZwt000696; Wed, 1 Jun 2016 06:18:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u516IZ8v000695; Wed, 1 Jun 2016 06:18:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606010618.u516IZ8v000695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 1 Jun 2016 06:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301104 - head/cddl/contrib/opensolaris/cmd/zpool 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.22 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, 01 Jun 2016 06:18:36 -0000 Author: allanjude Date: Wed Jun 1 06:18:34 2016 New Revision: 301104 URL: https://svnweb.freebsd.org/changeset/base/301104 Log: Fix missing space in mandoc syntax Reported by: rpokala Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Jun 1 05:15:11 2016 (r301103) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Jun 1 06:18:34 2016 (r301104) @@ -478,7 +478,7 @@ When the feature is set to .Sy enabled , the administrator can turn on the -.Sysha512 +.Sy sha512 checksum on any dataset using the .Dl # zfs set checksum=sha512 Ar dataset command. From owner-svn-src-head@freebsd.org Wed Jun 1 07:11:56 2016 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 03060B5F49A; Wed, 1 Jun 2016 07:11:56 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id C793E19DC; Wed, 1 Jun 2016 07:11:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u517Bs2L022036; Wed, 1 Jun 2016 07:11:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u517Bsjo022035; Wed, 1 Jun 2016 07:11:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606010711.u517Bsjo022035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 1 Jun 2016 07:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301109 - head/sys/dev/hyperv/vmbus 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.22 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, 01 Jun 2016 07:11:56 -0000 Author: sephe Date: Wed Jun 1 07:11:54 2016 New Revision: 301109 URL: https://svnweb.freebsd.org/changeset/base/301109 Log: hyperv/channel: Only cpu0 is supported as channel target cpu on WIN7 MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 1 07:03:11 2016 (r301108) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 1 07:11:54 2016 (r301109) @@ -302,6 +302,12 @@ vmbus_channel_cpu_set(struct hv_vmbus_ch { KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu %d", cpu)); + if (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008 || + hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) { + /* Only cpu0 is supported */ + cpu = 0; + } + chan->target_cpu = cpu; chan->target_vcpu = VMBUS_PCPU_GET(vmbus_get_softc(), vcpuid, cpu); @@ -359,9 +365,7 @@ vmbus_channel_select_defcpu(struct hv_vm } } - if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || - (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) || - (!is_perf_channel)) { + if (!is_perf_channel) { /* Stick to cpu0 */ vmbus_channel_cpu_set(channel, 0); return; From owner-svn-src-head@freebsd.org Wed Jun 1 07:45:04 2016 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 F144AB60584; Wed, 1 Jun 2016 07:45:04 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id C32C21999; Wed, 1 Jun 2016 07:45:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u517j3g6033848; Wed, 1 Jun 2016 07:45:03 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u517j3Qb033847; Wed, 1 Jun 2016 07:45:03 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201606010745.u517j3Qb033847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 1 Jun 2016 07:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301110 - head/sys/sys 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.22 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, 01 Jun 2016 07:45:05 -0000 Author: ed Date: Wed Jun 1 07:45:03 2016 New Revision: 301110 URL: https://svnweb.freebsd.org/changeset/base/301110 Log: Define the id_t type as required by POSIX. It seems that all versions of POSIX that I could find require that defines id_t. Define it together with rlim_t. While there, move these typedefs closer to the top of the header file, right after the includes, which we do in most other header files. Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Wed Jun 1 07:11:54 2016 (r301109) +++ head/sys/sys/resource.h Wed Jun 1 07:45:03 2016 (r301110) @@ -37,6 +37,16 @@ #include #include +#ifndef _ID_T_DECLARED +typedef __id_t id_t; +#define _ID_T_DECLARED +#endif + +#ifndef _RLIM_T_DECLARED +typedef __rlim_t rlim_t; +#define _RLIM_T_DECLARED +#endif + /* * Process priority specifications to get/setpriority. */ @@ -136,11 +146,6 @@ static const char *rlimit_ident[RLIM_NLI }; #endif -#ifndef _RLIM_T_DECLARED -typedef __rlim_t rlim_t; -#define _RLIM_T_DECLARED -#endif - struct rlimit { rlim_t rlim_cur; /* current (soft) limit */ rlim_t rlim_max; /* maximum value for rlim_cur */ From owner-svn-src-head@freebsd.org Wed Jun 1 08:20:11 2016 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 64567B55043; Wed, 1 Jun 2016 08:20:11 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 362B81CF8; Wed, 1 Jun 2016 08:20:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u518KA2Y045731; Wed, 1 Jun 2016 08:20:10 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u518KA9V045730; Wed, 1 Jun 2016 08:20:10 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606010820.u518KA9V045730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 1 Jun 2016 08:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301112 - head/sys/arm64/arm64 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.22 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, 01 Jun 2016 08:20:11 -0000 Author: zbb Date: Wed Jun 1 08:20:10 2016 New Revision: 301112 URL: https://svnweb.freebsd.org/changeset/base/301112 Log: Return real error value instead of hard-coded ENXIO (fix after r300149) It is possible to return real error value in case of gic_v3_attach() failure instead of hard-coded ENXIO. Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/arm64/arm64/gic_v3_fdt.c Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Wed Jun 1 08:20:07 2016 (r301111) +++ head/sys/arm64/arm64/gic_v3_fdt.c Wed Jun 1 08:20:10 2016 (r301112) @@ -141,11 +141,13 @@ gic_v3_fdt_attach(device_t dev) xref = OF_xref_from_node(ofw_bus_get_node(dev)); if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); + err = ENXIO; goto error; } if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc, GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + err = ENXIO; goto error; } #endif @@ -172,7 +174,7 @@ error: /* Failure so free resources */ gic_v3_detach(dev); - return (ENXIO); + return (err); } /* OFW bus interface */ From owner-svn-src-head@freebsd.org Wed Jun 1 09:20:53 2016 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 D2314B56C42; Wed, 1 Jun 2016 09:20:53 +0000 (UTC) (envelope-from sephe@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 mx1.freebsd.org (Postfix) with ESMTPS id 9DD251228; Wed, 1 Jun 2016 09:20:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u519KqGo068367; Wed, 1 Jun 2016 09:20:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u519Kqh6068360; Wed, 1 Jun 2016 09:20:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606010920.u519Kqh6068360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 1 Jun 2016 09:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301113 - in head/sys: conf dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 modules/hyperv/vmbus 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.22 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, 01 Jun 2016 09:20:53 -0000 Author: sephe Date: Wed Jun 1 09:20:52 2016 New Revision: 301113 URL: https://svnweb.freebsd.org/changeset/base/301113 Log: hyperv: Rename some cleaned up/almost cleaned up files MFC after: 1 week Sponsored by: Microsoft OSTC Added: head/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S - copied unchanged from r301112, head/sys/dev/hyperv/vmbus/amd64/hv_vector.S head/sys/dev/hyperv/vmbus/hyperv.c - copied unchanged from r301112, head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S - copied unchanged from r301112, head/sys/dev/hyperv/vmbus/i386/hv_vector.S head/sys/dev/hyperv/vmbus/vmbus.c - copied unchanged from r301112, head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/vmbus_et.c - copied unchanged from r301112, head/sys/dev/hyperv/vmbus/hv_et.c Deleted: head/sys/dev/hyperv/vmbus/amd64/hv_vector.S head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/i386/hv_vector.S Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Jun 1 08:20:10 2016 (r301112) +++ head/sys/conf/files.amd64 Wed Jun 1 09:20:52 2016 (r301113) @@ -273,12 +273,12 @@ dev/hyperv/utilities/hv_util.c option dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv dev/hyperv/vmbus/hv_connection.c optional hyperv -dev/hyperv/vmbus/hv_hv.c optional hyperv -dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv -dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv -dev/hyperv/vmbus/amd64/hv_vector.S optional hyperv +dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus_et.c optional hyperv +dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Jun 1 08:20:10 2016 (r301112) +++ head/sys/conf/files.i386 Wed Jun 1 09:20:52 2016 (r301113) @@ -248,12 +248,12 @@ dev/hyperv/utilities/hv_util.c option dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv dev/hyperv/vmbus/hv_connection.c optional hyperv -dev/hyperv/vmbus/hv_hv.c optional hyperv -dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv -dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv -dev/hyperv/vmbus/i386/hv_vector.S optional hyperv +dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus_et.c optional hyperv +dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard Copied: head/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S (from r301112, head/sys/dev/hyperv/vmbus/amd64/hv_vector.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S Wed Jun 1 09:20:52 2016 (r301113, copy of r301112, head/sys/dev/hyperv/vmbus/amd64/hv_vector.S) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include "assym.s" + +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(vmbus_isr) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + movq %rsp, %rdi + call vmbus_handle_intr + MEXITCOUNT + jmp doreti Copied: head/sys/dev/hyperv/vmbus/hyperv.c (from r301112, head/sys/dev/hyperv/vmbus/hv_hv.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/hyperv.c Wed Jun 1 09:20:52 2016 (r301113, copy of r301112, head/sys/dev/hyperv/vmbus/hv_hv.c) @@ -0,0 +1,404 @@ +/*- + * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * Implements low-level interactions with Hypver-V/Azure + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define HYPERV_FREEBSD_BUILD 0ULL +#define HYPERV_FREEBSD_VERSION ((uint64_t)__FreeBSD_version) +#define HYPERV_FREEBSD_OSID 0ULL + +#define MSR_HV_GUESTID_BUILD_FREEBSD \ + (HYPERV_FREEBSD_BUILD & MSR_HV_GUESTID_BUILD_MASK) +#define MSR_HV_GUESTID_VERSION_FREEBSD \ + ((HYPERV_FREEBSD_VERSION << MSR_HV_GUESTID_VERSION_SHIFT) & \ + MSR_HV_GUESTID_VERSION_MASK) +#define MSR_HV_GUESTID_OSID_FREEBSD \ + ((HYPERV_FREEBSD_OSID << MSR_HV_GUESTID_OSID_SHIFT) & \ + MSR_HV_GUESTID_OSID_MASK) + +#define MSR_HV_GUESTID_FREEBSD \ + (MSR_HV_GUESTID_BUILD_FREEBSD | \ + MSR_HV_GUESTID_VERSION_FREEBSD | \ + MSR_HV_GUESTID_OSID_FREEBSD | \ + MSR_HV_GUESTID_OSTYPE_FREEBSD) + +struct hypercall_ctx { + void *hc_addr; + struct hyperv_dma hc_dma; +}; + +static u_int hyperv_get_timecount(struct timecounter *tc); + +u_int hyperv_features; +u_int hyperv_recommends; + +static u_int hyperv_pm_features; +static u_int hyperv_features3; + +static struct timecounter hyperv_timecounter = { + .tc_get_timecount = hyperv_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = HYPERV_TIMER_FREQ, + .tc_name = "Hyper-V", + .tc_quality = 2000, + .tc_flags = 0, + .tc_priv = NULL +}; + +static struct hypercall_ctx hypercall_context; + +static u_int +hyperv_get_timecount(struct timecounter *tc __unused) +{ + return rdmsr(MSR_HV_TIME_REF_COUNT); +} + +/** + * @brief Invoke the specified hypercall + */ +static uint64_t +hv_vmbus_do_hypercall(uint64_t control, void* input, void* output) +{ +#ifdef __x86_64__ + uint64_t hv_status = 0; + uint64_t input_address = (input) ? hv_get_phys_addr(input) : 0; + uint64_t output_address = (output) ? hv_get_phys_addr(output) : 0; + volatile void *hypercall_page = hypercall_context.hc_addr; + + __asm__ __volatile__ ("mov %0, %%r8" : : "r" (output_address): "r8"); + __asm__ __volatile__ ("call *%3" : "=a"(hv_status): + "c" (control), "d" (input_address), + "m" (hypercall_page)); + return (hv_status); +#else + uint32_t control_high = control >> 32; + uint32_t control_low = control & 0xFFFFFFFF; + uint32_t hv_status_high = 1; + uint32_t hv_status_low = 1; + uint64_t input_address = (input) ? hv_get_phys_addr(input) : 0; + uint32_t input_address_high = input_address >> 32; + uint32_t input_address_low = input_address & 0xFFFFFFFF; + uint64_t output_address = (output) ? hv_get_phys_addr(output) : 0; + uint32_t output_address_high = output_address >> 32; + uint32_t output_address_low = output_address & 0xFFFFFFFF; + volatile void *hypercall_page = hypercall_context.hc_addr; + + __asm__ __volatile__ ("call *%8" : "=d"(hv_status_high), + "=a"(hv_status_low) : "d" (control_high), + "a" (control_low), "b" (input_address_high), + "c" (input_address_low), + "D"(output_address_high), + "S"(output_address_low), "m" (hypercall_page)); + return (hv_status_low | ((uint64_t)hv_status_high << 32)); +#endif /* __x86_64__ */ +} + +/** + * @brief Post a message using the hypervisor message IPC. + * (This involves a hypercall.) + */ +hv_vmbus_status +hv_vmbus_post_msg_via_msg_ipc( + hv_vmbus_connection_id connection_id, + hv_vmbus_msg_type message_type, + void* payload, + size_t payload_size) +{ + struct alignedinput { + uint64_t alignment8; + hv_vmbus_input_post_message msg; + }; + + hv_vmbus_input_post_message* aligned_msg; + hv_vmbus_status status; + size_t addr; + + if (payload_size > HV_MESSAGE_PAYLOAD_BYTE_COUNT) + return (EMSGSIZE); + + addr = (size_t) malloc(sizeof(struct alignedinput), M_DEVBUF, + M_ZERO | M_NOWAIT); + KASSERT(addr != 0, + ("Error VMBUS: malloc failed to allocate message buffer!")); + if (addr == 0) + return (ENOMEM); + + aligned_msg = (hv_vmbus_input_post_message*) + (HV_ALIGN_UP(addr, HV_HYPERCALL_PARAM_ALIGN)); + + aligned_msg->connection_id = connection_id; + aligned_msg->message_type = message_type; + aligned_msg->payload_size = payload_size; + memcpy((void*) aligned_msg->payload, payload, payload_size); + + status = hv_vmbus_do_hypercall( + HV_CALL_POST_MESSAGE, aligned_msg, 0) & 0xFFFF; + + free((void *) addr, M_DEVBUF); + return (status); +} + +/** + * @brief Signal an event on the specified connection using the hypervisor + * event IPC. (This involves a hypercall.) + */ +hv_vmbus_status +hv_vmbus_signal_event(void *con_id) +{ + hv_vmbus_status status; + + status = hv_vmbus_do_hypercall( + HV_CALL_SIGNAL_EVENT, + con_id, + 0) & 0xFFFF; + + return (status); +} + +int +hyperv_guid2str(const struct hv_guid *guid, char *buf, size_t sz) +{ + const uint8_t *d = guid->data; + + return snprintf(buf, sz, "%02x%02x%02x%02x-" + "%02x%02x-%02x%02x-%02x%02x-" + "%02x%02x%02x%02x%02x%02x", + d[3], d[2], d[1], d[0], + d[5], d[4], d[7], d[6], d[8], d[9], + d[10], d[11], d[12], d[13], d[14], d[15]); +} + +static bool +hyperv_identify(void) +{ + u_int regs[4]; + unsigned int maxleaf; + + if (vm_guest != VM_GUEST_HV) + return (false); + + do_cpuid(CPUID_LEAF_HV_MAXLEAF, regs); + maxleaf = regs[0]; + if (maxleaf < CPUID_LEAF_HV_LIMITS) + return (false); + + do_cpuid(CPUID_LEAF_HV_INTERFACE, regs); + if (regs[0] != CPUID_HV_IFACE_HYPERV) + return (false); + + do_cpuid(CPUID_LEAF_HV_FEATURES, regs); + if ((regs[0] & CPUID_HV_MSR_HYPERCALL) == 0) { + /* + * Hyper-V w/o Hypercall is impossible; someone + * is faking Hyper-V. + */ + return (false); + } + hyperv_features = regs[0]; + hyperv_pm_features = regs[2]; + hyperv_features3 = regs[3]; + + do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); + printf("Hyper-V Version: %d.%d.%d [SP%d]\n", + regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + + printf(" Features=0x%b\n", hyperv_features, + "\020" + "\001VPRUNTIME" /* MSR_HV_VP_RUNTIME */ + "\002TMREFCNT" /* MSR_HV_TIME_REF_COUNT */ + "\003SYNIC" /* MSRs for SynIC */ + "\004SYNTM" /* MSRs for SynTimer */ + "\005APIC" /* MSR_HV_{EOI,ICR,TPR} */ + "\006HYPERCALL" /* MSR_HV_{GUEST_OS_ID,HYPERCALL} */ + "\007VPINDEX" /* MSR_HV_VP_INDEX */ + "\010RESET" /* MSR_HV_RESET */ + "\011STATS" /* MSR_HV_STATS_ */ + "\012REFTSC" /* MSR_HV_REFERENCE_TSC */ + "\013IDLE" /* MSR_HV_GUEST_IDLE */ + "\014TMFREQ" /* MSR_HV_{TSC,APIC}_FREQUENCY */ + "\015DEBUG"); /* MSR_HV_SYNTH_DEBUG_ */ + printf(" PM Features=0x%b [C%u]\n", + (hyperv_pm_features & ~CPUPM_HV_CSTATE_MASK), + "\020" + "\005C3HPET", /* HPET is required for C3 state */ + CPUPM_HV_CSTATE(hyperv_pm_features)); + printf(" Features3=0x%b\n", hyperv_features3, + "\020" + "\001MWAIT" /* MWAIT */ + "\002DEBUG" /* guest debug support */ + "\003PERFMON" /* performance monitor */ + "\004PCPUDPE" /* physical CPU dynamic partition event */ + "\005XMMHC" /* hypercall input through XMM regs */ + "\006IDLE" /* guest idle support */ + "\007SLEEP" /* hypervisor sleep support */ + "\010NUMA" /* NUMA distance query support */ + "\011TMFREQ" /* timer frequency query (TSC, LAPIC) */ + "\012SYNCMC" /* inject synthetic machine checks */ + "\013CRASH" /* MSRs for guest crash */ + "\014DEBUGMSR" /* MSRs for guest debug */ + "\015NPIEP" /* NPIEP */ + "\016HVDIS"); /* disabling hypervisor */ + + do_cpuid(CPUID_LEAF_HV_RECOMMENDS, regs); + hyperv_recommends = regs[0]; + if (bootverbose) + printf(" Recommends: %08x %08x\n", regs[0], regs[1]); + + do_cpuid(CPUID_LEAF_HV_LIMITS, regs); + if (bootverbose) { + printf(" Limits: Vcpu:%d Lcpu:%d Int:%d\n", + regs[0], regs[1], regs[2]); + } + + if (maxleaf >= CPUID_LEAF_HV_HWFEATURES) { + do_cpuid(CPUID_LEAF_HV_HWFEATURES, regs); + if (bootverbose) { + printf(" HW Features: %08x, AMD: %08x\n", + regs[0], regs[3]); + } + } + + return (true); +} + +static void +hyperv_init(void *dummy __unused) +{ + if (!hyperv_identify()) { + /* Not Hyper-V; reset guest id to the generic one. */ + if (vm_guest == VM_GUEST_HV) + vm_guest = VM_GUEST_VM; + return; + } + + /* Set guest id */ + wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); + + if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { + /* Register Hyper-V timecounter */ + tc_init(&hyperv_timecounter); + } +} +SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, + NULL); + +static void +hypercall_memfree(void) +{ + hyperv_dmamem_free(&hypercall_context.hc_dma, + hypercall_context.hc_addr); + hypercall_context.hc_addr = NULL; +} + +static void +hypercall_create(void *arg __unused) +{ + uint64_t hc, hc_orig; + + if (vm_guest != VM_GUEST_HV) + return; + + hypercall_context.hc_addr = hyperv_dmamem_alloc(NULL, PAGE_SIZE, 0, + PAGE_SIZE, &hypercall_context.hc_dma, BUS_DMA_WAITOK); + if (hypercall_context.hc_addr == NULL) { + printf("hyperv: Hypercall page allocation failed\n"); + /* Can't perform any Hyper-V specific actions */ + vm_guest = VM_GUEST_VM; + return; + } + + /* Get the 'reserved' bits, which requires preservation. */ + hc_orig = rdmsr(MSR_HV_HYPERCALL); + + /* + * Setup the Hypercall page. + * + * NOTE: 'reserved' bits MUST be preserved. + */ + hc = ((hypercall_context.hc_dma.hv_paddr >> PAGE_SHIFT) << + MSR_HV_HYPERCALL_PGSHIFT) | + (hc_orig & MSR_HV_HYPERCALL_RSVD_MASK) | + MSR_HV_HYPERCALL_ENABLE; + wrmsr(MSR_HV_HYPERCALL, hc); + + /* + * Confirm that Hypercall page did get setup. + */ + hc = rdmsr(MSR_HV_HYPERCALL); + if ((hc & MSR_HV_HYPERCALL_ENABLE) == 0) { + printf("hyperv: Hypercall setup failed\n"); + hypercall_memfree(); + /* Can't perform any Hyper-V specific actions */ + vm_guest = VM_GUEST_VM; + return; + } + if (bootverbose) + printf("hyperv: Hypercall created\n"); +} +SYSINIT(hypercall_ctor, SI_SUB_DRIVERS, SI_ORDER_FIRST, hypercall_create, NULL); + +static void +hypercall_destroy(void *arg __unused) +{ + uint64_t hc; + + if (hypercall_context.hc_addr == NULL) + return; + + /* Disable Hypercall */ + hc = rdmsr(MSR_HV_HYPERCALL); + wrmsr(MSR_HV_HYPERCALL, (hc & MSR_HV_HYPERCALL_RSVD_MASK)); + hypercall_memfree(); + + if (bootverbose) + printf("hyperv: Hypercall destroyed\n"); +} +SYSUNINIT(hypercall_dtor, SI_SUB_DRIVERS, SI_ORDER_FIRST, hypercall_destroy, + NULL); Copied: head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S (from r301112, head/sys/dev/hyperv/vmbus/i386/hv_vector.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S Wed Jun 1 09:20:52 2016 (r301113, copy of r301112, head/sys/dev/hyperv/vmbus/i386/hv_vector.S) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include "assym.s" + +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(vmbus_isr) + PUSH_FRAME + SET_KERNEL_SREGS + cld + FAKE_MCOUNT(TF_EIP(%esp)) + pushl %esp + call vmbus_handle_intr + add $4, %esp + MEXITCOUNT + jmp doreti Copied: head/sys/dev/hyperv/vmbus/vmbus.c (from r301112, head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Jun 1 09:20:52 2016 (r301113, copy of r301112, head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c) @@ -0,0 +1,759 @@ +/*- + * Copyright (c) 2009-2012,2016 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * VM Bus Driver Implementation + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include "acpi_if.h" + +struct vmbus_softc *vmbus_sc; + +extern inthand_t IDTVEC(vmbus_isr); + +static void +vmbus_msg_task(void *xsc, int pending __unused) +{ + struct vmbus_softc *sc = xsc; + volatile struct vmbus_message *msg; + + msg = VMBUS_PCPU_GET(sc, message, curcpu) + VMBUS_SINT_MESSAGE; + for (;;) { + const hv_vmbus_channel_msg_table_entry *entry; + hv_vmbus_channel_msg_header *hdr; + hv_vmbus_channel_msg_type msg_type; + + if (msg->msg_type == VMBUS_MSGTYPE_NONE) + break; /* no message */ + + /* XXX: update messageHandler interface */ + hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, + msg->msg_data); + msg_type = hdr->message_type; + + if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) { + printf("VMBUS: unknown message type = %d\n", msg_type); + goto handled; + } + + entry = &g_channel_message_table[msg_type]; + if (entry->messageHandler) + entry->messageHandler(hdr); +handled: + msg->msg_type = VMBUS_MSGTYPE_NONE; + /* + * Make sure the write to msg_type (i.e. set to + * VMBUS_MSGTYPE_NONE) happens before we read the + * msg_flags and EOMing. Otherwise, the EOMing will + * not deliver any more messages since there is no + * empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compiler fence on UP kernel. + */ + mb(); + if (msg->msg_flags & VMBUS_MSGFLAG_PENDING) { + /* + * This will cause message queue rescan to possibly + * deliver another msg from the hypervisor + */ + wrmsr(MSR_HV_EOM, 0); + } + } +} + +static __inline int +vmbus_handle_intr1(struct vmbus_softc *sc, struct trapframe *frame, int cpu) +{ + volatile struct vmbus_message *msg; + struct vmbus_message *msg_base; + + msg_base = VMBUS_PCPU_GET(sc, message, cpu); + + /* + * Check event timer. + * + * TODO: move this to independent IDT vector. + */ + msg = msg_base + VMBUS_SINT_TIMER; + if (msg->msg_type == VMBUS_MSGTYPE_TIMER_EXPIRED) { + msg->msg_type = VMBUS_MSGTYPE_NONE; + + vmbus_et_intr(frame); + + /* + * Make sure the write to msg_type (i.e. set to + * VMBUS_MSGTYPE_NONE) happens before we read the + * msg_flags and EOMing. Otherwise, the EOMing will + * not deliver any more messages since there is no + * empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compiler fence on UP kernel. + */ + mb(); + if (msg->msg_flags & VMBUS_MSGFLAG_PENDING) { + /* + * This will cause message queue rescan to possibly + * deliver another msg from the hypervisor + */ + wrmsr(MSR_HV_EOM, 0); + } + } + + /* + * Check events. Hot path for network and storage I/O data; high rate. + * + * NOTE: + * As recommended by the Windows guest fellows, we check events before + * checking messages. + */ + sc->vmbus_event_proc(sc, cpu); + + /* + * Check messages. Mainly management stuffs; ultra low rate. + */ + msg = msg_base + VMBUS_SINT_MESSAGE; + if (__predict_false(msg->msg_type != VMBUS_MSGTYPE_NONE)) { + taskqueue_enqueue(VMBUS_PCPU_GET(sc, message_tq, cpu), + VMBUS_PCPU_PTR(sc, message_task, cpu)); + } + + return (FILTER_HANDLED); +} + +void +vmbus_handle_intr(struct trapframe *trap_frame) +{ + struct vmbus_softc *sc = vmbus_get_softc(); + int cpu = curcpu; + + /* + * Disable preemption. + */ + critical_enter(); + + /* + * Do a little interrupt counting. + */ + (*VMBUS_PCPU_GET(sc, intr_cnt, cpu))++; + + vmbus_handle_intr1(sc, trap_frame, cpu); + + /* + * Enable preemption. + */ + critical_exit(); +} + +static void +vmbus_synic_setup(void *xsc) +{ + struct vmbus_softc *sc = xsc; + int cpu = curcpu; + uint64_t val, orig; + uint32_t sint; + + if (hyperv_features & CPUID_HV_MSR_VP_INDEX) { + /* + * Save virtual processor id. + */ + VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(MSR_HV_VP_INDEX); + } else { + /* + * XXX + * Virtual processoor id is only used by a pretty broken + * channel selection code from storvsc. It's nothing + * critical even if CPUID_HV_MSR_VP_INDEX is not set; keep + * moving on. + */ + VMBUS_PCPU_GET(sc, vcpuid, cpu) = cpu; + } + + /* + * Setup the SynIC message. + */ + orig = rdmsr(MSR_HV_SIMP); + val = MSR_HV_SIMP_ENABLE | (orig & MSR_HV_SIMP_RSVD_MASK) | + ((VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT) << + MSR_HV_SIMP_PGSHIFT); + wrmsr(MSR_HV_SIMP, val); + + /* + * Setup the SynIC event flags. + */ + orig = rdmsr(MSR_HV_SIEFP); + val = MSR_HV_SIEFP_ENABLE | (orig & MSR_HV_SIEFP_RSVD_MASK) | + ((VMBUS_PCPU_GET(sc, event_flags_dma.hv_paddr, cpu) + >> PAGE_SHIFT) << MSR_HV_SIEFP_PGSHIFT); + wrmsr(MSR_HV_SIEFP, val); + + + /* + * Configure and unmask SINT for message and event flags. + */ + sint = MSR_HV_SINT0 + VMBUS_SINT_MESSAGE; + orig = rdmsr(sint); + val = sc->vmbus_idtvec | MSR_HV_SINT_AUTOEOI | + (orig & MSR_HV_SINT_RSVD_MASK); + wrmsr(sint, val); + + /* + * Configure and unmask SINT for timer. + */ + sint = MSR_HV_SINT0 + VMBUS_SINT_TIMER; + orig = rdmsr(sint); + val = sc->vmbus_idtvec | MSR_HV_SINT_AUTOEOI | + (orig & MSR_HV_SINT_RSVD_MASK); + wrmsr(sint, val); + + /* + * All done; enable SynIC. + */ + orig = rdmsr(MSR_HV_SCONTROL); + val = MSR_HV_SCTRL_ENABLE | (orig & MSR_HV_SCTRL_RSVD_MASK); + wrmsr(MSR_HV_SCONTROL, val); +} + +static void +vmbus_synic_teardown(void *arg) +{ + uint64_t orig; + uint32_t sint; + + /* + * Disable SynIC. + */ + orig = rdmsr(MSR_HV_SCONTROL); + wrmsr(MSR_HV_SCONTROL, (orig & MSR_HV_SCTRL_RSVD_MASK)); + + /* + * Mask message and event flags SINT. + */ + sint = MSR_HV_SINT0 + VMBUS_SINT_MESSAGE; + orig = rdmsr(sint); + wrmsr(sint, orig | MSR_HV_SINT_MASKED); + + /* + * Mask timer SINT. + */ + sint = MSR_HV_SINT0 + VMBUS_SINT_TIMER; + orig = rdmsr(sint); + wrmsr(sint, orig | MSR_HV_SINT_MASKED); + + /* + * Teardown SynIC message. + */ + orig = rdmsr(MSR_HV_SIMP); + wrmsr(MSR_HV_SIMP, (orig & MSR_HV_SIMP_RSVD_MASK)); + + /* + * Teardown SynIC event flags. + */ + orig = rdmsr(MSR_HV_SIEFP); + wrmsr(MSR_HV_SIEFP, (orig & MSR_HV_SIEFP_RSVD_MASK)); +} + +static int +vmbus_dma_alloc(struct vmbus_softc *sc) +{ + int cpu; + + CPU_FOREACH(cpu) { + void *ptr; + + /* + * Per-cpu messages and event flags. + */ + ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), + PAGE_SIZE, 0, PAGE_SIZE, + VMBUS_PCPU_PTR(sc, message_dma, cpu), + BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (ptr == NULL) + return ENOMEM; + VMBUS_PCPU_GET(sc, message, cpu) = ptr; + + ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), + PAGE_SIZE, 0, PAGE_SIZE, + VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), + BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (ptr == NULL) + return ENOMEM; + VMBUS_PCPU_GET(sc, event_flags, cpu) = ptr; + } + return 0; +} + +static void +vmbus_dma_free(struct vmbus_softc *sc) +{ + int cpu; + + CPU_FOREACH(cpu) { + if (VMBUS_PCPU_GET(sc, message, cpu) != NULL) { + hyperv_dmamem_free( + VMBUS_PCPU_PTR(sc, message_dma, cpu), + VMBUS_PCPU_GET(sc, message, cpu)); + VMBUS_PCPU_GET(sc, message, cpu) = NULL; + } + if (VMBUS_PCPU_GET(sc, event_flags, cpu) != NULL) { + hyperv_dmamem_free( + VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), + VMBUS_PCPU_GET(sc, event_flags, cpu)); + VMBUS_PCPU_GET(sc, event_flags, cpu) = NULL; + } + } +} + +static int +vmbus_intr_setup(struct vmbus_softc *sc) +{ + int cpu; + + CPU_FOREACH(cpu) { + char buf[MAXCOMLEN + 1]; + cpuset_t cpu_mask; + + /* Allocate an interrupt counter for Hyper-V interrupt */ + snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); + intrcnt_add(buf, VMBUS_PCPU_PTR(sc, intr_cnt, cpu)); + + /* + * Setup taskqueue to handle events. Task will be per- + * channel. + */ + VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast( + "hyperv event", M_WAITOK, taskqueue_thread_enqueue, + VMBUS_PCPU_PTR(sc, event_tq, cpu)); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, &cpu_mask, + "hvevent%d", cpu); + + /* + * Setup tasks and taskqueues to handle messages. + */ + VMBUS_PCPU_GET(sc, message_tq, cpu) = taskqueue_create_fast( + "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, + VMBUS_PCPU_PTR(sc, message_tq, cpu)); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + VMBUS_PCPU_PTR(sc, message_tq, cpu), 1, PI_NET, &cpu_mask, + "hvmsg%d", cpu); + TASK_INIT(VMBUS_PCPU_PTR(sc, message_task, cpu), 0, + vmbus_msg_task, sc); + } + + /* + * All Hyper-V ISR required resources are setup, now let's find a + * free IDT vector for Hyper-V ISR and set it up. + */ + sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(vmbus_isr)); + if (sc->vmbus_idtvec < 0) { + device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); + return ENXIO; + } + if(bootverbose) { + device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n", + sc->vmbus_idtvec); + } + return 0; +} + +static void +vmbus_intr_teardown(struct vmbus_softc *sc) +{ + int cpu; + + if (sc->vmbus_idtvec >= 0) { + lapic_ipi_free(sc->vmbus_idtvec); + sc->vmbus_idtvec = -1; + } + + CPU_FOREACH(cpu) { + if (VMBUS_PCPU_GET(sc, event_tq, cpu) != NULL) { + taskqueue_free(VMBUS_PCPU_GET(sc, event_tq, cpu)); + VMBUS_PCPU_GET(sc, event_tq, cpu) = NULL; + } + if (VMBUS_PCPU_GET(sc, message_tq, cpu) != NULL) { + taskqueue_drain(VMBUS_PCPU_GET(sc, message_tq, cpu), + VMBUS_PCPU_PTR(sc, message_task, cpu)); + taskqueue_free(VMBUS_PCPU_GET(sc, message_tq, cpu)); + VMBUS_PCPU_GET(sc, message_tq, cpu) = NULL; + } + } +} + +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jun 1 09:32:02 2016 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 BE744B57319; Wed, 1 Jun 2016 09:32:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 68B7F1B98; Wed, 1 Jun 2016 09:32:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 8477E4276AB; Wed, 1 Jun 2016 19:31:52 +1000 (AEST) Date: Wed, 1 Jun 2016 19:31:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301071 - head/sys/sys In-Reply-To: <201605311905.u4VJ5geL053766@repo.freebsd.org> Message-ID: <20160601183101.X1028@besplex.bde.org> References: <201605311905.u4VJ5geL053766@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=M8SwUHEs c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=2TT30KpsNie2StMT_LEA:9 a=KWgJyJwKMZXIdalQ:21 a=1cV-WSLL0UF4EQd1:21 a=BIl9eTCUz8m1Y23O:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 09:32:02 -0000 On Tue, 31 May 2016, Ed Schouten wrote: > Log: > Improve POSIX conformance of . > > - This header file has always depended on pthread_t, pthread_attr_t, > struct timespec, size_t and uid_t. Only as of POSIX 2008, these > dependencies have been states explicitly. They should now be defined. Not always. POSIX didn't have pthreads or timespecs before about 1993. > - In our implementation, struct sigevent::sigev_notify_attributes has > type "void *" instead of "pthread_attr_t *". My guess is that this was > done to prevent pulling in the pthread types, but this can easily be > avoided by using the underlying structure types. Not easily, since the tags of the underlying struct types are in the application namespace, at least up to POSIX 2001. > Modified: > head/sys/sys/signal.h > > Modified: head/sys/sys/signal.h > ============================================================================== > --- head/sys/sys/signal.h Tue May 31 18:45:52 2016 (r301070) > +++ head/sys/sys/signal.h Tue May 31 19:05:41 2016 (r301071) > @@ -45,6 +45,23 @@ > #include /* __MINSIGSTKSZ */ > #include /* sig_atomic_t; trap codes; sigcontext */ > > +#if __POSIX_VISIBLE >= 200809 > + > +#include This gives the following pollution (which breaks almost everything since includes this header: - struct tag names pthread* - struct member names state and mutex POSIX could reasonably be unimproved by reserving pthread* but not ordinary identifiers like state and mutex. > ... > @@ -160,6 +177,9 @@ union sigval { > #endif > > #if __POSIX_VISIBLE >= 199309 > + > +struct pthread_attr; > + The 1993 version certainly doesn't reserve pthread*. The 1996 version has a nice table of reserved symbols for every header. For signal.h, they are just ones with a prefix of sa_, si_, sigev_ and sival_ (these shall not be declared or #defined by the application), and SIG_, SA_, SI_ and SIGEV_ (these may be used by the application iff they are #undef'ed before use). This doesn't proprtly separate optional things. A draft 2001 version as a not so nice table. The rules are now too tangled to present in a single table, so there are several tables that are hard to parse. The first table has sa_, uc_ (new), SIG[A-Z] (stronger), SIG_[A-Z] (weaker). Then it has ss_ (new) and sv_ (new) for XSI only. Then it has si_, SI_, sigev_, SIGEV_ and sival_ for RTS only. The second table has SA_, SIG_[0-9a-z_] (different/weaker), then massive pollution: BUS_, CLD_, FPE_, ILL_, POLL_, SEGV_, SI_ (now in both tables), SS_, SV_ and TRAP_. A draft 2007 version is like the 2001 version. It fixes the sorting of uc_ and makes RTS non-optional. In the second table, it moves SS_, SV_ and TRAP_ under XSI, and moves POLL_ under OBS XSR. I think pthread is not reserved since it is not in these tables. Later versions of POSIX were broken to allow to be pollutied with all the symbols in , but I don't want to check what is in that now. is slightly simpler in POSIX but much more polluted than in FreeBSD. > struct sigevent { > int sigev_notify; /* Notification type */ > int sigev_signo; /* Signal number */ > @@ -168,7 +188,7 @@ struct sigevent { > __lwpid_t _threadid; Names like _threadid are bogus. sigev is reserved for uses like this. Noy using a prefix makes the namespace random. > struct { > void (*_function)(union sigval); > - void *_attribute; /* pthread_attr_t * */ > + struct pthread_attr **_attribute; pthread is not reserved. pthread*_t is only reserved by the general rule that everything ending in _t is reserved. This also has indentation errors. > } _sigev_thread; > unsigned short _kevent_flags; Further bogus names. At least they use a prefix. > long __spare__[8]; A more bogus name. > @@ -190,6 +210,7 @@ struct sigevent { > #define SIGEV_KEVENT 3 /* Generate a kevent. */ > #define SIGEV_THREAD_ID 4 /* Send signal to a kernel thread. */ It is correct to used the reserved prefix for our extensions, but this style is inconsistent with old parts of the file. In the old parts, we ifdef out extensions to a fault. This makes the code hard to read but provides good documentation of what is portable. > #endif > + > #endif /* __POSIX_VISIBLE >= 199309 */ > > #if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE > Bruce From owner-svn-src-head@freebsd.org Wed Jun 1 10:14:07 2016 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 D0B6BB58692; Wed, 1 Jun 2016 10:14:07 +0000 (UTC) (envelope-from bz@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 mx1.freebsd.org (Postfix) with ESMTPS id 9CEEE1106; Wed, 1 Jun 2016 10:14:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51AE6s3090369; Wed, 1 Jun 2016 10:14:06 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51AE5jG090350; Wed, 1 Jun 2016 10:14:05 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606011014.u51AE5jG090350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 1 Jun 2016 10:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301114 - in head: share/man/man9 sys/kern sys/netinet sys/netinet6 sys/sys 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.22 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, 01 Jun 2016 10:14:07 -0000 Author: bz Date: Wed Jun 1 10:14:04 2016 New Revision: 301114 URL: https://svnweb.freebsd.org/changeset/base/301114 Log: The pr_destroy field does not allow us to run the teardown code in a specific order. VNET_SYSUNINITs however are doing exactly that. Thus remove the VIMAGE conditional field from the domain(9) protosw structure and replace it with VNET_SYSUNINITs. This also allows us to change some order and to make the teardown functions file local static. Also convert divert(4) as it uses the same mechanism ip(4) and ip6(4) use internally. Slightly reshuffle the SI_SUB_* fields in kernel.h and add a new ones, e.g., for pfil consumers (firewalls), partially for this commit and for others to come. Reviewed by: gnn, tuexen (sctp), jhb (kernel.h) Obtained from: projects/vnet MFC after: 2 weeks X-MFC: do not remove pr_destroy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6652 Modified: head/share/man/man9/domain.9 head/sys/kern/uipc_domain.c head/sys/netinet/in_proto.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h head/sys/netinet/raw_ip.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h head/sys/sys/kernel.h head/sys/sys/protosw.h Modified: head/share/man/man9/domain.9 ============================================================================== --- head/share/man/man9/domain.9 Wed Jun 1 09:20:52 2016 (r301113) +++ head/share/man/man9/domain.9 Wed Jun 1 10:14:04 2016 (r301114) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2014 +.Dd June 1, 2016 .Dt DOMAIN 9 .Os .Sh NAME @@ -105,7 +105,6 @@ struct protosw { pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* utility hooks */ pr_init_t *pr_init; - pr_destroy_t *pr_destroy; pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ pr_drain_t *pr_drain; /* flush any excess space possible */ Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/kern/uipc_domain.c Wed Jun 1 10:14:04 2016 (r301114) @@ -196,11 +196,7 @@ void vnet_domain_uninit(void *arg) { struct domain *dp = arg; - struct protosw *pr; - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) - if (pr->pr_destroy) - (*pr->pr_destroy)(); if (dp->dom_destroy) (*dp->dom_destroy)(); } Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/in_proto.c Wed Jun 1 10:14:04 2016 (r301114) @@ -119,9 +119,6 @@ struct protosw inetsw[] = { .pr_domain = &inetdomain, .pr_protocol = IPPROTO_IP, .pr_init = ip_init, -#ifdef VIMAGE - .pr_destroy = ip_destroy, -#endif .pr_slowtimo = ip_slowtimo, .pr_drain = ip_drain, .pr_usrreqs = &nousrreqs @@ -135,9 +132,6 @@ struct protosw inetsw[] = { .pr_ctlinput = udp_ctlinput, .pr_ctloutput = udp_ctloutput, .pr_init = udp_init, -#ifdef VIMAGE - .pr_destroy = udp_destroy, -#endif .pr_usrreqs = &udp_usrreqs }, { @@ -149,9 +143,6 @@ struct protosw inetsw[] = { .pr_ctlinput = tcp_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_init = tcp_init, -#ifdef VIMAGE - .pr_destroy = tcp_destroy, -#endif .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, .pr_usrreqs = &tcp_usrreqs @@ -166,9 +157,6 @@ struct protosw inetsw[] = { .pr_ctlinput = sctp_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_init = sctp_init, -#ifdef VIMAGE - .pr_destroy = sctp_finish, -#endif .pr_drain = sctp_drain, .pr_usrreqs = &sctp_usrreqs }, @@ -193,9 +181,6 @@ struct protosw inetsw[] = { .pr_ctlinput = udplite_ctlinput, .pr_ctloutput = udp_ctloutput, .pr_init = udplite_init, -#ifdef VIMAGE - .pr_destroy = udplite_destroy, -#endif .pr_usrreqs = &udp_usrreqs }, { @@ -343,9 +328,6 @@ IPPROTOSPACER, .pr_input = rip_input, .pr_ctloutput = rip_ctloutput, .pr_init = rip_init, -#ifdef VIMAGE - .pr_destroy = rip_destroy, -#endif .pr_usrreqs = &rip_usrreqs }, }; Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/ip_divert.c Wed Jun 1 10:14:04 2016 (r301114) @@ -162,11 +162,13 @@ div_init(void) } static void -div_destroy(void) +div_destroy(void *unused __unused) { in_pcbinfo_destroy(&V_divcbinfo); } +VNET_SYSUNINIT(divert, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, + div_destroy, NULL); /* * IPPROTO_DIVERT is not in the real IP protocol number space; this @@ -755,9 +757,6 @@ struct protosw div_protosw = { .pr_ctlinput = div_ctlinput, .pr_ctloutput = ip_ctloutput, .pr_init = div_init, -#ifdef VIMAGE - .pr_destroy = div_destroy, -#endif .pr_usrreqs = &div_usrreqs }; @@ -789,10 +788,6 @@ div_modevent(module_t mod, int type, voi err = EPERM; break; case MOD_UNLOAD: -#ifdef VIMAGE - err = EPERM; - break; -#else /* * Forced unload. * @@ -813,10 +808,11 @@ div_modevent(module_t mod, int type, voi ip_divert_ptr = NULL; err = pf_proto_unregister(PF_INET, IPPROTO_DIVERT, SOCK_RAW); INP_INFO_WUNLOCK(&V_divcbinfo); - div_destroy(); +#ifndef VIMAGE + div_destroy(NULL); +#endif EVENTHANDLER_DEREGISTER(maxsockets_change, ip_divert_event_tag); break; -#endif /* !VIMAGE */ default: err = EOPNOTSUPP; break; @@ -830,6 +826,6 @@ static moduledata_t ipdivertmod = { 0 }; -DECLARE_MODULE(ipdivert, ipdivertmod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(ipdivert, ipdivertmod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); MODULE_DEPEND(ipdivert, ipfw, 3, 3, 3); MODULE_VERSION(ipdivert, 1); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/ip_input.c Wed Jun 1 10:14:04 2016 (r301114) @@ -361,8 +361,8 @@ ip_init(void) } #ifdef VIMAGE -void -ip_destroy(void) +static void +ip_destroy(void *unused __unused) { int error; @@ -388,6 +388,8 @@ ip_destroy(void) /* Destroy IP reassembly queue. */ ipreass_destroy(); } + +VNET_SYSUNINIT(ip, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip_destroy, NULL); #endif #ifdef RSS Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/ip_var.h Wed Jun 1 10:14:04 2016 (r301114) @@ -209,9 +209,6 @@ int ip_fragment(struct ip *ip, struct mb u_long if_hwassist_flags); void ip_forward(struct mbuf *m, int srcrt); void ip_init(void); -#ifdef VIMAGE -void ip_destroy(void); -#endif extern int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *, struct ip_moptions *); @@ -229,9 +226,6 @@ void ip_fillid(struct ip *); int rip_ctloutput(struct socket *, struct sockopt *); void rip_ctlinput(int, struct sockaddr *, void *); void rip_init(void); -#ifdef VIMAGE -void rip_destroy(void); -#endif int rip_input(struct mbuf **, int *, int); int rip_output(struct mbuf *, struct socket *, ...); int ipip_input(struct mbuf **, int *, int); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/raw_ip.c Wed Jun 1 10:14:04 2016 (r301114) @@ -218,12 +218,13 @@ rip_init(void) } #ifdef VIMAGE -void -rip_destroy(void) +static void +rip_destroy(void *unused __unused) { in_pcbinfo_destroy(&V_ripcbinfo); } +VNET_SYSUNINIT(raw_ip, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, rip_destroy, NULL); #endif #ifdef INET Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/sctp_usrreq.c Wed Jun 1 10:14:04 2016 (r301114) @@ -89,13 +89,14 @@ sctp_init(void) #endif } -void -sctp_finish(void) +#ifdef VIMAGE +static void +sctp_finish(void *unused __unused) { sctp_pcb_finish(); } - - +VNET_SYSUNINIT(sctp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, sctp_finish, NULL); +#endif void sctp_pathmtu_adjustment(struct sctp_tcb *stcb, uint16_t nxtsz) Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/sctp_var.h Wed Jun 1 10:14:04 2016 (r301114) @@ -344,7 +344,6 @@ void sctp_init(void); void sctp_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, uint8_t, uint16_t, uint16_t); -void sctp_finish(void); int sctp_flush(struct socket *, int); int sctp_shutdown(struct socket *); int Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/tcp_subr.c Wed Jun 1 10:14:04 2016 (r301114) @@ -728,8 +728,8 @@ tcp_init(void) } #ifdef VIMAGE -void -tcp_destroy(void) +static void +tcp_destroy(void *unused __unused) { int error; @@ -772,6 +772,7 @@ tcp_destroy(void) HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, error); } } +VNET_SYSUNINIT(tcp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, tcp_destroy, NULL); #endif void Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/tcp_var.h Wed Jun 1 10:14:04 2016 (r301114) @@ -755,9 +755,6 @@ struct tcpcb * tcp_drop(struct tcpcb *, int); void tcp_drain(void); void tcp_init(void); -#ifdef VIMAGE -void tcp_destroy(void); -#endif void tcp_fini(void *); char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, const void *); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/udp_usrreq.c Wed Jun 1 10:14:04 2016 (r301114) @@ -269,20 +269,23 @@ udp_discardcb(struct udpcb *up) } #ifdef VIMAGE -void -udp_destroy(void) +static void +udp_destroy(void *unused __unused) { in_pcbinfo_destroy(&V_udbinfo); uma_zdestroy(V_udpcb_zone); } +VNET_SYSUNINIT(udp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, udp_destroy, NULL); -void -udplite_destroy(void) +static void +udplite_destroy(void *unused __unused) { in_pcbinfo_destroy(&V_ulitecbinfo); } +VNET_SYSUNINIT(udplite, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, udplite_destroy, + NULL); #endif #ifdef INET Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet/udp_var.h Wed Jun 1 10:14:04 2016 (r301114) @@ -171,10 +171,6 @@ void udplite_ctlinput(int, struct socka int udp_ctloutput(struct socket *, struct sockopt *); void udp_init(void); void udplite_init(void); -#ifdef VIMAGE -void udp_destroy(void); -void udplite_destroy(void); -#endif int udp_input(struct mbuf **, int *, int); void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet6/in6_proto.c Wed Jun 1 10:14:04 2016 (r301114) @@ -153,9 +153,6 @@ struct protosw inet6sw[] = { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, -#ifdef VIMAGE - .pr_destroy = ip6_destroy, -#endif .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, .pr_usrreqs = &nousrreqs, Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet6/ip6_input.c Wed Jun 1 10:14:04 2016 (r301114) @@ -305,8 +305,8 @@ ip6proto_unregister(short ip6proto) } #ifdef VIMAGE -void -ip6_destroy() +static void +ip6_destroy(void *unused __unused) { int error; @@ -329,6 +329,8 @@ ip6_destroy() nd6_destroy(); in6_ifattach_destroy(); } + +VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip6_destroy, NULL); #endif static int Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/netinet6/ip6_var.h Wed Jun 1 10:14:04 2016 (r301114) @@ -354,9 +354,6 @@ int icmp6_ctloutput(struct socket *, str struct in6_ifaddr; void ip6_init(void); -#ifdef VIMAGE -void ip6_destroy(void); -#endif int ip6proto_register(short); int ip6proto_unregister(short); Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/sys/kernel.h Wed Jun 1 10:14:04 2016 (r301114) @@ -139,10 +139,13 @@ enum sysinit_sub_id { SI_SUB_PSEUDO = 0x7000000, /* pseudo devices*/ SI_SUB_EXEC = 0x7400000, /* execve() handlers */ SI_SUB_PROTO_BEGIN = 0x8000000, /* VNET initialization */ + SI_SUB_PROTO_PFIL = 0x8100000, /* Initialize pfil before FWs */ SI_SUB_PROTO_IF = 0x8400000, /* interfaces*/ SI_SUB_PROTO_DOMAININIT = 0x8600000, /* domain registration system */ + SI_SUB_PROTO_MC = 0x8700000, /* Multicast */ SI_SUB_PROTO_DOMAIN = 0x8800000, /* domains (address families?)*/ - SI_SUB_PROTO_IFATTACHDOMAIN = 0x8800001, /* domain dependent data init*/ + SI_SUB_PROTO_FIREWALL = 0x8806000, /* Firewalls */ + SI_SUB_PROTO_IFATTACHDOMAIN = 0x8808000,/* domain dependent data init */ SI_SUB_PROTO_END = 0x8ffffff, /* VNET helper functions */ SI_SUB_KPROF = 0x9000000, /* kernel profiling*/ SI_SUB_KICK_SCHEDULER = 0xa000000, /* start the timeout events*/ Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Wed Jun 1 09:20:52 2016 (r301113) +++ head/sys/sys/protosw.h Wed Jun 1 10:14:04 2016 (r301114) @@ -70,7 +70,6 @@ typedef int pr_output_t (struct mbuf *, typedef void pr_ctlinput_t (int, struct sockaddr *, void *); typedef int pr_ctloutput_t (struct socket *, struct sockopt *); typedef void pr_init_t (void); -typedef void pr_destroy_t (void); typedef void pr_fasttimo_t (void); typedef void pr_slowtimo_t (void); typedef void pr_drain_t (void); @@ -87,7 +86,6 @@ struct protosw { pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* utility hooks */ pr_init_t *pr_init; - pr_destroy_t *pr_destroy; pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ pr_drain_t *pr_drain; /* flush any excess space possible */ From owner-svn-src-head@freebsd.org Wed Jun 1 10:14:27 2016 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 48188B58706; Wed, 1 Jun 2016 10:14:27 +0000 (UTC) (envelope-from ache@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 mx1.freebsd.org (Postfix) with ESMTPS id F149712BE; Wed, 1 Jun 2016 10:14:26 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51AEQ8B090431; Wed, 1 Jun 2016 10:14:26 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51AEPFX090427; Wed, 1 Jun 2016 10:14:25 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606011014.u51AEPFX090427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 1 Jun 2016 10:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301115 - head/lib/libc/stdlib 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.22 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, 01 Jun 2016 10:14:27 -0000 Author: ache Date: Wed Jun 1 10:14:25 2016 New Revision: 301115 URL: https://svnweb.freebsd.org/changeset/base/301115 Log: Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde MFC after: 1 week Modified: head/lib/libc/stdlib/div.c head/lib/libc/stdlib/imaxdiv.c head/lib/libc/stdlib/ldiv.c head/lib/libc/stdlib/lldiv.c Modified: head/lib/libc/stdlib/div.c ============================================================================== --- head/lib/libc/stdlib/div.c Wed Jun 1 10:14:04 2016 (r301114) +++ head/lib/libc/stdlib/div.c Wed Jun 1 10:14:25 2016 (r301115) @@ -46,6 +46,7 @@ div(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) /* * The ANSI standard says that |r.quot| <= |n/d|, where * n/d is to be computed in infinite precision. In other @@ -73,5 +74,6 @@ div(num, denom) r.quot++; r.rem -= denom; } +#endif return (r); } Modified: head/lib/libc/stdlib/imaxdiv.c ============================================================================== --- head/lib/libc/stdlib/imaxdiv.c Wed Jun 1 10:14:04 2016 (r301114) +++ head/lib/libc/stdlib/imaxdiv.c Wed Jun 1 10:14:25 2016 (r301115) @@ -37,9 +37,11 @@ imaxdiv(intmax_t numer, intmax_t denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } Modified: head/lib/libc/stdlib/ldiv.c ============================================================================== --- head/lib/libc/stdlib/ldiv.c Wed Jun 1 10:14:04 2016 (r301114) +++ head/lib/libc/stdlib/ldiv.c Wed Jun 1 10:14:25 2016 (r301115) @@ -48,9 +48,11 @@ ldiv(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (num >= 0 && r.rem < 0) { r.quot++; r.rem -= denom; } +#endif return (r); } Modified: head/lib/libc/stdlib/lldiv.c ============================================================================== --- head/lib/libc/stdlib/lldiv.c Wed Jun 1 10:14:04 2016 (r301114) +++ head/lib/libc/stdlib/lldiv.c Wed Jun 1 10:14:25 2016 (r301115) @@ -37,9 +37,11 @@ lldiv(long long numer, long long denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } From owner-svn-src-head@freebsd.org Wed Jun 1 11:45:07 2016 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 E723CB6069D; Wed, 1 Jun 2016 11:45:07 +0000 (UTC) (envelope-from trasz@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 mx1.freebsd.org (Postfix) with ESMTPS id B46E61152; Wed, 1 Jun 2016 11:45:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Bj60v023444; Wed, 1 Jun 2016 11:45:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51Bj6mX023443; Wed, 1 Jun 2016 11:45:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606011145.u51Bj6mX023443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 Jun 2016 11:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301118 - head/usr.sbin/ctld 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.22 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, 01 Jun 2016 11:45:08 -0000 Author: trasz Date: Wed Jun 1 11:45:06 2016 New Revision: 301118 URL: https://svnweb.freebsd.org/changeset/base/301118 Log: Describe default value for "offload". MFC after: 1 month Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Wed Jun 1 10:55:22 2016 (r301117) +++ head/usr.sbin/ctld/ctl.conf.5 Wed Jun 1 11:45:06 2016 (r301118) @@ -226,6 +226,8 @@ An IPv4 or IPv6 address and port to list .It Ic offload Ar driver Define iSCSI hardware offload driver to use for this .Sy portal-group . +The default is +.Qq Ar none . .It Ic option Ar name Ar value The CTL-specific port options passed to the kernel. .It Ic redirect Ar address From owner-svn-src-head@freebsd.org Wed Jun 1 12:04:06 2016 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 23522B606DF; Wed, 1 Jun 2016 12:04:06 +0000 (UTC) (envelope-from trasz@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 mx1.freebsd.org (Postfix) with ESMTPS id E99C112E9; Wed, 1 Jun 2016 12:04:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51C45Ft030729; Wed, 1 Jun 2016 12:04:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51C45q8030728; Wed, 1 Jun 2016 12:04:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606011204.u51C45q8030728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 Jun 2016 12:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301119 - head/sys/dev/cxgbe/cxgbei 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.22 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, 01 Jun 2016 12:04:06 -0000 Author: trasz Date: Wed Jun 1 12:04:04 2016 New Revision: 301119 URL: https://svnweb.freebsd.org/changeset/base/301119 Log: Reduce the priority of cxgbei(4) driver, so it doesn't get chosen by default. This is a workaround for a too simplistic ICL module choosing mechanism. To use it, specify offload in ctl.conf or iscsi.conf. This fixes a problem where "kldload cxgbei" wedges the iSCSI stack, if you don't have a Chelsio card installed, or the endpoints of the iSCSI session are not reachable through addresses configured on that interface. Reviewed by: np@ MFC after: 1 month Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Wed Jun 1 11:45:06 2016 (r301118) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Wed Jun 1 12:04:04 2016 (r301119) @@ -850,7 +850,7 @@ icl_cxgbei_load(void) refcount_init(&icl_cxgbei_ncons, 0); - error = icl_register("cxgbei", false, 100, icl_cxgbei_limits, + error = icl_register("cxgbei", false, -100, icl_cxgbei_limits, icl_cxgbei_new_conn); KASSERT(error == 0, ("failed to register")); From owner-svn-src-head@freebsd.org Wed Jun 1 12:19:01 2016 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 A1552B60BFE; Wed, 1 Jun 2016 12:19:01 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id 7216D1AB4; Wed, 1 Jun 2016 12:19:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51CJ0WQ034450; Wed, 1 Jun 2016 12:19:00 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51CJ09D034449; Wed, 1 Jun 2016 12:19:00 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606011219.u51CJ09D034449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jun 2016 12:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301120 - head/sys/riscv/conf 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.22 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, 01 Jun 2016 12:19:01 -0000 Author: br Date: Wed Jun 1 12:19:00 2016 New Revision: 301120 URL: https://svnweb.freebsd.org/changeset/base/301120 Log: * Enable KDTRACE options as we support DTrace now. * Add bpf device to kernel config. Modified: head/sys/riscv/conf/GENERIC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Jun 1 12:04:04 2016 (r301119) +++ head/sys/riscv/conf/GENERIC Wed Jun 1 12:19:00 2016 (r301120) @@ -64,8 +64,8 @@ options AUDIT # Security event auditi options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework -# options KDTRACE_FRAME # Ensure frames are compiled in -# options KDTRACE_HOOKS # Kernel DTrace hooks +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks # options VFP # Floating-point support options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default @@ -102,4 +102,9 @@ device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + options FDT From owner-svn-src-head@freebsd.org Wed Jun 1 13:43:44 2016 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 9AA9EB606F5; Wed, 1 Jun 2016 13:43:44 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id 6C7F0195C; Wed, 1 Jun 2016 13:43:44 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51DhhL3070015; Wed, 1 Jun 2016 13:43:43 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51DhhHA070014; Wed, 1 Jun 2016 13:43:43 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606011343.u51DhhHA070014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jun 2016 13:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301121 - head/sys/modules 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.22 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, 01 Jun 2016 13:43:44 -0000 Author: br Date: Wed Jun 1 13:43:43 2016 New Revision: 301121 URL: https://svnweb.freebsd.org/changeset/base/301121 Log: Don't build some modules on RISC-V. Submitted by: Yukishige Shibata Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jun 1 12:19:00 2016 (r301120) +++ head/sys/modules/Makefile Wed Jun 1 13:43:43 2016 (r301121) @@ -499,7 +499,7 @@ _txp= txp .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \ ${MACHINE_ARCH:C/mips(el)?/mips/} != "mips" && \ - ${MACHINE_ARCH} != "powerpc" + ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "riscv" _cxgbe= cxgbe .endif @@ -508,7 +508,8 @@ SUBDIR+= zfs .endif .if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \ - ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" + ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \ + ${MACHINE_CPUARCH} != "riscv" _syscons= syscons _vpo= vpo .endif From owner-svn-src-head@freebsd.org Wed Jun 1 13:57:04 2016 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 1A2C0B60C1D; Wed, 1 Jun 2016 13:57:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id D9ADB1115; Wed, 1 Jun 2016 13:57:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 9E834D4A66D; Wed, 1 Jun 2016 23:56:59 +1000 (AEST) Date: Wed, 1 Jun 2016 23:56:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chris Torek cc: Bruce Evans , Andrey Chernov , pfg@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300956 - head/lib/libc/stdlib In-Reply-To: <201605312124.u4VLOhnI085631@elf.torek.net> Message-ID: <20160601232109.D2616@besplex.bde.org> References: <201605312124.u4VLOhnI085631@elf.torek.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=M8SwUHEs c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=bx8du_89sgTnowQVBh0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 13:57:04 -0000 On Tue, 31 May 2016, Chris Torek wrote: >> That was what I was complaining about. div.c is for C90 (misspelled >> "ANSI"). > > It wasn't misspelled when I wrote it. :-) The 1989 ANSI C :-) > standard was formally ratified in Dec 1989, and the draft was > pretty firm by the time I wrote the code (which I am sure was also > 1989, despite the 1990 copyright; we added or updated all the > copyrights at the last minute, for net-2). ISO's quick adoption, > and hence the name C90, post-date all of that. The weren't quick enough to be in the same year. I usually spell the year as 90, but this can be confusing when discussing the compiler c89 or the compiler flag -std=c89. Hmm, old gcc doesn't have -std=c90, but clang does. >> >> Correct rounding for a >> positive divisor is towards minus infinity so that the remainder is >> not negative. This is modulo arithmetic and has good algebraic >> properties. C99 requires rounding minus infinity, at least for positive >> divisors, under the extension "reliable integer division". > > Did you state this backwards? For integer divison I see: Oops. I seem to have misedited a whole clause. "towards" is also missing. > When integers are divided, the result of the / operator is the > algebraic quotient with any fractional part discarded.[105] If > the quotient a/b is representable, the expression (a/b)*b + a%b > shall equal a; otherwise, the behavior of both a/b and a%b is > undefined. > > which (as footnote 105 notes) is "truncation towards zero", so that > (-1)/2 is 0 and not -1. > >> In C90, >> the rounding is implementation-defined, so it may be correct, but it >> is "unreliable" since it can be anything. >> >> In C90, div() is specified as giving "reliable" division, and that is >> what the fixups implement. This now wastes time to change nothing. > > Right -- as long as the compiler must meet C99 rules, div.c > can just use the / and % operators. ache added the ifdef. I checked that compilers (old gcc and current clang on amd64) don't auto-inline div(). It is very suitable for inlining without the fixup. Bruce From owner-svn-src-head@freebsd.org Wed Jun 1 14:03:08 2016 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 D1E6DB60E7D; Wed, 1 Jun 2016 14:03:08 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id AB1381744; Wed, 1 Jun 2016 14:03:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51E37XN077233; Wed, 1 Jun 2016 14:03:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51E37nX077227; Wed, 1 Jun 2016 14:03:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606011403.u51E37nX077227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 1 Jun 2016 14:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301122 - in head/sys/dev/sfxge: . common 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.22 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, 01 Jun 2016 14:03:08 -0000 Author: arybchik Date: Wed Jun 1 14:03:07 2016 New Revision: 301122 URL: https://svnweb.freebsd.org/changeset/base/301122 Log: sfxge(4): set moderation in efx_ev_qcreate This simplifies setting an initial interrupt moderation value, and avoids most calls to evx_ev_qmoderate from contexts where MCDI is not allowed (MCDI is need for an EVQ timer workaround in a later patch). Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6673 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Wed Jun 1 13:43:43 2016 (r301121) +++ head/sys/dev/sfxge/common/ef10_ev.c Wed Jun 1 14:03:07 2016 (r301122) @@ -92,8 +92,10 @@ efx_mcdi_init_evq( __in unsigned int instance, __in efsys_mem_t *esmp, __in size_t nevs, - __in uint32_t irq) + __in uint32_t irq, + __in uint32_t us) { + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[ MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), @@ -141,10 +143,26 @@ efx_mcdi_init_evq( INIT_EVQ_IN_FLAG_RX_MERGE, 1, INIT_EVQ_IN_FLAG_TX_MERGE, 1); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, - MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0); + if (us == 0) { + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, + MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0); + } else { + uint32_t timer_val; + + /* Calculate the timer value in quanta */ + timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; + + /* Moderation value is base 0 so we need to deduct 1 */ + if (timer_val > 0) + timer_val--; + + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, + MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, timer_val); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, timer_val); + } MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_MODE, MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS); @@ -246,6 +264,7 @@ ef10_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -266,6 +285,11 @@ ef10_ev_qcreate( goto fail2; } + if (us > encp->enc_evq_timer_max_us) { + rc = EINVAL; + goto fail3; + } + /* Set up the handler table */ eep->ee_rx = ef10_ev_rx; eep->ee_tx = ef10_ev_tx; @@ -280,11 +304,13 @@ ef10_ev_qcreate( * Interrupts may be raised for events immediately after the queue is * created. See bug58606. */ - if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq)) != 0) - goto fail3; + if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us)) != 0) + goto fail4; return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Jun 1 13:43:43 2016 (r301121) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Jun 1 14:03:07 2016 (r301122) @@ -84,6 +84,7 @@ ef10_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep); void Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Jun 1 13:43:43 2016 (r301121) +++ head/sys/dev/sfxge/common/efx.h Wed Jun 1 14:03:07 2016 (r301122) @@ -1602,6 +1602,7 @@ efx_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __deref_out efx_evq_t **eepp); extern void Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Jun 1 13:43:43 2016 (r301121) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Jun 1 14:03:07 2016 (r301122) @@ -70,6 +70,7 @@ siena_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep); static void @@ -226,6 +227,7 @@ efx_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; @@ -262,7 +264,7 @@ efx_ev_qcreate( enp->en_ev_qcount++; *eepp = eep; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0) + if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, eep)) != 0) goto fail2; return (0); @@ -1257,6 +1259,7 @@ siena_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -1312,6 +1315,9 @@ siena_ev_qcreate( EFX_BAR_TBL_WRITEO(enp, FR_AZ_EVQ_PTR_TBL, index, &oword, B_TRUE); + /* Set initial interrupt moderation */ + siena_ev_qmoderate(eep, us); + return (0); fail4: Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Jun 1 13:43:43 2016 (r301121) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Jun 1 14:03:07 2016 (r301122) @@ -95,7 +95,7 @@ typedef struct efx_ev_ops_s { void (*eevo_fini)(efx_nic_t *); efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int, efsys_mem_t *, size_t, uint32_t, - efx_evq_t *); + uint32_t, efx_evq_t *); void (*eevo_qdestroy)(efx_evq_t *); efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int); void (*eevo_qpost)(efx_evq_t *, uint16_t); Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Wed Jun 1 13:43:43 2016 (r301121) +++ head/sys/dev/sfxge/sfxge_ev.c Wed Jun 1 14:03:07 2016 (r301122) @@ -704,14 +704,11 @@ sfxge_ev_qstart(struct sfxge_softc *sc, /* Create the common code event queue. */ if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries, - evq->buf_base_id, &evq->common)) != 0) + evq->buf_base_id, sc->ev_moderation, &evq->common)) != 0) goto fail; SFXGE_EVQ_LOCK(evq); - /* Set the default moderation */ - (void)efx_ev_qmoderate(evq->common, sc->ev_moderation); - /* Prime the event queue for interrupts */ if ((rc = efx_ev_qprime(evq->common, evq->read_ptr)) != 0) goto fail2; From owner-svn-src-head@freebsd.org Wed Jun 1 14:03:14 2016 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 C0F90B60E97; Wed, 1 Jun 2016 14:03:14 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id 623521798; Wed, 1 Jun 2016 14:03:14 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51E3DR1077283; Wed, 1 Jun 2016 14:03:13 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51E3DON077282; Wed, 1 Jun 2016 14:03:13 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606011403.u51E3DON077282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jun 2016 14:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301123 - head/sys/dev/sym 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.22 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, 01 Jun 2016 14:03:15 -0000 Author: br Date: Wed Jun 1 14:03:13 2016 New Revision: 301123 URL: https://svnweb.freebsd.org/changeset/base/301123 Log: Add a riscv define. Submitted by: Yukishige Shibata Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Wed Jun 1 14:03:07 2016 (r301122) +++ head/sys/dev/sym/sym_hipd.c Wed Jun 1 14:03:13 2016 (r301123) @@ -138,6 +138,8 @@ typedef u_int32_t u32; #define MEMORY_BARRIER() dmb() #elif defined __aarch64__ #define MEMORY_BARRIER() dmb(sy) +#elif defined __riscv__ +#define MEMORY_BARRIER() fence() #else #error "Not supported platform" #endif From owner-svn-src-head@freebsd.org Wed Jun 1 14:05:33 2016 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 CA108B60F6F; Wed, 1 Jun 2016 14:05:33 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id 9C13F1AA2; Wed, 1 Jun 2016 14:05:33 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51E5Wm3077415; Wed, 1 Jun 2016 14:05:32 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51E5WZi077414; Wed, 1 Jun 2016 14:05:32 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606011405.u51E5WZi077414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jun 2016 14:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301124 - head/sys/conf 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.22 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, 01 Jun 2016 14:05:33 -0000 Author: br Date: Wed Jun 1 14:05:32 2016 New Revision: 301124 URL: https://svnweb.freebsd.org/changeset/base/301124 Log: Build riscv modules as PIC. Submitted by: Yukishige Shibata Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Jun 1 14:03:13 2016 (r301123) +++ head/sys/conf/kmod.mk Wed Jun 1 14:05:32 2016 (r301124) @@ -130,7 +130,7 @@ CFLAGS+= ${DEBUG_FLAGS} CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif -.if ${MACHINE_CPUARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -fPIC .endif From owner-svn-src-head@freebsd.org Wed Jun 1 14:11:41 2016 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 52D13B4F282; Wed, 1 Jun 2016 14:11:41 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 1D1F51ED8; Wed, 1 Jun 2016 14:11:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51EBeDo080227; Wed, 1 Jun 2016 14:11:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51EBeEn080226; Wed, 1 Jun 2016 14:11:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606011411.u51EBeEn080226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 1 Jun 2016 14:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301125 - head/sys/dev/sfxge/common 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.22 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, 01 Jun 2016 14:11:41 -0000 Author: arybchik Date: Wed Jun 1 14:11:40 2016 New Revision: 301125 URL: https://svnweb.freebsd.org/changeset/base/301125 Log: sfxge(4): cleanup: add missing space after if keyword Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Jun 1 14:05:32 2016 (r301124) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Jun 1 14:11:40 2016 (r301125) @@ -506,7 +506,7 @@ efx_lic_v1v2_find_key( _NOTE(ARGUNUSED(enp)) - if((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) + if ((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) goto fail1; tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]); @@ -548,7 +548,7 @@ efx_lic_v1v2_validate_key( tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]); tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]); - if(tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { + if (tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { goto fail2; } if (tlv_type == 0) { From owner-svn-src-head@freebsd.org Wed Jun 1 14:12:32 2016 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 E9701B4F2F1; Wed, 1 Jun 2016 14:12:32 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id AC09811D8; Wed, 1 Jun 2016 14:12:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51ECVwT080944; Wed, 1 Jun 2016 14:12:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51ECVi8080942; Wed, 1 Jun 2016 14:12:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606011412.u51ECVi8080942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 Jun 2016 14:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301126 - in head/sys/riscv: conf riscv 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.22 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, 01 Jun 2016 14:12:33 -0000 Author: br Date: Wed Jun 1 14:12:31 2016 New Revision: 301126 URL: https://svnweb.freebsd.org/changeset/base/301126 Log: Add support for loadable kernel modules. Submitted by: Yukishige Shibata Modified: head/sys/riscv/conf/GENERIC head/sys/riscv/riscv/elf_machdep.c Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Jun 1 14:11:40 2016 (r301125) +++ head/sys/riscv/conf/GENERIC Wed Jun 1 14:12:31 2016 (r301126) @@ -23,7 +23,9 @@ ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support -makeoptions NO_MODULES=1 # We don't yet support modules on RISC-V + +# FIXME: linker error. "--relax and -r may not be used together" +makeoptions WITHOUT_MODULES="usb otusfw mwlfw ispfw mwlfw ralfw rtwnfw urtwnfw" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Wed Jun 1 14:11:40 2016 (r301125) +++ head/sys/riscv/riscv/elf_machdep.c Wed Jun 1 14:12:31 2016 (r301126) @@ -1,6 +1,7 @@ /*- * Copyright 1996-1998 John D. Polstra. * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2016 Yukishige SHibata * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -123,19 +125,380 @@ SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_AN (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_oinfo); +static int debug_kld; +SYSCTL_INT(_kern, OID_AUTO, debug_kld, + CTLFLAG_RW, &debug_kld, 0, + "Activate debug prints in elf_reloc_internal()"); + +struct type2str_ent { + int type; + const char* str; +}; + void elf64_dump_thread(struct thread *td, void *dst, size_t *off) { } -/* Process one elf relocation with addend. */ +/* + * Following 4 functions are used to manupilate bits on 32bit interger value. + * FIXME: I implemetend for ease-to-understand rather than for well-optimized. + */ +static uint32_t +gen_bitmask(int msb, int lsb) +{ + uint32_t mask; + + if (msb == sizeof(mask) * 8 - 1) + mask = ~0; + else + mask = (1U << (msb + 1)) - 1; + + if (lsb > 0) + mask &= ~((1U << lsb) - 1); + + return (mask); +} + +static uint32_t +extract_bits(uint32_t x, int msb, int lsb) +{ + uint32_t mask; + + mask = gen_bitmask(msb, lsb); + + x &= mask; + x >>= lsb; + + return (x); +} + +static uint32_t +insert_bits(uint32_t d, uint32_t s, int msb, int lsb) +{ + uint32_t mask; + + mask = gen_bitmask(msb, lsb); + + d &= ~mask; + + s <<= lsb; + s &= mask; + + return (d | s); +} + +static uint32_t +insert_imm(uint32_t insn, uint32_t imm, int imm_msb, int imm_lsb, + int insn_lsb) +{ + int insn_msb; + uint32_t v; + + v = extract_bits(imm, imm_msb, imm_lsb); + insn_msb = (imm_msb - imm_lsb) + insn_lsb; + + return (insert_bits(insn, v, insn_msb, insn_lsb)); +} + +/* + * The RISCV ISA is designed so that all of immediate value is + * sign-extened. + * An immediate value is sometimes generated at runtime by adding + * 12bit sign integer and 20bit signed integer. This requests 20bit + * immediate value to be ajusted if the MSB of the 12bit immediate + * value is asserted (sign extened value is treated as negative value). + * + * For example, 0x123800 can be calculated by adding upper 20 bit of + * 0x124000 and signed-extended 12bit immediate whose bit pattern is + * 0x800 as follows; + * 0x123800 + * = 0x123000 + 0x800 + * = (0x123000 + 0x1000) + (-0x1000 + 0x800) + * = (0x123000 + 0x1000) + (0xff...ff800) + * = 0x124000 + sign-exntend(0x800) + */ +static uint32_t +calc_hi20_imm(uint32_t value) +{ + /* + * There is the arithmetical hack that can remove conditional + * statement. But I implement it in straghtforward way. + */ + if ((value & 0x800) != 0) + value += 0x1000; + return (value & ~0xfff); +} + +static const struct type2str_ent t2s[] = { + { R_RISCV_NONE, "R_RISCV_NONE" }, + { R_RISCV_64, "R_RISCV_64" }, + { R_RISCV_JUMP_SLOT, "R_RISCV_JUMP_SLOT" }, + { R_RISCV_RELATIVE, "R_RISCV_RELATIVE" }, + { R_RISCV_JAL, "R_RISCV_JAL" }, + { R_RISCV_CALL, "R_RISCV_CALL" }, + { R_RISCV_PCREL_HI20, "R_RISCV_PCREL_HI20" }, + { R_RISCV_PCREL_LO12_I, "R_RISCV_PCREL_LO12_I" }, + { R_RISCV_PCREL_LO12_S, "R_RISCV_PCREL_LO12_S" }, + { R_RISCV_HI20, "R_RISCV_HI20" }, + { R_RISCV_LO12_I, "R_RISCV_LO12_I" }, + { R_RISCV_LO12_S, "R_RISCV_LO12_S" }, +}; + +static const char* +reloctype_to_str(int type) +{ + int i; + + for (i = 0; i < sizeof(t2s) / sizeof(t2s[0]); ++i) { + if (type == t2s[i].type) + return t2s[i].str; + } + + return "*unknown*"; +} + +/* + * Currently kernel loadable module for RISCV is compiled with -fPIC option. + * (see also additional CFLAGS definition for RISCV in sys/conf/kmod.mk) + * Only R_RISCV_64, R_RISCV_JUMP_SLOT and RISCV_RELATIVE are emitted in + * the module. Other relocations will be processed when kernel loadable + * modules are built in non-PIC. + * + * FIXME: only RISCV64 is supported. + */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, int local, elf_lookup_fn lookup) { + Elf_Size rtype, symidx; + const Elf_Rela *rela; + Elf_Addr val, addr; + Elf64_Addr *where; + Elf_Addr addend; + uint32_t before32_1; + uint32_t before32; + uint64_t before64; + uint32_t* insn32p; + uint32_t imm20; + int error; + + switch (type) { + case ELF_RELOC_RELA: + rela = (const Elf_Rela *)data; + where = (Elf_Addr *)(relocbase + rela->r_offset); + insn32p = (uint32_t*)where; + addend = rela->r_addend; + rtype = ELF_R_TYPE(rela->r_info); + symidx = ELF_R_SYM(rela->r_info); + break; + default: + printf("%s:%d unknown reloc type %d\n", + __FUNCTION__, __LINE__, type); + return -1; + } + + switch (rtype) { + case R_RISCV_NONE: + break; + + case R_RISCV_64: + case R_RISCV_JUMP_SLOT: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return -1; + + val = addr; + before64 = *where; + if (*where != val) + *where = val; + + if (debug_kld) + printf("%p %c %-24s %016lx -> %016lx\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before64, *where); + break; + + case R_RISCV_RELATIVE: + val = relocbase + addend; + + before64 = *where; + if (*where != val) + *where = val; + + if (debug_kld) + printf("%p %c %-24s %016lx -> %016lx\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before64, *where); + break; + + case R_RISCV_JAL: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return -1; + + val = addr - (Elf_Addr)where; + if ((val <= -(1UL << 20) || (1UL << 20) <= val)) { + printf("kldload: huge offset against R_RISCV_JAL\n"); + return -1; + } + + before32 = *insn32p; + *insn32p = insert_imm(*insn32p, val, 20, 20, 31); + *insn32p = insert_imm(*insn32p, val, 10, 1, 21); + *insn32p = insert_imm(*insn32p, val, 11, 11, 20); + *insn32p = insert_imm(*insn32p, val, 19, 12, 12); + + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + case R_RISCV_CALL: + /* + * R_RISCV_CALL relocates 8-byte region that consists + * of the sequence of AUIPC and JALR. + */ + /* calculate and check the pc relative offset. */ + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return -1; + val = addr - (Elf_Addr)where; + if ((val <= -(1UL << 32) || (1UL << 32) <= val)) { + printf("kldload:%s: huge offset against R_RISCV_CALL\n"); + return -1; + } + + /* Relocate AUIPC. */ + before32 = insn32p[0]; + imm20 = calc_hi20_imm(val); + insn32p[0] = insert_imm(insn32p[0], imm20, 31, 12, 12); + + /* Relocate JALR. */ + before32_1 = insn32p[1]; + insn32p[1] = insert_imm(insn32p[1], val, 11, 0, 20); + + if (debug_kld) + printf("%p %c %-24s %08x %08x -> %08x %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, insn32p[0], + before32_1, insn32p[1]); + break; + + case R_RISCV_PCREL_HI20: + val = addr - (Elf_Addr)where; + insn32p = (uint32_t*)where; + before32 = *insn32p; + imm20 = calc_hi20_imm(val); + *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); + + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + case R_RISCV_PCREL_LO12_I: + val = addr - (Elf_Addr)where; + insn32p = (uint32_t*)where; + before32 = *insn32p; + *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); + + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + case R_RISCV_PCREL_LO12_S: + val = addr - (Elf_Addr)where; + insn32p = (uint32_t*)where; + before32 = *insn32p; + *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); + *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + case R_RISCV_HI20: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return -1; + + insn32p = (uint32_t*)where; + before32 = *insn32p; + imm20 = calc_hi20_imm(val); + *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); + + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + case R_RISCV_LO12_I: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return -1; + + val = addr; + insn32p = (uint32_t*)where; + before32 = *insn32p; + *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); + + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + case R_RISCV_LO12_S: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return -1; + + val = addr; + insn32p = (uint32_t*)where; + before32 = *insn32p; + *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); + *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); + + if (debug_kld) + printf("%p %c %-24s %08x -> %08x\n", + where, + (local? 'l': 'g'), + reloctype_to_str(rtype), + before32, *insn32p); + break; + + default: + printf("kldload: unexpected relocation type %ld\n", rtype); + return (-1); + } - panic("elf_reloc_internal"); + return (0); } int From owner-svn-src-head@freebsd.org Wed Jun 1 14:16:17 2016 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 DB00CB4F40D; Wed, 1 Jun 2016 14:16:17 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 9A2F21464; Wed, 1 Jun 2016 14:16:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51EGGlG081221; Wed, 1 Jun 2016 14:16:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51EGGpA081217; Wed, 1 Jun 2016 14:16:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606011416.u51EGGpA081217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 1 Jun 2016 14:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301127 - head/sys/dev/sfxge/common 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.22 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, 01 Jun 2016 14:16:18 -0000 Author: arybchik Date: Wed Jun 1 14:16:16 2016 New Revision: 301127 URL: https://svnweb.freebsd.org/changeset/base/301127 Log: sfxge(4): cleanup: remove unused variables in common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Jun 1 14:12:31 2016 (r301126) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Jun 1 14:16:16 2016 (r301127) @@ -349,7 +349,6 @@ efx_ev_qprefetch( __in efx_evq_t *eep, __in unsigned int count) { - efx_nic_t *enp = eep->ee_enp; unsigned int offset; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Jun 1 14:12:31 2016 (r301126) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Jun 1 14:16:16 2016 (r301127) @@ -534,8 +534,6 @@ efx_lic_v1v2_validate_key( __in uint32_t length ) { - const efx_lic_ops_t *elop = enp->en_elop; - efx_rc_t rc; uint16_t tlv_type; uint16_t tlv_length; @@ -658,7 +656,6 @@ efx_lic_v1v2_delete_key( __out uint32_t *deltap ) { - efx_rc_t rc; uint32_t move_start = offset + length; uint32_t move_length = end - move_start; @@ -1158,7 +1155,6 @@ efx_lic_v3_validate_key( ) { // Check key is a valid V3 key - efx_rc_t rc; uint8_t key_type; uint8_t key_length; @@ -1396,8 +1392,6 @@ efx_lic_check_support( efx_lic_fini( __in efx_nic_t *enp) { - const efx_lic_ops_t *elop = enp->en_elop; - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); @@ -1573,7 +1567,6 @@ efx_lic_find_key( ) { const efx_lic_ops_t *elop = enp->en_elop; - boolean_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); @@ -1599,8 +1592,6 @@ efx_lic_validate_key( { const efx_lic_ops_t *elop = enp->en_elop; boolean_t rc; - uint16_t tlv_type; - uint16_t tlv_length; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Jun 1 14:12:31 2016 (r301126) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Jun 1 14:16:16 2016 (r301127) @@ -795,7 +795,6 @@ efx_mcdi_get_proxy_handle( __in efx_mcdi_req_t *emrp, __out uint32_t *handlep) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_rc_t rc; /* From owner-svn-src-head@freebsd.org Wed Jun 1 14:57:54 2016 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 DAB26B60715; Wed, 1 Jun 2016 14:57:54 +0000 (UTC) (envelope-from avos@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 mx1.freebsd.org (Postfix) with ESMTPS id 821CE14C0; Wed, 1 Jun 2016 14:57:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Evren096174; Wed, 1 Jun 2016 14:57:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51EvrOI096173; Wed, 1 Jun 2016 14:57:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606011457.u51EvrOI096173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 1 Jun 2016 14:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301128 - head/sys/dev/urtwn 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.22 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, 01 Jun 2016 14:57:55 -0000 Author: avos Date: Wed Jun 1 14:57:53 2016 New Revision: 301128 URL: https://svnweb.freebsd.org/changeset/base/301128 Log: urtwn: fix non-ERP BSS detection in HOSTAP mode. Receive all beacons in HOSTAP mode; they will give more information about present non-ERP / legacy BSSs (used to choose protection mode). Tested with RTL8188CUS (HOSTAP, urtwn) + RTL8821AU (HOSTAP, 11b mode). Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 14:16:16 2016 (r301127) +++ head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 14:57:53 2016 (r301128) @@ -2627,10 +2627,11 @@ urtwn_newstate(struct ieee80211vap *vap, if (ic->ic_promisc == 0) { reg = urtwn_read_4(sc, R92C_RCR); - if (vap->iv_opmode != IEEE80211_M_HOSTAP) + if (vap->iv_opmode != IEEE80211_M_HOSTAP) { reg |= R92C_RCR_CBSSID_DATA; - if (vap->iv_opmode != IEEE80211_M_IBSS) - reg |= R92C_RCR_CBSSID_BCN; + if (vap->iv_opmode != IEEE80211_M_IBSS) + reg |= R92C_RCR_CBSSID_BCN; + } urtwn_write_4(sc, R92C_RCR, reg); } @@ -4723,7 +4724,8 @@ urtwn_scan_start(struct ieee80211com *ic URTWN_LOCK(sc); /* Receive beacons / probe responses from any BSSID. */ - if (ic->ic_opmode != IEEE80211_M_IBSS) + if (ic->ic_opmode != IEEE80211_M_IBSS && + ic->ic_opmode != IEEE80211_M_HOSTAP) urtwn_set_rx_bssid_all(sc, 1); /* Set gain for scanning. */ @@ -4738,7 +4740,9 @@ urtwn_scan_end(struct ieee80211com *ic) URTWN_LOCK(sc); /* Restore limitations. */ - if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_IBSS) + if (ic->ic_promisc == 0 && + ic->ic_opmode != IEEE80211_M_IBSS && + ic->ic_opmode != IEEE80211_M_HOSTAP) urtwn_set_rx_bssid_all(sc, 0); /* Set gain under link. */ @@ -4931,14 +4935,13 @@ urtwn_set_promisc(struct urtwn_softc *sc if (vap->iv_state == IEEE80211_S_RUN) { switch (vap->iv_opmode) { case IEEE80211_M_STA: - mask2 |= R92C_RCR_CBSSID_DATA; - /* FALLTHROUGH */ - case IEEE80211_M_HOSTAP: mask2 |= R92C_RCR_CBSSID_BCN; - break; + /* FALLTHROUGH */ case IEEE80211_M_IBSS: mask2 |= R92C_RCR_CBSSID_DATA; break; + case IEEE80211_M_HOSTAP: + break; default: device_printf(sc->sc_dev, "%s: undefined opmode %d\n", __func__, vap->iv_opmode); From owner-svn-src-head@freebsd.org Wed Jun 1 15:19:50 2016 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 83CA1B61058; Wed, 1 Jun 2016 15:19:50 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 51DCE150A; Wed, 1 Jun 2016 15:19:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51FJnid003712; Wed, 1 Jun 2016 15:19:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51FJn44003711; Wed, 1 Jun 2016 15:19:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606011519.u51FJn44003711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 1 Jun 2016 15:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301130 - head/sys/modules 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.22 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, 01 Jun 2016 15:19:50 -0000 Author: bdrewery Date: Wed Jun 1 15:19:49 2016 New Revision: 301130 URL: https://svnweb.freebsd.org/changeset/base/301130 Log: Enable filemon on all architectures. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jun 1 15:08:27 2016 (r301129) +++ head/sys/modules/Makefile Wed Jun 1 15:19:49 2016 (r301130) @@ -116,7 +116,7 @@ SUBDIR= \ fdc \ fdescfs \ ${_fe} \ - ${_filemon} \ + filemon \ firewire \ firmware \ fuse \ @@ -549,7 +549,6 @@ _ep= ep _et= et _exca= exca _fe= fe -_filemon= filemon .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ibcore= ibcore .endif From owner-svn-src-head@freebsd.org Wed Jun 1 15:39:12 2016 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 6E098B6171E; Wed, 1 Jun 2016 15:39:12 +0000 (UTC) (envelope-from smh@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 mx1.freebsd.org (Postfix) with ESMTPS id 374AA18EC; Wed, 1 Jun 2016 15:39:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51FdBiS011182; Wed, 1 Jun 2016 15:39:11 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51FdB8J011181; Wed, 1 Jun 2016 15:39:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201606011539.u51FdB8J011181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 1 Jun 2016 15:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301131 - head/usr.sbin/tzsetup 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.22 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, 01 Jun 2016 15:39:12 -0000 Author: smh Date: Wed Jun 1 15:39:11 2016 New Revision: 301131 URL: https://svnweb.freebsd.org/changeset/base/301131 Log: Fix tzsetup not installing /etc/localtime for UTC If tzsetup UTC is run then it successfully configured the system for UTC including installing /etc/localtime however if the user ran just tzsetup for interactive configuration and select UTC no /etc/localtime was installed which resulted in failures for utilities which require said file. Change set_zone_utc to call install_zoneinfo("UTC") to ensure that /etc/localtime is created for interactive UTC selection. Users who have previously run tzsetup in interactive mode and select UTC can install the missing /etc/localtime by running tzsetup -r. Also correct static miss-match for set_zone_utc. MFC after: 2 weeks Relnotes: Yes Sponsored by: Multiplay Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Jun 1 15:19:49 2016 (r301130) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jun 1 15:39:11 2016 (r301131) @@ -199,6 +199,7 @@ static char *chrootenv = NULL; static void usage(void); static int confirm_zone(const char *filename); static int continent_country_menu(dialogMenuItem *); +static int install_zoneinfo(const char *zoneinfo); static int install_zoneinfo_file(const char *zoneinfo_file); static int set_zone_multi(dialogMenuItem *); static int set_zone_whole_country(dialogMenuItem *); @@ -633,13 +634,13 @@ set_zone_menu(dialogMenuItem *dmi) return (DITEM_LEAVE_MENU); } -int +static int set_zone_utc(void) { if (!confirm_zone(NULL)) return (DITEM_FAILURE | DITEM_RECREATE); - return (install_zoneinfo_file(NULL)); + return (install_zoneinfo("UTC")); } static int From owner-svn-src-head@freebsd.org Wed Jun 1 15:44:48 2016 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 90620B61A6B for ; Wed, 1 Jun 2016 15:44:48 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4608910C8 for ; Wed, 1 Jun 2016 15:44:48 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x229.google.com with SMTP id o16so22182599ywd.2 for ; Wed, 01 Jun 2016 08:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=+2wbew8Lx3m1CbNAxIufeDVG//4QAK+6/Q478rJFh5g=; b=bgJpQZQl8YgfNEjS4Vt9JnlAiRDbxpc6xZ+nF324RseoEPrfYwKuepSlyVIWpz8UA1 UWiNv9sssZ1CLB7N1225MVrkpLosBS2cDeFv9qcvIT/9+lALAomZq1ZgHY43KygwdRJ4 hc5bxZowlxQe1nrc4/LuNZ6nNt7Ynua8iAgcL04SS5mUqTvvlSLqXE4K8NIzoV2DBsBm Pj7qxCp7HNHYNyLROhv0F5iq6WZQ+Gk6lG/4Klg5nUxraG0DGKx7NlSRKP+TKzN1tzoV FNvdctJm6yQNRpAatoPhUFnfk/TU5+Fwa81a/xTH9SNbtVIq/VpxbB274xadLGtdx815 Irhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=+2wbew8Lx3m1CbNAxIufeDVG//4QAK+6/Q478rJFh5g=; b=iskv19IJQ+5CjJ75AlqNDpb2YMlm7xR4H616BXioaBelhyUcJPKrgsgX0g8hYJioQ9 T7m7x9GMMl3/Tba3iCAFs3iYy64KZm0x+bUe907DKyXaiQMHKBmdhMSHZ4L9YvE87J0w /eTNqGrAKsO/K7dlnkQtH5yJollxXS3TaK5KqrW2jgwdmD9+xskOwJjP35FfHIonjF+m F81Rq2P/t3/XOrCGpZIPGdeQeCCpHCLoVEvij3kellv9TQUoAH2CCMl8rPJJ8+AAw8x/ ZYm19O9yhR14n/hOqvyNWWac/N9hJ5GbW2tGLbsCTZI0xVeBsc5EyGbkuD8IHqJeb0Oa 9NvQ== X-Gm-Message-State: ALyK8tLSUa95WKkcG2lraEmZbnbz6CFEiL/O7sbnspintnpjp1dibg/i6OusVDcK6wGnMAf3pT0ysz7Dsf3ItQ== MIME-Version: 1.0 X-Received: by 10.13.202.207 with SMTP id m198mr2985002ywd.140.1464795887366; Wed, 01 Jun 2016 08:44:47 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Wed, 1 Jun 2016 08:44:47 -0700 (PDT) In-Reply-To: <20160601183101.X1028@besplex.bde.org> References: <201605311905.u4VJ5geL053766@repo.freebsd.org> <20160601183101.X1028@besplex.bde.org> Date: Wed, 1 Jun 2016 17:44:47 +0200 Message-ID: Subject: Re: svn commit: r301071 - head/sys/sys From: Ed Schouten To: Bruce Evans Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 15:44:48 -0000 Hi Bruce, 2016-06-01 11:31 GMT+02:00 Bruce Evans : >> - This header file has always depended on pthread_t, pthread_attr_t, >> struct timespec, size_t and uid_t. Only as of POSIX 2008, these >> dependencies have been states explicitly. They should now be defined. > > Not always. POSIX didn't have pthreads or timespecs before about 1993. Sure. s/always/for a long time/ >> - In our implementation, struct sigevent::sigev_notify_attributes has >> type "void *" instead of "pthread_attr_t *". My guess is that this was >> done to prevent pulling in the pthread types, but this can easily be >> avoided by using the underlying structure types. > > Not easily, since the tags of the underlying struct types are in the > application namespace, at least up to POSIX 2001. Yeah, it's quite unfortunate that we use structure types starting with 'pthread'. They should have had leading underscores. But in my opinion that's not a problem specific to this change; it's a problem with our pthread implementation in general. >> +#include > > This gives the following pollution (which breaks almost everything since > includes this header: > - struct tag names pthread* > - struct member names state and mutex Yes. It would have made so much more sense if a header like would have defined all pthread types as __pthread_t, __pthread_mutex_t, etc. That way there would have been a way to expose just pthread_t and pthread_attr_t without pulling in the rest. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Wed Jun 1 15:47:20 2016 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 902BAB61BF1; Wed, 1 Jun 2016 15:47:20 +0000 (UTC) (envelope-from avos@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 mx1.freebsd.org (Postfix) with ESMTPS id 5A4A11443; Wed, 1 Jun 2016 15:47:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51FlJCR014700; Wed, 1 Jun 2016 15:47:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51FlJhT014699; Wed, 1 Jun 2016 15:47:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606011547.u51FlJhT014699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 1 Jun 2016 15:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301132 - head/sys/dev/urtwn 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.22 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, 01 Jun 2016 15:47:20 -0000 Author: avos Date: Wed Jun 1 15:47:19 2016 New Revision: 301132 URL: https://svnweb.freebsd.org/changeset/base/301132 Log: urtwn: unbreak CTS-to-self protection mode. Do not set HWRTSEN bit when CTS-to-self is used; CTS2SELF bit triggers CTS frame transmission by itself (and it does not work when HWRTSEN bit is set). Tested with: * RTL8188CUS, HOSTAP mode (11g) * RTL8188EU, STA mode (11g) Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 15:39:11 2016 (r301131) +++ head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 15:47:19 2016 (r301132) @@ -2956,8 +2956,7 @@ urtwn_tx_data(struct urtwn_softc *sc, st switch (ic->ic_protmode) { case IEEE80211_PROT_CTSONLY: txd->txdw4 |= htole32( - R92C_TXDW4_CTS2SELF | - R92C_TXDW4_HWRTSEN); + R92C_TXDW4_CTS2SELF); break; case IEEE80211_PROT_RTSCTS: txd->txdw4 |= htole32( @@ -3118,11 +3117,10 @@ urtwn_tx_raw(struct urtwn_softc *sc, str params->ibp_try0)); } if (params->ibp_flags & IEEE80211_BPF_RTS) - txd->txdw4 |= htole32(R92C_TXDW4_RTSEN); + txd->txdw4 |= htole32(R92C_TXDW4_RTSEN | R92C_TXDW4_HWRTSEN); if (params->ibp_flags & IEEE80211_BPF_CTS) txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF); if (txd->txdw4 & htole32(R92C_TXDW4_RTSEN | R92C_TXDW4_CTS2SELF)) { - txd->txdw4 |= htole32(R92C_TXDW4_HWRTSEN); txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, URTWN_RIDX_OFDM24)); } From owner-svn-src-head@freebsd.org Wed Jun 1 15:56:09 2016 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 0ED03B61F72; Wed, 1 Jun 2016 15:56:09 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id D04CE1CB4; Wed, 1 Jun 2016 15:56:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Fu7jo018302; Wed, 1 Jun 2016 15:56:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51Fu7tv018301; Wed, 1 Jun 2016 15:56:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606011556.u51Fu7tv018301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 15:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301133 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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, 01 Jun 2016 15:56:09 -0000 Author: adrian Date: Wed Jun 1 15:56:07 2016 New Revision: 301133 URL: https://svnweb.freebsd.org/changeset/base/301133 Log: [ath_hal] add azimuth timestamp payload marking for AR9380 and later chips. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c Wed Jun 1 15:47:19 2016 (r301132) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c Wed Jun 1 15:56:07 2016 (r301133) @@ -614,6 +614,7 @@ ar9300_set_11n_tx_desc( (key_ix != HAL_TXKEYIX_INVALID ? SM(key_ix, AR_dest_idx) : 0) | SM(type, AR_frame_type) | (flags & HAL_TXDESC_NOACK ? AR_no_ack : 0) + | (flags & HAL_TXDESC_HWTS ? AR_insert_ts : 0) | (flags & HAL_TXDESC_EXT_ONLY ? AR_ext_only : 0) | (flags & HAL_TXDESC_EXT_AND_CTL ? AR_ext_and_ctl : 0); From owner-svn-src-head@freebsd.org Wed Jun 1 16:09:57 2016 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 83A13B613D0; Wed, 1 Jun 2016 16:09:57 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id 5E6CB1791; Wed, 1 Jun 2016 16:09:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51G9uEC022256; Wed, 1 Jun 2016 16:09:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51G9ue8022253; Wed, 1 Jun 2016 16:09:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606011609.u51G9ue8022253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 1 Jun 2016 16:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301134 - head/lib/libthr/thread 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.22 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, 01 Jun 2016 16:09:57 -0000 Author: cem Date: Wed Jun 1 16:09:56 2016 New Revision: 301134 URL: https://svnweb.freebsd.org/changeset/base/301134 Log: libthr: Add vprintf variant of _thread_printf, formatted PANIC() No ABI change. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6672 Modified: head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_printf.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Wed Jun 1 15:56:07 2016 (r301133) +++ head/lib/libthr/thread/thr_exit.c Wed Jun 1 16:09:56 2016 (r301134) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #ifdef _PTHREAD_FORCED_UNWIND #include #endif +#include #include #include #include @@ -172,18 +173,31 @@ thread_unwind(void) #endif void -_thread_exit(const char *fname, int lineno, const char *msg) +_thread_exitf(const char *fname, int lineno, const char *fmt, ...) { + va_list ap; /* Write an error message to the standard error file descriptor: */ - _thread_printf(2, - "Fatal error '%s' at line %d in file %s (errno = %d)\n", - msg, lineno, fname, errno); + _thread_printf(STDERR_FILENO, "Fatal error '"); + + va_start(ap, fmt); + _thread_vprintf(STDERR_FILENO, fmt, ap); + va_end(ap); + + _thread_printf(STDERR_FILENO, "' at line %d in file %s (errno = %d)\n", + lineno, fname, errno); abort(); } void +_thread_exit(const char *fname, int lineno, const char *msg) +{ + + _thread_exitf(fname, lineno, "%s", msg); +} + +void _pthread_exit(void *status) { _pthread_exit_mask(status, NULL); Modified: head/lib/libthr/thread/thr_printf.c ============================================================================== --- head/lib/libthr/thread/thr_printf.c Wed Jun 1 15:56:07 2016 (r301133) +++ head/lib/libthr/thread/thr_printf.c Wed Jun 1 16:09:56 2016 (r301134) @@ -52,8 +52,17 @@ static void pstr(int fd, const char *s); void _thread_printf(int fd, const char *fmt, ...) { + va_list ap; + + va_start(ap, fmt); + _thread_vprintf(fd, fmt, ap); + va_end(ap); +} + +void +_thread_vprintf(int fd, const char *fmt, va_list ap) +{ static const char digits[16] = "0123456789abcdef"; - va_list ap; char buf[20]; char *s; unsigned long r, u; @@ -61,13 +70,12 @@ _thread_printf(int fd, const char *fmt, long d; int islong; - va_start(ap, fmt); while ((c = *fmt++)) { islong = 0; if (c == '%') { next: c = *fmt++; if (c == '\0') - goto out; + return; switch (c) { case 'c': pchar(fd, va_arg(ap, int)); @@ -111,8 +119,6 @@ next: c = *fmt++; } pchar(fd, c); } -out: - va_end(ap); } /* Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Wed Jun 1 15:56:07 2016 (r301133) +++ head/lib/libthr/thread/thr_private.h Wed Jun 1 16:09:56 2016 (r301134) @@ -86,7 +86,7 @@ TAILQ_HEAD(mutex_queue, pthread_mutex); /* * Kernel fatal error handler macro. */ -#define PANIC(string) _thread_exit(__FILE__,__LINE__,string) +#define PANIC(args...) _thread_exitf(__FILE__, __LINE__, ##args) /* Output debug messages like this: */ #define stdout_debug(args...) _thread_printf(STDOUT_FILENO, ##args) @@ -778,6 +778,8 @@ void _mutex_leave_robust(struct pthread void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; void _thread_exit(const char *, int, const char *) __hidden __dead2; +void _thread_exitf(const char *, int, const char *, ...) __hidden __dead2 + __printflike(3, 4); int _thr_ref_add(struct pthread *, struct pthread *, int) __hidden; void _thr_ref_delete(struct pthread *, struct pthread *) __hidden; void _thr_ref_delete_unlocked(struct pthread *, struct pthread *) __hidden; @@ -789,7 +791,8 @@ void _thr_stack_free(struct pthread_attr void _thr_free(struct pthread *, struct pthread *) __hidden; void _thr_gc(struct pthread *) __hidden; void _thread_cleanupspecific(void) __hidden; -void _thread_printf(int, const char *, ...) __hidden; +void _thread_printf(int, const char *, ...) __hidden __printflike(2, 3); +void _thread_vprintf(int, const char *, va_list) __hidden; void _thr_spinlock_init(void) __hidden; void _thr_cancel_enter(struct pthread *) __hidden; void _thr_cancel_enter2(struct pthread *, int) __hidden; From owner-svn-src-head@freebsd.org Wed Jun 1 16:11:10 2016 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 8AC49B614E6; Wed, 1 Jun 2016 16:11:10 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id 5AD2019E7; Wed, 1 Jun 2016 16:11:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51GB9hn024920; Wed, 1 Jun 2016 16:11:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51GB9uY024919; Wed, 1 Jun 2016 16:11:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606011611.u51GB9uY024919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 1 Jun 2016 16:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301135 - head/lib/libthr/thread 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.22 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, 01 Jun 2016 16:11:10 -0000 Author: cem Date: Wed Jun 1 16:11:09 2016 New Revision: 301135 URL: https://svnweb.freebsd.org/changeset/base/301135 Log: libthr: _thread_vprintf: Enhance support for %p, %#x No functional change. No ABI change. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6672 Modified: head/lib/libthr/thread/thr_printf.c Modified: head/lib/libthr/thread/thr_printf.c ============================================================================== --- head/lib/libthr/thread/thr_printf.c Wed Jun 1 16:09:56 2016 (r301134) +++ head/lib/libthr/thread/thr_printf.c Wed Jun 1 16:11:09 2016 (r301135) @@ -68,15 +68,19 @@ _thread_vprintf(int fd, const char *fmt, unsigned long r, u; int c; long d; - int islong; + int islong, isalt; while ((c = *fmt++)) { + isalt = 0; islong = 0; if (c == '%') { next: c = *fmt++; if (c == '\0') return; switch (c) { + case '#': + isalt = 1; + goto next; case 'c': pchar(fd, va_arg(ap, int)); continue; @@ -87,10 +91,13 @@ next: c = *fmt++; islong = 1; goto next; case 'p': + pstr(fd, "0x"); islong = 1; case 'd': case 'u': case 'x': + if (c == 'x' && isalt) + pstr(fd, "0x"); r = ((c == 'u') || (c == 'd')) ? 10 : 16; if (c == 'd') { if (islong) From owner-svn-src-head@freebsd.org Wed Jun 1 16:12:28 2016 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 12A98B61555; Wed, 1 Jun 2016 16:12:28 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id E18E91D24; Wed, 1 Jun 2016 16:12:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51GCRvo025646; Wed, 1 Jun 2016 16:12:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51GCQAP025643; Wed, 1 Jun 2016 16:12:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606011612.u51GCQAP025643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 1 Jun 2016 16:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301136 - head/lib/libthr/thread 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.22 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, 01 Jun 2016 16:12:28 -0000 Author: cem Date: Wed Jun 1 16:12:26 2016 New Revision: 301136 URL: https://svnweb.freebsd.org/changeset/base/301136 Log: libthr: Use formatted PANIC() No functional change, although _thread_printf() may be slightly less functional or render some values differently from libc snprintf(3). No ABI change. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6672 Modified: head/lib/libthr/thread/thr_cond.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Wed Jun 1 16:11:09 2016 (r301135) +++ head/lib/libthr/thread/thr_cond.c Wed Jun 1 16:12:26 2016 (r301136) @@ -258,7 +258,7 @@ cond_wait_user(struct pthread_cond *cvp, curthread = _get_curthread(); if (curthread->wchan != NULL) - PANIC("thread was already on queue."); + PANIC("thread %p was already on queue.", curthread); if (cancel) _thr_testcancel(curthread); Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Wed Jun 1 16:11:09 2016 (r301135) +++ head/lib/libthr/thread/thr_exit.c Wed Jun 1 16:12:26 2016 (r301136) @@ -209,13 +209,10 @@ _pthread_exit_mask(void *status, sigset_ struct pthread *curthread = _get_curthread(); /* Check if this thread is already in the process of exiting: */ - if (curthread->cancelling) { - char msg[128]; - snprintf(msg, sizeof(msg), "Thread %p has called " + if (curthread->cancelling) + PANIC("Thread %p has called " "pthread_exit() from a destructor. POSIX 1003.1 " "1996 s16.2.5.2 does not allow this!", curthread); - PANIC(msg); - } /* Flag this thread as exiting. */ curthread->cancelling = 1; @@ -312,7 +309,7 @@ exit_thread(void) #if defined(_PTHREADS_INVARIANTS) if (THR_IN_CRITICAL(curthread)) - PANIC("thread exits with resources held!"); + PANIC("thread %p exits with resources held!", curthread); #endif /* * Kernel will do wakeup at the address, so joiner thread Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Wed Jun 1 16:11:09 2016 (r301135) +++ head/lib/libthr/thread/thr_mutex.c Wed Jun 1 16:12:26 2016 (r301136) @@ -135,13 +135,9 @@ mutex_assert_is_owned(struct pthread_mut { #if defined(_PTHREADS_INVARIANTS) - if (__predict_false(m->m_qe.tqe_prev == NULL)) { - char msg[128]; - snprintf(msg, sizeof(msg), - "mutex %p own %#x is not on list %p %p", + if (__predict_false(m->m_qe.tqe_prev == NULL)) + PANIC("mutex %p own %#x is not on list %p %p", m, m->m_lock.m_owner, m->m_qe.tqe_prev, m->m_qe.tqe_next); - PANIC(msg); - } #endif } @@ -152,27 +148,20 @@ mutex_assert_not_owned(struct pthread *c #if defined(_PTHREADS_INVARIANTS) if (__predict_false(m->m_qe.tqe_prev != NULL || - m->m_qe.tqe_next != NULL)) { - char msg[128]; - snprintf(msg, sizeof(msg), - "mutex %p own %#x is on list %p %p", + m->m_qe.tqe_next != NULL)) + PANIC("mutex %p own %#x is on list %p %p", m, m->m_lock.m_owner, m->m_qe.tqe_prev, m->m_qe.tqe_next); - PANIC(msg); - } if (__predict_false(is_robust_mutex(m) && (m->m_lock.m_rb_lnk != 0 || m->m_rb_prev != NULL || (is_pshared_mutex(m) && curthread->robust_list == (uintptr_t)&m->m_lock) || (!is_pshared_mutex(m) && curthread->priv_robust_list == - (uintptr_t)&m->m_lock)))) { - char msg[128]; - snprintf(msg, sizeof(msg), + (uintptr_t)&m->m_lock)))) + PANIC( "mutex %p own %#x is on robust linkage %p %p head %p phead %p", m, m->m_lock.m_owner, (void *)m->m_lock.m_rb_lnk, m->m_rb_prev, (void *)curthread->robust_list, (void *)curthread->priv_robust_list); - PANIC(msg); - } #endif } From owner-svn-src-head@freebsd.org Wed Jun 1 16:22:44 2016 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 EF0C2B6187A; Wed, 1 Jun 2016 16:22:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F53E152A; Wed, 1 Jun 2016 16:22:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u51GMd7a077506 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 1 Jun 2016 19:22:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u51GMd7a077506 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u51GMcGv077505; Wed, 1 Jun 2016 19:22:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 1 Jun 2016 19:22:38 +0300 From: Konstantin Belousov To: Ed Schouten Cc: Bruce Evans , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301071 - head/sys/sys Message-ID: <20160601162238.GM38613@kib.kiev.ua> References: <201605311905.u4VJ5geL053766@repo.freebsd.org> <20160601183101.X1028@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 16:22:45 -0000 On Wed, Jun 01, 2016 at 05:44:47PM +0200, Ed Schouten wrote: > Hi Bruce, > > 2016-06-01 11:31 GMT+02:00 Bruce Evans : > >> - This header file has always depended on pthread_t, pthread_attr_t, > >> struct timespec, size_t and uid_t. Only as of POSIX 2008, these > >> dependencies have been states explicitly. They should now be defined. > > > > Not always. POSIX didn't have pthreads or timespecs before about 1993. > > Sure. s/always/for a long time/ > > >> - In our implementation, struct sigevent::sigev_notify_attributes has > >> type "void *" instead of "pthread_attr_t *". My guess is that this was > >> done to prevent pulling in the pthread types, but this can easily be > >> avoided by using the underlying structure types. > > > > Not easily, since the tags of the underlying struct types are in the > > application namespace, at least up to POSIX 2001. > > Yeah, it's quite unfortunate that we use structure types starting with > 'pthread'. They should have had leading underscores. But in my opinion > that's not a problem specific to this change; it's a problem with our > pthread implementation in general. > > >> +#include > > > > This gives the following pollution (which breaks almost everything since > > includes this header: > > - struct tag names pthread* > > - struct member names state and mutex > > Yes. It would have made so much more sense if a header like > would have defined all pthread types as __pthread_t, > __pthread_mutex_t, etc. That way there would have been a way to expose > just pthread_t and pthread_attr_t without pulling in the rest. No, it wouldn't. Replace the typedefs with the forward-struct names by the void *. The only other change would be the libthr, where some casts might be needed. Use void * directly in signal.h if possible. From owner-svn-src-head@freebsd.org Wed Jun 1 16:30:06 2016 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 861FBB619A6; Wed, 1 Jun 2016 16:30:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6356119A7; Wed, 1 Jun 2016 16:30:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1AE8BB94C; Wed, 1 Jun 2016 12:30:05 -0400 (EDT) From: John Baldwin To: Julian Elischer Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299393 - in head: . share/mk Date: Wed, 01 Jun 2016 09:28:58 -0700 Message-ID: <1635327.lWf6hTW5HF@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201605102232.u4AMWNvp000287@repo.freebsd.org> <6335113.N7gIF2Maer@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 01 Jun 2016 12:30:05 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 16:30:06 -0000 On Monday, May 30, 2016 01:21:50 PM Julian Elischer wrote: > On 27/05/2016 2:28 AM, John Baldwin wrote: > > On Wednesday, May 25, 2016 03:27:07 PM Hans Petter Selasky wrote: > >> On 05/11/16 00:32, John Baldwin wrote: > >>> Author: jhb > >>> Date: Tue May 10 22:32:23 2016 > >>> New Revision: 299393 > >>> URL: https://svnweb.freebsd.org/changeset/base/299393 > >>> > >>> Log: > >>> Change the default installation directory for modules to /boot/modules. > >>> > >>> Kernel installs always override KMODDIR when installing modules, so > >>> this default setting is only used for standalone module builds. Many > >>> out-of-tree modules manually override KMODDIR already to avoid placing > >>> modules in /boot/kernel. This now makes that behavior the default. > >>> > >>> Discussed on: arch@ > >>> Reviewed by: imp > >>> Relnotes: yes > >>> > >> Just a small nit: > >> > >> There is a comment in bsd.own.mk which needs updating too: > >> > >>> # > >>> # KMODDIR Base path for loadable kernel modules > >>> # (see kld(4)). [/boot/kernel] > > Oops, thanks. Fixed. > > the comment should also mention it does not cover in-tree modules. Actually, it does. If you cd /sys/modules/foo and run make install it installs to this path. Only buildkernel overrides this explicitly when installing the modules built together with a kernel. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Jun 1 16:45:09 2016 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 4C914B61DE8; Wed, 1 Jun 2016 16:45:09 +0000 (UTC) (envelope-from gjb@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 mx1.freebsd.org (Postfix) with ESMTPS id 1BB2A1759; Wed, 1 Jun 2016 16:45:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Gj8Ow036954; Wed, 1 Jun 2016 16:45:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51Gj8RT036952; Wed, 1 Jun 2016 16:45:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606011645.u51Gj8RT036952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jun 2016 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301137 - in head: etc etc/ppp usr.sbin/ppp 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.22 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, 01 Jun 2016 16:45:09 -0000 Author: gjb Date: Wed Jun 1 16:45:08 2016 New Revision: 301137 URL: https://svnweb.freebsd.org/changeset/base/301137 Log: Revert r289096: Files listed in 'CONFS' are not properly included in new installations (missing from base.txz), for reasons I still do not fully understand. This reverts the change excluding /etc/ppp/ppp.conf from a new installation. /etc/dma/dma.conf is also affected, but requires a different solution, still being investigated. Reported by: Ben Woods Sponsored by: The FreeBSD Foundation Added: head/etc/ppp/ - copied from r289095, head/etc/ppp/ Deleted: head/usr.sbin/ppp/ppp.conf Modified: head/etc/Makefile head/usr.sbin/ppp/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jun 1 16:12:26 2016 (r301136) +++ head/etc/Makefile Wed Jun 1 16:45:08 2016 (r301137) @@ -305,6 +305,10 @@ distribution: .endif cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${MTREE} ${DESTDIR}/etc/mtree +.if ${MK_PPP} != "no" + cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ + ${PPPCNF} ${DESTDIR}/etc/ppp +.endif .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail Modified: head/usr.sbin/ppp/Makefile ============================================================================== --- head/usr.sbin/ppp/Makefile Wed Jun 1 16:12:26 2016 (r301136) +++ head/usr.sbin/ppp/Makefile Wed Jun 1 16:45:08 2016 (r301137) @@ -21,9 +21,6 @@ PPP_NO_PAM= PPP_NO_RADIUS= PPP_NO_SUID= .endif -CONFS= ppp.conf -CONFSDIR= ${CONFDIR}/ppp -CONFSMODE= 600 .if ${MK_ATM} == "no" PPP_NO_ATM= From owner-svn-src-head@freebsd.org Wed Jun 1 16:53:03 2016 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 B7020B61FF6; Wed, 1 Jun 2016 16:53:03 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 84C241CFD; Wed, 1 Jun 2016 16:53:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Gr21q040665; Wed, 1 Jun 2016 16:53:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51Gr2IP040664; Wed, 1 Jun 2016 16:53:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606011653.u51Gr2IP040664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 1 Jun 2016 16:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301138 - head/usr.bin/sed 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.22 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, 01 Jun 2016 16:53:03 -0000 Author: pfg Date: Wed Jun 1 16:53:02 2016 New Revision: 301138 URL: https://svnweb.freebsd.org/changeset/base/301138 Log: sed(1): Fix a mismatch and sync with the OpenBSD's commit. This was causing some strange behaviour. Reported by: olivier Obtained from: OpenBSD (CVS rev. 1.28) Modified: head/usr.bin/sed/process.c Modified: head/usr.bin/sed/process.c ============================================================================== --- head/usr.bin/sed/process.c Wed Jun 1 16:45:08 2016 (r301137) +++ head/usr.bin/sed/process.c Wed Jun 1 16:53:02 2016 (r301138) @@ -394,7 +394,7 @@ substitute(struct s_command *cp) linenum, fname, cp->u.s->maxbref); } } - if (!regexec_e(re, s, 0, 0, 0, psl)) + if (!regexec_e(re, ps, 0, 0, 0, psl)) return (0); SS.len = 0; /* Clean substitute space. */ @@ -404,7 +404,7 @@ substitute(struct s_command *cp) do { /* Copy the leading retained string. */ - if (n <= 1 && match[0].rm_so - le) + if (n <= 1 && (match[0].rm_so > le)) cspace(&SS, s, match[0].rm_so - le, APPEND); /* Skip zero-length matches right after other matches. */ @@ -425,8 +425,8 @@ substitute(struct s_command *cp) } /* Move past this match. */ - s += (match[0].rm_eo - le); - slen -= (match[0].rm_eo - le); + s = ps + match[0].rm_eo; + slen = psl - match[0].rm_eo; le = match[0].rm_eo; /* @@ -446,7 +446,8 @@ substitute(struct s_command *cp) } else lastempty = 0; - } while (n >= 0 && slen >= 0 && regexec_e(re, ps, 0, 0, le, psl)); + } while (n >= 0 && slen >= 0 && + regexec_e(re, ps, REG_NOTBOL, 0, le, psl)); /* Did not find the requested number of matches. */ if (n > 1) From owner-svn-src-head@freebsd.org Wed Jun 1 16:56:30 2016 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 31977B6109E; Wed, 1 Jun 2016 16:56:30 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 0429F1EED; Wed, 1 Jun 2016 16:56:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51GuTLu040845; Wed, 1 Jun 2016 16:56:29 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51GuTlZ040844; Wed, 1 Jun 2016 16:56:29 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606011656.u51GuTlZ040844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 1 Jun 2016 16:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301139 - head/bin/sh 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.22 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, 01 Jun 2016 16:56:30 -0000 Author: truckman Date: Wed Jun 1 16:56:29 2016 New Revision: 301139 URL: https://svnweb.freebsd.org/changeset/base/301139 Log: The (i < PROMPTLEN - 1) test added by r300442 in the code for the default case of \c in the prompt format string is a no-op. We already passed this test at the top of the loop, and i has not yet been incremented in this path. Change this test to (i < PROMPTLEN - 2). Reported by: Coverity CID: 1008328 Reviewed by: cem MFC after: 1 week Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Jun 1 16:53:02 2016 (r301138) +++ head/bin/sh/parser.c Wed Jun 1 16:56:29 2016 (r301139) @@ -2063,7 +2063,7 @@ getprompt(void *unused __unused) */ default: ps[i] = '\\'; - if (i < PROMPTLEN - 1) + if (i < PROMPTLEN - 2) ps[++i] = *fmt; break; } From owner-svn-src-head@freebsd.org Wed Jun 1 16:57:50 2016 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 8E993B6111E; Wed, 1 Jun 2016 16:57:50 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58AE5109F; Wed, 1 Jun 2016 16:57:50 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u51Gvf1J035954; Wed, 1 Jun 2016 09:57:45 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201606011657.u51Gvf1J035954@gw.catspoiler.org> Date: Wed, 1 Jun 2016 09:57:41 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r301139 - head/bin/sh To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201606011656.u51GuTlZ040844@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 16:57:50 -0000 On 1 Jun, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Wed Jun 1 16:56:29 2016 > New Revision: 301139 > URL: https://svnweb.freebsd.org/changeset/base/301139 > > Log: > The (i < PROMPTLEN - 1) test added by r300442 in the code for the default > case of \c in the prompt format string is a no-op. We already passed > this test at the top of the loop, and i has not yet been incremented in > this path. Change this test to (i < PROMPTLEN - 2). > > Reported by: Coverity > CID: 1008328 > Reviewed by: cem > MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6552 From owner-svn-src-head@freebsd.org Wed Jun 1 18:32:21 2016 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 D799FB61FBB; Wed, 1 Jun 2016 18:32:21 +0000 (UTC) (envelope-from mjg@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 mx1.freebsd.org (Postfix) with ESMTPS id AD49F129D; Wed, 1 Jun 2016 18:32:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51IWKxb078871; Wed, 1 Jun 2016 18:32:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51IWK0Y078864; Wed, 1 Jun 2016 18:32:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201606011832.u51IWK0Y078864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 1 Jun 2016 18:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301157 - in head/sys: kern sys 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.22 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, 01 Jun 2016 18:32:22 -0000 Author: mjg Date: Wed Jun 1 18:32:20 2016 New Revision: 301157 URL: https://svnweb.freebsd.org/changeset/base/301157 Log: Microoptimize locking primitives by avoiding unnecessary atomic ops. Inline version of primitives do an atomic op and if it fails they fallback to actual primitives, which immediately retry the atomic op. The obvious optimisation is to check if the lock is free and only then proceed to do an atomic op. Reviewed by: jhb, vangyzen Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/mutex.h head/sys/sys/rwlock.h head/sys/sys/sx.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/kern/kern_lock.c Wed Jun 1 18:32:20 2016 (r301157) @@ -787,8 +787,10 @@ __lockmgr_args(struct lock *lk, u_int fl break; } - while (!atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, - tid)) { + for (;;) { + if (lk->lk_lock == LK_UNLOCKED && + atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) + break; #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -1124,7 +1126,11 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, iwmesg, file, line); } - while (!atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) { + for (;;) { + if (lk->lk_lock == LK_UNLOCKED && + atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) + break; + #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/kern/kern_mutex.c Wed Jun 1 18:32:20 2016 (r301157) @@ -419,7 +419,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, all_time -= lockstat_nsecs(&m->lock_object); #endif - while (!_mtx_obtain_lock(m, tid)) { + for (;;) { + if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) + break; #ifdef KDTRACE_HOOKS spin_cnt++; #endif @@ -602,8 +604,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t #ifdef KDTRACE_HOOKS spin_time -= lockstat_nsecs(&m->lock_object); #endif - while (!_mtx_obtain_lock(m, tid)) { - + for (;;) { + if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) + break; /* Give interrupts a chance while we spin. */ spinlock_exit(); while (m->mtx_lock != MTX_UNOWNED) { @@ -675,7 +678,9 @@ retry: m->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); - while (!_mtx_obtain_lock(m, tid)) { + for (;;) { + if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) + break; if (m->mtx_lock == tid) { m->mtx_recurse++; break; Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/kern/kern_rwlock.c Wed Jun 1 18:32:20 2016 (r301157) @@ -771,7 +771,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u all_time -= lockstat_nsecs(&rw->lock_object); state = rw->rw_lock; #endif - while (!_rw_write_lock(rw, tid)) { + for (;;) { + if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid)) + break; #ifdef KDTRACE_HOOKS spin_cnt++; #endif Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/kern/kern_sx.c Wed Jun 1 18:32:20 2016 (r301157) @@ -544,7 +544,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t all_time -= lockstat_nsecs(&sx->lock_object); state = sx->sx_lock; #endif - while (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) { + for (;;) { + if (sx->sx_lock == SX_LOCK_UNLOCKED && + atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) + break; #ifdef KDTRACE_HOOKS spin_cnt++; #endif Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/sys/mutex.h Wed Jun 1 18:32:20 2016 (r301157) @@ -185,7 +185,7 @@ void thread_lock_flags_(struct thread *, #define __mtx_lock(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ - if (!_mtx_obtain_lock((mp), _tid)) \ + if (((mp)->mtx_lock != MTX_UNOWNED || !_mtx_obtain_lock((mp), _tid)))\ _mtx_lock_sleep((mp), _tid, (opts), (file), (line)); \ else \ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, \ @@ -203,7 +203,7 @@ void thread_lock_flags_(struct thread *, uintptr_t _tid = (uintptr_t)(tid); \ \ spinlock_enter(); \ - if (!_mtx_obtain_lock((mp), _tid)) { \ + if (((mp)->mtx_lock != MTX_UNOWNED || !_mtx_obtain_lock((mp), _tid))) {\ if ((mp)->mtx_lock == _tid) \ (mp)->mtx_recurse++; \ else \ @@ -232,7 +232,7 @@ void thread_lock_flags_(struct thread *, \ if ((mp)->mtx_recurse == 0) \ LOCKSTAT_PROFILE_RELEASE_LOCK(adaptive__release, mp); \ - if (!_mtx_release_lock((mp), _tid)) \ + if ((mp)->mtx_lock != _tid || !_mtx_release_lock((mp), _tid)) \ _mtx_unlock_sleep((mp), (opts), (file), (line)); \ } while (0) Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/sys/rwlock.h Wed Jun 1 18:32:20 2016 (r301157) @@ -96,7 +96,7 @@ #define __rw_wlock(rw, tid, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ - if (!_rw_write_lock((rw), _tid)) \ + if ((rw)->rw_lock != RW_UNLOCKED || !_rw_write_lock((rw), _tid))\ _rw_wlock_hard((rw), _tid, (file), (line)); \ else \ LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, \ @@ -112,7 +112,7 @@ else { \ LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, \ LOCKSTAT_WRITER); \ - if (!_rw_write_unlock((rw), _tid)) \ + if ((rw)->rw_lock != _tid || !_rw_write_unlock((rw), _tid))\ _rw_wunlock_hard((rw), _tid, (file), (line)); \ } \ } while (0) Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Wed Jun 1 17:57:56 2016 (r301156) +++ head/sys/sys/sx.h Wed Jun 1 18:32:20 2016 (r301157) @@ -150,7 +150,8 @@ __sx_xlock(struct sx *sx, struct thread uintptr_t tid = (uintptr_t)td; int error = 0; - if (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) + if (sx->sx_lock != SX_LOCK_UNLOCKED || + !atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) error = _sx_xlock_hard(sx, tid, opts, file, line); else LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, @@ -168,7 +169,8 @@ __sx_xunlock(struct sx *sx, struct threa if (sx->sx_recurse == 0) LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_WRITER); - if (!atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) + if (sx->sx_lock != tid || + !atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) _sx_xunlock_hard(sx, tid, file, line); } From owner-svn-src-head@freebsd.org Wed Jun 1 18:46:55 2016 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 32361B61460; Wed, 1 Jun 2016 18:46:55 +0000 (UTC) (envelope-from np@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 mx1.freebsd.org (Postfix) with ESMTPS id 04F7F1B3A; Wed, 1 Jun 2016 18:46:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51IksZK082634; Wed, 1 Jun 2016 18:46:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51IksQT082633; Wed, 1 Jun 2016 18:46:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606011846.u51IksQT082633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 1 Jun 2016 18:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301158 - head/sys/dev/cxgbe/iw_cxgbe 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.22 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, 01 Jun 2016 18:46:55 -0000 Author: np Date: Wed Jun 1 18:46:54 2016 New Revision: 301158 URL: https://svnweb.freebsd.org/changeset/base/301158 Log: iw_cxgbe: Fix panic that occurs when c4iw_ev_handler tries to acquire comp_handler_lock but c4iw_destroy_cq has already freed the CQ memory (which is where the lock resides). Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/ev.c Modified: head/sys/dev/cxgbe/iw_cxgbe/ev.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/ev.c Wed Jun 1 18:32:20 2016 (r301157) +++ head/sys/dev/cxgbe/iw_cxgbe/ev.c Wed Jun 1 18:46:54 2016 (r301158) @@ -194,13 +194,22 @@ int c4iw_ev_handler(struct sge_iq *iq, c struct c4iw_cq *chp; unsigned long flag; + spin_lock_irqsave(&dev->lock, flag); chp = get_chp(dev, qid); if (chp) { + atomic_inc(&chp->refcnt); + spin_unlock_irqrestore(&dev->lock, flag); + spin_lock_irqsave(&chp->comp_handler_lock, flag); (*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context); spin_unlock_irqrestore(&chp->comp_handler_lock, flag); - } else + if (atomic_dec_and_test(&chp->refcnt)) + wake_up(&chp->wait); + } else { CTR2(KTR_IW_CXGBE, "%s unknown cqid 0x%x", __func__, qid); + spin_unlock_irqrestore(&dev->lock, flag); + } + return 0; } #endif From owner-svn-src-head@freebsd.org Wed Jun 1 19:35:22 2016 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 42636B60152; Wed, 1 Jun 2016 19:35:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06182170A; Wed, 1 Jun 2016 19:35:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22b.google.com with SMTP id i127so31185568ita.1; Wed, 01 Jun 2016 12:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ZaBwXLIzVnz6wuSXYMF3oZbroSWOOReT2bneSYZcrwo=; b=zcdXn/cUTKoJVlxcB+3DVEMTqSC6CNCNe7wGXosQgqpYSbE8v+elkgFlyG1vw/83it I0HgYWTKtrtRnMJ2Ppr5eB2gfNqV1j5uPzVaetvFJq374NHQqgToPAHSLCbqc3nFZURC EiXmM/9cR5gjp5RrGv0V2O/mLW++c3j4OXpAhflhpWVBCPslj+4OlDfbL2jpdR+bqZ7g lhBYJSFp95jj8jSQQG2EO6AQ7hbddjT1dhFylcRO/NElYD155b2z0sbnUPaGhb+DbRPX 6ChrONq0T73ez6d32h224ga+OltMQZWBKfplPEoJB2953xSMTOnSBypXgLe/ugMuN9uT ov4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ZaBwXLIzVnz6wuSXYMF3oZbroSWOOReT2bneSYZcrwo=; b=jPapgxRQhs+gaDDZD0khBvp53gRI/WAqtHCktS/51Yz5oa+LfBJRSxwvpTtlNmRtqH Px9b3CQo4LSCkI93dIB9CAysO4Q05c+rJdf3rdVKJoGzLb2/hjCh/IoY8Uzz/U6rYPej ZjKJxtR7mrFlbtTtGm6fRRL0VOkAWQ8hFxjO9EvnW8tZ46LFpwEobAZ1SXY2tR4jQHTT 2atnwYVrF3jMvFddlZFsYuO3N86Qk0d/yiz20tW2RzA9t5eKD5cZwhV/YGc3yTQZx8Nr i+jExZqbLqPXVagRTn37LEn4uGt3u8d32RhhysGuNNZbSNPx3JCy3qQNH43ffgm8jQ/l uvrA== X-Gm-Message-State: ALyK8tLpW5lIOZbuF4Pbi7P3pWUCLP28HVle0/UlObdu/zzGVQsDxgeh2SjMXI6DGKO5HdKV5UIG/yjZK2ECOg== MIME-Version: 1.0 X-Received: by 10.36.137.87 with SMTP id s84mr7947669itd.93.1464809721319; Wed, 01 Jun 2016 12:35:21 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Wed, 1 Jun 2016 12:35:21 -0700 (PDT) In-Reply-To: <201606011457.u51EvrOI096173@repo.freebsd.org> References: <201606011457.u51EvrOI096173@repo.freebsd.org> Date: Wed, 1 Jun 2016 12:35:21 -0700 Message-ID: Subject: Re: svn commit: r301128 - head/sys/dev/urtwn From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 19:35:22 -0000 hi! Woo! Does this also help with IBSS? (Since we need to see all beacons so we can do adhoc joins.) -adrian On 1 June 2016 at 07:57, Andriy Voskoboinyk wrote: > Author: avos > Date: Wed Jun 1 14:57:53 2016 > New Revision: 301128 > URL: https://svnweb.freebsd.org/changeset/base/301128 > > Log: > urtwn: fix non-ERP BSS detection in HOSTAP mode. > > Receive all beacons in HOSTAP mode; they will give more information about > present non-ERP / legacy BSSs (used to choose protection mode). > > Tested with RTL8188CUS (HOSTAP, urtwn) + RTL8821AU (HOSTAP, 11b mode). > > Modified: > head/sys/dev/urtwn/if_urtwn.c > > Modified: head/sys/dev/urtwn/if_urtwn.c > ============================================================================== > --- head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 14:16:16 2016 (r301127) > +++ head/sys/dev/urtwn/if_urtwn.c Wed Jun 1 14:57:53 2016 (r301128) > @@ -2627,10 +2627,11 @@ urtwn_newstate(struct ieee80211vap *vap, > if (ic->ic_promisc == 0) { > reg = urtwn_read_4(sc, R92C_RCR); > > - if (vap->iv_opmode != IEEE80211_M_HOSTAP) > + if (vap->iv_opmode != IEEE80211_M_HOSTAP) { > reg |= R92C_RCR_CBSSID_DATA; > - if (vap->iv_opmode != IEEE80211_M_IBSS) > - reg |= R92C_RCR_CBSSID_BCN; > + if (vap->iv_opmode != IEEE80211_M_IBSS) > + reg |= R92C_RCR_CBSSID_BCN; > + } > > urtwn_write_4(sc, R92C_RCR, reg); > } > @@ -4723,7 +4724,8 @@ urtwn_scan_start(struct ieee80211com *ic > > URTWN_LOCK(sc); > /* Receive beacons / probe responses from any BSSID. */ > - if (ic->ic_opmode != IEEE80211_M_IBSS) > + if (ic->ic_opmode != IEEE80211_M_IBSS && > + ic->ic_opmode != IEEE80211_M_HOSTAP) > urtwn_set_rx_bssid_all(sc, 1); > > /* Set gain for scanning. */ > @@ -4738,7 +4740,9 @@ urtwn_scan_end(struct ieee80211com *ic) > > URTWN_LOCK(sc); > /* Restore limitations. */ > - if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_IBSS) > + if (ic->ic_promisc == 0 && > + ic->ic_opmode != IEEE80211_M_IBSS && > + ic->ic_opmode != IEEE80211_M_HOSTAP) > urtwn_set_rx_bssid_all(sc, 0); > > /* Set gain under link. */ > @@ -4931,14 +4935,13 @@ urtwn_set_promisc(struct urtwn_softc *sc > if (vap->iv_state == IEEE80211_S_RUN) { > switch (vap->iv_opmode) { > case IEEE80211_M_STA: > - mask2 |= R92C_RCR_CBSSID_DATA; > - /* FALLTHROUGH */ > - case IEEE80211_M_HOSTAP: > mask2 |= R92C_RCR_CBSSID_BCN; > - break; > + /* FALLTHROUGH */ > case IEEE80211_M_IBSS: > mask2 |= R92C_RCR_CBSSID_DATA; > break; > + case IEEE80211_M_HOSTAP: > + break; > default: > device_printf(sc->sc_dev, "%s: undefined opmode %d\n", > __func__, vap->iv_opmode); > From owner-svn-src-head@freebsd.org Wed Jun 1 19:35:32 2016 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 B133FB60192; Wed, 1 Jun 2016 19:35:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A54F188D; Wed, 1 Jun 2016 19:35:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x230.google.com with SMTP id e62so102739173ita.1; Wed, 01 Jun 2016 12:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=sPg9mv3WlmeWEPOlikTJrr1JqBa8qKlYzcdyOyddp3w=; b=EUfjNI59ENSdnq1g3k2G0YFhZSRfm8bz6+8aH0/ortUmW8lSKhzxS8m1QdmahOQ6cf jtgS5UF8WNcDBevzwDJ8PzR4uYO+p2EmtK1qLobzNLLujHp9yGFmob7nKmdjuXkh5/6p aDazCjaOswZxGa7ALDbiQZnFqSlIt8qUelaLF786tppadWuxYkW941r3qed50oysVtBy Gd4m4Rh26NYYGQV+CaaT2Kuw6tU54WIn21m0VgfrDm8JcuhHwnFgxq9x07Erx76xwGiQ 3OjTuMWgOub0uY3PIzZ+zQsq3l0u66Bbgo4JBdmxzEGxQT7zHRt0O75T/o3veyWIqcgn ejmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=sPg9mv3WlmeWEPOlikTJrr1JqBa8qKlYzcdyOyddp3w=; b=K8NpQdy9iwO8xI/z126TLeUZR5e1ooK8pYn0UV7169E6g21JS8tSpuprKZ0Bh2NJh9 5nmKPcKkpIfp+0QilyI1Nm+by6zRRZf52piexOlWroHv2xqeRzICMR9IR+ga5eS95N66 lSeMYDWv3kIdeHdfrreoThtBr7Z3rewTwM7AdzCpFyFU/kFQYBm5rDTo9bRrlKTqEREY KHVCN6EV84OhaAITfrS+AVNVajuG6eYVXyZFtOm5h6X3VIurpVH1P0BuIDMG0UhWl7wv U83yGOCUlnfemoXqpsDLbxNTPcLguXodzQMTWIfmGx3VFJeKVHjTIOYX9ZNOULBy7kLh 2naw== X-Gm-Message-State: ALyK8tIdVwt1crdrt3CfifDpT2i1uQHDSEo7a/oZQy/kmWtxVnGYxfBafbYPZDcFoQr1wqGVRkcojDKx/84e8Q== MIME-Version: 1.0 X-Received: by 10.36.68.88 with SMTP id o85mr7687908ita.39.1464809731705; Wed, 01 Jun 2016 12:35:31 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Wed, 1 Jun 2016 12:35:31 -0700 (PDT) In-Reply-To: References: <201606011457.u51EvrOI096173@repo.freebsd.org> Date: Wed, 1 Jun 2016 12:35:31 -0700 Message-ID: Subject: Re: svn commit: r301128 - head/sys/dev/urtwn From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 19:35:32 -0000 [snip] well, adhoc merges. -a From owner-svn-src-head@freebsd.org Wed Jun 1 19:49:39 2016 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 3E4DEB607FD; Wed, 1 Jun 2016 19:49:39 +0000 (UTC) (envelope-from oshogbo@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 mx1.freebsd.org (Postfix) with ESMTPS id 1077A13CE; Wed, 1 Jun 2016 19:49:38 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Jncgu005063; Wed, 1 Jun 2016 19:49:38 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51JncwU005062; Wed, 1 Jun 2016 19:49:38 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606011949.u51JncwU005062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 1 Jun 2016 19:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301159 - head/lib/libc/sys 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.22 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, 01 Jun 2016 19:49:39 -0000 Author: oshogbo Date: Wed Jun 1 19:49:38 2016 New Revision: 301159 URL: https://svnweb.freebsd.org/changeset/base/301159 Log: Document behavior of wait introduced in the r286698. Suggested by: glebius Reviewed by: wblock, bjk Differential Revision: https://reviews.freebsd.org/D6080 Modified: head/lib/libc/sys/wait.2 Modified: head/lib/libc/sys/wait.2 ============================================================================== --- head/lib/libc/sys/wait.2 Wed Jun 1 18:46:54 2016 (r301158) +++ head/lib/libc/sys/wait.2 Wed Jun 1 19:49:38 2016 (r301159) @@ -28,7 +28,7 @@ .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 3, 2013 +.Dd June 1, 2016 .Dt WAIT 2 .Os .Sh NAME @@ -596,6 +596,14 @@ and fields of .Fa infop must be checked against zero to determine if a process reported status. +.Pp +.Fn wait +called with -1 to wait for any child process will ignore a child that is +referenced by a process descriptor (see +.Xr pdfork 2 ) . +Specific processes can still be waited on by specifying the process ID +or descriptor (see +.Xr pdwait 4 ) . .Sh ERRORS The .Fn wait From owner-svn-src-head@freebsd.org Wed Jun 1 19:54:07 2016 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 344BCB609CE; Wed, 1 Jun 2016 19:54:07 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id 06063198D; Wed, 1 Jun 2016 19:54:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Js6b6008480; Wed, 1 Jun 2016 19:54:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51Js6i6008477; Wed, 1 Jun 2016 19:54:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606011954.u51Js6i6008477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 1 Jun 2016 19:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301160 - head/bin/ps 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.22 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, 01 Jun 2016 19:54:07 -0000 Author: cem Date: Wed Jun 1 19:54:05 2016 New Revision: 301160 URL: https://svnweb.freebsd.org/changeset/base/301160 Log: ps(1): Expand variables to match expanded fields ki_flag and ki_tdflag have been 'long', not 'int', since 2000 and 2005, respectively. Submitted by: Shawn Wills Sponsored by: EMC / Isilon Storage Division Modified: head/bin/ps/keyword.c head/bin/ps/print.c Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Wed Jun 1 19:49:38 2016 (r301159) +++ head/bin/ps/keyword.c Wed Jun 1 19:54:05 2016 (r301160) @@ -95,7 +95,7 @@ static VAR var[] = { {"etimes", "ELAPSED", NULL, "elapsed-times", USER, elapseds, 0, CHAR, NULL, 0}, {"euid", "", "uid", NULL, 0, NULL, 0, CHAR, NULL, 0}, - {"f", "F", NULL, "flags", 0, kvar, KOFF(ki_flag), INT, "x", 0}, + {"f", "F", NULL, "flags", 0, kvar, KOFF(ki_flag), LONG, "lx", 0}, {"f2", "F2", NULL, "flags2", 0, kvar, KOFF(ki_flag2), INT, "08x", 0}, {"fib", "FIB", NULL, "fib", 0, kvar, KOFF(ki_fibnum), INT, "d", 0}, {"flags", "", "f", NULL, 0, NULL, 0, CHAR, NULL, 0}, Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Wed Jun 1 19:49:38 2016 (r301159) +++ head/bin/ps/print.c Wed Jun 1 19:54:05 2016 (r301160) @@ -211,7 +211,7 @@ logname(KINFO *k, VARENT *ve __unused) char * state(KINFO *k, VARENT *ve __unused) { - int flag, tdflags; + long flag, tdflags; char *cp, *buf; buf = malloc(16); From owner-svn-src-head@freebsd.org Wed Jun 1 19:54:18 2016 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 55A33B60A08; Wed, 1 Jun 2016 19:54:18 +0000 (UTC) (envelope-from oshogbo@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 mx1.freebsd.org (Postfix) with ESMTPS id 269621AE6; Wed, 1 Jun 2016 19:54:18 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51JsH7W008532; Wed, 1 Jun 2016 19:54:17 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51JsH5M008531; Wed, 1 Jun 2016 19:54:17 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606011954.u51JsH5M008531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 1 Jun 2016 19:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301161 - head/share/mk 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.22 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, 01 Jun 2016 19:54:18 -0000 Author: oshogbo Date: Wed Jun 1 19:54:17 2016 New Revision: 301161 URL: https://svnweb.freebsd.org/changeset/base/301161 Log: Fix the library name. Reviewed by: bdrewery Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Jun 1 19:54:05 2016 (r301160) +++ head/share/mk/src.libnames.mk Wed Jun 1 19:54:17 2016 (r301161) @@ -504,7 +504,7 @@ LIBATF_CXXDIR= ${OBJTOP}/lib/atf/libatf- LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime LIBBSNMPDIR= ${OBJTOP}/lib/libbsnmp/libbsnmp -LIBCAP_CASPERDIR= ${OBJTOP}/lib/libcasper/libcasper +LIBCASPERDIR= ${OBJTOP}/lib/libcasper/libcasper LIBCAP_DNSDIR= ${OBJTOP}/lib/libcasper/services/cap_dns LIBCAP_GRPDIR= ${OBJTOP}/lib/libcasper/services/cap_grp LIBCAP_PWDDIR= ${OBJTOP}/lib/libcasper/services/cap_pwd From owner-svn-src-head@freebsd.org Wed Jun 1 20:01:15 2016 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 3834BB60D6C; Wed, 1 Jun 2016 20:01:15 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B21F1F08; Wed, 1 Jun 2016 20:01:15 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=65483 helo=[10.0.0.103]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1b81t6-0008mM-SK; Wed, 01 Jun 2016 01:52:28 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r301131 - head/usr.sbin/tzsetup From: Devin Teske In-Reply-To: <201606011539.u51FdB8J011181@repo.freebsd.org> Date: Wed, 1 Jun 2016 13:01:08 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: <9FC87174-ADC7-4E78-AE4A-C0EAD35AC1B1@freebsd.org> References: <201606011539.u51FdB8J011181@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:01:15 -0000 I think this should have been reviewed first before commit. 1. Changes should be mirrored with "bsdconfig timezone" to keep the two = aligned 2. Not all users are unaware of the linkage between /etc/localtime and = tzsetup and as-such, are left without a way of knowing how to clear the = state-change from "no localtime file" to instead "localtime file exists" = (as now tzsetup lacks any interface to unlink localtime as was the = option for UTC) I did not consider the lack of installing the UTC compiled zoneinfo file = as a bug, because calling that routine with a NULL argument was = effective in requesting the localtime file be unlinked to return to that = state. Yes, those that are plentifully aware that /etc/localtime is generated = after running tzsetup will know that you can simply rm it. But there are = situations such as maybe sudo allowing you to run tzsetup but not = allowing you to use rm that come to mind which throw a monkey-wrench = (aka spanner) in the works for even normal folk that may have relied on = the functionality to have /etc/localtime unlinked by selecting the UTC = option at the bottom of the list. --=20 Devin > On Jun 1, 2016, at 8:39 AM, Steven Hartland wrote: >=20 > Author: smh > Date: Wed Jun 1 15:39:11 2016 > New Revision: 301131 > URL: https://svnweb.freebsd.org/changeset/base/301131 >=20 > Log: > Fix tzsetup not installing /etc/localtime for UTC >=20 > If tzsetup UTC is run then it successfully configured the system for = UTC > including installing /etc/localtime however if the user ran just = tzsetup > for interactive configuration and select UTC no /etc/localtime was = installed > which resulted in failures for utilities which require said file. >=20 > Change set_zone_utc to call install_zoneinfo("UTC") to ensure that > /etc/localtime is created for interactive UTC selection. >=20 > Users who have previously run tzsetup in interactive mode and select = UTC > can install the missing /etc/localtime by running tzsetup -r. >=20 > Also correct static miss-match for set_zone_utc. >=20 > MFC after: 2 weeks > Relnotes: Yes > Sponsored by: Multiplay >=20 > Modified: > head/usr.sbin/tzsetup/tzsetup.c >=20 > Modified: head/usr.sbin/tzsetup/tzsetup.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.sbin/tzsetup/tzsetup.c Wed Jun 1 15:19:49 2016 = (r301130) > +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jun 1 15:39:11 2016 = (r301131) > @@ -199,6 +199,7 @@ static char *chrootenv =3D NULL; > static void usage(void); > static int confirm_zone(const char *filename); > static int continent_country_menu(dialogMenuItem *); > +static int install_zoneinfo(const char *zoneinfo); > static int install_zoneinfo_file(const char *zoneinfo_file); > static int set_zone_multi(dialogMenuItem *); > static int set_zone_whole_country(dialogMenuItem *); > @@ -633,13 +634,13 @@ set_zone_menu(dialogMenuItem *dmi) > return (DITEM_LEAVE_MENU); > } >=20 > -int > +static int > set_zone_utc(void) > { > if (!confirm_zone(NULL)) > return (DITEM_FAILURE | DITEM_RECREATE); >=20 > - return (install_zoneinfo_file(NULL)); > + return (install_zoneinfo("UTC")); > } >=20 > static int >=20 From owner-svn-src-head@freebsd.org Wed Jun 1 20:04:26 2016 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 3FE35B60F26; Wed, 1 Jun 2016 20:04:26 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 1B5F4145B; Wed, 1 Jun 2016 20:04:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51K4PjR012155; Wed, 1 Jun 2016 20:04:25 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51K4PIr012152; Wed, 1 Jun 2016 20:04:25 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606012004.u51K4PIr012152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 1 Jun 2016 20:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301162 - head/sys/netpfil/ipfw 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.22 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, 01 Jun 2016 20:04:26 -0000 Author: truckman Date: Wed Jun 1 20:04:24 2016 New Revision: 301162 URL: https://svnweb.freebsd.org/changeset/base/301162 Log: Replace constant expressions that contain multiplications by fractional floating point values with integer divides. This will eliminate any chance that the compiler will generate code to evaluate the expression using floating point at runtime. Suggested by: bde Submitted by: Rasool Al-Saadi MFC after: 8 days (with r300779 and r300949) Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c head/sys/netpfil/ipfw/dn_aqm_pie.h head/sys/netpfil/ipfw/dn_sched_fq_pie.c Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm_pie.c Wed Jun 1 19:54:17 2016 (r301161) +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Wed Jun 1 20:04:24 2016 (r301162) @@ -244,20 +244,20 @@ calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob < (int64_t)(PIE_MAX_PROB * 0.000001)) - p >>= 11 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.00001)) - p >>= 9 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.0001)) - p >>= 7 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.001)) - p >>= 5 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) - p >>= 3 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) - p >>= 1 + PIE_FIX_POINT_BITS+12; + if (prob < (PIE_MAX_PROB / 1000000)) /* 0.000001 */ + p >>= 11 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 100000)) /* 0.00001 */ + p >>= 9 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 10000)) /* 0.0001 */ + p >>= 7 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 1000)) /* 0.001 */ + p >>= 5 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 100)) /* 0.01 */ + p >>= 3 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 10)) /* 0.1 */ + p >>= 1 + PIE_FIX_POINT_BITS + 12; else - p >>= PIE_FIX_POINT_BITS+12; + p >>= PIE_FIX_POINT_BITS + 12; oldprob = prob; Modified: head/sys/netpfil/ipfw/dn_aqm_pie.h ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm_pie.h Wed Jun 1 19:54:17 2016 (r301161) +++ head/sys/netpfil/ipfw/dn_aqm_pie.h Wed Jun 1 20:04:24 2016 (r301162) @@ -132,11 +132,13 @@ drop_early(struct pie_status *pst, uint3 * if accu_prob < 0.85 -> enqueue * if accu_prob>8.5 ->drop * between 0.85 and 8.5 || !De-randomize --> drop on prob + * + * (0.85 = 17/20 ,8.5 = 17/2) */ if (pprms->flags & PIE_DERAND_ENABLED) { - if(pst->accu_prob < (uint64_t) (PIE_MAX_PROB * 0.85)) + if(pst->accu_prob < (uint64_t) (PIE_MAX_PROB * 17 / 20)) return ENQUE; - if( pst->accu_prob >= (uint64_t) (PIE_MAX_PROB * 8.5)) + if( pst->accu_prob >= (uint64_t) (PIE_MAX_PROB * 17 / 2)) return DROP; } Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_fq_pie.c Wed Jun 1 19:54:17 2016 (r301161) +++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c Wed Jun 1 20:04:24 2016 (r301162) @@ -407,20 +407,20 @@ fq_calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob < (int64_t)(PIE_MAX_PROB * 0.000001)) - p >>= 11 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.00001)) - p >>= 9 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.0001)) - p >>= 7 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.001)) - p >>= 5 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) - p >>= 3 + PIE_FIX_POINT_BITS+12; - else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) - p >>= 1 + PIE_FIX_POINT_BITS+12; + if (prob < (PIE_MAX_PROB / 1000000)) /* 0.000001 */ + p >>= 11 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 100000)) /* 0.00001 */ + p >>= 9 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 10000)) /* 0.0001 */ + p >>= 7 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 1000)) /* 0.001 */ + p >>= 5 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 100)) /* 0.01 */ + p >>= 3 + PIE_FIX_POINT_BITS + 12; + else if (prob < (PIE_MAX_PROB / 10)) /* 0.1 */ + p >>= 1 + PIE_FIX_POINT_BITS + 12; else - p >>= PIE_FIX_POINT_BITS+12; + p >>= PIE_FIX_POINT_BITS + 12; oldprob = prob; From owner-svn-src-head@freebsd.org Wed Jun 1 20:06:56 2016 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 5B899B61100; Wed, 1 Jun 2016 20:06:56 +0000 (UTC) (envelope-from gjb@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 mx1.freebsd.org (Postfix) with ESMTPS id 2C1631898; Wed, 1 Jun 2016 20:06:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51K6tTx012287; Wed, 1 Jun 2016 20:06:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51K6t0d012285; Wed, 1 Jun 2016 20:06:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606012006.u51K6t0d012285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jun 2016 20:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301163 - in head: etc libexec/dma/dmagent 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.22 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, 01 Jun 2016 20:06:56 -0000 Author: gjb Date: Wed Jun 1 20:06:55 2016 New Revision: 301163 URL: https://svnweb.freebsd.org/changeset/base/301163 Log: Implement a hack to re-enable installation of the dma.conf. The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check for the 'installconfig', but does not behave properly with the 'distribute' target. This seems to be related to the previously-reported issues with files within /etc in the past. Reported by: Ben Woods Sponsored by: The FreeBSD Foundation Modified: head/etc/Makefile head/libexec/dma/dmagent/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jun 1 20:04:24 2016 (r301162) +++ head/etc/Makefile Wed Jun 1 20:06:55 2016 (r301163) @@ -309,6 +309,10 @@ distribution: cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ ${PPPCNF} ${DESTDIR}/etc/ppp .endif +.if ${MK_DMAGENT} != "no" + cd ${.CURDIR}/../libexec/dma/dmagent; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + dma.conf ${DESTDIR}/etc/dma +.endif .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail Modified: head/libexec/dma/dmagent/Makefile ============================================================================== --- head/libexec/dma/dmagent/Makefile Wed Jun 1 20:04:24 2016 (r301162) +++ head/libexec/dma/dmagent/Makefile Wed Jun 1 20:06:55 2016 (r301163) @@ -18,8 +18,6 @@ SRCS= aliases_parse.y \ spool.c \ util.c MAN8= dma.8 -CONFS= dma.conf -CONFSDIR= ${CONFDIR}/dma YFLAGS+= -i CLEANFILES= aliases_parse.i FILES= mailer.conf From owner-svn-src-head@freebsd.org Wed Jun 1 20:13:25 2016 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 13C3AB6131A; Wed, 1 Jun 2016 20:13:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F1CD61D5C; Wed, 1 Jun 2016 20:13:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id EB6D01065; Wed, 1 Jun 2016 20:13:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B961C1D349; Wed, 1 Jun 2016 20:13:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id wtWljMjPi-tI; Wed, 1 Jun 2016 20:13:22 +0000 (UTC) Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8C4EE1D342 To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606012006.u51K6t0d012285@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> Date: Wed, 1 Jun 2016 13:13:20 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606012006.u51K6t0d012285@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:13:25 -0000 On 6/1/16 1:06 PM, Glen Barber wrote: > Author: gjb > Date: Wed Jun 1 20:06:55 2016 > New Revision: 301163 > URL: https://svnweb.freebsd.org/changeset/base/301163 > > Log: > Implement a hack to re-enable installation of the dma.conf. > > The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check > for the 'installconfig', but does not behave properly with the > 'distribute' target. > This just moves something out of installconfig, leaving it apparently still broken. Please revert this and r301137 and lets fix this properly. I'm pretty surprised by this. > This seems to be related to the previously-reported issues > with files within /etc in the past. > > Reported by: Ben Woods > Sponsored by: The FreeBSD Foundation > > Modified: > head/etc/Makefile > head/libexec/dma/dmagent/Makefile > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Wed Jun 1 20:04:24 2016 (r301162) > +++ head/etc/Makefile Wed Jun 1 20:06:55 2016 (r301163) > @@ -309,6 +309,10 @@ distribution: > cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ > ${PPPCNF} ${DESTDIR}/etc/ppp > .endif > +.if ${MK_DMAGENT} != "no" > + cd ${.CURDIR}/../libexec/dma/dmagent; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > + dma.conf ${DESTDIR}/etc/dma > +.endif > .if ${MK_MAIL} != "no" > cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > ${ETCMAIL} ${DESTDIR}/etc/mail > > Modified: head/libexec/dma/dmagent/Makefile > ============================================================================== > --- head/libexec/dma/dmagent/Makefile Wed Jun 1 20:04:24 2016 (r301162) > +++ head/libexec/dma/dmagent/Makefile Wed Jun 1 20:06:55 2016 (r301163) > @@ -18,8 +18,6 @@ SRCS= aliases_parse.y \ > spool.c \ > util.c > MAN8= dma.8 > -CONFS= dma.conf > -CONFSDIR= ${CONFDIR}/dma > YFLAGS+= -i > CLEANFILES= aliases_parse.i > FILES= mailer.conf > -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Wed Jun 1 20:14:42 2016 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 D154EB613B5; Wed, 1 Jun 2016 20:14:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id C1DB71ED8; Wed, 1 Jun 2016 20:14:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id B987911B4; Wed, 1 Jun 2016 20:14:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 818D01D362; Wed, 1 Jun 2016 20:14:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id y4RV9ejpQryT; Wed, 1 Jun 2016 20:14:40 +0000 (UTC) Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 2B5841D356 To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606012006.u51K6t0d012285@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 1 Jun 2016 13:14:39 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606012006.u51K6t0d012285@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:14:42 -0000 On 6/1/16 1:06 PM, Glen Barber wrote: > The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check > for the 'installconfig', but does not behave properly with the > 'distribute' target. It's not checking for 'make installconfig', it is checking if 'installconfig:' exists. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Wed Jun 1 20:22:23 2016 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 49C04B61533; Wed, 1 Jun 2016 20:22:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9DE131C; Wed, 1 Jun 2016 20:22:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id CBDE713BA; Wed, 1 Jun 2016 20:22:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 1 Jun 2016 20:22:21 +0000 From: Glen Barber To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent Message-ID: <20160601202221.GP75780@FreeBSD.org> References: <201606012006.u51K6t0d012285@repo.freebsd.org> <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A6Z7MKnLVMfR85kG" Content-Disposition: inline In-Reply-To: <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:22:23 -0000 --A6Z7MKnLVMfR85kG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 01, 2016 at 01:13:20PM -0700, Bryan Drewery wrote: > On 6/1/16 1:06 PM, Glen Barber wrote: > > Author: gjb > > Date: Wed Jun 1 20:06:55 2016 > > New Revision: 301163 > > URL: https://svnweb.freebsd.org/changeset/base/301163 > >=20 > > Log: > > Implement a hack to re-enable installation of the dma.conf. > > =20 > > The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check > > for the 'installconfig', but does not behave properly with the > > 'distribute' target. > > =20 >=20 > This just moves something out of installconfig, leaving it apparently > still broken. >=20 > Please revert this and r301137 and lets fix this properly. I'm pretty > surprised by this. >=20 I'm happy to revert these two commits, they were never intended to be a permanent fix (I probably should have noted that in the commit log). I'm still wrapping my head around what share/mk/bsd.confs.mk is trying to do, and why it is interfering with installing these files. Before these are reverted, do you have an idea in mind of a proper fix? Glen --A6Z7MKnLVMfR85kG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXT0P9AAoJEAMUWKVHj+KTCJsP/1Nxtx+/uXD7T3GCB72Pducp Z65hHRvfEaxK0y69AMyXw0+AEchV6MJEqHxC2sKvoNClrgKCrISphDvgaduXxrj+ usqcYGSxLSJWqo06nsQ3Rkemyg/dn03wclITT3Z3BzouoerjuO8LlJaxVp7d/Qd7 K4a1mzs16Y45f3fC1eJGvuOOkQ+ah7UGjVUXNlE/3WWXIFrOd7TwKI9sAz7apnIC oJ6OTSb9gE3/j9HUmUTn6x2A1XVVyfE+unPg6DdKALLhaAlcQjulG1GVphglOJj/ W8pQvOcY0Rn/DPxp2tfrkW0YH5GYPg2w7Zh/+gxkhPRfMXFiNm6bUk+3u63aob4r SIyMWAmYO1qmY7CztFO69Msp8xm1HHOHNqO72/HIw8j/sUxB03PUOw9Puubu0G+a suFG3c3Y82UiGuEJ+i22JqvAQ7VTqcu1GFIcPwM+YQWzj1B1y/3sOkacgCqVhmM/ BMFvVbaWCA/NtMSUkY5sibueoAviTga+44mTCMg3w/2pCh8hDIzEwz31yJAx3muX 6lKl8+HIk1nH2ERW9M6yx4q/4Fe1lZOrYlKyvDToxBvM+ETdOZ7g/2rUisSK8in2 CLx9TXUC/YVnvGWMufW3D9ilIcWWFPyej3NV35uKw8kDcBT14sJuYaz5U2b5r+MZ 97LCn4ZbfJt5E1G1lh3l =eYVd -----END PGP SIGNATURE----- --A6Z7MKnLVMfR85kG-- From owner-svn-src-head@freebsd.org Wed Jun 1 20:23:18 2016 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 35B2BB615A8; Wed, 1 Jun 2016 20:23:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 18F791671; Wed, 1 Jun 2016 20:23:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 0CEA91511; Wed, 1 Jun 2016 20:23:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C85991D3EB; Wed, 1 Jun 2016 20:23:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id MXkaggnA_Rlk; Wed, 1 Jun 2016 20:23:15 +0000 (UTC) Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E49A11D3E3 To: Glen Barber References: <201606012006.u51K6t0d012285@repo.freebsd.org> <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> <20160601202221.GP75780@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 1 Jun 2016 13:23:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160601202221.GP75780@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="veP29UdGKMKUwMgE2v2N3xJEAgsd0IA80" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:23:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --veP29UdGKMKUwMgE2v2N3xJEAgsd0IA80 Content-Type: multipart/mixed; boundary="s1o4j1gUQ8BLTUtapMUuViQrLxRFmn1CG" From: Bryan Drewery To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent References: <201606012006.u51K6t0d012285@repo.freebsd.org> <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> <20160601202221.GP75780@FreeBSD.org> In-Reply-To: <20160601202221.GP75780@FreeBSD.org> --s1o4j1gUQ8BLTUtapMUuViQrLxRFmn1CG Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/1/16 1:22 PM, Glen Barber wrote: > On Wed, Jun 01, 2016 at 01:13:20PM -0700, Bryan Drewery wrote: >> On 6/1/16 1:06 PM, Glen Barber wrote: >>> Author: gjb >>> Date: Wed Jun 1 20:06:55 2016 >>> New Revision: 301163 >>> URL: https://svnweb.freebsd.org/changeset/base/301163 >>> >>> Log: >>> Implement a hack to re-enable installation of the dma.conf. >>> =20 >>> The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check >>> for the 'installconfig', but does not behave properly with the >>> 'distribute' target. >>> =20 >> >> This just moves something out of installconfig, leaving it apparently >> still broken. >> >> Please revert this and r301137 and lets fix this properly. I'm pretty= >> surprised by this. >> >=20 > I'm happy to revert these two commits, they were never intended to be > a permanent fix (I probably should have noted that in the commit log). >=20 > I'm still wrapping my head around what share/mk/bsd.confs.mk is trying > to do, and why it is interfering with installing these files. >=20 > Before these are reverted, do you have an idea in mind of a proper fix?= >=20 What's the bug? make distribution works fine. Just tested rm -rf /tmp/blah make distrib-dirs DESTDIR=3D/tmp/blah make distribution DESTDIR=3D/tmp/blah files present: -rw-r--r-- 1 root wheel 2163 Jun 1 13:21 /tmp/blah/etc/dma/dma.conf -rw------- 1 root wheel 1082 Jun 1 13:21 /tmp/blah/etc/ppp/ppp.conf --=20 Regards, Bryan Drewery --s1o4j1gUQ8BLTUtapMUuViQrLxRFmn1CG-- --veP29UdGKMKUwMgE2v2N3xJEAgsd0IA80 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXT0QyAAoJEDXXcbtuRpfPOWoIAMu1XOweVfLhuna32mgXlQgN 9i8+nIG6YKociD3ii6hZT7iZN5rKSdcBvBoohoNdv8bWcl0C17yS4nHQPHkQotDb me5fUSceo28wBlWyoSKyTQcdFyfdO11XmJFP7MWaNcxq3wh831DxdKa9jPdMzaG4 dV9eTuumaB41iHAcODN9zixk+gpphtEqPFpn9EGmLNi6BojkolwOK4rEM5rjdvC7 2HdYukQmp0mPQYaTvXX0pFpfPJPVsgWHjXWaaGTAW3261pxiDv8KTwLhLYrl4pUi XBCbB4fwBCdl22EC46wl7w7DmoDdEgKRAh0UbYVCDy8bKqIxNkNIc6QaTx3X/rc= =OjQz -----END PGP SIGNATURE----- --veP29UdGKMKUwMgE2v2N3xJEAgsd0IA80-- From owner-svn-src-head@freebsd.org Wed Jun 1 20:25:39 2016 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 BBA68B61639; Wed, 1 Jun 2016 20:25:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A035E1823; Wed, 1 Jun 2016 20:25:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 990A1167F; Wed, 1 Jun 2016 20:25:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 504B91D3FC; Wed, 1 Jun 2016 20:25:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ouDoITcz1VXi; Wed, 1 Jun 2016 20:25:36 +0000 (UTC) Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7D8B31D3F5 To: Glen Barber References: <201606012006.u51K6t0d012285@repo.freebsd.org> <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> <20160601202221.GP75780@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <156b8d54-e891-16fe-7e89-2ed0bf01703a@FreeBSD.org> Date: Wed, 1 Jun 2016 13:25:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160601202221.GP75780@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kiXvj5h8OieQeGaNie43xQiGJqJfquPr8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:25:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kiXvj5h8OieQeGaNie43xQiGJqJfquPr8 Content-Type: multipart/mixed; boundary="vPMHfKe8QhskmhCpDaaBaXmDNVGNtimrH" From: Bryan Drewery To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <156b8d54-e891-16fe-7e89-2ed0bf01703a@FreeBSD.org> Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent References: <201606012006.u51K6t0d012285@repo.freebsd.org> <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> <20160601202221.GP75780@FreeBSD.org> In-Reply-To: <20160601202221.GP75780@FreeBSD.org> --vPMHfKe8QhskmhCpDaaBaXmDNVGNtimrH Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/1/16 1:22 PM, Glen Barber wrote: > On Wed, Jun 01, 2016 at 01:13:20PM -0700, Bryan Drewery wrote: >> On 6/1/16 1:06 PM, Glen Barber wrote: >>> Author: gjb >>> Date: Wed Jun 1 20:06:55 2016 >>> New Revision: 301163 >>> URL: https://svnweb.freebsd.org/changeset/base/301163 >>> >>> Log: >>> Implement a hack to re-enable installation of the dma.conf. >>> =20 >>> The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check >>> for the 'installconfig', but does not behave properly with the >>> 'distribute' target. >>> =20 >> >> This just moves something out of installconfig, leaving it apparently >> still broken. >> >> Please revert this and r301137 and lets fix this properly. I'm pretty= >> surprised by this. >> >=20 > I'm happy to revert these two commits, they were never intended to be > a permanent fix (I probably should have noted that in the commit log). >=20 > I'm still wrapping my head around what share/mk/bsd.confs.mk is trying > to do, and why it is interfering with installing these files. >=20 > Before these are reverted, do you have an idea in mind of a proper fix?= >=20 What commands are used to generate the snapshots? --=20 Regards, Bryan Drewery --vPMHfKe8QhskmhCpDaaBaXmDNVGNtimrH-- --kiXvj5h8OieQeGaNie43xQiGJqJfquPr8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXT0TAAAoJEDXXcbtuRpfPCp0H/AsaR4U/lAb7PJbzM4O7eptl VT8WMi6vQnBplOie+1xpGqOPFE0glv6r8W2XKmJqc2vG/9iWQu8NJgZCTeT+Lduu wCxTb/NbBKrIPz62GjPXtDLRbs7nmBDDhujtO/ojGVlXhAFFYkcjQMBG72YVSVEl nc+naTSGssuPBvG+Fw3szlpiFtTwjRQheTtjEQ57OcYBqooFVp32lujOlRvI1Le3 J4CHWtauTN/FrvYlHiew0iSp0p0dSWpiXZraUqujTFHPZfjb7parioN9Makc9U73 O/S2wJ2bso12+FBVb3P7Wt6LTm4LFv8syy/mIvKWCSnWjIthLLzsDWCaaBitIIU= =EiqH -----END PGP SIGNATURE----- --kiXvj5h8OieQeGaNie43xQiGJqJfquPr8-- From owner-svn-src-head@freebsd.org Wed Jun 1 20:29:28 2016 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 DD91BB616C8; Wed, 1 Jun 2016 20:29:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CDA2C1A29; Wed, 1 Jun 2016 20:29:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 73DC71813; Wed, 1 Jun 2016 20:29:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 1 Jun 2016 20:29:27 +0000 From: Glen Barber To: Bryan Drewery Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r301163 - in head: etc libexec/dma/dmagent Message-ID: <20160601202927.GR75780@FreeBSD.org> References: <201606012006.u51K6t0d012285@repo.freebsd.org> <0933c625-d329-6c4c-88ba-093ad955d475@FreeBSD.org> <20160601202221.GP75780@FreeBSD.org> <156b8d54-e891-16fe-7e89-2ed0bf01703a@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZRLamLUCLuRJXeX8" Content-Disposition: inline In-Reply-To: <156b8d54-e891-16fe-7e89-2ed0bf01703a@FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 20:29:29 -0000 --ZRLamLUCLuRJXeX8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 01, 2016 at 01:25:35PM -0700, Bryan Drewery wrote: > On 6/1/16 1:22 PM, Glen Barber wrote: > > On Wed, Jun 01, 2016 at 01:13:20PM -0700, Bryan Drewery wrote: > >> On 6/1/16 1:06 PM, Glen Barber wrote: > >>> Author: gjb > >>> Date: Wed Jun 1 20:06:55 2016 > >>> New Revision: 301163 > >>> URL: https://svnweb.freebsd.org/changeset/base/301163 > >>> > >>> Log: > >>> Implement a hack to re-enable installation of the dma.conf. > >>> =20 > >>> The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check > >>> for the 'installconfig', but does not behave properly with the > >>> 'distribute' target. > >>> =20 > >> > >> This just moves something out of installconfig, leaving it apparently > >> still broken. > >> > >> Please revert this and r301137 and lets fix this properly. I'm pretty > >> surprised by this. > >> > >=20 > > I'm happy to revert these two commits, they were never intended to be > > a permanent fix (I probably should have noted that in the commit log). > >=20 > > I'm still wrapping my head around what share/mk/bsd.confs.mk is trying > > to do, and why it is interfering with installing these files. > >=20 > > Before these are reverted, do you have an idea in mind of a proper fix? > >=20 >=20 > What commands are used to generate the snapshots? >=20 In the top-level of the branch, 'make -C release'. A quick way to produce the base.txz is: # make -C release base.txz Glen --ZRLamLUCLuRJXeX8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXT0WnAAoJEAMUWKVHj+KTxTMP/i5b8zwvHQ1dP6YTYFJ4Tj+9 ZYwTqwuKb8QIn+USlfNsSunKNO3EWxiQi3kwVZ52ESNnxb6E0rr9XKYAc+rRa3Cd E/NeAOzQm2IvPNTyn4HUXZDgpEcqxBSjcvMDVc3F9g1DbOkRpPlZeE1Dqd4dbQqr 7FuznPkHVsA7EzASe4LDzpKfa9u5fmKYFQp3z1Bb71E3k1mXQnuvxyyaTb/OXF71 1f0G/4D6yJFZl0EN9mJZ0UUyG57RcOaT5IltprI3wScjg4B3kW/QXrnsYnFj2L/d Nuc33BP7ofQ5nmmjBRpBOoVINJ5oXcz5axYjddPOZtxV/USUnkNJV44XiGT83AF3 rY7PeRm5K7YVgRwL5auO30fA32ae1gjPOs+FAWgYBusejn5iyccD3tNC/O0+iLlO HhpvGurBJjOH93zZ0kvM1WRuvOPGkCWPkKl31zRnj2gKvlFZTz3sWFuadEsOJq7X Ee3NS7Rvg7nObqlekSavQviTeYmWW7kaDpZHFrQycYsSXP4jGAvaeonw+NKPbbKE v1XiRctu8FnNF6mwr7Q1CDJmk7MNPOKQTG8L72IShE9onkCbuzVISYRjMjEnhT3O 90AdzA1mXCg5t/E95u0LwrH9JtDzZaNAKO5937yODX80AJCYpRSVG5YnQWcsbO34 jmgg0R6mwdNFrvbSo7fe =1IqK -----END PGP SIGNATURE----- --ZRLamLUCLuRJXeX8-- From owner-svn-src-head@freebsd.org Wed Jun 1 20:39:01 2016 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 639CAB61B55; Wed, 1 Jun 2016 20:39:01 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 1753D11D8; Wed, 1 Jun 2016 20:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51Kd0ob023340; Wed, 1 Jun 2016 20:39:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51Kd0Zs023339; Wed, 1 Jun 2016 20:39:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606012039.u51Kd0Zs023339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 1 Jun 2016 20:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301165 - head/sys/vm 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.22 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, 01 Jun 2016 20:39:01 -0000 Author: kib Date: Wed Jun 1 20:39:00 2016 New Revision: 301165 URL: https://svnweb.freebsd.org/changeset/base/301165 Log: If the fast path unbusy in vm_page_replace() fails, slow path needs to acquire the page lock, which recurses. Avoid the recursion by reusing the code from vm_page_remove() in a new helper vm_page_xunbusy_maybelocked(). Reviewed by: alc Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jun 1 20:30:31 2016 (r301164) +++ head/sys/vm/vm_page.c Wed Jun 1 20:39:00 2016 (r301165) @@ -759,6 +759,22 @@ vm_page_trysbusy(vm_page_t m) } } +static void +vm_page_xunbusy_maybelocked(vm_page_t m) +{ + bool lockacq; + + vm_page_assert_xbusied(m); + + lockacq = !mtx_owned(vm_page_lockptr(m)); + if (lockacq) + vm_page_lock(m); + vm_page_flash(m); + atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); + if (lockacq) + vm_page_unlock(m); +} + /* * vm_page_xunbusy_hard: * @@ -1197,25 +1213,14 @@ void vm_page_remove(vm_page_t m) { vm_object_t object; - boolean_t lockacq; if ((m->oflags & VPO_UNMANAGED) == 0) - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); if ((object = m->object) == NULL) return; VM_OBJECT_ASSERT_WLOCKED(object); - if (vm_page_xbusied(m)) { - lockacq = FALSE; - if ((m->oflags & VPO_UNMANAGED) != 0 && - !mtx_owned(vm_page_lockptr(m))) { - lockacq = TRUE; - vm_page_lock(m); - } - vm_page_flash(m); - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); - if (lockacq) - vm_page_unlock(m); - } + if (vm_page_xbusied(m)) + vm_page_xunbusy_maybelocked(m); /* * Now remove from the object's list of backed pages. @@ -1340,7 +1345,7 @@ vm_page_replace(vm_page_t mnew, vm_objec TAILQ_REMOVE(&object->memq, mold, listq); mold->object = NULL; - vm_page_xunbusy(mold); + vm_page_xunbusy_maybelocked(mold); /* * The object's resident_page_count does not change because we have From owner-svn-src-head@freebsd.org Wed Jun 1 20:44:29 2016 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 C8581B6155A; Wed, 1 Jun 2016 20:44:29 +0000 (UTC) (envelope-from gjb@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 mx1.freebsd.org (Postfix) with ESMTPS id A507E1C1D; Wed, 1 Jun 2016 20:44:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51KiSmG026793; Wed, 1 Jun 2016 20:44:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51KiSgD026788; Wed, 1 Jun 2016 20:44:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606012044.u51KiSgD026788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 1 Jun 2016 20:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301166 - in head: etc etc/ppp libexec/dma/dmagent share/mk usr.sbin/ppp 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.22 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, 01 Jun 2016 20:44:29 -0000 Author: gjb Date: Wed Jun 1 20:44:28 2016 New Revision: 301166 URL: https://svnweb.freebsd.org/changeset/base/301166 Log: Revert r301137 and r301163, and implement a correct fix for the CONFS issue with dma.conf and ppp.conf. Thank you very much to Bryan Drewery for looking into the problem and providing this fix. Pointyhat: gjb Sponsored by: The FreeBSD Foundation Added: head/usr.sbin/ppp/ppp.conf - copied unchanged from r301136, head/usr.sbin/ppp/ppp.conf Deleted: head/etc/ppp/ Modified: head/etc/Makefile head/libexec/dma/dmagent/Makefile head/share/mk/bsd.subdir.mk head/usr.sbin/ppp/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jun 1 20:39:00 2016 (r301165) +++ head/etc/Makefile Wed Jun 1 20:44:28 2016 (r301166) @@ -305,14 +305,6 @@ distribution: .endif cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${MTREE} ${DESTDIR}/etc/mtree -.if ${MK_PPP} != "no" - cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - ${PPPCNF} ${DESTDIR}/etc/ppp -.endif -.if ${MK_DMAGENT} != "no" - cd ${.CURDIR}/../libexec/dma/dmagent; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dma.conf ${DESTDIR}/etc/dma -.endif .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail Modified: head/libexec/dma/dmagent/Makefile ============================================================================== --- head/libexec/dma/dmagent/Makefile Wed Jun 1 20:39:00 2016 (r301165) +++ head/libexec/dma/dmagent/Makefile Wed Jun 1 20:44:28 2016 (r301166) @@ -18,6 +18,8 @@ SRCS= aliases_parse.y \ spool.c \ util.c MAN8= dma.8 +CONFS= dma.conf +CONFSDIR= ${CONFDIR}/dma YFLAGS+= -i CLEANFILES= aliases_parse.i FILES= mailer.conf Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Jun 1 20:39:00 2016 (r301165) +++ head/share/mk/bsd.subdir.mk Wed Jun 1 20:44:28 2016 (r301166) @@ -72,10 +72,9 @@ DISTRIBUTION?= base distribute: .MAKE .for dist in ${DISTRIBUTION} ${_+_}cd ${.CURDIR}; \ - ${MAKE} install -DNO_SUBDIR DESTDIR=${DISTDIR}/${dist} SHARED=copies + ${MAKE} install installconfig -DNO_SUBDIR DESTDIR=${DISTDIR}/${dist} SHARED=copies .endfor .endif - # Convenience targets to run 'build${target}' and 'install${target}' when # calling 'make ${target}'. .for __target in files includes Modified: head/usr.sbin/ppp/Makefile ============================================================================== --- head/usr.sbin/ppp/Makefile Wed Jun 1 20:39:00 2016 (r301165) +++ head/usr.sbin/ppp/Makefile Wed Jun 1 20:44:28 2016 (r301166) @@ -21,6 +21,9 @@ PPP_NO_PAM= PPP_NO_RADIUS= PPP_NO_SUID= .endif +CONFS= ppp.conf +CONFSDIR= ${CONFDIR}/ppp +CONFSMODE= 600 .if ${MK_ATM} == "no" PPP_NO_ATM= Copied: head/usr.sbin/ppp/ppp.conf (from r301136, head/usr.sbin/ppp/ppp.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ppp/ppp.conf Wed Jun 1 20:44:28 2016 (r301166, copy of r301136, head/usr.sbin/ppp/ppp.conf) @@ -0,0 +1,37 @@ +################################################################# +# PPP Sample Configuration File +# Originally written by Toshiharu OHNO +# Simplified 5/14/1999 by wself@cdrom.com +# +# See /usr/share/examples/ppp/ for some examples +# +# $FreeBSD$ +################################################################# + +default: + set log Phase Chat LCP IPCP CCP tun command + ident user-ppp VERSION + + # Ensure that "device" references the correct serial port + # for your modem. (cuau0 = COM1, cuau1 = COM2) + # + set device /dev/cuau1 + + set speed 115200 + set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \ + \"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT" + set timeout 180 # 3 minute idle timer (the default) + enable dns # request DNS info (for resolv.conf) + +papchap: + # + # edit the next three lines and replace the items in caps with + # the values which have been assigned by your ISP. + # + + set phone PHONE_NUM + set authname USERNAME + set authkey PASSWORD + + set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 + add default HISADDR # Add a (sticky) default route From owner-svn-src-head@freebsd.org Wed Jun 1 20:45:22 2016 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 E30E5B618C2; Wed, 1 Jun 2016 20:45:22 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id B077E1F0D; Wed, 1 Jun 2016 20:45:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51KjLJV026870; Wed, 1 Jun 2016 20:45:21 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51KjLuF026869; Wed, 1 Jun 2016 20:45:21 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201606012045.u51KjLuF026869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 1 Jun 2016 20:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301167 - head/lib/libcasper/services/cap_grp 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.22 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, 01 Jun 2016 20:45:23 -0000 Author: ed Date: Wed Jun 1 20:45:21 2016 New Revision: 301167 URL: https://svnweb.freebsd.org/changeset/base/301167 Log: Don't call setgrent() in an unportable way. For FreeBSD 12, I'm considering updating setgrent() to have a function prototype that conforms to POSIX. FreeBSD seems to be the only operating system that lets setgrent() return an integer. It's also inconsistent with setpwent(). It looks like our libcasper depends on setgrent() returning an integer. Get rid of that. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D6659 Modified: head/lib/libcasper/services/cap_grp/cap_grp.c Modified: head/lib/libcasper/services/cap_grp/cap_grp.c ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.c Wed Jun 1 20:44:28 2016 (r301166) +++ head/lib/libcasper/services/cap_grp/cap_grp.c Wed Jun 1 20:45:21 2016 (r301167) @@ -703,7 +703,9 @@ grp_setgrent(const nvlist_t *limits __un nvlist_t *nvlout __unused) { - return (setgrent() == 0 ? EFAULT : 0); + setgrent(); + + return (0); } static int From owner-svn-src-head@freebsd.org Wed Jun 1 20:55:26 2016 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 72CEFB6369C; Wed, 1 Jun 2016 20:55:26 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 2B3951717; Wed, 1 Jun 2016 20:55:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51KtPjZ030899; Wed, 1 Jun 2016 20:55:25 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51KtPWT030898; Wed, 1 Jun 2016 20:55:25 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606012055.u51KtPWT030898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 1 Jun 2016 20:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301168 - head/lib/libcrypt 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.22 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, 01 Jun 2016 20:55:26 -0000 Author: allanjude Date: Wed Jun 1 20:55:25 2016 New Revision: 301168 URL: https://svnweb.freebsd.org/changeset/base/301168 Log: Skein was not meant to be connected to libcrypto It is not a password hashing algorithm Reported by: cem Modified: head/lib/libcrypt/Makefile Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Wed Jun 1 20:45:21 2016 (r301167) +++ head/lib/libcrypt/Makefile Wed Jun 1 20:55:25 2016 (r301168) @@ -10,25 +10,16 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 5 LIB= crypt -.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 ${.CURDIR}/../../sys/crypto/skein +.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 SRCS= crypt.c misc.c \ crypt-md5.c md5c.c \ crypt-nthash.c md4c.c \ crypt-sha256.c sha256c.c \ - crypt-sha512.c sha512c.c \ - skein.c skein_block.c + crypt-sha512.c sha512c.c MAN= crypt.3 MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3 CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil \ - -I${.CURDIR}/../../sys/crypto/sha2 -I${.CURDIR}/../../sys/crypto/skein - -# Use assembly optimized skein if available -.if exists(${MACHINE_ARCH}/skein_block_asm.s) -.PATH: ${.CURDIR}/../../sys/crypto/skein/${MACHINE_ARCH} -SRCS += skein_block_asm.s -CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 -ACFLAGS += -DELF -Wa,--noexecstack -.endif + -I${.CURDIR}/../../sys/crypto/sha2 # Pull in the strong crypto, if it is present. .if exists(${.CURDIR}/../../secure/lib/libcrypt) && ${MK_CRYPT} != "no" @@ -43,10 +34,7 @@ CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BL SHA512_224_Init SHA512_224_Final SHA512_224_Update \ SHA512_256_Init SHA512_256_Final SHA512_256_Update \ SHA384_Init SHA384_Final SHA384_Update \ - SHA512_Init SHA512_Final SHA512_Update \ - SKEIN256_Init SKEIN256_Final SKEIN256_Update \ - SKEIN512_Init SKEIN512_Final SKEIN512_Update \ - SKEIN1024_Init SKEIN1024_Final SKEIN1024_Update + SHA512_Init SHA512_Final SHA512_Update CFLAGS+= -D${sym}=__${sym} .endfor From owner-svn-src-head@freebsd.org Wed Jun 1 21:38:33 2016 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 C0055B61B87; Wed, 1 Jun 2016 21:38:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A905413D4; Wed, 1 Jun 2016 21:38:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A23C91984; Wed, 1 Jun 2016 21:38:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 580881D5A1; Wed, 1 Jun 2016 21:38:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id EqjwNPagHqUY; Wed, 1 Jun 2016 21:38:26 +0000 (UTC) Subject: Re: svn commit: r301166 - in head: etc etc/ppp libexec/dma/dmagent share/mk usr.sbin/ppp DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C97861D59C To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606012044.u51KiSgD026788@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <3cb353d9-8196-68fb-a1fd-f339868436bd@FreeBSD.org> Date: Wed, 1 Jun 2016 14:38:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606012044.u51KiSgD026788@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9Nk0hNXBP7nXwGHQikN1nLQhvU6n52aPa" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 01 Jun 2016 21:38:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9Nk0hNXBP7nXwGHQikN1nLQhvU6n52aPa Content-Type: multipart/mixed; boundary="PpumRnjTmoDcI1HgxHbjtFqvwohJnCN4l" From: Bryan Drewery To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <3cb353d9-8196-68fb-a1fd-f339868436bd@FreeBSD.org> Subject: Re: svn commit: r301166 - in head: etc etc/ppp libexec/dma/dmagent share/mk usr.sbin/ppp References: <201606012044.u51KiSgD026788@repo.freebsd.org> In-Reply-To: <201606012044.u51KiSgD026788@repo.freebsd.org> --PpumRnjTmoDcI1HgxHbjtFqvwohJnCN4l Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/1/2016 1:44 PM, Glen Barber wrote: > Author: gjb > Date: Wed Jun 1 20:44:28 2016 > New Revision: 301166 > URL: https://svnweb.freebsd.org/changeset/base/301166 >=20 > Log: > Revert r301137 and r301163, and implement a correct fix > for the CONFS issue with dma.conf and ppp.conf. Thanks! --=20 Regards, Bryan Drewery --PpumRnjTmoDcI1HgxHbjtFqvwohJnCN4l-- --9Nk0hNXBP7nXwGHQikN1nLQhvU6n52aPa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXT1XOAAoJEDXXcbtuRpfPZO0H/1SazIPDu2s96YdzhVA741JQ CQNn0LRkKwtFIlb7yYLsxUcg/ozcZt4vFpZojxKpFJCtuWgWiWr5+HutPXJwx5GB cT6/dE8JIZ4MdzFYn9tPYtQqzPFZqVvIYBMX0a3zFZMzWER6E5244mv5QastfHoO Dp9oXAFsPZCKB0Oq+ZqTxSGIDXLrtNdVw8ynMBGxvQRMd5AQREh5+lrk/bKsNdvL J/shUQ/bf6+gmUmJz3kg3LHGYA/1pYlraRbrQJuJ8vLl96Etx5jnVpt4t9lyoAU4 yYH6zCPGEUjXiFp8bvmuNOELXum7k2Ml4LOwbC2t8Q0st11/XNxAxUtThOdel6c= =wbVS -----END PGP SIGNATURE----- --9Nk0hNXBP7nXwGHQikN1nLQhvU6n52aPa-- From owner-svn-src-head@freebsd.org Thu Jun 2 00:51:37 2016 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 EC739B6013E; Thu, 2 Jun 2016 00:51:37 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id B507418A8; Thu, 2 Jun 2016 00:51:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u520pbbS017331; Thu, 2 Jun 2016 00:51:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u520pasQ017321; Thu, 2 Jun 2016 00:51:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020051.u520pasQ017321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 00:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301181 - in head/sys: conf dev/ath modules/ath 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.22 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: Thu, 02 Jun 2016 00:51:38 -0000 Author: adrian Date: Thu Jun 2 00:51:36 2016 New Revision: 301181 URL: https://svnweb.freebsd.org/changeset/base/301181 Log: [ath] commit initial bluetooth coexistence support for the MCI NICs. This is the initial framework to call into the MCI HAL routines and drive the basic state engine. The MCI bluetooth coex model uses a command channel between wlan and bluetooth, rather than a 2-wire or 3-wire signaling protocol to control things. This means the wlan and bluetooth chip exchange a lot more information and signaling, even at the per-packet level. The NICs in question can share the input LNA and output PA on the die, so they absolutely can't stomp on each other in a silly fashion. It also allows for the bluetooth side to signal when profiles come and go, so the driver can take appropriate control. There's also the possibility of dynamic bluetooth/wlan duty cycle control which I haven't yet really played with. It configures things up with a static "wlan wins everything" coexistence, configures up the available 2GHz channel map for bluetooth, sets a static duty cycle for bluetooth/wifi traffic priority and drives the basics needed to keep the MCI HAL code happy. It doesn't do any actual coexistence except to default to "wlan wins everything", which at least demonstrates that things do indeed work. Bluetooth inquiry frames still trump wifi (including beacons), so that demonstrates things really do indeed seem to work. Tested: * AR9462 (WB222), STA mode + bt * QCA9565 (WB335), STA mode + bt TODO: * .. the rest of coexistence. yes, bluetooth, not people. That stuff's hard. * It doesn't do the initial BT side calibration, which requires a WLAN chip reset. I'll fix up the reset path a bit more first before I enable that. * The 1-ant and 2-ant configuration bits aren't being set correctly in if_ath_btcoex.c - I'll dig into that and fix it in a subsequent commit. * It's not enabled by default for WB222/WB225 even though I believe it now can be - I'll chase that up in a subsequent commit. Obtained from: Qualcomm Atheros, Linux ath9k Added: head/sys/dev/ath/if_ath_btcoex_mci.c (contents, props changed) head/sys/dev/ath/if_ath_btcoex_mci.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_btcoex.c head/sys/dev/ath/if_ath_btcoex.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 2 00:42:15 2016 (r301180) +++ head/sys/conf/files Thu Jun 2 00:51:36 2016 (r301181) @@ -765,6 +765,8 @@ dev/ath/if_ath_beacon.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_btcoex.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_btcoex_mci.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_debug.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_descdma.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jun 2 00:42:15 2016 (r301180) +++ head/sys/dev/ath/if_ath.c Thu Jun 2 00:51:36 2016 (r301181) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -475,6 +476,10 @@ ath_setup_hal_config(struct ath_softc *s if (sc->sc_pci_devinfo & ATH_PCI_AR9565_2ANT) device_printf(sc->sc_dev, "WB335 2-ANT card detected\n"); + if (sc->sc_pci_devinfo & ATH_PCI_BT_ANT_DIV) + device_printf(sc->sc_dev, + "Bluetooth Antenna Diversity card detected\n"); + if (sc->sc_pci_devinfo & ATH_PCI_KILLER) device_printf(sc->sc_dev, "Killer Wireless card detected\n"); @@ -2254,6 +2259,9 @@ ath_intr(void *arg) device_printf(sc->sc_dev, "%s: TSFOOR\n", __func__); sc->sc_syncbeacon = 1; } + if (status & HAL_INT_MCI) { + ath_btcoex_mci_intr(sc); + } } ATH_PCU_LOCK(sc); sc->sc_intr_cnt--; @@ -2549,6 +2557,12 @@ ath_init(struct ath_softc *sc) sc->sc_imask |= HAL_INT_RXEOL; /* + * Enable MCI interrupt for MCI devices. + */ + if (sc->sc_btcoex_mci) + sc->sc_imask |= HAL_INT_MCI; + + /* * Enable MIB interrupts when there are hardware phy counters. * Note we only do this (at the moment) for station mode. */ Modified: head/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.c Thu Jun 2 00:42:15 2016 (r301180) +++ head/sys/dev/ath/if_ath_btcoex.c Thu Jun 2 00:51:36 2016 (r301181) @@ -47,9 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include #include + #include #include @@ -71,6 +71,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +MALLOC_DECLARE(M_ATHDEV); /* * Initial AR9285 / (WB195) bluetooth coexistence settings, @@ -188,14 +191,8 @@ ath_btcoex_cfg_wb225(struct ath_softc *s return (0); } -/* - * Initial AR9462 / (WB222) bluetooth coexistence settings, - * just for experimentation. - * - * Return 0 for OK; errno for error. - */ static int -ath_btcoex_cfg_wb222(struct ath_softc *sc) +ath_btcoex_cfg_mci(struct ath_softc *sc, uint32_t mci_cfg, int do_btdiv) { HAL_BT_COEX_INFO btinfo; HAL_BT_COEX_CONFIG btconfig; @@ -207,7 +204,12 @@ ath_btcoex_cfg_wb222(struct ath_softc *s bzero(&btinfo, sizeof(btinfo)); bzero(&btconfig, sizeof(btconfig)); - device_printf(sc->sc_dev, "Enabling WB222 BTCOEX\n"); + sc->sc_ah->ah_config.ath_hal_mci_config = mci_cfg; + + if (ath_btcoex_mci_attach(sc) != 0) { + device_printf(sc->sc_dev, "Failed to setup btcoex\n"); + return (EINVAL); + } btinfo.bt_module = HAL_BT_MODULE_JANUS; /* XXX not used? */ btinfo.bt_coex_config = HAL_BT_COEX_CFG_MCI; @@ -227,9 +229,13 @@ ath_btcoex_cfg_wb222(struct ath_softc *s btinfo.bt_gpio_wlan_active = 5; btinfo.bt_active_polarity = 1; /* XXX not used */ - btinfo.bt_single_ant = 0; /* 2 antenna on WB222 */ + btinfo.bt_single_ant = 0; /* 2 antenna on WB335 */ btinfo.bt_isolation = 0; /* in dB, not used */ + /* Implement a default dutycycle/period */ + btinfo.bt_dutyCycle = 55; + btinfo.bt_period = 40; + ath_hal_btcoex_set_info(ah, &btinfo); btconfig.bt_time_extend = 0; @@ -244,79 +250,69 @@ ath_btcoex_cfg_wb222(struct ath_softc *s ath_hal_btcoex_set_config(ah, &btconfig); + /* Enable */ + ath_hal_btcoex_enable(sc->sc_ah); + + /* Stomp */ + ath_hal_btcoex_set_weights(ah, HAL_BT_COEX_STOMP_NONE); + /* * Enable antenna diversity. */ - ath_hal_btcoex_set_parameter(ah, HAL_BT_COEX_ANTENNA_DIVERSITY, 1); + ath_hal_btcoex_set_parameter(ah, HAL_BT_COEX_ANTENNA_DIVERSITY, + do_btdiv); return (0); } /* - * Initial QCA9565 / (WB335B) bluetooth coexistence settings, - * just for experimentation. + * Initial AR9462 / (WB222) bluetooth coexistence settings. * * Return 0 for OK; errno for error. */ static int -ath_btcoex_cfg_wb335b(struct ath_softc *sc) +ath_btcoex_cfg_wb222(struct ath_softc *sc) { - HAL_BT_COEX_INFO btinfo; - HAL_BT_COEX_CONFIG btconfig; - struct ath_hal *ah = sc->sc_ah; - - if (! ath_hal_btcoex_supported(ah)) - return (EINVAL); - bzero(&btinfo, sizeof(btinfo)); - bzero(&btconfig, sizeof(btconfig)); + device_printf(sc->sc_dev, "Enabling WB222 BTCOEX\n"); + /* XXX from ath9k */ + return (ath_btcoex_cfg_mci(sc, 0x2201, 1)); +} - device_printf(sc->sc_dev, "Enabling WB335B BTCOEX\n"); +/* + * Initial QCA9565 / (WB335B) bluetooth coexistence settings. + * + * Return 0 for OK; errno for error. + */ +static int +ath_btcoex_cfg_wb335b(struct ath_softc *sc) +{ + uint32_t flags; + int do_btdiv = 0; - btinfo.bt_module = HAL_BT_MODULE_JANUS; /* XXX not used? */ - btinfo.bt_coex_config = HAL_BT_COEX_CFG_MCI; + /* ath9k default */ + flags = 0xa4c1; + /* 1-ant and 2-ant AR9565 */ /* - * MCI uses a completely different interface to speak - * to the bluetooth module - it's a command based - * thing over a serial line, rather than - * state pins to/from the bluetooth module. - * - * So, the GPIO configuration, polarity, etc - * doesn't matter on MCI devices; it's just - * completely ignored by the HAL. + * XXX TODO: ensure these actually make it down to the + * HAL correctly! */ - btinfo.bt_gpio_bt_active = 4; - btinfo.bt_gpio_bt_priority = 8; - btinfo.bt_gpio_wlan_active = 5; - - btinfo.bt_active_polarity = 1; /* XXX not used */ - btinfo.bt_single_ant = 0; /* 2 antenna on WB335 */ - btinfo.bt_isolation = 0; /* in dB, not used */ - - ath_hal_btcoex_set_info(ah, &btinfo); - - btconfig.bt_time_extend = 0; - btconfig.bt_txstate_extend = 1; /* true */ - btconfig.bt_txframe_extend = 1; /* true */ - btconfig.bt_mode = HAL_BT_COEX_MODE_SLOTTED; - btconfig.bt_quiet_collision = 1; /* true */ - btconfig.bt_rxclear_polarity = 1; /* true */ - btconfig.bt_priority_time = 2; - btconfig.bt_first_slot_time = 5; - btconfig.bt_hold_rxclear = 1; /* true */ - - ath_hal_btcoex_set_config(ah, &btconfig); + if (sc->sc_pci_devinfo & ATH_PCI_AR9565_1ANT) { + flags |= ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED; + } else if (sc->sc_pci_devinfo & ATH_PCI_AR9565_2ANT) { + flags |= ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_NON_SHARED; + } - /* - * Enable antenna diversity. - */ - ath_hal_btcoex_set_parameter(ah, HAL_BT_COEX_ANTENNA_DIVERSITY, 1); + if (sc->sc_pci_devinfo & ATH_PCI_BT_ANT_DIV) { + do_btdiv = 1; + } - return (0); + device_printf(sc->sc_dev, "Enabling WB335 BTCOEX\n"); + /* XXX from ath9k */ + return (ath_btcoex_cfg_mci(sc, flags, do_btdiv)); } - #if 0 /* * When using bluetooth coexistence, ASPM needs to be disabled @@ -396,6 +392,9 @@ ath_btcoex_attach(struct ath_softc *sc) int ath_btcoex_detach(struct ath_softc *sc) { + if (sc->sc_btcoex_mci) { + ath_btcoex_mci_detach(sc); + } return (0); } @@ -412,6 +411,9 @@ ath_btcoex_detach(struct ath_softc *sc) int ath_btcoex_enable(struct ath_softc *sc, const struct ieee80211_channel *chan) { + if (sc->sc_btcoex_mci) { + ath_btcoex_mci_enable(sc, chan); + } return (0); } Modified: head/sys/dev/ath/if_ath_btcoex.h ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.h Thu Jun 2 00:42:15 2016 (r301180) +++ head/sys/dev/ath/if_ath_btcoex.h Thu Jun 2 00:51:36 2016 (r301181) @@ -31,6 +31,10 @@ #ifndef __IF_ATH_BTCOEX_H__ #define __IF_ATH_BTCOEX_H__ +typedef enum { + ATH_COEX_EVENT_BT_NOOP, +} ATH_BT_COEX_EVENT; + extern int ath_btcoex_attach(struct ath_softc *sc); extern int ath_btcoex_detach(struct ath_softc *sc); extern int ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag *ad); Added: head/sys/dev/ath/if_ath_btcoex_mci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_btcoex_mci.c Thu Jun 2 00:51:36 2016 (r301181) @@ -0,0 +1,654 @@ +/*- + * Copyright (c) 2014 Qualcomm Atheros, Inc. + * Copyright (c) 2016 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +/* + * This implements the MCI bluetooth coexistence handling. + */ +#include "opt_ath.h" +#include "opt_inet.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include /* XXX for ether_sprintf */ + +#include + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include +#include +#include + +#include + +MALLOC_DECLARE(M_ATHDEV); + +#define ATH_MCI_GPM_MAX_ENTRY 16 +#define ATH_MCI_GPM_BUF_SIZE (ATH_MCI_GPM_MAX_ENTRY * 16) +#define ATH_MCI_SCHED_BUF_SIZE (16 * 16) /* 16 entries, 4 dword each */ + +static void ath_btcoex_mci_update_wlan_channels(struct ath_softc *sc); + +int +ath_btcoex_mci_attach(struct ath_softc *sc) +{ + int buflen, error; + + buflen = ATH_MCI_GPM_BUF_SIZE + ATH_MCI_SCHED_BUF_SIZE; + error = ath_descdma_alloc_desc(sc, &sc->sc_btcoex.buf, NULL, + "MCI bufs", buflen, 1); + if (error != 0) { + device_printf(sc->sc_dev, "%s: failed to alloc MCI RAM\n", + __func__); + return (error); + } + + /* Yes, we're going to do bluetooth MCI coex */ + sc->sc_btcoex_mci = 1; + + /* Initialise the wlan channel mapping */ + sc->sc_btcoex.wlan_channels[0] = 0x00000000; + sc->sc_btcoex.wlan_channels[1] = 0xffffffff; + sc->sc_btcoex.wlan_channels[2] = 0xffffffff; + sc->sc_btcoex.wlan_channels[3] = 0x7fffffff; + + /* + * Ok, so the API is a bit odd. It assumes sched_addr is + * after gpm_addr, and it does math to figure out the right + * sched_buf pointer. + * + * So, set gpm_addr to buf, sched_addr to gpm_addr + ATH_MCI_GPM_BUF_SIZE, + * the HAL call with do (gpm_buf + (sched_addr - gpm_addr)) to + * set sched_buf, and we're "golden". + * + * Note, it passes in 'len' here (gpm_len) as + * ATH_MCI_GPM_BUF_SIZE >> 4. My guess is that it's 16 + * bytes per entry and we're storing 16 entries. + */ + sc->sc_btcoex.gpm_buf = (void *) sc->sc_btcoex.buf.dd_desc; + sc->sc_btcoex.sched_buf = sc->sc_btcoex.gpm_buf + + ATH_MCI_GPM_BUF_SIZE; + + sc->sc_btcoex.gpm_paddr = sc->sc_btcoex.buf.dd_desc_paddr; + sc->sc_btcoex.sched_paddr = sc->sc_btcoex.gpm_paddr + + ATH_MCI_GPM_BUF_SIZE; + + /* memset the gpm buffer with MCI_GPM_RSVD_PATTERN */ + memset(sc->sc_btcoex.gpm_buf, 0xfe, buflen); + + /* + * This is an unfortunate x86'ism in the HAL - the + * HAL code expects the passed in buffer to be + * coherent, and doesn't implement /any/ kind + * of buffer sync operations at all. + * + * So, this code will only work on dma coherent buffers + * and will behave poorly on non-coherent systems. + * Fixing this would require some HAL surgery so it + * actually /did/ the buffer flushing as appropriate. + */ + ath_hal_btcoex_mci_setup(sc->sc_ah, + sc->sc_btcoex.gpm_paddr, + sc->sc_btcoex.gpm_buf, + ATH_MCI_GPM_BUF_SIZE >> 4, + sc->sc_btcoex.sched_paddr); + + return (0); +} + +/* + * Detach btcoex from the given interface + */ +int +ath_btcoex_mci_detach(struct ath_softc *sc) +{ + + ath_hal_btcoex_mci_detach(sc->sc_ah); + ath_descdma_cleanup(sc, &sc->sc_btcoex.buf, NULL); + return (0); +} + +/* + * Configure or disable bluetooth coexistence on the given channel. + * + * For MCI, we just use the top-level enable/disable flag, and + * then the MCI reset / channel update path will configure things + * appropriately based on the current band. + */ +int +ath_btcoex_mci_enable(struct ath_softc *sc, + const struct ieee80211_channel *chan) +{ + + /* + * Always reconfigure stomp-all for now, so wlan wins. + * + * The default weights still don't allow beacons to win, + * so unless you set net.wlan.X.bmiss_max to something higher, + * net80211 will disconnect you during a HCI INQUIRY command. + * + * The longer-term solution is to dynamically adjust whether + * bmiss happens based on bluetooth requirements, and look at + * making the individual stomp bits configurable. + */ + ath_hal_btcoex_set_weights(sc->sc_ah, HAL_BT_COEX_STOMP_ALL); + + /* + * update wlan channels so the firmware knows what channels it + * can/can't use. + */ + ath_btcoex_mci_update_wlan_channels(sc); + + return (0); +} + +/* + * XXX TODO: turn into general btcoex, and then make this + * the MCI specific bits. + */ +static void +ath_btcoex_mci_event(struct ath_softc *sc, ATH_BT_COEX_EVENT nevent, + void *param) +{ + + if (! sc->sc_btcoex_mci) + return; + + /* + * Check whether we need to flush our local profile cache. + * If we do, then at (XXX TODO) we should flush our state, + * then wait for the MCI response with the updated profile list. + */ + if (ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_NEED_FLUSH_BT_INFO, NULL) != 0) { + uint32_t data = 0; + + if (ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_ENABLE, NULL) != 0) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Flush BT profile\n"); + /* + * XXX TODO: flush profile state on the ath(4) + * driver side; subsequent messages will come + * through with the current list of active + * profiles. + */ + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_NEED_FLUSH_BT_INFO, &data); + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SEND_STATUS_QUERY, NULL); + } + } + if (nevent == ATH_COEX_EVENT_BT_NOOP) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) BT_NOOP\n"); + return; + } +} + +static void +ath_btcoex_mci_send_gpm(struct ath_softc *sc, uint32_t *payload) +{ + + ath_hal_btcoex_mci_send_message(sc->sc_ah, MCI_GPM, 0, payload, 16, + AH_FALSE, AH_TRUE); +} + +/* + * This starts a BT calibration. It requires a chip reset. + */ +static int +ath_btcoex_mci_bt_cal_do(struct ath_softc *sc, int tx_timeout, int rx_timeout) +{ + + device_printf(sc->sc_dev, "%s: TODO!\n", __func__); + return (0); +} + +static void +ath_btcoex_mci_cal_msg(struct ath_softc *sc, uint8_t opcode, + uint8_t *rx_payload) +{ + uint32_t payload[4] = {0, 0, 0, 0}; + + switch (opcode) { + case MCI_GPM_BT_CAL_REQ: + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) receive BT_CAL_REQ\n"); + if (ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_BT, + NULL) == MCI_BT_AWAKE) { + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SET_BT_CAL_START, NULL); + ath_btcoex_mci_bt_cal_do(sc, 1000, 1000); + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) State mismatches: %d\n", + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_BT, NULL)); + } + break; + case MCI_GPM_BT_CAL_DONE: + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) receive BT_CAL_DONE\n"); + if (ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_BT, + NULL) == MCI_BT_CAL) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) ERROR ILLEGAL!\n"); + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) BT not in CAL state.\n"); + } + break; + case MCI_GPM_BT_CAL_GRANT: + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) receive BT_CAL_GRANT\n"); + /* Send WLAN_CAL_DONE for now */ + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) Send WLAN_CAL_DONE\n"); + MCI_GPM_SET_CAL_TYPE(payload, MCI_GPM_WLAN_CAL_DONE); + ath_btcoex_mci_send_gpm(sc, &payload[0]); + break; + default: + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Unknown GPM CAL message.\n"); + break; + } +} + +/* + * Update the bluetooth channel map. + * + * This map tells the bluetooth device which bluetooth channels + * are available for data. + * + * For 5GHz, all channels are available. + * For 2GHz, the current wifi channel range is blocked out, + * and the rest are available. + * + * This narrows which frequencies are used by the device when + * it initiates a transfer, thus hopefully reducing the chances + * of collisions (both hopefully on the current device and + * other devices in the same channel.) + */ +static void +ath_btcoex_mci_update_wlan_channels(struct ath_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_channel *chan = ic->ic_curchan; + uint32_t channel_info[4] = + { 0x00000000, 0xffffffff, 0xffffffff, 0x7fffffff }; + int32_t wl_chan, bt_chan, bt_start = 0, bt_end = 79; + + /* BT channel frequency is 2402 + k, k = 0 ~ 78 */ + if (IEEE80211_IS_CHAN_2GHZ(chan)) { + wl_chan = chan->ic_freq - 2402; + if (IEEE80211_IS_CHAN_HT40U(chan)) { + bt_start = wl_chan - 10; + bt_end = wl_chan + 30; + } else if (IEEE80211_IS_CHAN_HT40D(chan)) { + bt_start = wl_chan - 30; + bt_end = wl_chan + 10; + } else { + /* Assume 20MHz */ + bt_start = wl_chan - 10; + bt_end = wl_chan + 10; + } + + bt_start -= 7; + bt_end += 7; + + if (bt_start < 0) { + bt_start = 0; + } + if (bt_end > MCI_NUM_BT_CHANNELS) { + bt_end = MCI_NUM_BT_CHANNELS; + } + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) WLAN use channel %d\n", + chan->ic_freq); + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) mask BT channel %d - %d\n", bt_start, bt_end); + for (bt_chan = bt_start; bt_chan < bt_end; bt_chan++) { + MCI_GPM_CLR_CHANNEL_BIT(&channel_info[0], bt_chan); + } + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) WLAN not use any 2G channel, unmask all for BT\n"); + } + ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_SEND_WLAN_CHANNELS, + &channel_info[0]); +} + +static void +ath_btcoex_mci_coex_msg(struct ath_softc *sc, uint8_t opcode, + uint8_t *rx_payload) +{ + uint32_t version; + uint8_t major; + uint8_t minor; + uint32_t seq_num; + + switch (opcode) { + case MCI_GPM_COEX_VERSION_QUERY: + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Recv GPM COEX Version Query.\n"); + version = ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SEND_WLAN_COEX_VERSION, NULL); + break; + + case MCI_GPM_COEX_VERSION_RESPONSE: + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Recv GPM COEX Version Response.\n"); + major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION); + minor = *(rx_payload + MCI_GPM_COEX_B_MINOR_VERSION); + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) BT Coex version: %d.%d\n", major, minor); + version = (major << 8) + minor; + version = ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SET_BT_COEX_VERSION, &version); + break; + + case MCI_GPM_COEX_STATUS_QUERY: + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Recv GPM COEX Status Query = 0x%02x.\n", + *(rx_payload + MCI_GPM_COEX_B_WLAN_BITMAP)); + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SEND_WLAN_CHANNELS, NULL); + break; + + case MCI_GPM_COEX_BT_PROFILE_INFO: + /* + * XXX TODO: here is where we'd parse active profile + * info and make driver/stack choices as appropriate. + */ + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) TODO: Recv GPM COEX BT_Profile_Info.\n"); + break; + + case MCI_GPM_COEX_BT_STATUS_UPDATE: + seq_num = *((uint32_t *)(rx_payload + 12)); + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Recv GPM COEX BT_Status_Update: SEQ=%d\n", + seq_num); + break; + + default: + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Unknown GPM COEX message = 0x%02x\n", opcode); + break; + } +} + +void +ath_btcoex_mci_intr(struct ath_softc *sc) +{ + uint32_t mciInt, mciIntRxMsg; + uint32_t offset, subtype, opcode; + uint32_t *pGpm; + uint32_t more_data = HAL_MCI_GPM_MORE; + bool skip_gpm = false; + + DPRINTF(sc, ATH_DEBUG_BTCOEX, "%s: called\n", __func__); + + ath_hal_btcoex_mci_get_interrupt(sc->sc_ah, &mciInt, &mciIntRxMsg); + + if (ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_ENABLE, + NULL) == 0) { + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_INIT_GPM_OFFSET, NULL); + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) INTR but MCI_disabled\n"); + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) MCI interrupt: mciInt = 0x%x, mciIntRxMsg = 0x%x\n", + mciInt, mciIntRxMsg); + return; + } + + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_REQ_WAKE) { + uint32_t payload4[4] = { 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffff00}; + + /* + * The following REMOTE_RESET and SYS_WAKING used to sent + * only when BT wake up. Now they are always sent, as a + * recovery method to reset BT MCI's RX alignment. + */ + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 1. INTR Send REMOTE_RESET\n"); + ath_hal_btcoex_mci_send_message(sc->sc_ah, + MCI_REMOTE_RESET, 0, payload4, 16, AH_TRUE, AH_FALSE); + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 1. INTR Send SYS_WAKING\n"); + ath_hal_btcoex_mci_send_message(sc->sc_ah, + MCI_SYS_WAKING, 0, NULL, 0, AH_TRUE, AH_FALSE); + + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_REQ_WAKE; + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_RESET_REQ_WAKE, NULL); + + /* always do this for recovery and 2G/5G toggling and LNA_TRANS */ + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 1. Set BT state to AWAKE.\n"); + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SET_BT_AWAKE, NULL); + } + + /* Processing SYS_WAKING/SYS_SLEEPING */ + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_SYS_WAKING) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_SYS_WAKING; + if (ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_BT, + NULL) == MCI_BT_SLEEP) { + if (ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_REMOTE_SLEEP, NULL) == MCI_BT_SLEEP) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 2. BT stays in SLEEP mode.\n"); + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 2. Set BT state to AWAKE.\n"); + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SET_BT_AWAKE, NULL); + } + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 2. BT stays in AWAKE mode.\n"); + } + } + + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING; + if (ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_BT, + NULL) == MCI_BT_AWAKE) { + if (ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_REMOTE_SLEEP, NULL) == MCI_BT_AWAKE) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 3. BT stays in AWAKE mode.\n"); + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 3. Set BT state to SLEEP.\n"); + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_SET_BT_SLEEP, NULL); + } + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) 3. BT stays in SLEEP mode.\n"); + } + } + + /* + * Recover from out-of-order / wrong-offset GPM messages. + */ + if ((mciInt & HAL_MCI_INTERRUPT_RX_INVALID_HDR) || + (mciInt & HAL_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) MCI RX broken, skip GPM messages\n"); + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_RECOVER_RX, NULL); + skip_gpm = true; + } + + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_SCHD_INFO) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_SCHD_INFO; + offset = ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_LAST_SCHD_MSG_OFFSET, NULL); + } + + /* + * Parse GPM messages. + */ + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_GPM) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_GPM; + + while (more_data == HAL_MCI_GPM_MORE) { + pGpm = (void *) sc->sc_btcoex.gpm_buf; + offset = ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_NEXT_GPM_OFFSET, &more_data); + + if (offset == HAL_MCI_GPM_INVALID) + break; + pGpm += (offset >> 2); + /* + * The first DWORD is a timer. + * The real data starts from the second DWORD. + */ + subtype = MCI_GPM_TYPE(pGpm); + opcode = MCI_GPM_OPCODE(pGpm); + + if (!skip_gpm) { + if (MCI_GPM_IS_CAL_TYPE(subtype)) { + ath_btcoex_mci_cal_msg(sc, subtype, + (uint8_t*) pGpm); + } else { + switch (subtype) { + case MCI_GPM_COEX_AGENT: + ath_btcoex_mci_coex_msg(sc, + opcode, (uint8_t*) pGpm); + break; + case MCI_GPM_BT_DEBUG: + device_printf(sc->sc_dev, + "(MCI) TODO: GPM_BT_DEBUG!\n"); + break; + default: + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Unknown GPM message.\n"); + break; + } + } + } + MCI_GPM_RECYCLE(pGpm); + } + } + + /* + * This is monitoring/management information messages, so the driver + * layer can hook in and dynamically adjust things like aggregation + * size, expected bluetooth/wifi traffic throughput, etc. + * + * None of that is done right now; it just passes off the values + * to the HAL so it can update its internal state as appropriate. + * This code just prints out the values for debugging purposes. + */ + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_MONITOR) { + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_LNA_CONTROL) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_LNA_CONTROL; + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) LNA_CONTROL\n"); + } + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_LNA_INFO) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_LNA_INFO; + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) LNA_INFO\n"); + } + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO) { + int8_t value_dbm = ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_CONT_RSSI_POWER, NULL); + + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO; + if (ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_CONT_TXRX, NULL)) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) CONT_INFO: (tx) pri = %d, pwr = %d dBm\n", + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_CONT_PRIORITY, NULL), + value_dbm); + } else { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) CONT_INFO: (rx) pri = %d, rssi = %d dBm\n", + ath_hal_btcoex_mci_state(sc->sc_ah, + HAL_MCI_STATE_CONT_PRIORITY, NULL), + value_dbm); + } + } + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_CONT_NACK) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_CONT_NACK; + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) CONT_NACK\n"); + } + if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_CONT_RST) { + mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_CONT_RST; + DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) CONT_RST\n"); + } + } + + /* + * Recover the state engine if we hit an invalid header/timeout. + * This is the final part of GPT out-of-sync recovery. + */ + if ((mciInt & HAL_MCI_INTERRUPT_RX_INVALID_HDR) || + (mciInt & HAL_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) { + ath_btcoex_mci_event(sc, ATH_COEX_EVENT_BT_NOOP, NULL); + mciInt &= ~(HAL_MCI_INTERRUPT_RX_INVALID_HDR | + HAL_MCI_INTERRUPT_CONT_INFO_TIMEOUT); + } + + if (mciIntRxMsg & 0xfffffffe) { + DPRINTF(sc, ATH_DEBUG_BTCOEX, + "(MCI) Not processed IntRxMsg = 0x%x\n", mciIntRxMsg); + } +} Added: head/sys/dev/ath/if_ath_btcoex_mci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_btcoex_mci.h Thu Jun 2 00:51:36 2016 (r301181) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2016 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_BTCOEX_MCI_H__ +#define __IF_ATH_BTCOEX_MCI_H__ + +#define ATH_MCI_NUM_BT_CHANNELS 79 + +extern int ath_btcoex_mci_attach(struct ath_softc *sc); +extern int ath_btcoex_mci_detach(struct ath_softc *sc); +extern int ath_btcoex_mci_enable(struct ath_softc *sc, + const struct ieee80211_channel *chan); +extern void ath_btcoex_mci_intr(struct ath_softc *sc); + +#endif /* __IF_ATH_BTCOEX_MCI_H__ */ Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Jun 2 00:42:15 2016 (r301180) +++ head/sys/dev/ath/if_ath_tx.c Thu Jun 2 00:51:36 2016 (r301181) @@ -1738,6 +1738,15 @@ ath_tx_normal_setup(struct ath_softc *sc } #endif +#if 0 + /* + * Placeholder: if you want to transmit with the azimuth + * timestamp in the end of the payload, here's where you + * should set the TXDESC field. + */ + flags |= HAL_TXDESC_HWTS; +#endif + /* * Determine if a tx interrupt should be generated for * this descriptor. We take a tx interrupt to reap Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Jun 2 00:42:15 2016 (r301180) +++ head/sys/dev/ath/if_athvar.h Thu Jun 2 00:51:36 2016 (r301181) @@ -656,7 +656,8 @@ struct ath_softc { sc_has_ldpc : 1, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 2 11:12:12 2016 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 35B88B641DE; Thu, 2 Jun 2016 11:12:12 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 0839613D0; Thu, 2 Jun 2016 11:12:11 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BCBwB045097; Thu, 2 Jun 2016 11:12:11 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BCBmJ045096; Thu, 2 Jun 2016 11:12:11 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021112.u52BCBmJ045096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301196 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 11:12:12 -0000 Author: royger Date: Thu Jun 2 11:12:11 2016 New Revision: 301196 URL: https://svnweb.freebsd.org/changeset/base/301196 Log: xen-netfront: fix receiving TSO packets Currently FreeBSD is not properly fetching the TSO information from the Xen PV ring, and thus the received packets didn't have all the necessary information, like the segment size or even the TSO flag set. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 07:45:01 2016 (r301195) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:12:11 2016 (r301196) @@ -1253,6 +1253,13 @@ xn_rxeof(struct netfront_rxq *rxq) | CSUM_PSEUDO_HDR); m->m_pkthdr.csum_data = 0xffff; } + if ((rx->flags & NETRXF_extra_info) != 0 && + (extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].type == + XEN_NETIF_EXTRA_TYPE_GSO)) { + m->m_pkthdr.tso_segsz = + extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].u.gso.size; + m->m_pkthdr.csum_flags |= CSUM_TSO; + } rxq->stats.rx_packets++; rxq->stats.rx_bytes += m->m_pkthdr.len; From owner-svn-src-head@freebsd.org Thu Jun 2 04:25:55 2016 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 DF90CB6351D; Thu, 2 Jun 2016 04:25:55 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id B034B13AC; Thu, 2 Jun 2016 04:25:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u524Pso7097195; Thu, 2 Jun 2016 04:25:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u524PsN4097194; Thu, 2 Jun 2016 04:25:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020425.u524PsN4097194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 04:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301186 - head/sys/dev/ath 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.22 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: Thu, 02 Jun 2016 04:25:56 -0000 Author: adrian Date: Thu Jun 2 04:25:54 2016 New Revision: 301186 URL: https://svnweb.freebsd.org/changeset/base/301186 Log: [ath] correctly shift the QCA9565 LNA config into the mci config variable. Tested: * QCA9565, STA + BT mode Modified: head/sys/dev/ath/if_ath_btcoex.c Modified: head/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.c Thu Jun 2 03:16:02 2016 (r301185) +++ head/sys/dev/ath/if_ath_btcoex.c Thu Jun 2 04:25:54 2016 (r301186) @@ -299,9 +299,13 @@ ath_btcoex_cfg_wb335b(struct ath_softc * * HAL correctly! */ if (sc->sc_pci_devinfo & ATH_PCI_AR9565_1ANT) { - flags |= ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED; + flags &= ~ATH_MCI_CONFIG_ANT_ARCH; + flags |= ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED << + ATH_MCI_CONFIG_ANT_ARCH_S; } else if (sc->sc_pci_devinfo & ATH_PCI_AR9565_2ANT) { - flags |= ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_NON_SHARED; + flags &= ~ATH_MCI_CONFIG_ANT_ARCH; + flags |= ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_NON_SHARED << + ATH_MCI_CONFIG_ANT_ARCH_S; } if (sc->sc_pci_devinfo & ATH_PCI_BT_ANT_DIV) { From owner-svn-src-head@freebsd.org Thu Jun 2 15:31:25 2016 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 A0DACB654AE; Thu, 2 Jun 2016 15:31:25 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 711461D9D; Thu, 2 Jun 2016 15:31:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52FVORH041178; Thu, 2 Jun 2016 15:31:24 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52FVOSZ041177; Thu, 2 Jun 2016 15:31:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606021531.u52FVOSZ041177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 2 Jun 2016 15:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301207 - head/etc/rc.d 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.22 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: Thu, 02 Jun 2016 15:31:25 -0000 Author: asomers Date: Thu Jun 2 15:31:24 2016 New Revision: 301207 URL: https://svnweb.freebsd.org/changeset/base/301207 Log: Fix exit status of "service routing start " etc/rc.d/routing Ignore the exit status of options_{inet,inet6,atm}. It's meaningless. Reviewed by: hrs MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6687 Modified: head/etc/rc.d/routing Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Thu Jun 2 15:30:58 2016 (r301206) +++ head/etc/rc.d/routing Thu Jun 2 15:31:24 2016 (r301207) @@ -90,18 +90,23 @@ routing_stop() setroutes() { + local _ret + _ret=0 case $1 in static) static_$2 add $3 + _ret=$? ;; options) options_$2 ;; doall) static_$2 add $3 + _ret=$? options_$2 ;; esac + return $_ret } routing_stop_inet() From owner-svn-src-head@freebsd.org Wed Jun 1 22:04:11 2016 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 6FA79B66BFE; Wed, 1 Jun 2016 22:04:11 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id 3FE63179B; Wed, 1 Jun 2016 22:04:11 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51M4AJO056458; Wed, 1 Jun 2016 22:04:10 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51M4AUj056457; Wed, 1 Jun 2016 22:04:10 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606012204.u51M4AUj056457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 1 Jun 2016 22:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301172 - head/contrib/blacklist 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.22 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, 01 Jun 2016 22:04:11 -0000 Author: lidl Date: Wed Jun 1 22:04:10 2016 New Revision: 301172 URL: https://svnweb.freebsd.org/changeset/base/301172 Log: Import NetBSD's blacklist source from vendor tree This import includes The basic blacklist library and utility programs, to add a system-wide packet filtering notification mechanism to FreeBSD. The rational behind the daemon was given by Christos Zoulas in a presentation at vBSDcon 2015: https://youtu.be/fuuf8G28mjs Reviewed by: rpaulo Approved by: rpaulo Obtained from: NetBSD Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5912 Added: head/contrib/blacklist/ - copied from r301170, vendor/NetBSD/blacklist/dist/ From owner-svn-src-head@freebsd.org Thu Jun 2 15:52:35 2016 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 58477B68ED7; Thu, 2 Jun 2016 15:52:35 +0000 (UTC) (envelope-from mjg@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 mx1.freebsd.org (Postfix) with ESMTPS id 2962D1257; Thu, 2 Jun 2016 15:52:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52FqYPD049472; Thu, 2 Jun 2016 15:52:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52FqYxc049471; Thu, 2 Jun 2016 15:52:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201606021552.u52FqYxc049471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Jun 2016 15:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301208 - head/sys/kern 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.22 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: Thu, 02 Jun 2016 15:52:35 -0000 Author: mjg Date: Thu Jun 2 15:52:34 2016 New Revision: 301208 URL: https://svnweb.freebsd.org/changeset/base/301208 Log: taskqueue: plug a leak in _taskqueue_create While here make some style fixes and postpone the sprintf so that it is only done when the function can no longer fail. CID: 1356041 Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Thu Jun 2 15:31:24 2016 (r301207) +++ head/sys/kern/subr_taskqueue.c Thu Jun 2 15:52:34 2016 (r301208) @@ -130,14 +130,16 @@ _taskqueue_create(const char *name, int char *tq_name; tq_name = malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | M_ZERO); - if (!tq_name) + if (tq_name == NULL) return (NULL); - snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); - queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO); - if (!queue) + if (queue == NULL) { + free(tq_name, M_TASKQUEUE); return (NULL); + } + + snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); STAILQ_INIT(&queue->tq_queue); TAILQ_INIT(&queue->tq_active); From owner-svn-src-head@freebsd.org Thu Jun 2 03:16:04 2016 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 78CEBB66C0F; Thu, 2 Jun 2016 03:16:04 +0000 (UTC) (envelope-from allanjude@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 mx1.freebsd.org (Postfix) with ESMTPS id 3A48C1896; Thu, 2 Jun 2016 03:16:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u523G3s7071338; Thu, 2 Jun 2016 03:16:03 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u523G2Pg071333; Thu, 2 Jun 2016 03:16:02 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606020316.u523G2Pg071333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 2 Jun 2016 03:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301185 - head/sbin/ifconfig 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.22 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: Thu, 02 Jun 2016 03:16:04 -0000 Author: allanjude Date: Thu Jun 2 03:16:02 2016 New Revision: 301185 URL: https://svnweb.freebsd.org/changeset/base/301185 Log: Address feedback from hrs@ re: r301059 (ifconfig subnet mask) - Use NI_MAXHOST to size buffers for getnameinfo() - remove non-standard 'full' inet6 address printing - remove 'no scope' option - use strchr(3) to optimize replacing separator character in lladdrs Reviewed by: gnn, jhb Differential Revision: https://reviews.freebsd.org/D2856 Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Thu Jun 2 02:39:40 2016 (r301184) +++ head/sbin/ifconfig/af_inet.c Thu Jun 2 03:16:02 2016 (r301185) @@ -54,7 +54,7 @@ static const char rcsid[] = static struct in_aliasreq in_addreq; static struct ifreq in_ridreq; -static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ +static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ extern char *f_inet, *f_addr; static void Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Thu Jun 2 02:39:40 2016 (r301184) +++ head/sbin/ifconfig/af_inet6.c Thu Jun 2 03:16:02 2016 (r301185) @@ -65,13 +65,13 @@ static int ip6lifetime; static int prefix(void *, int); static char *sec2str(time_t); static int explicit_prefix = 0; -extern char *f_inet6, *f_addr, *f_scope; +extern char *f_inet6, *f_addr; extern void setnd6flags(const char *, int, int, const struct afswtch *); extern void setnd6defif(const char *, int, int, const struct afswtch *); extern void nd6_status(int); -static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ +static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ static void setifprefixlen(const char *addr, int dummy __unused, int s, @@ -173,10 +173,9 @@ in6_status(int s __unused, const struct struct in6_ifreq ifr6; int s6; u_int32_t flags6; - const u_int16_t *a; struct in6_addrlifetime lifetime; struct timespec now; - int error, n_flags, i; + int error, n_flags; clock_gettime(CLOCK_MONOTONIC_FAST, &now); @@ -208,30 +207,19 @@ in6_status(int s __unused, const struct lifetime = ifr6.ifr_ifru.ifru_lifetime; close(s6); - if (f_addr != NULL && strcmp(f_addr, "full") == 0) { - a = (const u_int16_t *)&sin->sin6_addr; - printf("\tinet6 "); - for (i = 0; i < 8; i++) { - printf("%04hx", ntohs(*(a + i))); - if (i < 7) - printf(":"); - } - } else { - if (f_addr != NULL && strcmp(f_addr, "fqdn") == 0) - n_flags = 0; - else if (f_addr != NULL && strcmp(f_addr, "host") == 0) - n_flags = NI_NOFQDN; - else - n_flags = NI_NUMERICHOST; - error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, - addr_buf, sizeof(addr_buf), NULL, 0, - n_flags); - if (error != 0 || - (f_scope != NULL && strcmp(f_scope, "none") == 0)) - inet_ntop(AF_INET6, &sin->sin6_addr, addr_buf, - sizeof(addr_buf)); - printf("\tinet6 %s", addr_buf); - } + if (f_addr != NULL && strcmp(f_addr, "fqdn") == 0) + n_flags = 0; + else if (f_addr != NULL && strcmp(f_addr, "host") == 0) + n_flags = NI_NOFQDN; + else + n_flags = NI_NUMERICHOST; + error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, + addr_buf, sizeof(addr_buf), NULL, 0, + n_flags); + if (error != 0) + inet_ntop(AF_INET6, &sin->sin6_addr, addr_buf, + sizeof(addr_buf)); + printf("\tinet6 %s", addr_buf); if (ifa->ifa_flags & IFF_POINTOPOINT) { sin = (struct sockaddr_in6 *)ifa->ifa_dstaddr; @@ -280,8 +268,7 @@ in6_status(int s __unused, const struct if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0) printf("prefer_source "); - if ((f_scope == NULL || strcmp(f_scope, "none") != 0) && - ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) + if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) printf("scopeid 0x%x ", ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); Modified: head/sbin/ifconfig/af_link.c ============================================================================== --- head/sbin/ifconfig/af_link.c Thu Jun 2 02:39:40 2016 (r301184) +++ head/sbin/ifconfig/af_link.c Thu Jun 2 03:16:02 2016 (r301185) @@ -58,25 +58,22 @@ link_status(int s __unused, const struct { /* XXX no const 'cuz LLADDR is defined wrong */ struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; - char *ether_format; - int i; + char *ether_format, *format_char; if (sdl != NULL && sdl->sdl_alen > 0) { if ((sdl->sdl_type == IFT_ETHER || sdl->sdl_type == IFT_L2VLAN || sdl->sdl_type == IFT_BRIDGE) && - sdl->sdl_alen == ETHER_ADDR_LEN) + sdl->sdl_alen == ETHER_ADDR_LEN) { + ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl)); if (f_ether != NULL && strcmp(f_ether, "dash") == 0) { - ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl)); - for (i = 0; i < strlen(ether_format); i++) { - if (ether_format[i] == ':') - ether_format[i] = '-'; - } - printf("\tether %s\n", ether_format); - } else - printf("\tether %s\n", - ether_ntoa((struct ether_addr *)LLADDR(sdl))); - else { + for (format_char = strchr(ether_format, ':'); + format_char != NULL; + format_char = strchr(ether_format, ':')) + *format_char = '-'; + } + printf("\tether %s\n", ether_format); + } else { int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; printf("\tlladdr %s\n", link_ntoa(sdl) + n); Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Thu Jun 2 02:39:40 2016 (r301184) +++ head/sbin/ifconfig/ifconfig.8 Thu Jun 2 03:16:02 2016 (r301185) @@ -213,7 +213,7 @@ The and their associated .Sy format strings are: -.Bl -tag -width scope +.Bl -tag -width ether .It Sy addr Adjust the display of inet and inet6 addresses .Bl -tag -width default @@ -223,9 +223,6 @@ Display inet and inet6 addresses in the .It Sy fqdn Display inet and inet6 addresses as fully qualified domain names .Pq FQDN -.It Sy full -Display inet6 addresses without suppressing zeroes. -Only applicable to inet6 .It Sy host Display inet and inet6 addresses as unqualified hostnames .It Sy numeric @@ -276,19 +273,6 @@ Display subnet prefix in integer format, .br prefixlen 64 .El -.It Sy scope -Controls the display of the interface scope as part of the address. -Only applicable to inet6 addresses. -.Bl -tag -width default -.It Sy default -The interface scope and scopeid are included in the address, for example: -.br -inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7 -.It Sy none -The interface scope and scopeid are not displayed, for example: -.br -inet6 fe80::1 prefixlen 64 -.El .El .Pp The following parameters may be set with Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Thu Jun 2 02:39:40 2016 (r301184) +++ head/sbin/ifconfig/ifconfig.c Thu Jun 2 03:16:02 2016 (r301185) @@ -99,7 +99,7 @@ int supmedia = 0; int printkeys = 0; /* Print keying material for interfaces. */ /* Formatter Strings */ -char *f_inet, *f_inet6, *f_ether, *f_addr, *f_scope; +char *f_inet, *f_inet6, *f_ether, *f_addr; static int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp); @@ -257,8 +257,6 @@ static void freeformat(void) free(f_ether); if (f_addr != NULL) free(f_addr); - if (f_scope != NULL) - free(f_scope); } static void setformat(char *input) @@ -286,8 +284,6 @@ static void setformat(char *input) f_inet = strdup(modifier); else if (strcmp(category, "inet6") == 0) f_inet6 = strdup(modifier); - else if (strcmp(category, "scope") == 0) - f_scope = strdup(modifier); } free(formatstr); } @@ -372,7 +368,7 @@ main(int argc, char *argv[]) size_t iflen; all = downonly = uponly = namesonly = noload = verbose = 0; - f_inet = f_inet6 = f_ether = f_addr = f_scope = NULL; + f_inet = f_inet6 = f_ether = f_addr = NULL; envformat = getenv("IFCONFIG_FORMAT"); if (envformat != NULL) From owner-svn-src-head@freebsd.org Thu Jun 2 04:42:47 2016 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 2F1ACB673F5; Thu, 2 Jun 2016 04:42:47 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 0146D150B; Thu, 2 Jun 2016 04:42:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u524gkaR004380; Thu, 2 Jun 2016 04:42:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u524gkPx004378; Thu, 2 Jun 2016 04:42:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020442.u524gkPx004378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 04:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301188 - in head/sys: conf modules/iwm 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.22 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: Thu, 02 Jun 2016 04:42:47 -0000 Author: adrian Date: Thu Jun 2 04:42:45 2016 New Revision: 301188 URL: https://svnweb.freebsd.org/changeset/base/301188 Log: [iwm] add if_iwm_led.c into the build. Modified: head/sys/conf/files head/sys/modules/iwm/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 2 04:42:28 2016 (r301187) +++ head/sys/conf/files Thu Jun 2 04:42:45 2016 (r301188) @@ -1704,6 +1704,7 @@ iwi_monitor.fw optional iwimonitorfw | clean "iwi_monitor.fw" dev/iwm/if_iwm.c optional iwm dev/iwm/if_iwm_binding.c optional iwm +dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm dev/iwm/if_iwm_pcie_trans.c optional iwm dev/iwm/if_iwm_phy_ctxt.c optional iwm Modified: head/sys/modules/iwm/Makefile ============================================================================== --- head/sys/modules/iwm/Makefile Thu Jun 2 04:42:28 2016 (r301187) +++ head/sys/modules/iwm/Makefile Thu Jun 2 04:42:45 2016 (r301188) @@ -6,7 +6,7 @@ KMOD= if_iwm # Main driver SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c -SRCS+= if_iwm_power.c if_iwm_scan.c +SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-head@freebsd.org Thu Jun 2 04:54:57 2016 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 D0236B67876; Thu, 2 Jun 2016 04:54:57 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id A11E21B71; Thu, 2 Jun 2016 04:54:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u524suGF008293; Thu, 2 Jun 2016 04:54:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u524susg008291; Thu, 2 Jun 2016 04:54:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020454.u524susg008291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 04:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301190 - head/sys/dev/iwm 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.22 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: Thu, 02 Jun 2016 04:54:57 -0000 Author: adrian Date: Thu Jun 2 04:54:56 2016 New Revision: 301190 URL: https://svnweb.freebsd.org/changeset/base/301190 Log: [iwm] Clean up iwm(4) scanning logic a bit. Submitted by: Imre Vadasz Obtained from: DragonflyBSD 8f3ffab9136e33263d424275ec28f57ad2096437 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 2 04:53:28 2016 (r301189) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 2 04:54:56 2016 (r301190) @@ -3642,7 +3642,8 @@ iwm_endscan_cb(void *arg, int pending) done = 0; if ((error = iwm_mvm_scan_request(sc, IEEE80211_CHAN_5GHZ, 0, NULL, 0)) != 0) { - device_printf(sc->sc_dev, "could not initiate scan\n"); + device_printf(sc->sc_dev, + "could not initiate 5 GHz scan\n"); done = 1; } } else { @@ -4883,9 +4884,10 @@ iwm_scan_start(struct ieee80211com *ic) IWM_LOCK(sc); error = iwm_mvm_scan_request(sc, IEEE80211_CHAN_2GHZ, 0, NULL, 0); if (error) { - device_printf(sc->sc_dev, "could not initiate scan\n"); + device_printf(sc->sc_dev, "could not initiate 2 GHz scan\n"); IWM_UNLOCK(sc); ieee80211_cancel_scan(vap); + sc->sc_scanband = 0; } else { iwm_led_blink_start(sc); IWM_UNLOCK(sc); Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Jun 2 04:53:28 2016 (r301189) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Jun 2 04:54:56 2016 (r301190) @@ -443,7 +443,6 @@ iwm_mvm_scan_request(struct iwm_softc *s * to allocate the time events. Warn on it, but maybe we * should try to send the command again with different params. */ - sc->sc_scanband = 0; ret = EIO; } return ret; From owner-svn-src-head@freebsd.org Thu Jun 2 04:53:29 2016 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 BCE67B677F8; Thu, 2 Jun 2016 04:53:29 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 8DC221A4E; Thu, 2 Jun 2016 04:53:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u524rSPa008207; Thu, 2 Jun 2016 04:53:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u524rS0s008205; Thu, 2 Jun 2016 04:53:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020453.u524rS0s008205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 04:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301189 - head/sys/dev/iwm 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.22 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: Thu, 02 Jun 2016 04:53:29 -0000 Author: adrian Date: Thu Jun 2 04:53:28 2016 New Revision: 301189 URL: https://svnweb.freebsd.org/changeset/base/301189 Log: [iwm] Use IWM_MAX_CMD_PAYLOAD_SIZE to improve command length checks. Taken-From: OpenBSD (parts of if_iwm.c r1.57 and if_iwmreg.h r1.10) Obtained from: DragonflyBSD b70c1eaad06257c5c7f4d8110d21642ebec14f42 Modified: head/sys/dev/iwm/if_iwm_util.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_util.c ============================================================================== --- head/sys/dev/iwm/if_iwm_util.c Thu Jun 2 04:42:45 2016 (r301188) +++ head/sys/dev/iwm/if_iwm_util.c Thu Jun 2 04:53:28 2016 (r301189) @@ -224,7 +224,10 @@ iwm_send_cmd(struct iwm_softc *sc, struc "large command paylen=%u len0=%u\n", paylen, hcmd->len[0]); /* Command is too large */ - if (sizeof(cmd->hdr) + paylen > IWM_RBUF_SIZE) { + if (paylen > IWM_MAX_CMD_PAYLOAD_SIZE) { + device_printf(sc->sc_dev, + "firmware command too long (%zd bytes)\n", + paylen + sizeof(cmd->hdr)); error = EINVAL; goto out; } @@ -269,7 +272,7 @@ iwm_send_cmd(struct iwm_softc *sc, struc (unsigned long) (hcmd->len[0] + hcmd->len[1] + sizeof(cmd->hdr)), async ? " (async)" : ""); - if (hcmd->len[0] > sizeof(cmd->data)) { + if (paylen > sizeof(cmd->data)) { bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREWRITE); } else { Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jun 2 04:42:45 2016 (r301188) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jun 2 04:53:28 2016 (r301189) @@ -5243,6 +5243,7 @@ enum iwm_power_scheme { }; #define IWM_DEF_CMD_PAYLOAD_SIZE 320 +#define IWM_MAX_CMD_PAYLOAD_SIZE ((4096 - 4) - sizeof(struct iwm_cmd_header)) #define IWM_CMD_FAILED_MSK 0x40 struct iwm_device_cmd { From owner-svn-src-head@freebsd.org Thu Jun 2 06:23:00 2016 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 4FF43B68ADF; Thu, 2 Jun 2016 06:23:00 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 207C01ECF; Thu, 2 Jun 2016 06:23:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u526Mx9V040932; Thu, 2 Jun 2016 06:22:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u526Mx60040931; Thu, 2 Jun 2016 06:22:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020622.u526Mx60040931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 06:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301193 - head/sys/dev/iwm 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.22 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: Thu, 02 Jun 2016 06:23:00 -0000 Author: adrian Date: Thu Jun 2 06:22:59 2016 New Revision: 301193 URL: https://svnweb.freebsd.org/changeset/base/301193 Log: [iwm] valid_{tx,rx}_ant from radio_cfg is only needed for 8000 family. * The "if (!data->valid_tx_ant || !data->valid_rx_ant) {" check was getting triggered with a 3165 chipset. Submitted by: Imre Vadasz Obtained from: DragonflyBSD 3655dfb6fc311fc83e5ce8370dd91b4cd4a37991 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 2 05:43:16 2016 (r301192) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 2 06:22:59 2016 (r301193) @@ -1764,22 +1764,12 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK(radio_cfg); data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK(radio_cfg); data->radio_cfg_pnum = IWM_NVM_RF_CFG_PNUM_MSK(radio_cfg); - data->valid_tx_ant = IWM_NVM_RF_CFG_TX_ANT_MSK(radio_cfg); - data->valid_rx_ant = IWM_NVM_RF_CFG_RX_ANT_MSK(radio_cfg); sku = le16_to_cpup(nvm_sw + IWM_SKU); data->sku_cap_band_24GHz_enable = sku & IWM_NVM_SKU_CAP_BAND_24GHZ; data->sku_cap_band_52GHz_enable = sku & IWM_NVM_SKU_CAP_BAND_52GHZ; data->sku_cap_11n_enable = 0; - if (!data->valid_tx_ant || !data->valid_rx_ant) { - device_printf(sc->sc_dev, - "%s: invalid antennas (0x%x, 0x%x)\n", - __func__, data->valid_tx_ant, - data->valid_rx_ant); - return EINVAL; - } - data->n_hw_addrs = le16_to_cpup(nvm_sw + IWM_N_HW_ADDRS); data->xtal_calib[0] = *(nvm_calib + IWM_XTAL_CALIB); From owner-svn-src-head@freebsd.org Thu Jun 2 07:43:04 2016 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 F408FB64F2C; Thu, 2 Jun 2016 07:43:03 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id C14C512BA; Thu, 2 Jun 2016 07:43:03 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u527h2HS070363; Thu, 2 Jun 2016 07:43:02 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u527h2DQ070362; Thu, 2 Jun 2016 07:43:02 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606020743.u527h2DQ070362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 07:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301194 - head/sys/xen 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.22 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: Thu, 02 Jun 2016 07:43:04 -0000 Author: royger Date: Thu Jun 2 07:43:02 2016 New Revision: 301194 URL: https://svnweb.freebsd.org/changeset/base/301194 Log: xen: add missing #define in include guard. Submitted by: Akshay Jaggi Reviewed by: royger Modified: head/sys/xen/gnttab.h Modified: head/sys/xen/gnttab.h ============================================================================== --- head/sys/xen/gnttab.h Thu Jun 2 06:22:59 2016 (r301193) +++ head/sys/xen/gnttab.h Thu Jun 2 07:43:02 2016 (r301194) @@ -35,6 +35,7 @@ */ #ifndef __ASM_GNTTAB_H__ +#define __ASM_GNTTAB_H__ #include #include From owner-svn-src-head@freebsd.org Thu Jun 2 11:18:03 2016 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 9ED0EB644A4; Thu, 2 Jun 2016 11:18:03 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 78D601AFA; Thu, 2 Jun 2016 11:18:03 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BI2fY047386; Thu, 2 Jun 2016 11:18:02 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BI2q8047385; Thu, 2 Jun 2016 11:18:02 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021118.u52BI2q8047385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301199 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 11:18:03 -0000 Author: royger Date: Thu Jun 2 11:18:02 2016 New Revision: 301199 URL: https://svnweb.freebsd.org/changeset/base/301199 Log: xen-netfront: fix two hotplug related issues This patch fixes two issues seen on hot-unplug. The first one is a panic caused by calling ether_ifdetach after freeing the internal netfront queue structures. ether_ifdetach will call xn_qflush, and this needs to be done before freeing the queues. This prevents the following panic: Fatal trap 9: general protection fault while in kernel mode cpuid = 2; apic id = 04 instruction pointer = 0x20:0xffffffff80b1687f stack pointer = 0x28:0xfffffe009239e770 frame pointer = 0x28:0xfffffe009239e780 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (thread taskq) [ thread pid 0 tid 100015 ] Stopped at strlen+0x1f: movq (%rcx),%rax db> bt Tracing pid 0 tid 100015 td 0xfffff800038a6000 strlen() at strlen+0x1f/frame 0xfffffe009239e780 kvprintf() at kvprintf+0xfa0/frame 0xfffffe009239e890 vsnprintf() at vsnprintf+0x31/frame 0xfffffe009239e8b0 kassert_panic() at kassert_panic+0x5a/frame 0xfffffe009239e920 __mtx_lock_flags() at __mtx_lock_flags+0x164/frame 0xfffffe009239e970 xn_qflush() at xn_qflush+0x59/frame 0xfffffe009239e9b0 if_detach() at if_detach+0x17e/frame 0xfffffe009239ea10 netif_free() at netif_free+0x97/frame 0xfffffe009239ea30 netfront_detach() at netfront_detach+0x11/frame 0xfffffe009239ea40 [...] Another panic can be triggered by hot-plugging a NIC: Fatal trap 18: integer divide fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff80902203 stack pointer = 0x28:0xfffffe00508d3660 frame pointer = 0x28:0xfffffe00508d36a0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 2960 (ifconfig) [ thread pid 2960 tid 100088 ] Stopped at xn_txq_mq_start+0x33: divl %esi,%eax db> bt Tracing pid 2960 tid 100088 td 0xfffff8000850aa00 xn_txq_mq_start() at xn_txq_mq_start+0x33/frame 0xfffffe00508d36a0 ether_output() at ether_output+0x570/frame 0xfffffe00508d3720 arprequest() at arprequest+0x433/frame 0xfffffe00508d3820 arp_ifinit() at arp_ifinit+0x49/frame 0xfffffe00508d3850 xn_ioctl() at xn_ioctl+0x1a2/frame 0xfffffe00508d3890 in_control() at in_control+0x882/frame 0xfffffe00508d3910 ifioctl() at ifioctl+0xda1/frame 0xfffffe00508d39a0 kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe00508d3a00 sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe00508d3ae0 amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe00508d3bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00508d3bf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011e185a, rsp = 0x7fffffffe478, rbp = 0x7fffffffe4c0 --- This is caused by marking the driver as active before it's fully initialized, and thus calling xn_txq_mq_start with num_queues set to 0. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6646 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:16:35 2016 (r301198) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:18:02 2016 (r301199) @@ -1704,7 +1704,7 @@ xn_ifinit_locked(struct netfront_info *n ifp = np->xn_ifp; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING || !netfront_carrier_ok(np)) return; xn_stop(np); @@ -2088,6 +2088,8 @@ xn_txq_mq_start(struct ifnet *ifp, struc np = ifp->if_softc; npairs = np->num_queues; + KASSERT(npairs != 0, ("called with 0 available queues")); + /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) i = m->m_pkthdr.flowid % npairs; @@ -2202,9 +2204,9 @@ netif_free(struct netfront_info *np) xn_stop(np); XN_UNLOCK(np); netif_disconnect_backend(np); + ether_ifdetach(np->xn_ifp); free(np->rxq, M_DEVBUF); free(np->txq, M_DEVBUF); - ether_ifdetach(np->xn_ifp); if_free(np->xn_ifp); np->xn_ifp = NULL; ifmedia_removeall(&np->sc_media); From owner-svn-src-head@freebsd.org Thu Jun 2 11:28:07 2016 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 11904B64D5B; Thu, 2 Jun 2016 11:28:07 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C9121A1E; Thu, 2 Jun 2016 11:28:06 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id a136so225291055wme.0; Thu, 02 Jun 2016 04:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=JVeaj5ZH4eEAnT5ngbHOBS5k/8E8op0Z+mxESMj9wgI=; b=B4M+v5FrJdVvTeIF73PI1SOgTozvcrlRBVzdqiUN3HN9uUhhmS2gX+yB5WymhkUbRc QhYxTRWQeqrfi/AD/97Cbg9FGpFcPcpFntJKr+khgRdJwn46Tron+/DjqHXwicvG4PZJ VClQfjWA/4e1EdZSdSSwThvuzAbUjvG0IdA+xzbK/sLNlnQFMsyeWnwbYFxpEkdrbzaA iLDIZS/BKEG2hgENZTV/GGvWMvhX2avtW08sKjiMagYqUtD5p06A6bkKWiHFe41WgZ6v 6kuJQV53ayj2zw5KCWTdXpfrmc7OjshkKVzRZNA403E1BhpK26YK7drDi2HVc8QoCw6X ttZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=JVeaj5ZH4eEAnT5ngbHOBS5k/8E8op0Z+mxESMj9wgI=; b=Slv1MzzaCMsIUl/SOyR1yEThuB4t1MUYTKETXaFaK+LU2KovVoDsywukaDC1Hm+Qpe DafzjHiYW9zrJ3AnDSc8pD7P+q+XTsGxHl9rOBSmETzA4sJHBMeIAN3AL338kQyQ5vyG qCdJRB9wgr8beTb1LHAZD5GIEfG41GRgEjaydm6PbN806ZjdhSbmtctZ2Jmvj9AXB73E ud6HRcArVhZkySN5+NeNWEuhua+mVbBTXugkrUP+UJbRWEOVwKyyyIqD1GkVt95H0Z86 GxF0CXCNkxQKdwauenQIjlAQwvXqvjWX0igLYPHPhaUQU8ZIIF0CYS4PMuO5OMGiArWl ySvg== X-Gm-Message-State: ALyK8tJ7WRe4kGwEctuh4KaRRoKbCUImyKyxVjionwYIwRqzu2wvbkN0BFk85K0W1YF/Kg== X-Received: by 10.194.175.36 with SMTP id bx4mr8119107wjc.35.1464866885169; Thu, 02 Jun 2016 04:28:05 -0700 (PDT) Received: from localhost (98.red-79-145-83.dynamicip.rima-tde.net. [79.145.83.98]) by smtp.gmail.com with ESMTPSA id d86sm39798726wmh.4.2016.06.02.04.28.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jun 2016 04:28:04 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 2 Jun 2016 13:28:01 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301197 - head/sys/dev/xen/netfront Message-ID: <20160602112801.yqxgblpmxml6d3uz@mac> References: <201606021114.u52BEQqB047172@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201606021114.u52BEQqB047172@repo.freebsd.org> User-Agent: Mutt/1.6.0-neo (2016-04-07) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 11:28:07 -0000 On Thu, Jun 02, 2016 at 11:14:26AM +0000, Roger Pau Monné wrote: > Author: royger > Date: Thu Jun 2 11:14:26 2016 > New Revision: 301197 > URL: https://svnweb.freebsd.org/changeset/base/301197 > > Log: > xen-netfront: always keep the Rx ring full of requests > > This is based on Linux commit 1f3c2eba1e2d866ef99bb9b10ade4096e3d7607c from > David Vrabel: > > A full Rx ring only requires 1 MiB of memory. This is not enough memory > that it is useful to dynamically scale the number of Rx requests in the ring > based on traffic rates, because: > > a) Even the full 1 MiB is a tiny fraction of a typically modern Linux > VM (for example, the AWS micro instance still has 1 GiB of memory). > > b) Netfront would have used up to 1 MiB already even with moderate > data rates (there was no adjustment of target based on memory > pressure). > > c) Small VMs are going to typically have one VCPU and hence only one > queue. > > Keeping the ring full of Rx requests handles bursty traffic better than > trying to converge on an optimal number of requests to keep filled. > > Reviewed by: Wei Liu > Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6610 From owner-svn-src-head@freebsd.org Thu Jun 2 12:57:42 2016 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 940F6B64ACA; Thu, 2 Jun 2016 12:57:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 5EE581A5D; Thu, 2 Jun 2016 12:57:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 793671FE024; Thu, 2 Jun 2016 14:57:40 +0200 (CEST) Subject: Re: svn commit: r301197 - head/sys/dev/xen/netfront To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <201606021114.u52BEQqB047172@repo.freebsd.org> <2c81e44d-65de-10f0-8837-f23896855150@selasky.org> <20160602125422.gmdsueoeu5fiiec5@mac> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Thu, 2 Jun 2016 15:01:03 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160602125422.gmdsueoeu5fiiec5@mac> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 12:57:42 -0000 On 06/02/16 14:54, Roger Pau Monné wrote: > On Thu, Jun 02, 2016 at 01:19:56PM +0200, Hans Petter Selasky wrote: >> On 06/02/16 13:14, Roger Pau Monné wrote: >>> + callout_reset(&rxq->rx_refill, hz/10, xn_alloc_rx_buffers_callout, >>> + rxq); >> >> Maybe use callout_reset_curcpu() to take advantage of callout's SMP >> capabilities ? > > Yes, that's fine. But what's the benefit of it? I don't really care whether > the callout is run on the current CPU or not. Is callout_reset_curcpu > cheaper than callout_reset? > Hi, It is maybe not cheaper, but it will distribute the load of the xn_alloc_rx_buffers_callout() callback, to the current CPU calling callout_reset_curcpu(). Else xn_alloc_rx_buffers_callout() will always be called from callback thread zero. --HPS From owner-svn-src-head@freebsd.org Thu Jun 2 12:54:29 2016 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 74933B6493E; Thu, 2 Jun 2016 12:54:29 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D564185E; Thu, 2 Jun 2016 12:54:29 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id z87so68500746wmh.0; Thu, 02 Jun 2016 05:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=xN+kHvAWJ8lWcgOsT4qcIo0q6AwxcJKDMOlq1FIrliA=; b=Toq5AG3NnxymabsAHIcAKWCJuDuIaZ/9VKsKg621Xx6LXhZ4S/OBorRGC47efgax+4 HVAX9+GACAhPy0neUsXeyRBk4h965dVLjn7R3Voirtm3/Fv5sKkvdqbQpPiaJzjBFxul HAFdFlnZ22f325YihLc1NLEVeqSC6cRGxgQ3RQL1Jeq+qKa7rkJz9MDxuVz2dr3CDZ91 O5Nlt4LgSz9NqcXM3ADglXdinYmVDfmsZGElun9R33hDUxaPJ9T0Q3kfeDuuQjrw9tjd gxwSXzt+5yZ5w0F//BAaHFj3kC2/kfRrYxpm6TnK9P89MLU6MWQDNb9hga/iJUmk26M/ Cltg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=xN+kHvAWJ8lWcgOsT4qcIo0q6AwxcJKDMOlq1FIrliA=; b=VNtzWtLrEHGFVdzL1h4JI1tCEbDLXYKOFi3m7DH7uNATWF1JXflF9GporhIsObPTF/ VSc+p5F/tYyT68GdAXn9ltpxcqGkyXsa7hfYnPaNCuu8VzJu2i59yDHSwMvS8Nyis7By k0X2J2Hdc0IXAFM5IPCg6/nroD9XnJ2exCj20u0lcy5gdliI9MjNw9juibnevvA9Z+Q0 xmBdVU1s24mOHW2WwslYBCYqlOL2g0aL9rMd+EPKrtzz4xuaNobirRL6bM4NzW7/kgvL CtWw7PAHK7os+cqnHHZ41dvmsKdyfCDubdYyy/Y0fY7K/LAU7e/a3gWnIoqx9yFFjFDC h21Q== X-Gm-Message-State: ALyK8tI2aGkb8wTkF0KcNuT8BHT/kWEmQQymYer73tVa3JFdHKxCp4dq+FbN+gR02Nab8w== X-Received: by 10.28.21.204 with SMTP id 195mr15951407wmv.64.1464872067589; Thu, 02 Jun 2016 05:54:27 -0700 (PDT) Received: from localhost (31.red-88-8-193.dynamicip.rima-tde.net. [88.8.193.31]) by smtp.gmail.com with ESMTPSA id j9sm438493wju.46.2016.06.02.05.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jun 2016 05:54:26 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 2 Jun 2016 14:54:22 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301197 - head/sys/dev/xen/netfront Message-ID: <20160602125422.gmdsueoeu5fiiec5@mac> References: <201606021114.u52BEQqB047172@repo.freebsd.org> <2c81e44d-65de-10f0-8837-f23896855150@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2c81e44d-65de-10f0-8837-f23896855150@selasky.org> User-Agent: Mutt/1.6.0-neo (2016-04-07) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 12:54:29 -0000 On Thu, Jun 02, 2016 at 01:19:56PM +0200, Hans Petter Selasky wrote: > On 06/02/16 13:14, Roger Pau Monné wrote: > > + callout_reset(&rxq->rx_refill, hz/10, xn_alloc_rx_buffers_callout, > > + rxq); > > Maybe use callout_reset_curcpu() to take advantage of callout's SMP > capabilities ? Yes, that's fine. But what's the benefit of it? I don't really care whether the callout is run on the current CPU or not. Is callout_reset_curcpu cheaper than callout_reset? Roger. From owner-svn-src-head@freebsd.org Wed Jun 1 21:58:15 2016 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 502EEB669DD; Wed, 1 Jun 2016 21:58:15 +0000 (UTC) (envelope-from jilles@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 mx1.freebsd.org (Postfix) with ESMTPS id 1F703128A; Wed, 1 Jun 2016 21:58:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51LwEfZ052959; Wed, 1 Jun 2016 21:58:14 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51LwD1D052954; Wed, 1 Jun 2016 21:58:13 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606012158.u51LwD1D052954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 1 Jun 2016 21:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301171 - head/lib/libc/sys 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.22 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, 01 Jun 2016 21:58:15 -0000 Author: jilles Date: Wed Jun 1 21:58:13 2016 New Revision: 301171 URL: https://svnweb.freebsd.org/changeset/base/301171 Log: thr_*(2): Add xrefs to what libthr implements using each syscall. Add text to thr_exit(2) and thr_new(2) discouraging their use in applications since calling these in a process with libthr loaded will confuse libthr and is likely to cause hangs or crashes. The thr_kill2(2) call is not used by libthr and may be useful in special applications. The other calls can be used in applications but it should not be necessary. Modified: head/lib/libc/sys/thr_exit.2 head/lib/libc/sys/thr_kill.2 head/lib/libc/sys/thr_new.2 head/lib/libc/sys/thr_self.2 head/lib/libc/sys/thr_set_name.2 Modified: head/lib/libc/sys/thr_exit.2 ============================================================================== --- head/lib/libc/sys/thr_exit.2 Wed Jun 1 21:52:12 2016 (r301170) +++ head/lib/libc/sys/thr_exit.2 Wed Jun 1 21:58:13 2016 (r301171) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd June 1, 2016 .Dt THR_EXIT 2 .Os .Sh NAME @@ -41,6 +41,13 @@ .Ft void .Fn thr_exit "long *state" .Sh DESCRIPTION +.Bf -symbolic +This function is intended for implementing threading. +Normal applications should call +.Xr pthread_exit 3 +instead. +.Ef +.Pp The .Fn thr_exit system call terminates the current kernel-scheduled thread. @@ -70,7 +77,8 @@ last one in the process. .Xr thr_new 2 , .Xr thr_self 2 , .Xr thr_set_name 2 , -.Xr _umtx_op 2 +.Xr _umtx_op 2 , +.Xr pthread_exit 3 .Sh STANDARDS The .Fn thr_exit Modified: head/lib/libc/sys/thr_kill.2 ============================================================================== --- head/lib/libc/sys/thr_kill.2 Wed Jun 1 21:52:12 2016 (r301170) +++ head/lib/libc/sys/thr_kill.2 Wed Jun 1 21:58:13 2016 (r301171) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd June 1, 2016 .Dt THR_kill 2 .Os .Sh NAME @@ -112,11 +112,13 @@ The current process does not have suffic send a signal to the specified process. .El .Sh SEE ALSO +.Xr kill 2 , .Xr thr_exit 2 , .Xr thr_new 2 , .Xr thr_self 2 , .Xr thr_set_name 2 , .Xr _umtx_op 2 , +.Xr pthread_kill 3 , .Xr signal 3 .Sh STANDARDS The Modified: head/lib/libc/sys/thr_new.2 ============================================================================== --- head/lib/libc/sys/thr_new.2 Wed Jun 1 21:52:12 2016 (r301170) +++ head/lib/libc/sys/thr_new.2 Wed Jun 1 21:58:13 2016 (r301171) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd June 1, 2016 .Dt THR_NEW 2 .Os .Sh NAME @@ -41,6 +41,13 @@ .Ft int .Fn thr_new "struct thr_param *param" "int param_size" .Sh DESCRIPTION +.Bf -symbolic +This function is intended for implementing threading. +Normal applications should call +.Xr pthread_create 3 +instead. +.Ef +.Pp The .Fn thr_new system call creates a new kernel-scheduled thread of execution in the context @@ -220,7 +227,8 @@ No kernel memory to allocate for the new .Xr thr_kill2 2 , .Xr thr_self 2 , .Xr thr_set_name 2 , -.Xr _umtx_op 2 +.Xr _umtx_op 2 , +.Xr pthread_create 3 .Sh STANDARDS The .Fn thr_new Modified: head/lib/libc/sys/thr_self.2 ============================================================================== --- head/lib/libc/sys/thr_self.2 Wed Jun 1 21:52:12 2016 (r301170) +++ head/lib/libc/sys/thr_self.2 Wed Jun 1 21:58:13 2016 (r301171) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd June 1, 2016 .Dt THR_SELF 2 .Os .Sh NAME @@ -76,7 +76,9 @@ argument is not valid. .Xr thr_kill2 2 , .Xr thr_new 2 , .Xr thr_set_name 2 , -.Xr _umtx_op 2 +.Xr _umtx_op 2 , +.Xr pthread_getthreadid_np 3 , +.Xr pthread_self 3 .Sh STANDARDS The .Fn thr_self Modified: head/lib/libc/sys/thr_set_name.2 ============================================================================== --- head/lib/libc/sys/thr_set_name.2 Wed Jun 1 21:52:12 2016 (r301170) +++ head/lib/libc/sys/thr_set_name.2 Wed Jun 1 21:58:13 2016 (r301171) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd June 1, 2016 .Dt THR_SET_NAME 2 .Os .Sh NAME @@ -87,6 +87,7 @@ does not exist in the current process. .Xr thr_new 2 , .Xr thr_self 2 , .Xr _umtx_op 2 , +.Xr pthread_set_name_np 3 , .Xr ddb 4 , .Xr ktr 9 .Sh STANDARDS From owner-svn-src-head@freebsd.org Wed Jun 1 22:11:55 2016 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 7BE77B66E56; Wed, 1 Jun 2016 22:11:55 +0000 (UTC) (envelope-from glebius@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 mx1.freebsd.org (Postfix) with ESMTPS id 4B00A1BEF; Wed, 1 Jun 2016 22:11:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51MBsuI060042; Wed, 1 Jun 2016 22:11:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51MBsV8060041; Wed, 1 Jun 2016 22:11:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201606012211.u51MBsV8060041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 1 Jun 2016 22:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301173 - head/sys/geom/mirror 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.22 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, 01 Jun 2016 22:11:55 -0000 Author: glebius Date: Wed Jun 1 22:11:54 2016 New Revision: 301173 URL: https://svnweb.freebsd.org/changeset/base/301173 Log: When we are in panic, always go the asynchronous path in g_mirror_destroy(), otherwise the system will hang. This is a temporarily least intrusive crutch to get certain panicing systems dumping. The proper fix should question is g_mirror_destroy() should be called on a panicing system at all. Discussed with: mav Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jun 1 22:04:10 2016 (r301172) +++ head/sys/geom/mirror/g_mirror.c Wed Jun 1 22:11:54 2016 (r301173) @@ -2989,7 +2989,8 @@ g_mirror_destroy(struct g_mirror_softc * sx_assert(&sc->sc_lock, SX_XLOCKED); pp = sc->sc_provider; - if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { + if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0 || + SCHEDULER_STOPPED())) { switch (how) { case G_MIRROR_DESTROY_SOFT: G_MIRROR_DEBUG(1, From owner-svn-src-head@freebsd.org Wed Jun 1 23:20:33 2016 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 D2991B64D3C; Wed, 1 Jun 2016 23:20:33 +0000 (UTC) (envelope-from landonf@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 mx1.freebsd.org (Postfix) with ESMTPS id A3CF512A7; Wed, 1 Jun 2016 23:20:33 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51NKWIJ083416; Wed, 1 Jun 2016 23:20:32 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51NKWUP083415; Wed, 1 Jun 2016 23:20:32 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606012320.u51NKWUP083415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 1 Jun 2016 23:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301179 - head/share/misc 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.22 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, 01 Jun 2016 23:20:33 -0000 Author: landonf Date: Wed Jun 1 23:20:32 2016 New Revision: 301179 URL: https://svnweb.freebsd.org/changeset/base/301179 Log: Add myself as src commiter. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6686 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jun 1 22:39:15 2016 (r301178) +++ head/share/misc/committers-src.dot Wed Jun 1 23:20:32 2016 (r301179) @@ -218,6 +218,7 @@ kevlo [label="Kevin Lo\nkevlo@FreeBSD.or kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] kp [label="Kristof Provost\nkp@FreeBSD.org\n2015/03/22"] +landonf [label="Landon Fuller\nlandonf@FreeBSD.org\n2016/05/31"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] lidl [label="Kurt Lidl\nlidl@FreeBSD.org\n2015/10/21"] loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] @@ -346,6 +347,7 @@ day1 -> dg adrian -> avos adrian -> jmcneill +adrian -> landonf adrian -> lidl adrian -> loos adrian -> monthadar From owner-svn-src-head@freebsd.org Wed Jun 1 22:21:43 2016 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 DB69DB660B1; Wed, 1 Jun 2016 22:21:43 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id A86301F4A; Wed, 1 Jun 2016 22:21:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51MLg3m062395; Wed, 1 Jun 2016 22:21:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51MLgwZ062394; Wed, 1 Jun 2016 22:21:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606012221.u51MLgwZ062394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 Jun 2016 22:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301174 - head/sys/cddl/contrib/opensolaris/uts/common/sys 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.22 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, 01 Jun 2016 22:21:44 -0000 Author: asomers Date: Wed Jun 1 22:21:42 2016 New Revision: 301174 URL: https://svnweb.freebsd.org/changeset/base/301174 Log: Improve the English in a comment sys/cddl/contrib/opensolaris/uts/common/sys/acl.h: Improve the english in a comment. No functional changes Submitted by: gibbs MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Wed Jun 1 22:11:54 2016 (r301173) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Wed Jun 1 22:21:42 2016 (r301174) @@ -35,8 +35,8 @@ #if defined(_KERNEL) /* - * When compiling OpenSolaris kernel code, this file is getting - * included instead of FreeBSD one. Pull the original sys/acl.h as well. + * When compiling OpenSolaris kernel code, this file is included instead of the + * FreeBSD one. Include the original sys/acl.h as well. */ #undef _SYS_ACL_H #include_next From owner-svn-src-head@freebsd.org Wed Jun 1 22:31:36 2016 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 6111AB667F0; Wed, 1 Jun 2016 22:31:36 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id 3D0181AD5; Wed, 1 Jun 2016 22:31:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51MVZRn065596; Wed, 1 Jun 2016 22:31:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51MVZeh065594; Wed, 1 Jun 2016 22:31:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606012231.u51MVZeh065594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 Jun 2016 22:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301176 - head/sys/vm 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.22 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, 01 Jun 2016 22:31:36 -0000 Author: markj Date: Wed Jun 1 22:31:35 2016 New Revision: 301176 URL: https://svnweb.freebsd.org/changeset/base/301176 Log: Fix memguard(9) in kernels with INVARIANTS enabled. With r284861, UMA zones use the trash ctor and dtor by default. This is incompatible with memguard, which frees the backing page when the item is freed. Modify the UMA debug functions to be no-ops if the item was allocated from memguard. This also fixes constructors such as mb_ctor_pack(), which invokes the trash ctor in addition to performing some initialization. Reviewed by: glebius MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D6562 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_dbg.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Jun 1 22:31:13 2016 (r301175) +++ head/sys/vm/uma_core.c Wed Jun 1 22:31:35 2016 (r301176) @@ -2112,16 +2112,10 @@ uma_zalloc_arg(uma_zone_t zone, void *ud if (memguard_cmp_zone(zone)) { item = memguard_alloc(zone->uz_size, flags); if (item != NULL) { - /* - * Avoid conflict with the use-after-free - * protecting infrastructure from INVARIANTS. - */ if (zone->uz_init != NULL && - zone->uz_init != mtrash_init && zone->uz_init(item, zone->uz_size, flags) != 0) return (NULL); if (zone->uz_ctor != NULL && - zone->uz_ctor != mtrash_ctor && zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { zone->uz_fini(item, zone->uz_size); @@ -2655,9 +2649,9 @@ uma_zfree_arg(uma_zone_t zone, void *ite return; #ifdef DEBUG_MEMGUARD if (is_memguard_addr(item)) { - if (zone->uz_dtor != NULL && zone->uz_dtor != mtrash_dtor) + if (zone->uz_dtor != NULL) zone->uz_dtor(item, zone->uz_size, udata); - if (zone->uz_fini != NULL && zone->uz_fini != mtrash_fini) + if (zone->uz_fini != NULL) zone->uz_fini(item, zone->uz_size); memguard_free(item); return; Modified: head/sys/vm/uma_dbg.c ============================================================================== --- head/sys/vm/uma_dbg.c Wed Jun 1 22:31:13 2016 (r301175) +++ head/sys/vm/uma_dbg.c Wed Jun 1 22:31:35 2016 (r301176) @@ -33,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_vm.h" + #include #include #include @@ -49,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static const uint32_t uma_junk = 0xdeadc0de; @@ -57,7 +60,6 @@ static const uint32_t uma_junk = 0xdeadc * prior to subsequent reallocation. * * Complies with standard ctor arg/return - * */ int trash_ctor(void *mem, int size, void *arg, int flags) @@ -65,6 +67,11 @@ trash_ctor(void *mem, int size, void *ar int cnt; uint32_t *p; +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(mem)) + return (0); +#endif + cnt = size / sizeof(uma_junk); for (p = mem; cnt > 0; cnt--, p++) @@ -93,6 +100,11 @@ trash_dtor(void *mem, int size, void *ar int cnt; uint32_t *p; +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(mem)) + return; +#endif + cnt = size / sizeof(uma_junk); for (p = mem; cnt > 0; cnt--, p++) @@ -131,6 +143,11 @@ mtrash_ctor(void *mem, int size, void *a uint32_t *p = mem; int cnt; +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(mem)) + return (0); +#endif + size -= sizeof(struct malloc_type *); ksp = (struct malloc_type **)mem; ksp += size / sizeof(struct malloc_type *); @@ -158,6 +175,11 @@ mtrash_dtor(void *mem, int size, void *a int cnt; uint32_t *p; +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(mem)) + return; +#endif + size -= sizeof(struct malloc_type *); cnt = size / sizeof(uma_junk); @@ -176,6 +198,11 @@ mtrash_init(void *mem, int size, int fla { struct malloc_type **ksp; +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(mem)) + return (0); +#endif + mtrash_dtor(mem, size, NULL); ksp = (struct malloc_type **)mem; From owner-svn-src-head@freebsd.org Wed Jun 1 22:34:23 2016 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 2278AB6695A; Wed, 1 Jun 2016 22:34:23 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id E924E1CD6; Wed, 1 Jun 2016 22:34:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51MYMKk067746; Wed, 1 Jun 2016 22:34:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51MYMd4067745; Wed, 1 Jun 2016 22:34:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606012234.u51MYMd4067745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 Jun 2016 22:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301177 - head/share/man/man9 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.22 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, 01 Jun 2016 22:34:23 -0000 Author: markj Date: Wed Jun 1 22:34:21 2016 New Revision: 301177 URL: https://svnweb.freebsd.org/changeset/base/301177 Log: Remove the BUGS entry in memguard's man page. UMA refcounting is gone as of r296243, so this bug no longer exists. In particular, it's now possible to guard mbuf clusters with memguard. Modified: head/share/man/man9/memguard.9 Modified: head/share/man/man9/memguard.9 ============================================================================== --- head/share/man/man9/memguard.9 Wed Jun 1 22:31:35 2016 (r301176) +++ head/share/man/man9/memguard.9 Wed Jun 1 22:34:21 2016 (r301177) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2014 +.Dd June 1, 2016 .Dt MEMGUARD 9 .Os .Sh NAME @@ -204,17 +204,3 @@ Additions have been made by and .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org to both the implementation and the documentation. -.Sh BUGS -It is not possible to guard allocations that really expect themselves to be -allocated from -.Xr uma 9 , -utilizing additional interfaces apart from -.Fn uma_zalloc -and -.Fn uma_free , -for example -.Fn uma_find_refcnt . -For the moment of writing only -.Xr mbuf 9 -cluster zones belong to that kind of allocations. -Attempt to guard them would lead to kernel panic. From owner-svn-src-head@freebsd.org Thu Jun 2 00:42:16 2016 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 C77F8B5583D; Thu, 2 Jun 2016 00:42:16 +0000 (UTC) (envelope-from truckman@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 mx1.freebsd.org (Postfix) with ESMTPS id 875691FF8; Thu, 2 Jun 2016 00:42:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u520gFR9015652; Thu, 2 Jun 2016 00:42:15 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u520gFKO015651; Thu, 2 Jun 2016 00:42:15 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606020042.u520gFKO015651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 2 Jun 2016 00:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301180 - head/sbin/ipfw 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.22 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: Thu, 02 Jun 2016 00:42:16 -0000 Author: truckman Date: Thu Jun 2 00:42:15 2016 New Revision: 301180 URL: https://svnweb.freebsd.org/changeset/base/301180 Log: Belatedly bump .Dd date for Dummynet AQM import in r300779. Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Jun 1 23:20:32 2016 (r301179) +++ head/sbin/ipfw/ipfw.8 Thu Jun 2 00:42:15 2016 (r301180) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2015 +.Dd May 26, 2016 .Dt IPFW 8 .Os .Sh NAME From owner-svn-src-head@freebsd.org Thu Jun 2 01:59:43 2016 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 2AF90B66425; Thu, 2 Jun 2016 01:59:43 +0000 (UTC) (envelope-from gnn@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 mx1.freebsd.org (Postfix) with ESMTPS id EF36C1866; Thu, 2 Jun 2016 01:59:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u521xgEe041247; Thu, 2 Jun 2016 01:59:42 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u521xgqT041246; Thu, 2 Jun 2016 01:59:42 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201606020159.u521xgqT041246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 2 Jun 2016 01:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301182 - head/sys/dev/ath 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.22 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: Thu, 02 Jun 2016 01:59:43 -0000 Author: gnn Date: Thu Jun 2 01:59:41 2016 New Revision: 301182 URL: https://svnweb.freebsd.org/changeset/base/301182 Log: Fix kernel build. Improper definition location of a variable. Modified: head/sys/dev/ath/if_ath_btcoex_mci.c Modified: head/sys/dev/ath/if_ath_btcoex_mci.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex_mci.c Thu Jun 2 00:51:36 2016 (r301181) +++ head/sys/dev/ath/if_ath_btcoex_mci.c Thu Jun 2 01:59:41 2016 (r301182) @@ -436,6 +436,7 @@ ath_btcoex_mci_intr(struct ath_softc *sc uint32_t offset, subtype, opcode; uint32_t *pGpm; uint32_t more_data = HAL_MCI_GPM_MORE; + int8_t value_dbm; bool skip_gpm = false; DPRINTF(sc, ATH_DEBUG_BTCOEX, "%s: called\n", __func__); @@ -607,7 +608,7 @@ ath_btcoex_mci_intr(struct ath_softc *sc DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) LNA_INFO\n"); } if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO) { - int8_t value_dbm = ath_hal_btcoex_mci_state(sc->sc_ah, + value_dbm = ath_hal_btcoex_mci_state(sc->sc_ah, HAL_MCI_STATE_CONT_RSSI_POWER, NULL); mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO; From owner-svn-src-head@freebsd.org Thu Jun 2 05:00:54 2016 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 3184DB67A59; Thu, 2 Jun 2016 05:00:54 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id DC15A1D42; Thu, 2 Jun 2016 05:00:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5250rFi008577; Thu, 2 Jun 2016 05:00:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5250rwE008576; Thu, 2 Jun 2016 05:00:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020500.u5250rwE008576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 05:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301191 - head/sys/dev/iwm 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.22 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: Thu, 02 Jun 2016 05:00:54 -0000 Author: adrian Date: Thu Jun 2 05:00:52 2016 New Revision: 301191 URL: https://svnweb.freebsd.org/changeset/base/301191 Log: [iwm] Add bit-polling in Rx-DMA init code path. Taken-From: OpenBSD (if_iwm.c r1.80) Submitted by: Imre Vadasz Obtained from: DragonflyBSD ed35558754288911048cb607e57c688273ebd8d4 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 2 04:54:56 2016 (r301190) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 2 05:00:52 2016 (r301191) @@ -225,6 +225,7 @@ static void iwm_free_kw(struct iwm_softc static int iwm_alloc_ict(struct iwm_softc *); static void iwm_free_ict(struct iwm_softc *); static int iwm_alloc_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); +static void iwm_disable_rx_dma(struct iwm_softc *); static void iwm_reset_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static void iwm_free_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static int iwm_alloc_tx_ring(struct iwm_softc *, struct iwm_tx_ring *, @@ -881,7 +882,7 @@ fail: iwm_free_rx_ring(sc, ring); } static void -iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) +iwm_disable_rx_dma(struct iwm_softc *sc) { /* XXX print out if we can't lock the NIC? */ @@ -890,6 +891,11 @@ iwm_reset_rx_ring(struct iwm_softc *sc, (void) iwm_pcie_rx_stop(sc); iwm_nic_unlock(sc); } +} + +static void +iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) +{ /* Reset the ring state */ ring->cur = 0; memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); @@ -1152,6 +1158,7 @@ iwm_stop_device(struct iwm_softc *sc) } iwm_nic_unlock(sc); } + iwm_disable_rx_dma(sc); /* Stop RX ring. */ iwm_reset_rx_ring(sc, &sc->rxq); @@ -1241,7 +1248,7 @@ iwm_nic_rx_init(struct iwm_softc *sc) memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); /* stop DMA */ - IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); + iwm_disable_rx_dma(sc); IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_RBDCB_WPTR, 0); IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_FLUSH_RB_REQ, 0); IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_RDPTR, 0); From owner-svn-src-head@freebsd.org Thu Jun 2 05:43:18 2016 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 7F712B632E1; Thu, 2 Jun 2016 05:43:18 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 42DFB1489; Thu, 2 Jun 2016 05:43:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u525hHwk026336; Thu, 2 Jun 2016 05:43:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u525hHQw026330; Thu, 2 Jun 2016 05:43:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020543.u525hHQw026330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 05:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301192 - head/sys/dev/iwm 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.22 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: Thu, 02 Jun 2016 05:43:18 -0000 Author: adrian Date: Thu Jun 2 05:43:16 2016 New Revision: 301192 URL: https://svnweb.freebsd.org/changeset/base/301192 Log: [iwm] Fix several nitpicks in iwm(4). Move some declarations to if_iwmreg.h. Remove iwm_fw_alive(); just call iwm_post_alive() directly. Simplify iwm_mvm_add_sta(). Return timeout error from iwm_apm_init(). Print a message when init (i.e. boot) firmware fails to load. Remove some commented-out code which wouldn't compile anyway. Move iwm_mvm_tx_fifo to if_iwmreg.h to match better where Linux puts it. Taken-From: OpenBSD (if_iwm.c r1.80 and if_iwmreg.h r1.11) Submitted by: Imre Vadasz Obtained from: DragonflyBSD 29fcb331e5620ae145a6ab9cdda830e22fff626a Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwm_phy_db.h head/sys/dev/iwm/if_iwm_power.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 2 05:00:52 2016 (r301191) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 2 05:43:16 2016 (r301192) @@ -265,7 +265,6 @@ static int iwm_firmware_load_chunk(struc const uint8_t *, uint32_t); static int iwm_load_firmware(struct iwm_softc *, enum iwm_ucode_type); static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_fw_alive(struct iwm_softc *, uint32_t); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, @@ -1353,14 +1352,6 @@ iwm_nic_init(struct iwm_softc *sc) return 0; } -enum iwm_mvm_tx_fifo { - IWM_MVM_TX_FIFO_BK = 0, - IWM_MVM_TX_FIFO_BE, - IWM_MVM_TX_FIFO_VI, - IWM_MVM_TX_FIFO_VO, - IWM_MVM_TX_FIFO_MCAST = 5, -}; - const uint8_t iwm_mvm_ac_to_tx_fifo[] = { IWM_MVM_TX_FIFO_VO, IWM_MVM_TX_FIFO_VI, @@ -2005,12 +1996,6 @@ iwm_start_fw(struct iwm_softc *sc, enum } static int -iwm_fw_alive(struct iwm_softc *sc, uint32_t sched_base) -{ - return iwm_post_alive(sc); -} - -static int iwm_send_tx_ant_cfg(struct iwm_softc *sc, uint8_t valid_tx_ant) { struct iwm_tx_ant_cfg_cmd tx_ant_cmd = { @@ -2058,7 +2043,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm return error; } - return iwm_fw_alive(sc, sc->sched_base); + return iwm_post_alive(sc); } /* @@ -2082,8 +2067,10 @@ iwm_run_init_mvm_ucode(struct iwm_softc sc->sc_init_complete = 0; if ((error = iwm_mvm_load_ucode_wait_alive(sc, - IWM_UCODE_TYPE_INIT)) != 0) + IWM_UCODE_TYPE_INIT)) != 0) { + device_printf(sc->sc_dev, "failed to load init firmware\n"); return error; + } if (justnvm) { if ((error = iwm_nvm_init(sc)) != 0) { @@ -3022,13 +3009,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc static int iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in) { - int ret; - - ret = iwm_mvm_sta_send_to_fw(sc, in, 0); - if (ret) - return ret; - - return 0; + return iwm_mvm_sta_send_to_fw(sc, in, 0); } static int Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Jun 2 05:00:52 2016 (r301191) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Jun 2 05:43:16 2016 (r301192) @@ -363,6 +363,8 @@ iwm_prepare_card_hw(struct iwm_softc *sc if (iwm_set_hw_ready(sc)) goto out; + DELAY(100); + /* If HW is not ready, prepare the conditions to check again */ IWM_SETBITS(sc, IWM_CSR_HW_IF_CONFIG_REG, IWM_CSR_HW_IF_CONFIG_REG_PREPARE); @@ -456,7 +458,7 @@ iwm_apm_init(struct iwm_softc *sc) IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000)) { device_printf(sc->sc_dev, "timeout waiting for clock stabilization\n"); - + error = ETIMEDOUT; goto out; } Modified: head/sys/dev/iwm/if_iwm_phy_db.h ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.h Thu Jun 2 05:00:52 2016 (r301191) +++ head/sys/dev/iwm/if_iwm_phy_db.h Thu Jun 2 05:43:16 2016 (r301192) @@ -106,41 +106,6 @@ #ifndef __IF_IWM_PHY_DB_H__ #define __IF_IWM_PHY_DB_H__ -enum iwm_phy_db_section_type { - IWM_PHY_DB_CFG = 1, - IWM_PHY_DB_CALIB_NCH, - IWM_PHY_DB_UNUSED, - IWM_PHY_DB_CALIB_CHG_PAPD, - IWM_PHY_DB_CALIB_CHG_TXP, - IWM_PHY_DB_MAX -}; - -#define IWM_PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ - -/* - * phy db - configure operational ucode - */ -struct iwm_phy_db_cmd { - uint16_t type; - uint16_t length; - uint8_t data[]; -} __packed; - -/* for parsing of tx power channel group data that comes from the firmware*/ -struct iwm_phy_db_chg_txp { - uint32_t space; - uint16_t max_channel_idx; -} __packed; - -/* - * phy db - Receive phy db chunk after calibrations - */ -struct iwm_calib_res_notif_phy_db { - uint16_t type; - uint16_t length; - uint8_t data[]; -} __packed; - extern int iwm_phy_db_set_section(struct iwm_softc *sc, struct iwm_calib_res_notif_phy_db *phy_db_notif); extern int iwm_send_phy_db_data(struct iwm_softc *sc); Modified: head/sys/dev/iwm/if_iwm_power.c ============================================================================== --- head/sys/dev/iwm/if_iwm_power.c Thu Jun 2 05:00:52 2016 (r301191) +++ head/sys/dev/iwm/if_iwm_power.c Thu Jun 2 05:43:16 2016 (r301192) @@ -233,30 +233,6 @@ iwm_mvm_power_log(struct iwm_softc *sc, "Disable power management\n"); return; } - KASSERT(0, ("unhandled power management")); - -#if 0 - DPRINTF(mvm, "Rx timeout = %u usec\n", - le32_to_cpu(cmd->rx_data_timeout)); - DPRINTF(mvm, "Tx timeout = %u usec\n", - le32_to_cpu(cmd->tx_data_timeout)); - if (cmd->flags & cpu_to_le16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK)) - DPRINTF(mvm, "DTIM periods to skip = %u\n", - cmd->skip_dtim_periods); - if (cmd->flags & cpu_to_le16(IWM_POWER_FLAGS_LPRX_ENA_MSK)) - DPRINTF(mvm, "LP RX RSSI threshold = %u\n", - cmd->lprx_rssi_threshold); - if (cmd->flags & cpu_to_le16(IWM_POWER_FLAGS_ADVANCE_PM_ENA_MSK)) { - DPRINTF(mvm, "uAPSD enabled\n"); - DPRINTF(mvm, "Rx timeout (uAPSD) = %u usec\n", - le32_to_cpu(cmd->rx_data_timeout_uapsd)); - DPRINTF(mvm, "Tx timeout (uAPSD) = %u usec\n", - le32_to_cpu(cmd->tx_data_timeout_uapsd)); - DPRINTF(mvm, "QNDP TID = %d\n", cmd->qndp_tid); - DPRINTF(mvm, "ACs flags = 0x%x\n", cmd->uapsd_ac_flags); - DPRINTF(mvm, "Max SP = %d\n", cmd->uapsd_max_sp); - } -#endif } static void Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jun 2 05:00:52 2016 (r301191) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jun 2 05:43:16 2016 (r301192) @@ -539,7 +539,7 @@ enum iwm_dtd_diode_reg { */ /** - * enum iwl_ucode_tlv_flag - ucode API flags + * enum iwm_ucode_tlv_flag - ucode API flags * @IWM_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously * was a separate TLV but moved here to save space. * @IWM_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behaviour on hidden SSID, @@ -1519,7 +1519,14 @@ enum { IWM_MVM_CMD_QUEUE = 9, }; -#define IWM_MVM_CMD_FIFO 7 +enum iwm_mvm_tx_fifo { + IWM_MVM_TX_FIFO_BK = 0, + IWM_MVM_TX_FIFO_BE, + IWM_MVM_TX_FIFO_VI, + IWM_MVM_TX_FIFO_VO, + IWM_MVM_TX_FIFO_MCAST = 5, + IWM_MVM_TX_FIFO_CMD = 7, +}; #define IWM_MVM_STATION_COUNT 16 @@ -1741,6 +1748,45 @@ struct iwm_phy_cfg_cmd { #define IWM_PHY_CFG_RX_CHAIN_B (1 << 13) #define IWM_PHY_CFG_RX_CHAIN_C (1 << 14) +/* + * PHY db + */ + +enum iwm_phy_db_section_type { + IWM_PHY_DB_CFG = 1, + IWM_PHY_DB_CALIB_NCH, + IWM_PHY_DB_UNUSED, + IWM_PHY_DB_CALIB_CHG_PAPD, + IWM_PHY_DB_CALIB_CHG_TXP, + IWM_PHY_DB_MAX +}; + +#define IWM_PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ + +/* + * phy db - configure operational ucode + */ +struct iwm_phy_db_cmd { + uint16_t type; + uint16_t length; + uint8_t data[]; +} __packed; + +/* for parsing of tx power channel group data that comes from the firmware */ +struct iwm_phy_db_chg_txp { + uint32_t space; + uint16_t max_channel_idx; +} __packed; + +/* + * phy db - Receive phy db chunk after calibrations + */ +struct iwm_calib_res_notif_phy_db { + uint16_t type; + uint16_t length; + uint8_t data[]; +} __packed; + /* Target of the IWM_NVM_ACCESS_CMD */ enum { From owner-svn-src-head@freebsd.org Thu Jun 2 07:45:02 2016 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 4603BB64FA4; Thu, 2 Jun 2016 07:45:02 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 08E98144E; Thu, 2 Jun 2016 07:45:01 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u527j1bo070490; Thu, 2 Jun 2016 07:45:01 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u527j1Y6070489; Thu, 2 Jun 2016 07:45:01 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606020745.u527j1Y6070489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 07:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301195 - head/sys/xen 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.22 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: Thu, 02 Jun 2016 07:45:02 -0000 Author: royger Date: Thu Jun 2 07:45:01 2016 New Revision: 301195 URL: https://svnweb.freebsd.org/changeset/base/301195 Log: xen: rewrite Xen error translation Using the public Xen error code header. Submitted by: Akshay Jaggi Reviewed by: royger Modified: head/sys/xen/error.h Modified: head/sys/xen/error.h ============================================================================== --- head/sys/xen/error.h Thu Jun 2 07:43:02 2016 (r301194) +++ head/sys/xen/error.h Thu Jun 2 07:45:01 2016 (r301195) @@ -29,130 +29,7 @@ #ifndef __XEN_ERROR_H__ #define __XEN_ERROR_H__ -/* List of Xen error codes */ -#define XEN_EPERM 1 /* Operation not permitted */ -#define XEN_ENOENT 2 /* No such file or directory */ -#define XEN_ESRCH 3 /* No such process */ -#define XEN_EINTR 4 /* Interrupted system call */ -#define XEN_EIO 5 /* I/O error */ -#define XEN_ENXIO 6 /* No such device or address */ -#define XEN_E2BIG 7 /* Arg list too long */ -#define XEN_ENOEXEC 8 /* Exec format error */ -#define XEN_EBADF 9 /* Bad file number */ -#define XEN_ECHILD 10 /* No child processes */ -#define XEN_EAGAIN 11 /* Try again */ -#define XEN_ENOMEM 12 /* Out of memory */ -#define XEN_EACCES 13 /* Permission denied */ -#define XEN_EFAULT 14 /* Bad address */ -#define XEN_ENOTBLK 15 /* Block device required */ -#define XEN_EBUSY 16 /* Device or resource busy */ -#define XEN_EEXIST 17 /* File exists */ -#define XEN_EXDEV 18 /* Cross-device link */ -#define XEN_ENODEV 19 /* No such device */ -#define XEN_ENOTDIR 20 /* Not a directory */ -#define XEN_EISDIR 21 /* Is a directory */ -#define XEN_EINVAL 22 /* Invalid argument */ -#define XEN_ENFILE 23 /* File table overflow */ -#define XEN_EMFILE 24 /* Too many open files */ -#define XEN_ENOTTY 25 /* Not a typewriter */ -#define XEN_ETXTBSY 26 /* Text file busy */ -#define XEN_EFBIG 27 /* File too large */ -#define XEN_ENOSPC 28 /* No space left on device */ -#define XEN_ESPIPE 29 /* Illegal seek */ -#define XEN_EROFS 30 /* Read-only file system */ -#define XEN_EMLINK 31 /* Too many links */ -#define XEN_EPIPE 32 /* Broken pipe */ -#define XEN_EDOM 33 /* Math argument out of domain of func */ -#define XEN_ERANGE 34 /* Math result not representable */ -#define XEN_EDEADLK 35 /* Resource deadlock would occur */ -#define XEN_ENAMETOOLONG 36 /* File name too long */ -#define XEN_ENOLCK 37 /* No record locks available */ -#define XEN_ENOSYS 38 /* Function not implemented */ -#define XEN_ENOTEMPTY 39 /* Directory not empty */ -#define XEN_ELOOP 40 /* Too many symbolic links encountered */ -#define XEN_ENOMSG 42 /* No message of desired type */ -#define XEN_EIDRM 43 /* Identifier removed */ -#define XEN_ECHRNG 44 /* Channel number out of range */ -#define XEN_EL2NSYNC 45 /* Level 2 not synchronized */ -#define XEN_EL3HLT 46 /* Level 3 halted */ -#define XEN_EL3RST 47 /* Level 3 reset */ -#define XEN_ELNRNG 48 /* Link number out of range */ -#define XEN_EUNATCH 49 /* Protocol driver not attached */ -#define XEN_ENOCSI 50 /* No CSI structure available */ -#define XEN_EL2HLT 51 /* Level 2 halted */ -#define XEN_EBADE 52 /* Invalid exchange */ -#define XEN_EBADR 53 /* Invalid request descriptor */ -#define XEN_EXFULL 54 /* Exchange full */ -#define XEN_ENOANO 55 /* No anode */ -#define XEN_EBADRQC 56 /* Invalid request code */ -#define XEN_EBADSLT 57 /* Invalid slot */ -#define XEN_EBFONT 59 /* Bad font file format */ -#define XEN_ENOSTR 60 /* Device not a stream */ -#define XEN_ENODATA 61 /* No data available */ -#define XEN_ETIME 62 /* Timer expired */ -#define XEN_ENOSR 63 /* Out of streams resources */ -#define XEN_ENONET 64 /* Machine is not on the network */ -#define XEN_ENOPKG 65 /* Package not installed */ -#define XEN_EREMOTE 66 /* Object is remote */ -#define XEN_ENOLINK 67 /* Link has been severed */ -#define XEN_EADV 68 /* Advertise error */ -#define XEN_ESRMNT 69 /* Srmount error */ -#define XEN_ECOMM 70 /* Communication error on send */ -#define XEN_EPROTO 71 /* Protocol error */ -#define XEN_EMULTIHOP 72 /* Multihop attempted */ -#define XEN_EDOTDOT 73 /* RFS specific error */ -#define XEN_EBADMSG 74 /* Not a data message */ -#define XEN_EOVERFLOW 75 /* Value too large for defined data type */ -#define XEN_ENOTUNIQ 76 /* Name not unique on network */ -#define XEN_EBADFD 77 /* File descriptor in bad state */ -#define XEN_EREMCHG 78 /* Remote address changed */ -#define XEN_ELIBACC 79 /* Can not access a needed shared library */ -#define XEN_ELIBBAD 80 /* Accessing a corrupted shared library */ -#define XEN_ELIBSCN 81 /* .lib section in a.out corrupted */ -#define XEN_ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define XEN_ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define XEN_EILSEQ 84 /* Illegal byte sequence */ -#define XEN_ERESTART 85 /* Interrupted system call should be restarted */ -#define XEN_ESTRPIPE 86 /* Streams pipe error */ -#define XEN_EUSERS 87 /* Too many users */ -#define XEN_ENOTSOCK 88 /* Socket operation on non-socket */ -#define XEN_EDESTADDRREQ 89 /* Destination address required */ -#define XEN_EMSGSIZE 90 /* Message too long */ -#define XEN_EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define XEN_ENOPROTOOPT 92 /* Protocol not available */ -#define XEN_EPROTONOSUPPORT 93 /* Protocol not supported */ -#define XEN_ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define XEN_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define XEN_EPFNOSUPPORT 96 /* Protocol family not supported */ -#define XEN_EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define XEN_EADDRINUSE 98 /* Address already in use */ -#define XEN_EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define XEN_ENETDOWN 100 /* Network is down */ -#define XEN_ENETUNREACH 101 /* Network is unreachable */ -#define XEN_ENETRESET 102 /* Network dropped connection because of reset */ -#define XEN_ECONNABORTED 103 /* Software caused connection abort */ -#define XEN_ECONNRESET 104 /* Connection reset by peer */ -#define XEN_ENOBUFS 105 /* No buffer space available */ -#define XEN_EISCONN 106 /* Transport endpoint is already connected */ -#define XEN_ENOTCONN 107 /* Transport endpoint is not connected */ -#define XEN_ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define XEN_ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define XEN_ETIMEDOUT 110 /* Connection timed out */ -#define XEN_ECONNREFUSED 111 /* Connection refused */ -#define XEN_EHOSTDOWN 112 /* Host is down */ -#define XEN_EHOSTUNREACH 113 /* No route to host */ -#define XEN_EALREADY 114 /* Operation already in progress */ -#define XEN_EINPROGRESS 115 /* Operation now in progress */ -#define XEN_ESTALE 116 /* Stale NFS file handle */ -#define XEN_EUCLEAN 117 /* Structure needs cleaning */ -#define XEN_ENOTNAM 118 /* Not a XENIX named type file */ -#define XEN_ENAVAIL 119 /* No XENIX semaphores available */ -#define XEN_EISNAM 120 /* Is a named type file */ -#define XEN_EREMOTEIO 121 /* Remote I/O error */ -#define XEN_EDQUOT 122 /* Quota exceeded */ - -#define XEN_ENOMEDIUM 123 /* No medium found */ -#define XEN_EMEDIUMTYPE 124 /* Wrong medium type */ +#include /* Translation table */ static int xen_errors[] = @@ -160,7 +37,6 @@ static int xen_errors[] = [XEN_EPERM] = EPERM, [XEN_ENOENT] = ENOENT, [XEN_ESRCH] = ESRCH, - [XEN_EINTR] = EINTR, [XEN_EIO] = EIO, [XEN_ENXIO] = ENXIO, [XEN_E2BIG] = E2BIG, @@ -171,114 +47,34 @@ static int xen_errors[] = [XEN_ENOMEM] = ENOMEM, [XEN_EACCES] = EACCES, [XEN_EFAULT] = EFAULT, - [XEN_ENOTBLK] = ENOTBLK, [XEN_EBUSY] = EBUSY, [XEN_EEXIST] = EEXIST, [XEN_EXDEV] = EXDEV, [XEN_ENODEV] = ENODEV, - [XEN_ENOTDIR] = ENOTDIR, - [XEN_EISDIR] = EISDIR, [XEN_EINVAL] = EINVAL, [XEN_ENFILE] = ENFILE, [XEN_EMFILE] = EMFILE, - [XEN_ENOTTY] = ENOTTY, - [XEN_ETXTBSY] = ETXTBSY, - [XEN_EFBIG] = EFBIG, [XEN_ENOSPC] = ENOSPC, - [XEN_ESPIPE] = ESPIPE, - [XEN_EROFS] = EROFS, [XEN_EMLINK] = EMLINK, - [XEN_EPIPE] = EPIPE, [XEN_EDOM] = EDOM, [XEN_ERANGE] = ERANGE, [XEN_EDEADLK] = EDEADLK, [XEN_ENAMETOOLONG] = ENAMETOOLONG, [XEN_ENOLCK] = ENOLCK, [XEN_ENOSYS] = ENOSYS, - [XEN_ENOTEMPTY] = ENOTEMPTY, - [XEN_ELOOP] = ELOOP, - [XEN_ENOMSG] = ENOMSG, - [XEN_EIDRM] = EIDRM, - [XEN_ECHRNG] = ERANGE, - [XEN_EL2NSYNC] = EFAULT, - [XEN_EL3HLT] = EFAULT, - [XEN_EL3RST] = EFAULT, - [XEN_ELNRNG] = ERANGE, - [XEN_EUNATCH] = ENODEV, - [XEN_ENOCSI] = ENODEV, - [XEN_EL2HLT] = EFAULT, - [XEN_EBADE] = ERANGE, - [XEN_EBADR] = EINVAL, - [XEN_EXFULL] = ENOBUFS, - [XEN_ENOANO] = EINVAL, - [XEN_EBADRQC] = EINVAL, - [XEN_EBADSLT] = EINVAL, - [XEN_EBFONT] = EFAULT, - [XEN_ENOSTR] = EINVAL, [XEN_ENODATA] = ENOENT, [XEN_ETIME] = ETIMEDOUT, - [XEN_ENOSR] = EFAULT, - [XEN_ENONET] = ENETDOWN, - [XEN_ENOPKG] = EINVAL, - [XEN_EREMOTE] = EREMOTE, - [XEN_ENOLINK] = ENOLINK, - [XEN_EADV] = EFAULT, - [XEN_ESRMNT] = EFAULT, - [XEN_ECOMM] = EFAULT, - [XEN_EPROTO] = EPROTO, - [XEN_EMULTIHOP] = EMULTIHOP, - [XEN_EDOTDOT] = EFAULT, [XEN_EBADMSG] = EBADMSG, [XEN_EOVERFLOW] = EOVERFLOW, - [XEN_ENOTUNIQ] = EADDRINUSE, - [XEN_EBADFD] = EBADF, - [XEN_EREMCHG] = EHOSTDOWN, - [XEN_ELIBACC] = EFAULT, - [XEN_ELIBBAD] = EFAULT, - [XEN_ELIBSCN] = EFAULT, - [XEN_ELIBMAX] = EFAULT, - [XEN_ELIBEXEC] = EFAULT, [XEN_EILSEQ] = EILSEQ, - [XEN_ERESTART] = EAGAIN, - [XEN_ESTRPIPE] = EPIPE, - [XEN_EUSERS] = EUSERS, [XEN_ENOTSOCK] = ENOTSOCK, - [XEN_EDESTADDRREQ] = EDESTADDRREQ, - [XEN_EMSGSIZE] = EMSGSIZE, - [XEN_EPROTOTYPE] = EPROTOTYPE, - [XEN_ENOPROTOOPT] = ENOPROTOOPT, - [XEN_EPROTONOSUPPORT] = EPROTONOSUPPORT, - [XEN_ESOCKTNOSUPPORT] = ESOCKTNOSUPPORT, [XEN_EOPNOTSUPP] = EOPNOTSUPP, - [XEN_EPFNOSUPPORT] = EPFNOSUPPORT, - [XEN_EAFNOSUPPORT] = EAFNOSUPPORT, [XEN_EADDRINUSE] = EADDRINUSE, [XEN_EADDRNOTAVAIL] = EADDRNOTAVAIL, - [XEN_ENETDOWN] = ENETDOWN, - [XEN_ENETUNREACH] = ENETUNREACH, - [XEN_ENETRESET] = ENETRESET, - [XEN_ECONNABORTED] = ECONNABORTED, - [XEN_ECONNRESET] = ECONNRESET, [XEN_ENOBUFS] = ENOBUFS, [XEN_EISCONN] = EISCONN, [XEN_ENOTCONN] = ENOTCONN, - [XEN_ESHUTDOWN] = ESHUTDOWN, - [XEN_ETOOMANYREFS] = ETOOMANYREFS, [XEN_ETIMEDOUT] = ETIMEDOUT, - [XEN_ECONNREFUSED] = ECONNREFUSED, - [XEN_EHOSTDOWN] = EHOSTDOWN, - [XEN_EHOSTUNREACH] = EHOSTUNREACH, - [XEN_EALREADY] = EALREADY, - [XEN_EINPROGRESS] = EINPROGRESS, - [XEN_ESTALE] = ESTALE, - [XEN_EUCLEAN] = EFAULT, - [XEN_ENOTNAM] = EFAULT, - [XEN_ENAVAIL] = EFAULT, - [XEN_EISNAM] = EFAULT, - [XEN_EREMOTEIO] = EIO, - [XEN_EDQUOT] = EDQUOT, - [XEN_ENOMEDIUM] = ENOENT, - [XEN_EMEDIUMTYPE] = ENOENT, }; static inline int From owner-svn-src-head@freebsd.org Thu Jun 2 04:42:29 2016 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 DED1FB67377; Thu, 2 Jun 2016 04:42:29 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id AF33C1384; Thu, 2 Jun 2016 04:42:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u524gSlF004326; Thu, 2 Jun 2016 04:42:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u524gSqr004322; Thu, 2 Jun 2016 04:42:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606020442.u524gSqr004322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Jun 2016 04:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301187 - head/sys/dev/iwm 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.22 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: Thu, 02 Jun 2016 04:42:30 -0000 Author: adrian Date: Thu Jun 2 04:42:28 2016 New Revision: 301187 URL: https://svnweb.freebsd.org/changeset/base/301187 Log: [iwm] add LED blinking for iwm hardware that supports it. Submitted by: Imre Vadasz Obtained from: DragonflyBSD, Linux iwlwifi/mvm Added: head/sys/dev/iwm/if_iwm_led.c (contents, props changed) head/sys/dev/iwm/if_iwm_led.h (contents, props changed) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 2 04:25:54 2016 (r301186) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 2 04:42:28 2016 (r301187) @@ -163,6 +163,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ @@ -3515,6 +3516,10 @@ iwm_newstate(struct ieee80211vap *vap, e ieee80211_state_name[nstate]); IEEE80211_UNLOCK(ic); IWM_LOCK(sc); + + if (vap->iv_state == IEEE80211_S_SCAN && nstate != vap->iv_state) + iwm_led_blink_stop(sc); + /* disable beacon filtering if we're hopping out of RUN */ if (vap->iv_state == IEEE80211_S_RUN && nstate != vap->iv_state) { iwm_mvm_disable_beacon_filter(sc); @@ -3829,6 +3834,7 @@ iwm_stop(struct iwm_softc *sc) sc->sc_flags |= IWM_FLAG_STOPPED; sc->sc_generation++; sc->sc_scanband = 0; + iwm_led_blink_stop(sc); sc->sc_tx_timer = 0; iwm_stop_device(sc); } @@ -4600,6 +4606,7 @@ iwm_attach(device_t dev) IWM_LOCK_INIT(sc); mbufq_init(&sc->sc_snd, ifqmaxlen); callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); + callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->sc_tq); @@ -4879,13 +4886,23 @@ iwm_scan_start(struct ieee80211com *ic) device_printf(sc->sc_dev, "could not initiate scan\n"); IWM_UNLOCK(sc); ieee80211_cancel_scan(vap); - } else + } else { + iwm_led_blink_start(sc); IWM_UNLOCK(sc); + } } static void iwm_scan_end(struct ieee80211com *ic) { + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct iwm_softc *sc = ic->ic_softc; + + IWM_LOCK(sc); + iwm_led_blink_stop(sc); + if (vap->iv_state == IEEE80211_S_RUN) + iwm_mvm_led_enable(sc); + IWM_UNLOCK(sc); } static void @@ -4982,6 +4999,7 @@ iwm_detach_local(struct iwm_softc *sc, i taskqueue_drain_all(sc->sc_tq); taskqueue_free(sc->sc_tq); } + callout_drain(&sc->sc_led_blink_to); callout_drain(&sc->sc_watchdog_to); iwm_stop_device(sc); if (do_net80211) Added: head/sys/dev/iwm/if_iwm_led.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwm/if_iwm_led.c Thu Jun 2 04:42:28 2016 (r301187) @@ -0,0 +1,182 @@ +/* $OpenBSD: if_iwm.c,v 1.39 2015/03/23 00:35:19 jsg Exp $ */ + +/* + * Copyright (c) 2014 genua mbh + * Copyright (c) 2014 Fixup Software Ltd. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 3.14.3 (tag id a2df521e42b1d9a23f620ac79dbfe8655a8391dd) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* Set led register on */ +void +iwm_mvm_led_enable(struct iwm_softc *sc) +{ + IWM_WRITE(sc, IWM_CSR_LED_REG, IWM_CSR_LED_REG_TURN_ON); +} + +/* Set led register off */ +void +iwm_mvm_led_disable(struct iwm_softc *sc) +{ + IWM_WRITE(sc, IWM_CSR_LED_REG, IWM_CSR_LED_REG_TURN_OFF); +} + +int +iwm_mvm_led_is_enabled(struct iwm_softc *sc) +{ + return (IWM_READ(sc, IWM_CSR_LED_REG) == IWM_CSR_LED_REG_TURN_ON); +} + +void +iwm_led_blink_timeout(void *arg) +{ + struct iwm_softc *sc = arg; + + if (iwm_mvm_led_is_enabled(sc)) + iwm_mvm_led_disable(sc); + else + iwm_mvm_led_enable(sc); + + callout_reset(&sc->sc_led_blink_to, (200 * hz) / 1000, + iwm_led_blink_timeout, sc); +} + +void +iwm_led_blink_start(struct iwm_softc *sc) +{ + callout_reset(&sc->sc_led_blink_to, 0, iwm_led_blink_timeout, sc); +} + +void +iwm_led_blink_stop(struct iwm_softc *sc) +{ + callout_drain(&sc->sc_led_blink_to); + iwm_mvm_led_disable(sc); +} Added: head/sys/dev/iwm/if_iwm_led.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwm/if_iwm_led.h Thu Jun 2 04:42:28 2016 (r301187) @@ -0,0 +1,101 @@ +/* $OpenBSD: if_iwm.c,v 1.39 2015/03/23 00:35:19 jsg Exp $ */ + +/* + * Copyright (c) 2014 genua mbh + * Copyright (c) 2014 Fixup Software Ltd. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 3.14.3 (tag id a2df521e42b1d9a23f620ac79dbfe8655a8391dd) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __IF_IWM_LED_H__ +#define __IF_IWM_LED_H__ + +void iwm_mvm_led_enable(struct iwm_softc *); +void iwm_mvm_led_disable(struct iwm_softc *); +int iwm_mvm_led_is_enabled(struct iwm_softc *); +void iwm_led_blink_timeout(void *); +void iwm_led_blink_start(struct iwm_softc *); +void iwm_led_blink_stop(struct iwm_softc *); + +#endif /* __IF_IWM_LED_H__ */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jun 2 04:25:54 2016 (r301186) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jun 2 04:42:28 2016 (r301187) @@ -412,6 +412,7 @@ struct iwm_softc { struct intr_config_hook sc_preinit_hook; struct callout sc_watchdog_to; + struct callout sc_led_blink_to; struct task init_task; From owner-svn-src-head@freebsd.org Thu Jun 2 08:41:59 2016 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 254CDB67F4A; Thu, 2 Jun 2016 08:41:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B0F5C1079; Thu, 2 Jun 2016 08:41:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-42-169.carlnfd1.nsw.optusnet.com.au [110.21.42.169]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 096AED63741; Thu, 2 Jun 2016 18:41:55 +1000 (AEST) Date: Thu, 2 Jun 2016 18:41:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Ed Schouten , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301071 - head/sys/sys In-Reply-To: <20160601162238.GM38613@kib.kiev.ua> Message-ID: <20160602174338.Q1850@besplex.bde.org> References: <201605311905.u4VJ5geL053766@repo.freebsd.org> <20160601183101.X1028@besplex.bde.org> <20160601162238.GM38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=kDyANCGC9fy361NNEb9EQQ==:117 a=kDyANCGC9fy361NNEb9EQQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=LIKQ__P1altPMfG7tTkA:9 a=ma3AmHuxA9pOwouJ:21 a=bOrop2JNBW-PD8MS:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 08:41:59 -0000 On Wed, 1 Jun 2016, Konstantin Belousov wrote: > On Wed, Jun 01, 2016 at 05:44:47PM +0200, Ed Schouten wrote: >> ... >>>> - In our implementation, struct sigevent::sigev_notify_attributes has >>>> type "void *" instead of "pthread_attr_t *". My guess is that this was >>>> done to prevent pulling in the pthread types, but this can easily be >>>> avoided by using the underlying structure types. >>> >>> Not easily, since the tags of the underlying struct types are in the >>> application namespace, at least up to POSIX 2001. >> >> Yeah, it's quite unfortunate that we use structure types starting with >> 'pthread'. They should have had leading underscores. But in my opinion >> that's not a problem specific to this change; it's a problem with our >> pthread implementation in general. >> >>>> +#include Indeed. The problem became larger in r146824 when these types started to be declared unconditionally in . Another bug in sys/_pthreadtypes.h is that it says that the prefixes pthread_ and PTHREAD_ are reserved for use in header symbols. Actually, they are only reserved for use in . This shouldn't be documented in the general header. The non-broken parts of general header depend on symbols ending with _t being reserved, not on this. >>> This gives the following pollution (which breaks almost everything since >>> includes this header: >>> - struct tag names pthread* >>> - struct member names state and mutex >> >> Yes. It would have made so much more sense if a header like >> would have defined all pthread types as __pthread_t, >> __pthread_mutex_t, etc. That way there would have been a way to expose >> just pthread_t and pthread_attr_t without pulling in the rest. > No, it wouldn't. Putting everything in sys/_types.h (or machine/_types.h) is convenient, and it avoids proliferation of headers, but it gives a different bloat problem: every header ends up declaring every type, but with an spelling in the implementation namespace. Then the number of types almost doubles when you declare only almost all types again in the application namespace. > Replace the typedefs with the forward-struct names by the void *. > The only other change would be the libthr, where some casts might > be needed. > > Use void * directly in signal.h if possible. Pointers to incomplete structures give more type safety than void *. Except for the problem with struct tags, just using them is best. Unlike for typedefs, we don't need a 5-line ifdef for every use to avoid redeclaratiion errors. sys/signal.h seems to use a pthread type just once. This type can be declared as 'struct pthread_attr *'. Actually, signal.h already used the correct method, except this was obfuscated using a private typedef (__pthread_t), and at some point when POSIX apparently started explicitly requiring to declare pthread_t, was polluted to match. We use ifdefs to a fault to minimise the scope of typedefs like size_t. Not doing this for the pthread types is inconsistent. For POSIX headers, it is easiest to declare all typedefs *_t in all headers. This may actually be more efficient by avoiding 1 layer of indirect typedefs like __size_t and 2-3 layers of header convolutions and ifdefs. The indirections and convolutuons are still technically needed for non-POSIX headers. Bruce From owner-svn-src-head@freebsd.org Thu Jun 2 11:14:27 2016 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 90542B642FE; Thu, 2 Jun 2016 11:14:27 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 60ADC175A; Thu, 2 Jun 2016 11:14:27 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BEQmY047173; Thu, 2 Jun 2016 11:14:26 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BEQqB047172; Thu, 2 Jun 2016 11:14:26 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021114.u52BEQqB047172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301197 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 11:14:27 -0000 Author: royger Date: Thu Jun 2 11:14:26 2016 New Revision: 301197 URL: https://svnweb.freebsd.org/changeset/base/301197 Log: xen-netfront: always keep the Rx ring full of requests This is based on Linux commit 1f3c2eba1e2d866ef99bb9b10ade4096e3d7607c from David Vrabel: A full Rx ring only requires 1 MiB of memory. This is not enough memory that it is useful to dynamically scale the number of Rx requests in the ring based on traffic rates, because: a) Even the full 1 MiB is a tiny fraction of a typically modern Linux VM (for example, the AWS micro instance still has 1 GiB of memory). b) Netfront would have used up to 1 MiB already even with moderate data rates (there was no adjustment of target based on memory pressure). c) Small VMs are going to typically have one VCPU and hence only one queue. Keeping the ring full of Rx requests handles bursty traffic better than trying to converge on an optimal number of requests to keep filled. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:12:11 2016 (r301196) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:14:26 2016 (r301197) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) #define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) +#define NET_RX_SLOTS_MIN (XEN_NETIF_NR_SLOTS_MIN + 1) + /* * Should the driver do LRO on the RX end * this can be toggled on the fly, but the @@ -114,6 +116,7 @@ struct netfront_rx_info; static void xn_txeof(struct netfront_txq *); static void xn_rxeof(struct netfront_rxq *); static void xn_alloc_rx_buffers(struct netfront_rxq *); +static void xn_alloc_rx_buffers_callout(void *arg); static void xn_release_rx_bufs(struct netfront_rxq *); static void xn_release_tx_bufs(struct netfront_txq *); @@ -182,16 +185,14 @@ struct netfront_rxq { grant_ref_t grant_ref[NET_TX_RING_SIZE + 1]; struct mbuf *mbufs[NET_RX_RING_SIZE + 1]; - struct mbufq batch; /* batch queue */ - int target; - - xen_pfn_t pfn_array[NET_RX_RING_SIZE]; struct lro_ctrl lro; struct taskqueue *tq; struct task intrtask; + struct callout rx_refill; + struct xn_rx_stats stats; }; @@ -233,12 +234,6 @@ struct netfront_info { u_int carrier; u_int maxfrags; - /* Receive-ring batched refills. */ -#define RX_MIN_TARGET 32 -#define RX_MAX_TARGET NET_RX_RING_SIZE - int rx_min_target; - int rx_max_target; - device_t xbdev; uint8_t mac[ETHER_ADDR_LEN]; @@ -687,6 +682,7 @@ static void destroy_rxq(struct netfront_rxq *rxq) { + callout_drain(&rxq->rx_refill); free(rxq->ring.sring, M_DEVBUF); taskqueue_drain_all(rxq->tq); taskqueue_free(rxq->tq); @@ -721,7 +717,6 @@ setup_rxqs(device_t dev, struct netfront rxq->id = q; rxq->info = info; - rxq->target = RX_MIN_TARGET; rxq->ring_ref = GRANT_REF_INVALID; rxq->ring.sring = NULL; snprintf(rxq->name, XN_QUEUE_NAME_LEN, "xnrx_%u", q); @@ -733,11 +728,9 @@ setup_rxqs(device_t dev, struct netfront rxq->grant_ref[i] = GRANT_REF_INVALID; } - mbufq_init(&rxq->batch, INT_MAX); - /* Start resources allocation */ - if (gnttab_alloc_grant_references(RX_MAX_TARGET, + if (gnttab_alloc_grant_references(NET_RX_RING_SIZE, &rxq->gref_head) != 0) { device_printf(dev, "allocating rx gref"); error = ENOMEM; @@ -760,6 +753,8 @@ setup_rxqs(device_t dev, struct netfront rxq->tq = taskqueue_create_fast(rxq->name, M_WAITOK, taskqueue_thread_enqueue, &rxq->tq); + callout_init(&rxq->rx_refill, 1); + error = taskqueue_start_threads(&rxq->tq, 1, PI_NET, "%s rxq %d", device_get_nameunit(dev), rxq->id); if (error != 0) { @@ -1058,119 +1053,88 @@ xn_release_tx_bufs(struct netfront_txq * } } -static void -xn_alloc_rx_buffers(struct netfront_rxq *rxq) +static struct mbuf * +xn_alloc_one_rx_buffer(struct netfront_rxq *rxq) { - struct netfront_info *np = rxq->info; - int otherend_id = xenbus_get_otherend_id(np->xbdev); - unsigned short id; - struct mbuf *m_new; - int i, batch_target, notify; - RING_IDX req_prod; - grant_ref_t ref; - netif_rx_request_t *req; - vm_offset_t vaddr; - u_long pfn; + struct mbuf *m; - req_prod = rxq->ring.req_prod_pvt; + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); + if (m == NULL) + return NULL; + m->m_len = m->m_pkthdr.len = MJUMPAGESIZE; - if (__predict_false(np->carrier == 0)) - return; + return (m); +} - /* - * Allocate mbufs greedily, even though we batch updates to the - * receive ring. This creates a less bursty demand on the memory - * allocator, and so should reduce the chance of failed allocation - * requests both for ourself and for other kernel subsystems. - * - * Here we attempt to maintain rx_target buffers in flight, counting - * buffers that we have yet to process in the receive ring. - */ - batch_target = rxq->target - (req_prod - rxq->ring.rsp_cons); - for (i = mbufq_len(&rxq->batch); i < batch_target; i++) { - m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); - if (m_new == NULL) { - if (i != 0) - goto refill; - /* XXX set timer */ - break; - } - m_new->m_len = m_new->m_pkthdr.len = MJUMPAGESIZE; +static void +xn_alloc_rx_buffers(struct netfront_rxq *rxq) +{ + RING_IDX req_prod; + int notify; - /* queue the mbufs allocated */ - mbufq_enqueue(&rxq->batch, m_new); - } + XN_RX_LOCK_ASSERT(rxq); - /* - * If we've allocated at least half of our target number of entries, - * submit them to the backend - we have enough to make the overhead - * of submission worthwhile. Otherwise wait for more mbufs and - * request entries to become available. - */ - if (i < (rxq->target/2)) { - if (req_prod > rxq->ring.sring->req_prod) - goto push; + if (__predict_false(rxq->info->carrier == 0)) return; - } - /* - * Double floating fill target if we risked having the backend - * run out of empty buffers for receive traffic. We define "running - * low" as having less than a fourth of our target buffers free - * at the time we refilled the queue. - */ - if ((req_prod - rxq->ring.sring->rsp_prod) < (rxq->target / 4)) { - rxq->target *= 2; - if (rxq->target > np->rx_max_target) - rxq->target = np->rx_max_target; - } + for (req_prod = rxq->ring.req_prod_pvt; + req_prod - rxq->ring.rsp_cons < NET_RX_RING_SIZE; + req_prod++) { + struct mbuf *m; + unsigned short id; + grant_ref_t ref; + struct netif_rx_request *req; + unsigned long pfn; -refill: - for (i = 0; ; i++) { - if ((m_new = mbufq_dequeue(&rxq->batch)) == NULL) + m = xn_alloc_one_rx_buffer(rxq); + if (m == NULL) break; - m_new->m_ext.ext_arg1 = (vm_paddr_t *)(uintptr_t)( - vtophys(m_new->m_ext.ext_buf) >> PAGE_SHIFT); - - id = xn_rxidx(req_prod + i); + id = xn_rxidx(req_prod); KASSERT(rxq->mbufs[id] == NULL, ("non-NULL xn_rx_chain")); - rxq->mbufs[id] = m_new; + rxq->mbufs[id] = m; ref = gnttab_claim_grant_reference(&rxq->gref_head); KASSERT(ref != GNTTAB_LIST_END, - ("reserved grant references exhuasted")); + ("reserved grant references exhuasted")); rxq->grant_ref[id] = ref; - vaddr = mtod(m_new, vm_offset_t); - pfn = vtophys(vaddr) >> PAGE_SHIFT; - req = RING_GET_REQUEST(&rxq->ring, req_prod + i); + pfn = atop(vtophys(mtod(m, vm_offset_t))); + req = RING_GET_REQUEST(&rxq->ring, req_prod); - gnttab_grant_foreign_access_ref(ref, otherend_id, pfn, 0); + gnttab_grant_foreign_access_ref(ref, + xenbus_get_otherend_id(rxq->info->xbdev), pfn, 0); req->id = id; req->gref = ref; + } - rxq->pfn_array[i] = - vtophys(mtod(m_new,vm_offset_t)) >> PAGE_SHIFT; + rxq->ring.req_prod_pvt = req_prod; + + /* Not enough requests? Try again later. */ + if (req_prod - rxq->ring.rsp_cons < NET_RX_SLOTS_MIN) { + callout_reset(&rxq->rx_refill, hz/10, xn_alloc_rx_buffers_callout, + rxq); + return; } - KASSERT(i, ("no mbufs processed")); /* should have returned earlier */ - KASSERT(mbufq_len(&rxq->batch) == 0, ("not all mbufs processed")); - /* - * We may have allocated buffers which have entries outstanding - * in the page * update queue -- make sure we flush those first! - */ - wmb(); + wmb(); /* barrier so backend seens requests */ - /* Above is a suitable barrier to ensure backend will see requests. */ - rxq->ring.req_prod_pvt = req_prod + i; -push: RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&rxq->ring, notify); if (notify) xen_intr_signal(rxq->xen_intr_handle); } +static void xn_alloc_rx_buffers_callout(void *arg) +{ + struct netfront_rxq *rxq; + + rxq = (struct netfront_rxq *)arg; + XN_RX_LOCK(rxq); + xn_alloc_rx_buffers(rxq); + XN_RX_UNLOCK(rxq); +} + static void xn_release_rx_bufs(struct netfront_rxq *rxq) { @@ -1792,8 +1756,12 @@ xn_ifinit_locked(struct netfront_info *n for (i = 0; i < np->num_queues; i++) { rxq = &np->rxq[i]; + XN_RX_LOCK(rxq); xn_alloc_rx_buffers(rxq); rxq->ring.sring->rsp_event = rxq->ring.rsp_cons + 1; + if (RING_HAS_UNCONSUMED_RESPONSES(&rxq->ring)) + taskqueue_enqueue(rxq->tq, &rxq->intrtask); + XN_RX_UNLOCK(rxq); } ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2009,7 +1977,9 @@ xn_connect(struct netfront_info *np) XN_TX_LOCK(txq); xn_txeof(txq); XN_TX_UNLOCK(txq); + XN_RX_LOCK(rxq); xn_alloc_rx_buffers(rxq); + XN_RX_UNLOCK(rxq); } return (0); @@ -2225,9 +2195,6 @@ create_netdev(device_t dev) ifmedia_add(&np->sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL); ifmedia_set(&np->sc_media, IFM_ETHER|IFM_MANUAL); - np->rx_min_target = RX_MIN_TARGET; - np->rx_max_target = RX_MAX_TARGET; - err = xen_net_read_mac(dev, np->mac); if (err != 0) goto error; From owner-svn-src-head@freebsd.org Thu Jun 2 11:19:17 2016 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 B5655B6450A; Thu, 2 Jun 2016 11:19:17 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 6DDDE1C45; Thu, 2 Jun 2016 11:19:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BJG8Y047471; Thu, 2 Jun 2016 11:19:16 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BJGBh047470; Thu, 2 Jun 2016 11:19:16 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021119.u52BJGBh047470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301200 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 11:19:17 -0000 Author: royger Date: Thu Jun 2 11:19:16 2016 New Revision: 301200 URL: https://svnweb.freebsd.org/changeset/base/301200 Log: xen-netfront: release grant references used for the shared rings Just calling gnttab_end_foreign_access_ref doesn't free the references, instead call gnttab_end_foreign_access with a NULL page argument in order to have the grant references freed. The code that maps the ring (xenbus_map_ring) already uses gnttab_grant_foreign_access which takes care of allocating a grant reference. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6608 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:18:02 2016 (r301199) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:19:16 2016 (r301200) @@ -663,7 +663,7 @@ disconnect_rxq(struct netfront_rxq *rxq) xn_release_rx_bufs(rxq); gnttab_free_grant_references(rxq->gref_head); - gnttab_end_foreign_access_ref(rxq->ring_ref); + gnttab_end_foreign_access(rxq->ring_ref, NULL); /* * No split event channel support at the moment, handle will * be unbound in tx. So no need to call xen_intr_unbind here, @@ -765,7 +765,7 @@ disconnect_txq(struct netfront_txq *txq) xn_release_tx_bufs(txq); gnttab_free_grant_references(txq->gref_head); - gnttab_end_foreign_access_ref(txq->ring_ref); + gnttab_end_foreign_access(txq->ring_ref, NULL); xen_intr_unbind(&txq->xen_intr_handle); } @@ -877,7 +877,7 @@ fail_bind_port: fail_start_thread: buf_ring_free(txq->br, M_DEVBUF); taskqueue_free(txq->tq); - gnttab_end_foreign_access_ref(txq->ring_ref); + gnttab_end_foreign_access(txq->ring_ref, NULL); fail_grant_ring: gnttab_free_grant_references(txq->gref_head); free(txq->ring.sring, M_DEVBUF); From owner-svn-src-head@freebsd.org Thu Jun 2 11:16:37 2016 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 37D1AB64404; Thu, 2 Jun 2016 11:16:37 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id E676D18AD; Thu, 2 Jun 2016 11:16:36 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BGa1V047288; Thu, 2 Jun 2016 11:16:36 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BGajD047287; Thu, 2 Jun 2016 11:16:36 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021116.u52BGajD047287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301198 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 11:16:37 -0000 Author: royger Date: Thu Jun 2 11:16:35 2016 New Revision: 301198 URL: https://svnweb.freebsd.org/changeset/base/301198 Log: xen-netfront: switch to using an interrupt handler In order to use custom taskqueues we would have to mask the interrupt, which is basically what is already done for an interrupt handler, or else we risk loosing interrupts. This switches netfront to the same interrupt handling that was done before multiqueue support was added. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:14:26 2016 (r301197) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:16:35 2016 (r301198) @@ -121,9 +121,9 @@ static void xn_alloc_rx_buffers_callout( static void xn_release_rx_bufs(struct netfront_rxq *); static void xn_release_tx_bufs(struct netfront_txq *); -static void xn_rxq_intr(void *); -static void xn_txq_intr(void *); -static int xn_intr(void *); +static void xn_rxq_intr(struct netfront_rxq *); +static void xn_txq_intr(struct netfront_txq *); +static void xn_intr(void *); static inline int xn_count_frags(struct mbuf *m); static int xn_assemble_tx_request(struct netfront_txq *, struct mbuf *); static int xn_ioctl(struct ifnet *, u_long, caddr_t); @@ -188,9 +188,6 @@ struct netfront_rxq { struct lro_ctrl lro; - struct taskqueue *tq; - struct task intrtask; - struct callout rx_refill; struct xn_rx_stats stats; @@ -214,7 +211,6 @@ struct netfront_txq { struct buf_ring *br; struct taskqueue *tq; - struct task intrtask; struct task defrtask; bool full; @@ -621,9 +617,8 @@ talk_to_backend(device_t dev, struct net } static void -xn_rxq_tq_intr(void *xrxq, int pending) +xn_rxq_intr(struct netfront_rxq *rxq) { - struct netfront_rxq *rxq = xrxq; XN_RX_LOCK(rxq); xn_rxeof(rxq); @@ -642,9 +637,8 @@ xn_txq_start(struct netfront_txq *txq) } static void -xn_txq_tq_intr(void *xtxq, int pending) +xn_txq_intr(struct netfront_txq *txq) { - struct netfront_txq *txq = xtxq; XN_TX_LOCK(txq); if (RING_HAS_UNCONSUMED_RESPONSES(&txq->ring)) @@ -684,8 +678,6 @@ destroy_rxq(struct netfront_rxq *rxq) callout_drain(&rxq->rx_refill); free(rxq->ring.sring, M_DEVBUF); - taskqueue_drain_all(rxq->tq); - taskqueue_free(rxq->tq); } static void @@ -749,27 +741,11 @@ setup_rxqs(device_t dev, struct netfront goto fail_grant_ring; } - TASK_INIT(&rxq->intrtask, 0, xn_rxq_tq_intr, rxq); - rxq->tq = taskqueue_create_fast(rxq->name, M_WAITOK, - taskqueue_thread_enqueue, &rxq->tq); - callout_init(&rxq->rx_refill, 1); - - error = taskqueue_start_threads(&rxq->tq, 1, PI_NET, - "%s rxq %d", device_get_nameunit(dev), rxq->id); - if (error != 0) { - device_printf(dev, "failed to start rx taskq %d\n", - rxq->id); - goto fail_start_thread; - } } return (0); -fail_start_thread: - gnttab_end_foreign_access_ref(rxq->ring_ref); - taskqueue_drain_all(rxq->tq); - taskqueue_free(rxq->tq); fail_grant_ring: gnttab_free_grant_references(rxq->gref_head); free(rxq->ring.sring, M_DEVBUF); @@ -871,9 +847,8 @@ setup_txqs(device_t dev, struct netfront txq->br = buf_ring_alloc(NET_TX_RING_SIZE, M_DEVBUF, M_WAITOK, &txq->lock); TASK_INIT(&txq->defrtask, 0, xn_txq_tq_deferred, txq); - TASK_INIT(&txq->intrtask, 0, xn_txq_tq_intr, txq); - txq->tq = taskqueue_create_fast(txq->name, M_WAITOK, + txq->tq = taskqueue_create(txq->name, M_WAITOK, taskqueue_thread_enqueue, &txq->tq); error = taskqueue_start_threads(&txq->tq, 1, PI_NET, @@ -885,10 +860,9 @@ setup_txqs(device_t dev, struct netfront } error = xen_intr_alloc_and_bind_local_port(dev, - xenbus_get_otherend_id(dev), xn_intr, /* handler */ NULL, - &info->txq[q], - INTR_TYPE_NET | INTR_MPSAFE | INTR_ENTROPY, - &txq->xen_intr_handle); + xenbus_get_otherend_id(dev), /* filter */ NULL, xn_intr, + &info->txq[q], INTR_TYPE_NET | INTR_MPSAFE | INTR_ENTROPY, + &txq->xen_intr_handle); if (error != 0) { device_printf(dev, "xen_intr_alloc_and_bind_local_port failed\n"); @@ -1356,28 +1330,11 @@ xn_txeof(struct netfront_txq *txq) if (txq->full && ((txq->ring.sring->req_prod - prod) < NET_TX_RING_SIZE)) { txq->full = false; - taskqueue_enqueue(txq->tq, &txq->intrtask); + xn_txq_start(txq); } } - static void -xn_rxq_intr(void *xrxq) -{ - struct netfront_rxq *rxq = xrxq; - - taskqueue_enqueue(rxq->tq, &rxq->intrtask); -} - -static void -xn_txq_intr(void *xtxq) -{ - struct netfront_txq *txq = xtxq; - - taskqueue_enqueue(txq->tq, &txq->intrtask); -} - -static int xn_intr(void *xsc) { struct netfront_txq *txq = xsc; @@ -1387,8 +1344,6 @@ xn_intr(void *xsc) /* kick both tx and rx */ xn_rxq_intr(rxq); xn_txq_intr(txq); - - return (FILTER_HANDLED); } static void @@ -1760,7 +1715,7 @@ xn_ifinit_locked(struct netfront_info *n xn_alloc_rx_buffers(rxq); rxq->ring.sring->rsp_event = rxq->ring.rsp_cons + 1; if (RING_HAS_UNCONSUMED_RESPONSES(&rxq->ring)) - taskqueue_enqueue(rxq->tq, &rxq->intrtask); + xn_rxeof(rxq); XN_RX_UNLOCK(rxq); } From owner-svn-src-head@freebsd.org Thu Jun 2 11:27:02 2016 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 57B0DB64D11; Thu, 2 Jun 2016 11:27:02 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E387418AE; Thu, 2 Jun 2016 11:27:01 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id a20so63191845wma.1; Thu, 02 Jun 2016 04:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=kizELhs2mcVKqO76wI+xpsLIhzhoZ9IEIOyWyGfzAZs=; b=ZvHCjhgUrOHWi4jFyMVZhINrID8fgcp1FxPr77Fcsk1ebqmewSn68LcED4IaDAjf/p 4SNIGUs3L8vXsZBncDCOlxmr+MMS5/8D/uCH1V3tyPnvxgMhVMUURCc/wAV9vVbaAO/k x85IcyHUnoVExiW7XnVvTymaLVatrcYHVBS9FLsCqUUyW13VJ9fjh/CsEmSDbP/hHPLV vo+/IH0DH9yKMEiz1zgf3Ld2Igqz0b8b6uY7ZwRLL1oCpi2Vo99W6GBx+IyV69PpU8IW khSyZJExm4fa69tS7zsng/FkZRvEG7OaaJt00Ekmilc3zSm+l8UdYEHcYN01Rp1G8OoT KCKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=kizELhs2mcVKqO76wI+xpsLIhzhoZ9IEIOyWyGfzAZs=; b=eTXeLh8IWc6CRA+iOZNWOQhJFoQCSfpVcBFDuEcRTN58c2Njmnz6NrZpw+63/7I5TE ylM4Bj7vif0MV1QcLdyEt3hZ9+Y4U0PnryeK+FnoB6Om9DP88Pqj85m7yVk6ED9BK7mp KX5wxJGQjol9XL9oOmu3jb8mQ7QgsqqTTYUSd6VvRKNmVRLGXNk7CiZbpnZJjVEwbtpl ZMobJvcmaO6VWLNNRC35vUTu1EJ8irwn3X1n2MRXDZ3yOXcCsjuZnaP05hPDFwclun8U ZeEUNy3k0Y8X5c6eOw6vd7mCReWcNt8FNKzOKGsXAGMDq+UdqrxSLxJEeBbamNWs+H5p BwGg== X-Gm-Message-State: ALyK8tKVTjkqVRkct7mBk/uH25Qkj2TbGqwn9eZabSX/QeOiGixTMELEyh3QnsvORMuoCQ== X-Received: by 10.28.44.87 with SMTP id s84mr8059760wms.61.1464866820363; Thu, 02 Jun 2016 04:27:00 -0700 (PDT) Received: from localhost (98.red-79-145-83.dynamicip.rima-tde.net. [79.145.83.98]) by smtp.gmail.com with ESMTPSA id ug8sm56725wjc.42.2016.06.02.04.26.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jun 2016 04:26:59 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 2 Jun 2016 13:26:55 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301198 - head/sys/dev/xen/netfront Message-ID: <20160602112655.bdxb4v3qxqhydkrx@mac> References: <201606021116.u52BGajD047287@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201606021116.u52BGajD047287@repo.freebsd.org> User-Agent: Mutt/1.6.0-neo (2016-04-07) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 11:27:02 -0000 On Thu, Jun 02, 2016 at 11:16:36AM +0000, Roger Pau Monné wrote: > Author: royger > Date: Thu Jun 2 11:16:35 2016 > New Revision: 301198 > URL: https://svnweb.freebsd.org/changeset/base/301198 > > Log: > xen-netfront: switch to using an interrupt handler > > In order to use custom taskqueues we would have to mask the interrupt, which > is basically what is already done for an interrupt handler, or else we risk > loosing interrupts. This switches netfront to the same interrupt handling > that was done before multiqueue support was added. > > Reviewed by: Wei Liu > Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6609 From owner-svn-src-head@freebsd.org Thu Jun 2 12:26:57 2016 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 8382FB6582A; Thu, 2 Jun 2016 12:26:57 +0000 (UTC) (envelope-from kadesai@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 mx1.freebsd.org (Postfix) with ESMTPS id 4184F1393; Thu, 2 Jun 2016 12:26:57 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52CQuxG072758; Thu, 2 Jun 2016 12:26:56 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52CQuJS072754; Thu, 2 Jun 2016 12:26:56 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201606021226.u52CQuJS072754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 2 Jun 2016 12:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301203 - head/sys/dev/mrsas 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.22 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: Thu, 02 Jun 2016 12:26:57 -0000 Author: kadesai Date: Thu Jun 2 12:26:55 2016 New Revision: 301203 URL: https://svnweb.freebsd.org/changeset/base/301203 Log: Added support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO/BROADCOM Limited Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Thu Jun 2 12:01:58 2016 (r301202) +++ head/sys/dev/mrsas/mrsas.c Thu Jun 2 12:26:55 2016 (r301203) @@ -188,6 +188,8 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, {0x1000, MRSAS_INTRUDER, 0xffff, 0xffff, "AVAGO Intruder SAS Controller"}, {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, + {0x1000, MRSAS_CUTLASS_52, 0xffff, 0xffff, "AVAGO Cutlass_52 SAS Controller"}, + {0x1000, MRSAS_CUTLASS_53, 0xffff, 0xffff, "AVAGO Cutlass_53 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -1630,7 +1632,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1654,7 +1658,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2455,7 +2461,9 @@ mrsas_ioc_init(struct mrsas_softc *sc) if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3491,7 +3499,9 @@ mrsas_build_mptmfi_passthru(struct mrsas if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Thu Jun 2 12:01:58 2016 (r301202) +++ head/sys/dev/mrsas/mrsas.h Thu Jun 2 12:26:55 2016 (r301203) @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); #define MRSAS_FURY 0x005f #define MRSAS_INTRUDER 0x00ce #define MRSAS_INTRUDER_24 0x00cf +#define MRSAS_CUTLASS_52 0x0052 +#define MRSAS_CUTLASS_53 0x0053 #define MRSAS_PCI_BAR0 0x10 #define MRSAS_PCI_BAR1 0x14 #define MRSAS_PCI_BAR2 0x1C Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Thu Jun 2 12:01:58 2016 (r301202) +++ head/sys/dev/mrsas/mrsas_cam.c Thu Jun 2 12:26:55 2016 (r301203) @@ -880,7 +880,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -912,7 +914,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -1191,7 +1195,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1205,7 +1211,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1218,7 +1226,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1230,7 +1240,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Thu Jun 2 12:01:58 2016 (r301202) +++ head/sys/dev/mrsas/mrsas_fp.c Thu Jun 2 12:26:55 2016 (r301203) @@ -752,7 +752,9 @@ mr_spanset_get_phy_params(struct mrsas_s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) do_invader = 1; /* Get row and span from io_info for Uneven Span IO. */ @@ -966,7 +968,9 @@ MR_BuildRaidContext(struct mrsas_softc * if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; else pRAID_Context->regLockFlags = (isRead) ? REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite; @@ -1454,7 +1458,9 @@ MR_GetPhyParams(struct mrsas_softc *sc, if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) do_invader = 1; row = mega_div64_32(stripRow, raid->rowDataSize); From owner-svn-src-head@freebsd.org Thu Jun 2 11:16:35 2016 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 C7A96B64400; Thu, 2 Jun 2016 11:16:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 9347E18AB; Thu, 2 Jun 2016 11:16:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8FAEC1FE024; Thu, 2 Jun 2016 13:16:32 +0200 (CEST) Subject: Re: svn commit: r301197 - head/sys/dev/xen/netfront To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606021114.u52BEQqB047172@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <2c81e44d-65de-10f0-8837-f23896855150@selasky.org> Date: Thu, 2 Jun 2016 13:19:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201606021114.u52BEQqB047172@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 11:16:35 -0000 On 06/02/16 13:14, Roger Pau Monné wrote: > + callout_reset(&rxq->rx_refill, hz/10, xn_alloc_rx_buffers_callout, > + rxq); Maybe use callout_reset_curcpu() to take advantage of callout's SMP capabilities ? --HPS From owner-svn-src-head@freebsd.org Thu Jun 2 11:21:01 2016 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 78618B64673; Thu, 2 Jun 2016 11:21:01 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 3B53F1F6A; Thu, 2 Jun 2016 11:21:01 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BL0LW048332; Thu, 2 Jun 2016 11:21:00 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BL0jZ048331; Thu, 2 Jun 2016 11:21:00 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021121.u52BL0jZ048331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301201 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 11:21:01 -0000 Author: royger Date: Thu Jun 2 11:21:00 2016 New Revision: 301201 URL: https://svnweb.freebsd.org/changeset/base/301201 Log: xen-netfront: perform an interface reset when changing options The PV backend will only pick the new options when the interface is detached and reattached again, so perform a full reset when changing options. This is very fast, and should not be noticeable by the user. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6658 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:19:16 2016 (r301200) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:21:00 2016 (r301201) @@ -237,7 +237,7 @@ struct netfront_info { struct ifmedia sc_media; - bool xn_resume; + bool xn_reset; }; struct netfront_rx_info { @@ -458,7 +458,6 @@ netfront_resume(device_t dev) { struct netfront_info *info = device_get_softc(dev); - info->xn_resume = true; netif_disconnect_backend(info); return (0); } @@ -590,10 +589,19 @@ talk_to_backend(device_t dev, struct net message = "writing feature-sg"; goto abort_transaction; } - err = xs_printf(xst, node, "feature-gso-tcpv4", "%d", 1); - if (err != 0) { - message = "writing feature-gso-tcpv4"; - goto abort_transaction; + if ((info->xn_ifp->if_capenable & IFCAP_LRO) != 0) { + err = xs_printf(xst, node, "feature-gso-tcpv4", "%d", 1); + if (err != 0) { + message = "writing feature-gso-tcpv4"; + goto abort_transaction; + } + } + if ((info->xn_ifp->if_capenable & IFCAP_RXCSUM) == 0) { + err = xs_printf(xst, node, "feature-no-csum-offload", "%d", 1); + if (err != 0) { + message = "writing feature-no-csum-offload"; + goto abort_transaction; + } } err = xs_transaction_end(xst, 0); @@ -960,7 +968,6 @@ netfront_backend_changed(device_t dev, X case XenbusStateInitialising: case XenbusStateInitialised: case XenbusStateUnknown: - case XenbusStateClosed: case XenbusStateReconfigured: case XenbusStateReconfiguring: break; @@ -974,6 +981,13 @@ netfront_backend_changed(device_t dev, X case XenbusStateClosing: xenbus_set_state(dev, XenbusStateClosed); break; + case XenbusStateClosed: + if (sc->xn_reset) { + netif_disconnect_backend(sc); + xenbus_set_state(dev, XenbusStateInitialising); + sc->xn_reset = false; + } + break; case XenbusStateConnected: #ifdef INET netfront_send_fake_arp(dev, sc); @@ -1739,11 +1753,14 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, { struct netfront_info *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; + device_t dev; #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; #endif - int mask, error = 0; + + dev = sc->xbdev; + switch(cmd) { case SIOCSIFADDR: #ifdef INET @@ -1820,6 +1837,31 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_capenable ^= IFCAP_LRO; } + /* + * We must reset the interface so the backend picks up the + * new features. + */ + XN_LOCK(sc); + netfront_carrier_off(sc); + sc->xn_reset = true; + /* + * NB: the pending packet queue is not flushed, since + * the interface should still support the old options. + */ + XN_UNLOCK(sc); + /* + * Delete the xenstore nodes that export features. + * + * NB: There's a xenbus state called + * "XenbusStateReconfiguring", which is what we should set + * here. Sadly none of the backends know how to handle it, + * and simply disconnect from the frontend, so we will just + * switch back to XenbusStateInitialising in order to force + * a reconnection. + */ + xs_rm(XST_NIL, xenbus_get_node(dev), "feature-gso-tcpv4"); + xs_rm(XST_NIL, xenbus_get_node(dev), "feature-no-csum-offload"); + xenbus_set_state(dev, XenbusStateClosing); break; case SIOCADDMULTI: case SIOCDELMULTI: @@ -1967,6 +2009,20 @@ xn_query_features(struct netfront_info * printf(" feature-gso-tcp4"); } + /* + * HW CSUM offload is assumed to be available unless + * feature-no-csum-offload is set in xenstore. + */ + if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), + "feature-no-csum-offload", NULL, "%d", &val) != 0) + val = 0; + + np->xn_ifp->if_capabilities |= IFCAP_HWCSUM; + if (val) { + np->xn_ifp->if_capabilities &= ~(IFCAP_HWCSUM); + printf(" feature-no-csum-offload"); + } + printf("\n"); } @@ -1977,50 +2033,50 @@ xn_configure_features(struct netfront_in #if (defined(INET) || defined(INET6)) int i; #endif + struct ifnet *ifp; + ifp = np->xn_ifp; err = 0; - if (np->xn_resume && - ((np->xn_ifp->if_capenable & np->xn_ifp->if_capabilities) - == np->xn_ifp->if_capenable)) { + if ((ifp->if_capenable & ifp->if_capabilities) == ifp->if_capenable) { /* Current options are available, no need to do anything. */ return (0); } /* Try to preserve as many options as possible. */ - if (np->xn_resume) - cap_enabled = np->xn_ifp->if_capenable; - else - cap_enabled = UINT_MAX; + cap_enabled = ifp->if_capenable; + ifp->if_capenable = ifp->if_hwassist = 0; #if (defined(INET) || defined(INET6)) - for (i = 0; i < np->num_queues; i++) - if ((np->xn_ifp->if_capenable & IFCAP_LRO) == - (cap_enabled & IFCAP_LRO)) + if ((cap_enabled & IFCAP_LRO) != 0) + for (i = 0; i < np->num_queues; i++) tcp_lro_free(&np->rxq[i].lro); -#endif - np->xn_ifp->if_capenable = - np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4) & cap_enabled; - np->xn_ifp->if_hwassist &= ~CSUM_TSO; -#if (defined(INET) || defined(INET6)) - for (i = 0; i < np->num_queues; i++) { - if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) == - (cap_enabled & IFCAP_LRO)) { + if (xn_enable_lro && + (ifp->if_capabilities & cap_enabled & IFCAP_LRO) != 0) { + ifp->if_capenable |= IFCAP_LRO; + for (i = 0; i < np->num_queues; i++) { err = tcp_lro_init(&np->rxq[i].lro); if (err != 0) { - device_printf(np->xbdev, "LRO initialization failed\n"); - } else { - np->rxq[i].lro.ifp = np->xn_ifp; - np->xn_ifp->if_capenable |= IFCAP_LRO; + device_printf(np->xbdev, + "LRO initialization failed\n"); + ifp->if_capenable &= ~IFCAP_LRO; + break; } + np->rxq[i].lro.ifp = ifp; } } - if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) == - (cap_enabled & IFCAP_TSO4)) { - np->xn_ifp->if_capenable |= IFCAP_TSO4; - np->xn_ifp->if_hwassist |= CSUM_TSO; + if ((ifp->if_capabilities & cap_enabled & IFCAP_TSO4) != 0) { + ifp->if_capenable |= IFCAP_TSO4; + ifp->if_hwassist |= CSUM_TSO; } #endif + if ((ifp->if_capabilities & cap_enabled & IFCAP_TXCSUM) != 0) { + ifp->if_capenable |= IFCAP_TXCSUM; + ifp->if_hwassist |= CSUM_TCP|CSUM_UDP; + } + if ((ifp->if_capabilities & cap_enabled & IFCAP_RXCSUM) != 0) + ifp->if_capenable |= IFCAP_RXCSUM; + return (err); } @@ -2169,7 +2225,9 @@ create_netdev(device_t dev) ifp->if_init = xn_ifinit; ifp->if_hwassist = XN_CSUM_FEATURES; - ifp->if_capabilities = IFCAP_HWCSUM; + /* Enable all supported features at device creation. */ + ifp->if_capenable = ifp->if_capabilities = + IFCAP_HWCSUM|IFCAP_TSO4|IFCAP_LRO; ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS; ifp->if_hw_tsomaxsegsize = PAGE_SIZE; From owner-svn-src-head@freebsd.org Thu Jun 2 14:25:11 2016 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 909DEB6583E; Thu, 2 Jun 2016 14:25:11 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 5CC2918B5; Thu, 2 Jun 2016 14:25:11 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52EPAQH016103; Thu, 2 Jun 2016 14:25:10 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52EPA4Y016102; Thu, 2 Jun 2016 14:25:10 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021425.u52EPA4Y016102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 14:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301204 - head/sys/dev/xen/netfront 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.22 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: Thu, 02 Jun 2016 14:25:11 -0000 Author: royger Date: Thu Jun 2 14:25:10 2016 New Revision: 301204 URL: https://svnweb.freebsd.org/changeset/base/301204 Log: xen-netfront: use callout_reset_curcpu instead of callout_reset This should help distribute the load of the callbacks. Suggested by: hps Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 12:26:55 2016 (r301203) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 14:25:10 2016 (r301204) @@ -1101,8 +1101,8 @@ xn_alloc_rx_buffers(struct netfront_rxq /* Not enough requests? Try again later. */ if (req_prod - rxq->ring.rsp_cons < NET_RX_SLOTS_MIN) { - callout_reset(&rxq->rx_refill, hz/10, xn_alloc_rx_buffers_callout, - rxq); + callout_reset_curcpu(&rxq->rx_refill, hz/10, + xn_alloc_rx_buffers_callout, rxq); return; } From owner-svn-src-head@freebsd.org Thu Jun 2 15:14:41 2016 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 79EC5B64F45; Thu, 2 Jun 2016 15:14:41 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id 2D8BC108B; Thu, 2 Jun 2016 15:14:41 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52FEeIT034665; Thu, 2 Jun 2016 15:14:40 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52FEe21034664; Thu, 2 Jun 2016 15:14:40 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606021514.u52FEe21034664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 2 Jun 2016 15:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301205 - head/sys/riscv/riscv 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.22 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: Thu, 02 Jun 2016 15:14:41 -0000 Author: br Date: Thu Jun 2 15:14:40 2016 New Revision: 301205 URL: https://svnweb.freebsd.org/changeset/base/301205 Log: Fix typos. Modified: head/sys/riscv/riscv/elf_machdep.c Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Thu Jun 2 14:25:10 2016 (r301204) +++ head/sys/riscv/riscv/elf_machdep.c Thu Jun 2 15:14:40 2016 (r301205) @@ -1,7 +1,7 @@ /*- * Copyright 1996-1998 John D. Polstra. * Copyright (c) 2015 Ruslan Bukin - * Copyright (c) 2016 Yukishige SHibata + * Copyright (c) 2016 Yukishige Shibata * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -132,7 +132,7 @@ SYSCTL_INT(_kern, OID_AUTO, debug_kld, struct type2str_ent { int type; - const char* str; + const char *str; }; void @@ -203,28 +203,28 @@ insert_imm(uint32_t insn, uint32_t imm, } /* - * The RISCV ISA is designed so that all of immediate value is - * sign-extened. + * The RISC-V ISA is designed so that all of immediate values are + * sign-extended. * An immediate value is sometimes generated at runtime by adding * 12bit sign integer and 20bit signed integer. This requests 20bit * immediate value to be ajusted if the MSB of the 12bit immediate - * value is asserted (sign extened value is treated as negative value). + * value is asserted (sign-extended value is treated as negative value). * * For example, 0x123800 can be calculated by adding upper 20 bit of - * 0x124000 and signed-extended 12bit immediate whose bit pattern is - * 0x800 as follows; + * 0x124000 and sign-extended 12bit immediate whose bit pattern is + * 0x800 as follows: * 0x123800 * = 0x123000 + 0x800 * = (0x123000 + 0x1000) + (-0x1000 + 0x800) * = (0x123000 + 0x1000) + (0xff...ff800) - * = 0x124000 + sign-exntend(0x800) + * = 0x124000 + sign-extention(0x800) */ static uint32_t calc_hi20_imm(uint32_t value) { /* * There is the arithmetical hack that can remove conditional - * statement. But I implement it in straghtforward way. + * statement. But I implement it in straightforward way. */ if ((value & 0x800) != 0) value += 0x1000; @@ -246,7 +246,7 @@ static const struct type2str_ent t2s[] = { R_RISCV_LO12_S, "R_RISCV_LO12_S" }, }; -static const char* +static const char * reloctype_to_str(int type) { int i; @@ -373,7 +373,7 @@ elf_reloc_internal(linker_file_t lf, Elf return -1; val = addr - (Elf_Addr)where; if ((val <= -(1UL << 32) || (1UL << 32) <= val)) { - printf("kldload:%s: huge offset against R_RISCV_CALL\n"); + printf("kldload: huge offset against R_RISCV_CALL\n"); return -1; } From owner-svn-src-head@freebsd.org Thu Jun 2 12:01:59 2016 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 B3102B66C5B; Thu, 2 Jun 2016 12:01:59 +0000 (UTC) (envelope-from avos@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 mx1.freebsd.org (Postfix) with ESMTPS id 8475B1ADF; Thu, 2 Jun 2016 12:01:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52C1wpd065252; Thu, 2 Jun 2016 12:01:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52C1wYC065251; Thu, 2 Jun 2016 12:01:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606021201.u52C1wYC065251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 2 Jun 2016 12:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301202 - head/sys/dev/usb/wlan 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.22 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: Thu, 02 Jun 2016 12:01:59 -0000 Author: avos Date: Thu Jun 2 12:01:58 2016 New Revision: 301202 URL: https://svnweb.freebsd.org/changeset/base/301202 Log: urtw: fix unused variable assignments. Append CWmax and retry limitation to tp->maxretry instead of rewriting it (will restore pre-r198194 behavior). Noticed by: pfg, hps Reported by: Coverity CID: 1304937, 1304920 Modified: head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Jun 2 11:21:00 2016 (r301201) +++ head/sys/dev/usb/wlan/if_urtw.c Thu Jun 2 12:01:58 2016 (r301202) @@ -1789,8 +1789,8 @@ urtw_tx_start(struct urtw_softc *sc, str flags |= (urtw_rate2rtl(11) & 0xf) << URTW_TX_FLAG_RTSRATE_SHIFT; tx->flag = htole32(flags); tx->retry = 3; /* CW minimum */ - tx->retry = 7 << 4; /* CW maximum */ - tx->retry = URTW_TX_MAXRETRY << 8; /* retry limitation */ + tx->retry |= 7 << 4; /* CW maximum */ + tx->retry |= URTW_TX_MAXRETRY << 8; /* retry limitation */ m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1)); } From owner-svn-src-head@freebsd.org Thu Jun 2 15:31:00 2016 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 11BCBB653C8; Thu, 2 Jun 2016 15:31:00 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id D7B591C40; Thu, 2 Jun 2016 15:30:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52FUxkE041118; Thu, 2 Jun 2016 15:30:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52FUxDo041117; Thu, 2 Jun 2016 15:30:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606021530.u52FUxDo041117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 2 Jun 2016 15:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301206 - head/sys/dev/usb/net 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.22 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: Thu, 02 Jun 2016 15:31:00 -0000 Author: pfg Date: Thu Jun 2 15:30:58 2016 New Revision: 301206 URL: https://svnweb.freebsd.org/changeset/base/301206 Log: usb/uhso: Don't bail out on first USB error. CID: 1305680 Submitted by: hselasky MFC after: 3 days Modified: head/sys/dev/usb/net/uhso.c Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Thu Jun 2 15:14:40 2016 (r301205) +++ head/sys/dev/usb/net/uhso.c Thu Jun 2 15:30:58 2016 (r301206) @@ -1225,6 +1225,7 @@ uhso_mux_write_callback(struct usb_xfer ht->ht_muxport); /* FALLTHROUGH */ case USB_ST_SETUP: +tr_setup: pc = usbd_xfer_get_frame(xfer, 1); if (ucom_get_data(&sc->sc_ucom[ht->ht_muxport], pc, 0, 32, &actlen)) { @@ -1255,7 +1256,8 @@ uhso_mux_write_callback(struct usb_xfer UHSO_DPRINTF(0, "error: %s\n", usbd_errstr(error)); if (error == USB_ERR_CANCELLED) break; - break; + usbd_xfer_set_stall(xfer); + goto tr_setup; } } From owner-svn-src-head@freebsd.org Thu Jun 2 14:28:32 2016 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 6A6C4B65C47; Thu, 2 Jun 2016 14:28:32 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0055E1ECE; Thu, 2 Jun 2016 14:28:31 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id a136so233124845wme.0; Thu, 02 Jun 2016 07:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=A/DR2n+gGZMvyYYCVcM43XVw8UJrDhumScaoOGXHHKE=; b=PwxNTw6Zd9oyRK9Lbleq77JAFvpCAMYf0mvqzWSpLsB85p4pDoBiC/+OFGsbfOo58V ktzKIX1iTNY03PEqkFVAqwOa8UlusLv8vMd9tZHuj/BOz8O36q3j09Q6ORAL2nNoyg7z oJiqp/OxKa/zOJ0MmkLkrVld6rj+MZ4eIyab3ILX5cr3QKNWDPm9ZcmNNsatOKPWdvDn isZlErbFFhpBJ+3e7PCPuRBfwSQ+oZVFi7is6nkUXxG3/7b172AiqKW7eeBRg57eDKDB 2+A7BvPm2B3xtBSbT5DNbJO1CjbuV73mUbtwwtfwefco6T0CYR522fsoz4qH//V1Mihe tRow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=A/DR2n+gGZMvyYYCVcM43XVw8UJrDhumScaoOGXHHKE=; b=dnCzyZRxwr0arL7/ICNNM9L3SeJOfl+Zr4XEijlzwk/+fPHzWXEHvpDDC6Qw4MN12+ r6YG0YtjbKBrt8NV1WTATHv0gHBGtQWIpzuf59OebaDb64kqg7sp6nq8SjXhZgNTXYJu in2fDHIaasktbPUvIMcH0k9+DavZsYhvE+n5RAv/MYLYX52yjYtGbtGHoc5FHhvCEVaJ LjLfAw2tRLgH7EPskWmySlbCMwjF0Cl/LtUH5jAgqgvXSRoluYkF4asczNCFD0hTdDut 6Y89t2Wq+n/rp51YEAc9FM03WmVqP2K5R0b9Sx0Vzt8x8tVlEyjGTrbt7QoP1G5A3miq oUTg== X-Gm-Message-State: ALyK8tJj5yW4gufMhjGRY3Pk4gDCkb+CMATT2RnTBqFbNS+HvRbybm1ZrNzy8uJsqfBr1w== X-Received: by 10.194.110.137 with SMTP id ia9mr8894007wjb.107.1464877709737; Thu, 02 Jun 2016 07:28:29 -0700 (PDT) Received: from localhost (78.red-88-8-193.dynamicip.rima-tde.net. [88.8.193.78]) by smtp.gmail.com with ESMTPSA id lf7sm870707wjb.23.2016.06.02.07.28.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jun 2016 07:28:29 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 2 Jun 2016 16:28:24 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301197 - head/sys/dev/xen/netfront Message-ID: <20160602142824.m6d24n2rx3i2kclt@mac> References: <201606021114.u52BEQqB047172@repo.freebsd.org> <2c81e44d-65de-10f0-8837-f23896855150@selasky.org> <20160602125422.gmdsueoeu5fiiec5@mac> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.6.0-neo (2016-04-07) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 14:28:32 -0000 On Thu, Jun 02, 2016 at 03:01:03PM +0200, Hans Petter Selasky wrote: > On 06/02/16 14:54, Roger Pau Monné wrote: > > On Thu, Jun 02, 2016 at 01:19:56PM +0200, Hans Petter Selasky wrote: > > > On 06/02/16 13:14, Roger Pau Monné wrote: > > > > + callout_reset(&rxq->rx_refill, hz/10, xn_alloc_rx_buffers_callout, > > > > + rxq); > > > > > > Maybe use callout_reset_curcpu() to take advantage of callout's SMP > > > capabilities ? > > > > Yes, that's fine. But what's the benefit of it? I don't really care whether > > the callout is run on the current CPU or not. Is callout_reset_curcpu > > cheaper than callout_reset? > > > > Hi, > > It is maybe not cheaper, but it will distribute the load of the > xn_alloc_rx_buffers_callout() callback, to the current CPU calling > callout_reset_curcpu(). Else xn_alloc_rx_buffers_callout() will always be > called from callback thread zero. Thanks for the clarification. I did get the impression that callout_reset already distributed the callbacks across the number of available CPUs, maybe the man page should be expanded to explain this? I've committed the change as r301204. Roger. From owner-svn-src-head@freebsd.org Thu Jun 2 14:35:50 2016 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 6D909B60726; Thu, 2 Jun 2016 14:35:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 39AF1101E; Thu, 2 Jun 2016 14:35:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6A5291FE024; Thu, 2 Jun 2016 16:35:48 +0200 (CEST) Subject: Re: svn commit: r301197 - head/sys/dev/xen/netfront To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <201606021114.u52BEQqB047172@repo.freebsd.org> <2c81e44d-65de-10f0-8837-f23896855150@selasky.org> <20160602125422.gmdsueoeu5fiiec5@mac> <20160602142824.m6d24n2rx3i2kclt@mac> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Thu, 2 Jun 2016 16:39:11 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160602142824.m6d24n2rx3i2kclt@mac> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 14:35:50 -0000 On 06/02/16 16:28, Roger Pau Monné wrote: > Thanks for the clarification. I did get the impression that callout_reset > already distributed the callbacks across the number of available CPUs, maybe > the man page should be expanded to explain this? Hi, It makes sense that callout_reset() should distribute callouts by default, though I can imagine that that there are applications which depend on a strict callback order for timeouts. +1 --HPS From owner-svn-src-head@freebsd.org Thu Jun 2 16:58:49 2016 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 159A6B62EBF; Thu, 2 Jun 2016 16:58:49 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id DB3651936; Thu, 2 Jun 2016 16:58:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52GwmGX071546; Thu, 2 Jun 2016 16:58:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52GwmaG071545; Thu, 2 Jun 2016 16:58:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606021658.u52GwmaG071545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 2 Jun 2016 16:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301210 - head/sys/vm 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.22 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: Thu, 02 Jun 2016 16:58:49 -0000 Author: markj Date: Thu Jun 2 16:58:47 2016 New Revision: 301210 URL: https://svnweb.freebsd.org/changeset/base/301210 Log: Don't preserve the page's object linkage in vm_page_insert_after(). Per the KASSERT at the beginning of the function, we expect that the page does not belong to any object, so its object and pindex fields are meaningless. Reset them in the rare case that vm_radix_insert() fails. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6669 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 2 16:40:09 2016 (r301209) +++ head/sys/vm/vm_page.c Thu Jun 2 16:58:47 2016 (r301210) @@ -1112,8 +1112,6 @@ static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred) { - vm_pindex_t sidx; - vm_object_t sobj; vm_page_t msucc; VM_OBJECT_ASSERT_WLOCKED(object); @@ -1134,8 +1132,6 @@ vm_page_insert_after(vm_page_t m, vm_obj /* * Record the object/offset pair in this page */ - sobj = m->object; - sidx = m->pindex; m->object = object; m->pindex = pindex; @@ -1143,8 +1139,8 @@ vm_page_insert_after(vm_page_t m, vm_obj * Now link into the object's ordered list of backed pages. */ if (vm_radix_insert(&object->rtree, m)) { - m->object = sobj; - m->pindex = sidx; + m->object = NULL; + m->pindex = 0; return (1); } vm_page_insert_radixdone(m, object, mpred); From owner-svn-src-head@freebsd.org Thu Jun 2 17:11:25 2016 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 6F7BBB65270; Thu, 2 Jun 2016 17:11:25 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id 4066C11D8; Thu, 2 Jun 2016 17:11:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HBObD076687; Thu, 2 Jun 2016 17:11:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HBOYM076686; Thu, 2 Jun 2016 17:11:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606021711.u52HBOYM076686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 2 Jun 2016 17:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301212 - head/sys/vm 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.22 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: Thu, 02 Jun 2016 17:11:25 -0000 Author: markj Date: Thu Jun 2 17:11:24 2016 New Revision: 301212 URL: https://svnweb.freebsd.org/changeset/base/301212 Log: Reset the page busy lock state after failing to insert into the object. Freeing a shared-busy page is not permitted. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6670 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 2 17:08:08 2016 (r301211) +++ head/sys/vm/vm_page.c Thu Jun 2 17:11:24 2016 (r301212) @@ -1748,6 +1748,7 @@ vm_page_alloc(vm_object_t object, vm_pin } m->object = NULL; m->oflags = VPO_UNMANAGED; + m->busy_lock = VPB_UNBUSIED; vm_page_free(m); return (NULL); } @@ -1949,6 +1950,7 @@ retry: m->object = NULL; m->oflags |= VPO_UNMANAGED; } + m->busy_lock = VPB_UNBUSIED; vm_page_free(m); } return (NULL); From owner-svn-src-head@freebsd.org Thu Jun 2 17:17:16 2016 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 ED24FB656DD; Thu, 2 Jun 2016 17:17:16 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id BDED91A73; Thu, 2 Jun 2016 17:17:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HHFct078875; Thu, 2 Jun 2016 17:17:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HHFf3078874; Thu, 2 Jun 2016 17:17:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606021717.u52HHFf3078874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 2 Jun 2016 17:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301213 - head/sys/netinet6 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.22 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: Thu, 02 Jun 2016 17:17:17 -0000 Author: markj Date: Thu Jun 2 17:17:15 2016 New Revision: 301213 URL: https://svnweb.freebsd.org/changeset/base/301213 Log: Always start IPv6 DAD asynchronously. Otherwise we transmit the first neighbour solicitation in the context of the caller of nd6_dad_start(), which can easily result in lock recursion. When DAD is to be started after some delay, we send the first NS from the DAD callout handler, so just change the implementation to do this in the non-delayed case as well. Reviewed by: ae, hrs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6639 Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Jun 2 17:11:24 2016 (r301212) +++ head/sys/netinet6/nd6_nbr.c Thu Jun 2 17:17:15 2016 (r301213) @@ -1216,7 +1216,6 @@ nd6_dad_start(struct ifaddr *ifa, int de struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; - int send_ns; /* * If we don't need DAD, don't do it. @@ -1290,12 +1289,7 @@ nd6_dad_start(struct ifaddr *ifa, int de dp->dad_ns_lcount = dp->dad_loopbackprobe = 0; refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); - send_ns = 0; - if (delay == 0) { - send_ns = 1; - delay = (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000; - } - nd6_dad_starttimer(dp, delay, send_ns); + nd6_dad_starttimer(dp, delay, 0); } /* From owner-svn-src-head@freebsd.org Thu Jun 2 17:21:58 2016 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 E5C62B65AF7; Thu, 2 Jun 2016 17:21:58 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id 9E86C132D; Thu, 2 Jun 2016 17:21:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HLvk2081712; Thu, 2 Jun 2016 17:21:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HLv6q081711; Thu, 2 Jun 2016 17:21:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606021721.u52HLv6q081711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 2 Jun 2016 17:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301214 - head/sys/netinet6 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.22 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: Thu, 02 Jun 2016 17:21:59 -0000 Author: markj Date: Thu Jun 2 17:21:57 2016 New Revision: 301214 URL: https://svnweb.freebsd.org/changeset/base/301214 Log: Exploit r301213 to fix in6 ifaddr locking in pfxlist_onlink_check(). Reviewed by: ae, hrs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6639 Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Thu Jun 2 17:17:15 2016 (r301213) +++ head/sys/netinet6/nd6_rtr.c Thu Jun 2 17:21:57 2016 (r301214) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1437,12 +1438,13 @@ find_pfxlist_reachable_router(struct nd_ * is no router around us. */ void -pfxlist_onlink_check() +pfxlist_onlink_check(void) { struct nd_prefix *pr; struct in6_ifaddr *ifa; struct nd_defrouter *dr; struct nd_pfxrouter *pfxrtr = NULL; + struct rm_priotracker in6_ifa_tracker; /* * Check if there is a prefix that has a reachable advertising @@ -1573,9 +1575,8 @@ pfxlist_onlink_check() * detached. Note, however, that a manually configured address should * always be attached. * The precise detection logic is same as the one for prefixes. - * - * XXXRW: in6_ifaddrhead locking. */ + IN6_IFADDR_RLOCK(&in6_ifa_tracker); TAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) { if (!(ifa->ia6_flags & IN6_IFF_AUTOCONF)) continue; @@ -1610,8 +1611,7 @@ pfxlist_onlink_check() ifa->ia6_flags |= IN6_IFF_DETACHED; } } - } - else { + } else { TAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) { if ((ifa->ia6_flags & IN6_IFF_AUTOCONF) == 0) continue; @@ -1624,6 +1624,7 @@ pfxlist_onlink_check() } } } + IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); } static int From owner-svn-src-head@freebsd.org Thu Jun 2 17:28:40 2016 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 E960CB65D59; Thu, 2 Jun 2016 17:28:40 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id B6A431A05; Thu, 2 Jun 2016 17:28:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HSdfL082554; Thu, 2 Jun 2016 17:28:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HSdox082553; Thu, 2 Jun 2016 17:28:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606021728.u52HSdox082553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 2 Jun 2016 17:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301215 - head/lib/libc/iconv 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.22 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: Thu, 02 Jun 2016 17:28:41 -0000 Author: pfg Date: Thu Jun 2 17:28:39 2016 New Revision: 301215 URL: https://svnweb.freebsd.org/changeset/base/301215 Log: citrus: Remove redundant code in _citrus_esdb_get_list(). It appears "sorted" may have not been implemented. Sorted or not, we always follow the same action so simplify the code. Leave a note for future generations. CID: 1347084 Modified: head/lib/libc/iconv/citrus_esdb.c Modified: head/lib/libc/iconv/citrus_esdb.c ============================================================================== --- head/lib/libc/iconv/citrus_esdb.c Thu Jun 2 17:21:57 2016 (r301214) +++ head/lib/libc/iconv/citrus_esdb.c Thu Jun 2 17:28:39 2016 (r301215) @@ -291,18 +291,12 @@ _citrus_esdb_get_list(char ***rlist, siz /* get alias entries */ while ((ret = _lookup_seq_next(cla, &key, &data)) == 0) { - if (sorted) - snprintf(buf, sizeof(buf), "%.*s/%.*s", - (int)_region_size(&data), - (const char *)_region_head(&data), - (int)_region_size(&key), - (const char *)_region_head(&key)); - else - snprintf(buf, sizeof(buf), "%.*s/%.*s", - (int)_region_size(&data), - (const char *)_region_head(&data), - (int)_region_size(&key), - (const char *)_region_head(&key)); + /* XXX: sorted? */ + snprintf(buf, sizeof(buf), "%.*s/%.*s", + (int)_region_size(&data), + (const char *)_region_head(&data), + (int)_region_size(&key), + (const char *)_region_head(&key)); _bcs_convert_to_upper(buf); list[num] = strdup(buf); if (list[num] == NULL) { From owner-svn-src-head@freebsd.org Thu Jun 2 17:31:38 2016 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 BDF03B65E56; Thu, 2 Jun 2016 17:31:38 +0000 (UTC) (envelope-from tuexen@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 mx1.freebsd.org (Postfix) with ESMTPS id 8E9AC1DBC; Thu, 2 Jun 2016 17:31:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HVbFQ085315; Thu, 2 Jun 2016 17:31:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HVbgt085314; Thu, 2 Jun 2016 17:31:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606021731.u52HVbgt085314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 2 Jun 2016 17:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301216 - head/usr.bin/sockstat 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.22 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: Thu, 02 Jun 2016 17:31:38 -0000 Author: tuexen Date: Thu Jun 2 17:31:37 2016 New Revision: 301216 URL: https://svnweb.freebsd.org/changeset/base/301216 Log: Fix two types which resulted in setting the address long wrong for IPv6 addresses. Reported by: pfg@ CID: 1347086 MFC after: 1 week Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Thu Jun 2 17:28:39 2016 (r301215) +++ head/usr.bin/sockstat/sockstat.c Thu Jun 2 17:31:37 2016 (r301216) @@ -390,7 +390,7 @@ gather_sctp(void) if (sock->family == AF_INET) sock->laddr->address.ss_len = sizeof(struct sockaddr_in); else - sock->laddr->address.ss_len = sizeof(struct sockaddr_in); + sock->laddr->address.ss_len = sizeof(struct sockaddr_in6); local_all_loopback = 0; } if ((sock->faddr = calloc(1, sizeof(struct addr))) == NULL) @@ -399,7 +399,7 @@ gather_sctp(void) if (sock->family == AF_INET) sock->faddr->address.ss_len = sizeof(struct sockaddr_in); else - sock->faddr->address.ss_len = sizeof(struct sockaddr_in); + sock->faddr->address.ss_len = sizeof(struct sockaddr_in6); no_stcb = 1; while (offset < len) { xstcb = (struct xsctp_tcb *)(void *)(buf + offset); From owner-svn-src-head@freebsd.org Thu Jun 2 17:51:32 2016 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 BA21DB65308; Thu, 2 Jun 2016 17:51:32 +0000 (UTC) (envelope-from gnn@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 mx1.freebsd.org (Postfix) with ESMTPS id 7E4FD1D7E; Thu, 2 Jun 2016 17:51:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HpVFd090403; Thu, 2 Jun 2016 17:51:31 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HpTrH090384; Thu, 2 Jun 2016 17:51:29 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201606021751.u52HpTrH090384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 2 Jun 2016 17:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301217 - in head/sys: net netinet netinet6 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.22 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: Thu, 02 Jun 2016 17:51:32 -0000 Author: gnn Date: Thu Jun 2 17:51:29 2016 New Revision: 301217 URL: https://svnweb.freebsd.org/changeset/base/301217 Log: This change re-adds L2 caching for TCP and UDP, as originally added in D4306 but removed due to other changes in the system. Restore the llentry pointer to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as appropriate. Submitted by: Mike Karels Differential Revision: https://reviews.freebsd.org/D6262 Modified: head/sys/net/flowtable.c head/sys/net/if_arcsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_iso88025subr.c head/sys/net/if_llatbl.h head/sys/net/route.c head/sys/net/route.h head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/in_pcb.c head/sys/netinet/ip_output.c head/sys/netinet/toecore.c head/sys/netinet6/in6.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/flowtable.c Thu Jun 2 17:51:29 2016 (r301217) @@ -696,13 +696,8 @@ flowtable_lookup(sa_family_t sa, struct ro->ro_rt = fle->f_rt; ro->ro_flags |= RT_NORTREF; lle = fle->f_lle; - if (lle != NULL && (lle->la_flags & LLE_VALID)) { - ro->ro_prepend = lle->r_linkdata; - ro->ro_plen = lle->r_hdrlen; - ro->ro_flags |= RT_MAY_LOOP; - if (lle->la_flags & LLE_IFADDR) - ro->ro_flags |= RT_L2_ME; - } + if (lle != NULL && (lle->la_flags & LLE_VALID)) + ro->ro_lle = lle; /* share ref with fle->f_lle */ return (0); } Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/if_arcsubr.c Thu Jun 2 17:51:29 2016 (r301217) @@ -129,7 +129,8 @@ arc_output(struct ifnet *ifp, struct mbu else if (ifp->if_flags & IFF_NOARP) adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF; else { - error = arpresolve(ifp, is_gw, m, dst, &adst, NULL); + error = arpresolve(ifp, is_gw, m, dst, &adst, NULL, + NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); } @@ -170,7 +171,8 @@ arc_output(struct ifnet *ifp, struct mbu if ((m->m_flags & M_MCAST) != 0) adst = arcbroadcastaddr; /* ARCnet broadcast address */ else { - error = nd6_resolve(ifp, is_gw, m, dst, &adst, NULL); + error = nd6_resolve(ifp, is_gw, m, dst, &adst, NULL, + NULL); if (error != 0) return (error == EWOULDBLOCK ? 0 : error); } Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/if_ethersubr.c Thu Jun 2 17:51:29 2016 (r301217) @@ -199,7 +199,7 @@ ether_requestencap(struct ifnet *ifp, st static int ether_resolve_addr(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro, u_char *phdr, - uint32_t *pflags) + uint32_t *pflags, struct llentry **plle) { struct ether_header *eh; uint32_t lleflags = 0; @@ -208,13 +208,16 @@ ether_resolve_addr(struct ifnet *ifp, st uint16_t etype; #endif + if (plle) + *plle = NULL; eh = (struct ether_header *)phdr; switch (dst->sa_family) { #ifdef INET case AF_INET: if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) - error = arpresolve(ifp, 0, m, dst, phdr, &lleflags); + error = arpresolve(ifp, 0, m, dst, phdr, &lleflags, + plle); else { if (m->m_flags & M_BCAST) memcpy(eh->ether_dhost, ifp->if_broadcastaddr, @@ -233,7 +236,8 @@ ether_resolve_addr(struct ifnet *ifp, st #ifdef INET6 case AF_INET6: if ((m->m_flags & M_MCAST) == 0) - error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags); + error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags, + plle); else { const struct in6_addr *a6; a6 = &(((const struct sockaddr_in6 *)dst)->sin6_addr); @@ -283,14 +287,40 @@ ether_output(struct ifnet *ifp, struct m int loop_copy = 1; int hlen; /* link layer header length */ uint32_t pflags; + struct llentry *lle = NULL; + struct rtentry *rt0 = NULL; + int addref = 0; phdr = NULL; pflags = 0; if (ro != NULL) { - phdr = ro->ro_prepend; - hlen = ro->ro_plen; - pflags = ro->ro_flags; + /* XXX BPF uses ro_prepend */ + if (ro->ro_prepend != NULL) { + phdr = ro->ro_prepend; + hlen = ro->ro_plen; + } else if (!(m->m_flags & (M_BCAST | M_MCAST))) { + if ((ro->ro_flags & RT_LLE_CACHE) != 0) { + lle = ro->ro_lle; + if (lle != NULL && + (lle->la_flags & LLE_VALID) == 0) { + LLE_FREE(lle); + lle = NULL; /* redundant */ + ro->ro_lle = NULL; + } + if (lle == NULL) { + /* if we lookup, keep cache */ + addref = 1; + } + } + if (lle != NULL) { + phdr = lle->r_linkdata; + hlen = lle->r_hdrlen; + pflags = lle->r_flags; + } + } + rt0 = ro->ro_rt; } + #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) @@ -308,7 +338,10 @@ ether_output(struct ifnet *ifp, struct m /* No prepend data supplied. Try to calculate ourselves. */ phdr = linkhdr; hlen = ETHER_HDR_LEN; - error = ether_resolve_addr(ifp, m, dst, ro, phdr, &pflags); + error = ether_resolve_addr(ifp, m, dst, ro, phdr, &pflags, + addref ? &lle : NULL); + if (addref && lle != NULL) + ro->ro_lle = lle; if (error != 0) return (error == EWOULDBLOCK ? 0 : error); } Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/if_fddisubr.c Thu Jun 2 17:51:29 2016 (r301217) @@ -126,7 +126,7 @@ fddi_output(struct ifnet *ifp, struct mb switch (dst->sa_family) { #ifdef INET case AF_INET: { - error = arpresolve(ifp, is_gw, m, dst, edst, NULL); + error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); type = htons(ETHERTYPE_IP); @@ -162,7 +162,7 @@ fddi_output(struct ifnet *ifp, struct mb #endif /* INET */ #ifdef INET6 case AF_INET6: - error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL); + error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); type = htons(ETHERTYPE_IPV6); Modified: head/sys/net/if_fwsubr.c ============================================================================== --- head/sys/net/if_fwsubr.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/if_fwsubr.c Thu Jun 2 17:51:29 2016 (r301217) @@ -144,7 +144,8 @@ firewire_output(struct ifnet *ifp, struc * doesn't fit into the arp model. */ if (unicast) { - error = arpresolve(ifp, is_gw, m, dst, (u_char *) destfw, NULL); + error = arpresolve(ifp, is_gw, m, dst, + (u_char *) destfw, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); } @@ -174,7 +175,7 @@ firewire_output(struct ifnet *ifp, struc case AF_INET6: if (unicast) { error = nd6_resolve(fc->fc_ifp, is_gw, m, dst, - (u_char *) destfw, NULL); + (u_char *) destfw, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); } Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/if_iso88025subr.c Thu Jun 2 17:51:29 2016 (r301217) @@ -254,7 +254,7 @@ iso88025_output(struct ifnet *ifp, struc switch (dst->sa_family) { #ifdef INET case AF_INET: - error = arpresolve(ifp, is_gw, m, dst, edst, NULL); + error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); snap_type = ETHERTYPE_IP; @@ -289,7 +289,7 @@ iso88025_output(struct ifnet *ifp, struc #endif /* INET */ #ifdef INET6 case AF_INET6: - error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL); + error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); snap_type = ETHERTYPE_IPV6; Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/if_llatbl.h Thu Jun 2 17:51:29 2016 (r301217) @@ -138,7 +138,6 @@ struct llentry { LLE_FREE_LOCKED(lle); \ } while (0) - typedef struct llentry *(llt_lookup_t)(struct lltable *, u_int flags, const struct sockaddr *l3addr); typedef struct llentry *(llt_alloc_t)(struct lltable *, u_int flags, Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/route.c Thu Jun 2 17:51:29 2016 (r301217) @@ -207,6 +207,8 @@ rt_tables_get_gen(int table, int fam) struct rib_head *rnh; rnh = *rt_tables_get_rnh_ptr(table, fam); + KASSERT(rnh != NULL, ("%s: NULL rib_head pointer table %d fam %d", + __func__, table, fam)); return (rnh->rnh_gen); } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/net/route.h Thu Jun 2 17:51:29 2016 (r301217) @@ -50,6 +50,11 @@ */ struct route { struct rtentry *ro_rt; + struct llentry *ro_lle; + /* + * ro_prepend and ro_plen are only used for bpf to pass in a + * preformed header. They are not cacheable. + */ char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; @@ -71,6 +76,7 @@ struct route { #define RT_REJECT 0x0020 /* Destination is reject */ #define RT_BLACKHOLE 0x0040 /* Destination is blackhole */ #define RT_HAS_GW 0x0080 /* Destination has GW */ +#define RT_LLE_CACHE 0x0100 /* Cache link layer */ struct rt_metrics { u_long rmx_locks; /* Kernel must leave these values alone */ @@ -399,6 +405,7 @@ struct rt_addrinfo { if ((_ro)->ro_flags & RT_NORTREF) { \ (_ro)->ro_flags &= ~RT_NORTREF; \ (_ro)->ro_rt = NULL; \ + (_ro)->ro_lle = NULL; \ } else { \ RT_LOCK((_ro)->ro_rt); \ RTFREE_LOCKED((_ro)->ro_rt); \ @@ -413,9 +420,11 @@ struct rt_addrinfo { */ #define RT_VALIDATE(ro, cookiep, fibnum) do { \ rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \ - if (*(cookiep) != cookie && (ro)->ro_rt != NULL) { \ - RTFREE((ro)->ro_rt); \ - (ro)->ro_rt = NULL; \ + if (*(cookiep) != cookie) { \ + if ((ro)->ro_rt != NULL) { \ + RTFREE((ro)->ro_rt); \ + (ro)->ro_rt = NULL; \ + } \ *(cookiep) = cookie; \ } \ } while (0) Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet/if_ether.c Thu Jun 2 17:51:29 2016 (r301217) @@ -420,7 +420,8 @@ arprequest(struct ifnet *ifp, const stru */ static int arpresolve_full(struct ifnet *ifp, int is_gw, int flags, struct mbuf *m, - const struct sockaddr *dst, u_char *desten, uint32_t *pflags) + const struct sockaddr *dst, u_char *desten, uint32_t *pflags, + struct llentry **plle) { struct llentry *la = NULL, *la_tmp; struct mbuf *curr = NULL; @@ -431,6 +432,8 @@ arpresolve_full(struct ifnet *ifp, int i if (pflags != NULL) *pflags = 0; + if (plle != NULL) + *plle = NULL; if ((flags & LLE_CREATE) == 0) { IF_AFDATA_RLOCK(ifp); @@ -483,6 +486,10 @@ arpresolve_full(struct ifnet *ifp, int i } if (pflags != NULL) *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR); + if (plle) { + LLE_ADDREF(la); + *plle = la; + } LLE_WUNLOCK(la); return (0); } @@ -548,12 +555,12 @@ arpresolve_full(struct ifnet *ifp, int i */ int arpresolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, - char *desten, uint32_t *pflags) + char *desten, uint32_t *pflags, struct llentry **plle) { int error; flags |= LLE_ADDRONLY; - error = arpresolve_full(ifp, 0, flags, NULL, dst, desten, pflags); + error = arpresolve_full(ifp, 0, flags, NULL, dst, desten, pflags, plle); return (error); } @@ -576,12 +583,15 @@ arpresolve_addr(struct ifnet *ifp, int f */ int arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, - const struct sockaddr *dst, u_char *desten, uint32_t *pflags) + const struct sockaddr *dst, u_char *desten, uint32_t *pflags, + struct llentry **plle) { struct llentry *la = NULL; if (pflags != NULL) *pflags = 0; + if (plle != NULL) + *plle = NULL; if (m != NULL) { if (m->m_flags & M_BCAST) { @@ -616,7 +626,7 @@ arpresolve(struct ifnet *ifp, int is_gw, IF_AFDATA_RUNLOCK(ifp); return (arpresolve_full(ifp, is_gw, la == NULL ? LLE_CREATE : 0, m, dst, - desten, pflags)); + desten, pflags, plle)); } /* Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet/if_ether.h Thu Jun 2 17:51:29 2016 (r301217) @@ -113,11 +113,14 @@ extern u_char ether_ipmulticast_min[ETHE extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN]; struct ifaddr; +struct llentry; int arpresolve_addr(struct ifnet *ifp, int flags, - const struct sockaddr *dst, char *desten, uint32_t *pflags); + const struct sockaddr *dst, char *desten, uint32_t *pflags, + struct llentry **plle); int arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, - const struct sockaddr *dst, u_char *desten, uint32_t *pflags); + const struct sockaddr *dst, u_char *desten, uint32_t *pflags, + struct llentry **plle); void arprequest(struct ifnet *, const struct in_addr *, const struct in_addr *, u_char *); void arp_ifinit(struct ifnet *, struct ifaddr *); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet/in_pcb.c Thu Jun 2 17:51:29 2016 (r301217) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1302,6 +1303,8 @@ in_pcbfree(struct inpcb *inp) RTFREE(inp->inp_route.ro_rt); inp->inp_route.ro_rt = (struct rtentry *)NULL; } + if (inp->inp_route.ro_lle) + LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ inp->inp_vflag = 0; inp->inp_flags2 |= INP_FREED; @@ -2243,6 +2246,8 @@ in_losing(struct inpcb *inp) RTFREE(inp->inp_route.ro_rt); inp->inp_route.ro_rt = (struct rtentry *)NULL; } + if (inp->inp_route.ro_lle) + LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ return; } Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet/ip_output.c Thu Jun 2 17:51:29 2016 (r301217) @@ -245,7 +245,8 @@ ip_output(struct mbuf *m, struct mbuf *o if (ro == NULL) { ro = &iproute; bzero(ro, sizeof (*ro)); - } + } else + ro->ro_flags |= RT_LLE_CACHE; #ifdef FLOWTABLE if (ro->ro_rt == NULL) @@ -311,6 +312,9 @@ again: dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { RTFREE(rte); rte = ro->ro_rt = (struct rtentry *)NULL; + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = (struct llentry *)NULL; } ia = NULL; have_ia_ref = 0; Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet/toecore.c Thu Jun 2 17:51:29 2016 (r301217) @@ -451,12 +451,12 @@ toe_l2_resolve(struct toedev *tod, struc switch (sa->sa_family) { #ifdef INET case AF_INET: - rc = arpresolve(ifp, 0, NULL, sa, lladdr, NULL); + rc = arpresolve(ifp, 0, NULL, sa, lladdr, NULL, NULL); break; #endif #ifdef INET6 case AF_INET6: - rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL); + rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL, NULL); break; #endif default: Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet6/in6.h Thu Jun 2 17:51:29 2016 (r301217) @@ -375,6 +375,11 @@ extern const struct in6_addr in6addr_lin #if __BSD_VISIBLE struct route_in6 { struct rtentry *ro_rt; + struct llentry *ro_lle; + /* + * ro_prepend and ro_plen are only used for bpf to pass in a + * preformed header. They are not cacheable. + */ char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet6/in6_pcb.c Thu Jun 2 17:51:29 2016 (r301217) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -831,6 +832,8 @@ in6_losing(struct inpcb *in6p) RTFREE(in6p->inp_route6.ro_rt); in6p->inp_route6.ro_rt = (struct rtentry *)NULL; } + if (in6p->inp_route.ro_lle) + LLE_FREE(in6p->inp_route.ro_lle); /* zeros ro_lle */ return; } @@ -846,6 +849,8 @@ in6_rtchange(struct inpcb *inp, int errn RTFREE(inp->inp_route6.ro_rt); inp->inp_route6.ro_rt = (struct rtentry *)NULL; } + if (inp->inp_route.ro_lle) + LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ return inp; } Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet6/ip6_output.c Thu Jun 2 17:51:29 2016 (r301217) @@ -500,7 +500,8 @@ ip6_output(struct mbuf *m0, struct ip6_p if (ro == NULL) { ro = &ip6route; bzero((caddr_t)ro, sizeof(*ro)); - } + } else + ro->ro_flags |= RT_LLE_CACHE; ro_pmtu = ro; if (opt && opt->ip6po_rthdr) ro = &opt->ip6po_route; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet6/nd6.c Thu Jun 2 17:51:29 2016 (r301217) @@ -136,7 +136,7 @@ static void nd6_llinfo_settimer_locked(s static void clear_llinfo_pqueue(struct llentry *); static void nd6_rtrequest(int, struct rtentry *, struct rt_addrinfo *); static int nd6_resolve_slow(struct ifnet *, int, struct mbuf *, - const struct sockaddr_in6 *, u_char *, uint32_t *); + const struct sockaddr_in6 *, u_char *, uint32_t *, struct llentry **); static int nd6_need_cache(struct ifnet *); @@ -2175,7 +2175,8 @@ nd6_output_ifp(struct ifnet *ifp, struct */ int nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, - const struct sockaddr *sa_dst, u_char *desten, uint32_t *pflags) + const struct sockaddr *sa_dst, u_char *desten, uint32_t *pflags, + struct llentry **plle) { struct llentry *ln = NULL; const struct sockaddr_in6 *dst6; @@ -2227,7 +2228,7 @@ nd6_resolve(struct ifnet *ifp, int is_gw } IF_AFDATA_RUNLOCK(ifp); - return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags)); + return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags, plle)); } @@ -2244,7 +2245,8 @@ nd6_resolve(struct ifnet *ifp, int is_gw */ static __noinline int nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, - const struct sockaddr_in6 *dst, u_char *desten, uint32_t *pflags) + const struct sockaddr_in6 *dst, u_char *desten, uint32_t *pflags, + struct llentry **plle) { struct llentry *lle = NULL, *lle_tmp; struct in6_addr *psrc, src; @@ -2331,6 +2333,10 @@ nd6_resolve_slow(struct ifnet *ifp, int bcopy(lladdr, desten, ll_len); if (pflags != NULL) *pflags = lle->la_flags; + if (plle) { + LLE_ADDREF(lle); + *plle = lle; + } LLE_WUNLOCK(lle); return (0); } @@ -2405,7 +2411,7 @@ nd6_resolve_addr(struct ifnet *ifp, int flags |= LLE_ADDRONLY; error = nd6_resolve_slow(ifp, flags, NULL, - (const struct sockaddr_in6 *)dst, desten, pflags); + (const struct sockaddr_in6 *)dst, desten, pflags, NULL); return (error); } Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Jun 2 17:31:37 2016 (r301216) +++ head/sys/netinet6/nd6.h Thu Jun 2 17:51:29 2016 (r301217) @@ -428,7 +428,7 @@ void nd6_purge(struct ifnet *); int nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, char *desten, uint32_t *pflags); int nd6_resolve(struct ifnet *, int, struct mbuf *, - const struct sockaddr *, u_char *, uint32_t *); + const struct sockaddr *, u_char *, uint32_t *, struct llentry **); int nd6_ioctl(u_long, caddr_t, struct ifnet *); void nd6_cache_lladdr(struct ifnet *, struct in6_addr *, char *, int, int, int); From owner-svn-src-head@freebsd.org Thu Jun 2 18:24:01 2016 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 CA15CB65DCB; Thu, 2 Jun 2016 18:24:01 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 9B4281E34; Thu, 2 Jun 2016 18:24:01 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IO0e2004568; Thu, 2 Jun 2016 18:24:00 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IO0sV004567; Thu, 2 Jun 2016 18:24:00 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021824.u52IO0sV004567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301218 - head/sys/boot/fdt/dts/arm 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.22 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: Thu, 02 Jun 2016 18:24:01 -0000 Author: zbb Date: Thu Jun 2 18:24:00 2016 New Revision: 301218 URL: https://svnweb.freebsd.org/changeset/base/301218 Log: Revert part of r294418 ("Correct ranges...") Commit was temporary fix due to rman_res_t defined as 32-bit u_long. After redefining it as 64-bit variable workaround is not needed and was removed. Submitted by: Bartosz Szczepanek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6214 Modified: head/sys/boot/fdt/dts/arm/armada-388-gp.dts Modified: head/sys/boot/fdt/dts/arm/armada-388-gp.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/armada-388-gp.dts Thu Jun 2 17:51:29 2016 (r301217) +++ head/sys/boot/fdt/dts/arm/armada-388-gp.dts Thu Jun 2 18:24:00 2016 (r301218) @@ -59,7 +59,7 @@ }; soc { - ranges = <0 0 0xf1000000 0x100000>; + ranges = ; internal-regs { spi@10600 { From owner-svn-src-head@freebsd.org Thu Jun 2 18:25:33 2016 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 336C7B65E72; Thu, 2 Jun 2016 18:25:33 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id 040061011; Thu, 2 Jun 2016 18:25:32 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IPWsh004664; Thu, 2 Jun 2016 18:25:32 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IPWla004663; Thu, 2 Jun 2016 18:25:32 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606021825.u52IPWla004663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Thu, 2 Jun 2016 18:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301219 - head/contrib/blacklist/bin 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.22 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: Thu, 02 Jun 2016 18:25:33 -0000 Author: lidl Date: Thu Jun 2 18:25:32 2016 New Revision: 301219 URL: https://svnweb.freebsd.org/changeset/base/301219 Log: Fixup path in NetBSD supplied documentation for FreeBSD NetBSD installs the blacklist-helper script in /libexec, and it goes into /usr/libexec on FreeBSD. Update the docs to match FreeBSD's installation location. Reviewed by: rpaulo Approved by: rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6592 Modified: head/contrib/blacklist/bin/blacklistd.8 Modified: head/contrib/blacklist/bin/blacklistd.8 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.8 Thu Jun 2 18:24:00 2016 (r301218) +++ head/contrib/blacklist/bin/blacklistd.8 Thu Jun 2 18:25:32 2016 (r301219) @@ -117,7 +117,7 @@ The following options are available: Use .Ar controlprog to communicate with the packet filter, usually -.Pa /libexec/blacklistd-helper . +.Pa /usr/libexec/blacklistd-helper . The following arguments are passed to the control program: .Bl -tag -width protocol .It action @@ -199,8 +199,8 @@ instead of .Xr syslogd 8 . .El .Sh FILES -.Bl -tag -width /libexec/blacklistd-helper -compact -.It Pa /libexec/blacklistd-helper +.Bl -tag -width /usr/libexec/blacklistd-helper -compact +.It Pa /usr/libexec/blacklistd-helper Shell script invoked to interface with the packet filter. .It Pa /etc/blacklistd.conf Configuration file. From owner-svn-src-head@freebsd.org Thu Jun 2 18:31:38 2016 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 5B1B0B65085; Thu, 2 Jun 2016 18:31:38 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 1A74116A7; Thu, 2 Jun 2016 18:31:38 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IVbdo006886; Thu, 2 Jun 2016 18:31:37 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IVb1O006883; Thu, 2 Jun 2016 18:31:37 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021831.u52IVb1O006883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301220 - in head/sys: arm/mv dev/cesa 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.22 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: Thu, 02 Jun 2016 18:31:38 -0000 Author: zbb Date: Thu Jun 2 18:31:36 2016 New Revision: 301220 URL: https://svnweb.freebsd.org/changeset/base/301220 Log: Map CESA SRAM memory in driver attach for Armada38x On other platforms with CESA accelerator the SRAM memory is mapped in early init before driver is attached. This method only works correctly with mappings no smaller than L1 section size (1MB). There may be more SRAM blocks and they may have smaller sizes than 1MB as is the case for Armada38x. Instead, map SRAM memory with bus_space_map() in CESA driver attach. Note that we can no longer assume that VA == PA for the SRAM. Submitted by: Michal Stanek sc_sram_base + CESA_SRAM_SIZE + * +------------------------+ <= sc->sc_sram_base_va + CESA_SRAM_SIZE * | | * | DATA | * | | - * +------------------------+ <= sc->sc_sram_base + CESA_DATA(0) + * +------------------------+ <= sc->sc_sram_base_va + CESA_DATA(0) * | struct cesa_sa_data | * +------------------------+ * | struct cesa_sa_hdesc | - * +------------------------+ <= sc->sc_sram_base + * +------------------------+ <= sc->sc_sram_base_va */ #include @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -373,7 +374,7 @@ static struct cesa_tdma_desc * cesa_tdma_copyin_sa_data(struct cesa_softc *sc, struct cesa_request *cr) { - return (cesa_tdma_copy(sc, sc->sc_sram_base + + return (cesa_tdma_copy(sc, sc->sc_sram_base_pa + sizeof(struct cesa_sa_hdesc), cr->cr_csd_paddr, sizeof(struct cesa_sa_data))); } @@ -382,7 +383,7 @@ static struct cesa_tdma_desc * cesa_tdma_copyout_sa_data(struct cesa_softc *sc, struct cesa_request *cr) { - return (cesa_tdma_copy(sc, cr->cr_csd_paddr, sc->sc_sram_base + + return (cesa_tdma_copy(sc, cr->cr_csd_paddr, sc->sc_sram_base_pa + sizeof(struct cesa_sa_hdesc), sizeof(struct cesa_sa_data))); } @@ -390,7 +391,7 @@ static struct cesa_tdma_desc * cesa_tdma_copy_sdesc(struct cesa_softc *sc, struct cesa_sa_desc *csd) { - return (cesa_tdma_copy(sc, sc->sc_sram_base, csd->csd_cshd_paddr, + return (cesa_tdma_copy(sc, sc->sc_sram_base_pa, csd->csd_cshd_paddr, sizeof(struct cesa_sa_hdesc))); } @@ -566,14 +567,14 @@ cesa_fill_packet(struct cesa_softc *sc, bsize = MIN(seg->ds_len, cp->cp_size - cp->cp_offset); if (bsize > 0) { - ctd = cesa_tdma_copy(sc, sc->sc_sram_base + + ctd = cesa_tdma_copy(sc, sc->sc_sram_base_pa + CESA_DATA(cp->cp_offset), seg->ds_addr, bsize); if (!ctd) return (-ENOMEM); STAILQ_INSERT_TAIL(&cp->cp_copyin, ctd, ctd_stq); - ctd = cesa_tdma_copy(sc, seg->ds_addr, sc->sc_sram_base + + ctd = cesa_tdma_copy(sc, seg->ds_addr, sc->sc_sram_base_pa + CESA_DATA(cp->cp_offset), bsize); if (!ctd) return (-ENOMEM); @@ -950,22 +951,33 @@ cesa_setup_sram(struct cesa_softc *sc) { phandle_t sram_node; ihandle_t sram_ihandle; - pcell_t sram_handle, sram_reg; + pcell_t sram_handle, sram_reg[2]; + int rv; - if (OF_getprop(ofw_bus_get_node(sc->sc_dev), "sram-handle", - (void *)&sram_handle, sizeof(sram_handle)) <= 0) - return (ENXIO); + rv = OF_getprop(ofw_bus_get_node(sc->sc_dev), "sram-handle", + (void *)&sram_handle, sizeof(sram_handle)); + if (rv <= 0) + return (rv); sram_ihandle = (ihandle_t)sram_handle; sram_ihandle = fdt32_to_cpu(sram_ihandle); sram_node = OF_instance_to_package(sram_ihandle); - if (OF_getprop(sram_node, "reg", (void *)&sram_reg, - sizeof(sram_reg)) <= 0) - return (ENXIO); - - sc->sc_sram_base = fdt32_to_cpu(sram_reg); - + rv = OF_getprop(sram_node, "reg", (void *)sram_reg, sizeof(sram_reg)); + if (rv <= 0) + return (rv); + + sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); + /* Store SRAM size to be able to unmap in detach() */ + sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); + +#if defined(SOC_MV_ARMADA38X) + /* SRAM memory was not mapped in platform_sram_devmap(), map it now */ + rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc->sc_sram_size, + 0, &(sc->sc_sram_base_va)); + if (rv != 0) + return (rv); +#endif return (0); } @@ -1066,7 +1078,7 @@ cesa_attach(device_t dev) NULL, cesa_intr, sc, &(sc->sc_icookie)); if (error) { device_printf(dev, "could not setup engine completion irq\n"); - goto err1; + goto err2; } /* Create DMA tag for processed data */ @@ -1081,13 +1093,13 @@ cesa_attach(device_t dev) NULL, NULL, /* lockfunc, lockfuncarg */ &sc->sc_data_dtag); /* dmat */ if (error) - goto err2; + goto err3; /* Initialize data structures: TDMA Descriptors Pool */ error = cesa_alloc_dma_mem(sc, &sc->sc_tdesc_cdm, CESA_TDMA_DESCRIPTORS * sizeof(struct cesa_tdma_hdesc)); if (error) - goto err3; + goto err4; STAILQ_INIT(&sc->sc_free_tdesc); for (i = 0; i < CESA_TDMA_DESCRIPTORS; i++) { @@ -1103,7 +1115,7 @@ cesa_attach(device_t dev) error = cesa_alloc_dma_mem(sc, &sc->sc_sdesc_cdm, CESA_SA_DESCRIPTORS * sizeof(struct cesa_sa_hdesc)); if (error) - goto err4; + goto err5; STAILQ_INIT(&sc->sc_free_sdesc); for (i = 0; i < CESA_SA_DESCRIPTORS; i++) { @@ -1119,7 +1131,7 @@ cesa_attach(device_t dev) error = cesa_alloc_dma_mem(sc, &sc->sc_requests_cdm, CESA_REQUESTS * sizeof(struct cesa_sa_data)); if (error) - goto err5; + goto err6; STAILQ_INIT(&sc->sc_free_requests); STAILQ_INIT(&sc->sc_ready_requests); @@ -1141,7 +1153,7 @@ cesa_attach(device_t dev) sc->sc_requests[i].cr_dmap); } while (i--); - goto err6; + goto err7; } STAILQ_INSERT_TAIL(&sc->sc_free_requests, &sc->sc_requests[i], @@ -1187,7 +1199,7 @@ cesa_attach(device_t dev) sc->sc_cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE); if (sc->sc_cid) { device_printf(dev, "could not get crypto driver id\n"); - goto err7; + goto err8; } crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0); @@ -1199,20 +1211,24 @@ cesa_attach(device_t dev) crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0); return (0); -err7: +err8: for (i = 0; i < CESA_REQUESTS; i++) bus_dmamap_destroy(sc->sc_data_dtag, sc->sc_requests[i].cr_dmap); -err6: +err7: cesa_free_dma_mem(&sc->sc_requests_cdm); -err5: +err6: cesa_free_dma_mem(&sc->sc_sdesc_cdm); -err4: +err5: cesa_free_dma_mem(&sc->sc_tdesc_cdm); -err3: +err4: bus_dma_tag_destroy(sc->sc_data_dtag); -err2: +err3: bus_teardown_intr(dev, sc->sc_res[1], sc->sc_icookie); +err2: +#if defined(SOC_MV_ARMADA38X) + bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size); +#endif err1: bus_release_resources(dev, cesa_res_spec, sc->sc_res); err0: @@ -1260,6 +1276,10 @@ cesa_detach(device_t dev) /* Relase I/O and IRQ resources */ bus_release_resources(dev, cesa_res_spec, sc->sc_res); +#if defined(SOC_MV_ARMADA38X) + /* Unmap SRAM memory */ + bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size); +#endif /* Destroy mutexes */ mtx_destroy(&sc->sc_sessions_lock); mtx_destroy(&sc->sc_requests_lock); Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Thu Jun 2 18:25:32 2016 (r301219) +++ head/sys/dev/cesa/cesa.h Thu Jun 2 18:31:36 2016 (r301220) @@ -257,7 +257,9 @@ struct cesa_softc { STAILQ_HEAD(, cesa_session) sc_free_sessions; /* CESA SRAM Address */ - bus_addr_t sc_sram_base; + bus_addr_t sc_sram_base_pa; + bus_space_handle_t sc_sram_base_va; + bus_size_t sc_sram_size; }; struct cesa_chain_info { From owner-svn-src-head@freebsd.org Thu Jun 2 18:33:27 2016 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 7F4C7B65120; Thu, 2 Jun 2016 18:33:27 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 3840B18FE; Thu, 2 Jun 2016 18:33:27 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IXQ1j008224; Thu, 2 Jun 2016 18:33:26 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IXQfT008222; Thu, 2 Jun 2016 18:33:26 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021833.u52IXQfT008222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301221 - head/sys/arm/mv 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.22 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: Thu, 02 Jun 2016 18:33:27 -0000 Author: zbb Date: Thu Jun 2 18:33:26 2016 New Revision: 301221 URL: https://svnweb.freebsd.org/changeset/base/301221 Log: Configure CPU window to second CESA SRAM Check if there is a second CESA SRAM node in FDT and add a CPU window for it. Define A38X specific macro for setting device attribute for each node. Submitted by: Michal Stanek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6216 Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvwin.h Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Thu Jun 2 18:31:36 2016 (r301220) +++ head/sys/arm/mv/mv_common.c Thu Jun 2 18:33:26 2016 (r301221) @@ -2107,6 +2107,37 @@ moveon: return (EINVAL); cpu_win_tbl[t].target = MV_WIN_CESA_TARGET; +#ifdef SOC_MV_ARMADA38X + cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(0); +#else + cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(1); +#endif + cpu_win_tbl[t].base = sram_base; + cpu_win_tbl[t].size = sram_size; + cpu_win_tbl[t].remap = ~0; + cpu_wins_no++; + debugf("sram: base = 0x%0lx size = 0x%0lx\n", sram_base, sram_size); + + /* Check if there is a second CESA node */ + while ((node = OF_peer(node)) != 0) { + if (fdt_is_compatible(node, "mrvl,cesa-sram")) { + if (fdt_regsize(node, &sram_base, &sram_size) != 0) + return (EINVAL); + break; + } + } + + if (node == 0) + return (0); + + t++; + if (t >= ((sizeof(cpu_win_tbl))/(sizeof(cpu_win_tbl[0])))) { + debugf("cannot fit CESA tuple into cpu_win_tbl\n"); + return (ENOMEM); + } + + /* Configure window for CESA1 */ + cpu_win_tbl[t].target = MV_WIN_CESA_TARGET; cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(1); cpu_win_tbl[t].base = sram_base; cpu_win_tbl[t].size = sram_size; Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Thu Jun 2 18:31:36 2016 (r301220) +++ head/sys/arm/mv/mvwin.h Thu Jun 2 18:33:26 2016 (r301221) @@ -233,6 +233,19 @@ * 2: engine0 */ #define MV_WIN_CESA_ATTR(eng_sel) (1 | ((eng_sel) << 2)) +#elif defined(SOC_MV_ARMADA38X) +#define MV_WIN_CESA_TARGET 9 +/* + * Bits [1:0] = Data swapping + * 0x0 = Byte swap + * 0x1 = No swap + * 0x2 = Byte and word swap + * 0x3 = Word swap + * Bits [4:2] = CESA select: + * 0x6 = CESA0 + * 0x5 = CESA1 + */ +#define MV_WIN_CESA_ATTR(eng_sel) (0x11 | (1 << (3 - (eng_sel)))) #else #define MV_WIN_CESA_TARGET 3 #define MV_WIN_CESA_ATTR(eng_sel) 0 From owner-svn-src-head@freebsd.org Thu Jun 2 18:35:37 2016 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 7A589B651B5; Thu, 2 Jun 2016 18:35:37 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 518EB1B06; Thu, 2 Jun 2016 18:35:37 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IZaso008379; Thu, 2 Jun 2016 18:35:36 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IZZag008369; Thu, 2 Jun 2016 18:35:35 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021835.u52IZZag008369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301222 - in head/sys: boot/fdt/dts/arm dev/cesa 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.22 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: Thu, 02 Jun 2016 18:35:37 -0000 Author: zbb Date: Thu Jun 2 18:35:35 2016 New Revision: 301222 URL: https://svnweb.freebsd.org/changeset/base/301222 Log: Split CESA memory resource into TDMA and CESA regs TDMA and CESA registers are placed in different ranges of memory. Split memory resource in DTS to reflect that. This change is needed to support multiple CESA nodes as otherwise the ranges of different nodes would overlap. In consequence, CESA_WRITE and CESA_READ macros have been split depending on which range of registers is accessed. Offsets for CESA registers have been modified as the base address has changed. Submitted by: Michal Stanek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6217 Modified: head/sys/boot/fdt/dts/arm/db78100.dts head/sys/boot/fdt/dts/arm/db88f6281.dts head/sys/boot/fdt/dts/arm/dockstar.dts head/sys/boot/fdt/dts/arm/dreamplug-1001.dts head/sys/boot/fdt/dts/arm/dreamplug-1001N.dts head/sys/boot/fdt/dts/arm/sheevaplug.dts head/sys/dev/cesa/cesa.c head/sys/dev/cesa/cesa.h Modified: head/sys/boot/fdt/dts/arm/db78100.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/db78100.dts Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/boot/fdt/dts/arm/db78100.dts Thu Jun 2 18:35:35 2016 (r301222) @@ -283,7 +283,8 @@ crypto@90000 { compatible = "mrvl,cesa"; - reg = <0x90000 0x10000>; + reg = <0x90000 0x1000 /* tdma base reg chan 0 */ + 0x9D000 0x1000>; /* cesa base reg chan 0 */ interrupts = <19>; interrupt-parent = <&PIC>; }; Modified: head/sys/boot/fdt/dts/arm/db88f6281.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/db88f6281.dts Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/boot/fdt/dts/arm/db88f6281.dts Thu Jun 2 18:35:35 2016 (r301222) @@ -221,7 +221,8 @@ crypto@30000 { compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; + reg = <0x30000 0x1000 /* tdma base reg chan 0 */ + 0x3D000 0x1000>; /* cesa base reg chan 0 */ interrupts = <22>; interrupt-parent = <&PIC>; Modified: head/sys/boot/fdt/dts/arm/dockstar.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/dockstar.dts Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/boot/fdt/dts/arm/dockstar.dts Thu Jun 2 18:35:35 2016 (r301222) @@ -206,7 +206,8 @@ crypto@30000 { compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; + reg = <0x30000 0x1000 /* tdma base reg chan 0 */ + 0x3D000 0x1000>; /* cesa base reg chan 0 */ interrupts = <22>; interrupt-parent = <&PIC>; Modified: head/sys/boot/fdt/dts/arm/dreamplug-1001.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/dreamplug-1001.dts Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/boot/fdt/dts/arm/dreamplug-1001.dts Thu Jun 2 18:35:35 2016 (r301222) @@ -270,7 +270,8 @@ crypto@30000 { compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; + reg = <0x30000 0x1000 /* tdma base reg chan 0 */ + 0x3D000 0x1000>; /* cesa base reg chan 0 */ interrupts = <22>; interrupt-parent = <&PIC>; Modified: head/sys/boot/fdt/dts/arm/dreamplug-1001N.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/dreamplug-1001N.dts Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/boot/fdt/dts/arm/dreamplug-1001N.dts Thu Jun 2 18:35:35 2016 (r301222) @@ -291,7 +291,8 @@ crypto@30000 { compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; + reg = <0x30000 0x1000 /* tdma base reg chan 0 */ + 0x3D000 0x1000>; /* cesa base reg chan 0 */ interrupts = <22>; interrupt-parent = <&PIC>; Modified: head/sys/boot/fdt/dts/arm/sheevaplug.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/sheevaplug.dts Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/boot/fdt/dts/arm/sheevaplug.dts Thu Jun 2 18:35:35 2016 (r301222) @@ -218,7 +218,8 @@ crypto@30000 { compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; + reg = <0x30000 0x1000 /* tdma base reg chan 0 */ + 0x3D000 0x1000>; /* cesa base reg chan 0 */ interrupts = <22>; interrupt-parent = <&PIC>; Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/dev/cesa/cesa.c Thu Jun 2 18:35:35 2016 (r301222) @@ -83,6 +83,7 @@ static int decode_win_cesa_setup(struct static struct resource_spec cesa_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, { -1, 0 } }; @@ -940,8 +941,8 @@ cesa_execute(struct cesa_softc *sc) cr = STAILQ_FIRST(&sc->sc_queued_requests); ctd = STAILQ_FIRST(&cr->cr_tdesc); - CESA_WRITE(sc, CESA_TDMA_ND, ctd->ctd_cthd_paddr); - CESA_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE); + CESA_TDMA_WRITE(sc, CESA_TDMA_ND, ctd->ctd_cthd_paddr); + CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE); CESA_UNLOCK(sc, requests); } @@ -1056,9 +1057,6 @@ cesa_attach(device_t dev) goto err0; } - sc->sc_bsh = rman_get_bushandle(*(sc->sc_res)); - sc->sc_bst = rman_get_bustag(*(sc->sc_res)); - /* Setup CESA decoding windows */ error = decode_win_cesa_setup(sc); if (error) { @@ -1074,8 +1072,8 @@ cesa_attach(device_t dev) } /* Setup interrupt handler */ - error = bus_setup_intr(dev, sc->sc_res[1], INTR_TYPE_NET | INTR_MPSAFE, - NULL, cesa_intr, sc, &(sc->sc_icookie)); + error = bus_setup_intr(dev, sc->sc_res[RES_CESA_IRQ], INTR_TYPE_NET | + INTR_MPSAFE, NULL, cesa_intr, sc, &(sc->sc_icookie)); if (error) { device_printf(dev, "could not setup engine completion irq\n"); goto err2; @@ -1174,8 +1172,9 @@ cesa_attach(device_t dev) * - Outstanding reads enabled, * - No byte-swap. */ - CESA_WRITE(sc, CESA_TDMA_CR, CESA_TDMA_CR_DBL128 | CESA_TDMA_CR_SBL128 | - CESA_TDMA_CR_ORDEN | CESA_TDMA_CR_NBS | CESA_TDMA_CR_ENABLE); + CESA_TDMA_WRITE(sc, CESA_TDMA_CR, CESA_TDMA_CR_DBL128 | + CESA_TDMA_CR_SBL128 | CESA_TDMA_CR_ORDEN | CESA_TDMA_CR_NBS | + CESA_TDMA_CR_ENABLE); /* * Initialize SA: @@ -1183,15 +1182,15 @@ cesa_attach(device_t dev) * - Multi-packet chain mode, * - Cooperation with TDMA enabled. */ - CESA_WRITE(sc, CESA_SA_DPR, 0); - CESA_WRITE(sc, CESA_SA_CR, CESA_SA_CR_ACTIVATE_TDMA | + CESA_REG_WRITE(sc, CESA_SA_DPR, 0); + CESA_REG_WRITE(sc, CESA_SA_CR, CESA_SA_CR_ACTIVATE_TDMA | CESA_SA_CR_WAIT_FOR_TDMA | CESA_SA_CR_MULTI_MODE); /* Unmask interrupts */ - CESA_WRITE(sc, CESA_ICR, 0); - CESA_WRITE(sc, CESA_ICM, CESA_ICM_ACCTDMA | sc->sc_tperr); - CESA_WRITE(sc, CESA_TDMA_ECR, 0); - CESA_WRITE(sc, CESA_TDMA_EMR, CESA_TDMA_EMR_MISS | + CESA_REG_WRITE(sc, CESA_ICR, 0); + CESA_REG_WRITE(sc, CESA_ICM, CESA_ICM_ACCTDMA | sc->sc_tperr); + CESA_TDMA_WRITE(sc, CESA_TDMA_ECR, 0); + CESA_TDMA_WRITE(sc, CESA_TDMA_EMR, CESA_TDMA_EMR_MISS | CESA_TDMA_EMR_DOUBLE_HIT | CESA_TDMA_EMR_BOTH_HIT | CESA_TDMA_EMR_DATA_ERROR); @@ -1224,7 +1223,7 @@ err5: err4: bus_dma_tag_destroy(sc->sc_data_dtag); err3: - bus_teardown_intr(dev, sc->sc_res[1], sc->sc_icookie); + bus_teardown_intr(dev, sc->sc_res[RES_CESA_IRQ], sc->sc_icookie); err2: #if defined(SOC_MV_ARMADA38X) bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size); @@ -1251,8 +1250,8 @@ cesa_detach(device_t dev) /* TODO: Wait for queued requests completion before shutdown. */ /* Mask interrupts */ - CESA_WRITE(sc, CESA_ICM, 0); - CESA_WRITE(sc, CESA_TDMA_EMR, 0); + CESA_REG_WRITE(sc, CESA_ICM, 0); + CESA_TDMA_WRITE(sc, CESA_TDMA_EMR, 0); /* Unregister from OCF */ crypto_unregister_all(sc->sc_cid); @@ -1271,7 +1270,7 @@ cesa_detach(device_t dev) bus_dma_tag_destroy(sc->sc_data_dtag); /* Stop interrupt */ - bus_teardown_intr(dev, sc->sc_res[1], sc->sc_icookie); + bus_teardown_intr(dev, sc->sc_res[RES_CESA_IRQ], sc->sc_icookie); /* Relase I/O and IRQ resources */ bus_release_resources(dev, cesa_res_spec, sc->sc_res); @@ -1302,10 +1301,10 @@ cesa_intr(void *arg) sc = arg; /* Ack interrupt */ - ecr = CESA_READ(sc, CESA_TDMA_ECR); - CESA_WRITE(sc, CESA_TDMA_ECR, 0); - icr = CESA_READ(sc, CESA_ICR); - CESA_WRITE(sc, CESA_ICR, 0); + ecr = CESA_TDMA_READ(sc, CESA_TDMA_ECR); + CESA_TDMA_WRITE(sc, CESA_TDMA_ECR, 0); + icr = CESA_REG_READ(sc, CESA_ICR); + CESA_REG_WRITE(sc, CESA_ICR, 0); /* Check for TDMA errors */ if (ecr & CESA_TDMA_ECR_MISS) { @@ -1676,8 +1675,8 @@ decode_win_cesa_setup(struct cesa_softc /* Disable and clear all CESA windows */ for (i = 0; i < MV_WIN_CESA_MAX; i++) { - CESA_WRITE(sc, MV_WIN_CESA_BASE(i), 0); - CESA_WRITE(sc, MV_WIN_CESA_CTRL(i), 0); + CESA_TDMA_WRITE(sc, MV_WIN_CESA_BASE(i), 0); + CESA_TDMA_WRITE(sc, MV_WIN_CESA_CTRL(i), 0); } /* Fill CESA TDMA decoding windows with information acquired from DTS */ @@ -1691,8 +1690,8 @@ decode_win_cesa_setup(struct cesa_softc (MV_WIN_DDR_ATTR(i) << MV_WIN_CPU_ATTR_SHIFT) | (MV_WIN_DDR_TARGET << MV_WIN_CPU_TARGET_SHIFT) | MV_WIN_CPU_ENABLE_BIT); - CESA_WRITE(sc, MV_WIN_CESA_BASE(i), br); - CESA_WRITE(sc, MV_WIN_CESA_CTRL(i), cr); + CESA_TDMA_WRITE(sc, MV_WIN_CESA_BASE(i), br); + CESA_TDMA_WRITE(sc, MV_WIN_CESA_CTRL(i), cr); } } Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Thu Jun 2 18:33:26 2016 (r301221) +++ head/sys/dev/cesa/cesa.h Thu Jun 2 18:35:35 2016 (r301222) @@ -93,10 +93,15 @@ mtx_assert(&(sc)->sc_ ## what ## _lock, MA_OWNED) /* Registers read/write macros */ -#define CESA_READ(sc, reg) \ - bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) -#define CESA_WRITE(sc, reg, val) \ - bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) +#define CESA_REG_READ(sc, reg) \ + bus_read_4((sc)->sc_res[RES_CESA_REGS], (reg)) +#define CESA_REG_WRITE(sc, reg, val) \ + bus_write_4((sc)->sc_res[RES_CESA_REGS], (reg), (val)) + +#define CESA_TDMA_READ(sc, reg) \ + bus_read_4((sc)->sc_res[RES_TDMA_REGS], (reg)) +#define CESA_TDMA_WRITE(sc, reg, val) \ + bus_write_4((sc)->sc_res[RES_TDMA_REGS], (reg), (val)) /* Generic allocator for objects */ #define CESA_GENERIC_ALLOC_LOCKED(sc, obj, pool) do { \ @@ -126,6 +131,14 @@ #define CESA_DATA(offset) \ (sizeof(struct cesa_sa_hdesc) + sizeof(struct cesa_sa_data) + offset) +/* CESA memory and IRQ resources */ +enum cesa_res_type { + RES_TDMA_REGS, + RES_CESA_REGS, + RES_CESA_IRQ, + RES_CESA_NUM +}; + struct cesa_tdma_hdesc { uint16_t cthd_byte_count; uint16_t cthd_flags; @@ -220,11 +233,9 @@ struct cesa_packet { struct cesa_softc { device_t sc_dev; int32_t sc_cid; - struct resource *sc_res[2]; + struct resource *sc_res[RES_CESA_NUM]; void *sc_icookie; bus_dma_tag_t sc_data_dtag; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; int sc_error; int sc_tperr; @@ -303,11 +314,11 @@ struct cesa_chain_info { #define CESA_CSHD_FRAG_MIDDLE (3U << 30) /* CESA registers definitions */ -#define CESA_ICR 0xDE20 +#define CESA_ICR 0x0E20 #define CESA_ICR_ACCTDMA (1 << 7) #define CESA_ICR_TPERR (1 << 12) -#define CESA_ICM 0xDE24 +#define CESA_ICM 0x0E24 #define CESA_ICM_ACCTDMA CESA_ICR_ACCTDMA #define CESA_ICM_TPERR CESA_ICR_TPERR @@ -341,17 +352,17 @@ struct cesa_chain_info { #define MV_WIN_CESA_MAX 4 /* CESA SA registers definitions */ -#define CESA_SA_CMD 0xDE00 +#define CESA_SA_CMD 0x0E00 #define CESA_SA_CMD_ACTVATE (1 << 0) -#define CESA_SA_DPR 0xDE04 +#define CESA_SA_DPR 0x0E04 -#define CESA_SA_CR 0xDE08 +#define CESA_SA_CR 0x0E08 #define CESA_SA_CR_WAIT_FOR_TDMA (1 << 7) #define CESA_SA_CR_ACTIVATE_TDMA (1 << 9) #define CESA_SA_CR_MULTI_MODE (1 << 11) -#define CESA_SA_SR 0xDE0C +#define CESA_SA_SR 0x0E0C #define CESA_SA_SR_ACTIVE (1 << 0) #endif From owner-svn-src-head@freebsd.org Thu Jun 2 18:37:51 2016 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 74614B6529E; Thu, 2 Jun 2016 18:37:51 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 324DE1DD6; Thu, 2 Jun 2016 18:37:51 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52Ibo2O008623; Thu, 2 Jun 2016 18:37:50 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IboZv008621; Thu, 2 Jun 2016 18:37:50 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021837.u52IboZv008621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301223 - head/sys/dev/cesa 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.22 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: Thu, 02 Jun 2016 18:37:51 -0000 Author: zbb Date: Thu Jun 2 18:37:50 2016 New Revision: 301223 URL: https://svnweb.freebsd.org/changeset/base/301223 Log: Truncate HMAC output only if requested by the client The output of HMAC was previously truncated to 12 bytes. This was only correct in case of one particular crypto client - the new version of IPSEC. Fix by taking into account the cri_mlen field in cryptoini session request filled in by the client. Submitted by: Michal Stanek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6218 Modified: head/sys/dev/cesa/cesa.c head/sys/dev/cesa/cesa.h Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Thu Jun 2 18:35:35 2016 (r301222) +++ head/sys/dev/cesa/cesa.c Thu Jun 2 18:37:50 2016 (r301223) @@ -1451,24 +1451,32 @@ cesa_newsession(device_t dev, uint32_t * if (!error && mac) { switch (mac->cri_alg) { case CRYPTO_MD5: - cs->cs_config |= CESA_CSHD_MD5; cs->cs_mblen = 1; - cs->cs_hlen = MD5_HASH_LEN; + cs->cs_hlen = (mac->cri_mlen == 0) ? MD5_HASH_LEN : + mac->cri_mlen; + cs->cs_config |= CESA_CSHD_MD5; break; case CRYPTO_MD5_HMAC: - cs->cs_config |= CESA_CSHD_MD5_HMAC; cs->cs_mblen = MD5_HMAC_BLOCK_LEN; - cs->cs_hlen = CESA_HMAC_HASH_LENGTH; + cs->cs_hlen = (mac->cri_mlen == 0) ? MD5_HASH_LEN : + mac->cri_mlen; + cs->cs_config |= CESA_CSHD_MD5_HMAC; + if (cs->cs_hlen == CESA_HMAC_TRUNC_LEN) + cs->cs_config |= CESA_CSHD_96_BIT_HMAC; break; case CRYPTO_SHA1: - cs->cs_config |= CESA_CSHD_SHA1; cs->cs_mblen = 1; - cs->cs_hlen = SHA1_HASH_LEN; + cs->cs_hlen = (mac->cri_mlen == 0) ? SHA1_HASH_LEN : + mac->cri_mlen; + cs->cs_config |= CESA_CSHD_SHA1; break; case CRYPTO_SHA1_HMAC: - cs->cs_config |= CESA_CSHD_SHA1_HMAC; cs->cs_mblen = SHA1_HMAC_BLOCK_LEN; - cs->cs_hlen = CESA_HMAC_HASH_LENGTH; + cs->cs_hlen = (mac->cri_mlen == 0) ? SHA1_HASH_LEN : + mac->cri_mlen; + cs->cs_config |= CESA_CSHD_SHA1_HMAC; + if (cs->cs_hlen == CESA_HMAC_TRUNC_LEN) + cs->cs_config |= CESA_CSHD_96_BIT_HMAC; break; default: error = EINVAL; Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Thu Jun 2 18:35:35 2016 (r301222) +++ head/sys/dev/cesa/cesa.h Thu Jun 2 18:37:50 2016 (r301223) @@ -68,7 +68,7 @@ #define CESA_TDMA_DESCRIPTORS (CESA_TDMA_DESC_PER_REQ * CESA_REQUESTS) /* Useful constants */ -#define CESA_HMAC_HASH_LENGTH 12 +#define CESA_HMAC_TRUNC_LEN 12 #define CESA_MAX_FRAGMENTS 64 #define CESA_SRAM_SIZE 2048 @@ -293,8 +293,10 @@ struct cesa_chain_info { #define CESA_CSHD_MD5 (4 << 4) #define CESA_CSHD_SHA1 (5 << 4) -#define CESA_CSHD_MD5_HMAC ((6 << 4) | (1 << 7)) -#define CESA_CSHD_SHA1_HMAC ((7 << 4) | (1 << 7)) +#define CESA_CSHD_MD5_HMAC (6 << 4) +#define CESA_CSHD_SHA1_HMAC (7 << 4) + +#define CESA_CSHD_96_BIT_HMAC (1 << 7) #define CESA_CSHD_DES (1 << 8) #define CESA_CSHD_3DES (2 << 8) From owner-svn-src-head@freebsd.org Thu Jun 2 18:39:34 2016 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 B363BB65358; Thu, 2 Jun 2016 18:39:34 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 7156E1F73; Thu, 2 Jun 2016 18:39:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IdXsV008739; Thu, 2 Jun 2016 18:39:33 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IdXrw008737; Thu, 2 Jun 2016 18:39:33 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021839.u52IdXrw008737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301224 - head/sys/dev/cesa 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.22 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: Thu, 02 Jun 2016 18:39:34 -0000 Author: zbb Date: Thu Jun 2 18:39:33 2016 New Revision: 301224 URL: https://svnweb.freebsd.org/changeset/base/301224 Log: Add HMAC-SHA256 support in CESA Only HMAC-SHA256 is added as it is the only SHA-2 variant supported by cryptodev. It is not possible to register hardware support for other algorithms in the family including regular non-keyed SHA256. Submitted by: Michal Stanek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6219 Modified: head/sys/dev/cesa/cesa.c head/sys/dev/cesa/cesa.h Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Thu Jun 2 18:37:50 2016 (r301223) +++ head/sys/dev/cesa/cesa.c Thu Jun 2 18:39:33 2016 (r301224) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include "cryptodev_if.h" @@ -449,6 +450,7 @@ cesa_set_mkey(struct cesa_session *cs, i uint8_t ipad[CESA_MAX_HMAC_BLOCK_LEN]; uint8_t opad[CESA_MAX_HMAC_BLOCK_LEN]; SHA1_CTX sha1ctx; + SHA256_CTX sha256ctx; MD5_CTX md5ctx; uint32_t *hout; uint32_t *hin; @@ -481,6 +483,14 @@ cesa_set_mkey(struct cesa_session *cs, i SHA1Update(&sha1ctx, opad, SHA1_HMAC_BLOCK_LEN); memcpy(hout, sha1ctx.h.b32, sizeof(sha1ctx.h.b32)); break; + case CRYPTO_SHA2_256_HMAC: + SHA256_Init(&sha256ctx); + SHA256_Update(&sha256ctx, ipad, SHA2_256_HMAC_BLOCK_LEN); + memcpy(hin, sha256ctx.state, sizeof(sha256ctx.state)); + SHA256_Init(&sha256ctx); + SHA256_Update(&sha256ctx, opad, SHA2_256_HMAC_BLOCK_LEN); + memcpy(hout, sha256ctx.state, sizeof(sha256ctx.state)); + break; default: return (EINVAL); } @@ -541,6 +551,7 @@ cesa_is_hash(int alg) case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_256_HMAC: return (1); default: return (0); @@ -942,7 +953,11 @@ cesa_execute(struct cesa_softc *sc) ctd = STAILQ_FIRST(&cr->cr_tdesc); CESA_TDMA_WRITE(sc, CESA_TDMA_ND, ctd->ctd_cthd_paddr); +#if defined (SOC_MV_ARMADA38X) + CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE | CESA_SA_CMD_SHA2); +#else CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE); +#endif CESA_UNLOCK(sc, requests); } @@ -1174,6 +1189,9 @@ cesa_attach(device_t dev) */ CESA_TDMA_WRITE(sc, CESA_TDMA_CR, CESA_TDMA_CR_DBL128 | CESA_TDMA_CR_SBL128 | CESA_TDMA_CR_ORDEN | CESA_TDMA_CR_NBS | +#if defined (SOC_MV_ARMADA38X) + CESA_TDMA_NUM_OUTSTAND | +#endif CESA_TDMA_CR_ENABLE); /* @@ -1208,6 +1226,7 @@ cesa_attach(device_t dev) crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0); crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0); crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0); + crypto_register(sc->sc_cid, CRYPTO_SHA2_256_HMAC, 0, 0); return (0); err8: @@ -1478,6 +1497,12 @@ cesa_newsession(device_t dev, uint32_t * if (cs->cs_hlen == CESA_HMAC_TRUNC_LEN) cs->cs_config |= CESA_CSHD_96_BIT_HMAC; break; + case CRYPTO_SHA2_256_HMAC: + cs->cs_mblen = SHA2_256_HMAC_BLOCK_LEN; + cs->cs_hlen = (mac->cri_mlen == 0) ? SHA2_256_HASH_LEN : + mac->cri_mlen; + cs->cs_config |= CESA_CSHD_SHA2_256_HMAC; + break; default: error = EINVAL; break; Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Thu Jun 2 18:37:50 2016 (r301223) +++ head/sys/dev/cesa/cesa.h Thu Jun 2 18:39:33 2016 (r301224) @@ -74,11 +74,9 @@ /* * CESA_MAX_HASH_LEN is maximum length of hash generated by CESA. - * As CESA suports only MD5 and SHA1 this equals to 20 bytes. - * However we increase the value to 24 bytes to meet alignment - * requirements in cesa_sa_data structure. + * As CESA supports MD5, SHA1 and SHA-256 this equals to 32 bytes. */ -#define CESA_MAX_HASH_LEN 24 +#define CESA_MAX_HASH_LEN 32 #define CESA_MAX_KEY_LEN 32 #define CESA_MAX_IV_LEN 16 #define CESA_MAX_HMAC_BLOCK_LEN 64 @@ -293,8 +291,10 @@ struct cesa_chain_info { #define CESA_CSHD_MD5 (4 << 4) #define CESA_CSHD_SHA1 (5 << 4) +#define CESA_CSHD_SHA2_256 (1 << 4) #define CESA_CSHD_MD5_HMAC (6 << 4) #define CESA_CSHD_SHA1_HMAC (7 << 4) +#define CESA_CSHD_SHA2_256_HMAC (3 << 4) #define CESA_CSHD_96_BIT_HMAC (1 << 7) @@ -336,6 +336,10 @@ struct cesa_chain_info { #define CESA_TDMA_CR_FETCHND (1 << 13) #define CESA_TDMA_CR_ACTIVE (1 << 14) +#if defined (SOC_MV_ARMADA38X) +#define CESA_TDMA_NUM_OUTSTAND (2 << 16) +#endif + #define CESA_TDMA_ECR 0x08C8 #define CESA_TDMA_ECR_MISS (1 << 0) #define CESA_TDMA_ECR_DOUBLE_HIT (1 << 1) @@ -357,6 +361,10 @@ struct cesa_chain_info { #define CESA_SA_CMD 0x0E00 #define CESA_SA_CMD_ACTVATE (1 << 0) +#if defined (SOC_MV_ARMADA38X) +#define CESA_SA_CMD_SHA2 (1 << 31) +#endif + #define CESA_SA_DPR 0x0E04 #define CESA_SA_CR 0x0E08 From owner-svn-src-head@freebsd.org Thu Jun 2 18:41:35 2016 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 6001AB653DC; Thu, 2 Jun 2016 18:41:35 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 3A559128E; Thu, 2 Jun 2016 18:41:35 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52IfYmR010079; Thu, 2 Jun 2016 18:41:34 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52IfYRC010075; Thu, 2 Jun 2016 18:41:34 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606021841.u52IfYRC010075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 2 Jun 2016 18:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301225 - in head/sys: arm/conf boot/fdt/dts/arm dev/cesa 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.22 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: Thu, 02 Jun 2016 18:41:35 -0000 Author: zbb Date: Thu Jun 2 18:41:33 2016 New Revision: 301225 URL: https://svnweb.freebsd.org/changeset/base/301225 Log: Add support for CESA on Armada38x Changes: - added new SoC ID in CESA attach - allowed crypto driver IDs other than 0 - added CESA nodes to Armada38x .dts files - enabled required devices in kernconf Submitted by: Michal Stanek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6220 Modified: head/sys/arm/conf/ARMADA38X head/sys/boot/fdt/dts/arm/armada-388-gp.dts head/sys/boot/fdt/dts/arm/armada-38x.dtsi head/sys/dev/cesa/cesa.c Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Thu Jun 2 18:39:33 2016 (r301224) +++ head/sys/arm/conf/ARMADA38X Thu Jun 2 18:41:33 2016 (r301225) @@ -81,6 +81,11 @@ device iic device iicbus device twsi +# CESA +device cesa +device crypto +device cryptodev + #FDT options FDT options FDT_DTB_STATIC Modified: head/sys/boot/fdt/dts/arm/armada-388-gp.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/armada-388-gp.dts Thu Jun 2 18:39:33 2016 (r301224) +++ head/sys/boot/fdt/dts/arm/armada-388-gp.dts Thu Jun 2 18:41:33 2016 (r301225) @@ -62,6 +62,13 @@ ranges = ; internal-regs { + crypto@90000 { + status = "okay"; + }; + crypto@92000 { + status = "okay"; + }; + spi@10600 { pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; Modified: head/sys/boot/fdt/dts/arm/armada-38x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/armada-38x.dtsi Thu Jun 2 18:39:33 2016 (r301224) +++ head/sys/boot/fdt/dts/arm/armada-38x.dtsi Thu Jun 2 18:41:33 2016 (r301225) @@ -63,6 +63,8 @@ gpio1 = &gpio1; serial0 = &uart0; serial1 = &uart1; + sram0 = &SRAM0; + sram1 = &SRAM1; }; pmu { @@ -70,6 +72,16 @@ interrupts-extended = <&mpic 3>; }; + SRAM0: sram@f1100000 { + compatible = "mrvl,cesa-sram"; + reg = <0xf1100000 0x0010000>; + }; + + SRAM1: sram@f1110000 { + compatible = "mrvl,cesa-sram"; + reg = <0xf1110000 0x0010000>; + }; + soc { compatible = "marvell,armada380-mbus", "simple-bus"; #address-cells = <2>; @@ -140,6 +152,25 @@ #size-cells = <1>; ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; + crypto@90000 { + compatible = "mrvl,cesa"; + reg = <0x90000 0x10000>; + interrupts = ; + interrupt-parent = <&gic>; + sram-handle = <&SRAM0>; + status = "disabled"; + }; + + crypto@92000 { + compatible = "mrvl,cesa"; + reg = <0x92000 0x1000 /* tdma base reg chan 1 */ + 0x9F000 0x1000>; /* cesa base reg chan 1 */ + interrupts = ; + interrupt-parent = <&gic>; + sram-handle = <&SRAM1>; + status = "disabled"; + }; + L2: cache-controller@8000 { compatible = "arm,pl310-cache"; reg = <0x8000 0x1000>; Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Thu Jun 2 18:39:33 2016 (r301224) +++ head/sys/dev/cesa/cesa.c Thu Jun 2 18:41:33 2016 (r301225) @@ -1043,6 +1043,7 @@ cesa_attach(device_t dev) switch (d) { case MV_DEV_88F6281: case MV_DEV_88F6282: + case MV_DEV_88F6828: sc->sc_tperr = 0; break; case MV_DEV_MV78100: @@ -1214,7 +1215,7 @@ cesa_attach(device_t dev) /* Register in OCF */ sc->sc_cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE); - if (sc->sc_cid) { + if (sc->sc_cid < 0) { device_printf(dev, "could not get crypto driver id\n"); goto err8; } From owner-svn-src-head@freebsd.org Thu Jun 2 18:48:19 2016 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 BF7B1B6564C for ; Thu, 2 Jun 2016 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 9E9F2186D for ; Thu, 2 Jun 2016 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 93418573-28f2-11e6-8929-8ded99d5e9d7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 2 Jun 2016 18:48:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u52ImA8f011053; Thu, 2 Jun 2016 12:48:10 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464893290.1204.186.camel@freebsd.org> Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa From: Ian Lepore To: Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 02 Jun 2016 12:48:10 -0600 In-Reply-To: <201606021831.u52IVb1O006883@repo.freebsd.org> References: <201606021831.u52IVb1O006883@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 18:48:19 -0000 On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > Author: zbb > Date: Thu Jun 2 18:31:36 2016 > New Revision: 301220 > URL: https://svnweb.freebsd.org/changeset/base/301220 > > Log: > Map CESA SRAM memory in driver attach for Armada38x > > On other platforms with CESA accelerator the SRAM memory is mapped > in > early init before driver is attached. This method only works > correctly > with mappings no smaller than L1 section size (1MB). There may be > more > SRAM blocks and they may have smaller sizes than 1MB as is the case > for Armada38x. Instead, map SRAM memory with bus_space_map() in > CESA > driver attach. Note that we can no longer assume that VA == PA for > the > SRAM. > > Submitted by: Michal Stanek Obtained from: Semihalf > Sponsored by: Stormshield > Differential revision: https://reviews.freebsd.org/D6215 > [...] > - > + rv = OF_getprop(sram_node, "reg", (void *)sram_reg, > sizeof(sram_reg)); > + if (rv <= 0) > + return (rv); > + > + sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); > + /* Store SRAM size to be able to unmap in detach() */ > + sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); > + OF_getprop() followed by fdt32_to_cpu() calls is properly spelled OF_getencprop() (with no fdt32_to_cpu calls). > +#if defined(SOC_MV_ARMADA38X) > + /* SRAM memory was not mapped in platform_sram_devmap(), map > it now */ > + rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc > ->sc_sram_size, > + 0, &(sc->sc_sram_base_va)); bus_space_map() returns a bus_space_handle_t for use with other bus_space functions. The handle is not necessarily "just the virtual address" (although that happens to be the case right now on arm). I don't see any bus_space_xxxxx() calls using this handle, that means that probably the correct function to use is pmap_mapdev(), not bus_space_map(). -- Ian From owner-svn-src-head@freebsd.org Thu Jun 2 19:03:24 2016 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 F0D2DB65A56 for ; Thu, 2 Jun 2016 19:03:24 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6377D1110 for ; Thu, 2 Jun 2016 19:03:24 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x22c.google.com with SMTP id b73so40211419lfb.3 for ; Thu, 02 Jun 2016 12:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nqjQzqPMiMOuOu2hKq80bzTTYv9Qq7nFf/AmBs2ZhVc=; b=HoNZzB+Vv78R9MqaBdNcepB21qdCFGUe8Edc/J5BkTvCxiTJYMdA0PHIE0XfWw+5Xv adqvsl4DfHNPmBgLrhkD7B8pGlVt9J1a6oVQXVm5rQLXfqhcsB3P/+qPgiOLEEYK8KE3 HtSiE26XBXLye6qU18zJTFSFSR75JkGGXVQkZKrpj5iYDWW1q6grIA8ISZfrw/HHiI7T wfQ/GbZM1MMLtrxo/gjjdUdtS5Skg8jv8AfoJ0DmnQTZCLY7FRC47IlUmFQw+KDBuKE2 diuzVu16jSHvXixtY1HjFVzM+aNzRSYYNSOXi7W+fiaQ65Kr19VrP5Wf7yDM9IvzjLqx YV6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nqjQzqPMiMOuOu2hKq80bzTTYv9Qq7nFf/AmBs2ZhVc=; b=WKXZhUqXFYHL1Y8mszZ3miTQxUoEcueZRJmMHd9M9zcUHYmFN3QLhS24W2X8XRXEqr ZkBpTHnIPUm2DfD5LWzw9RWRs7NL/S/yUO54T3AtkqzNqb7tuYb36gnOx2uOhgyJTFB2 ccxtyzWHavDEDjHMzk+ARxmQVKcHxnI5HiT6gPuJRbb+7ezQpuqcu3QtZn3PCC13ImBi nIDCj2Z8idf17DYa3BAA48VtUMTDhrKoFs6m5StNYiZCQrcev9GlrfYOUDFZmGO+ONJS st7V4rSakGsLCvQBIZQxhTdOFFE//EIN9GvslOJcFW4UJaqPqfaECTbBXxle2yg5JAru NZyw== X-Gm-Message-State: ALyK8tJecd1eY5K88XiLhXc6+RYWkGwbjmMxxKVegNm62C4WorqOyAEg3Go+iteYj8hfnuOtTbZ42auWVa3tEA== X-Received: by 10.25.27.196 with SMTP id b187mr3839034lfb.218.1464894202552; Thu, 02 Jun 2016 12:03:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.66 with HTTP; Thu, 2 Jun 2016 12:03:02 -0700 (PDT) In-Reply-To: <1464893290.1204.186.camel@freebsd.org> References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464893290.1204.186.camel@freebsd.org> From: Zbigniew Bodek Date: Thu, 2 Jun 2016 21:03:02 +0200 Message-ID: Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa To: Ian Lepore , =?UTF-8?Q?Micha=C5=82_Stanek?= Cc: Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 19:03:25 -0000 2016-06-02 20:48 GMT+02:00 Ian Lepore : > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > > Author: zbb > > Date: Thu Jun 2 18:31:36 2016 > > New Revision: 301220 > > URL: https://svnweb.freebsd.org/changeset/base/301220 > > > > Log: > > Map CESA SRAM memory in driver attach for Armada38x > > > > On other platforms with CESA accelerator the SRAM memory is mapped > > in > > early init before driver is attached. This method only works > > correctly > > with mappings no smaller than L1 section size (1MB). There may be > > more > > SRAM blocks and they may have smaller sizes than 1MB as is the case > > for Armada38x. Instead, map SRAM memory with bus_space_map() in > > CESA > > driver attach. Note that we can no longer assume that VA == PA for > > the > > SRAM. > > > > Submitted by: Michal Stanek > Obtained from: Semihalf > > Sponsored by: Stormshield > > Differential revision: https://reviews.freebsd.org/D6215 > > [...] > > - > > + rv = OF_getprop(sram_node, "reg", (void *)sram_reg, > > sizeof(sram_reg)); > > + if (rv <= 0) > > + return (rv); > > + > > + sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); > > + /* Store SRAM size to be able to unmap in detach() */ > > + sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); > > + > > OF_getprop() followed by fdt32_to_cpu() calls is properly spelled > OF_getencprop() (with no fdt32_to_cpu calls). > > > +#if defined(SOC_MV_ARMADA38X) > > + /* SRAM memory was not mapped in platform_sram_devmap(), map > > it now */ > > + rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc > > ->sc_sram_size, > > + 0, &(sc->sc_sram_base_va)); > > bus_space_map() returns a bus_space_handle_t for use with other > bus_space functions. The handle is not necessarily "just the virtual > address" (although that happens to be the case right now on arm). I > don't see any bus_space_xxxxx() calls using this handle, that means > that probably the correct function to use is pmap_mapdev(), not > bus_space_map(). > > -- Ian > > Thanks Ian, We will fix this ASAP. BTW. It would be better to get this review prior to committing the patch ;-) Phabricator revision didn't attract anyone's attention: https://reviews.freebsd.org/D6215 Kind regards zbb From owner-svn-src-head@freebsd.org Thu Jun 2 19:06:06 2016 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 E0F1FB65B2A; Thu, 2 Jun 2016 19:06:06 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id AC77212EB; Thu, 2 Jun 2016 19:06:06 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52J65GY019498; Thu, 2 Jun 2016 19:06:05 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52J649H019481; Thu, 2 Jun 2016 19:06:04 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606021906.u52J649H019481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Thu, 2 Jun 2016 19:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... 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.22 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: Thu, 02 Jun 2016 19:06:07 -0000 Author: lidl Date: Thu Jun 2 19:06:04 2016 New Revision: 301226 URL: https://svnweb.freebsd.org/changeset/base/301226 Log: Add basic blacklist build support Reviewed by: rpaulo Approved by: rpaulo Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5913 Added: head/etc/blacklistd.conf (contents, props changed) head/etc/rc.d/blacklistd (contents, props changed) head/lib/libblacklist/ head/lib/libblacklist/Makefile (contents, props changed) head/libexec/blacklistd-helper/ head/libexec/blacklistd-helper/Makefile (contents, props changed) head/usr.sbin/blacklistctl/ head/usr.sbin/blacklistctl/Makefile (contents, props changed) head/usr.sbin/blacklistd/ head/usr.sbin/blacklistd/Makefile (contents, props changed) Modified: head/etc/Makefile head/etc/defaults/rc.conf head/etc/periodic/security/520.pfdenied head/etc/rc.d/Makefile head/lib/Makefile head/libexec/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/share/mk/src.opts.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jun 2 18:41:33 2016 (r301225) +++ head/etc/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -86,6 +86,10 @@ BIN1+= apmd.conf BIN1+= auto_master .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +BIN1+= blacklistd.conf +.endif + .if ${MK_FREEBSD_UPDATE} != "no" BIN1+= freebsd-update.conf .endif Added: head/etc/blacklistd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/blacklistd.conf Thu Jun 2 19:06:04 2016 (r301226) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# +# Blacklist rule +# adr/mask:port type proto owner name nfail disable +[local] +ssh stream * * * 3 24h +ftp stream * * * 3 24h +smtp stream * * * 3 24h +submission stream * * * 3 24h +#6161 stream tcp6 christos * 2 10m +* * * * * 3 60 + +# adr/mask:port type proto owner name nfail disable +[remote] +#129.168.0.0/16 * * * = * * +#6161 = = = =/24 = = +#* stream tcp * = = = Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Jun 2 18:41:33 2016 (r301225) +++ head/etc/defaults/rc.conf Thu Jun 2 19:06:04 2016 (r301226) @@ -270,6 +270,8 @@ hastd_program="/sbin/hastd" # path to ha hastd_flags="" # Optional flags to hastd. ctld_enable="NO" # CAM Target Layer / iSCSI target daemon. local_unbound_enable="NO" # local caching resolver +blacklistd_enable="YES" # Run blacklistd daemon (YES/NO). +blacklistd_flags="" # Optional flags for blacklistd(8). # # kerberos. Do not run the admin daemons on slave servers Modified: head/etc/periodic/security/520.pfdenied ============================================================================== --- head/etc/periodic/security/520.pfdenied Thu Jun 2 18:41:33 2016 (r301225) +++ head/etc/periodic/security/520.pfdenied Thu Jun 2 19:06:04 2016 (r301226) @@ -44,8 +44,14 @@ rc=0 if check_yesno_period security_status_pfdenied_enable then TMP=`mktemp -t security` - if pfctl -sr -v -z 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then - check_diff new_only pf ${TMP} "${host} pf denied packets:" + touch ${TMP} + for _a in "" blacklistd + do + pfctl -a ${_a} -sr -v -z 2>/dev/null | \ + nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' >> ${TMP} + done + if [ -s ${TMP} ]; then + check_diff new_only pf ${TMP} "${host} pf denied packets:" fi rc=$? rm -f ${TMP} Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Thu Jun 2 18:41:33 2016 (r301225) +++ head/etc/rc.d/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -17,6 +17,7 @@ FILES= DAEMON \ auditd \ auditdistd \ bgfsck \ + ${_blacklistd} \ ${_bluetooth} \ bridge \ ${_bthidd} \ @@ -168,6 +169,10 @@ FILES+= automountd FILES+= autounmountd .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +_blacklistd+= blacklistd +.endif + .if ${MK_BLUETOOTH} != "no" _bluetooth= bluetooth _bthidd= bthidd Added: head/etc/rc.d/blacklistd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/blacklistd Thu Jun 2 19:06:04 2016 (r301226) @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Kurt Lidl under sponsorship from the +# FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# PROVIDE: blacklistd +# REQUIRE: netif pf + +. /etc/rc.subr + +name="blacklistd" +desc="System blacklist daemon" +rcvar="blacklistd_enable" +command="/usr/sbin/${name}" +required_files="/etc/blacklistd.conf" + +load_rc_config $name +run_rc_command "$1" Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Jun 2 18:41:33 2016 (r301225) +++ head/lib/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -28,6 +28,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libatm} \ libauditd \ libbegemot \ + ${_libblacklist} \ libblocksruntime \ ${_libbluetooth} \ ${_libbsnmp} \ @@ -161,6 +162,10 @@ SUBDIR_DEPEND_liblzma= ${_libthr} _libngatm= libngatm .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +_libblacklist= libblacklist +.endif + .if ${MK_BLUETOOTH} != "no" _libbluetooth= libbluetooth _libsdp= libsdp Added: head/lib/libblacklist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libblacklist/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +BLACKLIST_DIR=${SRCTOP}/contrib/blacklist + +.PATH: ${BLACKLIST_DIR}/lib ${BLACKLIST_DIR}/include + +LIB= blacklist +SHLIB_MAJOR= 0 + +LIBADD+= pthread + +CFLAGS.clang+=-Wno-thread-safety-analysis + +CFLAGS+=-I${BLACKLIST_DIR}/include -I${BLACKLIST_DIR}/port \ + -D_REENTRANT -DHAVE_CONFIG_H -DHAVE_DB_H -DHAVE_LIBUTIL_H \ + -DHAVE_CLOCK_GETTIME -DHAVE_FGETLN -DHAVE_GETPROGNAME \ + -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRUCT_SOCKADDR_SA_LEN + +SRCS= bl.c blacklist.c +INCS= blacklist.h +MAN= libblacklist.3 + +MLINKS= libblacklist.3 blacklist_open.3 \ + libblacklist.3 blacklist_close.3 \ + libblacklist.3 blacklist.3 \ + libblacklist.3 blacklist_r.3 \ + libblacklist.3 blacklist_sa.3 \ + libblacklist.3 blacklist_sa_r.3 + +.include Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Thu Jun 2 18:41:33 2016 (r301225) +++ head/libexec/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -5,6 +5,7 @@ SUBDIR= ${_atf} \ ${_atrun} \ + ${_blacklistd-helper} \ ${_comsat} \ ${_dma} \ getty \ @@ -33,6 +34,10 @@ SUBDIR= ${_atf} \ _atrun= atrun .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +_blacklistd-helper+= blacklistd-helper +.endif + .if ${MK_BOOTPD} != "no" SUBDIR+= bootpd .endif Added: head/libexec/blacklistd-helper/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/blacklistd-helper/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +BLACKLIST_DIR=${SRCTOP}/contrib/blacklist + +SCRIPTS= ${BLACKLIST_DIR}/libexec/blacklistd-helper + +.include Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Jun 2 18:41:33 2016 (r301225) +++ head/share/mk/bsd.libnames.mk Thu Jun 2 19:06:04 2016 (r301226) @@ -22,6 +22,7 @@ LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a +LIBBLACKLIST?= ${DESTDIR}${LIBDIR}/libblacklist.a LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Thu Jun 2 18:41:33 2016 (r301225) +++ head/share/mk/src.libnames.mk Thu Jun 2 19:06:04 2016 (r301226) @@ -178,6 +178,12 @@ _LIBRARIES= \ zfs \ zpool \ +.if ${MK_BLACKLIST} != "no" +_LIBRARIES+= \ + blacklist \ + +.endif + .if ${MK_OFED} != "no" _LIBRARIES+= \ cxgb4 \ @@ -200,6 +206,9 @@ _LIBRARIES+= \ # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml +.if ${MK_BLACKLIST} != "no" +_DP_blacklist+= pthread +.endif .if ${MK_OPENSSL} != "no" _DP_archive+= crypto .else @@ -502,6 +511,7 @@ LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libw LIBATF_CDIR= ${OBJTOP}/lib/atf/libatf-c LIBATF_CXXDIR= ${OBJTOP}/lib/atf/libatf-c++ LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias +LIBBLACKLISTDIR= ${OBJTOP}/lib/libblacklist LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime LIBBSNMPDIR= ${OBJTOP}/lib/libbsnmp/libbsnmp LIBCASPERDIR= ${OBJTOP}/lib/libcasper/libcasper Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jun 2 18:41:33 2016 (r301225) +++ head/share/mk/src.opts.mk Thu Jun 2 19:06:04 2016 (r301226) @@ -56,6 +56,7 @@ __DEFAULT_YES_OPTIONS = \ BHYVE \ BINUTILS \ BINUTILS_BOOTSTRAP \ + BLACKLIST \ BLUETOOTH \ BOOT \ BOOTPARAMD \ @@ -374,6 +375,7 @@ MK_CLANG_FULL:= no # MK_* variable is set to "no". # .for var in \ + BLACKLIST \ BZIP2 \ GNU \ INET \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 2 18:41:33 2016 (r301225) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 2 19:06:04 2016 (r301226) @@ -431,6 +431,26 @@ OLD_FILES+=usr/share/man/man7/ldint.7.gz OLD_FILES+=usr/share/man/man7/binutils.7.gz .endif +.if ${MK_BLACKLIST_SUPPORT} == no +OLD_FILES+=etc/rc.d/blacklistd +OLD_FILES+=usr/include/blacklist.h +OLD_FILES+=usr/lib/libblacklist.a +OLD_FILES+=usr/lib/libblacklist_p.a +OLD_FILES+=usr/lib/libblacklist.so +OLD_LIBS+=usr/lib/libblacklist.so.0 +OLD_FILES+=usr/libexec/blacklistd-helper +OLD_FILES+=usr/sbin/blacklistctl +OLD_FILES+=usr/sbin/blacklistd +OLD_FILES+=usr/share/man/man3/blacklist.3.gz +OLD_FILES+=usr/share/man/man3/blacklist_close.3.gz +OLD_FILES+=usr/share/man/man3/blacklist_open.3.gz +OLD_FILES+=usr/share/man/man3/blacklist_r.3.gz +OLD_FILES+=usr/share/man/man3/blacklist_sa.3.gz +OLD_FILES+=usr/share/man/man3/blacklist_sa_r.3.gz +OLD_FILES+=usr/share/man/man8/blacklistctl.8.gz +OLD_FILES+=usr/share/man/man8/blacklistd.8.gz +.endif + .if ${MK_BLUETOOTH} == no OLD_FILES+=etc/bluetooth/hcsecd.conf OLD_FILES+=etc/bluetooth/hosts Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Jun 2 18:41:33 2016 (r301225) +++ head/usr.sbin/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -113,6 +113,10 @@ SUBDIR.${MK_AUDIT}+= auditreduce SUBDIR.${MK_AUDIT}+= praudit SUBDIR.${MK_AUTHPF}+= authpf SUBDIR.${MK_AUTOFS}+= autofs +.if ${MK_BLACKLIST_SUPPORT} != "no" +SUBDIR.${MK_BLACKLIST_SUPPORT}+= blacklistctl +SUBDIR.${MK_BLACKLIST_SUPPORT}+= blacklistd +.endif SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall Added: head/usr.sbin/blacklistctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/blacklistctl/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +BLACKLIST_DIR=${SRCTOP}/contrib/blacklist +.PATH: ${BLACKLIST_DIR}/bin ${BLACKLIST_DIR}/port + +PROG= blacklistctl +SRCS= blacklistctl.c conf.c state.c support.c internal.c \ + sockaddr_snprintf.c pidfile.c strtoi.c popenve.c +MAN= blacklistctl.8 + +LDFLAGS+=-L${LIBBLACKLISTDIR} +LIBADD+= blacklist util + +CFLAGS+=-I${BLACKLIST_DIR}/include -I${BLACKLIST_DIR}/port \ + -D_PATH_BLCONTROL=\"/usr/libexec/blacklistd-helper\" \ + -DHAVE_CONFIG_H -DHAVE_DB_H -DHAVE_LIBUTIL_H \ + -DHAVE_CLOCK_GETTIME -DHAVE_FGETLN -DHAVE_FPARSELN \ + -DHAVE_GETPROGNAME -DHAVE_STRLCAT -DHAVE_STRLCPY \ + -DHAVE_STRUCT_SOCKADDR_SA_LEN +# CFLAGS+= -D_REENTRANT + +.include Added: head/usr.sbin/blacklistd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/blacklistd/Makefile Thu Jun 2 19:06:04 2016 (r301226) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +BLACKLIST_DIR=${SRCTOP}/contrib/blacklist +.PATH: ${BLACKLIST_DIR}/bin ${BLACKLIST_DIR}/port + +PROG= blacklistd +SRCS= blacklistd.c conf.c run.c state.c support.c internal.c \ + sockaddr_snprintf.c pidfile.c strtoi.c popenve.c +MAN= blacklistd.8 + +LDFLAGS+=-L${LIBBLACKLISTDIR} +LIBADD+= blacklist util + +CFLAGS+=-I${BLACKLIST_DIR}/include -I${BLACKLIST_DIR}/port \ + -D_PATH_BLCONTROL=\"/usr/libexec/blacklistd-helper\" \ + -DHAVE_CONFIG_H -DHAVE_DB_H -DHAVE_LIBUTIL_H \ + -DHAVE_CLOCK_GETTIME -DHAVE_FGETLN -DHAVE_FPARSELN \ + -DHAVE_GETPROGNAME -DHAVE_STRLCAT -DHAVE_STRLCPY \ + -DHAVE_STRUCT_SOCKADDR_SA_LEN +# CFLAGS+= -D_REENTRANT + +.include From owner-svn-src-head@freebsd.org Thu Jun 2 19:24:36 2016 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 EF3D2B6530B for ; Thu, 2 Jun 2016 19:24:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 D422B1275 for ; Thu, 2 Jun 2016 19:24:36 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a4f34763-28f7-11e6-a0ff-e511cd071b9b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 2 Jun 2016 19:24:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u52JOSxm011110; Thu, 2 Jun 2016 13:24:28 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464895468.1204.188.camel@freebsd.org> Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa From: Ian Lepore To: Zbigniew Bodek , =?iso-8859-2?Q?Micha=B3?= Stanek Cc: Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 02 Jun 2016 13:24:28 -0600 In-Reply-To: References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464893290.1204.186.camel@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 19:24:37 -0000 On Thu, 2016-06-02 at 21:03 +0200, Zbigniew Bodek wrote: > 2016-06-02 20:48 GMT+02:00 Ian Lepore : > > > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > > > Author: zbb > > > Date: Thu Jun 2 18:31:36 2016 > > > New Revision: 301220 > > > URL: https://svnweb.freebsd.org/changeset/base/301220 > > > > > > Log: > > > Map CESA SRAM memory in driver attach for Armada38x > > > > > > On other platforms with CESA accelerator the SRAM memory is > > > mapped > > > in > > > early init before driver is attached. This method only works > > > correctly > > > with mappings no smaller than L1 section size (1MB). There may > > > be > > > more > > > SRAM blocks and they may have smaller sizes than 1MB as is the > > > case > > > for Armada38x. Instead, map SRAM memory with bus_space_map() in > > > CESA > > > driver attach. Note that we can no longer assume that VA == PA > > > for > > > the > > > SRAM. > > > > > > Submitted by: Michal Stanek > > Obtained from: Semihalf > > > Sponsored by: Stormshield > > > Differential revision: https://reviews.freebsd.org/D6215 > > > [...] > > > - > > > + rv = OF_getprop(sram_node, "reg", (void *)sram_reg, > > > sizeof(sram_reg)); > > > + if (rv <= 0) > > > + return (rv); > > > + > > > + sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); > > > + /* Store SRAM size to be able to unmap in detach() */ > > > + sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); > > > + > > > > OF_getprop() followed by fdt32_to_cpu() calls is properly spelled > > OF_getencprop() (with no fdt32_to_cpu calls). > > > > > +#if defined(SOC_MV_ARMADA38X) > > > + /* SRAM memory was not mapped in platform_sram_devmap(), > > > map > > > it now */ > > > + rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc > > > ->sc_sram_size, > > > + 0, &(sc->sc_sram_base_va)); > > > > bus_space_map() returns a bus_space_handle_t for use with other > > bus_space functions. The handle is not necessarily "just the > > virtual > > address" (although that happens to be the case right now on arm). > > I > > don't see any bus_space_xxxxx() calls using this handle, that means > > that probably the correct function to use is pmap_mapdev(), not > > bus_space_map(). > > > > -- Ian > > > > Thanks Ian, > > We will fix this ASAP. > BTW. It would be better to get this review prior to committing the > patch > ;-) > Phabricator revision didn't attract anyone's attention: > https://reviews.freebsd.org/D6215 I've always said that phabricator was primarily a spam-generation tool, and now that seems to be true in spades. It apparently only delivers html-formatted mail now, and my mail client is smart enough to just route html-only messages directly to the trash. -- Ian From owner-svn-src-head@freebsd.org Thu Jun 2 19:24:37 2016 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 9BD7AB6530F; Thu, 2 Jun 2016 19:24:37 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4CE1277; Thu, 2 Jun 2016 19:24:37 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qg0-x232.google.com with SMTP id 52so1389746qgy.0; Thu, 02 Jun 2016 12:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=t6PEsD79Ogh7A5wi5RRecIbvvGA+WqpA97AXRfE5kLA=; b=CqsgqQubNXrviLAlUpZ6STIvKwvCCYH6RhDU2M+YSFTPrVdyDWgsPhhdz4pIpx/CdG rv1R947/2IfI3cq6+94dAinhzWxTB44vOCEhIAjbECjMaRTdVdinJRRUWDBIy6MzEMjr 8cE4OMQSVbrqXkbe7+IDpePu1XpaKmk+6qbEUjwdNydl5Sfa3gGx3LTxJnmKDA/Rdu7P /Ko3ErYIhJwBJkJzM3kulqUjyRJwn3t5fhbyaUKqQzxFWjPLnMRoiZ89FRgm8qUuGgHm gg5CwaG0/dCMeuNy2XoNlEIqBEhVdbuDufCnaXXp0gUEB5ROqPv1/T6RvTr/Nr875YMZ vBXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=t6PEsD79Ogh7A5wi5RRecIbvvGA+WqpA97AXRfE5kLA=; b=MM6HvxisQ6inOODnX12O1shICQONRwc55ALzSLvTGFG+ct8REnGilyRbm/YRdYtmdC ZQM+D7jv0WMwBZ854E6s8bRe+f8FjlMn3R3M2spS4td1PeuZxae1uLtPpI50WNsV6wPx YDOBBU2HVvF4EQjN+Tql4IIDcxFvp+WV0bwWL43FV34FXz/bcdk3RlJHumjaI8REm6Qn J/A5caCa2e0n5Q+ecwn8GDDTGB/DC/xlwhcBpTLDLuhji4G6hmhEH5u7dHl4DknE0I9R WqBRSgSTTScoyKyq3NRYJj9Fe1pq4ye5lYNfGXvKrNVlTOFbaSORQdj/osuJx6XQxEfd eHPw== X-Gm-Message-State: ALyK8tL1/ImsQr/zvpnVEWy4EHiFwd9OuQog+6IO36f6voHIakQxbeAX+5GBgYz+2m592Q== X-Received: by 10.140.160.135 with SMTP id g129mr43961255qhg.47.1464895475872; Thu, 02 Jun 2016 12:24:35 -0700 (PDT) Received: from mbp.home (179-125-139-233.desktop.com.br. [179.125.139.233]) by smtp.gmail.com with ESMTPSA id 61sm549108qte.38.2016.06.02.12.24.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jun 2016 12:24:35 -0700 (PDT) Sender: Renato Botelho Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... From: Renato Botelho In-Reply-To: <201606021906.u52J649H019481@repo.freebsd.org> Date: Thu, 2 Jun 2016 16:24:32 -0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201606021906.u52J649H019481@repo.freebsd.org> To: Kurt Lidl X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 19:24:37 -0000 > On Jun 2, 2016, at 16:06, Kurt Lidl wrote: >=20 > Author: lidl > Date: Thu Jun 2 19:06:04 2016 > New Revision: 301226 > URL: https://svnweb.freebsd.org/changeset/base/301226 >=20 > Log: > Add basic blacklist build support >=20 > Reviewed by: rpaulo > Approved by: rpaulo > Relnotes: YES > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D5913 >=20 > Added: > head/etc/blacklistd.conf (contents, props changed) > head/etc/rc.d/blacklistd (contents, props changed) > head/lib/libblacklist/ > head/lib/libblacklist/Makefile (contents, props changed) > head/libexec/blacklistd-helper/ > head/libexec/blacklistd-helper/Makefile (contents, props changed) > head/usr.sbin/blacklistctl/ > head/usr.sbin/blacklistctl/Makefile (contents, props changed) > head/usr.sbin/blacklistd/ > head/usr.sbin/blacklistd/Makefile (contents, props changed) > Modified: > head/etc/Makefile > head/etc/defaults/rc.conf > head/etc/periodic/security/520.pfdenied > head/etc/rc.d/Makefile > head/lib/Makefile > head/libexec/Makefile > head/share/mk/bsd.libnames.mk > head/share/mk/src.libnames.mk > head/share/mk/src.opts.mk > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.sbin/Makefile Looks like it=E2=80=99s missing man pages, no? -- Renato Botelho From owner-svn-src-head@freebsd.org Thu Jun 2 19:25:28 2016 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 40299B653E4; Thu, 2 Jun 2016 19:25:28 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEBA61752; Thu, 2 Jun 2016 19:25:27 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qg0-x234.google.com with SMTP id 93so1344452qgx.2; Thu, 02 Jun 2016 12:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LvM7BZNZyLdftgUYpCnVuINU74V0vTdbwjDrciUXOz4=; b=M1VmriplTtA4NVUh8TGU+W7yvKJSR9cDhwZEfUrDyruHE3Gqp99v4qbKxZ3BE5npKe ZJJWWOD6twMzFhPFwDiKEGQhDy79KwdO93cXKd2JRTZLsYz2ZX9uyJ6mLon4wfu5wlF+ oPnE54SA0YEh5xe33Bh8kS0nWuta83qpuxpG+fq5uTwLOe+3mAWar1/Zi57vc196+s6X BWOhdfWyGMpAsNA1BYzm+rApJ21SuE/l6b05Ni5mR5GwwlJyr16jhUG+JaULIWFgBV6n hGxgPvmWmOVP3lyNNWBKGILcWJ8t+pjRBqmqdLBuNXuuQhUs72Nh2FQWpY3bwBkIkkRI 2hrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=LvM7BZNZyLdftgUYpCnVuINU74V0vTdbwjDrciUXOz4=; b=RDwFqnI1KKXDOU2Q8dZc488q9AmtzvuSzlXn223bvc+r9/tAkmMTH606XlqhtfXRJt 8DyLL8fn0GiSJU4XifjupJ34NZy8B0WkwCKPYF6a8M+cdOWDcQ69+xlG4rFh+z64p+97 5uf26BNz0ewcoHevORgOvhN4GEWI40Do7yCLRjwRsEr87qSVz44McxUEuwO9WdPAj6uf ATqSJqDRCSw5afoPvGvqCm8Rx2r7n1ScE+XjUr3KciyIFmef9GJrYUXn8AMVKWMqDhfg 0nzkfq6cLIPWQovIyclu0li4Z/Q6nIsC0mUCj8S6QI10GM2TstwfwKuDk2CTkIpma6ME y8mA== X-Gm-Message-State: ALyK8tLJpTsH2z27Py/e9N5efhOa2mL8sSZfS8YidivgLAabPIaU4etQZHtTD3Be5sw+GQ== X-Received: by 10.140.159.20 with SMTP id f20mr44917080qhf.61.1464895527022; Thu, 02 Jun 2016 12:25:27 -0700 (PDT) Received: from mbp.home (179-125-139-233.desktop.com.br. [179.125.139.233]) by smtp.gmail.com with ESMTPSA id 61sm549108qte.38.2016.06.02.12.25.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jun 2016 12:25:26 -0700 (PDT) Sender: Renato Botelho Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... From: Renato Botelho In-Reply-To: Date: Thu, 2 Jun 2016 16:25:25 -0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201606021906.u52J649H019481@repo.freebsd.org> To: Kurt Lidl X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 19:25:28 -0000 > On Jun 2, 2016, at 16:24, Renato Botelho wrote: >=20 >> On Jun 2, 2016, at 16:06, Kurt Lidl wrote: >>=20 >> Author: lidl >> Date: Thu Jun 2 19:06:04 2016 >> New Revision: 301226 >> URL: https://svnweb.freebsd.org/changeset/base/301226 >>=20 >> Log: >> Add basic blacklist build support >>=20 >> Reviewed by: rpaulo >> Approved by: rpaulo >> Relnotes: YES >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D5913 >>=20 >> Added: >> head/etc/blacklistd.conf (contents, props changed) >> head/etc/rc.d/blacklistd (contents, props changed) >> head/lib/libblacklist/ >> head/lib/libblacklist/Makefile (contents, props changed) >> head/libexec/blacklistd-helper/ >> head/libexec/blacklistd-helper/Makefile (contents, props changed) >> head/usr.sbin/blacklistctl/ >> head/usr.sbin/blacklistctl/Makefile (contents, props changed) >> head/usr.sbin/blacklistd/ >> head/usr.sbin/blacklistd/Makefile (contents, props changed) >> Modified: >> head/etc/Makefile >> head/etc/defaults/rc.conf >> head/etc/periodic/security/520.pfdenied >> head/etc/rc.d/Makefile >> head/lib/Makefile >> head/libexec/Makefile >> head/share/mk/bsd.libnames.mk >> head/share/mk/src.libnames.mk >> head/share/mk/src.opts.mk >> head/tools/build/mk/OptionalObsoleteFiles.inc >> head/usr.sbin/Makefile >=20 > Looks like it=E2=80=99s missing man pages, no? nvm my fat finger, now I saw the other commit. Sorry for the noise. -- Renato Botelho From owner-svn-src-head@freebsd.org Thu Jun 2 19:54:39 2016 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 BC72CB662BA; Thu, 2 Jun 2016 19:54:39 +0000 (UTC) (envelope-from dim@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 mx1.freebsd.org (Postfix) with ESMTPS id 746FA112C; Thu, 2 Jun 2016 19:54:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52Jsc3x038258; Thu, 2 Jun 2016 19:54:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52Jscl9038256; Thu, 2 Jun 2016 19:54:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201606021954.u52Jscl9038256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 2 Jun 2016 19:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301227 - in head: contrib/llvm/lib/Target/X86 lib/clang/include/clang/Basic 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.22 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: Thu, 02 Jun 2016 19:54:39 -0000 Author: dim Date: Thu Jun 2 19:54:38 2016 New Revision: 301227 URL: https://svnweb.freebsd.org/changeset/base/301227 Log: Pull in r271548 from upstream llvm trunk (by me): Only attempt to detect AVG if SSE2 is available Summary: In PR29973 Sanjay Patel reported an assertion failure when a certain loop was optimized, for a target without SSE2 support. It turned out this was because of the AVG pattern detection introduced in rL253952. Prevent the assertion failure by bailing out early in `detectAVGPattern()`, if the target does not support SSE2. Also add a minimized test case. Reviewers: congh, eli.friedman, spatel Subscribers: emaste, llvm-commits Differential Revision: http://reviews.llvm.org/D20905 This should fix assertion failures ("Requires at least SSE2!") when building the games/0ad port with CPUTYPE=pentium3. Reported by: madpilot Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/lib/clang/include/clang/Basic/Version.inc Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Jun 2 19:06:04 2016 (r301226) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Jun 2 19:54:38 2016 (r301227) @@ -26159,6 +26159,8 @@ static SDValue detectAVGPattern(SDValue if (InScalarVT.getSizeInBits() <= ScalarVT.getSizeInBits()) return SDValue(); + if (!Subtarget->hasSSE2()) + return SDValue(); if (Subtarget->hasAVX512()) { if (VT.getSizeInBits() > 512) return SDValue(); Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Thu Jun 2 19:06:04 2016 (r301226) +++ head/lib/clang/include/clang/Basic/Version.inc Thu Jun 2 19:54:38 2016 (r301227) @@ -9,4 +9,4 @@ #define SVN_REVISION "262564" -#define FREEBSD_CC_VERSION 1100003U +#define FREEBSD_CC_VERSION 1100004U From owner-svn-src-head@freebsd.org Thu Jun 2 20:21:03 2016 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 D059EB66C4F; Thu, 2 Jun 2016 20:21:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCB61504; Thu, 2 Jun 2016 20:21:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x235.google.com with SMTP id d51so6519040qte.2; Thu, 02 Jun 2016 13:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=HWCZBi8ps8MiEIfoCr3Hpmsmv+FWSQRHSscncvQOyJw=; b=vMruujkOhg91LkcvOiuMDXmbNidHW/lhYSRhNTJhL8r3Dc5Cxv8o0FXMqUq+3rba+S YFrpvV7lh9S0hk+p1q4xDCOiLE/Njuxe5Jvusd9mcHc3b2TZ/XxB/uMML42BXj6qylIB DG86IICojlnaDSiLZtSTeKJvMf78gf4KL89lwYCjKW/D3QT4eHgR+hC324A1b7JiYDop buMPeL+RhhBhCRchweOBrsJN727ztLLWlcPvxL3a/W9bLib261vis7xkrTWVJeO6q61J AJsqaBDIPlXQwlbNEOj5aMtxGUA/F/WDGWXUokmneF8gfvXr5w2sAXolW761T7VVmmoj 9xcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=HWCZBi8ps8MiEIfoCr3Hpmsmv+FWSQRHSscncvQOyJw=; b=LkzI1RUklKorcHrEkBTJclvCg6endF0SQX4ligB27uwqPDa/fjsVzJ80ns9Uo+ftcO R6ioTm6uxfoUOCCaSsmxXwd9v8P2Sk77BE2VNUGaFnXlguLkIkPsbT1RG92J3Po1jWtz 8MUtazrNGyAc9hZ1ykvbOQabwBoRKMRYJ6v44XOwugB0+3VtyFCqhyboSKPPUrAoFVWD dJqqNflDenhzl7gwVRD/b1i5F2euETCJED+3La11/EnkD19XStBW4aSAtxqgHva0tY9L DGv/0vcy6csZDmg0k+8OjklPDQYRoW3M6ryKjOjUopLKBfYUL5bn5lxafbk2Vvn+qeSG r3zg== X-Gm-Message-State: ALyK8tJIBNThgSwc9UmR9R0z+5P5zVAzyUARerjOefFObgKUlYaalAUjYc51A/HlMki9Ga21UjMMt+uU1nCgMw== MIME-Version: 1.0 X-Received: by 10.200.51.89 with SMTP id u25mr44075qta.58.1464898862744; Thu, 02 Jun 2016 13:21:02 -0700 (PDT) Received: by 10.55.146.69 with HTTP; Thu, 2 Jun 2016 13:21:02 -0700 (PDT) In-Reply-To: <201606021751.u52HpTrH090384@repo.freebsd.org> References: <201606021751.u52HpTrH090384@repo.freebsd.org> Date: Thu, 2 Jun 2016 13:21:02 -0700 Message-ID: Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6 From: Ngie Cooper To: "George V. Neville-Neil" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 20:21:03 -0000 On Thu, Jun 2, 2016 at 10:51 AM, George V. Neville-Neil wrote: > Author: gnn > Date: Thu Jun 2 17:51:29 2016 > New Revision: 301217 > URL: https://svnweb.freebsd.org/changeset/base/301217 > > Log: > This change re-adds L2 caching for TCP and UDP, as originally added in D4306 > but removed due to other changes in the system. Restore the llentry pointer > to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as > appropriate. > > Submitted by: Mike Karels > Differential Revision: https://reviews.freebsd.org/D6262 This broke ibcore: https://lists.freebsd.org/pipermail/freebsd-current/2016-June/061640.html Thanks, -Ngie From owner-svn-src-head@freebsd.org Thu Jun 2 20:31:03 2016 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 A904AB650EA; Thu, 2 Jun 2016 20:31:03 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 770471051; Thu, 2 Jun 2016 20:31:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52KV2V5049895; Thu, 2 Jun 2016 20:31:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52KV2XO049894; Thu, 2 Jun 2016 20:31:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606022031.u52KV2XO049894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 2 Jun 2016 20:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301228 - head/lib 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.22 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: Thu, 02 Jun 2016 20:31:03 -0000 Author: bdrewery Date: Thu Jun 2 20:31:02 2016 New Revision: 301228 URL: https://svnweb.freebsd.org/changeset/base/301228 Log: Remove libstdc++ again. This was mis-merged in r298107 which missed r289389. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Jun 2 19:54:38 2016 (r301227) +++ head/lib/Makefile Thu Jun 2 20:31:02 2016 (r301228) @@ -150,7 +150,6 @@ SUBDIR_DEPEND_libpjdlog= libutil SUBDIR_DEPEND_libprocstat= libkvm libutil SUBDIR_DEPEND_libradius= libmd SUBDIR_DEPEND_libsmb= libkiconv -SUBDIR_DEPEND_libstdc++:= msun SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} From owner-svn-src-head@freebsd.org Thu Jun 2 20:50:56 2016 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 60143B6594F; Thu, 2 Jun 2016 20:50:56 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (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 3B2891D18; Thu, 2 Jun 2016 20:50:55 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from nyufwa-guests-01.natpool.nyu.edu ([192.76.177.124]:4910 helo=[172.30.17.42]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1b8ZZv-0002og-2O; Thu, 02 Jun 2016 16:50:55 -0400 From: "George Neville-Neil" To: "Ngie Cooper" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6 Date: Thu, 02 Jun 2016 16:50:54 -0400 Message-ID: <8DBC3C44-AAF3-4C84-986D-BABC1BF7BE13@freebsd.org> In-Reply-To: References: <201606021751.u52HpTrH090384@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.9.4r5234) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 20:50:56 -0000 On 2 Jun 2016, at 16:21, Ngie Cooper wrote: > On Thu, Jun 2, 2016 at 10:51 AM, George V. Neville-Neil > wrote: >> Author: gnn >> Date: Thu Jun 2 17:51:29 2016 >> New Revision: 301217 >> URL: https://svnweb.freebsd.org/changeset/base/301217 >> >> Log: >> This change re-adds L2 caching for TCP and UDP, as originally added >> in D4306 >> but removed due to other changes in the system. Restore the llentry >> pointer >> to the "struct route", and use it to cache the L2 lookup (ARP or >> ND6) as >> appropriate. >> >> Submitted by: Mike Karels >> Differential Revision: https://reviews.freebsd.org/D6262 > > This broke ibcore: > https://lists.freebsd.org/pipermail/freebsd-current/2016-June/061640.html > Thanks, > -Ngie About to commit a fix. Best, George From owner-svn-src-head@freebsd.org Thu Jun 2 20:53:44 2016 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 702A7B65B25; Thu, 2 Jun 2016 20:53:44 +0000 (UTC) (envelope-from gnn@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 mx1.freebsd.org (Postfix) with ESMTPS id 26E0F10EC; Thu, 2 Jun 2016 20:53:44 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52KrhPD060417; Thu, 2 Jun 2016 20:53:43 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52KrhDq060415; Thu, 2 Jun 2016 20:53:43 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201606022053.u52KrhDq060415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 2 Jun 2016 20:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301229 - in head/sys/ofed/drivers/infiniband: core ulp/ipoib 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.22 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: Thu, 02 Jun 2016 20:53:44 -0000 Author: gnn Date: Thu Jun 2 20:53:43 2016 New Revision: 301229 URL: https://svnweb.freebsd.org/changeset/base/301229 Log: Fix up the Infiniband code to handle the new arpresolve. Modified: head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Jun 2 20:31:02 2016 (r301228) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Jun 2 20:53:43 2016 (r301229) @@ -395,13 +395,13 @@ mcast: #ifdef INET case AF_INET: error = arpresolve(ifp, is_gw, NULL, - is_gw ? rte->rt_gateway : dst_in, edst, NULL); + is_gw ? rte->rt_gateway : dst_in, edst, NULL, NULL); break; #endif #ifdef INET6 case AF_INET6: error = nd6_resolve(ifp, is_gw, NULL, - is_gw ? rte->rt_gateway : dst_in, edst, NULL); + is_gw ? rte->rt_gateway : dst_in, edst, NULL, NULL); break; #endif default: Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Jun 2 20:31:02 2016 (r301228) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Jun 2 20:53:43 2016 (r301229) @@ -1296,7 +1296,7 @@ ipoib_output(struct ifnet *ifp, struct m else if (m->m_flags & M_MCAST) ip_ib_mc_map(((struct sockaddr_in *)dst)->sin_addr.s_addr, ifp->if_broadcastaddr, edst); else - error = arpresolve(ifp, is_gw, m, dst, edst, NULL); + error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); type = htons(ETHERTYPE_IP); @@ -1334,7 +1334,7 @@ ipoib_output(struct ifnet *ifp, struct m else if (m->m_flags & M_MCAST) ipv6_ib_mc_map(&((struct sockaddr_in6 *)dst)->sin6_addr, ifp->if_broadcastaddr, edst); else - error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL); + error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); if (error) return error; type = htons(ETHERTYPE_IPV6); From owner-svn-src-head@freebsd.org Thu Jun 2 21:06:42 2016 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 B634BB65DE3 for ; Thu, 2 Jun 2016 21:06:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x233.google.com (mail-qt0-x233.google.com [IPv6:2607:f8b0:400d:c0d::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 757941793; Thu, 2 Jun 2016 21:06:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x233.google.com with SMTP id d51so6823100qte.2; Thu, 02 Jun 2016 14:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=N8M+Cijf0E7OsSwXmF3NxrgDRSu65xhykSyIDnsJR3c=; b=yM+3PpAcogg6NmaCe3MUkRek9LHkZ3rf6f1gtOkTpTbAuizgVwHxToxFx3NQEIfJcw TRteu+7+C5UOQqmuBw8seCIYPxUpV2E8fT5cxWLfWAKMJ4pflabHEC0Jdp7UzyntRufQ SEej79XXenJ76rrzKiGfhpBVOEt9hVxRCMKFMaqAwJjBcb27Zv109g/nthktVf669/97 neASkd4l0e18oGoA4Z7M8qZ6QnDkyP5jgl3kTSY82LzG0H51TYPS3K4YhfA+fGkiGpSM aeThEg0ATuCF/RPjPjltpIDYOz/Fry0mQCVxVKNLqF3jEnD+nfDQm7Gvi6x3CmHJqT6G bjuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=N8M+Cijf0E7OsSwXmF3NxrgDRSu65xhykSyIDnsJR3c=; b=hpkvbG1u72RJVTq8BDhJ1qTtl8m120M5vju1zxwl9gH6A8fxVUXUKbDf6xok6sMsg1 24Z2EL/RV40IKzS+/n8DtOccdgEr4cteCdpzavj/h3FQdYRnZcqbHjiC2g+tl5t7r+tp miSiBUaYbAOSJwX4FyYnt3MIGdc6+ClZjbrSG8eWnZp4LEWg+QBgvr7MSVgCPfgSDvsd n6iC7Rfwxq/0cqh7Flxo5cGQQ6ZiF8QMC2RffbFLQfoPSK+FoIPIWn//IHn4LmeCR1cy A5Pyhqfj2cGkyHSBhUa92UV5J6NXDM1MWwgfckv+O+i+MK39FCRtz48XMeAMpja7hdd1 SHeA== X-Gm-Message-State: ALyK8tKszspV8UREN/EDNDBElja5w+E+xdZNoEp38tSkHYHlvAqQWYz1Oyuppn5Fn67Z2BdzwmnVQsQ0ElASwA== MIME-Version: 1.0 X-Received: by 10.237.41.5 with SMTP id s5mr176347qtd.71.1464901601658; Thu, 02 Jun 2016 14:06:41 -0700 (PDT) Received: by 10.55.146.69 with HTTP; Thu, 2 Jun 2016 14:06:41 -0700 (PDT) In-Reply-To: <574dca4a1aea2_5ed04db318625e6@ss1435.mail> References: <574dca4a1aea2_5ed04db318625e6@ss1435.mail> Date: Thu, 2 Jun 2016 14:06:41 -0700 Message-ID: Subject: Re: New Defects reported by Coverity Scan for FreeBSD From: Ngie Cooper To: "svn-src-head@freebsd.org" Cc: Uli S Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 21:06:42 -0000 On Tue, May 31, 2016 at 10:30 AM, wrote: > > Hi, > > Please find the latest report on new defect(s) introduced to FreeBSD found with Coverity Scan. > > 25 new defect(s) introduced to FreeBSD found with Coverity Scan. > 135 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. > > New defect(s) Reported-by: Coverity Scan > Showing 20 of 25 defect(s) This is pretty cool, actually... the number of defects reported by Coverity has drastically decreased in the last few months -- down ~1500 issues from ~12000 to ~10300 according to the "Outstanding vs Fixed defects over period of time" [*] graph (we still have another 2k issues to beat before we can get back down to our defect count last year -- 04/2015). Cheers, -Ngie * https://scan.coverity.com/projects/freebsd From owner-svn-src-head@freebsd.org Thu Jun 2 21:06:52 2016 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 D39DDB65E0C; Thu, 2 Jun 2016 21:06:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF07017B8; Thu, 2 Jun 2016 21:06:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AD4F0B977; Thu, 2 Jun 2016 17:06:51 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Zbigniew Bodek , =?utf-8?B?TWljaGHFgg==?= Stanek , Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa Date: Thu, 02 Jun 2016 14:05:33 -0700 Message-ID: <1946366.I33PJXpI92@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <1464895468.1204.188.camel@freebsd.org> References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464895468.1204.188.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 02 Jun 2016 17:06:51 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 21:06:52 -0000 On Thursday, June 02, 2016 01:24:28 PM Ian Lepore wrote: > On Thu, 2016-06-02 at 21:03 +0200, Zbigniew Bodek wrote: > > 2016-06-02 20:48 GMT+02:00 Ian Lepore : > > > > > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > > > > Author: zbb > > > > Date: Thu Jun 2 18:31:36 2016 > > > > New Revision: 301220 > > > > URL: https://svnweb.freebsd.org/changeset/base/301220 > > > > > > > > Log: > > > > Map CESA SRAM memory in driver attach for Armada38x > > > > > > > > On other platforms with CESA accelerator the SRAM memory is > > > > mapped > > > > in > > > > early init before driver is attached. This method only works > > > > correctly > > > > with mappings no smaller than L1 section size (1MB). There may > > > > be > > > > more > > > > SRAM blocks and they may have smaller sizes than 1MB as is the > > > > case > > > > for Armada38x. Instead, map SRAM memory with bus_space_map() in > > > > CESA > > > > driver attach. Note that we can no longer assume that VA == PA > > > > for > > > > the > > > > SRAM. > > > > > > > > Submitted by: Michal Stanek > > > Obtained from: Semihalf > > > > Sponsored by: Stormshield > > > > Differential revision: https://reviews.freebsd.org/D6215 > > > > [...] > > > > - > > > > + rv = OF_getprop(sram_node, "reg", (void *)sram_reg, > > > > sizeof(sram_reg)); > > > > + if (rv <= 0) > > > > + return (rv); > > > > + > > > > + sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); > > > > + /* Store SRAM size to be able to unmap in detach() */ > > > > + sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); > > > > + > > > > > > OF_getprop() followed by fdt32_to_cpu() calls is properly spelled > > > OF_getencprop() (with no fdt32_to_cpu calls). > > > > > > > +#if defined(SOC_MV_ARMADA38X) > > > > + /* SRAM memory was not mapped in platform_sram_devmap(), > > > > map > > > > it now */ > > > > + rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc > > > > ->sc_sram_size, > > > > + 0, &(sc->sc_sram_base_va)); > > > > > > bus_space_map() returns a bus_space_handle_t for use with other > > > bus_space functions. The handle is not necessarily "just the > > > virtual > > > address" (although that happens to be the case right now on arm). > > > I > > > don't see any bus_space_xxxxx() calls using this handle, that means > > > that probably the correct function to use is pmap_mapdev(), not > > > bus_space_map(). > > > > > > -- Ian > > > > > > Thanks Ian, > > > > We will fix this ASAP. > > BTW. It would be better to get this review prior to committing the > > patch > > ;-) > > Phabricator revision didn't attract anyone's attention: > > https://reviews.freebsd.org/D6215 > > > I've always said that phabricator was primarily a spam-generation tool, > and now that seems to be true in spades. It apparently only delivers > html-formatted mail now, and my mail client is smart enough to just > route html-only messages directly to the trash. There's a config option to turn off the HTML bit. A recent "upgrade" of phab silently turned on HTML e-mails by default. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 2 21:34:34 2016 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 99EB7B676C1 for ; Thu, 2 Jun 2016 21:34:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 0BE5017CC for ; Thu, 2 Jun 2016 21:34:33 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c8815a83-2909-11e6-ac92-3142cfe117f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.eu.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 2 Jun 2016 21:34:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u52LYKhO011354; Thu, 2 Jun 2016 15:34:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464903260.1204.191.camel@freebsd.org> Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa From: Ian Lepore To: John Baldwin Cc: Zbigniew Bodek , =?iso-8859-2?Q?Micha=B3?= Stanek , Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 02 Jun 2016 15:34:20 -0600 In-Reply-To: <1946366.I33PJXpI92@ralph.baldwin.cx> References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464895468.1204.188.camel@freebsd.org> <1946366.I33PJXpI92@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 21:34:34 -0000 On Thu, 2016-06-02 at 14:05 -0700, John Baldwin wrote: > On Thursday, June 02, 2016 01:24:28 PM Ian Lepore wrote: > > On Thu, 2016-06-02 at 21:03 +0200, Zbigniew Bodek wrote: > > > 2016-06-02 20:48 GMT+02:00 Ian Lepore : > > > > > > > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > > > > > [...] > > > > I've always said that phabricator was primarily a spam-generation > > tool, > > and now that seems to be true in spades. It apparently only > > delivers > > html-formatted mail now, and my mail client is smart enough to just > > route html-only messages directly to the trash. > > There's a config option to turn off the HTML bit. A recent "upgrade" > of > phab silently turned on HTML e-mails by default. > I thought at first you meant an option the admins have to set, but I see now that it's a per-user email setting. So now I'll be back to seeing all the phab stuff I don't have time to deal with, and will be able to feel suitably guilty about it again. -- Ian From owner-svn-src-head@freebsd.org Fri Jun 3 00:06:25 2016 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 7D061B689F2; Fri, 3 Jun 2016 00:06:25 +0000 (UTC) (envelope-from gjb@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 mx1.freebsd.org (Postfix) with ESMTPS id 47D751433; Fri, 3 Jun 2016 00:06:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5306OJ0029544; Fri, 3 Jun 2016 00:06:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5306OeB029543; Fri, 3 Jun 2016 00:06:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606030006.u5306OeB029543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 Jun 2016 00:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301230 - head/sys/conf 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.22 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, 03 Jun 2016 00:06:25 -0000 Author: gjb Date: Fri Jun 3 00:06:24 2016 New Revision: 301230 URL: https://svnweb.freebsd.org/changeset/base/301230 Log: Update to ALPHA2 in preparation of a new set of snapshot builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Jun 2 20:53:43 2016 (r301229) +++ head/sys/conf/newvers.sh Fri Jun 3 00:06:24 2016 (r301230) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="ALPHA1" +BRANCH="ALPHA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-head@freebsd.org Fri Jun 3 03:40:40 2016 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 BCD5BB68185; Fri, 3 Jun 2016 03:40:40 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 8E52214B2; Fri, 3 Jun 2016 03:40:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u533edvl006631; Fri, 3 Jun 2016 03:40:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u533edHA006630; Fri, 3 Jun 2016 03:40:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606030340.u533edHA006630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Jun 2016 03:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301235 - head/sbin/dhclient 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.22 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, 03 Jun 2016 03:40:40 -0000 Author: pfg Date: Fri Jun 3 03:40:39 2016 New Revision: 301235 URL: https://svnweb.freebsd.org/changeset/base/301235 Log: dhclient(1): correct obvious mismatch in get_char(). Correct switch between current and previous line buffers when encountering a carriage return in the input. CID: 1305719 Obtained from: OpenBSD (CVS rev. 1.30) MFC after: 3 days Modified: head/sbin/dhclient/conflex.c Modified: head/sbin/dhclient/conflex.c ============================================================================== --- head/sbin/dhclient/conflex.c Fri Jun 3 03:22:00 2016 (r301234) +++ head/sbin/dhclient/conflex.c Fri Jun 3 03:40:39 2016 (r301235) @@ -97,8 +97,8 @@ get_char(FILE *cfile) cur_line = line2; prev_line = line1; } else { - cur_line = line2; - prev_line = line1; + cur_line = line1; + prev_line = line2; } line++; lpos = 1; From owner-svn-src-head@freebsd.org Fri Jun 3 05:01:36 2016 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 CC0CCB68EF0; Fri, 3 Jun 2016 05:01:36 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 96172174D; Fri, 3 Jun 2016 05:01:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5351Zq0035704; Fri, 3 Jun 2016 05:01:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5351ZMg035703; Fri, 3 Jun 2016 05:01:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606030501.u5351ZMg035703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Jun 2016 05:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301236 - head/sys/dev/drm2 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.22 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, 03 Jun 2016 05:01:36 -0000 Author: adrian Date: Fri Jun 3 05:01:35 2016 New Revision: 301236 URL: https://svnweb.freebsd.org/changeset/base/301236 Log: [drm] fix up hex_dump_to_buffer to not overflow linebuf. That check wasn't enough to handle appending a two byte character following it. This prevented my T400 (Intel Core 2 Duo P8400) from attaching; it would panic from a stack overflow detection. Modified: head/sys/dev/drm2/drm_os_freebsd.c Modified: head/sys/dev/drm2/drm_os_freebsd.c ============================================================================== --- head/sys/dev/drm2/drm_os_freebsd.c Fri Jun 3 03:40:39 2016 (r301235) +++ head/sys/dev/drm2/drm_os_freebsd.c Fri Jun 3 05:01:35 2016 (r301236) @@ -422,7 +422,7 @@ hex_dump_to_buffer(const void *buf, size } } - if (j > linebuflen - 1) + if (j > linebuflen - 4) break; sprintf(linebuf + j, "%02X", c); From owner-svn-src-head@freebsd.org Fri Jun 3 05:03:30 2016 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 83DBAB68F79; Fri, 3 Jun 2016 05:03:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 502B119C8; Fri, 3 Jun 2016 05:03:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x229.google.com with SMTP id z189so128561209itg.0; Thu, 02 Jun 2016 22:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=mUqIxQ0JRMYHZ2NdO8pUbvaF7ViT2Xdhr3lFngCnTjY=; b=BTlIwgtTy428E2YSUIeDT8tfzAOhfZgSzFB7z8SOTV2rON7368dKOuxDEPUsTwgEOH luXqwEM4VmtsRAQYmiy2n247wBs7vkx89m1239MTLcYSV6B61z9yM1o8ELK2KdRvHyB2 ADctsWzF9wscBA2giGM5elUH6X9xOLrTIR6PRPHtPPoUXYpV8IWOWr0TYX5F+fYTfJ2b XvajK4ws85ekM4puk7OdZirOP0NTQwKymYRDjuNToY31muIoyAiebMxt4n5tq19T7pvu 84HY9TgOIn55k/S7SEPJiQT+d73jrXD21+BWMli7FbyCUZT+Y/LUD2FvjWAAKVsEUyQ7 RKvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to; bh=mUqIxQ0JRMYHZ2NdO8pUbvaF7ViT2Xdhr3lFngCnTjY=; b=PfD4FKx5eKaOxRxDpN9DYxUWlC/kHeTTw0HbMpb/YqZ7pWFKC7h3lBxre5aL8SkNxE cEVJY6wjduemMsdxb6ICSsixPAxUpBduY3SVAaSq454mjWTkuGiRhQH902xx+2AAII7C sCChqNEIGDhpklp9o4x0+MMfb4XpAO2Wfxj1p9JaCv8WzDdhK/+Rr+YJBo6qTeJFa/VN L4LGjMaH+IKtmvB5sxhy5yeUXWh6qfuvNzPkoDzZKEtjfRCI8GPgYAux/Jw+Av38MlVE sL8AMiixX7R4ocniQm+fRuiEOf/vud9hlMsI+iq4BMbBtfKK72wEdgIPTksas6LS+ApT 0hGQ== X-Gm-Message-State: ALyK8tKLpmEkMzttKPtPkGrDhZxV8IzrCb2eA9TkbBI9iACzKwJS6WdFBpL3XnH+VHGZOdzDQQ5ToKjfWkN+ww== MIME-Version: 1.0 X-Received: by 10.36.81.79 with SMTP id s76mr2298072ita.71.1464930209527; Thu, 02 Jun 2016 22:03:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Thu, 2 Jun 2016 22:03:29 -0700 (PDT) In-Reply-To: <201606030501.u5351ZMg035703@repo.freebsd.org> References: <201606030501.u5351ZMg035703@repo.freebsd.org> Date: Thu, 2 Jun 2016 22:03:29 -0700 X-Google-Sender-Auth: MOHjWW3ONZZR-AQYA_NOzGRkmck Message-ID: Subject: Re: svn commit: r301236 - head/sys/dev/drm2 From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 05:03:30 -0000 fwiw, this made me cry. a lot. grr. -adrian On 2 June 2016 at 22:01, Adrian Chadd wrote: > Author: adrian > Date: Fri Jun 3 05:01:35 2016 > New Revision: 301236 > URL: https://svnweb.freebsd.org/changeset/base/301236 > > Log: > [drm] fix up hex_dump_to_buffer to not overflow linebuf. > > That check wasn't enough to handle appending a two byte character > following it. > > This prevented my T400 (Intel Core 2 Duo P8400) from attaching; > it would panic from a stack overflow detection. > > Modified: > head/sys/dev/drm2/drm_os_freebsd.c > > Modified: head/sys/dev/drm2/drm_os_freebsd.c > ============================================================================== > --- head/sys/dev/drm2/drm_os_freebsd.c Fri Jun 3 03:40:39 2016 (r301235) > +++ head/sys/dev/drm2/drm_os_freebsd.c Fri Jun 3 05:01:35 2016 (r301236) > @@ -422,7 +422,7 @@ hex_dump_to_buffer(const void *buf, size > } > } > > - if (j > linebuflen - 1) > + if (j > linebuflen - 4) > break; > > sprintf(linebuf + j, "%02X", c); > From owner-svn-src-head@freebsd.org Fri Jun 3 05:27:36 2016 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 32C22B68606; Fri, 3 Jun 2016 05:27:36 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 0E52D179C; Fri, 3 Jun 2016 05:27:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u535RZGi046360; Fri, 3 Jun 2016 05:27:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u535RYUq046355; Fri, 3 Jun 2016 05:27:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606030527.u535RYUq046355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 3 Jun 2016 05:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301237 - head/sys/dev/sfxge/common 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.22 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, 03 Jun 2016 05:27:36 -0000 Author: arybchik Date: Fri Jun 3 05:27:34 2016 New Revision: 301237 URL: https://svnweb.freebsd.org/changeset/base/301237 Log: sfxge(4): support EVQ timer workaround via MCDI Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/6675 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Jun 3 05:01:35 2016 (r301236) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Jun 3 05:27:34 2016 (r301237) @@ -87,6 +87,52 @@ ef10_ev_mcdi( static __checkReturn efx_rc_t +efx_mcdi_set_evq_tmr( + __in efx_nic_t *enp, + __in uint32_t instance, + __in uint32_t mode, + __in uint32_t timer_ns) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_SET_EVQ_TMR_IN_LEN, + MC_CMD_SET_EVQ_TMR_OUT_LEN)]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SET_EVQ_TMR; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_SET_EVQ_TMR_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_SET_EVQ_TMR_OUT_LEN; + + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_INSTANCE, instance); + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS, timer_ns); + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS, timer_ns); + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_TMR_MODE, mode); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_SET_EVQ_TMR_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t efx_mcdi_init_evq( __in efx_nic_t *enp, __in unsigned int instance, @@ -437,9 +483,19 @@ ef10_ev_qmoderate( efx_nic_t *enp = eep->ee_enp; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_dword_t dword; - uint32_t timer_val, mode; + uint32_t timer_ns, timer_val, mode; efx_rc_t rc; + /* Check that hardware and MCDI use the same timer MODE values */ + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_DIS == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_DIS); + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_IMMED_START == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_IMMED_START); + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_TRIG_START == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_TRIG_START); + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_INT_HLDOFF == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_INT_HLDOFF); + if (us > encp->enc_evq_timer_max_us) { rc = EINVAL; goto fail1; @@ -447,37 +503,46 @@ ef10_ev_qmoderate( /* If the value is zero then disable the timer */ if (us == 0) { - timer_val = 0; + timer_ns = 0; mode = FFE_CZ_TIMER_MODE_DIS; } else { + timer_ns = us * 1000u; + mode = FFE_CZ_TIMER_MODE_INT_HLDOFF; + } + + if (encp->enc_bug61265_workaround) { + rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, timer_ns); + if (rc != 0) + goto fail2; + } else { /* Calculate the timer value in quanta */ - timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; + timer_val = timer_ns / encp->enc_evq_timer_quantum_ns; /* Moderation value is base 0 so we need to deduct 1 */ if (timer_val > 0) timer_val--; - mode = FFE_CZ_TIMER_MODE_INT_HLDOFF; - } - - if (encp->enc_bug35388_workaround) { - EFX_POPULATE_DWORD_3(dword, - ERF_DD_EVQ_IND_TIMER_FLAGS, - EFE_DD_EVQ_IND_TIMER_FLAGS, - ERF_DD_EVQ_IND_TIMER_MODE, mode, - ERF_DD_EVQ_IND_TIMER_VAL, timer_val); - EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, - eep->ee_index, &dword, 0); - } else { - EFX_POPULATE_DWORD_2(dword, - ERF_DZ_TC_TIMER_MODE, mode, - ERF_DZ_TC_TIMER_VAL, timer_val); - EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, - eep->ee_index, &dword, 0); + if (encp->enc_bug35388_workaround) { + EFX_POPULATE_DWORD_3(dword, + ERF_DD_EVQ_IND_TIMER_FLAGS, + EFE_DD_EVQ_IND_TIMER_FLAGS, + ERF_DD_EVQ_IND_TIMER_MODE, mode, + ERF_DD_EVQ_IND_TIMER_VAL, timer_val); + EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, + eep->ee_index, &dword, 0); + } else { + EFX_POPULATE_DWORD_2(dword, + ERF_DZ_TC_TIMER_MODE, mode, + ERF_DZ_TC_TIMER_VAL, timer_val); + EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, + eep->ee_index, &dword, 0); + } } return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Jun 3 05:01:35 2016 (r301236) +++ head/sys/dev/sfxge/common/efx.h Fri Jun 3 05:27:34 2016 (r301237) @@ -1129,6 +1129,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_bug26807_workaround; boolean_t enc_bug35388_workaround; boolean_t enc_bug41750_workaround; + boolean_t enc_bug61265_workaround; boolean_t enc_rx_batching_enabled; /* Maximum number of descriptors completed in an rx event. */ uint32_t enc_rx_batch_max; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Jun 3 05:01:35 2016 (r301236) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Jun 3 05:27:34 2016 (r301237) @@ -291,6 +291,8 @@ hunt_board_cfg( FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; } + encp->enc_bug61265_workaround = B_FALSE; /* Medford only */ + /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) goto fail12; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Jun 3 05:01:35 2016 (r301236) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Jun 3 05:27:34 2016 (r301237) @@ -227,6 +227,23 @@ medford_board_cfg( epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; + /* + * Enable firmware workarounds for hardware errata. + * Expected responses are: + * - 0 (zero): + * Success: workaround enabled or disabled as requested. + * - MC_CMD_ERR_ENOSYS (reported as ENOTSUP): + * Firmware does not support the MC_CMD_WORKAROUND request. + * (assume that the workaround is not supported). + * - MC_CMD_ERR_ENOENT (reported as ENOENT): + * Firmware does not support the requested workaround. + * - MC_CMD_ERR_EPERM (reported as EACCES): + * Unprivileged function cannot enable/disable workarounds. + * + * See efx_mcdi_request_errcode() for MCDI error translations. + */ + + if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* * Interrupt testing does not work for VFs. See bug50084. @@ -238,9 +255,23 @@ medford_board_cfg( /* Chained multicast is always enabled on Medford */ encp->enc_bug26807_workaround = B_TRUE; + /* + * If the bug61265 workaround is enabled, then interrupt holdoff timers + * cannot be controlled by timer table writes, so MCDI must be used + * (timer table writes can still be used for wakeup timers). + */ + rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG61265, B_TRUE, + NULL); + if ((rc == 0) || (rc == EACCES)) + encp->enc_bug61265_workaround = B_TRUE; + else if ((rc == ENOTSUP) || (rc == ENOENT)) + encp->enc_bug61265_workaround = B_FALSE; + else + goto fail8; + /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail8; + goto fail9; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -252,14 +283,14 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail9; + goto fail10; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) - goto fail10; + goto fail11; encp->enc_rx_buf_align_end = end_padding; /* Alignment for WPTR updates */ @@ -288,13 +319,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail11; + goto fail12; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail12; + goto fail13; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -317,12 +348,14 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail13; + goto fail14; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); +fail14: + EFSYS_PROBE(fail14); fail13: EFSYS_PROBE(fail13); fail12: From owner-svn-src-head@freebsd.org Fri Jun 3 06:15:53 2016 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 6A0DEB68F0F; Fri, 3 Jun 2016 06:15:53 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id 3B19B1D31; Fri, 3 Jun 2016 06:15:53 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u536FqQQ064672; Fri, 3 Jun 2016 06:15:52 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u536FqZw064670; Fri, 3 Jun 2016 06:15:52 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606030615.u536FqZw064670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 3 Jun 2016 06:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301240 - in head: tools/build/mk usr.sbin/blacklistd 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.22 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, 03 Jun 2016 06:15:53 -0000 Author: lidl Date: Fri Jun 3 06:15:52 2016 New Revision: 301240 URL: https://svnweb.freebsd.org/changeset/base/301240 Log: Add blacklistd.conf manpage Install the blacklistd.conf man page, missed in the original commit. Submitted by: Herbert J. Skuhra ( herbert at mailbox.org ) Reviewed by: rpaulo Approved by: rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6702 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/blacklistd/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 3 06:01:32 2016 (r301239) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 3 06:15:52 2016 (r301240) @@ -449,6 +449,7 @@ OLD_FILES+=usr/share/man/man3/blacklist_ OLD_FILES+=usr/share/man/man3/blacklist_sa_r.3.gz OLD_FILES+=usr/share/man/man8/blacklistctl.8.gz OLD_FILES+=usr/share/man/man8/blacklistd.8.gz +OLD_FILES+=usr/share/man/man8/blacklistd.conf.5.gz .endif .if ${MK_BLUETOOTH} == no Modified: head/usr.sbin/blacklistd/Makefile ============================================================================== --- head/usr.sbin/blacklistd/Makefile Fri Jun 3 06:01:32 2016 (r301239) +++ head/usr.sbin/blacklistd/Makefile Fri Jun 3 06:15:52 2016 (r301240) @@ -6,7 +6,7 @@ BLACKLIST_DIR=${SRCTOP}/contrib/blacklis PROG= blacklistd SRCS= blacklistd.c conf.c run.c state.c support.c internal.c \ sockaddr_snprintf.c pidfile.c strtoi.c popenve.c -MAN= blacklistd.8 +MAN= blacklistd.8 blacklistd.conf.5 LDFLAGS+=-L${LIBBLACKLISTDIR} LIBADD+= blacklist util From owner-svn-src-head@freebsd.org Fri Jun 3 06:24:04 2016 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 935CEB6808F; Fri, 3 Jun 2016 06:24:04 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id 6EAC71234; Fri, 3 Jun 2016 06:24:04 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u536O3jJ068425; Fri, 3 Jun 2016 06:24:03 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u536O3SS068421; Fri, 3 Jun 2016 06:24:03 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606030624.u536O3SS068421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 3 Jun 2016 06:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301241 - head/libexec/ftpd 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.22 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, 03 Jun 2016 06:24:04 -0000 Author: lidl Date: Fri Jun 3 06:24:03 2016 New Revision: 301241 URL: https://svnweb.freebsd.org/changeset/base/301241 Log: Add blacklist support to ftpd Reviewed by: rpaulo Approved by: rpaulo Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6703 Added: head/libexec/ftpd/blacklist.c (contents, props changed) head/libexec/ftpd/blacklist_client.h (contents, props changed) Modified: head/libexec/ftpd/Makefile head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/Makefile ============================================================================== --- head/libexec/ftpd/Makefile Fri Jun 3 06:15:52 2016 (r301240) +++ head/libexec/ftpd/Makefile Fri Jun 3 06:24:03 2016 (r301241) @@ -24,6 +24,13 @@ SRCS+= ls.c cmp.c print.c util.c CFLAGS+=-Dmain=ls_main -I${.CURDIR}/${LSDIR} LIBADD+= m +.if ${MK_BLACKLIST_SUPPORT} != "no" +CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include +SRCS+= blacklist.c +LIBADD+= blacklist +LDFLAGS+=-L${LIBBLACKLISTDIR} +.endif + .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 .endif Added: head/libexec/ftpd/blacklist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/ftpd/blacklist.c Fri Jun 3 06:24:03 2016 (r301241) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Kurt Lidl under sponsorship from the + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ + +/* $FreeBSD$ */ + +#include +#include +#include +#include + +#include "blacklist_client.h" +#include + +static struct blacklist *blstate; + +void +blacklist_init(void) +{ + blstate = blacklist_open(); +} + +void +blacklist_notify(int action, int fd, char *msg) +{ + if (blstate == NULL) + blacklist_init(); + if (blstate == NULL) + return; + (void)blacklist_r(blstate, action, fd, msg); +} Added: head/libexec/ftpd/blacklist_client.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/ftpd/blacklist_client.h Fri Jun 3 06:24:03 2016 (r301241) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Kurt Lidl under sponsorship from the + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ + +/* $FreeBSD$ */ + +void blacklist_notify(int, int, char *); +void blacklist_init(void); Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Fri Jun 3 06:15:52 2016 (r301240) +++ head/libexec/ftpd/ftpd.c Fri Jun 3 06:24:03 2016 (r301241) @@ -93,6 +93,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif + #include "pathnames.h" #include "extern.h" @@ -640,6 +644,9 @@ gotchild: reply(220, "%s FTP server (%s) ready.", hostname, version); else reply(220, "FTP server ready."); +#ifdef USE_BLACKLIST + blacklist_init(); +#endif for (;;) (void) yyparse(); /* NOTREACHED */ @@ -1415,6 +1422,9 @@ skip: */ if (rval) { reply(530, "Login incorrect."); +#ifdef USE_BLACKLIST + blacklist_notify(1, 0, "Login incorrect"); +#endif if (logging) { syslog(LOG_NOTICE, "FTP LOGIN FAILED FROM %s", @@ -1432,6 +1442,11 @@ skip: } return; } +#ifdef USE_BLACKLIST + else { + blacklist_notify(0, 0, "Login successful"); + } +#endif } login_attempts = 0; /* this time successful */ if (setegid(pw->pw_gid) < 0) { From owner-svn-src-head@freebsd.org Fri Jun 3 06:51:21 2016 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 B093CB685EB for ; Fri, 3 Jun 2016 06:51:21 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718AB1154 for ; Fri, 3 Jun 2016 06:51:20 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 5167 invoked by uid 89); 3 Jun 2016 06:51:19 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 3 Jun 2016 06:51:19 -0000 Received: (qmail 4286 invoked by uid 89); 3 Jun 2016 06:51:02 -0000 Received: by simscan 1.3.1 ppid: 4276, pid: 4282, t: 0.0047s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 3 Jun 2016 06:51:02 -0000 Received: (qmail 19082 invoked by uid 89); 3 Jun 2016 06:51:02 -0000 Received: by simscan 1.4.0 ppid: 19028, pid: 19039, t: 19.0786s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 3 Jun 2016 06:50:42 -0000 From: Jan Beich To: Kurt Lidl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301172 - head/contrib/blacklist In-Reply-To: <201606012204.u51M4AUj056457@repo.freebsd.org> (Kurt Lidl's message of "Wed, 1 Jun 2016 22:04:10 +0000 (UTC)") References: <201606012204.u51M4AUj056457@repo.freebsd.org> Date: Fri, 03 Jun 2016 08:50:34 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 06:51:21 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Kurt Lidl writes: > Author: lidl > Date: Wed Jun 1 22:04:10 2016 > New Revision: 301172 > URL: https://svnweb.freebsd.org/changeset/base/301172 > > Log: > Import NetBSD's blacklist source from vendor tree >=20=20=20 > This import includes The basic blacklist library and utility programs, > to add a system-wide packet filtering notification mechanism to > FreeBSD. >=20=20=20 > The rational behind the daemon was given by Christos Zoulas in a > presentation at vBSDcon 2015: https://youtu.be/fuuf8G28mjs >=20=20=20 > Reviewed by: rpaulo > Approved by: rpaulo > Obtained from: NetBSD > Relnotes: YES Can you track FreeBSD version in manpages? Maybe ping upstream, so they add .Fx as well. $ fgrep .Nx contrib/blacklist/**/*.[0-9] contrib/blacklist/bin/blacklistctl.8:.Nx 7 . contrib/blacklist/bin/blacklistd.8:.Nx 7 . contrib/blacklist/bin/blacklistd.conf.5:.Nx 7 . $ man blacklistd | col -b | fgrep -A1 HISTORY HISTORY blacklistd appeared in NetBSD 7. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJXUSi6XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bemYH/071bfXNu9a8kKiZIAhzorxW 1zNUFsiKJ7IcBGnHgJHfYK0z9eFp7rtZ+gI12LGvmKE4zQlXIbP2PcV7fg7VR7to 31FTHJ/gITtbbagoK1A8v1jV8QMVhHX5bakDKQRRQbL3fLc7ypr46HfmMMl1jvdv s8Q1czsw64mjenli2VHCTR+HXS3WGFQhlYWzVB4olg4m+BY8cXKcm0EibIduy5ix o+MVfo5yRlYKkk/QjGixB3OqFoOmH+C0dh8zOec0LQeIFEfKDLTOCdfQlmEAL/Pj 8Og5e10vLKfHTU67xgV0eOvvk24e+Gy7qESeCB/Jij5J2AkTra3WepIkchpMnas= =mqdV -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Fri Jun 3 06:58:21 2016 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 7557FB687D2; Fri, 3 Jun 2016 06:58:21 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id 3FC821662; Fri, 3 Jun 2016 06:58:21 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u536wKx2079937; Fri, 3 Jun 2016 06:58:20 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u536wKs3079935; Fri, 3 Jun 2016 06:58:20 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606030658.u536wKs3079935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 3 Jun 2016 06:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301242 - head/libexec/rshd 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.22 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, 03 Jun 2016 06:58:21 -0000 Author: lidl Date: Fri Jun 3 06:58:20 2016 New Revision: 301242 URL: https://svnweb.freebsd.org/changeset/base/301242 Log: Add blacklist support to rshd Reviewed by: rpaulo Approved by: rpaulo Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6594 Modified: head/libexec/rshd/Makefile head/libexec/rshd/rshd.c Modified: head/libexec/rshd/Makefile ============================================================================== --- head/libexec/rshd/Makefile Fri Jun 3 06:24:03 2016 (r301241) +++ head/libexec/rshd/Makefile Fri Jun 3 06:58:20 2016 (r301242) @@ -2,6 +2,9 @@ # $FreeBSD$ PACKAGE=rcmds + +.include + PROG= rshd MAN= rshd.8 @@ -12,4 +15,10 @@ WFORMAT=0 LIBADD= util pam +.if ${MK_BLACKLIST_SUPPORT} != "no" +CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include +LIBADD+= blacklist +LDFLAGS+=-L${LIBBLACKLISTDIR} +.endif + .include Modified: head/libexec/rshd/rshd.c ============================================================================== --- head/libexec/rshd/rshd.c Fri Jun 3 06:24:03 2016 (r301241) +++ head/libexec/rshd/rshd.c Fri Jun 3 06:58:20 2016 (r301242) @@ -88,6 +88,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef USE_BLACKLIST +#include +#endif + static struct pam_conv pamc = { openpam_nullconv, NULL }; static pam_handle_t *pamh; static int pam_err; @@ -252,6 +256,9 @@ doit(struct sockaddr *fromp) "connection from %s on illegal port %u", numericname, srcport); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "illegal port"); +#endif exit(1); } @@ -285,6 +292,9 @@ doit(struct sockaddr *fromp) "2nd socket from %s on unreserved port %u", numericname, port); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "unreserved port"); +#endif exit(1); } *((in_port_t *)&fromp->sa_data) = htons(port); @@ -309,6 +319,9 @@ doit(struct sockaddr *fromp) if (pam_err != PAM_SUCCESS) { syslog(LOG_ERR|LOG_AUTH, "pam_start(): %s", pam_strerror(pamh, pam_err)); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "login incorrect"); +#endif rshd_errx(1, "Login incorrect."); } @@ -316,6 +329,9 @@ doit(struct sockaddr *fromp) (pam_err = pam_set_item(pamh, PAM_RHOST, rhost)) != PAM_SUCCESS) { syslog(LOG_ERR|LOG_AUTH, "pam_set_item(): %s", pam_strerror(pamh, pam_err)); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "login incorrect"); +#endif rshd_errx(1, "Login incorrect."); } @@ -332,6 +348,9 @@ doit(struct sockaddr *fromp) syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: permission denied (%s). cmd='%.80s'", ruser, rhost, luser, pam_strerror(pamh, pam_err), cmdbuf); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "permission denied"); +#endif rshd_errx(1, "Login incorrect."); } @@ -341,6 +360,9 @@ doit(struct sockaddr *fromp) syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: unknown login. cmd='%.80s'", ruser, rhost, luser, cmdbuf); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "unknown login"); +#endif if (errorstr == NULL) errorstr = "Login incorrect."; rshd_errx(1, errorstr, rhost); @@ -373,6 +395,9 @@ doit(struct sockaddr *fromp) "%s@%s as %s: permission denied (%s). cmd='%.80s'", ruser, rhost, luser, __rcmd_errstr, cmdbuf); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "permission denied"); +#endif rshd_errx(1, "Login incorrect."); } if (!auth_timeok(lc, time(NULL))) @@ -468,6 +493,9 @@ doit(struct sockaddr *fromp) } } +#ifdef USE_BLACKLIST + blacklist(0, STDIN_FILENO, "success"); +#endif for (fd = getdtablesize(); fd > 2; fd--) (void) close(fd); if (setsid() == -1) @@ -534,8 +562,12 @@ getstr(char *buf, int cnt, const char *e if (read(STDIN_FILENO, &c, 1) != 1) exit(1); *buf++ = c; - if (--cnt == 0) + if (--cnt == 0) { +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "buffer overflow"); +#endif rshd_errx(1, "%s too long", error); + } } while (c != 0); } From owner-svn-src-head@freebsd.org Fri Jun 3 07:00:30 2016 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 2B3E2B68848; Fri, 3 Jun 2016 07:00:30 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id D23D41813; Fri, 3 Jun 2016 07:00:29 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5370SOW080094; Fri, 3 Jun 2016 07:00:28 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5370Scm080092; Fri, 3 Jun 2016 07:00:28 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606030700.u5370Scm080092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 3 Jun 2016 07:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301243 - head/libexec/fingerd 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.22 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, 03 Jun 2016 07:00:30 -0000 Author: lidl Date: Fri Jun 3 07:00:28 2016 New Revision: 301243 URL: https://svnweb.freebsd.org/changeset/base/301243 Log: Add blacklist support to fingerd Reviewed by: rpaulo Approved by: rpaulo Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5916 Modified: head/libexec/fingerd/Makefile head/libexec/fingerd/fingerd.c Modified: head/libexec/fingerd/Makefile ============================================================================== --- head/libexec/fingerd/Makefile Fri Jun 3 06:58:20 2016 (r301242) +++ head/libexec/fingerd/Makefile Fri Jun 3 07:00:28 2016 (r301243) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ +.include + PROG= fingerd LIBADD= util MAN= fingerd.8 @@ -8,4 +10,10 @@ MAN= fingerd.8 WARNS?= 2 WFORMAT=0 +.if ${MK_BLACKLIST_SUPPORT} != "no" +CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include +LIBADD+= blacklist +LDFLAGS+=-L${LIBBLACKLISTDIR} +.endif + .include Modified: head/libexec/fingerd/fingerd.c ============================================================================== --- head/libexec/fingerd/fingerd.c Fri Jun 3 06:58:20 2016 (r301242) +++ head/libexec/fingerd/fingerd.c Fri Jun 3 07:00:28 2016 (r301243) @@ -57,6 +57,9 @@ static const char rcsid[] = #include #include #include "pathnames.h" +#ifdef USE_BLACKLIST +#include +#endif void logerr(const char *, ...) __printflike(1, 2) __dead2; @@ -153,12 +156,18 @@ main(int argc, char *argv[]) *ap = strtok(lp, " \t\r\n"); if (!*ap) { if (secure && ap == &av[4]) { +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "nousername"); +#endif puts("must provide username\r\n"); exit(1); } break; } if (secure && strchr(*ap, '@')) { +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "noforwarding"); +#endif puts("forwarding service denied\r\n"); exit(1); } @@ -197,6 +206,9 @@ main(int argc, char *argv[]) } dup2(STDOUT_FILENO, STDERR_FILENO); +#ifdef USE_BLACKLIST + blacklist(0, STDIN_FILENO, "success"); +#endif execv(prog, comp); write(STDERR_FILENO, prog, strlen(prog)); #define MSG ": cannot execute\n" From owner-svn-src-head@freebsd.org Fri Jun 3 07:24:43 2016 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 2506BB68CFD; Fri, 3 Jun 2016 07:24:43 +0000 (UTC) (envelope-from tuexen@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 mx1.freebsd.org (Postfix) with ESMTPS id EB21E1759; Fri, 3 Jun 2016 07:24:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u537Ogoi091138; Fri, 3 Jun 2016 07:24:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u537OgmD091137; Fri, 3 Jun 2016 07:24:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606030724.u537OgmD091137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 3 Jun 2016 07:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301244 - head/sys/netinet 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.22 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, 03 Jun 2016 07:24:43 -0000 Author: tuexen Date: Fri Jun 3 07:24:41 2016 New Revision: 301244 URL: https://svnweb.freebsd.org/changeset/base/301244 Log: Store the peers vtag in host byte order in the cookie, since all consumers expect it that way. This fixes the vtag when sending en ERROR chunk. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Jun 3 07:00:28 2016 (r301243) +++ head/sys/netinet/sctp_output.c Fri Jun 3 07:24:41 2016 (r301244) @@ -5828,7 +5828,7 @@ do_a_abort: /* Now lets put the SCTP header in place */ initack = mtod(m, struct sctp_init_ack_chunk *); /* Save it off for quick ref */ - stc.peers_vtag = init_chk->init.initiate_tag; + stc.peers_vtag = ntohl(init_chk->init.initiate_tag); /* who are we */ memcpy(stc.identification, SCTP_VERSION_STRING, min(strlen(SCTP_VERSION_STRING), sizeof(stc.identification))); From owner-svn-src-head@freebsd.org Fri Jun 3 07:43:05 2016 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 6AB33B68224; Fri, 3 Jun 2016 07:43:05 +0000 (UTC) (envelope-from tuexen@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 mx1.freebsd.org (Postfix) with ESMTPS id 3CF351208; Fri, 3 Jun 2016 07:43:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u537h42u098332; Fri, 3 Jun 2016 07:43:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u537h4l0098331; Fri, 3 Jun 2016 07:43:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606030743.u537h4l0098331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 3 Jun 2016 07:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301246 - head/sys/netinet 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.22 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, 03 Jun 2016 07:43:05 -0000 Author: tuexen Date: Fri Jun 3 07:43:04 2016 New Revision: 301246 URL: https://svnweb.freebsd.org/changeset/base/301246 Log: Get struct sctp_net_route in-sync with struct route again. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Fri Jun 3 07:34:59 2016 (r301245) +++ head/sys/netinet/sctp_structs.h Fri Jun 3 07:43:04 2016 (r301246) @@ -189,6 +189,7 @@ struct iterator_control { struct sctp_net_route { sctp_rtentry_t *ro_rt; + struct llentry *ro_lle; char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; From owner-svn-src-head@freebsd.org Fri Jun 3 08:00:24 2016 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 814A7B685FA; Fri, 3 Jun 2016 08:00:24 +0000 (UTC) (envelope-from delphij@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 mx1.freebsd.org (Postfix) with ESMTPS id 1F66918DB; Fri, 3 Jun 2016 08:00:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5380N1H002328; Fri, 3 Jun 2016 08:00:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5380Mgb002323; Fri, 3 Jun 2016 08:00:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201606030800.u5380Mgb002323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 3 Jun 2016 08:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301247 - in head: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/ntpd contrib/ntp/ntpdc contrib/ntp/ntpq contrib/ntp/ntpsnmpd contrib/ntp/scripts contrib/ntp/scripts/buil... 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.22 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, 03 Jun 2016 08:00:24 -0000 Author: delphij Date: Fri Jun 3 08:00:22 2016 New Revision: 301247 URL: https://svnweb.freebsd.org/changeset/base/301247 Log: MFV r301238: ntp 4.2.8p8. Security: CVE-2016-4957, CVE-2016-4953, CVE-2016-4954 Security: CVE-2016-4955, CVE-2016-4956 Security: FreeBSD-SA-16:24.ntp With hat: so Added: head/contrib/ntp/scripts/build/genAuthors.in - copied unchanged from r301238, vendor/ntp/dist/scripts/build/genAuthors.in head/contrib/ntp/sntp/m4/sntp_problemtests.m4 - copied unchanged from r301238, vendor/ntp/dist/sntp/m4/sntp_problemtests.m4 Modified: head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/NEWS head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/html/miscopt.html head/contrib/ntp/include/ntp.h head/contrib/ntp/ntpd/complete.conf.in head/contrib/ntp/ntpd/invoke-ntp.conf.texi head/contrib/ntp/ntpd/invoke-ntp.keys.texi head/contrib/ntp/ntpd/invoke-ntpd.texi head/contrib/ntp/ntpd/keyword-gen-utd head/contrib/ntp/ntpd/keyword-gen.c head/contrib/ntp/ntpd/ntp.conf.5man head/contrib/ntp/ntpd/ntp.conf.5mdoc head/contrib/ntp/ntpd/ntp.conf.def head/contrib/ntp/ntpd/ntp.conf.html head/contrib/ntp/ntpd/ntp.conf.man.in head/contrib/ntp/ntpd/ntp.conf.mdoc.in head/contrib/ntp/ntpd/ntp.keys.5man head/contrib/ntp/ntpd/ntp.keys.5mdoc head/contrib/ntp/ntpd/ntp.keys.html head/contrib/ntp/ntpd/ntp.keys.man.in head/contrib/ntp/ntpd/ntp.keys.mdoc.in head/contrib/ntp/ntpd/ntp_config.c head/contrib/ntp/ntpd/ntp_io.c head/contrib/ntp/ntpd/ntp_keyword.h head/contrib/ntp/ntpd/ntp_parser.c head/contrib/ntp/ntpd/ntp_parser.h head/contrib/ntp/ntpd/ntp_proto.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd.1ntpdman head/contrib/ntp/ntpd/ntpd.1ntpdmdoc head/contrib/ntp/ntpd/ntpd.html head/contrib/ntp/ntpd/ntpd.man.in head/contrib/ntp/ntpd/ntpd.mdoc.in head/contrib/ntp/ntpd/refclock_parse.c head/contrib/ntp/ntpdc/invoke-ntpdc.texi head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc.1ntpdcman head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc head/contrib/ntp/ntpdc/ntpdc.c head/contrib/ntp/ntpdc/ntpdc.html head/contrib/ntp/ntpdc/ntpdc.man.in head/contrib/ntp/ntpdc/ntpdc.mdoc.in head/contrib/ntp/ntpq/invoke-ntpq.texi head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq.1ntpqman head/contrib/ntp/ntpq/ntpq.1ntpqmdoc head/contrib/ntp/ntpq/ntpq.c head/contrib/ntp/ntpq/ntpq.html head/contrib/ntp/ntpq/ntpq.man.in head/contrib/ntp/ntpq/ntpq.mdoc.in head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc head/contrib/ntp/ntpsnmpd/ntpsnmpd.html head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in head/contrib/ntp/packageinfo.sh head/contrib/ntp/scripts/build/Makefile.am head/contrib/ntp/scripts/build/Makefile.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi head/contrib/ntp/scripts/invoke-plot_summary.texi head/contrib/ntp/scripts/invoke-summary.texi head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc head/contrib/ntp/scripts/ntp-wait/ntp-wait.html head/contrib/ntp/scripts/ntp-wait/ntp-wait.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi head/contrib/ntp/scripts/ntpsweep/ntpsweep-opts head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc head/contrib/ntp/scripts/ntpsweep/ntpsweep.html head/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in head/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in head/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi head/contrib/ntp/scripts/ntptrace/ntptrace-opts head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc head/contrib/ntp/scripts/ntptrace/ntptrace.html head/contrib/ntp/scripts/ntptrace/ntptrace.man.in head/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in head/contrib/ntp/scripts/plot_summary-opts head/contrib/ntp/scripts/plot_summary-opts.def head/contrib/ntp/scripts/plot_summary.1plot_summaryman head/contrib/ntp/scripts/plot_summary.1plot_summarymdoc head/contrib/ntp/scripts/plot_summary.html head/contrib/ntp/scripts/plot_summary.man.in head/contrib/ntp/scripts/plot_summary.mdoc.in head/contrib/ntp/scripts/summary-opts head/contrib/ntp/scripts/summary.1summaryman head/contrib/ntp/scripts/summary.1summarymdoc head/contrib/ntp/scripts/summary.html head/contrib/ntp/scripts/summary.man.in head/contrib/ntp/scripts/summary.mdoc.in head/contrib/ntp/scripts/update-leap/invoke-update-leap.texi head/contrib/ntp/scripts/update-leap/update-leap-opts head/contrib/ntp/scripts/update-leap/update-leap.1update-leapman head/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc head/contrib/ntp/scripts/update-leap/update-leap.html head/contrib/ntp/scripts/update-leap/update-leap.man.in head/contrib/ntp/scripts/update-leap/update-leap.mdoc.in head/contrib/ntp/sntp/Makefile.in head/contrib/ntp/sntp/aclocal.m4 head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/configure.ac head/contrib/ntp/sntp/include/Makefile.in head/contrib/ntp/sntp/include/version.def head/contrib/ntp/sntp/include/version.texi head/contrib/ntp/sntp/invoke-sntp.texi head/contrib/ntp/sntp/libopts/Makefile.in head/contrib/ntp/sntp/m4/ntp_problemtests.m4 head/contrib/ntp/sntp/m4/version.m4 head/contrib/ntp/sntp/scripts/Makefile.in head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp.1sntpman head/contrib/ntp/sntp/sntp.1sntpmdoc head/contrib/ntp/sntp/sntp.html head/contrib/ntp/sntp/sntp.man.in head/contrib/ntp/sntp/sntp.mdoc.in head/contrib/ntp/sntp/tests/Makefile.am head/contrib/ntp/sntp/tests/Makefile.in head/contrib/ntp/sntp/unity/Makefile.in head/contrib/ntp/sntp/version.c head/contrib/ntp/util/invoke-ntp-keygen.texi head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen.1ntp-keygenman head/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc head/contrib/ntp/util/ntp-keygen.html head/contrib/ntp/util/ntp-keygen.man.in head/contrib/ntp/util/ntp-keygen.mdoc.in head/usr.sbin/ntp/config.h head/usr.sbin/ntp/doc/ntp-keygen.8 head/usr.sbin/ntp/doc/ntp.conf.5 head/usr.sbin/ntp/doc/ntp.keys.5 head/usr.sbin/ntp/doc/ntpd.8 head/usr.sbin/ntp/doc/ntpdc.8 head/usr.sbin/ntp/doc/ntpq.8 head/usr.sbin/ntp/doc/sntp.8 head/usr.sbin/ntp/scripts/mkver Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Fri Jun 3 07:43:04 2016 (r301246) +++ head/contrib/ntp/ChangeLog Fri Jun 3 08:00:22 2016 (r301247) @@ -1,4 +1,26 @@ --- +(4.2.8p8) 2016/06/02 Released by Harlan Stenn + +* [Sec 3042] Broadcast Interleave. HStenn. +* [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + - validate origin timestamps on bad MACs, too. stenn@ntp.org +* [Sec 3044] Spoofed server packets are partially processed. HStenn. +* [Sec 3045] Bad authentication demobilizes ephemeral associations. JPerlinger. +* [Sec 3046] CRYPTO_NAK crash. stenn@ntp.org +* [Bug 3038] NTP fails to build in VS2015. perlinger@ntp.org + - provide build environment + - 'wint_t' and 'struct timespec' defined by VS2015 + - fixed print()/scanf() format issues +* [Bug 3052] Add a .gitignore file. Edmund Wong. +* [Bug 3054] miscopt.html documents the allan intercept in seconds. SWhite. +* [Bug 3058] fetch_timestamp() mishandles 64-bit alignment. Brian Utterback, + JPerlinger, HStenn. +* Update the NEWS file for 4.2.8p8. HStenn. +* Fix typo in ntp-wait and plot_summary. HStenn. +* Make sure we have an "author" file for git imports. HStenn. +* Update the sntp problem tests for MacOS. HStenn. + +--- (4.2.8p7) 2016/04/26 Released by Harlan Stenn * [Sec 2901] KoD packets must have non-zero transmit timestamps. HStenn. Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Fri Jun 3 07:43:04 2016 (r301246) +++ head/contrib/ntp/CommitLog Fri Jun 3 08:00:22 2016 (r301247) @@ -1,3 +1,774 @@ +ChangeSet@1.3686, 2016-06-02 07:40:06-04:00, stenn@deacon.udel.edu + NTP_4_2_8P8 + TAG: NTP_4_2_8P8 + + ChangeLog@1.1834 +1 -0 + NTP_4_2_8P8 + + ntpd/invoke-ntp.conf.texi@1.200 +1 -1 + NTP_4_2_8P8 + + ntpd/invoke-ntp.keys.texi@1.190 +1 -1 + NTP_4_2_8P8 + + ntpd/invoke-ntpd.texi@1.506 +2 -2 + NTP_4_2_8P8 + + ntpd/ntp.conf.5man@1.234 +3 -3 + NTP_4_2_8P8 + + ntpd/ntp.conf.5mdoc@1.234 +2 -2 + NTP_4_2_8P8 + + ntpd/ntp.conf.html@1.185 +55 -19 + NTP_4_2_8P8 + + ntpd/ntp.conf.man.in@1.234 +3 -3 + NTP_4_2_8P8 + + ntpd/ntp.conf.mdoc.in@1.234 +2 -2 + NTP_4_2_8P8 + + ntpd/ntp.keys.5man@1.224 +2 -2 + NTP_4_2_8P8 + + ntpd/ntp.keys.5mdoc@1.224 +2 -2 + NTP_4_2_8P8 + + ntpd/ntp.keys.html@1.186 +1 -1 + NTP_4_2_8P8 + + ntpd/ntp.keys.man.in@1.224 +2 -2 + NTP_4_2_8P8 + + ntpd/ntp.keys.mdoc.in@1.224 +2 -2 + NTP_4_2_8P8 + + ntpd/ntpd-opts.c@1.528 +7 -7 + NTP_4_2_8P8 + + ntpd/ntpd-opts.h@1.527 +3 -3 + NTP_4_2_8P8 + + ntpd/ntpd.1ntpdman@1.335 +3 -3 + NTP_4_2_8P8 + + ntpd/ntpd.1ntpdmdoc@1.335 +2 -2 + NTP_4_2_8P8 + + ntpd/ntpd.html@1.179 +2 -2 + NTP_4_2_8P8 + + ntpd/ntpd.man.in@1.335 +3 -3 + NTP_4_2_8P8 + + ntpd/ntpd.mdoc.in@1.335 +2 -2 + NTP_4_2_8P8 + + ntpdc/invoke-ntpdc.texi@1.503 +2 -2 + NTP_4_2_8P8 + + ntpdc/ntpdc-opts.c@1.521 +7 -7 + NTP_4_2_8P8 + + ntpdc/ntpdc-opts.h@1.520 +3 -3 + NTP_4_2_8P8 + + ntpdc/ntpdc.1ntpdcman@1.334 +3 -3 + NTP_4_2_8P8 + + ntpdc/ntpdc.1ntpdcmdoc@1.334 +2 -2 + NTP_4_2_8P8 + + ntpdc/ntpdc.html@1.347 +2 -2 + NTP_4_2_8P8 + + ntpdc/ntpdc.man.in@1.334 +3 -3 + NTP_4_2_8P8 + + ntpdc/ntpdc.mdoc.in@1.334 +2 -2 + NTP_4_2_8P8 + + ntpq/invoke-ntpq.texi@1.511 +2 -2 + NTP_4_2_8P8 + + ntpq/ntpq-opts.c@1.528 +7 -7 + NTP_4_2_8P8 + + ntpq/ntpq-opts.h@1.526 +3 -3 + NTP_4_2_8P8 + + ntpq/ntpq.1ntpqman@1.339 +3 -3 + NTP_4_2_8P8 + + ntpq/ntpq.1ntpqmdoc@1.339 +2 -2 + NTP_4_2_8P8 + + ntpq/ntpq.html@1.176 +2 -2 + NTP_4_2_8P8 + + ntpq/ntpq.man.in@1.339 +3 -3 + NTP_4_2_8P8 + + ntpq/ntpq.mdoc.in@1.339 +2 -2 + NTP_4_2_8P8 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.505 +2 -2 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd-opts.c@1.523 +7 -7 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd-opts.h@1.522 +3 -3 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.334 +3 -3 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.334 +2 -2 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd.html@1.174 +1 -1 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd.man.in@1.334 +3 -3 + NTP_4_2_8P8 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.334 +2 -2 + NTP_4_2_8P8 + + packageinfo.sh@1.528 +2 -2 + NTP_4_2_8P8 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.95 +3 -3 + NTP_4_2_8P8 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.96 +2 -2 + NTP_4_2_8P8 + + scripts/calc_tickadj/calc_tickadj.html@1.97 +1 -1 + NTP_4_2_8P8 + + scripts/calc_tickadj/calc_tickadj.man.in@1.94 +3 -3 + NTP_4_2_8P8 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.96 +2 -2 + NTP_4_2_8P8 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.99 +1 -1 + NTP_4_2_8P8 + + scripts/invoke-plot_summary.texi@1.117 +2 -2 + NTP_4_2_8P8 + + scripts/invoke-summary.texi@1.116 +2 -2 + NTP_4_2_8P8 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.326 +2 -2 + NTP_4_2_8P8 + + scripts/ntp-wait/ntp-wait-opts@1.62 +2 -2 + NTP_4_2_8P8 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.323 +3 -3 + NTP_4_2_8P8 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.324 +2 -2 + NTP_4_2_8P8 + + scripts/ntp-wait/ntp-wait.html@1.343 +2 -2 + NTP_4_2_8P8 + + scripts/ntp-wait/ntp-wait.man.in@1.323 +3 -3 + NTP_4_2_8P8 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.324 +2 -2 + NTP_4_2_8P8 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.114 +2 -2 + NTP_4_2_8P8 + + scripts/ntpsweep/ntpsweep-opts@1.64 +2 -2 + NTP_4_2_8P8 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.102 +3 -3 + NTP_4_2_8P8 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.102 +2 -2 + NTP_4_2_8P8 + + scripts/ntpsweep/ntpsweep.html@1.115 +2 -2 + NTP_4_2_8P8 + + scripts/ntpsweep/ntpsweep.man.in@1.102 +3 -3 + NTP_4_2_8P8 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.103 +2 -2 + NTP_4_2_8P8 + + scripts/ntptrace/invoke-ntptrace.texi@1.115 +2 -2 + NTP_4_2_8P8 + + scripts/ntptrace/ntptrace-opts@1.64 +2 -2 + NTP_4_2_8P8 + + scripts/ntptrace/ntptrace.1ntptraceman@1.102 +3 -3 + NTP_4_2_8P8 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.103 +2 -2 + NTP_4_2_8P8 + + scripts/ntptrace/ntptrace.html@1.116 +2 -2 + NTP_4_2_8P8 + + scripts/ntptrace/ntptrace.man.in@1.102 +3 -3 + NTP_4_2_8P8 + + scripts/ntptrace/ntptrace.mdoc.in@1.104 +2 -2 + NTP_4_2_8P8 + + scripts/plot_summary-opts@1.65 +2 -2 + NTP_4_2_8P8 + + scripts/plot_summary.1plot_summaryman@1.115 +3 -3 + NTP_4_2_8P8 + + scripts/plot_summary.1plot_summarymdoc@1.115 +2 -2 + NTP_4_2_8P8 + + scripts/plot_summary.html@1.118 +40 -58 + NTP_4_2_8P8 + + scripts/plot_summary.man.in@1.115 +3 -3 + NTP_4_2_8P8 + + scripts/plot_summary.mdoc.in@1.115 +2 -2 + NTP_4_2_8P8 + + scripts/summary-opts@1.64 +2 -2 + NTP_4_2_8P8 + + scripts/summary.1summaryman@1.114 +3 -3 + NTP_4_2_8P8 + + scripts/summary.1summarymdoc@1.114 +2 -2 + NTP_4_2_8P8 + + scripts/summary.html@1.117 +2 -2 + NTP_4_2_8P8 + + scripts/summary.man.in@1.114 +3 -3 + NTP_4_2_8P8 + + scripts/summary.mdoc.in@1.114 +2 -2 + NTP_4_2_8P8 + + scripts/update-leap/invoke-update-leap.texi@1.15 +1 -1 + NTP_4_2_8P8 + + scripts/update-leap/update-leap-opts@1.15 +2 -2 + NTP_4_2_8P8 + + scripts/update-leap/update-leap.1update-leapman@1.15 +3 -3 + NTP_4_2_8P8 + + scripts/update-leap/update-leap.1update-leapmdoc@1.15 +2 -2 + NTP_4_2_8P8 + + scripts/update-leap/update-leap.html@1.15 +1 -1 + NTP_4_2_8P8 + + scripts/update-leap/update-leap.man.in@1.15 +3 -3 + NTP_4_2_8P8 + + scripts/update-leap/update-leap.mdoc.in@1.15 +2 -2 + NTP_4_2_8P8 + + sntp/invoke-sntp.texi@1.503 +2 -2 + NTP_4_2_8P8 + + sntp/sntp-opts.c@1.522 +7 -7 + NTP_4_2_8P8 + + sntp/sntp-opts.h@1.520 +3 -3 + NTP_4_2_8P8 + + sntp/sntp.1sntpman@1.338 +3 -3 + NTP_4_2_8P8 + + sntp/sntp.1sntpmdoc@1.338 +2 -2 + NTP_4_2_8P8 + + sntp/sntp.html@1.518 +2 -2 + NTP_4_2_8P8 + + sntp/sntp.man.in@1.338 +3 -3 + NTP_4_2_8P8 + + sntp/sntp.mdoc.in@1.338 +2 -2 + NTP_4_2_8P8 + + util/invoke-ntp-keygen.texi@1.506 +2 -2 + NTP_4_2_8P8 + + util/ntp-keygen-opts.c@1.524 +7 -7 + NTP_4_2_8P8 + + util/ntp-keygen-opts.h@1.522 +3 -3 + NTP_4_2_8P8 + + util/ntp-keygen.1ntp-keygenman@1.334 +3 -3 + NTP_4_2_8P8 + + util/ntp-keygen.1ntp-keygenmdoc@1.334 +2 -2 + NTP_4_2_8P8 + + util/ntp-keygen.html@1.180 +2 -2 + NTP_4_2_8P8 + + util/ntp-keygen.man.in@1.334 +3 -3 + NTP_4_2_8P8 + + util/ntp-keygen.mdoc.in@1.334 +2 -2 + NTP_4_2_8P8 + +ChangeSet@1.3685, 2016-06-02 06:50:37-04:00, stenn@deacon.udel.edu + 4.2.8p8 + + packageinfo.sh@1.527 +1 -1 + 4.2.8p8 + +ChangeSet@1.3684, 2016-05-27 08:02:09+00:00, stenn@psp-deb1.ntp.org + typo + + NEWS@1.174 +1 -1 + typo + +ChangeSet@1.3683, 2016-05-27 00:07:22-07:00, harlan@max.pfcs.com + [Bug 3058] fetch_timestamp() mishandles 64-bit alignment. Brian Utterback, JPerlinger, HStenn. + + ChangeLog@1.1833 +2 -0 + [Bug 3058] fetch_timestamp() mishandles 64-bit alignment. Brian Utterback, JPerlinger, HStenn. + + NEWS@1.173 +2 -0 + [Bug 3058] fetch_timestamp() mishandles 64-bit alignment. Brian Utterback, JPerlinger, HStenn. + + ntpd/ntp_io.c@1.417 +41 -41 + [Bug 3058] fetch_timestamp() mishandles 64-bit alignment. Brian Utterback, JPerlinger, HStenn. + +ChangeSet@1.3682, 2016-05-26 22:37:19-07:00, harlan@max.pfcs.com + [Sec3043] - validate origin timestamps on bad MACs, too. stenn@ntp.org + + ChangeLog@1.1832 +2 -1 + [Sec3043] - validate origin timestamps on bad MACs, too. stenn@ntp.org + + NEWS@1.172 +9 -9 + [Sec3043] - validate origin timestamps on bad MACs, too. stenn@ntp.org + + ntpd/ntp_proto.c@1.392 +19 -6 + [Sec3043] - validate origin timestamps on bad MACs, too. stenn@ntp.org + +ChangeSet@1.3681, 2016-05-24 23:31:36+00:00, stenn@psp-deb1.ntp.org + Update the NEWS file for 4.2.8p8. HStenn. + + ChangeLog@1.1831 +1 -0 + Update the NEWS file for 4.2.8p8. HStenn. + + NEWS@1.171 +103 -2 + Update the NEWS file for 4.2.8p8. HStenn. + +ChangeSet@1.3680, 2016-05-24 12:05:06+00:00, stenn@psp-deb1.ntp.org + [Sec 3044] Spoofed server packets are partially processed. HStenn. + + ChangeLog@1.1830 +3 -2 + [Sec 3044] Spoofed server packets are partially processed. HStenn. + + ntpd/ntp_proto.c@1.391 +39 -24 + [Sec 3044] Spoofed server packets are partially processed. HStenn. + +ChangeSet@1.3669.3.2, 2016-05-24 02:58:00-07:00, harlan@hms-mbp11.pfcs.com + Make sure we have an "author" file for git imports. HStenn. + + ChangeLog@1.1820.3.3 +1 -0 + Update the problem tests for MacOS for sntp. HStenn. + + ChangeLog@1.1820.3.2 +1 -0 + Make sure we have an "author" file for git imports. HStenn. + + configure.ac@1.606 +1 -0 + Make sure we have an "author" file for git imports. HStenn. + + scripts/build/Makefile.am@1.5 +1 -1 + Make sure we have an "author" file for git imports. HStenn. + + scripts/build/genAuthors.in@1.1 +82 -0 + BitKeeper file /Users/harlan/src/ntp-stable/scripts/build/genAuthors.in + + scripts/build/genAuthors.in@1.0 +0 -0 + + sntp/configure.ac@1.83 +2 -0 + Make sure we have an "author" file for git imports. HStenn. + + sntp/m4/ntp_problemtests.m4@1.5 +1 -0 + Make sure we have an "author" file for git imports. HStenn. + + sntp/m4/sntp_problemtests.m4@1.1 +47 -0 + BitKeeper file /Users/harlan/src/ntp-stable/sntp/m4/sntp_problemtests.m4 + + sntp/m4/sntp_problemtests.m4@1.0 +0 -0 + + sntp/tests/Makefile.am@1.67 +8 -2 + Update the problem tests for MacOS for sntp. HStenn. + +ChangeSet@1.3669.3.1, 2016-05-24 02:25:46-07:00, harlan@hms-mbp11.pfcs.com + [Sec 3042] Broadcast Interleave. HStenn. + + ChangeLog@1.1820.3.1 +4 -0 + [Sec 3042] Broadcast Interleave. HStenn. + + ntpd/ntp_proto.c@1.386.1.1 +69 -14 + [Sec 3042] Broadcast Interleave. HStenn. + +ChangeSet@1.3678, 2016-05-23 09:53:37+00:00, stenn@psp-deb1.ntp.org + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ChangeLog@1.1828 +1 -1 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + include/ntp.h@1.220 +1 -0 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/complete.conf.in@1.31 +1 -1 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/invoke-ntp.conf.texi@1.199 +23 -3 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/keyword-gen-utd@1.28 +1 -1 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/keyword-gen.c@1.34 +2 -1 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp.conf.5man@1.233 +27 -6 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp.conf.5mdoc@1.233 +24 -2 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp.conf.def@1.24 +22 -0 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp.conf.man.in@1.233 +27 -6 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp.conf.mdoc.in@1.233 +24 -2 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp_config.c@1.338 +6 -2 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp_keyword.h@1.30 +617 -597 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp_parser.c@1.102 +1541 -1773 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp_parser.h@1.66 +294 -306 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp_parser.y@1.92 +2 -0 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + + ntpd/ntp_proto.c@1.389 +29 -8 + [Sec 3043] Autokey association reset. perlinger@ntp.org, stenn@ntp.org + +ChangeSet@1.3671.1.3, 2016-05-17 06:49:41+00:00, stenn@psp-deb1.ntp.org + [Bug 3054] miscopt.html documents the allan intercept in seconds. SWhite. + + ChangeLog@1.1822.1.3 +1 -0 + [Bug 3054] miscopt.html documents the allan intercept in seconds. SWhite. + + html/miscopt.html@1.86 +2 -2 + [Bug 3054] miscopt.html documents the allan intercept in seconds. SWhite. + +ChangeSet@1.3671.1.2, 2016-05-17 04:25:50+00:00, stenn@psp-deb1.ntp.org + [Bug 3052] Add a .gitignore file. Edmund Wong. + + .gitignore@1.1 +9 -0 + BitKeeper file /home/stenn/ntp-stable/.gitignore + + .gitignore@1.0 +0 -0 + + BitKeeper/etc/ignore@1.91 +0 -1 + [Bug 3052] Add a .gitignore file. Edmund Wong. + + ChangeLog@1.1822.1.2 +1 -0 + [Bug 3052] Add a .gitignore file. Edmund Wong. + +ChangeSet@1.3675, 2016-05-08 11:59:28+02:00, perlinger@ntp.org + [Sec 3043] Autokey association reset. perlinger@ntp.org + (fixes [Sec 3044] and [Sec 3045], too) + + ChangeLog@1.1825 +2 -0 + [Sec 3043] Autokey association reset. perlinger@ntp.org + + ntpd/ntp_proto.c@1.388 +28 -22 + [Sec 3043] Autokey association reset. perlinger@ntp.org + (fixes [Sec 3044] and [Sec 3045], too) + +ChangeSet@1.3674, 2016-05-06 11:05:44+00:00, stenn@psp-deb1.ntp.org + [Sec 3046] CRYPTO_NAK crash + + ChangeLog@1.1824 +1 -0 + [Sec 3046] CRYPTO_NAK crash + + ntpd/ntp_proto.c@1.387 +2 -1 + [Sec 3046] CRYPTO_NAK crash + +ChangeSet@1.3669.2.1, 2016-05-06 09:20:29+00:00, stenn@psp-deb1.ntp.org + Fix typo in ntp-wait and plot_summary. HStenn. + + ChangeLog@1.1820.2.1 +4 -0 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/invoke-plot_summary.texi@1.116 +2 -2 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/ntp-wait/ntp-wait.in@1.12 +1 -1 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary-opts@1.64 +1 -1 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary-opts.def@1.3 +1 -1 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary.1plot_summaryman@1.114 +4 -4 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary.1plot_summarymdoc@1.114 +3 -3 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary.html@1.117 +58 -40 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary.man.in@1.114 +4 -4 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/plot_summary.mdoc.in@1.114 +3 -3 + Fix typo in ntp-wait and plot_summary. HStenn. + + scripts/t/ntp-wait.t@1.2 +1 -1 + Fix typo in ntp-wait and plot_summary. HStenn. + +ChangeSet@1.3672, 2016-05-05 06:17:20+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for 4.2.8p9 for Bug 3038 + + NEWS@1.170 +9 -0 + Update NEWS file for 4.2.8p9 for Bug 3038 + +ChangeSet@1.3671, 2016-05-05 06:09:53+00:00, stenn@psp-deb1.ntp.org + trivial cleanup + + ChangeLog@1.1822 +1 -0 + trivial cleanup + +ChangeSet@1.3670, 2016-04-27 21:54:12+02:00, perlinger@ntp.org + [Bug 3038] NTP fails to build in VS2015 Community Edition + - new build environment + - 'wint_t' and 'struct timespec' defined by VS2015 + - fixed several format clashes in 'printf()' and 'scanf' + + BitKeeper/etc/ignore@1.90 +1 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - skip next version of MSVC symbol database + + ChangeLog@1.1821 +6 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + + ntpd/refclock_parse.c@1.83 +6 -6 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - work around clash SOCKET vs file descriptor formatting + + ntpdc/ntpdc.c@1.107 +2 -2 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - fix format warnings/errors + + ntpq/ntpq.c@1.170 +5 -2 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - fix format warnings/errors + + ports/winnt/include/config.h@1.115 +4 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - VS2015 has 'wint_t' + + ports/winnt/include/sys/time.h@1.9 +2 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - VS2015 has 'struct timespec' + + ports/winnt/libntp/termios.c@1.33 +3 -3 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - fix format parsing error + + ports/winnt/ppsapi/loopback/src/sys/time.h@1.2 +2 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - VS2015 has 'struct timespec' + + ports/winnt/vs2013/common.props@1.3 +1 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + -enable multiprocessor build + + ports/winnt/vs2015/common.props@1.1 +60 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/common.props@1.0 +0 -0 + + ports/winnt/vs2015/debug-x64.props@1.1 +24 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/debug-x64.props@1.0 +0 -0 + + ports/winnt/vs2015/debug.props@1.1 +24 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/debug.props@1.0 +0 -0 + + ports/winnt/vs2015/instsrv/instsrv.vcxproj@1.1 +269 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/instsrv/instsrv.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/instsrv/instsrv.vcxproj.filters@1.1 +28 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/instsrv/instsrv.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.1 +431 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.1 +574 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj@1.1 +252 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj.filters@1.1 +39 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj@1.1 +270 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj.filters@1.1 +36 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/ntp.sln@1.1 +166 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntp.sln@1.0 +0 -0 + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.1 +227 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.1 +69 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/ntpd/gen-ntp_keyword.bat@1.1 +53 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpd/gen-ntp_keyword.bat@1.0 +0 -0 + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.1 +515 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.1 +556 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj@1.1 +287 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj.filters@1.1 +72 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj@1.1 +278 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj.filters@1.1 +45 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/ntpq/ntpq.vcxproj@1.1 +277 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpq/ntpq.vcxproj@1.0 +0 -0 + + ports/winnt/vs2015/ntpq/ntpq.vcxproj.filters@1.1 +42 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/ntpq/ntpq.vcxproj.filters@1.0 +0 -0 + + ports/winnt/vs2015/release-x64.props@1.1 +25 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/release-x64.props@1.0 +0 -0 + + ports/winnt/vs2015/release.props@1.1 +25 -0 + [Bug 3038] NTP fails to build in VS2015 Community Edition + - add build environment + + ports/winnt/vs2015/release.props@1.0 +0 -0 + ChangeSet@1.3669, 2016-04-26 20:30:51-04:00, stenn@deacon.udel.edu NTP_4_2_8P7 TAG: NTP_4_2_8P7 Modified: head/contrib/ntp/NEWS ============================================================================== --- head/contrib/ntp/NEWS Fri Jun 3 07:43:04 2016 (r301246) +++ head/contrib/ntp/NEWS Fri Jun 3 08:00:22 2016 (r301247) @@ -1,4 +1,116 @@ --- +NTP 4.2.8p8 (Harlan Stenn , 2016/06/02) + +Focus: Security, Bug fixes, enhancements. + +Severity: HIGH + +In addition to bug fixes and enhancements, this release fixes the +following 1 high- and 4 low-severity vulnerabilities: + +* CRYPTO_NAK crash + Date Resolved: 02 June 2016; Dev (4.3.93) 02 June 2016 + References: Sec 3046 / CVE-2016-4957 / VU#321640 + Affects: ntp-4.2.8p7, and ntp-4.3.92. + CVSS2: HIGH 7.8 (AV:N/AC:L/Au:N/C:N/I:N/A:C) + CVSS3: HIGH 7.5 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H + Summary: The fix for Sec 3007 in ntp-4.2.8p7 contained a bug that + could cause ntpd to crash. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p8, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + If you cannot upgrade from 4.2.8p7, the only other alternatives + are to patch your code or filter CRYPTO_NAK packets. + Properly monitor your ntpd instances, and auto-restart ntpd + (without -g) if it stops running. + Credit: This weakness was discovered by Nicolas Edet of Cisco. + +* Bad authentication demobilizes ephemeral associations + Date Resolved: 02 June 2016; Dev (4.3.93) 02 June 2016 + References: Sec 3045 / CVE-2016-4953 / VU#321640 + Affects: ntp-4, up to but not including ntp-4.2.8p8, and + ntp-4.3.0 up to, but not including ntp-4.3.93. + CVSS2: LOW 2.6 (AV:N/AC:H/Au:N/C:N/I:N/A:P) + CVSS3: LOW 3.7 CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L + Summary: An attacker who knows the origin timestamp and can send a + spoofed packet containing a CRYPTO-NAK to an ephemeral peer + target before any other response is sent can demobilize that + association. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p8, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + Properly monitor your ntpd instances. + Credit: This weakness was discovered by Miroslav Lichvar of Red Hat. + +* Processing spoofed server packets + Date Resolved: 02 June 2016; Dev (4.3.93) 02 June 2016 + References: Sec 3044 / CVE-2016-4954 / VU#321640 + Affects: ntp-4, up to but not including ntp-4.2.8p8, and + ntp-4.3.0 up to, but not including ntp-4.3.93. + CVSS2: LOW 2.6 (AV:N/AC:H/Au:N/C:N/I:N/A:P) + CVSS3: LOW 3.7 CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L + Summary: An attacker who is able to spoof packets with correct origin + timestamps from enough servers before the expected response + packets arrive at the target machine can affect some peer + variables and, for example, cause a false leap indication to be set. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p8, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + Properly monitor your ntpd instances. + Credit: This weakness was discovered by Jakub Prokes of Red Hat. + +* Autokey association reset + Date Resolved: 02 June 2016; Dev (4.3.93) 02 June 2016 + References: Sec 3043 / CVE-2016-4955 / VU#321640 + Affects: ntp-4, up to but not including ntp-4.2.8p8, and + ntp-4.3.0 up to, but not including ntp-4.3.93. + CVSS2: LOW 2.6 (AV:N/AC:H/Au:N/C:N/I:N/A:P) + CVSS3: LOW 3.7 CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L + Summary: An attacker who is able to spoof a packet with a correct + origin timestamp before the expected response packet arrives at + the target machine can send a CRYPTO_NAK or a bad MAC and cause + the association's peer variables to be cleared. If this can be + done often enough, it will prevent that association from working. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p8, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + Properly monitor your ntpd instances. + Credit: This weakness was discovered by Miroslav Lichvar of Red Hat. + +* Broadcast interleave + Date Resolved: 02 June 2016; Dev (4.3.93) 02 June 2016 + References: Sec 3042 / CVE-2016-4956 / VU#321640 + Affects: ntp-4, up to but not including ntp-4.2.8p8, and + ntp-4.3.0 up to, but not including ntp-4.3.93. + CVSS2: LOW 2.6 (AV:N/AC:H/Au:N/C:N/I:N/A:P) + CVSS3: LOW 3.7 CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L + Summary: The fix for NtpBug2978 does not cover broadcast associations, + so broadcast clients can be triggered to flip into interleave mode. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p8, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page + Properly monitor your ntpd instances. + Credit: This weakness was discovered by Miroslav Lichvar of Red Hat. + +Other fixes: +* [Bug 3038] NTP fails to build in VS2015. perlinger@ntp.org + - provide build environment + - 'wint_t' and 'struct timespec' defined by VS2015 + - fixed print()/scanf() format issues +* [Bug 3052] Add a .gitignore file. Edmund Wong. +* [Bug 3054] miscopt.html documents the allan intercept in seconds. SWhite. +* [Bug 3058] fetch_timestamp() mishandles 64-bit alignment. Brian Utterback, + JPerlinger, HStenn. +* Fix typo in ntp-wait and plot_summary. HStenn. +* Make sure we have an "author" file for git imports. HStenn. +* Update the sntp problem tests for MacOS. HStenn. + +--- NTP 4.2.8p7 (Harlan Stenn , 2016/04/26) Focus: Security, Bug fixes, enhancements. Modified: head/contrib/ntp/configure ============================================================================== --- head/contrib/ntp/configure Fri Jun 3 07:43:04 2016 (r301246) +++ head/contrib/ntp/configure Fri Jun 3 08:00:22 2016 (r301247) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ntp 4.2.8p7. +# Generated by GNU Autoconf 2.69 for ntp 4.2.8p8. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p7' -PACKAGE_STRING='ntp 4.2.8p7' +PACKAGE_VERSION='4.2.8p8' +PACKAGE_STRING='ntp 4.2.8p8' PACKAGE_BUGREPORT='http://bugs.ntp.org./' PACKAGE_URL='http://www.ntp.org./' @@ -1618,7 +1618,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p7 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1688,7 +1688,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p7:";; + short | recursive ) echo "Configuration of ntp 4.2.8p8:";; esac cat <<\_ACEOF @@ -1924,7 +1924,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p7 +ntp configure 4.2.8p8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2754,7 +2754,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p7, which was +It was created by ntp $as_me 4.2.8p8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3755,7 +3755,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p7' + VERSION='4.2.8p8' cat >>confdefs.h <<_ACEOF @@ -37251,6 +37251,7 @@ fi + ### @@ -37309,6 +37310,8 @@ ac_config_files="$ac_config_files script *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jun 3 08:19:49 2016 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 4429FB68B84; Fri, 3 Jun 2016 08:19:49 +0000 (UTC) (envelope-from delphij@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 mx1.freebsd.org (Postfix) with ESMTPS id 10EE214B0; Fri, 3 Jun 2016 08:19:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u538JmEK009867; Fri, 3 Jun 2016 08:19:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u538JmIo009866; Fri, 3 Jun 2016 08:19:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201606030819.u538JmIo009866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 3 Jun 2016 08:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301248 - head/release/doc/en_US.ISO8859-1/relnotes 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.22 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, 03 Jun 2016 08:19:49 -0000 Author: delphij Date: Fri Jun 3 08:19:47 2016 New Revision: 301248 URL: https://svnweb.freebsd.org/changeset/base/301248 Log: Chase NTP update. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 3 08:00:22 2016 (r301247) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 3 08:19:47 2016 (r301248) @@ -175,8 +175,8 @@ The MK_ARM_EABI &man.src.conf.5; option has been removed. - The ntp suite - has been updated to version 4.2.8p7. + The ntp suite + has been updated to version 4.2.8p8. From owner-svn-src-head@freebsd.org Fri Jun 3 08:35:08 2016 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 854CFB68F61; Fri, 3 Jun 2016 08:35:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3A2171EE9; Fri, 3 Jun 2016 08:35:08 +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 u538Z7Bv017159; Fri, 3 Jun 2016 08:35:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u538Z7wF017158; Fri, 3 Jun 2016 08:35:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606030835.u538Z7wF017158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 3 Jun 2016 08:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301249 - head/sys/netinet 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.22 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, 03 Jun 2016 08:35:08 -0000 Author: hselasky Date: Fri Jun 3 08:35:07 2016 New Revision: 301249 URL: https://svnweb.freebsd.org/changeset/base/301249 Log: Use insertion sort instead of bubble sort in TCP LRO. Replacing the bubble sort with insertion sort gives an 80% reduction in runtime on average, with randomized keys, for small partitions. If the keys are pre-sorted, insertion sort runs in linear time, and even if the keys are reversed, insertion sort is faster than bubble sort, although not by much. Update comment describing "tcp_lro_sort()" while at it. Differential Revision: https://reviews.freebsd.org/D6619 Sponsored by: Mellanox Technologies Tested by: Netflix Suggested by: Pieter de Goeje Reviewed by: ed, gallatin, gnn, transport Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Fri Jun 3 08:19:47 2016 (r301248) +++ head/sys/netinet/tcp_lro.c Fri Jun 3 08:35:07 2016 (r301249) @@ -387,7 +387,8 @@ tcp_lro_msb_64(uint64_t x) * number of elements to sort and 64 is the number of sequence bits * available. The algorithm is bit-slicing the 64-bit sequence number, * sorting one bit at a time from the most significant bit until the - * least significant one, skipping the constant bits. + * least significant one, skipping the constant bits. This is + * typically called a radix sort. */ static void tcp_lro_sort(struct lro_mbuf_sort *parray, uint32_t size) @@ -399,17 +400,13 @@ tcp_lro_sort(struct lro_mbuf_sort *parra uint32_t y; repeat: - /* for small arrays bubble sort is faster */ + /* for small arrays insertion sort is faster */ if (size <= 12) { - for (x = 0; x != size; x++) { - for (y = x + 1; y != size; y++) { - if (parray[x].seq > parray[y].seq) { - /* swap entries */ - temp = parray[x]; - parray[x] = parray[y]; - parray[y] = temp; - } - } + for (x = 1; x < size; x++) { + temp = parray[x]; + for (y = x; y > 0 && temp.seq < parray[y - 1].seq; y--) + parray[y] = parray[y - 1]; + parray[y] = temp; } return; } From owner-svn-src-head@freebsd.org Fri Jun 3 10:13:19 2016 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 6A82AB66E19; Fri, 3 Jun 2016 10:13:19 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 2CFBF1E33; Fri, 3 Jun 2016 10:13:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53ADI2W054637; Fri, 3 Jun 2016 10:13:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53ADIbC054635; Fri, 3 Jun 2016 10:13:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606031013.u53ADIbC054635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Jun 2016 10:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301263 - in head/sys: kern sys 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.22 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, 03 Jun 2016 10:13:19 -0000 Author: andrew Date: Fri Jun 3 10:13:18 2016 New Revision: 301263 URL: https://svnweb.freebsd.org/changeset/base/301263 Log: Add an interface to handle interrupt controllers that have a contiguous range of interrupts they pass to a second controller driver to handle. The parent driver is expected to detect when one of these interrupts has been triggered and call intr_child_irq_handler to pass the interrupt to a child. The children controllers are then expected to manage the range by allocating interrupts as needed. This will initially be used by the ARM GICv3 driver, but is is expected to be useful for other driver where this type of allocation applies. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6436 Modified: head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Fri Jun 3 09:17:22 2016 (r301262) +++ head/sys/kern/subr_intr.c Fri Jun 3 10:13:18 2016 (r301263) @@ -98,6 +98,15 @@ static intr_irq_filter_t *irq_root_filte static void *irq_root_arg; static u_int irq_root_ipicount; +struct intr_pic_child { + SLIST_ENTRY(intr_pic_child) pc_next; + struct intr_pic *pc_pic; + intr_child_irq_filter_t *pc_filter; + void *pc_filter_arg; + uintptr_t pc_start; + uintptr_t pc_length; +}; + /* Interrupt controller definition. */ struct intr_pic { SLIST_ENTRY(intr_pic) pic_next; @@ -106,6 +115,8 @@ struct intr_pic { #define FLAG_PIC (1 << 0) #define FLAG_MSI (1 << 1) u_int pic_flags; + struct mtx pic_child_lock; + SLIST_HEAD(, intr_pic_child) pic_children; }; static struct mtx pic_list_lock; @@ -323,6 +334,29 @@ intr_irq_handler(struct trapframe *tf) #endif } +int +intr_child_irq_handler(struct intr_pic *parent, uintptr_t irq) +{ + struct intr_pic_child *child; + bool found; + + found = false; + mtx_lock_spin(&parent->pic_child_lock); + SLIST_FOREACH(child, &parent->pic_children, pc_next) { + if (child->pc_start <= irq && + irq < (child->pc_start + child->pc_length)) { + found = true; + break; + } + } + mtx_unlock_spin(&parent->pic_child_lock); + + if (found) + return (child->pc_filter(child->pc_filter_arg, irq)); + + return (FILTER_STRAY); +} + /* * interrupt controller dispatch function for interrupts. It should * be called straight from the interrupt controller, when associated interrupt @@ -892,6 +926,7 @@ pic_create(device_t dev, intptr_t xref) } pic->pic_xref = xref; pic->pic_dev = dev; + mtx_init(&pic->pic_child_lock, "pic child lock", NULL, MTX_SPIN); SLIST_INSERT_HEAD(&pic_list, pic, pic_next); mtx_unlock(&pic_list_lock); @@ -1001,6 +1036,44 @@ intr_pic_claim_root(device_t dev, intptr return (0); } +/* + * Add a handler to manage a sub range of a parents interrupts. + */ +struct intr_pic * +intr_pic_add_handler(device_t parent, struct intr_pic *pic, + intr_child_irq_filter_t *filter, void *arg, uintptr_t start, + uintptr_t length) +{ + struct intr_pic *parent_pic; + struct intr_pic_child *newchild; +#ifdef INVARIANTS + struct intr_pic_child *child; +#endif + + parent_pic = pic_lookup(parent, 0); + if (parent_pic == NULL) + return (NULL); + + newchild = malloc(sizeof(*newchild), M_INTRNG, M_WAITOK | M_ZERO); + newchild->pc_pic = pic; + newchild->pc_filter = filter; + newchild->pc_filter_arg = arg; + newchild->pc_start = start; + newchild->pc_length = length; + + mtx_lock_spin(&parent_pic->pic_child_lock); +#ifdef INVARIANTS + SLIST_FOREACH(child, &parent_pic->pic_children, pc_next) { + KASSERT(child->pc_pic != pic, ("%s: Adding a child PIC twice", + __func__)); + } +#endif + SLIST_INSERT_HEAD(&parent_pic->pic_children, newchild, pc_next); + mtx_unlock_spin(&parent_pic->pic_child_lock); + + return (pic); +} + int intr_map_irq(device_t dev, intptr_t xref, struct intr_map_data *data, u_int *irqp) Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Fri Jun 3 09:17:22 2016 (r301262) +++ head/sys/sys/intr.h Fri Jun 3 10:13:18 2016 (r301263) @@ -74,6 +74,7 @@ typedef int intr_irq_filter_t(void *arg, #else typedef int intr_irq_filter_t(void *arg); #endif +typedef int intr_child_irq_filter_t(void *arg, uintptr_t irq); #define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) @@ -81,6 +82,8 @@ typedef int intr_irq_filter_t(void *arg) #define INTR_ISRCF_PPI 0x02 /* PPI interrupt */ #define INTR_ISRCF_BOUND 0x04 /* bound to a CPU */ +struct intr_pic; + /* Interrupt source definition. */ struct intr_irqsrc { device_t isrc_dev; /* where isrc is mapped */ @@ -113,6 +116,8 @@ u_int intr_irq_next_cpu(u_int current_cp struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); +struct intr_pic *intr_pic_add_handler(device_t, struct intr_pic *, + intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); extern device_t intr_irq_root_dev; @@ -127,6 +132,7 @@ int intr_setup_irq(device_t, struct reso int intr_teardown_irq(device_t, struct resource *, void *); int intr_describe_irq(device_t, struct resource *, void *, const char *); +int intr_child_irq_handler(struct intr_pic *, uintptr_t); /* MSI/MSI-X handling */ int intr_msi_register(device_t, intptr_t); From owner-svn-src-head@freebsd.org Fri Jun 3 10:28:08 2016 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 04DF2B6832A; Fri, 3 Jun 2016 10:28:08 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id C02831A31; Fri, 3 Jun 2016 10:28:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53AS7u7058420; Fri, 3 Jun 2016 10:28:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53AS64t058415; Fri, 3 Jun 2016 10:28:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606031028.u53AS64t058415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Jun 2016 10:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301265 - in head/sys: arm64/arm64 arm64/include conf 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.22 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, 03 Jun 2016 10:28:08 -0000 Author: andrew Date: Fri Jun 3 10:28:06 2016 New Revision: 301265 URL: https://svnweb.freebsd.org/changeset/base/301265 Log: Add the GICv3 ITS intrng driver. As the interface to the interrupt framework has significantly changed the driver has moved to a new file. While it shares some code with the existing driver this has been modified to work better with the intrng framework. This has been tested on the ThunderX servers in the netperf cluster and has been used to boot them for other testing, including DTrace and hwpmc. With this we can use intrng on all supported arm64 platforms I was able to test on. It is expected we will move to intrng soon, and disable the old arm64 interrupt framework. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6437 Added: head/sys/arm64/arm64/gicv3_its.c (contents, props changed) Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/include/intr.h head/sys/conf/files.arm64 Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Fri Jun 3 10:17:19 2016 (r301264) +++ head/sys/arm64/arm64/gic_v3.c Fri Jun 3 10:28:06 2016 (r301265) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_reg.h" #include "gic_v3_var.h" +static bus_read_ivar_t gic_v3_read_ivar; + #ifdef INTRNG static pic_disable_intr_t gic_v3_disable_intr; static pic_enable_intr_t gic_v3_enable_intr; @@ -101,6 +103,9 @@ static device_method_t gic_v3_methods[] /* Device interface */ DEVMETHOD(device_detach, gic_v3_detach), + /* Bus interface */ + DEVMETHOD(bus_read_ivar, gic_v3_read_ivar), + #ifdef INTRNG /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, gic_v3_disable_intr), @@ -179,6 +184,44 @@ static gic_v3_initseq_t gic_v3_secondary }; #endif +#ifdef INTRNG +uint32_t +gic_r_read_4(device_t dev, bus_size_t offset) +{ + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + return (bus_read_4(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset)); +} + +uint64_t +gic_r_read_8(device_t dev, bus_size_t offset) +{ + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + return (bus_read_8(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset)); +} + +void +gic_r_write_4(device_t dev, bus_size_t offset, uint32_t val) +{ + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + bus_write_4(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset, val); +} + +void +gic_r_write_8(device_t dev, bus_size_t offset, uint64_t val) +{ + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + bus_write_8(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset, val); +} +#endif + /* * Device interface. */ @@ -327,17 +370,39 @@ gic_v3_detach(device_t dev) return (0); } +static int +gic_v3_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + + switch (which) { + case GICV3_IVAR_NIRQS: + *result = sc->gic_nirqs; + return (0); + case GICV3_IVAR_REDIST_VADDR: + *result = (uintptr_t)rman_get_virtual( + sc->gic_redists.pcpu[PCPU_GET(cpuid)]); + return (0); + } + + return (ENOENT); +} + #ifdef INTRNG int arm_gic_v3_intr(void *arg) { struct gic_v3_softc *sc = arg; struct gic_v3_irqsrc *gi; + struct intr_pic *pic; uint64_t active_irq; struct trapframe *tf; bool first; first = true; + pic = sc->gic_pic; while (1) { if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { @@ -357,6 +422,11 @@ arm_gic_v3_intr(void *arg) active_irq = gic_icc_read(IAR1); } + if (active_irq >= GIC_FIRST_LPI) { + intr_child_irq_handler(pic, active_irq); + continue; + } + if (__predict_false(active_irq >= sc->gic_nirqs)) return (FILTER_HANDLED); @@ -733,11 +803,12 @@ gic_v3_bind_intr(device_t dev, struct in static void gic_v3_init_secondary(device_t dev) { + device_t child; struct gic_v3_softc *sc; gic_v3_initseq_t *init_func; struct intr_irqsrc *isrc; u_int cpu, irq; - int err; + int err, i; sc = device_get_softc(dev); cpu = PCPU_GET(cpuid); @@ -766,6 +837,11 @@ gic_v3_init_secondary(device_t dev) if (intr_isrc_init_on_cpu(isrc, cpu)) gic_v3_enable_intr(dev, isrc); } + + for (i = 0; i < sc->gic_nchildren; i++) { + child = sc->gic_children[i]; + PIC_INIT_SECONDARY(child); + } } static void Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Fri Jun 3 10:17:19 2016 (r301264) +++ head/sys/arm64/arm64/gic_v3_fdt.c Fri Jun 3 10:28:06 2016 (r301265) @@ -139,7 +139,8 @@ gic_v3_fdt_attach(device_t dev) #ifdef INTRNG xref = OF_xref_from_node(ofw_bus_get_node(dev)); - if (intr_pic_register(dev, xref) == NULL) { + sc->gic_pic = intr_pic_register(dev, xref); + if (sc->gic_pic == NULL) { device_printf(dev, "could not register PIC\n"); err = ENXIO; goto error; @@ -164,6 +165,11 @@ gic_v3_fdt_attach(device_t dev) } } +#ifdef INTRNG + if (device_get_children(dev, &sc->gic_children, &sc->gic_nchildren) != 0) + sc->gic_nchildren = 0; +#endif + return (err); error: Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Fri Jun 3 10:17:19 2016 (r301264) +++ head/sys/arm64/arm64/gic_v3_var.h Fri Jun 3 10:28:06 2016 (r301265) @@ -36,10 +36,12 @@ DECLARE_CLASS(gic_v3_driver); +#ifndef INTRNG #define LPI_FLAGS_CONF_FLUSH (1UL << 0) #define LPI_CONFTAB_SIZE PAGE_SIZE_64K /* 1 bit per LPI + 1 KB more for the obligatory PPI, SGI, SPI stuff */ #define LPI_PENDTAB_SIZE ((LPI_CONFTAB_SIZE / 8) + 0x400) +#endif #ifdef INTRNG struct gic_v3_irqsrc { @@ -86,6 +88,9 @@ struct gic_v3_softc { boolean_t gic_registered; #ifdef INTRNG + int gic_nchildren; + device_t *gic_children; + struct intr_pic *gic_pic; struct gic_v3_irqsrc *gic_irqs; #endif }; @@ -96,25 +101,38 @@ struct gic_v3_softc { MALLOC_DECLARE(M_GIC_V3); +/* ivars */ +enum { + GICV3_IVAR_NIRQS, + GICV3_IVAR_REDIST_VADDR, +}; + +__BUS_ACCESSOR(gicv3, nirqs, GICV3, NIRQS, u_int); +__BUS_ACCESSOR(gicv3, redist_vaddr, GICV3, REDIST_VADDR, void *); + /* Device methods */ int gic_v3_attach(device_t dev); int gic_v3_detach(device_t dev); int arm_gic_v3_intr(void *); +#ifdef INTRNG +uint32_t gic_r_read_4(device_t, bus_size_t); +uint64_t gic_r_read_8(device_t, bus_size_t); +void gic_r_write_4(device_t, bus_size_t, uint32_t var); +void gic_r_write_8(device_t, bus_size_t, uint64_t var); +#endif + /* * ITS */ -#define GIC_V3_ITS_DEVSTR "ARM GIC Interrupt Translation Service" -#define GIC_V3_ITS_COMPSTR "arm,gic-v3-its" - -DECLARE_CLASS(gic_v3_its_driver); /* LPI chunk owned by ITS device */ struct lpi_chunk { u_int lpi_base; u_int lpi_free; /* First free LPI in set */ +#ifndef INTRNG u_int *lpi_col_ids; - +#endif u_int lpi_num; /* Total number of LPIs in chunk */ u_int lpi_busy; /* Number of busy LPIs in chink */ }; @@ -132,6 +150,7 @@ struct its_dev { vm_offset_t itt; size_t itt_size; }; +#ifndef INTRNG TAILQ_HEAD(its_dev_list, its_dev); /* ITS private table description */ @@ -152,6 +171,11 @@ struct its_cmd { uint64_t cmd_dword[4]; /* ITS command double word */ }; +#define GIC_V3_ITS_DEVSTR "ARM GIC Interrupt Translation Service" +#define GIC_V3_ITS_COMPSTR "arm,gic-v3-its" + +DECLARE_CLASS(gic_v3_its_driver); + /* ITS commands encoding */ #define ITS_CMD_MOVI (0x01) #define ITS_CMD_SYNC (0x05) @@ -183,6 +207,7 @@ struct its_cmd { /* Valid command bit */ #define CMD_VALID_SHIFT (63) #define CMD_VALID_MASK (1UL << CMD_VALID_SHIFT) +#endif /* INTRNG */ /* * ITS command descriptor. @@ -237,13 +262,14 @@ struct its_cmd_desc { }; }; +#define ITS_TARGET_NONE 0xFBADBEEF + +#ifndef INTRNG #define ITS_CMDQ_SIZE PAGE_SIZE_64K #define ITS_CMDQ_NENTRIES (ITS_CMDQ_SIZE / sizeof(struct its_cmd)) #define ITS_FLAGS_CMDQ_FLUSH (1UL << 0) -#define ITS_TARGET_NONE 0xFBADBEEF - struct gic_v3_its_softc { device_t dev; struct resource * its_res; @@ -255,7 +281,9 @@ struct gic_v3_its_softc { uint64_t its_flags; +#ifndef INTRNG struct its_dev_list its_dev_list; +#endif bitstr_t * its_lpi_bitmap; uint32_t its_lpi_maxid; @@ -290,6 +318,7 @@ int its_init_cpu(struct gic_v3_its_softc int lpi_migrate(device_t, uint32_t, u_int); void lpi_unmask_irq(device_t, uint32_t); void lpi_mask_irq(device_t, uint32_t); +#endif /* * GIC Distributor accessors. * Notice that only GIC sofc can be passed. Added: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/gicv3_its.c Fri Jun 3 10:28:06 2016 (r301265) @@ -0,0 +1,1585 @@ +/*- + * Copyright (c) 2015-2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * the sponsorship of the FreeBSD Foundation. + * + * This software was developed by Semihalf under + * the sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif +#include +#include + +#include "pcib_if.h" +#include "pic_if.h" +#include "msi_if.h" + +MALLOC_DEFINE(M_GICV3_ITS, "GICv3 ITS", + "ARM GICv3 Interrupt Translation Service"); + +#define LPI_NIRQS (64 * 1024) + +/* The size and alignment of the command circular buffer */ +#define ITS_CMDQ_SIZE (64 * 1024) /* Must be a multiple of 4K */ +#define ITS_CMDQ_ALIGN (64 * 1024) + +#define LPI_CONFTAB_SIZE LPI_NIRQS +#define LPI_CONFTAB_ALIGN (64 * 1024) +#define LPI_CONFTAB_MAX_ADDR ((1ul << 48) - 1) /* We need a 47 bit PA */ + +/* 1 bit per SPI, PPI, and SGI (8k), and 1 bit per LPI (LPI_CONFTAB_SIZE) */ +#define LPI_PENDTAB_SIZE ((LPI_NIRQS + GIC_FIRST_LPI) / 8) +#define LPI_PENDTAB_ALIGN (64 * 1024) +#define LPI_PENDTAB_MAX_ADDR ((1ul << 48) - 1) /* We need a 47 bit PA */ + +#define LPI_INT_TRANS_TAB_ALIGN 256 +#define LPI_INT_TRANS_TAB_MAX_ADDR ((1ul << 48) - 1) + +/* ITS commands encoding */ +#define ITS_CMD_MOVI (0x01) +#define ITS_CMD_SYNC (0x05) +#define ITS_CMD_MAPD (0x08) +#define ITS_CMD_MAPC (0x09) +#define ITS_CMD_MAPTI (0x0a) +#define ITS_CMD_MAPI (0x0b) +#define ITS_CMD_INV (0x0c) +#define ITS_CMD_INVALL (0x0d) +/* Command */ +#define CMD_COMMAND_MASK (0xFFUL) +/* PCI device ID */ +#define CMD_DEVID_SHIFT (32) +#define CMD_DEVID_MASK (0xFFFFFFFFUL << CMD_DEVID_SHIFT) +/* Size of IRQ ID bitfield */ +#define CMD_SIZE_MASK (0xFFUL) +/* Virtual LPI ID */ +#define CMD_ID_MASK (0xFFFFFFFFUL) +/* Physical LPI ID */ +#define CMD_PID_SHIFT (32) +#define CMD_PID_MASK (0xFFFFFFFFUL << CMD_PID_SHIFT) +/* Collection */ +#define CMD_COL_MASK (0xFFFFUL) +/* Target (CPU or Re-Distributor) */ +#define CMD_TARGET_SHIFT (16) +#define CMD_TARGET_MASK (0xFFFFFFFFUL << CMD_TARGET_SHIFT) +/* Interrupt Translation Table address */ +#define CMD_ITT_MASK (0xFFFFFFFFFF00UL) +/* Valid command bit */ +#define CMD_VALID_SHIFT (63) +#define CMD_VALID_MASK (1UL << CMD_VALID_SHIFT) + +/* ITS command. Each command is 32 bytes long */ +struct its_cmd { + uint64_t cmd_dword[4]; /* ITS command double word */ +}; + +/* An ITS private table */ +struct its_ptable { + vm_offset_t ptab_vaddr; + unsigned long ptab_size; +}; + +/* ITS collection description. */ +struct its_col { + uint64_t col_target; /* Target Re-Distributor */ + uint64_t col_id; /* Collection ID */ +}; + +struct gicv3_its_irqsrc { + struct intr_irqsrc gi_isrc; + u_int gi_irq; + struct its_dev *gi_its_dev; +}; + +struct gicv3_its_softc { + struct intr_pic *sc_pic; + struct resource *sc_its_res; + + struct its_ptable sc_its_ptab[GITS_BASER_NUM]; + struct its_col *sc_its_cols[MAXCPU]; /* Per-CPU collections */ + + /* + * TODO: We should get these from the parent as we only want a + * single copy of each across the interrupt controller. + */ + vm_offset_t sc_conf_base; + vm_offset_t sc_pend_base[MAXCPU]; + + /* Command handling */ + struct mtx sc_its_cmd_lock; + struct its_cmd *sc_its_cmd_base; /* Command circular buffer address */ + size_t sc_its_cmd_next_idx; + + vmem_t *sc_irq_alloc; + struct gicv3_its_irqsrc *sc_irqs; + + struct mtx sc_its_dev_lock; + TAILQ_HEAD(its_dev_list, its_dev) sc_its_dev_list; + +#define ITS_FLAGS_CMDQ_FLUSH 0x00000001 +#define ITS_FLAGS_LPI_CONF_FLUSH 0x00000002 +#define ITS_FLAGS_ERRATA_CAVIUM_22375 0x00000004 + u_int sc_its_flags; +}; + +typedef void (its_quirk_func_t)(device_t); +static its_quirk_func_t its_quirk_cavium_22375; + +static const struct { + const char *desc; + uint32_t iidr; + uint32_t iidr_mask; + its_quirk_func_t *func; +} its_quirks[] = { + { + /* Cavium ThunderX Pass 1.x */ + .desc = "Cavoum ThunderX errata: 22375, 24313", + .iidr = GITS_IIDR_RAW(GITS_IIDR_IMPL_CAVIUM, + GITS_IIDR_PROD_THUNDER, GITS_IIDR_VAR_THUNDER_1, 0), + .iidr_mask = ~GITS_IIDR_REVISION_MASK, + .func = its_quirk_cavium_22375, + }, +}; + +static u_int gic_irq_cpu; + +#define gic_its_read_4(sc, reg) \ + bus_read_4((sc)->sc_its_res, (reg)) +#define gic_its_read_8(sc, reg) \ + bus_read_8((sc)->sc_its_res, (reg)) + +#define gic_its_write_4(sc, reg, val) \ + bus_write_4((sc)->sc_its_res, (reg), (val)) +#define gic_its_write_8(sc, reg, val) \ + bus_write_8((sc)->sc_its_res, (reg), (val)) + +static device_attach_t gicv3_its_attach; +static device_detach_t gicv3_its_detach; + +static pic_disable_intr_t gicv3_its_disable_intr; +static pic_enable_intr_t gicv3_its_enable_intr; +static pic_map_intr_t gicv3_its_map_intr; +static pic_setup_intr_t gicv3_its_setup_intr; +static pic_post_filter_t gicv3_its_post_filter; +static pic_post_ithread_t gicv3_its_post_ithread; +static pic_pre_ithread_t gicv3_its_pre_ithread; +static pic_bind_intr_t gicv3_its_bind_intr; +#ifdef SMP +static pic_init_secondary_t gicv3_its_init_secondary; +#endif +static msi_alloc_msi_t gicv3_its_alloc_msi; +static msi_release_msi_t gicv3_its_release_msi; +static msi_alloc_msix_t gicv3_its_alloc_msix; +static msi_release_msix_t gicv3_its_release_msix; +static msi_map_msi_t gicv3_its_map_msi; + +static void its_cmd_movi(device_t, struct gicv3_its_irqsrc *); +static void its_cmd_mapc(device_t, struct its_col *, uint8_t); +static void its_cmd_mapti(device_t, struct gicv3_its_irqsrc *); +static void its_cmd_mapd(device_t, struct its_dev *, uint8_t); +static void its_cmd_inv(device_t, struct its_dev *, struct gicv3_its_irqsrc *); +static void its_cmd_invall(device_t, struct its_col *); + +static device_method_t gicv3_its_methods[] = { + /* Device interface */ + DEVMETHOD(device_detach, gicv3_its_detach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, gicv3_its_disable_intr), + DEVMETHOD(pic_enable_intr, gicv3_its_enable_intr), + DEVMETHOD(pic_map_intr, gicv3_its_map_intr), + DEVMETHOD(pic_setup_intr, gicv3_its_setup_intr), + DEVMETHOD(pic_post_filter, gicv3_its_post_filter), + DEVMETHOD(pic_post_ithread, gicv3_its_post_ithread), + DEVMETHOD(pic_pre_ithread, gicv3_its_pre_ithread), +#ifdef SMP + DEVMETHOD(pic_bind_intr, gicv3_its_bind_intr), + DEVMETHOD(pic_init_secondary, gicv3_its_init_secondary), +#endif + + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, gicv3_its_alloc_msi), + DEVMETHOD(msi_release_msi, gicv3_its_release_msi), + DEVMETHOD(msi_alloc_msix, gicv3_its_alloc_msix), + DEVMETHOD(msi_release_msix, gicv3_its_release_msix), + DEVMETHOD(msi_map_msi, gicv3_its_map_msi), + + /* End */ + DEVMETHOD_END +}; + +static DEFINE_CLASS_0(gic, gicv3_its_driver, gicv3_its_methods, + sizeof(struct gicv3_its_softc)); + +static void +gicv3_its_cmdq_init(struct gicv3_its_softc *sc) +{ + vm_paddr_t cmd_paddr; + uint64_t reg, tmp; + + /* Set up the command circular buffer */ + sc->sc_its_cmd_base = contigmalloc(ITS_CMDQ_SIZE, M_GICV3_ITS, + M_WAITOK | M_ZERO, 0, (1ul << 48) - 1, ITS_CMDQ_ALIGN, 0); + sc->sc_its_cmd_next_idx = 0; + + cmd_paddr = vtophys(sc->sc_its_cmd_base); + + /* Set the base of the command buffer */ + reg = GITS_CBASER_VALID | + (GITS_CBASER_CACHE_NIWAWB << GITS_CBASER_CACHE_SHIFT) | + cmd_paddr | (GITS_CBASER_SHARE_IS << GITS_CBASER_SHARE_SHIFT) | + (ITS_CMDQ_SIZE / 4096 - 1); + gic_its_write_8(sc, GITS_CBASER, reg); + + /* Read back to check for fixed value fields */ + tmp = gic_its_read_8(sc, GITS_CBASER); + + if ((tmp & GITS_CBASER_SHARE_MASK) != + (GITS_CBASER_SHARE_IS << GITS_CBASER_SHARE_SHIFT)) { + /* Check if the hardware reported non-shareable */ + if ((tmp & GITS_CBASER_SHARE_MASK) == + (GITS_CBASER_SHARE_NS << GITS_CBASER_SHARE_SHIFT)) { + /* If so remove the cache attribute */ + reg &= ~GITS_CBASER_CACHE_MASK; + reg &= ~GITS_CBASER_SHARE_MASK; + /* Set to Non-cacheable, Non-shareable */ + reg |= GITS_CBASER_CACHE_NIN << GITS_CBASER_CACHE_SHIFT; + reg |= GITS_CBASER_SHARE_NS << GITS_CBASER_SHARE_SHIFT; + + gic_its_write_8(sc, GITS_CBASER, reg); + } + + /* The command queue has to be flushed after each command */ + sc->sc_its_flags |= ITS_FLAGS_CMDQ_FLUSH; + } + + /* Get the next command from the start of the buffer */ + gic_its_write_8(sc, GITS_CWRITER, 0x0); +} + +static int +gicv3_its_table_init(device_t dev, struct gicv3_its_softc *sc) +{ + vm_offset_t table; + vm_paddr_t paddr; + uint64_t cache, reg, share, tmp, type; + size_t esize, its_tbl_size, nidents, nitspages, npages; + int i, page_size; + int devbits; + + if ((sc->sc_its_flags & ITS_FLAGS_ERRATA_CAVIUM_22375) != 0) { + /* + * GITS_TYPER[17:13] of ThunderX reports that device IDs + * are to be 21 bits in length. The entry size of the ITS + * table can be read from GITS_BASERn[52:48] and on ThunderX + * is supposed to be 8 bytes in length (for device table). + * Finally the page size that is to be used by ITS to access + * this table will be set to 64KB. + * + * This gives 0x200000 entries of size 0x8 bytes covered by + * 256 pages each of which 64KB in size. The number of pages + * (minus 1) should then be written to GITS_BASERn[7:0]. In + * that case this value would be 0xFF but on ThunderX the + * maximum value that HW accepts is 0xFD. + * + * Set an arbitrary number of device ID bits to 20 in order + * to limit the number of entries in ITS device table to + * 0x100000 and the table size to 8MB. + */ + devbits = 20; + cache = 0; + } else { + devbits = GITS_TYPER_DEVB(gic_its_read_8(sc, GITS_TYPER)); + cache = GITS_BASER_CACHE_WAWB; + } + share = GITS_BASER_SHARE_IS; + page_size = PAGE_SIZE_64K; + + for (i = 0; i < GITS_BASER_NUM; i++) { + reg = gic_its_read_8(sc, GITS_BASER(i)); + /* The type of table */ + type = GITS_BASER_TYPE(reg); + /* The table entry size */ + esize = GITS_BASER_ESIZE(reg); + + switch(type) { + case GITS_BASER_TYPE_DEV: + nidents = (1 << devbits); + its_tbl_size = esize * nidents; + its_tbl_size = roundup2(its_tbl_size, PAGE_SIZE_64K); + break; + case GITS_BASER_TYPE_VP: + case GITS_BASER_TYPE_PP: /* Undocumented? */ + case GITS_BASER_TYPE_IC: + its_tbl_size = page_size; + break; + default: + continue; + } + npages = howmany(its_tbl_size, PAGE_SIZE); + + /* Allocate the table */ + table = (vm_offset_t)contigmalloc(npages * PAGE_SIZE, + M_GICV3_ITS, M_WAITOK | M_ZERO, 0, (1ul << 48) - 1, + PAGE_SIZE, 0); + + sc->sc_its_ptab[i].ptab_vaddr = table; + sc->sc_its_ptab[i].ptab_size = npages * PAGE_SIZE; + + paddr = vtophys(table); + + while (1) { + nitspages = howmany(its_tbl_size, page_size); + + /* Clear the fields we will be setting */ + reg &= ~(GITS_BASER_VALID | + GITS_BASER_CACHE_MASK | GITS_BASER_TYPE_MASK | + GITS_BASER_ESIZE_MASK | GITS_BASER_PA_MASK | + GITS_BASER_SHARE_MASK | GITS_BASER_PSZ_MASK | + GITS_BASER_SIZE_MASK); + /* Set the new values */ + reg |= GITS_BASER_VALID | + (cache << GITS_BASER_CACHE_SHIFT) | + (type << GITS_BASER_TYPE_SHIFT) | + ((esize - 1) << GITS_BASER_ESIZE_SHIFT) | + paddr | (share << GITS_BASER_SHARE_SHIFT) | + (nitspages - 1); + + switch (page_size) { + case PAGE_SIZE: /* 4KB */ + reg |= + GITS_BASER_PSZ_4K << GITS_BASER_PSZ_SHIFT; + break; + case PAGE_SIZE_16K: /* 16KB */ + reg |= + GITS_BASER_PSZ_4K << GITS_BASER_PSZ_SHIFT; + break; + case PAGE_SIZE_64K: /* 64KB */ + reg |= + GITS_BASER_PSZ_64K << GITS_BASER_PSZ_SHIFT; + break; + } + + gic_its_write_8(sc, GITS_BASER(i), reg); + + /* Read back to check */ + tmp = gic_its_read_8(sc, GITS_BASER(i)); + + /* Do the snareability masks line up? */ + if ((tmp & GITS_BASER_SHARE_MASK) != + (reg & GITS_BASER_SHARE_MASK)) { + share = (tmp & GITS_BASER_SHARE_MASK) >> + GITS_BASER_SHARE_SHIFT; + continue; + } + + if ((tmp & GITS_BASER_PSZ_MASK) != + (reg & GITS_BASER_PSZ_MASK)) { + switch (page_size) { + case PAGE_SIZE_16K: + page_size = PAGE_SIZE; + continue; + case PAGE_SIZE_64K: + page_size = PAGE_SIZE_16K; + continue; + } + } + + if (tmp != reg) { + device_printf(dev, "GITS_BASER%d: " + "unable to be updated: %lx != %lx\n", + i, reg, tmp); + return (ENXIO); + } + + /* We should have made all needed changes */ + break; + } + } + + return (0); +} + +static void +gicv3_its_conftable_init(struct gicv3_its_softc *sc) +{ + + sc->sc_conf_base = (vm_offset_t)contigmalloc(LPI_CONFTAB_SIZE, + M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR, LPI_CONFTAB_ALIGN, + 0); + + /* Set the default configuration */ + memset((void *)sc->sc_conf_base, GIC_PRIORITY_MAX | LPI_CONF_GROUP1, + LPI_CONFTAB_SIZE); + + /* Flush the table to memory */ + cpu_dcache_wb_range(sc->sc_conf_base, LPI_CONFTAB_SIZE); +} + +static void +gicv3_its_pendtables_init(struct gicv3_its_softc *sc) +{ + int i; + + for (i = 0; i < mp_ncpus; i++) { + if (CPU_ISSET(i, &all_cpus) == 0) + continue; + + sc->sc_pend_base[i] = (vm_offset_t)contigmalloc( + LPI_PENDTAB_SIZE, M_GICV3_ITS, M_WAITOK | M_ZERO, + 0, LPI_PENDTAB_MAX_ADDR, LPI_PENDTAB_ALIGN, 0); + + /* Flush so the ITS can see the memory */ + cpu_dcache_wb_range((vm_offset_t)sc->sc_pend_base, + LPI_PENDTAB_SIZE); + } +} + +static int +its_init_cpu(device_t dev, struct gicv3_its_softc *sc) +{ + device_t gicv3; + vm_paddr_t target; + uint64_t xbaser, tmp; + uint32_t ctlr; + u_int cpuid; + + gicv3 = device_get_parent(dev); + cpuid = PCPU_GET(cpuid); + + /* Check if the ITS is enabled on this CPU */ + if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) { + return (ENXIO); + } + + /* Disable LPIs */ + ctlr = gic_r_read_4(gicv3, GICR_CTLR); + ctlr &= ~GICR_CTLR_LPI_ENABLE; + gic_r_write_4(gicv3, GICR_CTLR, ctlr); + + /* Make sure changes are observable my the GIC */ + dsb(sy); + + /* + * Set the redistributor base + */ + xbaser = vtophys(sc->sc_conf_base) | + (GICR_PROPBASER_SHARE_IS << GICR_PROPBASER_SHARE_SHIFT) | + (GICR_PROPBASER_CACHE_NIWAWB << GICR_PROPBASER_CACHE_SHIFT) | + (flsl(LPI_CONFTAB_SIZE | GIC_FIRST_LPI) - 1); + gic_r_write_8(gicv3, GICR_PROPBASER, xbaser); + + /* Check the cache attributes we set */ + tmp = gic_r_read_8(gicv3, GICR_PROPBASER); + + if ((tmp & GICR_PROPBASER_SHARE_MASK) != + (xbaser & GICR_PROPBASER_SHARE_MASK)) { + if ((tmp & GICR_PROPBASER_SHARE_MASK) == + (GICR_PROPBASER_SHARE_NS << GICR_PROPBASER_SHARE_SHIFT)) { + /* We need to mark as non-cacheable */ + xbaser &= ~(GICR_PROPBASER_SHARE_MASK | + GICR_PROPBASER_CACHE_MASK); + /* Non-cacheable */ + xbaser |= GICR_PROPBASER_CACHE_NIN << + GICR_PROPBASER_CACHE_SHIFT; + /* Non-sareable */ + xbaser |= GICR_PROPBASER_SHARE_NS << + GICR_PROPBASER_SHARE_SHIFT; + gic_r_write_8(gicv3, GICR_PROPBASER, xbaser); + } + sc->sc_its_flags |= ITS_FLAGS_LPI_CONF_FLUSH; + } + + /* + * Set the LPI pending table base + */ + xbaser = vtophys(sc->sc_pend_base[cpuid]) | + (GICR_PENDBASER_CACHE_NIWAWB << GICR_PENDBASER_CACHE_SHIFT) | + (GICR_PENDBASER_SHARE_IS << GICR_PENDBASER_SHARE_SHIFT); + + gic_r_write_8(gicv3, GICR_PENDBASER, xbaser); + + tmp = gic_r_read_8(gicv3, GICR_PENDBASER); + + if ((tmp & GICR_PENDBASER_SHARE_MASK) == + (GICR_PENDBASER_SHARE_NS << GICR_PENDBASER_SHARE_SHIFT)) { + /* Clear the cahce and shareability bits */ + xbaser &= ~(GICR_PENDBASER_CACHE_MASK | + GICR_PENDBASER_SHARE_MASK); + /* Mark as non-shareable */ + xbaser |= GICR_PENDBASER_SHARE_NS << GICR_PENDBASER_SHARE_SHIFT; + /* And non-cacheable */ + xbaser |= GICR_PENDBASER_CACHE_NIN << + GICR_PENDBASER_CACHE_SHIFT; + } + + /* Enable LPIs */ + ctlr = gic_r_read_4(gicv3, GICR_CTLR); + ctlr |= GICR_CTLR_LPI_ENABLE; + gic_r_write_4(gicv3, GICR_CTLR, ctlr); + + /* Make sure the GIC has seen everything */ + dsb(sy); + + if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) { + /* This ITS wants the redistributor physical address */ + target = vtophys(gicv3_get_redist_vaddr(dev)); + } else { + /* This ITS wants the unique processor number */ + target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)); + } + + sc->sc_its_cols[cpuid]->col_target = target; + sc->sc_its_cols[cpuid]->col_id = cpuid; + + its_cmd_mapc(dev, sc->sc_its_cols[cpuid], 1); + its_cmd_invall(dev, sc->sc_its_cols[cpuid]); + + return (0); +} + +static int +gicv3_its_attach(device_t dev) +{ + struct gicv3_its_softc *sc; + const char *name; + uint32_t iidr; + int err, i, rid; + + sc = device_get_softc(dev); + + rid = 0; + sc->sc_its_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_its_res == NULL) { + device_printf(dev, "Could not allocate memory\n"); + return (ENXIO); + } + + iidr = gic_its_read_4(sc, GITS_IIDR); + for (i = 0; i < nitems(its_quirks); i++) { + if ((iidr & its_quirks[i].iidr_mask) == its_quirks[i].iidr) { + if (bootverbose) { + device_printf(dev, "Applying %s\n", + its_quirks[i].desc); + } + its_quirks[i].func(dev); + break; + } + } + + /* Allocate the private tables */ + err = gicv3_its_table_init(dev, sc); + if (err != 0) + return (err); + + /* Protects access to the device list */ + mtx_init(&sc->sc_its_dev_lock, "ITS device lock", NULL, MTX_SPIN); + + /* Protects access to the ITS command circular buffer. */ + mtx_init(&sc->sc_its_cmd_lock, "ITS cmd lock", NULL, MTX_SPIN); + + /* Allocate the command circular buffer */ + gicv3_its_cmdq_init(sc); + + /* Allocate the per-CPU collections */ + for (int cpu = 0; cpu < mp_ncpus; cpu++) + if (CPU_ISSET(cpu, &all_cpus) != 0) + sc->sc_its_cols[cpu] = malloc( + sizeof(*sc->sc_its_cols[0]), M_GICV3_ITS, + M_WAITOK | M_ZERO); + else + sc->sc_its_cols[cpu] = NULL; + + /* Enable the ITS */ + gic_its_write_4(sc, GITS_CTLR, + gic_its_read_4(sc, GITS_CTLR) | GITS_CTLR_EN); + + /* Create the LPI configuration table */ + gicv3_its_conftable_init(sc); + + /* And the pending tebles */ + gicv3_its_pendtables_init(sc); + + /* Enable LPIs on this CPU */ + its_init_cpu(dev, sc); + + TAILQ_INIT(&sc->sc_its_dev_list); + + /* + * Create the vmem object to allocate IRQs from. We try to use all + * IRQs not already used by the GICv3. + * XXX: This assumes there are no other interrupt controllers in the + * system. + */ + sc->sc_irq_alloc = vmem_create("GICv3 ITS IRQs", 0, + NIRQ - gicv3_get_nirqs(dev), 1, 1, M_FIRSTFIT | M_WAITOK); + + sc->sc_irqs = malloc(sizeof(*sc->sc_irqs) * LPI_NIRQS, M_GICV3_ITS, + M_WAITOK | M_ZERO); + name = device_get_nameunit(dev); + for (i = 0; i < LPI_NIRQS; i++) { + sc->sc_irqs[i].gi_irq = i; + err = intr_isrc_register(&sc->sc_irqs[i].gi_isrc, dev, 0, + "%s,%u", name, i); + } + + return (0); +} + +static int +gicv3_its_detach(device_t dev) +{ + + return (ENXIO); +} + +static void +its_quirk_cavium_22375(device_t dev) +{ + struct gicv3_its_softc *sc; + + sc = device_get_softc(dev); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jun 3 11:05:56 2016 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 4AEA0B68F51; Fri, 3 Jun 2016 11:05:56 +0000 (UTC) (envelope-from skra@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 mx1.freebsd.org (Postfix) with ESMTPS id 188C811D7; Fri, 3 Jun 2016 11:05:56 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53B5tq4073577; Fri, 3 Jun 2016 11:05:55 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53B5tVi073576; Fri, 3 Jun 2016 11:05:55 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201606031105.u53B5tVi073576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 3 Jun 2016 11:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301266 - head/sys/arm/freescale/imx 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.22 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, 03 Jun 2016 11:05:56 -0000 Author: skra Date: Fri Jun 3 11:05:55 2016 New Revision: 301266 URL: https://svnweb.freebsd.org/changeset/base/301266 Log: Postpone allocation of IRQ resource to the time when interrupt controller devices are attached. This has already been done for bus_setup_intr(). There was no doubt that if someone wants to setup an interrupt, corresponding interrupt controller device must already be attached. However, the same must be valid for allocation of an interrupt resource unless the allocation is done blindly, without any information that such interrupt even exists. While it was done this blind way before, it won't be possible after next INTRNG change. Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 10:28:06 2016 (r301265) +++ head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 11:05:55 2016 (r301266) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); static struct resource_spec imx6_anatop_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; #define MEMRES 0 @@ -637,11 +636,20 @@ initialize_tempmon(struct imx6_anatop_so static void intr_setup(void *arg) { + int rid; struct imx6_anatop_softc *sc; sc = arg; - bus_setup_intr(sc->dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, - tempmon_intr, NULL, sc, &sc->temp_intrhand); + rid = 0; + sc->res[IRQRES] = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->res[IRQRES] != NULL) { + bus_setup_intr(sc->dev, sc->res[IRQRES], + INTR_TYPE_MISC | INTR_MPSAFE, tempmon_intr, NULL, sc, + &sc->temp_intrhand); + } else { + device_printf(sc->dev, "Cannot allocate IRQ resource\n"); + } config_intrhook_disestablish(&sc->intr_setup_hook); } From owner-svn-src-head@freebsd.org Fri Jun 3 11:18:32 2016 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 295B5B684C5; Fri, 3 Jun 2016 11:18:32 +0000 (UTC) (envelope-from skra@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 mx1.freebsd.org (Postfix) with ESMTPS id EF4F919E5; Fri, 3 Jun 2016 11:18:31 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53BIVYP077243; Fri, 3 Jun 2016 11:18:31 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53BIVqc077242; Fri, 3 Jun 2016 11:18:31 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201606031118.u53BIVqc077242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 3 Jun 2016 11:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301267 - head/sys/arm/arm 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.22 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, 03 Jun 2016 11:18:32 -0000 Author: skra Date: Fri Jun 3 11:18:30 2016 New Revision: 301267 URL: https://svnweb.freebsd.org/changeset/base/301267 Log: Define irq variable only in the block where used. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Fri Jun 3 11:05:55 2016 (r301266) +++ head/sys/arm/arm/gic.c Fri Jun 3 11:18:30 2016 (r301267) @@ -1109,12 +1109,10 @@ arm_gic_setup_intr(device_t dev, struct { struct arm_gic_softc *sc = device_get_softc(dev); struct gic_irqsrc *gi = (struct gic_irqsrc *)isrc; - u_int irq; enum intr_trigger trig; enum intr_polarity pol; if ((gi->gi_flags & GI_FLAG_MSI) == GI_FLAG_MSI) { - irq = gi->gi_irq; pol = gi->gi_pol; trig = gi->gi_trig; KASSERT(pol == INTR_POLARITY_HIGH, @@ -1122,14 +1120,13 @@ arm_gic_setup_intr(device_t dev, struct KASSERT(trig == INTR_TRIGGER_EDGE, ("%s: MSI interrupts must be edge triggered", __func__)); } else if (data != NULL) { - /* Get config for resource. */ - if (gic_map_intr(dev, data, &irq, &pol, &trig)) - return (EINVAL); + u_int irq; - if (gi->gi_irq != irq) + /* Get config for resource. */ + if (gic_map_intr(dev, data, &irq, &pol, &trig) || + gi->gi_irq != irq) return (EINVAL); } else { - irq = gi->gi_irq; pol = INTR_POLARITY_CONFORM; trig = INTR_TRIGGER_CONFORM; } From owner-svn-src-head@freebsd.org Fri Jun 3 11:38:53 2016 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 E5BBDB68ABA; Fri, 3 Jun 2016 11:38:53 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id A7DB412EF; Fri, 3 Jun 2016 11:38:53 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53Bcqhc085338; Fri, 3 Jun 2016 11:38:52 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53Bcq9o085337; Fri, 3 Jun 2016 11:38:52 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606031138.u53Bcq9o085337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 3 Jun 2016 11:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301268 - head/sys/dev/xen/blkback 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.22 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, 03 Jun 2016 11:38:54 -0000 Author: royger Date: Fri Jun 3 11:38:52 2016 New Revision: 301268 URL: https://svnweb.freebsd.org/changeset/base/301268 Log: blkback: add support for hotplug scripts Hotplug scripts are needed in order to use fancy disk configurations in xl, like iSCSI disks. The job of hotplug scripts is to locally attach the disk and present it to blkback as a block device or a regular file. This change introduces a new xenstore node in the blkback hierarchy, called "physical-device-path". This is a straigh replacement for the "params" node, which was used before. Hotplug scripts will need to read the "params" node, perform whatever actions are necessary and then write the "physical-device-path" node. The hotplug script is also in charge of detaching the disk once the domain has been shutdown. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Fri Jun 3 11:18:30 2016 (r301267) +++ head/sys/dev/xen/blkback/blkback.c Fri Jun 3 11:38:52 2016 (r301268) @@ -802,6 +802,9 @@ struct xbb_softc { /** How many times we have run out of request structures */ uint64_t request_shortages; + + /** Watch to wait for hotplug script execution */ + struct xs_watch hotplug_watch; }; /*---------------------------- Request Processing ----------------------------*/ @@ -3306,7 +3309,7 @@ xbb_connect(struct xbb_softc *xbb) { int error; - if (xenbus_get_state(xbb->dev) == XenbusStateConnected) + if (xenbus_get_state(xbb->dev) != XenbusStateInitialised) return; if (xbb_collect_frontend_info(xbb) != 0) @@ -3403,6 +3406,12 @@ xbb_shutdown(struct xbb_softc *xbb) xbb->flags |= XBBF_IN_SHUTDOWN; mtx_unlock(&xbb->lock); + if (xbb->hotplug_watch.node != NULL) { + xs_unregister_watch(&xbb->hotplug_watch); + free(xbb->hotplug_watch.node, M_XENBLOCKBACK); + xbb->hotplug_watch.node = NULL; + } + if (xenbus_get_state(xbb->dev) < XenbusStateClosing) xenbus_set_state(xbb->dev, XenbusStateClosing); @@ -3583,61 +3592,24 @@ xbb_setup_sysctl(struct xbb_softc *xbb) "communication channel pages (negotiated)"); } -/** - * Attach to a XenBus device that has been claimed by our probe routine. - * - * \param dev NewBus device object representing this Xen Block Back instance. - * - * \return 0 for success, errno codes for failure. - */ -static int -xbb_attach(device_t dev) +static void +xbb_attach_disk(struct xs_watch *watch, const char **vec, unsigned int len) { + device_t dev; struct xbb_softc *xbb; int error; - u_int max_ring_page_order; - - DPRINTF("Attaching to %s\n", xenbus_get_node(dev)); - /* - * Basic initialization. - * After this block it is safe to call xbb_detach() - * to clean up any allocated data for this instance. - */ + dev = (device_t) watch->callback_data; xbb = device_get_softc(dev); - xbb->dev = dev; - xbb->otherend_id = xenbus_get_otherend_id(dev); - TASK_INIT(&xbb->io_task, /*priority*/0, xbb_run_queue, xbb); - mtx_init(&xbb->lock, device_get_nameunit(dev), NULL, MTX_DEF); - /* - * Publish protocol capabilities for consumption by the - * front-end. - */ - error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), - "feature-barrier", "1"); - if (error) { - xbb_attach_failed(xbb, error, "writing %s/feature-barrier", - xenbus_get_node(xbb->dev)); - return (error); - } + error = xs_gather(XST_NIL, xenbus_get_node(dev), "physical-device-path", + NULL, &xbb->dev_name, NULL); + if (error != 0) + return; - error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), - "feature-flush-cache", "1"); - if (error) { - xbb_attach_failed(xbb, error, "writing %s/feature-flush-cache", - xenbus_get_node(xbb->dev)); - return (error); - } - - max_ring_page_order = flsl(XBB_MAX_RING_PAGES) - 1; - error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), - "max-ring-page-order", "%u", max_ring_page_order); - if (error) { - xbb_attach_failed(xbb, error, "writing %s/max-ring-page-order", - xenbus_get_node(xbb->dev)); - return (error); - } + xs_unregister_watch(watch); + free(watch->node, M_XENBLOCKBACK); + watch->node = NULL; /* Collect physical device information. */ error = xs_gather(XST_NIL, xenbus_get_otherend_path(xbb->dev), @@ -3648,12 +3620,11 @@ xbb_attach(device_t dev) error = xs_gather(XST_NIL, xenbus_get_node(dev), "mode", NULL, &xbb->dev_mode, - "params", NULL, &xbb->dev_name, NULL); if (error != 0) { xbb_attach_failed(xbb, error, "reading backend fields at %s", xenbus_get_node(dev)); - return (ENXIO); + return; } /* Parse fopen style mode flags. */ @@ -3664,13 +3635,11 @@ xbb_attach(device_t dev) * Verify the physical device is present and can support * the desired I/O mode. */ - DROP_GIANT(); error = xbb_open_backend(xbb); - PICKUP_GIANT(); if (error != 0) { xbb_attach_failed(xbb, error, "Unable to open %s", xbb->dev_name); - return (ENXIO); + return; } /* Use devstat(9) for recording statistics. */ @@ -3702,7 +3671,7 @@ xbb_attach(device_t dev) /*contxt*/&xbb->io_taskqueue); if (xbb->io_taskqueue == NULL) { xbb_attach_failed(xbb, error, "Unable to create taskqueue"); - return (ENOMEM); + return; } taskqueue_start_threads(&xbb->io_taskqueue, @@ -3717,10 +3686,89 @@ xbb_attach(device_t dev) if (error) { xbb_attach_failed(xbb, error, "writing %s/hotplug-status", xenbus_get_node(xbb->dev)); - return (error); + return; } /* Tell the front end that we are ready to connect. */ + xenbus_set_state(dev, XenbusStateInitialised); +} + +/** + * Attach to a XenBus device that has been claimed by our probe routine. + * + * \param dev NewBus device object representing this Xen Block Back instance. + * + * \return 0 for success, errno codes for failure. + */ +static int +xbb_attach(device_t dev) +{ + struct xbb_softc *xbb; + int error; + u_int max_ring_page_order; + struct sbuf *watch_path; + + DPRINTF("Attaching to %s\n", xenbus_get_node(dev)); + + /* + * Basic initialization. + * After this block it is safe to call xbb_detach() + * to clean up any allocated data for this instance. + */ + xbb = device_get_softc(dev); + xbb->dev = dev; + xbb->otherend_id = xenbus_get_otherend_id(dev); + TASK_INIT(&xbb->io_task, /*priority*/0, xbb_run_queue, xbb); + mtx_init(&xbb->lock, device_get_nameunit(dev), NULL, MTX_DEF); + + /* + * Publish protocol capabilities for consumption by the + * front-end. + */ + error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), + "feature-barrier", "1"); + if (error) { + xbb_attach_failed(xbb, error, "writing %s/feature-barrier", + xenbus_get_node(xbb->dev)); + return (error); + } + + error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), + "feature-flush-cache", "1"); + if (error) { + xbb_attach_failed(xbb, error, "writing %s/feature-flush-cache", + xenbus_get_node(xbb->dev)); + return (error); + } + + max_ring_page_order = flsl(XBB_MAX_RING_PAGES) - 1; + error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), + "max-ring-page-order", "%u", max_ring_page_order); + if (error) { + xbb_attach_failed(xbb, error, "writing %s/max-ring-page-order", + xenbus_get_node(xbb->dev)); + return (error); + } + + /* + * We need to wait for hotplug script execution before + * moving forward. + */ + watch_path = xs_join(xenbus_get_node(xbb->dev), "physical-device-path"); + xbb->hotplug_watch.callback_data = (uintptr_t)dev; + xbb->hotplug_watch.callback = xbb_attach_disk; + KASSERT(xbb->hotplug_watch.node == NULL, ("watch node already setup")); + xbb->hotplug_watch.node = strdup(sbuf_data(watch_path), M_XENBLOCKBACK); + sbuf_delete(watch_path); + error = xs_register_watch(&xbb->hotplug_watch); + if (error != 0) { + xbb_attach_failed(xbb, error, "failed to create watch on %s", + xbb->hotplug_watch.node); + free(xbb->hotplug_watch.node, M_XENBLOCKBACK); + return (error); + } + + /* Tell the toolstack blkback has attached. */ xenbus_set_state(dev, XenbusStateInitWait); return (0); From owner-svn-src-head@freebsd.org Fri Jun 3 11:39:37 2016 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 42624B68B1A; Fri, 3 Jun 2016 11:39:37 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id E564B14E9; Fri, 3 Jun 2016 11:39:36 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53BdauI085408; Fri, 3 Jun 2016 11:39:36 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53BdakP085407; Fri, 3 Jun 2016 11:39:36 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606031139.u53BdakP085407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 3 Jun 2016 11:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301269 - head/sys/dev/xen/blkback 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.22 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, 03 Jun 2016 11:39:37 -0000 Author: royger Date: Fri Jun 3 11:39:35 2016 New Revision: 301269 URL: https://svnweb.freebsd.org/changeset/base/301269 Log: xen-blkback: fix error path on failed attach The current error path in case of failure during attach/initialization is not correct and leaves blkback in a stuck state. This is due to blkback waiting for blkfront to switch to state XenbusStateClosed, but if blkfront never attached (because the guest is not even started) it cannot possibly make it to that state. Instead just wait for the frontend to be in a state different than XenbusStateConnected in order to proceed with the shutdown. Also, it is wrong to call xbb_detach directly because it destroys the lock which can still be used by xbb_frontend_changed. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Fri Jun 3 11:38:52 2016 (r301268) +++ head/sys/dev/xen/blkback/blkback.c Fri Jun 3 11:39:35 2016 (r301269) @@ -172,7 +172,6 @@ struct xbb_xen_req; static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt, ...) __attribute__((format(printf, 3, 4))); static int xbb_shutdown(struct xbb_softc *xbb); -static int xbb_detach(device_t dev); /*------------------------------ Data Structures -----------------------------*/ @@ -3419,8 +3418,8 @@ xbb_shutdown(struct xbb_softc *xbb) mtx_lock(&xbb->lock); xbb->flags &= ~XBBF_IN_SHUTDOWN; - /* The front can submit I/O until entering the closed state. */ - if (frontState < XenbusStateClosed) + /* Wait for the frontend to disconnect (if it's connected). */ + if (frontState == XenbusStateConnected) return (EAGAIN); DPRINTF("\n"); @@ -3477,7 +3476,9 @@ xbb_attach_failed(struct xbb_softc *xbb, xs_printf(XST_NIL, xenbus_get_node(xbb->dev), "online", "0"); - xbb_detach(xbb->dev); + mtx_lock(&xbb->lock); + xbb_shutdown(xbb); + mtx_unlock(&xbb->lock); } /*---------------------------- NewBus Entrypoints ----------------------------*/ From owner-svn-src-head@freebsd.org Fri Jun 3 12:40:41 2016 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 64003B685ED; Fri, 3 Jun 2016 12:40:41 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 27859145B; Fri, 3 Jun 2016 12:40:40 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-143.nat-2.net.cam.ac.uk [131.111.5.143]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id B5CCED78FE; Fri, 3 Jun 2016 12:40:34 +0000 (UTC) Date: Fri, 3 Jun 2016 13:40:31 +0100 From: Andrew Turner To: Svatopluk Kraus Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301266 - head/sys/arm/freescale/imx Message-ID: <20160603134031.7a038244@zapp> In-Reply-To: <201606031105.u53B5tVi073576@repo.freebsd.org> References: <201606031105.u53B5tVi073576@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 12:40:41 -0000 On Fri, 3 Jun 2016 11:05:55 +0000 (UTC) Svatopluk Kraus wrote: > Author: skra > Date: Fri Jun 3 11:05:55 2016 > New Revision: 301266 > URL: https://svnweb.freebsd.org/changeset/base/301266 > > Log: > Postpone allocation of IRQ resource to the time when interrupt > controller devices are attached. This has already been done for > bus_setup_intr(). > > There was no doubt that if someone wants to setup an interrupt, > corresponding interrupt controller device must already be attached. > However, the same must be valid for allocation of an interrupt > resource unless the allocation is done blindly, without any > information that such interrupt even exists. While it was done this > blind way before, it won't be possible after next INTRNG change. > > Modified: > head/sys/arm/freescale/imx/imx6_anatop.c > > Modified: head/sys/arm/freescale/imx/imx6_anatop.c > ============================================================================== > --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 > 10:28:06 2016 (r301265) +++ > head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 11:05:55 > 2016 (r301266) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); > static struct resource_spec imx6_anatop_spec[] = { > { SYS_RES_MEMORY, 0, RF_ACTIVE }, > - { SYS_RES_IRQ, 0, RF_ACTIVE }, Why not mark it as optional? Andrew From owner-svn-src-head@freebsd.org Fri Jun 3 13:57:12 2016 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 5C165B68CF0; Fri, 3 Jun 2016 13:57:12 +0000 (UTC) (envelope-from bz@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 mx1.freebsd.org (Postfix) with ESMTPS id 12BF21015; Fri, 3 Jun 2016 13:57:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53DvBFX036454; Fri, 3 Jun 2016 13:57:11 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53DvAJ0036445; Fri, 3 Jun 2016 13:57:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606031357.u53DvAJ0036445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 3 Jun 2016 13:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301270 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 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.22 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, 03 Jun 2016 13:57:12 -0000 Author: bz Date: Fri Jun 3 13:57:10 2016 New Revision: 301270 URL: https://svnweb.freebsd.org/changeset/base/301270 Log: Introduce a per-VNET flag to enable/disable netisr prcessing on that VNET. Add accessor functions to toggle the state per VNET. The base system (vnet0) will always enable itself with the normal registration. We will share the registered protocol handlers in all VNETs minimising duplication and management. Upon disabling netisr processing for a VNET drain the netisr queue from packets for that VNET. Update netisr consumers to (de)register on a per-VNET start/teardown using VNET_SYS(UN)INIT functionality. The change should be transparent for non-VIMAGE kernels. Reviewed by: gnn (, hiren) Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6691 Modified: head/share/man/man9/netisr.9 head/sys/net/if_epair.c head/sys/net/if_ethersubr.c head/sys/net/netisr.c head/sys/net/netisr.h head/sys/net/rtsock.c head/sys/netinet/if_ether.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Fri Jun 3 11:39:35 2016 (r301269) +++ head/share/man/man9/netisr.9 Fri Jun 3 13:57:10 2016 (r301270) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2015 +.Dd June 3, 2016 .Dt NETISR 9 .Os .Sh NAME @@ -61,6 +61,16 @@ .Fn netisr_get_cpucount "void" .Ft u_int .Fn netisr_get_cpuid "u_int cpunumber" +.Pp +With optional virtual network stack support enabled via the following kernel +compile option: +.Bd -ragged -offset indent +.Cd "options VIMAGE" +.Ed +.Ft void +.Fn netisr_register_vnet "const struct netisr_handler *nhp" +.Ft void +.Fn netisr_unregister_vnet "const struct netisr_handler *nhp" .Sh DESCRIPTION The .Nm @@ -80,6 +90,16 @@ and may also manage queue limits and sta and .Fn netisr_setqlimit . .Pp +In case of VIMAGE kernels each virtual network stack (vnet), that is not the +default base system network stack, calls +.Fn netisr_register_vnet +and +.Fn netisr_unregister_vnet +to enable or disable packet processing by the +.Nm +for each protocol. +Disabling will also purge any outstanding packet from the protocol queue. +.Pp .Nm supports multi-processor execution of handlers, and relies on a combination of source ordering and protocol-specific ordering and work-placement Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/net/if_epair.c Fri Jun 3 13:57:10 2016 (r301270) @@ -959,6 +959,9 @@ vnet_epair_init(const void *unused __unu V_epair_cloner = if_clone_advanced(epairname, 0, epair_clone_match, epair_clone_create, epair_clone_destroy); +#ifdef VIMAGE + netisr_register_vnet(&epair_nh); +#endif } VNET_SYSINIT(vnet_epair_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_epair_init, NULL); @@ -967,6 +970,9 @@ static void vnet_epair_uninit(const void *unused __unused) { +#ifdef VIMAGE + netisr_unregister_vnet(&epair_nh); +#endif if_clone_detach(V_epair_cloner); } VNET_SYSUNINIT(vnet_epair_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/net/if_ethersubr.c Fri Jun 3 13:57:10 2016 (r301270) @@ -702,12 +702,16 @@ vnet_ether_init(__unused void *arg) if ((i = pfil_head_register(&V_link_pfil_hook)) != 0) printf("%s: WARNING: unable to register pfil link hook, " "error %d\n", __func__, i); +#ifdef VIMAGE + netisr_register_vnet(ðer_nh); +#endif } VNET_SYSINIT(vnet_ether_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, vnet_ether_init, NULL); +#ifdef VIMAGE static void -vnet_ether_destroy(__unused void *arg) +vnet_ether_pfil_destroy(__unused void *arg) { int i; @@ -715,8 +719,18 @@ vnet_ether_destroy(__unused void *arg) printf("%s: WARNING: unable to unregister pfil link hook, " "error %d\n", __func__, i); } +VNET_SYSUNINIT(vnet_ether_pfil_uninit, SI_SUB_PROTO_PFIL, SI_ORDER_ANY, + vnet_ether_pfil_destroy, NULL); + +static void +vnet_ether_destroy(__unused void *arg) +{ + + netisr_unregister_vnet(ðer_nh); +} VNET_SYSUNINIT(vnet_ether_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, vnet_ether_destroy, NULL); +#endif @@ -740,7 +754,9 @@ ether_input(struct ifnet *ifp, struct mb * so assert it is correct here. */ KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + CURVNET_SET_QUIET(ifp->if_vnet); netisr_dispatch(NETISR_ETHER, m); + CURVNET_RESTORE(); m = mn; } } Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/net/netisr.c Fri Jun 3 13:57:10 2016 (r301270) @@ -210,6 +210,23 @@ SYSCTL_UINT(_net_isr, OID_AUTO, maxprot, */ static struct netisr_proto netisr_proto[NETISR_MAXPROT]; +#ifdef VIMAGE +/* + * The netisr_enable array describes a per-VNET flag for registered + * protocols on whether this netisr is active in this VNET or not. + * netisr_register() will automatically enable the netisr for the + * default VNET and all currently active instances. + * netisr_unregister() will disable all active VNETs, including vnet0. + * Individual network stack instances can be enabled/disabled by the + * netisr_(un)register _vnet() functions. + * With this we keep the one netisr_proto per protocol but add a + * mechanism to stop netisr processing for vnet teardown. + * Apart from that we expect a VNET to always be enabled. + */ +static VNET_DEFINE(u_int, netisr_enable[NETISR_MAXPROT]); +#define V_netisr_enable VNET(netisr_enable) +#endif + /* * Per-CPU workstream data. See netisr_internal.h for more details. */ @@ -352,6 +369,7 @@ sysctl_netisr_dispatch_policy(SYSCTL_HAN void netisr_register(const struct netisr_handler *nhp) { + VNET_ITERATOR_DECL(vnet_iter); struct netisr_work *npwp; const char *name; u_int i, proto; @@ -420,6 +438,22 @@ netisr_register(const struct netisr_hand bzero(npwp, sizeof(*npwp)); npwp->nw_qlimit = netisr_proto[proto].np_qlimit; } + +#ifdef VIMAGE + /* + * Test that we are in vnet0 and have a curvnet set. + */ + KASSERT(curvnet != NULL, ("%s: curvnet is NULL", __func__)); + KASSERT(IS_DEFAULT_VNET(curvnet), ("%s: curvnet %p is not vnet0 %p", + __func__, curvnet, vnet0)); + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_netisr_enable[proto] = 1; + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); +#endif NETISR_WUNLOCK(); } @@ -584,6 +618,7 @@ netisr_drain_proto(struct netisr_work *n void netisr_unregister(const struct netisr_handler *nhp) { + VNET_ITERATOR_DECL(vnet_iter); struct netisr_work *npwp; #ifdef INVARIANTS const char *name; @@ -602,6 +637,16 @@ netisr_unregister(const struct netisr_ha ("%s(%u): protocol not registered for %s", __func__, proto, name)); +#ifdef VIMAGE + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_netisr_enable[proto] = 0; + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); +#endif + netisr_proto[proto].np_name = NULL; netisr_proto[proto].np_handler = NULL; netisr_proto[proto].np_m2flow = NULL; @@ -616,6 +661,97 @@ netisr_unregister(const struct netisr_ha NETISR_WUNLOCK(); } +#ifdef VIMAGE +void +netisr_register_vnet(const struct netisr_handler *nhp) +{ + u_int proto; + + proto = nhp->nh_proto; + + KASSERT(curvnet != NULL, ("%s: curvnet is NULL", __func__)); + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, nhp->nh_name)); + NETISR_WLOCK(); + KASSERT(netisr_proto[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + nhp->nh_name)); + + V_netisr_enable[proto] = 1; + NETISR_WUNLOCK(); +} + +static void +netisr_drain_proto_vnet(struct vnet *vnet, u_int proto) +{ + struct netisr_workstream *nwsp; + struct netisr_work *npwp; + struct mbuf *m, *mp, *n, *ne; + u_int i; + + KASSERT(vnet != NULL, ("%s: vnet is NULL", __func__)); + NETISR_LOCK_ASSERT(); + + CPU_FOREACH(i) { + nwsp = DPCPU_ID_PTR(i, nws); + if (nwsp->nws_intr_event == NULL) + continue; + npwp = &nwsp->nws_work[proto]; + NWS_LOCK(nwsp); + + /* + * Rather than dissecting and removing mbufs from the middle + * of the chain, we build a new chain if the packet stays and + * update the head and tail pointers at the end. All packets + * matching the given vnet are freed. + */ + m = npwp->nw_head; + n = ne = NULL; + while (m != NULL) { + mp = m; + m = m->m_nextpkt; + mp->m_nextpkt = NULL; + if (mp->m_pkthdr.rcvif->if_vnet != vnet) { + if (n == NULL) { + n = ne = mp; + } else { + ne->m_nextpkt = mp; + ne = mp; + } + continue; + } + /* This is a packet in the selected vnet. Free it. */ + npwp->nw_len--; + m_freem(mp); + } + npwp->nw_head = n; + npwp->nw_tail = ne; + NWS_UNLOCK(nwsp); + } +} + +void +netisr_unregister_vnet(const struct netisr_handler *nhp) +{ + u_int proto; + + proto = nhp->nh_proto; + + KASSERT(curvnet != NULL, ("%s: curvnet is NULL", __func__)); + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, nhp->nh_name)); + NETISR_WLOCK(); + KASSERT(netisr_proto[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + nhp->nh_name)); + + V_netisr_enable[proto] = 0; + + netisr_drain_proto_vnet(curvnet, proto); + NETISR_WUNLOCK(); +} +#endif + /* * Compose the global and per-protocol policies on dispatch, and return the * dispatch policy to use. @@ -906,6 +1042,13 @@ netisr_queue_src(u_int proto, uintptr_t KASSERT(netisr_proto[proto].np_handler != NULL, ("%s: invalid proto %u", __func__, proto)); +#ifdef VIMAGE + if (V_netisr_enable[proto] == 0) { + m_freem(m); + return (ENOPROTOOPT); + } +#endif + m = netisr_select_cpuid(&netisr_proto[proto], NETISR_DISPATCH_DEFERRED, source, m, &cpuid); if (m != NULL) { @@ -952,6 +1095,13 @@ netisr_dispatch_src(u_int proto, uintptr KASSERT(npp->np_handler != NULL, ("%s: invalid proto %u", __func__, proto)); +#ifdef VIMAGE + if (V_netisr_enable[proto] == 0) { + m_freem(m); + return (ENOPROTOOPT); + } +#endif + dispatch_policy = netisr_get_dispatch(npp); if (dispatch_policy == NETISR_DISPATCH_DEFERRED) return (netisr_queue_src(proto, source, m)); Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/net/netisr.h Fri Jun 3 13:57:10 2016 (r301270) @@ -210,6 +210,10 @@ void netisr_getqlimit(const struct netis void netisr_register(const struct netisr_handler *nhp); int netisr_setqlimit(const struct netisr_handler *nhp, u_int qlimit); void netisr_unregister(const struct netisr_handler *nhp); +#ifdef VIMAGE +void netisr_register_vnet(const struct netisr_handler *nhp); +void netisr_unregister_vnet(const struct netisr_handler *nhp); +#endif /* * Process a packet destined for a protocol, and attempt direct dispatch. Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/net/rtsock.c Fri Jun 3 13:57:10 2016 (r301270) @@ -191,15 +191,33 @@ SYSCTL_PROC(_net_route, OID_AUTO, netisr "maximum routing socket dispatch queue length"); static void -rts_init(void) +vnet_rts_init(void) { int tmp; - if (TUNABLE_INT_FETCH("net.route.netisr_maxqlen", &tmp)) - rtsock_nh.nh_qlimit = tmp; - netisr_register(&rtsock_nh); + if (IS_DEFAULT_VNET(curvnet)) { + if (TUNABLE_INT_FETCH("net.route.netisr_maxqlen", &tmp)) + rtsock_nh.nh_qlimit = tmp; + netisr_register(&rtsock_nh); + } +#ifdef VIMAGE + else + netisr_register_vnet(&rtsock_nh); +#endif +} +VNET_SYSINIT(vnet_rtsock, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, + vnet_rts_init, 0); + +#ifdef VIMAGE +static void +vnet_rts_uninit(void) +{ + + netisr_unregister_vnet(&rtsock_nh); } -SYSINIT(rtsock, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, rts_init, 0); +VNET_SYSUNINIT(vnet_rts_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, + vnet_rts_uninit, 0); +#endif static int raw_input_rts_cb(struct mbuf *m, struct sockproto *proto, struct sockaddr *src, Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/netinet/if_ether.c Fri Jun 3 13:57:10 2016 (r301270) @@ -143,7 +143,6 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT } while (0) -static void arp_init(void); static void arpintr(struct mbuf *); static void arptimer(void *); #ifdef INET @@ -1337,12 +1336,33 @@ arp_iflladdr(void *arg __unused, struct } static void -arp_init(void) +vnet_arp_init(void) { - netisr_register(&arp_nh); - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { + netisr_register(&arp_nh); iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); + } +#ifdef VIMAGE + else + netisr_register_vnet(&arp_nh); +#endif } -SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); +VNET_SYSINIT(vnet_arp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_SECOND, + vnet_arp_init, 0); + +#ifdef VIMAGE +/* + * We have to unregister ARP along with IP otherwise we risk doing INADDR_HASH + * lookups after destroying the hash. Ideally this would go on SI_ORDER_3.5. + */ +static void +vnet_arp_destroy(__unused void *arg) +{ + + netisr_unregister_vnet(&arp_nh); +} +VNET_SYSUNINIT(vnet_arp_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, + vnet_arp_destroy, NULL); +#endif Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/netinet/ip_input.c Fri Jun 3 13:57:10 2016 (r301270) @@ -331,8 +331,15 @@ ip_init(void) __func__); /* Skip initialization of globals for non-default instances. */ - if (!IS_DEFAULT_VNET(curvnet)) +#ifdef VIMAGE + if (!IS_DEFAULT_VNET(curvnet)) { + netisr_register_vnet(&ip_nh); +#ifdef RSS + netisr_register_vnet(&ip_direct_nh); +#endif return; + } +#endif pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); if (pr == NULL) @@ -366,6 +373,11 @@ ip_destroy(void *unused __unused) { int error; +#ifdef RSS + netisr_unregister_vnet(&ip_direct_nh); +#endif + netisr_unregister_vnet(&ip_nh); + if ((error = pfil_head_unregister(&V_inet_pfil_hook)) != 0) printf("%s: WARNING: unable to unregister pfil hook, " "error %d\n", __func__, error); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri Jun 3 11:39:35 2016 (r301269) +++ head/sys/netinet6/ip6_input.c Fri Jun 3 13:57:10 2016 (r301270) @@ -217,8 +217,15 @@ ip6_init(void) V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; /* Skip global initialization stuff for non-default instances. */ - if (!IS_DEFAULT_VNET(curvnet)) +#ifdef VIMAGE + if (!IS_DEFAULT_VNET(curvnet)) { + netisr_register_vnet(&ip6_nh); +#ifdef RSS + netisr_register_vnet(&ip6_direct_nh); +#endif return; + } +#endif pr = pffindproto(PF_INET6, IPPROTO_RAW, SOCK_RAW); if (pr == NULL) @@ -310,6 +317,11 @@ ip6_destroy(void *unused __unused) { int error; +#ifdef RSS + netisr_unregister_vnet(&ip6_direct_nh); +#endif + netisr_unregister_vnet(&ip6_nh); + if ((error = pfil_head_unregister(&V_inet6_pfil_hook)) != 0) printf("%s: WARNING: unable to unregister pfil hook, " "error %d\n", __func__, error); From owner-svn-src-head@freebsd.org Fri Jun 3 14:05:25 2016 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 141D7B68E6C; Fri, 3 Jun 2016 14:05:25 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE9E316C6; Fri, 3 Jun 2016 14:05:24 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-io0-f175.google.com with SMTP id p194so75792338iod.1; Fri, 03 Jun 2016 07:05:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=seqEaikiqXv+TsfYzFM7E+SJUdu7bfqU3URYrqLbjnE=; b=L33dY9vONJU1YW2KVeryEOo/Wq9ERxJZ2lW/W3bIlR3x1MJgDfE+IgNvmV1tCuP5WJ mtGpX37Xj0P16oktTXraA00MmxhUYEmi2PDWaixc5U3Q4k8Nk3aukkbnWQSprwnQ9lbB mOZtQkj/ZADStY8Ao/GVdHNmhdxDpoG3RmQM5pDq/kjfsy9tBSdkMrHUqtPUrkQoPxCP +mcwmrB2yuv92JUyOfu/nVnOlf/P6Q6cxLce0mCQjN3o5JFNN2Fush7Tzavxra9VCYq+ c+w8zqGKTRwasOCzA1aSVIT26HlisuaJ+bJycaSmIAb/fXrqYPJCrJr/+VJ2Tq0uY4mm lyGw== X-Gm-Message-State: ALyK8tJ/NqmQir4AQWSMb9EddUUonhhjhYMAvPhZTNEa02wD1LgVZYRJmAnZRnU8YT0VmA== X-Received: by 10.107.140.132 with SMTP id o126mr5375599iod.70.1464962347193; Fri, 03 Jun 2016 06:59:07 -0700 (PDT) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com. [209.85.214.51]) by smtp.gmail.com with ESMTPSA id h125sm2842388ioa.20.2016.06.03.06.59.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Jun 2016 06:59:07 -0700 (PDT) Received: by mail-it0-f51.google.com with SMTP id f67so9491700ith.1; Fri, 03 Jun 2016 06:59:06 -0700 (PDT) X-Received: by 10.36.61.199 with SMTP id n190mr5556890itn.64.1464962346586; Fri, 03 Jun 2016 06:59:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.60.67 with HTTP; Fri, 3 Jun 2016 06:59:06 -0700 (PDT) In-Reply-To: <20160603134031.7a038244@zapp> References: <201606031105.u53B5tVi073576@repo.freebsd.org> <20160603134031.7a038244@zapp> From: Svatopluk Kraus Date: Fri, 3 Jun 2016 15:59:06 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r301266 - head/sys/arm/freescale/imx To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 14:05:25 -0000 On Fri, Jun 3, 2016 at 2:40 PM, Andrew Turner wrote: > On Fri, 3 Jun 2016 11:05:55 +0000 (UTC) > Svatopluk Kraus wrote: > >> Author: skra >> Date: Fri Jun 3 11:05:55 2016 >> New Revision: 301266 >> URL: https://svnweb.freebsd.org/changeset/base/301266 >> >> Log: >> Postpone allocation of IRQ resource to the time when interrupt >> controller devices are attached. This has already been done for >> bus_setup_intr(). >> >> There was no doubt that if someone wants to setup an interrupt, >> corresponding interrupt controller device must already be attached. >> However, the same must be valid for allocation of an interrupt >> resource unless the allocation is done blindly, without any >> information that such interrupt even exists. While it was done this >> blind way before, it won't be possible after next INTRNG change. >> >> Modified: >> head/sys/arm/freescale/imx/imx6_anatop.c >> >> Modified: head/sys/arm/freescale/imx/imx6_anatop.c >> ============================================================================== >> --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 >> 10:28:06 2016 (r301265) +++ >> head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 11:05:55 >> 2016 (r301266) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); >> static struct resource_spec imx6_anatop_spec[] = { >> { SYS_RES_MEMORY, 0, RF_ACTIVE }, >> - { SYS_RES_IRQ, 0, RF_ACTIVE }, > > Why not mark it as optional? The interrupt resource must be allocated in any case. So, I do not see any reason why to make it RF_OPTIONAL. > > Andrew From owner-svn-src-head@freebsd.org Fri Jun 3 14:09:40 2016 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 1378FB6813B; Fri, 3 Jun 2016 14:09:40 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id D9FA71DCE; Fri, 3 Jun 2016 14:09:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53E9dnb040387; Fri, 3 Jun 2016 14:09:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53E9dqJ040385; Fri, 3 Jun 2016 14:09:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606031409.u53E9dqJ040385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 3 Jun 2016 14:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301271 - head/crypto/openssl/crypto 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.22 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, 03 Jun 2016 14:09:40 -0000 Author: avg Date: Fri Jun 3 14:09:38 2016 New Revision: 301271 URL: https://svnweb.freebsd.org/changeset/base/301271 Log: openssl: change SHLIB_VERSION_NUMBER to reflect the reality Some consumers actually use this definition. We probably need some procedure to ensure that SHLIB_VERSION_NUMBER is updated whenever we change the library version in secure/lib/libssl/Makefile. Modified: head/crypto/openssl/crypto/opensslv.h Modified: head/crypto/openssl/crypto/opensslv.h ============================================================================== --- head/crypto/openssl/crypto/opensslv.h Fri Jun 3 13:57:10 2016 (r301270) +++ head/crypto/openssl/crypto/opensslv.h Fri Jun 3 14:09:38 2016 (r301271) @@ -88,7 +88,7 @@ extern "C" { * should only keep the versions that are binary compatible with the current. */ # define SHLIB_VERSION_HISTORY "" -# define SHLIB_VERSION_NUMBER "7" +# define SHLIB_VERSION_NUMBER "8" #ifdef __cplusplus From owner-svn-src-head@freebsd.org Fri Jun 3 14:22:13 2016 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 A28E1B68433; Fri, 3 Jun 2016 14:22:13 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 73BBA16DD; Fri, 3 Jun 2016 14:22:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53EMC8K046950; Fri, 3 Jun 2016 14:22:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53EMClR046949; Fri, 3 Jun 2016 14:22:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606031422.u53EMClR046949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 3 Jun 2016 14:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301273 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.22 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, 03 Jun 2016 14:22:13 -0000 Author: avg Date: Fri Jun 3 14:22:12 2016 New Revision: 301273 URL: https://svnweb.freebsd.org/changeset/base/301273 Log: zfs_root: fix a potential root vnode reference leak It could happen in an unlikely case that we fail to lock the root vnode with requested flags (which appear to never include LK_NOWAIT). MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jun 3 14:14:55 2016 (r301272) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jun 3 14:22:12 2016 (r301273) @@ -1780,11 +1780,13 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t ZFS_EXIT(zfsvfs); - if (error == 0) + if (error == 0) { error = vn_lock(*vpp, flags); - if (error != 0) - *vpp = NULL; - + if (error != 0) { + VN_RELE(*vpp); + *vpp = NULL; + } + } return (error); } From owner-svn-src-head@freebsd.org Fri Jun 3 14:23:00 2016 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 2E856B6848F for ; Fri, 3 Jun 2016 14:23:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 95576189A for ; Fri, 3 Jun 2016 14:22:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ac906def-2996-11e6-ac92-3142cfe117f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.eu.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 3 Jun 2016 14:22:59 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u53EMq2D000989; Fri, 3 Jun 2016 08:22:52 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464963772.1204.195.camel@freebsd.org> Subject: Re: svn commit: r301266 - head/sys/arm/freescale/imx From: Ian Lepore To: Andrew Turner , Svatopluk Kraus Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 03 Jun 2016 08:22:52 -0600 In-Reply-To: <20160603134031.7a038244@zapp> References: <201606031105.u53B5tVi073576@repo.freebsd.org> <20160603134031.7a038244@zapp> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 14:23:00 -0000 On Fri, 2016-06-03 at 13:40 +0100, Andrew Turner wrote: > On Fri, 3 Jun 2016 11:05:55 +0000 (UTC) > Svatopluk Kraus wrote: > > > Author: skra > > Date: Fri Jun 3 11:05:55 2016 > > New Revision: 301266 > > URL: https://svnweb.freebsd.org/changeset/base/301266 > > > > Log: > > Postpone allocation of IRQ resource to the time when interrupt > > controller devices are attached. This has already been done for > > bus_setup_intr(). > > > > There was no doubt that if someone wants to setup an interrupt, > > corresponding interrupt controller device must already be > > attached. > > However, the same must be valid for allocation of an interrupt > > resource unless the allocation is done blindly, without any > > information that such interrupt even exists. While it was done this > > blind way before, it won't be possible after next INTRNG change. > > > > Modified: > > head/sys/arm/freescale/imx/imx6_anatop.c > > > > Modified: head/sys/arm/freescale/imx/imx6_anatop.c > > =================================================================== > > =========== > > --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 > > 10:28:06 2016 (r301265) +++ > > head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 11:05:55 > > 2016 (r301266) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); > > static struct resource_spec imx6_anatop_spec[] = { > > { SYS_RES_MEMORY, 0, RF_ACTIVE }, > > - { SYS_RES_IRQ, 0, RF_ACTIVE }, > > Why not mark it as optional? No point, really. The anatop driver attaches at BUS_PASS_BUS, way before interrupt controllers, so it's not like attach-time allocation will ever work, optional or not. (It's not a bus, it's a driver for regulators and some cpu/soc control stuff that almost every other driver will need, but we don't have a named bus pass early enough for that, other than _BUS). -- Ian From owner-svn-src-head@freebsd.org Fri Jun 3 14:30:34 2016 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 64BC5B68791; Fri, 3 Jun 2016 14:30:34 +0000 (UTC) (envelope-from vangyzen@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 mx1.freebsd.org (Postfix) with ESMTPS id 25AA51DF1; Fri, 3 Jun 2016 14:30:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53EUX7A047852; Fri, 3 Jun 2016 14:30:33 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53EUXfo047847; Fri, 3 Jun 2016 14:30:33 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201606031430.u53EUXfo047847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 3 Jun 2016 14:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301274 - in head: lib/libc/sys share/man/man3 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.22 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, 03 Jun 2016 14:30:34 -0000 Author: vangyzen Date: Fri Jun 3 14:30:32 2016 New Revision: 301274 URL: https://svnweb.freebsd.org/changeset/base/301274 Log: Improve errno documentation in pthread_create(3) and thr_new(2) Add some missing errno values to thr_new(2) and pthread_create(3). In particular, EDEADLK was not documented in the latter. While I'm here, improve some English and cross-references. Reviewed by: kib Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6663 Modified: head/lib/libc/sys/cpuset_getaffinity.2 head/lib/libc/sys/thr_new.2 head/share/man/man3/pthread_attr_affinity_np.3 head/share/man/man3/pthread_create.3 Modified: head/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- head/lib/libc/sys/cpuset_getaffinity.2 Fri Jun 3 14:22:12 2016 (r301273) +++ head/lib/libc/sys/cpuset_getaffinity.2 Fri Jun 3 14:30:32 2016 (r301274) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2015 +.Dd June 2, 2016 .Dt CPUSET_GETAFFINITY 2 .Os .Sh NAME @@ -114,6 +114,8 @@ to the value in The following error codes may be set in .Va errno : .Bl -tag -width Er +.\" When changing this list, consider updating share/man/man3/pthread_create.3, +.\" since that function can return any of these errors. .It Bq Er EINVAL The .Fa level Modified: head/lib/libc/sys/thr_new.2 ============================================================================== --- head/lib/libc/sys/thr_new.2 Fri Jun 3 14:22:12 2016 (r301273) +++ head/lib/libc/sys/thr_new.2 Fri Jun 3 14:30:32 2016 (r301274) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd June 2, 2016 .Dt THR_NEW 2 .Os .Sh NAME @@ -175,6 +175,8 @@ The .Fn thr_new operation returns the following errors: .Bl -tag -width Er +.\" When changing this list, consider updating share/man/man3/pthread_create.3, +.\" since that function can return any of these errors. .It Bq Er EFAULT The memory pointed to by the .Fa param @@ -188,7 +190,7 @@ or .Fa rtp arguments is not valid. .It Bq Er EFAULT -Specified stack base is invalid, or the kernel was unable to put required +The specified stack base is invalid, or the kernel was unable to put required initial data on the stack. .It Bq Er EINVAL The @@ -205,6 +207,9 @@ member is not and specifies invalid scheduling parameters. .It Bq Er EINVAL The specified TLS base is invalid. +.It Bq Er EPERM +The caller does not have permission to set the scheduling parameters or +scheduling policy. .It Bq Er EPROCLIM Creation of the new thread would exceed the .Dv RACCT_NTHR @@ -216,7 +221,7 @@ Creation of the new thread would exceed .Xr sysctl 2 limit. .It Bq Er ENOMEM -No kernel memory to allocate for the new thread structures. +There was not enough kernel memory to allocate the new thread structures. .El .Sh SEE ALSO .Xr ps 1 , Modified: head/share/man/man3/pthread_attr_affinity_np.3 ============================================================================== --- head/share/man/man3/pthread_attr_affinity_np.3 Fri Jun 3 14:22:12 2016 (r301273) +++ head/share/man/man3/pthread_attr_affinity_np.3 Fri Jun 3 14:30:32 2016 (r301274) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd June 2, 2016 .Dt PTHREAD_ATTR_AFFINITY_NP 3 .Os .Sh NAME @@ -132,8 +132,8 @@ Insufficient memory exists to store the .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , -.Xr pthread_get_affinity_np 3 , -.Xr pthread_set_affinity_np 3 +.Xr pthread_getaffinity_np 3 , +.Xr pthread_setaffinity_np 3 .Sh STANDARDS The .Nm pthread_attr_getaffinity_np Modified: head/share/man/man3/pthread_create.3 ============================================================================== --- head/share/man/man3/pthread_create.3 Fri Jun 3 14:22:12 2016 (r301273) +++ head/share/man/man3/pthread_create.3 Fri Jun 3 14:30:32 2016 (r301274) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 15, 2014 +.Dd June 2, 2016 .Dt PTHREAD_CREATE 3 .Os .Sh NAME @@ -101,22 +101,41 @@ indicate the error. .Sh ERRORS The .Fn pthread_create -function will fail if: +function can return any of the following errors: .Bl -tag -width Er +.It Bq Er ENOMEM +The system lacked the necessary resources to create another thread. .It Bq Er EAGAIN -The system lacked the necessary resources to create another thread, or -the system-imposed limit on the total number of threads in a process -[PTHREAD_THREADS_MAX] would be exceeded. +The system-imposed limit on the total number of threads in a process +.Dv [PTHREAD_THREADS_MAX] +would be exceeded. +.It Bq Er EAGAIN +The +.Dv RACCT_NTHR +limit would be exceeded; see +.Xr racct 2 . .It Bq Er EPERM -The caller does not have appropriate permission to set the required scheduling -parameters or scheduling policy. +The caller does not have permission to set the scheduling parameters or +scheduling policy. .It Bq Er EINVAL -The value specified by +A value specified by .Fa attr is invalid. +.It Bq Er EDEADLK +The CPU set specified by +.Fa attr +would prevent the thread from running on any CPU. +.It Bq Er EFAULT +The stack base specified by +.Fa attr +is invalid, or the kernel was unable to put required +initial data on the stack. .El .Sh SEE ALSO +.Xr cpuset_setaffinity 2 , .Xr fork 2 , +.Xr racct 2 , +.Xr thr_new 2 , .Xr pthread_attr 3 , .Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , From owner-svn-src-head@freebsd.org Fri Jun 3 14:37:19 2016 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 E924FB68B05; Fri, 3 Jun 2016 14:37:19 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 9C8A1148F; Fri, 3 Jun 2016 14:37:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53EbIm2051618; Fri, 3 Jun 2016 14:37:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53EbI26051616; Fri, 3 Jun 2016 14:37:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606031437.u53EbI26051616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 3 Jun 2016 14:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301275 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.22 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, 03 Jun 2016 14:37:20 -0000 Author: avg Date: Fri Jun 3 14:37:18 2016 New Revision: 301275 URL: https://svnweb.freebsd.org/changeset/base/301275 Log: zfs: set VROOT / VV_ROOT consistently and in a single place This is a followup to r300131. A filesystem's root vnode can be reached not only through VSF_ROOT, but by other means as well. For example, via a dot-dot lookup. Also, a root vnode can get reclaimed and then re-created. For these reasons it was insufficient to clear VV_ROOT flag from a root vnode of a snapshot mounted under .zfs in zfsctl_snapdir_lookup(). So, now we set the flag in zfs_znode_sa_init() only if a vnode represent a root of a filesystem or a standalone snapshot. That is, the flag is not set for snapshots mounted under .zfs. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jun 3 14:30:32 2016 (r301274) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jun 3 14:37:18 2016 (r301275) @@ -1051,13 +1051,6 @@ relookup: */ VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0); goto domount; - } else { - /* - * VROOT was set during the traverse call. We need - * to clear it since we're pretending to be part - * of our parent's vfs. - */ - (*vpp)->v_flag &= ~VROOT; } mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); @@ -1132,7 +1125,6 @@ domount: */ ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs); VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; - (*vpp)->v_flag &= ~VROOT; } ZFS_EXIT(zfsvfs); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Jun 3 14:30:32 2016 (r301274) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Jun 3 14:37:18 2016 (r301275) @@ -574,9 +574,10 @@ zfs_znode_sa_init(zfsvfs_t *zfsvfs, znod zp->z_is_sa = (obj_type == DMU_OT_SA) ? B_TRUE : B_FALSE; /* - * Slap on VROOT if we are the root znode + * Slap on VROOT if we are the root znode unless we are the root + * node of a snapshot mounted under .zfs. */ - if (zp->z_id == zfsvfs->z_root) + if (zp->z_id == zfsvfs->z_root && zfsvfs->z_parent == zfsvfs) ZTOV(zp)->v_flag |= VROOT; mutex_exit(&zp->z_lock); From owner-svn-src-head@freebsd.org Fri Jun 3 14:40:59 2016 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 1A0B9B68BDE for ; Fri, 3 Jun 2016 14:40:59 +0000 (UTC) (envelope-from mst@semihalf.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4A5A194E for ; Fri, 3 Jun 2016 14:40:58 +0000 (UTC) (envelope-from mst@semihalf.com) Received: by mail-it0-x232.google.com with SMTP id n126so5296475itd.1 for ; Fri, 03 Jun 2016 07:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=GW26f8Ek1IaA/aL719Wu71BET147JtBl7iM3QynXPA4=; b=gd92alYUJ1DEbhHwYcUiuZ4v5qhSU6xejIwUKbdakwH1fHbosSLzYgPcj1lsCNiLo6 H6unulo83fWRfPJu+gfGvU4BVBznEIazfq0ULfjCRZqOnROOt6eT6EHVErc7r/gDhiv5 VwGThx+8fBxGeJ2dDiCjiku+HlpjEjjUww6mC1TAov2UtynpCWiSWNkaPomBwrQS4Y4D v58vyTjhiAkIuj+lWWAAptg5p4mBiuHC9rnft44pSiyR9Xyo2Ncw4iZ90Vcp5tVW7Hfh YSe1K3HmPrcohgHJJOcG+bvwYQTb1R/h7V19Lq5+RKolgYTHON3OCWqrFRH+Dt+ye2um 3ejA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=GW26f8Ek1IaA/aL719Wu71BET147JtBl7iM3QynXPA4=; b=hsd5zrEWsTS2NUOXCeeKvtXy4OS5Rwc1+rQYA8KPys9LlncUvrwxgmAvwABpk71nbT DP5Y1yNxra4Sfx6iA0tE3BY/t7xtJs7PeQrAekq1uFhhyiZmxwUVvOsdrtDchdIY0b/Y wdJIbdeCTzOPFLob8zAhl7/8hI+NDEb/6ECEqL2yjrSZJ7/I/w9oWnugNCxtnmEeDSVJ S1DmIhdlzp/4hEex18WMRqVHAnYGYCA4PEWzUWi+6wtAqReDr5bHPDSU/JKFQ5kstyKJ KwhggxicJwgcKTaIyLfn6mnuoKN4nbzqo13FMeIkeXHmDVu8fNGfd9uzXZWztCSW/Xd2 4SDA== X-Gm-Message-State: ALyK8tLdTa/ckA/XT5+OkuHapQDCibFu9y0P6iAdujDFUTUYKRoyg5nGkHuqFkOJD9TMdMiMX+JOO+wAsYgf0g== MIME-Version: 1.0 X-Received: by 10.36.149.215 with SMTP id m206mr5921961itd.20.1464964858029; Fri, 03 Jun 2016 07:40:58 -0700 (PDT) Received: by 10.79.36.201 with HTTP; Fri, 3 Jun 2016 07:40:57 -0700 (PDT) In-Reply-To: <1464903260.1204.191.camel@freebsd.org> References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464895468.1204.188.camel@freebsd.org> <1946366.I33PJXpI92@ralph.baldwin.cx> <1464903260.1204.191.camel@freebsd.org> Date: Fri, 3 Jun 2016 16:40:57 +0200 Message-ID: Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa From: =?UTF-8?Q?Micha=C5=82_Stanek?= To: Ian Lepore Cc: John Baldwin , Zbigniew Bodek , Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: multipart/mixed; boundary=94eb2c05e21af8ebdc053460b56a X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 14:40:59 -0000 --94eb2c05e21af8ebdc053460b56a Content-Type: text/plain; charset=UTF-8 Thanks Ian, here's a patch correcting what you mentioned, please check if it's OK. Best regards, Michal Stanek 2016-06-02 23:34 GMT+02:00 Ian Lepore : > On Thu, 2016-06-02 at 14:05 -0700, John Baldwin wrote: > > On Thursday, June 02, 2016 01:24:28 PM Ian Lepore wrote: > > > On Thu, 2016-06-02 at 21:03 +0200, Zbigniew Bodek wrote: > > > > 2016-06-02 20:48 GMT+02:00 Ian Lepore : > > > > > > > > > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > > > > > > > [...] > > > > > > I've always said that phabricator was primarily a spam-generation > > > tool, > > > and now that seems to be true in spades. It apparently only > > > delivers > > > html-formatted mail now, and my mail client is smart enough to just > > > route html-only messages directly to the trash. > > > > There's a config option to turn off the HTML bit. A recent "upgrade" > > of > > phab silently turned on HTML e-mails by default. > > > > I thought at first you meant an option the admins have to set, but I > see now that it's a per-user email setting. So now I'll be back to > seeing all the phab stuff I don't have time to deal with, and will be > able to feel suitably guilty about it again. > > -- Ian > > --94eb2c05e21af8ebdc053460b56a Content-Type: text/x-patch; charset=US-ASCII; name="cesa.patch" Content-Disposition: attachment; filename="cesa.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iozu3i7f0 RnJvbSA1MzIyN2ViZTMwNDFhN2M2MzU0NTMwZTIyN2NjNzc0Njk3M2JmNjIwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWwgU3RhbmVrIDxtc3RAc2VtaWhhbGYuY29tPgpEYXRl OiBGcmksIDMgSnVuIDIwMTYgMTY6MTg6MjAgKzAyMDAKU3ViamVjdDogW1BBVENIIDIvMl0gQ0VT QSBpYW4gcGF0Y2gKCi0tLQogc3lzL2Rldi9jZXNhL2Nlc2EuYyB8IDIzICsrKysrKysrKysrKy0t LS0tLS0tLS0tCiBzeXMvZGV2L2Nlc2EvY2VzYS5oIHwgIDIgKy0KIDIgZmlsZXMgY2hhbmdlZCwg MTMgaW5zZXJ0aW9ucygrKSwgMTIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvc3lzL2Rldi9j ZXNhL2Nlc2EuYyBiL3N5cy9kZXYvY2VzYS9jZXNhLmMKaW5kZXggM2Q1NTIzZS4uNDNlY2ZjMyAx MDA2NDQKLS0tIGEvc3lzL2Rldi9jZXNhL2Nlc2EuYworKysgYi9zeXMvZGV2L2Nlc2EvY2VzYS5j CkBAIC05NzAsMjkgKzk3MCwzMCBAQCBjZXNhX3NldHVwX3NyYW0oc3RydWN0IGNlc2Ffc29mdGMg KnNjKQogCXBjZWxsX3Qgc3JhbV9oYW5kbGUsIHNyYW1fcmVnWzJdOwogCWludCBydjsKIAotCXJ2 ID0gT0ZfZ2V0cHJvcChvZndfYnVzX2dldF9ub2RlKHNjLT5zY19kZXYpLCAic3JhbS1oYW5kbGUi LAorCXJ2ID0gT0ZfZ2V0ZW5jcHJvcChvZndfYnVzX2dldF9ub2RlKHNjLT5zY19kZXYpLCAic3Jh bS1oYW5kbGUiLAogCSAgICAodm9pZCAqKSZzcmFtX2hhbmRsZSwgc2l6ZW9mKHNyYW1faGFuZGxl KSk7CiAJaWYgKHJ2IDw9IDApCiAJCXJldHVybiAocnYpOwogCiAJc3JhbV9paGFuZGxlID0gKGlo YW5kbGVfdClzcmFtX2hhbmRsZTsKLQlzcmFtX2loYW5kbGUgPSBmZHQzMl90b19jcHUoc3JhbV9p aGFuZGxlKTsKIAlzcmFtX25vZGUgPSBPRl9pbnN0YW5jZV90b19wYWNrYWdlKHNyYW1faWhhbmRs ZSk7CiAKLQlydiA9IE9GX2dldHByb3Aoc3JhbV9ub2RlLCAicmVnIiwgKHZvaWQgKilzcmFtX3Jl Zywgc2l6ZW9mKHNyYW1fcmVnKSk7CisJcnYgPSBPRl9nZXRlbmNwcm9wKHNyYW1fbm9kZSwgInJl ZyIsICh2b2lkICopc3JhbV9yZWcsIHNpemVvZihzcmFtX3JlZykpOwogCWlmIChydiA8PSAwKQog CQlyZXR1cm4gKHJ2KTsKIAotCXNjLT5zY19zcmFtX2Jhc2VfcGEgPSBmZHQzMl90b19jcHUoc3Jh bV9yZWdbMF0pOworCXNjLT5zY19zcmFtX2Jhc2VfcGEgPSBzcmFtX3JlZ1swXTsKIAkvKiBTdG9y ZSBTUkFNIHNpemUgdG8gYmUgYWJsZSB0byB1bm1hcCBpbiBkZXRhY2goKSAqLwotCXNjLT5zY19z cmFtX3NpemUgPSBmZHQzMl90b19jcHUoc3JhbV9yZWdbMV0pOworCXNjLT5zY19zcmFtX3NpemUg PSBzcmFtX3JlZ1sxXTsKIAogI2lmIGRlZmluZWQoU09DX01WX0FSTUFEQTM4WCkKKwl2b2lkICpz cmFtX3ZhOworCiAJLyogU1JBTSBtZW1vcnkgd2FzIG5vdCBtYXBwZWQgaW4gcGxhdGZvcm1fc3Jh bV9kZXZtYXAoKSwgbWFwIGl0IG5vdyAqLwotCXJ2ID0gYnVzX3NwYWNlX21hcChmZHRidXNfYnNf dGFnLCBzYy0+c2Nfc3JhbV9iYXNlX3BhLCBzYy0+c2Nfc3JhbV9zaXplLAotCSAgICAwLCAmKHNj LT5zY19zcmFtX2Jhc2VfdmEpKTsKLQlpZiAocnYgIT0gMCkKLQkJcmV0dXJuIChydik7CisJc3Jh bV92YSA9IHBtYXBfbWFwZGV2KHNjLT5zY19zcmFtX2Jhc2VfcGEsIHNjLT5zY19zcmFtX3NpemUp OworCWlmIChzcmFtX3ZhID09IE5VTEwpCisJCXJldHVybiAoRU5PTUVNKTsKKwlzYy0+c2Nfc3Jh bV9iYXNlX3ZhID0gKHZtX29mZnNldF90KXNyYW1fdmE7CiAjZW5kaWYKIAlyZXR1cm4gKDApOwog fQpAQCAtMTI0MCw3ICsxMjQxLDcgQEAgZXJyMzoKIAlidXNfdGVhcmRvd25faW50cihkZXYsIHNj LT5zY19yZXNbUkVTX0NFU0FfSVJRXSwgc2MtPnNjX2ljb29raWUpOwogZXJyMjoKICNpZiBkZWZp bmVkKFNPQ19NVl9BUk1BREEzOFgpCi0JYnVzX3NwYWNlX3VubWFwKGZkdGJ1c19ic190YWcsIHNj LT5zY19zcmFtX2Jhc2VfdmEsIHNjLT5zY19zcmFtX3NpemUpOworCXBtYXBfdW5tYXBkZXYoc2Mt PnNjX3NyYW1fYmFzZV92YSwgc2MtPnNjX3NyYW1fc2l6ZSk7CiAjZW5kaWYKIGVycjE6CiAJYnVz X3JlbGVhc2VfcmVzb3VyY2VzKGRldiwgY2VzYV9yZXNfc3BlYywgc2MtPnNjX3Jlcyk7CkBAIC0x MjkxLDcgKzEyOTIsNyBAQCBjZXNhX2RldGFjaChkZXZpY2VfdCBkZXYpCiAKICNpZiBkZWZpbmVk KFNPQ19NVl9BUk1BREEzOFgpCiAJLyogVW5tYXAgU1JBTSBtZW1vcnkgKi8KLQlidXNfc3BhY2Vf dW5tYXAoZmR0YnVzX2JzX3RhZywgc2MtPnNjX3NyYW1fYmFzZV92YSwgc2MtPnNjX3NyYW1fc2l6 ZSk7CisJcG1hcF91bm1hcGRldihzYy0+c2Nfc3JhbV9iYXNlX3ZhLCBzYy0+c2Nfc3JhbV9zaXpl KTsKICNlbmRpZgogCS8qIERlc3RvcnkgbXV0ZXhlcyAqLwogCW10eF9kZXN0cm95KCZzYy0+c2Nf c2Vzc2lvbnNfbG9jayk7CmRpZmYgLS1naXQgYS9zeXMvZGV2L2Nlc2EvY2VzYS5oIGIvc3lzL2Rl di9jZXNhL2Nlc2EuaAppbmRleCA0ODE5ZDNkLi5lOGY2MzcyIDEwMDY0NAotLS0gYS9zeXMvZGV2 L2Nlc2EvY2VzYS5oCisrKyBiL3N5cy9kZXYvY2VzYS9jZXNhLmgKQEAgLTI2Nyw3ICsyNjcsNyBA QCBzdHJ1Y3QgY2VzYV9zb2Z0YyB7CiAKIAkvKiBDRVNBIFNSQU0gQWRkcmVzcyAqLwogCWJ1c19h ZGRyX3QJCQlzY19zcmFtX2Jhc2VfcGE7Ci0JYnVzX3NwYWNlX2hhbmRsZV90CQlzY19zcmFtX2Jh c2VfdmE7CisJdm1fb2Zmc2V0X3QJCQlzY19zcmFtX2Jhc2VfdmE7CiAJYnVzX3NpemVfdAkJCXNj X3NyYW1fc2l6ZTsKIH07CiAKLS0gCjIuNC42Cgo= --94eb2c05e21af8ebdc053460b56a-- From owner-svn-src-head@freebsd.org Fri Jun 3 14:49:40 2016 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 2773CB68ED7 for ; Fri, 3 Jun 2016 14:49:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 D13B61DB2 for ; Fri, 3 Jun 2016 14:49:39 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6a735e23-299a-11e6-8929-8ded99d5e9d7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 3 Jun 2016 14:49:46 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u53EnabP001039; Fri, 3 Jun 2016 08:49:36 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464965376.1204.198.camel@freebsd.org> Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa From: Ian Lepore To: =?iso-8859-2?Q?Micha=B3?= Stanek Cc: John Baldwin , Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 03 Jun 2016 08:49:36 -0600 In-Reply-To: References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464895468.1204.188.camel@freebsd.org> <1946366.I33PJXpI92@ralph.baldwin.cx> <1464903260.1204.191.camel@freebsd.org> Content-Type: text/plain; charset="iso-8859-2" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 14:49:40 -0000 On Fri, 2016-06-03 at 16:40 +0200, Micha³ Stanek wrote: > Thanks Ian, here's a patch correcting what you mentioned, please > check if > it's OK. > > Best regards, > Michal Stanek > That looks good, thanks. (It's unfortunate that pmap_unmapdev() takes a different datatype for the va than pmap_mapdev() returns, but that's a multi-platform mess that's hard to fix now.) -- Ian From owner-svn-src-head@freebsd.org Fri Jun 3 14:49:57 2016 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 177C1B68F11; Fri, 3 Jun 2016 14:49:57 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2C531F10; Fri, 3 Jun 2016 14:49:56 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-it0-f46.google.com with SMTP id i127so82071770ita.1; Fri, 03 Jun 2016 07:49:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=g2tepqCSB1LmYSFVjGT29U7BvMzcvqHL0eBUbVOm8Sc=; b=OWMlfk9s+Tdz9kIM+mTFvdSS7quycbNTFrEBV5dhgF1MxgA1XRao6MQq4dGKE7Yb26 PGoAnBeCR5jwWDmclJ6Wb7FyGv1weZhkSkwGUAcSa9dvHiN3E3GSnVY0tnJEeyOgySt0 6KfLkKdSrLsPmRae3t11yUm7pPdsnWQVuhuifTIgU7/aZKjD0jUdLwq4/7OWZ/QgoTnB qWl9AbPBzqo6dEqbgOga49bG19Wmyzoq+Gjb2zeD8D5hhN+LReYx/eaSUW3t2sOx6hRL Ni3f7o4amHHN479+3y0PH4vJPI/qpLPeBh+HZnhgRmW6b1wCtFu5JtkmrTkaZTCJrjjF LQ/A== X-Gm-Message-State: ALyK8tIw1fIMmeuOHCjXI+wcwI2JNDY3pEX7cHP66Js1hsPUFReI4QlCZYOePvf64O9Y/w== X-Received: by 10.36.10.65 with SMTP id 62mr9221975itw.89.1464965390438; Fri, 03 Jun 2016 07:49:50 -0700 (PDT) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com. [209.85.223.169]) by smtp.gmail.com with ESMTPSA id f39sm2897968ioj.21.2016.06.03.07.49.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Jun 2016 07:49:50 -0700 (PDT) Received: by mail-io0-f169.google.com with SMTP id k19so63238164ioi.3; Fri, 03 Jun 2016 07:49:50 -0700 (PDT) X-Received: by 10.107.162.131 with SMTP id l125mr5618738ioe.84.1464965389957; Fri, 03 Jun 2016 07:49:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.60.67 with HTTP; Fri, 3 Jun 2016 07:49:49 -0700 (PDT) In-Reply-To: <201606031105.u53B5tVi073576@repo.freebsd.org> References: <201606031105.u53B5tVi073576@repo.freebsd.org> From: Svatopluk Kraus Date: Fri, 3 Jun 2016 16:49:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r301266 - head/sys/arm/freescale/imx To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 14:49:57 -0000 I forgot to add to commit message: Reported by: Ulrich Grey Tested by: Ulrich Grey On Fri, Jun 3, 2016 at 1:05 PM, Svatopluk Kraus wrote: > Author: skra > Date: Fri Jun 3 11:05:55 2016 > New Revision: 301266 > URL: https://svnweb.freebsd.org/changeset/base/301266 > > Log: > Postpone allocation of IRQ resource to the time when interrupt > controller devices are attached. This has already been done for > bus_setup_intr(). > > There was no doubt that if someone wants to setup an interrupt, > corresponding interrupt controller device must already be attached. > However, the same must be valid for allocation of an interrupt resource > unless the allocation is done blindly, without any information that > such interrupt even exists. While it was done this blind way before, > it won't be possible after next INTRNG change. > > Modified: > head/sys/arm/freescale/imx/imx6_anatop.c > > Modified: head/sys/arm/freescale/imx/imx6_anatop.c > ============================================================================== > --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 10:28:06 2016 (r301265) > +++ head/sys/arm/freescale/imx/imx6_anatop.c Fri Jun 3 11:05:55 2016 (r301266) > @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); > > static struct resource_spec imx6_anatop_spec[] = { > { SYS_RES_MEMORY, 0, RF_ACTIVE }, > - { SYS_RES_IRQ, 0, RF_ACTIVE }, > { -1, 0 } > }; > #define MEMRES 0 > @@ -637,11 +636,20 @@ initialize_tempmon(struct imx6_anatop_so > static void > intr_setup(void *arg) > { > + int rid; > struct imx6_anatop_softc *sc; > > sc = arg; > - bus_setup_intr(sc->dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, > - tempmon_intr, NULL, sc, &sc->temp_intrhand); > + rid = 0; > + sc->res[IRQRES] = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, > + RF_ACTIVE); > + if (sc->res[IRQRES] != NULL) { > + bus_setup_intr(sc->dev, sc->res[IRQRES], > + INTR_TYPE_MISC | INTR_MPSAFE, tempmon_intr, NULL, sc, > + &sc->temp_intrhand); > + } else { > + device_printf(sc->dev, "Cannot allocate IRQ resource\n"); > + } > config_intrhook_disestablish(&sc->intr_setup_hook); > } > > From owner-svn-src-head@freebsd.org Fri Jun 3 15:33:23 2016 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 16521B69A4A; Fri, 3 Jun 2016 15:33:23 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id D95241C63; Fri, 3 Jun 2016 15:33:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53FXMPP073675; Fri, 3 Jun 2016 15:33:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53FXMDV073674; Fri, 3 Jun 2016 15:33:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606031533.u53FXMDV073674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Jun 2016 15:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301276 - head/sys/dev/nxge/xgehal 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.22 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, 03 Jun 2016 15:33:23 -0000 Author: pfg Date: Fri Jun 3 15:33:21 2016 New Revision: 301276 URL: https://svnweb.freebsd.org/changeset/base/301276 Log: nxge(4): Remove useless self-assignment. Apparently the original implementation brought a self-assignment to work around some bogus lint issue that is not relevant anymore. CID: 1347070 Modified: head/sys/dev/nxge/xgehal/xgehal-device.c Modified: head/sys/dev/nxge/xgehal/xgehal-device.c ============================================================================== --- head/sys/dev/nxge/xgehal/xgehal-device.c Fri Jun 3 14:37:18 2016 (r301275) +++ head/sys/dev/nxge/xgehal/xgehal-device.c Fri Jun 3 15:33:21 2016 (r301276) @@ -3321,7 +3321,6 @@ __hal_update_bimodal(xge_hal_device_t *h iwl_txcnt = (hldev->irq_workload_txcnt[ring_no] ? hldev->irq_workload_txcnt[ring_no] : 1); iwl_cnt = iwl_rxcnt + iwl_txcnt; - iwl_cnt = iwl_cnt; /* just to remove the lint warning */ /* * we need to take hldev->config.isr_polling_cnt into account From owner-svn-src-head@freebsd.org Fri Jun 3 16:17:37 2016 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 CF7DBB685A0; Fri, 3 Jun 2016 16:17:37 +0000 (UTC) (envelope-from dim@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 mx1.freebsd.org (Postfix) with ESMTPS id 83FA5165F; Fri, 3 Jun 2016 16:17:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53GHaoa088349; Fri, 3 Jun 2016 16:17:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53GHaEB088345; Fri, 3 Jun 2016 16:17:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201606031617.u53GHaEB088345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 3 Jun 2016 16:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic 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.22 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, 03 Jun 2016 16:17:37 -0000 Author: dim Date: Fri Jun 3 16:17:36 2016 New Revision: 301277 URL: https://svnweb.freebsd.org/changeset/base/301277 Log: For clang, move the definition of FREEBSD_CC_VERSION into its own header file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc. The header is only included from one .cpp file in the clang tree. This minimizes the number of .cpp files that need to be rebuilt if the version is bumped. Discussed with: bdrewery Added: head/lib/clang/freebsd_cc_version.h (contents, props changed) Modified: head/Makefile.inc1 head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/libclangbasic/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jun 3 15:33:21 2016 (r301276) +++ head/Makefile.inc1 Fri Jun 3 16:17:36 2016 (r301277) @@ -99,7 +99,7 @@ _expected_compiler_type= gcc .if ${_expected_compiler_type} == "clang" CROSS_COMPILER_FREEBSD_VERSION!= \ awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ - ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown + ${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown CROSS_COMPILER_VERSION!= \ awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown Added: head/lib/clang/freebsd_cc_version.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/freebsd_cc_version.h Fri Jun 3 16:17:36 2016 (r301277) @@ -0,0 +1,3 @@ +/* $FreeBSD$ */ + +#define FREEBSD_CC_VERSION 1100004 Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 15:33:21 2016 (r301276) +++ head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 16:17:36 2016 (r301277) @@ -8,5 +8,3 @@ #define CLANG_VENDOR "FreeBSD " #define SVN_REVISION "262564" - -#define FREEBSD_CC_VERSION 1100004U Modified: head/lib/clang/libclangbasic/Makefile ============================================================================== --- head/lib/clang/libclangbasic/Makefile Fri Jun 3 15:33:21 2016 (r301276) +++ head/lib/clang/libclangbasic/Makefile Fri Jun 3 16:17:36 2016 (r301277) @@ -50,3 +50,6 @@ TGHDRS= AttrHasAttributeImpl \ # XX: work around GCC bug 67888 CFLAGS.gcc += -fpermissive + +# Ensure FREEBSD_CC_VERSION is defined for Targets.cpp +CFLAGS.Targets.cpp+= -include ../freebsd_cc_version.h From owner-svn-src-head@freebsd.org Fri Jun 3 17:44:11 2016 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 365B1B68042; Fri, 3 Jun 2016 17:44:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1E8351312; Fri, 3 Jun 2016 17:44:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 0FD801628; Fri, 3 Jun 2016 17:44:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id BAD54217AF; Fri, 3 Jun 2016 17:44:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id hr4QgklneEDK; Fri, 3 Jun 2016 17:44:07 +0000 (UTC) Subject: Re: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7281E217AA To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, ache@FreeBSD.org References: <201606031617.u53GHaEB088345@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 3 Jun 2016 10:44:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606031617.u53GHaEB088345@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VNjnRLneTl6CdwTCjemOb7pB3xE25sjgf" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 17:44:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VNjnRLneTl6CdwTCjemOb7pB3xE25sjgf Content-Type: multipart/mixed; boundary="0sMtmcN35gA48UnWcExJWjSo89AmUow80" From: Bryan Drewery To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, ache@FreeBSD.org Message-ID: Subject: Re: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic References: <201606031617.u53GHaEB088345@repo.freebsd.org> In-Reply-To: <201606031617.u53GHaEB088345@repo.freebsd.org> --0sMtmcN35gA48UnWcExJWjSo89AmUow80 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks! I think this helps Andrey's recent clang rebuild issues as well since the quite-common file was being touched often. On 6/3/2016 9:17 AM, Dimitry Andric wrote: > Author: dim > Date: Fri Jun 3 16:17:36 2016 > New Revision: 301277 > URL: https://svnweb.freebsd.org/changeset/base/301277 >=20 > Log: > For clang, move the definition of FREEBSD_CC_VERSION into its own hea= der > file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc.= > The header is only included from one .cpp file in the clang tree. > =20 > This minimizes the number of .cpp files that need to be rebuilt if th= e > version is bumped. > =20 > Discussed with: bdrewery >=20 > Added: > head/lib/clang/freebsd_cc_version.h (contents, props changed) > Modified: > head/Makefile.inc1 > head/lib/clang/include/clang/Basic/Version.inc > head/lib/clang/libclangbasic/Makefile >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Fri Jun 3 15:33:21 2016 (r301276) > +++ head/Makefile.inc1 Fri Jun 3 16:17:36 2016 (r301277) > @@ -99,7 +99,7 @@ _expected_compiler_type=3D gcc > .if ${_expected_compiler_type} =3D=3D "clang" > CROSS_COMPILER_FREEBSD_VERSION!=3D \ > awk '$$2 =3D=3D "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ > - ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown > + ${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown > CROSS_COMPILER_VERSION!=3D \ > awk '$$2 =3D=3D "CLANG_VERSION" {split($$3, a, "."); print a[1] * 100= 00 + a[2] * 100 + a[3]}' \ > ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown >=20 > Added: head/lib/clang/freebsd_cc_version.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/clang/freebsd_cc_version.h Fri Jun 3 16:17:36 2016 (r3012= 77) > @@ -0,0 +1,3 @@ > +/* $FreeBSD$ */ > + > +#define FREEBSD_CC_VERSION 1100004 >=20 > Modified: head/lib/clang/include/clang/Basic/Version.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 15:33:21 = 2016 (r301276) > +++ head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 16:17:36 = 2016 (r301277) > @@ -8,5 +8,3 @@ > #define CLANG_VENDOR "FreeBSD " > =20 > #define SVN_REVISION "262564" > - > -#define FREEBSD_CC_VERSION 1100004U >=20 > Modified: head/lib/clang/libclangbasic/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/clang/libclangbasic/Makefile Fri Jun 3 15:33:21 2016 (r30= 1276) > +++ head/lib/clang/libclangbasic/Makefile Fri Jun 3 16:17:36 2016 (r30= 1277) > @@ -50,3 +50,6 @@ TGHDRS=3D AttrHasAttributeImpl \ > =20 > # XX: work around GCC bug 67888 > CFLAGS.gcc +=3D -fpermissive > + > +# Ensure FREEBSD_CC_VERSION is defined for Targets.cpp > +CFLAGS.Targets.cpp+=3D -include ../freebsd_cc_version.h >=20 --=20 Regards, Bryan Drewery --0sMtmcN35gA48UnWcExJWjSo89AmUow80-- --VNjnRLneTl6CdwTCjemOb7pB3xE25sjgf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXUcHsAAoJEDXXcbtuRpfPDcgH/1CK5mooorpkCojxhK1ZYA+r DJGB3wfaz58PijqXTNgLi8H/AwtN5MXLV9VDVYKfD14/Hl13qSg8aHSbclAtPohG HP0ZTrOXmkrQ+pRNfn2AC/veGoszxohbg4D9gGVGWxayXXnKRrXRLEgZuxNvL8RU hBUMhx7Y1mt38JbQ2J8tWQuG4HQCPfx9LDR8xVyETXixrwwEsFIC+dpcG9AJK/qf EtWP3Qx+ZtkpNpk+Yd2Xs+V5wQ9Ya8E6pyvbvl/DdAVe6VHywb8EofFY0Hc5lOvV qinTcoN4ELAFcljADqUafM4PPDJkbGpVEed31yfWTC11VzFjpdkzTtbN5scom08= =HxT/ -----END PGP SIGNATURE----- --VNjnRLneTl6CdwTCjemOb7pB3xE25sjgf-- From owner-svn-src-head@freebsd.org Fri Jun 3 17:46:00 2016 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 1486AB68125; Fri, 3 Jun 2016 17:46:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F1A491662; Fri, 3 Jun 2016 17:45:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E5AAE1795; Fri, 3 Jun 2016 17:45:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9E410217BC; Fri, 3 Jun 2016 17:45:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id XHdlH7ggFGBz; Fri, 3 Jun 2016 17:45:56 +0000 (UTC) Subject: Re: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 1E4F2217B6 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606031617.u53GHaEB088345@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <4fb107fd-5d48-ab77-cc7d-8bf96550a30a@FreeBSD.org> Date: Fri, 3 Jun 2016 10:46:01 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606031617.u53GHaEB088345@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qEhjdnDbNb3mHIk7IMdeiIsEVBEtdlGkS" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 17:46:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qEhjdnDbNb3mHIk7IMdeiIsEVBEtdlGkS Content-Type: multipart/mixed; boundary="rP4X8q6D0ADpBjwWAm7pV2JolbpkOC5Hx" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <4fb107fd-5d48-ab77-cc7d-8bf96550a30a@FreeBSD.org> Subject: Re: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic References: <201606031617.u53GHaEB088345@repo.freebsd.org> In-Reply-To: <201606031617.u53GHaEB088345@repo.freebsd.org> --rP4X8q6D0ADpBjwWAm7pV2JolbpkOC5Hx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/3/2016 9:17 AM, Dimitry Andric wrote: > Author: dim > Date: Fri Jun 3 16:17:36 2016 > New Revision: 301277 > URL: https://svnweb.freebsd.org/changeset/base/301277 >=20 > Log: > For clang, move the definition of FREEBSD_CC_VERSION into its own hea= der > file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc.= > The header is only included from one .cpp file in the clang tree. > =20 > This minimizes the number of .cpp files that need to be rebuilt if th= e > version is bumped. > =20 > Discussed with: bdrewery >=20 > Added: > head/lib/clang/freebsd_cc_version.h (contents, props changed) > Modified: > head/Makefile.inc1 > head/lib/clang/include/clang/Basic/Version.inc > head/lib/clang/libclangbasic/Makefile >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Fri Jun 3 15:33:21 2016 (r301276) > +++ head/Makefile.inc1 Fri Jun 3 16:17:36 2016 (r301277) > @@ -99,7 +99,7 @@ _expected_compiler_type=3D gcc > .if ${_expected_compiler_type} =3D=3D "clang" > CROSS_COMPILER_FREEBSD_VERSION!=3D \ > awk '$$2 =3D=3D "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ > - ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown > + ${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown > CROSS_COMPILER_VERSION!=3D \ > awk '$$2 =3D=3D "CLANG_VERSION" {split($$3, a, "."); print a[1] * 100= 00 + a[2] * 100 + a[3]}' \ > ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown >=20 > Added: head/lib/clang/freebsd_cc_version.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/clang/freebsd_cc_version.h Fri Jun 3 16:17:36 2016 (r3012= 77) > @@ -0,0 +1,3 @@ > +/* $FreeBSD$ */ > + > +#define FREEBSD_CC_VERSION 1100004 >=20 > Modified: head/lib/clang/include/clang/Basic/Version.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 15:33:21 = 2016 (r301276) > +++ head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 16:17:36 = 2016 (r301277) > @@ -8,5 +8,3 @@ > #define CLANG_VENDOR "FreeBSD " > =20 > #define SVN_REVISION "262564" > - > -#define FREEBSD_CC_VERSION 1100004U >=20 > Modified: head/lib/clang/libclangbasic/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/clang/libclangbasic/Makefile Fri Jun 3 15:33:21 2016 (r30= 1276) > +++ head/lib/clang/libclangbasic/Makefile Fri Jun 3 16:17:36 2016 (r30= 1277) > @@ -50,3 +50,6 @@ TGHDRS=3D AttrHasAttributeImpl \ > =20 > # XX: work around GCC bug 67888 > CFLAGS.gcc +=3D -fpermissive > + > +# Ensure FREEBSD_CC_VERSION is defined for Targets.cpp > +CFLAGS.Targets.cpp+=3D -include ../freebsd_cc_version.h >=20 We're going to want a similar fix for GCC as well since its version is currently in a common header of ./gnu/usr.bin/cc/cc_tools/freebsd-native.= h. I don't have time to address it today but can look sometime in the next few weeks if no one does it before me. --=20 Regards, Bryan Drewery --rP4X8q6D0ADpBjwWAm7pV2JolbpkOC5Hx-- --qEhjdnDbNb3mHIk7IMdeiIsEVBEtdlGkS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXUcJZAAoJEDXXcbtuRpfPKeYIALlHnib7KG1mAMNf2h5wEUFz 12S6D7+e5pg8qvNNHA3xaJ+CZmo5NenemyWkUUOEXb5OEKwm/gKBo0wxbq26FBi2 Zd9VcS+AdNwM3c9bGR5Jfy3N3ZLN4Dtr4V7nKDlGg8bllDvPH7T+jjTEccnJL2y8 yz+HQ4KdPWlKw22vAgHJ08EK9JN4jILZzKmgZXZyites9nRTOwv78kYSCsQehYgN QkOon9D3GP6nLorR3b7e4kr1NutPKVo7Andq4kj+PWa43dbV802PvR4ZDNd1FSPt mniTxzMzL+hQm26BSIeHGf2vE4i2uwdhTrO7BBhaHVqg+Aeh+QS1QWn9GOMI0gU= =8jZN -----END PGP SIGNATURE----- --qEhjdnDbNb3mHIk7IMdeiIsEVBEtdlGkS-- From owner-svn-src-head@freebsd.org Fri Jun 3 18:05:19 2016 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 ADD41B686F3; Fri, 3 Jun 2016 18:05:19 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 7BB1C11E4; Fri, 3 Jun 2016 18:05:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53I5IGr034129; Fri, 3 Jun 2016 18:05:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53I5It3034128; Fri, 3 Jun 2016 18:05:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606031805.u53I5It3034128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Jun 2016 18:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301278 - head/sys/x86/x86 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.22 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, 03 Jun 2016 18:05:19 -0000 Author: kib Date: Fri Jun 3 18:05:18 2016 New Revision: 301278 URL: https://svnweb.freebsd.org/changeset/base/301278 Log: diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index d8bda77..bb15df0 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 1000000 +#define LOOPS 100000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Fri Jun 3 16:17:36 2016 (r301277) +++ head/sys/x86/x86/local_apic.c Fri Jun 3 18:05:18 2016 (r301278) @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 1000000 +#define LOOPS 100000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which From owner-svn-src-head@freebsd.org Fri Jun 3 18:06:39 2016 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 53E77B6878C; Fri, 3 Jun 2016 18:06:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 38A9413A6; Fri, 3 Jun 2016 18:06:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 31F991DE0; Fri, 3 Jun 2016 18:06:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id BDB332187D; Fri, 3 Jun 2016 18:06:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id PpVxrXCm4CzH; Fri, 3 Jun 2016 18:06:32 +0000 (UTC) Subject: Re: svn commit: r301278 - head/sys/x86/x86 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com AE68C21877 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606031805.u53I5It3034128@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <26e439ce-9979-e833-60f5-ce2dcb91ced2@FreeBSD.org> Date: Fri, 3 Jun 2016 11:06:36 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606031805.u53I5It3034128@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nm3e4HVAv6TeDFFVufQV1UbmQ884hUvOo" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 18:06:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nm3e4HVAv6TeDFFVufQV1UbmQ884hUvOo Content-Type: multipart/mixed; boundary="qB6ADHikV2OmkofGOPn5CRehsd6QJPXug" From: Bryan Drewery To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <26e439ce-9979-e833-60f5-ce2dcb91ced2@FreeBSD.org> Subject: Re: svn commit: r301278 - head/sys/x86/x86 References: <201606031805.u53I5It3034128@repo.freebsd.org> In-Reply-To: <201606031805.u53I5It3034128@repo.freebsd.org> --qB6ADHikV2OmkofGOPn5CRehsd6QJPXug Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Commitception! On 6/3/2016 11:05 AM, Konstantin Belousov wrote: > Author: kib > Date: Fri Jun 3 18:05:18 2016 > New Revision: 301278 > URL: https://svnweb.freebsd.org/changeset/base/301278 >=20 > Log: > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index d8bda77..bb15df0 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) > } > =20 > #ifdef SMP > -#define LOOPS 1000000 > +#define LOOPS 100000 > /* > * Calibrate the busy loop waiting for IPI ack in xAPIC mode. > * lapic_ipi_wait_mult contains the number of iterations which >=20 > Modified: > head/sys/x86/x86/local_apic.c >=20 > Modified: head/sys/x86/x86/local_apic.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/x86/x86/local_apic.c Fri Jun 3 16:17:36 2016 (r301277) > +++ head/sys/x86/x86/local_apic.c Fri Jun 3 18:05:18 2016 (r301278) > @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) > } > =20 > #ifdef SMP > -#define LOOPS 1000000 > +#define LOOPS 100000 > /* > * Calibrate the busy loop waiting for IPI ack in xAPIC mode. > * lapic_ipi_wait_mult contains the number of iterations which >=20 --=20 Regards, Bryan Drewery --qB6ADHikV2OmkofGOPn5CRehsd6QJPXug-- --nm3e4HVAv6TeDFFVufQV1UbmQ884hUvOo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXUccsAAoJEDXXcbtuRpfPhwAIANs8Eidz5n0k2ki8wnHj8A+G p/8e8S/ciq3ORJg8dfgzSRyfKuKc7LbIgN5QX+CoXnPb9qAQ48SuwZgN04L7h0IS Cfs4HynETgMK99yFrDNvRz1/tljVhLFzOUZ5gynidwh9yrO1ZaL0WaHLUMMdqXBP +LlzxY7Bb9tvLJ1jayi95jvtejuBo9+7lRW8G4t11kXfg9Z+EaBpdssxTgnnuyyn AqX0tV7nyFbAUyE7ZshyW9zhe6pXqH9QbhpA1SYf7o5afTdJGxz2l9St1u5muxrx U3Y56OQuzxNnev+f8zHScKmsZHAaIjaL5RkA+KlMW+fnyaWSg+3HqjSO90jBM8M= =0/DE -----END PGP SIGNATURE----- --nm3e4HVAv6TeDFFVufQV1UbmQ884hUvOo-- From owner-svn-src-head@freebsd.org Fri Jun 3 18:23:46 2016 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 54E3EB68CF3; Fri, 3 Jun 2016 18:23:46 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 2558D1117; Fri, 3 Jun 2016 18:23:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53INjio041538; Fri, 3 Jun 2016 18:23:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53INjq0041537; Fri, 3 Jun 2016 18:23:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606031823.u53INjq0041537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Jun 2016 18:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301279 - head/sys/x86/x86 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.22 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, 03 Jun 2016 18:23:46 -0000 Author: kib Date: Fri Jun 3 18:23:45 2016 New Revision: 301279 URL: https://svnweb.freebsd.org/changeset/base/301279 Log: Trim some spaces to record correct commit message for the r301278. Reduce number of iterations used for calibrating ICR read loop. The new number of iteration still gives the same ICR latency as before, tested on Intel SandyBridge and Haswell machines, and on AMD. But it significantly reduces the unneeded pause on boot in some VMs, from ~10 secs to less then 1 sec. It was reported to occur in bhyve on AMD host. Reported and tested by: avg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Fri Jun 3 18:05:18 2016 (r301278) +++ head/sys/x86/x86/local_apic.c Fri Jun 3 18:23:45 2016 (r301279) @@ -706,7 +706,7 @@ native_lapic_setup(int boot) lapic_write32(LAPIC_LVT_CMCI, lvt_mode(la, APIC_LVT_CMCI, lapic_read32(LAPIC_LVT_CMCI))); } - + intr_restore(saveintr); } @@ -1725,7 +1725,7 @@ static void apic_setup_local(void *dummy __unused) { int retval; - + if (best_enum == NULL) return; From owner-svn-src-head@freebsd.org Fri Jun 3 18:23:54 2016 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 38735B68D22; Fri, 3 Jun 2016 18:23:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D320C1251; Fri, 3 Jun 2016 18:23:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 510D41492; Fri, 3 Jun 2016 18:23:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 01CBB2190A; Fri, 3 Jun 2016 18:23:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0Oi7Z_YVVgRK; Fri, 3 Jun 2016 18:23:49 +0000 (UTC) Subject: Re: svn commit: r301278 - head/sys/x86/x86 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C2B1B21904 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606031805.u53I5It3034128@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <0759475d-e59c-f788-c72f-f6ee353c9131@FreeBSD.org> Date: Fri, 3 Jun 2016 11:23:54 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606031805.u53I5It3034128@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vaufaJ1uvJp8fb48fk3klxraMNbIIKTqO" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 18:23:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vaufaJ1uvJp8fb48fk3klxraMNbIIKTqO Content-Type: multipart/mixed; boundary="e2knincgVBAoDdjWHWCPGD05v8wNIdB5a" From: Bryan Drewery To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0759475d-e59c-f788-c72f-f6ee353c9131@FreeBSD.org> Subject: Re: svn commit: r301278 - head/sys/x86/x86 References: <201606031805.u53I5It3034128@repo.freebsd.org> In-Reply-To: <201606031805.u53I5It3034128@repo.freebsd.org> --e2knincgVBAoDdjWHWCPGD05v8wNIdB5a Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Seriously though, can you please revert this and recommit with a proper message? Thanks! On 6/3/2016 11:05 AM, Konstantin Belousov wrote: > Author: kib > Date: Fri Jun 3 18:05:18 2016 > New Revision: 301278 > URL: https://svnweb.freebsd.org/changeset/base/301278 >=20 > Log: > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index d8bda77..bb15df0 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) > } > =20 > #ifdef SMP > -#define LOOPS 1000000 > +#define LOOPS 100000 > /* > * Calibrate the busy loop waiting for IPI ack in xAPIC mode. > * lapic_ipi_wait_mult contains the number of iterations which >=20 > Modified: > head/sys/x86/x86/local_apic.c >=20 > Modified: head/sys/x86/x86/local_apic.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/x86/x86/local_apic.c Fri Jun 3 16:17:36 2016 (r301277) > +++ head/sys/x86/x86/local_apic.c Fri Jun 3 18:05:18 2016 (r301278) > @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) > } > =20 > #ifdef SMP > -#define LOOPS 1000000 > +#define LOOPS 100000 > /* > * Calibrate the busy loop waiting for IPI ack in xAPIC mode. > * lapic_ipi_wait_mult contains the number of iterations which >=20 --=20 Regards, Bryan Drewery --e2knincgVBAoDdjWHWCPGD05v8wNIdB5a-- --vaufaJ1uvJp8fb48fk3klxraMNbIIKTqO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXUcs6AAoJEDXXcbtuRpfPH5gH/RuWlBWOAXDo0z6zIfChOXdU 9ng3JxTYYpzriFqbgBR4L2TI6h/KwRrBh7fU6BY1yTInBS/Hb92OAgB6+YNFLI2A sa1yfYVIqICO9Vq6JYxUxtpF4RpWLDRnuYLE0jWD4idBblrgbUFZaX1uAEMyh41o hrbWlkdgJ2/l1eDvh8b3v6mN9kmjXYQLPo/k47HrDeSNYnS7IvPEnSxpmeM7HC04 vM9FNFdOM7LWuhllaIITfebs+SuC24xzGJ+A+oMOEpSbrm6H4Dp0dXn7yl2TwkjV yIDsBThuFhaRezfFoEth1nFZ/C5+beH/kAVTK3HFGa/2DeKfILHxQareXlnxd4Y= =N+b2 -----END PGP SIGNATURE----- --vaufaJ1uvJp8fb48fk3klxraMNbIIKTqO-- From owner-svn-src-head@freebsd.org Fri Jun 3 18:37:57 2016 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 BEEECB6942F; Fri, 3 Jun 2016 18:37:57 +0000 (UTC) (envelope-from garga@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 mx1.freebsd.org (Postfix) with ESMTPS id 76351118F; Fri, 3 Jun 2016 18:37:57 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53IbuLb045483; Fri, 3 Jun 2016 18:37:56 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53IbuPV045481; Fri, 3 Jun 2016 18:37:56 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201606031837.u53IbuPV045481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Fri, 3 Jun 2016 18:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301280 - head/release 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.22 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, 03 Jun 2016 18:37:57 -0000 Author: garga (ports committer) Date: Fri Jun 3 18:37:56 2016 New Revision: 301280 URL: https://svnweb.freebsd.org/changeset/base/301280 Log: One of the already implemented options in release/Makefile is NOSRC. When it's defined, installation image is shipped without source distribution (src.txz) Add the hability of defining NOSRC in release.conf and pass it to 'make release' argument Approved by: gjb Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D6710 Modified: head/release/release.conf.sample head/release/release.sh Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Fri Jun 3 18:23:45 2016 (r301279) +++ head/release/release.conf.sample Fri Jun 3 18:37:56 2016 (r301280) @@ -51,6 +51,7 @@ PORTBRANCH="ports/head@rHEAD" ## Set miscellaneous 'make release' settings. #NODOC= #NOPORTS= +#NOSRC= #WITH_DVD= #WITH_COMPRESSED_IMAGES= Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Jun 3 18:23:45 2016 (r301279) +++ head/release/release.sh Fri Jun 3 18:37:56 2016 (r301280) @@ -102,6 +102,9 @@ env_setup() { NODOC= NOPORTS= + # Set to non-empty value to disable distributing source tree. + NOSRC= + # Set to non-empty value to build dvd1.iso as part of the release. WITH_DVD= WITH_COMPRESSED_IMAGES= @@ -160,15 +163,18 @@ env_check() { NODOC=yes fi - # If NOPORTS and/or NODOC are unset, they must not pass to make as - # variables. The release makefile verifies definedness of the + # If NOSRC, NOPORTS and/or NODOC are unset, they must not pass to make + # as variables. The release makefile verifies definedness of the # NOPORTS/NODOC variables instead of their values. - DOCPORTS= + SRCDOCPORTS= if [ -n "${NOPORTS}" ]; then - DOCPORTS="NOPORTS=yes " + SRCDOCPORTS="NOPORTS=yes" fi if [ -n "${NODOC}" ]; then - DOCPORTS="${DOCPORTS}NODOC=yes" + SRCDOCPORTS="${SRCDOCPORTS}${SRCDOCPORTS:+ }NODOC=yes" + fi + if [ -n "${NOSRC}" ]; then + SRCDOCPORTS="${SRCDOCPORTS}${SRCDOCPORTS:+ }NOSRC=yes" fi # The aggregated build-time flags based upon variables defined within @@ -206,7 +212,7 @@ env_check() { RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \ KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} \ - KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${DOCPORTS} \ + KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${SRCDOCPORTS} \ WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" From owner-svn-src-head@freebsd.org Fri Jun 3 18:52:58 2016 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 4EBF5B69A67; Fri, 3 Jun 2016 18:52:58 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id 209D01F17; Fri, 3 Jun 2016 18:52:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53IqvX9052759; Fri, 3 Jun 2016 18:52:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53IqvVH052758; Fri, 3 Jun 2016 18:52:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606031852.u53IqvVH052758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 3 Jun 2016 18:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301281 - head/sys/arm/mv 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.22 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, 03 Jun 2016 18:52:58 -0000 Author: zbb Date: Fri Jun 3 18:52:57 2016 New Revision: 301281 URL: https://svnweb.freebsd.org/changeset/base/301281 Log: Use nitems() macro instead of re-inventing it Fixed after r301221. Pointed out by: oshogbo Submitted by: Michal Stanek Obtained from: Semihalf Modified: head/sys/arm/mv/mv_common.c Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Fri Jun 3 18:37:56 2016 (r301280) +++ head/sys/arm/mv/mv_common.c Fri Jun 3 18:52:57 2016 (r301281) @@ -2131,7 +2131,7 @@ moveon: return (0); t++; - if (t >= ((sizeof(cpu_win_tbl))/(sizeof(cpu_win_tbl[0])))) { + if (t >= nitems(cpu_win_tbl)) { debugf("cannot fit CESA tuple into cpu_win_tbl\n"); return (ENOMEM); } From owner-svn-src-head@freebsd.org Fri Jun 3 18:54:18 2016 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 39196B69ADF; Fri, 3 Jun 2016 18:54:18 +0000 (UTC) (envelope-from zbb@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 mx1.freebsd.org (Postfix) with ESMTPS id EF8C910D2; Fri, 3 Jun 2016 18:54:17 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53IsHQa052852; Fri, 3 Jun 2016 18:54:17 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53IsHcb052850; Fri, 3 Jun 2016 18:54:17 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201606031854.u53IsHcb052850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 3 Jun 2016 18:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301282 - head/sys/dev/cesa 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.22 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, 03 Jun 2016 18:54:18 -0000 Author: zbb Date: Fri Jun 3 18:54:16 2016 New Revision: 301282 URL: https://svnweb.freebsd.org/changeset/base/301282 Log: Use proper interface for FDT parsing and memory mapping in CESA Improvements after r301220. Bus space methods are not called so simple pmap_mapdev will suffice. Use OF_getencprop to get buffer with already converted endianess. Pointed out by: ian Submitted by: Michal Stanek Obtained from: Semihalf Modified: head/sys/dev/cesa/cesa.c head/sys/dev/cesa/cesa.h Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Fri Jun 3 18:52:57 2016 (r301281) +++ head/sys/dev/cesa/cesa.c Fri Jun 3 18:54:16 2016 (r301282) @@ -970,29 +970,30 @@ cesa_setup_sram(struct cesa_softc *sc) pcell_t sram_handle, sram_reg[2]; int rv; - rv = OF_getprop(ofw_bus_get_node(sc->sc_dev), "sram-handle", + rv = OF_getencprop(ofw_bus_get_node(sc->sc_dev), "sram-handle", (void *)&sram_handle, sizeof(sram_handle)); if (rv <= 0) return (rv); sram_ihandle = (ihandle_t)sram_handle; - sram_ihandle = fdt32_to_cpu(sram_ihandle); sram_node = OF_instance_to_package(sram_ihandle); - rv = OF_getprop(sram_node, "reg", (void *)sram_reg, sizeof(sram_reg)); + rv = OF_getencprop(sram_node, "reg", (void *)sram_reg, sizeof(sram_reg)); if (rv <= 0) return (rv); - sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); + sc->sc_sram_base_pa = sram_reg[0]; /* Store SRAM size to be able to unmap in detach() */ - sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); + sc->sc_sram_size = sram_reg[1]; #if defined(SOC_MV_ARMADA38X) + void *sram_va; + /* SRAM memory was not mapped in platform_sram_devmap(), map it now */ - rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc->sc_sram_size, - 0, &(sc->sc_sram_base_va)); - if (rv != 0) - return (rv); + sram_va = pmap_mapdev(sc->sc_sram_base_pa, sc->sc_sram_size); + if (sram_va == NULL) + return (ENOMEM); + sc->sc_sram_base_va = (vm_offset_t)sram_va; #endif return (0); } @@ -1246,7 +1247,7 @@ err3: bus_teardown_intr(dev, sc->sc_res[RES_CESA_IRQ], sc->sc_icookie); err2: #if defined(SOC_MV_ARMADA38X) - bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size); + pmap_unmapdev(sc->sc_sram_base_va, sc->sc_sram_size); #endif err1: bus_release_resources(dev, cesa_res_spec, sc->sc_res); @@ -1297,7 +1298,7 @@ cesa_detach(device_t dev) #if defined(SOC_MV_ARMADA38X) /* Unmap SRAM memory */ - bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size); + pmap_unmapdev(sc->sc_sram_base_va, sc->sc_sram_size); #endif /* Destroy mutexes */ mtx_destroy(&sc->sc_sessions_lock); Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Fri Jun 3 18:52:57 2016 (r301281) +++ head/sys/dev/cesa/cesa.h Fri Jun 3 18:54:16 2016 (r301282) @@ -267,7 +267,7 @@ struct cesa_softc { /* CESA SRAM Address */ bus_addr_t sc_sram_base_pa; - bus_space_handle_t sc_sram_base_va; + vm_offset_t sc_sram_base_va; bus_size_t sc_sram_size; }; From owner-svn-src-head@freebsd.org Fri Jun 3 19:10:10 2016 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 9C3A9B69EB7; Fri, 3 Jun 2016 19:10:10 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81C6E19F4; Fri, 3 Jun 2016 19:10:10 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O8700300JEMX300@mr11p00im-asmtp003.me.com>; Fri, 03 Jun 2016 18:10:04 +0000 (GMT) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O8700E0WJSQGD30@mr11p00im-asmtp003.me.com>; Fri, 03 Jun 2016 18:10:04 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-03_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1606030199 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Fri, 03 Jun 2016 11:10:45 -0700 Subject: Re: svn commit: r301278 - head/sys/x86/x86 From: Ravi Pokala Sender: "Pokala, Ravi" To: Bryan Drewery , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r301278 - head/sys/x86/x86 References: <201606031805.u53I5It3034128@repo.freebsd.org> <26e439ce-9979-e833-60f5-ce2dcb91ced2@FreeBSD.org> In-reply-to: <26e439ce-9979-e833-60f5-ce2dcb91ced2@FreeBSD.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1464977404; bh=RuwGZT2SfPEMlWCb101s17v+vaN4sWd4wV8hoxGAkU8=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=Lg0k/Rc3li0q7SD3wpm2eksQXx47NHbG45AyCsRlN2/VuvjcJ2XKdgavDzPWM2Ejo 5R5jIZVarh2pkJ0HVfb7T9SgvoRutY5Wsl2fyImMrK+192nEAZkNSFppIPX9WDJ3vR Cz9zOjQ2kyBb6MpCoom9jr3s0rNqiZdF/PoXnuv0cNMglZUm7F/XdSqQ8+xUTnn+bX 71BQB3Q+o1s1dYZ9EjZ1KFwSfc281AKVqqgZCOvKoWEFUvHR9HnL9Ihk4jl5EFGM8P kyAG8HVuQM0RU+vPzjRQktp7MqNxwtxq6gVZa0u+vg5gWPGLVAgPlNGp5oXac8b1+L Bw+Oe2eBkbRmw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 19:10:10 -0000 -----Original Message----- From: on behalf of Bryan Drewery Organization: FreeBSD Date: 2016-06-03, Friday at 11:06 To: Konstantin Belousov , , , Subject: Re: svn commit: r301278 - head/sys/x86/x86 >Commitception! http://inception.davepedu.com/noflash.php >On 6/3/2016 11:05 AM, Konstantin Belousov wrote: >> Author: kib >> Date: Fri Jun 3 18:05:18 2016 >> New Revision: 301278 >> URL: https://svnweb.freebsd.org/changeset/base/301278 >> >> Log: >> diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c >> index d8bda77..bb15df0 100644 >> --- a/sys/x86/x86/local_apic.c >> +++ b/sys/x86/x86/local_apic.c >> @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) >> } >> >> #ifdef SMP >> -#define LOOPS 1000000 >> +#define LOOPS 100000 >> /* >> * Calibrate the busy loop waiting for IPI ack in xAPIC mode. >> * lapic_ipi_wait_mult contains the number of iterations which >> >> Modified: >> head/sys/x86/x86/local_apic.c >> >> Modified: head/sys/x86/x86/local_apic.c >> ============================================================================== >> --- head/sys/x86/x86/local_apic.c Fri Jun 3 16:17:36 2016 (r301277) >> +++ head/sys/x86/x86/local_apic.c Fri Jun 3 18:05:18 2016 (r301278) >> @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) >> } >> >> #ifdef SMP >> -#define LOOPS 1000000 >> +#define LOOPS 100000 >> /* >> * Calibrate the busy loop waiting for IPI ack in xAPIC mode. >> * lapic_ipi_wait_mult contains the number of iterations which >> > > >-- >Regards, >Bryan Drewery > From owner-svn-src-head@freebsd.org Fri Jun 3 19:25:33 2016 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 72DC4B69549; Fri, 3 Jun 2016 19:25:33 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 36A841A76; Fri, 3 Jun 2016 19:25:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53JPWG7064077; Fri, 3 Jun 2016 19:25:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53JPUjp064061; Fri, 3 Jun 2016 19:25:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606031925.u53JPUjp064061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Jun 2016 19:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301283 - in head: gnu/usr.bin/groff/src/libs/libdriver gnu/usr.bin/groff/src/libs/libgroff kerberos5/tools/asn1_compile lib/libblacklist lib/libdevdctl libexec/blacklistd-helper target... 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.22 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, 03 Jun 2016 19:25:33 -0000 Author: bdrewery Date: Fri Jun 3 19:25:30 2016 New Revision: 301283 URL: https://svnweb.freebsd.org/changeset/base/301283 Log: DIRDEPS_BUILD: Connect new directories and update dependencies. Sponsored by: EMC / Isilon Storage Division Added: head/lib/libblacklist/Makefile.depend (contents, props changed) head/lib/libdevdctl/Makefile.depend (contents, props changed) head/libexec/blacklistd-helper/Makefile.depend (contents, props changed) head/usr.bin/bsdcat/Makefile.depend (contents, props changed) head/usr.bin/resizewin/Makefile.depend (contents, props changed) head/usr.bin/sdiff/Makefile.depend (contents, props changed) head/usr.sbin/blacklistctl/Makefile.depend (contents, props changed) head/usr.sbin/blacklistd/Makefile.depend (contents, props changed) head/usr.sbin/zonectl/Makefile.depend (contents, props changed) Modified: head/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend head/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend head/kerberos5/tools/asn1_compile/Makefile.depend head/targets/pseudo/tests/Makefile.depend head/targets/pseudo/userland/Makefile.depend head/targets/pseudo/userland/lib/Makefile.depend head/targets/pseudo/userland/libexec/Makefile.depend Modified: head/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend ============================================================================== --- head/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -4,6 +4,7 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libc++ \ lib/msun \ Modified: head/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend ============================================================================== --- head/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -4,6 +4,7 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libc++ \ lib/msun \ Modified: head/kerberos5/tools/asn1_compile/Makefile.depend ============================================================================== --- head/kerberos5/tools/asn1_compile/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/kerberos5/tools/asn1_compile/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -9,7 +9,6 @@ DIRDEPS = \ include/xlocale \ kerberos5/lib/libroken \ kerberos5/lib/libvers \ - kerberos5/tools/make-roken.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Added: head/lib/libblacklist/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libblacklist/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/libthr \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libdevdctl/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdevdctl/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libcxxrt \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/libexec/blacklistd-helper/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/blacklistd-helper/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/targets/pseudo/tests/Makefile.depend ============================================================================== --- head/targets/pseudo/tests/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/targets/pseudo/tests/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -283,6 +283,7 @@ DIRDEPS= \ usr.bin/bmake/tests/variables/modifier_t \ usr.bin/bmake/tests/variables/opt_V \ usr.bin/bmake/tests/variables/t0 \ + usr.bin/bsdcat/tests \ usr.bin/calendar/tests \ usr.bin/cmp/tests \ usr.bin/col/tests \ Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/targets/pseudo/userland/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -179,6 +179,7 @@ DIRDEPS+= \ usr.bin/brandelf \ usr.bin/bsdiff/bsdiff \ usr.bin/bsdiff/bspatch \ + usr.bin/bsdcat \ usr.bin/bzip2 \ usr.bin/bzip2recover \ usr.bin/c89 \ @@ -329,6 +330,7 @@ DIRDEPS+= \ usr.bin/quota \ usr.bin/rctl \ usr.bin/renice \ + usr.bin/resizewin \ usr.bin/rev \ usr.bin/revoke \ usr.bin/rlogin \ @@ -342,6 +344,7 @@ DIRDEPS+= \ usr.bin/rwall \ usr.bin/rwho \ usr.bin/script \ + usr.bin/sdiff \ usr.bin/sed \ usr.bin/send-pr \ usr.bin/seq \ @@ -788,6 +791,7 @@ DIRDEPS+= \ usr.sbin/ypset \ usr.sbin/zic/zdump \ usr.sbin/zic/zic \ + usr.sbin/zonectl \ ${DEP_RELDIR}/cddl \ ${DEP_RELDIR}/games \ ${DEP_RELDIR}/gnu \ @@ -890,6 +894,12 @@ DIRDEPS.powerpc= \ usr.sbin/nvram \ usr.sbin/ofwdump +.if ${MK_BLACKLIST_SUPPORT} != "no" +DIRDEPS+= \ + usr.sbin/blacklistctl \ + usr.sbin/blacklistd +.endif + .if ${MK_GPL_DTC} != "yes" DIRDEPS+= usr.bin/dtc .endif Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/targets/pseudo/userland/lib/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -40,6 +40,7 @@ DIRDEPS = \ lib/libcuse \ lib/libcxxrt \ lib/libdevctl \ + lib/libdevdctl \ lib/libdevinfo \ lib/libdevstat \ lib/libdwarf \ @@ -215,4 +216,8 @@ DIRDEPS+= \ contrib/ofed/usr.lib/libsdp .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +DIRDEPS+= lib/libblacklist +.endif + .include Modified: head/targets/pseudo/userland/libexec/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/libexec/Makefile.depend Fri Jun 3 18:54:16 2016 (r301282) +++ head/targets/pseudo/userland/libexec/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -2,6 +2,8 @@ # This file is not autogenerated - take care! +.include + DIRDEPS = \ libexec/atf/atf-check \ libexec/atf/atf-sh \ @@ -39,4 +41,8 @@ DIRDEPS = \ libexec/ypxfr \ +.if ${MK_BLACKLIST_SUPPORT} != "no" +DIRDEPS+= libexec/blacklistd-helper +.endif + .include Added: head/usr.bin/bsdcat/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/bsdcat/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,25 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libarchive \ + lib/libbz2 \ + lib/libc \ + lib/libcompiler_rt \ + lib/libexpat \ + lib/liblzma \ + lib/libthr \ + lib/libz \ + secure/lib/libcrypto \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/resizewin/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/resizewin/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/sdiff/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.sbin/blacklistctl/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/blacklistctl/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,22 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libblacklist \ + lib/libc \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libutil \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.sbin/blacklistd/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/blacklistd/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,22 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libblacklist \ + lib/libc \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libutil \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.sbin/zonectl/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/zonectl/Makefile.depend Fri Jun 3 19:25:30 2016 (r301283) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcam \ + lib/libcompiler_rt \ + lib/libsbuf \ + lib/libutil \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From owner-svn-src-head@freebsd.org Fri Jun 3 19:25:43 2016 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 87626B69582; Fri, 3 Jun 2016 19:25:43 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 625CF1BEF; Fri, 3 Jun 2016 19:25:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53JPgfu064190; Fri, 3 Jun 2016 19:25:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53JPfPT064179; Fri, 3 Jun 2016 19:25:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606031925.u53JPfPT064179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Jun 2016 19:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301285 - in head: bin/sh kerberos5 kerberos5/lib/libasn1 kerberos5/lib/libgssapi_spnego kerberos5/lib/libhdb kerberos5/lib/libhx509 share/mk usr.sbin/acpi/iasl usr.sbin/bsnmpd/bsnmpd 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.22 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, 03 Jun 2016 19:25:43 -0000 Author: bdrewery Date: Fri Jun 3 19:25:41 2016 New Revision: 301285 URL: https://svnweb.freebsd.org/changeset/base/301285 Log: WITH_META_MODE: Don't expect meta files for side-effect generated files. The first file in these lists will generate everything else so only it should be getting a .meta file. With bmake's missing=yes meta feature these would otherwise cause a rebuild without the .NOMETA hint. Sponsored by: EMC / Isilon Storage Division Modified: head/bin/sh/Makefile head/kerberos5/Makefile.inc head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_spnego/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libhx509/Makefile head/share/mk/bsd.dep.mk head/share/mk/bsd.snmpmod.mk head/usr.sbin/acpi/iasl/Makefile head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/bin/sh/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -39,6 +39,7 @@ CLEANFILES+= ${GENSRCS} ${GENHDRS} build-tools: mknodes mksyntax .ORDER: builtins.c builtins.h +builtins.h: .NOMETA builtins.c builtins.h: mkbuiltins builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} @@ -51,10 +52,12 @@ mknodes: mknodes.o ${BUILD_TOOLS_META} mksyntax: mksyntax.o ${BUILD_TOOLS_META} .ORDER: nodes.c nodes.h +nodes.h: .NOMETA nodes.c nodes.h: mknodes nodetypes nodes.c.pat ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat .ORDER: syntax.c syntax.h +syntax.h: .NOMETA syntax.c syntax.h: mksyntax ${BTOOLSPATH:U.}/mksyntax Modified: head/kerberos5/Makefile.inc ============================================================================== --- head/kerberos5/Makefile.inc Fri Jun 3 19:25:36 2016 (r301284) +++ head/kerberos5/Makefile.inc Fri Jun 3 19:25:41 2016 (r301285) @@ -35,6 +35,7 @@ ETSRCS= \ .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" .ORDER: ${_ET}.h ${_ET}.c +${_ET}.c: .NOMETA ${_ET}.c ${_ET}.h: ${ET} compile_et ${.ALLSRC} CLEANFILES+= ${_ET}.h ${_ET}.c Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/kerberos5/lib/libasn1/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -56,11 +56,13 @@ INCS+= krb5_asn1.h \ kx509_asn1.h .ORDER: ${GEN_CMS} +${GEN_CMS:[2..-1]}: .NOMETA ${GEN_CMS}: cms.asn1 cms.opt ${ASN1_COMPILE} --one-code-file \ --option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1 .ORDER: ${GEN_RFC2459} +${GEN_RFC2459:[2..-1]}: .NOMETA ${GEN_RFC2459}: rfc2459.asn1 ${ASN1_COMPILE} \ --one-code-file \ @@ -72,6 +74,7 @@ ${GEN_RFC2459}: rfc2459.asn1 --sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1 .ORDER: ${GEN_K5} +${GEN_K5:[2..-1]}: .NOMETA ${GEN_K5}: krb5.asn1 krb5.opt ${ASN1_COMPILE} \ --one-code-file \ @@ -79,31 +82,37 @@ ${GEN_K5}: krb5.asn1 krb5.opt ${.ALLSRC:M*.asn1} krb5_asn1 .ORDER: ${GEN_PKINIT} +${GEN_PKINIT:[2..-1]}: .NOMETA ${GEN_PKINIT}: pkinit.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkinit_asn1 .ORDER: ${GEN_PKCS8} +${GEN_PKCS8:[2..-1]}: .NOMETA ${GEN_PKCS8}: pkcs8.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs8_asn1 .ORDER: ${GEN_PKCS9} +${GEN_PKCS9:[2..-1]}: .NOMETA ${GEN_PKCS9}: pkcs9.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs9_asn1 .ORDER: ${GEN_PKCS12} +${GEN_PKCS12:[2..-1]}: .NOMETA ${GEN_PKCS12}: pkcs12.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs12_asn1 .ORDER: ${GEN_DIGEST} +${GEN_DIGEST:[2..-1]}: .NOMETA ${GEN_DIGEST}: digest.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} digest_asn1 .ORDER: ${GEN_KX509} +${GEN_KX509:[2..-1]}: .NOMETA ${GEN_KX509}: kx509.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} kx509_asn1 Modified: head/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_spnego/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/kerberos5/lib/libgssapi_spnego/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -38,6 +38,7 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx spnego_asn1_files spnego_asn1-template.c .ORDER: ${GEN} +${GEN:[2..-1]}: .NOMETA ${GEN}: spnego.asn1 spnego.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} spnego_asn1 Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/kerberos5/lib/libhdb/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -86,6 +86,7 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx hdb_asn1-template.[ch]* .ORDER: ${GEN} +${GEN:[2..-1]}: .NOMETA ${GEN}: hdb.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} hdb_asn1 Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/kerberos5/lib/libhx509/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -269,16 +269,19 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx INCS+= ocsp_asn1.h pkcs10_asn1.h crmf_asn1.h .ORDER: ${GEN_OCSP} +${GEN_OCSP:[2..-1]}: .NOMETA ${GEN_OCSP}: ocsp.asn1 ocsp.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} ocsp_asn1 .ORDER: ${GEN_PKCS10} +${GEN_PKCS10:[2..-1]}: .NOMETA ${GEN_PKCS10}: pkcs10.asn1 pkcs10.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} pkcs10_asn1 .ORDER: ${GEN_CRMF} +${GEN_CRMF:[2..-1]}: .NOMETA ${GEN_CRMF}: crmf.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} crmf_asn1 Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Jun 3 19:25:36 2016 (r301284) +++ head/share/mk/bsd.dep.mk Fri Jun 3 19:25:41 2016 (r301285) @@ -107,6 +107,7 @@ SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES+= ${_YC} .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) .ORDER: ${_YC} y.tab.h +y.tab.h: .NOMETA ${_YC} y.tab.h: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} cp y.tab.c ${_YC} @@ -114,6 +115,7 @@ CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h .ORDER: ${_YC} ${_YH} +${_YH}: .NOMETA ${_YC} ${_YH}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} SRCS+= ${_YH} Modified: head/share/mk/bsd.snmpmod.mk ============================================================================== --- head/share/mk/bsd.snmpmod.mk Fri Jun 3 19:25:36 2016 (r301284) +++ head/share/mk/bsd.snmpmod.mk Fri Jun 3 19:25:41 2016 (r301285) @@ -11,6 +11,7 @@ ${MOD}_oid.h: ${MOD}_tree.def ${EXTRAMIB cat ${.ALLSRC} | gensnmptree -e ${XSYM} > ${.TARGET} .ORDER: ${MOD}_tree.c ${MOD}_tree.h +${MOD}_tree.h: .NOMETA ${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def ${EXTRAMIBDEFS} cat ${.ALLSRC} | gensnmptree -p ${MOD}_ Modified: head/usr.sbin/acpi/iasl/Makefile ============================================================================== --- head/usr.sbin/acpi/iasl/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/usr.sbin/acpi/iasl/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -97,6 +97,7 @@ aslcompiler.y: ${PARSER} ${ACPICA_DIR}/compiler/aslparser.y > ${.TARGET} .ORDER: aslcompilerparse.c aslcompilerparse.h +aslcompilerparse.h: .NOMETA aslcompilerparse.c aslcompilerparse.h: aslcompiler.y ${YACC} ${YFLAGS} -pAslCompiler -oaslcompilerparse.c ${.ALLSRC} @@ -107,6 +108,7 @@ dtparserlex.c: dtparser.l ${LEX} ${LFLAGS} -PDtParser -o${.TARGET} ${.ALLSRC} .ORDER: dtparserparse.c dtparserparse.h +dtparserparse.h: .NOMETA dtparserparse.c dtparserparse.h: dtparser.y ${YACC} ${YFLAGS} -pDtParser -odtparserparse.c ${.ALLSRC} @@ -117,6 +119,7 @@ prparserlex.c: prparser.l ${LEX} ${LFLAGS} -PPrParser -o${.TARGET} ${.ALLSRC} .ORDER: prparserparse.c prparserparse.h +prparserparse.h: .NOMETA prparserparse.c prparserparse.h: prparser.y ${YACC} ${YFLAGS} -pPrParser -oprparserparse.c ${.ALLSRC} Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Fri Jun 3 19:25:36 2016 (r301284) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Fri Jun 3 19:25:41 2016 (r301285) @@ -40,6 +40,7 @@ oid.h: tree.def Makefile gensnmptree -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET} .ORDER: tree.c tree.h +tree.h: .NOMETA tree.c tree.h: tree.def gensnmptree -l < ${.ALLSRC} From owner-svn-src-head@freebsd.org Fri Jun 3 19:25:38 2016 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 0D262B6956B; Fri, 3 Jun 2016 19:25:38 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id D12901AB3; Fri, 3 Jun 2016 19:25:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53JPb2O064134; Fri, 3 Jun 2016 19:25:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53JPa0c064124; Fri, 3 Jun 2016 19:25:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606031925.u53JPa0c064124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Jun 2016 19:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301284 - in head: share/mk sys/conf 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.22 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, 03 Jun 2016 19:25:38 -0000 Author: bdrewery Date: Fri Jun 3 19:25:36 2016 New Revision: 301284 URL: https://svnweb.freebsd.org/changeset/base/301284 Log: Revert r301079. This breaks cross-building with WITH_META_MODE since it will rebuild 'build-tools' during the 'everything' phase. A more proper fix is coming to bmake to implicitly require .META unless .NOMETA (and other restrictions) are in place. Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.info.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.man.mk head/share/mk/bsd.nls.mk head/share/mk/bsd.prog.mk head/share/mk/sys.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/bsd.dep.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -92,7 +92,7 @@ OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} # Lexical analyzers .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c -${_LC}: ${_LSRC} ${OP_META} +${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC} SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} @@ -107,7 +107,6 @@ SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES+= ${_YC} .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) .ORDER: ${_YC} y.tab.h -${_YC}: ${OP_META} ${_YC} y.tab.h: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} cp y.tab.c ${_YC} @@ -115,14 +114,13 @@ CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h .ORDER: ${_YC} ${_YH} -${_YC}: ${OP_META} ${_YC} ${_YH}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} SRCS+= ${_YH} CLEANFILES+= ${_YH} .endfor .else -${_YC}: ${_YSRC} ${OP_META} +${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC} @@ -136,20 +134,20 @@ CFLAGS+= -I${.OBJDIR} .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} SRCS+= ${_D}.h -${_D}.h: ${_DSRC} ${OP_META} +${_D}.h: ${_DSRC} ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC} SRCS:= ${SRCS:S/^${_DSRC}$//} OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o -${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} ${OP_META} +${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po -${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} ${OP_META} +${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} -${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} ${OP_META} +${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .endif @@ -245,7 +243,7 @@ DPSRCS+= ${SRCS} # A .depend file will only be generated if there are commands in # beforedepend/_EXTRADEPEND/afterdepend. The target is kept # to allow 'make depend' to generate files. -${DEPENDFILE}: ${DPSRCS} ${OP_META} +${DEPENDFILE}: ${DPSRCS} .if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE}) rm -f ${DEPENDFILE} .endif Modified: head/share/mk/bsd.info.mk ============================================================================== --- head/share/mk/bsd.info.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/bsd.info.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -86,18 +86,18 @@ DVIPS2ASCII?= dvips2ascii .SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html -.texi.info .texinfo.info: ${OP_META} +.texi.info .texinfo.info: ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \ -o ${.TARGET} -.texi.dvi .texinfo.dvi: ${OP_META} +.texi.dvi .texinfo.dvi: TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \ ${TEX} ${.IMPSRC} > ${.IMPSRC:T:R}-la.texi TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \ ${TEX} ${.IMPSRC:T:R}-la.texi ${.TARGET}.new mv -f ${.TARGET}.new ${.TARGET} -.dvi.ps: ${OP_META} +.dvi.ps: ${DVIPS} -o ${.TARGET} ${.IMPSRC} -.info.html: ${OP_META} +.info.html: ${INFO2HTML} ${.IMPSRC} ${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET} @@ -133,7 +133,7 @@ all: ${IFILES} .endif .for x in ${IFILENS} -${x:S/$/${ICOMPRESS_EXT}/}: ${x} ${OP_META} +${x:S/$/${ICOMPRESS_EXT}/}: ${x} ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET} .endfor @@ -158,7 +158,7 @@ ${x:S/$/-install/}: .if defined(SRCS) CLEANFILES+= ${INFO}.texi -${INFO}.texi: ${SRCS} ${OP_META} +${INFO}.texi: ${SRCS} cat ${.ALLSRC} > ${.TARGET} .endif Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/bsd.lib.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -91,55 +91,55 @@ PICFLAG=-fpic PO_FLAG=-pg -.c.o: ${OP_META} +.c.o: ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.c.po: ${OP_META} +.c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.c.So: ${OP_META} +.c.So: ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.cc.o .C.o .cpp.o .cxx.o: ${OP_META} +.cc.o .C.o .cpp.o .cxx.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.cc.po .C.po .cpp.po .cxx.po: ${OP_META} +.cc.po .C.po .cpp.po .cxx.po: ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.cc.So .C.So .cpp.So .cxx.So: ${OP_META} +.cc.So .C.So .cpp.So .cxx.So: ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.f.po: ${OP_META} +.f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} ${CTFCONVERT_CMD} -.f.So: ${OP_META} +.f.So: ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} ${CTFCONVERT_CMD} -.s.po .s.So: ${OP_META} +.s.po .s.So: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} ${CTFCONVERT_CMD} -.asm.po: ${OP_META} +.asm.po: ${CC:N${CCACHE_BIN}} -x assembler-with-cpp -DPROF ${PO_CFLAGS} \ ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.asm.So: ${OP_META} +.asm.So: ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.S.po: ${OP_META} +.S.po: ${CC:N${CCACHE_BIN}} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ -o ${.TARGET} ${CTFCONVERT_CMD} -.S.So: ${OP_META} +.S.So: ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} @@ -183,7 +183,7 @@ CLEANFILES+= ${OBJS} ${STATICOBJS} .if defined(LIB) && !empty(LIB) _LIBS= lib${LIB_PRIVATE}${LIB}.a -lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} ${OP_META} +lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} @@ -198,7 +198,7 @@ POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o= DEPENDOBJS+= ${POBJS} CLEANFILES+= ${POBJS} -lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} ${OP_META} +lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${POBJS} | tsort -q` ${ARADD} @@ -230,7 +230,7 @@ ${SHLIB_NAME_FULL}: beforelinking .if defined(SHLIB_LINK) .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) -${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} ${OP_META} +${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} sed -e 's,@@SHLIB@@,${_SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LIBDIR},g' \ ${.ALLSRC} > ${.TARGET} @@ -241,7 +241,7 @@ CLEANFILES+= ${SHLIB_LINK:R}.ld CLEANFILES+= ${SHLIB_LINK} .endif -${SHLIB_NAME_FULL}: ${SOBJS} ${OP_META} +${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) @@ -256,11 +256,11 @@ ${SHLIB_NAME_FULL}: ${SOBJS} ${OP_META} .if ${MK_DEBUG_FILES} != "no" CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug -${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OP_META} +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} -${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} ${OP_META} +${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} .endif .endif #defined(SHLIB_NAME) @@ -268,7 +268,7 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a -lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} ${OP_META} +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} @@ -281,7 +281,7 @@ _LIBS+= ${LINTLIB} LINTOBJS+= ${SRCS:M*.c:.c=.ln} CLEANFILES+= ${LINTOBJS} -${LINTLIB}: ${LINTOBJS} ${OP_META} +${LINTLIB}: ${LINTOBJS} @${ECHO} building lint library ${.TARGET} @rm -f ${.TARGET} ${LINT} ${LINTLIBFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/bsd.man.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -99,7 +99,7 @@ ${__target}: ${__page} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __target in ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} all-man: ${__target} -${__target}: ${__page} ${OP_META} +${__target}: ${__page} ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} > ${.TARGET} .endfor .endif @@ -112,7 +112,7 @@ CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g} .for __page in ${MAN} .for __target in ${__page:T:S/$/${CATEXT}/g} all-man: ${__target} -${__target}: ${__page} ${OP_META} +${__target}: ${__page} ${MANDOC_CMD} ${.ALLSRC} > ${.TARGET} .endfor .endfor @@ -148,7 +148,7 @@ CLEANFILES+= ${MAN:T:S/$/${CATEXT}${MCOM .for __page in ${MAN} .for __target in ${__page:T:S/$/${MCOMPRESS_EXT}/} all-man: ${__target} -${__target}: ${__page} ${OP_META} +${__target}: ${__page} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MCOMPRESS_CMD} > ${.TARGET} .else @@ -158,7 +158,7 @@ ${__target}: ${__page} ${OP_META} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __target in ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/} all-man: ${__target} -${__target}: ${__page} ${OP_META} +${__target}: ${__page} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} | ${MCOMPRESS_CMD} > ${.TARGET} .else Modified: head/share/mk/bsd.nls.mk ============================================================================== --- head/share/mk/bsd.nls.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/bsd.nls.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -42,7 +42,7 @@ NLSSRCFILES_${file}?= ${NLSSRCFILES} .endif .if defined(NLSSRCFILES_${file}) NLSSRCDIR_${file}?= ${NLSSRCDIR} -${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//} ${OP_META} +${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//} @rm -f ${.TARGET} cat ${.ALLSRC} > ${.TARGET} CLEANFILES+= ${file}.msg Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/bsd.prog.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -90,7 +90,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} beforelinking: ${OBJS} ${PROG_FULL}: beforelinking .endif -${PROG_FULL}: ${OBJS} ${OP_META} +${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ ${OBJS} ${LDADD} @@ -122,7 +122,7 @@ OBJS+= ${PROG}.o beforelinking: ${OBJS} ${PROG_FULL}: beforelinking .endif -${PROG_FULL}: ${OBJS} ${OP_META} +${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ ${OBJS} ${LDADD} @@ -138,11 +138,11 @@ ${PROG_FULL}: ${OBJS} ${OP_META} .endif # !defined(SRCS) .if ${MK_DEBUG_FILES} != "no" -${PROG}: ${PROG_FULL} ${PROGNAME}.debug ${OP_META} +${PROG}: ${PROG_FULL} ${PROGNAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ ${PROG_FULL} ${.TARGET} -${PROGNAME}.debug: ${PROG_FULL} ${OP_META} +${PROGNAME}.debug: ${PROG_FULL} ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} .endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/share/mk/sys.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -61,9 +61,6 @@ META_MODE+= nofilemon META_MODE?= normal .export META_MODE .MAKE.MODE?= ${META_MODE} -.if ${.MAKE.MODE:Mmeta*} != "" -OP_META= .META -.endif .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed @@ -292,99 +289,99 @@ YFLAGS ?= -d # non-Posix rule set -.sh: ${OP_META} +.sh: cp -f ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} -.c.ln: ${OP_META} +.c.ln: ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ touch ${.TARGET} -.cc.ln .C.ln .cpp.ln .cxx.ln: ${OP_META} +.cc.ln .C.ln .cpp.ln .cxx.ln: ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \ touch ${.TARGET} -.c: ${OP_META} +.c: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} ${CTFCONVERT_CMD} -.c.o: ${OP_META} +.c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.cc .cpp .cxx .C: ${OP_META} +.cc .cpp .cxx .C: ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} -.cc.o .cpp.o .cxx.o .C.o: ${OP_META} +.cc.o .cpp.o .cxx.o .C.o: ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.m.o: ${OP_META} +.m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.p.o: ${OP_META} +.p.o: ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.e .r .F .f: ${OP_META} +.e .r .F .f: ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \ -o ${.TARGET} -.e.o .r.o .F.o .f.o: ${OP_META} +.e.o .r.o .F.o .f.o: ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.S.o: ${OP_META} +.S.o: ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.asm.o: ${OP_META} +.asm.o: ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ -o ${.TARGET} ${CTFCONVERT_CMD} -.s.o: ${OP_META} +.s.o: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} ${CTFCONVERT_CMD} # XXX not -j safe -.y.o: ${OP_META} +.y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} rm -f y.tab.c ${CTFCONVERT_CMD} -.l.o: ${OP_META} +.l.o: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} rm -f ${.PREFIX}.tmp.c ${CTFCONVERT_CMD} # XXX not -j safe -.y.c: ${OP_META} +.y.c: ${YACC} ${YFLAGS} ${.IMPSRC} mv y.tab.c ${.TARGET} -.l.c: ${OP_META} +.l.c: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET} -.s.out .c.out .o.out: ${OP_META} +.s.out .c.out .o.out: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} ${CTFCONVERT_CMD} -.f.out .F.out .r.out .e.out: ${OP_META} +.f.out .F.out .r.out .e.out: ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ ${LDLIBS} -o ${.TARGET} rm -f ${.PREFIX}.o ${CTFCONVERT_CMD} # XXX not -j safe -.y.out: ${OP_META} +.y.out: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} rm -f y.tab.c ${CTFCONVERT_CMD} -.l.out: ${OP_META} +.l.out: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} rm -f ${.PREFIX}.tmp.c Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/sys/conf/kern.post.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -108,10 +108,10 @@ modules-all modules-depend: modules-obj FULLKERNEL= ${KERNEL_KO} .else FULLKERNEL= ${KERNEL_KO}.full -${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.debug ${OP_META} +${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.debug \ ${FULLKERNEL} ${.TARGET} -${KERNEL_KO}.debug: ${FULLKERNEL} ${OP_META} +${KERNEL_KO}.debug: ${FULLKERNEL} ${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET} install.debug reinstall.debug: gdbinit cd ${.CURDIR}; ${MAKE} ${.TARGET:R} @@ -127,7 +127,7 @@ gdbinit: .endif .endif -${FULLKERNEL}: ${SYSTEM_DEP} vers.o ${OP_META} +${FULLKERNEL}: ${SYSTEM_DEP} vers.o @rm -f ${.TARGET} @echo linking ${.TARGET} ${SYSTEM_LD} @@ -150,9 +150,9 @@ LNFILES= ${CFILES:T:S/.c$/.ln/} .for mfile in ${MFILES} # XXX the low quality .m.o rules gnerated by config are normally used # instead of the .m.c rules here. -${mfile:T:S/.m$/.c/}: ${mfile} ${OP_META} +${mfile:T:S/.m$/.c/}: ${mfile} ${AWK} -f $S/tools/makeobjops.awk ${mfile} -c -${mfile:T:S/.m$/.h/}: ${mfile} ${OP_META} +${mfile:T:S/.m$/.h/}: ${mfile} ${AWK} -f $S/tools/makeobjops.awk ${mfile} -h .endfor @@ -172,18 +172,18 @@ lint: ${LNFILES} # dynamic references. We could probably do a '-Bforcedynamic' mode like # in the a.out ld. For now, this works. HACK_EXTRA_FLAGS?= -shared -hack.So: Makefile ${OP_META} +hack.So: Makefile :> hack.c ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So rm -f hack.c -assym.s: $S/kern/genassym.sh genassym.o ${OP_META} +assym.s: $S/kern/genassym.sh genassym.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} -genassym.o: $S/$M/$M/genassym.c ${OP_META} +genassym.o: $S/$M/$M/genassym.c ${CC} -c ${CFLAGS:N-fno-common} $S/$M/$M/genassym.c -${SYSTEM_OBJS} genassym.o vers.o: opt_global.h ${OP_META} +${SYSTEM_OBJS} genassym.o vers.o: opt_global.h # Skip reading .depend when not needed to speed up tree-walks # and simple lookups. @@ -260,7 +260,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}:N .NOPATH: .depend ${DEPENDFILES_OBJS} -.depend: .PRECIOUS ${SRCS} ${OP_META} +.depend: .PRECIOUS ${SRCS} _ILINKS= machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" @@ -339,26 +339,26 @@ kernel-reinstall: ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/ .endif -config.o env.o hints.o vers.o vnode_if.o: ${OP_META} +config.o env.o hints.o vers.o vnode_if.o: ${NORMAL_C} ${NORMAL_CTFCONVERT} -config.ln env.ln hints.ln vers.ln vnode_if.ln: ${OP_META} +config.ln env.ln hints.ln vers.ln vnode_if.ln: ${NORMAL_LINT} -vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} ${OP_META} +vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT} -vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src ${OP_META} +vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: $S/tools/vnode_if.awk \ - $S/kern/vnode_if.src ${OP_META} -vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h ${OP_META} + $S/kern/vnode_if.src +vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -h -vnode_if_newproto.h: ${OP_META} +vnode_if_newproto.h: ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -p -vnode_if_typedef.h: ${OP_META} +vnode_if_typedef.h: ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -q .if ${MFS_IMAGE:Uno} != "no" @@ -367,7 +367,7 @@ vnode_if_typedef.h: ${OP_META} # via linking. Make sure the contents are in the mfs section and rename the # start/end/size variables to __start_mfs, __stop_mfs, and mfs_size, # respectively. -embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} ${OP_META} +embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} ${OBJCOPY} --input-target binary \ --output-target ${EMBEDFS_FORMAT.${MACHINE_ARCH}} \ --binary-architecture ${EMBEDFS_ARCH.${MACHINE_ARCH}} \ Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/sys/conf/kern.pre.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -22,7 +22,6 @@ _srcconf_included_: # The kernel build always occurs in the object directory which is .CURDIR. .if ${.MAKE.MODE:Unormal:Mmeta} .MAKE.MODE+= curdirOk=yes -OP_META= .META .endif # Can be overridden by makeoptions or /etc/make.conf Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Jun 3 19:25:30 2016 (r301283) +++ head/sys/conf/kmod.mk Fri Jun 3 19:25:36 2016 (r301284) @@ -159,7 +159,7 @@ CTFFLAGS+= -g .endif .if defined(FIRMWS) -${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk ${OP_META} +${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk ${AWK} -f ${SYSDIR}/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \ ${FIRMWARE_LICENSE:C/.+/-l/}${FIRMWARE_LICENSE} @@ -167,7 +167,7 @@ SRCS+= ${KMOD:S/$/.c/} CLEANFILES+= ${KMOD:S/$/.c/} .for _firmw in ${FIRMWS} -${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} ${OP_META} +${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} @if [ -e ${_firmw:C/\:.*$//} ]; then \ ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ @@ -198,15 +198,15 @@ PROG= ${KMOD}.ko FULLPROG= ${PROG} .else FULLPROG= ${PROG}.full -${PROG}: ${FULLPROG} ${PROG}.debug ${OP_META} +${PROG}: ${FULLPROG} ${PROG}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROG}.debug \ ${FULLPROG} ${.TARGET} -${PROG}.debug: ${FULLPROG} ${OP_META} +${PROG}.debug: ${FULLPROG} ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET} .endif .if ${__KLD_SHARED} == yes -${FULLPROG}: ${KMOD}.kld ${OP_META} +${FULLPROG}: ${KMOD}.kld .if ${MACHINE_CPUARCH} != "aarch64" ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld .else @@ -229,9 +229,9 @@ CLEANFILES+= export_syms .endif .if ${__KLD_SHARED} == yes -${KMOD}.kld: ${OBJS} ${OP_META} +${KMOD}.kld: ${OBJS} .else -${FULLPROG}: ${OBJS} ${OP_META} +${FULLPROG}: ${OBJS} .endif ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} .if ${MK_CTF} != "no" @@ -397,16 +397,16 @@ _MATCHES=${_MFILES:${_MATCH}} CLEANFILES+= ${_i} .endif .endfor # _i -.m.c: ${SYSDIR}/tools/makeobjops.awk ${OP_META} +.m.c: ${SYSDIR}/tools/makeobjops.awk ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c -.m.h: ${SYSDIR}/tools/makeobjops.awk ${OP_META} +.m.h: ${SYSDIR}/tools/makeobjops.awk ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h .for _i in mii pccard .if !empty(SRCS:M${_i}devs.h) CLEANFILES+= ${_i}devs.h -${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs ${OP_META} +${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs ${AWK} -f ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs .endif .endfor # _i @@ -415,9 +415,8 @@ ${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h CLEANFILES+= bhnd_nvram_map.h bhnd_nvram_map.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \ ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ - ${SYSDIR}/dev/bhnd/nvram/nvram_map \ - ${OP_META} -bhnd_nvram_map.h: ${OP_META} + ${SYSDIR}/dev/bhnd/nvram/nvram_map +bhnd_nvram_map.h: sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map -h .endif @@ -426,28 +425,27 @@ bhnd_nvram_map.h: ${OP_META} CLEANFILES+= bhnd_nvram_map_data.h bhnd_nvram_map_data.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \ ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ - ${SYSDIR}/dev/bhnd/nvram/nvram_map \ - ${OP_META} -bhnd_nvram_map_data.h: ${OP_META} + ${SYSDIR}/dev/bhnd/nvram/nvram_map +bhnd_nvram_map_data.h: sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map -d .endif .if !empty(SRCS:Musbdevs.h) CLEANFILES+= usbdevs.h -usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs ${OP_META} +usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -h .endif .if !empty(SRCS:Musbdevs_data.h) CLEANFILES+= usbdevs_data.h -usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs ${OP_META} +usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d .endif .if !empty(SRCS:Macpi_quirks.h) CLEANFILES+= acpi_quirks.h -acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks ${OP_META} +acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks ${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks .endif @@ -457,10 +455,10 @@ assym.s: genassym.o .if defined(KERNBUILDDIR) genassym.o: opt_global.h .endif -assym.s: ${SYSDIR}/kern/genassym.sh ${OP_META} +assym.s: ${SYSDIR}/kern/genassym.sh sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c -genassym.o: ${SRCS:Mopt_*.h} ${OP_META} +genassym.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-fno-common} \ ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c .endif From owner-svn-src-head@freebsd.org Fri Jun 3 19:25:47 2016 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 1EFD1B695AA; Fri, 3 Jun 2016 19:25:47 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id A73601CBE; Fri, 3 Jun 2016 19:25:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53JPjgC064238; Fri, 3 Jun 2016 19:25:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53JPj2Y064237; Fri, 3 Jun 2016 19:25:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606031925.u53JPj2Y064237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Jun 2016 19:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301286 - head/share/mk 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.22 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, 03 Jun 2016 19:25:47 -0000 Author: bdrewery Date: Fri Jun 3 19:25:45 2016 New Revision: 301286 URL: https://svnweb.freebsd.org/changeset/base/301286 Log: WITH_CCACHE_BUILD + WITH_META_MODE: Ignore ccache changes. Ccache will not affect the output of the objects, so just ignore it for meta mode handling. This avoids having everything rebuild if ccache is updated. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Fri Jun 3 19:25:41 2016 (r301285) +++ head/share/mk/bsd.compiler.mk Fri Jun 3 19:25:45 2016 (r301286) @@ -96,6 +96,9 @@ CCACHE_DIR:= ${CCACHE_DIR:tA} .MAKE.META.IGNORE_PATHS+= ${CCACHE_DIR} .export CCACHE_DIR .endif +# ccache doesn't affect build output so let it slide for meta mode +# comparisons. +.MAKE.META.IGNORE_PATHS+= ${CCACHE_BIN} ccache-print-options: .PHONY @${CCACHE_BIN} -p .endif # exists(${CCACHE_BIN}) From owner-svn-src-head@freebsd.org Fri Jun 3 19:52:07 2016 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 6EA9BB69B48 for ; Fri, 3 Jun 2016 19:52:07 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E85081E30 for ; Fri, 3 Jun 2016 19:52:06 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f41.google.com with SMTP id k98so61084119lfi.1 for ; Fri, 03 Jun 2016 12:52:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=82wzOX07Sm7GC65McTUpMZ5Nam1N3wphjG+y38LZcSA=; b=fR4vBL3zQciV9Gei7xfRXM3oPecuTbzT+yL620d9Lroiug2BuerQO7TEnsAb7MDRxs JmX66phaho66yKBzwL/SL0CcRBcC48NFzhEhaynsr14PrE76i5OQzWdeu0PGBPM8DGPy GsII3MzgLV092eyzOTFvNMJQsDZCMhUMjMfWKd2lFBflaGh55SNSY7YP2kNobl6eluok USkGERta1t2QJJ2DhMZSlJz06wA3q7Mj9srhPX7FgRc1zhyh+v7pRZnJbUAyyEKN0SY6 MOvTftYcpZYgHH74k2i7tDFxyB/XOw3EaMlJBsYL4lHWa35AuzvytVwujhXlbLNlXZ8L 2JhA== X-Gm-Message-State: ALyK8tLt/epWSFgDu22s4b/J+/0kHT6/uDe25wxDL4/cCQr9pketiHXwGWbggzM6mjwsuw== X-Received: by 10.25.150.195 with SMTP id y186mr1227646lfd.169.1464983518838; Fri, 03 Jun 2016 12:51:58 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 66sm545906ljf.8.2016.06.03.12.51.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Jun 2016 12:51:58 -0700 (PDT) Subject: Re: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic To: Bryan Drewery , Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606031617.u53GHaEB088345@repo.freebsd.org> From: Andrey Chernov Message-ID: <0b8a3212-fec2-c041-8cb5-a1dc7b3637ef@freebsd.org> Date: Fri, 3 Jun 2016 22:51:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8Mo6nKTvn1a4UrfgTt9HjIxdsK0wCNh6M" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 19:52:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8Mo6nKTvn1a4UrfgTt9HjIxdsK0wCNh6M Content-Type: multipart/mixed; boundary="B4CeiJCeJjE4xC8AMhjAM8QgBkpGdmn1U" From: Andrey Chernov To: Bryan Drewery , Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0b8a3212-fec2-c041-8cb5-a1dc7b3637ef@freebsd.org> Subject: Re: svn commit: r301277 - in head: . lib/clang lib/clang/include/clang/Basic lib/clang/libclangbasic References: <201606031617.u53GHaEB088345@repo.freebsd.org> In-Reply-To: --B4CeiJCeJjE4xC8AMhjAM8QgBkpGdmn1U Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03.06.2016 20:44, Bryan Drewery wrote: > Thanks! >=20 > I think this helps Andrey's recent clang rebuild issues as well since > the quite-common file was being touched often. Thanx! >=20 > On 6/3/2016 9:17 AM, Dimitry Andric wrote: >> Author: dim >> Date: Fri Jun 3 16:17:36 2016 >> New Revision: 301277 >> URL: https://svnweb.freebsd.org/changeset/base/301277 >> >> Log: >> For clang, move the definition of FREEBSD_CC_VERSION into its own he= ader >> file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc= =2E >> The header is only included from one .cpp file in the clang tree. >> =20 >> This minimizes the number of .cpp files that need to be rebuilt if t= he >> version is bumped. >> =20 >> Discussed with: bdrewery >> >> Added: >> head/lib/clang/freebsd_cc_version.h (contents, props changed) >> Modified: >> head/Makefile.inc1 >> head/lib/clang/include/clang/Basic/Version.inc >> head/lib/clang/libclangbasic/Makefile >> >> Modified: head/Makefile.inc1 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/Makefile.inc1 Fri Jun 3 15:33:21 2016 (r301276) >> +++ head/Makefile.inc1 Fri Jun 3 16:17:36 2016 (r301277) >> @@ -99,7 +99,7 @@ _expected_compiler_type=3D gcc >> .if ${_expected_compiler_type} =3D=3D "clang" >> CROSS_COMPILER_FREEBSD_VERSION!=3D \ >> awk '$$2 =3D=3D "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ >> - ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown >> + ${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown >> CROSS_COMPILER_VERSION!=3D \ >> awk '$$2 =3D=3D "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10= 000 + a[2] * 100 + a[3]}' \ >> ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown >> >> Added: head/lib/clang/freebsd_cc_version.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/lib/clang/freebsd_cc_version.h Fri Jun 3 16:17:36 2016 (r301= 277) >> @@ -0,0 +1,3 @@ >> +/* $FreeBSD$ */ >> + >> +#define FREEBSD_CC_VERSION 1100004 >> >> Modified: head/lib/clang/include/clang/Basic/Version.inc >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 15:33:21= 2016 (r301276) >> +++ head/lib/clang/include/clang/Basic/Version.inc Fri Jun 3 16:17:36= 2016 (r301277) >> @@ -8,5 +8,3 @@ >> #define CLANG_VENDOR "FreeBSD " >> =20 >> #define SVN_REVISION "262564" >> - >> -#define FREEBSD_CC_VERSION 1100004U >> >> Modified: head/lib/clang/libclangbasic/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/clang/libclangbasic/Makefile Fri Jun 3 15:33:21 2016 (r3= 01276) >> +++ head/lib/clang/libclangbasic/Makefile Fri Jun 3 16:17:36 2016 (r3= 01277) >> @@ -50,3 +50,6 @@ TGHDRS=3D AttrHasAttributeImpl \ >> =20 >> # XX: work around GCC bug 67888 >> CFLAGS.gcc +=3D -fpermissive >> + >> +# Ensure FREEBSD_CC_VERSION is defined for Targets.cpp >> +CFLAGS.Targets.cpp+=3D -include ../freebsd_cc_version.h >> >=20 >=20 --B4CeiJCeJjE4xC8AMhjAM8QgBkpGdmn1U-- --8Mo6nKTvn1a4UrfgTt9HjIxdsK0wCNh6M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXUd/dAAoJEKUckv0MjfbKpJ8IALGQ/daLaYaSRkKQCsXp+2c4 FdZO+k/K1vr0iFjUEosH7TrXZLXYiGCyD8cqgJUB0HQARkCno5ijK0FuKfj3z+wA t1PNOqd4M897ojirDNc7WFmsRDB5q98eLE2FpMbeFv76o7lx9TAO3nDhA0h5akdf fPAy5IhJHuTf/N/kA0cYuXlP16EVVv7fqN7XAtiSdIFC6SgJd6sTid4PmPYg+Xq0 TiLHD6A4VZupFRnevfebZgvqNhQ+bw4H6avTsGuIOmEXFKgaUE7boKmX1itrF6zW YQRs3cdapxMwPqRvBQiKJBu0+QxRyi7zYf7QpzKUKzwHRvKvl20Si8Irxs2efAs= =Gytg -----END PGP SIGNATURE----- --8Mo6nKTvn1a4UrfgTt9HjIxdsK0wCNh6M-- From owner-svn-src-head@freebsd.org Fri Jun 3 20:49:50 2016 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 8CA85B687D8; Fri, 3 Jun 2016 20:49:50 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 44D9B18C6; Fri, 3 Jun 2016 20:49:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53KnnEd093931; Fri, 3 Jun 2016 20:49:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53KnnuL093930; Fri, 3 Jun 2016 20:49:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606032049.u53KnnuL093930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Jun 2016 20:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301287 - head 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.22 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, 03 Jun 2016 20:49:50 -0000 Author: bdrewery Date: Fri Jun 3 20:49:49 2016 New Revision: 301287 URL: https://svnweb.freebsd.org/changeset/base/301287 Log: WITHOUT_CROSS_COMPILER: Fix installworld. Since no WORLDTMP/usr/bin/cc is created, cc cannot be found during installworld time since /usr/bin is not in the PATH. Pass along the known compiler metadata to allow installworld to work. The same fix was used for WITH_SYSTEM_COMPILER. A better route would be to store a cookie in buildworld containing this compiler metadata and then using that at install time, rather than rerunning cc. Reported by: Mark Millard Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jun 3 19:25:45 2016 (r301286) +++ head/Makefile.inc1 Fri Jun 3 20:49:49 2016 (r301287) @@ -118,9 +118,6 @@ CROSS_COMPILER_VERSION!= \ # Everything matches, disable the bootstrap compiler. MK_CLANG_BOOTSTRAP= no MK_GCC_BOOTSTRAP= no -CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ - COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .if make(buildworld) .info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. .endif @@ -128,6 +125,15 @@ CROSSENV+= COMPILER_VERSION=${COMPILER_V .endif # ${_expected_compiler_type} == ${COMPILER_TYPE} .endif # ${XCC:N${CCACHE_BIN}:M/*} +# For installworld need to ensure that the looked-up compiler metadata is +# passed along rather than trying to run cc from the restricted +# STRICTTMPPATH. +.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" +CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ + COMPILER_TYPE=${COMPILER_TYPE} \ + COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} +.endif + # Handle external binutils. .if defined(CROSS_TOOLCHAIN_PREFIX) CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} From owner-svn-src-head@freebsd.org Fri Jun 3 20:55:34 2016 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 EADE5B68A29; Fri, 3 Jun 2016 20:55:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A89C41E69; Fri, 3 Jun 2016 20:55:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id t13so1168108qtc.3; Fri, 03 Jun 2016 13:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HWGEn3tjQ+r9gR6ZgUdItm3resf6jXDZafLJUhGKrBo=; b=bxRo3sl4Z2cZzkGMDDLEZ0YEuR9iqbQzy2kmGAPq8k1fEKs384PPDdxtyVoDMFK/dP 5aDhLrzXoqmvo3TrQUwA8+hQEyfVz4VCG5VD4xVnbyn1VFsTfvf+GP0/0dyCp9Z2l33R pE5HXFCZOh0UyY6MLglWUSY0Q/ydsMbRzIVuVbRFUDaMF8DeERdTHcDr5CHmt2pXKlmA O7SvKvqRLbJICNzFTxTg/anfJHofc8cAKLYOU9BLrP2rQVA9IFXCIkT+MdnmfXZCpsEs iVduAJUCmtSMSaUh8ELLCU/6uvudP+Vh2NBe8+MoDMdqkwg0VSOUGOvU3mkeC640Hqy+ izEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HWGEn3tjQ+r9gR6ZgUdItm3resf6jXDZafLJUhGKrBo=; b=QGi5iPzcK1EHDEJnlR7sobX/f1eCN4Tt8MIIOyK6cRQhPxQiwHHbAjx7CuP0AnCbYw 5M9f2fUUzRJ+ZmTSWoGe4rTJGdOdmvQOVEyCcTwvm3W5rIbKVI5GkcFRCB7XTBS/HyKA 0WLO0P7JRFhCHCcmg1wLnxm0SmzdBBDCybFTX9cozWh6vqM66+DiWhxTyhDg5G0J+qj3 Dw7elz5blgda6EZ34be/tHt+yU4lfbqIFnLpgTbqMU31S6PEh3wusGmmg3LRTEz8Gg1F n9qo7Ht1rHXQqgGuBE+DuEgd2WXIw/DWFsy6YF+IAxuDQSgmWUaLeWOdGLNqv+2s+qi1 hlPg== X-Gm-Message-State: ALyK8tJ1UhoXDzaqjomobsmHLdLaRcUUbuIy07r25lqYZpb54kjeTezwzLWZCUJdUOn6fuSqxePrJrlgvBYRZQ== X-Received: by 10.237.41.5 with SMTP id s5mr5362789qtd.71.1464987333765; Fri, 03 Jun 2016 13:55:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.146.69 with HTTP; Fri, 3 Jun 2016 13:55:33 -0700 (PDT) In-Reply-To: <201606032049.u53KnnuL093930@repo.freebsd.org> References: <201606032049.u53KnnuL093930@repo.freebsd.org> From: Ngie Cooper Date: Fri, 3 Jun 2016 13:55:33 -0700 Message-ID: Subject: Re: svn commit: r301287 - head To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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, 03 Jun 2016 20:55:35 -0000 On Fri, Jun 3, 2016 at 1:49 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri Jun 3 20:49:49 2016 > New Revision: 301287 > URL: https://svnweb.freebsd.org/changeset/base/301287 > > Log: > WITHOUT_CROSS_COMPILER: Fix installworld. > > Since no WORLDTMP/usr/bin/cc is created, cc cannot be found > during installworld time since /usr/bin is not in the PATH. > Pass along the known compiler metadata to allow installworld > to work. The same fix was used for WITH_SYSTEM_COMPILER. > > A better route would be to store a cookie in buildworld > containing this compiler metadata and then using that > at install time, rather than rerunning cc. > > Reported by: Mark Millard > Sponsored by: EMC / Isilon Storage Division Thank you. This should fix the Trebuca Canyon's I've been using. From owner-svn-src-head@freebsd.org Fri Jun 3 21:11:35 2016 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 9961EB68CB3; Fri, 3 Jun 2016 21:11:35 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 6B1F1169C; Fri, 3 Jun 2016 21:11:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53LBY0S004902; Fri, 3 Jun 2016 21:11:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53LBYHw004901; Fri, 3 Jun 2016 21:11:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606032111.u53LBYHw004901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Jun 2016 21:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301288 - head/sys/arm/nvidia/tegra124 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.22 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, 03 Jun 2016 21:11:35 -0000 Author: pfg Date: Fri Jun 3 21:11:34 2016 New Revision: 301288 URL: https://svnweb.freebsd.org/changeset/base/301288 Log: tegra124: use roundup/rounddown macros from . Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Fri Jun 3 20:49:49 2016 (r301287) +++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Fri Jun 3 21:11:34 2016 (r301288) @@ -214,8 +214,8 @@ TUNABLE_INT("hw.tegra124.cpufreq.lowest_ #define DIV_ROUND_CLOSEST(val, div) (((val) + ((div) / 2)) / (div)) -#define ROUND_UP(val, div) ((((val) + ((div) - 1)) / (div)) * (div)) -#define ROUND_DOWN(val, div) (((val) / (div)) * (div)) +#define ROUND_UP(val, div) roundup(val, div) +#define ROUND_DOWN(val, div) rounddown(val, div) /* * Compute requesetd voltage for given frequency and SoC process variations, From owner-svn-src-head@freebsd.org Fri Jun 3 21:23:13 2016 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 138FDB68FA0; Fri, 3 Jun 2016 21:23:13 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id DFA0F1D75; Fri, 3 Jun 2016 21:23:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53LNCMj008555; Fri, 3 Jun 2016 21:23:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53LNBLb008549; Fri, 3 Jun 2016 21:23:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606032123.u53LNBLb008549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Jun 2016 21:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301289 - head/contrib/one-true-awk 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.22 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, 03 Jun 2016 21:23:13 -0000 Author: pfg Date: Fri Jun 3 21:23:11 2016 New Revision: 301289 URL: https://svnweb.freebsd.org/changeset/base/301289 Log: MFV r300961: one-true-awk: replace 0 with NULL for pointers Also remove a redundant semicolon. Modified: head/contrib/one-true-awk/b.c head/contrib/one-true-awk/lex.c head/contrib/one-true-awk/maketab.c head/contrib/one-true-awk/parse.c head/contrib/one-true-awk/run.c head/contrib/one-true-awk/tran.c Directory Properties: head/contrib/one-true-awk/ (props changed) Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Fri Jun 3 21:11:34 2016 (r301288) +++ head/contrib/one-true-awk/b.c Fri Jun 3 21:23:11 2016 (r301289) @@ -85,11 +85,11 @@ fa *makedfa(const char *s, int anchor) / fa *pfa; static int now = 1; - if (setvec == 0) { /* first time through any RE */ + if (setvec == NULL) { /* first time through any RE */ maxsetvec = MAXLIN; setvec = (int *) malloc(maxsetvec * sizeof(int)); tmpset = (int *) malloc(maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space initializing makedfa"); } @@ -305,11 +305,11 @@ char *cclenter(const char *argp) /* add int j; uschar *p = (uschar *) argp; uschar *op, *bp; - static uschar *buf = 0; + static uschar *buf = NULL; static int bufsz = 100; op = p; - if (buf == 0 && (buf = (uschar *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (uschar *) malloc(bufsz)) == NULL) FATAL("out of space for character class [%.10s...] 1", p); bp = buf; for (i = 0; (c = *p++) != 0; ) { @@ -368,7 +368,7 @@ void cfoll(fa *f, Node *v) /* enter foll maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space in cfoll()"); } for (i = 0; i <= f->accept; i++) @@ -409,7 +409,7 @@ int first(Node *p) /* collects initially maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space in first()"); } if (type(p) == EMPTYRE) { @@ -788,7 +788,7 @@ int relex(void) /* lexical analyzer for { int c, n; int cflag; - static uschar *buf = 0; + static uschar *buf = NULL; static int bufsz = 100; uschar *bp; struct charclass *cc; @@ -813,7 +813,7 @@ int relex(void) /* lexical analyzer for rlxval = c; return CHAR; case '[': - if (buf == 0 && (buf = (uschar *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (uschar *) malloc(bufsz)) == NULL) FATAL("out of space in reg expr %.10s..", lastre); bp = buf; if (*prestr == '^') { @@ -878,7 +878,7 @@ int cgoto(fa *f, int s, int c) maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space in cgoto()"); } for (i = 0; i <= f->accept; i++) @@ -900,7 +900,7 @@ int cgoto(fa *f, int s, int c) maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("cgoto overflow"); } if (setvec[q[j]] == 0) { Modified: head/contrib/one-true-awk/lex.c ============================================================================== --- head/contrib/one-true-awk/lex.c Fri Jun 3 21:11:34 2016 (r301288) +++ head/contrib/one-true-awk/lex.c Fri Jun 3 21:23:11 2016 (r301289) @@ -170,10 +170,10 @@ int reg = 0; /* 1 => return a REGEXPR no int yylex(void) { int c; - static char *buf = 0; + static char *buf = NULL; static int bufsize = 5; /* BUG: setting this small causes core dump! */ - if (buf == 0 && (buf = (char *) malloc(bufsize)) == NULL) + if (buf == NULL && (buf = (char *) malloc(bufsize)) == NULL) FATAL( "out of space in yylex" ); if (sc) { sc = 0; @@ -358,10 +358,10 @@ int string(void) { int c, n; char *s, *bp; - static char *buf = 0; + static char *buf = NULL; static int bufsz = 500; - if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL) FATAL("out of space for strings"); for (bp = buf; (c = input()) != '"'; ) { if (!adjbuf(&buf, &bufsz, bp-buf+2, 500, &bp, "string")) @@ -504,11 +504,11 @@ void startreg(void) /* next call to yyle int regexpr(void) { int c; - static char *buf = 0; + static char *buf = NULL; static int bufsz = 500; char *bp; - if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL) FATAL("out of space for rex expr"); bp = buf; for ( ; (c = input()) != '/' && c != 0; ) { @@ -539,7 +539,7 @@ char ebuf[300]; char *ep = ebuf; char yysbuf[100]; /* pushback buffer */ char *yysptr = yysbuf; -FILE *yyin = 0; +FILE *yyin = NULL; int input(void) /* get next lexical input character */ { Modified: head/contrib/one-true-awk/maketab.c ============================================================================== --- head/contrib/one-true-awk/maketab.c Fri Jun 3 21:11:34 2016 (r301288) +++ head/contrib/one-true-awk/maketab.c Fri Jun 3 21:23:11 2016 (r301289) @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) table[p->token-FIRSTTOKEN] = p->name; printf("\nCell *(*proctab[%d])(Node **, int) = {\n", SIZE); for (i=0; innext, n++) + for (n = 0; p != NULL; p = p->nnext, n++) if (strcmp(((Cell *)(p->narg[0]))->nval, s) == 0) return n; return -1; Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Fri Jun 3 21:11:34 2016 (r301288) +++ head/contrib/one-true-awk/run.c Fri Jun 3 21:23:11 2016 (r301289) @@ -502,7 +502,7 @@ Cell *awkdelete(Node **a, int n) /* a[0] x = execute(a[0]); /* Cell* for symbol table */ if (!isarr(x)) return True; - if (a[1] == 0) { /* delete the elements, not the table */ + if (a[1] == NULL) { /* delete the elements, not the table */ freesymtab(x); x->tval &= ~STR; x->tval |= ARR; @@ -586,7 +586,7 @@ Cell *matchop(Node **a, int n) /* ~ and } x = execute(a[1]); /* a[1] = target text */ s = getsval(x); - if (a[0] == 0) /* a[1] == 0: already-compiled reg expr */ + if (a[0] == NULL) /* a[1] == 0: already-compiled reg expr */ i = (*mf)((fa *) a[2], s); else { y = execute(a[2]); /* a[2] = regular expr */ @@ -702,7 +702,7 @@ Cell *gettemp(void) /* get a tempcell */ FATAL("out of space for temporaries"); for(i = 1; i < 100; i++) tmps[i-1].cnext = &tmps[i]; - tmps[i-1].cnext = 0; + tmps[i-1].cnext = NULL; } x = tmps; tmps = x->cnext; @@ -737,18 +737,18 @@ Cell *substr(Node **a, int nnn) /* subs int k, m, n; char *s; int temp; - Cell *x, *y, *z = 0; + Cell *x, *y, *z = NULL; x = execute(a[0]); y = execute(a[1]); - if (a[2] != 0) + if (a[2] != NULL) z = execute(a[2]); s = getsval(x); k = strlen(s) + 1; if (k <= 1) { tempfree(x); tempfree(y); - if (a[2] != 0) { + if (a[2] != NULL) { tempfree(z); } x = gettemp(); @@ -761,7 +761,7 @@ Cell *substr(Node **a, int nnn) /* subs else if (m > k) m = k; tempfree(y); - if (a[2] != 0) { + if (a[2] != NULL) { n = (int) getfval(z); tempfree(z); } else @@ -1175,7 +1175,7 @@ Cell *pastat(Node **a, int n) /* a[0] { { Cell *x; - if (a[0] == 0) + if (a[0] == NULL) x = execute(a[1]); else { x = execute(a[0]); @@ -1212,16 +1212,16 @@ Cell *dopa2(Node **a, int n) /* a[0], a[ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { - Cell *x = 0, *y, *ap; + Cell *x = NULL, *y, *ap; char *s, *origs; int sep; - char *t, temp, num[50], *fs = 0; + char *t, temp, num[50], *fs = NULL; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); - if (a[2] == 0) /* fs string */ + if (a[2] == NULL) /* fs string */ fs = *FS; else if (arg3type == STRING) { /* split(str,arr,"string") */ x = execute(a[2]); @@ -1340,7 +1340,7 @@ Cell *split(Node **a, int nnn) /* split( tempfree(ap); tempfree(y); free(origs); - if (a[2] != 0 && arg3type == STRING) { + if (a[2] != NULL && arg3type == STRING) { tempfree(x); } x = gettemp(); @@ -1372,7 +1372,7 @@ Cell *ifstat(Node **a, int n) /* if (a[0 if (istrue(x)) { tempfree(x); x = execute(a[1]); - } else if (a[2] != 0) { + } else if (a[2] != NULL) { tempfree(x); x = execute(a[2]); } @@ -1424,7 +1424,7 @@ Cell *forstat(Node **a, int n) /* for (a x = execute(a[0]); tempfree(x); for (;;) { - if (a[1]!=0) { + if (a[1]!=NULL) { x = execute(a[1]); if (!istrue(x)) return(x); else tempfree(x); @@ -1506,7 +1506,7 @@ Cell *bltin(Node **a, int n) /* builtin case FCOS: u = cos(getfval(x)); break; case FATAN: - if (nextarg == 0) { + if (nextarg == NULL) { WARNING("atan2 requires two arguments; returning 1.0"); u = 1.0; } else { @@ -1569,7 +1569,7 @@ Cell *bltin(Node **a, int n) /* builtin tempfree(x); x = gettemp(); setfval(x, u); - if (nextarg != 0) { + if (nextarg != NULL) { WARNING("warning: function has too many arguments"); for ( ; nextarg; nextarg = nextarg->nnext) execute(nextarg); @@ -1583,7 +1583,7 @@ Cell *printstat(Node **a, int n) /* prin Cell *y; FILE *fp; - if (a[1] == 0) /* a[1] is redirection operator, a[2] is file */ + if (a[1] == NULL) /* a[1] is redirection operator, a[2] is file */ fp = stdout; else fp = redirect(ptoi(a[1]), a[2]); @@ -1596,7 +1596,7 @@ Cell *printstat(Node **a, int n) /* prin else fputs(*OFS, fp); } - if (a[1] != 0) + if (a[1] != NULL) fflush(fp); if (ferror(fp)) FATAL("write error on %s", filename(fp)); @@ -1655,7 +1655,7 @@ FILE *openfile(int a, const char *us) { const char *s = us; int i, m; - FILE *fp = 0; + FILE *fp = NULL; if (*s == '\0') FATAL("null file name in print or getline"); @@ -1670,7 +1670,7 @@ FILE *openfile(int a, const char *us) return NULL; for (i=0; i < nfiles; i++) - if (files[i].fp == 0) + if (files[i].fp == NULL) break; if (i >= nfiles) { struct files *nf; @@ -1787,7 +1787,7 @@ Cell *sub(Node **a, int nnn) /* substitu FATAL("out of memory in sub"); x = execute(a[3]); /* target string */ t = getsval(x); - if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */ + if (a[0] == NULL) /* 0 => a[1] is already-compiled regexpr */ pfa = (fa *) a[1]; /* regular expression */ else { y = execute(a[1]); @@ -1827,7 +1827,7 @@ Cell *sub(Node **a, int nnn) /* substitu if (pb > buf + bufsz) FATAL("sub result2 %.30s too big; can't happen", buf); setsval(x, buf); /* BUG: should be able to avoid copy */ - result = True;; + result = True; } tempfree(x); tempfree(y); @@ -1850,7 +1850,7 @@ Cell *gsub(Node **a, int nnn) /* global num = 0; x = execute(a[3]); /* target string */ t = getsval(x); - if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */ + if (a[0] == NULL) /* 0 => a[1] is already-compiled regexpr */ pfa = (fa *) a[1]; /* regular expression */ else { y = execute(a[1]); Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Fri Jun 3 21:11:34 2016 (r301288) +++ head/contrib/one-true-awk/tran.c Fri Jun 3 21:23:11 2016 (r301289) @@ -174,7 +174,7 @@ void freesymtab(Cell *ap) /* free a symb free(cp); tp->nelem--; } - tp->tab[i] = 0; + tp->tab[i] = NULL; } if (tp->nelem != 0) WARNING("can't happen: inconsistent element count freeing %s", ap->nval); From owner-svn-src-head@freebsd.org Fri Jun 3 21:35:20 2016 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 809E1B6927E; Fri, 3 Jun 2016 21:35:20 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 52D021739; Fri, 3 Jun 2016 21:35:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53LZJZX012516; Fri, 3 Jun 2016 21:35:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53LZJLI012515; Fri, 3 Jun 2016 21:35:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606032135.u53LZJLI012515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Jun 2016 21:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301290 - head/share/mk 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.22 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, 03 Jun 2016 21:35:20 -0000 Author: bdrewery Date: Fri Jun 3 21:35:19 2016 New Revision: 301290 URL: https://svnweb.freebsd.org/changeset/base/301290 Log: WITH_META_MODE: Avoid "building" .depend if there is nothing to do. This avoids 'Building /path/.depend' when it will not actually produce a file. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Jun 3 21:23:11 2016 (r301289) +++ head/share/mk/bsd.dep.mk Fri Jun 3 21:35:19 2016 (r301290) @@ -246,7 +246,9 @@ DPSRCS+= ${SRCS} # beforedepend/_EXTRADEPEND/afterdepend. The target is kept # to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} -.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE}) +.if exists(${.OBJDIR}/${DEPENDFILE}) || \ + ((commands(beforedepend) || commands(_EXTRADEPEND) || \ + commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta)) rm -f ${DEPENDFILE} .endif .if target(_EXTRADEPEND) From owner-svn-src-head@freebsd.org Fri Jun 3 21:37:26 2016 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 07388B69306; Fri, 3 Jun 2016 21:37:26 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id AEC1418F0; Fri, 3 Jun 2016 21:37:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53LbOeB012628; Fri, 3 Jun 2016 21:37:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53LbOUV012626; Fri, 3 Jun 2016 21:37:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606032137.u53LbOUV012626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Jun 2016 21:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301291 - in head/contrib/gcclibs: include libiberty 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.22 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, 03 Jun 2016 21:37:26 -0000 Author: pfg Date: Fri Jun 3 21:37:24 2016 New Revision: 301291 URL: https://svnweb.freebsd.org/changeset/base/301291 Log: libiberty: prevent integer overflow. Take care of very old bug leading to heap-buffer overflow by processing certain file headers via bfd binary. PR: 200888 Obtained from: OpenBSD MFC after: 2 weeks Modified: head/contrib/gcclibs/include/objalloc.h head/contrib/gcclibs/libiberty/objalloc.c Modified: head/contrib/gcclibs/include/objalloc.h ============================================================================== --- head/contrib/gcclibs/include/objalloc.h Fri Jun 3 21:35:19 2016 (r301290) +++ head/contrib/gcclibs/include/objalloc.h Fri Jun 3 21:37:24 2016 (r301291) @@ -1,5 +1,5 @@ /* objalloc.h -- routines to allocate memory for objects - Copyright 1997, 2001 Free Software Foundation, Inc. + Copyright 1997, 2001-2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Solutions. This program is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct obj if (__len == 0) \ __len = 1; \ __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \ - (__len <= __o->current_space \ + (__len != 0 && __len <= __o->current_space \ ? (__o->current_ptr += __len, \ __o->current_space -= __len, \ (void *) (__o->current_ptr - __len)) \ Modified: head/contrib/gcclibs/libiberty/objalloc.c ============================================================================== --- head/contrib/gcclibs/libiberty/objalloc.c Fri Jun 3 21:35:19 2016 (r301290) +++ head/contrib/gcclibs/libiberty/objalloc.c Fri Jun 3 21:37:24 2016 (r301291) @@ -1,5 +1,5 @@ /* objalloc.c -- routines to allocate memory for objects - Copyright 1997 Free Software Foundation, Inc. + Copyright 1997-2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Solutions. This program is free software; you can redistribute it and/or modify it @@ -112,8 +112,10 @@ objalloc_create (void) /* Allocate space from an objalloc structure. */ PTR -_objalloc_alloc (struct objalloc *o, unsigned long len) +_objalloc_alloc (struct objalloc *o, unsigned long original_len) { + unsigned long len = original_len; + /* We avoid confusion from zero sized objects by always allocating at least 1 byte. */ if (len == 0) @@ -121,6 +123,11 @@ _objalloc_alloc (struct objalloc *o, uns len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); + /* CVE-2012-3509: Check for overflow in the alignment operation above + * and then malloc argument below. */ + if (len + CHUNK_HEADER_SIZE < original_len) + return NULL; + if (len <= o->current_space) { o->current_ptr += len; From owner-svn-src-head@freebsd.org Sat Jun 4 00:08:39 2016 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 26AD8B69E17; Sat, 4 Jun 2016 00:08:39 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id DD68014CB; Sat, 4 Jun 2016 00:08:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5408clW068110; Sat, 4 Jun 2016 00:08:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5408c4P068109; Sat, 4 Jun 2016 00:08:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201606040008.u5408c4P068109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 4 Jun 2016 00:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301292 - head/sys/dev/ntb/ntb_hw 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.22 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: Sat, 04 Jun 2016 00:08:39 -0000 Author: mav Date: Sat Jun 4 00:08:37 2016 New Revision: 301292 URL: https://svnweb.freebsd.org/changeset/base/301292 Log: When negotiating MSIX parameters, give other head time to see our NTB_MSIX_RECEIVED status, before making upper layers overwrite it. This is not completely perfect, but now it works better then before. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 3 21:37:24 2016 (r301291) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Jun 4 00:08:37 2016 (r301292) @@ -2801,6 +2801,8 @@ ntb_exchange_msix(void *ctx) ntb = ctx; + if (ntb->peer_msix_good) + goto msix_good; if (ntb->peer_msix_done) goto msix_done; @@ -2832,16 +2834,21 @@ msix_done: goto reschedule; ntb->peer_msix_good = true; + /* Give peer time to see our NTB_MSIX_RECEIVED. */ + goto reschedule; +msix_good: ntb_poll_link(ntb); ntb_link_event(ntb); return; reschedule: ntb->lnk_sta = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); - if (_xeon_link_is_up(ntb)) - callout_reset(&ntb->peer_msix_work, hz / 100, ntb_exchange_msix, ntb); - else + if (_xeon_link_is_up(ntb)) { + callout_reset(&ntb->peer_msix_work, + hz * (ntb->peer_msix_good ? 2 : 1) / 100, + ntb_exchange_msix, ntb); + } else ntb_spad_clear(ntb); } From owner-svn-src-head@freebsd.org Sat Jun 4 00:19:00 2016 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 77042B650F6; Sat, 4 Jun 2016 00:19:00 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 2D3C11C32; Sat, 4 Jun 2016 00:19:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u540IxSd071691; Sat, 4 Jun 2016 00:18:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u540Ixs1071690; Sat, 4 Jun 2016 00:18:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201606040018.u540Ixs1071690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 4 Jun 2016 00:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301293 - head/sys/dev/ntb/ntb_hw 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.22 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: Sat, 04 Jun 2016 00:19:00 -0000 Author: mav Date: Sat Jun 4 00:18:59 2016 New Revision: 301293 URL: https://svnweb.freebsd.org/changeset/base/301293 Log: When negotiating NTB_SB01BASE_LOCKUP workaround, don't try to limit the BAR size to 1MB. According to Xeon v3 specifications and my tests, that size register is write-once and so not writeable after BIOS written it. Instead of that, make the code work with BAR of any sufficient size, properly calculating offset within its base. It also simplifies the code. Discussed with: cem MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Jun 4 00:08:37 2016 (r301292) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Jun 4 00:18:59 2016 (r301293) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #define NTB_MSIX_VER_GUARD 0xaabbccdd #define NTB_MSIX_RECEIVED 0xe0f0e0f0 -#define ONE_MB (1024u * 1024) /* * PCI constants could be somewhere more generic, but aren't defined/used in @@ -238,6 +237,7 @@ struct ntb_softc { /* Memory window used to access peer bar0 */ #define B2B_MW_DISABLED UINT8_MAX uint8_t b2b_mw_idx; + uint32_t msix_xlat; uint8_t msix_mw_idx; uint8_t mw_count; @@ -1361,12 +1361,12 @@ ntb_get_msix_info(struct ntb_softc *ntb) laddr = bus_read_4(msix->msix_table_res, offset + PCI_MSIX_ENTRY_LOWER_ADDR); - ntb_printf(2, "local lower MSIX addr(%u): 0x%x\n", i, laddr); + ntb_printf(2, "local MSIX addr(%u): 0x%x\n", i, laddr); KASSERT((laddr & MSI_INTEL_ADDR_BASE) == MSI_INTEL_ADDR_BASE, ("local MSIX addr 0x%x not in MSI base 0x%x", laddr, MSI_INTEL_ADDR_BASE)); - ntb->msix_data[i].nmd_ofs = laddr & ~MSI_INTEL_ADDR_BASE; + ntb->msix_data[i].nmd_ofs = laddr; data = bus_read_4(msix->msix_table_res, offset + PCI_MSIX_ENTRY_DATA); @@ -1659,15 +1659,6 @@ xeon_reset_sbar_size(struct ntb_softc *n bar_sz--; else bar_sz = 0; - } else if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && - ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) { - /* Restrict LAPIC BAR to 1MB */ - pci_write_config(ntb->device, bar->psz_off, 20, 1); - pci_write_config(ntb->device, bar->ssz_off, 20, 1); - bar_sz = pci_read_config(ntb->device, bar->psz_off, 1); - bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); - (void)bar_sz; - return; } pci_write_config(ntb->device, bar->ssz_off, bar_sz, 1); bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); @@ -1678,24 +1669,19 @@ static void xeon_set_sbar_base_and_limit(struct ntb_softc *ntb, uint64_t bar_addr, enum ntb_bar idx, enum ntb_bar regbar) { - uint64_t reg_val, lmt_addr; + uint64_t reg_val; uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); if (idx == regbar) bar_addr += ntb->b2b_off; - lmt_addr = bar_addr; - - if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && - ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) - lmt_addr += ONE_MB; /* * Set limit registers first to avoid an errata where setting the base * registers locks the limit registers. */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, lmt_reg, lmt_addr); + ntb_reg_write(4, lmt_reg, bar_addr); reg_val = ntb_reg_read(4, lmt_reg); (void)reg_val; @@ -1703,7 +1689,7 @@ xeon_set_sbar_base_and_limit(struct ntb_ reg_val = ntb_reg_read(4, base_reg); (void)reg_val; } else { - ntb_reg_write(8, lmt_reg, lmt_addr); + ntb_reg_write(8, lmt_reg, bar_addr); reg_val = ntb_reg_read(8, lmt_reg); (void)reg_val; @@ -1732,31 +1718,13 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb static int xeon_setup_msix_bar(struct ntb_softc *ntb) { - struct ntb_pci_bar_info *lapic_bar; enum ntb_bar bar_num; - int rc; if (!HAS_FEATURE(NTB_SB01BASE_LOCKUP)) return (0); bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); - lapic_bar = &ntb->bar_info[bar_num]; - - /* Restrict LAPIC BAR to 1MB */ - if (lapic_bar->size > ONE_MB) { - rc = bus_adjust_resource(ntb->device, SYS_RES_MEMORY, - lapic_bar->pci_resource, lapic_bar->pbase, - lapic_bar->pbase + ONE_MB - 1); - if (rc == 0) - lapic_bar->size = ONE_MB; - else { - ntb_printf(0, "Failed to shrink LAPIC BAR resource to " - "1 MB: %d\n", rc); - /* Ignore error */ - } - } - - ntb->peer_lapic_bar = lapic_bar; + ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; return (0); } @@ -1867,10 +1835,13 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, * We point the chosen MSIX MW BAR xlat to remote LAPIC for * workaround */ - if (size == 4) + if (size == 4) { ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); - else + ntb->msix_xlat = ntb_reg_read(4, xlatoffset); + } else { ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); + ntb->msix_xlat = ntb_reg_read(8, xlatoffset); + } } (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); @@ -2810,7 +2781,7 @@ ntb_exchange_msix(void *ctx) ntb_peer_spad_write(ntb, NTB_MSIX_DATA0 + i, ntb->msix_data[i].nmd_data); ntb_peer_spad_write(ntb, NTB_MSIX_OFS0 + i, - ntb->msix_data[i].nmd_ofs); + ntb->msix_data[i].nmd_ofs - ntb->msix_xlat); } ntb_peer_spad_write(ntb, NTB_MSIX_GUARD, NTB_MSIX_VER_GUARD); @@ -2820,8 +2791,10 @@ ntb_exchange_msix(void *ctx) for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { ntb_spad_read(ntb, NTB_MSIX_DATA0 + i, &val); + ntb_printf(2, "remote MSIX data(%u): 0x%x\n", i, val); ntb->peer_msix_data[i].nmd_data = val; ntb_spad_read(ntb, NTB_MSIX_OFS0 + i, &val); + ntb_printf(2, "remote MSIX addr(%u): 0x%x\n", i, val); ntb->peer_msix_data[i].nmd_ofs = val; } From owner-svn-src-head@freebsd.org Sat Jun 4 01:01:47 2016 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 6FBB9B65A8B; Sat, 4 Jun 2016 01:01:47 +0000 (UTC) (envelope-from cy@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 mx1.freebsd.org (Postfix) with ESMTPS id 3D7361FC8; Sat, 4 Jun 2016 01:01:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5411kws087679; Sat, 4 Jun 2016 01:01:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5411khU087678; Sat, 4 Jun 2016 01:01:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606040101.u5411khU087678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 4 Jun 2016 01:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301295 - head/etc/defaults 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.22 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: Sat, 04 Jun 2016 01:01:47 -0000 Author: cy Date: Sat Jun 4 01:01:46 2016 New Revision: 301295 URL: https://svnweb.freebsd.org/changeset/base/301295 Log: Enable daily_ntpd_leapfile_enable by default. Otherwise an expired leapfile will be ignored and ntpd will behave as if it has no leapfile. While here, remove an extraneous blank line. Suggested by: ache MFC after: 1 week Modified: head/etc/defaults/periodic.conf Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Sat Jun 4 00:32:26 2016 (r301294) +++ head/etc/defaults/periodic.conf Sat Jun 4 01:01:46 2016 (r301295) @@ -135,9 +135,8 @@ daily_status_mail_rejects_logs=3 # How daily_status_mail_rejects_shorten="NO" # Shorten output # 480.leapfile-ntpd -daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting - # leapfile sources # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status From owner-svn-src-head@freebsd.org Sat Jun 4 03:52:21 2016 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 2B5AFB699D1; Sat, 4 Jun 2016 03:52:21 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id F0C8911AD; Sat, 4 Jun 2016 03:52:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u543qK0J051505; Sat, 4 Jun 2016 03:52:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u543qKjx051503; Sat, 4 Jun 2016 03:52:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606040352.u543qKjx051503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 4 Jun 2016 03:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301296 - head/sys/dev/ioat 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.22 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: Sat, 04 Jun 2016 03:52:21 -0000 Author: cem Date: Sat Jun 4 03:52:19 2016 New Revision: 301296 URL: https://svnweb.freebsd.org/changeset/base/301296 Log: ioat(4): Make channel indices unsigned Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Jun 4 01:01:46 2016 (r301295) +++ head/sys/dev/ioat/ioat.c Sat Jun 4 03:52:19 2016 (r301296) @@ -152,8 +152,8 @@ MODULE_VERSION(ioat, 1); * Private data structures */ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNELS]; -static int ioat_channel_index = 0; -SYSCTL_INT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, +static unsigned ioat_channel_index = 0; +SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, "Number of IOAT channels attached"); static struct _pcsid Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Sat Jun 4 01:01:46 2016 (r301295) +++ head/sys/dev/ioat/ioat_internal.h Sat Jun 4 03:52:19 2016 (r301296) @@ -455,7 +455,7 @@ struct ioat_softc { }) int version; - int chan_idx; + unsigned chan_idx; struct mtx submit_lock; device_t device; From owner-svn-src-head@freebsd.org Sat Jun 4 03:54:32 2016 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 35F1EB69B0B; Sat, 4 Jun 2016 03:54:32 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id 07CBF142A; Sat, 4 Jun 2016 03:54:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u543sVxi051613; Sat, 4 Jun 2016 03:54:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u543sVeP051611; Sat, 4 Jun 2016 03:54:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606040354.u543sVeP051611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 4 Jun 2016 03:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301297 - head/sys/dev/ioat 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.22 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: Sat, 04 Jun 2016 03:54:32 -0000 Author: cem Date: Sat Jun 4 03:54:30 2016 New Revision: 301297 URL: https://svnweb.freebsd.org/changeset/base/301297 Log: ioat(4): Export the number of available channels Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Jun 4 03:52:19 2016 (r301296) +++ head/sys/dev/ioat/ioat.c Sat Jun 4 03:54:30 2016 (r301297) @@ -742,6 +742,13 @@ ioat_reset_hw_task(void *ctx, int pendin /* * User API functions */ +unsigned +ioat_get_nchannels(void) +{ + + return (ioat_channel_index); +} + bus_dmaengine_t ioat_get_dmaengine(uint32_t index, int flags) { Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Sat Jun 4 03:52:19 2016 (r301296) +++ head/sys/dev/ioat/ioat.h Sat Jun 4 03:54:30 2016 (r301297) @@ -85,6 +85,8 @@ typedef void *bus_dmaengine_t; struct bus_dmadesc; typedef void (*bus_dmaengine_callback_t)(void *arg, int error); +unsigned ioat_get_nchannels(void); + /* * Called first to acquire a reference to the DMA channel * From owner-svn-src-head@freebsd.org Sat Jun 4 04:14:07 2016 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 7E5DCB6802B; Sat, 4 Jun 2016 04:14:07 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id 47EBD10E0; Sat, 4 Jun 2016 04:14:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u544E6Ji059083; Sat, 4 Jun 2016 04:14:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u544E6ZU059082; Sat, 4 Jun 2016 04:14:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606040414.u544E6ZU059082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 4 Jun 2016 04:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301300 - head/sys/dev/ioat 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.22 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: Sat, 04 Jun 2016 04:14:07 -0000 Author: cem Date: Sat Jun 4 04:14:06 2016 New Revision: 301300 URL: https://svnweb.freebsd.org/changeset/base/301300 Log: ioat(4): Always log capabilities on attach Different, relatively recent Intel Xeon hardware support radically different features. E.g., BDX support CRC32 while BDX-DE does not. Reviewed by: rpokala (spiritually) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Jun 4 04:02:03 2016 (r301299) +++ head/sys/dev/ioat/ioat.c Sat Jun 4 04:14:06 2016 (r301300) @@ -407,7 +407,7 @@ ioat3_attach(device_t device) ioat = DEVICE2SOFTC(device); ioat->capabilities = ioat_read_dmacapability(ioat); - ioat_log_message(1, "Capabilities: %b\n", (int)ioat->capabilities, + ioat_log_message(0, "Capabilities: %b\n", (int)ioat->capabilities, IOAT_DMACAP_STR); xfercap = ioat_read_xfercap(ioat); From owner-svn-src-head@freebsd.org Sat Jun 4 07:18:41 2016 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 1211FB68F8A; Sat, 4 Jun 2016 07:18:41 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id D73651BBB; Sat, 4 Jun 2016 07:18:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u547IdX3027551; Sat, 4 Jun 2016 07:18:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u547IdpJ027550; Sat, 4 Jun 2016 07:18:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606040718.u547IdpJ027550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jun 2016 07:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301302 - head/sys/dev/usb/wlan 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.22 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: Sat, 04 Jun 2016 07:18:41 -0000 Author: adrian Date: Sat Jun 4 07:18:39 2016 New Revision: 301302 URL: https://svnweb.freebsd.org/changeset/base/301302 Log: [run] fix TSF locking in RX radiotap. Submitted by: Imre Vadasz Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Jun 4 05:46:52 2016 (r301301) +++ head/sys/dev/usb/wlan/if_run.c Sat Jun 4 07:18:39 2016 (r301302) @@ -2829,7 +2829,9 @@ run_rx_frame(struct run_softc *sc, struc tap->wr_antenna = ant; tap->wr_dbm_antsignal = run_rssi2dbm(sc, rssi, ant); tap->wr_rate = 2; /* in case it can't be found below */ + RUN_LOCK(sc); run_get_tsf(sc, &tap->wr_tsf); + RUN_UNLOCK(sc); phy = le16toh(rxwi->phy); switch (phy & RT2860_PHY_MODE) { case RT2860_PHY_CCK: From owner-svn-src-head@freebsd.org Sat Jun 4 07:28:10 2016 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 EE392B692CF; Sat, 4 Jun 2016 07:28:10 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id C050410FC; Sat, 4 Jun 2016 07:28:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u547S96P031191; Sat, 4 Jun 2016 07:28:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u547S9Q0031190; Sat, 4 Jun 2016 07:28:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606040728.u547S9Q0031190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jun 2016 07:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301303 - head/sys/dev/ath/ath_hal 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.22 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: Sat, 04 Jun 2016 07:28:11 -0000 Author: adrian Date: Sat Jun 4 07:28:09 2016 New Revision: 301303 URL: https://svnweb.freebsd.org/changeset/base/301303 Log: [ath_hal] add BTCOEX_STOMP_AUDIO; delete unused methods. Modified: head/sys/dev/ath/ath_hal/ah_btcoex.h Modified: head/sys/dev/ath/ath_hal/ah_btcoex.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_btcoex.h Sat Jun 4 07:18:39 2016 (r301302) +++ head/sys/dev/ath/ath_hal/ah_btcoex.h Sat Jun 4 07:28:09 2016 (r301303) @@ -37,9 +37,7 @@ typedef struct { u_int8_t bt_gpio_wlan_active; u_int8_t bt_active_polarity; HAL_BOOL bt_single_ant; - u_int8_t bt_dutyCycle; u_int8_t bt_isolation; - u_int8_t bt_period; } HAL_BT_COEX_INFO; typedef enum { @@ -101,6 +99,7 @@ typedef enum { HAL_BT_COEX_STOMP_NONE, HAL_BT_COEX_STOMP_ALL_FORCE, HAL_BT_COEX_STOMP_LOW_FORCE, + HAL_BT_COEX_STOMP_AUDIO, } HAL_BT_COEX_STOMP_TYPE; typedef struct { From owner-svn-src-head@freebsd.org Sat Jun 4 07:28:37 2016 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 96AC8B69323; Sat, 4 Jun 2016 07:28:37 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 680321272; Sat, 4 Jun 2016 07:28:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u547Sa8I031262; Sat, 4 Jun 2016 07:28:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u547Sabi031261; Sat, 4 Jun 2016 07:28:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606040728.u547Sabi031261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jun 2016 07:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301304 - head/sys/dev/ath/ath_hal/ar5416 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.22 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: Sat, 04 Jun 2016 07:28:37 -0000 Author: adrian Date: Sat Jun 4 07:28:36 2016 New Revision: 301304 URL: https://svnweb.freebsd.org/changeset/base/301304 Log: [ath_hal] add placeholders for AUDIO stomp for Kite/Kiwi. It just stomps all; which is enough for some testing. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Sat Jun 4 07:28:09 2016 (r301303) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Sat Jun 4 07:28:36 2016 (r301304) @@ -97,6 +97,8 @@ ar5416BTCoexSetWeights(struct ath_hal *a if (AR_SREV_KIWI_10_OR_LATER(ah)) { /* TODO: TX RX separate is not enabled. */ switch (stompType) { + case HAL_BT_COEX_STOMP_AUDIO: + /* XXX TODO */ case HAL_BT_COEX_STOMP_ALL: ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; ahp->ah_btCoexWLANWeight = AR5416_STOMP_ALL_WLAN_WGHT; @@ -128,6 +130,8 @@ ar5416BTCoexSetWeights(struct ath_hal *a } } else { switch (stompType) { + case HAL_BT_COEX_STOMP_AUDIO: + /* XXX TODO */ case HAL_BT_COEX_STOMP_ALL: ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; ahp->ah_btCoexWLANWeight = AR5416_STOMP_ALL_WLAN_WGHT; From owner-svn-src-head@freebsd.org Sat Jun 4 07:29:11 2016 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 B450BB69378; Sat, 4 Jun 2016 07:29:11 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 81F641458; Sat, 4 Jun 2016 07:29:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u547TAIq031336; Sat, 4 Jun 2016 07:29:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u547TAZD031335; Sat, 4 Jun 2016 07:29:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606040729.u547TAZD031335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jun 2016 07:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301305 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 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: Sat, 04 Jun 2016 07:29:11 -0000 Author: adrian Date: Sat Jun 4 07:29:10 2016 New Revision: 301305 URL: https://svnweb.freebsd.org/changeset/base/301305 Log: [ath_hal] add STOMP_AUDIO for AR9462/QCA9565. Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Sat Jun 4 07:28:36 2016 (r301304) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Sat Jun 4 07:29:10 2016 (r301305) @@ -1890,6 +1890,12 @@ void ar9300_mci_bt_coex_set_weights(stru ar9300_gpio_set(ah, 5, 0); } break; + case HAL_BT_COEX_STOMP_AUDIO: + ahp->ah_bt_coex_wlan_weight[0] = 0xffffff01; + ahp->ah_bt_coex_wlan_weight[1] = 0xffffffff; + ahp->ah_bt_coex_wlan_weight[2] = 0xffffff01; + ahp->ah_bt_coex_wlan_weight[3] = 0xffffffff; + break; default: /* There is a forceWeight from registry */ ahp->ah_bt_coex_wlan_weight[0] = stomp_type; From owner-svn-src-head@freebsd.org Sat Jun 4 08:47:47 2016 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 8C4DDB6876E; Sat, 4 Jun 2016 08:47:47 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 4FA9C13A5; Sat, 4 Jun 2016 08:47:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u548lk7X060870; Sat, 4 Jun 2016 08:47:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u548ljBB060861; Sat, 4 Jun 2016 08:47:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606040847.u548ljBB060861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 4 Jun 2016 08:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301306 - in head/sys/boot/efi: include libefi loader loader/arch/amd64 loader/arch/arm loader/arch/arm64 loader/arch/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.22 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: Sat, 04 Jun 2016 08:47:47 -0000 Author: andrew Date: Sat Jun 4 08:47:45 2016 New Revision: 301306 URL: https://svnweb.freebsd.org/changeset/base/301306 Log: Use the UEFI event timer to update the time on arm and arm64. The current code uses the GetTime function from the Runtime Service, however this has been shown to not return a useable time on many arm64 UEFI implementations. Reviewed by: jhb, smh Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6709 Added: head/sys/boot/efi/libefi/time_event.c (contents, props changed) Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/libefi/time.c head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c head/sys/boot/efi/loader/arch/arm/exec.c head/sys/boot/efi/loader/arch/arm64/exec.c head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/include/efilib.h Sat Jun 4 08:47:45 2016 (r301306) @@ -55,6 +55,9 @@ void efi_free_devpath_name(CHAR16 *); int efi_status_to_errno(EFI_STATUS); +void efi_time_init(void); +void efi_time_fini(void); + EFI_STATUS main(int argc, CHAR16 *argv[]); void exit(EFI_STATUS status); void delay(int usecs); Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/libefi/Makefile Sat Jun 4 08:47:45 2016 (r301306) @@ -5,7 +5,13 @@ INTERNALLIB= WARNS?= 2 SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ - handles.c libefi.c time.c + handles.c libefi.c + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SRCS+= time.c +.elif ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +SRCS+= time_event.c +.endif # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only Modified: head/sys/boot/efi/libefi/time.c ============================================================================== --- head/sys/boot/efi/libefi/time.c Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/libefi/time.c Sat Jun 4 08:47:45 2016 (r301306) @@ -58,6 +58,16 @@ __FBSDID("$FreeBSD$"); #define SECSPERHOUR ( 60*60 ) #define SECSPERDAY (24 * SECSPERHOUR) +void +efi_time_init(void) +{ +} + +void +efi_time_fini(void) +{ +} + static time_t efi_time(EFI_TIME *ETime) { Added: head/sys/boot/efi/libefi/time_event.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/time_event.c Sat Jun 4 08:47:45 2016 (r301306) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2016 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +static EFI_EVENT time_event; +static uint64_t curtime; + +static void +time_update(EFI_EVENT event, void *context) +{ + + curtime += 10; +} + +void +efi_time_init(void) +{ + + /* Create a timer event */ + BS->CreateEvent(EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, + time_update, 0, &time_event); + /* Use a 10ms timer */ + BS->SetTimer(time_event, TimerPeriodic, 100000); +} + +void +efi_time_fini(void) +{ + + /* Cancel the timer */ + BS->SetTimer(time_event, TimerCancel, 0); + BS->CloseEvent(time_event); +} + +time_t +time(time_t *tloc) +{ + time_t t; + + t = curtime / 1000; + if (tloc != NULL) + *tloc = t; + + return (t); +} + +time_t +getsecs() +{ + return time(0); +} Modified: head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Sat Jun 4 08:47:45 2016 (r301306) @@ -186,9 +186,12 @@ elf64_exec(struct preloaded_file *fp) printf("Start @ 0x%lx ...\n", ehdr->e_entry); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernend); - if (err != 0) + if (err != 0) { + efi_time_init(); return(err); + } dev_cleanup(); Modified: head/sys/boot/efi/loader/arch/arm/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm/exec.c Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/loader/arch/arm/exec.c Sat Jun 4 08:47:45 2016 (r301306) @@ -73,8 +73,11 @@ __elfN(arm_exec)(struct preloaded_file * e = (Elf_Ehdr *)&fmp->md_data; - if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) + efi_time_fini(); + if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) { + efi_time_init(); return (error); + } entry = efi_translate(e->e_entry); printf("Kernel entry at 0x%x...\n", (unsigned)entry); Modified: head/sys/boot/efi/loader/arch/arm64/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/exec.c Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/loader/arch/arm64/exec.c Sat Jun 4 08:47:45 2016 (r301306) @@ -113,9 +113,12 @@ elf64_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); entry = efi_translate(ehdr->e_entry); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernendp); - if (err != 0) + if (err != 0) { + efi_time_init(); return (err); + } dev_cleanup(); Modified: head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c ============================================================================== --- head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c Sat Jun 4 08:47:45 2016 (r301306) @@ -71,9 +71,12 @@ elf32_exec(struct preloaded_file *fp) return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); + efi_time_fini(); err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); - if (err != 0) + if (err != 0) { + efi_time_init(); return(err); + } entry = ehdr->e_entry & 0xffffff; printf("Start @ 0x%lx ...\n", entry); Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Sat Jun 4 07:29:10 2016 (r301305) +++ head/sys/boot/efi/loader/main.c Sat Jun 4 08:47:45 2016 (r301306) @@ -246,6 +246,9 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; #endif + /* Init the time source */ + efi_time_init(); + has_kbd = has_keyboard(); /* From owner-svn-src-head@freebsd.org Sat Jun 4 08:56:31 2016 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 A299DB68ABA; Sat, 4 Jun 2016 08:56:31 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 7391F1AB7; Sat, 4 Jun 2016 08:56:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u548uUBV064408; Sat, 4 Jun 2016 08:56:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u548uUkB064407; Sat, 4 Jun 2016 08:56:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606040856.u548uUkB064407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Jun 2016 08:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301307 - head/sys/dev/ath 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.22 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: Sat, 04 Jun 2016 08:56:31 -0000 Author: adrian Date: Sat Jun 4 08:56:30 2016 New Revision: 301307 URL: https://svnweb.freebsd.org/changeset/base/301307 Log: [ath] remove now unused parameters. These will move to being part of the driver btcoex stuff I'm working on, since the HAL doesn't know what to do with them. Modified: head/sys/dev/ath/if_ath_btcoex.c Modified: head/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.c Sat Jun 4 08:47:45 2016 (r301306) +++ head/sys/dev/ath/if_ath_btcoex.c Sat Jun 4 08:56:30 2016 (r301307) @@ -232,10 +232,6 @@ ath_btcoex_cfg_mci(struct ath_softc *sc, btinfo.bt_single_ant = 0; /* 2 antenna on WB335 */ btinfo.bt_isolation = 0; /* in dB, not used */ - /* Implement a default dutycycle/period */ - btinfo.bt_dutyCycle = 55; - btinfo.bt_period = 40; - ath_hal_btcoex_set_info(ah, &btinfo); btconfig.bt_time_extend = 0; From owner-svn-src-head@freebsd.org Sat Jun 4 09:17:46 2016 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 93E4EB65277; Sat, 4 Jun 2016 09:17:46 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id 6F4B6193A; Sat, 4 Jun 2016 09:17:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u549HjPj072005; Sat, 4 Jun 2016 09:17:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u549Hjbc072002; Sat, 4 Jun 2016 09:17:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606040917.u549Hjbc072002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 4 Jun 2016 09:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301308 - head/sys/dev/sfxge/common 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.22 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: Sat, 04 Jun 2016 09:17:46 -0000 Author: arybchik Date: Sat Jun 4 09:17:45 2016 New Revision: 301308 URL: https://svnweb.freebsd.org/changeset/base/301308 Log: sfxge(4): add helper to compute timer quantum This also adjusts the timer values used to match the Linux net driver implementation: a) non-zero time intervals should result in at least one quantum b) timer load/reload values are only zero biased for Falcon/Siena Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6704 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Jun 4 08:56:30 2016 (r301307) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Jun 4 09:17:45 2016 (r301308) @@ -141,7 +141,6 @@ efx_mcdi_init_evq( __in uint32_t irq, __in uint32_t us) { - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[ MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), @@ -189,25 +188,22 @@ efx_mcdi_init_evq( INIT_EVQ_IN_FLAG_RX_MERGE, 1, INIT_EVQ_IN_FLAG_TX_MERGE, 1); + /* If the value is zero then disable the timer */ if (us == 0) { MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS); MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0); MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0); } else { - uint32_t timer_val; + unsigned int ticks; - /* Calculate the timer value in quanta */ - timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; - - /* Moderation value is base 0 so we need to deduct 1 */ - if (timer_val > 0) - timer_val--; + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail2; MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, timer_val); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, timer_val); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, ticks); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, ticks); } MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_MODE, @@ -230,18 +226,20 @@ efx_mcdi_init_evq( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) { rc = EMSGSIZE; - goto fail3; + goto fail4; } /* NOTE: ignore the returned IRQ param as firmware does not set it. */ return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -483,7 +481,7 @@ ef10_ev_qmoderate( efx_nic_t *enp = eep->ee_enp; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_dword_t dword; - uint32_t timer_ns, timer_val, mode; + uint32_t mode; efx_rc_t rc; /* Check that hardware and MCDI use the same timer MODE values */ @@ -503,37 +501,35 @@ ef10_ev_qmoderate( /* If the value is zero then disable the timer */ if (us == 0) { - timer_ns = 0; mode = FFE_CZ_TIMER_MODE_DIS; } else { - timer_ns = us * 1000u; mode = FFE_CZ_TIMER_MODE_INT_HLDOFF; } if (encp->enc_bug61265_workaround) { - rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, timer_ns); + uint32_t ns = us * 1000; + + rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, ns); if (rc != 0) goto fail2; } else { - /* Calculate the timer value in quanta */ - timer_val = timer_ns / encp->enc_evq_timer_quantum_ns; + unsigned int ticks; - /* Moderation value is base 0 so we need to deduct 1 */ - if (timer_val > 0) - timer_val--; + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail3; if (encp->enc_bug35388_workaround) { EFX_POPULATE_DWORD_3(dword, ERF_DD_EVQ_IND_TIMER_FLAGS, EFE_DD_EVQ_IND_TIMER_FLAGS, ERF_DD_EVQ_IND_TIMER_MODE, mode, - ERF_DD_EVQ_IND_TIMER_VAL, timer_val); + ERF_DD_EVQ_IND_TIMER_VAL, ticks); EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, &dword, 0); } else { EFX_POPULATE_DWORD_2(dword, ERF_DZ_TC_TIMER_MODE, mode, - ERF_DZ_TC_TIMER_VAL, timer_val); + ERF_DZ_TC_TIMER_VAL, ticks); EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, eep->ee_index, &dword, 0); } @@ -541,6 +537,8 @@ ef10_ev_qmoderate( return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Jun 4 08:56:30 2016 (r301307) +++ head/sys/dev/sfxge/common/efx.h Sat Jun 4 09:17:45 2016 (r301308) @@ -1773,6 +1773,12 @@ efx_ev_qpoll( __in_opt void *arg); extern __checkReturn efx_rc_t +efx_ev_usecs_to_ticks( + __in efx_nic_t *enp, + __in unsigned int usecs, + __out unsigned int *ticksp); + +extern __checkReturn efx_rc_t efx_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us); Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Jun 4 08:56:30 2016 (r301307) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Jun 4 09:17:45 2016 (r301308) @@ -406,6 +406,27 @@ efx_ev_qpost( } __checkReturn efx_rc_t +efx_ev_usecs_to_ticks( + __in efx_nic_t *enp, + __in unsigned int us, + __out unsigned int *ticksp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + unsigned int ticks; + + /* Convert microseconds to a timer tick count */ + if (us == 0) + ticks = 0; + else if (us * 1000 < encp->enc_evq_timer_quantum_ns) + ticks = 1; /* Never round down to zero */ + else + ticks = us * 1000 / encp->enc_evq_timer_quantum_ns; + + *ticksp = ticks; + return (0); +} + + __checkReturn efx_rc_t efx_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us) @@ -1224,18 +1245,15 @@ siena_ev_qmoderate( FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_DIS, FRF_CZ_TC_TIMER_VAL, 0); } else { - uint32_t timer_val; + unsigned int ticks; - /* Calculate the timer value in quanta */ - timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; - - /* Moderation value is base 0 so we need to deduct 1 */ - if (timer_val > 0) - timer_val--; + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail2; + EFSYS_ASSERT(ticks > 0); EFX_POPULATE_DWORD_2(dword, FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF, - FRF_CZ_TC_TIMER_VAL, timer_val); + FRF_CZ_TC_TIMER_VAL, ticks - 1); } locked = (eep->ee_index == 0) ? 1 : 0; @@ -1245,6 +1263,8 @@ siena_ev_qmoderate( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Sat Jun 4 09:20:48 2016 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 1BA8CB65367; Sat, 4 Jun 2016 09:20:48 +0000 (UTC) (envelope-from arybchik@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 mx1.freebsd.org (Postfix) with ESMTPS id C30DF1B1B; Sat, 4 Jun 2016 09:20:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u549KkTD072168; Sat, 4 Jun 2016 09:20:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u549KkAJ072166; Sat, 4 Jun 2016 09:20:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606040920.u549KkAJ072166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 4 Jun 2016 09:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301309 - in head/sys/dev/sfxge: . common 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.22 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: Sat, 04 Jun 2016 09:20:48 -0000 Author: arybchik Date: Sat Jun 4 09:20:46 2016 New Revision: 301309 URL: https://svnweb.freebsd.org/changeset/base/301309 Log: sfxge(4): always be ready to receive batched events When the low-latency firmware variant is running, it is reported as not being capable of batching RX events, but it can still do so if the FORCE_EV_MERGING flag is set on an RXQ. Therefore we need to handle batched RX events even if the capability isn't set. If this bug is fixed in the firmware such that the capability is set even when running the low-latency firmware variant, it will almost always be reported so I don't think we lose much by removing the check. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6705 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Sat Jun 4 09:17:45 2016 (r301308) +++ head/sys/dev/sfxge/common/ef10_nic.c Sat Jun 4 09:20:46 2016 (r301309) @@ -1003,8 +1003,11 @@ ef10_get_datapath_caps( encp->enc_rx_batching_enabled = CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE; - if (encp->enc_rx_batching_enabled) - encp->enc_rx_batch_max = 16; + /* + * Even if batching isn't reported as supported, we may still get + * batched events. + */ + encp->enc_rx_batch_max = 16; /* Check if the firmware supports disabling scatter on RXQs */ encp->enc_rx_disable_scatter_supported = Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Sat Jun 4 09:17:45 2016 (r301308) +++ head/sys/dev/sfxge/sfxge_ev.c Sat Jun 4 09:20:46 2016 (r301309) @@ -128,8 +128,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u rxq->pending += delta; if (delta != 1) { - if ((!efx_nic_cfg_get(sc->enp)->enc_rx_batching_enabled) || - (delta <= 0) || + if ((delta <= 0) || (delta > efx_nic_cfg_get(sc->enp)->enc_rx_batch_max)) { evq->exception = B_TRUE; From owner-svn-src-head@freebsd.org Sat Jun 4 14:57:27 2016 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 C33E3B6925B; Sat, 4 Jun 2016 14:57:27 +0000 (UTC) (envelope-from bapt@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 mx1.freebsd.org (Postfix) with ESMTPS id 6119A1E77; Sat, 4 Jun 2016 14:57:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54EvQJX000839; Sat, 4 Jun 2016 14:57:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54EvPsu000829; Sat, 4 Jun 2016 14:57:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606041457.u54EvPsu000829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 4 Jun 2016 14:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301339 - in head: contrib/libucl/src contrib/libucl/uthash lib/libucl 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.22 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: Sat, 04 Jun 2016 14:57:27 -0000 Author: bapt Date: Sat Jun 4 14:57:25 2016 New Revision: 301339 URL: https://svnweb.freebsd.org/changeset/base/301339 Log: Import libucl snapshot 20160604 It replaces xxhash with mumhash It fixes issues with msgpack on non x86 Added: head/contrib/libucl/src/mum.h - copied unchanged from r301336, vendor/libucl/dist/src/mum.h Deleted: head/contrib/libucl/src/xxhash.c head/contrib/libucl/src/xxhash.h Modified: head/contrib/libucl/src/Makefile.am head/contrib/libucl/src/ucl_hash.c head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_msgpack.c head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/uthash/uthash.h head/lib/libucl/Makefile Directory Properties: head/contrib/libucl/ (props changed) Modified: head/contrib/libucl/src/Makefile.am ============================================================================== --- head/contrib/libucl/src/Makefile.am Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/src/Makefile.am Sat Jun 4 14:57:25 2016 (r301339) @@ -12,8 +12,7 @@ libucl_la_SOURCES= ucl_emitter.c \ ucl_schema.c \ ucl_util.c \ ucl_msgpack.c \ - ucl_sexp.c \ - xxhash.c + ucl_sexp.c libucl_la_CFLAGS= $(libucl_common_cflags) \ @CURL_CFLAGS@ libucl_la_LDFLAGS = -version-info @SO_VERSION@ @@ -25,7 +24,7 @@ libucl_la_LIBADD= @LIBFETCH_LIBS@ \ include_HEADERS= $(top_srcdir)/include/ucl.h \ $(top_srcdir)/include/ucl++.h noinst_HEADERS= ucl_internal.h \ - xxhash.h \ + mum.h \ ucl_hash.h \ ucl_chartable.h \ tree.h Copied: head/contrib/libucl/src/mum.h (from r301336, vendor/libucl/dist/src/mum.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/src/mum.h Sat Jun 4 14:57:25 2016 (r301339, copy of r301336, vendor/libucl/dist/src/mum.h) @@ -0,0 +1,417 @@ +/* Copyright (c) 2016 Vladimir Makarov + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +/* This file implements MUM (MUltiply and Mix) hashing. We randomize + input data by 64x64-bit multiplication and mixing hi- and low-parts + of the multiplication result by using an addition and then mix it + into the current state. We use prime numbers randomly generated + with the equal probability of their bit values for the + multiplication. When all primes are used once, the state is + randomized and the same prime numbers are used again for data + randomization. + + The MUM hashing passes all SMHasher tests. Pseudo Random Number + Generator based on MUM also passes NIST Statistical Test Suite for + Random and Pseudorandom Number Generators for Cryptographic + Applications (version 2.2.1) with 1000 bitstreams each containing + 1M bits. MUM hashing is also faster Spooky64 and City64 on small + strings (at least upto 512-bit) on Haswell and Power7. The MUM bulk + speed (speed on very long data) is bigger than Spooky and City on + Power7. On Haswell the bulk speed is bigger than Spooky one and + close to City speed. */ + +#ifndef __MUM_HASH__ +#define __MUM_HASH__ + +#include +#include +#include +#include + +#ifdef _MSC_VER +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +/* Macro saying to use 128-bit integers implemented by GCC for some + targets. */ +#ifndef _MUM_USE_INT128 +/* In GCC uint128_t is defined if HOST_BITS_PER_WIDE_INT >= 64. + HOST_WIDE_INT is long if HOST_BITS_PER_LONG > HOST_BITS_PER_INT, + otherwise int. */ +#if defined(__GNUC__) && UINT_MAX != ULONG_MAX +#define _MUM_USE_INT128 1 +#else +#define _MUM_USE_INT128 0 +#endif +#endif + +#if defined(__GNUC__) && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) || (__GNUC__ > 4)) +#define _MUM_FRESH_GCC +#endif + +#if defined(__GNUC__) && !defined(__llvm__) +#define _MUM_ATTRIBUTE_UNUSED __attribute__((unused)) +#define _MUM_OPTIMIZE(opts) __attribute__((__optimize__ (opts))) +#define _MUM_TARGET(opts) __attribute__((__target__ (opts))) +#else +#define _MUM_ATTRIBUTE_UNUSED +#define _MUM_OPTIMIZE(opts) +#define _MUM_TARGET(opts) +#endif + + +/* Here are different primes randomly generated with the equal + probability of their bit values. They are used to randomize input + values. */ +static uint64_t _mum_hash_step_prime = 0x2e0bb864e9ea7df5ULL; +static uint64_t _mum_key_step_prime = 0xcdb32970830fcaa1ULL; +static uint64_t _mum_block_start_prime = 0xc42b5e2e6480b23bULL; +static uint64_t _mum_unroll_prime = 0x7b51ec3d22f7096fULL; +static uint64_t _mum_tail_prime = 0xaf47d47c99b1461bULL; +static uint64_t _mum_finish_prime1 = 0xa9a7ae7ceff79f3fULL; +static uint64_t _mum_finish_prime2 = 0xaf47d47c99b1461bULL; + +static uint64_t _mum_primes [] = { + 0X9ebdcae10d981691, 0X32b9b9b97a27ac7d, 0X29b5584d83d35bbd, 0X4b04e0e61401255f, + 0X25e8f7b1f1c9d027, 0X80d4c8c000f3e881, 0Xbd1255431904b9dd, 0X8a3bd4485eee6d81, + 0X3bc721b2aad05197, 0X71b1a19b907d6e33, 0X525e6c1084a8534b, 0X9e4c2cd340c1299f, + 0Xde3add92e94caa37, 0X7e14eadb1f65311d, 0X3f5aa40f89812853, 0X33b15a3b587d15c9, +}; + +/* Multiply 64-bit V and P and return sum of high and low parts of the + result. */ +static inline uint64_t +_mum (uint64_t v, uint64_t p) { + uint64_t hi, lo; +#if _MUM_USE_INT128 +#if defined(__aarch64__) + /* AARCH64 needs 2 insns to calculate 128-bit result of the + multiplication. If we use a generic code we actually call a + function doing 128x128->128 bit multiplication. The function is + very slow. */ + lo = v * p, hi; + asm ("umulh %0, %1, %2" : "=r" (hi) : "r" (v), "r" (p)); +#else + __uint128_t r = (__uint128_t) v * (__uint128_t) p; + hi = (uint64_t) (r >> 64); + lo = (uint64_t) r; +#endif +#else + /* Implementation of 64x64->128-bit multiplication by four 32x32->64 + bit multiplication. */ + uint64_t hv = v >> 32, hp = p >> 32; + uint64_t lv = (uint32_t) v, lp = (uint32_t) p; + uint64_t rh = hv * hp; + uint64_t rm_0 = hv * lp; + uint64_t rm_1 = hp * lv; + uint64_t rl = lv * lp; + uint64_t t, carry = 0; + + /* We could ignore a carry bit here if we did not care about the + same hash for 32-bit and 64-bit targets. */ + t = rl + (rm_0 << 32); +#ifdef MUM_TARGET_INDEPENDENT_HASH + carry = t < rl; +#endif + lo = t + (rm_1 << 32); +#ifdef MUM_TARGET_INDEPENDENT_HASH + carry += lo < t; +#endif + hi = rh + (rm_0 >> 32) + (rm_1 >> 32) + carry; +#endif + /* We could use XOR here too but, for some reasons, on Haswell and + Power7 using an addition improves hashing performance by 10% for + small strings. */ + return hi + lo; +} + +#if defined(_MSC_VER) +#define _mum_bswap_32(x) _byteswap_uint32_t (x) +#define _mum_bswap_64(x) _byteswap_uint64_t (x) +#elif defined(__APPLE__) +#include +#define _mum_bswap_32(x) OSSwapInt32 (x) +#define _mum_bswap_64(x) OSSwapInt64 (x) +#elif defined(__GNUC__) +#define _mum_bswap32(x) __builtin_bswap32 (x) +#define _mum_bswap64(x) __builtin_bswap64 (x) +#else +#include +#define _mum_bswap32(x) bswap32 (x) +#define _mum_bswap64(x) bswap64 (x) +#endif + +static inline uint64_t +_mum_le (uint64_t v) { +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || !defined(MUM_TARGET_INDEPENDENT_HASH) + return v; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return _mum_bswap64 (v); +#else +#error "Unknown endianess" +#endif +} + +static inline uint32_t +_mum_le32 (uint32_t v) { +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || !defined(MUM_TARGET_INDEPENDENT_HASH) + return v; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return _mum_bswap32 (v); +#else +#error "Unknown endianess" +#endif +} + +/* Macro defining how many times the most nested loop in + _mum_hash_aligned will be unrolled by the compiler (although it can + make an own decision:). Use only a constant here to help a + compiler to unroll a major loop. + + The macro value affects the result hash for strings > 128 bit. The + unroll factor greatly affects the hashing speed. We prefer the + speed. */ +#ifndef _MUM_UNROLL_FACTOR_POWER +#if defined(__PPC64__) && !defined(MUM_TARGET_INDEPENDENT_HASH) +#define _MUM_UNROLL_FACTOR_POWER 3 +#elif defined(__aarch64__) && !defined(MUM_TARGET_INDEPENDENT_HASH) +#define _MUM_UNROLL_FACTOR_POWER 4 +#else +#define _MUM_UNROLL_FACTOR_POWER 2 +#endif +#endif + +#if _MUM_UNROLL_FACTOR_POWER < 1 +#error "too small unroll factor" +#elif _MUM_UNROLL_FACTOR_POWER > 4 +#error "We have not enough primes for such unroll factor" +#endif + +#define _MUM_UNROLL_FACTOR (1 << _MUM_UNROLL_FACTOR_POWER) + +static inline uint64_t _MUM_OPTIMIZE("unroll-loops") +_mum_hash_aligned (uint64_t start, const void *key, size_t len) { + uint64_t result = start; + const unsigned char *str = (const unsigned char *) key; + uint64_t u64; + int i; + size_t n; + + result = _mum (result, _mum_block_start_prime); + while (len > _MUM_UNROLL_FACTOR * sizeof (uint64_t)) { + /* This loop could be vectorized when we have vector insns for + 64x64->128-bit multiplication. AVX2 currently only have a + vector insn for 4 32x32->64-bit multiplication. */ + for (i = 0; i < _MUM_UNROLL_FACTOR; i++) + result ^= _mum (_mum_le (((uint64_t *) str)[i]), _mum_primes[i]); + len -= _MUM_UNROLL_FACTOR * sizeof (uint64_t); + str += _MUM_UNROLL_FACTOR * sizeof (uint64_t); + /* We will use the same prime numbers on the next iterations -- + randomize the state. */ + result = _mum (result, _mum_unroll_prime); + } + n = len / sizeof (uint64_t); + for (i = 0; i < (int)n; i++) + result ^= _mum (_mum_le (((uint64_t *) str)[i]), _mum_primes[i]); + len -= n * sizeof (uint64_t); str += n * sizeof (uint64_t); + switch (len) { + case 7: + u64 = _mum_le32 (*(uint32_t *) str); + u64 |= (uint64_t) str[4] << 32; + u64 |= (uint64_t) str[5] << 40; + u64 |= (uint64_t) str[6] << 48; + return result ^ _mum (u64, _mum_tail_prime); + case 6: + u64 = _mum_le32 (*(uint32_t *) str); + u64 |= (uint64_t) str[4] << 32; + u64 |= (uint64_t) str[5] << 40; + return result ^ _mum (u64, _mum_tail_prime); + case 5: + u64 = _mum_le32 (*(uint32_t *) str); + u64 |= (uint64_t) str[4] << 32; + return result ^ _mum (u64, _mum_tail_prime); + case 4: + u64 = _mum_le32 (*(uint32_t *) str); + return result ^ _mum (u64, _mum_tail_prime); + case 3: + u64 = str[0]; + u64 |= (uint64_t) str[1] << 8; + u64 |= (uint64_t) str[2] << 16; + return result ^ _mum (u64, _mum_tail_prime); + case 2: + u64 = str[0]; + u64 |= (uint64_t) str[1] << 8; + return result ^ _mum (u64, _mum_tail_prime); + case 1: + u64 = str[0]; + return result ^ _mum (u64, _mum_tail_prime); + } + return result; +} + +/* Final randomization of H. */ +static inline uint64_t +_mum_final (uint64_t h) { + h ^= _mum (h, _mum_finish_prime1); + h ^= _mum (h, _mum_finish_prime2); + return h; +} + +#if defined(__x86_64__) && defined(_MUM_FRESH_GCC) + +/* We want to use AVX2 insn MULX instead of generic x86-64 MULQ where + it is possible. Although on modern Intel processors MULQ takes + 3-cycles vs. 4 for MULX, MULX permits more freedom in insn + scheduling as it uses less fixed registers. */ +static inline uint64_t _MUM_TARGET("arch=haswell") +_mum_hash_avx2 (const void * key, size_t len, uint64_t seed) { + return _mum_final (_mum_hash_aligned (seed + len, key, len)); +} +#endif + +#ifndef _MUM_UNALIGNED_ACCESS +#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) \ + || defined(__s390__) || defined(__m32c__) || defined(cris) \ + || defined(__CR16__) || defined(__vax__) || defined(__m68k__) \ + || defined(__aarch64__) +#define _MUM_UNALIGNED_ACCESS 1 +#else +#define _MUM_UNALIGNED_ACCESS 0 +#endif +#endif + +/* When we need an aligned access to data being hashed we move part of + the unaligned data to an aligned block of given size and then + process it, repeating processing the data by the block. */ +#ifndef _MUM_BLOCK_LEN +#define _MUM_BLOCK_LEN 1024 +#endif + +#if _MUM_BLOCK_LEN < 8 +#error "too small block length" +#endif + +static inline uint64_t +#if defined(__x86_64__) +_MUM_TARGET("inline-all-stringops") +#endif +_mum_hash_default (const void *key, size_t len, uint64_t seed) { + uint64_t result; + const unsigned char *str = (const unsigned char *) key; + size_t block_len; + uint64_t buf[_MUM_BLOCK_LEN / sizeof (uint64_t)]; + + result = seed + len; + if (_MUM_UNALIGNED_ACCESS || ((size_t) str & 0x7) == 0) + result = _mum_hash_aligned (result, key, len); + else { + while (len != 0) { + block_len = len < _MUM_BLOCK_LEN ? len : _MUM_BLOCK_LEN; + memmove (buf, str, block_len); + result = _mum_hash_aligned (result, buf, block_len); + len -= block_len; + str += block_len; + } + } + return _mum_final (result); +} + +static inline uint64_t +_mum_next_factor (void) { + uint64_t start = 0; + int i; + + for (i = 0; i < 8; i++) + start = (start << 8) | rand() % 256; + return start; +} + +/* ++++++++++++++++++++++++++ Interface functions: +++++++++++++++++++ */ + +/* Set random multiplicators depending on SEED. */ +static inline void +mum_hash_randomize (uint64_t seed) { + int i; + + srand (seed); + _mum_hash_step_prime = _mum_next_factor (); + _mum_key_step_prime = _mum_next_factor (); + _mum_finish_prime1 = _mum_next_factor (); + _mum_finish_prime2 = _mum_next_factor (); + _mum_block_start_prime = _mum_next_factor (); + _mum_unroll_prime = _mum_next_factor (); + _mum_tail_prime = _mum_next_factor (); + for (i = 0; i < (int)(sizeof (_mum_primes) / sizeof (uint64_t)); i++) + _mum_primes[i] = _mum_next_factor (); +} + +/* Start hashing data with SEED. Return the state. */ +static inline uint64_t +mum_hash_init (uint64_t seed) { + return seed; +} + +/* Process data KEY with the state H and return the updated state. */ +static inline uint64_t +mum_hash_step (uint64_t h, uint64_t key) +{ + return _mum (h, _mum_hash_step_prime) ^ _mum (key, _mum_key_step_prime); +} + +/* Return the result of hashing using the current state H. */ +static inline uint64_t +mum_hash_finish (uint64_t h) { + return _mum_final (h); +} + +/* Fast hashing of KEY with SEED. The hash is always the same for the + same key on any target. */ +static inline size_t +mum_hash64 (uint64_t key, uint64_t seed) { + return mum_hash_finish (mum_hash_step (mum_hash_init (seed), key)); +} + +/* Hash data KEY of length LEN and SEED. The hash depends on the + target endianess and the unroll factor. */ +static inline uint64_t +mum_hash (const void *key, size_t len, uint64_t seed) { +#if defined(__x86_64__) && defined(_MUM_FRESH_GCC) + static int avx2_support = 0; + + if (avx2_support > 0) + return _mum_hash_avx2 (key, len, seed); + else if (! avx2_support) { + __builtin_cpu_init (); + avx2_support = __builtin_cpu_supports ("avx2") ? 1 : -1; + if (avx2_support > 0) + return _mum_hash_avx2 (key, len, seed); + } +#endif + return _mum_hash_default (key, len, seed); +} + +#endif Modified: head/contrib/libucl/src/ucl_hash.c ============================================================================== --- head/contrib/libucl/src/ucl_hash.c Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/src/ucl_hash.c Sat Jun 4 14:57:25 2016 (r301339) @@ -25,6 +25,7 @@ #include "ucl_hash.h" #include "khash.h" #include "kvec.h" +#include "mum.h" #include #include @@ -99,20 +100,11 @@ static const unsigned char lc_map[256] = #define UCL64_BIT_HASH 1 #endif -#ifdef UCL64_BIT_HASH static inline uint32_t ucl_hash_func (const ucl_object_t *o) { - return XXH64 (o->key, o->keylen, ucl_hash_seed ()); + return mum_hash (o->key, o->keylen, ucl_hash_seed ()); } -#else -static inline uint32_t -ucl_hash_func (const ucl_object_t *o) -{ - return XXH32 (o->key, o->keylen, ucl_hash_seed ()); -} -#endif - static inline int ucl_hash_equal (const ucl_object_t *k1, const ucl_object_t *k2) { @@ -126,91 +118,60 @@ ucl_hash_equal (const ucl_object_t *k1, KHASH_INIT (ucl_hash_node, const ucl_object_t *, struct ucl_hash_elt, 1, ucl_hash_func, ucl_hash_equal) -#ifdef UCL64_BIT_HASH static inline uint32_t ucl_hash_caseless_func (const ucl_object_t *o) { unsigned len = o->keylen; - unsigned leftover = o->keylen % 4; + unsigned leftover = o->keylen % 8; unsigned fp, i; const uint8_t* s = (const uint8_t*)o->key; union { struct { - unsigned char c1, c2, c3, c4; + unsigned char c1, c2, c3, c4, c5, c6, c7, c8; } c; - uint32_t pp; + uint64_t pp; } u; - XXH64_state_t st; + uint64_t r; fp = len - leftover; - XXH64_reset (&st, ucl_hash_seed ()); + r = ucl_hash_seed (); - for (i = 0; i != fp; i += 4) { + for (i = 0; i != fp; i += 8) { u.c.c1 = s[i], u.c.c2 = s[i + 1], u.c.c3 = s[i + 2], u.c.c4 = s[i + 3]; + u.c.c5 = s[i + 4], u.c.c6 = s[i + 5], u.c.c7 = s[i + 6], u.c.c8 = s[i + 7]; u.c.c1 = lc_map[u.c.c1]; u.c.c2 = lc_map[u.c.c2]; u.c.c3 = lc_map[u.c.c3]; u.c.c4 = lc_map[u.c.c4]; - XXH64_update (&st, &u.pp, sizeof (u)); + u.c.c1 = lc_map[u.c.c5]; + u.c.c2 = lc_map[u.c.c6]; + u.c.c3 = lc_map[u.c.c7]; + u.c.c4 = lc_map[u.c.c8]; + r = mum_hash_step (r, u.pp); } u.pp = 0; switch (leftover) { + case 7: + u.c.c7 = lc_map[(unsigned char)s[i++]]; + case 6: + u.c.c6 = lc_map[(unsigned char)s[i++]]; + case 5: + u.c.c5 = lc_map[(unsigned char)s[i++]]; + case 4: + u.c.c4 = lc_map[(unsigned char)s[i++]]; case 3: u.c.c3 = lc_map[(unsigned char)s[i++]]; case 2: u.c.c2 = lc_map[(unsigned char)s[i++]]; case 1: u.c.c1 = lc_map[(unsigned char)s[i]]; - XXH64_update (&st, &u.pp, leftover); + r = mum_hash_step (r, u.pp); break; } - return XXH64_digest (&st); + return mum_hash_finish (r); } -#else -static inline uint32_t -ucl_hash_caseless_func (const ucl_object_t *o) -{ - unsigned len = o->keylen; - unsigned leftover = o->keylen % 4; - unsigned fp, i; - const uint8_t* s = (const uint8_t*)o->key; - union { - struct { - unsigned char c1, c2, c3, c4; - } c; - uint32_t pp; - } u; - XXH32_state_t st; - - fp = len - leftover; - XXH32_reset (&st, ucl_hash_seed ()); - - for (i = 0; i != fp; i += 4) { - u.c.c1 = s[i], u.c.c2 = s[i + 1], u.c.c3 = s[i + 2], u.c.c4 = s[i + 3]; - u.c.c1 = lc_map[u.c.c1]; - u.c.c2 = lc_map[u.c.c2]; - u.c.c3 = lc_map[u.c.c3]; - u.c.c4 = lc_map[u.c.c4]; - XXH32_update (&st, &u.pp, sizeof (u)); - } - - u.pp = 0; - switch (leftover) { - case 3: - u.c.c3 = lc_map[(unsigned char)s[i++]]; - case 2: - u.c.c2 = lc_map[(unsigned char)s[i++]]; - case 1: - u.c.c1 = lc_map[(unsigned char)s[i]]; - XXH32_update (&st, &u.pp, leftover); - break; - } - - return XXH32_digest (&st); -} -#endif static inline int ucl_hash_caseless_equal (const ucl_object_t *k1, const ucl_object_t *k2) Modified: head/contrib/libucl/src/ucl_internal.h ============================================================================== --- head/contrib/libucl/src/ucl_internal.h Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/src/ucl_internal.h Sat Jun 4 14:57:25 2016 (r301339) @@ -93,7 +93,6 @@ #include "uthash.h" #include "ucl.h" #include "ucl_hash.h" -#include "xxhash.h" #ifdef HAVE_OPENSSL #include Modified: head/contrib/libucl/src/ucl_msgpack.c ============================================================================== --- head/contrib/libucl/src/ucl_msgpack.c Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/src/ucl_msgpack.c Sat Jun 4 14:57:25 2016 (r301339) @@ -1423,6 +1423,10 @@ ucl_msgpack_parse_int (struct ucl_parser int16_t iv16; int32_t iv32; int64_t iv64; + uint16_t uiv16; + uint32_t uiv32; + uint64_t uiv64; + if (len > remain) { return -1; @@ -1455,7 +1459,9 @@ ucl_msgpack_parse_int (struct ucl_parser len = 2; break; case msgpack_uint16: - obj->value.iv = FROM_BE16 (*(uint16_t *)pos); + memcpy (&uiv16, pos, sizeof (uiv16)); + uiv16 = FROM_BE16 (uiv16); + obj->value.iv = uiv16; len = 2; break; case msgpack_int32: @@ -1465,7 +1471,9 @@ ucl_msgpack_parse_int (struct ucl_parser len = 4; break; case msgpack_uint32: - obj->value.iv = FROM_BE32 (*(uint32_t *)pos); + memcpy(&uiv32, pos, sizeof(uiv32)); + uiv32 = FROM_BE32(uiv32); + obj->value.iv = uiv32; len = 4; break; case msgpack_int64: @@ -1475,7 +1483,9 @@ ucl_msgpack_parse_int (struct ucl_parser len = 8; break; case msgpack_uint64: - obj->value.iv = FROM_BE64 (*(uint64_t *)pos); + memcpy(&uiv64, pos, sizeof(uiv64)); + uiv64 = FROM_BE64(uiv64); + obj->value.iv = uiv64; len = 8; break; default: @@ -1498,6 +1508,7 @@ ucl_msgpack_parse_float (struct ucl_pars uint32_t i; float f; } d; + uint64_t uiv64; if (len > remain) { return -1; @@ -1507,13 +1518,16 @@ ucl_msgpack_parse_float (struct ucl_pars switch (fmt) { case msgpack_float32: - d.i = FROM_BE32 (*(uint32_t *)pos); + memcpy(&d.i, pos, sizeof(d.i)); + d.i = FROM_BE32(d.i); /* XXX: can be slow */ obj->value.dv = d.f; len = 4; break; case msgpack_float64: - obj->value.iv = FROM_BE64 (*(uint64_t *)pos); + memcpy(&uiv64, pos, sizeof(uiv64)); + uiv64 = FROM_BE64(uiv64); + obj->value.iv = uiv64; len = 8; break; default: Modified: head/contrib/libucl/src/ucl_parser.c ============================================================================== --- head/contrib/libucl/src/ucl_parser.c Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/src/ucl_parser.c Sat Jun 4 14:57:25 2016 (r301339) @@ -2597,12 +2597,7 @@ ucl_parser_add_chunk_full (struct ucl_pa return false; } - if (len == 0) { - parser->top_obj = ucl_object_new_full (UCL_OBJECT, priority); - return true; - } - - if (data == NULL) { + if (data == NULL && len != 0) { ucl_create_err (&parser->err, "invalid chunk added"); return false; } @@ -2613,6 +2608,7 @@ ucl_parser_add_chunk_full (struct ucl_pa ucl_create_err (&parser->err, "cannot allocate chunk structure"); return false; } + chunk->begin = data; chunk->remain = len; chunk->pos = chunk->begin; @@ -2631,12 +2627,27 @@ ucl_parser_add_chunk_full (struct ucl_pa return false; } - switch (parse_type) { - default: - case UCL_PARSE_UCL: - return ucl_state_machine (parser); - case UCL_PARSE_MSGPACK: - return ucl_parse_msgpack (parser); + if (len > 0) { + /* Need to parse something */ + switch (parse_type) { + default: + case UCL_PARSE_UCL: + return ucl_state_machine (parser); + case UCL_PARSE_MSGPACK: + return ucl_parse_msgpack (parser); + } + } + else { + /* Just add empty chunk and go forward */ + if (parser->top_obj == NULL) { + /* + * In case of empty object, create one to indicate that we've + * read something + */ + parser->top_obj = ucl_object_new_full (UCL_OBJECT, priority); + } + + return true; } } Modified: head/contrib/libucl/src/ucl_util.c ============================================================================== --- head/contrib/libucl/src/ucl_util.c Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/src/ucl_util.c Sat Jun 4 14:57:25 2016 (r301339) @@ -975,6 +975,7 @@ ucl_include_file_single (const unsigned if (params->soft_fail) { return false; } + return (!params->must_exist || false); } @@ -1172,11 +1173,14 @@ ucl_include_file_single (const unsigned res = ucl_parser_add_chunk_full (parser, buf, buflen, params->priority, params->strat, params->parse_type); - if (!res && !params->must_exist) { - /* Free error */ - utstring_free (parser->err); - parser->err = NULL; - parser->state = UCL_STATE_AFTER_VALUE; + + if (!res) { + if (!params->must_exist) { + /* Free error */ + utstring_free (parser->err); + parser->err = NULL; + res = true; + } } /* Stop nesting the include, take 1 level off the stack */ @@ -1849,6 +1853,9 @@ ucl_parser_add_fd_priority (struct ucl_p fd, strerror (errno)); return false; } + if (st.st_size == 0) { + return true; + } if ((buf = ucl_mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) { ucl_create_err (&parser->err, "cannot mmap fd %d: %s", fd, strerror (errno)); Modified: head/contrib/libucl/uthash/uthash.h ============================================================================== --- head/contrib/libucl/uthash/uthash.h Sat Jun 4 14:57:08 2016 (r301338) +++ head/contrib/libucl/uthash/uthash.h Sat Jun 4 14:57:25 2016 (r301339) @@ -22,12 +22,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI */ #ifndef UTHASH_H -#define UTHASH_H +#define UTHASH_H #include /* memcmp,strlen */ #include /* ptrdiff_t */ #include /* exit() */ -#include "xxhash.h" +#include "mum.h" /* These macros use decltype or the earlier __typeof GNU extension. As decltype is only available in newer compilers (VS2010 or gcc 4.3+ @@ -50,7 +50,7 @@ do { char **_da_dst = (char**)(&(dst)); \ *_da_dst = (char*)(src); \ } while(0) -#else +#else #define DECLTYPE_ASSIGN(dst,src) \ do { \ (dst) = DECLTYPE(dst)(src); \ @@ -115,12 +115,12 @@ do { if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ -} while (0) +} while (0) #define HASH_BLOOM_FREE(tbl) \ do { \ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ -} while (0) +} while (0) #define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) #define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) @@ -132,9 +132,9 @@ do { HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) #else -#define HASH_BLOOM_MAKE(tbl) -#define HASH_BLOOM_FREE(tbl) -#define HASH_BLOOM_ADD(tbl,hashv) +#define HASH_BLOOM_MAKE(tbl) +#define HASH_BLOOM_FREE(tbl) +#define HASH_BLOOM_ADD(tbl,hashv) #define HASH_BLOOM_TEST(tbl,hashv) (1) #define HASH_BLOOM_BYTELEN 0 #endif @@ -170,7 +170,7 @@ do { }; \ HASH_ADD(hh,head,fieldname,keylen_in,add); \ } while(0) - + #define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ do { \ unsigned _ha_bkt; \ @@ -328,10 +328,10 @@ do { } \ } while (0) #else -#define HASH_FSCK(hh,head) +#define HASH_FSCK(hh,head) #endif -/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to +/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to * the descriptor to which this macro is defined for tuning the hash function. * The app can #include to get the prototype for write(2). */ #ifdef HASH_EMIT_KEYS @@ -341,12 +341,12 @@ do { write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ write(HASH_EMIT_KEYS, keyptr, fieldlen); \ } while (0) -#else -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) +#else +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) #endif /* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ -#ifdef HASH_FUNCTION +#ifdef HASH_FUNCTION #define HASH_FCN HASH_FUNCTION #else #define HASH_FCN HASH_XX @@ -356,14 +356,14 @@ do { #define HASH_XX(key,keylen,num_bkts,hashv,bkt) \ do { \ - hashv = XXH32 (key, keylen, XX_HASH_PRIME); \ + hashv = mum_hash (key, keylen, XX_HASH_PRIME); \ bkt = (hashv) & (num_bkts-1); \ } while (0) /* key comparison function; return 0 if keys equal */ -#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) +#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) /* iterate over items in a known bucket to find desired item */ #define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ @@ -404,36 +404,36 @@ do { } \ if (hh_del->hh_next) { \ hh_del->hh_next->hh_prev = hh_del->hh_prev; \ - } + } /* Bucket expansion has the effect of doubling the number of buckets * and redistributing the items into the new buckets. Ideally the * items will distribute more or less evenly into the new buckets * (the extent to which this is true is a measure of the quality of - * the hash function as it applies to the key domain). - * + * the hash function as it applies to the key domain). + * * With the items distributed into more buckets, the chain length * (item count) in each bucket is reduced. Thus by expanding buckets - * the hash keeps a bound on the chain length. This bounded chain + * the hash keeps a bound on the chain length. This bounded chain * length is the essence of how a hash provides constant time lookup. - * + * * The calculation of tbl->ideal_chain_maxlen below deserves some * explanation. First, keep in mind that we're calculating the ideal * maximum chain length based on the *new* (doubled) bucket count. * In fractions this is just n/b (n=number of items,b=new num buckets). - * Since the ideal chain length is an integer, we want to calculate + * Since the ideal chain length is an integer, we want to calculate * ceil(n/b). We don't depend on floating point arithmetic in this * hash, so to calculate ceil(n/b) with integers we could write - * + * * ceil(n/b) = (n/b) + ((n%b)?1:0) - * + * * and in fact a previous version of this hash did just that. * But now we have improved things a bit by recognizing that b is * always a power of two. We keep its base 2 log handy (call it lb), * so now we can write this with a bit shift and logical AND: - * + * * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) - * + * */ #define HASH_EXPAND_BUCKETS(tbl) \ do { \ @@ -485,7 +485,7 @@ do { /* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ -/* Note that HASH_SORT assumes the hash handle name to be hh. +/* Note that HASH_SORT assumes the hash handle name to be hh. * HASH_SRT was added to allow the hash handle name to be passed in. */ #define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) #define HASH_SRT(hh,head,cmpfcn) \ @@ -575,10 +575,10 @@ do { } \ } while (0) -/* This function selects items from one hash into another hash. - * The end result is that the selected items have dual presence - * in both hashes. There is no copy of the items made; rather - * they are added into the new hash through a secondary hash +/* This function selects items from one hash into another hash. + * The end result is that the selected items have dual presence + * in both hashes. There is no copy of the items made; rather + * they are added into the new hash through a secondary hash * hash handle that must be present in the structure. */ #define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ do { \ @@ -638,7 +638,7 @@ do { #ifdef NO_DECLTYPE #define HASH_ITER(hh,head,el,tmp) \ for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ - el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) + el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) #else #define HASH_ITER(hh,head,el,tmp) \ for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ @@ -646,7 +646,7 @@ for((el)=(head),(tmp)=DECLTYPE(el)((head #endif /* obtain a count of items in the hash */ -#define HASH_COUNT(head) HASH_CNT(hh,head) +#define HASH_COUNT(head) HASH_CNT(hh,head) #define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) typedef struct UT_hash_bucket { @@ -655,7 +655,7 @@ typedef struct UT_hash_bucket { /* expand_mult is normally set to 0. In this situation, the max chain length * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If - * the bucket's chain exceeds this length, bucket expansion is triggered). + * the bucket's chain exceeds this length, bucket expansion is triggered). * However, setting expand_mult to a non-zero value delays bucket expansion * (that would be triggered by additions to this particular bucket) * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. @@ -663,7 +663,7 @@ typedef struct UT_hash_bucket { * multiplier is to reduce bucket expansions, since they are expensive, in * situations where we know that a particular bucket tends to be overused. * It is better to let its chain length grow to a longer yet-still-bounded - * value, than to do an O(n) bucket expansion too often. + * value, than to do an O(n) bucket expansion too often. */ unsigned expand_mult; @@ -689,7 +689,7 @@ typedef struct UT_hash_table { * hash distribution; reaching them in a chain traversal takes >ideal steps */ unsigned nonideal_items; - /* ineffective expands occur when a bucket doubling was performed, but + /* ineffective expands occur when a bucket doubling was performed, but * afterward, more than half the items in the hash had nonideal chain * positions. If this happens on two consecutive expansions we inhibit any * further expansion, as it's not helping; this happens when the hash Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Sat Jun 4 14:57:08 2016 (r301338) +++ head/lib/libucl/Makefile Sat Jun 4 14:57:25 2016 (r301339) @@ -14,8 +14,7 @@ SRCS= ucl_emitter_streamline.c \ ucl_parser.c \ ucl_schema.c \ ucl_sexp.c \ - ucl_util.c \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jun 4 16:31:34 2016 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 9ECCAB6A5DB; Sat, 4 Jun 2016 16:31:34 +0000 (UTC) (envelope-from bapt@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 mx1.freebsd.org (Postfix) with ESMTPS id 7000417A4; Sat, 4 Jun 2016 16:31:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54GVXP1039505; Sat, 4 Jun 2016 16:31:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54GVXuK039503; Sat, 4 Jun 2016 16:31:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606041631.u54GVXuK039503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 4 Jun 2016 16:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301367 - head/usr.sbin/pw 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.22 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: Sat, 04 Jun 2016 16:31:34 -0000 Author: bapt Date: Sat Jun 4 16:31:33 2016 New Revision: 301367 URL: https://svnweb.freebsd.org/changeset/base/301367 Log: Fix typo preventing pw {user,group}next -C from working as expected Reported by: Mike Selnet via forums.freebsd.org MFC after: 3 days Modified: head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sat Jun 4 16:31:04 2016 (r301366) +++ head/usr.sbin/pw/pw_group.c Sat Jun 4 16:31:33 2016 (r301367) @@ -261,7 +261,7 @@ pw_group_next(int argc, char **argv, cha int ch; bool quiet = false; - while ((ch = getopt(argc, argv, "Cq")) != -1) { + while ((ch = getopt(argc, argv, "C:q")) != -1) { switch (ch) { case 'C': cfg = optarg; Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat Jun 4 16:31:04 2016 (r301366) +++ head/usr.sbin/pw/pw_user.c Sat Jun 4 16:31:33 2016 (r301367) @@ -742,7 +742,7 @@ pw_user_next(int argc, char **argv, char bool quiet = false; uid_t next; - while ((ch = getopt(argc, argv, "Cq")) != -1) { + while ((ch = getopt(argc, argv, "C:q")) != -1) { switch (ch) { case 'C': cfg = optarg; From owner-svn-src-head@freebsd.org Sat Jun 4 17:17:11 2016 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 40B30B69A4A; Sat, 4 Jun 2016 17:17:11 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 0EA921506; Sat, 4 Jun 2016 17:17:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54HHAkk056091; Sat, 4 Jun 2016 17:17:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54HHASn056090; Sat, 4 Jun 2016 17:17:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606041717.u54HHASn056090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Jun 2016 17:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301394 - head 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.22 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: Sat, 04 Jun 2016 17:17:11 -0000 Author: bdrewery Date: Sat Jun 4 17:17:10 2016 New Revision: 301394 URL: https://svnweb.freebsd.org/changeset/base/301394 Log: Follow-up r301287: Pass external compiler metadata when used. This fixes WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external compiler, to pass the external compiler metadata rather than the ${CC} metadata. On a build host that has clang as CC it was passing the clang metadata rather than GCC metadata during the build. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jun 4 17:16:35 2016 (r301393) +++ head/Makefile.inc1 Sat Jun 4 17:17:10 2016 (r301394) @@ -129,9 +129,15 @@ MK_GCC_BOOTSTRAP= no # passed along rather than trying to run cc from the restricted # STRICTTMPPATH. .if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" +.if defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} +.else +CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ + COMPILER_TYPE=${X_COMPILER_TYPE} \ + COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} +.endif .endif # Handle external binutils. From owner-svn-src-head@freebsd.org Sat Jun 4 17:37:27 2016 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 1AEDDB6A3D7; Sat, 4 Jun 2016 17:37:27 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id EB4931FD4; Sat, 4 Jun 2016 17:37:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54HbQ1S064134; Sat, 4 Jun 2016 17:37:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54HbPOR064126; Sat, 4 Jun 2016 17:37:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606041737.u54HbPOR064126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Jun 2016 17:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301402 - in head/gnu/usr.bin/cc: c++ cc cc1 cc1plus cc_tools cpp gcov 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.22 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: Sat, 04 Jun 2016 17:37:27 -0000 Author: bdrewery Date: Sat Jun 4 17:37:25 2016 New Revision: 301402 URL: https://svnweb.freebsd.org/changeset/base/301402 Log: DIRDEPS_BUILD: Update GCC dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/usr.bin/cc/c++/Makefile.depend head/gnu/usr.bin/cc/cc/Makefile.depend head/gnu/usr.bin/cc/cc1/Makefile.depend head/gnu/usr.bin/cc/cc1plus/Makefile.depend head/gnu/usr.bin/cc/cc_tools/Makefile.depend head/gnu/usr.bin/cc/cpp/Makefile.depend head/gnu/usr.bin/cc/gcov/Makefile.depend Modified: head/gnu/usr.bin/cc/c++/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/c++/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/c++/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -11,7 +11,6 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libc_nonshared \ lib/libcompiler_rt \ Modified: head/gnu/usr.bin/cc/cc/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/cc/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/cc/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -3,6 +3,7 @@ DIRDEPS = \ gnu/lib/csu \ + gnu/lib/libgcc \ gnu/usr.bin/cc/cc_tools \ gnu/usr.bin/cc/libcpp \ gnu/usr.bin/cc/libiberty \ Modified: head/gnu/usr.bin/cc/cc1/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/cc1/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/cc1/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -2,6 +2,8 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ gnu/usr.bin/cc/cc_int \ gnu/usr.bin/cc/cc_tools \ gnu/usr.bin/cc/libcpp \ Modified: head/gnu/usr.bin/cc/cc1plus/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/cc1plus/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/cc1plus/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -2,11 +2,14 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ gnu/usr.bin/cc/cc_int \ gnu/usr.bin/cc/cc_tools \ gnu/usr.bin/cc/libcpp \ gnu/usr.bin/cc/libdecnumber \ gnu/usr.bin/cc/libiberty \ + gnu/usr.bin/gperf.host \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/usr.bin/cc/cc_tools/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -8,9 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libc_nonshared \ lib/libcompiler_rt \ lib/msun \ + usr.bin/yacc.host \ .include Modified: head/gnu/usr.bin/cc/cpp/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/cpp/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/cpp/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -11,7 +11,6 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libc_nonshared \ lib/libcompiler_rt \ Modified: head/gnu/usr.bin/cc/gcov/Makefile.depend ============================================================================== --- head/gnu/usr.bin/cc/gcov/Makefile.depend Sat Jun 4 17:24:10 2016 (r301401) +++ head/gnu/usr.bin/cc/gcov/Makefile.depend Sat Jun 4 17:37:25 2016 (r301402) @@ -10,7 +10,6 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libc_nonshared \ lib/libcompiler_rt \ From owner-svn-src-head@freebsd.org Sat Jun 4 17:38:18 2016 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 CAC26B6A433; Sat, 4 Jun 2016 17:38:18 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 9C08E115A; Sat, 4 Jun 2016 17:38:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54HcHfF064210; Sat, 4 Jun 2016 17:38:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54HcHsL064208; Sat, 4 Jun 2016 17:38:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606041738.u54HcHsL064208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Jun 2016 17:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301403 - head 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.22 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: Sat, 04 Jun 2016 17:38:18 -0000 Author: bdrewery Date: Sat Jun 4 17:38:17 2016 New Revision: 301403 URL: https://svnweb.freebsd.org/changeset/base/301403 Log: Fix incorrect logic in r301394. Reported by: Mark Millard Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jun 4 17:37:25 2016 (r301402) +++ head/Makefile.inc1 Sat Jun 4 17:38:17 2016 (r301403) @@ -129,7 +129,7 @@ MK_GCC_BOOTSTRAP= no # passed along rather than trying to run cc from the restricted # STRICTTMPPATH. .if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" -.if defined(X_COMPILER_TYPE) +.if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} From owner-svn-src-head@freebsd.org Sat Jun 4 17:39:43 2016 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 C30E2B6A50A; Sat, 4 Jun 2016 17:39:43 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 9F0F1147A; Sat, 4 Jun 2016 17:39:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54Hdgxv064297; Sat, 4 Jun 2016 17:39:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54HdgnQ064296; Sat, 4 Jun 2016 17:39:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606041739.u54HdgnQ064296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Jun 2016 17:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301404 - head/sys/dev/filemon 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.22 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: Sat, 04 Jun 2016 17:39:43 -0000 Author: bdrewery Date: Sat Jun 4 17:39:42 2016 New Revision: 301404 URL: https://svnweb.freebsd.org/changeset/base/301404 Log: Support all architectures by just using sysent. PowerPC64 has two different ABIs, neither of which is elf64_freebsd_sysvec. Using sysent and freebsd32_sysent achieves the same effect. X-MFC-With: r301130 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Sat Jun 4 17:38:17 2016 (r301403) +++ head/sys/dev/filemon/filemon_wrapper.c Sat Jun 4 17:39:42 2016 (r301404) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "opt_compat.h" @@ -414,32 +415,25 @@ filemon_event_process_fork(void *arg __u static void filemon_wrapper_install(void) { -#if defined(__LP64__) - struct sysent *sv_table = elf64_freebsd_sysvec.sv_table; -#else - struct sysent *sv_table = elf32_freebsd_sysvec.sv_table; -#endif - - sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; - sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; - sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; - sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; - sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; - sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; - sv_table[SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) - sv_table = ia32_freebsd_sysvec.sv_table; + sysent[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; + sysent[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; + sysent[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; + sysent[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; + sysent[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; + sysent[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; + sysent[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; + sysent[SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; - sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; - sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; - sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; - sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; - sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; - sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; - sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) + freebsd32_sysent[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; + freebsd32_sysent[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; + freebsd32_sysent[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; + freebsd32_sysent[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; + freebsd32_sysent[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; + freebsd32_sysent[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; + freebsd32_sysent[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; + freebsd32_sysent[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; #endif /* COMPAT_ARCH32 */ filemon_exec_tag = EVENTHANDLER_REGISTER(process_exec, @@ -453,32 +447,25 @@ filemon_wrapper_install(void) static void filemon_wrapper_deinstall(void) { -#if defined(__LP64__) - struct sysent *sv_table = elf64_freebsd_sysvec.sv_table; -#else - struct sysent *sv_table = elf32_freebsd_sysvec.sv_table; -#endif - - sv_table[SYS_chdir].sy_call = (sy_call_t *)sys_chdir; - sv_table[SYS_open].sy_call = (sy_call_t *)sys_open; - sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat; - sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename; - sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink; - sv_table[SYS_link].sy_call = (sy_call_t *)sys_link; - sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; - sv_table[SYS_linkat].sy_call = (sy_call_t *)sys_linkat; -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) - sv_table = ia32_freebsd_sysvec.sv_table; + sysent[SYS_chdir].sy_call = (sy_call_t *)sys_chdir; + sysent[SYS_open].sy_call = (sy_call_t *)sys_open; + sysent[SYS_openat].sy_call = (sy_call_t *)sys_openat; + sysent[SYS_rename].sy_call = (sy_call_t *)sys_rename; + sysent[SYS_unlink].sy_call = (sy_call_t *)sys_unlink; + sysent[SYS_link].sy_call = (sy_call_t *)sys_link; + sysent[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; + sysent[SYS_linkat].sy_call = (sy_call_t *)sys_linkat; - sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *)sys_chdir; - sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; - sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; - sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename; - sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink; - sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; - sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; - sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *)sys_linkat; +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) + freebsd32_sysent[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *)sys_chdir; + freebsd32_sysent[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; + freebsd32_sysent[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; + freebsd32_sysent[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename; + freebsd32_sysent[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink; + freebsd32_sysent[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; + freebsd32_sysent[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; + freebsd32_sysent[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *)sys_linkat; #endif /* COMPAT_ARCH32 */ EVENTHANDLER_DEREGISTER(process_exec, filemon_exec_tag); From owner-svn-src-head@freebsd.org Sat Jun 4 18:45:57 2016 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 43ECDB6A226; Sat, 4 Jun 2016 18:45:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3D4B149D; Sat, 4 Jun 2016 18:45:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f51.google.com with SMTP id w184so173003215oiw.2; Sat, 04 Jun 2016 11:45:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=leMrlw748miQ/MWrEivEgIp/d2wKvNkdUtXdh5mKxlk=; b=PPYmaV4Sb2kAk0XmM5oLcQV17JN3EFoqOi4mwXXh4aDcv+ejen4dWKKENUIa5WFALw BdMi5yUPBzbVmNBaRN+rs/veQUfORPev15vRd423ufM5Jjx6Q5rIDcf0fFnILy62rFEy QUIXZlEKkPhkeKXEpDBRA5nmX0uHfo+yuP9LcP1aGdvR874O2eoA4MlLRUY0zyXnX95O UCAOml0w/xhCCweimR4Q53/Aixx2H1BkJJBGEF++gr9JHomiVgt1ULqw2E+7xuPdI53j biVYFre5MEbGOjOQfdblhLrCi3cbQ9X5kHrWU33+0E/F81aMxe7T13WfIk3TmQKl+kWJ GpUg== X-Gm-Message-State: ALyK8tIm06BkcshY1kX6buUxr+WAmBAPmjx/LKJMcsjrdzi1NIeT1zL1W+xsQfHbSyMFiQ== X-Received: by 10.157.47.150 with SMTP id r22mr4870919otb.87.1465056448263; Sat, 04 Jun 2016 09:07:28 -0700 (PDT) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id 95sm5992928otr.19.2016.06.04.09.07.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jun 2016 09:07:28 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id i65so6279133ith.1; Sat, 04 Jun 2016 09:07:27 -0700 (PDT) X-Received: by 10.36.77.200 with SMTP id l191mr6538350itb.86.1465056447689; Sat, 04 Jun 2016 09:07:27 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.205.70 with HTTP; Sat, 4 Jun 2016 09:07:27 -0700 (PDT) In-Reply-To: <201606041457.u54EvPsu000829@repo.freebsd.org> References: <201606041457.u54EvPsu000829@repo.freebsd.org> From: Conrad Meyer Date: Sat, 4 Jun 2016 09:07:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r301339 - in head: contrib/libucl/src contrib/libucl/uthash lib/libucl To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sat, 04 Jun 2016 18:45:57 -0000 On Sat, Jun 4, 2016 at 7:57 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Jun 4 14:57:25 2016 > New Revision: 301339 > URL: https://svnweb.freebsd.org/changeset/base/301339 > > Log: > Import libucl snapshot 20160604 > > It replaces xxhash with mumhash Why was xxhash replaced with mumhash? > It fixes issues with msgpack on non x86 What issues? Thanks, Conrad From owner-svn-src-head@freebsd.org Sat Jun 4 18:54:38 2016 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 4A8C7B6A757; Sat, 4 Jun 2016 18:54:38 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3A6E1EBE; Sat, 4 Jun 2016 18:54:37 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id n184so38331069wmn.1; Sat, 04 Jun 2016 11:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cjp1waImL0flTVvg4F+zejHmirj7P/t8hkqzjYzJwcs=; b=h1bmtidps5B4AgSD5NmQe/lPkxikcGYOqURanjOZdLWhW/dVqCP1v6rnCfuwmMZTEx dMjmnDj0LVBv9LFrQD7ioqq/9VpYYJDfFMjil2fJEHnrBWNoFROBfxcXXIj9MOLXGcy9 0CfR49Et/15Ufsxj8vb/l59CLQ0mSSXh2O4/E/oT6E4Mskll2zY2l/xF5ARSn3kfvaUf ZbntXzH0q5BfMhM2IsrF/is5fVOlpsKfb2WThcOlBjuB7yHOGXVP7NuEjFZpf4AqHhaT cromC71ciJ/xY/lhLozJRb1uGjLfC2+OpWVsT6gtuAPMlcaH6sAKPiPmPXKsezzxZ8l6 uGPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=cjp1waImL0flTVvg4F+zejHmirj7P/t8hkqzjYzJwcs=; b=IPxjkZy92C+4sjXK7rysaXkbsX+rKvz0VAnRRnX3TJKNS9qr45zAKLyJ55dqlfvKdb D0ctCYI8jb5ovFDuk74CDzeyEzTwAWul/D7xHEJtdgPfMJIDnXjmzbGb/6X7ruqqckrX ud0RIsYMnWXGoIMuBBp5LBJ9oVg1aSWE0EaA4IFawusS0DhC6AsmjIKpqf0RCLjceFf/ FNk8IyArWa71qNG1TxN3CBwCH+8CjkrOTZl/jzIfuW5zborv2LyXcmj5HEvK28i2nVTx T7iPkmZXdwaRXj14Ledwtji2XKl+uTTpjyQ8Dhod3/bAnyOCZYzOex4ok5K4x5l0NFjE tyOw== X-Gm-Message-State: ALyK8tL/NtQ9M6Ronph/P8tQnx4QoxYhta4K/n108nkeMto5DsHyxMhnObRuCKxu11WHrw== X-Received: by 10.28.25.69 with SMTP id 66mr4525089wmz.39.1465066476442; Sat, 04 Jun 2016 11:54:36 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id t1sm11885915wjy.3.2016.06.04.11.54.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jun 2016 11:54:35 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 4 Jun 2016 20:54:33 +0200 From: Baptiste Daroussin To: Conrad Meyer Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r301339 - in head: contrib/libucl/src contrib/libucl/uthash lib/libucl Message-ID: <20160604185433.GE22189@ivaldir.etoilebsd.net> References: <201606041457.u54EvPsu000829@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o0ZfoUVt4BxPQnbU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sat, 04 Jun 2016 18:54:38 -0000 --o0ZfoUVt4BxPQnbU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 04, 2016 at 09:07:27AM -0700, Conrad Meyer wrote: > On Sat, Jun 4, 2016 at 7:57 AM, Baptiste Daroussin wro= te: > > Author: bapt > > Date: Sat Jun 4 14:57:25 2016 > > New Revision: 301339 > > URL: https://svnweb.freebsd.org/changeset/base/301339 > > > > Log: > > Import libucl snapshot 20160604 > > > > It replaces xxhash with mumhash >=20 > Why was xxhash replaced with mumhash? Because upstream has perferred to switch to mumhash (I'm not upstream) >=20 > > It fixes issues with msgpack on non x86 >=20 The issue was problem with memory alignement in the code for the msgpack reader/emitter leading to bus error Best regards, Bapt --o0ZfoUVt4BxPQnbU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXUyMMAAoJEGOJi9zxtz5aocsP/0EustwmOoBR5ORuhVyZXgbC SW+QV7T12/dK+sdxhKHUw6RxjifGV/6KGx4VqmEIEnjpys4yNMVHHUlWUcO1Fsoo VsMlZqheIv70CF1Nh9ZF1s0faZgQ9YaudfIB+Hs1tSI4VAaN+y9R7xO2JTmZJsHk P0hbj2cmFdtP67E9lH1YvyenQl3AF6b3oyWp7dnNst/Sy2MCsoC9b03DudC87zFU +2EwCZlk9AVrk83Z11uaHcMREy8q6RKGjElpUf+51xCNoLEAtQ/nNoHdx0d2i5pK 2MJy2ySYSCx+ik1QFnGw3tmA8VDxCeLw9Q60bopBXTiAxxiIhme41U/3j0V5OUF8 2IqpF80XFVoHF46sg3z+TiZzBJz4xKosDVdYc2fkLAsDCWoCYXM5tNrvUelb0uVC JvgXHMKXAP+Z9mpg2cGcjLxgHgYNwlaat8senL4u4Q28iGfQSwEAsfmd7YF/UXO9 BUaQuHT5L9x627q8jCyGGCxe/OCpd/edKIjfRRW2Wt2lKYRoNS0ygYhoE9wgmQBB oxLuI7jcI7/0O4oldtlw1g65dKNiozX0MPUWYxZ7B0FSxORt/bEAaZbHpkddMsLo KPFKgwco79geFO0YioRB/Gdt0FuSQ2MlfzlTe16kHHXXA/JUNniINAD2ORxWasrI yPUefYG32aWqm7PBeCj4 =HzFb -----END PGP SIGNATURE----- --o0ZfoUVt4BxPQnbU-- From owner-svn-src-head@freebsd.org Sat Jun 4 18:57:01 2016 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 DFF2FB6A865; Sat, 4 Jun 2016 18:57:01 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id B10FF10B5; Sat, 4 Jun 2016 18:57:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54Iv0Jr093788; Sat, 4 Jun 2016 18:57:00 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54Iv0Rq093787; Sat, 4 Jun 2016 18:57:00 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201606041857.u54Iv0Rq093787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 4 Jun 2016 18:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301406 - head/sys/sys 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.22 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: Sat, 04 Jun 2016 18:57:02 -0000 Author: ed Date: Sat Jun 4 18:57:00 2016 New Revision: 301406 URL: https://svnweb.freebsd.org/changeset/base/301406 Log: Don't test for INKERNEL to check whether we're in kernel space. It turns out that actually defines a macro under this name, even when we're not in kernelspace. This causes us to suppress some macro definitions that are used by userspace apps. PR: 210026 Reported by: jbeich@ MFC after: 2 weeks Modified: head/sys/sys/soundcard.h Modified: head/sys/sys/soundcard.h ============================================================================== --- head/sys/sys/soundcard.h Sat Jun 4 17:40:23 2016 (r301405) +++ head/sys/sys/soundcard.h Sat Jun 4 18:57:00 2016 (r301406) @@ -1261,7 +1261,7 @@ typedef struct mixer_info { */ #define LOCL_STARTAUDIO 1 -#if (!defined(_KERNEL) && !defined(INKERNEL)) || defined(USE_SEQ_MACROS) +#if !defined(_KERNEL) || defined(USE_SEQ_MACROS) /* * Some convenience macros to simplify programming of the * /dev/sequencer interface From owner-svn-src-head@freebsd.org Sat Jun 4 19:00:13 2016 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 6C777B6A9E4; Sat, 4 Jun 2016 19:00:13 +0000 (UTC) (envelope-from landonf@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 mx1.freebsd.org (Postfix) with ESMTPS id 1F5211474; Sat, 4 Jun 2016 19:00:13 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54J0CAQ093993; Sat, 4 Jun 2016 19:00:12 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54J0B8K093989; Sat, 4 Jun 2016 19:00:11 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606041900.u54J0B8K093989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 4 Jun 2016 19:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301407 - head/share/man/man4 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.22 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: Sat, 04 Jun 2016 19:00:13 -0000 Author: landonf Date: Sat Jun 4 19:00:11 2016 New Revision: 301407 URL: https://svnweb.freebsd.org/changeset/base/301407 Log: Update my e-mail address (and fix related typo in siba.4) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6714 Modified: head/share/man/man4/bcma.4 head/share/man/man4/bhnd.4 head/share/man/man4/bhndb.4 head/share/man/man4/siba.4 Modified: head/share/man/man4/bcma.4 ============================================================================== --- head/share/man/man4/bcma.4 Sat Jun 4 18:57:00 2016 (r301406) +++ head/share/man/man4/bcma.4 Sat Jun 4 19:00:11 2016 (r301407) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2015 +.Dd June 3, 2016 .Dt BCMA 4 .Os .Sh NAME @@ -75,4 +75,4 @@ device driver first appeared in The .Nm driver was written by -.An Landon Fuller Aq Mt landon@landonf.org . +.An Landon Fuller Aq Mt landonf@FreeBSD.org . Modified: head/share/man/man4/bhnd.4 ============================================================================== --- head/share/man/man4/bhnd.4 Sat Jun 4 18:57:00 2016 (r301406) +++ head/share/man/man4/bhnd.4 Sat Jun 4 19:00:11 2016 (r301407) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2015 +.Dd June 3, 2016 .Dt BHND 4 .Os .Sh NAME @@ -80,4 +80,4 @@ device driver first appeared in The .Nm driver was written by -.An Landon Fuller Aq Mt landon@landonf.org . +.An Landon Fuller Aq Mt landonf@FreeBSD.org . Modified: head/share/man/man4/bhndb.4 ============================================================================== --- head/share/man/man4/bhndb.4 Sat Jun 4 18:57:00 2016 (r301406) +++ head/share/man/man4/bhndb.4 Sat Jun 4 19:00:11 2016 (r301407) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2015 +.Dd June 3, 2016 .Dt BHNDB 4 .Os .Sh NAME @@ -65,7 +65,7 @@ device driver first appeared in The .Nm driver was written by -.An Landon Fuller Aq Mt landon@landonf.org . +.An Landon Fuller Aq Mt landonf@FreeBSD.org . .Sh CAVEATS The .Nm Modified: head/share/man/man4/siba.4 ============================================================================== --- head/share/man/man4/siba.4 Sat Jun 4 18:57:00 2016 (r301406) +++ head/share/man/man4/siba.4 Sat Jun 4 19:00:11 2016 (r301407) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd June 3, 2016 .Dt SIBA 4 .Os .Sh NAME @@ -88,6 +88,6 @@ and .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . The driver was rewritten for -.Fx 11.0 . +.Fx 11.0 by -.An Landon Fuller Aq Mt landon@landonf.org . +.An Landon Fuller Aq Mt landonf@FreeBSD.org . From owner-svn-src-head@freebsd.org Sat Jun 4 19:05:38 2016 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 7E9C5B6ACC9; Sat, 4 Jun 2016 19:05:38 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward3h.cmail.yandex.net (forward3h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D0CA1D3D; Sat, 4 Jun 2016 19:05:37 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback12h.mail.yandex.net (mxback12h.mail.yandex.net [84.201.186.130]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id 9CC382111A; Sat, 4 Jun 2016 22:05:33 +0300 (MSK) Received: from web17h.yandex.ru (web17h.yandex.ru [84.201.186.46]) by mxback12h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id drI0witmvB-5WE43oRn; Sat, 04 Jun 2016 22:05:32 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1465067132; bh=AFferurqezmJ3WFR0zI2l2eTWe4IMiJLFmxVZlxARbo=; h=X-Yandex-Sender-Uid:From:Envelope-From:To:In-Reply-To:References: Subject:MIME-Version:Message-Id:X-Mailer:Date: Content-Transfer-Encoding:Content-Type; b=WnY/30IzhLO/YFquNAVM4CgHHneTPmVmnDQ68LqRSKF+79QmmwY+UmAtOa82J2vl/ tSWAr6Ohhqtq2VaUJv6DtJA20wIG0s0h9YPYKWU8UzpINZ/4BoNyBjAuewBD5wTYi3 IGZbw3R66u420DfS3ZB/m6JxOfl+SUugADqQKQoI= Authentication-Results: mxback12h.mail.yandex.net; dkim=pass header.i=@ipfw.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0,1 1130000031510964 X-Yandex-Sender-Uid: 1130000014307927 Received: by web17h.yandex.ru with HTTP; Sat, 04 Jun 2016 22:05:32 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: George V. Neville-Neil , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201606021751.u52HpTrH090384@repo.freebsd.org> References: <201606021751.u52HpTrH090384@repo.freebsd.org> Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6 MIME-Version: 1.0 Message-Id: <3448221465067132@web17h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 04 Jun 2016 22:05:32 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sat, 04 Jun 2016 19:05:38 -0000 02.06.2016, 20:51, "George V. Neville-Neil" : > Author: gnn > Date: Thu Jun 2 17:51:29 2016 > New Revision: 301217 > URL: https://svnweb.freebsd.org/changeset/base/301217 > > Log: >   This change re-adds L2 caching for TCP and UDP, as originally added in D4306 >   but removed due to other changes in the system. Restore the llentry pointer >   to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as >   appropriate. I have several comments regarding this commit. 1 Architecturally, there was quite a lot of efforts to eliminate layering violation between lltable and other places in network stack. It ended by committing D4102, which allowed both to cleanup lower level, provide abstract “prepend†framework which could be used to provide cached data to _otuput() functions. This change brings these violations back in a really invasive way. Additionally, implementing L2 PCB caching at the other subsystem expense is really a bad idea. If one wants caching in some subsystem, it should be implemented in that subsystem not polluting other things. Current implementation permits this by filling in “ro_prepend†/ ro_plen fields. In general, this change looks more like a local hack and not like the code that should be included in the tree. 2 There was no benchmarks proving the effectiveness of this change. (For example, it is not obvious if it could significantly improve TCP since we still have per-session TCP wlock + (typically) per-ring mutex, so removing lltable rock might not help things here). Given that the patch complicates existing code, there should be adequate benefits to consider whether this change is worth implementing. 3 The “network†group was not included to the review despite the fact that most of the changes were related to the L2 layer which is not “transportâ€, so some people might have missed this review. 4 This change DOES NOT WORK. really. (which raises questions on both review and benchmarking process). The reason is that “plle†argument is filled only in “heavy†lltable lookup functions (e.g. when we don’t have neighbour adjacency). 99.9% of the time arpresolve/nd6_resolve() returns the result w/o calling their heavy versions, and the returned “plle†is NULL. This can be easily verified by calling something like dtrace -n 'fbt:kernel:ether_output:entry /arg3!=NULL&&((struct route *)arg3)->ro_lle != NULL/ { stack(); }' Given that, I kindly ask you to backout this change. > >   Submitted by: Mike Karels >   Differential Revision: https://reviews.freebsd.org/D6262 > > Modified: >   head/sys/net/flowtable.c >   head/sys/net/if_arcsubr.c >   head/sys/net/if_ethersubr.c >   head/sys/net/if_fddisubr.c >   head/sys/net/if_fwsubr.c >   head/sys/net/if_iso88025subr.c >   head/sys/net/if_llatbl.h >   head/sys/net/route.c >   head/sys/net/route.h >   head/sys/netinet/if_ether.c >   head/sys/netinet/if_ether.h >   head/sys/netinet/in_pcb.c >   head/sys/netinet/ip_output.c >   head/sys/netinet/toecore.c >   head/sys/netinet6/in6.h >   head/sys/netinet6/in6_pcb.c >   head/sys/netinet6/ip6_output.c >   head/sys/netinet6/nd6.c >   head/sys/netinet6/nd6.h > > Modified: head/sys/net/flowtable.c > ============================================================================== > --- head/sys/net/flowtable.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/flowtable.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -696,13 +696,8 @@ flowtable_lookup(sa_family_t sa, struct >          ro->ro_rt = fle->f_rt; >          ro->ro_flags |= RT_NORTREF; >          lle = fle->f_lle; > - if (lle != NULL && (lle->la_flags & LLE_VALID)) { > - ro->ro_prepend = lle->r_linkdata; > - ro->ro_plen = lle->r_hdrlen; > - ro->ro_flags |= RT_MAY_LOOP; > - if (lle->la_flags & LLE_IFADDR) > - ro->ro_flags |= RT_L2_ME; > - } > + if (lle != NULL && (lle->la_flags & LLE_VALID)) > + ro->ro_lle = lle; /* share ref with fle->f_lle */ > >          return (0); >  } > > Modified: head/sys/net/if_arcsubr.c > ============================================================================== > --- head/sys/net/if_arcsubr.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/if_arcsubr.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -129,7 +129,8 @@ arc_output(struct ifnet *ifp, struct mbu >                  else if (ifp->if_flags & IFF_NOARP) >                          adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF; >                  else { > - error = arpresolve(ifp, is_gw, m, dst, &adst, NULL); > + error = arpresolve(ifp, is_gw, m, dst, &adst, NULL, > + NULL); >                          if (error) >                                  return (error == EWOULDBLOCK ? 0 : error); >                  } > @@ -170,7 +171,8 @@ arc_output(struct ifnet *ifp, struct mbu >                  if ((m->m_flags & M_MCAST) != 0) >                          adst = arcbroadcastaddr; /* ARCnet broadcast address */ >                  else { > - error = nd6_resolve(ifp, is_gw, m, dst, &adst, NULL); > + error = nd6_resolve(ifp, is_gw, m, dst, &adst, NULL, > + NULL); >                          if (error != 0) >                                  return (error == EWOULDBLOCK ? 0 : error); >                  } > > Modified: head/sys/net/if_ethersubr.c > ============================================================================== > --- head/sys/net/if_ethersubr.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/if_ethersubr.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -199,7 +199,7 @@ ether_requestencap(struct ifnet *ifp, st >  static int >  ether_resolve_addr(struct ifnet *ifp, struct mbuf *m, >          const struct sockaddr *dst, struct route *ro, u_char *phdr, > - uint32_t *pflags) > + uint32_t *pflags, struct llentry **plle) >  { >          struct ether_header *eh; >          uint32_t lleflags = 0; > @@ -208,13 +208,16 @@ ether_resolve_addr(struct ifnet *ifp, st >          uint16_t etype; >  #endif > > + if (plle) > + *plle = NULL; >          eh = (struct ether_header *)phdr; > >          switch (dst->sa_family) { >  #ifdef INET >          case AF_INET: >                  if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) > - error = arpresolve(ifp, 0, m, dst, phdr, &lleflags); > + error = arpresolve(ifp, 0, m, dst, phdr, &lleflags, > + plle); >                  else { >                          if (m->m_flags & M_BCAST) >                                  memcpy(eh->ether_dhost, ifp->if_broadcastaddr, > @@ -233,7 +236,8 @@ ether_resolve_addr(struct ifnet *ifp, st >  #ifdef INET6 >          case AF_INET6: >                  if ((m->m_flags & M_MCAST) == 0) > - error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags); > + error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags, > + plle); >                  else { >                          const struct in6_addr *a6; >                          a6 = &(((const struct sockaddr_in6 *)dst)->sin6_addr); > @@ -283,14 +287,40 @@ ether_output(struct ifnet *ifp, struct m >          int loop_copy = 1; >          int hlen; /* link layer header length */ >          uint32_t pflags; > + struct llentry *lle = NULL; > + struct rtentry *rt0 = NULL; > + int addref = 0; > >          phdr = NULL; >          pflags = 0; >          if (ro != NULL) { > - phdr = ro->ro_prepend; > - hlen = ro->ro_plen; > - pflags = ro->ro_flags; > + /* XXX BPF uses ro_prepend */ > + if (ro->ro_prepend != NULL) { > + phdr = ro->ro_prepend; > + hlen = ro->ro_plen; > + } else if (!(m->m_flags & (M_BCAST | M_MCAST))) { > + if ((ro->ro_flags & RT_LLE_CACHE) != 0) { > + lle = ro->ro_lle; > + if (lle != NULL && > + (lle->la_flags & LLE_VALID) == 0) { > + LLE_FREE(lle); > + lle = NULL; /* redundant */ > + ro->ro_lle = NULL; > + } > + if (lle == NULL) { > + /* if we lookup, keep cache */ > + addref = 1; > + } > + } > + if (lle != NULL) { > + phdr = lle->r_linkdata; > + hlen = lle->r_hdrlen; > + pflags = lle->r_flags; > + } > + } > + rt0 = ro->ro_rt; >          } > + >  #ifdef MAC >          error = mac_ifnet_check_transmit(ifp, m); >          if (error) > @@ -308,7 +338,10 @@ ether_output(struct ifnet *ifp, struct m >                  /* No prepend data supplied. Try to calculate ourselves. */ >                  phdr = linkhdr; >                  hlen = ETHER_HDR_LEN; > - error = ether_resolve_addr(ifp, m, dst, ro, phdr, &pflags); > + error = ether_resolve_addr(ifp, m, dst, ro, phdr, &pflags, > + addref ? &lle : NULL); > + if (addref && lle != NULL) > + ro->ro_lle = lle; >                  if (error != 0) >                          return (error == EWOULDBLOCK ? 0 : error); >          } > > Modified: head/sys/net/if_fddisubr.c > ============================================================================== > --- head/sys/net/if_fddisubr.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/if_fddisubr.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -126,7 +126,7 @@ fddi_output(struct ifnet *ifp, struct mb >          switch (dst->sa_family) { >  #ifdef INET >          case AF_INET: { > - error = arpresolve(ifp, is_gw, m, dst, edst, NULL); > + error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); >                  if (error) >                          return (error == EWOULDBLOCK ? 0 : error); >                  type = htons(ETHERTYPE_IP); > @@ -162,7 +162,7 @@ fddi_output(struct ifnet *ifp, struct mb >  #endif /* INET */ >  #ifdef INET6 >          case AF_INET6: > - error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL); > + error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); >                  if (error) >                          return (error == EWOULDBLOCK ? 0 : error); >                  type = htons(ETHERTYPE_IPV6); > > Modified: head/sys/net/if_fwsubr.c > ============================================================================== > --- head/sys/net/if_fwsubr.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/if_fwsubr.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -144,7 +144,8 @@ firewire_output(struct ifnet *ifp, struc >                   * doesn't fit into the arp model. >                   */ >                  if (unicast) { > - error = arpresolve(ifp, is_gw, m, dst, (u_char *) destfw, NULL); > + error = arpresolve(ifp, is_gw, m, dst, > + (u_char *) destfw, NULL, NULL); >                          if (error) >                                  return (error == EWOULDBLOCK ? 0 : error); >                  } > @@ -174,7 +175,7 @@ firewire_output(struct ifnet *ifp, struc >          case AF_INET6: >                  if (unicast) { >                          error = nd6_resolve(fc->fc_ifp, is_gw, m, dst, > - (u_char *) destfw, NULL); > + (u_char *) destfw, NULL, NULL); >                          if (error) >                                  return (error == EWOULDBLOCK ? 0 : error); >                  } > > Modified: head/sys/net/if_iso88025subr.c > ============================================================================== > --- head/sys/net/if_iso88025subr.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/if_iso88025subr.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -254,7 +254,7 @@ iso88025_output(struct ifnet *ifp, struc >          switch (dst->sa_family) { >  #ifdef INET >          case AF_INET: > - error = arpresolve(ifp, is_gw, m, dst, edst, NULL); > + error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); >                  if (error) >                          return (error == EWOULDBLOCK ? 0 : error); >                  snap_type = ETHERTYPE_IP; > @@ -289,7 +289,7 @@ iso88025_output(struct ifnet *ifp, struc >  #endif /* INET */ >  #ifdef INET6 >          case AF_INET6: > - error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL); > + error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); >                  if (error) >                          return (error == EWOULDBLOCK ? 0 : error); >                  snap_type = ETHERTYPE_IPV6; > > Modified: head/sys/net/if_llatbl.h > ============================================================================== > --- head/sys/net/if_llatbl.h Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/if_llatbl.h Thu Jun 2 17:51:29 2016 (r301217) > @@ -138,7 +138,6 @@ struct llentry { >          LLE_FREE_LOCKED(lle); \ >  } while (0) > > - >  typedef struct llentry *(llt_lookup_t)(struct lltable *, u_int flags, >      const struct sockaddr *l3addr); >  typedef struct llentry *(llt_alloc_t)(struct lltable *, u_int flags, > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/route.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -207,6 +207,8 @@ rt_tables_get_gen(int table, int fam) >          struct rib_head *rnh; > >          rnh = *rt_tables_get_rnh_ptr(table, fam); > + KASSERT(rnh != NULL, ("%s: NULL rib_head pointer table %d fam %d", > + __func__, table, fam)); >          return (rnh->rnh_gen); >  } > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/net/route.h Thu Jun 2 17:51:29 2016 (r301217) > @@ -50,6 +50,11 @@ >   */ >  struct route { >          struct rtentry *ro_rt; > + struct llentry *ro_lle; > + /* > + * ro_prepend and ro_plen are only used for bpf to pass in a > + * preformed header. They are not cacheable. > + */ >          char *ro_prepend; >          uint16_t ro_plen; >          uint16_t ro_flags; > @@ -71,6 +76,7 @@ struct route { >  #define RT_REJECT 0x0020 /* Destination is reject */ >  #define RT_BLACKHOLE 0x0040 /* Destination is blackhole */ >  #define RT_HAS_GW 0x0080 /* Destination has GW */ > +#define RT_LLE_CACHE 0x0100 /* Cache link layer */ > >  struct rt_metrics { >          u_long rmx_locks; /* Kernel must leave these values alone */ > @@ -399,6 +405,7 @@ struct rt_addrinfo { >                  if ((_ro)->ro_flags & RT_NORTREF) { \ >                          (_ro)->ro_flags &= ~RT_NORTREF; \ >                          (_ro)->ro_rt = NULL; \ > + (_ro)->ro_lle = NULL; \ >                  } else { \ >                          RT_LOCK((_ro)->ro_rt); \ >                          RTFREE_LOCKED((_ro)->ro_rt); \ > @@ -413,9 +420,11 @@ struct rt_addrinfo { >   */ >  #define RT_VALIDATE(ro, cookiep, fibnum) do { \ >          rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \ > - if (*(cookiep) != cookie && (ro)->ro_rt != NULL) { \ > - RTFREE((ro)->ro_rt); \ > - (ro)->ro_rt = NULL; \ > + if (*(cookiep) != cookie) { \ > + if ((ro)->ro_rt != NULL) { \ > + RTFREE((ro)->ro_rt); \ > + (ro)->ro_rt = NULL; \ > + } \ >                  *(cookiep) = cookie; \ >          } \ >  } while (0) > > Modified: head/sys/netinet/if_ether.c > ============================================================================== > --- head/sys/netinet/if_ether.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet/if_ether.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -420,7 +420,8 @@ arprequest(struct ifnet *ifp, const stru >   */ >  static int >  arpresolve_full(struct ifnet *ifp, int is_gw, int flags, struct mbuf *m, > - const struct sockaddr *dst, u_char *desten, uint32_t *pflags) > + const struct sockaddr *dst, u_char *desten, uint32_t *pflags, > + struct llentry **plle) >  { >          struct llentry *la = NULL, *la_tmp; >          struct mbuf *curr = NULL; > @@ -431,6 +432,8 @@ arpresolve_full(struct ifnet *ifp, int i > >          if (pflags != NULL) >                  *pflags = 0; > + if (plle != NULL) > + *plle = NULL; > >          if ((flags & LLE_CREATE) == 0) { >                  IF_AFDATA_RLOCK(ifp); > @@ -483,6 +486,10 @@ arpresolve_full(struct ifnet *ifp, int i >                  } >                  if (pflags != NULL) >                          *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR); > + if (plle) { > + LLE_ADDREF(la); > + *plle = la; > + } >                  LLE_WUNLOCK(la); >                  return (0); >          } > @@ -548,12 +555,12 @@ arpresolve_full(struct ifnet *ifp, int i >   */ >  int >  arpresolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, > - char *desten, uint32_t *pflags) > + char *desten, uint32_t *pflags, struct llentry **plle) >  { >          int error; > >          flags |= LLE_ADDRONLY; > - error = arpresolve_full(ifp, 0, flags, NULL, dst, desten, pflags); > + error = arpresolve_full(ifp, 0, flags, NULL, dst, desten, pflags, plle); >          return (error); >  } > > @@ -576,12 +583,15 @@ arpresolve_addr(struct ifnet *ifp, int f >   */ >  int >  arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, > - const struct sockaddr *dst, u_char *desten, uint32_t *pflags) > + const struct sockaddr *dst, u_char *desten, uint32_t *pflags, > + struct llentry **plle) >  { >          struct llentry *la = NULL; > >          if (pflags != NULL) >                  *pflags = 0; > + if (plle != NULL) > + *plle = NULL; > >          if (m != NULL) { >                  if (m->m_flags & M_BCAST) { > @@ -616,7 +626,7 @@ arpresolve(struct ifnet *ifp, int is_gw, >          IF_AFDATA_RUNLOCK(ifp); > >          return (arpresolve_full(ifp, is_gw, la == NULL ? LLE_CREATE : 0, m, dst, > - desten, pflags)); > + desten, pflags, plle)); >  } > >  /* > > Modified: head/sys/netinet/if_ether.h > ============================================================================== > --- head/sys/netinet/if_ether.h Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet/if_ether.h Thu Jun 2 17:51:29 2016 (r301217) > @@ -113,11 +113,14 @@ extern u_char ether_ipmulticast_min[ETHE >  extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN]; > >  struct ifaddr; > +struct llentry; > >  int arpresolve_addr(struct ifnet *ifp, int flags, > - const struct sockaddr *dst, char *desten, uint32_t *pflags); > + const struct sockaddr *dst, char *desten, uint32_t *pflags, > + struct llentry **plle); >  int arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, > - const struct sockaddr *dst, u_char *desten, uint32_t *pflags); > + const struct sockaddr *dst, u_char *desten, uint32_t *pflags, > + struct llentry **plle); >  void arprequest(struct ifnet *, const struct in_addr *, >              const struct in_addr *, u_char *); >  void arp_ifinit(struct ifnet *, struct ifaddr *); > > Modified: head/sys/netinet/in_pcb.c > ============================================================================== > --- head/sys/netinet/in_pcb.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet/in_pcb.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); >  #include >  #include >  #include > +#include >  #include >  #include >  #include > @@ -1302,6 +1303,8 @@ in_pcbfree(struct inpcb *inp) >                  RTFREE(inp->inp_route.ro_rt); >                  inp->inp_route.ro_rt = (struct rtentry *)NULL; >          } > + if (inp->inp_route.ro_lle) > + LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ > >          inp->inp_vflag = 0; >          inp->inp_flags2 |= INP_FREED; > @@ -2243,6 +2246,8 @@ in_losing(struct inpcb *inp) >                  RTFREE(inp->inp_route.ro_rt); >                  inp->inp_route.ro_rt = (struct rtentry *)NULL; >          } > + if (inp->inp_route.ro_lle) > + LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ >          return; >  } > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet/ip_output.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -245,7 +245,8 @@ ip_output(struct mbuf *m, struct mbuf *o >          if (ro == NULL) { >                  ro = &iproute; >                  bzero(ro, sizeof (*ro)); > - } > + } else > + ro->ro_flags |= RT_LLE_CACHE; > >  #ifdef FLOWTABLE >          if (ro->ro_rt == NULL) > @@ -311,6 +312,9 @@ again: >                            dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { >                  RTFREE(rte); >                  rte = ro->ro_rt = (struct rtentry *)NULL; > + if (ro->ro_lle) > + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ > + ro->ro_lle = (struct llentry *)NULL; >          } >          ia = NULL; >          have_ia_ref = 0; > > Modified: head/sys/netinet/toecore.c > ============================================================================== > --- head/sys/netinet/toecore.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet/toecore.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -451,12 +451,12 @@ toe_l2_resolve(struct toedev *tod, struc >          switch (sa->sa_family) { >  #ifdef INET >          case AF_INET: > - rc = arpresolve(ifp, 0, NULL, sa, lladdr, NULL); > + rc = arpresolve(ifp, 0, NULL, sa, lladdr, NULL, NULL); >                  break; >  #endif >  #ifdef INET6 >          case AF_INET6: > - rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL); > + rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL, NULL); >                  break; >  #endif >          default: > > Modified: head/sys/netinet6/in6.h > ============================================================================== > --- head/sys/netinet6/in6.h Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet6/in6.h Thu Jun 2 17:51:29 2016 (r301217) > @@ -375,6 +375,11 @@ extern const struct in6_addr in6addr_lin >  #if __BSD_VISIBLE >  struct route_in6 { >          struct rtentry *ro_rt; > + struct llentry *ro_lle; > + /* > + * ro_prepend and ro_plen are only used for bpf to pass in a > + * preformed header. They are not cacheable. > + */ >          char *ro_prepend; >          uint16_t ro_plen; >          uint16_t ro_flags; > > Modified: head/sys/netinet6/in6_pcb.c > ============================================================================== > --- head/sys/netinet6/in6_pcb.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet6/in6_pcb.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); > >  #include >  #include > +#include >  #include >  #include > > @@ -831,6 +832,8 @@ in6_losing(struct inpcb *in6p) >                  RTFREE(in6p->inp_route6.ro_rt); >                  in6p->inp_route6.ro_rt = (struct rtentry *)NULL; >          } > + if (in6p->inp_route.ro_lle) > + LLE_FREE(in6p->inp_route.ro_lle); /* zeros ro_lle */ >          return; >  } > > @@ -846,6 +849,8 @@ in6_rtchange(struct inpcb *inp, int errn >                  RTFREE(inp->inp_route6.ro_rt); >                  inp->inp_route6.ro_rt = (struct rtentry *)NULL; >          } > + if (inp->inp_route.ro_lle) > + LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ >          return inp; >  } > > Modified: head/sys/netinet6/ip6_output.c > ============================================================================== > --- head/sys/netinet6/ip6_output.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet6/ip6_output.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -500,7 +500,8 @@ ip6_output(struct mbuf *m0, struct ip6_p >          if (ro == NULL) { >                  ro = &ip6route; >                  bzero((caddr_t)ro, sizeof(*ro)); > - } > + } else > + ro->ro_flags |= RT_LLE_CACHE; >          ro_pmtu = ro; >          if (opt && opt->ip6po_rthdr) >                  ro = &opt->ip6po_route; > > Modified: head/sys/netinet6/nd6.c > ============================================================================== > --- head/sys/netinet6/nd6.c Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet6/nd6.c Thu Jun 2 17:51:29 2016 (r301217) > @@ -136,7 +136,7 @@ static void nd6_llinfo_settimer_locked(s >  static void clear_llinfo_pqueue(struct llentry *); >  static void nd6_rtrequest(int, struct rtentry *, struct rt_addrinfo *); >  static int nd6_resolve_slow(struct ifnet *, int, struct mbuf *, > - const struct sockaddr_in6 *, u_char *, uint32_t *); > + const struct sockaddr_in6 *, u_char *, uint32_t *, struct llentry **); >  static int nd6_need_cache(struct ifnet *); > > @@ -2175,7 +2175,8 @@ nd6_output_ifp(struct ifnet *ifp, struct >   */ >  int >  nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, > - const struct sockaddr *sa_dst, u_char *desten, uint32_t *pflags) > + const struct sockaddr *sa_dst, u_char *desten, uint32_t *pflags, > + struct llentry **plle) >  { >          struct llentry *ln = NULL; >          const struct sockaddr_in6 *dst6; > @@ -2227,7 +2228,7 @@ nd6_resolve(struct ifnet *ifp, int is_gw >          } >          IF_AFDATA_RUNLOCK(ifp); > > - return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags)); > + return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags, plle)); >  } > > @@ -2244,7 +2245,8 @@ nd6_resolve(struct ifnet *ifp, int is_gw >   */ >  static __noinline int >  nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, > - const struct sockaddr_in6 *dst, u_char *desten, uint32_t *pflags) > + const struct sockaddr_in6 *dst, u_char *desten, uint32_t *pflags, > + struct llentry **plle) >  { >          struct llentry *lle = NULL, *lle_tmp; >          struct in6_addr *psrc, src; > @@ -2331,6 +2333,10 @@ nd6_resolve_slow(struct ifnet *ifp, int >                  bcopy(lladdr, desten, ll_len); >                  if (pflags != NULL) >                          *pflags = lle->la_flags; > + if (plle) { > + LLE_ADDREF(lle); > + *plle = lle; > + } >                  LLE_WUNLOCK(lle); >                  return (0); >          } > @@ -2405,7 +2411,7 @@ nd6_resolve_addr(struct ifnet *ifp, int > >          flags |= LLE_ADDRONLY; >          error = nd6_resolve_slow(ifp, flags, NULL, > - (const struct sockaddr_in6 *)dst, desten, pflags); > + (const struct sockaddr_in6 *)dst, desten, pflags, NULL); >          return (error); >  } > > Modified: head/sys/netinet6/nd6.h > ============================================================================== > --- head/sys/netinet6/nd6.h Thu Jun 2 17:31:37 2016 (r301216) > +++ head/sys/netinet6/nd6.h Thu Jun 2 17:51:29 2016 (r301217) > @@ -428,7 +428,7 @@ void nd6_purge(struct ifnet *); >  int nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, >      char *desten, uint32_t *pflags); >  int nd6_resolve(struct ifnet *, int, struct mbuf *, > - const struct sockaddr *, u_char *, uint32_t *); > + const struct sockaddr *, u_char *, uint32_t *, struct llentry **); >  int nd6_ioctl(u_long, caddr_t, struct ifnet *); >  void nd6_cache_lladdr(struct ifnet *, struct in6_addr *, >          char *, int, int, int); From owner-svn-src-head@freebsd.org Sat Jun 4 19:31:08 2016 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 B6AD5B684FC; Sat, 4 Jun 2016 19:31:08 +0000 (UTC) (envelope-from landonf@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 mx1.freebsd.org (Postfix) with ESMTPS id 748D31C29; Sat, 4 Jun 2016 19:31:08 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54JV7qL005527; Sat, 4 Jun 2016 19:31:07 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54JV76d005520; Sat, 4 Jun 2016 19:31:07 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606041931.u54JV76d005520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 4 Jun 2016 19:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301408 - in head/sys/dev/bhnd: . cores/chipc 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.22 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: Sat, 04 Jun 2016 19:31:08 -0000 Author: landonf Date: Sat Jun 4 19:31:06 2016 New Revision: 301408 URL: https://svnweb.freebsd.org/changeset/base/301408 Log: Fix several MIPS/BCM-blocking bugs in bhnd(4) chipc - Correct IRQ lines for UART (to fix IRQ lookup in future) - Check device unit in resource assignment during chipc_add_child - If chipc hint->size is RM_MAX_END, resource end should be same as window end - Clear reference from resource list entry to resource in case of resource release - Add CHIPC_GET_CAPS implementation - Correct chipc flash constants (to be unshifted) - Default implementation of get_attach_type should iterate over device tree - Add default implementation for BHND_CHIPC_GET_CAPS usable by chipc grandchildren Submitted by: Michael Zhilin Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6584 Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipcreg.h Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sat Jun 4 19:00:11 2016 (r301407) +++ head/sys/dev/bhnd/bhnd.h Sat Jun 4 19:31:06 2016 (r301408) @@ -356,6 +356,8 @@ int bhnd_bus_generic_activate_resour int bhnd_bus_generic_deactivate_resource (device_t dev, device_t child, int type, int rid, struct bhnd_resource *r); +bhnd_attach_type bhnd_bus_generic_get_attach_type(device_t dev, + device_t child); Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 4 19:00:11 2016 (r301407) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 4 19:31:06 2016 (r301408) @@ -55,12 +55,6 @@ CODE { panic("bhnd_bus_get_chipid unimplemented"); } - static bhnd_attach_type - bhnd_bus_null_get_attach_type(device_t dev, device_t child) - { - panic("bhnd_bus_get_attach_type unimplemented"); - } - static int bhnd_bus_null_read_board_info(device_t dev, device_t child, struct bhnd_board_info *info) @@ -203,7 +197,7 @@ METHOD const struct bhnd_chipid * get_ch METHOD bhnd_attach_type get_attach_type { device_t dev; device_t child; -} DEFAULT bhnd_bus_null_get_attach_type; +} DEFAULT bhnd_bus_generic_get_attach_type; /** * Attempt to read the BHND board identification from the parent bus. Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Sat Jun 4 19:00:11 2016 (r301407) +++ head/sys/dev/bhnd/bhnd_subr.c Sat Jun 4 19:31:06 2016 (r301408) @@ -1158,3 +1158,22 @@ bhnd_bus_generic_deactivate_resource(dev return (EINVAL); }; + +/** + * Helper function for implementing BHND_BUS_GET_ATTACH_TYPE(). + * + * This implementation of BHND_BUS_GET_ATTACH_TYPE() simply calls the + * BHND_BUS_GET_ATTACH_TYPE() method of the parent of @p dev. + */ +bhnd_attach_type +bhnd_bus_generic_get_attach_type(device_t dev, device_t child) +{ + /* iterate from cores via bhnd to bridge or SoC */ + if (device_get_parent(dev) != NULL) + return (BHND_BUS_GET_ATTACH_TYPE(device_get_parent(dev), + child)); + + panic("bhnd_bus_get_attach_type unimplemented"); + /* Unreachable */ + return (BHND_ATTACH_ADAPTER); +} Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 4 19:00:11 2016 (r301407) +++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 4 19:31:06 2016 (r301408) @@ -39,6 +39,29 @@ INTERFACE bhnd_chipc; HEADER { /* forward declarations */ struct chipc_caps; + struct chipc_caps *bhnd_chipc_generic_get_caps(device_t dev); +} + +CODE { + + /** + * Helper function for implementing BHND_CHIPC_GET_CAPS(). + * + * This implementation of BHND_CHIPC_GET_CAPS() simply calls the + * BHND_CHIPC_GET_CAPS() method of the parent of @p dev. + */ + struct chipc_caps* + bhnd_chipc_generic_get_caps(device_t dev) + { + + if (device_get_parent(dev) != NULL) + return (BHND_CHIPC_GET_CAPS(device_get_parent(dev))); + + panic("bhnd_chipc_generic_get_caps unimplemented"); + /* Unreachable */ + return (NULL); + } + } /** @@ -77,7 +100,7 @@ METHOD void write_chipctrl { */ METHOD struct chipc_caps * get_caps { device_t dev; -} +} DEFAULT bhnd_chipc_generic_get_caps; /** * Enable hardware access to the SPROM. Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 4 19:00:11 2016 (r301407) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 4 19:31:06 2016 (r301408) @@ -110,12 +110,13 @@ static const struct chipc_hint { u_int region; } chipc_hints[] = { // FIXME: cfg/spi port1.1 mapping on siba(4) SoCs + // FIXME: IRQ shouldn't be hardcoded /* device unit type rid base size port,region */ { "bhnd_nvram", 0, SYS_RES_MEMORY, 0, CHIPC_SPROM_OTP, CHIPC_SPROM_OTP_SIZE, 0,0 }, { "uart", 0, SYS_RES_MEMORY, 0, CHIPC_UART0_BASE, CHIPC_UART_SIZE, 0,0 }, - { "uart", 0, SYS_RES_IRQ, 0, 0, RM_MAX_END }, + { "uart", 0, SYS_RES_IRQ, 0, 2, 1 }, { "uart", 1, SYS_RES_MEMORY, 0, CHIPC_UART1_BASE, CHIPC_UART_SIZE, 0,0 }, - { "uart", 1, SYS_RES_IRQ, 0, 0, RM_MAX_END }, + { "uart", 1, SYS_RES_IRQ, 0, 2, 1 }, { "spi", 0, SYS_RES_MEMORY, 0, 0, RM_MAX_END, 1,1 }, { "spi", 0, SYS_RES_MEMORY, 1, CHIPC_SFLASH_BASE, CHIPC_SFLASH_SIZE, 0,0 }, { "cfi", 0, SYS_RES_MEMORY, 0, 0, RM_MAX_END, 1,1}, @@ -480,12 +481,30 @@ chipc_add_child(device_t dev, u_int orde struct chipc_devinfo *dinfo; const struct chipc_hint *hint; device_t child; + devclass_t child_dc; int error; + int busrel_unit; child = device_add_child_ordered(dev, order, name, unit); if (child == NULL) return (NULL); + /* system-wide device unit */ + unit = device_get_unit(child); + child_dc = device_get_devclass(child); + + busrel_unit = 0; + for (int i = 0; i < unit; i++) { + device_t tmp; + + tmp = devclass_get_device(child_dc, i); + if (tmp != NULL && (device_get_parent(tmp) == dev)) + busrel_unit++; + } + + /* bus-wide device unit (override unit for further hint matching) */ + unit = busrel_unit; + dinfo = malloc(sizeof(struct chipc_devinfo), M_BHND, M_NOWAIT); if (dinfo == NULL) { device_delete_child(dev, child); @@ -504,9 +523,14 @@ chipc_add_child(device_t dev, u_int orde bhnd_addr_t region_addr; bhnd_size_t region_size; + /* Check device name */ if (strcmp(hint->name, name) != 0) continue; + /* Check device unit */ + if (hint->unit >= 0 && unit != hint->unit) + continue; + switch (hint->type) { case SYS_RES_IRQ: /* Add child resource */ @@ -535,8 +559,9 @@ chipc_add_child(device_t dev, u_int orde /* Verify requested range is mappable */ if (hint->base > region_size || - hint->size > region_size || - region_size - hint->base < hint->size ) + (hint->size != RM_MAX_END && + (hint->size > region_size || + region_size - hint->base < hint->size ))) { device_printf(dev, "%s%u.%u region cannot map requested range " @@ -546,9 +571,17 @@ chipc_add_child(device_t dev, u_int orde hint->size); } - /* Add child resource */ - error = bus_set_resource(child, hint->type, - hint->rid, region_addr + hint->base, hint->size); + /* + * Add child resource. If hint doesn't define the end + * of resource window (RX_MAX_END), use end of region. + */ + + error = bus_set_resource(child, + hint->type, + hint->rid, region_addr + hint->base, + (hint->size == RM_MAX_END) ? + region_size - hint->base : + hint->size); if (error) { device_printf(dev, "bus_set_resource() failed for %s: %d\n", @@ -754,8 +787,10 @@ chipc_alloc_resource(device_t dev, devic if (rle->res != NULL) { device_printf(dev, - "resource entry %#x type %d for child %s is busy\n", - *rid, type, device_get_nameunit(child)); + "resource entry %#x type %d for child %s is busy " + "[%d]\n", + *rid, type, device_get_nameunit(child), + rman_get_flags(rle->res)); return (NULL); } @@ -821,10 +856,11 @@ static int chipc_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - struct chipc_softc *sc; - struct chipc_region *cr; - struct rman *rm; - int error; + struct chipc_softc *sc; + struct chipc_region *cr; + struct rman *rm; + struct resource_list_entry *rle; + int error; sc = device_get_softc(dev); @@ -853,6 +889,11 @@ chipc_release_resource(device_t dev, dev /* Drop allocation reference */ chipc_release_region(sc, cr, RF_ALLOCATED); + /* Clear reference from the resource list entry if exists */ + rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), type, rid); + if (rle != NULL) + rle->res = NULL; + return (0); } @@ -1238,6 +1279,15 @@ chipc_write_chipctrl(device_t dev, uint3 CHIPC_UNLOCK(sc); } +static struct chipc_caps * +chipc_get_caps(device_t dev) +{ + struct chipc_softc *sc; + + sc = device_get_softc(dev); + return (&sc->caps); +} + static device_method_t chipc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, chipc_probe), @@ -1279,6 +1329,7 @@ static device_method_t chipc_methods[] = DEVMETHOD(bhnd_chipc_write_chipctrl, chipc_write_chipctrl), DEVMETHOD(bhnd_chipc_enable_sprom, chipc_enable_sprom_pins), DEVMETHOD(bhnd_chipc_disable_sprom, chipc_disable_sprom_pins), + DEVMETHOD(bhnd_chipc_get_caps, chipc_get_caps), DEVMETHOD_END }; Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcreg.h Sat Jun 4 19:00:11 2016 (r301407) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.h Sat Jun 4 19:31:06 2016 (r301408) @@ -240,11 +240,11 @@ #define CHIPC_CAP_EXTBUS_PROG 0x2 /* ExtBus: ProgIf only */ #define CHIPC_CAP_FLASH_MASK 0x00000700 /* Type of flash */ #define CHIPC_CAP_FLASH_SHIFT 8 -#define CHIPC_CAP_FLASH_NONE 0x000 /* No flash */ -#define CHIPC_CAP_SFLASH_ST 0x100 /* ST serial flash */ -#define CHIPC_CAP_SFLASH_AT 0x200 /* Atmel serial flash */ -#define CHIPC_CAP_NFLASH 0x300 /* NAND flash */ -#define CHIPC_CAP_PFLASH 0x700 /* Parallel flash */ +#define CHIPC_CAP_FLASH_NONE 0x0 /* No flash */ +#define CHIPC_CAP_SFLASH_ST 0x1 /* ST serial flash */ +#define CHIPC_CAP_SFLASH_AT 0x2 /* Atmel serial flash */ +#define CHIPC_CAP_NFLASH 0x3 /* NAND flash */ +#define CHIPC_CAP_PFLASH 0x7 /* Parallel flash */ #define CHIPC_CAP_PLL_MASK 0x00038000 /* Type of PLL */ #define CHIPC_CAP_PLL_SHIFT 15 #define CHIPC_CAP_PWR_CTL 0x00040000 /* Power control */ From owner-svn-src-head@freebsd.org Sat Jun 4 19:39:07 2016 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 26656B687E9; Sat, 4 Jun 2016 19:39:07 +0000 (UTC) (envelope-from landonf@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 mx1.freebsd.org (Postfix) with ESMTPS id E5B1210D8; Sat, 4 Jun 2016 19:39:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54Jd6jT009054; Sat, 4 Jun 2016 19:39:06 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54Jd5vL009046; Sat, 4 Jun 2016 19:39:05 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606041939.u54Jd5vL009046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 4 Jun 2016 19:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301409 - in head/sys: dev/bhnd/cores/chipc mips/broadcom 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.22 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: Sat, 04 Jun 2016 19:39:07 -0000 Author: landonf Date: Sat Jun 4 19:39:05 2016 New Revision: 301409 URL: https://svnweb.freebsd.org/changeset/base/301409 Log: bhnd(4): Add support for chipc-attached flash This adds support for serial (via SPI) and parallel (via CFI) flash as found on BCM47xx/BCM53xx SoCs. Submitted by: Michael Zhilin Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6250 Added: head/sys/dev/bhnd/cores/chipc/chipc_cfi.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_slicer.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_slicer.h (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_spi.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_spi.h (contents, props changed) Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/mips/broadcom/uart_bus_chipc.c Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 4 19:31:06 2016 (r301408) +++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 4 19:39:05 2016 (r301409) @@ -28,7 +28,6 @@ #include #include -#include INTERFACE bhnd_chipc; @@ -37,6 +36,7 @@ INTERFACE bhnd_chipc; # HEADER { + #include /* forward declarations */ struct chipc_caps; struct chipc_caps *bhnd_chipc_generic_get_caps(device_t dev); @@ -123,3 +123,12 @@ METHOD int enable_sprom { METHOD void disable_sprom { device_t dev; } + +/** + * Return the flash configuration register value + * + * @param dev A bhnd(4) ChipCommon device + */ +METHOD uint32_t get_flash_cfg { + device_t dev; +} Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 4 19:31:06 2016 (r301408) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 4 19:39:05 2016 (r301409) @@ -39,19 +39,36 @@ __FBSDID("$FreeBSD$"); * and bcma(4) interconnects, providing a common interface to chipset * identification, bus enumeration, UARTs, clocks, watchdog interrupts, GPIO, * flash, etc. + * + * The purpose of this driver is memory resource management for ChipCommon drivers + * like UART, PMU, flash. ChipCommon core has several memory regions. + * + * ChipCommon driver has memory resource manager. Driver + * gets information about BHND core ports/regions and map them + * into drivers' resources. + * + * Here is overview of mapping: + * + * ------------------------------------------------------ + * | Port.Region| Purpose | + * ------------------------------------------------------ + * | 0.0 | PMU, SPI(0x40), UART(0x300) | + * | 1.0 | ? | + * | 1.1 | MMIO flash (SPI & CFI) | + * ------------------------------------------------------ */ #include #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -99,6 +116,18 @@ static struct bhnd_device_quirk chipc_qu }; +/* + * Here is resource configuration hints for child devices + * + * [Flash] There are 2 flash resources: + * - resource ID (rid) = 0: memory-mapped flash memory + * - resource ID (rid) = 1: memory-mapped flash registers (i.e for SPI) + * + * [UART] Uses IRQ and memory resources: + * - resource ID (rid) = 0: memory-mapped registers + * - IRQ resource ID (rid) = 0: shared IRQ line for Tx/Rx. + */ + static const struct chipc_hint { const char *name; int unit; @@ -1288,6 +1317,15 @@ chipc_get_caps(device_t dev) return (&sc->caps); } +static uint32_t +chipc_get_flash_cfg(device_t dev) +{ + struct chipc_softc *sc; + + sc = device_get_softc(dev); + return (bhnd_bus_read_4(sc->core, CHIPC_FLASH_CFG)); +} + static device_method_t chipc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, chipc_probe), @@ -1330,11 +1368,13 @@ static device_method_t chipc_methods[] = DEVMETHOD(bhnd_chipc_enable_sprom, chipc_enable_sprom_pins), DEVMETHOD(bhnd_chipc_disable_sprom, chipc_disable_sprom_pins), DEVMETHOD(bhnd_chipc_get_caps, chipc_get_caps), + DEVMETHOD(bhnd_chipc_get_flash_cfg, chipc_get_flash_cfg), DEVMETHOD_END }; DEFINE_CLASS_0(bhnd_chipc, chipc_driver, chipc_methods, sizeof(struct chipc_softc)); -DRIVER_MODULE(bhnd_chipc, bhnd, chipc_driver, bhnd_chipc_devclass, 0, 0); +EARLY_DRIVER_MODULE(bhnd_chipc, bhnd, chipc_driver, bhnd_chipc_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_DEPEND(bhnd_chipc, bhnd, 1, 1, 1); MODULE_VERSION(bhnd_chipc, 1); Added: head/sys/dev/bhnd/cores/chipc/chipc_cfi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_cfi.c Sat Jun 4 19:39:05 2016 (r301409) @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "bhnd_chipc_if.h" +#include "chipc_slicer.h" +#include "chipcreg.h" +#include "chipcvar.h" + +/* + * **************************** PROTOTYPES **************************** + */ + +static void chipc_cfi_identify(driver_t *driver, device_t parent); +static int chipc_cfi_probe(device_t dev); +static int chipc_cfi_attach(device_t dev); + +/* + * **************************** IMPLEMENTATION ************************ + */ + +static void +chipc_cfi_identify(driver_t *driver, device_t parent) +{ + struct chipc_caps *caps; + + if (device_find_child(parent, cfi_driver_name, -1) != NULL) + return; + + caps = BHND_CHIPC_GET_CAPS(parent); + if (caps == NULL) + return; + + if (caps->flash_type != CHIPC_PFLASH_CFI) + return; + + BUS_ADD_CHILD(parent, 0, cfi_driver_name, -1); + return; +} + +static int +chipc_cfi_probe(device_t dev) +{ + int error; + int enabled; + int byteswap; + uint32_t flash_config; + struct cfi_softc *sc; + + sc = device_get_softc(dev); + + flash_config = BHND_CHIPC_GET_FLASH_CFG(device_get_parent(dev)); + + enabled = (flash_config & CHIPC_CF_EN); + byteswap = (flash_config & CHIPC_CF_BS); + + if (enabled == 0) + device_disable(dev); + + BHND_DEBUG_DEV(dev, "trying attach flash enabled=%d swapbytes=%d", + enabled, byteswap); + + sc->sc_width = 0; + error = cfi_probe(dev); + if (error == 0) + device_set_desc(dev, "ChipCommon CFI"); + return (error); +} + +static int +chipc_cfi_attach(device_t dev) +{ + int error; + + error = cfi_attach(dev); + if (error) + return (error); + + flash_register_slicer(chipc_slicer_cfi); + return (0); +} + +static device_method_t chipc_cfi_methods[] = { + /* device interface */ + DEVMETHOD(device_identify, chipc_cfi_identify), + DEVMETHOD(device_probe, chipc_cfi_probe), + DEVMETHOD(device_attach, chipc_cfi_attach), + DEVMETHOD(device_detach, cfi_detach), + + {0, 0} +}; + +static driver_t chipc_cfi_driver = { + cfi_driver_name, + chipc_cfi_methods, + sizeof(struct cfi_softc), +}; + +DRIVER_MODULE(cfi, bhnd_chipc, chipc_cfi_driver, cfi_devclass, 0, 0); + Added: head/sys/dev/bhnd/cores/chipc/chipc_slicer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_slicer.c Sat Jun 4 19:39:05 2016 (r301409) @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Slicer is required to split firmware images into pieces. + * The first supported FW is TRX-based used by Asus routers + * TODO: add NetGear FW (CHK) + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "chipc_slicer.h" + +#include +#include "chipc_spi.h" + +static int chipc_slicer_walk(device_t dev, struct resource* res, + struct flash_slice *slices, int *nslices); + +int +chipc_slicer_cfi(device_t dev, struct flash_slice *slices, int *nslices) +{ + struct cfi_softc *sc; + + if (strcmp("cfi", device_get_name(dev)) != 0) + return (0); + + sc = device_get_softc(dev); + + return (chipc_slicer_walk(dev, sc->sc_res, slices, nslices)); +} + +int +chipc_slicer_spi(device_t dev, struct flash_slice *slices, int *nslices) +{ + /* flash(mx25l) <- spibus <- chipc_spi */ + device_t spibus; + device_t chipc_spi; + struct chipc_spi_softc *sc; + + BHND_DEBUG_DEV(dev, "initting SPI slicer: %s", device_get_name(dev)); + + if (strcmp("mx25l", device_get_name(dev)) != 0) + return (EINVAL); + + spibus = device_get_parent(dev); + if (spibus == NULL) { + BHND_ERROR_DEV(dev, "no found ChipCommon SPI BUS device"); + return (EINVAL); + } + + chipc_spi = device_get_parent(spibus); + if (chipc_spi == NULL) { + BHND_ERROR_DEV(spibus, "no found ChipCommon SPI device"); + return (EINVAL); + } + + sc = device_get_softc(chipc_spi); + + return (chipc_slicer_walk(dev, sc->sc_res, slices, nslices)); +} + +/* + * Main processing part + */ +static int +chipc_slicer_walk(device_t dev, struct resource* res, + struct flash_slice *slices, int *nslices) +{ + uint32_t fw_len; + uint32_t fs_ofs; + uint32_t val; + uint32_t ofs_trx; + int flash_size; + + *nslices = 0; + + flash_size = rman_get_size(res); + ofs_trx = flash_size; + + BHND_TRACE_DEV(dev, "slicer: scanning memory [%x bytes] for headers...", + flash_size); + + /* Find FW header in flash memory with step=128Kb (0x1000) */ + for(uint32_t ofs = 0; ofs < flash_size; ofs+= 0x1000){ + val = bus_read_4(res, ofs); + switch (val) { + case TRX_MAGIC: + /* check for second TRX */ + if (ofs_trx < ofs) { + BHND_TRACE_DEV(dev, "stop on 2nd TRX: %x", ofs); + break; + } + + BHND_TRACE("TRX found: %x", ofs); + ofs_trx = ofs; + /* read last offset of TRX header */ + fs_ofs = bus_read_4(res, ofs + 24); + BHND_TRACE("FS offset: %x", fs_ofs); + + /* + * GEOM IO will panic if offset is not aligned + * on sector size, i.e. 512 bytes + */ + if (fs_ofs % 0x200 != 0) { + BHND_WARN("WARNING! filesystem offset should be" + " aligned on sector size (%d bytes)", 0x200); + BHND_WARN("ignoring TRX firmware image"); + break; + } + + slices[*nslices].base = ofs + fs_ofs; + //XXX: fully sized? any other partition? + fw_len = bus_read_4(res, ofs + 4); + slices[*nslices].size = fw_len - fs_ofs; + slices[*nslices].label = "rootfs"; + *nslices += 1; + break; + case CFE_MAGIC: + BHND_TRACE("CFE found: %x", ofs); + break; + case NVRAM_MAGIC: + BHND_TRACE("NVRAM found: %x", ofs); + break; + default: + break; + } + } + + BHND_TRACE("slicer: done"); + return (0); +} Added: head/sys/dev/bhnd/cores/chipc/chipc_slicer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_slicer.h Sat Jun 4 19:39:05 2016 (r301409) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef _BHND_CORES_CHIPC_CHIPC_SLICER_H_ +#define _BHND_CORES_CHIPC_CHIPC_SLICER_H_ + +#include + +#define TRX_MAGIC 0x30524448 +#define CFE_MAGIC 0x43464531 +#define NVRAM_MAGIC 0x48534C46 + +int chipc_slicer_spi(device_t dev, struct flash_slice *slices, + int *nslices); +int chipc_slicer_cfi(device_t dev, struct flash_slice *slices, + int *nslices); + +#endif /* _BHND_CORES_CHIPC_CHIPC_SLICER_H_ */ Added: head/sys/dev/bhnd/cores/chipc/chipc_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_spi.c Sat Jun 4 19:39:05 2016 (r301409) @@ -0,0 +1,280 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +/* + * SPI BUS interface + */ +#include + +#include "spibus_if.h" + +#include "chipcreg.h" +#include "chipcvar.h" +#include "chipc_spi.h" +#include "bhnd_chipc_if.h" + +/* + * Flash slicer + */ +#include "chipc_slicer.h" + +/* + * **************************** PROTOTYPES **************************** + */ + +static void chipc_spi_identify(driver_t *driver, device_t parent); +static int chipc_spi_probe(device_t dev); +static int chipc_spi_attach(device_t dev); +static int chipc_spi_transfer(device_t dev, device_t child, + struct spi_command *cmd); +static int chipc_spi_txrx(struct chipc_spi_softc *sc, uint8_t in, + uint8_t* out); +static int chipc_spi_wait(struct chipc_spi_softc *sc); + +/* + * **************************** IMPLEMENTATION ************************ + */ + +static void +chipc_spi_identify(driver_t *driver, device_t parent) +{ + struct chipc_caps *caps; + device_t spidev; + device_t spibus; + device_t flash; + char* flash_name; + int err; + + flash_name = NULL; + + if (device_find_child(parent, "spi", -1) != NULL) + return; + + caps = BHND_CHIPC_GET_CAPS(parent); + if (caps == NULL) { + BHND_ERROR_DEV(parent, "can't retrieve ChipCommon capabilities"); + return; + } + + switch (caps->flash_type) { + case CHIPC_SFLASH_AT: + flash_name = "at45d"; + break; + case CHIPC_SFLASH_ST: + flash_name = "mx25l"; + break; + default: + return; + } + + spidev = BUS_ADD_CHILD(parent, 0, "spi", -1); + if (spidev == NULL) { + BHND_ERROR_DEV(parent, "can't add chipc_spi to ChipCommon"); + return; + } + + err = device_probe_and_attach(spidev); + if (err) { + BHND_ERROR_DEV(spidev, "failed attach chipc_spi: %d", err); + return; + } + + spibus = device_find_child(spidev, "spibus", -1); + if (spibus == NULL) { + BHND_ERROR_DEV(spidev, "can't find spibus under chipc_spi"); + return; + } + + flash = BUS_ADD_CHILD(spibus, 0, flash_name, -1); + if (flash == NULL) { + BHND_ERROR_DEV(spibus, "can't add %s to spibus", flash_name); + return; + } + + err = device_probe_and_attach(flash); + if (err) + BHND_ERROR_DEV(flash, "failed attach flash %s: %d", flash_name, + err); + + return; +} + +static int +chipc_spi_probe(device_t dev) +{ + device_set_desc(dev, "ChipCommon SPI"); + return (BUS_PROBE_DEFAULT); +} + +struct resource_spec spec_mem[] = { + {SYS_RES_MEMORY, 0, RF_ACTIVE}, + {SYS_RES_MEMORY, 1, RF_ACTIVE}, + { -1, -1, 0 } + }; + +static int +chipc_spi_attach(device_t dev) +{ + int err; + struct chipc_spi_softc *sc; + struct resource *mem[2]; + + sc = device_get_softc(dev); + err = bus_alloc_resources(dev, spec_mem, mem); + if (err != 0) + return (ENXIO); + + sc->sc_res = mem[0]; + sc->sc_mem_res = mem[1]; + + flash_register_slicer(chipc_slicer_spi); + device_add_child(dev, "spibus", 0); + return (bus_generic_attach(dev)); +} + +static int +chipc_spi_wait(struct chipc_spi_softc *sc) +{ + int i; + + for (i = CHIPC_SPI_MAXTRIES; i > 0; i--) + if (!(SPI_READ(sc, CHIPC_SPI_FLASHCTL) & CHIPC_SPI_FLASHCTL_START)) + break; + + if (i > 0) + return (0); + + BHND_DEBUG_DEV(sc->dev, "busy"); + return (-1); +} + +static int +chipc_spi_txrx(struct chipc_spi_softc *sc, uint8_t out, uint8_t* in) +{ + uint32_t ctl; + + ctl = CHIPC_SPI_FLASHCTL_START | CHIPC_SPI_FLASHCTL_CSACTIVE | out; + SPI_BARRIER_WRITE(sc); + SPI_WRITE(sc, CHIPC_SPI_FLASHCTL, ctl); + SPI_BARRIER_WRITE(sc); + + if (chipc_spi_wait(sc)) + return (-1); + + *in = SPI_READ(sc, CHIPC_SPI_FLASHDATA) & 0xff; + return (0); +} + +static int +chipc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct chipc_spi_softc *sc; + uint8_t *buf_in; + uint8_t *buf_out; + int i; + + sc = device_get_softc(dev); + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + if (cmd->tx_cmd_sz == 0) { + BHND_DEBUG_DEV(child, "size of command is ZERO"); + return (EIO); + } + + SPI_BARRIER_WRITE(sc); + SPI_WRITE(sc, CHIPC_SPI_FLASHADDR, 0); + SPI_BARRIER_WRITE(sc); + + /* + * Transfer command + */ + buf_out = (uint8_t *)cmd->tx_cmd; + buf_in = (uint8_t *)cmd->rx_cmd; + for (i = 0; i < cmd->tx_cmd_sz; i++) + if (chipc_spi_txrx(sc, buf_out[i], &(buf_in[i]))) + return (EIO); + + /* + * Receive/transmit data + */ + buf_out = (uint8_t *)cmd->tx_data; + buf_in = (uint8_t *)cmd->rx_data; + for (i = 0; i < cmd->tx_data_sz; i++) + if (chipc_spi_txrx(sc, buf_out[i], &(buf_in[i]))) + return (EIO); + + /* + * Clear CS bit and whole control register + */ + SPI_BARRIER_WRITE(sc); + SPI_WRITE(sc, CHIPC_SPI_FLASHCTL, 0); + SPI_BARRIER_WRITE(sc); + + return (0); +} + +/* + * **************************** METADATA ************************ + */ +static device_method_t chipc_spi_methods[] = { + DEVMETHOD(device_identify, chipc_spi_identify), + DEVMETHOD(device_probe, chipc_spi_probe), + DEVMETHOD(device_attach, chipc_spi_attach), + /* SPI */ + DEVMETHOD(spibus_transfer, chipc_spi_transfer), + DEVMETHOD_END +}; + +static driver_t chipc_spi_driver = { + "spi", + chipc_spi_methods, + sizeof(struct chipc_spi_softc), +}; + +static devclass_t chipc_spi_devclass; + +DRIVER_MODULE(chipc_spi, bhnd_chipc, chipc_spi_driver, chipc_spi_devclass, + 0, 0); Added: head/sys/dev/bhnd/cores/chipc/chipc_spi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_spi.h Sat Jun 4 19:39:05 2016 (r301409) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +/* + * $FreeBSD$ + */ + +#ifndef _BHND_CORES_CHIPC_CHIPC_SPI_H_ +#define _BHND_CORES_CHIPC_CHIPC_SPI_H_ + +#define CHIPC_SPI_MAXTRIES 1000 + +#define CHIPC_SPI_ACTION_INPUT 1 +#define CHIPC_SPI_ACTION_OUTPUT 2 + +#define CHIPC_SPI_FLASHCTL 0x00 +#define CHIPC_SPI_FLASHCTL_OPCODE 0x000000ff +#define CHIPC_SPI_FLASHCTL_ACTION 0x00000700 // +/* + * We don't use action at all. Experimentaly found, that + * action 0 - read current MISO byte to data register (interactive mode) + * action 1 = read 2nd byte to data register + * action 2 = read 4th byte to data register (surprise! see action 6) + * action 3 = read 5th byte to data register + * action 4 = read bytes 5-8 to data register in swapped order + * action 5 = read bytes 9-12 to data register in swapped order + * action 6 = read 3rd byte to data register + * action 7 = read bytes 6-9 to data register in swapped order + * It may be wrong if CS bit is 1. + * If CS bit is 1, you should write cmd / data to opcode byte-to-byte. + */ +#define CHIPC_SPI_FLASHCTL_CSACTIVE 0x00001000 +#define CHIPC_SPI_FLASHCTL_START 0x80000000 //same as BUSY +#define CHIPC_SPI_FLASHCTL_BUSY 0x80000000 //same as BUSY +#define CHIPC_SPI_FLASHADDR 0x04 +#define CHIPC_SPI_FLASHDATA 0x08 + +struct chipc_spi_softc { + device_t dev; + + /* SPI registers */ + struct resource *sc_mem_res; + + /* MMIO flash */ + struct resource *sc_res; +}; + +/* register space access macros */ +#define SPI_BARRIER_WRITE(sc) bus_barrier((sc)->sc_mem_res, 0, 0, \ + BUS_SPACE_BARRIER_WRITE) +#define SPI_BARRIER_READ(sc) bus_barrier((sc)->sc_mem_res, 0, 0, \ + BUS_SPACE_BARRIER_READ) +#define SPI_BARRIER_RW(sc) bus_barrier((sc)->sc_mem_res, 0, 0, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE) + +#define SPI_WRITE(sc, reg, val) do { \ + bus_write_4(sc->sc_mem_res, (reg), (val)); \ + } while (0) + +#define SPI_READ(sc, reg) bus_read_4(sc->sc_mem_res, (reg)) + +#define SPI_SET_BITS(sc, reg, bits) \ + SPI_WRITE(sc, reg, SPI_READ(sc, (reg)) | (bits)) + +#define SPI_CLEAR_BITS(sc, reg, bits) \ + SPI_WRITE(sc, reg, SPI_READ(sc, (reg)) & ~(bits)) + +#endif /* _BHND_CORES_CHIPC_CHIPC_SPI_H_ */ Modified: head/sys/mips/broadcom/uart_bus_chipc.c ============================================================================== --- head/sys/mips/broadcom/uart_bus_chipc.c Sat Jun 4 19:31:06 2016 (r301408) +++ head/sys/mips/broadcom/uart_bus_chipc.c Sat Jun 4 19:39:05 2016 (r301409) @@ -45,9 +45,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "uart_if.h" #include "bhnd_chipc_if.h" + static int uart_chipc_probe(device_t dev); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -55,9 +58,18 @@ extern SLIST_HEAD(uart_devinfo_list, uar static void uart_chipc_identify(driver_t *driver, device_t parent) { - struct chipc_capabilities *caps; + struct chipc_caps *caps; - caps = BHND_CHIPC_GET_CAPABILITIES(parent); + if (device_find_child(parent, "uart", -1) != NULL) + return; + + caps = BHND_CHIPC_GET_CAPS(parent); + + if (caps == NULL) { + device_printf(parent, "error: can't retrieve ChipCommon " + "capabilities\n"); + return; + } if (caps->num_uarts == 0) return; @@ -74,6 +86,7 @@ uart_chipc_probe(device_t dev) struct uart_softc *sc; struct resource *res; int rid; + int err; rid = 0; res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -97,7 +110,11 @@ uart_chipc_probe(device_t dev) sc->sc_bas.bst = sc->sc_sysdev->bas.bst; sc->sc_bas.bsh = sc->sc_sysdev->bas.bsh; - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + err = bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + if (err) { + device_printf(dev, "can't release resource [%d]\n", rid); + return (ENXIO); + } /* We use internal SoC clock generator with non-standart freq MHz */ return (uart_bus_probe(dev, 0, sc->sc_sysdev->bas.rclk, 0, 0)); From owner-svn-src-head@freebsd.org Sat Jun 4 19:53:49 2016 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 E2EEFB68D73; Sat, 4 Jun 2016 19:53:49 +0000 (UTC) (envelope-from landonf@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 mx1.freebsd.org (Postfix) with ESMTPS id AC31A1CCA; Sat, 4 Jun 2016 19:53:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54Jrmp9016316; Sat, 4 Jun 2016 19:53:48 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54JrmWA016305; Sat, 4 Jun 2016 19:53:48 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606041953.u54JrmWA016305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 4 Jun 2016 19:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301410 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/siba dev/bhnd/soc dev/siba mips/broadcom mips/conf 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.22 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: Sat, 04 Jun 2016 19:53:50 -0000 Author: landonf Date: Sat Jun 4 19:53:47 2016 New Revision: 301410 URL: https://svnweb.freebsd.org/changeset/base/301410 Log: Switch mips/sentry5 to bhnd(4), and unify with mips/broadcom Now that bhnd(4) provides feature parity with the previous siba/mips implementation, we can switch sentry5 over and begin lifting common support code out for use across bhnd(4) embedded targets. Changes: - Fixed enumeration of siba(4) per-core address maps, required for discovery of memory mapped chipc flash region on siba(4) devices. - Simplified bhnd kernel configuration (dropped 'bhndbus' option). - Replaced files.broadcom's direct file references with their corresponding standard kernel options. - Lifted out common bcma/siba nexus support, inheriting from the new generic bhnd_nexus driver. - Dropped now-unused sentry5 siba code. - Re-integrated BCM into the universe build now that it actually compiles. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6712 Added: head/sys/dev/bhnd/bhnd_nexus.c (contents, props changed) head/sys/dev/bhnd/bhnd_nexusvar.h - copied, changed from r301409, head/sys/dev/bhnd/soc/bhnd_soc.h Deleted: head/sys/dev/bhnd/soc/bhnd_soc.c head/sys/dev/bhnd/soc/bhnd_soc.h head/sys/dev/siba/siba_cc.c head/sys/dev/siba/siba_mips.c head/sys/dev/siba/siba_pcib.c head/sys/dev/siba/siba_pcibvar.h Modified: head/sys/conf/files head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_nexus.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/mips/broadcom/files.broadcom head/sys/mips/conf/BCM head/sys/mips/conf/BCM.hints head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SENTRY5.hints Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/conf/files Sat Jun 4 19:53:47 2016 (r301410) @@ -9,12 +9,12 @@ acpi_quirks.h optional acpi \ compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ no-obj no-implicit-rule before-depend \ clean "acpi_quirks.h" -bhnd_nvram_map.h optional bhndbus | bhnd \ +bhnd_nvram_map.h optional bhnd \ dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \ no-obj no-implicit-rule before-depend \ clean "bhnd_nvram_map.h" -bhnd_nvram_map_data.h optional bhndbus | bhnd \ +bhnd_nvram_map_data.h optional bhnd \ dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ no-obj no-implicit-rule before-depend \ @@ -1127,40 +1127,46 @@ dev/ath/ath_dfs/null/dfs_null.c optional dev/bce/if_bce.c optional bce dev/bfe/if_bfe.c optional bfe dev/bge/if_bge.c optional bge -dev/bhnd/bhnd.c optional bhndbus | bhnd -dev/bhnd/bhnd_subr.c optional bhndbus | bhnd -dev/bhnd/bhnd_bus_if.m optional bhndbus | bhnd -dev/bhnd/bhndb/bhnd_bhndb.c optional bhndbus | bhndb -dev/bhnd/bhndb/bhndb.c optional bhndbus | bhndb -dev/bhnd/bhndb/bhndb_bus_if.m optional bhndbus | bhndb -dev/bhnd/bhndb/bhndb_hwdata.c optional bhndbus | bhndb -dev/bhnd/bhndb/bhndb_if.m optional bhndbus | bhndb -dev/bhnd/bhndb/bhndb_pci.c optional bhndbus pci | bhndb pci -dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndbus pci | bhndb pci -dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndbus pci | bhndb pci -dev/bhnd/bhndb/bhndb_subr.c optional bhndbus pci | bhndb -dev/bhnd/bcma/bcma.c optional bhndbus | bcma -dev/bhnd/bcma/bcma_bhndb.c optional bhndbus | bcma bhndb -dev/bhnd/bcma/bcma_erom.c optional bhndbus | bcma -dev/bhnd/bcma/bcma_subr.c optional bhndbus | bcma -dev/bhnd/cores/chipc/chipc.c optional bhndbus | bhnd -dev/bhnd/cores/chipc/chipc_subr.c optional bhndbus | bhnd -dev/bhnd/cores/chipc/bhnd_chipc_if.m optional bhndbus | bhnd -dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhndbus | bhnd -dev/bhnd/cores/pci/bhnd_pci.c optional bhndbus pci | bhnd pci -dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndbus pci | bhndb pci +dev/bhnd/bhnd.c optional bhnd +dev/bhnd/bhnd_nexus.c optional bhnd siba_nexus | \ + bhnd bcma_nexus +dev/bhnd/bhnd_subr.c optional bhnd +dev/bhnd/bhnd_bus_if.m optional bhnd +dev/bhnd/bhndb/bhnd_bhndb.c optional bhndb bhnd +dev/bhnd/bhndb/bhndb.c optional bhndb bhnd +dev/bhnd/bhndb/bhndb_bus_if.m optional bhndb bhnd +dev/bhnd/bhndb/bhndb_hwdata.c optional bhndb bhnd +dev/bhnd/bhndb/bhndb_if.m optional bhndb bhnd +dev/bhnd/bhndb/bhndb_pci.c optional bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndb bhnd pci +dev/bhnd/bhndb/bhndb_subr.c optional bhndb bhnd +dev/bhnd/bcma/bcma.c optional bcma bhnd +dev/bhnd/bcma/bcma_bhndb.c optional bcma bhnd bhndb +dev/bhnd/bcma/bcma_erom.c optional bcma bhnd +dev/bhnd/bcma/bcma_nexus.c optional bcma_nexus bcma bhnd +dev/bhnd/bcma/bcma_subr.c optional bcma bhnd +dev/bhnd/cores/chipc/chipc.c optional bhnd +dev/bhnd/cores/chipc/chipc_cfi.c optional bhnd cfi +dev/bhnd/cores/chipc/chipc_slicer.c optional bhnd cfi | bhnd spibus +dev/bhnd/cores/chipc/chipc_spi.c optional bhnd spibus +dev/bhnd/cores/chipc/chipc_subr.c optional bhnd +dev/bhnd/cores/chipc/bhnd_chipc_if.m optional bhnd +dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhnd +dev/bhnd/cores/pci/bhnd_pci.c optional bhnd pci +dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndb bhnd pci dev/bhnd/cores/pci/bhnd_pcib.c optional bhnd_pcib bhnd pci -dev/bhnd/cores/pcie2/bhnd_pcie2.c optional bhndbus pci | bhnd pci -dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c optional bhndbus pci | bhndb pci +dev/bhnd/cores/pcie2/bhnd_pcie2.c optional bhnd pci +dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c optional bhndb bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2b.c optional bhnd_pcie2b bhnd pci -dev/bhnd/nvram/bhnd_nvram_if.m optional bhndbus | bhnd -dev/bhnd/nvram/bhnd_sprom.c optional bhndbus | bhnd -dev/bhnd/nvram/bhnd_sprom_subr.c optional bhndbus | bhnd -dev/bhnd/nvram/nvram_subr.c optional bhndbus | bhnd -dev/bhnd/siba/siba.c optional bhndbus | siba -dev/bhnd/siba/siba_bhndb.c optional bhndbus | siba bhndb -dev/bhnd/siba/siba_nexus.c optional siba_nexus siba -dev/bhnd/siba/siba_subr.c optional bhndbus | siba +dev/bhnd/nvram/bhnd_nvram_if.m optional bhnd +dev/bhnd/nvram/bhnd_sprom.c optional bhnd +dev/bhnd/nvram/bhnd_sprom_subr.c optional bhnd +dev/bhnd/nvram/nvram_subr.c optional bhnd +dev/bhnd/siba/siba.c optional siba bhnd +dev/bhnd/siba/siba_bhndb.c optional siba bhnd bhndb +dev/bhnd/siba/siba_nexus.c optional siba_nexus siba bhnd +dev/bhnd/siba/siba_subr.c optional siba bhnd # dev/bktr/bktr_audio.c optional bktr pci dev/bktr/bktr_card.c optional bktr pci @@ -1182,7 +1188,7 @@ dev/bwi/if_bwi_pci.c optional bwi pci # XXX Work around clang warning, until maintainer approves fix. dev/bwn/if_bwn.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" -dev/bwn/if_bwn_pci.c optional bwn pci bhnd | bwn pci bhndbus +dev/bwn/if_bwn_pci.c optional bwn pci bhnd dev/bwn/if_bwn_phy_common.c optional bwn siba_bwn dev/bwn/if_bwn_phy_g.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" @@ -1190,7 +1196,7 @@ dev/bwn/if_bwn_phy_lp.c optional bwn si compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_phy_n.c optional bwn siba_bwn dev/bwn/if_bwn_util.c optional bwn siba_bwn -dev/bwn/bwn_mac.c optional bwn bhnd | bwn bhndbus +dev/bwn/bwn_mac.c optional bwn bhnd dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus @@ -2490,10 +2496,7 @@ dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci dev/siba/siba_bwn.c optional siba_bwn pci -dev/siba/siba_cc.c optional siba_s5 !bhnd !bhndbus -dev/siba/siba_core.c optional siba_s5 | siba_bwn pci -dev/siba/siba_mips.c optional siba_s5 !bhnd !bhndbus -dev/siba/siba_pcib.c optional siba_s5 pci !bhnd !bhndbus +dev/siba/siba_core.c optional siba_bwn pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/dev/bhnd/bcma/bcma.c Sat Jun 4 19:53:47 2016 (r301410) @@ -98,8 +98,9 @@ bcma_attach(device_t dev) r_end = r_start + r_count - 1; dinfo->rid_agent = i + 1; - dinfo->res_agent = bhnd_alloc_resource(dev, SYS_RES_MEMORY, - &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE); + dinfo->res_agent = BHND_BUS_ALLOC_RESOURCE(dev, dev, + SYS_RES_MEMORY, &dinfo->rid_agent, r_start, r_end, r_count, + RF_ACTIVE); if (dinfo->res_agent == NULL) { device_printf(dev, "failed allocating agent register " "block for core %d\n", i); Modified: head/sys/dev/bhnd/bcma/bcma_nexus.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_nexus.c Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/dev/bhnd/bcma/bcma_nexus.c Sat Jun 4 19:53:47 2016 (r301410) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2016 Michael Zhilin + * Copyright (c) 2015-2016 Landon Fuller * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,6 +26,8 @@ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ */ #include @@ -34,78 +37,102 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include -#include +#include +#include +#include -#include "bhnd_bus_if.h" #include "bcmavar.h" #include "bcma_eromreg.h" -#define BCMA_NEXUS_EROM_RID 10 +/* + * Supports bcma(4) attachment to a nexus bus. + */ + +static int bcma_nexus_attach(device_t); +static int bcma_nexus_probe(device_t); + +struct bcma_nexus_softc { + struct bcma_softc parent_sc; + struct bhnd_chipid bcma_cid; +}; static int bcma_nexus_probe(device_t dev) { - const struct bhnd_chipid *cid = BHND_BUS_GET_CHIPID(device_get_parent(dev), dev); + struct bcma_nexus_softc *sc; + int error; - /* Check bus type */ - if (cid->chip_type != BHND_CHIPTYPE_BCMA) + sc = device_get_softc(dev); + + /* Read the ChipCommon info using the hints the kernel + * was compiled with. */ + if ((error = bhnd_nexus_read_chipid(dev, &sc->bcma_cid))) + return (error); + + if (sc->bcma_cid.chip_type != BHND_CHIPTYPE_BCMA) return (ENXIO); - /* Delegate to default probe implementation */ - return (bcma_probe(dev)); + if ((error = bcma_probe(dev)) > 0) { + device_printf(dev, "error %d in probe\n", error); + return (error); + } + + return (0); } static int bcma_nexus_attach(device_t dev) { - int erom_rid; - int error; - struct resource *erom_res; - const struct bhnd_chipid *cid = BHND_BUS_GET_CHIPID(device_get_parent(dev), dev); - - erom_rid = BCMA_NEXUS_EROM_RID; - error = bus_set_resource(dev, SYS_RES_MEMORY, erom_rid, cid->enum_addr, BCMA_EROM_TABLE_SIZE); - if (error != 0) { - BHND_ERROR_DEV(dev, "failed to set EROM resource"); - return (error); - } - - /* Map the EROM resource and enumerate our children. */ - BHND_DEBUG_DEV(dev, "erom enum address: %jx", cid->enum_addr); - erom_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &erom_rid, RF_ACTIVE); - if (erom_res == NULL) { - BHND_ERROR_DEV(dev, "failed to allocate EROM resource"); - return (ENXIO); - } - - BHND_DEBUG_DEV(dev, "erom scanning start address: %p", rman_get_virtual(erom_res)); - error = bcma_add_children(dev, erom_res, BCMA_EROM_TABLE_START); - - /* Clean up */ - bus_release_resource(dev, SYS_RES_MEMORY, erom_rid, erom_res); - if (error) - return (error); + struct bcma_nexus_softc *sc; + struct resource *erom_res; + int error; + int rid; + + sc = device_get_softc(dev); + + /* Map the EROM resource and enumerate the bus. */ + rid = 0; + erom_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + sc->bcma_cid.enum_addr, + sc->bcma_cid.enum_addr + BCMA_EROM_TABLE_SIZE, + BCMA_EROM_TABLE_SIZE, RF_ACTIVE); + if (erom_res == NULL) { + device_printf(dev, "failed to allocate EROM resource\n"); + return (ENXIO); + } - /* Call our superclass' implementation */ - return (bcma_attach(dev)); + error = bcma_add_children(dev, erom_res, BCMA_EROM_TABLE_START); + bus_release_resource(dev, SYS_RES_MEMORY, rid, erom_res); + + if (error) + return (error); + + return (bcma_attach(dev)); +} + +static const struct bhnd_chipid * +bcma_nexus_get_chipid(device_t dev, device_t child) { + struct bcma_nexus_softc *sc = device_get_softc(dev); + return (&sc->bcma_cid); } static device_method_t bcma_nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcma_nexus_probe), DEVMETHOD(device_attach, bcma_nexus_attach), + + /* bhnd interface */ + DEVMETHOD(bhnd_bus_get_chipid, bcma_nexus_get_chipid), + DEVMETHOD_END }; -DEFINE_CLASS_1(bhnd, bcma_nexus_driver, bcma_nexus_methods, sizeof(struct bcma_softc), bcma_driver); -EARLY_DRIVER_MODULE(bcma_nexus, bhnd_soc, bcma_nexus_driver, bhnd_devclass, - NULL, NULL, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); - -MODULE_VERSION(bcma_nexus, 1); -MODULE_DEPEND(bcma_nexus, bcma, 1, 1, 1); -MODULE_DEPEND(bcma_nexus, bhnd_soc, 1, 1, 1); +DEFINE_CLASS_2(bhnd, bcma_nexus_driver, bcma_nexus_methods, + sizeof(struct bcma_nexus_softc), bhnd_nexus_driver, bcma_driver); + +DRIVER_MODULE(bcma_nexus, nexus, bcma_nexus_driver, bhnd_devclass, 0, 0); Added: head/sys/dev/bhnd/bhnd_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bhnd_nexus.c Sat Jun 4 19:53:47 2016 (r301410) @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 2015-2016 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + + +/* + * bhnd(4) driver mix-in providing shared common methods for + * bhnd bus devices attached via a root nexus. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "bhnd_nexusvar.h" + +static const struct resource_spec bhnd_nexus_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* chipc registers */ + { -1, 0, 0 } +}; + +/** + * Map ChipCommon's register block and read the chip identifier data. + * + * @param dev A bhnd_nexus device. + * @param chipid On success, will be populated with the chip identifier. + * @retval 0 success + * @retval non-zero An error occurred reading the chip identifier.. + */ +int +bhnd_nexus_read_chipid(device_t dev, struct bhnd_chipid *chipid) +{ + struct resource_spec rspec[nitems(bhnd_nexus_res_spec)]; + int error; + + memcpy(rspec, bhnd_nexus_res_spec, sizeof(rspec)); + error = bhnd_read_chipid(dev, rspec, 0, chipid); + if (error) + device_printf(dev, "error %d reading chip ID\n", error); + + return (error); +} + +static bool +bhnd_nexus_is_hw_disabled(device_t dev, device_t child) +{ + return false; +} + +static bhnd_attach_type +bhnd_nexus_get_attach_type(device_t dev, device_t child) +{ + return (BHND_ATTACH_NATIVE); +} + +static int +bhnd_nexus_activate_resource(device_t dev, device_t child, int type, int rid, + struct bhnd_resource *r) +{ + int error; + + /* Always direct */ + if ((error = bus_activate_resource(child, type, rid, r->res))) + return (error); + + r->direct = true; + return (0); +} + + +static device_method_t bhnd_nexus_methods[] = { + /* bhnd interface */ + DEVMETHOD(bhnd_bus_activate_resource, bhnd_nexus_activate_resource), + DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_nexus_is_hw_disabled), + DEVMETHOD(bhnd_bus_get_attach_type, bhnd_nexus_get_attach_type), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(bhnd, bhnd_nexus_driver, bhnd_nexus_methods, + sizeof(struct bhnd_softc)); Copied and modified: head/sys/dev/bhnd/bhnd_nexusvar.h (from r301409, head/sys/dev/bhnd/soc/bhnd_soc.h) ============================================================================== --- head/sys/dev/bhnd/soc/bhnd_soc.h Sat Jun 4 19:39:05 2016 (r301409, copy source) +++ head/sys/dev/bhnd/bhnd_nexusvar.h Sat Jun 4 19:53:47 2016 (r301410) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Michael Zhilin + * Copyright (c) 2016 Landon Fuller * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,27 +25,22 @@ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. - */ - -/* + * * $FreeBSD$ */ -#ifndef _BHND_SOC_BHND_SOC_H_ -#define _BHND_SOC_BHND_SOC_H_ -#define BHND_SOC_MAXNUM_CORES 0x20 -#define BHND_SOC_RAM_OFFSET 0x0 -#define BHND_SOC_RAM_SIZE 0x20000000 - -struct bhnd_soc_softc { - device_t dev; - device_t bridge; - device_t bus; - struct bhnd_chipid chipid; /* chip identification */ -}; - -struct bhnd_soc_devinfo { - struct resource_list resources; -}; +#ifndef _BHND_BHND_NEXUSVAR_H_ +#define _BHND_BHND_NEXUSVAR_H_ + +#include +#include +#include +#include + +#include "bhndvar.h" + +DECLARE_CLASS(bhnd_nexus_driver); + +int bhnd_nexus_read_chipid(device_t dev, struct bhnd_chipid *chipid); -#endif /* _BHND_SOC_BHND_SOC_H_ */ +#endif /* _BHND_BHND_NEXUSVAR_H_ */ Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/dev/bhnd/siba/siba.c Sat Jun 4 19:53:47 2016 (r301410) @@ -114,7 +114,7 @@ siba_attach(device_t dev) /* Allocate the config resource */ dinfo->cfg_rid[cfgidx] = 0; - dinfo->cfg[cfgidx] = bhnd_alloc_resource(dev, + dinfo->cfg[cfgidx] = BHND_BUS_ALLOC_RESOURCE(dev, dev, SYS_RES_MEMORY, &dinfo->cfg_rid[cfgidx], r_start, r_end, r_count, RF_ACTIVE); @@ -458,10 +458,6 @@ siba_register_addrspaces(device_t dev, s /* Fetch the address match register value */ adm = bus_read_4(r, adm_offset); - /* Skip disabled entries */ - if (adm & SIBA_AM_ADEN) - continue; - /* Parse the value */ if ((error = siba_parse_admatch(adm, &addr, &size))) { device_printf(dev, "failed to decode address " @@ -551,7 +547,7 @@ siba_add_children(device_t dev, const st ccid = bhnd_parse_chipid(ccreg, SIBA_ENUM_ADDR); if (!CHIPC_NCORES_MIN_HWREV(ccrev)) { - switch (device) { + switch (ccid.chip_id) { case BHND_CHIPID_BCM4306: ccid.ncores = 6; break; Modified: head/sys/dev/bhnd/siba/siba_nexus.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_nexus.c Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/dev/bhnd/siba/siba_nexus.c Sat Jun 4 19:53:47 2016 (r301410) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2015-2016 Landon Fuller * Copyright (c) 2007 Bruce M. Simpson. * All rights reserved. * @@ -28,217 +29,50 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include -#include -#include #include +#include +#include #include -#include +#include +#include -#include "sibareg.h" #include "sibavar.h" /* * Supports siba(4) attachment to a MIPS nexus bus. * - * This driver is a direct port of Bruce M. Simpson' original siba(4) to the - * bhnd(4) bus infrastructure. + * Derived from Bruce M. Simpson' original siba(4) driver. */ -/* - * TODO: De-mipsify this code. - * TODO: cpu clock calculation. -> move to siba_cc instance - * TODO: Hardwire IRQs for attached cores on siba at probe time. - * TODO: Support detach. - * TODO: Power management. - * TODO: code cleanup. - * TODO: Support deployments of siba other than as a system bus. - */ - -#ifndef MIPS_MEM_RID -#define MIPS_MEM_RID 0x20 -#endif - -extern int rman_debug; - -static struct rman mem_rman; /* XXX move to softc */ - -static int siba_debug = 1; -static const char descfmt[] = "Sonics SiliconBackplane rev %s"; -#define SIBA_DEVDESCLEN sizeof(descfmt) + 8 - -static int siba_nexus_activate_resource(device_t, device_t, int, int, - struct resource *); -static struct resource * - siba_nexus_alloc_resource(device_t, device_t, int, int *, - rman_res_t, rman_res_t, rman_res_t, u_int); -static int siba_nexus_attach(device_t); -#ifdef notyet -static uint8_t siba_nexus_getirq(uint16_t); -#endif -static int siba_nexus_probe(device_t); - struct siba_nexus_softc { struct siba_softc parent_sc; - - device_t siba_dev; /* Device ID */ struct bhnd_chipid siba_cid; - struct resource *siba_mem_res; - bus_space_tag_t siba_mem_bt; - bus_space_handle_t siba_mem_bh; - bus_addr_t siba_maddr; - bus_size_t siba_msize; }; -// TODO - depends on bhnd(4) IRQ support -#ifdef notyet -/* - * On the Sentry5, the system bus IRQs are the same as the - * MIPS IRQs. Particular cores are hardwired to certain IRQ lines. - */ -static uint8_t -siba_nexus_getirq(uint16_t devid) -{ - uint8_t irq; - - switch (devid) { - case BHND_COREID_CC: - irq = 0; - break; - case BHND_COREID_ENET: - irq = 1; - break; - case BHND_COREID_IPSEC: - irq = 2; - break; - case BHND_COREID_USB: - irq = 3; - break; - case BHND_COREID_PCI: - irq = 4; - break; -#if 0 - /* - * 5 is reserved for the MIPS on-chip timer interrupt; - * it is hard-wired by the tick driver. - */ - case BHND_COREID_MIPS: - case BHND_COREID_MIPS33: - irq = 5; - break; -#endif - default: - irq = 0xFF; /* this core does not need an irq */ - break; - } - - return (irq); -} -#endif - static int siba_nexus_probe(device_t dev) { - struct siba_nexus_softc *sc = device_get_softc(dev); - struct bhnd_core_info cc; - uint32_t idhi, idlo; - int error, rid; - - sc->siba_dev = dev; - - //rman_debug = 1; /* XXX */ - - /* - * Read the ChipCommon info using the hints the kernel - * was compiled with. - */ - rid = MIPS_MEM_RID; - sc->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->siba_mem_res == NULL) { - device_printf(dev, "unable to allocate probe aperture\n"); - return (ENXIO); - } - sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res); - sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res); - sc->siba_maddr = rman_get_start(sc->siba_mem_res); - sc->siba_msize = rman_get_size(sc->siba_mem_res); - - if (siba_debug) { - device_printf(dev, "start %08x len %08x\n", - sc->siba_maddr, sc->siba_msize); - } - - idlo = bus_read_4(sc->siba_mem_res, SIBA_IDLOW); - idhi = bus_read_4(sc->siba_mem_res, SIBA_IDHIGH); - cc = siba_parse_core_info(idhi, 0, 0); - - if (siba_debug) { - device_printf(dev, "idhi = %08x\n", idhi); - device_printf(dev, " chipcore id = %08x\n", cc.device); - } + struct siba_nexus_softc *sc; + int error; - /* - * For now, check that the first core is the ChipCommon core. - */ - if (bhnd_core_class(&cc) != BHND_DEVCLASS_CC) { - if (siba_debug) - device_printf(dev, "first core is not ChipCommon\n"); - return (ENXIO); - } - - /* - * Determine backplane revision and set description string. - */ - uint32_t rev; - char *revp; - char descbuf[SIBA_DEVDESCLEN]; - - rev = SIBA_REG_GET(idlo, IDL_SBREV); - revp = "unknown"; - if (rev == SIBA_IDL_SBREV_2_2) - revp = "2.2"; - else if (rev == SIBA_IDL_SBREV_2_3) - revp = "2.3"; - - (void)snprintf(descbuf, sizeof(descbuf), descfmt, revp); - device_set_desc_copy(dev, descbuf); - - /* - * Determine how many cores are present on this siba bus, so - * that we may map them all. - */ - uint32_t ccidreg; - - ccidreg = bus_read_4(sc->siba_mem_res, CHIPC_ID); - sc->siba_cid = bhnd_parse_chipid(ccidreg, sc->siba_maddr); - if (siba_debug) { - device_printf(dev, "ccid = %08x, cc_id = %04x, cc_rev = %04x\n", - ccidreg, sc->siba_cid.chip_id, sc->siba_cid.chip_rev); - } + sc = device_get_softc(dev); - if (sc->siba_cid.ncores == 0) - sc->siba_cid.ncores = siba_get_ncores(&sc->siba_cid); - - if (siba_debug) { - device_printf(dev, "%d cores detected.\n", sc->siba_cid.ncores); - } + /* Read the ChipCommon info using the hints the kernel + * was compiled with. */ + if ((error = bhnd_nexus_read_chipid(dev, &sc->siba_cid))) + return (error); - /* - * Now we know how many cores are on this siba, release the - * mapping and allocate a new mapping spanning all cores on the bus. - */ - rid = MIPS_MEM_RID; - error = bus_release_resource(dev, SYS_RES_MEMORY, rid, - sc->siba_mem_res); - if (error != 0) { - device_printf(dev, "error %d releasing resource\n", error); + if (sc->siba_cid.chip_type != BHND_CHIPTYPE_SIBA) return (ENXIO); + + if ((error = siba_probe(dev)) > 0) { + device_printf(dev, "error %d in probe\n", error); + return (error); } return (0); @@ -247,52 +81,15 @@ siba_nexus_probe(device_t dev) static int siba_nexus_attach(device_t dev) { - struct siba_nexus_softc *sc = device_get_softc(dev); - uint32_t total; - int error, rid; + struct siba_nexus_softc *sc; + int error; - if (siba_debug) - printf("%s: entry\n", __func__); + sc = device_get_softc(dev); /* Enumerate the bus. */ - if ((error = siba_add_children(dev, &sc->siba_cid))) + if ((error = siba_add_children(dev, NULL))) { + device_printf(dev, "error %d enumerating children\n", error); return (error); - - /* Allocate full core aperture */ - total = sc->siba_cid.ncores; - sc->siba_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - sc->siba_maddr, sc->siba_maddr + total - 1, total, RF_ACTIVE); - if (sc->siba_mem_res == NULL) { - device_printf(dev, "unable to allocate entire aperture\n"); - return (ENXIO); - } - sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res); - sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res); - sc->siba_maddr = rman_get_start(sc->siba_mem_res); - sc->siba_msize = rman_get_size(sc->siba_mem_res); - - if (siba_debug) { - device_printf(dev, "after remapping: start %08x len %08x\n", - sc->siba_maddr, sc->siba_msize); - } - bus_set_resource(dev, SYS_RES_MEMORY, rid, sc->siba_maddr, - sc->siba_msize); - - /* - * We need a manager for the space we claim on nexus to - * satisfy requests from children. - * We need to keep the source reservation we took because - * otherwise it may be claimed elsewhere. - * XXX move to softc - */ - mem_rman.rm_start = sc->siba_maddr; - mem_rman.rm_end = sc->siba_maddr + sc->siba_msize - 1; - mem_rman.rm_type = RMAN_ARRAY; - mem_rman.rm_descr = "SiBa I/O memory addresses"; - if (rman_init(&mem_rman) != 0 || - rman_manage_region(&mem_rman, mem_rman.rm_start, - mem_rman.rm_end) != 0) { - panic("%s: mem_rman", __func__); } return (siba_attach(dev)); @@ -304,150 +101,18 @@ siba_nexus_get_chipid(device_t dev, devi return (&sc->siba_cid); } -static struct resource * -siba_nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct resource *rv; - struct resource_list *rl; - struct resource_list_entry *rle; - int isdefault, needactivate; - -#if 0 - if (siba_debug) - printf("%s: entry\n", __func__); -#endif - - isdefault = (start == 0UL && end == ~0UL && count == 1); - needactivate = flags & RF_ACTIVE; - rl = BUS_GET_RESOURCE_LIST(bus, child); - rle = NULL; - - if (isdefault) { - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); - start = rle->start; - end = rle->end; - count = rle->count; - } - - /* - * If the request is for a resource which we manage, - * attempt to satisfy the allocation ourselves. - */ - if (type == SYS_RES_MEMORY && - start >= mem_rman.rm_start && end <= mem_rman.rm_end) { - - rv = rman_reserve_resource(&mem_rman, start, end, count, - flags, child); - if (rv == 0) { - printf("%s: could not reserve resource\n", __func__); - return (0); - } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv)) { - printf("%s: could not activate resource\n", - __func__); - rman_release_resource(rv); - return (0); - } - } - - return (rv); - } - - /* - * Pass the request to the parent, usually MIPS nexus. - */ - if (siba_debug) - printf("%s: proxying request to parent\n", __func__); - return (resource_list_alloc(rl, bus, child, type, rid, - start, end, count, flags)); -} - -/* - * The parent bus is responsible for resource activation; in the - * case of MIPS, this boils down to setting the virtual address and - * bus handle by mapping the physical address into KSEG1. - */ -static int -siba_nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) -{ - return (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), child, type, - rid, r)); -} - -// TODO - depends on bhnd(4) IRQ support -#ifdef notyet -static struct siba_devinfo * -siba_nexus_setup_devinfo(device_t dev, uint8_t idx) -{ - struct siba_nexus_softc *sc = device_get_softc(dev); - struct siba_devinfo *sdi; - uint32_t idlo, idhi, rev; - uint16_t vendorid, devid; - bus_addr_t baseaddr; - - sdi = malloc(sizeof(*sdi), M_DEVBUF, M_WAITOK | M_ZERO); - resource_list_init(&sdi->sdi_rl); - - idlo = siba_mips_read_4(sc, idx, SIBA_IDLOW); - idhi = siba_mips_read_4(sc, idx, SIBA_IDHIGH); - - vendorid = (idhi & SIBA_IDHIGH_VENDORMASK) >> - SIBA_IDHIGH_VENDOR_SHIFT; - devid = ((idhi & 0x8ff0) >> 4); - rev = (idhi & SIBA_IDHIGH_REVLO); - rev |= (idhi & SIBA_IDHIGH_REVHI) >> SIBA_IDHIGH_REVHI_SHIFT; - - sdi->sdi_vid = vendorid; - sdi->sdi_devid = devid; - sdi->sdi_rev = rev; - sdi->sdi_idx = idx; - sdi->sdi_irq = siba_getirq(devid); - - /* - * Determine memory window on bus and irq if one is needed. - */ - baseaddr = sc->siba_maddr + (idx * SIBA_CORE_SIZE); - resource_list_add(&sdi->sdi_rl, SYS_RES_MEMORY, - MIPS_MEM_RID, /* XXX */ - baseaddr, baseaddr + SIBA_CORE_LEN - 1, SIBA_CORE_LEN); - - if (sdi->sdi_irq != 0xff) { - resource_list_add(&sdi->sdi_rl, SYS_RES_IRQ, - 0, sdi->sdi_irq, sdi->sdi_irq, 1); - } - - return (sdi); -} -#endif - static device_method_t siba_nexus_methods[] = { /* Device interface */ - DEVMETHOD(device_attach, siba_nexus_attach), - DEVMETHOD(device_probe, siba_nexus_probe), - - /* Bus interface */ - DEVMETHOD(bus_activate_resource,siba_nexus_activate_resource), - DEVMETHOD(bus_alloc_resource, siba_nexus_alloc_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(device_probe, siba_nexus_probe), + DEVMETHOD(device_attach, siba_nexus_attach), /* bhnd interface */ - DEVMETHOD(bhnd_get_chipid, siba_nexus_get_chipid), + DEVMETHOD(bhnd_bus_get_chipid, siba_nexus_get_chipid), DEVMETHOD_END }; -DEFINE_CLASS_1(bhnd, siba_nexus_driver, siba_nexus_methods, - sizeof(struct siba_nexus_softc), siba_driver); +DEFINE_CLASS_2(bhnd, siba_nexus_driver, siba_nexus_methods, + sizeof(struct siba_nexus_softc), bhnd_nexus_driver, siba_driver); -DRIVER_MODULE(siba_nexus, nexus, siba_driver, bhnd_devclass, 0, 0); +DRIVER_MODULE(siba_nexus, nexus, siba_nexus_driver, bhnd_devclass, 0, 0); Modified: head/sys/dev/bhnd/siba/siba_subr.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_subr.c Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/dev/bhnd/siba/siba_subr.c Sat Jun 4 19:53:47 2016 (r301410) @@ -244,9 +244,9 @@ siba_append_dinfo_region(struct siba_dev struct siba_addrspace *sa; struct siba_port *port; rman_res_t r_size; - + /* Verify that base + size will not overflow */ - if (UINT32_MAX - size < base) + if (size > 0 && UINT32_MAX - (size - 1) < base) return (ERANGE); /* Verify that size - bus_reserved will not underflow */ @@ -276,7 +276,7 @@ siba_append_dinfo_region(struct siba_dev /* Populate the resource list */ r_size = size - bus_reserved; sa->sa_rid = resource_list_add_next(&dinfo->resources, SYS_RES_MEMORY, - base, base + r_size - 1, r_size); + base, base + (r_size - 1), r_size); /* Append to target port */ STAILQ_INSERT_TAIL(&port->sp_addrs, sa, sa_link); Modified: head/sys/mips/broadcom/files.broadcom ============================================================================== --- head/sys/mips/broadcom/files.broadcom Sat Jun 4 19:39:05 2016 (r301409) +++ head/sys/mips/broadcom/files.broadcom Sat Jun 4 19:53:47 2016 (r301410) @@ -17,31 +17,5 @@ mips/broadcom/uart_bus_chipc.c optional mips/broadcom/bcm_socinfo.c standard mips/broadcom/bcm_mipscore.c standard *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jun 4 19:58:03 2016 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 A389FB68F38; Sat, 4 Jun 2016 19:58:03 +0000 (UTC) (envelope-from landonf@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 mx1.freebsd.org (Postfix) with ESMTPS id 6DB351F8B; Sat, 4 Jun 2016 19:58:03 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54Jw2VY016570; Sat, 4 Jun 2016 19:58:02 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54Jw1Nw016560; Sat, 4 Jun 2016 19:58:01 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606041958.u54Jw1Nw016560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 4 Jun 2016 19:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301411 - in head/sys/dev/bhnd: cores/chipc nvram 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.22 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: Sat, 04 Jun 2016 19:58:03 -0000 Author: landonf Date: Sat Jun 4 19:58:01 2016 New Revision: 301411 URL: https://svnweb.freebsd.org/changeset/base/301411 Log: bhnd(4): support IPX OTP NVRAM/SPROM data source Add support for fetching SPROM data from OTP on chipsets with an IPX OTP controller (including the BCM43225). This integrates the NVRAM data source into the chipc_caps capability structure, and adds a sprom_offset field that can be used with OTP to locate the SPROM image data (found within the general use region, H/W subregion). This also removes one of two duplicate parse error messages reported by both the bhnd_sprom driver and the underlying SPROM parsing API. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6729 Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc.h head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/chipcvar.h head/sys/dev/bhnd/nvram/bhnd_nvram.h head/sys/dev/bhnd/nvram/bhnd_sprom.c head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c head/sys/dev/bhnd/nvram/bhnd_spromvar.h Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 4 19:58:01 2016 (r301411) @@ -65,15 +65,6 @@ CODE { } /** - * Return the preferred NVRAM data source. - * - * @param dev A bhnd(4) ChipCommon device. - */ -METHOD bhnd_nvram_src_t nvram_src { - device_t dev; -} - -/** * Write @p value with @p mask directly to the chipctrl register. * * @param dev A bhnd(4) ChipCommon device. @@ -103,7 +94,7 @@ METHOD struct chipc_caps * get_caps { } DEFAULT bhnd_chipc_generic_get_caps; /** - * Enable hardware access to the SPROM. + * Enable hardware access to the SPROM/OTP source. * * @param sc chipc driver state. * @@ -116,7 +107,7 @@ METHOD int enable_sprom { } /** - * Release hardware access to the SPROM. + * Release hardware access to the SPROM/OTP source. * * @param sc chipc driver state. */ Modified: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Sat Jun 4 19:58:01 2016 (r301411) @@ -48,12 +48,19 @@ __FBSDID("$FreeBSD$"); #include "bhnd_nvram_if.h" -#include "chipc.h" +#include "chipcvar.h" +#include "chipc_private.h" + +#define CHIPC_VALID_SPROM_SRC(_src) \ + ((_src) == BHND_NVRAM_SRC_SPROM || (_src) == BHND_NVRAM_SRC_OTP) static void chipc_sprom_identify(driver_t *driver, device_t parent) { - if (bhnd_chipc_nvram_src(parent) != BHND_NVRAM_SRC_SPROM) + struct chipc_caps *caps; + + caps = BHND_CHIPC_GET_CAPS(parent); + if (!CHIPC_VALID_SPROM_SRC(caps->nvram_src)) return; if (device_find_child(parent, "bhnd_nvram", 0) != NULL) @@ -66,13 +73,15 @@ chipc_sprom_identify(driver_t *driver, d static int chipc_sprom_probe(device_t dev) { - device_t chipc; - int error; + struct chipc_caps *caps; + device_t chipc; + int error; chipc = device_get_parent(dev); + caps = BHND_CHIPC_GET_CAPS(chipc); - /* Only match on SPROM devices */ - if (BHND_CHIPC_NVRAM_SRC(chipc) != BHND_NVRAM_SRC_SPROM) + /* Only match on SPROM/OTP devices */ + if (!CHIPC_VALID_SPROM_SRC(caps->nvram_src)) return (ENXIO); /* Defer to default driver implementation */ @@ -85,16 +94,19 @@ chipc_sprom_probe(device_t dev) static int chipc_sprom_attach(device_t dev) { - device_t chipc; - int error; + struct chipc_caps *caps; + device_t chipc; + int error; + + chipc = device_get_parent(dev); + caps = BHND_CHIPC_GET_CAPS(chipc); /* Request that ChipCommon enable access to SPROM hardware before * delegating attachment (and SPROM parsing) to the common driver */ - chipc = device_get_parent(dev); if ((error = BHND_CHIPC_ENABLE_SPROM(chipc))) return (error); - error = bhnd_sprom_attach(dev); + error = bhnd_sprom_attach(dev, caps->sprom_offset); BHND_CHIPC_DISABLE_SPROM(chipc); return (error); } Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 4 19:58:01 2016 (r301411) @@ -91,10 +91,18 @@ static const struct bhnd_device chipc_de /* Device quirks table */ static struct bhnd_device_quirk chipc_quirks[] = { - /* core revision quirks */ + /* HND OTP controller revisions */ + BHND_CORE_QUIRK (HWREV_EQ (12), CHIPC_QUIRK_OTP_HND), /* (?) */ + BHND_CORE_QUIRK (HWREV_EQ (17), CHIPC_QUIRK_OTP_HND), /* BCM4311 */ + BHND_CORE_QUIRK (HWREV_EQ (22), CHIPC_QUIRK_OTP_HND), /* BCM4312 */ + + /* IPX OTP controller revisions */ + BHND_CORE_QUIRK (HWREV_EQ (21), CHIPC_QUIRK_OTP_IPX), + BHND_CORE_QUIRK (HWREV_GTE(23), CHIPC_QUIRK_OTP_IPX), + BHND_CORE_QUIRK (HWREV_GTE(32), CHIPC_QUIRK_SUPPORTS_SPROM), BHND_CORE_QUIRK (HWREV_GTE(35), CHIPC_QUIRK_SUPPORTS_CAP_EXT), - BHND_CORE_QUIRK (HWREV_GTE(49), CHIPC_QUIRK_IPX_OTPLAYOUT_SIZE), + BHND_CORE_QUIRK (HWREV_GTE(49), CHIPC_QUIRK_IPX_OTPL_SIZE), /* 4706 variant quirks */ BHND_CORE_QUIRK (HWREV_EQ (38), CHIPC_QUIRK_4706_NFLASH), /* BCM5357? */ @@ -159,10 +167,11 @@ static int chipc_try_activate_resourc int type, int rid, struct resource *r, bool req_direct); +static bhnd_nvram_src chipc_find_nvram_src(struct chipc_softc *sc, + struct chipc_caps *caps); static int chipc_read_caps(struct chipc_softc *sc, struct chipc_caps *caps); -static bhnd_nvram_src_t chipc_nvram_identify(struct chipc_softc *sc); static bool chipc_should_enable_sprom( struct chipc_softc *sc); @@ -265,9 +274,6 @@ chipc_attach(device_t dev) if (bootverbose) chipc_print_caps(sc->dev, &sc->caps); - /* Identify NVRAM source */ - sc->nvram_src = chipc_nvram_identify(sc); - /* Probe and attach children */ bus_generic_probe(dev); if ((error = bus_generic_attach(dev))) @@ -305,6 +311,60 @@ chipc_detach(device_t dev) return (0); } +/** + * Determine the NVRAM data source for this device. + * + * The SPROM, OTP, and flash capability flags must be fully populated in + * @p caps. + * + * @param sc chipc driver state. + * @param caps capability flags to be used to derive NVRAM configuration. + */ +static bhnd_nvram_src +chipc_find_nvram_src(struct chipc_softc *sc, struct chipc_caps *caps) +{ + uint32_t otp_st, srom_ctrl; + + /* Very early devices vend SPROM/OTP/CIS (if at all) via the + * host bridge interface instead of ChipCommon. */ + if (!CHIPC_QUIRK(sc, SUPPORTS_SPROM)) + return (BHND_NVRAM_SRC_UNKNOWN); + + /* + * Later chipset revisions standardized the SPROM capability flags and + * register interfaces. + * + * We check for hardware presence in order of precedence. For example, + * SPROM is is always used in preference to internal OTP if found. + */ + if (caps->sprom) { + srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); + if (srom_ctrl & CHIPC_SRC_PRESENT) + return (BHND_NVRAM_SRC_SPROM); + } + + /* Check for programmed OTP H/W subregion (contains SROM data) */ + if (CHIPC_QUIRK(sc, SUPPORTS_OTP) && caps->otp_size > 0) { + /* TODO: need access to HND-OTP device */ + if (!CHIPC_QUIRK(sc, OTP_HND)) { + device_printf(sc->dev, + "NVRAM unavailable: unsupported OTP controller.\n"); + return (BHND_NVRAM_SRC_UNKNOWN); + } + + otp_st = bhnd_bus_read_4(sc->core, CHIPC_OTPST); + if (otp_st & CHIPC_OTPS_GUP_HW) + return (BHND_NVRAM_SRC_OTP); + } + + /* Check for flash */ + if (caps->flash_type != CHIPC_FLASH_NONE) + return (BHND_NVRAM_SRC_FLASH); + + /* No NVRAM hardware capability declared */ + return (BHND_NVRAM_SRC_UNKNOWN); +} + /* Read and parse chipc capabilities */ static int chipc_read_caps(struct chipc_softc *sc, struct chipc_caps *caps) @@ -342,7 +402,7 @@ chipc_read_caps(struct chipc_softc *sc, caps->aob = CHIPC_GET_FLAG(cap_ext_reg, CHIPC_CAP2_AOB); /* Fetch OTP size for later IPX controller revisions */ - if (CHIPC_QUIRK(sc, IPX_OTPLAYOUT_SIZE)) { + if (CHIPC_QUIRK(sc, IPX_OTPL_SIZE)) { regval = bhnd_bus_read_4(sc->core, CHIPC_OTPLAYOUT); caps->otp_size = CHIPC_GET_BITS(regval, CHIPC_OTPL_SIZE); } @@ -384,47 +444,26 @@ chipc_read_caps(struct chipc_softc *sc, caps->flash_type = CHIPC_NFLASH_4706; } - return (0); -} -/** - * Determine the NVRAM data source for this device. - * - * @param sc chipc driver state. - */ -static bhnd_nvram_src_t -chipc_nvram_identify(struct chipc_softc *sc) -{ - uint32_t srom_ctrl; + /* Determine NVRAM source. Must occur after the SPROM/OTP/flash + * capability flags have been populated. */ + caps->nvram_src = chipc_find_nvram_src(sc, caps); + + /* Determine the SPROM offset within OTP (if any). SPROM-formatted + * data is placed within the OTP general use region. */ + caps->sprom_offset = 0; + if (caps->nvram_src == BHND_NVRAM_SRC_OTP) { + CHIPC_ASSERT_QUIRK(sc, OTP_IPX); - /* Very early devices vend SPROM/OTP/CIS (if at all) via the - * host bridge interface instead of ChipCommon. */ - if (!CHIPC_QUIRK(sc, SUPPORTS_SPROM)) - return (BHND_NVRAM_SRC_UNKNOWN); + /* Bit offset to GUP HW subregion containing SPROM data */ + regval = bhnd_bus_read_4(sc->core, CHIPC_OTPLAYOUT); + caps->sprom_offset = CHIPC_GET_BITS(regval, CHIPC_OTPL_GUP); - /* - * Later chipset revisions standardized the SPROM capability flags and - * register interfaces. - * - * We check for hardware presence in order of precedence. For example, - * SPROM is is always used in preference to internal OTP if found. - */ - if (CHIPC_CAP(sc, sprom)) { - srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); - if (srom_ctrl & CHIPC_SRC_PRESENT) - return (BHND_NVRAM_SRC_SPROM); + /* Convert to bytes */ + caps->sprom_offset /= 8; } - /* Check for OTP */ - if (CHIPC_CAP(sc, otp_size) != 0) - return (BHND_NVRAM_SRC_OTP); - - /* Check for flash */ - if (CHIPC_CAP(sc, flash_type) != CHIPC_FLASH_NONE) - return (BHND_NVRAM_SRC_FLASH); - - /* No NVRAM hardware capability declared */ - return (BHND_NVRAM_SRC_UNKNOWN); + return (0); } static int @@ -1284,13 +1323,6 @@ finished: CHIPC_UNLOCK(sc); } -static bhnd_nvram_src_t -chipc_nvram_src(device_t dev) -{ - struct chipc_softc *sc = device_get_softc(dev); - return (sc->nvram_src); -} - static void chipc_write_chipctrl(device_t dev, uint32_t value, uint32_t mask) { @@ -1363,7 +1395,6 @@ static device_method_t chipc_methods[] = DEVMETHOD(bhnd_bus_activate_resource, chipc_activate_bhnd_resource), /* ChipCommon interface */ - DEVMETHOD(bhnd_chipc_nvram_src, chipc_nvram_src), DEVMETHOD(bhnd_chipc_write_chipctrl, chipc_write_chipctrl), DEVMETHOD(bhnd_chipc_enable_sprom, chipc_enable_sprom_pins), DEVMETHOD(bhnd_chipc_disable_sprom, chipc_disable_sprom_pins), Modified: head/sys/dev/bhnd/cores/chipc/chipc.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.h Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/cores/chipc/chipc.h Sat Jun 4 19:58:01 2016 (r301411) @@ -37,15 +37,4 @@ #include "bhnd_chipc_if.h" -/** - * Query a ChipCommon device and return the preferred NVRAM data source. - * - * @param dev A bhnd(4) ChipCommon device. - */ -static inline bhnd_nvram_src_t -bhnd_chipc_nvram_src(device_t dev) -{ - return (BHND_CHIPC_NVRAM_SRC(dev)); -} - #endif /* _BHND_CORES_CHIPC_CHIPC_H_ */ Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcreg.h Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.h Sat Jun 4 19:58:01 2016 (r301411) @@ -48,7 +48,7 @@ #define CHIPC_OTPST 0x10 /**< otp status */ #define CHIPC_OTPCTRL 0x14 /**< otp control */ #define CHIPC_OTPPROG 0x18 -#define CHIPC_OTPLAYOUT 0x1C /**< otp layout (rev >= 23) */ +#define CHIPC_OTPLAYOUT 0x1C /**< otp layout (IPX OTP) */ #define CHIPC_INTST 0x20 /**< interrupt status */ #define CHIPC_INTM 0x24 /**< interrupt mask */ @@ -339,7 +339,7 @@ enum { #define CHIPC_OTPS_RV(x) (1 << (16 + (x))) /* redundancy entry valid */ #define CHIPC_OTPS_RV_MASK 0x0fff0000 -/* Fields in the otpcontrol register in rev >= 21 */ +/* IPX OTP fields in the otpcontrol register */ #define CHIPC_OTPC_PROGSEL 0x00000001 #define CHIPC_OTPC_PCOUNT_MASK 0x0000000e #define CHIPC_OTPC_PCOUNT_SHIFT 1 @@ -350,7 +350,7 @@ enum { #define CHIPC_OTPC_ODM 0x00000800 #define CHIPC_OTPC_PROGEN 0x80000000 -/* Fields in otpprog in rev >= 21 and HND OTP */ +/* Fields in otpprog in IPX OTP and HND OTP */ #define CHIPC_OTPP_COL_MASK 0x000000ff #define CHIPC_OTPP_COL_SHIFT 0 #define CHIPC_OTPP_ROW_MASK 0x0000ff00 @@ -366,6 +366,8 @@ enum { /* otplayout */ #define CHIPC_OTPL_SIZE_MASK 0x0000f000 /* rev >= 49 */ #define CHIPC_OTPL_SIZE_SHIFT 12 +#define CHIPC_OTPL_GUP_MASK 0x00000FFF /* bit offset to general use region */ +#define CHIPC_OTPL_GUP_SHIFT 0 #define CHIPC_OTPL_CISFORMAT_NEW 0x80000000 /* rev >= 36 */ /* Opcodes for OTPP_OC field */ Modified: head/sys/dev/bhnd/cores/chipc/chipcvar.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcvar.h Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/cores/chipc/chipcvar.h Sat Jun 4 19:58:01 2016 (r301411) @@ -32,6 +32,9 @@ #ifndef _BHND_CORES_CHIPC_CHIPCVAR_H_ #define _BHND_CORES_CHIPC_CHIPCVAR_H_ +#include +#include + #include #include "chipc.h" @@ -67,8 +70,14 @@ struct chipc_caps { uint8_t extbus_type; /**< ExtBus type (CHIPC_CAP_EXTBUS_*) */ chipc_flash flash_type; /**< Flash type */ + bhnd_nvram_src nvram_src; /**< identified NVRAM source */ + + bus_size_t sprom_offset; /**< Offset to SPROM data within + SPROM/OTP, 0 if unknown or not + present */ uint8_t otp_size; /**< OTP (row?) size, 0 if not present */ - uint8_t cfi_width; /**< CFI bus width, 0 if unknown or CFI not present */ + uint8_t cfi_width; /**< CFI bus width, 0 if unknown or CFI + not present */ uint8_t pll_type; /**< PLL type */ bool power_control; /**< Power control available */ @@ -158,9 +167,21 @@ enum { /** Supports CHIPC_CAPABILITIES_EXT register */ CHIPC_QUIRK_SUPPORTS_CAP_EXT = (1<<6), + /** Supports HND or IPX OTP registers (CHIPC_OTPST, CHIPC_OTPCTRL, + * CHIPC_OTPPROG) */ + CHIPC_QUIRK_SUPPORTS_OTP = (1<<7), + + /** Supports HND OTP registers. */ + CHIPC_QUIRK_OTP_HND = (1<<8) | + CHIPC_QUIRK_SUPPORTS_OTP, + + /** Supports IPX OTP registers. */ + CHIPC_QUIRK_OTP_IPX = (1<<9) | + CHIPC_QUIRK_SUPPORTS_OTP, + /** OTP size is defined via CHIPC_OTPLAYOUT register in later * ChipCommon revisions using the 'IPX' OTP controller. */ - CHIPC_QUIRK_IPX_OTPLAYOUT_SIZE = (1<<7), + CHIPC_QUIRK_IPX_OTPL_SIZE = (1<<10) }; /** @@ -183,8 +204,6 @@ struct chipc_softc { uint32_t quirks; /**< chipc quirk flags */ struct chipc_caps caps; /**< chipc capabilities */ - bhnd_nvram_src_t nvram_src; /**< identified NVRAM source */ - struct mtx mtx; /**< state mutex. */ size_t sprom_refcnt; /**< SPROM pin enable refcount */ struct rman mem_rman; /**< port memory manager */ Modified: head/sys/dev/bhnd/nvram/bhnd_nvram.h ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_nvram.h Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/nvram/bhnd_nvram.h Sat Jun 4 19:58:01 2016 (r301411) @@ -65,6 +65,6 @@ typedef enum { * is provided by a common platform NVRAM * device. */ -} bhnd_nvram_src_t; +} bhnd_nvram_src; #endif /* _BHND_NVRAM_BHND_NVRAM_H_ */ Modified: head/sys/dev/bhnd/nvram/bhnd_sprom.c ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_sprom.c Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/nvram/bhnd_sprom.c Sat Jun 4 19:58:01 2016 (r301411) @@ -71,19 +71,33 @@ bhnd_sprom_probe(device_t dev) /* Quiet by default */ if (!bootverbose) device_quiet(dev); - device_set_desc(dev, "Broadcom SPROM/OTP"); + device_set_desc(dev, "SPROM/OTP"); /* Refuse wildcard attachments */ return (BUS_PROBE_NOWILDCARD); } +/* Default DEVICE_ATTACH() implementation; assumes a zero offset to the + * SPROM data */ +static int +bhnd_sprom_attach_meth(device_t dev) +{ + return (bhnd_sprom_attach(dev, 0)); +} + /** - * Default bhnd sprom driver implementation of DEVICE_ATTACH(). + * BHND SPROM device attach. + * + * This should be called from DEVICE_ATTACH() with the @p offset to the + * SPROM data. * - * Assumes sprom is mapped via YS_RES_MEMORY resource with RID 0. + * Assumes SPROM is mapped via SYS_RES_MEMORY resource with RID 0. + * + * @param dev BHND SPROM device. + * @param offset Offset to the SPROM data. */ int -bhnd_sprom_attach(device_t dev) +bhnd_sprom_attach(device_t dev, bus_size_t offset) { struct bhnd_sprom_softc *sc; int error; @@ -101,10 +115,8 @@ bhnd_sprom_attach(device_t dev) } /* Initialize SPROM shadow */ - if ((error = bhnd_sprom_init(&sc->shadow, sc->sprom_res, 0))) { - device_printf(dev, "unrecognized SPROM format\n"); + if ((error = bhnd_sprom_init(&sc->shadow, sc->sprom_res, offset))) goto failed; - } /* Initialize mutex */ SPROM_LOCK_INIT(sc); @@ -118,7 +130,7 @@ failed: } /** - * Default bhnd sprom driver implementation of DEVICE_DETACH(). + * Default bhnd_sprom implementation of DEVICE_RESUME(). */ int bhnd_sprom_resume(device_t dev) @@ -127,7 +139,7 @@ bhnd_sprom_resume(device_t dev) } /** - * Default bhnd sprom driver implementation of DEVICE_DETACH(). + * Default bhnd sprom driver implementation of DEVICE_SUSPEND(). */ int bhnd_sprom_suspend(device_t dev) @@ -193,7 +205,7 @@ bhnd_sprom_setvar_meth(device_t dev, con static device_method_t bhnd_sprom_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bhnd_sprom_probe), - DEVMETHOD(device_attach, bhnd_sprom_attach), + DEVMETHOD(device_attach, bhnd_sprom_attach_meth), DEVMETHOD(device_resume, bhnd_sprom_resume), DEVMETHOD(device_suspend, bhnd_sprom_suspend), DEVMETHOD(device_detach, bhnd_sprom_detach), Modified: head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c Sat Jun 4 19:58:01 2016 (r301411) @@ -465,7 +465,7 @@ sprom_populate_shadow(struct bhnd_sprom } /* identification failed */ - device_printf(sc->dev, "unrecognized sprom format\n"); + device_printf(sc->dev, "unrecognized SPROM format\n"); return (EINVAL); } Modified: head/sys/dev/bhnd/nvram/bhnd_spromvar.h ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_spromvar.h Sat Jun 4 19:53:47 2016 (r301410) +++ head/sys/dev/bhnd/nvram/bhnd_spromvar.h Sat Jun 4 19:58:01 2016 (r301411) @@ -38,7 +38,7 @@ DECLARE_CLASS(bhnd_sprom_driver); struct bhnd_sprom; int bhnd_sprom_probe(device_t dev); -int bhnd_sprom_attach(device_t dev); +int bhnd_sprom_attach(device_t dev, bus_size_t offset); int bhnd_sprom_resume(device_t dev); int bhnd_sprom_suspend(device_t dev); int bhnd_sprom_detach(device_t dev); From owner-svn-src-head@freebsd.org Sat Jun 4 20:20:15 2016 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 7309AB6A452; Sat, 4 Jun 2016 20:20:15 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 4052E198B; Sat, 4 Jun 2016 20:20:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54KKEOg023963; Sat, 4 Jun 2016 20:20:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54KKEwo023961; Sat, 4 Jun 2016 20:20:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606042020.u54KKEwo023961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Jun 2016 20:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301412 - in head/lib: libc/sys libthr 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.22 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: Sat, 04 Jun 2016 20:20:15 -0000 Author: kib Date: Sat Jun 4 20:20:14 2016 New Revision: 301412 URL: https://svnweb.freebsd.org/changeset/base/301412 Log: Fix markup. Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/sys/_umtx_op.2 head/lib/libthr/libthr.3 Modified: head/lib/libc/sys/_umtx_op.2 ============================================================================== --- head/lib/libc/sys/_umtx_op.2 Sat Jun 4 19:58:01 2016 (r301411) +++ head/lib/libc/sys/_umtx_op.2 Sat Jun 4 20:20:14 2016 (r301412) @@ -472,7 +472,7 @@ read of the umutex memory faults .It the list length limit described in .Xr libthr 3 - is reached. +is reached. .El .Pp Every mutex in both lists is unlocked as if the Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Sat Jun 4 19:58:01 2016 (r301411) +++ head/lib/libthr/libthr.3 Sat Jun 4 20:20:14 2016 (r301412) @@ -234,7 +234,7 @@ installs interposing handlers into the h .Li libc . The interposers provide real locking implementation instead of the stubs for single-threaded processes in -.Li , +.Li libc , cancellation support and some modifications to the signal operations. .Pp .Nm From owner-svn-src-head@freebsd.org Sat Jun 4 21:34:07 2016 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 D430CB69261; Sat, 4 Jun 2016 21:34:07 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id A47D81BB8; Sat, 4 Jun 2016 21:34:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54LY6gL053020; Sat, 4 Jun 2016 21:34:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54LY68b053018; Sat, 4 Jun 2016 21:34:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606042134.u54LY68b053018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 4 Jun 2016 21:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301413 - head/usr.bin/getent 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.22 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: Sat, 04 Jun 2016 21:34:07 -0000 Author: markj Date: Sat Jun 4 21:34:06 2016 New Revision: 301413 URL: https://svnweb.freebsd.org/changeset/base/301413 Log: Document getent(1)'s ability to enumerate netgroup members. MFC after: 3 days Modified: head/usr.bin/getent/getent.1 head/usr.bin/getent/getent.c Modified: head/usr.bin/getent/getent.1 ============================================================================== --- head/usr.bin/getent/getent.1 Sat Jun 4 20:20:14 2016 (r301412) +++ head/usr.bin/getent/getent.1 Sat Jun 4 21:34:06 2016 (r301413) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2005 +.Dd June 4, 2016 .Dt GETENT 1 .Os .Sh NAME @@ -62,6 +62,7 @@ argument may be one of: .It Li ethers Ta address name .It Li group Ta group:passwd:gid:[member[,member]...] .It Li hosts Ta address name [alias ...] +.It Li netgroup Ta (host,user,domain) [...] .It Li networks Ta name network [alias ...] .It Li passwd Ta user:passwd:uid:gid:gecos:home_dir:shell .It Li protocols Ta name protocol [alias ...] @@ -107,6 +108,7 @@ or 3 if there is no support for enumerat .Xr ethers 5 , .Xr group 5 , .Xr hosts 5 , +.Xr netgroup 5 , .Xr networks 5 , .Xr nsswitch.conf 5 , .Xr passwd 5 , Modified: head/usr.bin/getent/getent.c ============================================================================== --- head/usr.bin/getent/getent.c Sat Jun 4 20:20:14 2016 (r301412) +++ head/usr.bin/getent/getent.c Sat Jun 4 21:34:06 2016 (r301413) @@ -84,13 +84,13 @@ static struct getentdb { { "ethers", ethers, }, { "group", group, }, { "hosts", hosts, }, + { "netgroup", netgroup, }, { "networks", networks, }, { "passwd", passwd, }, { "protocols", protocols, }, { "rpc", rpc, }, { "services", services, }, { "shells", shells, }, - { "netgroup", netgroup, }, { "utmpx", utmpx, }, { NULL, NULL, }, From owner-svn-src-head@freebsd.org Sat Jun 4 23:34:52 2016 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 5A401B6A8E9; Sat, 4 Jun 2016 23:34:52 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 2B2681BF9; Sat, 4 Jun 2016 23:34:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u54NYpqc096530; Sat, 4 Jun 2016 23:34:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u54NYpFt096529; Sat, 4 Jun 2016 23:34:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606042334.u54NYpFt096529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Jun 2016 23:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301414 - head/sys/dev/filemon 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.22 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: Sat, 04 Jun 2016 23:34:52 -0000 Author: bdrewery Date: Sat Jun 4 23:34:51 2016 New Revision: 301414 URL: https://svnweb.freebsd.org/changeset/base/301414 Log: Fix build after r301404. X-MFC-With: r301404 MFC after: 1 week Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Sat Jun 4 21:34:06 2016 (r301413) +++ head/sys/dev/filemon/filemon_wrapper.c Sat Jun 4 23:34:51 2016 (r301414) @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) +extern struct sysent freebsd32_sysent[]; +#endif + static eventhandler_tag filemon_exec_tag; static eventhandler_tag filemon_exit_tag; static eventhandler_tag filemon_fork_tag;