From owner-svn-src-stable-11@freebsd.org Sun Aug 28 00:12:46 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90ECDB78B2F; Sun, 28 Aug 2016 00:12:46 +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 6E795265; Sun, 28 Aug 2016 00:12:46 +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 u7S0CjV6004266; Sun, 28 Aug 2016 00:12:45 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S0Cjk8004265; Sun, 28 Aug 2016 00:12:45 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201608280012.u7S0Cjk8004265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Sun, 28 Aug 2016 00:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304929 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 00:12:46 -0000 Author: skreuzer (doc,ports committer) Date: Sun Aug 28 00:12:45 2016 New Revision: 304929 URL: https://svnweb.freebsd.org/changeset/base/304929 Log: Document r299142, The leap-seconds file has been updated to leap-seconds.3676752000 Document r302177, WITH_SYSTEM_COMPILER: Enable by default Document r304246, PCIe HotPlug: Detect bridges that are not really HotPlug capable Document r301565, Switch arm64 to use intrng by default Document r299781, Support for the Allwinner Reduced Serial Bus (RSB) Document r296064, Support for Allwinner A20 HDMI Document r299393, Default installation directory for modules is /boot/modules Document r303716, Drop SSH1 support Document r303719, Disable DSA by default Document r297633, RCTL resources for limited filesystem IO Document r300723, Mellanox implementation of iSER Document r299848, Allow reroot to NFS Document r301033, Discovery without attaching support in iscsictl Document r299371, camcontrol reprobe Document r295212, Add an additional, libucl-based configuration file parser to ctld Document r287842, Change default regulatory domain from DEBUG to FCC in ifconfig Document r301875, The SIOCSIFALIFETIME_IN6 ioctl has been removed Approved by: re (gjb, implicit, relnotes) Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Aug 27 23:03:23 2016 (r304928) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Aug 28 00:12:45 2016 (r304929) @@ -175,8 +175,15 @@ The MK_ARM_EABI &man.src.conf.5; option has been removed. + The WITH_SYSTEM_COMPILER + &man.src.conf.5; option is enabled by default. + The ntp suite has been updated to version 4.2.8p8. + + The + /etc/ntp/leap-seconds + has been updated to version 3676752000. @@ -443,10 +450,11 @@ falling back to the PCI ID database in the &os; base system. - The &man.ifconfig.8; utility has been - updated to always exit with an error code if an important - &man.ioctl.2; fails. + By default the &man.ifconfig.8; utility + will set the default regulatory domain to FCC + on wireless interfaces. As a result, newly created wireless + interfaces with default settings will have less chances to + violate country-specific regulations. @@ -458,6 +466,12 @@ OpenSSH has been updated to 7.2p2. + SSHv1 support has been removed from + OpenSSH. + + Support for DSA is disabled by default in + OpenSSH. + mdocml has been updated to version 1.12.3. @@ -1030,6 +1044,10 @@ To retain the previous behavior, add KERN_DEBUGDIR="" to &man.src.conf.5;. + + &arch.arm64; has been switched over to using + INTRNG by default. @@ -1317,6 +1335,9 @@ support is enabled by default on &arch.amd64;, &arch.arm64; and &arch.powerpc; + PCI-express HotPlug support has been + enabled for slots with power controllers + The &man.asmc.4; driver has been updated to support the &apple; MacMini 3,1. @@ -1530,6 +1551,11 @@ interrupts on AXP209 power management integrated circuits have been added. + Support for the Allwinner + Reduced Serial Bus (RSB) has been added. + + Support for Allwinner A20 HDMI + has been added. @@ -1551,6 +1577,10 @@ &man.ctld.8; utility has been updated to allow controlling non-iSCSI &man.ctl.4; ports. + Support + for parsing libucl-based configuration files has been added to + &man.ctld.8;. + The &man.autofs.5; subsystem has been updated to include a new &man.auto.master.5; map, -media, which @@ -1581,6 +1611,9 @@ Support for managing Shingled Magnetic Recording (SMR) drives has been added. + The + &man.camcontrol.8; command can manually force updating capacity + data after a disk gets resized using the reprobe subcommand. @@ -1600,6 +1633,13 @@ for the timeo, actimeo, noac, and proto options have been added to &man.mount.nfs.8;. + + The Mellanox implementation of iSER (iSCSI + Extensions for RDMA) has been imported. + + The ability to discover iSCSI targets without + having to attach to a target has been added to the + &man.iscsictl.8; command. @@ -1627,6 +1667,10 @@ The minimum and maximum values for the ZFS adaptive replacement cache can be modified at runtime. + + Four new + resources have been added to &man.rctl.8; to allow + throttles to be set on filesystem IO. @@ -1690,6 +1734,9 @@ updated to enable ttyu1, ttyu2, and ttyu3 by default, if the callin port is an active console port. + + The default installation directory for modules + has been changed to /boot/modules. @@ -1705,6 +1752,12 @@ This section describes changes that affect networking in &os;. + The unused SIOCSIFALIFETIME_IN6 + ioctl has been removed. + + Support to + be able to reroot into a NFSv4 volume has been added. + Network Protocols From owner-svn-src-stable-11@freebsd.org Sun Aug 28 00:21:25 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73EC1B78C97; Sun, 28 Aug 2016 00:21:25 +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 2BC80816; Sun, 28 Aug 2016 00:21:25 +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 u7S0LOL9005177; Sun, 28 Aug 2016 00:21:24 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S0LOxe005176; Sun, 28 Aug 2016 00:21:24 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201608280021.u7S0LOxe005176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Sun, 28 Aug 2016 00:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304930 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 00:21:25 -0000 Author: skreuzer (doc,ports committer) Date: Sun Aug 28 00:21:24 2016 New Revision: 304930 URL: https://svnweb.freebsd.org/changeset/base/304930 Log: Remove stale items Approved by: re (gjb, implicit, relnotes) Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Aug 28 00:12:45 2016 (r304929) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Aug 28 00:21:24 2016 (r304930) @@ -201,35 +201,9 @@ to restrict the output to only listing details about a single device. - A new flag, onifconsole - has been added to /etc/ttys. This allows - the system to provide a login prompt via serial console if the - device is an active kernel console, otherwise it is equivalent - to off. - Support for displaying VPD for PCI devices via &man.pciconf.8; has been added. - &man.ping.8; protects against malicious - network packets using the Capsicum framework to drop - privileges. - - The &man.ps.1; utility has been - updated to include the -J flag, used to - filter output by matching &man.jail.8; IDs and names. - Additionally, argument 0 can be used to - -J to only list processes running on the - host system. - - The &man.top.1; utility has been updated - to filter by &man.jail.8; ID or name, in followup to the - &man.ps.1; change in r265229. - - The &man.pmcstat.8; utility has been - updated to include a new flag, -l, which - ends event collection after the specified number of - seconds. - The &man.ps.1; utility has been updated to include a new keyword, tracer, which displays the PID of the tracing From owner-svn-src-stable-11@freebsd.org Sun Aug 28 05:18:40 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41287B7857B; Sun, 28 Aug 2016 05:18:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13BAA147; Sun, 28 Aug 2016 05:18:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S5Id2X014674; Sun, 28 Aug 2016 05:18:39 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S5Id8M014673; Sun, 28 Aug 2016 05:18:39 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608280518.u7S5Id8M014673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 28 Aug 2016 05:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304943 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 05:18:40 -0000 Author: alc Date: Sun Aug 28 05:18:39 2016 New Revision: 304943 URL: https://svnweb.freebsd.org/changeset/base/304943 Log: MFC r304050 Eliminate two calls to vm_page_xunbusy() that are both unnecessary and incorrect from the error cases in exec_map_first_page(). They are unnecessary because we automatically unbusy the page in vm_page_free() when we remove it from the object. The calls are incorrect because they happen after the page is freed, so we might actually unbusy the page after it has been reallocated to a different object. (This error was introduced in r292373.) Modified: stable/11/sys/kern/kern_exec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Sun Aug 28 05:07:13 2016 (r304942) +++ stable/11/sys/kern/kern_exec.c Sun Aug 28 05:18:39 2016 (r304943) @@ -990,7 +990,6 @@ exec_map_first_page(imgp) vm_page_lock(ma[0]); vm_page_free(ma[0]); vm_page_unlock(ma[0]); - vm_page_xunbusy(ma[0]); VM_OBJECT_WUNLOCK(object); return (EIO); } @@ -1018,7 +1017,6 @@ exec_map_first_page(imgp) vm_page_lock(ma[i]); vm_page_free(ma[i]); vm_page_unlock(ma[i]); - vm_page_xunbusy(ma[i]); } VM_OBJECT_WUNLOCK(object); return (EIO); From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:08:31 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1138EB78693; Sun, 28 Aug 2016 07:08:31 +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 D5935AB0; Sun, 28 Aug 2016 07:08:30 +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 u7S78Ukf055520; Sun, 28 Aug 2016 07:08:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S78UWg055519; Sun, 28 Aug 2016 07:08:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280708.u7S78UWg055519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304945 - stable/11/lib/libc/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:08:31 -0000 Author: ngie Date: Sun Aug 28 07:08:29 2016 New Revision: 304945 URL: https://svnweb.freebsd.org/changeset/base/304945 Log: MFC r304034: Initialize `ai` to NULL and test for `ai` with type-appropriate values Depending on the address family and ai_flags containing AI_V4MAPPED, it might not do a proper DNS lookup on the provided DNS address Convert some `ai` boolean true/false checks to NULL/non-NULL while here. PR: 211790 Modified: stable/11/lib/libc/net/getaddrinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/11/lib/libc/net/getaddrinfo.c Sun Aug 28 05:42:03 2016 (r304944) +++ stable/11/lib/libc/net/getaddrinfo.c Sun Aug 28 07:08:29 2016 (r304945) @@ -2249,6 +2249,8 @@ _dns_getaddrinfo(void *rv, void *cb_data struct res_target q, q2; res_state res; + ai = NULL; + hostname = va_arg(ap, char *); pai = va_arg(ap, const struct addrinfo *); @@ -2327,16 +2329,16 @@ _dns_getaddrinfo(void *rv, void *cb_data /* prefer IPv6 */ if (q.next) { ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai, res); - if (ai) { + if (ai != NULL) { cur->ai_next = ai; while (cur && cur->ai_next) cur = cur->ai_next; } } - if (!ai || pai->ai_family != AF_UNSPEC || + if (ai == NULL || pai->ai_family != AF_UNSPEC || (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) { ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); - if (ai) + if (ai != NULL) cur->ai_next = ai; } free(buf); From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:09:46 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEBD4B786F7; Sun, 28 Aug 2016 07:09:46 +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 B0752C1C; Sun, 28 Aug 2016 07:09:46 +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 u7S79jn4055643; Sun, 28 Aug 2016 07:09:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S79jiE055638; Sun, 28 Aug 2016 07:09:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280709.u7S79jiE055638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304946 - stable/11/tests/sys/acl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:09:47 -0000 Author: ngie Date: Sun Aug 28 07:09:45 2016 New Revision: 304946 URL: https://svnweb.freebsd.org/changeset/base/304946 Log: MFC r304040: Redirect the output of the testcases to stderr instead of redirecting it to /dev/null This will aid in debugging failures Modified: stable/11/tests/sys/acl/00.sh stable/11/tests/sys/acl/01.sh stable/11/tests/sys/acl/02.sh stable/11/tests/sys/acl/03.sh stable/11/tests/sys/acl/04.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/acl/00.sh ============================================================================== --- stable/11/tests/sys/acl/00.sh Sun Aug 28 07:08:29 2016 (r304945) +++ stable/11/tests/sys/acl/00.sh Sun Aug 28 07:09:45 2016 (r304946) @@ -75,7 +75,7 @@ chmod 600 xxx rm xxx echo "ok 2" -perl $TESTDIR/run $TESTDIR/tools-posix.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-posix.test >&2 if [ $? -eq 0 ]; then echo "ok 3" Modified: stable/11/tests/sys/acl/01.sh ============================================================================== --- stable/11/tests/sys/acl/01.sh Sun Aug 28 07:08:29 2016 (r304945) +++ stable/11/tests/sys/acl/01.sh Sun Aug 28 07:09:45 2016 (r304946) @@ -76,7 +76,7 @@ chmod 600 xxx rm xxx echo "ok 2" -perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2 if [ $? -eq 0 ]; then echo "ok 3" Modified: stable/11/tests/sys/acl/02.sh ============================================================================== --- stable/11/tests/sys/acl/02.sh Sun Aug 28 07:08:29 2016 (r304945) +++ stable/11/tests/sys/acl/02.sh Sun Aug 28 07:09:45 2016 (r304946) @@ -76,9 +76,9 @@ rm xxx echo "ok 2" if [ `sysctl -n vfs.acl_nfs4_old_semantics` = 0 ]; then - perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null + perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2 else - perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null + perl $TESTDIR/run $TESTDIR/tools-nfs4.test >&2 fi if [ $? -eq 0 ]; then Modified: stable/11/tests/sys/acl/03.sh ============================================================================== --- stable/11/tests/sys/acl/03.sh Sun Aug 28 07:08:29 2016 (r304945) +++ stable/11/tests/sys/acl/03.sh Sun Aug 28 07:09:45 2016 (r304946) @@ -89,7 +89,7 @@ echo "ok 3" cd $MNTROOT -perl $TESTDIR/run $TESTDIR/tools-crossfs.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-crossfs.test >&2 if [ $? -eq 0 ]; then echo "ok 4" Modified: stable/11/tests/sys/acl/04.sh ============================================================================== --- stable/11/tests/sys/acl/04.sh Sun Aug 28 07:08:29 2016 (r304945) +++ stable/11/tests/sys/acl/04.sh Sun Aug 28 07:09:45 2016 (r304946) @@ -57,7 +57,7 @@ echo "ok 1" cd $MNT -perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test >&2 if [ $? -eq 0 ]; then echo "ok 2" From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:10:49 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30CA2B78771; Sun, 28 Aug 2016 07:10:49 +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 01AF9DA4; Sun, 28 Aug 2016 07:10: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 u7S7AmH0057749; Sun, 28 Aug 2016 07:10:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S7Am7X057748; Sun, 28 Aug 2016 07:10:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280710.u7S7Am7X057748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304947 - stable/11/tests/sys/kern/acct X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:10:49 -0000 Author: ngie Date: Sun Aug 28 07:10:48 2016 New Revision: 304947 URL: https://svnweb.freebsd.org/changeset/base/304947 Log: MFC r304238: Only expect :encode_tv_random_million to fail on 64-bit platforms It passes on i386 Modified: stable/11/tests/sys/kern/acct/acct_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/acct/acct_test.c ============================================================================== --- stable/11/tests/sys/kern/acct/acct_test.c Sun Aug 28 07:09:45 2016 (r304946) +++ stable/11/tests/sys/kern/acct/acct_test.c Sun Aug 28 07:10:48 2016 (r304947) @@ -204,7 +204,10 @@ ATF_TC_BODY(encode_tv_random_million, tc struct timeval tv; long k; - atf_tc_expect_fail("the testcase violates FLT_EPSILON"); +#ifdef __LP64__ + atf_tc_expect_fail("the testcase violates FLT_EPSILON on 64-bit " + "platforms, e.g. amd64"); +#endif ATF_REQUIRE_MSG(unsetenv("TZ") == 0, "unsetting TZ failed; errno=%d", errno); From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:12:48 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B00D9B7888D; Sun, 28 Aug 2016 07:12: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 6882012F; Sun, 28 Aug 2016 07:12: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 u7S7ClKj059154; Sun, 28 Aug 2016 07:12:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S7ClG4059151; Sun, 28 Aug 2016 07:12:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280712.u7S7ClG4059151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304948 - in stable/11/cddl/usr.sbin/dtrace/tests: common/raise common/safety tools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:12:48 -0000 Author: ngie Date: Sun Aug 28 07:12:47 2016 New Revision: 304948 URL: https://svnweb.freebsd.org/changeset/base/304948 Log: MFC r303900: Highball memory requirement (4GB) with common/{raise,safety} Both test suites require more memory than my amd64 VM using GENERIC-NODEBUG can provide and reliably panic it with OOM issues in dtrace(4). Some of the testcases fail, but this at least bypasses the panic behavior on platforms that don't have enough resources Discussed with: markj Modified: stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile Sun Aug 28 07:10:48 2016 (r304947) +++ stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile Sun Aug 28 07:12:47 2016 (r304948) @@ -20,4 +20,6 @@ CFILES= \ tst.raise3.c \ +TEST_METADATA.t_dtrace_contrib+= required_memory="4g" + .include "../../dtrace.test.mk" Modified: stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Sun Aug 28 07:10:48 2016 (r304947) +++ stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Sun Aug 28 07:12:47 2016 (r304948) @@ -53,4 +53,6 @@ CFILES= \ +TEST_METADATA.t_dtrace_contrib+= required_memory="4g" + .include "../../dtrace.test.mk" Modified: stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Sun Aug 28 07:10:48 2016 (r304947) +++ stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Sun Aug 28 07:12:47 2016 (r304948) @@ -34,15 +34,28 @@ genmakefile() # One-off variable definitions. local special - if [ "$basedir" = proc ]; then + case "$basedir" in + proc) special=" LIBADD.tst.sigwait.exe+= rt " - elif [ "$basedir" = uctf ]; then + ;; + raise) + special=" +TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\" +" + ;; + safety) + special=" +TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\" +" + ;; + uctf) special=" WITH_CTF=YES " - fi + ;; + esac local makefile=$(mktemp) cat <<__EOF__ > $makefile From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:16:13 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A0FB78919; Sun, 28 Aug 2016 07:16: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 C49AA2B2; Sun, 28 Aug 2016 07:16:12 +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 u7S7GCoW059361; Sun, 28 Aug 2016 07:16:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S7GBQQ059359; Sun, 28 Aug 2016 07:16:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280716.u7S7GBQQ059359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304949 - stable/11/usr.bin/getconf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:16:13 -0000 Author: ngie Date: Sun Aug 28 07:16:11 2016 New Revision: 304949 URL: https://svnweb.freebsd.org/changeset/base/304949 Log: MFC r303830,r304693,r304694,r304698: r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*] r304693: Clean up trailing whitespace r304694: Add `MIN_HOLE_SIZE` pathconf(2) support to getconf This allows shell programs to programmatically determine whether or not a filesystem supports sparse files r304698: Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4 The TRUSTEDBSD prefix was chosen for consistency with the other related `_PC_ACL*` prefixed variables. Modified: stable/11/usr.bin/getconf/getconf.c stable/11/usr.bin/getconf/pathconf.gperf Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/getconf/getconf.c ============================================================================== --- stable/11/usr.bin/getconf/getconf.c Sun Aug 28 07:12:47 2016 (r304948) +++ stable/11/usr.bin/getconf/getconf.c Sun Aug 28 07:16:11 2016 (r304949) @@ -109,13 +109,13 @@ main(int argc, char **argv) do_confstr(name, key); else printf("undefined\n"); - } else { + } else { valid = find_sysconf(name, &key); if (valid > 0) { do_sysconf(name, key); } else if (valid < 0) { printf("undefined\n"); - } else + } else errx(EX_USAGE, "no such configuration parameter `%s'", name); Modified: stable/11/usr.bin/getconf/pathconf.gperf ============================================================================== --- stable/11/usr.bin/getconf/pathconf.gperf Sun Aug 28 07:12:47 2016 (r304948) +++ stable/11/usr.bin/getconf/pathconf.gperf Sun Aug 28 07:16:11 2016 (r304949) @@ -24,6 +24,7 @@ FILESIZEBITS, _PC_FILESIZEBITS LINK_MAX, _PC_LINK_MAX MAX_CANON, _PC_MAX_CANON MAX_INPUT, _PC_MAX_INPUT +MIN_HOLE_SIZE, _PC_MIN_HOLE_SIZE NAME_MAX, _PC_NAME_MAX PATH_MAX, _PC_PATH_MAX PIPE_BUF, _PC_PIPE_BUF @@ -34,6 +35,7 @@ POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFE POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN SYMLINK_MAX, _PC_SYMLINK_MAX TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED +TRUSTEDBSD_ACL_NFS4, _PC_ACL_NFS4 TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:17:26 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE510B78992; Sun, 28 Aug 2016 07:17:26 +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 BE767644; Sun, 28 Aug 2016 07:17:26 +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 u7S7HPPv059482; Sun, 28 Aug 2016 07:17:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S7HP8r059481; Sun, 28 Aug 2016 07:17:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280717.u7S7HP8r059481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304950 - stable/11/lib/libc/tests/resolv X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:17:27 -0000 Author: ngie Date: Sun Aug 28 07:17:25 2016 New Revision: 304950 URL: https://svnweb.freebsd.org/changeset/base/304950 Log: MFC r304033: Increase timeout from 10 minutes to 20 minutes for all tests On particular slow networks, it can (on average) take longer to resolve hosts to IP* addresses. 20 minutes seemed reasonable for my work network This will be solved in a more meaningful way (if possible) using concurrency in the near future Modified: stable/11/lib/libc/tests/resolv/resolv_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/resolv/resolv_test.c ============================================================================== --- stable/11/lib/libc/tests/resolv/resolv_test.c Sun Aug 28 07:16:11 2016 (r304949) +++ stable/11/lib/libc/tests/resolv/resolv_test.c Sun Aug 28 07:17:25 2016 (r304950) @@ -291,7 +291,7 @@ do { \ ATF_TC(getaddrinfo_test); ATF_TC_HEAD(getaddrinfo_test, tc) { - atf_tc_set_md_var(tc, "timeout", "450"); + atf_tc_set_md_var(tc, "timeout", "1200"); } ATF_TC_BODY(getaddrinfo_test, tc) { @@ -301,7 +301,7 @@ ATF_TC_BODY(getaddrinfo_test, tc) ATF_TC(gethostby_test); ATF_TC_HEAD(gethostby_test, tc) { - atf_tc_set_md_var(tc, "timeout", "450"); + atf_tc_set_md_var(tc, "timeout", "1200"); } ATF_TC_BODY(gethostby_test, tc) { @@ -312,7 +312,7 @@ ATF_TC_BODY(gethostby_test, tc) ATF_TC(getipnodeby_test); ATF_TC_HEAD(getipnodeby_test, tc) { - atf_tc_set_md_var(tc, "timeout", "450"); + atf_tc_set_md_var(tc, "timeout", "1200"); } ATF_TC_BODY(getipnodeby_test, tc) { From owner-svn-src-stable-11@freebsd.org Sun Aug 28 07:19:34 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D69D4B789EE; Sun, 28 Aug 2016 07:19:34 +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 A90FB807; Sun, 28 Aug 2016 07:19:34 +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 u7S7JXG3059612; Sun, 28 Aug 2016 07:19:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S7JXL7059611; Sun, 28 Aug 2016 07:19:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608280719.u7S7JXL7059611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 28 Aug 2016 07:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304951 - stable/11/usr.bin/tar/tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 07:19:34 -0000 Author: ngie Date: Sun Aug 28 07:19:33 2016 New Revision: 304951 URL: https://svnweb.freebsd.org/changeset/base/304951 Log: MFC r303804: Fix building usr.bin/tar/tests with PIE symbol building enabled by removing CFLAGS+= -static `CFLAGS+= -static` was a carryover from pre-r289195 with usr.bin/tar/test/Makefile that should have been specified in LDFLAGS There doesn't seem to be an apparent need for static compilation of the test binaries. Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002) Modified: stable/11/usr.bin/tar/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/tar/tests/Makefile ============================================================================== --- stable/11/usr.bin/tar/tests/Makefile Sun Aug 28 07:17:25 2016 (r304950) +++ stable/11/usr.bin/tar/tests/Makefile Sun Aug 28 07:19:33 2016 (r304951) @@ -9,7 +9,6 @@ ATF_TESTS_SH+= functional_test BINDIR= ${TESTSDIR} CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\" -CFLAGS+= -static CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR} CFLAGS+= -I${_LIBARCHIVEDIR}/tar -I${_LIBARCHIVEDIR}/test_utils From owner-svn-src-stable-11@freebsd.org Sun Aug 28 08:49:57 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34E5CB778CD; Sun, 28 Aug 2016 08:49:57 +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 D9DB4779; Sun, 28 Aug 2016 08:49: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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 913863C82ED; Sun, 28 Aug 2016 18:49:46 +1000 (AEST) Date: Sun, 28 Aug 2016 18:49:45 +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-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r304947 - stable/11/tests/sys/kern/acct In-Reply-To: <201608280710.u7S7Am7X057748@repo.freebsd.org> Message-ID: <20160828174315.E1696@besplex.bde.org> References: <201608280710.u7S7Am7X057748@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=CoZCCSMD 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=E_Nap1b-OaeuWiuqp0EA:9 a=-WCYPtOOOc7DIrD1:21 a=M3j2CLTmEwHoSjr9:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 08:49:57 -0000 On Sun, 28 Aug 2016, Garrett Cooper wrote: > Log: > MFC r304238: > > Only expect :encode_tv_random_million to fail on 64-bit platforms > > It passes on i386 This can't depend on 64-bitness. It might depend on FLT_EPSILON, but IEEE might require a specific representation of floats and we only have and only support one. This is probably a bug in the tests that shows up on arches with extra precision. Perhaps just a complier bug. > Modified: stable/11/tests/sys/kern/acct/acct_test.c > ============================================================================== > --- stable/11/tests/sys/kern/acct/acct_test.c Sun Aug 28 07:09:45 2016 (r304946) > +++ stable/11/tests/sys/kern/acct/acct_test.c Sun Aug 28 07:10:48 2016 (r304947) > @@ -204,7 +204,10 @@ ATF_TC_BODY(encode_tv_random_million, tc > struct timeval tv; > long k; > > - atf_tc_expect_fail("the testcase violates FLT_EPSILON"); > +#ifdef __LP64__ > + atf_tc_expect_fail("the testcase violates FLT_EPSILON on 64-bit " > + "platforms, e.g. amd64"); > +#endif > > ATF_REQUIRE_MSG(unsetenv("TZ") == 0, "unsetting TZ failed; errno=%d", errno); The rest of the function is: X for (k = 1; k < 1000000L; k++) { X tv.tv_sec = random(); X tv.tv_usec = (random() % 1000000L); X v.c = encode_timeval(tv); X check_result(atf_tc_get_ident(tc), X (float)tv.tv_sec * AHZ + tv.tv_usec, v); X } AHZ here is less than an obfuscation of literal 10000000 or just 1e6 or 1e6F. It doesn't even have the style bug of an L suffix like the nearby literals. Types are important here, but the L isn't. AHZ used to be a constant related to fixed-point conversions in acct.h. It used to have value 1000. Note much like the AHZ. now devfines AHZV1 and this has value 64. This is for a legacy API. Not very compatible. This file doesn't include except possibly via namespace pollution, so it doesn't get any AHZ*. It only uses AHZ to convert tv_sec to usec. This was magical and may be broken. The file convert.c is included. This is a converted copy of kern_acct.c. Back when AHZ existed in acct.h, kern_acct.c used to use AHZ with its different value. I don't see how overriding that value either didn't cause a redefinition error or inconsistencies. Now kern_acct.c doesn't use either AHZ* so this definition is not magical. So AHZ should be replaced by literal 1000000 except possibly for type problems. IIRC, C99 specifies the dubious behaviour of converting integers to float in float expressions to support the dubious behaviour of evaluating float expressions in float precision. 1000000 is even exactly representable in float precision. But the result of the mutliplication isn't in general. Adding a small tv_usec to a not very large tv_sec converted to usec is almost certain to not be representable in a 32-bit float after a few random choices. So we expect innacuracies. The float expression may be evaluated in extra precision, and is on i386. So we expect smaller inaccuracies on i386. It is not clear if remaining bugs are in the test or the compiler. Probably both. The test asks for inaccuracies and gets them in the expression sometimes. It doesn't try to force the inaccuracies by casting to float, and only C90+ compilers do this cast as specified since the specification specifies behaviour that is too pessimal to use. C90+ compilers are in short supply, but gcc later than aout 4.6 properlay pessimizes the cast when instructed to by certain compiler flags. But the test it calls a function which should do the conversion. It takes excessive inlining combined with the de-pessimization to not do the conversion. Apparently, clang does do the excessive inlining. Otherwise the result would be the same on i386 as on amd64. The test seems to be quite broken. encode_timeval() does some conversion which is presumably correct. We calculate a value in usec to compare against. This is only done in float precision (possibly higher, but we don't control this). We expect a relative error of about FLT_EPSILON in this. Later we convert to a relative error, so this is only slightly broken. encode_timeval() must have a rounding error, and our calculation has one and the scaling has more. So we should expect errors of several times FLT_EPSILON. So the test only seems to be slightly broken. Strictly less than FLT_EPSILON is too strict if the calculations are actually done in float precision since it is too difficult to calculate the reference and do the scaling without increasing the error. The worst case for the reference is tv_sec = 2**31-1 (31 bits) and tv_usec = 999999 (20 bits). That is exactly representable in 53 bits (double precision) so we should use that. Bruce From owner-svn-src-stable-11@freebsd.org Sun Aug 28 15:23:46 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED121BA6D23; Sun, 28 Aug 2016 15:23:46 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from anoxia.adamw.org (anoxia.adamw.org [104.225.8.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anoxia.adamw.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA11B01; Sun, 28 Aug 2016 15:23:46 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by anoxia.adamw.org (OpenSMTPD) with ESMTPSA id fe0a1008 TLS version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO; Sun, 28 Aug 2016 09:23:45 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304949 - stable/11/usr.bin/getconf From: Adam Weinberger In-Reply-To: <201608280716.u7S7GBQQ059359@repo.freebsd.org> Date: Sun, 28 Aug 2016 09:23:41 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9F020217-DA91-43FD-9A9A-183ED9851C34@adamw.org> References: <201608280716.u7S7GBQQ059359@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 15:23:47 -0000 > On 28 Aug, 2016, at 1:16, Garrett Cooper wrote: >=20 > Author: ngie > Date: Sun Aug 28 07:16:11 2016 > New Revision: 304949 > URL: https://svnweb.freebsd.org/changeset/base/304949 >=20 > Log: > MFC r303830,r304693,r304694,r304698: >=20 > r303830: >=20 > Remove vestigal references to __alpha__ >=20 > Replace alpha reference in getconf(1) with amd64 [*] >=20 > PR: 211300 [*] Hi Garrett, It doesn't look like the contents of r303830 were part of that MFC. I'm = not sure if that was intentional, so this is just a head's up. # Adam --=20 Adam Weinberger adamw@adamw.org http://www.adamw.org From owner-svn-src-stable-11@freebsd.org Mon Aug 29 04:46:00 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A0D9B77CE7; Mon, 29 Aug 2016 04:46:00 +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 DFD96FF2; Mon, 29 Aug 2016 04:45:59 +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 u7T4jx7I035659; Mon, 29 Aug 2016 04:45:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T4jxYJ035658; Mon, 29 Aug 2016 04:45:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290445.u7T4jxYJ035658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 04:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304974 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 04:46:00 -0000 Author: kib Date: Mon Aug 29 04:45:58 2016 New Revision: 304974 URL: https://svnweb.freebsd.org/changeset/base/304974 Log: MFC r303548: Cache getbintime(9) answer in timehands. Modified: stable/11/sys/kern/kern_tc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_tc.c ============================================================================== --- stable/11/sys/kern/kern_tc.c Mon Aug 29 04:44:24 2016 (r304973) +++ stable/11/sys/kern/kern_tc.c Mon Aug 29 04:45:58 2016 (r304974) @@ -68,6 +68,7 @@ struct timehands { uint64_t th_scale; u_int th_offset_count; struct bintime th_offset; + struct bintime th_bintime; struct timeval th_microtime; struct timespec th_nanotime; struct bintime th_boottime; @@ -235,9 +236,8 @@ fbclock_bintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; + *bt = th->th_bintime; bintime_addx(bt, th->th_scale * tc_delta(th)); - bintime_add(bt, &th->th_boottime); atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -311,8 +311,7 @@ fbclock_getbintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; - bintime_add(bt, &th->th_boottime); + *bt = th->th_bintime; atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -387,9 +386,8 @@ bintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; + *bt = th->th_bintime; bintime_addx(bt, th->th_scale * tc_delta(th)); - bintime_add(bt, &th->th_boottime); atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -463,8 +461,7 @@ getbintime(struct bintime *bt) do { th = timehands; gen = atomic_load_acq_int(&th->th_generation); - *bt = th->th_offset; - bintime_add(bt, &th->th_boottime); + *bt = th->th_bintime; atomic_thread_fence_acq(); } while (gen == 0 || gen != th->th_generation); } @@ -1389,6 +1386,8 @@ tc_windup(struct bintime *new_boottimebi if (bt.sec != t) th->th_boottime.sec += bt.sec - t; } + th->th_bintime = th->th_offset; + bintime_add(&th->th_bintime, &th->th_boottime); /* Update the UTC timestamps used by the get*() functions. */ /* XXX shouldn't do this here. Should force non-`get' versions. */ bintime2timeval(&bt, &th->th_microtime); @@ -1808,9 +1807,8 @@ pps_event(struct pps_state *pps, int eve /* Convert the count to a timespec. */ tcount = pps->capcount - pps->capth->th_offset_count; tcount &= pps->capth->th_counter->tc_counter_mask; - bt = pps->capth->th_offset; + bt = pps->capth->th_bintime; bintime_addx(&bt, pps->capth->th_scale * tcount); - bintime_add(&bt, &pps->capth->th_boottime); bintime2timespec(&bt, &ts); /* If the timecounter was wound up underneath us, bail out. */ From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:15:44 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6F41BC5557; Mon, 29 Aug 2016 05:15:44 +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 BF50B34E; Mon, 29 Aug 2016 05:15:44 +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 u7T5FhbE046674; Mon, 29 Aug 2016 05:15:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5FhPf046667; Mon, 29 Aug 2016 05:15:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290515.u7T5FhPf046667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304977 - in stable/11: include lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:15:45 -0000 Author: kib Date: Mon Aug 29 05:15:43 2016 New Revision: 304977 URL: https://svnweb.freebsd.org/changeset/base/304977 Log: MFC r304176: Add a trivial implementation of fdatasync(2). Modified: stable/11/include/unistd.h stable/11/lib/libc/sys/Symbol.map stable/11/sys/compat/freebsd32/syscalls.master stable/11/sys/kern/syscalls.master stable/11/sys/kern/vfs_default.c stable/11/sys/kern/vfs_syscalls.c stable/11/sys/kern/vnode_if.src Directory Properties: stable/11/ (props changed) Modified: stable/11/include/unistd.h ============================================================================== --- stable/11/include/unistd.h Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/include/unistd.h Mon Aug 29 05:15:43 2016 (r304977) @@ -384,6 +384,7 @@ extern int optind, opterr, optopt; /* ISO/IEC 9945-1: 1996 */ #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE int fsync(int); +int fdatasync(int); /* * ftruncate() was in the POSIX Realtime Extension (it's used for shared Modified: stable/11/lib/libc/sys/Symbol.map ============================================================================== --- stable/11/lib/libc/sys/Symbol.map Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/lib/libc/sys/Symbol.map Mon Aug 29 05:15:43 2016 (r304977) @@ -398,6 +398,10 @@ FBSD_1.4 { recvmmsg; }; +FBSD_1.5 { + fdatasync; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; @@ -588,6 +592,8 @@ FBSDprivate_1.0 { __sys_fstatfs; _fsync; __sys_fsync; + _fdatasync; + __sys_fdatasync; _futimes; __sys_futimes; _getaudit; Modified: stable/11/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/11/sys/compat/freebsd32/syscalls.master Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/sys/compat/freebsd32/syscalls.master Mon Aug 29 05:15:43 2016 (r304977) @@ -1081,3 +1081,4 @@ 549 AUE_NULL NOPROTO { int numa_setaffinity(cpuwhich_t which, \ id_t id, \ const struct vm_domain_policy *policy); } +550 AUE_FSYNC NOPROTO { int fdatasync(int fd); } Modified: stable/11/sys/kern/syscalls.master ============================================================================== --- stable/11/sys/kern/syscalls.master Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/sys/kern/syscalls.master Mon Aug 29 05:15:43 2016 (r304977) @@ -993,8 +993,9 @@ id_t id, \ struct vm_domain_policy_entry *policy); } 549 AUE_NULL STD { int numa_setaffinity(cpuwhich_t which, \ - id_t id, \ - const struct vm_domain_policy_entry *policy); } + id_t id, const struct \ + vm_domain_policy_entry *policy); } +550 AUE_FSYNC STD { int fdatasync(int fd); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/sys/kern/vfs_default.c Mon Aug 29 05:15:43 2016 (r304977) @@ -83,6 +83,7 @@ static int vop_stdset_text(struct vop_se static int vop_stdunset_text(struct vop_unset_text_args *ap); static int vop_stdget_writecount(struct vop_get_writecount_args *ap); static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); +static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); /* @@ -111,6 +112,7 @@ struct vop_vector default_vnodeops = { .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, + .vop_fdatasync = vop_stdfdatasync, .vop_getpages = vop_stdgetpages, .vop_getpages_async = vop_stdgetpages_async, .vop_getwritemount = vop_stdgetwritemount, @@ -726,6 +728,13 @@ loop2: return (error); } +static int +vop_stdfdatasync(struct vop_fdatasync_args *ap) +{ + + return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); +} + /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ int vop_stdgetpages(ap) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/sys/kern/vfs_syscalls.c Mon Aug 29 05:15:43 2016 (r304977) @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st } #endif -/* - * Sync an open file. - */ -#ifndef _SYS_SYSPROTO_H_ -struct fsync_args { - int fd; -}; -#endif -int -sys_fsync(td, uap) - struct thread *td; - struct fsync_args /* { - int fd; - } */ *uap; +static int +kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; struct mount *mp; @@ -3375,11 +3363,15 @@ sys_fsync(td, uap) cap_rights_t rights; int error, lock_flags; - AUDIT_ARG_FD(uap->fd); - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); + AUDIT_ARG_FD(fd); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSYNC), &fp); if (error != 0) return (error); vp = fp->f_vnode; +#if 0 + if (!fullsync) + /* XXXKIB: compete outstanding aio writes */; +#endif error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) goto drop; @@ -3396,8 +3388,7 @@ sys_fsync(td, uap) vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - error = VOP_FSYNC(vp, MNT_WAIT, td); - + error = fullsync ? VOP_FSYNC(vp, MNT_WAIT, td) : VOP_FDATASYNC(vp, td); VOP_UNLOCK(vp, 0); vn_finished_write(mp); drop: @@ -3406,6 +3397,28 @@ drop: } /* + * Sync an open file. + */ +#ifndef _SYS_SYSPROTO_H_ +struct fsync_args { + int fd; +}; +#endif +int +sys_fsync(struct thread *td, struct fsync_args *uap) +{ + + return (kern_fsync(td, uap->fd, true)); +} + +int +sys_fdatasync(struct thread *td, struct fdatasync_args *uap) +{ + + return (kern_fsync(td, uap->fd, false)); +} + +/* * Rename files. Source and destination must either both be directories, or * both not be directories. If target is a directory, it must be empty. */ Modified: stable/11/sys/kern/vnode_if.src ============================================================================== --- stable/11/sys/kern/vnode_if.src Mon Aug 29 05:08:53 2016 (r304976) +++ stable/11/sys/kern/vnode_if.src Mon Aug 29 05:15:43 2016 (r304977) @@ -707,6 +707,14 @@ vop_add_writecount { IN int inc; }; +%% fdatasync vp L L L + +vop_fdatasync { + IN struct vnode *vp; + IN struct thread *td; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:17:47 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15AB8BC55CA; Mon, 29 Aug 2016 05:17:47 +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 E5BDE8D1; Mon, 29 Aug 2016 05:17: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 u7T5Hkdg046793; Mon, 29 Aug 2016 05:17:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5HjWx046782; Mon, 29 Aug 2016 05:17:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290517.u7T5HjWx046782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304978 - in stable/11/sys: compat/freebsd32 kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:17:47 -0000 Author: kib Date: Mon Aug 29 05:17:44 2016 New Revision: 304978 URL: https://svnweb.freebsd.org/changeset/base/304978 Log: Regen Modified: stable/11/sys/compat/freebsd32/freebsd32_proto.h stable/11/sys/compat/freebsd32/freebsd32_syscall.h stable/11/sys/compat/freebsd32/freebsd32_syscalls.c stable/11/sys/compat/freebsd32/freebsd32_sysent.c stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c stable/11/sys/kern/init_sysent.c stable/11/sys/kern/syscalls.c stable/11/sys/kern/systrace_args.c stable/11/sys/sys/syscall.h stable/11/sys/sys/syscall.mk stable/11/sys/sys/sysproto.h Modified: stable/11/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_proto.h Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/compat/freebsd32/freebsd32_proto.h Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/11/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_syscall.h Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/compat/freebsd32/freebsd32_syscall.h Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -457,4 +457,5 @@ #define FREEBSD32_SYS_freebsd32_utimensat 547 #define FREEBSD32_SYS_numa_getaffinity 548 #define FREEBSD32_SYS_numa_setaffinity 549 -#define FREEBSD32_SYS_MAXSYSCALL 550 +#define FREEBSD32_SYS_fdatasync 550 +#define FREEBSD32_SYS_MAXSYSCALL 551 Modified: stable/11/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib */ const char *freebsd32_syscallnames[] = { @@ -583,4 +583,5 @@ const char *freebsd32_syscallnames[] = { "freebsd32_utimensat", /* 547 = freebsd32_utimensat */ "numa_getaffinity", /* 548 = numa_getaffinity */ "numa_setaffinity", /* 549 = numa_setaffinity */ + "fdatasync", /* 550 = fdatasync */ }; Modified: stable/11/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_sysent.c Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/compat/freebsd32/freebsd32_sysent.c Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks + * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib */ #include "opt_compat.h" @@ -626,4 +626,5 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */ { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ }; Modified: stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Aug 29 05:17:44 2016 (r304978) @@ -3316,6 +3316,13 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } + /* fdatasync */ + case 550: { + struct fdatasync_args *p = params; + iarg[0] = p->fd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8902,6 +8909,16 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* fdatasync */ + case 550: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10783,6 +10800,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* fdatasync */ + case 550: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: stable/11/sys/kern/init_sysent.c ============================================================================== --- stable/11/sys/kern/init_sysent.c Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/kern/init_sysent.c Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/kern/syscalls.master 303854 2016-08-08 20:23:11Z bdrewery + * created from FreeBSD: stable/11/sys/kern/syscalls.master 304977 2016-08-29 05:15:43Z kib */ #include "opt_compat.h" @@ -596,4 +596,5 @@ struct sysent sysent[] = { { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ }; Modified: stable/11/sys/kern/syscalls.c ============================================================================== --- stable/11/sys/kern/syscalls.c Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/kern/syscalls.c Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/kern/syscalls.master 303854 2016-08-08 20:23:11Z bdrewery + * created from FreeBSD: stable/11/sys/kern/syscalls.master 304977 2016-08-29 05:15:43Z kib */ const char *syscallnames[] = { @@ -557,4 +557,5 @@ const char *syscallnames[] = { "utimensat", /* 547 = utimensat */ "numa_getaffinity", /* 548 = numa_getaffinity */ "numa_setaffinity", /* 549 = numa_setaffinity */ + "fdatasync", /* 550 = fdatasync */ }; Modified: stable/11/sys/kern/systrace_args.c ============================================================================== --- stable/11/sys/kern/systrace_args.c Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/kern/systrace_args.c Mon Aug 29 05:17:44 2016 (r304978) @@ -3326,6 +3326,13 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } + /* fdatasync */ + case 550: { + struct fdatasync_args *p = params; + iarg[0] = p->fd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8862,6 +8869,16 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* fdatasync */ + case 550: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10778,6 +10795,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* fdatasync */ + case 550: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: stable/11/sys/sys/syscall.h ============================================================================== --- stable/11/sys/sys/syscall.h Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/sys/syscall.h Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/kern/syscalls.master 303854 2016-08-08 20:23:11Z bdrewery + * created from FreeBSD: stable/11/sys/kern/syscalls.master 304977 2016-08-29 05:15:43Z kib */ #define SYS_syscall 0 @@ -467,4 +467,5 @@ #define SYS_utimensat 547 #define SYS_numa_getaffinity 548 #define SYS_numa_setaffinity 549 -#define SYS_MAXSYSCALL 550 +#define SYS_fdatasync 550 +#define SYS_MAXSYSCALL 551 Modified: stable/11/sys/sys/syscall.mk ============================================================================== --- stable/11/sys/sys/syscall.mk Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/sys/syscall.mk Mon Aug 29 05:17:44 2016 (r304978) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/11/sys/kern/syscalls.master 303854 2016-08-08 20:23:11Z bdrewery +# created from FreeBSD: stable/11/sys/kern/syscalls.master 304977 2016-08-29 05:15:43Z kib MIASM = \ syscall.o \ exit.o \ @@ -395,4 +395,5 @@ MIASM = \ futimens.o \ utimensat.o \ numa_getaffinity.o \ - numa_setaffinity.o + numa_setaffinity.o \ + fdatasync.o Modified: stable/11/sys/sys/sysproto.h ============================================================================== --- stable/11/sys/sys/sysproto.h Mon Aug 29 05:15:43 2016 (r304977) +++ stable/11/sys/sys/sysproto.h Mon Aug 29 05:17:44 2016 (r304978) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/11/sys/kern/syscalls.master 303854 2016-08-08 20:23:11Z bdrewery + * created from FreeBSD: stable/11/sys/kern/syscalls.master 304977 2016-08-29 05:15:43Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1788,6 +1788,9 @@ struct numa_setaffinity_args { char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char policy_l_[PADL_(const struct vm_domain_policy_entry *)]; const struct vm_domain_policy_entry * policy; char policy_r_[PADR_(const struct vm_domain_policy_entry *)]; }; +struct fdatasync_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2174,6 +2177,7 @@ int sys_futimens(struct thread *, struct int sys_utimensat(struct thread *, struct utimensat_args *); int sys_numa_getaffinity(struct thread *, struct numa_getaffinity_args *); int sys_numa_setaffinity(struct thread *, struct numa_setaffinity_args *); +int sys_fdatasync(struct thread *, struct fdatasync_args *); #ifdef COMPAT_43 @@ -2951,6 +2955,7 @@ int freebsd10_pipe(struct thread *, stru #define SYS_AUE_utimensat AUE_FUTIMESAT #define SYS_AUE_numa_getaffinity AUE_NULL #define SYS_AUE_numa_setaffinity AUE_NULL +#define SYS_AUE_fdatasync AUE_FSYNC #undef PAD_ #undef PADL_ From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:37:05 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D575BC5F91; Mon, 29 Aug 2016 05:37:05 +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 5160D30B; Mon, 29 Aug 2016 05:37:05 +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 u7T5b45o054272; Mon, 29 Aug 2016 05:37:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5b4bE054266; Mon, 29 Aug 2016 05:37:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290537.u7T5b4bE054266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304980 - in stable/11: lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:37:05 -0000 Author: kib Date: Mon Aug 29 05:37:03 2016 New Revision: 304980 URL: https://svnweb.freebsd.org/changeset/base/304980 Log: MFC r304209: The fdatasync(2) call must be cancellation point. Added: stable/11/lib/libc/sys/fdatasync.c - copied unchanged from r304209, head/lib/libc/sys/fdatasync.c Modified: stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/sys/Makefile.inc stable/11/lib/libc/sys/interposing_table.c stable/11/lib/libthr/thread/thr_syscalls.c stable/11/share/man/man3/pthread_testcancel.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Mon Aug 29 05:35:35 2016 (r304979) +++ stable/11/lib/libc/include/libc_private.h Mon Aug 29 05:37:03 2016 (r304980) @@ -228,6 +228,7 @@ enum { INTERPOS_wait6, INTERPOS_ppoll, INTERPOS_map_stacks_exec, + INTERPOS_fdatasync, INTERPOS_MAX }; @@ -318,6 +319,7 @@ int __sys_clock_gettime(__clockid_t, st int __sys_close(int); int __sys_connect(int, const struct sockaddr *, __socklen_t); int __sys_fcntl(int, int, ...); +int __sys_fdatasync(int); int __sys_fsync(int); __pid_t __sys_fork(void); int __sys_ftruncate(int, __off_t); Modified: stable/11/lib/libc/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/sys/Makefile.inc Mon Aug 29 05:35:35 2016 (r304979) +++ stable/11/lib/libc/sys/Makefile.inc Mon Aug 29 05:37:03 2016 (r304980) @@ -37,6 +37,7 @@ INTERPOSED = \ close \ connect \ fcntl \ + fdatasync \ fsync \ fork \ kevent \ Copied: stable/11/lib/libc/sys/fdatasync.c (from r304209, head/lib/libc/sys/fdatasync.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/sys/fdatasync.c Mon Aug 29 05:37:03 2016 (r304980, copy of r304209, head/lib/libc/sys/fdatasync.c) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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 "libc_private.h" + +int +fdatasync(int fd) +{ + + return (((int (*)(int))__libc_interposing[INTERPOS_fdatasync])(fd)); +} Modified: stable/11/lib/libc/sys/interposing_table.c ============================================================================== --- stable/11/lib/libc/sys/interposing_table.c Mon Aug 29 05:35:35 2016 (r304979) +++ stable/11/lib/libc/sys/interposing_table.c Mon Aug 29 05:37:03 2016 (r304980) @@ -79,6 +79,7 @@ interpos_func_t __libc_interposing[INTER SLOT(wait6, __sys_wait6), SLOT(ppoll, __sys_ppoll), SLOT(map_stacks_exec, __libc_map_stacks_exec), + SLOT(fdatasync, __sys_fdatasync), }; #undef SLOT Modified: stable/11/lib/libthr/thread/thr_syscalls.c ============================================================================== --- stable/11/lib/libthr/thread/thr_syscalls.c Mon Aug 29 05:35:35 2016 (r304979) +++ stable/11/lib/libthr/thread/thr_syscalls.c Mon Aug 29 05:37:03 2016 (r304980) @@ -227,6 +227,20 @@ __thr_fsync(int fd) return (ret); } +static int +__thr_fdatasync(int fd) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter2(curthread, 0); + ret = __sys_fdatasync(fd); + _thr_cancel_leave(curthread, 1); + + return (ret); +} + /* * Cancellation behavior: * Thread may be canceled after system call. @@ -653,6 +667,7 @@ __thr_interpose_libc(void) SLOT(wait6); SLOT(ppoll); SLOT(map_stacks_exec); + SLOT(fdatasync); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = Modified: stable/11/share/man/man3/pthread_testcancel.3 ============================================================================== --- stable/11/share/man/man3/pthread_testcancel.3 Mon Aug 29 05:35:35 2016 (r304979) +++ stable/11/share/man/man3/pthread_testcancel.3 Mon Aug 29 05:37:03 2016 (r304980) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd April 16, 2015 +.Dd August 16, 2016 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -114,6 +114,7 @@ function is a cancellation point if .Fa cmd is .Dv F_SETLKW . +.It Fn fdatasync .It Fn fsync .It Fn kevent The From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:40:23 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40624B77026; Mon, 29 Aug 2016 05:40:23 +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 E7C5F695; Mon, 29 Aug 2016 05:40:22 +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 u7T5eMI2054466; Mon, 29 Aug 2016 05:40:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5eLej054463; Mon, 29 Aug 2016 05:40:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290540.u7T5eLej054463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304981 - in stable/11/sys: fs/msdosfs kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:40:23 -0000 Author: kib Date: Mon Aug 29 05:40:21 2016 New Revision: 304981 URL: https://svnweb.freebsd.org/changeset/base/304981 Log: MFC r304178: Implement VOP_FDATASYNC() for msdosfs. Modified: stable/11/sys/fs/msdosfs/msdosfs_vnops.c stable/11/sys/kern/vfs_default.c stable/11/sys/sys/vnode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 29 05:37:03 2016 (r304980) +++ stable/11/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 29 05:40:21 2016 (r304981) @@ -1897,6 +1897,7 @@ struct vop_vector msdosfs_vnodeops = { .vop_close = msdosfs_close, .vop_create = msdosfs_create, .vop_fsync = msdosfs_fsync, + .vop_fdatasync = vop_stdfdatasync_buf, .vop_getattr = msdosfs_getattr, .vop_inactive = msdosfs_inactive, .vop_link = msdosfs_link, Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Mon Aug 29 05:37:03 2016 (r304980) +++ stable/11/sys/kern/vfs_default.c Mon Aug 29 05:40:21 2016 (r304981) @@ -735,6 +735,17 @@ vop_stdfdatasync(struct vop_fdatasync_ar return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); } +int +vop_stdfdatasync_buf(struct vop_fdatasync_args *ap) +{ + struct vop_fsync_args apf; + + apf.a_vp = ap->a_vp; + apf.a_waitfor = MNT_WAIT; + apf.a_td = ap->a_td; + return (vop_stdfsync(&apf)); +} + /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ int vop_stdgetpages(ap) Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Mon Aug 29 05:37:03 2016 (r304980) +++ stable/11/sys/sys/vnode.h Mon Aug 29 05:40:21 2016 (r304981) @@ -741,6 +741,7 @@ int vfs_write_suspend(struct mount *mp, int vfs_write_suspend_umnt(struct mount *mp); void vnlru_free(int, struct vfsops *); int vop_stdbmap(struct vop_bmap_args *); +int vop_stdfdatasync_buf(struct vop_fdatasync_args *); int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); int vop_stdgetpages(struct vop_getpages_args *); From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:51:30 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0094BB77381; Mon, 29 Aug 2016 05:51:30 +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 B605CF0E; Mon, 29 Aug 2016 05:51:29 +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 u7T5pS9w061000; Mon, 29 Aug 2016 05:51:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5pR51060988; Mon, 29 Aug 2016 05:51:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290551.u7T5pR51060988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304983 - in stable/11/sys: fs/smbfs fs/unionfs kern sys ufs/ffs ufs/ufs vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:51:30 -0000 Author: kib Date: Mon Aug 29 05:51:27 2016 New Revision: 304983 URL: https://svnweb.freebsd.org/changeset/base/304983 Log: MFC r303924 (by trasz): Eliminate vprint(). Modified: stable/11/sys/fs/smbfs/smbfs_node.c stable/11/sys/fs/unionfs/union_vnops.c stable/11/sys/kern/vfs_default.c stable/11/sys/kern/vfs_lookup.c stable/11/sys/kern/vfs_mount.c stable/11/sys/kern/vfs_subr.c stable/11/sys/sys/vnode.h stable/11/sys/ufs/ffs/ffs_snapshot.c stable/11/sys/ufs/ffs/ffs_vnops.c stable/11/sys/ufs/ufs/ufs_lookup.c stable/11/sys/ufs/ufs/ufs_quota.c stable/11/sys/vm/vm_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/smbfs/smbfs_node.c ============================================================================== --- stable/11/sys/fs/smbfs/smbfs_node.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/fs/smbfs/smbfs_node.c Mon Aug 29 05:51:27 2016 (r304983) @@ -132,7 +132,7 @@ smbfs_node_alloc(struct mount *mp, struc } dnp = dvp ? VTOSMB(dvp) : NULL; if (dnp == NULL && dvp != NULL) { - vprint("smbfs_node_alloc: dead parent vnode", dvp); + vn_printf(dvp, "smbfs_node_alloc: dead parent vnode "); return EINVAL; } error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, Modified: stable/11/sys/fs/unionfs/union_vnops.c ============================================================================== --- stable/11/sys/fs/unionfs/union_vnops.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/fs/unionfs/union_vnops.c Mon Aug 29 05:51:27 2016 (r304983) @@ -1753,9 +1753,9 @@ unionfs_print(struct vop_print_args *ap) */ if (unp->un_uppervp != NULLVP) - vprint("unionfs: upper", unp->un_uppervp); + vn_printf(unp->un_uppervp, "unionfs: upper "); if (unp->un_lowervp != NULLVP) - vprint("unionfs: lower", unp->un_lowervp); + vn_printf(unp->un_lowervp, "unionfs: lower "); return (0); } Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/kern/vfs_default.c Mon Aug 29 05:51:27 2016 (r304983) @@ -258,7 +258,7 @@ static int vop_nostrategy (struct vop_strategy_args *ap) { printf("No strategy for buffer at %p\n", ap->a_bp); - vprint("vnode", ap->a_vp); + vn_printf(ap->a_vp, "vnode "); ap->a_bp->b_ioflags |= BIO_ERROR; ap->a_bp->b_error = EOPNOTSUPP; bufdone(ap->a_bp); @@ -723,7 +723,7 @@ loop2: } BO_UNLOCK(bo); if (error == EAGAIN) - vprint("fsync: giving up on dirty", vp); + vn_printf(vp, "fsync: giving up on dirty "); return (error); } Modified: stable/11/sys/kern/vfs_lookup.c ============================================================================== --- stable/11/sys/kern/vfs_lookup.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/kern/vfs_lookup.c Mon Aug 29 05:51:27 2016 (r304983) @@ -721,7 +721,7 @@ unionlookup: if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags)) cnp->cn_lkflags = LK_EXCLUSIVE; #ifdef NAMEI_DIAGNOSTIC - vprint("lookup in", dp); + vn_printf(dp, "lookup in "); #endif lkflags_save = cnp->cn_lkflags; cnp->cn_lkflags = compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags, @@ -1007,7 +1007,7 @@ relookup(struct vnode *dvp, struct vnode * We now have a segment name to search for, and a directory to search. */ #ifdef NAMEI_DIAGNOSTIC - vprint("search in:", dp); + vn_printf(dp, "search in "); #endif if ((error = VOP_LOOKUP(dp, vpp, cnp)) != 0) { KASSERT(*vpp == NULL, ("leaf should be empty")); Modified: stable/11/sys/kern/vfs_mount.c ============================================================================== --- stable/11/sys/kern/vfs_mount.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/kern/vfs_mount.c Mon Aug 29 05:51:27 2016 (r304983) @@ -510,7 +510,7 @@ vfs_mount_destroy(struct mount *mp) struct vnode *vp; TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) - vprint("", vp); + vn_printf(vp, "dangling vnode "); panic("unmount: dangling vnode"); } KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers")); Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/kern/vfs_subr.c Mon Aug 29 05:51:27 2016 (r304983) @@ -2645,7 +2645,7 @@ vputx(struct vnode *vp, int func) error = 0; if (vp->v_usecount != 0) { - vprint("vputx: usecount not zero", vp); + vn_printf(vp, "vputx: usecount not zero for vnode "); panic("vputx: usecount not zero"); } @@ -3036,7 +3036,7 @@ loop: busy++; #ifdef DIAGNOSTIC if (busyprt) - vprint("vflush: busy vnode", vp); + vn_printf(vp, "vflush: busy vnode "); #endif } VOP_UNLOCK(vp, 0); @@ -3409,7 +3409,7 @@ DB_SHOW_COMMAND(lockedvnods, lockedvnode TAILQ_FOREACH(mp, &mountlist, mnt_list) { TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { if (vp->v_type != VMARKER && VOP_ISLOCKED(vp)) - vprint("", vp); + vn_printf(vp, "vnode "); } } } Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/sys/vnode.h Mon Aug 29 05:51:27 2016 (r304983) @@ -673,7 +673,6 @@ int vtruncbuf(struct vnode *vp, struct u int blksize); void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); -#define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp); int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred); Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Mon Aug 29 05:51:27 2016 (r304983) @@ -558,7 +558,7 @@ loop: } VI_UNLOCK(xvp); if (snapdebug) - vprint("ffs_snapshot: busy vnode", xvp); + vn_printf(xvp, "ffs_snapshot: busy vnode "); if (VOP_GETATTR(xvp, &vat, td->td_ucred) == 0 && vat.va_nlink > 0) { VOP_UNLOCK(xvp, 0); Modified: stable/11/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vnops.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/ufs/ffs/ffs_vnops.c Mon Aug 29 05:51:27 2016 (r304983) @@ -342,7 +342,7 @@ next: goto loop; #ifdef INVARIANTS if (!vn_isdisk(vp, NULL)) - vprint("ffs_fsync: dirty", vp); + vn_printf(vp, "ffs_fsync: dirty "); #endif } BO_UNLOCK(bo); Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Mon Aug 29 05:51:27 2016 (r304983) @@ -1136,7 +1136,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); if (error != 0) - vprint("ufs_direnter: failed to truncate", dvp); + vn_printf(dvp, "ufs_direnter: failed to truncate "); #ifdef UFS_DIRHASH if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); Modified: stable/11/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_quota.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/ufs/ufs/ufs_quota.c Mon Aug 29 05:51:27 2016 (r304983) @@ -469,7 +469,7 @@ chkdquot(struct inode *ip) continue; if (ip->i_dquot[i] == NODQUOT) { UFS_UNLOCK(ump); - vprint("chkdquot: missing dquot", ITOV(ip)); + vn_printf(ITOV(ip), "chkdquot: missing dquot "); panic("chkdquot: missing dquot"); } } Modified: stable/11/sys/vm/vm_object.c ============================================================================== --- stable/11/sys/vm/vm_object.c Mon Aug 29 05:46:35 2016 (r304982) +++ stable/11/sys/vm/vm_object.c Mon Aug 29 05:51:27 2016 (r304983) @@ -471,7 +471,7 @@ vm_object_vndeallocate(vm_object_t objec KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); #ifdef INVARIANTS if (object->ref_count == 0) { - vprint("vm_object_vndeallocate", vp); + vn_printf(vp, "vm_object_vndeallocate "); panic("vm_object_vndeallocate: bad object reference count"); } #endif From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:54:00 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62F6B7740C; Mon, 29 Aug 2016 05:54:00 +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 7872E16E; Mon, 29 Aug 2016 05:54:00 +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 u7T5rxk7061801; Mon, 29 Aug 2016 05:53:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5rxbK061799; Mon, 29 Aug 2016 05:53:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290553.u7T5rxbK061799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304984 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:54:00 -0000 Author: kib Date: Mon Aug 29 05:53:59 2016 New Revision: 304984 URL: https://svnweb.freebsd.org/changeset/base/304984 Log: MFC r304180: Implement VOP_FDATASYNC() for UFS. Modified: stable/11/sys/ufs/ffs/ffs_extern.h stable/11/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_extern.h ============================================================================== --- stable/11/sys/ufs/ffs/ffs_extern.h Mon Aug 29 05:51:27 2016 (r304983) +++ stable/11/sys/ufs/ffs/ffs_extern.h Mon Aug 29 05:53:59 2016 (r304984) @@ -174,6 +174,11 @@ void softdep_freework(struct workhead *) * deadlock when flushing snapshot inodes while holding snaplk. */ #define NO_INO_UPDT 0x00000001 +/* + * Request data sync only from ffs_syncvnode(), not touching even more + * metadata than NO_INO_UPDT. + */ +#define DATA_ONLY 0x00000002 int ffs_rdonly(struct inode *); Modified: stable/11/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vnops.c Mon Aug 29 05:51:27 2016 (r304983) +++ stable/11/sys/ufs/ffs/ffs_vnops.c Mon Aug 29 05:53:59 2016 (r304984) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif static vop_fsync_t ffs_fsync; +static vop_fdatasync_t ffs_fdatasync; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -123,6 +124,7 @@ static vop_vptofh_t ffs_vptofh; struct vop_vector ffs_vnodeops1 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_getpages = vnode_pager_local_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, @@ -135,6 +137,7 @@ struct vop_vector ffs_vnodeops1 = { struct vop_vector ffs_fifoops1 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */ .vop_vptofh = ffs_vptofh, }; @@ -143,6 +146,7 @@ struct vop_vector ffs_fifoops1 = { struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_getpages = vnode_pager_local_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, @@ -161,6 +165,7 @@ struct vop_vector ffs_vnodeops2 = { struct vop_vector ffs_fifoops2 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_lock1 = ffs_lock, .vop_reallocblks = ffs_reallocblks, .vop_strategy = ffsext_strategy, @@ -216,10 +221,10 @@ ffs_syncvnode(struct vnode *vp, int wait { struct inode *ip; struct bufobj *bo; - struct buf *bp; - struct buf *nbp; + struct buf *bp, *nbp; ufs_lbn_t lbn; - int error, wait, passes; + int error, passes; + bool still_dirty, wait; ip = VTOI(vp); ip->i_flag &= ~IN_NEEDSYNC; @@ -238,7 +243,7 @@ ffs_syncvnode(struct vnode *vp, int wait */ error = 0; passes = 0; - wait = 0; /* Always do an async pass first. */ + wait = false; /* Always do an async pass first. */ lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1)); BO_LOCK(bo); loop: @@ -254,15 +259,23 @@ loop: if ((bp->b_vflags & BV_SCANNED) != 0) continue; bp->b_vflags |= BV_SCANNED; - /* Flush indirects in order. */ + /* + * Flush indirects in order, if requested. + * + * Note that if only datasync is requested, we can + * skip indirect blocks when softupdates are not + * active. Otherwise we must flush them with data, + * since dependencies prevent data block writes. + */ if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR && - lbn_level(bp->b_lblkno) >= passes) + (lbn_level(bp->b_lblkno) >= passes || + ((flags & DATA_ONLY) != 0 && !DOINGSOFTDEP(vp)))) continue; if (bp->b_lblkno > lbn) panic("ffs_syncvnode: syncing truncated data."); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { BO_UNLOCK(bo); - } else if (wait != 0) { + } else if (wait) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)) != 0) { @@ -330,31 +343,59 @@ next: * these will be done with one sync and one async pass. */ if (bo->bo_dirty.bv_cnt > 0) { - /* Write the inode after sync passes to flush deps. */ - if (wait && DOINGSOFTDEP(vp) && (flags & NO_INO_UPDT) == 0) { - BO_UNLOCK(bo); - ffs_update(vp, 1); - BO_LOCK(bo); + if ((flags & DATA_ONLY) == 0) { + still_dirty = true; + } else { + /* + * For data-only sync, dirty indirect buffers + * are ignored. + */ + still_dirty = false; + TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { + if (bp->b_lblkno > -NDADDR) { + still_dirty = true; + break; + } + } } - /* switch between sync/async. */ - wait = !wait; - if (wait == 1 || ++passes < NIADDR + 2) - goto loop; + + if (still_dirty) { + /* Write the inode after sync passes to flush deps. */ + if (wait && DOINGSOFTDEP(vp) && + (flags & NO_INO_UPDT) == 0) { + BO_UNLOCK(bo); + ffs_update(vp, 1); + BO_LOCK(bo); + } + /* switch between sync/async. */ + wait = !wait; + if (wait || ++passes < NIADDR + 2) + goto loop; #ifdef INVARIANTS - if (!vn_isdisk(vp, NULL)) - vn_printf(vp, "ffs_fsync: dirty "); + if (!vn_isdisk(vp, NULL)) + vn_printf(vp, "ffs_fsync: dirty "); #endif + } } BO_UNLOCK(bo); error = 0; - if ((flags & NO_INO_UPDT) == 0) - error = ffs_update(vp, 1); - if (DOINGSUJ(vp)) - softdep_journal_fsync(VTOI(vp)); + if ((flags & DATA_ONLY) == 0) { + if ((flags & NO_INO_UPDT) == 0) + error = ffs_update(vp, 1); + if (DOINGSUJ(vp)) + softdep_journal_fsync(VTOI(vp)); + } return (error); } static int +ffs_fdatasync(struct vop_fdatasync_args *ap) +{ + + return (ffs_syncvnode(ap->a_vp, MNT_WAIT, DATA_ONLY)); +} + +static int ffs_lock(ap) struct vop_lock1_args /* { struct vnode *a_vp; From owner-svn-src-stable-11@freebsd.org Mon Aug 29 05:59:13 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48260B774CB; Mon, 29 Aug 2016 05:59:13 +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 1F33F303; Mon, 29 Aug 2016 05:59:13 +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 u7T5xCYB062032; Mon, 29 Aug 2016 05:59:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5xCkb062030; Mon, 29 Aug 2016 05:59:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290559.u7T5xCkb062030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 05:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304985 - stable/11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 05:59:13 -0000 Author: kib Date: Mon Aug 29 05:59:12 2016 New Revision: 304985 URL: https://svnweb.freebsd.org/changeset/base/304985 Log: MFC r304287: Add fdatasync(2) man page, combined with fsync(2). Modified: stable/11/lib/libc/sys/Makefile.inc stable/11/lib/libc/sys/fsync.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/sys/Makefile.inc Mon Aug 29 05:53:59 2016 (r304984) +++ stable/11/lib/libc/sys/Makefile.inc Mon Aug 29 05:59:12 2016 (r304985) @@ -366,6 +366,7 @@ MLINKS+=ffclock.2 ffclock_getcounter.2 \ ffclock.2 ffclock_getestimate.2 \ ffclock.2 ffclock_setestimate.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 +MLINKS+=fsync.2 fdatasync.2 MLINKS+=getdirentries.2 getdents.2 MLINKS+=getfh.2 lgetfh.2 MLINKS+=getgid.2 getegid.2 Modified: stable/11/lib/libc/sys/fsync.2 ============================================================================== --- stable/11/lib/libc/sys/fsync.2 Mon Aug 29 05:53:59 2016 (r304984) +++ stable/11/lib/libc/sys/fsync.2 Mon Aug 29 05:59:12 2016 (r304985) @@ -1,5 +1,11 @@ .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2016 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Parts of this documentation were written by +.\" Konstantin Belousov 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 @@ -28,40 +34,65 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 17, 2016 .Dt FSYNC 2 .Os .Sh NAME -.Nm fsync +.Nm fdatasync, fsync .Nd "synchronise changes to a file" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In unistd.h .Ft int +.Fn fdatasync "int fd" +.Ft int .Fn fsync "int fd" .Sh DESCRIPTION The .Fn fsync system call -causes all modified data and attributes of +causes all modified data and attributes of the file referenced by +the file descriptor .Fa fd to be moved to a permanent storage device. This normally results in all in-core modified copies of buffers for the associated file to be written to a disk. .Pp The +.Fn fdatasync +system call causes all modified data of +.Fa fd +to be moved to a permanent storage device. +Unlike +.Fn fsync , +the system call does not guarantee that file attributes or +metadata necessary to access the file are committed to the permanent storage. +.Pp +The .Fn fsync system call should be used by programs that require a file to be in a known state, for example, in building a simple transaction facility. +If the file metadata has already been committed, using +.Fn fdatasync +can be more efficient than +.Fn fsync . +.Pp +Both +.Fn fdatasync +and +.Fn fsync +calls are cancellation points. .Sh RETURN VALUES .Rv -std fsync .Sh ERRORS The .Fn fsync -fails if: +and +.Fn fdatasync +calls fail if: .Bl -tag -width Er .It Bq Er EBADF The @@ -85,3 +116,15 @@ The .Fn fsync system call appeared in .Bx 4.2 . +The +.Fn fdatasync +system call appeared in +.Fx 12.0 +.Sh BUGS +The +.Fn fdatasync +system call currently does not guarantee that enqueued +.Xr aio 4 +requests for the file referenced by +.Fa fd +are completed before the syscall returns. From owner-svn-src-stable-11@freebsd.org Mon Aug 29 06:32:31 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23D9BC70AC; Mon, 29 Aug 2016 06:32:31 +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 A23D8116; Mon, 29 Aug 2016 06:32:31 +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 u7T6WU0M076678; Mon, 29 Aug 2016 06:32:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T6WUSZ076674; Mon, 29 Aug 2016 06:32:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608290632.u7T6WUSZ076674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 06:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304987 - in stable/11/sys: compat/cloudabi compat/linux kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 06:32:32 -0000 Author: kib Date: Mon Aug 29 06:32:30 2016 New Revision: 304987 URL: https://svnweb.freebsd.org/changeset/base/304987 Log: MFC r304182 (by ed): Let CloudABI use fdatasync() as well. MFC r304185 (by ed): Eliminate use of sys_fsync() and sys_fdatasync(). Modified: stable/11/sys/compat/cloudabi/cloudabi_fd.c stable/11/sys/compat/linux/linux_file.c stable/11/sys/kern/vfs_syscalls.c stable/11/sys/sys/syscallsubr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- stable/11/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 29 06:32:30 2016 (r304987) @@ -172,12 +172,8 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fsync_args fsync_args = { - .fd = uap->fd - }; - /* Call into fsync(), as FreeBSD lacks fdatasync(). */ - return (sys_fsync(td, &fsync_args)); + return (kern_fsync(td, uap->fd, false)); } int @@ -557,9 +553,6 @@ cloudabi_sys_fd_stat_put(struct thread * int cloudabi_sys_fd_sync(struct thread *td, struct cloudabi_sys_fd_sync_args *uap) { - struct fsync_args fsync_args = { - .fd = uap->fd - }; - return (sys_fsync(td, &fsync_args)); + return (kern_fsync(td, uap->fd, true)); } Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/compat/linux/linux_file.c Mon Aug 29 06:32:30 2016 (r304987) @@ -1013,10 +1013,8 @@ linux_fdatasync(td, uap) struct thread *td; struct linux_fdatasync_args *uap; { - struct fsync_args bsd; - bsd.fd = uap->fd; - return (sys_fsync(td, &bsd)); + return (kern_fsync(td, uap->fd, false)); } int Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/kern/vfs_syscalls.c Mon Aug 29 06:32:30 2016 (r304987) @@ -3354,7 +3354,7 @@ freebsd6_ftruncate(struct thread *td, st } #endif -static int +int kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; Modified: stable/11/sys/sys/syscallsubr.h ============================================================================== --- stable/11/sys/sys/syscallsubr.h Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/sys/syscallsubr.h Mon Aug 29 06:32:30 2016 (r304987) @@ -100,6 +100,7 @@ int kern_fhstat(struct thread *td, fhand int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); +int kern_fsync(struct thread *td, int fd, bool fullsync); int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); From owner-svn-src-stable-11@freebsd.org Mon Aug 29 08:39:54 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A796CBC70D2; Mon, 29 Aug 2016 08:39:54 +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 6BFBFD3F; Mon, 29 Aug 2016 08:39:54 +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 u7T8dr7e022066; Mon, 29 Aug 2016 08:39:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T8droX022065; Mon, 29 Aug 2016 08:39:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608290839.u7T8droX022065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 29 Aug 2016 08:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304992 - stable/11/sys/dev/usb/controller X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 08:39:54 -0000 Author: hselasky Date: Mon Aug 29 08:39:53 2016 New Revision: 304992 URL: https://svnweb.freebsd.org/changeset/base/304992 Log: MFC r304597: Fix for invalid use of bits in input context. Basically split configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and xhci_cmd_configure_ep() respectivly. This resolves some errors when using XHCI under QEMU and gets is more in line with the XHCI specification. PR: 212021 Modified: stable/11/sys/dev/usb/controller/xhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/11/sys/dev/usb/controller/xhci.c Mon Aug 29 07:48:35 2016 (r304991) +++ stable/11/sys/dev/usb/controller/xhci.c Mon Aug 29 08:39:53 2016 (r304992) @@ -3867,12 +3867,10 @@ xhci_configure_reset_endpoint(struct usb xhci_configure_mask(udev, (1U << epno) | 1U, 0); - err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); - - if (err != 0) - DPRINTF("Could not configure endpoint %u\n", epno); - - err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); + if (epno > 1) + err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); + else + err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); if (err != 0) DPRINTF("Could not configure endpoint %u\n", epno); @@ -4255,6 +4253,10 @@ xhci_device_state_change(struct usb_devi sc->sc_hw.devs[index].state = XHCI_ST_ADDRESSED; + /* set configure mask to slot only */ + xhci_configure_mask(udev, 1, 0); + + /* deconfigure all endpoints, except EP0 */ err = xhci_cmd_configure_ep(sc, 0, 1, index); if (err) { From owner-svn-src-stable-11@freebsd.org Mon Aug 29 08:48:11 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89356BC74B2; Mon, 29 Aug 2016 08:48:11 +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 58EA280A; Mon, 29 Aug 2016 08:48:11 +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 u7T8mATN025935; Mon, 29 Aug 2016 08:48:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T8mA5t025934; Mon, 29 Aug 2016 08:48:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608290848.u7T8mA5t025934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 29 Aug 2016 08:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304996 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 08:48:11 -0000 Author: hselasky Date: Mon Aug 29 08:48:10 2016 New Revision: 304996 URL: https://svnweb.freebsd.org/changeset/base/304996 Log: MFC r304601: Increase the maximum RX/TX queue size. This allows for a RX/TX queue size of 16384 mbufs. Previously the limit was 8192. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Mon Aug 29 08:46:15 2016 (r304995) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Mon Aug 29 08:48:10 2016 (r304996) @@ -70,11 +70,11 @@ #define MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE 0x7 #define MLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE 0xa -#define MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE 0xd +#define MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE 0xe #define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE 0x7 #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa -#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd +#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xe /* freeBSD HW LRO is limited by 16KB - the size of max mbuf */ #define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ MJUM16BYTES From owner-svn-src-stable-11@freebsd.org Mon Aug 29 08:52:54 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B014BC78EB; Mon, 29 Aug 2016 08:52:54 +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 1A0C39; Mon, 29 Aug 2016 08:52:54 +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 u7T8qrWD029569; Mon, 29 Aug 2016 08:52:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T8qrwh029568; Mon, 29 Aug 2016 08:52:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608290852.u7T8qrwh029568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 29 Aug 2016 08:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304999 - stable/11/sys/dev/usb/controller X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 08:52:54 -0000 Author: hselasky Date: Mon Aug 29 08:52:53 2016 New Revision: 304999 URL: https://svnweb.freebsd.org/changeset/base/304999 Log: MFC r304629: Don't separate the status stage of the XHCI USB control transfers into its own job because this breaks the simplified QEMU XHCI TRB parser, which expects the complete USB control transfer as a series of back to back TRBs. The old behaviour is kept under #ifdef in case this change breaks enumeration of any USB devices. PR: 212021 Modified: stable/11/sys/dev/usb/controller/xhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/11/sys/dev/usb/controller/xhci.c Mon Aug 29 08:51:27 2016 (r304998) +++ stable/11/sys/dev/usb/controller/xhci.c Mon Aug 29 08:52:53 2016 (r304999) @@ -2221,7 +2221,11 @@ xhci_setup_generic_chain(struct usb_xfer * Send a DATA1 message and invert the current * endpoint direction. */ +#ifdef XHCI_STEP_STATUS_STAGE temp.step_td = (xfer->nframes != 0); +#else + temp.step_td = 0; +#endif temp.direction = UE_GET_DIR(xfer->endpointno) ^ UE_DIR_IN; temp.len = 0; temp.pc = NULL; From owner-svn-src-stable-11@freebsd.org Mon Aug 29 12:54:48 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665DBBC701A; Mon, 29 Aug 2016 12:54:48 +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 0BBA5C8B; Mon, 29 Aug 2016 12:54: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 u7TCslaK021615; Mon, 29 Aug 2016 12:54:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TCslYA021611; Mon, 29 Aug 2016 12:54:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608291254.u7TCslYA021611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 29 Aug 2016 12:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305002 - in stable/11/contrib/sqlite3: . tea X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 12:54:48 -0000 Author: cy Date: Mon Aug 29 12:54:46 2016 New Revision: 305002 URL: https://svnweb.freebsd.org/changeset/base/305002 Log: MFC r304747: Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100). This commit addresses the tmpdir selection vulnerability fixed in sqlite3-1.13.0. See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b. Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b Security: CVE-2016-6153 Added: stable/11/contrib/sqlite3/Makefile.msc - copied unchanged from r304747, head/contrib/sqlite3/Makefile.msc stable/11/contrib/sqlite3/Replace.cs - copied unchanged from r304747, head/contrib/sqlite3/Replace.cs stable/11/contrib/sqlite3/compile - copied unchanged from r304747, head/contrib/sqlite3/compile stable/11/contrib/sqlite3/sqlite3.rc - copied unchanged from r304747, head/contrib/sqlite3/sqlite3.rc stable/11/contrib/sqlite3/tea/ - copied from r304747, head/contrib/sqlite3/tea/ Modified: stable/11/contrib/sqlite3/Makefile.am stable/11/contrib/sqlite3/Makefile.in stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/shell.c stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/sqlite3ext.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/sqlite3/Makefile.am ============================================================================== --- stable/11/contrib/sqlite3/Makefile.am Mon Aug 29 08:55:59 2016 (r305001) +++ stable/11/contrib/sqlite3/Makefile.am Mon Aug 29 12:54:46 2016 (r305002) @@ -1,5 +1,5 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c Modified: stable/11/contrib/sqlite3/Makefile.in ============================================================================== --- stable/11/contrib/sqlite3/Makefile.in Mon Aug 29 08:55:59 2016 (r305001) +++ stable/11/contrib/sqlite3/Makefile.in Mon Aug 29 12:54:46 2016 (r305002) @@ -305,6 +305,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ +SESSION_FLAGS = @SESSION_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -362,7 +363,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 Copied: stable/11/contrib/sqlite3/Makefile.msc (from r304747, head/contrib/sqlite3/Makefile.msc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/sqlite3/Makefile.msc Mon Aug 29 12:54:46 2016 (r305002, copy of r304747, head/contrib/sqlite3/Makefile.msc) @@ -0,0 +1,971 @@ +#### DO NOT EDIT #### +# This makefile is automatically generated from the Makefile.msc at +# the root of the canonical SQLite source tree (not the +# amalgamation tarball) using the tool/mkmsvcmin.tcl +# script. +# + +# +# nmake Makefile for SQLite +# +############################################################################### +############################## START OF OPTIONS ############################### +############################################################################### + +# The toplevel directory of the source tree. This is the directory +# that contains this "Makefile.msc". +# +TOP = . + + +# Set this non-0 to enable full warnings (-W4, etc) when compiling. +# +!IFNDEF USE_FULLWARN +USE_FULLWARN = 0 +!ENDIF + +# Set this non-0 to enable full runtime error checks (-RTC1, etc). This +# has no effect if (any) optimizations are enabled. +# +!IFNDEF USE_RUNTIME_CHECKS +USE_RUNTIME_CHECKS = 0 +!ENDIF + +# Set this non-0 to use "stdcall" calling convention for the core library +# and shell executable. +# +!IFNDEF USE_STDCALL +USE_STDCALL = 0 +!ENDIF + +# Set this non-0 to have the shell executable link against the core dynamic +# link library. +# +!IFNDEF DYNAMIC_SHELL +DYNAMIC_SHELL = 0 +!ENDIF + +# Set this non-0 to enable extra code that attempts to detect misuse of the +# SQLite API. +# +!IFNDEF API_ARMOR +API_ARMOR = 0 +!ENDIF + +# If necessary, create a list of harmless compiler warnings to disable when +# compiling the various tools. For the SQLite source code itself, warnings, +# if any, will be disabled from within it. +# +!IFNDEF NO_WARN +!IF $(USE_FULLWARN)!=0 +NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206 +NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706 +!ENDIF +!ENDIF + +# Set this non-0 to use the library paths and other options necessary for +# Windows Phone 8.1. +# +!IFNDEF USE_WP81_OPTS +USE_WP81_OPTS = 0 +!ENDIF + +# Set this non-0 to split the SQLite amalgamation file into chunks to +# be used for debugging with Visual Studio. +# +!IFNDEF SPLIT_AMALGAMATION +SPLIT_AMALGAMATION = 0 +!ENDIF + + +# Set this non-0 to dynamically link to the MSVC runtime library. +# +!IFNDEF USE_CRT_DLL +USE_CRT_DLL = 0 +!ENDIF + +# Set this non-0 to link to the RPCRT4 library. +# +!IFNDEF USE_RPCRT4_LIB +USE_RPCRT4_LIB = 0 +!ENDIF + +# Set this non-0 to generate assembly code listings for the source code +# files. +# +!IFNDEF USE_LISTINGS +USE_LISTINGS = 0 +!ENDIF + +# Set this non-0 to attempt setting the native compiler automatically +# for cross-compiling the command line tools needed during the compilation +# process. +# +!IFNDEF XCOMPILE +XCOMPILE = 0 +!ENDIF + +# Set this non-0 to use the native libraries paths for cross-compiling +# the command line tools needed during the compilation process. +# +!IFNDEF USE_NATIVE_LIBPATHS +USE_NATIVE_LIBPATHS = 0 +!ENDIF + +# Set this 0 to skip the compiling and embedding of version resources. +# +!IFNDEF USE_RC +USE_RC = 1 +!ENDIF + +# Set this non-0 to compile binaries suitable for the WinRT environment. +# This setting does not apply to any binaries that require Tcl to operate +# properly (i.e. the text fixture, etc). +# +!IFNDEF FOR_WINRT +FOR_WINRT = 0 +!ENDIF + +# Set this non-0 to compile binaries suitable for the UWP environment. +# This setting does not apply to any binaries that require Tcl to operate +# properly (i.e. the text fixture, etc). +# +!IFNDEF FOR_UWP +FOR_UWP = 0 +!ENDIF + +# Set this non-0 to compile binaries suitable for the Windows 10 platform. +# +!IFNDEF FOR_WIN10 +FOR_WIN10 = 0 +!ENDIF + + +# Set this to non-0 to create and use PDBs. +# +!IFNDEF SYMBOLS +SYMBOLS = 1 +!ENDIF + +# Set this to non-0 to use the SQLite debugging heap subsystem. +# +!IFNDEF MEMDEBUG +MEMDEBUG = 0 +!ENDIF + +# Set this to non-0 to use the Win32 native heap subsystem. +# +!IFNDEF WIN32HEAP +WIN32HEAP = 0 +!ENDIF + +# Set this to non-0 to enable OSTRACE() macros, which can be useful when +# debugging. +# +!IFNDEF OSTRACE +OSTRACE = 0 +!ENDIF + +# Set this to one of the following values to enable various debugging +# features. Each level includes the debugging options from the previous +# levels. Currently, the recognized values for DEBUG are: +# +# 0 == NDEBUG: Disables assert() and other runtime diagnostics. +# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API. +# 2 == Disables NDEBUG and all optimizations and then enables PDBs. +# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code. +# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call. +# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros. +# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros. +# +!IFNDEF DEBUG +DEBUG = 0 +!ENDIF + +# Enable use of available compiler optimizations? Normally, this should be +# non-zero. Setting this to zero, thus disabling all compiler optimizations, +# can be useful for testing. +# +!IFNDEF OPTIMIZATIONS +OPTIMIZATIONS = 2 +!ENDIF + +# Set this to non-0 to enable support for the session extension. +# +!IFNDEF SESSION +SESSION = 0 +!ENDIF + +# Set the source code file to be used by executables and libraries when +# they need the amalgamation. +# +!IFNDEF SQLITE3C +!IF $(SPLIT_AMALGAMATION)!=0 +SQLITE3C = sqlite3-all.c +!ELSE +SQLITE3C = sqlite3.c +!ENDIF +!ENDIF + +# Set the include code file to be used by executables and libraries when +# they need SQLite. +# +!IFNDEF SQLITE3H +SQLITE3H = sqlite3.h +!ENDIF + +# This is the name to use for the SQLite dynamic link library (DLL). +# +!IFNDEF SQLITE3DLL +!IF $(FOR_WIN10)!=0 +SQLITE3DLL = winsqlite3.dll +!ELSE +SQLITE3DLL = sqlite3.dll +!ENDIF +!ENDIF + +# This is the name to use for the SQLite import library (LIB). +# +!IFNDEF SQLITE3LIB +!IF $(FOR_WIN10)!=0 +SQLITE3LIB = winsqlite3.lib +!ELSE +SQLITE3LIB = sqlite3.lib +!ENDIF +!ENDIF + +# This is the name to use for the SQLite shell executable (EXE). +# +!IFNDEF SQLITE3EXE +!IF $(FOR_WIN10)!=0 +SQLITE3EXE = winsqlite3shell.exe +!ELSE +SQLITE3EXE = sqlite3.exe +!ENDIF +!ENDIF + +# This is the argument used to set the program database (PDB) file for the +# SQLite shell executable (EXE). +# +!IFNDEF SQLITE3EXEPDB +!IF $(FOR_WIN10)!=0 +SQLITE3EXEPDB = +!ELSE +SQLITE3EXEPDB = /pdb:sqlite3sh.pdb +!ENDIF +!ENDIF + +# These are the "standard" SQLite compilation options used when compiling for +# the Windows platform. +# +!IFNDEF OPT_FEATURE_FLAGS +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 +!ENDIF + +# Should the session extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(SESSION)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 +!ENDIF + +# These are the "extended" SQLite compilation options used when compiling for +# the Windows 10 platform. +# +!IFNDEF EXT_FEATURE_FLAGS +!IF $(FOR_WIN10)!=0 +EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1 +EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1 +EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1 +!ELSE +EXT_FEATURE_FLAGS = +!ENDIF +!ENDIF + +############################################################################### +############################### END OF OPTIONS ################################ +############################################################################### + +# When compiling for the Windows 10 platform, the PLATFORM macro must be set +# to an appropriate value (e.g. x86, x64, arm, arm64, etc). +# +!IF $(FOR_WIN10)!=0 +!IFNDEF PLATFORM +!ERROR Using the FOR_WIN10 option requires a value for PLATFORM. +!ENDIF +!ENDIF + +# This assumes that MSVC is always installed in 32-bit Program Files directory +# and sets the variable for use in locating other 32-bit installs accordingly. +# +PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\.. +PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\) + +# Check for the predefined command macro CC. This should point to the compiler +# binary for the target platform. If it is not defined, simply define it to +# the legacy default value 'cl.exe'. +# +!IFNDEF CC +CC = cl.exe +!ENDIF + +# Check for the predefined command macro CSC. This should point to a working +# C Sharp compiler binary. If it is not defined, simply define it to the +# legacy default value 'csc.exe'. +# +!IFNDEF CSC +CSC = csc.exe +!ENDIF + +# Check for the command macro LD. This should point to the linker binary for +# the target platform. If it is not defined, simply define it to the legacy +# default value 'link.exe'. +# +!IFNDEF LD +LD = link.exe +!ENDIF + +# Check for the predefined command macro RC. This should point to the resource +# compiler binary for the target platform. If it is not defined, simply define +# it to the legacy default value 'rc.exe'. +# +!IFNDEF RC +RC = rc.exe +!ENDIF + +# Check for the MSVC runtime library path macro. Otherwise, this value will +# default to the 'lib' directory underneath the MSVC installation directory. +# +!IFNDEF CRTLIBPATH +CRTLIBPATH = $(VCINSTALLDIR)\lib +!ENDIF + +CRTLIBPATH = $(CRTLIBPATH:\\=\) + +# Check for the command macro NCC. This should point to the compiler binary +# for the platform the compilation process is taking place on. If it is not +# defined, simply define it to have the same value as the CC macro. When +# cross-compiling, it is suggested that this macro be modified via the command +# line (since nmake itself does not provide a built-in method to guess it). +# For example, to use the x86 compiler when cross-compiling for x64, a command +# line similar to the following could be used (all on one line): +# +# nmake /f Makefile.msc sqlite3.dll +# XCOMPILE=1 USE_NATIVE_LIBPATHS=1 +# +# Alternatively, the full path and file name to the compiler binary for the +# platform the compilation process is taking place may be specified (all on +# one line): +# +# nmake /f Makefile.msc sqlite3.dll +# "NCC=""%VCINSTALLDIR%\bin\cl.exe""" +# USE_NATIVE_LIBPATHS=1 +# +!IFDEF NCC +NCC = $(NCC:\\=\) +!ELSEIF $(XCOMPILE)!=0 +NCC = "$(VCINSTALLDIR)\bin\$(CC)" +NCC = $(NCC:\\=\) +!ELSE +NCC = $(CC) +!ENDIF + +# Check for the MSVC native runtime library path macro. Otherwise, +# this value will default to the 'lib' directory underneath the MSVC +# installation directory. +# +!IFNDEF NCRTLIBPATH +NCRTLIBPATH = $(VCINSTALLDIR)\lib +!ENDIF + +NCRTLIBPATH = $(NCRTLIBPATH:\\=\) + +# Check for the Platform SDK library path macro. Otherwise, this +# value will default to the 'lib' directory underneath the Windows +# SDK installation directory (the environment variable used appears +# to be available when using Visual C++ 2008 or later via the +# command line). +# +!IFNDEF NSDKLIBPATH +NSDKLIBPATH = $(WINDOWSSDKDIR)\lib +!ENDIF + +NSDKLIBPATH = $(NSDKLIBPATH:\\=\) + +# Check for the UCRT library path macro. Otherwise, this value will +# default to the version-specific, platform-specific 'lib' directory +# underneath the Windows SDK installation directory. +# +!IFNDEF UCRTLIBPATH +UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM) +!ENDIF + +UCRTLIBPATH = $(UCRTLIBPATH:\\=\) + +# C compiler and options for use in building executables that +# will run on the platform that is doing the build. +# +!IF $(USE_FULLWARN)!=0 +BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS) +!ELSE +BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS) +!ENDIF + +# Check if assembly code listings should be generated for the source +# code files to be compiled. +# +!IF $(USE_LISTINGS)!=0 +BCC = $(BCC) -FAcs +!ENDIF + +# Check if the native library paths should be used when compiling +# the command line tools used during the compilation process. If +# so, set the necessary macro now. +# +!IF $(USE_NATIVE_LIBPATHS)!=0 +NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)" + +!IFDEF NUCRTLIBPATH +NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\) +NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)" +!ENDIF +!ENDIF + +# C compiler and options for use in building executables that +# will run on the target platform. (BCC and TCC are usually the +# same unless your are cross-compiling.) +# +!IF $(USE_FULLWARN)!=0 +TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS) +!ELSE +TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS) +!ENDIF + +TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise +RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS) + +# Check if we want to use the "stdcall" calling convention when compiling. +# This is not supported by the compilers for non-x86 platforms. It should +# also be noted here that building any target with these "stdcall" options +# will most likely fail if the Tcl library is also required. This is due +# to how the Tcl library functions are declared and exported (i.e. without +# an explicit calling convention, which results in "cdecl"). +# +!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0 +!IF "$(PLATFORM)"=="x86" +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +!ELSE +!IFNDEF PLATFORM +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +!ELSE +CORE_CCONV_OPTS = +SHELL_CCONV_OPTS = +!ENDIF +!ENDIF +!ELSE +CORE_CCONV_OPTS = +SHELL_CCONV_OPTS = +!ENDIF + +# These are additional compiler options used for the core library. +# +!IFNDEF CORE_COMPILE_OPTS +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport) +!ELSE +CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) +!ENDIF +!ENDIF + +# These are the additional targets that the core library should depend on +# when linking. +# +!IFNDEF CORE_LINK_DEP +!IF $(DYNAMIC_SHELL)!=0 +CORE_LINK_DEP = +!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86" +CORE_LINK_DEP = sqlite3.def +!ELSE +CORE_LINK_DEP = +!ENDIF +!ENDIF + +# These are additional linker options used for the core library. +# +!IFNDEF CORE_LINK_OPTS +!IF $(DYNAMIC_SHELL)!=0 +CORE_LINK_OPTS = +!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86" +CORE_LINK_OPTS = /DEF:sqlite3.def +!ELSE +CORE_LINK_OPTS = +!ENDIF +!ENDIF + +# These are additional compiler options used for the shell executable. +# +!IFNDEF SHELL_COMPILE_OPTS +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport) +!ELSE +SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) +!ENDIF +!ENDIF + +# This is the source code that the shell executable should be compiled +# with. +# +!IFNDEF SHELL_CORE_SRC +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_CORE_SRC = +!ELSE +SHELL_CORE_SRC = $(SQLITE3C) +!ENDIF +!ENDIF + +# This is the core library that the shell executable should depend on. +# +!IFNDEF SHELL_CORE_DEP +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_CORE_DEP = $(SQLITE3DLL) +!ELSE +SHELL_CORE_DEP = +!ENDIF +!ENDIF + +# This is the core library that the shell executable should link with. +# +!IFNDEF SHELL_CORE_LIB +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_CORE_LIB = $(SQLITE3LIB) +!ELSE +SHELL_CORE_LIB = +!ENDIF +!ENDIF + +# These are additional linker options used for the shell executable. +# +!IFNDEF SHELL_LINK_OPTS +SHELL_LINK_OPTS = $(SHELL_CORE_LIB) +!ENDIF + +# Check if assembly code listings should be generated for the source +# code files to be compiled. +# +!IF $(USE_LISTINGS)!=0 +TCC = $(TCC) -FAcs +!ENDIF + +# When compiling the library for use in the WinRT environment, +# the following compile-time options must be used as well to +# disable use of Win32 APIs that are not available and to enable +# use of Win32 APIs that are specific to Windows 8 and/or WinRT. +# +!IF $(FOR_WINRT)!=0 +TCC = $(TCC) -DSQLITE_OS_WINRT=1 +RCC = $(RCC) -DSQLITE_OS_WINRT=1 +TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP +RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP +!ENDIF + +# C compiler options for the Windows 10 platform (needs MSVC 2015). +# +!IF $(FOR_WIN10)!=0 +TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +!ENDIF + +# Also, we need to dynamically link to the correct MSVC runtime +# when compiling for WinRT (e.g. debug or release) OR if the +# USE_CRT_DLL option is set to force dynamically linking to the +# MSVC runtime library. +# +!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0 +!IF $(DEBUG)>1 +TCC = $(TCC) -MDd +BCC = $(BCC) -MDd +!ELSE +TCC = $(TCC) -MD +BCC = $(BCC) -MD +!ENDIF +!ELSE +!IF $(DEBUG)>1 +TCC = $(TCC) -MTd +BCC = $(BCC) -MTd +!ELSE +TCC = $(TCC) -MT +BCC = $(BCC) -MT +!ENDIF +!ENDIF + + +# Define -DNDEBUG to compile without debugging (i.e., for production usage) +# Omitting the define will cause extra debugging code to be inserted and +# includes extra comments when "EXPLAIN stmt" is used. +# +!IF $(DEBUG)==0 +TCC = $(TCC) -DNDEBUG +BCC = $(BCC) -DNDEBUG +RCC = $(RCC) -DNDEBUG +!ENDIF + +!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0 +TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1 +RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1 +!ENDIF + +!IF $(DEBUG)>2 +TCC = $(TCC) -DSQLITE_DEBUG=1 +RCC = $(RCC) -DSQLITE_DEBUG=1 +!ENDIF + +!IF $(DEBUG)>4 || $(OSTRACE)!=0 +TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1 +RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1 +!ENDIF + +!IF $(DEBUG)>5 +TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1 +RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1 +!ENDIF + +# Prevent warnings about "insecure" MSVC runtime library functions +# being used. +# +TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS +BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS +RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS + +# Prevent warnings about "deprecated" POSIX functions being used. +# +TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS +BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS +RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS + +# Use the SQLite debugging heap subsystem? +# +!IF $(MEMDEBUG)!=0 +TCC = $(TCC) -DSQLITE_MEMDEBUG=1 +RCC = $(RCC) -DSQLITE_MEMDEBUG=1 + +# Use native Win32 heap subsystem instead of malloc/free? +# +!ELSEIF $(WIN32HEAP)!=0 +TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1 +RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1 + +# Validate the heap on every call into the native Win32 heap subsystem? +# +!IF $(DEBUG)>3 +TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 +RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 +!ENDIF +!ENDIF + + +# Compiler options needed for programs that use the readline() library. +# +!IFNDEF READLINE_FLAGS +READLINE_FLAGS = -DHAVE_READLINE=0 +!ENDIF + +# The library that programs using readline() must link against. +# +!IFNDEF LIBREADLINE +LIBREADLINE = +!ENDIF + +# Should the database engine be compiled threadsafe +# +TCC = $(TCC) -DSQLITE_THREADSAFE=1 +RCC = $(RCC) -DSQLITE_THREADSAFE=1 + +# Do threads override each others locks by default (1), or do we test (-1) +# +TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 +RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 + +# Any target libraries which libsqlite must be linked against +# +!IFNDEF TLIBS +TLIBS = +!ENDIF + +# Flags controlling use of the in memory btree implementation +# +# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to +# default to file, 2 to default to memory, and 3 to force temporary +# tables to always be in memory. +# +TCC = $(TCC) -DSQLITE_TEMP_STORE=1 +RCC = $(RCC) -DSQLITE_TEMP_STORE=1 + +# Enable/disable loadable extensions, and other optional features +# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). +# The same set of OMIT and ENABLE flags should be passed to the +# LEMON parser generator and the mkkeywordhash tool as well. + +# These are the required SQLite compilation options used when compiling for +# the Windows platform. +# +REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100 + +# If we are linking to the RPCRT4 library, enable features that need it. +# +!IF $(USE_RPCRT4_LIB)!=0 +REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1 +!ENDIF + +# Add the required and optional SQLite compilation options into the command +# lines used to invoke the MSVC code and resource compilers. +# +TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) +RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) + +# Add in any optional parameters specified on the commane line, e.g. +# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1" +# +TCC = $(TCC) $(OPTS) +RCC = $(RCC) $(OPTS) + +# If compiling for debugging, add some defines. +# +!IF $(DEBUG)>1 +TCC = $(TCC) -D_DEBUG +BCC = $(BCC) -D_DEBUG +RCC = $(RCC) -D_DEBUG +!ENDIF + +# If optimizations are enabled or disabled (either implicitly or +# explicitly), add the necessary flags. +# +!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0 +TCC = $(TCC) -Od +BCC = $(BCC) -Od +!IF $(USE_RUNTIME_CHECKS)!=0 +TCC = $(TCC) -RTC1 +BCC = $(BCC) -RTC1 +!ENDIF +!ELSEIF $(OPTIMIZATIONS)>=3 +TCC = $(TCC) -Ox +BCC = $(BCC) -Ox +!ELSEIF $(OPTIMIZATIONS)==2 +TCC = $(TCC) -O2 +BCC = $(BCC) -O2 +!ELSEIF $(OPTIMIZATIONS)==1 +TCC = $(TCC) -O1 +BCC = $(BCC) -O1 +!ENDIF + +# If symbols are enabled (or compiling for debugging), enable PDBs. +# +!IF $(DEBUG)>1 || $(SYMBOLS)!=0 +TCC = $(TCC) -Zi +BCC = $(BCC) -Zi +!ENDIF + + +# Command line prefixes for compiling code, compiling resources, +# linking, etc. +# +LTCOMPILE = $(TCC) -Fo$@ +LTRCOMPILE = $(RCC) -r +LTLIB = lib.exe +LTLINK = $(TCC) -Fe$@ + +# If requested, link to the RPCRT4 library. +# +!IF $(USE_RPCRT4_LIB)!=0 +LTLINK = $(LTLINK) rpcrt4.lib +!ENDIF + +# If a platform was set, force the linker to target that. +# Note that the vcvars*.bat family of batch files typically +# set this for you. Otherwise, the linker will attempt +# to deduce the binary type based on the object files. +!IFDEF PLATFORM +LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM) +LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM) +!ELSE +LTLINKOPTS = /NOLOGO +LTLIBOPTS = /NOLOGO +!ENDIF + +# When compiling for use in the WinRT environment, the following +# linker option must be used to mark the executable as runnable +# only in the context of an application container. +# +!IF $(FOR_WINRT)!=0 +LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER +!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0" +!IFNDEF STORELIBPATH +!IF "$(PLATFORM)"=="x86" +STORELIBPATH = $(CRTLIBPATH)\store +!ELSEIF "$(PLATFORM)"=="x64" +STORELIBPATH = $(CRTLIBPATH)\store\amd64 +!ELSEIF "$(PLATFORM)"=="ARM" +STORELIBPATH = $(CRTLIBPATH)\store\arm +!ELSE +STORELIBPATH = $(CRTLIBPATH)\store +!ENDIF +!ENDIF +STORELIBPATH = $(STORELIBPATH:\\=\) +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)" +!ENDIF +!ENDIF + +# When compiling for Windows Phone 8.1, an extra library path is +# required. +# +!IF $(USE_WP81_OPTS)!=0 +!IFNDEF WP81LIBPATH +!IF "$(PLATFORM)"=="x86" +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86 +!ELSEIF "$(PLATFORM)"=="ARM" +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM +!ELSE +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86 +!ENDIF +!ENDIF +!ENDIF + +# When compiling for Windows Phone 8.1, some extra linker options +# are also required. +# +!IF $(USE_WP81_OPTS)!=0 +!IFDEF WP81LIBPATH +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" +!ENDIF +LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE +LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib +!ENDIF + +# When compiling for UWP or the Windows 10 platform, some extra linker +# options are also required. +# +!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 +LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib +LTLINKOPTS = $(LTLINKOPTS) mincore.lib +!IFDEF PSDKLIBPATH +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" +!ENDIF +!ENDIF + +!IF $(FOR_WIN10)!=0 +LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)" +!IF $(DEBUG)>1 +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib +!ELSE +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib +!ENDIF +!ENDIF + +# If either debugging or symbols are enabled, enable PDBs. +# +!IF $(DEBUG)>1 || $(SYMBOLS)!=0 +LDFLAGS = /DEBUG $(LDOPTS) +!ELSE +LDFLAGS = $(LDOPTS) +!ENDIF + + +# You should not have to change anything below this line +############################################################################### + + +# Object files for the amalgamation. +# +LIBOBJS1 = sqlite3.lo + +# Determine the real value of LIBOBJ based on the 'configure' script +# +LIBOBJ = $(LIBOBJS1) + +# Determine if embedded resource compilation and usage are enabled. +# +!IF $(USE_RC)!=0 +LIBRESOBJS = sqlite3res.lo +!ELSE +LIBRESOBJS = +!ENDIF + + +# Additional compiler options for the shell. These are only effective +# when the shell is not being dynamically linked. +# +!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS +!ENDIF + + +# This is the default Makefile target. The objects listed here +# are what get build when you type just "make" with no arguments. +# +all: dll shell + +# Dynamic link library section. +# +dll: $(SQLITE3DLL) + +# Shell executable. +# +shell: $(SQLITE3EXE) + + +$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) + +Replace.exe: + $(CSC) /target:exe $(TOP)\Replace.cs + +sqlite3.def: Replace.exe $(LIBOBJ) + echo EXPORTS > sqlite3.def + dumpbin /all $(LIBOBJ) \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | sort >> sqlite3.def + +$(SQLITE3EXE): $(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) + $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\shell.c $(SHELL_CORE_SRC) \ + /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) + + +# Rule to build the amalgamation +# +sqlite3.lo: $(SQLITE3C) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C) + + +# Rule to build the Win32 resources object file. +# +!IF $(USE_RC)!=0 +_HASHCHAR=^# +!IF ![echo !IFNDEF VERSION > rcver.vc] && \ + ![for /F "delims=" %V in ('type "$(SQLITE3H)" ^| find "$(_HASHCHAR)define SQLITE_VERSION "') do (echo VERSION = ^^%V >> rcver.vc)] && \ + ![echo !ENDIF >> rcver.vc] +!INCLUDE rcver.vc +!ENDIF + +RESOURCE_VERSION = $(VERSION:^#=) +RESOURCE_VERSION = $(RESOURCE_VERSION:define=) +RESOURCE_VERSION = $(RESOURCE_VERSION:SQLITE_VERSION=) +RESOURCE_VERSION = $(RESOURCE_VERSION:"=) +RESOURCE_VERSION = $(RESOURCE_VERSION:.=,) + +$(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H) + echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h + echo #define SQLITE_RESOURCE_VERSION $(RESOURCE_VERSION) >> sqlite3rc.h + echo #endif >> sqlite3rc.h + $(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc +!ENDIF + + +clean: + del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Mon Aug 29 18:00:15 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69299BC7B0D; Mon, 29 Aug 2016 18:00:15 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4377EBD8; Mon, 29 Aug 2016 18:00:15 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TI0Ec0037463; Mon, 29 Aug 2016 18:00:14 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TI0E3m037460; Mon, 29 Aug 2016 18:00:14 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201608291800.u7TI0E3m037460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 29 Aug 2016 18:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305008 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 18:00:15 -0000 Author: hiren Date: Mon Aug 29 18:00:14 2016 New Revision: 305008 URL: https://svnweb.freebsd.org/changeset/base/305008 Log: MFC r303626 (by gallatin) Rework IPV6 TCP path MTU discovery to match IPv4. No objection: gallatin Modified: stable/11/sys/netinet/tcp_subr.c stable/11/sys/netinet6/icmp6.c stable/11/sys/netinet6/ip6_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_subr.c ============================================================================== --- stable/11/sys/netinet/tcp_subr.c Mon Aug 29 17:50:36 2016 (r305007) +++ stable/11/sys/netinet/tcp_subr.c Mon Aug 29 18:00:14 2016 (r305008) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef INET6 +#include #include #include #include @@ -2040,72 +2041,146 @@ tcp_ctlinput(int cmd, struct sockaddr *s void tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) { - struct tcphdr th; + struct in6_addr *dst; + struct tcphdr *th; struct inpcb *(*notify)(struct inpcb *, int) = tcp_notify; struct ip6_hdr *ip6; struct mbuf *m; + struct inpcb *inp; + struct tcpcb *tp; + struct icmp6_hdr *icmp6; struct ip6ctlparam *ip6cp = NULL; const struct sockaddr_in6 *sa6_src = NULL; - int off; - struct tcp_portonly { - u_int16_t th_sport; - u_int16_t th_dport; - } *thp; + struct in_conninfo inc; + tcp_seq icmp_tcp_seq; + unsigned int mtu; + unsigned int off; + if (sa->sa_family != AF_INET6 || sa->sa_len != sizeof(struct sockaddr_in6)) return; - if (cmd == PRC_MSGSIZE) - notify = tcp_mtudisc_notify; - else if (!PRC_IS_REDIRECT(cmd) && - ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0)) - return; - /* if the parameter is from icmp6, decode it. */ if (d != NULL) { ip6cp = (struct ip6ctlparam *)d; + icmp6 = ip6cp->ip6c_icmp6; m = ip6cp->ip6c_m; ip6 = ip6cp->ip6c_ip6; off = ip6cp->ip6c_off; sa6_src = ip6cp->ip6c_src; + dst = ip6cp->ip6c_finaldst; } else { m = NULL; ip6 = NULL; off = 0; /* fool gcc */ sa6_src = &sa6_any; + dst = NULL; } - if (ip6 != NULL) { - struct in_conninfo inc; - /* - * XXX: We assume that when IPV6 is non NULL, - * M and OFF are valid. - */ + if (cmd == PRC_MSGSIZE) + notify = tcp_mtudisc_notify; + else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || + cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && + ip6 != NULL) + notify = tcp_drop_syn_sent; - /* check if we can safely examine src and dst ports */ - if (m->m_pkthdr.len < off + sizeof(*thp)) - return; + /* + * Hostdead is ugly because it goes linearly through all PCBs. + * XXX: We never get this from ICMP, otherwise it makes an + * excellent DoS attack on machines with many connections. + */ + else if (cmd == PRC_HOSTDEAD) + ip6 = NULL; + else if ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0) + return; - bzero(&th, sizeof(th)); - m_copydata(m, off, sizeof(*thp), (caddr_t)&th); + if (ip6 == NULL) { + in6_pcbnotify(&V_tcbinfo, sa, 0, + (const struct sockaddr *)sa6_src, + 0, cmd, NULL, notify); + return; + } - in6_pcbnotify(&V_tcbinfo, sa, th.th_dport, - (struct sockaddr *)ip6cp->ip6c_src, - th.th_sport, cmd, NULL, notify); + /* Check if we can safely get the ports from the tcp hdr */ + if (m == NULL || + (m->m_pkthdr.len < + (int32_t) (off + offsetof(struct tcphdr, th_seq)))) { + return; + } + th = (struct tcphdr *) mtodo(ip6cp->ip6c_m, ip6cp->ip6c_off); + INP_INFO_RLOCK(&V_tcbinfo); + inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, th->th_dport, + &ip6->ip6_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL); + if (inp != NULL && PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + inp = (*notify)(inp, EHOSTDOWN); + if (inp != NULL) + INP_WUNLOCK(inp); + } else if (inp != NULL) { + if (!(inp->inp_flags & INP_TIMEWAIT) && + !(inp->inp_flags & INP_DROPPED) && + !(inp->inp_socket == NULL)) { + icmp_tcp_seq = ntohl(th->th_seq); + tp = intotcpcb(inp); + if (SEQ_GEQ(icmp_tcp_seq, tp->snd_una) && + SEQ_LT(icmp_tcp_seq, tp->snd_max)) { + if (cmd == PRC_MSGSIZE) { + /* + * MTU discovery: + * If we got a needfrag set the MTU + * in the route to the suggested new + * value (if given) and then notify. + */ + mtu = ntohl(icmp6->icmp6_mtu); + /* + * If no alternative MTU was + * proposed, or the proposed + * MTU was too small, set to + * the min. + */ + if (mtu < IPV6_MMTU) + mtu = IPV6_MMTU - 8; + + + bzero(&inc, sizeof(inc)); + inc.inc_fibnum = M_GETFIB(m); + inc.inc_flags |= INC_ISIPV6; + inc.inc6_faddr = *dst; + if (in6_setscope(&inc.inc6_faddr, + m->m_pkthdr.rcvif, NULL)) + goto unlock_inp; + + /* + * Only process the offered MTU if it + * is smaller than the current one. + */ + if (mtu < tp->t_maxseg + + (sizeof (*th) + sizeof (*ip6))) { + tcp_hc_updatemtu(&inc, mtu); + tcp_mtudisc(inp, mtu); + ICMP6STAT_INC(icp6s_pmtuchg); + } + } else + inp = (*notify)(inp, + inet6ctlerrmap[cmd]); + } + } +unlock_inp: + if (inp != NULL) + INP_WUNLOCK(inp); + } else { bzero(&inc, sizeof(inc)); - inc.inc_fport = th.th_dport; - inc.inc_lport = th.th_sport; - inc.inc6_faddr = ((struct sockaddr_in6 *)sa)->sin6_addr; - inc.inc6_laddr = ip6cp->ip6c_src->sin6_addr; + inc.inc_fibnum = M_GETFIB(m); inc.inc_flags |= INC_ISIPV6; - INP_INFO_RLOCK(&V_tcbinfo); - syncache_unreach(&inc, &th); - INP_INFO_RUNLOCK(&V_tcbinfo); - } else - in6_pcbnotify(&V_tcbinfo, sa, 0, (const struct sockaddr *)sa6_src, - 0, cmd, NULL, notify); + inc.inc_fport = th->th_dport; + inc.inc_lport = th->th_sport; + inc.inc6_faddr = *dst; + inc.inc6_laddr = ip6->ip6_src; + syncache_unreach(&inc, th); + } + INP_INFO_RUNLOCK(&V_tcbinfo); } #endif /* INET6 */ Modified: stable/11/sys/netinet6/icmp6.c ============================================================================== --- stable/11/sys/netinet6/icmp6.c Mon Aug 29 17:50:36 2016 (r305007) +++ stable/11/sys/netinet6/icmp6.c Mon Aug 29 18:00:14 2016 (r305008) @@ -485,15 +485,13 @@ icmp6_input(struct mbuf **mp, int *offp, icmp6_ifstat_inc(ifp, ifs6_in_dstunreach); switch (code) { case ICMP6_DST_UNREACH_NOROUTE: + case ICMP6_DST_UNREACH_ADDR: /* PRC_HOSTDEAD is a DOS */ code = PRC_UNREACH_NET; break; case ICMP6_DST_UNREACH_ADMIN: icmp6_ifstat_inc(ifp, ifs6_in_adminprohib); code = PRC_UNREACH_PROTOCOL; /* is this a good code? */ break; - case ICMP6_DST_UNREACH_ADDR: - code = PRC_HOSTDEAD; - break; case ICMP6_DST_UNREACH_BEYONDSCOPE: /* I mean "source address was incorrect." */ code = PRC_PARAMPROB; Modified: stable/11/sys/netinet6/ip6_output.c ============================================================================== --- stable/11/sys/netinet6/ip6_output.c Mon Aug 29 17:50:36 2016 (r305007) +++ stable/11/sys/netinet6/ip6_output.c Mon Aug 29 18:00:14 2016 (r305008) @@ -150,9 +150,10 @@ static int ip6_insertfraghdr(struct mbuf static int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t); static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *); static int ip6_getpmtu(struct route_in6 *, int, - struct ifnet *, const struct in6_addr *, u_long *, int *, u_int); + struct ifnet *, const struct in6_addr *, u_long *, int *, u_int, + u_int); static int ip6_calcmtu(struct ifnet *, const struct in6_addr *, u_long, - u_long *, int *); + u_long *, int *, u_int); static int ip6_getpmtu_ctl(u_int, const struct in6_addr *, u_long *); static int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int); @@ -718,7 +719,7 @@ again: /* Determine path MTU. */ if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, &ip6->ip6_dst, - &mtu, &alwaysfrag, fibnum)) != 0) + &mtu, &alwaysfrag, fibnum, *nexthdrp)) != 0) goto bad; /* @@ -1251,7 +1252,7 @@ ip6_getpmtu_ctl(u_int fibnum, const stru ifp = nh6.nh_ifp; mtu = nh6.nh_mtu; - error = ip6_calcmtu(ifp, dst, mtu, mtup, NULL); + error = ip6_calcmtu(ifp, dst, mtu, mtup, NULL, 0); fib6_free_nh_ext(fibnum, &nh6); return (error); @@ -1270,7 +1271,7 @@ ip6_getpmtu_ctl(u_int fibnum, const stru static int ip6_getpmtu(struct route_in6 *ro_pmtu, int do_lookup, struct ifnet *ifp, const struct in6_addr *dst, u_long *mtup, - int *alwaysfragp, u_int fibnum) + int *alwaysfragp, u_int fibnum, u_int proto) { struct nhop6_basic nh6; struct in6_addr kdst; @@ -1308,7 +1309,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, i if (ro_pmtu->ro_rt) mtu = ro_pmtu->ro_rt->rt_mtu; - return (ip6_calcmtu(ifp, dst, mtu, mtup, alwaysfragp)); + return (ip6_calcmtu(ifp, dst, mtu, mtup, alwaysfragp, proto)); } /* @@ -1320,7 +1321,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, i */ static int ip6_calcmtu(struct ifnet *ifp, const struct in6_addr *dst, u_long rt_mtu, - u_long *mtup, int *alwaysfragp) + u_long *mtup, int *alwaysfragp, u_int proto) { u_long mtu = 0; int alwaysfrag = 0; @@ -1335,7 +1336,11 @@ ip6_calcmtu(struct ifnet *ifp, const str inc.inc6_faddr = *dst; ifmtu = IN6_LINKMTU(ifp); - mtu = tcp_hc_getmtu(&inc); + + /* TCP is known to react to pmtu changes so skip hc */ + if (proto != IPPROTO_TCP) + mtu = tcp_hc_getmtu(&inc); + if (mtu) mtu = min(mtu, rt_mtu); else From owner-svn-src-stable-11@freebsd.org Tue Aug 30 01:01:43 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D0B1BC8B2E; Tue, 30 Aug 2016 01:01:43 +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 BA0C1800; Tue, 30 Aug 2016 01:01:42 +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 u7U11fpJ003395; Tue, 30 Aug 2016 01:01:41 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U11fI7003394; Tue, 30 Aug 2016 01:01:41 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608300101.u7U11fI7003394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Tue, 30 Aug 2016 01:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305038 - stable/11/lib/libc/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2016 01:01:43 -0000 Author: ache Date: Tue Aug 30 01:01:41 2016 New Revision: 305038 URL: https://svnweb.freebsd.org/changeset/base/305038 Log: MFC r304911 The formal behavior of qsort is unstable with regard to objects that are equal. Unfortunately, RFC 3484 requires that otherwise equal objects remain in the order supplied by the DNS server. The present code attempts to deal with this by returning -1 for objects that are equal (i.e., returns that the first parameter is less then the second parameter). Unfortunately, the qsort API does not state that the first parameter passed in is in any particular position in the list. PR: 212122 Submitted by: Herbie.Robinson@stratus.com Modified: stable/11/lib/libc/net/getaddrinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/11/lib/libc/net/getaddrinfo.c Tue Aug 30 00:57:57 2016 (r305037) +++ stable/11/lib/libc/net/getaddrinfo.c Tue Aug 30 01:01:41 2016 (r305038) @@ -224,6 +224,7 @@ struct ai_order { struct policyqueue *aio_dstpolicy; struct addrinfo *aio_ai; int aio_matchlen; + int aio_initial_sequence; }; static const ns_src default_dns_files[] = { @@ -708,6 +709,7 @@ reorder(struct addrinfo *sentinel) aio[i].aio_dstpolicy = match_addrselectpolicy(ai->ai_addr, &policyhead); set_source(&aio[i], &policyhead); + aio[i].aio_initial_sequence = i; } /* perform sorting. */ @@ -1066,6 +1068,23 @@ comp_dst(const void *arg1, const void *a } /* Rule 10: Otherwise, leave the order unchanged. */ + + /* + * Note that qsort is unstable; so, we can't return zero and + * expect the order to be unchanged. + * That also means we can't depend on the current position of + * dst2 being after dst1. We must enforce the initial order + * with an explicit compare on the original position. + * The qsort specification requires that "When the same objects + * (consisting of width bytes, irrespective of their current + * positions in the array) are passed more than once to the + * comparison function, the results shall be consistent with one + * another." + * In other words, If A < B, then we must also return B > A. + */ + if (dst2->aio_initial_sequence < dst1->aio_initial_sequence) + return(1); + return(-1); } From owner-svn-src-stable-11@freebsd.org Tue Aug 30 13:39:43 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A9ABC76E5; Tue, 30 Aug 2016 13:39:43 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5203B7B; Tue, 30 Aug 2016 13:39:43 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UDdgSZ087070; Tue, 30 Aug 2016 13:39:42 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UDdgc0087069; Tue, 30 Aug 2016 13:39:42 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201608301339.u7UDdgc0087069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Tue, 30 Aug 2016 13:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305063 - in stable: 10/sys/kern 11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2016 13:39:43 -0000 Author: badger Date: Tue Aug 30 13:39:42 2016 New Revision: 305063 URL: https://svnweb.freebsd.org/changeset/base/305063 Log: MFC r304184: sem_post(): wake up the sleeper only after adjusting has_waiters If the caller of sem_post() wakes up a thread sleeping via sem_wait() before it clears the has_waiters flag, the caller of sem_wait() has no way of knowing when it is safe to destroy the semaphore and reuse the memory. This is because the caller of sem_post() may be interrupted between the wake step and the clearing of has_waiters. It will then write into the has_waiters flag in userspace after being preempted for some unknown amount of time. Approved by: vangyzen (mentor) Sponsored by: Dell Inc. Modified: stable/11/sys/kern/kern_umtx.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_umtx.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/kern/kern_umtx.c ============================================================================== --- stable/11/sys/kern/kern_umtx.c Tue Aug 30 13:26:00 2016 (r305062) +++ stable/11/sys/kern/kern_umtx.c Tue Aug 30 13:39:42 2016 (r305063) @@ -3123,7 +3123,6 @@ do_sem_wake(struct thread *td, struct _u umtxq_busy(&key); cnt = umtxq_count(&key); if (cnt > 0) { - umtxq_signal(&key, 1); /* * Check if count is greater than 0, this means the memory is * still being referenced by user code, so we can safely @@ -3136,6 +3135,7 @@ do_sem_wake(struct thread *td, struct _u if (error == -1) error = EFAULT; } + umtxq_signal(&key, 1); } umtxq_unbusy(&key); umtxq_unlock(&key); @@ -3235,8 +3235,6 @@ do_sem2_wake(struct thread *td, struct _ umtxq_busy(&key); cnt = umtxq_count(&key); if (cnt > 0) { - umtxq_signal(&key, 1); - /* * If this was the last sleeping thread, clear the waiters * flag in _count. @@ -3251,6 +3249,8 @@ do_sem2_wake(struct thread *td, struct _ error = EFAULT; umtxq_lock(&key); } + + umtxq_signal(&key, 1); } umtxq_unbusy(&key); umtxq_unlock(&key); From owner-svn-src-stable-11@freebsd.org Tue Aug 30 13:56:12 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9779EBC7B0E; Tue, 30 Aug 2016 13:56:12 +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 4D846B57; Tue, 30 Aug 2016 13:56:12 +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 u7UDuBk0094242; Tue, 30 Aug 2016 13:56:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UDuBFo094241; Tue, 30 Aug 2016 13:56:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608301356.u7UDuBFo094241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Aug 2016 13:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305064 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2016 13:56:12 -0000 Author: kib Date: Tue Aug 30 13:56:11 2016 New Revision: 305064 URL: https://svnweb.freebsd.org/changeset/base/305064 Log: MFC r304916: Consistently delimit each vnode description block with two blank lines. Modified: stable/11/sys/kern/vnode_if.src Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vnode_if.src ============================================================================== --- stable/11/sys/kern/vnode_if.src Tue Aug 30 13:39:42 2016 (r305063) +++ stable/11/sys/kern/vnode_if.src Tue Aug 30 13:56:11 2016 (r305064) @@ -63,6 +63,7 @@ vop_islocked { IN struct vnode *vp; }; + %% lookup dvp L L L %% lookup vpp - L - @@ -76,6 +77,7 @@ vop_lookup { IN struct componentname *cnp; }; + %% cachedlookup dvp L L L %% cachedlookup vpp - L - @@ -87,6 +89,7 @@ vop_cachedlookup { IN struct componentname *cnp; }; + %% create dvp E E E %% create vpp - L - %! create post vop_create_post @@ -181,12 +184,14 @@ vop_setattr { IN struct ucred *cred; }; + %% markatime vp L L L vop_markatime { IN struct vnode *vp; }; + %% read vp L L L %! read post vop_read_post @@ -646,6 +651,7 @@ vop_allocate { INOUT off_t *len; }; + %% advise vp U U U vop_advise { @@ -655,6 +661,7 @@ vop_advise { IN int advice; }; + %% unp_bind vp E E E vop_unp_bind { @@ -662,6 +669,7 @@ vop_unp_bind { IN struct socket *socket; }; + %% unp_connect vp L L L vop_unp_connect { @@ -669,30 +677,35 @@ vop_unp_connect { OUT struct socket **socket; }; + %% unp_detach vp = = = vop_unp_detach { IN struct vnode *vp; }; + %% is_text vp L L L vop_is_text { IN struct vnode *vp; }; + %% set_text vp E E E vop_set_text { IN struct vnode *vp; }; + %% vop_unset_text vp E E E vop_unset_text { IN struct vnode *vp; }; + %% get_writecount vp L L L vop_get_writecount { @@ -700,6 +713,7 @@ vop_get_writecount { OUT int *writecount; }; + %% add_writecount vp E E E vop_add_writecount { @@ -707,6 +721,7 @@ vop_add_writecount { IN int inc; }; + %% fdatasync vp L L L vop_fdatasync { From owner-svn-src-stable-11@freebsd.org Tue Aug 30 19:27:28 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CBD4BC905E; Tue, 30 Aug 2016 19:27:28 +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 35246123; Tue, 30 Aug 2016 19:27:28 +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 u7UJRRaC020752; Tue, 30 Aug 2016 19:27:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UJRR2V020750; Tue, 30 Aug 2016 19:27:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608301927.u7UJRR2V020750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 30 Aug 2016 19:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305080 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2016 19:27:28 -0000 Author: tuexen Date: Tue Aug 30 19:27:27 2016 New Revision: 305080 URL: https://svnweb.freebsd.org/changeset/base/305080 Log: MFC r304736: When aborting an association, send the ABORT before notifying the upper layer. For the kernel this doesn't matter, for the userland stack, it does. While there, silence a clang warning when compiling it in userland. MFC r304837: Fix a bug, where no SACK is sent when receiving a FORWARD-TSN or I-FORWARD-TSN chunk before any DATA or I-DATA chunk. Thanks to Julian Cordes for finding this problem and prividing packetdrill scripts to reporduce the issue. Modified: stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Tue Aug 30 19:26:07 2016 (r305079) +++ stable/11/sys/netinet/sctp_input.c Tue Aug 30 19:27:27 2016 (r305080) @@ -5515,6 +5515,11 @@ process_control_chunks: *offset = length; return (NULL); } + /* + * For sending a SACK this looks like DATA + * chunks. + */ + stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; sctp_handle_forward_tsn(stcb, (struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset); if (abort_flag) { Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Tue Aug 30 19:26:07 2016 (r305079) +++ stable/11/sys/netinet/sctputil.c Tue Aug 30 19:27:27 2016 (r305080) @@ -3983,17 +3983,16 @@ sctp_abort_association(struct sctp_inpcb vtag = 0; if (stcb != NULL) { - /* We have a TCB to abort, send notification too */ vtag = stcb->asoc.peer_vtag; - sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); - /* get the assoc vrf id and table id */ vrf_id = stcb->asoc.vrf_id; - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } sctp_send_abort(m, iphlen, src, dst, sh, vtag, op_err, mflowtype, mflowid, inp->fibnum, vrf_id, port); if (stcb != NULL) { + /* We have a TCB to abort, send notification too */ + sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); + stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; /* Ok, now lets free it */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); @@ -4109,10 +4108,6 @@ sctp_abort_an_association(struct sctp_in } else { stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } - /* notify the ulp */ - if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - sctp_abort_notification(stcb, 0, 0, NULL, so_locked); - } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); SCTP_STAT_INCR_COUNTER32(sctps_aborted); @@ -4120,6 +4115,10 @@ sctp_abort_an_association(struct sctp_in (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } + /* notify the ulp */ + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { + sctp_abort_notification(stcb, 0, 0, NULL, so_locked); + } /* now free the asoc */ #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); @@ -6400,6 +6399,7 @@ sctp_connectx_helper_find(struct sctp_in #endif default: *totaddr = i; + incr = 0; /* we are done */ break; } From owner-svn-src-stable-11@freebsd.org Wed Aug 31 01:26:22 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCA5BC7206; Wed, 31 Aug 2016 01:26:22 +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 713B5187; Wed, 31 Aug 2016 01:26: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 u7V1QLDU059080; Wed, 31 Aug 2016 01:26:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V1QL5H059078; Wed, 31 Aug 2016 01:26:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608310126.u7V1QL5H059078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Aug 2016 01:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305105 - stable/11/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 01:26:22 -0000 Author: markj Date: Wed Aug 31 01:26:21 2016 New Revision: 305105 URL: https://svnweb.freebsd.org/changeset/base/305105 Log: MFC r304055: Fix handling of forward enum declarations in the CTF tools. Modified: stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Wed Aug 31 01:04:57 2016 (r305104) +++ stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Wed Aug 31 01:26:21 2016 (r305105) @@ -816,6 +816,11 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d Dwarf_Unsigned uval; Dwarf_Signed sval; + if (die_isdecl(dw, die)) { + tdp->t_type = FORWARD; + return; + } + debug(3, "die %llu: creating enum\n", off); tdp->t_type = ENUM; Modified: stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Wed Aug 31 01:04:57 2016 (r305104) +++ stable/11/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Wed Aug 31 01:26:21 2016 (r305105) @@ -338,7 +338,8 @@ fwd_equiv(tdesc_t *ctdp, tdesc_t *mtdp) { tdesc_t *defn = (ctdp->t_type == FORWARD ? mtdp : ctdp); - return (defn->t_type == STRUCT || defn->t_type == UNION); + return (defn->t_type == STRUCT || defn->t_type == UNION || + defn->t_type == ENUM); } static int From owner-svn-src-stable-11@freebsd.org Wed Aug 31 09:49:27 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F09BC7855; Wed, 31 Aug 2016 09:49:27 +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 695BCE0F; Wed, 31 Aug 2016 09:49:27 +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 u7V9nQMu049228; Wed, 31 Aug 2016 09:49:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V9nQJ0049227; Wed, 31 Aug 2016 09:49:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608310949.u7V9nQJ0049227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 31 Aug 2016 09:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305117 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 09:49:27 -0000 Author: mav Date: Wed Aug 31 09:49:26 2016 New Revision: 305117 URL: https://svnweb.freebsd.org/changeset/base/305117 Log: MFC r304751: Fix minor copy/paste bug. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Wed Aug 31 09:23:09 2016 (r305116) +++ stable/11/sbin/camcontrol/camcontrol.c Wed Aug 31 09:49:26 2016 (r305117) @@ -7515,7 +7515,7 @@ smpphycontrol(struct cam_device *device, response = malloc(sizeof(*response)); if (response == NULL) { warn("%s: unable to allocate %zd bytes", __func__, - sizeof(*request)); + sizeof(*response)); retval = 1; goto bailout; } From owner-svn-src-stable-11@freebsd.org Wed Aug 31 17:30:22 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B6D2BCAE1D; Wed, 31 Aug 2016 17:30: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 2D8D5637; Wed, 31 Aug 2016 17:30: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 u7VHUL5o024800; Wed, 31 Aug 2016 17:30:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VHUL4f024798; Wed, 31 Aug 2016 17:30:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608311730.u7VHUL4f024798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Aug 2016 17:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305135 - in stable/11/sys/arm64: arm64 include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 17:30:22 -0000 Author: andrew Date: Wed Aug 31 17:30:21 2016 New Revision: 305135 URL: https://svnweb.freebsd.org/changeset/base/305135 Log: MFC 302789: Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem. Modified: stable/11/sys/arm64/arm64/mem.c stable/11/sys/arm64/include/memdev.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/mem.c ============================================================================== --- stable/11/sys/arm64/arm64/mem.c Wed Aug 31 16:56:54 2016 (r305134) +++ stable/11/sys/arm64/arm64/mem.c Wed Aug 31 17:30:21 2016 (r305135) @@ -114,3 +114,19 @@ memrw(struct cdev *dev, struct uio *uio, return (error); } +/* + * allow user processes to MMAP some memory sections + * instead of going through read/write + */ +/* ARGSUSED */ +int +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) +{ + if (dev2unit(dev) == CDEV_MINOR_MEM) + *paddr = offset; + else if (dev2unit(dev) == CDEV_MINOR_KMEM) + *paddr = vtophys(offset); + /* else panic! */ + return (0); +} Modified: stable/11/sys/arm64/include/memdev.h ============================================================================== --- stable/11/sys/arm64/include/memdev.h Wed Aug 31 16:56:54 2016 (r305134) +++ stable/11/sys/arm64/include/memdev.h Wed Aug 31 17:30:21 2016 (r305135) @@ -35,6 +35,6 @@ d_open_t memopen; d_read_t memrw; #define memioctl (d_ioctl_t *)NULL -#define memmmap (d_mmap_t *)NULL +d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ From owner-svn-src-stable-11@freebsd.org Wed Aug 31 17:36:45 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5629BC8058; Wed, 31 Aug 2016 17:36:45 +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 7962AB92; Wed, 31 Aug 2016 17:36:45 +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 u7VHaiVI028547; Wed, 31 Aug 2016 17:36:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VHahaO028538; Wed, 31 Aug 2016 17:36:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608311736.u7VHahaO028538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Aug 2016 17:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305136 - in stable/11/sys: arm64/arm64 arm64/cavium arm64/include dev/pci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 17:36:45 -0000 Author: andrew Date: Wed Aug 31 17:36:43 2016 New Revision: 305136 URL: https://svnweb.freebsd.org/changeset/base/305136 Log: MFC 302847, 302848, 302852, 302853: Remove the remaining non-INTRNG support from the arm64 code. Modified: stable/11/sys/arm64/arm64/autoconf.c stable/11/sys/arm64/arm64/gic_v3.c stable/11/sys/arm64/arm64/gic_v3_fdt.c stable/11/sys/arm64/arm64/gic_v3_var.h stable/11/sys/arm64/arm64/mp_machdep.c stable/11/sys/arm64/arm64/nexus.c stable/11/sys/arm64/cavium/thunder_pcie_pem_fdt.c stable/11/sys/arm64/include/intr.h stable/11/sys/dev/pci/pci_host_generic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/autoconf.c ============================================================================== --- stable/11/sys/arm64/arm64/autoconf.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/arm64/autoconf.c Wed Aug 31 17:36:43 2016 (r305136) @@ -81,12 +81,8 @@ static void configure_final(void *dummy) { -#ifdef INTRNG /* Enable interrupt reception on this CPU */ intr_enable(); -#else - arm_enable_intr(); -#endif cninit_finish(); if (bootverbose) Modified: stable/11/sys/arm64/arm64/gic_v3.c ============================================================================== --- stable/11/sys/arm64/arm64/gic_v3.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/arm64/gic_v3.c Wed Aug 31 17:36:43 2016 (r305136) @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); 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; static pic_map_intr_t gic_v3_map_intr; @@ -90,18 +89,6 @@ static u_int gic_irq_cpu; static u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; static u_int sgi_first_unused = GIC_FIRST_SGI; #endif -#else -/* Device and PIC methods */ -static int gic_v3_bind(device_t, u_int, u_int); -static void gic_v3_dispatch(device_t, struct trapframe *); -static void gic_v3_eoi(device_t, u_int); -static void gic_v3_mask_irq(device_t, u_int); -static void gic_v3_unmask_irq(device_t, u_int); -#ifdef SMP -static void gic_v3_init_secondary(device_t); -static void gic_v3_ipi_send(device_t, cpuset_t, u_int); -#endif -#endif static device_method_t gic_v3_methods[] = { /* Device interface */ @@ -110,7 +97,6 @@ static device_method_t gic_v3_methods[] /* Bus interface */ DEVMETHOD(bus_read_ivar, gic_v3_read_ivar), -#ifdef INTRNG /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, gic_v3_disable_intr), DEVMETHOD(pic_enable_intr, gic_v3_enable_intr), @@ -126,18 +112,6 @@ static device_method_t gic_v3_methods[] DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), DEVMETHOD(pic_ipi_setup, gic_v3_ipi_setup), #endif -#else - /* PIC interface */ - DEVMETHOD(pic_bind, gic_v3_bind), - DEVMETHOD(pic_dispatch, gic_v3_dispatch), - DEVMETHOD(pic_eoi, gic_v3_eoi), - DEVMETHOD(pic_mask, gic_v3_mask_irq), - DEVMETHOD(pic_unmask, gic_v3_unmask_irq), -#ifdef SMP - DEVMETHOD(pic_init_secondary, gic_v3_init_secondary), - DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), -#endif -#endif /* End */ DEVMETHOD_END @@ -188,7 +162,6 @@ static gic_v3_initseq_t gic_v3_secondary }; #endif -#ifdef INTRNG uint32_t gic_r_read_4(device_t dev, bus_size_t offset) { @@ -224,7 +197,6 @@ gic_r_write_8(device_t dev, bus_size_t o sc = device_get_softc(dev); bus_write_8(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset, val); } -#endif /* * Device interface. @@ -238,10 +210,8 @@ gic_v3_attach(device_t dev) int rid; int err; size_t i; -#ifdef INTRNG u_int irq; const char *name; -#endif sc = device_get_softc(dev); sc->gic_registered = FALSE; @@ -290,7 +260,6 @@ gic_v3_attach(device_t dev) if (sc->gic_nirqs > GIC_I_NUM_MAX) sc->gic_nirqs = GIC_I_NUM_MAX; -#ifdef INTRNG sc->gic_irqs = malloc(sizeof(*sc->gic_irqs) * sc->gic_nirqs, M_GIC_V3, M_WAITOK | M_ZERO); name = device_get_nameunit(dev); @@ -318,7 +287,6 @@ gic_v3_attach(device_t dev) return (err); } } -#endif /* Get the number of supported interrupt identifier bits */ sc->gic_idbits = GICD_TYPER_IDBITS(typer); @@ -334,14 +302,6 @@ gic_v3_attach(device_t dev) if (err != 0) return (err); } - /* - * Full success. - * Now register PIC to the interrupts handling layer. - */ -#ifndef INTRNG - arm_register_root_pic(dev, sc->gic_nirqs); - sc->gic_registered = TRUE; -#endif return (0); } @@ -394,7 +354,6 @@ gic_v3_read_ivar(device_t dev, device_t return (ENOENT); } -#ifdef INTRNG int arm_gic_v3_intr(void *arg) { @@ -914,215 +873,6 @@ gic_v3_ipi_setup(device_t dev, u_int ipi return (0); } #endif /* SMP */ -#else /* INTRNG */ -/* - * PIC interface. - */ - -static int -gic_v3_bind(device_t dev, u_int irq, u_int cpuid) -{ - uint64_t aff; - struct gic_v3_softc *sc; - - sc = device_get_softc(dev); - - if (irq <= GIC_LAST_PPI) { - /* Can't bind PPI to another CPU but it's not an error */ - return (0); - } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { - aff = CPU_AFFINITY(cpuid); - gic_d_write(sc, 4, GICD_IROUTER(irq), aff); - return (0); - } else if (irq >= GIC_FIRST_LPI) - return (lpi_migrate(dev, irq, cpuid)); - - return (EINVAL); -} - -static void -gic_v3_dispatch(device_t dev, struct trapframe *frame) -{ - uint64_t active_irq; - - while (1) { - if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { - /* - * Hardware: Cavium ThunderX - * Chip revision: Pass 1.0 (early version) - * Pass 1.1 (production) - * ERRATUM: 22978, 23154 - */ - __asm __volatile( - "nop;nop;nop;nop;nop;nop;nop;nop; \n" - "mrs %0, ICC_IAR1_EL1 \n" - "nop;nop;nop;nop; \n" - "dsb sy \n" - : "=&r" (active_irq)); - } else { - active_irq = gic_icc_read(IAR1); - } - - if (__predict_false(active_irq == ICC_IAR1_EL1_SPUR)) - break; - - if (__predict_true((active_irq >= GIC_FIRST_PPI && - active_irq <= GIC_LAST_SPI) || active_irq >= GIC_FIRST_LPI)) { - arm_dispatch_intr(active_irq, frame); - continue; - } - - if (active_irq <= GIC_LAST_SGI) { - gic_icc_write(EOIR1, (uint64_t)active_irq); - arm_dispatch_intr(active_irq, frame); - continue; - } - } -} - -static void -gic_v3_eoi(device_t dev, u_int irq) -{ - - gic_icc_write(EOIR1, (uint64_t)irq); -} - -static void -gic_v3_mask_irq(device_t dev, u_int irq) -{ - struct gic_v3_softc *sc; - - sc = device_get_softc(dev); - - if (irq <= GIC_LAST_PPI) { /* SGIs and PPIs in corresponding Re-Distributor */ - gic_r_write(sc, 4, - GICR_SGI_BASE_SIZE + GICD_ICENABLER(irq), GICD_I_MASK(irq)); - gic_v3_wait_for_rwp(sc, REDIST); - } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { /* SPIs in distributor */ - gic_r_write(sc, 4, GICD_ICENABLER(irq), GICD_I_MASK(irq)); - gic_v3_wait_for_rwp(sc, DIST); - } else if (irq >= GIC_FIRST_LPI) { /* LPIs */ - lpi_mask_irq(dev, irq); - } else - panic("%s: Unsupported IRQ number %u", __func__, irq); -} - -static void -gic_v3_unmask_irq(device_t dev, u_int irq) -{ - struct gic_v3_softc *sc; - - sc = device_get_softc(dev); - - if (irq <= GIC_LAST_PPI) { /* SGIs and PPIs in corresponding Re-Distributor */ - gic_r_write(sc, 4, - GICR_SGI_BASE_SIZE + GICD_ISENABLER(irq), GICD_I_MASK(irq)); - gic_v3_wait_for_rwp(sc, REDIST); - } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { /* SPIs in distributor */ - gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq)); - gic_v3_wait_for_rwp(sc, DIST); - } else if (irq >= GIC_FIRST_LPI) { /* LPIs */ - lpi_unmask_irq(dev, irq); - } else - panic("%s: Unsupported IRQ number %u", __func__, irq); -} - -#ifdef SMP -static void -gic_v3_init_secondary(device_t dev) -{ - struct gic_v3_softc *sc; - gic_v3_initseq_t *init_func; - int err; - - sc = device_get_softc(dev); - - /* Train init sequence for boot CPU */ - for (init_func = gic_v3_secondary_init; *init_func != NULL; init_func++) { - err = (*init_func)(sc); - if (err != 0) { - device_printf(dev, - "Could not initialize GIC for CPU%u\n", - PCPU_GET(cpuid)); - return; - } - } - - /* - * Try to initialize ITS. - * If there is no driver attached this routine will fail but that - * does not mean failure here as only LPIs will not be functional - * on the current CPU. - */ - if (its_init_cpu(NULL) != 0) { - device_printf(dev, - "Could not initialize ITS for CPU%u. " - "No LPIs will arrive on this CPU\n", - PCPU_GET(cpuid)); - } - - /* - * ARM64TODO: Unmask timer PPIs. To be removed when appropriate - * mechanism is implemented. - * Activate the timer interrupts: virtual (27), secure (29), - * and non-secure (30). Use hardcoded values here as there - * should be no defines for them. - */ - gic_v3_unmask_irq(dev, 27); - gic_v3_unmask_irq(dev, 29); - gic_v3_unmask_irq(dev, 30); -} - -static void -gic_v3_ipi_send(device_t dev, cpuset_t cpuset, u_int ipi) -{ - u_int cpu; - uint64_t aff, tlist; - uint64_t val; - uint64_t aff_mask; - - /* Set affinity mask to match level 3, 2 and 1 */ - aff_mask = CPU_AFF1_MASK | CPU_AFF2_MASK | CPU_AFF3_MASK; - - /* Iterate through all CPUs in set */ - while (!CPU_EMPTY(&cpuset)) { - aff = tlist = 0; - for (cpu = 0; cpu < mp_ncpus; cpu++) { - /* Compose target list for single AFF3:AFF2:AFF1 set */ - if (CPU_ISSET(cpu, &cpuset)) { - if (!tlist) { - /* - * Save affinity of the first CPU to - * send IPI to for later comparison. - */ - aff = CPU_AFFINITY(cpu); - tlist |= (1UL << CPU_AFF0(aff)); - CPU_CLR(cpu, &cpuset); - } - /* Check for same Affinity level 3, 2 and 1 */ - if ((aff & aff_mask) == (CPU_AFFINITY(cpu) & aff_mask)) { - tlist |= (1UL << CPU_AFF0(CPU_AFFINITY(cpu))); - /* Clear CPU in cpuset from target list */ - CPU_CLR(cpu, &cpuset); - } - } - } - if (tlist) { - KASSERT((tlist & ~ICC_SGI1R_EL1_TL_MASK) == 0, - ("Target list too long for GICv3 IPI")); - /* Send SGI to CPUs in target list */ - val = tlist; - val |= (uint64_t)CPU_AFF3(aff) << ICC_SGI1R_EL1_AFF3_SHIFT; - val |= (uint64_t)CPU_AFF2(aff) << ICC_SGI1R_EL1_AFF2_SHIFT; - val |= (uint64_t)CPU_AFF1(aff) << ICC_SGI1R_EL1_AFF1_SHIFT; - val |= (uint64_t)(ipi & ICC_SGI1R_EL1_SGIID_MASK) << - ICC_SGI1R_EL1_SGIID_SHIFT; - gic_icc_write(SGI1R, val); - } - } -} -#endif -#endif /* !INTRNG */ /* * Helper routines Modified: stable/11/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- stable/11/sys/arm64/arm64/gic_v3_fdt.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/arm64/gic_v3_fdt.c Wed Aug 31 17:36:43 2016 (r305136) @@ -116,9 +116,7 @@ gic_v3_fdt_attach(device_t dev) { struct gic_v3_softc *sc; pcell_t redist_regions; -#ifdef INTRNG intptr_t xref; -#endif int err; sc = device_get_softc(dev); @@ -137,7 +135,6 @@ gic_v3_fdt_attach(device_t dev) if (err != 0) goto error; -#ifdef INTRNG xref = OF_xref_from_node(ofw_bus_get_node(dev)); sc->gic_pic = intr_pic_register(dev, xref); if (sc->gic_pic == NULL) { @@ -151,7 +148,6 @@ gic_v3_fdt_attach(device_t dev) err = ENXIO; goto error; } -#endif /* * Try to register ITS to this GIC. @@ -165,10 +161,8 @@ 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); @@ -302,37 +296,3 @@ gic_v3_ofw_bus_attach(device_t dev) return (bus_generic_attach(dev)); } - -#ifndef INTRNG -static int gic_v3_its_fdt_probe(device_t dev); - -static device_method_t gic_v3_its_fdt_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, gic_v3_its_fdt_probe), - - /* End */ - DEVMETHOD_END -}; - -DEFINE_CLASS_1(its, gic_v3_its_fdt_driver, gic_v3_its_fdt_methods, - sizeof(struct gic_v3_its_softc), gic_v3_its_driver); - -static devclass_t gic_v3_its_fdt_devclass; - -EARLY_DRIVER_MODULE(its, gic, gic_v3_its_fdt_driver, - gic_v3_its_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); - -static int -gic_v3_its_fdt_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, GIC_V3_ITS_COMPSTR)) - return (ENXIO); - - device_set_desc(dev, GIC_V3_ITS_DEVSTR); - return (BUS_PROBE_DEFAULT); -} -#endif Modified: stable/11/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- stable/11/sys/arm64/arm64/gic_v3_var.h Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/arm64/gic_v3_var.h Wed Aug 31 17:36:43 2016 (r305136) @@ -36,21 +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 { struct intr_irqsrc gi_isrc; uint32_t gi_irq; enum intr_polarity gi_pol; enum intr_trigger gi_trig; }; -#endif struct redist_lpis { vm_offset_t conf_base; @@ -87,17 +78,13 @@ 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 }; -#ifdef INTRNG #define GIC_INTR_ISRC(sc, irq) (&sc->gic_irqs[irq].gi_isrc) -#endif MALLOC_DECLARE(M_GIC_V3); @@ -115,12 +102,10 @@ 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 @@ -130,9 +115,6 @@ void gic_r_write_8(device_t, bus_size_t, 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 */ }; @@ -150,64 +132,6 @@ struct its_dev { vm_offset_t itt; size_t itt_size; }; -#ifndef INTRNG -TAILQ_HEAD(its_dev_list, its_dev); - -/* ITS private table description */ -struct its_ptab { - vm_offset_t ptab_vaddr; /* Virtual Address of table */ - size_t ptab_pgsz; /* Page size */ - size_t ptab_npages; /* Number of pages */ -}; - -/* ITS collection description. */ -struct its_col { - uint64_t col_target; /* Target Re-Distributor */ - uint64_t col_id; /* Collection ID */ -}; - -/* ITS command. Each command is 32 bytes long */ -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) -#define ITS_CMD_MAPD (0x08) -#define ITS_CMD_MAPC (0x09) -#define ITS_CMD_MAPVI (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) -#endif /* INTRNG */ /* * ITS command descriptor. @@ -264,61 +188,6 @@ 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) - -struct gic_v3_its_softc { - device_t dev; - struct resource * its_res; - - struct its_cmd * its_cmdq_base; /* ITS command queue base */ - struct its_cmd * its_cmdq_write; /* ITS command queue write ptr */ - struct its_ptab its_ptabs[GITS_BASER_NUM];/* ITS private tables */ - struct its_col * its_cols[MAXCPU];/* Per-CPU collections */ - - uint64_t its_flags; - -#ifndef INTRNG - struct its_dev_list its_dev_list; -#endif - - bitstr_t * its_lpi_bitmap; - uint32_t its_lpi_maxid; - - struct mtx its_dev_lock; - struct mtx its_cmd_lock; - - uint32_t its_socket; /* Socket number ITS is attached to */ -}; - -/* Stuff that is specific to the vendor's implementation */ -typedef uint32_t (*its_devbits_func_t)(device_t); - -struct its_quirks { - uint64_t cpuid; - uint64_t cpuid_mask; - its_devbits_func_t devbits_func; -}; - -extern devclass_t gic_v3_its_devclass; - -int gic_v3_its_detach(device_t); - -int gic_v3_its_alloc_msix(device_t, device_t, int *); -int gic_v3_its_release_msix(device_t, device_t, int); -int gic_v3_its_alloc_msi(device_t, device_t, int, int *); -int gic_v3_its_release_msi(device_t, device_t, int, int *); -int gic_v3_its_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); - -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. Modified: stable/11/sys/arm64/arm64/mp_machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/mp_machdep.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/arm64/mp_machdep.c Wed Aug 31 17:36:43 2016 (r305136) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include -#ifdef INTRNG #include "pic_if.h" typedef void intr_ipi_send_t(void *, cpuset_t, u_int); @@ -86,7 +85,6 @@ static struct intr_ipi ipi_sources[INTR_ static struct intr_ipi *intr_ipi_lookup(u_int); static void intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *); -#endif /* INTRNG */ boolean_t ofw_cpu_reg(phandle_t node, u_int, cell_t *); @@ -214,18 +212,12 @@ release_aps(void *dummy __unused) { int cpu, i; -#ifdef INTRNG intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); intr_pic_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); intr_pic_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); intr_pic_ipi_setup(IPI_STOP_HARD, "stop hard", ipi_stop, NULL); intr_pic_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); -#else - /* Setup the IPI handler */ - for (i = 0; i < INTR_IPI_COUNT; i++) - arm_setup_ipihandler(ipi_handler, i); -#endif atomic_store_rel_int(&aps_ready, 1); /* Wake up the other CPUs */ @@ -253,9 +245,6 @@ void init_secondary(uint64_t cpu) { struct pcpu *pcpup; -#ifndef INTRNG - int i; -#endif pcpup = &__pcpu[cpu]; /* @@ -282,15 +271,7 @@ init_secondary(uint64_t cpu) */ identify_cpu(); -#ifdef INTRNG intr_pic_init_secondary(); -#else - /* Configure the interrupt controller */ - arm_init_secondary(); - - for (i = 0; i < INTR_IPI_COUNT; i++) - arm_unmask_ipi(i); -#endif /* Start per-CPU event timers. */ cpu_initclocks_ap(); @@ -322,7 +303,6 @@ init_secondary(uint64_t cpu) /* NOTREACHED */ } -#ifdef INTRNG /* * Send IPI thru interrupt controller. */ @@ -378,7 +358,6 @@ intr_ipi_send(cpuset_t cpus, u_int ipi) ii->ii_send(ii->ii_send_arg, cpus, ipi); } -#endif static void ipi_ast(void *dummy __unused) @@ -432,44 +411,6 @@ ipi_stop(void *dummy __unused) CTR0(KTR_SMP, "IPI_STOP (restart)"); } -#ifndef INTRNG -static int -ipi_handler(void *arg) -{ - u_int cpu, ipi; - - arg = (void *)((uintptr_t)arg & ~(1 << 16)); - KASSERT((uintptr_t)arg < INTR_IPI_COUNT, - ("Invalid IPI %ju", (uintptr_t)arg)); - - cpu = PCPU_GET(cpuid); - ipi = (uintptr_t)arg; - - switch(ipi) { - case IPI_AST: - ipi_ast(NULL); - break; - case IPI_PREEMPT: - ipi_preempt(NULL); - break; - case IPI_RENDEZVOUS: - ipi_rendezvous(NULL); - break; - case IPI_STOP: - case IPI_STOP_HARD: - ipi_stop(NULL); - break; - case IPI_HARDCLOCK: - ipi_hardclock(NULL); - break; - default: - panic("Unknown IPI %#0x on cpu %d", ipi, curcpu); - } - - return (FILTER_HANDLED); -} -#endif - struct cpu_group * cpu_topo(void) { @@ -624,7 +565,6 @@ cpu_mp_setmaxid(void) mp_maxid = 0; } -#ifdef INTRNG /* * Lookup IPI source. */ @@ -768,4 +708,3 @@ ipi_selected(cpuset_t cpus, u_int ipi) CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); intr_ipi_send(cpus, ipi); } -#endif /* INTRNG */ Modified: stable/11/sys/arm64/arm64/nexus.c ============================================================================== --- stable/11/sys/arm64/arm64/nexus.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/arm64/nexus.c Wed Aug 31 17:36:43 2016 (r305136) @@ -271,13 +271,9 @@ nexus_config_intr(device_t dev, int irq, enum intr_polarity pol) { -#ifdef INTRNG /* TODO: This is wrong, it's needed for ACPI */ device_printf(dev, "bus_config_intr is obsolete and not supported!\n"); return (EOPNOTSUPP); -#else - return (intr_irq_config(irq, trig, pol)); -#endif } static int @@ -294,12 +290,7 @@ nexus_setup_intr(device_t dev, device_t if (error) return (error); -#ifdef INTRNG error = intr_setup_irq(child, res, filt, intr, arg, flags, cookiep); -#else - error = arm_setup_intr(device_get_nameunit(child), filt, intr, - arg, rman_get_start(res), flags, cookiep); -#endif return (error); } @@ -308,11 +299,7 @@ static int nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) { -#ifdef INTRNG return (intr_teardown_irq(child, r, ih)); -#else - return (intr_irq_remove_handler(child, rman_get_start(r), ih)); -#endif } #ifdef SMP @@ -320,11 +307,7 @@ static int nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { -#ifdef INTRNG return (intr_bind_irq(child, irq, cpu)); -#else - return (intr_irq_bind(rman_get_start(irq), cpu)); -#endif } #endif @@ -447,22 +430,8 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { -#ifdef INTRNG - return (INTR_IRQ_INVALID); -#else - int irq; - - if (icells == 3) { - irq = intr[1]; - if (intr[0] == 0) - irq += 32; /* SPI */ - else - irq += 16; /* PPI */ - } else - irq = intr[0]; - return (irq); -#endif + return (INTR_IRQ_INVALID); } #endif Modified: stable/11/sys/arm64/cavium/thunder_pcie_pem_fdt.c ============================================================================== --- stable/11/sys/arm64/cavium/thunder_pcie_pem_fdt.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/cavium/thunder_pcie_pem_fdt.c Wed Aug 31 17:36:43 2016 (r305136) @@ -109,7 +109,6 @@ thunder_pem_fdt_probe(device_t dev) return (ENXIO); } -#ifdef INTRNG static int thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) @@ -162,44 +161,6 @@ thunder_pem_fdt_map_msi(device_t pci, de NULL); return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); } -#else -static int -thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, - int *irqs) -{ - - return (arm_alloc_msi(pci, child, count, maxcount, irqs)); -} - -static int -thunder_pem_fdt_release_msi(device_t pci, device_t child, int count, int *irqs) -{ - - return (arm_release_msi(pci, child, count, irqs)); -} - -static int -thunder_pem_fdt_alloc_msix(device_t pci, device_t child, int *irq) -{ - - return (arm_alloc_msix(pci, child, irq)); -} - -static int -thunder_pem_fdt_release_msix(device_t pci, device_t child, int irq) -{ - - return (arm_release_msix(pci, child, irq)); -} - -static int -thunder_pem_fdt_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, - uint32_t *data) -{ - - return (arm_map_msi(pci, child, irq, addr, data)); -} -#endif static int thunder_pem_fdt_get_id(device_t dev, device_t child, enum pci_id_type type, Modified: stable/11/sys/arm64/include/intr.h ============================================================================== --- stable/11/sys/arm64/include/intr.h Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/arm64/include/intr.h Wed Aug 31 17:36:43 2016 (r305136) @@ -29,8 +29,6 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ -#ifdef INTRNG - #ifdef FDT #include #endif @@ -50,33 +48,4 @@ arm_irq_memory_barrier(uintptr_t irq) void intr_ipi_dispatch(u_int, struct trapframe *); #endif -#else -int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity); -void intr_irq_handler(struct trapframe *); -int intr_irq_remove_handler(device_t, u_int, void *); - -void arm_dispatch_intr(u_int, struct trapframe *); -int arm_enable_intr(void); -void arm_mask_irq(u_int); -void arm_register_root_pic(device_t, u_int); -void arm_register_msi_pic(device_t); -int arm_alloc_msi(device_t, device_t, int, int, int *); -int arm_release_msi(device_t, device_t, int, int *); -int arm_alloc_msix(device_t, device_t, int *); -int arm_release_msix(device_t, device_t, int); -int arm_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); -int arm_map_msix(device_t, device_t, int, uint64_t *, uint32_t *); -int arm_setup_intr(const char *, driver_filter_t *, driver_intr_t, - void *, u_int, enum intr_type, void **); -void arm_unmask_irq(u_int); - -#ifdef SMP -int intr_irq_bind(u_int, int); - -void arm_init_secondary(void); -void arm_setup_ipihandler(driver_filter_t *, u_int); -void arm_unmask_ipi(u_int); -#endif -#endif - #endif /* _MACHINE_INTR_H */ Modified: stable/11/sys/dev/pci/pci_host_generic.c ============================================================================== --- stable/11/sys/dev/pci/pci_host_generic.c Wed Aug 31 17:30:21 2016 (r305135) +++ stable/11/sys/dev/pci/pci_host_generic.c Wed Aug 31 17:36:43 2016 (r305136) @@ -724,8 +724,6 @@ generic_pcie_alloc_msi(device_t pci, dev NULL); return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, irqs)); -#elif defined(__aarch64__) - return (arm_alloc_msi(pci, child, count, maxcount, irqs)); #else return (ENXIO); #endif @@ -740,8 +738,6 @@ generic_pcie_release_msi(device_t pci, d ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, NULL); return (intr_release_msi(pci, child, msi_parent, count, irqs)); -#elif defined(__aarch64__) - return (arm_release_msi(pci, child, count, irqs)); #else return (ENXIO); #endif @@ -757,8 +753,6 @@ generic_pcie_map_msi(device_t pci, devic ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, NULL); return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); -#elif defined(__aarch64__) - return (arm_map_msi(pci, child, irq, addr, data)); #else return (ENXIO); #endif @@ -773,8 +767,6 @@ generic_pcie_alloc_msix(device_t pci, de ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, NULL); return (intr_alloc_msix(pci, child, msi_parent, irq)); -#elif defined(__aarch64__) - return (arm_alloc_msix(pci, child, irq)); #else return (ENXIO); #endif @@ -789,8 +781,6 @@ generic_pcie_release_msix(device_t pci, ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, NULL); return (intr_release_msix(pci, child, msi_parent, irq)); -#elif defined(__aarch64__) - return (arm_release_msix(pci, child, irq)); #else return (ENXIO); #endif From owner-svn-src-stable-11@freebsd.org Wed Aug 31 18:00:43 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 251F2BC8946; Wed, 31 Aug 2016 18:00:43 +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 D897AF7C; Wed, 31 Aug 2016 18:00:42 +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 u7VI0gWU036925; Wed, 31 Aug 2016 18:00:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VI0fpb036919; Wed, 31 Aug 2016 18:00:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608311800.u7VI0fpb036919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 31 Aug 2016 18:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305138 - in stable: 10/contrib/ipfilter 10/sys/contrib/ipfilter/netinet 11/contrib/ipfilter 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 18:00:43 -0000 Author: dim Date: Wed Aug 31 18:00:41 2016 New Revision: 305138 URL: https://svnweb.freebsd.org/changeset/base/305138 Log: MFC r304953: Define ipfilter's SOLARIS macro in a defined and portable way. Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D7671 MFC r304959 (by kib): Complete r304953. Sponsored by: The FreeBSD Foundation MFC r304964: Follow-up to r304953, in which I broke the build: apparently the SOLARIS macro is defined in lots of different places in ipfilter, so replace all of the nonportable definitions with portable ones. Pointy hat to: dim Modified: stable/11/contrib/ipfilter/opts.h stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_fil.h stable/11/sys/contrib/ipfilter/netinet/ip_log.c stable/11/sys/contrib/ipfilter/netinet/ip_nat.h stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/opts.h stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/10/sys/contrib/ipfilter/netinet/ip_log.c stable/10/sys/contrib/ipfilter/netinet/ip_nat.h stable/10/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/10/ (props changed) Modified: stable/11/contrib/ipfilter/opts.h ============================================================================== --- stable/11/contrib/ipfilter/opts.h Wed Aug 31 17:52:11 2016 (r305137) +++ stable/11/contrib/ipfilter/opts.h Wed Aug 31 18:00:41 2016 (r305138) @@ -12,7 +12,11 @@ #define __OPTS_H__ #ifndef SOLARIS -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #define OPT_REMOVE 0x000001 #define OPT_DEBUG 0x000002 Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Wed Aug 31 17:52:11 2016 (r305137) +++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Wed Aug 31 18:00:41 2016 (r305138) @@ -32,7 +32,13 @@ # define __KERNEL__ #endif -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#ifndef SOLARIS +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif +#endif #if defined(__SVR4) || defined(__svr4__) || defined(__sgi) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Wed Aug 31 17:52:11 2016 (r305137) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Wed Aug 31 18:00:41 2016 (r305138) @@ -29,7 +29,11 @@ #endif #ifndef SOLARIS -# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #ifndef __P Modified: stable/11/sys/contrib/ipfilter/netinet/ip_log.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_log.c Wed Aug 31 17:52:11 2016 (r305137) +++ stable/11/sys/contrib/ipfilter/netinet/ip_log.c Wed Aug 31 18:00:41 2016 (r305138) @@ -19,7 +19,11 @@ # include #endif #ifndef SOLARIS -# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #include #include Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_nat.h Wed Aug 31 17:52:11 2016 (r305137) +++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.h Wed Aug 31 18:00:41 2016 (r305138) @@ -13,8 +13,12 @@ #ifndef __IP_NAT_H__ #define __IP_NAT_H__ -#ifndef SOLARIS -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#ifndef SOLARIS +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Aug 31 17:52:11 2016 (r305137) +++ stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Aug 31 18:00:41 2016 (r305138) @@ -12,8 +12,12 @@ #ifndef __IP_PROXY_H__ #define __IP_PROXY_H__ -#ifndef SOLARIS -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#ifndef SOLARIS +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) From owner-svn-src-stable-11@freebsd.org Wed Aug 31 18:37:06 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F4C3BC96F7; Wed, 31 Aug 2016 18:37:06 +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 D574AFAA; Wed, 31 Aug 2016 18:37:05 +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 u7VIb5TR052501; Wed, 31 Aug 2016 18:37:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VIb5sX052500; Wed, 31 Aug 2016 18:37:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608311837.u7VIb5sX052500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 31 Aug 2016 18:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305142 - in stable: 10/sbin/hastd 11/sbin/hastd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 18:37:06 -0000 Author: dim Date: Wed Aug 31 18:37:04 2016 New Revision: 305142 URL: https://svnweb.freebsd.org/changeset/base/305142 Log: MFC r304969: Define hastd's STRICT_ALIGN macro in a defined and portable way. Modified: stable/11/sbin/hastd/lzf.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/hastd/lzf.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sbin/hastd/lzf.h ============================================================================== --- stable/11/sbin/hastd/lzf.h Wed Aug 31 18:35:41 2016 (r305141) +++ stable/11/sbin/hastd/lzf.h Wed Aug 31 18:37:04 2016 (r305142) @@ -132,7 +132,11 @@ lzf_decompress (const void *const in_dat * Unconditionally aligning does not cost very much, so do it if unsure */ #ifndef STRICT_ALIGN -# define STRICT_ALIGN !(defined(__i386) || defined (__amd64)) +# if !(defined(__i386) || defined (__amd64)) +# define STRICT_ALIGN 1 +# else +# define STRICT_ALIGN 0 +# endif #endif /* From owner-svn-src-stable-11@freebsd.org Wed Aug 31 20:21:05 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4506BCA094; Wed, 31 Aug 2016 20:21:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5346EC3D; Wed, 31 Aug 2016 20:21:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VKL4qj091544; Wed, 31 Aug 2016 20:21:04 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VKL4aw091538; Wed, 31 Aug 2016 20:21:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608312021.u7VKL4aw091538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 Aug 2016 20:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305150 - stable/11/secure/lib/libcrypto X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 20:21:05 -0000 Author: jkim Date: Wed Aug 31 20:21:03 2016 New Revision: 305150 URL: https://svnweb.freebsd.org/changeset/base/305150 Log: MFC: r304320 Disable assembly sources when compiler/assembler cannot compile certain instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support AVX instructions. Added: stable/11/secure/lib/libcrypto/opensslconf-aarch64.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-aarch64.h.in stable/11/secure/lib/libcrypto/opensslconf-arm.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-arm.h.in stable/11/secure/lib/libcrypto/opensslconf-mips.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-mips.h.in stable/11/secure/lib/libcrypto/opensslconf-powerpc.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-powerpc.h.in stable/11/secure/lib/libcrypto/opensslconf-riscv.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-riscv.h.in stable/11/secure/lib/libcrypto/opensslconf-sparc64.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-sparc64.h.in stable/11/secure/lib/libcrypto/opensslconf-x86.h.in - copied unchanged from r304320, head/secure/lib/libcrypto/opensslconf-x86.h.in Deleted: stable/11/secure/lib/libcrypto/opensslconf-aarch64.h stable/11/secure/lib/libcrypto/opensslconf-arm.h stable/11/secure/lib/libcrypto/opensslconf-mips.h stable/11/secure/lib/libcrypto/opensslconf-powerpc.h stable/11/secure/lib/libcrypto/opensslconf-riscv.h stable/11/secure/lib/libcrypto/opensslconf-sparc64.h stable/11/secure/lib/libcrypto/opensslconf-x86.h Modified: stable/11/secure/lib/libcrypto/Makefile stable/11/secure/lib/libcrypto/Makefile.asm stable/11/secure/lib/libcrypto/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/secure/lib/libcrypto/Makefile ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile Wed Aug 31 19:37:10 2016 (r305149) +++ stable/11/secure/lib/libcrypto/Makefile Wed Aug 31 20:21:03 2016 (r305150) @@ -22,9 +22,9 @@ MAN+= config.5 des_modes.7 # base sources SRCS= cpt_err.c cryptlib.c cversion.c ex_data.c mem.c mem_dbg.c o_dir.c \ o_fips.c o_init.c o_str.c o_time.c uid.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= x86_64cpuid.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= x86cpuid.S .else SRCS+= mem_clr.c @@ -33,10 +33,10 @@ INCS+= crypto.h ebcdic.h opensslv.h ossl # aes SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c @@ -60,7 +60,7 @@ INCS+= asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.S .else @@ -82,10 +82,10 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c bn_lib.c bn_mod.c \ bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_prime.c bn_print.c bn_rand.c \ bn_recp.c bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c @@ -98,9 +98,9 @@ INCS+= buffer.h # camellia SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_ofb.c cmll_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= cmll_misc.c cmll-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c @@ -135,7 +135,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c enc_read.c enc_writ.c \ fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c @@ -161,7 +161,7 @@ SRCS+= ec2_mult.c ec2_oct.c ec2_smpl.c e ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c ec_mult.c ec_oct.c \ ec_pmeth.c ec_print.c eck_prn.c ecp_mont.c ecp_nist.c ecp_oct.c \ ecp_smpl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= ecp_nistz256.c ecp_nistz256-x86_64.S .endif INCS+= ec.h @@ -218,9 +218,9 @@ INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= md5-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= md5-586.S .endif INCS+= md5.h @@ -232,9 +232,9 @@ INCS+= mdc2.h # modes SRCS+= cbc128.c ccm128.c cfb128.c ctr128.c cts128.c gcm128.c ofb128.c \ wrap128.c xts128.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= ghash-x86.S .endif INCS+= modes.h @@ -278,9 +278,9 @@ INCS+= rc2.h # rc4 SRCS+= rc4_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rc4-md5-x86_64.S rc4-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= rc4-586.S .else SRCS+= rc4_enc.c rc4_skey.c @@ -289,7 +289,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= rc5-586.S .else SRCS+= rc5_enc.c @@ -298,7 +298,7 @@ INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= rmd-586.S .endif INCS+= ripemd.h @@ -316,10 +316,10 @@ INCS+= seed.h # sha SRCS+= sha1_one.c sha1dgst.c sha256.c sha512.c sha_dgst.c sha_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \ sha512-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif INCS+= sha.h @@ -348,9 +348,9 @@ INCS+= ui.h ui_compat.h # whrlpool SRCS+= wp_dgst.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= wp-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= wp-mmx.S wp_block.c .else SRCS+= wp_block.c @@ -389,13 +389,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes ACFLAGS+= -Wa,--noexecstack .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -OPENSSLCONF_H= opensslconf-x86.h -.else -OPENSSLCONF_H= opensslconf-${MACHINE_CPUARCH}.h -.endif - -CLEANFILES= buildinf.h opensslconf.h +CLEANFILES= buildinf.h opensslconf.h opensslconf.h.tmp buildinf.h: Makefile ( echo "#ifndef MK1MF_BUILD"; \ @@ -404,17 +398,21 @@ buildinf.h: Makefile echo " #define PLATFORM \"platform: FreeBSD-${MACHINE_ARCH}\""; \ echo "#endif" ) > ${.TARGET} -opensslconf.h: ${OPENSSLCONF_H} - ${CP} ${.ALLSRC} ${.TARGET} +opensslconf.h: opensslconf-${MACHINE_CPUARCH:C/^(amd64|i386)$/x86/}.h.in +.if defined(ASM_${MACHINE_CPUARCH}) + sed 's/%%ASM%%//; /%%NO_ASM%%/d' ${.ALLSRC} > ${.TARGET}.tmp +.else + sed '/%%ASM%%/d; s/%%NO_ASM%%//' ${.ALLSRC} > ${.TARGET}.tmp +.endif + ${CP} ${.TARGET}.tmp ${.TARGET} .include -.if ${MACHINE_CPUARCH} == "amd64" -_bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm -.endif - -.if exists(${.CURDIR}/${MACHINE_CPUARCH}) +.if defined(ASM_${MACHINE_CPUARCH}) .PATH: ${.CURDIR}/${MACHINE_CPUARCH} +.if defined(ASM_amd64) +.PATH: ${LCRYPTO_SRC}/crypto/bn/asm +.endif .endif .PATH: ${LCRYPTO_SRC}/crypto \ @@ -423,7 +421,6 @@ _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/as ${LCRYPTO_SRC}/crypto/bf \ ${LCRYPTO_SRC}/crypto/bio \ ${LCRYPTO_SRC}/crypto/bn \ - ${_bn_asmpath} \ ${LCRYPTO_SRC}/crypto/buffer \ ${LCRYPTO_SRC}/crypto/camellia \ ${LCRYPTO_SRC}/crypto/cast \ Modified: stable/11/secure/lib/libcrypto/Makefile.asm ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 19:37:10 2016 (r305149) +++ stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:21:03 2016 (r305150) @@ -6,7 +6,7 @@ .include "Makefile.inc" -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes/asm \ @@ -78,7 +78,7 @@ ${s}.S: ${s}.s cat ${s}.s ) > ${.TARGET} .endfor -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes/asm \ Modified: stable/11/secure/lib/libcrypto/Makefile.inc ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile.inc Wed Aug 31 19:37:10 2016 (r305149) +++ stable/11/secure/lib/libcrypto/Makefile.inc Wed Aug 31 20:21:03 2016 (r305150) @@ -21,7 +21,17 @@ CFLAGS+=-DL_ENDIAN CFLAGS+=-DB_ENDIAN .endif -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +_ASM_AVX!= { \ + echo vzeroall | \ + ${CC} -x assembler -o /dev/null -c - 2> /dev/null; \ + } && echo yes || echo no +.if ${_ASM_AVX} == yes +ASM_${MACHINE_CPUARCH}= +.endif +.endif + +.if defined(ASM_amd64) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM CFLAGS+=-DECP_NISTZ256_ASM @@ -30,7 +40,7 @@ CFLAGS+=-DMD5_ASM CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+=-DWHIRLPOOL_ASM -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m Copied: stable/11/secure/lib/libcrypto/opensslconf-aarch64.h.in (from r304320, head/secure/lib/libcrypto/opensslconf-aarch64.h.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/secure/lib/libcrypto/opensslconf-aarch64.h.in Wed Aug 31 20:21:03 2016 (r305150, copy of r304320, head/secure/lib/libcrypto/opensslconf-aarch64.h.in) @@ -0,0 +1,262 @@ +/* $FreeBSD$ */ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif +#endif + +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/lib/engines" +#define OPENSSLDIR "/etc/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#undef RC4_CHUNK +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned int +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#undef BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#define RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#define DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif Copied: stable/11/secure/lib/libcrypto/opensslconf-arm.h.in (from r304320, head/secure/lib/libcrypto/opensslconf-arm.h.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/secure/lib/libcrypto/opensslconf-arm.h.in Wed Aug 31 20:21:03 2016 (r305150, copy of r304320, head/secure/lib/libcrypto/opensslconf-arm.h.in) @@ -0,0 +1,262 @@ +/* $FreeBSD$ */ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif +#endif + +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/lib/engines" +#define OPENSSLDIR "/etc/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#undef RC4_CHUNK +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned long +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#define BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#undef SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#define THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#define RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#define DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif Copied: stable/11/secure/lib/libcrypto/opensslconf-mips.h.in (from r304320, head/secure/lib/libcrypto/opensslconf-mips.h.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/secure/lib/libcrypto/opensslconf-mips.h.in Wed Aug 31 20:21:03 2016 (r305150, copy of r304320, head/secure/lib/libcrypto/opensslconf-mips.h.in) @@ -0,0 +1,274 @@ +/* $FreeBSD$ */ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif +#endif + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/lib/engines" +#define OPENSSLDIR "/etc/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#undef RC4_CHUNK +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#ifdef __mips_n64 +#define DES_LONG unsigned int +#else +#define DES_LONG unsigned long +#endif +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#ifdef __mips_n64 +#undef BN_LLONG +#else +#define BN_LLONG +#endif + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#ifdef __mips_n64 +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#else +#undef SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#define THIRTY_TWO_BIT +#endif +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#define RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#define DES_PTR +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Wed Aug 31 20:25:38 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8ADABCA1E3; Wed, 31 Aug 2016 20:25:38 +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 91A9A229F; Wed, 31 Aug 2016 20:25:38 +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 u7VKPbAC095057; Wed, 31 Aug 2016 20:25:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VKPbSq095056; Wed, 31 Aug 2016 20:25:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608312025.u7VKPbSq095056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 31 Aug 2016 20:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305151 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 20:25:38 -0000 Author: kib Date: Wed Aug 31 20:25:37 2016 New Revision: 305151 URL: https://svnweb.freebsd.org/changeset/base/305151 Log: MFC r304315 (by jilles): rights(4): CAP_FSYNC also permits fdatasync(2). Modified: stable/11/share/man/man4/rights.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/rights.4 ============================================================================== --- stable/11/share/man/man4/rights.4 Wed Aug 31 20:21:03 2016 (r305150) +++ stable/11/share/man/man4/rights.4 Wed Aug 31 20:25:37 2016 (r305151) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2015 +.Dd August 17, 2016 .Dt RIGHTS 4 .Os .Sh NAME @@ -254,6 +254,7 @@ Permit .It Dv CAP_FSYNC Permit .Xr aio_fsync 2 , +.Xr fdatasync 2 , .Xr fsync 2 and .Xr openat 2 From owner-svn-src-stable-11@freebsd.org Wed Aug 31 20:30:51 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 464DCBCA327; Wed, 31 Aug 2016 20:30:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F15E8254D; Wed, 31 Aug 2016 20:30:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VKUown095313; Wed, 31 Aug 2016 20:30:50 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VKUnqP095308; Wed, 31 Aug 2016 20:30:49 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608312030.u7VKUnqP095308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 Aug 2016 20:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305152 - in stable/11: crypto/openssl/crypto/bn/asm crypto/openssl/crypto/sha/asm secure/lib/libcrypto secure/lib/libcrypto/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 20:30:51 -0000 Author: jkim Date: Wed Aug 31 20:30:49 2016 New Revision: 305152 URL: https://svnweb.freebsd.org/changeset/base/305152 Log: MFC: r304636 Build OpenSSL assembly sources for arm. Added: stable/11/secure/lib/libcrypto/arm/ - copied from r304636, head/secure/lib/libcrypto/arm/ Modified: stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl stable/11/secure/lib/libcrypto/Makefile stable/11/secure/lib/libcrypto/Makefile.asm stable/11/secure/lib/libcrypto/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl ============================================================================== --- stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Wed Aug 31 20:25:37 2016 (r305151) +++ stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Wed Aug 31 20:30:49 2016 (r305152) @@ -213,8 +213,8 @@ $code.=<<___; .align 5 .LNEON: ldr r12, [sp] @ 5th argument - vmov.32 $a, r2, r1 - vmov.32 $b, r12, r3 + vmov $a, r2, r1 + vmov $b, r12, r3 vmov.i64 $k48, #0x0000ffffffffffff vmov.i64 $k32, #0x00000000ffffffff vmov.i64 $k16, #0x000000000000ffff Modified: stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl ============================================================================== --- stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl Wed Aug 31 20:25:37 2016 (r305151) +++ stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl Wed Aug 31 20:30:49 2016 (r305152) @@ -595,7 +595,7 @@ sha256_block_data_order_armv8: adr $Ktbl,.LARMv8 sub $Ktbl,$Ktbl,#.LARMv8-K256 # else - adrl $Ktbl,K256 + sub $Ktbl,$Ktbl,#256+32 # endif add $len,$inp,$len,lsl#6 @ len to point at the end of inp Modified: stable/11/secure/lib/libcrypto/Makefile ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile Wed Aug 31 20:25:37 2016 (r305151) +++ stable/11/secure/lib/libcrypto/Makefile Wed Aug 31 20:30:49 2016 (r305152) @@ -24,6 +24,8 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex o_fips.c o_init.c o_str.c o_time.c uid.c .if defined(ASM_amd64) SRCS+= x86_64cpuid.S +.elif defined(ASM_arm) +SRCS+= armcap.c armv4cpuid.S .elif defined(ASM_i386) SRCS+= x86cpuid.S .else @@ -36,6 +38,8 @@ SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes .if defined(ASM_amd64) SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S +.elif defined(ASM_arm) +SRCS+= aes-armv4.S aes_cbc.c aesv8-armx.S bsaes-armv7.S .elif defined(ASM_i386) SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else @@ -85,6 +89,8 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn .if defined(ASM_amd64) SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S +.elif defined(ASM_arm) +SRCS+= armv4-mont.S armv4-gf2m.S bn_asm.c .elif defined(ASM_i386) SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else @@ -234,6 +240,8 @@ SRCS+= cbc128.c ccm128.c cfb128.c ctr128 wrap128.c xts128.c .if defined(ASM_amd64) SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S +.elif defined(ASM_arm) +SRCS+= ghash-armv4.S ghashv8-armx.S .elif defined(ASM_i386) SRCS+= ghash-x86.S .endif @@ -319,6 +327,8 @@ SRCS+= sha1_one.c sha1dgst.c sha256.c sh .if defined(ASM_amd64) SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \ sha512-x86_64.S +.elif defined(ASM_arm) +SRCS+= sha1-armv4-large.S sha256-armv4.S sha512-armv4.S .elif defined(ASM_i386) SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif Modified: stable/11/secure/lib/libcrypto/Makefile.asm ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:25:37 2016 (r305151) +++ stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:30:49 2016 (r305152) @@ -78,6 +78,46 @@ ${s}.S: ${s}.s cat ${s}.s ) > ${.TARGET} .endfor +.elif defined(ASM_arm) + +.PATH: ${LCRYPTO_SRC}/crypto \ + ${LCRYPTO_SRC}/crypto/aes/asm \ + ${LCRYPTO_SRC}/crypto/bn/asm \ + ${LCRYPTO_SRC}/crypto/modes/asm \ + ${LCRYPTO_SRC}/crypto/sha/asm + +PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm + +# aes +SRCS= aesv8-armx.pl bsaes-armv7.pl + +# bn +SRCS+= armv4-mont.pl armv4-gf2m.pl + +# modes +SRCS+= ghash-armv4.pl ghashv8-armx.pl + +# sha +SRCS+= sha1-armv4-large.pl sha256-armv4.pl sha512-armv4.pl + +ASM= aes-armv4.S ${SRCS:R:S/$/.S/} + +all: ${ASM} + +CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} +.SUFFIXES: .pl + +aes-armv4.S: aes-armv4.pl + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.ALLSRC:T}.' ;\ + env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET} + +.pl.S: + env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/} + ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\ + cat ${.TARGET:R:S/$/.s/}) > ${.TARGET} + .elif defined(ASM_i386) .PATH: ${LCRYPTO_SRC}/crypto \ Modified: stable/11/secure/lib/libcrypto/Makefile.inc ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile.inc Wed Aug 31 20:25:37 2016 (r305151) +++ stable/11/secure/lib/libcrypto/Makefile.inc Wed Aug 31 20:30:49 2016 (r305152) @@ -29,6 +29,8 @@ _ASM_AVX!= { \ .if ${_ASM_AVX} == yes ASM_${MACHINE_CPUARCH}= .endif +.elif ${MACHINE_CPUARCH} == "arm" +ASM_arm= .endif .if defined(ASM_amd64) @@ -40,6 +42,11 @@ CFLAGS+=-DMD5_ASM CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+=-DWHIRLPOOL_ASM +.elif defined(ASM_arm) +CFLAGS+=-DAES_ASM -DBSAES_ASM +CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m +CFLAGS+=-DGHASH_ASM +CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM .elif defined(ASM_i386) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM From owner-svn-src-stable-11@freebsd.org Wed Aug 31 20:34:06 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93ADEBCA440; Wed, 31 Aug 2016 20:34:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60E6B299A; Wed, 31 Aug 2016 20:34:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VKY5OL098850; Wed, 31 Aug 2016 20:34:05 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VKXx6E098786; Wed, 31 Aug 2016 20:33:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608312033.u7VKXx6E098786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 Aug 2016 20:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305153 - in stable/11/secure/lib/libcrypto: . amd64 arm i386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 20:34:06 -0000 Author: jkim Date: Wed Aug 31 20:33:59 2016 New Revision: 305153 URL: https://svnweb.freebsd.org/changeset/base/305153 Log: MFC: r304638, r304640 Fix white spaces and prefer C-style comments in assembly sources. Modified: stable/11/secure/lib/libcrypto/Makefile.asm stable/11/secure/lib/libcrypto/amd64/aes-x86_64.S stable/11/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S stable/11/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S stable/11/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S stable/11/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S stable/11/secure/lib/libcrypto/amd64/aesni-x86_64.S stable/11/secure/lib/libcrypto/amd64/bsaes-x86_64.S stable/11/secure/lib/libcrypto/amd64/cmll-x86_64.S stable/11/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S stable/11/secure/lib/libcrypto/amd64/ghash-x86_64.S stable/11/secure/lib/libcrypto/amd64/md5-x86_64.S stable/11/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S stable/11/secure/lib/libcrypto/amd64/rc4-x86_64.S stable/11/secure/lib/libcrypto/amd64/rsaz-avx2.S stable/11/secure/lib/libcrypto/amd64/rsaz-x86_64.S stable/11/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S stable/11/secure/lib/libcrypto/amd64/sha1-x86_64.S stable/11/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S stable/11/secure/lib/libcrypto/amd64/sha256-x86_64.S stable/11/secure/lib/libcrypto/amd64/sha512-x86_64.S stable/11/secure/lib/libcrypto/amd64/vpaes-x86_64.S stable/11/secure/lib/libcrypto/amd64/wp-x86_64.S stable/11/secure/lib/libcrypto/amd64/x86_64-gf2m.S stable/11/secure/lib/libcrypto/amd64/x86_64-mont.S stable/11/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/11/secure/lib/libcrypto/amd64/x86_64cpuid.S stable/11/secure/lib/libcrypto/arm/aes-armv4.S stable/11/secure/lib/libcrypto/arm/aesv8-armx.S stable/11/secure/lib/libcrypto/arm/armv4-gf2m.S stable/11/secure/lib/libcrypto/arm/armv4-mont.S stable/11/secure/lib/libcrypto/arm/bsaes-armv7.S stable/11/secure/lib/libcrypto/arm/ghash-armv4.S stable/11/secure/lib/libcrypto/arm/ghashv8-armx.S stable/11/secure/lib/libcrypto/arm/sha1-armv4-large.S stable/11/secure/lib/libcrypto/arm/sha256-armv4.S stable/11/secure/lib/libcrypto/arm/sha512-armv4.S stable/11/secure/lib/libcrypto/i386/aes-586.S stable/11/secure/lib/libcrypto/i386/aesni-x86.S stable/11/secure/lib/libcrypto/i386/bf-586.S stable/11/secure/lib/libcrypto/i386/bf-686.S stable/11/secure/lib/libcrypto/i386/bn-586.S stable/11/secure/lib/libcrypto/i386/cmll-x86.S stable/11/secure/lib/libcrypto/i386/co-586.S stable/11/secure/lib/libcrypto/i386/crypt586.S stable/11/secure/lib/libcrypto/i386/des-586.S stable/11/secure/lib/libcrypto/i386/ghash-x86.S stable/11/secure/lib/libcrypto/i386/md5-586.S stable/11/secure/lib/libcrypto/i386/rc4-586.S stable/11/secure/lib/libcrypto/i386/rc5-586.S stable/11/secure/lib/libcrypto/i386/rmd-586.S stable/11/secure/lib/libcrypto/i386/sha1-586.S stable/11/secure/lib/libcrypto/i386/sha256-586.S stable/11/secure/lib/libcrypto/i386/sha512-586.S stable/11/secure/lib/libcrypto/i386/vpaes-x86.S stable/11/secure/lib/libcrypto/i386/wp-mmx.S stable/11/secure/lib/libcrypto/i386/x86-gf2m.S stable/11/secure/lib/libcrypto/i386/x86-mont.S stable/11/secure/lib/libcrypto/i386/x86cpuid.S Directory Properties: stable/11/ (props changed) Modified: stable/11/secure/lib/libcrypto/Makefile.asm ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:33:59 2016 (r305153) @@ -64,8 +64,8 @@ CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} .SUFFIXES: .pl .pl.S: - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\ env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET} ${SHA_TMP}: ${SHA_SRC} @@ -73,8 +73,8 @@ ${SHA_TMP}: ${SHA_SRC} .for s in ${SHA_ASM} ${s}.S: ${s}.s - ( echo ' # $$'FreeBSD'$$' ;\ - echo ' # Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${SHA_SRC}. */' ;\ cat ${s}.s ) > ${.TARGET} .endfor @@ -108,14 +108,14 @@ CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} .SUFFIXES: .pl aes-armv4.S: aes-armv4.pl - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.ALLSRC:T}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\ env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET} .pl.S: env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/} - ( echo ' # $$'FreeBSD'$$' ;\ - echo ' # Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}. */' ;\ cat ${.TARGET:R:S/$/.s/}) > ${.TARGET} .elif defined(ASM_i386) @@ -183,8 +183,8 @@ CLEANFILES= ${ASM} .SUFFIXES: .pl .pl.S: - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\ echo '#ifdef PIC' ;\ env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ echo '#else' ;\ Modified: stable/11/secure/lib/libcrypto/amd64/aes-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/aes-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/aes-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aes-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aes-x86_64.pl. */ .text .type _x86_64_AES_encrypt,@function .align 16 Modified: stable/11/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-gcm-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-gcm-x86_64.pl. */ .text .type _aesni_ctr32_ghash_6x,@function Modified: stable/11/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-mb-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-mb-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-sha1-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-sha1-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-sha256-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-sha256-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/aesni-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/aesni-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/aesni-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-x86_64.pl. */ .text .globl aesni_encrypt Modified: stable/11/secure/lib/libcrypto/amd64/bsaes-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/bsaes-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/bsaes-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bsaes-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bsaes-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/cmll-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/cmll-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/cmll-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from cmll-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from cmll-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ecp_nistz256-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ecp_nistz256-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/ghash-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/ghash-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/ghash-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ghash-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghash-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/md5-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/md5-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/md5-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from md5-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from md5-x86_64.pl. */ .text .align 16 Modified: stable/11/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc4-md5-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc4-md5-x86_64.pl. */ .text .align 16 Modified: stable/11/secure/lib/libcrypto/amd64/rc4-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/rc4-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/rc4-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc4-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc4-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/rsaz-avx2.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/rsaz-avx2.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/rsaz-avx2.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rsaz-avx2.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rsaz-avx2.pl. */ .text .globl rsaz_1024_sqr_avx2 Modified: stable/11/secure/lib/libcrypto/amd64/rsaz-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/rsaz-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/rsaz-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rsaz-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rsaz-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-mb-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-mb-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/sha1-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/sha1-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/sha1-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha256-mb-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha256-mb-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/sha256-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/sha256-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/sha256-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha512-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/sha512-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/sha512-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/sha512-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha512-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/vpaes-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/vpaes-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/vpaes-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from vpaes-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from vpaes-x86_64.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/wp-x86_64.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/wp-x86_64.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/wp-x86_64.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from wp-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from wp-x86_64.pl. */ .text .globl whirlpool_block Modified: stable/11/secure/lib/libcrypto/amd64/x86_64-gf2m.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/x86_64-gf2m.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/x86_64-gf2m.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64-gf2m.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64-gf2m.pl. */ .text .type _mul_1x1,@function Modified: stable/11/secure/lib/libcrypto/amd64/x86_64-mont.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/x86_64-mont.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/x86_64-mont.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64-mont.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64-mont.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/x86_64-mont5.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/x86_64-mont5.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/x86_64-mont5.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64-mont5.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64-mont5.pl. */ .text Modified: stable/11/secure/lib/libcrypto/amd64/x86_64cpuid.S ============================================================================== --- stable/11/secure/lib/libcrypto/amd64/x86_64cpuid.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/amd64/x86_64cpuid.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64cpuid.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64cpuid.pl. */ .hidden OPENSSL_cpuid_setup .section .init Modified: stable/11/secure/lib/libcrypto/arm/aes-armv4.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/aes-armv4.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/aes-armv4.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aes-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aes-armv4.pl. */ @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: stable/11/secure/lib/libcrypto/arm/aesv8-armx.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/aesv8-armx.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/aesv8-armx.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from aesv8-armx.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesv8-armx.pl. */ #include "arm_arch.h" #if __ARM_MAX_ARCH__>=7 Modified: stable/11/secure/lib/libcrypto/arm/armv4-gf2m.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/armv4-gf2m.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/armv4-gf2m.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from armv4-gf2m.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from armv4-gf2m.pl. */ #include "arm_arch.h" .text Modified: stable/11/secure/lib/libcrypto/arm/armv4-mont.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/armv4-mont.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/armv4-mont.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from armv4-mont.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from armv4-mont.pl. */ #include "arm_arch.h" .text Modified: stable/11/secure/lib/libcrypto/arm/bsaes-armv7.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/bsaes-armv7.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/bsaes-armv7.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from bsaes-armv7.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bsaes-armv7.pl. */ @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: stable/11/secure/lib/libcrypto/arm/ghash-armv4.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/ghash-armv4.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/ghash-armv4.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from ghash-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghash-armv4.pl. */ #include "arm_arch.h" .text Modified: stable/11/secure/lib/libcrypto/arm/ghashv8-armx.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/ghashv8-armx.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/ghashv8-armx.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from ghashv8-armx.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghashv8-armx.pl. */ #include "arm_arch.h" .text Modified: stable/11/secure/lib/libcrypto/arm/sha1-armv4-large.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/sha1-armv4-large.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/sha1-armv4-large.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha1-armv4-large.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-armv4-large.pl. */ #include "arm_arch.h" .text Modified: stable/11/secure/lib/libcrypto/arm/sha256-armv4.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/sha256-armv4.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/sha256-armv4.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha256-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha256-armv4.pl. */ @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: stable/11/secure/lib/libcrypto/arm/sha512-armv4.S ============================================================================== --- stable/11/secure/lib/libcrypto/arm/sha512-armv4.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/arm/sha512-armv4.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha512-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-armv4.pl. */ #include "arm_arch.h" #ifdef __ARMEL__ # define LO 0 Modified: stable/11/secure/lib/libcrypto/i386/aes-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/aes-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/aes-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aes-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aes-586.pl. */ #ifdef PIC .file "aes-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/aesni-x86.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/aesni-x86.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/aesni-x86.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-x86.pl. */ #ifdef PIC .file "aesni-x86.S" .text Modified: stable/11/secure/lib/libcrypto/i386/bf-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/bf-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/bf-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bf-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bf-586.pl. */ #ifdef PIC .file "bf-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/bf-686.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/bf-686.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/bf-686.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bf-686.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bf-686.pl. */ #ifdef PIC .file "bf-686.S" .text Modified: stable/11/secure/lib/libcrypto/i386/bn-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/bn-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/bn-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bn-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bn-586.pl. */ #ifdef PIC .file "bn-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/cmll-x86.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/cmll-x86.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/cmll-x86.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from cmll-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from cmll-x86.pl. */ #ifdef PIC .file "cmll-x86.S" .text Modified: stable/11/secure/lib/libcrypto/i386/co-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/co-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/co-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from co-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from co-586.pl. */ #ifdef PIC .file "co-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/crypt586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/crypt586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/crypt586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from crypt586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from crypt586.pl. */ #ifdef PIC .file "crypt586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/des-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/des-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/des-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from des-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from des-586.pl. */ #ifdef PIC .file "des-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/ghash-x86.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/ghash-x86.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/ghash-x86.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ghash-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghash-x86.pl. */ #ifdef PIC .file "ghash-x86.S" .text Modified: stable/11/secure/lib/libcrypto/i386/md5-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/md5-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/md5-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from md5-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from md5-586.pl. */ #ifdef PIC .file "md5-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/rc4-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/rc4-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/rc4-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc4-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc4-586.pl. */ #ifdef PIC .file "rc4-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/rc5-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/rc5-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/rc5-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc5-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc5-586.pl. */ #ifdef PIC .file "rc5-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/rmd-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/rmd-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/rmd-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rmd-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rmd-586.pl. */ #ifdef PIC .file "rmd-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/sha1-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/sha1-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/sha1-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-586.pl. */ #ifdef PIC .file "sha1-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/sha256-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/sha256-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/sha256-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha256-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha256-586.pl. */ #ifdef PIC .file "sha256-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/sha512-586.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/sha512-586.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/sha512-586.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha512-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-586.pl. */ #ifdef PIC .file "sha512-586.S" .text Modified: stable/11/secure/lib/libcrypto/i386/vpaes-x86.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/vpaes-x86.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/vpaes-x86.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from vpaes-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from vpaes-x86.pl. */ #ifdef PIC .file "vpaes-x86.S" .text Modified: stable/11/secure/lib/libcrypto/i386/wp-mmx.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/wp-mmx.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/wp-mmx.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from wp-mmx.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from wp-mmx.pl. */ #ifdef PIC .file "wp-mmx.S" .text Modified: stable/11/secure/lib/libcrypto/i386/x86-gf2m.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/x86-gf2m.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/x86-gf2m.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86-gf2m.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86-gf2m.pl. */ #ifdef PIC .file "x86-gf2m.S" .text Modified: stable/11/secure/lib/libcrypto/i386/x86-mont.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/x86-mont.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/x86-mont.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86-mont.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86-mont.pl. */ #ifdef PIC .file "x86-mont.S" .text Modified: stable/11/secure/lib/libcrypto/i386/x86cpuid.S ============================================================================== --- stable/11/secure/lib/libcrypto/i386/x86cpuid.S Wed Aug 31 20:30:49 2016 (r305152) +++ stable/11/secure/lib/libcrypto/i386/x86cpuid.S Wed Aug 31 20:33:59 2016 (r305153) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86cpuid.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86cpuid.pl. */ #ifdef PIC .file "x86cpuid.S" .text From owner-svn-src-stable-11@freebsd.org Wed Aug 31 21:14:17 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C907BBCAF49; Wed, 31 Aug 2016 21:14:17 +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 80616995; Wed, 31 Aug 2016 21:14:17 +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 u7VLEG7c014139; Wed, 31 Aug 2016 21:14:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VLEGMu014137; Wed, 31 Aug 2016 21:14:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608312114.u7VLEGMu014137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Aug 2016 21:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305157 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 21:14:17 -0000 Author: markj Date: Wed Aug 31 21:14:16 2016 New Revision: 305157 URL: https://svnweb.freebsd.org/changeset/base/305157 Log: MFC r304053, r304054: Initialize busy lock state and strengthen busy lock assertions. Modified: stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_phys.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Wed Aug 31 21:12:50 2016 (r305156) +++ stable/11/sys/vm/vm_page.c Wed Aug 31 21:14:16 2016 (r305157) @@ -1712,8 +1712,7 @@ vm_page_alloc(vm_object_t object, vm_pin ("vm_page_alloc: page %p has unexpected queue %d", m, m->queue)); KASSERT(m->wire_count == 0, ("vm_page_alloc: page %p is wired", m)); KASSERT(m->hold_count == 0, ("vm_page_alloc: page %p is held", m)); - KASSERT(!vm_page_sbusied(m), - ("vm_page_alloc: page %p is busy", m)); + KASSERT(!vm_page_busied(m), ("vm_page_alloc: page %p is busy", m)); KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("vm_page_alloc: page %p has unexpected memattr %d", m, @@ -2021,7 +2020,7 @@ vm_page_alloc_init(vm_page_t m) ("vm_page_alloc_init: page %p is wired", m)); KASSERT(m->hold_count == 0, ("vm_page_alloc_init: page %p is held", m)); - KASSERT(!vm_page_sbusied(m), + KASSERT(!vm_page_busied(m), ("vm_page_alloc_init: page %p is busy", m)); KASSERT(m->dirty == 0, ("vm_page_alloc_init: page %p is dirty", m)); Modified: stable/11/sys/vm/vm_phys.c ============================================================================== --- stable/11/sys/vm/vm_phys.c Wed Aug 31 21:12:50 2016 (r305156) +++ stable/11/sys/vm/vm_phys.c Wed Aug 31 21:14:16 2016 (r305157) @@ -741,6 +741,7 @@ vm_phys_add_page(vm_paddr_t pa) vm_cnt.v_page_count++; m = vm_phys_paddr_to_vm_page(pa); + m->busy_lock = VPB_UNBUSIED; m->phys_addr = pa; m->queue = PQ_NONE; m->segind = vm_phys_paddr_to_segind(pa); From owner-svn-src-stable-11@freebsd.org Wed Aug 31 21:35:13 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83299BCA6F8; Wed, 31 Aug 2016 21:35:13 +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 45351BC0; Wed, 31 Aug 2016 21:35:13 +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 u7VLZC6Y021970; Wed, 31 Aug 2016 21:35:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VLZCma021968; Wed, 31 Aug 2016 21:35:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608312135.u7VLZCma021968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Aug 2016 21:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305159 - in stable/11/sys: kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 21:35:13 -0000 Author: markj Date: Wed Aug 31 21:35:12 2016 New Revision: 305159 URL: https://svnweb.freebsd.org/changeset/base/305159 Log: MFC r303855: Handle races with listening socket close when connecting a unix socket. PR: 211531 Modified: stable/11/sys/kern/uipc_usrreq.c stable/11/sys/sys/unpcb.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_usrreq.c ============================================================================== --- stable/11/sys/kern/uipc_usrreq.c Wed Aug 31 21:18:38 2016 (r305158) +++ stable/11/sys/kern/uipc_usrreq.c Wed Aug 31 21:35:12 2016 (r305159) @@ -430,6 +430,8 @@ uipc_attach(struct socket *so, int proto unp->unp_socket = so; so->so_pcb = unp; unp->unp_refcount = 1; + if (so->so_head != NULL) + unp->unp_flags |= UNP_NASCENT; UNP_LIST_LOCK(); unp->unp_gencnt = ++unp_gencnt; @@ -652,14 +654,22 @@ uipc_detach(struct socket *so) unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); - UNP_LINK_WLOCK(); + vp = NULL; + local_unp_rights = 0; + UNP_LIST_LOCK(); - UNP_PCB_LOCK(unp); LIST_REMOVE(unp, unp_link); unp->unp_gencnt = ++unp_gencnt; --unp_count; UNP_LIST_UNLOCK(); + if ((unp->unp_flags & UNP_NASCENT) != 0) { + UNP_PCB_LOCK(unp); + goto teardown; + } + UNP_LINK_WLOCK(); + UNP_PCB_LOCK(unp); + /* * XXXRW: Should assert vp->v_socket == so. */ @@ -687,6 +697,7 @@ uipc_detach(struct socket *so) } local_unp_rights = unp_rights; UNP_LINK_WUNLOCK(); +teardown: unp->unp_socket->so_pcb = NULL; saved_unp_addr = unp->unp_addr; unp->unp_addr = NULL; @@ -1473,6 +1484,7 @@ unp_connect2(struct socket *so, struct s if (so2->so_type != so->so_type) return (EPROTOTYPE); + unp2->unp_flags &= ~UNP_NASCENT; unp->unp_conn = unp2; switch (so->so_type) { Modified: stable/11/sys/sys/unpcb.h ============================================================================== --- stable/11/sys/sys/unpcb.h Wed Aug 31 21:18:38 2016 (r305158) +++ stable/11/sys/sys/unpcb.h Wed Aug 31 21:35:12 2016 (r305159) @@ -103,11 +103,6 @@ struct unpcb { #define UNP_WANTCRED 0x004 /* credentials wanted */ #define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ -#define UNPGC_REF 0x1 /* unpcb has external ref. */ -#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ -#define UNPGC_SCANNED 0x4 /* Has been scanned. */ -#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ - /* * These flags are used to handle non-atomicity in connect() and bind() * operations on a socket: in particular, to avoid races between multiple @@ -115,6 +110,15 @@ struct unpcb { */ #define UNP_CONNECTING 0x010 /* Currently connecting. */ #define UNP_BINDING 0x020 /* Currently binding. */ +#define UNP_NASCENT 0x040 /* Newborn child socket. */ + +/* + * Flags in unp_gcflag. + */ +#define UNPGC_REF 0x1 /* unpcb has external ref. */ +#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ +#define UNPGC_SCANNED 0x4 /* Has been scanned. */ +#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) From owner-svn-src-stable-11@freebsd.org Wed Aug 31 22:18:51 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86F3CBCA366; Wed, 31 Aug 2016 22:18:51 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48CF2BB6; Wed, 31 Aug 2016 22:18:51 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VMIojb037291; Wed, 31 Aug 2016 22:18:50 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VMIobQ037290; Wed, 31 Aug 2016 22:18:50 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201608312218.u7VMIobQ037290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Wed, 31 Aug 2016 22:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305165 - in stable: 10/sbin/resolvconf 11/sbin/resolvconf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 22:18:51 -0000 Author: badger Date: Wed Aug 31 22:18:50 2016 New Revision: 305165 URL: https://svnweb.freebsd.org/changeset/base/305165 Log: MFC r304652: Fix missing substitution of @SBINDIR@ in resolvconf scripts Certain features, such as resolv_conf_passthrough=NULL, do not work correctly due to this missing substitution. Also remove the @PREFIX@ substitution, which is no longer needed. Approved by: vangyzen (mentor) Sponsored by: Dell Inc. Modified: stable/11/sbin/resolvconf/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/resolvconf/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/11/sbin/resolvconf/Makefile ============================================================================== --- stable/11/sbin/resolvconf/Makefile Wed Aug 31 21:48:22 2016 (r305164) +++ stable/11/sbin/resolvconf/Makefile Wed Aug 31 22:18:50 2016 (r305165) @@ -16,6 +16,7 @@ CLEANFILES= ${SCRIPTS} ${FILES} ${MAN} SYSCONFDIR= /etc RCDIR= ${SYSCONFDIR}/rc.d VARDIR= /var/run/resolvconf +SBINDIR= /sbin # We don't assume to restart the services in /sbin. So, though # our service(8) is in /usr/sbin, we can use it, here. @@ -28,13 +29,13 @@ RESTARTCMD= "/usr/sbin/service ${CMD1} \ .for f in ${SCRIPTS} ${FILES} ${MAN} ${f}: ${f}.in - sed -e 's:@PREFIX@::g' \ - -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ + sed -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ -e 's:@VARDIR@:${VARDIR}:g' \ -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \ -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \ -e 's:@RCDIR@:${RCDIR}:g' \ + -e 's:@SBINDIR@:${SBINDIR}:g' \ -e 's: vpn : ng[0-9]*&:g' \ ${DIST}/$@.in > $@ .endfor From owner-svn-src-stable-11@freebsd.org Thu Sep 1 07:15:24 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADFEBBCBF29; Thu, 1 Sep 2016 07:15:24 +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 785759D9; Thu, 1 Sep 2016 07:15:24 +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 u817FN04040360; Thu, 1 Sep 2016 07:15:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u817FNRh040359; Thu, 1 Sep 2016 07:15:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609010715.u817FNRh040359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 1 Sep 2016 07:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305181 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 07:15:24 -0000 Author: kib Date: Thu Sep 1 07:15:23 2016 New Revision: 305181 URL: https://svnweb.freebsd.org/changeset/base/305181 Log: MFC r304812: In both do_rw_wrlock() and do_rw_rdlock(), do not obliterate possible error from sleep. Modified: stable/11/sys/kern/kern_umtx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_umtx.c ============================================================================== --- stable/11/sys/kern/kern_umtx.c Thu Sep 1 07:08:01 2016 (r305180) +++ stable/11/sys/kern/kern_umtx.c Thu Sep 1 07:15:23 2016 (r305181) @@ -2609,7 +2609,7 @@ do_rw_rdlock(struct thread *td, struct u uint32_t flags, wrflags; int32_t state, oldstate; int32_t blocked_readers; - int error, rv; + int error, error1, rv; uq = td->td_umtxq; error = fueword32(&rwlock->rw_flags, &flags); @@ -2758,9 +2758,12 @@ sleep: if (oldstate == state) break; state = oldstate; - error = umtxq_check_susp(td); - if (error != 0) + error1 = umtxq_check_susp(td); + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } } @@ -2783,7 +2786,7 @@ do_rw_wrlock(struct thread *td, struct u int32_t state, oldstate; int32_t blocked_writers; int32_t blocked_readers; - int error, rv; + int error, error1, rv; uq = td->td_umtxq; error = fueword32(&rwlock->rw_flags, &flags); @@ -2929,14 +2932,17 @@ sleep: if (oldstate == state) break; state = oldstate; - error = umtxq_check_susp(td); + error1 = umtxq_check_susp(td); /* * We are leaving the URWLOCK_WRITE_WAITERS * behind, but this should not harm the * correctness. */ - if (error != 0) + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } rv = fueword32(&rwlock->rw_blocked_readers, &blocked_readers); From owner-svn-src-stable-11@freebsd.org Thu Sep 1 07:19:05 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C79F3BCB2D7; Thu, 1 Sep 2016 07:19:05 +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 89FBED3A; Thu, 1 Sep 2016 07:19:05 +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 u817J4wU040582; Thu, 1 Sep 2016 07:19:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u817J45U040581; Thu, 1 Sep 2016 07:19:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609010719.u817J45U040581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 1 Sep 2016 07:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305183 - stable/11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 07:19:05 -0000 Author: kib Date: Thu Sep 1 07:19:04 2016 New Revision: 305183 URL: https://svnweb.freebsd.org/changeset/base/305183 Log: MFC r305024: Typesetting fixes. Modified: stable/11/lib/libc/sys/ptrace.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/ptrace.2 ============================================================================== --- stable/11/lib/libc/sys/ptrace.2 Thu Sep 1 07:17:06 2016 (r305182) +++ stable/11/lib/libc/sys/ptrace.2 Thu Sep 1 07:19:04 2016 (r305183) @@ -104,7 +104,7 @@ Each traced process has a tracing event An event in the traced process only reports a signal stop if the corresponding flag is set in the tracing event mask. The current set of tracing event flags include: -.Bl -tag -width ".Dv PTRACE_SYSCALL" +.Bl -tag -width "Dv PTRACE_SYSCALL" .It Dv PTRACE_EXEC Report a stop for a successful invocation of .Xr execve 2 . @@ -231,7 +231,7 @@ The .Fa request argument can be: -.Bl -tag -width 12n +.Bl -tag -width "Dv PT_GET_EVENT_MASK" .It Dv PT_TRACE_ME This request is the only one used by the traced process; it declares that the process expects to be traced by its parent. @@ -469,31 +469,31 @@ The fields in the .Vt "struct ptrace_lwpinfo" have the following meaning: .Bl -tag -width indent -compact -.It pl_lwpid +.It Va pl_lwpid LWP id of the thread -.It pl_event +.It Va pl_event Event that caused the stop. -Currently defined events are -.Bl -tag -width indent -compact -.It PL_EVENT_NONE +Currently defined events are: +.Bl -tag -width "Dv PL_EVENT_SIGNAL" -compact +.It Dv PL_EVENT_NONE No reason given -.It PL_EVENT_SIGNAL +.It Dv PL_EVENT_SIGNAL Thread stopped due to the pending signal .El -.It pl_flags +.It Va pl_flags Flags that specify additional details about observed stop. Currently defined flags are: .Bl -tag -width indent -compact -.It PL_FLAG_SCE +.It Dv PL_FLAG_SCE The thread stopped due to system call entry, right after the kernel is entered. The debugger may examine syscall arguments that are stored in memory and registers according to the ABI of the current process, and modify them, if needed. -.It PL_FLAG_SCX +.It Dv PL_FLAG_SCX The thread is stopped immediately before syscall is returning to the usermode. The debugger may examine system call return values in the ABI-defined registers and/or memory. -.It PL_FLAG_EXEC +.It Dv PL_FLAG_EXEC When .Dv PL_FLAG_SCX is set, this flag may be additionally specified to inform that the @@ -501,13 +501,13 @@ program being executed by debuggee proce execution of a system call from the .Fn execve 2 family. -.It PL_FLAG_SI +.It Dv PL_FLAG_SI Indicates that .Va pl_siginfo member of .Vt "struct ptrace_lwpinfo" contains valid information. -.It PL_FLAG_FORKED +.It Dv PL_FLAG_FORKED Indicates that the process is returning from a call to .Fn fork 2 that created a new child process. @@ -515,42 +515,42 @@ The process identifier of the new proces .Va pl_child_pid member of .Vt "struct ptrace_lwpinfo" . -.It PL_FLAG_CHILD +.It Dv PL_FLAG_CHILD The flag is set for first event reported from a new child which is automatically attached when .Dv PTRACE_FORK is enabled. -.It PL_FLAG_BORN +.It Dv PL_FLAG_BORN This flag is set for the first event reported from a new LWP when .Dv PTRACE_LWP is enabled. It is reported along with .Dv PL_FLAG_SCX . -.It PL_FLAG_EXITED +.It Dv PL_FLAG_EXITED This flag is set for the last event reported by an exiting LWP when .Dv PTRACE_LWP is enabled. Note that this event is not reported when the last LWP in a process exits. The termination of the last thread is reported via a normal process exit event. -.It PL_FLAG_VFORKED +.It Dv PL_FLAG_VFORKED Indicates that the thread is returning from a call to .Xr vfork 2 that created a new child process. This flag is set in addition to .Dv PL_FLAG_FORKED . -.It PL_FLAG_VFORK_DONE +.It Dv PL_FLAG_VFORK_DONE Indicates that the thread has resumed after a child process created via .Xr vfork 2 has stopped sharing its address space with the traced process. .El -.It pl_sigmask +.It Va pl_sigmask The current signal mask of the LWP -.It pl_siglist +.It Va pl_siglist The current pending set of signals for the LWP. Note that signals that are delivered to the process would not appear on an LWP siglist until the thread is selected for delivery. -.It pl_siginfo +.It Va pl_siginfo The siginfo that accompanies the signal pending. Only valid for .Dv PL_EVENT_SIGNAL @@ -558,9 +558,9 @@ stop when .Dv PL_FLAG_SI is set in .Va pl_flags . -.It pl_tdname +.It Va pl_tdname The name of the thread. -.It pl_child_pid +.It Va pl_child_pid The process identifier of the new child process. Only valid for a .Dv PL_EVENT_SIGNAL @@ -568,7 +568,7 @@ stop when .Dv PL_FLAG_FORKED is set in .Va pl_flags . -.It pl_syscall_code +.It Va pl_syscall_code The ABI-specific identifier of the current system call. Note that for indirect system calls this field reports the indirected system call. @@ -578,7 +578,7 @@ or .Dv PL_FLAG_SCX is set in .Va pl_flags. -.It pl_syscall_narg +.It Va pl_syscall_narg The number of arguments passed to the current system call not counting the system call identifier. Note that for indirect system calls this field reports the arguments @@ -590,10 +590,10 @@ or is set in .Va pl_flags. .El -.It PT_GETNUMLWPS +.It Dv PT_GETNUMLWPS This request returns the number of kernel threads associated with the traced process. -.It PT_GETLWPLIST +.It Dv PT_GETLWPLIST This request can be used to get the current thread list. A pointer to an array of type .Vt lwpid_t @@ -604,15 +604,15 @@ with the array size specified by The return value from .Fn ptrace is the count of array entries filled in. -.It PT_SETSTEP +.It Dv PT_SETSTEP This request will turn on single stepping of the specified process. -.It PT_CLEARSTEP +.It Dv PT_CLEARSTEP This request will turn off single stepping of the specified process. -.It PT_SUSPEND +.It Dv PT_SUSPEND This request will suspend the specified thread. -.It PT_RESUME +.It Dv PT_RESUME This request will resume the specified thread. -.It PT_TO_SCE +.It Dv PT_TO_SCE This request will set the .Dv PTRACE_SCE event flag to trace all future system call entries and continue the process. @@ -622,7 +622,7 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. -.It PT_TO_SCX +.It Dv PT_TO_SCX This request will set the .Dv PTRACE_SCX event flag to trace all future system call exits and continue the process. @@ -632,7 +632,7 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. -.It PT_SYSCALL +.It Dv PT_SYSCALL This request will set the .Dv PTRACE_SYSCALL event flag to trace all future system call entries and exits and continue @@ -643,7 +643,7 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. -.It PT_FOLLOW_FORK +.It Dv PT_FOLLOW_FORK This request controls tracing for new child processes of a traced process. If .Fa data @@ -655,7 +655,7 @@ If is zero, .Dv PTRACE_FORK is cleared from the traced process's event tracing mask. -.It PT_LWP_EVENTS +.It Dv PT_LWP_EVENTS This request controls tracing of LWP creation and destruction. If .Fa data @@ -667,25 +667,25 @@ If is zero, .Dv PTRACE_LWP is cleared from the traced process's event tracing mask. -.It PT_GET_EVENT_MASK +.It Dv PT_GET_EVENT_MASK This request reads the traced process's event tracing mask into the integer pointed to by .Fa addr . The size of the integer must be passed in .Fa data . -.It PT_SET_EVENT_MASK +.It Dv PT_SET_EVENT_MASK This request sets the traced process's event tracing mask from the integer pointed to by .Fa addr . The size of the integer must be passed in .Fa data . -.It PT_VM_TIMESTAMP +.It Dv PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from .Fn ptrace . This provides a low-cost way for the tracing process to determine if the VM map changed since the last time this request was made. -.It PT_VM_ENTRY +.It Dv PT_VM_ENTRY This request is used to iterate over the entries of the VM map of the traced process. The From owner-svn-src-stable-11@freebsd.org Thu Sep 1 07:41:50 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54EA8BCB5FD; Thu, 1 Sep 2016 07:41:50 +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 24E90DD0; Thu, 1 Sep 2016 07:41:50 +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 u817fnnW051054; Thu, 1 Sep 2016 07:41:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u817fnmd051053; Thu, 1 Sep 2016 07:41:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010741.u817fnmd051053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 07:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305187 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 07:41:50 -0000 Author: sephe Date: Thu Sep 1 07:41:49 2016 New Revision: 305187 URL: https://svnweb.freebsd.org/changeset/base/305187 Log: MFC 304202 tcp/lro: Make # of LRO entries tunable Reviewed by: hps, gallatin Obtained from: rrs, gallatin Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe) Differential Revision: https://reviews.freebsd.org/D7499 Modified: stable/11/sys/netinet/tcp_lro.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_lro.c ============================================================================== --- stable/11/sys/netinet/tcp_lro.c Thu Sep 1 07:23:47 2016 (r305186) +++ stable/11/sys/netinet/tcp_lro.c Thu Sep 1 07:41:49 2016 (r305187) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -69,6 +71,14 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO static void tcp_lro_rx_done(struct lro_ctrl *lc); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP LRO"); + +static unsigned tcp_lro_entries = TCP_LRO_ENTRIES; +SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries, + CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0, + "default number of LRO entries"); + static __inline void tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_entry *le) { @@ -86,7 +96,7 @@ tcp_lro_active_remove(struct lro_entry * int tcp_lro_init(struct lro_ctrl *lc) { - return (tcp_lro_init_args(lc, NULL, TCP_LRO_ENTRIES, 0)); + return (tcp_lro_init_args(lc, NULL, tcp_lro_entries, 0)); } int From owner-svn-src-stable-11@freebsd.org Thu Sep 1 07:08:02 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0836BCB37D; Thu, 1 Sep 2016 07:08:02 +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 8169F2F8; Thu, 1 Sep 2016 07:08:02 +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 u81781fG036737; Thu, 1 Sep 2016 07:08:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81781Rc036736; Thu, 1 Sep 2016 07:08:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609010708.u81781Rc036736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 1 Sep 2016 07:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305180 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 07:08:02 -0000 Author: kib Date: Thu Sep 1 07:08:01 2016 New Revision: 305180 URL: https://svnweb.freebsd.org/changeset/base/305180 Log: MFC r304808: Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. PR: 211947 Modified: stable/11/sys/kern/kern_umtx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_umtx.c ============================================================================== --- stable/11/sys/kern/kern_umtx.c Thu Sep 1 07:04:47 2016 (r305179) +++ stable/11/sys/kern/kern_umtx.c Thu Sep 1 07:08:01 2016 (r305180) @@ -2743,9 +2743,12 @@ sleep: suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { rv = fueword32(&rwlock->rw_state, &state); - if (rv == -1) + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; - while (error == 0) { + break; + } + for (;;) { rv = casueword32(&rwlock->rw_state, state, &oldstate, state & ~URWLOCK_READ_WAITERS); if (rv == -1) { @@ -2756,6 +2759,8 @@ sleep: break; state = oldstate; error = umtxq_check_susp(td); + if (error != 0) + break; } } From owner-svn-src-stable-11@freebsd.org Thu Sep 1 07:54:04 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AFF7BCBA3E; Thu, 1 Sep 2016 07:54:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C18085E0; Thu, 1 Sep 2016 07:54:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u817s248055573; Thu, 1 Sep 2016 07:54:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u817rxd6055539; Thu, 1 Sep 2016 07:53:59 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609010753.u817rxd6055539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 1 Sep 2016 07:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305188 - in stable/11: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarch... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 07:54:04 -0000 Author: mm Date: Thu Sep 1 07:53:59 2016 New Revision: 305188 URL: https://svnweb.freebsd.org/changeset/base/305188 Log: MFC r304075,r304989: Sync libarchive with vendor including security fixes Vendor issues fixed: Issue #731: Reject tar entries >= INT64_MAX Issue #744: Very long pathnames evade symlink checks Issue #748: libarchive can compress, but cannot decompress zip some files PR #750: ustar: fix out of bounds read on empty string ("") filename PR #755: fix use of acl_get_flagset_np() on FreeBSD Issue #767: Buffer overflow printing a filename Issue #770: Zip read: be more careful about extra_length MFC r304874: Temporarily disable two libarchive tests that have not yet been fixed by vendor. Tests will be re-enabled after a fix has been merged. Added: stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c - copied unchanged from r304075, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu - copied unchanged from r304075, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure744.c - copied unchanged from r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure745.c - copied unchanged from r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure746.c - copied unchanged from r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c Modified: stable/11/contrib/libarchive/cat/test/test_version.c stable/11/contrib/libarchive/cpio/cmdline.c stable/11/contrib/libarchive/cpio/test/test_option_version.c stable/11/contrib/libarchive/libarchive/archive_match.c stable/11/contrib/libarchive/libarchive/archive_ppmd7_private.h stable/11/contrib/libarchive/libarchive/archive_read_add_passphrase.c stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_read_private.h stable/11/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/11/contrib/libarchive/libarchive/archive_util.c stable/11/contrib/libarchive/libarchive/archive_write_disk_acl.c stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_ustar.c stable/11/contrib/libarchive/libarchive/test/main.c stable/11/contrib/libarchive/libarchive/test/test.h stable/11/contrib/libarchive/libarchive/test/test_archive_string_conversion.c stable/11/contrib/libarchive/libarchive/test/test_fuzz.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/11/contrib/libarchive/tar/cmdline.c stable/11/contrib/libarchive/tar/test/test_version.c stable/11/contrib/libarchive/tar/util.c stable/11/lib/libarchive/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/cat/test/test_version.c ============================================================================== --- stable/11/contrib/libarchive/cat/test/test_version.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/cat/test/test_version.c Thu Sep 1 07:53:59 2016 (r305188) @@ -83,7 +83,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: stable/11/contrib/libarchive/cpio/cmdline.c ============================================================================== --- stable/11/contrib/libarchive/cpio/cmdline.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/cpio/cmdline.c Thu Sep 1 07:53:59 2016 (r305188) @@ -63,6 +63,7 @@ static const struct option { } cpio_longopts[] = { { "b64encode", 0, OPTION_B64ENCODE }, { "create", 0, 'o' }, + { "dereference", 0, 'L' }, { "dot", 0, 'V' }, { "extract", 0, 'i' }, { "file", 1, 'F' }, Modified: stable/11/contrib/libarchive/cpio/test/test_option_version.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_version.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/cpio/test/test_option_version.c Thu Sep 1 07:53:59 2016 (r305188) @@ -75,7 +75,7 @@ verify(const char *p, size_t s) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: stable/11/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_match.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_match.c Thu Sep 1 07:53:59 2016 (r305188) @@ -655,7 +655,7 @@ add_pattern_from_file(struct archive_mat } } - /* If something error happend, report it immediately. */ + /* If an error occurred, report it immediately. */ if (r < ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar); Modified: stable/11/contrib/libarchive/libarchive/archive_ppmd7_private.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_ppmd7_private.h Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_ppmd7_private.h Thu Sep 1 07:53:59 2016 (r305188) @@ -19,7 +19,7 @@ If you need the compatibility with origi #define PPMD7_MAX_ORDER 64 #define PPMD7_MIN_MEM_SIZE (1 << 11) -#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3) +#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3) struct CPpmd7_Context_; Modified: stable/11/contrib/libarchive/libarchive/archive_read_add_passphrase.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_add_passphrase.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_add_passphrase.c Thu Sep 1 07:53:59 2016 (r305188) @@ -125,7 +125,7 @@ void __archive_read_reset_passphrase(struct archive_read *a) { - a->passphrases.candiate = -1; + a->passphrases.candidate = -1; } /* @@ -137,31 +137,31 @@ __archive_read_next_passphrase(struct ar struct archive_read_passphrase *p; const char *passphrase; - if (a->passphrases.candiate < 0) { + if (a->passphrases.candidate < 0) { /* Count out how many passphrases we have. */ int cnt = 0; for (p = a->passphrases.first; p != NULL; p = p->next) cnt++; - a->passphrases.candiate = cnt; + a->passphrases.candidate = cnt; p = a->passphrases.first; - } else if (a->passphrases.candiate > 1) { + } else if (a->passphrases.candidate > 1) { /* Rotate a passphrase list. */ - a->passphrases.candiate--; + a->passphrases.candidate--; p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); - /* Pick a new passphrase candiate up. */ + /* Pick a new passphrase candidate up. */ p = a->passphrases.first; - } else if (a->passphrases.candiate == 1) { - /* This case is that all cadiates failed to decryption. */ - a->passphrases.candiate = 0; + } else if (a->passphrases.candidate == 1) { + /* This case is that all candidates failed to decrypt. */ + a->passphrases.candidate = 0; if (a->passphrases.first->next != NULL) { /* Rotate a passphrase list. */ p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); } p = NULL; - } else /* There is no passphrase candaite. */ + } else /* There is no passphrase candidate. */ p = NULL; if (p != NULL) @@ -177,7 +177,7 @@ __archive_read_next_passphrase(struct ar if (p == NULL) return (NULL); insert_passphrase_to_head(a, p); - a->passphrases.candiate = 1; + a->passphrases.candidate = 1; } } else passphrase = NULL; Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Thu Sep 1 07:53:59 2016 (r305188) @@ -641,13 +641,16 @@ translate_acl(struct archive_read_disk * * Libarchive stores "flag" (NFSv4 inheritance bits) * in the ae_perm bitmap. */ - acl_get_flagset_np(acl_entry, &acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) - ae_perm |= acl_inherit_map[i].archive_inherit; - - } + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit)) + ae_perm |= acl_inherit_map[i].archive_inherit; + } + } #endif acl_get_permset(acl_entry, &acl_permset); Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c Thu Sep 1 07:53:59 2016 (r305188) @@ -938,7 +938,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_path_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1041,7 +1041,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_time_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1067,7 +1067,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_owner_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { Modified: stable/11/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_private.h Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_private.h Thu Sep 1 07:53:59 2016 (r305188) @@ -221,7 +221,7 @@ struct archive_read { struct { struct archive_read_passphrase *first; struct archive_read_passphrase **last; - int candiate; + int candidate; archive_passphrase_callback *callback; void *client_data; } passphrases; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Thu Sep 1 07:53:59 2016 (r305188) @@ -595,7 +595,7 @@ lz4_filter_read_data_block(struct archiv #endif } - /* Check if an error happend in decompression process. */ + /* Check if an error occurred in the decompression process. */ if (uncompressed_size < 0) { archive_set_error(&(self->archive->archive), ARCHIVE_ERRNO_MISC, "lz4 decompression failed"); Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c Thu Sep 1 07:53:59 2016 (r305188) @@ -1715,8 +1715,11 @@ lha_crc16(uint16_t crc, const void *pp, #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) -#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ - || defined(__clang__) +#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) +/* GCC 4.8 and later has __builtin_bswap16() */ +# define bswap16(x) __builtin_bswap16(x) +#elif defined(__clang__) +/* All clang versions have __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) #else # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8)) Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c Thu Sep 1 07:53:59 2016 (r305188) @@ -1128,8 +1128,15 @@ header_common(struct archive_read *a, st if (tar->entry_bytes_remaining < 0) { tar->entry_bytes_remaining = 0; archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Tar entry has negative size?"); - err = ARCHIVE_WARN; + "Tar entry has negative size"); + return (ARCHIVE_FATAL); + } + if (tar->entry_bytes_remaining == INT64_MAX) { + /* Note: tar_atol returns INT64_MAX on overflow */ + tar->entry_bytes_remaining = 0; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Tar entry size overflow"); + return (ARCHIVE_FATAL); } tar->realsize = tar->entry_bytes_remaining; archive_entry_set_size(entry, tar->entry_bytes_remaining); Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c Thu Sep 1 07:53:59 2016 (r305188) @@ -318,7 +318,7 @@ start_over: } memcpy(w->pool.str, fnam.str, fnam.len); w->pool.str[fnam.len] = '\0'; - /* let noone else know about the pool, it's a secret, shhh */ + /* let no one else know about the pool, it's a secret, shhh */ fnam.str = w->pool.str; /* snarf mtime or deduce from rtime Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c Thu Sep 1 07:53:59 2016 (r305188) @@ -418,18 +418,30 @@ zip_time(const char *p) * id1+size1+data1 + id2+size2+data2 ... * triplets. id and size are 2 bytes each. */ -static void -process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry) +static int +process_extra(struct archive_read *a, const char *p, size_t extra_length, struct zip_entry* zip_entry) { unsigned offset = 0; - while (offset < extra_length - 4) { + if (extra_length == 0) { + return ARCHIVE_OK; + } + + if (extra_length < 4) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Too-small extra data: Need at least 4 bytes, but only found %d bytes", (int)extra_length); + return ARCHIVE_FAILED; + } + while (offset <= extra_length - 4) { unsigned short headerid = archive_le16dec(p + offset); unsigned short datasize = archive_le16dec(p + offset + 2); offset += 4; if (offset + datasize > extra_length) { - break; + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Extra data overflow: Need %d bytes but only found %d bytes", + (int)datasize, (int)(extra_length - offset)); + return ARCHIVE_FAILED; } #ifdef DEBUG fprintf(stderr, "Header id 0x%04x, length %d\n", @@ -715,13 +727,13 @@ process_extra(const char *p, size_t extr } offset += datasize; } -#ifdef DEBUG - if (offset != extra_length) - { - fprintf(stderr, - "Extra data field contents do not match reported size!\n"); + if (offset != extra_length) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed extra data: Consumed %d bytes of %d bytes", + (int)offset, (int)extra_length); + return ARCHIVE_FAILED; } -#endif + return ARCHIVE_OK; } /* @@ -840,7 +852,9 @@ zip_read_local_file_header(struct archiv return (ARCHIVE_FATAL); } - process_extra(h, extra_length, zip_entry); + if (ARCHIVE_OK != process_extra(a, h, extra_length, zip_entry)) { + return ARCHIVE_FATAL; + } __archive_read_consume(a, extra_length); /* Work around a bug in Info-Zip: When reading from a pipe, it @@ -1293,7 +1307,7 @@ zip_read_data_deflate(struct archive_rea && bytes_avail > zip->entry_bytes_remaining) { bytes_avail = (ssize_t)zip->entry_bytes_remaining; } - if (bytes_avail <= 0) { + if (bytes_avail < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Truncated ZIP file body"); return (ARCHIVE_FATAL); @@ -2691,7 +2705,9 @@ slurp_central_directory(struct archive_r "Truncated ZIP file header"); return ARCHIVE_FATAL; } - process_extra(p + filename_length, extra_length, zip_entry); + if (ARCHIVE_OK != process_extra(a, p + filename_length, extra_length, zip_entry)) { + return ARCHIVE_FATAL; + } /* * Mac resource fork files are stored under the Modified: stable/11/contrib/libarchive/libarchive/archive_util.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_util.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_util.c Thu Sep 1 07:53:59 2016 (r305188) @@ -580,7 +580,7 @@ void __archive_ensure_cloexec_flag(int fd) { #if defined(_WIN32) && !defined(__CYGWIN__) - (void)fd; /* UNSED */ + (void)fd; /* UNUSED */ #else int flags; Modified: stable/11/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_disk_acl.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_write_disk_acl.c Thu Sep 1 07:53:59 2016 (r305188) @@ -138,6 +138,7 @@ set_acl(struct archive *a, int fd, const acl_permset_t acl_permset; #ifdef ACL_TYPE_NFS4 acl_flagset_t acl_flagset; + int r; #endif int ret; int ae_type, ae_permset, ae_tag, ae_id; @@ -223,12 +224,16 @@ set_acl(struct archive *a, int fd, const } #ifdef ACL_TYPE_NFS4 - acl_get_flagset_np(acl_entry, &acl_flagset); - acl_clear_flags_np(acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + acl_clear_flags_np(acl_flagset); + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (ae_permset & acl_inherit_map[i].archive_inherit) + acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + } } #endif } Modified: stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c Thu Sep 1 07:53:59 2016 (r305188) @@ -1796,7 +1796,7 @@ edit_deep_directories(struct archive_wri char *tail = a->name; /* If path is short, avoid the open() below. */ - if (strlen(tail) <= PATH_MAX) + if (strlen(tail) < PATH_MAX) return; /* Try to record our starting dir. */ @@ -1806,7 +1806,7 @@ edit_deep_directories(struct archive_wri return; /* As long as the path is too long... */ - while (strlen(tail) > PATH_MAX) { + while (strlen(tail) >= PATH_MAX) { /* Locate a dir prefix shorter than PATH_MAX. */ tail += PATH_MAX - 8; while (tail > a->name && *tail != '/') @@ -2401,8 +2401,18 @@ check_symlinks(struct archive_write_disk r = lstat(a->name, &st); if (r != 0) { /* We've hit a dir that doesn't exist; stop now. */ - if (errno == ENOENT) + if (errno == ENOENT) { break; + } else { + /* Note: This effectively disables deep directory + * support when security checks are enabled. + * Otherwise, very long pathnames that trigger + * an error here could evade the sandbox. + * TODO: We could do better, but it would probably + * require merging the symlink checks with the + * deep-directory editing. */ + return (ARCHIVE_FAILED); + } } else if (S_ISLNK(st.st_mode)) { if (c == '\0') { /* Modified: stable/11/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Thu Sep 1 07:53:59 2016 (r305188) @@ -436,7 +436,7 @@ struct iso_option { * Type : string * Default: Auto detect * : We check a size of boot image; - * : If ths size is just 1.22M/1.44M/2.88M, + * : If the size is just 1.22M/1.44M/2.88M, * : we assume boot_type is 'fd'; * : otherwise boot_type is 'no-emulation'. * COMPAT : Modified: stable/11/contrib/libarchive/libarchive/archive_write_set_format_ustar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Thu Sep 1 07:53:59 2016 (r305188) @@ -307,7 +307,7 @@ archive_write_ustar_header(struct archiv * case getting WCS failed. On POSIX, this is a * normal operation. */ - if (p != NULL && p[strlen(p) - 1] != '/') { + if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') { struct archive_string as; archive_string_init(&as); Modified: stable/11/contrib/libarchive/libarchive/test/main.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/main.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/test/main.c Thu Sep 1 07:53:59 2016 (r305188) @@ -1440,6 +1440,31 @@ assertion_file_size(const char *file, in return (0); } +/* Verify mode of 'pathname'. */ +int +assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode) +{ + int mode; + int r; + + assertion_count(file, line); +#if defined(_WIN32) && !defined(__CYGWIN__) + failure_start(file, line, "assertFileMode not yet implemented for Windows"); +#else + { + struct stat st; + r = lstat(pathname, &st); + mode = (int)(st.st_mode & 0777); + } + if (r == 0 && mode == expected_mode) + return (1); + failure_start(file, line, "File %s has mode %o, expected %o", + pathname, mode, expected_mode); +#endif + failure_finish(NULL); + return (0); +} + /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */ int assertion_is_dir(const char *file, int line, const char *pathname, int mode) Modified: stable/11/contrib/libarchive/libarchive/test/test.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test.h Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/test/test.h Thu Sep 1 07:53:59 2016 (r305188) @@ -182,6 +182,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -246,6 +248,7 @@ int assertion_file_mtime_recent(const ch int assertion_file_nlinks(const char *, int, const char *, int); int assertion_file_not_exists(const char *, int, const char *); int assertion_file_size(const char *, int, const char *, long); +int assertion_file_mode(const char *, int, const char *, int); int assertion_is_dir(const char *, int, const char *, int); int assertion_is_hardlink(const char *, int, const char *, const char *); int assertion_is_not_hardlink(const char *, int, const char *, const char *); Modified: stable/11/contrib/libarchive/libarchive/test/test_archive_string_conversion.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Thu Sep 1 07:53:59 2016 (r305188) @@ -800,8 +800,8 @@ DEFINE_TEST(test_archive_string_conversi assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assert((fp = fopen(testdata, "w")) != NULL); while ((size = archive_read_data(a, buff, 512)) > 0) - fwrite(buff, 1, size, fp); - fclose(fp); + assertEqualInt(size, fwrite(buff, 1, size, fp)); + assertEqualInt(0, fclose(fp)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); test_archive_string_normalization_nfc(testdata); Modified: stable/11/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_fuzz.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/test/test_fuzz.c Thu Sep 1 07:53:59 2016 (r305188) @@ -110,13 +110,17 @@ test_fuzz(const struct files *filesets) for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - rawimage = (char *)realloc(rawimage, oldsize + size); + char *newraw = (char *)realloc(rawimage, oldsize + size); + if (!assert(newraw != NULL)) + { + free(rawimage); + continue; + } + rawimage = newraw; memcpy(rawimage + oldsize, tmp, size); oldsize += size; size = oldsize; free(tmp); - if (!assert(rawimage != NULL)) - continue; } } if (size == 0) Modified: stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c Thu Sep 1 07:41:49 2016 (r305187) +++ stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c Thu Sep 1 07:53:59 2016 (r305188) @@ -3603,7 +3603,7 @@ DEFINE_TEST(test_read_format_rar_multivo assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); /* - * Eigth header. + * Eighth header. */ assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("testdir/testsymlink6", archive_entry_pathname(ae)); Copied: stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c (from r304075, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c Thu Sep 1 07:53:59 2016 (r305188, copy of r304075, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD"); + +#include + + +/* + * Github Issue 748 reported problems with end-of-entry handling + * with highly-compressible data. This resulted in the end of the + * data being truncated (extracted as zero bytes). + */ + +/* + * Extract the specific test archive that was used to diagnose + * Issue 748: + */ +DEFINE_TEST(test_read_format_zip_high_compression) +{ + const char *refname = "test_read_format_zip_high_compression.zip"; + char *p; + size_t archive_size; + struct archive *a; + struct archive_entry *entry; + + const void *pv; + size_t s; + int64_t o; + + extract_reference_file(refname); + p = slurpfile(&archive_size, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, archive_size, 16 * 1024)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(160, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + free(p); +} + +/* + * Synthesize a lot of varying inputs that are highly compressible. + */ +DEFINE_TEST(test_read_format_zip_high_compression2) +{ + const size_t body_size = 1024 * 1024; + const size_t buff_size = 2 * 1024 * 1024; + char *body, *body_read, *buff; + int n; + + assert((body = malloc(body_size)) != NULL); + assert((body_read = malloc(body_size)) != NULL); + assert((buff = malloc(buff_size)) != NULL); + + /* Highly-compressible data: all bytes 255, except for a + * single 1 byte. + * The body is always 256k + 6 bytes long (the internal deflation + * buffer is exactly 256k). + */ + + for(n = 1024; n < (int)body_size; n += 1024) { + struct archive *a; + struct archive_entry *entry; + size_t used = 0; + const void *pv; + size_t s; + int64_t o; + + memset(body, 255, body_size); + body[n] = 1; + + /* Write an archive with a single entry of n bytes. */ + assert((a = archive_write_new()) != NULL); + assertEqualInt(ARCHIVE_OK, archive_write_set_format_zip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_open_memory(a, buff, buff_size, &used)); + + entry = archive_entry_new2(a); + archive_entry_set_pathname(entry, "test"); + archive_entry_set_filetype(entry, AE_IFREG); + archive_entry_set_size(entry, 262150); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + assertEqualInt(262150, archive_write_data(a, body, 262150)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Read back the entry and verify the contents. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, buff, used, 17)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(6, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + } + + free(body); + free(body_read); + free(buff); +} Copied: stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu (from r304075, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu Thu Sep 1 07:53:59 2016 (r305188, copy of r304075, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu) @@ -0,0 +1,18 @@ +begin 644 test_read_format_zip_high_compression.zip +M4$L#!!0`"``(`*=Y]4@``````````*``!``(`"``8VAA +MD5>>))%7GB215W5X"P`!!/8!```$%````.W=06K#,!`%T&E)P8LL?*2XC@N% +M)#5QO>AM@9WDJ6!%\6$K/Q6T3LAX]N/GQ'Z9G&KA^*K1'S +M.`[GOIM*[TP_Q_>O0[G_:3X.Y\^^V/X2<>))%7=7@+``$$]@$```04````4$L%!@`````!``$`5@````L"```` +!```` +` +end Copied: stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure744.c (from r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure744.c Thu Sep 1 07:53:59 2016 (r305188, copy of r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #744 describes a bug in the sandboxing code that + * causes very long pathnames to not get checked for symlinks. + */ + +DEFINE_TEST(test_write_disk_secure744) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + size_t buff_size = 8192; + char *buff = malloc(buff_size); + char *p = buff; + int n = 0; + int t; + + assert(buff != NULL); + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + while (p + 500 < buff + buff_size) { + memset(p, 'x', 100); + p += 100; + p[0] = '\0'; + + buff[0] = ((n / 1000) % 10) + '0'; + buff[1] = ((n / 100) % 10)+ '0'; + buff[2] = ((n / 10) % 10)+ '0'; + buff[3] = ((n / 1) % 10)+ '0'; + buff[4] = '_'; + ++n; + + /* Create a symlink pointing to the testworkdir */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, testworkdir); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + *p++ = '/'; + sprintf(p, "target%d", n); + + /* Try to create a file through the symlink, should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFDIR | 0777); + + t = archive_write_header(a, ae); + archive_entry_free(ae); + failure("Attempt to create target%d via %d-character symlink should have failed", n, (int)strlen(buff)); + if(!assertEqualInt(ARCHIVE_FAILED, t)) { + break; + } + } + archive_free(a); + free(buff); +#endif +} Copied: stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure745.c (from r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure745.c Thu Sep 1 07:53:59 2016 (r305188, copy of r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #745 describes a bug in the sandboxing code that + * allows one to use a symlink to edit the permissions on a file or + * directory outside of the sandbox. + */ + +DEFINE_TEST(test_write_disk_secure745) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* The target dir: The one we're going to try to change permission on */ + assertMakeDir("target", 0700); + + /* The sandbox dir we're going to run inside of. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create a symlink pointing to the target directory */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, "../target"); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Try to alter the target dir through the symlink; this should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFDIR | 0777); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Permission of target dir should not have changed. */ + assertFileMode("../target", 0700); +#endif +} Copied: stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure746.c (from r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/test/test_write_disk_secure746.c Thu Sep 1 07:53:59 2016 (r305188, copy of r304075, head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #746 describes a problem in which hardlink targets are + * not adequately checked and can be used to modify entries outside of + * the sandbox. + */ + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NODOTDOT disallows '..' in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746a) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NODOTDOT); + + /* Attempt to hardlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "../target/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NOSYMLINK disallows symlinks in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746b) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* Create a symlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "symlink"); + archive_entry_copy_symlink(ae, "../target"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Attempt to hardlink to the target directory via the symlink. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "symlink/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Thu Sep 1 18:56:43 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1A8EBCC286; Thu, 1 Sep 2016 18:56:43 +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 B178625E; Thu, 1 Sep 2016 18:56:43 +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 u81IugrG009664; Thu, 1 Sep 2016 18:56:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Iug0r009663; Thu, 1 Sep 2016 18:56:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609011856.u81Iug0r009663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 1 Sep 2016 18:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305225 - stable/11/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 18:56:44 -0000 Author: ngie Date: Thu Sep 1 18:56:42 2016 New Revision: 305225 URL: https://svnweb.freebsd.org/changeset/base/305225 Log: MFC r303573: Cast result from third parameter to int instead of promoting it to size_t This resolves a -Wformat issue when the value is used as a format width precision specifier, i.e. %*s Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/util.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzpool/common/util.c Thu Sep 1 18:37:11 2016 (r305224) +++ stable/11/cddl/contrib/opensolaris/lib/libzpool/common/util.c Thu Sep 1 18:56:42 2016 (r305225) @@ -108,7 +108,7 @@ show_vdev_stats(const char *desc, const (void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n", indent, "", prefix, - indent + strlen(prefix) - 25 - (vs->vs_space ? 0 : 12), + (int)(indent + strlen(prefix) - 25 - (vs->vs_space ? 0 : 12)), desc, vs->vs_space ? 6 : 0, vs->vs_space ? used : "", vs->vs_space ? 6 : 0, vs->vs_space ? avail : "", From owner-svn-src-stable-11@freebsd.org Thu Sep 1 19:00:31 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF89ABCC351; Thu, 1 Sep 2016 19:00:31 +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 C220268A; Thu, 1 Sep 2016 19:00:31 +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 u81J0ViF009964; Thu, 1 Sep 2016 19:00:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81J0Vgd009963; Thu, 1 Sep 2016 19:00:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609011900.u81J0Vgd009963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 1 Sep 2016 19:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305226 - stable/11/usr.bin/getconf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 19:00:32 -0000 Author: ngie Date: Thu Sep 1 19:00:30 2016 New Revision: 305226 URL: https://svnweb.freebsd.org/changeset/base/305226 Log: MFC r304809: Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs It's not necessarily intuitive that the variables to query contain TRUSTEDBSD in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like "_PC_ACL_NFS4". Relnotes: yes Modified: stable/11/usr.bin/getconf/pathconf.gperf Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/getconf/pathconf.gperf ============================================================================== --- stable/11/usr.bin/getconf/pathconf.gperf Thu Sep 1 18:56:42 2016 (r305225) +++ stable/11/usr.bin/getconf/pathconf.gperf Thu Sep 1 19:00:30 2016 (r305226) @@ -20,8 +20,14 @@ static const struct map *in_word_set(con %} struct map { const char *name; int key; int valid; }; %% +ACL_EXTENDED, _PC_ACL_EXTENDED +ACL_NFS4, _PC_ACL_NFS4 +ACL_PATH_MAX, _PC_ACL_PATH_MAX +CAP_PRESENT, _PC_CAP_PRESENT FILESIZEBITS, _PC_FILESIZEBITS +INF_PRESENT, _PC_INF_PRESENT LINK_MAX, _PC_LINK_MAX +MAC_PRESENT, _PC_MAC_PRESENT MAX_CANON, _PC_MAX_CANON MAX_INPUT, _PC_MAX_INPUT MIN_HOLE_SIZE, _PC_MIN_HOLE_SIZE From owner-svn-src-stable-11@freebsd.org Thu Sep 1 19:30:53 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DA3BCCBD2; Thu, 1 Sep 2016 19:30:53 +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 450AAE95; Thu, 1 Sep 2016 19:30:53 +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 u81JUqoF022323; Thu, 1 Sep 2016 19:30:52 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81JUqls022322; Thu, 1 Sep 2016 19:30:52 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201609011930.u81JUqls022322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 1 Sep 2016 19:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305232 - stable/11/sys/boot/i386/libi386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 19:30:53 -0000 Author: gjb Date: Thu Sep 1 19:30:52 2016 New Revision: 305232 URL: https://svnweb.freebsd.org/changeset/base/305232 Log: MFC r304966 (peter): The read-ahead code from r298230 made it likely the boot code would read beyond the end of disk. r298900 added code to prevent this. Some BIOSes cause significant delays if asked to read past end-of-disk. We never trusted the BIOS to accurately report the sectorsize of disks before and this set of changes. Unfortuately they interact badly with the infamous >2TB wraparound bugs. We have a number of relatively-recent machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB. With pre-r298900 they work just fine. After r298900 they stop working if the boot environment attempts to access anything outside the first 1TB on the disk. 'ZFS: I/O error, all block copies unavailable' etc. It affects both UFS and ZFS if they try to boot from large volumes. This change replaces the blind trust of the BIOS end-of-disk reporting with a read-ahead clip to prevent reads crossing the of end-of-disk boundary. Since 2^32 (2TB) size reporting truncation is not uncommon, the clipping is done on 2TB aliases of the reported end-of-disk. ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ... as one of them is likely to be the real end-of-disk. This should make the loader on these broken machines behave the same as traditional pre-r298900 loader behavior, without disabling read-ahead. PR: 212139 Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/boot/i386/libi386/biosdisk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/11/sys/boot/i386/libi386/biosdisk.c Thu Sep 1 19:18:26 2016 (r305231) +++ stable/11/sys/boot/i386/libi386/biosdisk.c Thu Sep 1 19:30:52 2016 (r305232) @@ -495,7 +495,7 @@ bd_realstrategy(void *devdata, int rw, d char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - int blks; + int blks, remaining; #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ char fragbuf[BIOSDISK_SECSIZE]; size_t fragsize; @@ -511,14 +511,15 @@ bd_realstrategy(void *devdata, int rw, d if (rsize) *rsize = 0; - if (dblk >= BD(dev).bd_sectors) { - DEBUG("IO past disk end %llu", (unsigned long long)dblk); - return (EIO); - } - - if (dblk + blks > BD(dev).bd_sectors) { - /* perform partial read */ - blks = BD(dev).bd_sectors - dblk; + /* + * Perform partial read to prevent read-ahead crossing + * the end of disk - or any 32 bit aliases of the end. + * Signed arithmetic is used to handle wrap-around cases + * like we do for TCP sequence numbers. + */ + remaining = (int)(BD(dev).bd_sectors - dblk); /* truncate */ + if (remaining > 0 && remaining < blks) { + blks = remaining; size = blks * BD(dev).bd_sectorsize; DEBUG("short read %d", blks); } From owner-svn-src-stable-11@freebsd.org Thu Sep 1 22:24:32 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2004FBCCAEF; Thu, 1 Sep 2016 22:24:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9DFC1A1; Thu, 1 Sep 2016 22:24:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81MOVkU089580; Thu, 1 Sep 2016 22:24:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81MOV1Q089579; Thu, 1 Sep 2016 22:24:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201609012224.u81MOV1Q089579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 1 Sep 2016 22:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305249 - stable/11/sys/boot/powerpc/boot1.chrp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 22:24:32 -0000 Author: nwhitehorn Date: Thu Sep 1 22:24:30 2016 New Revision: 305249 URL: https://svnweb.freebsd.org/changeset/base/305249 Log: MFC r305036: Some versions of SLOF do not append the partition number to the boot device argument to the stage-1 bootloader. In such cases, boot1 would only try to read the entire device rather than checking for partitions. Instead of panic'ing, fall back to reading the partitions as normal in such situations. This was preventing boot of installed systems on some versions of PowerKVM. PR: kern/211599 Modified: stable/11/sys/boot/powerpc/boot1.chrp/boot1.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/11/sys/boot/powerpc/boot1.chrp/boot1.c Thu Sep 1 21:30:12 2016 (r305248) +++ stable/11/sys/boot/powerpc/boot1.chrp/boot1.c Thu Sep 1 22:24:30 2016 (r305249) @@ -137,7 +137,9 @@ ofw_init(void *vpd, int res, int (*openf p = bootpath; while (*p != '\0') { + /* Truncate partition ID */ if (*p == ':') { + ofw_close(bootdev); *(++p) = '\0'; break; } @@ -419,31 +421,40 @@ main(int ac, char **av) memcpy(bootpath_full,bootpath,len+1); - if (bootpath_full[len-1] == ':') { - for (i = 0; i < 16; i++) { - if (i < 10) { - bootpath_full[len] = i + '0'; - bootpath_full[len+1] = '\0'; - } else { - bootpath_full[len] = '1'; - bootpath_full[len+1] = i - 10 + '0'; - bootpath_full[len+2] = '\0'; - } - - if (domount(bootpath_full,1) >= 0) - break; - - if (bootdev > 0) - ofw_close(bootdev); + if (bootpath_full[len-1] != ':') { + /* First try full volume */ + if (domount(bootpath_full,1) == 0) + goto out; + + /* Add a : so that we try partitions if that fails */ + if (bootdev > 0) + ofw_close(bootdev); + bootpath_full[len] = ':'; + len += 1; + } + + /* Loop through first 16 partitions to find a UFS one */ + for (i = 0; i < 16; i++) { + if (i < 10) { + bootpath_full[len] = i + '0'; + bootpath_full[len+1] = '\0'; + } else { + bootpath_full[len] = '1'; + bootpath_full[len+1] = i - 10 + '0'; + bootpath_full[len+2] = '\0'; } + + if (domount(bootpath_full,1) >= 0) + break; - if (i >= 16) - panic("domount"); - } else { - if (domount(bootpath_full,0) == -1) - panic("domount"); + if (bootdev > 0) + ofw_close(bootdev); } + if (i >= 16) + panic("domount"); + +out: printf(" Boot volume: %s\n",bootpath_full); ofw_setprop(chosenh, "bootargs", bootpath_full, len+2); load(path); From owner-svn-src-stable-11@freebsd.org Thu Sep 1 22:27:48 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB686BCCBA2; Thu, 1 Sep 2016 22:27:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBC35379; Thu, 1 Sep 2016 22:27:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81MRl5D089754; Thu, 1 Sep 2016 22:27:47 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81MRlFu089753; Thu, 1 Sep 2016 22:27:47 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201609012227.u81MRlFu089753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 1 Sep 2016 22:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305250 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 22:27:49 -0000 Author: nwhitehorn Date: Thu Sep 1 22:27:47 2016 New Revision: 305250 URL: https://svnweb.freebsd.org/changeset/base/305250 Log: MFC r305108,305109: Refix operation on sparse CPU mappings as in r302372, temporarily broken by r304716. PR: kern/210106 Modified: stable/11/sys/kern/subr_gtaskqueue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_gtaskqueue.c ============================================================================== --- stable/11/sys/kern/subr_gtaskqueue.c Thu Sep 1 22:24:30 2016 (r305249) +++ stable/11/sys/kern/subr_gtaskqueue.c Thu Sep 1 22:27:47 2016 (r305250) @@ -742,7 +742,7 @@ _taskqgroup_adjust(struct taskqgroup *qg LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); cpuset_t mask; struct grouptask *gtask; - int i, old_cnt, qid; + int i, k, old_cnt, qid, cpu; mtx_assert(&qgroup->tqg_lock, MA_OWNED); @@ -806,8 +806,11 @@ _taskqgroup_adjust(struct taskqgroup *qg /* * Set new CPU and IRQ affinity */ + cpu = CPU_FIRST(); for (i = 0; i < cnt; i++) { - qgroup->tqg_queue[i].tgc_cpu = i * qgroup->tqg_stride; + qgroup->tqg_queue[i].tgc_cpu = cpu; + for (k = 0; k < qgroup->tqg_stride; k++) + cpu = CPU_NEXT(cpu); CPU_ZERO(&mask); CPU_SET(qgroup->tqg_queue[i].tgc_cpu, &mask); LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) { From owner-svn-src-stable-11@freebsd.org Fri Sep 2 04:06:45 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 782B2BCB0BC; Fri, 2 Sep 2016 04:06:45 +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 537B9984; Fri, 2 Sep 2016 04:06:45 +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 u8246isj017730; Fri, 2 Sep 2016 04:06:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8246i1N017728; Fri, 2 Sep 2016 04:06:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609020406.u8246i1N017728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 2 Sep 2016 04:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305271 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 04:06:45 -0000 Author: ngie Date: Fri Sep 2 04:06:44 2016 New Revision: 305271 URL: https://svnweb.freebsd.org/changeset/base/305271 Log: MFC r303576: Conditionalize code which defines sysctls per _KERNEL #ifdef guard This resolves several issues when compiling libzpool (userspace library), i.e. -Wimplicit-function-declaration and -Wmissing-declarations issues. Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Fri Sep 2 03:19:55 2016 (r305270) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Fri Sep 2 04:06:44 2016 (r305271) @@ -58,9 +58,11 @@ typedef struct mirror_map { static int vdev_mirror_shift = 21; +#ifdef _KERNEL SYSCTL_DECL(_vfs_zfs_vdev); static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0, "ZFS VDEV Mirror"); +#endif /* * The load configuration settings below are tuned by default for @@ -74,28 +76,38 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AU /* Rotating media load calculation configuration. */ static int rotating_inc = 0; +#ifdef _KERNEL SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RWTUN, &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's"); +#endif static int rotating_seek_inc = 5; +#ifdef _KERNEL SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RWTUN, &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's"); +#endif static int rotating_seek_offset = 1 * 1024 * 1024; +#ifdef _KERNEL SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RWTUN, &rotating_seek_offset, 0, "Offset in bytes from the last I/O which " "triggers a reduced rotating media seek increment"); +#endif /* Non-rotating media load calculation configuration. */ static int non_rotating_inc = 0; +#ifdef _KERNEL SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RWTUN, &non_rotating_inc, 0, "Non-rotating media load increment for non-seeking I/O's"); +#endif static int non_rotating_seek_inc = 1; +#ifdef _KERNEL SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RWTUN, &non_rotating_seek_inc, 0, "Non-rotating media load increment for seeking I/O's"); +#endif static inline size_t Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Sep 2 03:19:55 2016 (r305270) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Sep 2 04:06:44 2016 (r305271) @@ -176,6 +176,7 @@ int zfs_vdev_read_gap_limit = 32 << 10; int zfs_vdev_write_gap_limit = 4 << 10; #ifdef __FreeBSD__ +#ifdef _KERNEL SYSCTL_DECL(_vfs_zfs_vdev); static int sysctl_zfs_async_write_active_min_dirty_percent(SYSCTL_HANDLER_ARGS); @@ -271,6 +272,7 @@ sysctl_zfs_async_write_active_max_dirty_ return (0); } #endif +#endif int vdev_queue_offset_compare(const void *x1, const void *x2) From owner-svn-src-stable-11@freebsd.org Fri Sep 2 17:07:54 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A39EBCC7C9; Fri, 2 Sep 2016 17:07:54 +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 E5E2E28D9; Fri, 2 Sep 2016 17:07:53 +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 u82H7rYb013071; Fri, 2 Sep 2016 17:07:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82H7qnM013068; Fri, 2 Sep 2016 17:07:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609021707.u82H7qnM013068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Sep 2016 17:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305286 - in stable/11/cddl/usr.sbin/zfsd: . tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 17:07:54 -0000 Author: dim Date: Fri Sep 2 17:07:52 2016 New Revision: 305286 URL: https://svnweb.freebsd.org/changeset/base/305286 Log: MFC r305013: Add an empty virtual destructor to zfsd's Vdev class. This is needed because the class has virtual functions, and the compiler-generated default destructor is non-virtual. Reviewed by: asomers MFC r305016: Fix the zfsd unittest: * TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin * DevdCtl::EventBuffer no longer exists, so remove its forward declaration Modified: stable/11/cddl/usr.sbin/zfsd/tests/Makefile stable/11/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc stable/11/cddl/usr.sbin/zfsd/vdev.h Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/tests/Makefile Fri Sep 2 10:13:51 2016 (r305285) +++ stable/11/cddl/usr.sbin/zfsd/tests/Makefile Fri Sep 2 17:07:52 2016 (r305286) @@ -4,7 +4,7 @@ SRCDIR=${.CURDIR}/../../../.. .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR}/.. -TESTSDIR?= ${TESTSBASE}/cddl/sbin/zfsd +TESTSDIR?= ${TESTSBASE}/cddl/usr.sbin/zfsd PLAIN_TESTS_CXX= zfsd_unittest SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} Modified: stable/11/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Fri Sep 2 10:13:51 2016 (r305285) +++ stable/11/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Fri Sep 2 17:07:52 2016 (r305286) @@ -72,7 +72,6 @@ using std::string; using std::stringstream; using DevdCtl::Event; -using DevdCtl::EventBuffer; using DevdCtl::EventFactory; using DevdCtl::EventList; using DevdCtl::Guid; Modified: stable/11/cddl/usr.sbin/zfsd/vdev.h ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/vdev.h Fri Sep 2 10:13:51 2016 (r305285) +++ stable/11/cddl/usr.sbin/zfsd/vdev.h Fri Sep 2 17:07:52 2016 (r305286) @@ -108,6 +108,12 @@ public: * \brief No-op copy constructor for nonexistent vdevs. */ Vdev(); + + /** + * \brief No-op virtual destructor, since this class has virtual + * functions. + */ + virtual ~Vdev(); bool DoesNotExist() const; /** @@ -145,6 +151,10 @@ private: extern Vdev NonexistentVdev; //- Vdev Inline Public Methods ------------------------------------------------ +inline Vdev::~Vdev() +{ +} + inline DevdCtl::Guid Vdev::PoolGUID() const { From owner-svn-src-stable-11@freebsd.org Fri Sep 2 17:24:18 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 029B0BCCE32; Fri, 2 Sep 2016 17:24:18 +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 A2E436B4; Fri, 2 Sep 2016 17:24: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 u82HOGgW020756; Fri, 2 Sep 2016 17:24:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82HOG3M020754; Fri, 2 Sep 2016 17:24:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609021724.u82HOG3M020754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Sep 2016 17:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305287 - in stable: 10/usr.sbin/bluetooth/btpand 11/usr.sbin/bluetooth/btpand X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 17:24:18 -0000 Author: dim Date: Fri Sep 2 17:24:16 2016 New Revision: 305287 URL: https://svnweb.freebsd.org/changeset/base/305287 Log: MFC r305023: Avoid undefined behavior when calling va_start() in bnep_send_control(), by making the 'type' parameter a plain unsigned. Modified: stable/11/usr.sbin/bluetooth/btpand/bnep.c stable/11/usr.sbin/bluetooth/btpand/btpand.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bluetooth/btpand/bnep.c stable/10/usr.sbin/bluetooth/btpand/btpand.h Directory Properties: stable/10/ (props changed) Modified: stable/11/usr.sbin/bluetooth/btpand/bnep.c ============================================================================== --- stable/11/usr.sbin/bluetooth/btpand/bnep.c Fri Sep 2 17:07:52 2016 (r305286) +++ stable/11/usr.sbin/bluetooth/btpand/bnep.c Fri Sep 2 17:24:16 2016 (r305287) @@ -574,7 +574,7 @@ bnep_recv_filter_multi_addr_rsp(channel_ } void -bnep_send_control(channel_t *chan, uint8_t type, ...) +bnep_send_control(channel_t *chan, unsigned type, ...) { packet_t *pkt; uint8_t *p; @@ -590,7 +590,7 @@ bnep_send_control(channel_t *chan, uint8 va_start(ap, type); *p++ = BNEP_CONTROL; - *p++ = type; + *p++ = (uint8_t)type; switch(type) { case BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD: Modified: stable/11/usr.sbin/bluetooth/btpand/btpand.h ============================================================================== --- stable/11/usr.sbin/bluetooth/btpand/btpand.h Fri Sep 2 17:07:52 2016 (r305286) +++ stable/11/usr.sbin/bluetooth/btpand/btpand.h Fri Sep 2 17:24:16 2016 (r305287) @@ -183,7 +183,7 @@ b2eaddr(void *dst, bdaddr_t *src) /* bnep.c */ bool bnep_send(channel_t *, packet_t *); bool bnep_recv(packet_t *); -void bnep_send_control(channel_t *, uint8_t, ...); +void bnep_send_control(channel_t *, unsigned, ...); /* channel.c */ void channel_init(void); From owner-svn-src-stable-11@freebsd.org Fri Sep 2 22:04:21 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB4E3BCC302; Fri, 2 Sep 2016 22:04:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B515362; Fri, 2 Sep 2016 22:04:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82M4K27025954; Fri, 2 Sep 2016 22:04:20 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82M4KOm025953; Fri, 2 Sep 2016 22:04:20 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609022204.u82M4KOm025953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 2 Sep 2016 22:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305308 - stable/11/sys/arm/ti X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 22:04:21 -0000 Author: gonzo Date: Fri Sep 2 22:04:20 2016 New Revision: 305308 URL: https://svnweb.freebsd.org/changeset/base/305308 Log: MFC r305039: Fix TI PRUSS driver panic with INVARIANTS enabled Value passed as islocked argument to knlist_add should be consistent with actual lock state so add lock/unlock calls around knlist_add PR: 212120 Submitted by: Manuel Stuhn Modified: stable/11/sys/arm/ti/ti_pruss.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/ti_pruss.c ============================================================================== --- stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 21:35:32 2016 (r305307) +++ stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 22:04:20 2016 (r305308) @@ -310,7 +310,9 @@ ti_pruss_kqfilter(struct cdev *cdev, str case EVFILT_READ: kn->kn_hook = sc; kn->kn_fop = &ti_pruss_kq_read; + mtx_lock(&sc->sc_mtx); knlist_add(&sc->sc_selinfo.si_note, kn, 1); + mtx_unlock(&sc->sc_mtx); break; default: return (EINVAL); From owner-svn-src-stable-11@freebsd.org Fri Sep 2 22:13:20 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62E76BCC59A; Fri, 2 Sep 2016 22:13:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B5A6A4A; Fri, 2 Sep 2016 22:13:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82MDJxO029723; Fri, 2 Sep 2016 22:13:19 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82MDJEf029721; Fri, 2 Sep 2016 22:13:19 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609022213.u82MDJEf029721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 2 Sep 2016 22:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305309 - stable/11/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 22:13:20 -0000 Author: gonzo Date: Fri Sep 2 22:13:19 2016 New Revision: 305309 URL: https://svnweb.freebsd.org/changeset/base/305309 Log: MFC r305104: Update VCHIQ driver to upstream version 4eda74f2 PR: 211525 Submitted by: Sylvain Garrigues Modified: stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c ============================================================================== --- stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Fri Sep 2 22:04:20 2016 (r305308) +++ stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Fri Sep 2 22:13:19 2016 (r305309) @@ -46,10 +46,10 @@ #define VCHIQ_MINOR 0 /* Some per-instance constants */ -#define MAX_COMPLETIONS 16 +#define MAX_COMPLETIONS 128 #define MAX_SERVICES 64 #define MAX_ELEMENTS 8 -#define MSG_QUEUE_SIZE 64 +#define MSG_QUEUE_SIZE 128 #define KEEPALIVE_VER 1 #define KEEPALIVE_VER_MIN KEEPALIVE_VER @@ -208,30 +208,32 @@ add_completion(VCHIQ_INSTANCE_T instance void *bulk_userdata) { VCHIQ_COMPLETION_DATA_T *completion; + int insert; DEBUG_INITIALISE(g_state.local) - while (instance->completion_insert == - (instance->completion_remove + MAX_COMPLETIONS)) { + insert = instance->completion_insert; + while ((insert - instance->completion_remove) >= MAX_COMPLETIONS) { /* Out of space - wait for the client */ DEBUG_TRACE(SERVICE_CALLBACK_LINE); vchiq_log_trace(vchiq_arm_log_level, "add_completion - completion queue full"); DEBUG_COUNT(COMPLETION_QUEUE_FULL_COUNT); + if (down_interruptible(&instance->remove_event) != 0) { vchiq_log_info(vchiq_arm_log_level, "service_callback interrupted"); return VCHIQ_RETRY; - } else if (instance->closing) { + } + + if (instance->closing) { vchiq_log_info(vchiq_arm_log_level, "service_callback closing"); - return VCHIQ_ERROR; + return VCHIQ_SUCCESS; } DEBUG_TRACE(SERVICE_CALLBACK_LINE); } - completion = - &instance->completions[instance->completion_insert & - (MAX_COMPLETIONS - 1)]; + completion = &instance->completions[insert & (MAX_COMPLETIONS - 1)]; completion->header = header; completion->reason = reason; @@ -252,9 +254,9 @@ add_completion(VCHIQ_INSTANCE_T instance wmb(); if (reason == VCHIQ_MESSAGE_AVAILABLE) - user_service->message_available_pos = - instance->completion_insert; - instance->completion_insert++; + user_service->message_available_pos = insert; + + instance->completion_insert = ++insert; up(&instance->insert_event); @@ -279,6 +281,7 @@ service_callback(VCHIQ_REASON_T reason, USER_SERVICE_T *user_service; VCHIQ_SERVICE_T *service; VCHIQ_INSTANCE_T instance; + int skip_completion = 0; DEBUG_INITIALISE(g_state.local) DEBUG_TRACE(SERVICE_CALLBACK_LINE); @@ -345,9 +348,6 @@ service_callback(VCHIQ_REASON_T reason, user_service->msg_queue[user_service->msg_insert & (MSG_QUEUE_SIZE - 1)] = header; user_service->msg_insert++; - spin_unlock(&msg_queue_spinlock); - - up(&user_service->insert_event); /* If there is a thread waiting in DEQUEUE_MESSAGE, or if ** there is a MESSAGE_AVAILABLE in the completion queue then @@ -356,13 +356,22 @@ service_callback(VCHIQ_REASON_T reason, if (((user_service->message_available_pos - instance->completion_remove) >= 0) || user_service->dequeue_pending) { - DEBUG_TRACE(SERVICE_CALLBACK_LINE); user_service->dequeue_pending = 0; - return VCHIQ_SUCCESS; + skip_completion = 1; } + spin_unlock(&msg_queue_spinlock); + + up(&user_service->insert_event); + header = NULL; } + + if (skip_completion) { + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + return VCHIQ_SUCCESS; + } + DEBUG_TRACE(SERVICE_CALLBACK_LINE); return add_completion(instance, reason, header, user_service, @@ -789,7 +798,7 @@ vchiq_ioctl(struct cdev *cdev, u_long cm break; } - memcpy(&args, (const void*)arg, sizeof(args)); + memcpy(&args, (const void*)arg, sizeof(args)); lmutex_lock(&instance->completion_mutex); @@ -797,6 +806,7 @@ vchiq_ioctl(struct cdev *cdev, u_long cm while ((instance->completion_remove == instance->completion_insert) && !instance->closing) { + DEBUG_TRACE(AWAIT_COMPLETION_LINE); lmutex_unlock(&instance->completion_mutex); rc = down_interruptible(&instance->insert_event); @@ -811,24 +821,29 @@ vchiq_ioctl(struct cdev *cdev, u_long cm } DEBUG_TRACE(AWAIT_COMPLETION_LINE); - /* A read memory barrier is needed to stop prefetch of a stale - ** completion record - */ - rmb(); - if (ret == 0) { int msgbufcount = args.msgbufcount; + int remove; + + remove = instance->completion_remove; + for (count = 0; count < args.count; count++) { VCHIQ_COMPLETION_DATA_T *completion; VCHIQ_SERVICE_T *service1; USER_SERVICE_T *user_service; VCHIQ_HEADER_T *header; - if (instance->completion_remove == - instance->completion_insert) + + if (remove == instance->completion_insert) break; + completion = &instance->completions[ - instance->completion_remove & - (MAX_COMPLETIONS - 1)]; + remove & (MAX_COMPLETIONS - 1)]; + + + /* A read memory barrier is needed to prevent + ** the prefetch of a stale completion record + */ + rmb(); service1 = completion->service_userdata; user_service = service1->base.userdata; @@ -905,7 +920,11 @@ vchiq_ioctl(struct cdev *cdev, u_long cm break; } - instance->completion_remove++; + /* Ensure that the above copy has completed + ** before advancing the remove pointer. */ + mb(); + + instance->completion_remove = ++remove; } if (msgbufcount != args.msgbufcount) { Modified: stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c ============================================================================== --- stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Fri Sep 2 22:04:20 2016 (r305308) +++ stable/11/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Fri Sep 2 22:13:19 2016 (r305309) @@ -622,15 +622,15 @@ process_free_queue(VCHIQ_STATE_T *state) BITSET_T service_found[BITSET_SIZE(VCHIQ_MAX_SERVICES)]; int slot_queue_available; - /* Use a read memory barrier to ensure that any state that may have - ** been modified by another thread is not masked by stale prefetched - ** values. */ - rmb(); - /* Find slots which have been freed by the other side, and return them ** to the available queue. */ slot_queue_available = state->slot_queue_available; + /* Use a memory barrier to ensure that any state that may have been + ** modified by another thread is not masked by stale prefetched + ** values. */ + mb(); + while (slot_queue_available != local->slot_queue_recycle) { unsigned int pos; int slot_index = local->slot_queue[slot_queue_available++ & @@ -638,6 +638,8 @@ process_free_queue(VCHIQ_STATE_T *state) char *data = (char *)SLOT_DATA_FROM_INDEX(state, slot_index); int data_found = 0; + rmb(); + vchiq_log_trace(vchiq_core_log_level, "%d: pfq %d=%x %x %x", state->id, slot_index, (unsigned int)data, local->slot_queue_recycle, slot_queue_available); @@ -753,6 +755,8 @@ process_free_queue(VCHIQ_STATE_T *state) up(&state->data_quota_event); } + mb(); + state->slot_queue_available = slot_queue_available; up(&state->slot_available_event); } @@ -904,16 +908,14 @@ queue_message(VCHIQ_STATE_T *state, VCHI error_count); return VCHIQ_ERROR; } - if (i == 0) { - if (SRVTRACE_ENABLED(service, - VCHIQ_LOG_INFO)) - vchiq_log_dump_mem("Sent", 0, - header->data + pos, - min(64u, - elements[0].size)); - } } + if (SRVTRACE_ENABLED(service, + VCHIQ_LOG_INFO)) + vchiq_log_dump_mem("Sent", 0, + header->data, + min(16, pos)); + spin_lock("a_spinlock); service_quota->message_use_count++; @@ -1052,16 +1054,13 @@ queue_message_sync(VCHIQ_STATE_T *state, error_count); return VCHIQ_ERROR; } - if (i == 0) { - if (vchiq_sync_log_level >= - VCHIQ_LOG_TRACE) - vchiq_log_dump_mem("Sent Sync", - 0, header->data + pos, - min(64u, - elements[0].size)); - } } + if (vchiq_sync_log_level >= VCHIQ_LOG_TRACE) + vchiq_log_dump_mem("Sent Sync", + 0, header->data, + min(16, pos)); + VCHIQ_SERVICE_STATS_INC(service, ctrl_tx_count); VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size); } else { @@ -1732,7 +1731,7 @@ parse_rx_slots(VCHIQ_STATE_T *state) remoteport, localport, size); if (size > 0) vchiq_log_dump_mem("Rcvd", 0, header->data, - min(64, size)); + min(16, size)); } if (((unsigned int)header & VCHIQ_SLOT_MASK) + calc_stride(size) @@ -2202,7 +2201,7 @@ sync_func(void *v) remoteport, localport, size); if (size > 0) vchiq_log_dump_mem("Rcvd", 0, header->data, - min(64, size)); + min(16, size)); } switch (type) { From owner-svn-src-stable-11@freebsd.org Sat Sep 3 01:09:24 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26227BCEA3B; Sat, 3 Sep 2016 01:09:24 +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 D1107E29; Sat, 3 Sep 2016 01:09:23 +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 u8319NiI093676; Sat, 3 Sep 2016 01:09:23 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8319Nxn093675; Sat, 3 Sep 2016 01:09:23 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609030109.u8319Nxn093675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sat, 3 Sep 2016 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305317 - stable/11/lib/libc/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2016 01:09:24 -0000 Author: ache Date: Sat Sep 3 01:09:22 2016 New Revision: 305317 URL: https://svnweb.freebsd.org/changeset/base/305317 Log: MFC r305133 Apply the same qsort() usage fix as in r304911 getaddrinfo.c qsort() can't be stabilized with just return(-1) alone. Modified: stable/11/lib/libc/net/name6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/name6.c ============================================================================== --- stable/11/lib/libc/net/name6.c Sat Sep 3 01:08:52 2016 (r305316) +++ stable/11/lib/libc/net/name6.c Sat Sep 3 01:09:22 2016 (r305317) @@ -185,6 +185,7 @@ struct hp_order { #define aio_sa aio_un.aiou_sa int aio_matchlen; char *aio_h_addr; + int aio_initial_sequence; }; static struct hostent *_hpcopy(struct hostent *, int *); @@ -711,6 +712,7 @@ _hpreorder(struct hostent *hp) aio[i].aio_dstscope = gai_addr2scopetype(sa); aio[i].aio_dstpolicy = match_addrselectpolicy(sa, &policyhead); set_source(&aio[i], &policyhead); + aio[i].aio_initial_sequence = i; } /* perform sorting. */ @@ -1045,6 +1047,23 @@ comp_dst(const void *arg1, const void *a } /* Rule 10: Otherwise, leave the order unchanged. */ + + /* + * Note that qsort is unstable; so, we can't return zero and + * expect the order to be unchanged. + * That also means we can't depend on the current position of + * dst2 being after dst1. We must enforce the initial order + * with an explicit compare on the original position. + * The qsort specification requires that "When the same objects + * (consisting of width bytes, irrespective of their current + * positions in the array) are passed more than once to the + * comparison function, the results shall be consistent with one + * another." + * In other words, If A < B, then we must also return B > A. + */ + if (dst2->aio_initial_sequence < dst1->aio_initial_sequence) + return(1); + return(-1); } From owner-svn-src-stable-11@freebsd.org Sat Sep 3 08:44:25 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 479AFBCD33F; Sat, 3 Sep 2016 08:44:25 +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 BBF892FA9; Sat, 3 Sep 2016 08:44:24 +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 u838iI6g025951 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 3 Sep 2016 11:44:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u838iI6g025951 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u838iIkQ025950; Sat, 3 Sep 2016 11:44:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Sep 2016 11:44:18 +0300 From: Konstantin Belousov To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r305308 - stable/11/sys/arm/ti Message-ID: <20160903084418.GU83214@kib.kiev.ua> References: <201609022204.u82M4KOm025953@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201609022204.u82M4KOm025953@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-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2016 08:44:25 -0000 On Fri, Sep 02, 2016 at 10:04:20PM +0000, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Fri Sep 2 22:04:20 2016 > New Revision: 305308 > URL: https://svnweb.freebsd.org/changeset/base/305308 > > Log: > MFC r305039: > > Fix TI PRUSS driver panic with INVARIANTS enabled > > Value passed as islocked argument to knlist_add should > be consistent with actual lock state so add lock/unlock > calls around knlist_add > > PR: 212120 > Submitted by: Manuel Stuhn > > Modified: > stable/11/sys/arm/ti/ti_pruss.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/arm/ti/ti_pruss.c > ============================================================================== > --- stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 21:35:32 2016 (r305307) > +++ stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 22:04:20 2016 (r305308) > @@ -310,7 +310,9 @@ ti_pruss_kqfilter(struct cdev *cdev, str > case EVFILT_READ: > kn->kn_hook = sc; > kn->kn_fop = &ti_pruss_kq_read; > + mtx_lock(&sc->sc_mtx); > knlist_add(&sc->sc_selinfo.si_note, kn, 1); > + mtx_unlock(&sc->sc_mtx); > break; > default: > return (EINVAL); Wouldn't it be less code to just change the arg to indicate 'unlocked' ? From owner-svn-src-stable-11@freebsd.org Sat Sep 3 09:03:43 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F840BCDE1E; Sat, 3 Sep 2016 09:03:43 +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 D4DEBFBF; Sat, 3 Sep 2016 09:03:42 +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 u8393gU1074230; Sat, 3 Sep 2016 09:03:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8393fM9074219; Sat, 3 Sep 2016 09:03:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609030903.u8393fM9074219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Sep 2016 09:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305329 - in stable/11/lib/libc: amd64/sys arm/sys i386/sys include mips/sys powerpc/sys powerpc64/sys sparc64/sys sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2016 09:03:43 -0000 Author: kib Date: Sat Sep 3 09:03:40 2016 New Revision: 305329 URL: https://svnweb.freebsd.org/changeset/base/305329 Log: MFC r304928: Do not obliterate errno value in the main thread during ptrace(2) call on x86. MFC r304931: Follow ABI when calling __error from the ptrace(2) wrapper. MFC r305012: Rewrite ptrace(2) wrappers in C. MFC r305022: Restore the requirement of setting errno to zero before calling ptrace(2). Added: stable/11/lib/libc/sys/ptrace.c - copied unchanged from r305012, head/lib/libc/sys/ptrace.c Deleted: stable/11/lib/libc/amd64/sys/ptrace.S stable/11/lib/libc/arm/sys/ptrace.S stable/11/lib/libc/i386/sys/ptrace.S stable/11/lib/libc/mips/sys/ptrace.S stable/11/lib/libc/powerpc/sys/ptrace.S stable/11/lib/libc/powerpc64/sys/ptrace.S stable/11/lib/libc/sparc64/sys/ptrace.S Modified: stable/11/lib/libc/amd64/sys/Makefile.inc stable/11/lib/libc/arm/sys/Makefile.inc stable/11/lib/libc/i386/sys/Makefile.inc stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/mips/sys/Makefile.inc stable/11/lib/libc/powerpc/sys/Makefile.inc stable/11/lib/libc/powerpc64/sys/Makefile.inc stable/11/lib/libc/sparc64/sys/Makefile.inc stable/11/lib/libc/sys/Makefile.inc stable/11/lib/libc/sys/ptrace.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/amd64/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/amd64/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -4,7 +4,7 @@ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ amd64_set_gsbase.c __vdso_gettc.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ +MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: Modified: stable/11/lib/libc/arm/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/arm/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/arm/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o Modified: stable/11/lib/libc/i386/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/i386/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/i386/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ +MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/include/libc_private.h Sat Sep 3 09:03:40 2016 (r305329) @@ -335,6 +335,7 @@ int __sys_openat(int, const char *, int int __sys_pselect(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timespec *, const __sigset_t *); +int __sys_ptrace(int, __pid_t, char *, int); int __sys_poll(struct pollfd *, unsigned, int); int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *, const __sigset_t *); Modified: stable/11/lib/libc/mips/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/mips/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/mips/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -3,7 +3,7 @@ SRCS+= trivial-vdso_tc.c MDASM= Ovfork.S brk.S cerror.S exect.S \ - ptrace.S sbrk.S syscall.S + sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o Modified: stable/11/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/powerpc/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/powerpc/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: stable/11/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/powerpc64/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/powerpc64/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: stable/11/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/sparc64/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/sparc64/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -12,7 +12,7 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: stable/11/lib/libc/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/sys/Makefile.inc Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) @@ -48,6 +48,7 @@ INTERPOSED = \ poll \ ppoll \ pselect \ + ptrace \ read \ readv \ recvfrom \ Modified: stable/11/lib/libc/sys/ptrace.2 ============================================================================== --- stable/11/lib/libc/sys/ptrace.2 Sat Sep 3 08:48:51 2016 (r305328) +++ stable/11/lib/libc/sys/ptrace.2 Sat Sep 3 09:03:40 2016 (r305329) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 28, 2016 +.Dd August 29, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -900,13 +900,29 @@ argument is ignored. .Pp Additionally, other machine-specific requests can exist. .Sh RETURN VALUES +Most requests return 0 on success and \-1 on error. Some requests can cause .Fn ptrace to return \-1 -as a non-error value; to disambiguate, +as a non-error value, among them are +.Dv PT_READ_I +and +.Dv PT_READ_D , +which return the value read from the process memory on success. +To disambiguate, .Va errno can be set to 0 before the call and checked afterwards. +.Pp +The current +.Fn ptrace +implementation always sets +.Va errno +to 0 before calling into the kernel, both for historic reasons and for +consistency with other operating systems. +It is recommended to assign zero to +.Va errno +explicitly for forward compatibility. .Sh ERRORS The .Fn ptrace Copied: stable/11/lib/libc/sys/ptrace.c (from r305012, head/lib/libc/sys/ptrace.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/sys/ptrace.c Sat Sep 3 09:03:40 2016 (r305329, copy of r305012, head/lib/libc/sys/ptrace.c) @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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 "libc_private.h" + +__weak_reference(_ptrace, ptrace); + +int +_ptrace(int request, pid_t pid, caddr_t addr, int data) +{ + + errno = 0; + return (__sys_ptrace(request, pid, addr, data)); +} From owner-svn-src-stable-11@freebsd.org Sat Sep 3 09:24:34 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E61A4BCE45C; Sat, 3 Sep 2016 09:24:34 +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 B34ABC6E; Sat, 3 Sep 2016 09:24:34 +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 u839OXMq081892; Sat, 3 Sep 2016 09:24:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u839OXuk081891; Sat, 3 Sep 2016 09:24:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609030924.u839OXuk081891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Sep 2016 09:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305330 - stable/11/lib/libc/aarch64/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2016 09:24:35 -0000 Author: kib Date: Sat Sep 3 09:24:33 2016 New Revision: 305330 URL: https://svnweb.freebsd.org/changeset/base/305330 Log: MFC r305015: Remove commented out mention of ptrace.S. Modified: stable/11/lib/libc/aarch64/sys/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/aarch64/sys/Makefile.inc Sat Sep 3 09:03:40 2016 (r305329) +++ stable/11/lib/libc/aarch64/sys/Makefile.inc Sat Sep 3 09:24:33 2016 (r305330) @@ -4,7 +4,6 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c -#MDASM= ptrace.S MDASM= cerror.S \ shmat.S \ sigreturn.S \ From owner-svn-src-stable-11@freebsd.org Sat Sep 3 18:43:16 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1AEBBCE6FF; Sat, 3 Sep 2016 18:43:15 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE2C1F15; Sat, 3 Sep 2016 18:43:15 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [136.179.10.143] (helo=[10.140.230.85]) by id.bluezbox.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bgFuF-000NHP-De; Sat, 03 Sep 2016 11:43:07 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r305308 - stable/11/sys/arm/ti From: Oleksandr Tymoshenko In-Reply-To: <20160903084418.GU83214@kib.kiev.ua> Date: Sat, 3 Sep 2016 11:42:37 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <40BCE21A-2FB8-44FD-8C2C-0579D8C0E57F@freebsd.org> References: <201609022204.u82M4KOm025953@repo.freebsd.org> <20160903084418.GU83214@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Sep 3, 2016, at 1:44 AM, Konstantin Belousov wrote: > > On Fri, Sep 02, 2016 at 10:04:20PM +0000, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Fri Sep 2 22:04:20 2016 >> New Revision: 305308 >> URL: https://svnweb.freebsd.org/changeset/base/305308 >> >> Log: >> MFC r305039: >> >> Fix TI PRUSS driver panic with INVARIANTS enabled >> >> Value passed as islocked argument to knlist_add should >> be consistent with actual lock state so add lock/unlock >> calls around knlist_add >> >> PR: 212120 >> Submitted by: Manuel Stuhn >> >> Modified: >> stable/11/sys/arm/ti/ti_pruss.c >> Directory Properties: >> stable/11/ (props changed) >> >> Modified: stable/11/sys/arm/ti/ti_pruss.c >> ============================================================================== >> --- stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 21:35:32 2016 (r305307) >> +++ stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 22:04:20 2016 (r305308) >> @@ -310,7 +310,9 @@ ti_pruss_kqfilter(struct cdev *cdev, str >> case EVFILT_READ: >> kn->kn_hook = sc; >> kn->kn_fop = &ti_pruss_kq_read; >> + mtx_lock(&sc->sc_mtx); >> knlist_add(&sc->sc_selinfo.si_note, kn, 1); >> + mtx_unlock(&sc->sc_mtx); >> break; >> default: >> return (EINVAL); > Wouldn't it be less code to just change the arg to indicate 'unlocked’ ? [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2016 18:43:16 -0000 > On Sep 3, 2016, at 1:44 AM, Konstantin Belousov = wrote: >=20 > On Fri, Sep 02, 2016 at 10:04:20PM +0000, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Fri Sep 2 22:04:20 2016 >> New Revision: 305308 >> URL: https://svnweb.freebsd.org/changeset/base/305308 >>=20 >> Log: >> MFC r305039: >>=20 >> Fix TI PRUSS driver panic with INVARIANTS enabled >>=20 >> Value passed as islocked argument to knlist_add should >> be consistent with actual lock state so add lock/unlock >> calls around knlist_add >>=20 >> PR: 212120 >> Submitted by: Manuel Stuhn >>=20 >> Modified: >> stable/11/sys/arm/ti/ti_pruss.c >> Directory Properties: >> stable/11/ (props changed) >>=20 >> Modified: stable/11/sys/arm/ti/ti_pruss.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 >> --- stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 21:35:32 2016 = (r305307) >> +++ stable/11/sys/arm/ti/ti_pruss.c Fri Sep 2 22:04:20 2016 = (r305308) >> @@ -310,7 +310,9 @@ ti_pruss_kqfilter(struct cdev *cdev, str >> case EVFILT_READ: >> kn->kn_hook =3D sc; >> kn->kn_fop =3D &ti_pruss_kq_read; >> + mtx_lock(&sc->sc_mtx); >> knlist_add(&sc->sc_selinfo.si_note, kn, 1); >> + mtx_unlock(&sc->sc_mtx); >> break; >> default: >> return (EINVAL); > Wouldn't it be less code to just change the arg to indicate = 'unlocked=E2=80=99 ? It would. I=E2=80=99ll update HEAD and stable/11 soon. Thanks for = spotting.=20