From owner-svn-src-stable-11@freebsd.org Sun Feb 19 03:11:15 2017 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 D97BCCE39F0; Sun, 19 Feb 2017 03:11:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8B2A1A19; Sun, 19 Feb 2017 03:11:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1J3BE0w056014; Sun, 19 Feb 2017 03:11:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1J3BEL4056013; Sun, 19 Feb 2017 03:11:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702190311.v1J3BEL4056013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Feb 2017 03:11: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: r313931 - stable/11/sys/fs/devfs 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.23 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, 19 Feb 2017 03:11:16 -0000 Author: kib Date: Sun Feb 19 03:11:14 2017 New Revision: 313931 URL: https://svnweb.freebsd.org/changeset/base/313931 Log: MFC r313797: Minor style fixes. Modified: stable/11/sys/fs/devfs/devfs_devs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/11/sys/fs/devfs/devfs_devs.c Sun Feb 19 02:03:09 2017 (r313930) +++ stable/11/sys/fs/devfs/devfs_devs.c Sun Feb 19 03:11:14 2017 (r313931) @@ -208,7 +208,7 @@ devfs_newdirent(char *name, int namelen) struct dirent d; d.d_namlen = namelen; - i = sizeof (*de) + GENERIC_DIRSIZ(&d); + i = sizeof(*de) + GENERIC_DIRSIZ(&d); de = malloc(i, M_DEVFS3, M_WAITOK | M_ZERO); de->de_dirent = (struct dirent *)(de + 1); de->de_dirent->d_namlen = namelen; @@ -246,7 +246,8 @@ devfs_parent_dirent(struct devfs_dirent } struct devfs_dirent * -devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode) +devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, + struct devfs_dirent *dotdot, u_int inode) { struct devfs_dirent *dd; struct devfs_dirent *de; From owner-svn-src-stable-11@freebsd.org Sun Feb 19 17:35:15 2017 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 C7D56CE27D7; Sun, 19 Feb 2017 17:35:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967E01332; Sun, 19 Feb 2017 17:35:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1JHZEdC005409; Sun, 19 Feb 2017 17:35:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1JHZESA005408; Sun, 19 Feb 2017 17:35:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702191735.v1JHZESA005408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 19 Feb 2017 17:35: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: r313952 - stable/11/usr.bin/timeout 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.23 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, 19 Feb 2017 17:35:15 -0000 Author: bapt Date: Sun Feb 19 17:35:14 2017 New Revision: 313952 URL: https://svnweb.freebsd.org/changeset/base/313952 Log: MFC r313867, r313869-r313870 r313867: Add history and Authors section in the manpage Submitted by: dteske MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9419 r313869: Also add vsevolod@ in the authors r313870: Use full name for the month Reported by: brueffer Modified: stable/11/usr.bin/timeout/timeout.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/timeout/timeout.1 ============================================================================== --- stable/11/usr.bin/timeout/timeout.1 Sun Feb 19 17:32:21 2017 (r313951) +++ stable/11/usr.bin/timeout/timeout.1 Sun Feb 19 17:35:14 2017 (r313952) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 28, 2014 +.Dd February 17, 2017 .Dt TIMEOUT 1 .Os .Sh NAME @@ -127,3 +127,12 @@ the exit status return is 125. .Sh SEE ALSO .Xr kill 1 , .Xr signal 3 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 10.3 . +.Sh AUTHORS +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org +and +.An Vsevolod Stakhov Aq Mt vsevolod@FreeBSD.org From owner-svn-src-stable-11@freebsd.org Sun Feb 19 21:08:11 2017 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 6DD33CE5DA7; Sun, 19 Feb 2017 21:08:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1E419AF; Sun, 19 Feb 2017 21:08:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1JL8Amg093124; Sun, 19 Feb 2017 21:08:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1JL8AwS093123; Sun, 19 Feb 2017 21:08:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702192108.v1JL8AwS093123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 19 Feb 2017 21:08: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: r313970 - stable/11/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.23 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, 19 Feb 2017 21:08:11 -0000 Author: pfg Date: Sun Feb 19 21:08:10 2017 New Revision: 313970 URL: https://svnweb.freebsd.org/changeset/base/313970 Log: MFC r313819: Remove outdated claim. Despite wishful thinking the removal of these old functions hasn't happened yet. Modified: stable/11/include/stdlib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/stdlib.h ============================================================================== --- stable/11/include/stdlib.h Sun Feb 19 21:02:05 2017 (r313969) +++ stable/11/include/stdlib.h Sun Feb 19 21:08:10 2017 (r313970) @@ -315,7 +315,7 @@ void srandomdev(void); long long strtonum(const char *, long long, long long, const char **); -/* Deprecated interfaces, to be removed in FreeBSD 6.0. */ +/* Deprecated interfaces, to be removed. */ __int64_t strtoq(const char *, char **, int); __uint64_t From owner-svn-src-stable-11@freebsd.org Mon Feb 20 03:26:21 2017 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 63413CE34EE; Mon, 20 Feb 2017 03:26:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B54717B4; Mon, 20 Feb 2017 03:26:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1K3QKDR052685; Mon, 20 Feb 2017 03:26:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1K3QJv1052675; Mon, 20 Feb 2017 03:26:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702200326.v1K3QJv1052675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Feb 2017 03:26: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: r313980 - in stable/11: contrib/openresolv 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.23 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, 20 Feb 2017 03:26:21 -0000 Author: pfg Date: Mon Feb 20 03:26:19 2017 New Revision: 313980 URL: https://svnweb.freebsd.org/changeset/base/313980 Log: MFC r312992: MFV r312970, 313160: openresolv: update to version 3.9.0. It is now possible to drop the _WITH_ARG vars thanks to a change to the pdns_recursor upstreamed by Guy Yur. Modified: stable/11/contrib/openresolv/Makefile stable/11/contrib/openresolv/configure stable/11/contrib/openresolv/libc.in stable/11/contrib/openresolv/pdns_recursor.in stable/11/contrib/openresolv/resolvconf.8.in stable/11/contrib/openresolv/resolvconf.conf.5.in stable/11/contrib/openresolv/resolvconf.in stable/11/sbin/resolvconf/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/openresolv/Makefile ============================================================================== --- stable/11/contrib/openresolv/Makefile Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/Makefile Mon Feb 20 03:26:19 2017 (r313980) @@ -37,6 +37,11 @@ SED_STATUSARG= -e 's:@STATUSARG@:${STAT DISTPREFIX?= ${PKG}-${VERSION} DISTFILEGZ?= ${DISTPREFIX}.tar.gz DISTFILE?= ${DISTPREFIX}.tar.xz +DISTINFO= ${DISTFILE}.distinfo +DISTINFOSIGN= ${DISTINFO}.asc +CKSUM?= cksum -a SHA256 +PGP?= netpgp + FOSSILID?= current .SUFFIXES: .in @@ -53,7 +58,7 @@ clean: rm -f ${TARGET} distclean: clean - rm -f config.mk ${DISTFILE} + rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} installdirs: @@ -83,3 +88,11 @@ dist: fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} gunzip -c ${DISTFILEGZ} | xz >${DISTFILE} rm ${DISTFILEGZ} + +distinfo: dist + rm -f ${DISTINFO} ${DISTINFOSIGN} + ${CKSUM} ${DISTFILE} >${DISTINFO} + #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO} + ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} + chmod 644 ${DISTINFOSIGN} + ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} Modified: stable/11/contrib/openresolv/configure ============================================================================== --- stable/11/contrib/openresolv/configure Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/configure Mon Feb 20 03:26:19 2017 (r313980) @@ -120,14 +120,21 @@ echo "Configuring openresolv for ... $OS rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK -# On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled -# regardless of if it's not running. -# So we force onestatus to work around this silly bug. -if [ -z "$STATUSARG" ]; then - case "$OS" in - freebsd*) STATUSARG="onestatus";; - esac -fi +case "$OS" in +freebsd*) + # On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled + # regardless of if it's not running. + # So we force onestatus to work around this silly bug. + if [ -z "$STATUSARG" ]; then + STATUSARG="onestatus" + fi + ;; +linux*) + # cksum does't support -a and netpgp is rare + echo "CKSUM= sha256sum --tag" >>$CONFIG_MK + echo "PGP= gpg2" >>$CONFIG_MK + ;; +esac for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG do Modified: stable/11/contrib/openresolv/libc.in ============================================================================== --- stable/11/contrib/openresolv/libc.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/libc.in Mon Feb 20 03:26:19 2017 (r313980) @@ -216,7 +216,7 @@ fi if $backup; then if [ "$newconf" = "$signature$NL" ]; then if [ -e "$resolv_conf.bak" ]; then - newconf="$(cat "$resolv_conf.bak")" + newconf="$(cat "$resolv_conf.bak")$NL" fi elif [ -e "$resolv_conf" ]; then read line <"$resolv_conf" Modified: stable/11/contrib/openresolv/pdns_recursor.in ============================================================================== --- stable/11/contrib/openresolv/pdns_recursor.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/pdns_recursor.in Mon Feb 20 03:26:19 2017 (r313980) @@ -34,7 +34,6 @@ NL=" " : ${pdns_service:=pdns_recursor} -: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} newzones= @@ -68,5 +67,12 @@ if [ ! -f "$pdns_zones" ] || \ [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] then printf %s "$newzones" >"$pdns_zones" - eval $pdns_restart + if [ -n "$pdns_restart" ]; then + eval $pdns_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${pdns_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${pdns_service} + fi fi Modified: stable/11/contrib/openresolv/resolvconf.8.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.8.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/resolvconf.8.in Mon Feb 20 03:26:19 2017 (r313980) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 7, 2016 +.Dd November 29, 2016 .Dt RESOLVCONF 8 .Os .Sh NAME @@ -45,6 +45,8 @@ .Fl il Ar pattern .Nm .Fl u +.Nm +.Fl Fl version .Sh DESCRIPTION .Nm manages @@ -106,7 +108,7 @@ See .Xr resolvconf.conf 5 for how to configure .Nm -to use a local name server. +to use a local name server and how to remove the private marking. .Pp .Nm can mark an interfaces @@ -126,7 +128,7 @@ on the .Ar interface . .Pp Here are some options for the above commands:- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It Fl f Ignore non existent interfaces. Only really useful for deleting interfaces. @@ -146,7 +148,7 @@ as exclusive when adding, otherwise only .Pp .Nm has some more commands for general usage:- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It Fl i Ar pattern List the interfaces and protocols, optionally matching .Ar pattern , @@ -168,12 +170,15 @@ to update all its subscribers. .Nm does not update the subscribers when adding a resolv.conf that matches what it already has for that interface. +.It Fl Fl version +Echo the resolvconf version to +.Em stdout . .El .Pp .Nm also has some commands designed to be used by it's subscribers and system startup:- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It Fl I Initialise the state directory .Pa @VARDIR@ . @@ -223,7 +228,7 @@ Here are some suggested protocol tags to .Pa resolv.conf file registered on an .Ar interface Ns No :- -.Bl -tag -width indent +.Bl -tag -width pattern_opt .It dhcp Dynamic Host Configuration Protocol. Initial versions of Modified: stable/11/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.conf.5.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/resolvconf.conf.5.in Mon Feb 20 03:26:19 2017 (r313980) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 2016 +.Dd December 29, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -69,6 +69,11 @@ If unset, defaults to the following:- These interfaces will be processed next, unless they have a metric. If unset, defaults to the following:- .D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* +.It Sy inclusive_interfaces +Ignore any exlcusive marking for these interfaces. +This is handy when 3rd party integrations force the +.Nm resolvconf -x +option and you want to disable it easily. .It Sy local_nameservers If unset, defaults to the following:- .D1 127.* 0.0.0.0 255.255.255.255 ::1 @@ -102,6 +107,11 @@ Requires a local nameserver other than l This is equivalent to the .Nm resolvconf -p option. +.It Sy public_interfaces +Force these interface to be public, overriding the private marking. +This is handy when 3rd party integrations force the +.Nm resolvconf -p +option and you want to disable it easily. .It Sy replace Is a space separated list of replacement keywords. The syntax is this: Modified: stable/11/contrib/openresolv/resolvconf.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/resolvconf.in Mon Feb 20 03:26:19 2017 (r313980) @@ -25,13 +25,19 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" -OPENRESOLV_VERSION="3.8.1" +OPENRESOLV_VERSION="3.9.0" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ RCDIR=@RCDIR@ RESTARTCMD=@RESTARTCMD@ +if [ "$1" = "--version" ]; then + echo "openresolv $OPENRESOLV_VERSION" + echo "Copyright (c) 2007-2016 Roy Marples" + exit 0 +fi + # Disregard dhcpcd setting unset interface_order state_dir @@ -90,6 +96,7 @@ usage() that match the specified pattern -u Run updates from our current DNS information + --version Echo the ${RESOLVCONF##*/} version Options: -f Ignore non existent interfaces @@ -129,6 +136,34 @@ strip_trailing_dots() printf "\n" } +private_iface() +{ + local p + + # Allow expansion + cd "$IFACEDIR" + + # Public interfaces override private ones. + for p in $public_interfaces; do + case "$iface" in + "$p"|"$p":*) return 1;; + esac + done + + if [ -e "$PRIVATEDIR/$iface" ]; then + return 0 + fi + + for p in $private_interfaces; do + case "$iface" in + "$p"|"$p":*) return 0;; + esac + done + + # Not a private interface + return 1 +} + # Parse resolv.conf's and make variables # for domain name servers, search name servers and global nameservers parse_resolv() @@ -144,20 +179,10 @@ parse_resolv() if ${new}; then iface="${line#\# resolv.conf from *}" new=false - if [ -e "$PRIVATEDIR/$iface" ]; then + if private_iface "$iface"; then private=true else - # Allow expansion - cd "$IFACEDIR" private=false - for p in $private_interfaces; do - case "$iface" in - "$p"|"$p":*) - private=true - break - ;; - esac - done fi fi ;; @@ -301,9 +326,9 @@ fi" /usr/sbin/service \$1 restart; fi" elif [ -x /bin/sv ]; then - RESTARTCMD="/bin/sv try-restart \$1" + RESTARTCMD="/bin/sv status \$1 >/dev/null 2>&1 && /bin/sv try-restart \$1" elif [ -x /usr/bin/sv ]; then - RESTARTCMD="/usr/bin/sv try-restart \$1" + RESTARTCMD="/usr/bin/sv status \$1 >/dev/null 2>&1 && /usr/bin/sv try-restart \$1" elif [ -e /etc/arch-release -a -d /etc/rc.d ]; then RCDIR=/etc/rc.d RESTARTCMD="if [ -e /var/run/daemons/\$1 ]; then @@ -378,6 +403,14 @@ list_resolv() done fi excl=true + cd "$IFACEDIR" + for i in $inclusive_interfaces; do + if [ -f "$i" -a "$list" = "$i" ]; then + list= + excl=false + break + fi + done ;; *) excl=false @@ -418,7 +451,6 @@ list_resolv() cd "$IFACEDIR" retval=1 - excl=true for i in $(uniqify $list); do # Only list interfaces which we really have if ! [ -f "$i" ]; then @@ -432,8 +464,7 @@ list_resolv() if [ "$cmd" = i -o "$cmd" = "-i" ]; then printf %s "$i " else - echo_resolv "$i" - echo + echo_resolv "$i" && echo fi [ $? = 0 -a "$retval" = 1 ] && retval=0 done Modified: stable/11/sbin/resolvconf/Makefile ============================================================================== --- stable/11/sbin/resolvconf/Makefile Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/sbin/resolvconf/Makefile Mon Feb 20 03:26:19 2017 (r313980) @@ -20,9 +20,6 @@ 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. -CMD1_WITH_ARG= \1 onestatus >/dev/null 2>\&1 -CMD2_WITH_ARG= \1 restart -RESTARTCMD_WITH_ARG= /usr/sbin/service ${CMD1_WITH_ARG} \&\& /usr/sbin/service ${CMD2_WITH_ARG} CMD1= \\$$1 onestatus >/dev/null 2>\&1 CMD2= \\$$1 restart RESTARTCMD= "/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}" @@ -32,7 +29,6 @@ ${f}: ${f}.in 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' \ From owner-svn-src-stable-11@freebsd.org Mon Feb 20 03:34:01 2017 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 A15AECE3731; Mon, 20 Feb 2017 03:34:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F1DC1C4C; Mon, 20 Feb 2017 03:34:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1K3Y0dM056611; Mon, 20 Feb 2017 03:34:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1K3XxOO056595; Mon, 20 Feb 2017 03:33:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702200333.v1K3XxOO056595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Feb 2017 03: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: r313981 - in stable/11/lib/libedit: . TEST edit/readline 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.23 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, 20 Feb 2017 03:34:01 -0000 Author: pfg Date: Mon Feb 20 03:33:59 2017 New Revision: 313981 URL: https://svnweb.freebsd.org/changeset/base/313981 Log: MFC r312997, r313002: Re-import libedit 2016-02-27 and update libedit with changes from NetBSD's 2016-03-21. Obtained from: NetBSD Modified: stable/11/lib/libedit/Makefile stable/11/lib/libedit/TEST/rl1.c stable/11/lib/libedit/TEST/tc1.c stable/11/lib/libedit/TEST/wtc1.c stable/11/lib/libedit/chared.c stable/11/lib/libedit/chared.h stable/11/lib/libedit/chartype.c stable/11/lib/libedit/chartype.h stable/11/lib/libedit/common.c stable/11/lib/libedit/config.h stable/11/lib/libedit/edit/readline/readline.h stable/11/lib/libedit/editline.3 stable/11/lib/libedit/el.c stable/11/lib/libedit/el.h stable/11/lib/libedit/eln.c stable/11/lib/libedit/emacs.c stable/11/lib/libedit/filecomplete.c stable/11/lib/libedit/hist.c stable/11/lib/libedit/hist.h stable/11/lib/libedit/histedit.h stable/11/lib/libedit/history.c stable/11/lib/libedit/keymacro.c stable/11/lib/libedit/makelist stable/11/lib/libedit/map.c stable/11/lib/libedit/parse.c stable/11/lib/libedit/prompt.c stable/11/lib/libedit/prompt.h stable/11/lib/libedit/read.c stable/11/lib/libedit/read.h stable/11/lib/libedit/readline.c stable/11/lib/libedit/refresh.c stable/11/lib/libedit/refresh.h stable/11/lib/libedit/search.c stable/11/lib/libedit/search.h stable/11/lib/libedit/sig.c stable/11/lib/libedit/sig.h stable/11/lib/libedit/sys.h stable/11/lib/libedit/terminal.c stable/11/lib/libedit/terminal.h stable/11/lib/libedit/tokenizer.c stable/11/lib/libedit/tty.c stable/11/lib/libedit/tty.h stable/11/lib/libedit/vi.c Modified: stable/11/lib/libedit/Makefile ============================================================================== --- stable/11/lib/libedit/Makefile Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/Makefile Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2009/01/18 12:17:49 lukem Exp $ +# $NetBSD: Makefile,v 1.56 2016/03/02 19:24:20 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ @@ -7,7 +7,7 @@ LIB= edit SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ +OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c @@ -35,12 +35,11 @@ CLEANFILES+= common.h editline.c emacs.h INCS= histedit.h -OSRCS+= eln.c SRCS+= tokenizern.c historyn.c CLEANFILES+= tokenizern.c historyn.c CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR -CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH -CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT +#CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH +#CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT WARNS?= 1 Modified: stable/11/lib/libedit/TEST/rl1.c ============================================================================== --- stable/11/lib/libedit/TEST/rl1.c Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/TEST/rl1.c Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $ */ +/* $NetBSD: rl1.c,v 1.2 2016/02/29 00:54:19 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $"); +__RCSID("$NetBSD: rl1.c,v 1.2 2016/02/29 00:54:19 christos Exp $"); #endif /* not lint */ __FBSDID("$FreeBSD$"); Modified: stable/11/lib/libedit/TEST/tc1.c ============================================================================== --- stable/11/lib/libedit/TEST/tc1.c Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/TEST/tc1.c Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $ */ +/* $NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19 #if 0 static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $"); +__RCSID("$NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $"); #endif #endif /* not lint && not SCCSID */ __FBSDID("$FreeBSD$"); @@ -50,15 +50,15 @@ __FBSDID("$FreeBSD$"); /* * test.c: A little test program */ -#include -#include -#include #include #include -#include -#include #include #include +#include +#include +#include +#include +#include #include "histedit.h" @@ -158,7 +158,7 @@ main(int argc, char *argv[]) /* Add a user-defined function */ el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete); - /* Bind tab to it */ + /* Bind tab to it */ el_set(el, EL_BIND, "^I", "ed-complete", NULL); /* Modified: stable/11/lib/libedit/TEST/wtc1.c ============================================================================== --- stable/11/lib/libedit/TEST/wtc1.c Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/TEST/wtc1.c Mon Feb 20 03:33:59 2017 (r313981) @@ -5,13 +5,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include #include +#include #include #include +#include +#include +#include +#include +#include #include "../histedit.h" Modified: stable/11/lib/libedit/chared.c ============================================================================== --- stable/11/lib/libedit/chared.c Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/chared.c Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -46,8 +46,12 @@ __FBSDID("$FreeBSD$"); /* * chared.c: Character editor utilities */ +#include #include +#include + #include "el.h" +#include "common.h" private void ch__clearmacro (EditLine *); @@ -201,7 +205,7 @@ c_delbefore1(EditLine *el) * Return if p is part of a word according to emacs */ protected int -ce__isword(Int p) +ce__isword(wint_t p) { return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL; } @@ -211,7 +215,7 @@ ce__isword(Int p) * Return if p is part of a word according to vi */ protected int -cv__isword(Int p) +cv__isword(wint_t p) { if (Isalnum(p) || p == '_') return 1; @@ -225,7 +229,7 @@ cv__isword(Int p) * Return if p is part of a big word according to vi */ protected int -cv__isWord(Int p) +cv__isWord(wint_t p) { return !Isspace(p); } @@ -235,7 +239,7 @@ cv__isWord(Int p) * Find the previous word */ protected Char * -c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int)) +c__prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t)) { p--; @@ -259,7 +263,7 @@ c__prev_word(Char *p, Char *low, int n, * Find the next word */ protected Char * -c__next_word(Char *p, Char *high, int n, int (*wtest)(Int)) +c__next_word(Char *p, Char *high, int n, int (*wtest)(wint_t)) { while (n--) { while ((p < high) && !(*wtest)(*p)) @@ -277,7 +281,7 @@ c__next_word(Char *p, Char *high, int n, * Find the next word vi style */ protected Char * -cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int)) +cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(wint_t)) { int test; @@ -306,7 +310,7 @@ cv_next_word(EditLine *el, Char *p, Char * Find the previous word vi style */ protected Char * -cv_prev_word(Char *p, Char *low, int n, int (*wtest)(Int)) +cv_prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t)) { int test; @@ -370,7 +374,7 @@ cv_delfini(EditLine *el) * Go to the end of this word according to vi */ protected Char * -cv__endword(Char *p, Char *high, int n, int (*wtest)(Int)) +cv__endword(Char *p, Char *high, int n, int (*wtest)(wint_t)) { int test; @@ -524,7 +528,7 @@ ch_enlargebufs(EditLine *el, size_t addl /* zero the newly added memory, leave old data in */ (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer)); - + oldbuf = el->el_line.buffer; el->el_line.buffer = newbuffer; @@ -573,7 +577,7 @@ ch_enlargebufs(EditLine *el, size_t addl el->el_chared.c_redo.lim = newbuffer + (el->el_chared.c_redo.lim - el->el_chared.c_redo.buf); el->el_chared.c_redo.buf = newbuffer; - + if (!hist_enlargebuf(el, sz, newsz)) return 0; @@ -673,9 +677,9 @@ out: protected int c_gets(EditLine *el, Char *buf, const Char *prompt) { - Char ch; + wchar_t wch; ssize_t len; - Char *cp = el->el_line.buffer; + Char *cp = el->el_line.buffer, ch; if (prompt) { len = (ssize_t)Strlen(prompt); @@ -690,26 +694,28 @@ c_gets(EditLine *el, Char *buf, const Ch el->el_line.lastchar = cp + 1; re_refresh(el); - if (FUN(el,getc)(el, &ch) != 1) { + if (el_wgetc(el, &wch) != 1) { ed_end_of_file(el, 0); len = -1; break; } + ch = (Char)wch; switch (ch) { - case 0010: /* Delete and backspace */ + case L'\b': /* Delete and backspace */ case 0177: if (len == 0) { len = -1; break; } + len--; cp--; continue; case 0033: /* ESC */ - case '\r': /* Newline */ - case '\n': + case L'\r': /* Newline */ + case L'\n': buf[len] = ch; break; Modified: stable/11/lib/libedit/chared.h ============================================================================== --- stable/11/lib/libedit/chared.h Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/chared.h Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: chared.h,v 1.27 2016/02/16 22:53:14 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,11 +41,6 @@ #ifndef _h_el_chared #define _h_el_chared -#include -#include - -#include "histedit.h" - #define EL_MAXMACRO 10 /* @@ -140,24 +135,18 @@ typedef struct el_chared_t { #define MODE_REPLACE 1 #define MODE_REPLACE_1 2 -#include "common.h" -#include "vi.h" -#include "emacs.h" -#include "search.h" -#include "fcns.h" - -protected int cv__isword(Int); -protected int cv__isWord(Int); +protected int cv__isword(wint_t); +protected int cv__isWord(wint_t); protected void cv_delfini(EditLine *); -protected Char *cv__endword(Char *, Char *, int, int (*)(Int)); -protected int ce__isword(Int); +protected Char *cv__endword(Char *, Char *, int, int (*)(wint_t)); +protected int ce__isword(wint_t); protected void cv_undo(EditLine *); protected void cv_yank(EditLine *, const Char *, int); -protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int)); -protected Char *cv_prev_word(Char *, Char *, int, int (*)(Int)); -protected Char *c__next_word(Char *, Char *, int, int (*)(Int)); -protected Char *c__prev_word(Char *, Char *, int, int (*)(Int)); +protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(wint_t)); +protected Char *cv_prev_word(Char *, Char *, int, int (*)(wint_t)); +protected Char *c__next_word(Char *, Char *, int, int (*)(wint_t)); +protected Char *c__prev_word(Char *, Char *, int, int (*)(wint_t)); protected void c_insert(EditLine *, int); protected void c_delbefore(EditLine *, int); protected void c_delbefore1(EditLine *); Modified: stable/11/lib/libedit/chartype.c ============================================================================== --- stable/11/lib/libedit/chartype.c Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/chartype.c Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */ +/* $NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -31,13 +31,16 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $"); +__RCSID("$NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $"); #endif /* not lint && not SCCSID */ #include __FBSDID("$FreeBSD$"); -#include "el.h" +#include #include +#include + +#include "el.h" #define CT_BUFSIZ ((size_t)1024) @@ -68,7 +71,7 @@ ct_conv_wbuff_resize(ct_buffer_t *conv, { void *p; - if (wsize <= conv->wsize) + if (wsize <= conv->wsize) return 0; conv->wsize = wsize; @@ -206,6 +209,28 @@ ct_encode_char(char *dst, size_t len, Ch } return l; } + +size_t +ct_mbrtowc(wchar_t *wc, const char *s, size_t n) +{ + mbstate_t mbs; + /* This only works because UTF-8 is stateless */ + memset(&mbs, 0, sizeof(mbs)); + return mbrtowc(wc, s, n, &mbs); +} + +#else + +size_t +ct_mbrtowc(wchar_t *wc, const char *s, size_t n) + if (s == NULL) + return 0; + if (n == 0) + return (size_t)-2; + if (wc != NULL) + *wc = *s; + return *s != '\0'; +} #endif protected const Char * @@ -329,7 +354,7 @@ ct_visual_char(Char *dst, size_t len, Ch return c > 0xffff ? 8 : 7; #else *dst++ = '\\'; -#define tooctaldigit(v) ((v) + '0') +#define tooctaldigit(v) (Char)((v) + '0') *dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7); *dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7); *dst++ = tooctaldigit(((unsigned int) c ) & 0x7); Modified: stable/11/lib/libedit/chartype.h ============================================================================== --- stable/11/lib/libedit/chartype.h Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/chartype.h Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.25 2016/03/07 00:05:20 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -32,7 +32,6 @@ #define _h_chartype_f - #ifdef WIDECHAR /* Ideally we should also test the value of the define to see if it @@ -55,21 +54,19 @@ #warning Build environment does not support non-BMP characters #endif -#define ct_mbtowc mbtowc -#define ct_mbtowc_reset mbtowc(0,0,(size_t)0) +#define ct_wctob wctob #define ct_wctomb wctomb #define ct_wctomb_reset wctomb(0,0) #define ct_wcstombs wcstombs #define ct_mbstowcs mbstowcs #define Char wchar_t -#define Int wint_t #define FUN(prefix,rest) prefix ## _w ## rest #define FUNW(type) type ## _w #define TYPE(type) type ## W -#define FCHAR "%lc" #define FSTR "%ls" -#define STR(x) L ## x +#define FSTARSTR "%.*ls" +#define STR(x) L ## x #define UC(c) c #define Isalpha(x) iswalpha(x) #define Isalnum(x) iswalnum(x) @@ -110,21 +107,19 @@ Width(wchar_t c) #else /* NARROW */ -#define ct_mbtowc error -#define ct_mbtowc_reset +#define ct_wctob(w) ((int)(w)) #define ct_wctomb error -#define ct_wctomb_reset +#define ct_wctomb_reset #define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a)) #define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a)) #define Char char -#define Int int #define FUN(prefix,rest) prefix ## _ ## rest #define FUNW(type) type #define TYPE(type) type -#define FCHAR "%c" #define FSTR "%s" -#define STR(x) x +#define FSTARSTR "%.*s" +#define STR(x) x #define UC(c) (unsigned char)(c) #define Isalpha(x) isalpha((unsigned char)x) @@ -213,7 +208,7 @@ protected size_t ct_enc_width(Char); #define VISUAL_WIDTH_MAX ((size_t)8) /* The terminal is thought of in terms of X columns by Y lines. In the cases - * where a wide character takes up more than one column, the adjacent + * where a wide character takes up more than one column, the adjacent * occupied column entries will contain this faux character. */ #define MB_FILL_CHAR ((Char)-1) @@ -245,5 +240,7 @@ protected const Char *ct_visual_string(c protected int ct_chr_class(Char c); #endif +size_t ct_mbrtowc(wchar_t *, const char *, size_t); + #endif /* _chartype_f */ Modified: stable/11/lib/libedit/common.c ============================================================================== --- stable/11/lib/libedit/common.c Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/common.c Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $ */ +/* $NetBSD: common.c,v 1.40 2016/03/02 19:24:20 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $"); +__RCSID("$NetBSD: common.c,v 1.40 2016/03/02 19:24:20 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -46,7 +46,13 @@ __FBSDID("$FreeBSD$"); /* * common.c: Common Editor functions */ +#include +#include + #include "el.h" +#include "common.h" +#include "parse.h" +#include "vi.h" /* ed_end_of_file(): * Indicate end of file @@ -54,7 +60,7 @@ __FBSDID("$FreeBSD$"); */ protected el_action_t /*ARGSUSED*/ -ed_end_of_file(EditLine *el, Int c __attribute__((__unused__))) +ed_end_of_file(EditLine *el, wint_t c __attribute__((__unused__))) { re_goto_bottom(el); @@ -68,7 +74,7 @@ ed_end_of_file(EditLine *el, Int c __att * Insert a character [bound to all insert keys] */ protected el_action_t -ed_insert(EditLine *el, Int c) +ed_insert(EditLine *el, wint_t c) { int count = el->el_state.argument; @@ -87,14 +93,14 @@ ed_insert(EditLine *el, Int c) || el->el_line.cursor >= el->el_line.lastchar) c_insert(el, 1); - *el->el_line.cursor++ = c; + *el->el_line.cursor++ = (Char)c; re_fastaddc(el); /* fast refresh for one char. */ } else { if (el->el_state.inputmode != MODE_REPLACE_1) c_insert(el, el->el_state.argument); while (count-- && el->el_line.cursor < el->el_line.lastchar) - *el->el_line.cursor++ = c; + *el->el_line.cursor++ = (Char)c; re_refresh(el); } @@ -111,7 +117,7 @@ ed_insert(EditLine *el, Int c) */ protected el_action_t /*ARGSUSED*/ -ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__))) +ed_delete_prev_word(EditLine *el, wint_t c __attribute__((__unused__))) { Char *cp, *p, *kp; @@ -139,12 +145,13 @@ ed_delete_prev_word(EditLine *el, Int c */ protected el_action_t /*ARGSUSED*/ -ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__))) +ed_delete_next_char(EditLine *el, wint_t c __attribute__((__unused__))) { #ifdef DEBUG_EDIT #define EL el->el_line - (void) fprintf(el->el_errlfile, - "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n", + (void) fprintf(el->el_errfile, + "\nD(b: %p(" FSTR ") c: %p(" FSTR ") last: %p(" FSTR + ") limit: %p(" FSTR ")\n", EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar, EL.lastchar, EL.limit, EL.limit); #endif @@ -186,7 +193,7 @@ ed_delete_next_char(EditLine *el, Int c */ protected el_action_t /*ARGSUSED*/ -ed_kill_line(EditLine *el, Int c __attribute__((__unused__))) +ed_kill_line(EditLine *el, wint_t c __attribute__((__unused__))) { Char *kp, *cp; @@ -207,7 +214,7 @@ ed_kill_line(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_move_to_end(EditLine *el, Int c __attribute__((__unused__))) +ed_move_to_end(EditLine *el, wint_t c __attribute__((__unused__))) { el->el_line.cursor = el->el_line.lastchar; @@ -230,7 +237,7 @@ ed_move_to_end(EditLine *el, Int c __att */ protected el_action_t /*ARGSUSED*/ -ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__))) +ed_move_to_beg(EditLine *el, wint_t c __attribute__((__unused__))) { el->el_line.cursor = el->el_line.buffer; @@ -253,7 +260,7 @@ ed_move_to_beg(EditLine *el, Int c __att * [^T] [^T] */ protected el_action_t -ed_transpose_chars(EditLine *el, Int c) +ed_transpose_chars(EditLine *el, wint_t c) { if (el->el_line.cursor < el->el_line.lastchar) { @@ -266,7 +273,7 @@ ed_transpose_chars(EditLine *el, Int c) /* must have at least two chars entered */ c = el->el_line.cursor[-2]; el->el_line.cursor[-2] = el->el_line.cursor[-1]; - el->el_line.cursor[-1] = c; + el->el_line.cursor[-1] = (Char)c; return CC_REFRESH; } else return CC_ERROR; @@ -279,7 +286,7 @@ ed_transpose_chars(EditLine *el, Int c) */ protected el_action_t /*ARGSUSED*/ -ed_next_char(EditLine *el, Int c __attribute__((__unused__))) +ed_next_char(EditLine *el, wint_t c __attribute__((__unused__))) { Char *lim = el->el_line.lastchar; @@ -308,7 +315,7 @@ ed_next_char(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_prev_word(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_word(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor == el->el_line.buffer) @@ -334,7 +341,7 @@ ed_prev_word(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_prev_char(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_char(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor > el->el_line.buffer) { @@ -358,14 +365,12 @@ ed_prev_char(EditLine *el, Int c __attri * [^V] [^V] */ protected el_action_t -ed_quoted_insert(EditLine *el, Int c) +ed_quoted_insert(EditLine *el, wint_t c) { int num; - Char tc; tty_quotemode(el); - num = FUN(el,getc)(el, &tc); - c = tc; + num = el_wgetc(el, &c); tty_noquotemode(el); if (num == 1) return ed_insert(el, c); @@ -378,7 +383,7 @@ ed_quoted_insert(EditLine *el, Int c) * Adds to argument or enters a digit */ protected el_action_t -ed_digit(EditLine *el, Int c) +ed_digit(EditLine *el, wint_t c) { if (!Isdigit(c)) @@ -406,7 +411,7 @@ ed_digit(EditLine *el, Int c) * For ESC-n */ protected el_action_t -ed_argument_digit(EditLine *el, Int c) +ed_argument_digit(EditLine *el, wint_t c) { if (!Isdigit(c)) @@ -432,7 +437,7 @@ ed_argument_digit(EditLine *el, Int c) protected el_action_t /*ARGSUSED*/ ed_unassigned(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) + wint_t c __attribute__((__unused__))) { return CC_ERROR; @@ -449,8 +454,8 @@ ed_unassigned(EditLine *el __attribute__ */ protected el_action_t /*ARGSUSED*/ -ed_tty_sigint(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_sigint(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -463,8 +468,8 @@ ed_tty_sigint(EditLine *el __attribute__ */ protected el_action_t /*ARGSUSED*/ -ed_tty_dsusp(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_dsusp(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -477,8 +482,8 @@ ed_tty_dsusp(EditLine *el __attribute__( */ protected el_action_t /*ARGSUSED*/ -ed_tty_flush_output(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_flush_output(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -491,8 +496,8 @@ ed_tty_flush_output(EditLine *el __attri */ protected el_action_t /*ARGSUSED*/ -ed_tty_sigquit(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_sigquit(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -505,8 +510,8 @@ ed_tty_sigquit(EditLine *el __attribute_ */ protected el_action_t /*ARGSUSED*/ -ed_tty_sigtstp(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_sigtstp(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -519,8 +524,8 @@ ed_tty_sigtstp(EditLine *el __attribute_ */ protected el_action_t /*ARGSUSED*/ -ed_tty_stop_output(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_stop_output(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -533,8 +538,8 @@ ed_tty_stop_output(EditLine *el __attrib */ protected el_action_t /*ARGSUSED*/ -ed_tty_start_output(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_tty_start_output(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -547,7 +552,7 @@ ed_tty_start_output(EditLine *el __attri */ protected el_action_t /*ARGSUSED*/ -ed_newline(EditLine *el, Int c __attribute__((__unused__))) +ed_newline(EditLine *el, wint_t c __attribute__((__unused__))) { re_goto_bottom(el); @@ -563,7 +568,7 @@ ed_newline(EditLine *el, Int c __attribu */ protected el_action_t /*ARGSUSED*/ -ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__))) +ed_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__))) { if (el->el_line.cursor <= el->el_line.buffer) @@ -583,7 +588,7 @@ ed_delete_prev_char(EditLine *el, Int c */ protected el_action_t /*ARGSUSED*/ -ed_clear_screen(EditLine *el, Int c __attribute__((__unused__))) +ed_clear_screen(EditLine *el, wint_t c __attribute__((__unused__))) { terminal_clear_screen(el); /* clear the whole real screen */ @@ -598,8 +603,8 @@ ed_clear_screen(EditLine *el, Int c __at */ protected el_action_t /*ARGSUSED*/ -ed_redisplay(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_redisplay(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_REDISPLAY; @@ -612,7 +617,7 @@ ed_redisplay(EditLine *el __attribute__( */ protected el_action_t /*ARGSUSED*/ -ed_start_over(EditLine *el, Int c __attribute__((__unused__))) +ed_start_over(EditLine *el, wint_t c __attribute__((__unused__))) { ch_reset(el, 0); @@ -626,8 +631,8 @@ ed_start_over(EditLine *el, Int c __attr */ protected el_action_t /*ARGSUSED*/ -ed_sequence_lead_in(EditLine *el __attribute__((__unused__)), - Int c __attribute__((__unused__))) +ed_sequence_lead_in(EditLine *el __attribute__((__unused__)), + wint_t c __attribute__((__unused__))) { return CC_NORM; @@ -640,7 +645,7 @@ ed_sequence_lead_in(EditLine *el __attri */ protected el_action_t /*ARGSUSED*/ -ed_prev_history(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_history(EditLine *el, wint_t c __attribute__((__unused__))) { char beep = 0; int sv_event = el->el_history.eventno; @@ -660,7 +665,6 @@ ed_prev_history(EditLine *el, Int c __at if (hist_get(el) == CC_ERROR) { if (el->el_map.type == MAP_VI) { el->el_history.eventno = sv_event; - } beep = 1; /* el->el_history.eventno was fixed by first call */ @@ -678,7 +682,7 @@ ed_prev_history(EditLine *el, Int c __at */ protected el_action_t /*ARGSUSED*/ -ed_next_history(EditLine *el, Int c __attribute__((__unused__))) +ed_next_history(EditLine *el, wint_t c __attribute__((__unused__))) { el_action_t beep = CC_REFRESH, rval; @@ -705,11 +709,11 @@ ed_next_history(EditLine *el, Int c __at */ protected el_action_t /*ARGSUSED*/ -ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__))) +ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__))) { const Char *hp; int h; - bool_t found = 0; + int found = 0; el->el_chared.c_vcmd.action = NOP; el->el_chared.c_undo.len = -1; @@ -748,7 +752,7 @@ ed_search_prev_history(EditLine *el, Int (el->el_line.lastchar - el->el_line.buffer)) || hp[el->el_line.lastchar - el->el_line.buffer]) && c_hmatch(el, hp)) { - found++; + found = 1; break; } h++; @@ -773,11 +777,11 @@ ed_search_prev_history(EditLine *el, Int */ protected el_action_t /*ARGSUSED*/ -ed_search_next_history(EditLine *el, Int c __attribute__((__unused__))) +ed_search_next_history(EditLine *el, wint_t c __attribute__((__unused__))) { const Char *hp; int h; - bool_t found = 0; + int found = 0; el->el_chared.c_vcmd.action = NOP; el->el_chared.c_undo.len = -1; @@ -827,7 +831,7 @@ ed_search_next_history(EditLine *el, Int */ protected el_action_t /*ARGSUSED*/ -ed_prev_line(EditLine *el, Int c __attribute__((__unused__))) +ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__))) { Char *ptr; int nchars = c_hpos(el); @@ -870,7 +874,7 @@ ed_prev_line(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_next_line(EditLine *el, Int c __attribute__((__unused__))) +ed_next_line(EditLine *el, wint_t c __attribute__((__unused__))) { Char *ptr; int nchars = c_hpos(el); @@ -904,7 +908,7 @@ ed_next_line(EditLine *el, Int c __attri */ protected el_action_t /*ARGSUSED*/ -ed_command(EditLine *el, Int c __attribute__((__unused__))) +ed_command(EditLine *el, wint_t c __attribute__((__unused__))) { Char tmpbuf[EL_BUFSIZ]; int tmplen; Modified: stable/11/lib/libedit/config.h ============================================================================== --- stable/11/lib/libedit/config.h Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/config.h Mon Feb 20 03:33:59 2017 (r313981) @@ -21,8 +21,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if you have the `fgetln' function. */ -#define HAVE_FGETLN 1 +/* Define to 1 if you have the `getline' function. */ +#define HAVE_GETLINE 1 /* Define to 1 if you have the `fork' function. */ #define HAVE_FORK 1 @@ -188,9 +188,6 @@ /* Define to 1 if you have the `vis' function. */ #define HAVE_VIS 1 -/* Define to 1 if you have the `wcsdup' function. */ -#define HAVE_WCSDUP 1 - /* Define to 1 if `fork' works. */ #define HAVE_WORKING_FORK 1 @@ -257,6 +254,9 @@ /* Version number of package */ #define VERSION "3.0" +/* Define to 1 if the system provides the SIZE_MAX constant */ +#define HAVE_SIZE_MAX 1 + /* Define to 1 if you want wide-character code */ /* #undef WIDECHAR */ Modified: stable/11/lib/libedit/edit/readline/readline.h ============================================================================== --- stable/11/lib/libedit/edit/readline/readline.h Mon Feb 20 03:26:19 2017 (r313980) +++ stable/11/lib/libedit/edit/readline/readline.h Mon Feb 20 03:33:59 2017 (r313981) @@ -1,4 +1,4 @@ -/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */ +/* $NetBSD: readline.h,v 1.39 2016/02/17 19:47:49 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ typedef void *histdata_t; typedef struct _hist_entry { const char *line; - histdata_t data; + histdata_t data; } HIST_ENTRY; typedef struct _keymap_entry { @@ -89,7 +89,7 @@ typedef KEYMAP_ENTRY *Keymap; #define RUBOUT 0x7f #define ABORT_CHAR CTRL('G') -#define RL_READLINE_VERSION 0x0402 +#define RL_READLINE_VERSION 0x0402 #define RL_PROMPT_START_IGNORE '\1' #define RL_PROMPT_END_IGNORE '\2' @@ -98,7 +98,7 @@ typedef KEYMAP_ENTRY *Keymap; extern "C" { #endif extern const char *rl_library_version; -extern int rl_readline_version; +extern int rl_readline_version; extern char *rl_readline_name; extern FILE *rl_instream; extern FILE *rl_outstream; @@ -199,10 +199,10 @@ int rl_add_defun(const char *, rl_comm HISTORY_STATE *history_get_history_state(void); void rl_get_screen_size(int *, int *); void rl_set_screen_size(int, int); -char *rl_filename_completion_function (const char *, int); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Mon Feb 20 10:44:25 2017 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 B2693CE5FA9; Mon, 20 Feb 2017 10:44:25 +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 8A67E1531; Mon, 20 Feb 2017 10:44:25 +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 v1KAiOXH029387; Mon, 20 Feb 2017 10:44:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1KAiOXd029384; Mon, 20 Feb 2017 10:44:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702201044.v1KAiOXd029384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Feb 2017 10:44: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: r313989 - in stable/11/sys: arm/include arm64/include 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.23 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, 20 Feb 2017 10:44:25 -0000 Author: kib Date: Mon Feb 20 10:44:24 2017 New Revision: 313989 URL: https://svnweb.freebsd.org/changeset/base/313989 Log: MFC r313345: Update arm and arm64 counters MD bits. MFC r313394 (by manu): subr_sfbus.c need sys/proc.h for struct thread definition. Modified: stable/11/sys/arm/include/counter.h stable/11/sys/arm64/include/counter.h stable/11/sys/kern/subr_sfbuf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/counter.h ============================================================================== --- stable/11/sys/arm/include/counter.h Mon Feb 20 08:10:41 2017 (r313988) +++ stable/11/sys/arm/include/counter.h Mon Feb 20 10:44:24 2017 (r313989) @@ -31,12 +31,9 @@ #include #include -#ifdef INVARIANTS -#include -#endif -#define counter_enter() critical_enter() -#define counter_exit() critical_exit() +#define counter_enter() do {} while (0) +#define counter_exit() do {} while (0) #ifdef IN_SUBR_COUNTER_C @@ -55,7 +52,7 @@ counter_u64_fetch_inline(uint64_t *p) int i; r = 0; - for (i = 0; i < mp_ncpus; i++) + CPU_FOREACH(i) r += counter_u64_read_one((uint64_t *)p, i); return (r); @@ -78,18 +75,13 @@ counter_u64_zero_inline(counter_u64_t c) } #endif -#define counter_u64_add_protected(c, inc) do { \ - CRITICAL_ASSERT(curthread); \ - atomic_add_64((uint64_t *)zpcpu_get(c), (inc)); \ -} while (0) +#define counter_u64_add_protected(c, inc) counter_u64_add(c, inc) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - counter_enter(); - counter_u64_add_protected(c, inc); - counter_exit(); + atomic_add_64((uint64_t *)zpcpu_get(c), inc); } #endif /* ! __MACHINE_COUNTER_H__ */ Modified: stable/11/sys/arm64/include/counter.h ============================================================================== --- stable/11/sys/arm64/include/counter.h Mon Feb 20 08:10:41 2017 (r313988) +++ stable/11/sys/arm64/include/counter.h Mon Feb 20 10:44:24 2017 (r313989) @@ -30,12 +30,10 @@ #define _MACHINE_COUNTER_H_ #include -#ifdef INVARIANTS -#include -#endif +#include -#define counter_enter() critical_enter() -#define counter_exit() critical_exit() +#define counter_enter() do {} while (0) +#define counter_exit() do {} while (0) #ifdef IN_SUBR_COUNTER_C static inline uint64_t @@ -52,13 +50,12 @@ counter_u64_fetch_inline(uint64_t *p) int i; r = 0; - for (i = 0; i < mp_ncpus; i++) + CPU_FOREACH(i) r += counter_u64_read_one((uint64_t *)p, i); return (r); } -/* XXXKIB might interrupt increment */ static void counter_u64_zero_one_cpu(void *arg) { @@ -76,18 +73,13 @@ counter_u64_zero_inline(counter_u64_t c) } #endif -#define counter_u64_add_protected(c, inc) do { \ - CRITICAL_ASSERT(curthread); \ - *(uint64_t *)zpcpu_get(c) += (inc); \ -} while (0) +#define counter_u64_add_protected(c, inc) counter_u64_add(c, inc) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - counter_enter(); - counter_u64_add_protected(c, inc); - counter_exit(); + atomic_add_64((uint64_t *)zpcpu_get(c), inc); } #endif /* ! _MACHINE_COUNTER_H_ */ Modified: stable/11/sys/kern/subr_sfbuf.c ============================================================================== --- stable/11/sys/kern/subr_sfbuf.c Mon Feb 20 08:10:41 2017 (r313988) +++ stable/11/sys/kern/subr_sfbuf.c Mon Feb 20 10:44:24 2017 (r313989) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-stable-11@freebsd.org Mon Feb 20 10:49:05 2017 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 EA2E1CE6065; Mon, 20 Feb 2017 10:49: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 C24371743; Mon, 20 Feb 2017 10:49: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 v1KAn423029601; Mon, 20 Feb 2017 10:49:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1KAn43c029600; Mon, 20 Feb 2017 10:49:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702201049.v1KAn43c029600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Feb 2017 10:49: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: r313990 - 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.23 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, 20 Feb 2017 10:49:06 -0000 Author: kib Date: Mon Feb 20 10:49:04 2017 New Revision: 313990 URL: https://svnweb.freebsd.org/changeset/base/313990 Log: MFC r313693: Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers. Modified: stable/11/sys/vm/vm_mmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_mmap.c ============================================================================== --- stable/11/sys/vm/vm_mmap.c Mon Feb 20 10:44:24 2017 (r313989) +++ stable/11/sys/vm/vm_mmap.c Mon Feb 20 10:49:04 2017 (r313990) @@ -106,14 +106,8 @@ struct sbrk_args { }; #endif -/* - * MPSAFE - */ -/* ARGSUSED */ int -sys_sbrk(td, uap) - struct thread *td; - struct sbrk_args *uap; +sys_sbrk(struct thread *td, struct sbrk_args *uap) { /* Not yet implemented */ return (EOPNOTSUPP); @@ -125,14 +119,8 @@ struct sstk_args { }; #endif -/* - * MPSAFE - */ -/* ARGSUSED */ int -sys_sstk(td, uap) - struct thread *td; - struct sstk_args *uap; +sys_sstk(struct thread *td, struct sstk_args *uap) { /* Not yet implemented */ return (EOPNOTSUPP); @@ -146,11 +134,9 @@ struct getpagesize_args { #endif int -ogetpagesize(td, uap) - struct thread *td; - struct getpagesize_args *uap; +ogetpagesize(struct thread *td, struct getpagesize_args *uap) { - /* MP SAFE */ + td->td_retval[0] = PAGE_SIZE; return (0); } @@ -182,9 +168,6 @@ struct mmap_args { }; #endif -/* - * MPSAFE - */ int sys_mmap(td, uap) struct thread *td; @@ -458,9 +441,6 @@ struct msync_args { int flags; }; #endif -/* - * MPSAFE - */ int sys_msync(td, uap) struct thread *td; @@ -513,9 +493,6 @@ struct munmap_args { size_t len; }; #endif -/* - * MPSAFE - */ int sys_munmap(td, uap) struct thread *td; @@ -589,9 +566,6 @@ struct mprotect_args { int prot; }; #endif -/* - * MPSAFE - */ int sys_mprotect(td, uap) struct thread *td; @@ -631,13 +605,8 @@ struct minherit_args { int inherit; }; #endif -/* - * MPSAFE - */ int -sys_minherit(td, uap) - struct thread *td; - struct minherit_args *uap; +sys_minherit(struct thread *td, struct minherit_args *uap) { vm_offset_t addr; vm_size_t size, pageoff; @@ -672,13 +641,8 @@ struct madvise_args { }; #endif -/* - * MPSAFE - */ int -sys_madvise(td, uap) - struct thread *td; - struct madvise_args *uap; +sys_madvise(struct thread *td, struct madvise_args *uap) { vm_offset_t start, end; vm_map_t map; @@ -730,13 +694,8 @@ struct mincore_args { }; #endif -/* - * MPSAFE - */ int -sys_mincore(td, uap) - struct thread *td; - struct mincore_args *uap; +sys_mincore(struct thread *td, struct mincore_args *uap) { vm_offset_t addr, first_addr; vm_offset_t end, cend; @@ -989,13 +948,8 @@ struct mlock_args { size_t len; }; #endif -/* - * MPSAFE - */ int -sys_mlock(td, uap) - struct thread *td; - struct mlock_args *uap; +sys_mlock(struct thread *td, struct mlock_args *uap) { return (vm_mlock(td->td_proc, td->td_ucred, uap->addr, uap->len)); @@ -1061,13 +1015,8 @@ struct mlockall_args { }; #endif -/* - * MPSAFE - */ int -sys_mlockall(td, uap) - struct thread *td; - struct mlockall_args *uap; +sys_mlockall(struct thread *td, struct mlockall_args *uap) { vm_map_t map; int error; @@ -1138,13 +1087,8 @@ struct munlockall_args { }; #endif -/* - * MPSAFE - */ int -sys_munlockall(td, uap) - struct thread *td; - struct munlockall_args *uap; +sys_munlockall(struct thread *td, struct munlockall_args *uap) { vm_map_t map; int error; @@ -1179,9 +1123,6 @@ struct munlock_args { size_t len; }; #endif -/* - * MPSAFE - */ int sys_munlock(td, uap) struct thread *td; @@ -1332,8 +1273,6 @@ done: /* * vm_mmap_cdev() * - * MPSAFE - * * Helper function for vm_mmap. Perform sanity check specific for mmap * operations on cdevs. */ From owner-svn-src-stable-11@freebsd.org Mon Feb 20 20:12:03 2017 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 AE400CE6368; Mon, 20 Feb 2017 20:12:03 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E8210BE; Mon, 20 Feb 2017 20:12:03 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1KKC2gX062012; Mon, 20 Feb 2017 20:12:02 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1KKC2ZG062011; Mon, 20 Feb 2017 20:12:02 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201702202012.v1KKC2ZG062011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 20 Feb 2017 20:12:02 +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: r313997 - stable/11/sys/cam/ctl 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.23 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, 20 Feb 2017 20:12:03 -0000 Author: ken Date: Mon Feb 20 20:12:02 2017 New Revision: 313997 URL: https://svnweb.freebsd.org/changeset/base/313997 Log: MFC 313895: ------------------------------------------------------------------------ r313895 | ken | 2017-02-17 13:15:27 -0700 (Fri, 17 Feb 2017) | 9 lines Make ctl(4) build with CTL_IO_DELAY defined. sys/cam/ctl/ctl.c: In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill it in before trying to dereference it. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Mon Feb 20 19:08:36 2017 (r313996) +++ stable/11/sys/cam/ctl/ctl.c Mon Feb 20 20:12:02 2017 (r313997) @@ -12402,6 +12402,9 @@ ctl_datamove(union ctl_io *io) if (io->io_hdr.flags & CTL_FLAG_DELAY_DONE) { io->io_hdr.flags &= ~CTL_FLAG_DELAY_DONE; } else { + struct ctl_lun *lun; + + lun = CTL_LUN(io); if ((lun != NULL) && (lun->delay_info.datamove_delay > 0)) { From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:10:03 2017 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 88F3BCE766E; Tue, 21 Feb 2017 02:10:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57F9017D6; Tue, 21 Feb 2017 02:10:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2A2MY007589; Tue, 21 Feb 2017 02:10:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2A2RI007588; Tue, 21 Feb 2017 02:10:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201702210210.v1L2A2RI007588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 21 Feb 2017 02:10:02 +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: r314002 - stable/11/sys/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.23 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, 21 Feb 2017 02:10:03 -0000 Author: sephe Date: Tue Feb 21 02:10:02 2017 New Revision: 314002 URL: https://svnweb.freebsd.org/changeset/base/314002 Log: MFC 311475 if: Defer the if_up until the ifnet.if_ioctl is called. This ensures the interface is initialized by the interface driver before it can be used by the rest of the system. Reviewed by: jhb, karels, gnn Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8905 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Tue Feb 21 01:11:18 2017 (r314001) +++ stable/11/sys/net/if.c Tue Feb 21 02:10:02 2017 (r314002) @@ -2300,7 +2300,7 @@ static int ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) { struct ifreq *ifr; - int error = 0; + int error = 0, do_ifup = 0; int new_flags, temp_flags; size_t namelen, onamelen; size_t descrlen; @@ -2427,7 +2427,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, if_down(ifp); } else if (new_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) { - if_up(ifp); + do_ifup = 1; } /* See if permanently promiscuous mode bit is about to flip */ if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) { @@ -2446,6 +2446,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, if (ifp->if_ioctl) { (void) (*ifp->if_ioctl)(ifp, cmd, data); } + if (do_ifup) + if_up(ifp); getmicrotime(&ifp->if_lastchange); break; From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:16:00 2017 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 BCA65CE7949; Tue, 21 Feb 2017 02:16:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1921CD3; Tue, 21 Feb 2017 02:16:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2FxTU011580; Tue, 21 Feb 2017 02:15:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2FxeT011575; Tue, 21 Feb 2017 02:15:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201702210215.v1L2FxeT011575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 21 Feb 2017 02:15: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: r314003 - in stable/11/sys/dev/hyperv: include utilities vmbus vmbus/amd64 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.23 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, 21 Feb 2017 02:16:00 -0000 Author: sephe Date: Tue Feb 21 02:15:58 2017 New Revision: 314003 URL: https://svnweb.freebsd.org/changeset/base/314003 Log: MFC 311743 hyperv: Add method to read 64bit Hyper-V specific time value. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9057 Modified: stable/11/sys/dev/hyperv/include/hyperv.h stable/11/sys/dev/hyperv/utilities/vmbus_timesync.c stable/11/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c stable/11/sys/dev/hyperv/vmbus/hyperv.c stable/11/sys/dev/hyperv/vmbus/vmbus_et.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/11/sys/dev/hyperv/include/hyperv.h Tue Feb 21 02:10:02 2017 (r314002) +++ stable/11/sys/dev/hyperv/include/hyperv.h Tue Feb 21 02:15:58 2017 (r314003) @@ -79,9 +79,17 @@ struct hyperv_guid { #define HYPERV_GUID_STRLEN 40 -int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); +typedef uint64_t (*hyperv_tc64_t)(void); -extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +int hyperv_guid2str(const struct hyperv_guid *, char *, + size_t); + +/* + * hyperv_tc64 could be NULL, if there were no suitable Hyper-V + * specific timecounter. + */ +extern hyperv_tc64_t hyperv_tc64; +extern u_int hyperv_features; /* CPUID_HV_MSR_ */ #endif /* _KERNEL */ Modified: stable/11/sys/dev/hyperv/utilities/vmbus_timesync.c ============================================================================== --- stable/11/sys/dev/hyperv/utilities/vmbus_timesync.c Tue Feb 21 02:10:02 2017 (r314002) +++ stable/11/sys/dev/hyperv/utilities/vmbus_timesync.c Tue Feb 21 02:15:58 2017 (r314003) @@ -52,8 +52,7 @@ __FBSDID("$FreeBSD$"); VMBUS_ICVER_LE(VMBUS_IC_VERSION(4, 0), (sc)->ic_msgver) #define VMBUS_TIMESYNC_DORTT(sc) \ - (VMBUS_TIMESYNC_MSGVER4((sc)) &&\ - (hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) + (VMBUS_TIMESYNC_MSGVER4((sc)) && hyperv_tc64 != NULL) static int vmbus_timesync_probe(device_t); static int vmbus_timesync_attach(device_t); @@ -117,7 +116,7 @@ vmbus_timesync(struct vmbus_ic_softc *sc uint64_t hv_ns, vm_ns, rtt = 0; if (VMBUS_TIMESYNC_DORTT(sc)) - rtt = rdmsr(MSR_HV_TIME_REF_COUNT) - sent_tc; + rtt = hyperv_tc64() - sent_tc; hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE + rtt) * HYPERV_TIMER_NS_FACTOR; nanotime(&vm_ts); Modified: stable/11/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Tue Feb 21 02:10:02 2017 (r314002) +++ stable/11/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Tue Feb 21 02:15:58 2017 (r314003) @@ -133,8 +133,8 @@ hyperv_tsc_vdso_timehands(struct vdso_ti } #define HYPERV_TSC_TIMECOUNT(fence) \ -static u_int \ -hyperv_tsc_timecount_##fence(struct timecounter *tc) \ +static uint64_t \ +hyperv_tc64_tsc_##fence(void) \ { \ struct hyperv_reftsc *tsc_ref = hyperv_ref_tsc.tsc_ref; \ uint32_t seq; \ @@ -162,6 +162,13 @@ hyperv_tsc_timecount_##fence(struct time /* Fallback to the generic timecounter, i.e. rdmsr. */ \ return (rdmsr(MSR_HV_TIME_REF_COUNT)); \ } \ + \ +static u_int \ +hyperv_tsc_timecount_##fence(struct timecounter *tc __unused) \ +{ \ + \ + return (hyperv_tc64_tsc_##fence()); \ +} \ struct __hack HYPERV_TSC_TIMECOUNT(lfence); @@ -170,6 +177,7 @@ HYPERV_TSC_TIMECOUNT(mfence); static void hyperv_tsc_tcinit(void *dummy __unused) { + hyperv_tc64_t tc64 = NULL; uint64_t val, orig; if ((hyperv_features & @@ -182,11 +190,13 @@ hyperv_tsc_tcinit(void *dummy __unused) case CPU_VENDOR_AMD: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_mfence; + tc64 = hyperv_tc64_tsc_mfence; break; case CPU_VENDOR_INTEL: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_lfence; + tc64 = hyperv_tc64_tsc_lfence; break; default: @@ -211,6 +221,10 @@ hyperv_tsc_tcinit(void *dummy __unused) /* Register "enlightened" timecounter. */ tc_init(&hyperv_tsc_timecounter); + /* Install 64 bits timecounter method for other modules to use. */ + KASSERT(tc64 != NULL, ("tc64 is not set")); + hyperv_tc64 = tc64; + /* Add device for mmap(2). */ make_dev(&hyperv_tsc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0444, HYPERV_REFTSC_DEVNAME); Modified: stable/11/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/hyperv.c Tue Feb 21 02:10:02 2017 (r314002) +++ stable/11/sys/dev/hyperv/vmbus/hyperv.c Tue Feb 21 02:15:58 2017 (r314003) @@ -77,6 +77,8 @@ u_int hyperv_recommends; static u_int hyperv_pm_features; static u_int hyperv_features3; +hyperv_tc64_t hyperv_tc64; + static struct timecounter hyperv_timecounter = { .tc_get_timecount = hyperv_get_timecount, .tc_poll_pps = NULL, @@ -96,6 +98,13 @@ hyperv_get_timecount(struct timecounter return rdmsr(MSR_HV_TIME_REF_COUNT); } +static uint64_t +hyperv_tc64_rdmsr(void) +{ + + return (rdmsr(MSR_HV_TIME_REF_COUNT)); +} + uint64_t hypercall_post_message(bus_addr_t msg_paddr) { @@ -232,6 +241,12 @@ hyperv_init(void *dummy __unused) if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { /* Register Hyper-V timecounter */ tc_init(&hyperv_timecounter); + + /* + * Install 64 bits timecounter method for other modules + * to use. + */ + hyperv_tc64 = hyperv_tc64_rdmsr; } } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, Modified: stable/11/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus_et.c Tue Feb 21 02:10:02 2017 (r314002) +++ stable/11/sys/dev/hyperv/vmbus/vmbus_et.c Tue Feb 21 02:15:58 2017 (r314003) @@ -48,13 +48,10 @@ __FBSDID("$FreeBSD$"); MSR_HV_STIMER_CFG_SINT_MASK) /* - * Two additionally required features: + * Additionally required feature: * - SynIC is needed for interrupt generation. - * - Time reference counter is needed to set ABS reference count to - * STIMER0_COUNT. */ -#define CPUID_HV_ET_MASK (CPUID_HV_MSR_TIME_REFCNT | \ - CPUID_HV_MSR_SYNIC | \ +#define CPUID_HV_ET_MASK (CPUID_HV_MSR_SYNIC | \ CPUID_HV_MSR_SYNTIMER) static void vmbus_et_identify(driver_t *, device_t); @@ -102,7 +99,7 @@ vmbus_et_start(struct eventtimer *et __u { uint64_t current; - current = rdmsr(MSR_HV_TIME_REF_COUNT); + current = hyperv_tc64(); current += hyperv_sbintime2count(first); wrmsr(MSR_HV_STIMER0_COUNT, current); @@ -131,7 +128,8 @@ vmbus_et_identify(driver_t *driver, devi { if (device_get_unit(parent) != 0 || device_find_child(parent, VMBUS_ET_NAME, -1) != NULL || - (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) + (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK || + hyperv_tc64 == NULL) return; device_add_child(parent, VMBUS_ET_NAME, -1); @@ -187,9 +185,8 @@ vmbus_et_attach(device_t dev) vmbus_et.et_start = vmbus_et_start; /* - * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will - * not return 0, since writing 0 to STIMER0_COUNT will disable - * STIMER0. + * Delay a bit to make sure that hyperv_tc64 will not return 0, + * since writing 0 to STIMER0_COUNT will disable STIMER0. */ DELAY(100); smp_rendezvous(NULL, vmbus_et_config, NULL, NULL); From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:19:20 2017 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 AC087CE7B4B; Tue, 21 Feb 2017 02:19:20 +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 869661055; Tue, 21 Feb 2017 02:19:20 +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 v1L2JJwa011834; Tue, 21 Feb 2017 02:19:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2JJto011830; Tue, 21 Feb 2017 02:19:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201702210219.v1L2JJto011830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 21 Feb 2017 02:19: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: r314005 - in stable/11: share/man/man4 sys/dev/alc sys/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.23 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, 21 Feb 2017 02:19:20 -0000 Author: sephe Date: Tue Feb 21 02:19:19 2017 New Revision: 314005 URL: https://svnweb.freebsd.org/changeset/base/314005 Log: MFC 312250 alc: Add Killer E2500 support Reviewed by: jhb, yongari Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9058 Modified: stable/11/share/man/man4/alc.4 stable/11/sys/dev/alc/if_alc.c stable/11/sys/dev/alc/if_alcreg.h stable/11/sys/dev/pci/pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/alc.4 ============================================================================== --- stable/11/share/man/man4/alc.4 Tue Feb 21 02:18:45 2017 (r314004) +++ stable/11/share/man/man4/alc.4 Tue Feb 21 02:19:19 2017 (r314005) @@ -124,6 +124,8 @@ Atheros AR8172 PCI Express Fast Ethernet Killer E2200 Gigabit Ethernet controller .It Killer E2400 Gigabit Ethernet controller +.It +Killer E2500 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the Modified: stable/11/sys/dev/alc/if_alc.c ============================================================================== --- stable/11/sys/dev/alc/if_alc.c Tue Feb 21 02:18:45 2017 (r314004) +++ stable/11/sys/dev/alc/if_alc.c Tue Feb 21 02:19:19 2017 (r314005) @@ -123,6 +123,8 @@ static struct alc_ident alc_ident_table[ "Killer E2200 Gigabit Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, "Killer E2400 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2500, 9 * 1024, + "Killer E2500 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -1083,6 +1085,7 @@ alc_phy_down(struct alc_softc *sc) case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_E2400: + case DEVICEID_ATHEROS_E2500: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1402,6 +1405,7 @@ alc_attach(device_t dev) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_E2400: + case DEVICEID_ATHEROS_E2500: sc->alc_flags |= ALC_FLAG_E2X00; /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: @@ -1480,7 +1484,8 @@ alc_attach(device_t dev) if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; /* - * Force maximum payload size to 128 bytes for E2200/E2400. + * Force maximum payload size to 128 bytes for + * E2200/E2400/E2500. * Otherwise it triggers DMA write error. */ if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) Modified: stable/11/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/11/sys/dev/alc/if_alcreg.h Tue Feb 21 02:18:45 2017 (r314004) +++ stable/11/sys/dev/alc/if_alcreg.h Tue Feb 21 02:19:19 2017 (r314005) @@ -50,6 +50,7 @@ #define DEVICEID_ATHEROS_AR8172 0x10A0 #define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_E2400 0xE0A1 +#define DEVICEID_ATHEROS_E2500 0xE0B1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: stable/11/sys/dev/pci/pci.c ============================================================================== --- stable/11/sys/dev/pci/pci.c Tue Feb 21 02:18:45 2017 (r314004) +++ stable/11/sys/dev/pci/pci.c Tue Feb 21 02:19:19 2017 (r314005) @@ -281,13 +281,14 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a - * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * Atheros AR8161/AR8162/E2200/E2400/E2500 Ethernet controllers have + * a bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0B11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:23:59 2017 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 144C5CE7F48; Tue, 21 Feb 2017 02:23:59 +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 D516F178E; Tue, 21 Feb 2017 02:23:58 +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 v1L2NvkN015765; Tue, 21 Feb 2017 02:23:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2NvBg015764; Tue, 21 Feb 2017 02:23:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210223.v1L2NvBg015764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:23:57 +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: r314007 - stable/11/usr.bin/bluetooth 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.23 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, 21 Feb 2017 02:23:59 -0000 Author: ngie Date: Tue Feb 21 02:23:57 2017 New Revision: 314007 URL: https://svnweb.freebsd.org/changeset/base/314007 Log: MFC r313656: Use SRCTOP to define .include with usr.bin/Makefile.inc Modified: stable/11/usr.bin/bluetooth/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/bluetooth/Makefile.inc ============================================================================== --- stable/11/usr.bin/bluetooth/Makefile.inc Tue Feb 21 02:23:27 2017 (r314006) +++ stable/11/usr.bin/bluetooth/Makefile.inc Tue Feb 21 02:23:57 2017 (r314007) @@ -1,4 +1,4 @@ # $FreeBSD$ -.include "${.CURDIR}/../../Makefile.inc" +.include "${SRCTOP}/usr.bin/Makefile.inc" From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:24:46 2017 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 CB065CE7038; Tue, 21 Feb 2017 02:24: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 977551A24; Tue, 21 Feb 2017 02:24: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 v1L2Ojse015912; Tue, 21 Feb 2017 02:24:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2Ojv4015911; Tue, 21 Feb 2017 02:24:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210224.v1L2Ojv4015911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:24: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: r314009 - stable/11/usr.bin/atm/sscop 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.23 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, 21 Feb 2017 02:24:46 -0000 Author: ngie Date: Tue Feb 21 02:24:45 2017 New Revision: 314009 URL: https://svnweb.freebsd.org/changeset/base/314009 Log: MFC r313653: Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output Modified: stable/11/usr.bin/atm/sscop/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/atm/sscop/Makefile ============================================================================== --- stable/11/usr.bin/atm/sscop/Makefile Tue Feb 21 02:24:31 2017 (r314008) +++ stable/11/usr.bin/atm/sscop/Makefile Tue Feb 21 02:24:45 2017 (r314009) @@ -1,6 +1,6 @@ # $FreeBSD$ -CONTRIB= ${.CURDIR}/../../../contrib/ngatm/sscop +CONTRIB= ${SRCTOP}/contrib/ngatm/sscop .PATH: ${CONTRIB} From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:26:58 2017 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 BA7E3CE7186; Tue, 21 Feb 2017 02:26:58 +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 6FDC21C66; Tue, 21 Feb 2017 02:26:58 +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 v1L2QvGB016067; Tue, 21 Feb 2017 02:26:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2QvJP016066; Tue, 21 Feb 2017 02:26:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210226.v1L2QvJP016066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:26:57 +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: r314010 - stable/11/gnu/usr.bin/gdb 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.23 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, 21 Feb 2017 02:26:58 -0000 Author: ngie Date: Tue Feb 21 02:26:57 2017 New Revision: 314010 URL: https://svnweb.freebsd.org/changeset/base/314010 Log: MFC r313650: Use SRCTOP/OBJTOP and simplify output using :H instead of "../" for directory entries This simplifies pathing in make/displayed output Modified: stable/11/gnu/usr.bin/gdb/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- stable/11/gnu/usr.bin/gdb/Makefile.inc Tue Feb 21 02:24:45 2017 (r314009) +++ stable/11/gnu/usr.bin/gdb/Makefile.inc Tue Feb 21 02:26:57 2017 (r314010) @@ -5,19 +5,17 @@ VENDOR= marcel PACKAGE= gdb -BMAKE_GDB= ${.CURDIR}/.. -BMAKE_ROOT= ${BMAKE_GDB}/.. +BMAKE_GDB= ${.CURDIR:H} +BMAKE_ROOT= ${BMAKE_GDB:H} BMAKE_BU= ${BMAKE_ROOT}/binutils -CNTRB_ROOT= ${BMAKE_ROOT}/../../contrib -CNTRB_BU= ${CNTRB_ROOT}/binutils -CNTRB_GDB= ${CNTRB_ROOT}/gdb -CNTRB_RL= ${CNTRB_ROOT}/libreadline - -OBJ_ROOT= ${.OBJDIR}/../.. -OBJ_BU= ${OBJ_ROOT}/binutils -OBJ_GDB= ${OBJ_ROOT}/gdb -OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/readline +CNTRB_BU= ${SRCTOP}/contrib/binutils +CNTRB_GDB= ${SRCTOP}/contrib/gdb +CNTRB_RL= ${SRCTOP}/contrib/libreadline + +OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils +OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb +OBJ_RL= ${OBJTOP}/gnu/lib/libreadline/readline # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... @@ -47,12 +45,12 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include CFLAGS+= -I${CNTRB_GDB}/include CFLAGS+= -I${CNTRB_BU}/bfd -CFLAGS+= -I${OBJ_RL}/.. +CFLAGS+= -I${OBJ_RL:H} GENSRCS+= nm.h tm.h .if defined(GDB_CROSS_DEBUGGER) -CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT}/../.. +CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT:H:H} GDB_SUFFIX= -${TARGET_ARCH} MAN= .endif From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:30:29 2017 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 7CEABCE7277; Tue, 21 Feb 2017 02:30:29 +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 4786F1E08; Tue, 21 Feb 2017 02:30:29 +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 v1L2USmg016324; Tue, 21 Feb 2017 02:30:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2URaZ016312; Tue, 21 Feb 2017 02:30:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210230.v1L2URaZ016312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:30: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: r314011 - in stable/11/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion 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.23 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, 21 Feb 2017 02:30:29 -0000 Author: ngie Date: Tue Feb 21 02:30:26 2017 New Revision: 314011 URL: https://svnweb.freebsd.org/changeset/base/314011 Log: MFC r313679: Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu of ../ elsewhere This simplifies pathing in make/displayed output Modified: stable/11/usr.bin/svn/Makefile.inc stable/11/usr.bin/svn/svn/Makefile stable/11/usr.bin/svn/svnadmin/Makefile stable/11/usr.bin/svn/svnbench/Makefile stable/11/usr.bin/svn/svndumpfilter/Makefile stable/11/usr.bin/svn/svnfsfs/Makefile stable/11/usr.bin/svn/svnlook/Makefile stable/11/usr.bin/svn/svnmucc/Makefile stable/11/usr.bin/svn/svnrdump/Makefile stable/11/usr.bin/svn/svnserve/Makefile stable/11/usr.bin/svn/svnsync/Makefile stable/11/usr.bin/svn/svnversion/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/svn/Makefile.inc ============================================================================== --- stable/11/usr.bin/svn/Makefile.inc Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/Makefile.inc Tue Feb 21 02:30:26 2017 (r314011) @@ -12,33 +12,31 @@ PACKAGE= svn .if !defined(SVNDIR) -SVNDIR= ${.CURDIR}/../../../contrib/subversion/subversion -APRU= ${.CURDIR}/../../../contrib/apr-util -APR= ${.CURDIR}/../../../contrib/apr +SVNDIR= ${SRCTOP}/contrib/subversion/subversion +APRU= ${SRCTOP}/contrib/apr-util +APR= ${SRCTOP}/contrib/apr WARNS?= 0 # definitely not warns friendly -.if exists(${.CURDIR}/../../Makefile.inc) -.include "${.CURDIR}/../../Makefile.inc" -.endif +.sinclude "${.CURDIR:H:H}/Makefile.inc" -LIBAPRDIR= ${.OBJDIR}/../lib/libapr -LIBAPR_UTILDIR= ${.OBJDIR}/../lib/libapr_util -LIBSERFDIR= ${.OBJDIR}/../lib/libserf - -LIBSVN_CLIENTDIR= ${.OBJDIR}/../lib/libsvn_client -LIBSVN_DELTADIR= ${.OBJDIR}/../lib/libsvn_delta -LIBSVN_DIFFDIR= ${.OBJDIR}/../lib/libsvn_diff -LIBSVN_FSDIR= ${.OBJDIR}/../lib/libsvn_fs -LIBSVN_FS_FSDIR= ${.OBJDIR}/../lib/libsvn_fs_fs -LIBSVN_FS_UTILDIR= ${.OBJDIR}/../lib/libsvn_fs_util -LIBSVN_FS_XDIR= ${.OBJDIR}/../lib/libsvn_fs_x -LIBSVN_RADIR= ${.OBJDIR}/../lib/libsvn_ra -LIBSVN_RA_LOCALDIR= ${.OBJDIR}/../lib/libsvn_ra_local -LIBSVN_RA_SVNDIR= ${.OBJDIR}/../lib/libsvn_ra_svn -LIBSVN_RA_SERFDIR= ${.OBJDIR}/../lib/libsvn_ra_serf -LIBSVN_REPOSDIR= ${.OBJDIR}/../lib/libsvn_repos -LIBSVN_SUBRDIR= ${.OBJDIR}/../lib/libsvn_subr -LIBSVN_WCDIR= ${.OBJDIR}/../lib/libsvn_wc +LIBAPRDIR= ${.OBJDIR:H}/lib/libapr +LIBAPR_UTILDIR= ${.OBJDIR:H}/lib/libapr_util +LIBSERFDIR= ${.OBJDIR:H}/lib/libserf + +LIBSVN_CLIENTDIR= ${.OBJDIR:H}/lib/libsvn_client +LIBSVN_DELTADIR= ${.OBJDIR:H}/lib/libsvn_delta +LIBSVN_DIFFDIR= ${.OBJDIR:H}/lib/libsvn_diff +LIBSVN_FSDIR= ${.OBJDIR:H}/lib/libsvn_fs +LIBSVN_FS_FSDIR= ${.OBJDIR:H}/lib/libsvn_fs_fs +LIBSVN_FS_UTILDIR= ${.OBJDIR:H}/lib/libsvn_fs_util +LIBSVN_FS_XDIR= ${.OBJDIR:H}/lib/libsvn_fs_x +LIBSVN_RADIR= ${.OBJDIR:H}/lib/libsvn_ra +LIBSVN_RA_LOCALDIR= ${.OBJDIR:H}/lib/libsvn_ra_local +LIBSVN_RA_SVNDIR= ${.OBJDIR:H}/lib/libsvn_ra_svn +LIBSVN_RA_SERFDIR= ${.OBJDIR:H}/lib/libsvn_ra_serf +LIBSVN_REPOSDIR= ${.OBJDIR:H}/lib/libsvn_repos +LIBSVN_SUBRDIR= ${.OBJDIR:H}/lib/libsvn_subr +LIBSVN_WCDIR= ${.OBJDIR:H}/lib/libsvn_wc LIBAPR= ${LIBAPRDIR}/libapr.a LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util.a Modified: stable/11/usr.bin/svn/svn/Makefile ============================================================================== --- stable/11/usr.bin/svn/svn/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svn/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svn @@ -17,11 +17,11 @@ SRCS= add-cmd.c auth-cmd.c blame-cmd.c c resolved-cmd.c revert-cmd.c status-cmd.c similarity.c status.c \ svn.c switch-cmd.c unlock-cmd.c update-cmd.c upgrade-cmd.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnadmin/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnadmin/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnadmin/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnadmin @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}admin SRCS= svnadmin.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnbench/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnbench/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnbench/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnbench @@ -11,11 +11,11 @@ PROG= svn${SVNLITE}bench SRCS= help-cmd.c notify.c null-blame-cmd.c null-export-cmd.c \ null-info-cmd.c null-list-cmd.c null-log-cmd.c svnbench.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- stable/11/usr.bin/svn/svndumpfilter/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svndumpfilter/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svndumpfilter @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}dumpfilter SRCS= svndumpfilter.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnfsfs/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnfsfs/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnfsfs/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnfsfs @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}fsfs SRCS= dump-index-cmd.c load-index-cmd.c stats-cmd.c svnfsfs.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnlook/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnlook/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnlook/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnlook @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}look SRCS= svnlook.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnmucc/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnmucc/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnmucc/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnmucc @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}mucc SRCS= svnmucc.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnrdump/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnrdump/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnrdump/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnrdump @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}rdump SRCS= dump_editor.c load_editor.c svnrdump.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnserve/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnserve/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnserve/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnserve @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}serve SRCS= cyrus_auth.c log-escape.c logger.c serve.c svnserve.c winservice.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnsync/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnsync/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnsync/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnsync @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}sync SRCS= svnsync.c sync.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/11/usr.bin/svn/svnversion/Makefile ============================================================================== --- stable/11/usr.bin/svn/svnversion/Makefile Tue Feb 21 02:26:57 2017 (r314010) +++ stable/11/usr.bin/svn/svnversion/Makefile Tue Feb 21 02:30:26 2017 (r314011) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnversion @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}version SRCS= svnversion.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:33:30 2017 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 3EE32CE746E; Tue, 21 Feb 2017 02:33:30 +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 0DFD535C; Tue, 21 Feb 2017 02:33:29 +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 v1L2XTRH020377; Tue, 21 Feb 2017 02:33:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2XTNt020376; Tue, 21 Feb 2017 02:33:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210233.v1L2XTNt020376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:33:29 +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: r314012 - stable/11/usr.bin/awk 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.23 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, 21 Feb 2017 02:33:30 -0000 Author: ngie Date: Tue Feb 21 02:33:28 2017 New Revision: 314012 URL: https://svnweb.freebsd.org/changeset/base/314012 Log: MFC r313654: Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix for maketab.c The former simplifies pathing in make/displayed output, whereas the latter was just unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in the Makefile. Modified: stable/11/usr.bin/awk/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/awk/Makefile ============================================================================== --- stable/11/usr.bin/awk/Makefile Tue Feb 21 02:30:26 2017 (r314011) +++ stable/11/usr.bin/awk/Makefile Tue Feb 21 02:33:28 2017 (r314012) @@ -1,6 +1,6 @@ # $FreeBSD$ -AWKSRC= ${.CURDIR}/../../contrib/one-true-awk +AWKSRC= ${SRCTOP}/contrib/one-true-awk .PATH: ${AWKSRC} PROG= awk @@ -26,6 +26,6 @@ proctab.c: maketab ${BTOOLSPATH:U.}/maketab > proctab.c build-tools: maketab -maketab: ytab.h ${AWKSRC}/maketab.c ${BUILD_TOOLS_META} +maketab: ytab.h maketab.c ${BUILD_TOOLS_META} .include From owner-svn-src-stable-11@freebsd.org Tue Feb 21 02:35:18 2017 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 34829CE75FB; Tue, 21 Feb 2017 02:35:18 +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 03E8598C; Tue, 21 Feb 2017 02:35:17 +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 v1L2ZHJt020668; Tue, 21 Feb 2017 02:35:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2ZH5O020667; Tue, 21 Feb 2017 02:35:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210235.v1L2ZH5O020667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:35:17 +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: r314015 - stable/11/usr.bin/bsdcat 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.23 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, 21 Feb 2017 02:35:18 -0000 Author: ngie Date: Tue Feb 21 02:35:16 2017 New Revision: 314015 URL: https://svnweb.freebsd.org/changeset/base/314015 Log: MFC r313652: Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output Modified: stable/11/usr.bin/bsdcat/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/bsdcat/Makefile ============================================================================== --- stable/11/usr.bin/bsdcat/Makefile Tue Feb 21 02:34:59 2017 (r314014) +++ stable/11/usr.bin/bsdcat/Makefile Tue Feb 21 02:35:16 2017 (r314015) @@ -2,10 +2,10 @@ .include -_LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive -_LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive +_LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive -PROG= bsdcat +PROG= bsdcat BSDCAT_VERSION_STRING= 3.2.2 .PATH: ${_LIBARCHIVEDIR}/cat From owner-svn-src-stable-11@freebsd.org Tue Feb 21 03:46:45 2017 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 A56E4CE6693; Tue, 21 Feb 2017 03:46: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 73C4E1A2D; Tue, 21 Feb 2017 03:46: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 v1L3ki6N050374; Tue, 21 Feb 2017 03:46:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L3khuT050366; Tue, 21 Feb 2017 03:46:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210346.v1L3khuT050366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 03:46: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: r314021 - in stable/11/lib/libnetbsd: . 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.23 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, 21 Feb 2017 03:46:45 -0000 Author: ngie Date: Tue Feb 21 03:46:43 2017 New Revision: 314021 URL: https://svnweb.freebsd.org/changeset/base/314021 Log: MFC r313404: Improve libnetbsd compatibility with NetBSD This change is being made to diff reduce/reduce duplication in contrib/netbsd-tests and to facilitate further porting of software from NetBSD Add the following headers: - sys/event.h: -- sys/types.h is required for kqueue on FreeBSD, but not NetBSD. - sys/types.h: -- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD. Pull in sys/param.h to have parity with NetBSD. - sys/wait.h: -- Define wrusage as __wrusage for parity with NetBSD typedef. - glob.h -- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef. - pthread.h: -- Pull in pthread_np.h for _np functions defined separately on FreeBSD. Improve compatibility with NetBSD in the following headers: - sha1.h: -- define SHA1_CTX as SHA_CTX -- define SHA1Final as SHA1_Final - sha2.h: -- #include sha384 to pick up all of the SHA 384 bit macros and definitions. - util.h: -- Add sys/types.h to util.h to pollute the header for types used in flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them for the functions. Added: stable/11/lib/libnetbsd/glob.h - copied unchanged from r313404, head/lib/libnetbsd/glob.h stable/11/lib/libnetbsd/pthread.h - copied unchanged from r313404, head/lib/libnetbsd/pthread.h stable/11/lib/libnetbsd/sys/event.h - copied unchanged from r313404, head/lib/libnetbsd/sys/event.h stable/11/lib/libnetbsd/sys/types.h - copied unchanged from r313404, head/lib/libnetbsd/sys/types.h stable/11/lib/libnetbsd/sys/wait.h - copied unchanged from r313404, head/lib/libnetbsd/sys/wait.h Modified: stable/11/lib/libnetbsd/sha1.h stable/11/lib/libnetbsd/sha2.h stable/11/lib/libnetbsd/util.h Directory Properties: stable/11/ (props changed) Copied: stable/11/lib/libnetbsd/glob.h (from r313404, head/lib/libnetbsd/glob.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/glob.h Tue Feb 21 03:46:43 2017 (r314021, copy of r313404, head/lib/libnetbsd/glob.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBNETBSD_GLOB_H_ +#define _LIBNETBSD_GLOB_H_ + +#include_next + +#ifndef __gl_stat_t +#define __gl_stat_t struct stat +#endif + +#endif Copied: stable/11/lib/libnetbsd/pthread.h (from r313404, head/lib/libnetbsd/pthread.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/pthread.h Tue Feb 21 03:46:43 2017 (r314021, copy of r313404, head/lib/libnetbsd/pthread.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBNETBSD_PTHREAD_H_ +#define _LIBNETBSD_PTHREAD_H_ + +#include_next +#include + +#endif Modified: stable/11/lib/libnetbsd/sha1.h ============================================================================== --- stable/11/lib/libnetbsd/sha1.h Tue Feb 21 03:46:37 2017 (r314020) +++ stable/11/lib/libnetbsd/sha1.h Tue Feb 21 03:46:43 2017 (r314021) @@ -35,8 +35,11 @@ #include +#define SHA1_CTX SHA_CTX + #define SHA1End SHA1_End #define SHA1File SHA1_File +#define SHA1Final SHA1_Final #define SHA1Init SHA1_Init #define SHA1Update SHA1_Update Modified: stable/11/lib/libnetbsd/sha2.h ============================================================================== --- stable/11/lib/libnetbsd/sha2.h Tue Feb 21 03:46:37 2017 (r314020) +++ stable/11/lib/libnetbsd/sha2.h Tue Feb 21 03:46:43 2017 (r314021) @@ -34,6 +34,7 @@ #define _SHA2_H_ #include +#include #include #endif /* _SHA2_H_ */ Copied: stable/11/lib/libnetbsd/sys/event.h (from r313404, head/lib/libnetbsd/sys/event.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/sys/event.h Tue Feb 21 03:46:43 2017 (r314021, copy of r313404, head/lib/libnetbsd/sys/event.h) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_EVENT_H_ +#define _LIBNETBSD_SYS_EVENT_H_ + +/* + * kqueue on FreeBSD requires sys/event.h, which in turn uses uintptr_t + * (defined in sys/types.h), so in order to accomodate their requirements, + * pull in sys/types.h as part of event.h. + */ +#include + +#include_next + +#endif Copied: stable/11/lib/libnetbsd/sys/types.h (from r313404, head/lib/libnetbsd/sys/types.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/sys/types.h Tue Feb 21 03:46:43 2017 (r314021, copy of r313404, head/lib/libnetbsd/sys/types.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_TYPES_H_ +#define _LIBNETBSD_SYS_TYPES_H_ + +#include_next + +#include /* For NBBY */ + +#endif Copied: stable/11/lib/libnetbsd/sys/wait.h (from r313404, head/lib/libnetbsd/sys/wait.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/sys/wait.h Tue Feb 21 03:46:43 2017 (r314021, copy of r313404, head/lib/libnetbsd/sys/wait.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_WAIT_H_ +#define _LIBNETBSD_SYS_WAIT_H_ + +#include_next + +#define wrusage __wrusage + +#endif Modified: stable/11/lib/libnetbsd/util.h ============================================================================== --- stable/11/lib/libnetbsd/util.h Tue Feb 21 03:46:37 2017 (r314020) +++ stable/11/lib/libnetbsd/util.h Tue Feb 21 03:46:43 2017 (r314021) @@ -30,12 +30,13 @@ * SUCH DAMAGE. */ -#ifndef _UTIL_H_ -#define _UTIL_H_ +#ifndef _LIBNETBSD_UTIL_H_ +#define _LIBNETBSD_UTIL_H_ +#include #include char *flags_to_string(u_long flags, const char *def); int string_to_flags(char **stringp, u_long *setp, u_long *clrp); -#endif /* _UTIL_H_ */ +#endif From owner-svn-src-stable-11@freebsd.org Tue Feb 21 03:49:54 2017 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 2610FCE680E; Tue, 21 Feb 2017 03:49:54 +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 E6EC11D08; Tue, 21 Feb 2017 03:49:53 +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 v1L3nqk6050547; Tue, 21 Feb 2017 03:49:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L3nqI5050546; Tue, 21 Feb 2017 03:49:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210349.v1L3nqI5050546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 03:49: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: r314022 - stable/11/lib/msun/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.23 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, 21 Feb 2017 03:49:54 -0000 Author: ngie Date: Tue Feb 21 03:49:52 2017 New Revision: 314022 URL: https://svnweb.freebsd.org/changeset/base/314022 Log: MFC r313713: Handle clang 4.x+ with the compile-time exception added in r312213 It also fails the assertions noted in bug 208703 PR: 208703 PR: 217084 Modified: stable/11/lib/msun/tests/fmaxmin_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/tests/fmaxmin_test.c ============================================================================== --- stable/11/lib/msun/tests/fmaxmin_test.c Tue Feb 21 03:46:43 2017 (r314021) +++ stable/11/lib/msun/tests/fmaxmin_test.c Tue Feb 21 03:49:52 2017 (r314022) @@ -116,7 +116,8 @@ testall(int testnum, long double big, lo /* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */ #if defined(__clang__) && \ - (__clang_major__ >= 3 && __clang_minor__ >= 8 && __clang_patchlevel__ >= 0) + ((__clang_major__ > 3)) || \ + ((__clang_major__ == 3 && __clang_minor__ >= 8)) #define affected_by_bug_208703 #endif From owner-svn-src-stable-11@freebsd.org Tue Feb 21 05:12:44 2017 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 55E26CE7ED8; Tue, 21 Feb 2017 05:12:44 +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 1D04D286; Tue, 21 Feb 2017 05:12:44 +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 v1L5ChCg086294; Tue, 21 Feb 2017 05:12:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L5ChSj086293; Tue, 21 Feb 2017 05:12:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702210512.v1L5ChSj086293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 21 Feb 2017 05:12: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: r314025 - stable/11/sys/cam/ctl 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.23 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, 21 Feb 2017 05:12:44 -0000 Author: mav Date: Tue Feb 21 05:12:42 2017 New Revision: 314025 URL: https://svnweb.freebsd.org/changeset/base/314025 Log: MFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity. Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 21 05:08:07 2017 (r314024) +++ stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 21 05:12:42 2017 (r314025) @@ -1120,8 +1120,10 @@ ctl_backend_ramdisk_create(struct ctl_be STAILQ_INIT(&be_lun->cont_queue); sx_init(&be_lun->page_lock, "cram page lock"); - if (be_lun->cap_bytes == 0) + if (be_lun->cap_bytes == 0) { + be_lun->indir = 0; be_lun->pages = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK); + } be_lun->zero_page = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK|M_ZERO); mtx_init(&be_lun->queue_lock, "cram queue lock", NULL, MTX_DEF); From owner-svn-src-stable-11@freebsd.org Tue Feb 21 08:57:30 2017 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 7322BCE72A3; Tue, 21 Feb 2017 08:57:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27D9096F; Tue, 21 Feb 2017 08:57:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L8vTUS077216; Tue, 21 Feb 2017 08:57:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L8vT7F077214; Tue, 21 Feb 2017 08:57:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702210857.v1L8vT7F077214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Feb 2017 08:57:29 +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: r314030 - 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.23 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, 21 Feb 2017 08:57:30 -0000 Author: avg Date: Tue Feb 21 08:57:28 2017 New Revision: 314030 URL: https://svnweb.freebsd.org/changeset/base/314030 Log: MFC r313686: check remaining space in zfs implementations of vptocnp PR: 216939 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 21 08:57:27 2017 (r314029) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 21 08:57:28 2017 (r314030) @@ -1604,16 +1604,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc } if (sep == NULL) { mutex_exit(&sdp->sd_lock); - error = ENOENT; + error = SET_ERROR(ENOENT); } else { size_t len; len = strlen(sep->se_name); - *ap->a_buflen -= len; - bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); - mutex_exit(&sdp->sd_lock); - vref(dvp); - *ap->a_vpp = dvp; + if (*ap->a_buflen < len) { + mutex_exit(&sdp->sd_lock); + error = SET_ERROR(ENOMEM); + } else { + *ap->a_buflen -= len; + bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); + mutex_exit(&sdp->sd_lock); + vref(dvp); + *ap->a_vpp = dvp; + } } VN_RELE(dvp); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 21 08:57:27 2017 (r314029) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 21 08:57:28 2017 (r314030) @@ -5941,6 +5941,10 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) error = zfs_znode_parent_and_name(zp, &dzp, name); if (error == 0) { len = strlen(name); + if (*ap->a_buflen < len) + error = SET_ERROR(ENOMEM); + } + if (error == 0) { *ap->a_buflen -= len; bcopy(name, ap->a_buf + *ap->a_buflen, len); *ap->a_vpp = ZTOV(dzp); From owner-svn-src-stable-11@freebsd.org Tue Feb 21 09:13:35 2017 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 6B6BDCE7C7B; Tue, 21 Feb 2017 09:13:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39FCD171D; Tue, 21 Feb 2017 09:13:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L9DY1B085434; Tue, 21 Feb 2017 09:13:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L9DYBP085433; Tue, 21 Feb 2017 09:13:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702210913.v1L9DYBP085433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Feb 2017 09:13:34 +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: r314031 - 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.23 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, 21 Feb 2017 09:13:35 -0000 Author: avg Date: Tue Feb 21 09:13:34 2017 New Revision: 314031 URL: https://svnweb.freebsd.org/changeset/base/314031 Log: MFC r313687: remove l2_padding_needed statistic from zfs arc Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 21 08:57:28 2017 (r314030) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 21 09:13:34 2017 (r314031) @@ -711,7 +711,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_asize; kstat_named_t arcstat_l2_hdr_size; - kstat_named_t arcstat_l2_padding_needed; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -809,7 +808,6 @@ static arc_stats_t arc_stats = { { "l2_size", KSTAT_DATA_UINT64 }, { "l2_asize", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "l2_padding_needed", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, From owner-svn-src-stable-11@freebsd.org Tue Feb 21 09:29:12 2017 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 F1D84CE6245; Tue, 21 Feb 2017 09:29:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C999AAB; Tue, 21 Feb 2017 09:29:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L9TBM4089578; Tue, 21 Feb 2017 09:29:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L9TBDG089575; Tue, 21 Feb 2017 09:29:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702210929.v1L9TBDG089575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Feb 2017 09:29: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: r314033 - in stable/11/sys: fs/nfsserver rpc 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.23 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, 21 Feb 2017 09:29:13 -0000 Author: avg Date: Tue Feb 21 09:29:11 2017 New Revision: 314033 URL: https://svnweb.freebsd.org/changeset/base/314033 Log: MFC r313735: add svcpool_close to handle killed nfsd threads PR: 204340 Reported by: Panzura Approved by: rmacklem Obtained from: rmacklem Modified: stable/11/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/11/sys/rpc/svc.c stable/11/sys/rpc/svc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Feb 21 09:13:38 2017 (r314032) +++ stable/11/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Feb 21 09:29:11 2017 (r314033) @@ -551,18 +551,16 @@ nfsrvd_init(int terminating) nfsd_master_proc = NULL; NFSD_UNLOCK(); nfsrv_freeallbackchannel_xprts(); - svcpool_destroy(nfsrvd_pool); - nfsrvd_pool = NULL; + svcpool_close(nfsrvd_pool); + NFSD_LOCK(); + } else { + NFSD_UNLOCK(); + nfsrvd_pool = svcpool_create("nfsd", + SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); + nfsrvd_pool->sp_rcache = NULL; + nfsrvd_pool->sp_assign = fhanew_assign; + nfsrvd_pool->sp_done = fha_nd_complete; NFSD_LOCK(); } - - NFSD_UNLOCK(); - - nfsrvd_pool = svcpool_create("nfsd", SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); - nfsrvd_pool->sp_rcache = NULL; - nfsrvd_pool->sp_assign = fhanew_assign; - nfsrvd_pool->sp_done = fha_nd_complete; - - NFSD_LOCK(); } Modified: stable/11/sys/rpc/svc.c ============================================================================== --- stable/11/sys/rpc/svc.c Tue Feb 21 09:13:38 2017 (r314032) +++ stable/11/sys/rpc/svc.c Tue Feb 21 09:29:11 2017 (r314033) @@ -75,6 +75,7 @@ static void svc_new_thread(SVCGROUP *grp static void xprt_unregister_locked(SVCXPRT *xprt); static void svc_change_space_used(SVCPOOL *pool, long delta); static bool_t svc_request_space_available(SVCPOOL *pool); +static void svcpool_cleanup(SVCPOOL *pool); /* *************** SVCXPRT related stuff **************** */ @@ -174,8 +175,12 @@ svcpool_create(const char *name, struct return pool; } -void -svcpool_destroy(SVCPOOL *pool) +/* + * Code common to svcpool_destroy() and svcpool_close(), which cleans up + * the pool data structures. + */ +static void +svcpool_cleanup(SVCPOOL *pool) { SVCGROUP *grp; SVCXPRT *xprt, *nxprt; @@ -211,6 +216,15 @@ svcpool_destroy(SVCPOOL *pool) mtx_lock(&pool->sp_lock); } mtx_unlock(&pool->sp_lock); +} + +void +svcpool_destroy(SVCPOOL *pool) +{ + SVCGROUP *grp; + int g; + + svcpool_cleanup(pool); for (g = 0; g < SVC_MAXGROUPS; g++) { grp = &pool->sp_groups[g]; @@ -226,6 +240,30 @@ svcpool_destroy(SVCPOOL *pool) } /* + * Similar to svcpool_destroy(), except that it does not destroy the actual + * data structures. As such, "pool" may be used again. + */ +void +svcpool_close(SVCPOOL *pool) +{ + SVCGROUP *grp; + int g; + + svcpool_cleanup(pool); + + /* Now, initialize the pool's state for a fresh svc_run() call. */ + mtx_lock(&pool->sp_lock); + pool->sp_state = SVCPOOL_INIT; + mtx_unlock(&pool->sp_lock); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + grp->sg_state = SVCPOOL_ACTIVE; + mtx_unlock(&grp->sg_lock); + } +} + +/* * Sysctl handler to get the present thread count on a pool */ static int Modified: stable/11/sys/rpc/svc.h ============================================================================== --- stable/11/sys/rpc/svc.h Tue Feb 21 09:13:38 2017 (r314032) +++ stable/11/sys/rpc/svc.h Tue Feb 21 09:29:11 2017 (r314033) @@ -729,6 +729,12 @@ extern SVCPOOL* svcpool_create(const cha extern void svcpool_destroy(SVCPOOL *pool); /* + * Close a service pool. Similar to svcpool_destroy(), but it does not + * free the data structures. As such, the pool can be used again. + */ +extern void svcpool_close(SVCPOOL *pool); + +/* * Transport independent svc_create routine. */ extern int svc_create(SVCPOOL *, void (*)(struct svc_req *, SVCXPRT *), From owner-svn-src-stable-11@freebsd.org Tue Feb 21 12:45:57 2017 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 EA14ECE5821; Tue, 21 Feb 2017 12:45:57 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A94A9171B; Tue, 21 Feb 2017 12:45:57 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1LCju6V071350; Tue, 21 Feb 2017 12:45:56 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1LCjujf071349; Tue, 21 Feb 2017 12:45:56 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201702211245.v1LCjujf071349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 21 Feb 2017 12:45:56 +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: r314041 - stable/11/usr.sbin/ndp 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.23 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, 21 Feb 2017 12:45:58 -0000 Author: garga (ports committer) Date: Tue Feb 21 12:45:56 2017 New Revision: 314041 URL: https://svnweb.freebsd.org/changeset/base/314041 Log: MFC r313737: Fix style(9) Reviewed by: allanjude, vangyzen Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9510 Modified: stable/11/usr.sbin/ndp/ndp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ndp/ndp.c ============================================================================== --- stable/11/usr.sbin/ndp/ndp.c Tue Feb 21 12:43:02 2017 (r314040) +++ stable/11/usr.sbin/ndp/ndp.c Tue Feb 21 12:45:56 2017 (r314041) @@ -109,10 +109,11 @@ #include #include "gmt2local.h" -#define NEXTADDR(w, s) \ - if (rtm->rtm_addrs & (w)) { \ - bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);} - +#define NEXTADDR(w, s) \ + if (rtm->rtm_addrs & (w)) { \ + bcopy((char *)&s, cp, sizeof(s)); \ + cp += SA_SIZE(&s); \ + } static pid_t pid; static int nflag; @@ -529,10 +530,10 @@ delete: printf("cannot locate %s\n", host); return (1); } - /* - * need to reinit the field because it has rt_key - * but we want the actual address - */ + /* + * need to reinit the field because it has rt_key + * but we want the actual address + */ NEXTADDR(RTA_DST, sin_m); rtm->rtm_flags |= RTF_LLDATA; if (rtmsg(RTM_DELETE) == 0) { @@ -604,7 +605,8 @@ again:; rtm = (struct rt_msghdr *)next; sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)((char *)sin + ALIGN(sin->sin6_len)); + sdl = (struct sockaddr_dl *)((char *)sin + + ALIGN(sin->sin6_len)); /* * Some OSes can produce a route that has the LINK flag but @@ -724,7 +726,7 @@ again:; isrouter ? "R" : "", (rtm->rtm_flags & RTF_ANNOUNCE) ? "p" : ""); } else { -#if 0 /* W and P are mystery even for us */ +#if 0 /* W and P are mystery even for us */ sin = (struct sockaddr_in6 *) (sdl->sdl_len + (char *)sdl); snprintf(flgbuf, sizeof(flgbuf), "%s%s%s%s", @@ -855,7 +857,7 @@ rtmsg(int cmd) rtm->rtm_inits = RTV_EXPIRE; } rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA); -#if 0 /* we don't support ipv6addr/128 type proxying */ +#if 0 /* we don't support ipv6addr/128 type proxying */ if (rtm->rtm_flags & RTF_ANNOUNCE) { rtm->rtm_flags &= ~RTF_HOST; rtm->rtm_addrs |= RTA_NETMASK; @@ -868,7 +870,7 @@ rtmsg(int cmd) NEXTADDR(RTA_DST, sin_m); NEXTADDR(RTA_GATEWAY, sdl_m); -#if 0 /* we don't support ipv6addr/128 type proxying */ +#if 0 /* we don't support ipv6addr/128 type proxying */ memset(&so_mask.sin6_addr, 0xff, sizeof(so_mask.sin6_addr)); NEXTADDR(RTA_NETMASK, so_mask); #endif @@ -913,7 +915,7 @@ ifinfo(char *ifname, int argc, char **ar err(1, "ioctl(SIOCGIFINFO_IN6)"); /* NOTREACHED */ } -#define ND nd.ndi +#define ND nd.ndi newflags = ND.flags; for (i = 0; i < argc; i++) { int clear = 0; @@ -924,35 +926,33 @@ ifinfo(char *ifname, int argc, char **ar cp++; } -#define SETFLAG(s, f) \ - do {\ - if (strcmp(cp, (s)) == 0) {\ - if (clear)\ - newflags &= ~(f);\ - else\ - newflags |= (f);\ - }\ - } while (0) +#define SETFLAG(s, f) do { \ + if (strcmp(cp, (s)) == 0) { \ + if (clear) \ + newflags &= ~(f); \ + else \ + newflags |= (f); \ + } \ +} while (0) /* * XXX: this macro is not 100% correct, in that it matches "nud" against * "nudbogus". But we just let it go since this is minor. */ -#define SETVALUE(f, v) \ - do { \ - char *valptr; \ - unsigned long newval; \ - v = 0; /* unspecified */ \ - if (strncmp(cp, f, strlen(f)) == 0) { \ - valptr = strchr(cp, '='); \ - if (valptr == NULL) \ - err(1, "syntax error in %s field", (f)); \ - errno = 0; \ - newval = strtoul(++valptr, NULL, 0); \ - if (errno) \ - err(1, "syntax error in %s's value", (f)); \ - v = newval; \ - } \ - } while (0) +#define SETVALUE(f, v) do { \ + char *valptr; \ + unsigned long newval; \ + v = 0; /* unspecified */ \ + if (strncmp(cp, f, strlen(f)) == 0) { \ + valptr = strchr(cp, '='); \ + if (valptr == NULL) \ + err(1, "syntax error in %s field", (f)); \ + errno = 0; \ + newval = strtoul(++valptr, NULL, 0); \ + if (errno) \ + err(1, "syntax error in %s's value", (f)); \ + v = newval; \ + } \ +} while (0) SETFLAG("disabled", ND6_IFF_IFDISABLED); SETFLAG("nud", ND6_IFF_PERFORMNUD); @@ -1021,7 +1021,7 @@ ifinfo(char *ifname, int argc, char **ar printf("%02x", rbuf[j]); } } -#endif +#endif /* IPV6CTL_USETEMPADDR */ if (ND.flags) { printf("\nFlags: "); #ifdef ND6_IFF_IFDISABLED @@ -1314,7 +1314,7 @@ getdefif() close(s); } -#endif +#endif /* SIOCSDEFIFACE_IN6 */ static char * sec2str(time_t total) From owner-svn-src-stable-11@freebsd.org Tue Feb 21 12:51:46 2017 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 D80C0CE5A8D; Tue, 21 Feb 2017 12:51:46 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 989B01D3E; Tue, 21 Feb 2017 12:51:46 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1LCpjkH075314; Tue, 21 Feb 2017 12:51:45 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1LCpjfM075312; Tue, 21 Feb 2017 12:51:45 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201702211251.v1LCpjfM075312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 21 Feb 2017 12:51: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: r314042 - stable/11/sbin/fsck_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.23 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, 21 Feb 2017 12:51:47 -0000 Author: garga (ports committer) Date: Tue Feb 21 12:51:45 2017 New Revision: 314042 URL: https://svnweb.freebsd.org/changeset/base/314042 Log: MFC r313745: * Add missing parameters to usage() * Add missing parameters to manpage synopsis * Add missing description of -d flag * Sort flags descriptions Reviewed by: allanjude, kib Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9152 Modified: stable/11/sbin/fsck_ffs/fsck_ffs.8 stable/11/sbin/fsck_ffs/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/11/sbin/fsck_ffs/fsck_ffs.8 Tue Feb 21 12:45:56 2017 (r314041) +++ stable/11/sbin/fsck_ffs/fsck_ffs.8 Tue Feb 21 12:51:45 2017 (r314042) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd February 14, 2017 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BEFfnpRryZ +.Op Fl BCdEFfnpRrSyZ .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -149,45 +149,6 @@ If unexpected errors are found, the file system is marked as needing a foreground check and .Nm exits without attempting any further cleaning. -.It Fl E -Clear unallocated blocks, notifying the underlying device that they -are not used and that their contents may be discarded. -This is useful for filesystems which have been mounted on systems -without TRIM support, or with TRIM support disabled, as well as -filesystems which have been copied from one device to another. -.Pp -See the -.Fl E -and -.Fl t -flags of -.Xr newfs 8 , -and -the -.Fl t -flag of -.Xr tunefs 8 . -.It Fl F -Determine whether the file system needs to be cleaned immediately -in foreground, or if its cleaning can be deferred to background. -To be eligible for background cleaning it must have been running -with soft updates, not have been marked as needing a foreground check, -and be mounted and writable when the background check is to be done. -If these conditions are met, then -.Nm -exits with a zero exit status. -Otherwise it exits with a non-zero exit status. -If the file system is clean, -it will exit with a non-zero exit status so that the clean status -of the file system can be verified and reported during the foreground -checks. -Note that when invoked with the -.Fl F -flag, no cleanups are done. -The only thing that -.Nm -does is to determine whether a foreground or background -check is needed and exit with an appropriate status code. .It Fl b Use the block specified immediately after the flag as the super block for the file system. @@ -243,6 +204,47 @@ first line of output from This option implies the .Fl f flag. +.It Fl d +Enable debugging messages. +.It Fl E +Clear unallocated blocks, notifying the underlying device that they +are not used and that their contents may be discarded. +This is useful for filesystems which have been mounted on systems +without TRIM support, or with TRIM support disabled, as well as +filesystems which have been copied from one device to another. +.Pp +See the +.Fl E +and +.Fl t +flags of +.Xr newfs 8 , +and +the +.Fl t +flag of +.Xr tunefs 8 . +.It Fl F +Determine whether the file system needs to be cleaned immediately +in foreground, or if its cleaning can be deferred to background. +To be eligible for background cleaning it must have been running +with soft updates, not have been marked as needing a foreground check, +and be mounted and writable when the background check is to be done. +If these conditions are met, then +.Nm +exits with a zero exit status. +Otherwise it exits with a non-zero exit status. +If the file system is clean, +it will exit with a non-zero exit status so that the clean status +of the file system can be verified and reported during the foreground +checks. +Note that when invoked with the +.Fl F +flag, no cleanups are done. +The only thing that +.Nm +does is to determine whether a foreground or background +check is needed and exit with an appropriate status code. .It Fl f Force .Nm Modified: stable/11/sbin/fsck_ffs/main.c ============================================================================== --- stable/11/sbin/fsck_ffs/main.c Tue Feb 21 12:45:56 2017 (r314041) +++ stable/11/sbin/fsck_ffs/main.c Tue Feb 21 12:51:45 2017 (r314042) @@ -670,7 +670,7 @@ static void usage(void) { (void) fprintf(stderr, -"usage: %s [-BEFfnpry] [-b block] [-c level] [-m mode] filesystem ...\n", +"usage: %s [-BCdEFfnpRrSyZ] [-b block] [-c level] [-m mode] filesystem ...\n", getprogname()); exit(1); } From owner-svn-src-stable-11@freebsd.org Wed Feb 22 00:50:37 2017 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 B21DACE5E3E; Wed, 22 Feb 2017 00:50:37 +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 8153E1DC5; Wed, 22 Feb 2017 00:50:37 +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 v1M0oaJ3065984; Wed, 22 Feb 2017 00:50:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M0oa1t065983; Wed, 22 Feb 2017 00:50:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702220050.v1M0oa1t065983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Feb 2017 00:50:36 +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: r314063 - 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.23 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, 22 Feb 2017 00:50:37 -0000 Author: markj Date: Wed Feb 22 00:50:36 2017 New Revision: 314063 URL: https://svnweb.freebsd.org/changeset/base/314063 Log: MFC r313261: Make witness_warn() always print to the console. Modified: stable/11/sys/kern/subr_witness.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_witness.c ============================================================================== --- stable/11/sys/kern/subr_witness.c Tue Feb 21 23:32:27 2017 (r314062) +++ stable/11/sys/kern/subr_witness.c Wed Feb 22 00:50:36 2017 (r314063) @@ -1733,15 +1733,14 @@ witness_warn(int flags, struct lock_obje continue; if (n == 0) { va_start(ap, fmt); - witness_voutput(fmt, ap); + vprintf(fmt, ap); va_end(ap); - witness_output( - " with the following %slocks held:\n", + printf(" with the following %slocks held:\n", (flags & WARN_SLEEPOK) != 0 ? "non-sleepable " : ""); } n++; - witness_list_lock(lock1, witness_output); + witness_list_lock(lock1, printf); } /* @@ -1766,11 +1765,11 @@ witness_warn(int flags, struct lock_obje return (0); va_start(ap, fmt); - witness_voutput(fmt, ap); + vprintf(fmt, ap); va_end(ap); - witness_output(" with the following %slocks held:\n", + printf(" with the following %slocks held:\n", (flags & WARN_SLEEPOK) != 0 ? "non-sleepable " : ""); - n += witness_list_locks(&lock_list, witness_output); + n += witness_list_locks(&lock_list, printf); } else sched_unpin(); if (flags & WARN_PANIC && n) From owner-svn-src-stable-11@freebsd.org Wed Feb 22 04:15:40 2017 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 CC753CE94EC; Wed, 22 Feb 2017 04:15:40 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9893F1235; Wed, 22 Feb 2017 04:15:40 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M4Fd43051597; Wed, 22 Feb 2017 04:15:39 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M4FdmW051596; Wed, 22 Feb 2017 04:15:39 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201702220415.v1M4FdmW051596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 22 Feb 2017 04:15: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: r314072 - stable/11/crypto/openssh 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.23 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, 22 Feb 2017 04:15:40 -0000 Author: lidl Date: Wed Feb 22 04:15:39 2017 New Revision: 314072 URL: https://svnweb.freebsd.org/changeset/base/314072 Log: MFC r313965: Only notify blacklistd for successful logins in auth.c Before this change, every pass through auth.c resulted in a call to blacklist_notify(). In a normal remote login, there would be a failed login flagged for the printing of the "xxx login:" prompt, before the remote user could enter a password. If the user successfully entered a good password, then a good login would be flagged, and everything would be OK. If the user entered an incorrect password, there would be another failed login flagged in auth1.c (or auth2.c) for the actual bad password attempt. Finally, when sshd got around to issuing the second "xxx login:" prompt, there would be yet another failed login notice sent to blacklistd. So, if there was a 3 bad logins limit set (the default), the system would actually block the address after the first bad password attempt. Reported by: Rick Adams Reviewed by: des Sponsored by: The FreeBSD Foundation Modified: stable/11/crypto/openssh/auth.c Directory Properties: stable/11/ (props changed) Modified: stable/11/crypto/openssh/auth.c ============================================================================== --- stable/11/crypto/openssh/auth.c Wed Feb 22 03:49:46 2017 (r314071) +++ stable/11/crypto/openssh/auth.c Wed Feb 22 04:15:39 2017 (r314072) @@ -295,8 +295,8 @@ auth_log(Authctxt *authctxt, int authent authmsg = "Partial"; else { authmsg = authenticated ? "Accepted" : "Failed"; - BLACKLIST_NOTIFY(authenticated ? - BLACKLIST_AUTH_OK : BLACKLIST_AUTH_FAIL); + if (authenticated) + BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK); } authlog("%s %s%s%s for %s%.100s from %.200s port %d %s%s%s", From owner-svn-src-stable-11@freebsd.org Wed Feb 22 06:06:59 2017 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 85834CE8480; Wed, 22 Feb 2017 06:06:59 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 547CB1BAE; Wed, 22 Feb 2017 06:06:59 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M66w75096376; Wed, 22 Feb 2017 06:06:58 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M66wZG096374; Wed, 22 Feb 2017 06:06:58 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220606.v1M66wZG096374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 06:06:58 +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: r314083 - stable/11/sys/dev/hyperv/netvsc 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.23 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, 22 Feb 2017 06:06:59 -0000 Author: dexuan Date: Wed Feb 22 06:06:58 2017 New Revision: 314083 URL: https://svnweb.freebsd.org/changeset/base/314083 Log: MFC: 312685 Approved by: sephe(mentor) r312685 hyperv/hn: remember the channel pointer in struct hn_rx_ring This will be used by the coming NIC SR-IOV patch. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8909 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 05:11:24 2017 (r314082) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 06:06:58 2017 (r314083) @@ -4323,6 +4323,7 @@ hn_chan_attach(struct hn_softc *sc, stru KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED) == 0, ("RX ring %d already attached", idx)); rxr->hn_rx_flags |= HN_RX_FLAG_ATTACHED; + rxr->hn_chan = chan; if (bootverbose) { if_printf(sc->hn_ifp, "link RX ring %d to chan%u\n", Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Wed Feb 22 05:11:24 2017 (r314082) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Wed Feb 22 06:06:58 2017 (r314083) @@ -85,6 +85,8 @@ struct hn_rx_ring { void *hn_br; /* TX/RX bufring */ struct hyperv_dma hn_br_dma; + + struct vmbus_channel *hn_chan; } __aligned(CACHE_LINE_SIZE); #define HN_TRUST_HCSUM_IP 0x0001 From owner-svn-src-stable-11@freebsd.org Wed Feb 22 06:12:34 2017 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 E6C78CE87E2; Wed, 22 Feb 2017 06:12:34 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B30AF279; Wed, 22 Feb 2017 06:12:34 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M6CXBk000389; Wed, 22 Feb 2017 06:12:33 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M6CXmw000388; Wed, 22 Feb 2017 06:12:33 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220612.v1M6CXmw000388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 06:12: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: r314084 - stable/11/sys/dev/hyperv/netvsc 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.23 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, 22 Feb 2017 06:12:35 -0000 Author: dexuan Date: Wed Feb 22 06:12:33 2017 New Revision: 314084 URL: https://svnweb.freebsd.org/changeset/base/314084 Log: MFC: 312686 Approved by: sephe (mentor) r312686 hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt() It's unnecessary because the upper nework stack does the same checking. In the case of Hyper-V SR-IOV, we need to remove the checking because 1) multicast/broadcast packets are still received through the synthetic NIC and we need to inject the packets through the VF interface; 2) we must inject the packets even if the synthetic NIC is down, or has a different MTU from the VF device. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8962 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 06:06:58 2017 (r314083) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 06:12:33 2017 (r314084) @@ -2129,15 +2129,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v int size, do_lro = 0, do_csum = 1; int hash_type; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - return (0); - - /* - * Bail out if packet contains more data than configured MTU. - */ - if (dlen > (ifp->if_mtu + ETHER_HDR_LEN)) { - return (0); - } else if (dlen <= MHLEN) { + if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); From owner-svn-src-stable-11@freebsd.org Wed Feb 22 06:26:52 2017 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 17125CE8B64; Wed, 22 Feb 2017 06:26:52 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2DBCA32; Wed, 22 Feb 2017 06:26:51 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M6Qojj004556; Wed, 22 Feb 2017 06:26:50 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M6Qo9m004554; Wed, 22 Feb 2017 06:26:50 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220626.v1M6Qo9m004554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 06:26: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: r314085 - stable/11/sys/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.23 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, 22 Feb 2017 06:26:52 -0000 Author: dexuan Date: Wed Feb 22 06:26:50 2017 New Revision: 314085 URL: https://svnweb.freebsd.org/changeset/base/314085 Log: MFC: 312687, 312688 Approved by: sephe (mentor) r312687 ifnet: introduce event handlers for ifup/ifdown events Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and a VF NIC to work together, mainly to support seamless live migration. When the VF device becomes UP (or DOWN), the synthetic NIC driver needs to switch the data path from the synthetic NIC to the VF (or the opposite). So the synthetic NIC driver needs to know when a VF device is becoming UP or DOWN and hence the patch is made. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8963 r312688 hyperv/hn: add the support for VF drivers (SR-IOV) Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and a VF NIC to work together (both NICs have the same MAC address), mainly to support seamless live migration. When the VF device becomes UP (or DOWN), the synthetic NIC driver needs to switch the data path from the synthetic NIC to the VF (or the opposite). Note: multicast/broadcast packets are still received through the synthetic NIC and we need to inject the packets through the VF interface (if the VF is UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP). Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8964 Modified: stable/11/sys/net/if.c stable/11/sys/net/if_var.h Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Wed Feb 22 06:12:33 2017 (r314084) +++ stable/11/sys/net/if.c Wed Feb 22 06:26:50 2017 (r314085) @@ -2218,6 +2218,7 @@ void if_down(struct ifnet *ifp) { + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN); if_unroute(ifp, IFF_UP, AF_UNSPEC); } @@ -2230,6 +2231,7 @@ if_up(struct ifnet *ifp) { if_route(ifp, IFF_UP, AF_UNSPEC); + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP); } /* Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Wed Feb 22 06:12:33 2017 (r314084) +++ stable/11/sys/net/if_var.h Wed Feb 22 06:26:50 2017 (r314085) @@ -359,6 +359,11 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); +/* Interface up/down event */ +#define IFNET_EVENT_UP 0 +#define IFNET_EVENT_DOWN 1 +typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); +EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); #endif /* _SYS_EVENTHANDLER_H_ */ /* From owner-svn-src-stable-11@freebsd.org Wed Feb 22 07:42:30 2017 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 1940BCE9151; Wed, 22 Feb 2017 07:42:30 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9358166A; Wed, 22 Feb 2017 07:42:29 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M7gSE3036695; Wed, 22 Feb 2017 07:42:28 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M7gSMA036693; Wed, 22 Feb 2017 07:42:28 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220742.v1M7gSMA036693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 07:42:28 +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: r314089 - stable/11/sys/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.23 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, 22 Feb 2017 07:42:30 -0000 Author: dexuan Date: Wed Feb 22 07:42:28 2017 New Revision: 314089 URL: https://svnweb.freebsd.org/changeset/base/314089 Log: revert the MFC r314085 Sorry, I generated a wrong commit log for r314085 due to a copy&pasate mistake. Let me revert it and I'll redo the MFC. Modified: stable/11/sys/net/if.c stable/11/sys/net/if_var.h Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Wed Feb 22 07:12:20 2017 (r314088) +++ stable/11/sys/net/if.c Wed Feb 22 07:42:28 2017 (r314089) @@ -2218,7 +2218,6 @@ void if_down(struct ifnet *ifp) { - EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN); if_unroute(ifp, IFF_UP, AF_UNSPEC); } @@ -2231,7 +2230,6 @@ if_up(struct ifnet *ifp) { if_route(ifp, IFF_UP, AF_UNSPEC); - EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP); } /* Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Wed Feb 22 07:12:20 2017 (r314088) +++ stable/11/sys/net/if_var.h Wed Feb 22 07:42:28 2017 (r314089) @@ -359,11 +359,6 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); -/* Interface up/down event */ -#define IFNET_EVENT_UP 0 -#define IFNET_EVENT_DOWN 1 -typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); -EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); #endif /* _SYS_EVENTHANDLER_H_ */ /* From owner-svn-src-stable-11@freebsd.org Wed Feb 22 08:02:26 2017 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 03EC4CE9857; Wed, 22 Feb 2017 08:02:26 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5BE12E4; Wed, 22 Feb 2017 08:02:25 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M82OS7044781; Wed, 22 Feb 2017 08:02:24 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M82OLg044779; Wed, 22 Feb 2017 08:02:24 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220802.v1M82OLg044779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 08:02: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: r314090 - stable/11/sys/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.23 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, 22 Feb 2017 08:02:26 -0000 Author: dexuan Date: Wed Feb 22 08:02:24 2017 New Revision: 314090 URL: https://svnweb.freebsd.org/changeset/base/314090 Log: MFC: 312687, 312916 Approved by: sephe (mentor) r312687 ifnet: introduce event handlers for ifup/ifdown events Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and a VF NIC to work together, mainly to support seamless live migration. When the VF device becomes UP (or DOWN), the synthetic NIC driver needs to switch the data path from the synthetic NIC to the VF (or the opposite). So the synthetic NIC driver needs to know when a VF device is becoming UP or DOWN and hence the patch is made. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8963 r312916 ifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h Thank glebius for pointing this out: "The network stuff shall not be added to sys/eventhandler.h" Reviewed by: David_A_Bright_DELL.com, sephe, glebius Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9345 Modified: stable/11/sys/net/if.c stable/11/sys/net/if_var.h Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Wed Feb 22 07:42:28 2017 (r314089) +++ stable/11/sys/net/if.c Wed Feb 22 08:02:24 2017 (r314090) @@ -2218,6 +2218,7 @@ void if_down(struct ifnet *ifp) { + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN); if_unroute(ifp, IFF_UP, AF_UNSPEC); } @@ -2230,6 +2231,7 @@ if_up(struct ifnet *ifp) { if_route(ifp, IFF_UP, AF_UNSPEC); + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP); } /* Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Wed Feb 22 07:42:28 2017 (r314089) +++ stable/11/sys/net/if_var.h Wed Feb 22 08:02:24 2017 (r314090) @@ -359,6 +359,11 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); +/* Interface up/down event */ +#define IFNET_EVENT_UP 0 +#define IFNET_EVENT_DOWN 1 +typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); +EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); #endif /* _SYS_EVENTHANDLER_H_ */ /* From owner-svn-src-stable-11@freebsd.org Wed Feb 22 08:26:53 2017 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 5A0EECE9C47; Wed, 22 Feb 2017 08:26:53 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26202EAF; Wed, 22 Feb 2017 08:26:53 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M8Qqn9052997; Wed, 22 Feb 2017 08:26:52 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M8QpS4052992; Wed, 22 Feb 2017 08:26:51 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220826.v1M8QpS4052992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 08:26:51 +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: r314091 - stable/11/sys/dev/hyperv/netvsc 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.23 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, 22 Feb 2017 08:26:53 -0000 Author: dexuan Date: Wed Feb 22 08:26:51 2017 New Revision: 314091 URL: https://svnweb.freebsd.org/changeset/base/314091 Log: MFC 312688 Approved by: sephe (mentor) r312688 hyperv/hn: add the support for VF drivers (SR-IOV) Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and a VF NIC to work together (both NICs have the same MAC address), mainly to support seamless live migration. When the VF device becomes UP (or DOWN), the synthetic NIC driver needs to switch the data path from the synthetic NIC to the VF (or the opposite). Note: multicast/broadcast packets are still received through the synthetic NIC and we need to inject the packets through the VF interface (if the VF is UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP). Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8964 Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c stable/11/sys/dev/hyperv/netvsc/hn_nvs.h stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnreg.h stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Wed Feb 22 08:02:24 2017 (r314090) +++ stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Wed Feb 22 08:26:51 2017 (r314091) @@ -500,6 +500,8 @@ hn_nvs_conf_ndis(struct hn_softc *sc, in conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; conf.nvs_mtu = mtu; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; + if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) + conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; /* NOTE: No response. */ error = hn_nvs_req_send(sc, &conf, sizeof(conf)); @@ -719,3 +721,15 @@ hn_nvs_send_rndis_ctrl(struct vmbus_chan return hn_nvs_send_rndis_sglist(chan, HN_NVS_RNDIS_MTYPE_CTRL, sndc, gpa, gpa_cnt); } + +void +hn_nvs_set_datapath(struct hn_softc *sc, uint32_t path) +{ + struct hn_nvs_datapath dp; + + memset(&dp, 0, sizeof(dp)); + dp.nvs_type = HN_NVS_TYPE_SET_DATAPATH; + dp.nvs_active_path = path; + + hn_nvs_req_send(sc, &dp, sizeof(dp)); +} Modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_nvs.h Wed Feb 22 08:02:24 2017 (r314090) +++ stable/11/sys/dev/hyperv/netvsc/hn_nvs.h Wed Feb 22 08:26:51 2017 (r314091) @@ -100,6 +100,7 @@ void hn_nvs_sent_xact(struct hn_nvs_sen int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); +void hn_nvs_set_datapath(struct hn_softc *sc, uint32_t path); extern struct hn_nvs_sendctx hn_nvs_sendctx_none; Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 08:02:24 2017 (r314090) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 08:26:51 2017 (r314091) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -84,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -216,6 +218,11 @@ struct hn_rxinfo { uint32_t hash_value; }; +struct hn_update_vf { + struct hn_rx_ring *rxr; + struct ifnet *vf; +}; + #define HN_RXINFO_VLAN 0x0001 #define HN_RXINFO_CSUM 0x0002 #define HN_RXINFO_HASHINF 0x0004 @@ -295,7 +302,7 @@ static int hn_txagg_pktmax_sysctl(SYSC static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); -static void hn_stop(struct hn_softc *); +static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); @@ -707,7 +714,8 @@ hn_rxfilter_config(struct hn_softc *sc) HN_LOCK_ASSERT(sc); - if (ifp->if_flags & IFF_PROMISC) { + if ((ifp->if_flags & IFF_PROMISC) || + (sc->hn_flags & HN_FLAG_VF)) { filter = NDIS_PACKET_TYPE_PROMISCUOUS; } else { filter = NDIS_PACKET_TYPE_DIRECTED; @@ -896,6 +904,119 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmr->ifm_active |= IFM_10G_T | IFM_FDX; } +static void +hn_update_vf_task(void *arg, int pending __unused) +{ + struct hn_update_vf *uv = arg; + + uv->rxr->hn_vf = uv->vf; +} + +static void +hn_update_vf(struct hn_softc *sc, struct ifnet *vf) +{ + struct hn_rx_ring *rxr; + struct hn_update_vf uv; + struct task task; + int i; + + HN_LOCK_ASSERT(sc); + + TASK_INIT(&task, 0, hn_update_vf_task, &uv); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + + if (i < sc->hn_rx_ring_inuse) { + uv.rxr = rxr; + uv.vf = vf; + vmbus_chan_run_task(rxr->hn_chan, &task); + } else { + rxr->hn_vf = vf; + } + } +} + +static void +hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +{ + struct ifnet *hn_ifp; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + goto out; + + hn_ifp = sc->hn_ifp; + + if (ifp == hn_ifp) + goto out; + + if (ifp->if_alloctype != IFT_ETHER) + goto out; + + /* Ignore lagg/vlan interfaces */ + if (strcmp(ifp->if_dname, "lagg") == 0 || + strcmp(ifp->if_dname, "vlan") == 0) + goto out; + + if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) + goto out; + + /* Now we're sure 'ifp' is a real VF device. */ + if (vf) { + if (sc->hn_flags & HN_FLAG_VF) + goto out; + + sc->hn_flags |= HN_FLAG_VF; + hn_rxfilter_config(sc); + } else { + if (!(sc->hn_flags & HN_FLAG_VF)) + goto out; + + sc->hn_flags &= ~HN_FLAG_VF; + if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + hn_rxfilter_config(sc); + else + hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); + } + + hn_nvs_set_datapath(sc, + vf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); + + hn_update_vf(sc, vf ? ifp : NULL); + + if (vf) { + hn_suspend_mgmt(sc); + sc->hn_link_flags &= + ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); + if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + } else { + hn_resume_mgmt(sc); + } + + if (bootverbose) + if_printf(hn_ifp, "Data path is switched %s %s\n", + vf ? "to" : "from", if_name(ifp)); +out: + HN_UNLOCK(sc); +} + +static void +hn_ifnet_event(void *arg, struct ifnet *ifp, int event) +{ + if (event != IFNET_EVENT_UP && event != IFNET_EVENT_DOWN) + return; + + hn_set_vf(arg, ifp, event == IFNET_EVENT_UP); +} + +static void +hn_ifaddr_event(void *arg, struct ifnet *ifp) +{ + hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); +} + /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const struct hyperv_guid g_net_vsc_device_type = { .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -1221,6 +1342,12 @@ hn_attach(device_t dev) sc->hn_mgmt_taskq = sc->hn_mgmt_taskq0; hn_update_link_status(sc); + sc->hn_ifnet_evthand = EVENTHANDLER_REGISTER(ifnet_event, + hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); + + sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, + hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -1235,6 +1362,11 @@ hn_detach(device_t dev) struct hn_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->hn_ifp; + if (sc->hn_ifaddr_evthand != NULL) + EVENTHANDLER_DEREGISTER(ifaddr_event, sc->hn_ifaddr_evthand); + if (sc->hn_ifnet_evthand != NULL) + EVENTHANDLER_DEREGISTER(ifnet_event, sc->hn_ifnet_evthand); + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { /* * In case that the vmbus missed the orphan handler @@ -1247,7 +1379,7 @@ hn_detach(device_t dev) HN_LOCK(sc); if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - hn_stop(sc); + hn_stop(sc, true); /* * NOTE: * hn_stop() only suspends data, so managment @@ -2124,11 +2256,14 @@ static int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_rxinfo *info) { - struct ifnet *ifp = rxr->hn_ifp; + struct ifnet *ifp; struct mbuf *m_new; int size, do_lro = 0, do_csum = 1; int hash_type; + /* If the VF is active, inject the packet through the VF */ + ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { @@ -2439,7 +2574,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - hn_stop(sc); + hn_stop(sc, false); } sc->hn_if_flags = ifp->if_flags; @@ -2529,7 +2664,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } static void -hn_stop(struct hn_softc *sc) +hn_stop(struct hn_softc *sc, bool detaching) { struct ifnet *ifp = sc->hn_ifp; int i; @@ -2550,6 +2685,13 @@ hn_stop(struct hn_softc *sc) atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_oactive = 0; + + /* + * If the VF is active, make sure the filter is not 0, even if + * the synthetic NIC is down. + */ + if (!detaching && (sc->hn_flags & HN_FLAG_VF)) + hn_rxfilter_config(sc); } static void @@ -4894,7 +5036,8 @@ hn_suspend(struct hn_softc *sc) /* Disable polling. */ hn_polling(sc, 0); - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || + (sc->hn_flags & HN_FLAG_VF)) hn_suspend_data(sc); hn_suspend_mgmt(sc); } @@ -4983,9 +5126,18 @@ static void hn_resume(struct hn_softc *sc) { - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || + (sc->hn_flags & HN_FLAG_VF)) hn_resume_data(sc); - hn_resume_mgmt(sc); + + /* + * When the VF is activated, the synthetic interface is changed + * to DOWN in hn_set_vf(). Here, if the VF is still active, we + * don't call hn_resume_mgmt() until the VF is deactivated in + * hn_set_vf(). + */ + if (!(sc->hn_flags & HN_FLAG_VF)) + hn_resume_mgmt(sc); /* * Re-enable polling if this interface is running and Modified: stable/11/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnreg.h Wed Feb 22 08:02:24 2017 (r314090) +++ stable/11/sys/dev/hyperv/netvsc/if_hnreg.h Wed Feb 22 08:26:51 2017 (r314091) @@ -133,6 +133,17 @@ struct hn_nvs_ndis_init { } __packed; CTASSERT(sizeof(struct hn_nvs_ndis_init) >= HN_NVS_REQSIZE_MIN); +#define HN_NVS_DATAPATH_SYNTHETIC 0 +#define HN_NVS_DATAPATH_VF 1 + +/* No response */ +struct hn_nvs_datapath { + uint32_t nvs_type; /* HN_NVS_TYPE_SET_DATAPATH */ + uint32_t nvs_active_path;/* HN_NVS_DATAPATH_* */ + uint32_t nvs_rsvd[6]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_datapath) >= HN_NVS_REQSIZE_MIN); + struct hn_nvs_rxbuf_conn { uint32_t nvs_type; /* HN_NVS_TYPE_RXBUF_CONN */ uint32_t nvs_gpadl; /* RXBUF vmbus GPADL */ Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Wed Feb 22 08:02:24 2017 (r314090) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Wed Feb 22 08:26:51 2017 (r314091) @@ -59,6 +59,7 @@ struct hn_tx_ring; struct hn_rx_ring { struct ifnet *hn_ifp; + struct ifnet *hn_vf; /* SR-IOV VF */ struct hn_tx_ring *hn_txr; void *hn_pktbuf; int hn_pktbuf_len; @@ -234,6 +235,9 @@ struct hn_softc { int hn_rss_ind_size; uint32_t hn_rss_hash; /* NDIS_HASH_ */ struct ndis_rssprm_toeplitz hn_rss; + + eventhandler_tag hn_ifaddr_evthand; + eventhandler_tag hn_ifnet_evthand; }; #define HN_FLAG_RXBUF_CONNECTED 0x0001 @@ -244,6 +248,7 @@ struct hn_softc { #define HN_FLAG_NO_SLEEPING 0x0020 #define HN_FLAG_RXBUF_REF 0x0040 #define HN_FLAG_CHIM_REF 0x0080 +#define HN_FLAG_VF 0x0100 #define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) From owner-svn-src-stable-11@freebsd.org Wed Feb 22 08:37:53 2017 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 18E89CE9EEA; Wed, 22 Feb 2017 08:37:53 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3FB7154E; Wed, 22 Feb 2017 08:37:52 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M8bpvT057254; Wed, 22 Feb 2017 08:37:51 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M8bp5J057253; Wed, 22 Feb 2017 08:37:51 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702220837.v1M8bp5J057253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 22 Feb 2017 08:37:51 +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: r314092 - stable/11/sys/dev/hyperv/netvsc 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.23 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, 22 Feb 2017 08:37:53 -0000 Author: dexuan Date: Wed Feb 22 08:37:51 2017 New Revision: 314092 URL: https://svnweb.freebsd.org/changeset/base/314092 Log: MFC 312689, 312690 Approved by: sephe (mentor) r312689 hyperv/hn: add a sysctl name for the VF interface This makes it easier for the userland script to find the releated VF interface. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9101 r312690 hyperv/hn: add devctl_notify for VF_UP/DOWN events Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9102 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 08:26:51 2017 (r314091) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Wed Feb 22 08:37:51 2017 (r314092) @@ -301,6 +301,7 @@ static int hn_txagg_pkts_sysctl(SYSCTL static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); @@ -995,6 +996,9 @@ hn_set_vf(struct hn_softc *sc, struct if hn_resume_mgmt(sc); } + devctl_notify("HYPERV_NIC_VF", if_name(hn_ifp), + vf ? "VF_UP" : "VF_DOWN", NULL); + if (bootverbose) if_printf(hn_ifp, "Data path is switched %s %s\n", vf ? "to" : "from", if_name(ifp)); @@ -1254,6 +1258,9 @@ hn_attach(device_t dev) CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_polling_sysctl, "I", "Polling frequency: [100,1000000], 0 disable polling"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "vf", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_vf_sysctl, "A", "Virtual Function's name"); /* * Setup the ifmedia, which has been initialized earlier. @@ -3222,6 +3229,22 @@ hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_vf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char vf_name[128]; + struct ifnet *vf; + + HN_LOCK(sc); + vf_name[0] = '\0'; + vf = sc->hn_rx_ring[0].hn_vf; + if (vf != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + HN_UNLOCK(sc); + return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; From owner-svn-src-stable-11@freebsd.org Wed Feb 22 08:49:53 2017 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 C8CC4CE71C4; Wed, 22 Feb 2017 08:49:53 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E0A1B21; Wed, 22 Feb 2017 08:49:53 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1M8nqBJ061390; Wed, 22 Feb 2017 08:49:52 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1M8nqB8061389; Wed, 22 Feb 2017 08:49:52 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201702220849.v1M8nqB8061389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 22 Feb 2017 08:49: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: r314093 - stable/11/sys/dev/bxe 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.23 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, 22 Feb 2017 08:49:53 -0000 Author: royger Date: Wed Feb 22 08:49:52 2017 New Revision: 314093 URL: https://svnweb.freebsd.org/changeset/base/314093 Log: MFC r313771 bxe: enable usage with NetXtreme II BCM57840 2x20GbE chip Sponsored by: Citrix Systems R&D Modified: stable/11/sys/dev/bxe/bxe.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Wed Feb 22 08:37:51 2017 (r314092) +++ stable/11/sys/dev/bxe/bxe.c Wed Feb 22 08:49:52 2017 (r314093) @@ -168,6 +168,12 @@ static struct bxe_device_type bxe_devs[] }, { BRCM_VENDORID, + CHIP_NUM_57840_2_20, + PCI_ANY_ID, PCI_ANY_ID, + "QLogic NetXtreme II BCM57840 2x20GbE" + }, + { + BRCM_VENDORID, CHIP_NUM_57840_MF, PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57840 MF 10GbE" From owner-svn-src-stable-11@freebsd.org Wed Feb 22 17:57:21 2017 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 01C9BCE9CC5; Wed, 22 Feb 2017 17:57:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B544F1330; Wed, 22 Feb 2017 17:57:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1MHvJTt092771; Wed, 22 Feb 2017 17:57:19 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1MHvJTX092770; Wed, 22 Feb 2017 17:57:19 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201702221757.v1MHvJTX092770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 22 Feb 2017 17:57: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: r314102 - stable/11/sys/dev/e1000 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.23 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, 22 Feb 2017 17:57:21 -0000 Author: marius Date: Wed Feb 22 17:57:19 2017 New Revision: 314102 URL: https://svnweb.freebsd.org/changeset/base/314102 Log: MFC: r311979 Reset the EIAC register to include the LINK status bit and restore link up/down notifications. Modified: stable/11/sys/dev/e1000/if_em.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/if_em.c ============================================================================== --- stable/11/sys/dev/e1000/if_em.c Wed Feb 22 17:20:18 2017 (r314101) +++ stable/11/sys/dev/e1000/if_em.c Wed Feb 22 17:57:19 2017 (r314102) @@ -5114,7 +5114,7 @@ em_enable_intr(struct adapter *adapter) u32 ims_mask = IMS_ENABLE_MASK; if (hw->mac.type == e1000_82574) { - E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); + E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); ims_mask |= adapter->ims; } E1000_WRITE_REG(hw, E1000_IMS, ims_mask); From owner-svn-src-stable-11@freebsd.org Wed Feb 22 19:58:01 2017 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 22B0CCE6435; Wed, 22 Feb 2017 19:58:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD49B114C; Wed, 22 Feb 2017 19:58:00 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1MJw0nZ043744; Wed, 22 Feb 2017 19:58:00 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1MJvxvD043737; Wed, 22 Feb 2017 19:57:59 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702221957.v1MJvxvD043737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 Feb 2017 19:57: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: r314107 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux 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.23 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, 22 Feb 2017 19:58:01 -0000 Author: dchagin Date: Wed Feb 22 19:57:59 2017 New Revision: 314107 URL: https://svnweb.freebsd.org/changeset/base/314107 Log: MFC r313284: Update syscall.master to 4.10-rc6. Also fix comments, a typo, and wrong numbering for a few unimplemented syscalls. For 32-bit Linuxulator, socketcall() syscall was historically the entry point for the sockets API. Starting in Linux 4.3, direct syscalls are provided for the sockets API. Enable it. The initial version of patch was provided by trasz@ and extended by me. MFC r313285: Regen after r313284. MFC r313684: Fix r313284. Members of the syscall argument structures are padded to a word size. So, for COMPAT_LINUX32 we should convert user supplied system call arguments which is 32-bit in that case to the array of register_t. MFC r313912: Finish r313684. Convert linux_recv(), linux_send() and linux_accept() system call arguments to the register_t type too. Modified: stable/11/sys/amd64/linux/linux_dummy.c stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_syscall.h stable/11/sys/amd64/linux/linux_syscalls.c stable/11/sys/amd64/linux/linux_sysent.c stable/11/sys/amd64/linux/linux_systrace_args.c stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/linux32_dummy.c stable/11/sys/amd64/linux32/linux32_proto.h stable/11/sys/amd64/linux32/linux32_syscall.h stable/11/sys/amd64/linux32/linux32_syscalls.c stable/11/sys/amd64/linux32/linux32_sysent.c stable/11/sys/amd64/linux32/linux32_systrace_args.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/linux_socket.c stable/11/sys/compat/linux/linux_socket.h stable/11/sys/i386/linux/linux_dummy.c stable/11/sys/i386/linux/linux_proto.h stable/11/sys/i386/linux/linux_syscall.h stable/11/sys/i386/linux/linux_syscalls.c stable/11/sys/i386/linux/linux_sysent.c stable/11/sys/i386/linux/linux_systrace_args.c stable/11/sys/i386/linux/syscalls.master Modified: stable/11/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/11/sys/amd64/linux/linux_dummy.c Wed Feb 22 19:39:54 2017 (r314106) +++ stable/11/sys/amd64/linux/linux_dummy.c Wed Feb 22 19:57:59 2017 (r314107) @@ -82,41 +82,86 @@ DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); +/* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); +/* linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); +/* linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(unshare); +/* linux 2.6.17: */ DUMMY(splice); DUMMY(tee); DUMMY(sync_file_range); DUMMY(vmsplice); +/* linux 2.6.18: */ DUMMY(move_pages); +/* linux 2.6.22: */ DUMMY(signalfd); -DUMMY(timerfd); +DUMMY(timerfd_create); +/* linux 2.6.25: */ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); +/* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); +/* linux 2.6.30: */ DUMMY(preadv); DUMMY(pwritev); -DUMMY(rt_tsigqueueinfo); +/* linux 2.6.31: */ +DUMMY(rt_tgsigqueueinfo); DUMMY(perf_event_open); +/* linux 2.6.38: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); +/* linux 2.6.39: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); +/* linux 3.0: */ DUMMY(setns); +DUMMY(getcpu); +/* linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); +/* linux 3.5: */ DUMMY(kcmp); +/* linux 3.8: */ DUMMY(finit_module); +DUMMY(sched_setattr); +DUMMY(sched_getattr); +/* linux 3.14: */ +DUMMY(renameat2); +/* linux 3.15: */ +DUMMY(seccomp); +DUMMY(getrandom); +DUMMY(memfd_create); +DUMMY(kexec_file_load); +/* linux 3.18: */ +DUMMY(bpf); +/* linux 3.19: */ +DUMMY(execveat); +/* linux 4.2: */ +DUMMY(userfaultfd); +/* linux 4.3: */ +DUMMY(membarrier); +/* linux 4.4: */ +DUMMY(mlock2); +/* linux 4.5: */ +DUMMY(copy_file_range); +/* linux 4.6: */ +DUMMY(preadv2); +DUMMY(pwritev2); +/* linux 4.8: */ +DUMMY(pkey_mprotect); +DUMMY(pkey_alloc); +DUMMY(pkey_free); #define DUMMY_XATTR(s) \ int \ Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Wed Feb 22 19:39:54 2017 (r314106) +++ stable/11/sys/amd64/linux/linux_proto.h Wed Feb 22 19:57:59 2017 (r314107) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1000,7 +1000,7 @@ struct linux_epoll_pwait_args { struct linux_signalfd_args { register_t dummy; }; -struct linux_timerfd_args { +struct linux_timerfd_create_args { register_t dummy; }; struct linux_eventfd_args { @@ -1044,16 +1044,27 @@ struct linux_pipe2_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_inotify_init1_args { - register_t dummy; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_preadv_args { - register_t dummy; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)]; + char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)]; + char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)]; + char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)]; }; struct linux_pwritev_args { - register_t dummy; -}; -struct linux_rt_tsigqueueinfo_args { - register_t dummy; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)]; + char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)]; + char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)]; + char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)]; +}; +struct linux_rt_tgsigqueueinfo_args { + char tgid_l_[PADL_(l_pid_t)]; l_pid_t tgid; char tgid_r_[PADR_(l_pid_t)]; + char tid_l_[PADL_(l_pid_t)]; l_pid_t tid; char tid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char uinfo_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * uinfo; char uinfo_r_[PADR_(l_siginfo_t *)]; }; struct linux_perf_event_open_args { register_t dummy; @@ -1096,19 +1107,141 @@ struct linux_sendmmsg_args { char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_setns_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char nstype_l_[PADL_(l_int)]; l_int nstype; char nstype_r_[PADR_(l_int)]; +}; +struct linux_getcpu_args { + char cpu_l_[PADL_(l_uint *)]; l_uint * cpu; char cpu_r_[PADR_(l_uint *)]; + char node_l_[PADL_(l_uint *)]; l_uint * node; char node_r_[PADR_(l_uint *)]; + char cache_l_[PADL_(void *)]; void * cache; char cache_r_[PADR_(void *)]; }; struct linux_process_vm_readv_args { - register_t dummy; + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)]; + char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)]; + char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)]; + char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; }; struct linux_process_vm_writev_args { - register_t dummy; + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)]; + char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)]; + char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)]; + char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; }; struct linux_kcmp_args { - register_t dummy; + char pid1_l_[PADL_(l_pid_t)]; l_pid_t pid1; char pid1_r_[PADR_(l_pid_t)]; + char pid2_l_[PADL_(l_pid_t)]; l_pid_t pid2; char pid2_r_[PADR_(l_pid_t)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char idx1_l_[PADL_(l_ulong)]; l_ulong idx1; char idx1_r_[PADR_(l_ulong)]; + char idx_l_[PADL_(l_ulong)]; l_ulong idx; char idx_r_[PADR_(l_ulong)]; }; struct linux_finit_module_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_sched_setattr_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_sched_getattr_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)]; + char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_renameat2_args { + char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; +}; +struct linux_seccomp_args { + char op_l_[PADL_(l_uint)]; l_uint op; char op_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)]; +}; +struct linux_getrandom_args { + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_memfd_create_args { + char uname_ptr_l_[PADL_(const char *)]; const char * uname_ptr; char uname_ptr_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_kexec_file_load_args { + char kernel_fd_l_[PADL_(l_int)]; l_int kernel_fd; char kernel_fd_r_[PADR_(l_int)]; + char initrd_fd_l_[PADL_(l_int)]; l_int initrd_fd; char initrd_fd_r_[PADR_(l_int)]; + char cmdline_len_l_[PADL_(l_ulong)]; l_ulong cmdline_len; char cmdline_len_r_[PADR_(l_ulong)]; + char cmdline_ptr_l_[PADL_(const char *)]; const char * cmdline_ptr; char cmdline_ptr_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; +}; +struct linux_bpf_args { + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)]; + char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)]; +}; +struct linux_execveat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char argv_l_[PADL_(const char **)]; const char ** argv; char argv_r_[PADR_(const char **)]; + char envp_l_[PADL_(const char **)]; const char ** envp; char envp_r_[PADR_(const char **)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_userfaultfd_args { + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_membarrier_args { + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_mlock2_args { + char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_copy_file_range_args { + char fd_in_l_[PADL_(l_int)]; l_int fd_in; char fd_in_r_[PADR_(l_int)]; + char off_in_l_[PADL_(l_loff_t *)]; l_loff_t * off_in; char off_in_r_[PADR_(l_loff_t *)]; + char fd_out_l_[PADL_(l_int)]; l_int fd_out; char fd_out_r_[PADR_(l_int)]; + char off_out_l_[PADL_(l_loff_t *)]; l_loff_t * off_out; char off_out_r_[PADR_(l_loff_t *)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_preadv2_args { + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char vec_l_[PADL_(const struct iovec *)]; const struct iovec * vec; char vec_r_[PADR_(const struct iovec *)]; + char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)]; + char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)]; + char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_pwritev2_args { + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char vec_l_[PADL_(const struct iovec *)]; const struct iovec * vec; char vec_r_[PADR_(const struct iovec *)]; + char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)]; + char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)]; + char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_pkey_mprotect_args { + char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)]; + char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; +}; +struct linux_pkey_alloc_args { + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char init_val_l_[PADL_(l_ulong)]; l_ulong init_val; char init_val_r_[PADR_(l_ulong)]; +}; +struct linux_pkey_free_args { + char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; #define nosys linux_nosys int linux_open(struct thread *, struct linux_open_args *); @@ -1339,7 +1472,7 @@ int linux_move_pages(struct thread *, st int linux_utimensat(struct thread *, struct linux_utimensat_args *); int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *); int linux_signalfd(struct thread *, struct linux_signalfd_args *); -int linux_timerfd(struct thread *, struct linux_timerfd_args *); +int linux_timerfd_create(struct thread *, struct linux_timerfd_create_args *); int linux_eventfd(struct thread *, struct linux_eventfd_args *); int linux_fallocate(struct thread *, struct linux_fallocate_args *); int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *); @@ -1353,7 +1486,7 @@ int linux_pipe2(struct thread *, struct int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *); int linux_preadv(struct thread *, struct linux_preadv_args *); int linux_pwritev(struct thread *, struct linux_pwritev_args *); -int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *); +int linux_rt_tgsigqueueinfo(struct thread *, struct linux_rt_tgsigqueueinfo_args *); int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *); int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *); int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *); @@ -1365,10 +1498,29 @@ int linux_clock_adjtime(struct thread *, int linux_syncfs(struct thread *, struct linux_syncfs_args *); int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *); int linux_setns(struct thread *, struct linux_setns_args *); +int linux_getcpu(struct thread *, struct linux_getcpu_args *); int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *); int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *); int linux_kcmp(struct thread *, struct linux_kcmp_args *); int linux_finit_module(struct thread *, struct linux_finit_module_args *); +int linux_sched_setattr(struct thread *, struct linux_sched_setattr_args *); +int linux_sched_getattr(struct thread *, struct linux_sched_getattr_args *); +int linux_renameat2(struct thread *, struct linux_renameat2_args *); +int linux_seccomp(struct thread *, struct linux_seccomp_args *); +int linux_getrandom(struct thread *, struct linux_getrandom_args *); +int linux_memfd_create(struct thread *, struct linux_memfd_create_args *); +int linux_kexec_file_load(struct thread *, struct linux_kexec_file_load_args *); +int linux_bpf(struct thread *, struct linux_bpf_args *); +int linux_execveat(struct thread *, struct linux_execveat_args *); +int linux_userfaultfd(struct thread *, struct linux_userfaultfd_args *); +int linux_membarrier(struct thread *, struct linux_membarrier_args *); +int linux_mlock2(struct thread *, struct linux_mlock2_args *); +int linux_copy_file_range(struct thread *, struct linux_copy_file_range_args *); +int linux_preadv2(struct thread *, struct linux_preadv2_args *); +int linux_pwritev2(struct thread *, struct linux_pwritev2_args *); +int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); +int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); +int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); #ifdef COMPAT_43 @@ -1632,7 +1784,7 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT #define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL #define LINUX_SYS_AUE_linux_signalfd AUE_NULL -#define LINUX_SYS_AUE_linux_timerfd AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL #define LINUX_SYS_AUE_linux_eventfd AUE_NULL #define LINUX_SYS_AUE_linux_fallocate AUE_NULL #define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL @@ -1646,7 +1798,7 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL #define LINUX_SYS_AUE_linux_preadv AUE_NULL #define LINUX_SYS_AUE_linux_pwritev AUE_NULL -#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL +#define LINUX_SYS_AUE_linux_rt_tgsigqueueinfo AUE_NULL #define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL #define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL #define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL @@ -1658,10 +1810,29 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_syncfs AUE_SYNC #define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL #define LINUX_SYS_AUE_linux_setns AUE_NULL +#define LINUX_SYS_AUE_linux_getcpu AUE_NULL #define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL #define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL #define LINUX_SYS_AUE_linux_kcmp AUE_NULL #define LINUX_SYS_AUE_linux_finit_module AUE_NULL +#define LINUX_SYS_AUE_linux_sched_setattr AUE_NULL +#define LINUX_SYS_AUE_linux_sched_getattr AUE_NULL +#define LINUX_SYS_AUE_linux_renameat2 AUE_NULL +#define LINUX_SYS_AUE_linux_seccomp AUE_NULL +#define LINUX_SYS_AUE_linux_getrandom AUE_NULL +#define LINUX_SYS_AUE_linux_memfd_create AUE_NULL +#define LINUX_SYS_AUE_linux_kexec_file_load AUE_NULL +#define LINUX_SYS_AUE_linux_bpf AUE_NULL +#define LINUX_SYS_AUE_linux_execveat AUE_NULL +#define LINUX_SYS_AUE_linux_userfaultfd AUE_NULL +#define LINUX_SYS_AUE_linux_membarrier AUE_NULL +#define LINUX_SYS_AUE_linux_mlock2 AUE_NULL +#define LINUX_SYS_AUE_linux_copy_file_range AUE_NULL +#define LINUX_SYS_AUE_linux_preadv2 AUE_NULL +#define LINUX_SYS_AUE_linux_pwritev2 AUE_NULL +#define LINUX_SYS_AUE_linux_pkey_mprotect AUE_NULL +#define LINUX_SYS_AUE_linux_pkey_alloc AUE_NULL +#define LINUX_SYS_AUE_linux_pkey_free AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/11/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/11/sys/amd64/linux/linux_syscall.h Wed Feb 22 19:39:54 2017 (r314106) +++ stable/11/sys/amd64/linux/linux_syscall.h Wed Feb 22 19:57:59 2017 (r314107) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin */ #define LINUX_SYS_read 0 @@ -277,7 +277,7 @@ #define LINUX_SYS_linux_utimensat 280 #define LINUX_SYS_linux_epoll_pwait 281 #define LINUX_SYS_linux_signalfd 282 -#define LINUX_SYS_linux_timerfd 283 +#define LINUX_SYS_linux_timerfd_create 283 #define LINUX_SYS_linux_eventfd 284 #define LINUX_SYS_linux_fallocate 285 #define LINUX_SYS_linux_timerfd_settime 286 @@ -291,7 +291,7 @@ #define LINUX_SYS_linux_inotify_init1 294 #define LINUX_SYS_linux_preadv 295 #define LINUX_SYS_linux_pwritev 296 -#define LINUX_SYS_linux_rt_tsigqueueinfo 297 +#define LINUX_SYS_linux_rt_tgsigqueueinfo 297 #define LINUX_SYS_linux_perf_event_open 298 #define LINUX_SYS_linux_recvmmsg 299 #define LINUX_SYS_linux_fanotify_init 300 @@ -303,8 +303,27 @@ #define LINUX_SYS_linux_syncfs 306 #define LINUX_SYS_linux_sendmmsg 307 #define LINUX_SYS_linux_setns 308 -#define LINUX_SYS_linux_process_vm_readv 309 -#define LINUX_SYS_linux_process_vm_writev 310 -#define LINUX_SYS_linux_kcmp 311 -#define LINUX_SYS_linux_finit_module 312 -#define LINUX_SYS_MAXSYSCALL 314 +#define LINUX_SYS_linux_getcpu 309 +#define LINUX_SYS_linux_process_vm_readv 310 +#define LINUX_SYS_linux_process_vm_writev 311 +#define LINUX_SYS_linux_kcmp 312 +#define LINUX_SYS_linux_finit_module 313 +#define LINUX_SYS_linux_sched_setattr 314 +#define LINUX_SYS_linux_sched_getattr 315 +#define LINUX_SYS_linux_renameat2 316 +#define LINUX_SYS_linux_seccomp 317 +#define LINUX_SYS_linux_getrandom 318 +#define LINUX_SYS_linux_memfd_create 319 +#define LINUX_SYS_linux_kexec_file_load 320 +#define LINUX_SYS_linux_bpf 321 +#define LINUX_SYS_linux_execveat 322 +#define LINUX_SYS_linux_userfaultfd 323 +#define LINUX_SYS_linux_membarrier 324 +#define LINUX_SYS_linux_mlock2 325 +#define LINUX_SYS_linux_copy_file_range 326 +#define LINUX_SYS_linux_preadv2 327 +#define LINUX_SYS_linux_pwritev2 328 +#define LINUX_SYS_linux_pkey_mprotect 329 +#define LINUX_SYS_linux_pkey_alloc 330 +#define LINUX_SYS_linux_pkey_free 331 +#define LINUX_SYS_MAXSYSCALL 333 Modified: stable/11/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux/linux_syscalls.c Wed Feb 22 19:39:54 2017 (r314106) +++ stable/11/sys/amd64/linux/linux_syscalls.c Wed Feb 22 19:57:59 2017 (r314107) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin */ const char *linux_syscallnames[] = { @@ -217,7 +217,7 @@ const char *linux_syscallnames[] = { "#206", /* 206 = linux_io_setup */ "#207", /* 207 = linux_io_destroy */ "#208", /* 208 = linux_io_getevents */ - "#209", /* 209 = inux_io_submit */ + "#209", /* 209 = linux_io_submit */ "#210", /* 210 = linux_io_cancel */ "#211", /* 211 = linux_get_thread_area */ "linux_lookup_dcookie", /* 212 = linux_lookup_dcookie */ @@ -291,7 +291,7 @@ const char *linux_syscallnames[] = { "linux_utimensat", /* 280 = linux_utimensat */ "linux_epoll_pwait", /* 281 = linux_epoll_pwait */ "linux_signalfd", /* 282 = linux_signalfd */ - "linux_timerfd", /* 283 = linux_timerfd */ + "linux_timerfd_create", /* 283 = linux_timerfd_create */ "linux_eventfd", /* 284 = linux_eventfd */ "linux_fallocate", /* 285 = linux_fallocate */ "linux_timerfd_settime", /* 286 = linux_timerfd_settime */ @@ -305,7 +305,7 @@ const char *linux_syscallnames[] = { "linux_inotify_init1", /* 294 = linux_inotify_init1 */ "linux_preadv", /* 295 = linux_preadv */ "linux_pwritev", /* 296 = linux_pwritev */ - "linux_rt_tsigqueueinfo", /* 297 = linux_rt_tsigqueueinfo */ + "linux_rt_tgsigqueueinfo", /* 297 = linux_rt_tgsigqueueinfo */ "linux_perf_event_open", /* 298 = linux_perf_event_open */ "linux_recvmmsg", /* 299 = linux_recvmmsg */ "linux_fanotify_init", /* 300 = linux_fanotify_init */ @@ -317,9 +317,28 @@ const char *linux_syscallnames[] = { "linux_syncfs", /* 306 = linux_syncfs */ "linux_sendmmsg", /* 307 = linux_sendmmsg */ "linux_setns", /* 308 = linux_setns */ - "linux_process_vm_readv", /* 309 = linux_process_vm_readv */ - "linux_process_vm_writev", /* 310 = linux_process_vm_writev */ - "linux_kcmp", /* 311 = linux_kcmp */ - "linux_finit_module", /* 312 = linux_finit_module */ - "#313", /* 313 = nosys */ + "linux_getcpu", /* 309 = linux_getcpu */ + "linux_process_vm_readv", /* 310 = linux_process_vm_readv */ + "linux_process_vm_writev", /* 311 = linux_process_vm_writev */ + "linux_kcmp", /* 312 = linux_kcmp */ + "linux_finit_module", /* 313 = linux_finit_module */ + "linux_sched_setattr", /* 314 = linux_sched_setattr */ + "linux_sched_getattr", /* 315 = linux_sched_getattr */ + "linux_renameat2", /* 316 = linux_renameat2 */ + "linux_seccomp", /* 317 = linux_seccomp */ + "linux_getrandom", /* 318 = linux_getrandom */ + "linux_memfd_create", /* 319 = linux_memfd_create */ + "linux_kexec_file_load", /* 320 = linux_kexec_file_load */ + "linux_bpf", /* 321 = linux_bpf */ + "linux_execveat", /* 322 = linux_execveat */ + "linux_userfaultfd", /* 323 = linux_userfaultfd */ + "linux_membarrier", /* 324 = linux_membarrier */ + "linux_mlock2", /* 325 = linux_mlock2 */ + "linux_copy_file_range", /* 326 = linux_copy_file_range */ + "linux_preadv2", /* 327 = linux_preadv2 */ + "linux_pwritev2", /* 328 = linux_pwritev2 */ + "linux_pkey_mprotect", /* 329 = linux_pkey_mprotect */ + "linux_pkey_alloc", /* 330 = linux_pkey_alloc */ + "linux_pkey_free", /* 331 = linux_pkey_free */ + "#332", /* 332 = nosys */ }; Modified: stable/11/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysent.c Wed Feb 22 19:39:54 2017 (r314106) +++ stable/11/sys/amd64/linux/linux_sysent.c Wed Feb 22 19:57:59 2017 (r314107) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin */ #include @@ -227,7 +227,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 206 = linux_io_setup */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 207 = linux_io_destroy */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = inux_io_submit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = linux_io_cancel */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = linux_get_thread_area */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 212 = linux_lookup_dcookie */ @@ -301,7 +301,7 @@ struct sysent linux_sysent[] = { { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */ - { 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */ + { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */ @@ -312,10 +312,10 @@ struct sysent linux_sysent[] = { { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 291 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 292 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 293 = linux_pipe2 */ - { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 294 = linux_inotify_init1 */ - { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 295 = linux_preadv */ - { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 296 = linux_pwritev */ - { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 297 = linux_rt_tsigqueueinfo */ + { AS(linux_inotify_init1_args), (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 294 = linux_inotify_init1 */ + { AS(linux_preadv_args), (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 295 = linux_preadv */ + { AS(linux_pwritev_args), (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 296 = linux_pwritev */ + { AS(linux_rt_tgsigqueueinfo_args), (sy_call_t *)linux_rt_tgsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 297 = linux_rt_tgsigqueueinfo */ { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 298 = linux_perf_event_open */ { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 299 = linux_recvmmsg */ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 300 = linux_fanotify_init */ @@ -326,10 +326,29 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_clock_adjtime */ { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_syncfs */ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_sendmmsg */ - { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */ - { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_process_vm_readv */ - { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_writev */ - { 0, (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_kcmp */ - { 0, (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_finit_module */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = nosys */ + { AS(linux_setns_args), (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */ + { AS(linux_getcpu_args), (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_getcpu */ + { AS(linux_process_vm_readv_args), (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_readv */ + { AS(linux_process_vm_writev_args), (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_process_vm_writev */ + { AS(linux_kcmp_args), (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_kcmp */ + { AS(linux_finit_module_args), (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 313 = linux_finit_module */ + { AS(linux_sched_setattr_args), (sy_call_t *)linux_sched_setattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sched_setattr */ + { AS(linux_sched_getattr_args), (sy_call_t *)linux_sched_getattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_sched_getattr */ + { AS(linux_renameat2_args), (sy_call_t *)linux_renameat2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_renameat2 */ + { AS(linux_seccomp_args), (sy_call_t *)linux_seccomp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_seccomp */ + { AS(linux_getrandom_args), (sy_call_t *)linux_getrandom, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getrandom */ + { AS(linux_memfd_create_args), (sy_call_t *)linux_memfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_memfd_create */ + { AS(linux_kexec_file_load_args), (sy_call_t *)linux_kexec_file_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_kexec_file_load */ + { AS(linux_bpf_args), (sy_call_t *)linux_bpf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_bpf */ + { AS(linux_execveat_args), (sy_call_t *)linux_execveat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_execveat */ + { AS(linux_userfaultfd_args), (sy_call_t *)linux_userfaultfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_userfaultfd */ + { AS(linux_membarrier_args), (sy_call_t *)linux_membarrier, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_membarrier */ + { AS(linux_mlock2_args), (sy_call_t *)linux_mlock2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_mlock2 */ + { AS(linux_copy_file_range_args), (sy_call_t *)linux_copy_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_copy_file_range */ + { AS(linux_preadv2_args), (sy_call_t *)linux_preadv2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_preadv2 */ + { AS(linux_pwritev2_args), (sy_call_t *)linux_pwritev2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_pwritev2 */ + { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_pkey_mprotect */ + { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_pkey_alloc */ + { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pkey_free */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 332 = nosys */ }; Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Wed Feb 22 19:39:54 2017 (r314106) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Wed Feb 22 19:57:59 2017 (r314107) @@ -2076,7 +2076,7 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* linux_timerfd */ + /* linux_timerfd_create */ case 283: { *n_args = 0; break; @@ -2157,22 +2157,41 @@ systrace_args(int sysnum, void *params, } /* linux_inotify_init1 */ case 294: { - *n_args = 0; + struct linux_inotify_init1_args *p = params; + iarg[0] = p->flags; /* l_int */ + *n_args = 1; break; } /* linux_preadv */ case 295: { - *n_args = 0; + struct linux_preadv_args *p = params; + iarg[0] = p->fd; /* l_ulong */ + uarg[1] = (intptr_t) p->vec; /* struct iovec * */ + iarg[2] = p->vlen; /* l_ulong */ + iarg[3] = p->pos_l; /* l_ulong */ + iarg[4] = p->pos_h; /* l_ulong */ + *n_args = 5; break; } /* linux_pwritev */ case 296: { - *n_args = 0; + struct linux_pwritev_args *p = params; + iarg[0] = p->fd; /* l_ulong */ + uarg[1] = (intptr_t) p->vec; /* struct iovec * */ + iarg[2] = p->vlen; /* l_ulong */ + iarg[3] = p->pos_l; /* l_ulong */ + iarg[4] = p->pos_h; /* l_ulong */ + *n_args = 5; break; } - /* linux_rt_tsigqueueinfo */ + /* linux_rt_tgsigqueueinfo */ case 297: { - *n_args = 0; + struct linux_rt_tgsigqueueinfo_args *p = params; + iarg[0] = p->tgid; /* l_pid_t */ + iarg[1] = p->tid; /* l_pid_t */ + iarg[2] = p->sig; /* l_int */ + uarg[3] = (intptr_t) p->uinfo; /* l_siginfo_t * */ + *n_args = 4; break; } /* linux_perf_event_open */ @@ -2245,27 +2264,235 @@ systrace_args(int sysnum, void *params, } /* linux_setns */ case 308: { - *n_args = 0; + struct linux_setns_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->nstype; /* l_int */ + *n_args = 2; break; } - /* linux_process_vm_readv */ + /* linux_getcpu */ case 309: { - *n_args = 0; + struct linux_getcpu_args *p = params; + uarg[0] = (intptr_t) p->cpu; /* l_uint * */ + uarg[1] = (intptr_t) p->node; /* l_uint * */ + uarg[2] = (intptr_t) p->cache; /* void * */ + *n_args = 3; break; } - /* linux_process_vm_writev */ + /* linux_process_vm_readv */ case 310: { - *n_args = 0; + struct linux_process_vm_readv_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->lvec; /* const struct iovec * */ + iarg[2] = p->liovcnt; /* l_ulong */ + uarg[3] = (intptr_t) p->rvec; /* const struct iovec * */ + iarg[4] = p->riovcnt; /* l_ulong */ + iarg[5] = p->flags; /* l_ulong */ + *n_args = 6; break; } - /* linux_kcmp */ + /* linux_process_vm_writev */ case 311: { - *n_args = 0; + struct linux_process_vm_writev_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->lvec; /* const struct iovec * */ + iarg[2] = p->liovcnt; /* l_ulong */ + uarg[3] = (intptr_t) p->rvec; /* const struct iovec * */ + iarg[4] = p->riovcnt; /* l_ulong */ + iarg[5] = p->flags; /* l_ulong */ + *n_args = 6; break; } - /* linux_finit_module */ + /* linux_kcmp */ case 312: { - *n_args = 0; + struct linux_kcmp_args *p = params; + iarg[0] = p->pid1; /* l_pid_t */ + iarg[1] = p->pid2; /* l_pid_t */ + iarg[2] = p->type; /* l_int */ + iarg[3] = p->idx1; /* l_ulong */ + iarg[4] = p->idx; /* l_ulong */ + *n_args = 5; + break; + } + /* linux_finit_module */ + case 313: { + struct linux_finit_module_args *p = params; + iarg[0] = p->fd; /* l_int */ + uarg[1] = (intptr_t) p->uargs; /* const char * */ + iarg[2] = p->flags; /* l_int */ + *n_args = 3; + break; + } + /* linux_sched_setattr */ + case 314: { + struct linux_sched_setattr_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->attr; /* void * */ + iarg[2] = p->flags; /* l_uint */ + *n_args = 3; + break; + } + /* linux_sched_getattr */ + case 315: { + struct linux_sched_getattr_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->attr; /* void * */ + iarg[2] = p->size; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; + break; + } + /* linux_renameat2 */ + case 316: { + struct linux_renameat2_args *p = params; + iarg[0] = p->oldfd; /* l_int */ + uarg[1] = (intptr_t) p->oldname; /* const char * */ + iarg[2] = p->newfd; /* l_int */ + uarg[3] = (intptr_t) p->newname; /* const char * */ + uarg[4] = p->flags; /* unsigned int */ + *n_args = 5; + break; + } + /* linux_seccomp */ + case 317: { + struct linux_seccomp_args *p = params; + iarg[0] = p->op; /* l_uint */ + iarg[1] = p->flags; /* l_uint */ + uarg[2] = (intptr_t) p->uargs; /* const char * */ + *n_args = 3; + break; + } + /* linux_getrandom */ + case 318: { + struct linux_getrandom_args *p = params; + uarg[0] = (intptr_t) p->buf; /* char * */ + iarg[1] = p->count; /* l_size_t */ + iarg[2] = p->flags; /* l_uint */ + *n_args = 3; + break; + } + /* linux_memfd_create */ + case 319: { + struct linux_memfd_create_args *p = params; + uarg[0] = (intptr_t) p->uname_ptr; /* const char * */ + iarg[1] = p->flags; /* l_uint */ + *n_args = 2; + break; + } + /* linux_kexec_file_load */ + case 320: { + struct linux_kexec_file_load_args *p = params; + iarg[0] = p->kernel_fd; /* l_int */ + iarg[1] = p->initrd_fd; /* l_int */ + iarg[2] = p->cmdline_len; /* l_ulong */ + uarg[3] = (intptr_t) p->cmdline_ptr; /* const char * */ + iarg[4] = p->flags; /* l_ulong */ + *n_args = 5; + break; + } + /* linux_bpf */ + case 321: { + struct linux_bpf_args *p = params; + iarg[0] = p->cmd; /* l_int */ + uarg[1] = (intptr_t) p->attr; /* void * */ + iarg[2] = p->size; /* l_uint */ + *n_args = 3; + break; + } + /* linux_execveat */ + case 322: { + struct linux_execveat_args *p = params; + iarg[0] = p->dfd; /* l_int */ + uarg[1] = (intptr_t) p->filename; /* const char * */ + uarg[2] = (intptr_t) p->argv; /* const char ** */ + uarg[3] = (intptr_t) p->envp; /* const char ** */ + iarg[4] = p->flags; /* l_int */ + *n_args = 5; + break; + } + /* linux_userfaultfd */ + case 323: { + struct linux_userfaultfd_args *p = params; + iarg[0] = p->flags; /* l_int */ + *n_args = 1; + break; + } + /* linux_membarrier */ + case 324: { + struct linux_membarrier_args *p = params; + iarg[0] = p->cmd; /* l_int */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; + break; + } + /* linux_mlock2 */ + case 325: { + struct linux_mlock2_args *p = params; + iarg[0] = p->start; /* l_ulong */ + iarg[1] = p->len; /* l_size_t */ + iarg[2] = p->flags; /* l_int */ + *n_args = 3; + break; + } + /* linux_copy_file_range */ + case 326: { + struct linux_copy_file_range_args *p = params; + iarg[0] = p->fd_in; /* l_int */ + uarg[1] = (intptr_t) p->off_in; /* l_loff_t * */ + iarg[2] = p->fd_out; /* l_int */ + uarg[3] = (intptr_t) p->off_out; /* l_loff_t * */ + iarg[4] = p->len; /* l_size_t */ + iarg[5] = p->flags; /* l_uint */ + *n_args = 6; + break; + } + /* linux_preadv2 */ + case 327: { + struct linux_preadv2_args *p = params; + iarg[0] = p->fd; /* l_ulong */ + uarg[1] = (intptr_t) p->vec; /* const struct iovec * */ + iarg[2] = p->vlen; /* l_ulong */ + iarg[3] = p->pos_l; /* l_ulong */ + iarg[4] = p->pos_h; /* l_ulong */ + iarg[5] = p->flags; /* l_int */ + *n_args = 6; + break; + } + /* linux_pwritev2 */ + case 328: { + struct linux_pwritev2_args *p = params; + iarg[0] = p->fd; /* l_ulong */ + uarg[1] = (intptr_t) p->vec; /* const struct iovec * */ + iarg[2] = p->vlen; /* l_ulong */ + iarg[3] = p->pos_l; /* l_ulong */ + iarg[4] = p->pos_h; /* l_ulong */ + iarg[5] = p->flags; /* l_int */ + *n_args = 6; + break; + } + /* linux_pkey_mprotect */ + case 329: { + struct linux_pkey_mprotect_args *p = params; + iarg[0] = p->start; /* l_ulong */ + iarg[1] = p->len; /* l_size_t */ + iarg[2] = p->prot; /* l_ulong */ + iarg[3] = p->pkey; /* l_int */ + *n_args = 4; + break; + } + /* linux_pkey_alloc */ + case 330: { + struct linux_pkey_alloc_args *p = params; + iarg[0] = p->flags; /* l_ulong */ + iarg[1] = p->init_val; /* l_ulong */ + *n_args = 2; + break; + } + /* linux_pkey_free */ + case 331: { + struct linux_pkey_free_args *p = params; + iarg[0] = p->pkey; /* l_int */ + *n_args = 1; break; } default: @@ -5415,7 +5642,7 @@ systrace_entry_setargdesc(int sysnum, in /* linux_signalfd */ case 282: break; - /* linux_timerfd */ + /* linux_timerfd_create */ case 283: break; /* linux_eventfd */ @@ -5529,15 +5756,76 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_inotify_init1 */ case 294: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_preadv */ case 295: + switch(ndx) { + case 0: + p = "l_ulong"; + break; + case 1: + p = "userland struct iovec *"; + break; + case 2: + p = "l_ulong"; + break; + case 3: + p = "l_ulong"; + break; + case 4: + p = "l_ulong"; + break; + default: + break; + }; break; /* linux_pwritev */ case 296: + switch(ndx) { + case 0: + p = "l_ulong"; + break; + case 1: + p = "userland struct iovec *"; + break; + case 2: + p = "l_ulong"; + break; + case 3: + p = "l_ulong"; + break; + case 4: + p = "l_ulong"; + break; + default: + break; + }; break; - /* linux_rt_tsigqueueinfo */ + /* linux_rt_tgsigqueueinfo */ case 297: + switch(ndx) { + case 0: + p = "l_pid_t"; + break; + case 1: + p = "l_pid_t"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "userland l_siginfo_t *"; + break; + default: + break; + }; break; /* linux_perf_event_open */ case 298: @@ -5629,28 +5917,448 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_setns */ case 308: + switch(ndx) { + case 0: + p = "l_int"; + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Wed Feb 22 20:11:23 2017 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 243D0CE68A9; Wed, 22 Feb 2017 20:11:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCCA11BF3; Wed, 22 Feb 2017 20:11:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1MKBL2H048126; Wed, 22 Feb 2017 20:11:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1MKBL7l048125; Wed, 22 Feb 2017 20:11:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702222011.v1MKBL7l048125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 Feb 2017 20:11: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: r314108 - stable/11 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.23 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, 22 Feb 2017 20:11:23 -0000 Author: dchagin Date: Wed Feb 22 20:11:21 2017 New Revision: 314108 URL: https://svnweb.freebsd.org/changeset/base/314108 Log: Record mergeinfo for r313284, r313285, r313684, r313912 missied in r314107. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable-11@freebsd.org Thu Feb 23 07:28:31 2017 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 24CBDCEABCD; Thu, 23 Feb 2017 07:28: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 E5A30E9F; Thu, 23 Feb 2017 07:28:30 +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 v1N7STLM025630; Thu, 23 Feb 2017 07:28:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N7STag025629; Thu, 23 Feb 2017 07:28:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230728.v1N7STag025629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 07:28:29 +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: r314127 - stable/11/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.23 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, 23 Feb 2017 07:28:31 -0000 Author: kib Date: Thu Feb 23 07:28:29 2017 New Revision: 314127 URL: https://svnweb.freebsd.org/changeset/base/314127 Log: MFC r313493: Define ELF_ST_VISIBILITY(). Modified: stable/11/sys/sys/elf_generic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/elf_generic.h ============================================================================== --- stable/11/sys/sys/elf_generic.h Thu Feb 23 07:12:18 2017 (r314126) +++ stable/11/sys/sys/elf_generic.h Thu Feb 23 07:28:29 2017 (r314127) @@ -84,5 +84,6 @@ __ElfType(Ssize); #define ELF_ST_BIND __ELFN(ST_BIND) #define ELF_ST_TYPE __ELFN(ST_TYPE) #define ELF_ST_INFO __ELFN(ST_INFO) +#define ELF_ST_VISIBILITY __ELFN(ST_VISIBILITY) #endif /* !_SYS_ELF_GENERIC_H_ */ From owner-svn-src-stable-11@freebsd.org Thu Feb 23 07:39:02 2017 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 92985CEAF1E; Thu, 23 Feb 2017 07:39: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 5F216152D; Thu, 23 Feb 2017 07:39: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 v1N7d1iA029917; Thu, 23 Feb 2017 07:39:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N7d1QT029916; Thu, 23 Feb 2017 07:39:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230739.v1N7d1QT029916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 07:39: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: r314128 - stable/11/libexec/rtld-elf 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.23 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, 23 Feb 2017 07:39:02 -0000 Author: kib Date: Thu Feb 23 07:39:01 2017 New Revision: 314128 URL: https://svnweb.freebsd.org/changeset/base/314128 Log: MFC r313494: Handle protected symbols in rtld. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Thu Feb 23 07:28:29 2017 (r314127) +++ stable/11/libexec/rtld-elf/rtld.c Thu Feb 23 07:39:01 2017 (r314128) @@ -3952,15 +3952,19 @@ symlook_default(SymLook *req, const Obj_ donelist_init(&donelist); symlook_init_from_req(&req1, req); - /* Look first in the referencing object if linked symbolically. */ - if (refobj->symbolic && !donelist_check(&donelist, refobj)) { - res = symlook_obj(&req1, refobj); - if (res == 0) { - req->sym_out = req1.sym_out; - req->defobj_out = req1.defobj_out; - assert(req->defobj_out != NULL); - } + /* + * Look first in the referencing object if linked symbolically, + * and similarly handle protected symbols. + */ + res = symlook_obj(&req1, refobj); + if (res == 0 && (refobj->symbolic || + ELF_ST_VISIBILITY(req1.sym_out->st_other) == STV_PROTECTED)) { + req->sym_out = req1.sym_out; + req->defobj_out = req1.defobj_out; + assert(req->defobj_out != NULL); } + if (refobj->symbolic || req->defobj_out != NULL) + donelist_check(&donelist, refobj); symlook_global(req, &donelist); From owner-svn-src-stable-11@freebsd.org Thu Feb 23 07:42:50 2017 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 51646CEAC4E; Thu, 23 Feb 2017 07:42:50 +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 1E1ADEC6; Thu, 23 Feb 2017 07:42:50 +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 v1N7gndO033614; Thu, 23 Feb 2017 07:42:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N7gn3S033613; Thu, 23 Feb 2017 07:42:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230742.v1N7gn3S033613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 07:42: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: r314129 - stable/11/bin/ls 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.23 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, 23 Feb 2017 07:42:50 -0000 Author: kib Date: Thu Feb 23 07:42:49 2017 New Revision: 314129 URL: https://svnweb.freebsd.org/changeset/base/314129 Log: MFC r313798: Use uintmax_t to print st_nlink. Modified: stable/11/bin/ls/print.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ls/print.c ============================================================================== --- stable/11/bin/ls/print.c Thu Feb 23 07:39:01 2017 (r314128) +++ stable/11/bin/ls/print.c Thu Feb 23 07:42:49 2017 (r314129) @@ -259,12 +259,12 @@ printlong(const DISPLAY *dp) np = p->fts_pointer; xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); if (f_numericonly) { - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid); } else { - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {t:user/%-*s} {t:group/%-*s} ", + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, dp->s_user, np->user, dp->s_group, np->group); } if (S_ISBLK(sp->st_mode)) From owner-svn-src-stable-11@freebsd.org Thu Feb 23 09:30:39 2017 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 455CBCEABCE; Thu, 23 Feb 2017 09:30:39 +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 DAD4D615; Thu, 23 Feb 2017 09:30: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 v1N9UcjH074458; Thu, 23 Feb 2017 09:30:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N9UcJ2074457; Thu, 23 Feb 2017 09:30:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230930.v1N9UcJ2074457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 09:30:38 +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: r314133 - 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.23 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, 23 Feb 2017 09:30:39 -0000 Author: kib Date: Thu Feb 23 09:30:37 2017 New Revision: 314133 URL: https://svnweb.freebsd.org/changeset/base/314133 Log: MFC r313496: Increase a chance of devfs_close() calling d_close cdevsw method. Modified: stable/11/sys/kern/vfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_vnops.c ============================================================================== --- stable/11/sys/kern/vfs_vnops.c Thu Feb 23 08:17:42 2017 (r314132) +++ stable/11/sys/kern/vfs_vnops.c Thu Feb 23 09:30:37 2017 (r314133) @@ -422,12 +422,9 @@ vn_writechk(vp) /* * Vnode close call */ -int -vn_close(vp, flags, file_cred, td) - register struct vnode *vp; - int flags; - struct ucred *file_cred; - struct thread *td; +static int +vn_close1(struct vnode *vp, int flags, struct ucred *file_cred, + struct thread *td, bool keep_ref) { struct mount *mp; int error, lock_flags; @@ -449,11 +446,22 @@ vn_close(vp, flags, file_cred, td) __func__, vp, vp->v_writecount); } error = VOP_CLOSE(vp, flags, file_cred, td); - vput(vp); + if (keep_ref) + VOP_UNLOCK(vp, 0); + else + vput(vp); vn_finished_write(mp); return (error); } +int +vn_close(struct vnode *vp, int flags, struct ucred *file_cred, + struct thread *td) +{ + + return (vn_close1(vp, flags, file_cred, td, false)); +} + /* * Heuristic to detect sequential operation. */ @@ -1569,16 +1577,15 @@ vn_closefile(fp, td) struct vnode *vp; struct flock lf; int error; + bool ref; vp = fp->f_vnode; fp->f_ops = &badfileops; + ref= (fp->f_flag & FHASLOCK) != 0 && fp->f_type == DTYPE_VNODE; - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) - vref(vp); - - error = vn_close(vp, fp->f_flag, fp->f_cred, td); + error = vn_close1(vp, fp->f_flag, fp->f_cred, td, ref); - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) { + if (__predict_false(ref)) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; From owner-svn-src-stable-11@freebsd.org Thu Feb 23 09:41:34 2017 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 6E3E7CE815B; Thu, 23 Feb 2017 09:41: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 2C6EFE25; Thu, 23 Feb 2017 09:41: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 v1N9fXKT078828; Thu, 23 Feb 2017 09:41:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N9fXFO078826; Thu, 23 Feb 2017 09:41:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230941.v1N9fXFO078826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 09:41: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: r314134 - 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.23 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, 23 Feb 2017 09:41:34 -0000 Author: kib Date: Thu Feb 23 09:41:32 2017 New Revision: 314134 URL: https://svnweb.freebsd.org/changeset/base/314134 Log: MFC r313495: Do not establish advisory locks when doing open(O_EXLOCK) or open(O_SHLOCK) for files which do not have DTYPE_VNODE type. MFC r313549: Fix r313495. Modified: stable/11/sys/kern/vfs_vnops.c stable/11/sys/sys/file.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_vnops.c ============================================================================== --- stable/11/sys/kern/vfs_vnops.c Thu Feb 23 09:30:37 2017 (r314133) +++ stable/11/sys/kern/vfs_vnops.c Thu Feb 23 09:41:32 2017 (r314134) @@ -349,8 +349,12 @@ vn_open_vnode(struct vnode *vp, int fmod if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0) return (error); - if (fmode & (O_EXLOCK | O_SHLOCK)) { + while ((fmode & (O_EXLOCK | O_SHLOCK)) != 0) { KASSERT(fp != NULL, ("open with flock requires fp")); + if (fp->f_type != DTYPE_NONE && fp->f_type != DTYPE_VNODE) { + error = EOPNOTSUPP; + break; + } lock_flags = VOP_ISLOCKED(vp); VOP_UNLOCK(vp, 0); lf.l_whence = SEEK_SET; @@ -367,8 +371,12 @@ vn_open_vnode(struct vnode *vp, int fmod if (error == 0) fp->f_flag |= FHASLOCK; vn_lock(vp, lock_flags | LK_RETRY); - if (error == 0 && vp->v_iflag & VI_DOOMED) + if (error != 0) + break; + if ((vp->v_iflag & VI_DOOMED) != 0) { error = ENOENT; + break; + } /* * Another thread might have used this vnode as an @@ -376,20 +384,20 @@ vn_open_vnode(struct vnode *vp, int fmod * Ensure the vnode is still able to be opened for * writing after the lock has been obtained. */ - if (error == 0 && accmode & VWRITE) + if ((accmode & VWRITE) != 0) error = vn_writechk(vp); + break; + } - if (error != 0) { - fp->f_flag |= FOPENFAILED; - fp->f_vnode = vp; - if (fp->f_ops == &badfileops) { - fp->f_type = DTYPE_VNODE; - fp->f_ops = &vnops; - } - vref(vp); + if (error != 0) { + fp->f_flag |= FOPENFAILED; + fp->f_vnode = vp; + if (fp->f_ops == &badfileops) { + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; } - } - if (error == 0 && fmode & FWRITE) { + vref(vp); + } else if ((fmode & FWRITE) != 0) { VOP_ADD_WRITECOUNT(vp, 1); CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); Modified: stable/11/sys/sys/file.h ============================================================================== --- stable/11/sys/sys/file.h Thu Feb 23 09:30:37 2017 (r314133) +++ stable/11/sys/sys/file.h Thu Feb 23 09:41:32 2017 (r314134) @@ -55,6 +55,7 @@ struct socket; #endif /* _KERNEL */ +#define DTYPE_NONE 0 /* not yet initialized */ #define DTYPE_VNODE 1 /* file */ #define DTYPE_SOCKET 2 /* communications endpoint */ #define DTYPE_PIPE 3 /* pipe */ From owner-svn-src-stable-11@freebsd.org Thu Feb 23 09:52:23 2017 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 B2742CE86D9; Thu, 23 Feb 2017 09:52: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 718CD18AF; Thu, 23 Feb 2017 09:52:23 +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 v1N9qMeh087221; Thu, 23 Feb 2017 09:52:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N9qMiN087220; Thu, 23 Feb 2017 09:52:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230952.v1N9qMiN087220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 09:52:22 +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: r314135 - stable/11/sys/fs/nfsclient 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.23 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, 23 Feb 2017 09:52:23 -0000 Author: kib Date: Thu Feb 23 09:52:22 2017 New Revision: 314135 URL: https://svnweb.freebsd.org/changeset/base/314135 Log: MFC r313799: Do not allocate char[MNAMELEN] on stack in nfsclient. Modified: stable/11/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 23 09:41:32 2017 (r314134) +++ stable/11/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 23 09:52:22 2017 (r314135) @@ -749,8 +749,7 @@ static int nfs_mount_parse_from(struct vfsoptlist *opts, char **hostnamep, struct sockaddr_in **sinp, char *dirpath, size_t dirpathsize, int *dirlenp) { - char nam[MNAMELEN + 1]; - char *delimp, *hostp, *spec; + char *nam, *delimp, *hostp, *spec; int error, have_bracket = 0, offset, rv, speclen; struct sockaddr_in *sin; size_t len; @@ -758,6 +757,7 @@ nfs_mount_parse_from(struct vfsoptlist * error = vfs_getopt(opts, "from", (void **)&spec, &speclen); if (error != 0) return (error); + nam = malloc(MNAMELEN + 1, M_TEMP, M_WAITOK); /* * This part comes from sbin/mount_nfs/mount_nfs.c:getnfsargs(). @@ -776,6 +776,7 @@ nfs_mount_parse_from(struct vfsoptlist * hostp = delimp + 1; } else { printf("%s: no : nfs-name\n", __func__); + free(nam, M_TEMP); return (EINVAL); } *delimp = '\0'; @@ -791,6 +792,7 @@ nfs_mount_parse_from(struct vfsoptlist * spec[speclen - 1] = '\0'; if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { printf("%s: %s:%s: name too long", __func__, hostp, spec); + free(nam, M_TEMP); return (EINVAL); } /* Make both '@' and ':' notations equal */ @@ -816,6 +818,7 @@ nfs_mount_parse_from(struct vfsoptlist * if (rv != 1) { printf("%s: cannot parse '%s', inet_pton() returned %d\n", __func__, hostp, rv); + free(nam, M_TEMP); free(sin, M_SONAME); return (EINVAL); } @@ -832,6 +835,7 @@ nfs_mount_parse_from(struct vfsoptlist * strlcpy(dirpath, spec, dirpathsize); *dirlenp = strlen(dirpath); + free(nam, M_TEMP); return (0); } @@ -874,7 +878,7 @@ nfs_mount(struct mount *mp) struct sockaddr *nam = NULL; struct vnode *vp; struct thread *td; - char hst[MNAMELEN]; + char *hst; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *cp, *opt, *name, *secname; int nametimeo = NFS_DEFAULT_NAMETIMEO; @@ -886,6 +890,7 @@ nfs_mount(struct mount *mp) has_nfs_args_opt = 0; has_nfs_from_opt = 0; + hst = malloc(MNAMELEN, M_TEMP, M_WAITOK); if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; @@ -1324,6 +1329,7 @@ out: mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); } + free(hst, M_TEMP); return (error); } From owner-svn-src-stable-11@freebsd.org Thu Feb 23 09:55:56 2017 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 A4D55CE87DF; Thu, 23 Feb 2017 09:55:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FE031BDD; Thu, 23 Feb 2017 09:55:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1N9ttie087514; Thu, 23 Feb 2017 09:55:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N9ttZf087513; Thu, 23 Feb 2017 09:55:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702230955.v1N9ttZf087513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Feb 2017 09:55:55 +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: r314137 - stable/11/sys/fs/nfsclient 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.23 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, 23 Feb 2017 09:55:56 -0000 Author: kib Date: Thu Feb 23 09:55:55 2017 New Revision: 314137 URL: https://svnweb.freebsd.org/changeset/base/314137 Log: MFC r313800: Do not access memory past the buffer end. Do not accept and silently truncate too long hostname. Modified: stable/11/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 23 09:53:54 2017 (r314136) +++ stable/11/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 23 09:55:55 2017 (r314137) @@ -1270,8 +1270,13 @@ nfs_mount(struct mount *mp) error = EINVAL; goto out; } - bcopy(args.hostname, hst, MNAMELEN); - hst[MNAMELEN - 1] = '\0'; + if (len >= MNAMELEN) { + vfs_mount_error(mp, "Hostname too long"); + error = EINVAL; + goto out; + } + bcopy(args.hostname, hst, len); + hst[len] = '\0'; } if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0) From owner-svn-src-stable-11@freebsd.org Fri Feb 24 10:20:15 2017 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 80F55CEB0F1; Fri, 24 Feb 2017 10:20:15 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 331FD1103; Fri, 24 Feb 2017 10:20:15 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OAKE5t088952; Fri, 24 Feb 2017 10:20:14 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OAKEJb088950; Fri, 24 Feb 2017 10:20:14 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201702241020.v1OAKEJb088950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 24 Feb 2017 10:20: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: r314198 - in stable/11/sys: amd64/amd64 i386/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.23 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, 24 Feb 2017 10:20:15 -0000 Author: royger Date: Fri Feb 24 10:20:13 2017 New Revision: 314198 URL: https://svnweb.freebsd.org/changeset/base/314198 Log: MFC r313871 x86: fix MTRR initialization if EARLY_AP_STARTUP is used Sponsored by: Citrix Systems R&D Modified: stable/11/sys/amd64/amd64/amd64_mem.c stable/11/sys/i386/i386/i686_mem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/amd64_mem.c ============================================================================== --- stable/11/sys/amd64/amd64/amd64_mem.c Fri Feb 24 09:30:51 2017 (r314197) +++ stable/11/sys/amd64/amd64/amd64_mem.c Fri Feb 24 10:20:13 2017 (r314198) @@ -609,6 +609,10 @@ amd64_mrinit(struct mem_range_softc *sc) u_int regs[4]; int i, nmdesc = 0, pabits; + if (sc->mr_desc != NULL) + /* Already initialized. */ + return; + mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -750,5 +754,6 @@ amd64_mem_drvinit(void *unused) return; } mem_range_softc.mr_op = &amd64_mrops; + amd64_mrinit(&mem_range_softc); } -SYSINIT(amd64memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, amd64_mem_drvinit, NULL); +SYSINIT(amd64memdev, SI_SUB_CPU, SI_ORDER_ANY, amd64_mem_drvinit, NULL); Modified: stable/11/sys/i386/i386/i686_mem.c ============================================================================== --- stable/11/sys/i386/i386/i686_mem.c Fri Feb 24 09:30:51 2017 (r314197) +++ stable/11/sys/i386/i386/i686_mem.c Fri Feb 24 10:20:13 2017 (r314198) @@ -588,6 +588,10 @@ i686_mrinit(struct mem_range_softc *sc) u_int regs[4]; int i, nmdesc = 0, pabits; + if (sc->mr_desc != NULL) + /* Already initialized. */ + return; + mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -716,5 +720,6 @@ i686_mem_drvinit(void *unused) return; } mem_range_softc.mr_op = &i686_mrops; + i686_mrinit(&mem_range_softc); } -SYSINIT(i686memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, i686_mem_drvinit, NULL); +SYSINIT(i686memdev, SI_SUB_CPU, SI_ORDER_ANY, i686_mem_drvinit, NULL); From owner-svn-src-stable-11@freebsd.org Fri Feb 24 16:02:04 2017 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 51D67CEBDDA; Fri, 24 Feb 2017 16:02:04 +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 14E336E7; Fri, 24 Feb 2017 16:02:04 +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 v1OG23WS034543; Fri, 24 Feb 2017 16:02:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OG21SM034524; Fri, 24 Feb 2017 16:02:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702241602.v1OG21SM034524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 Feb 2017 16:02: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: r314210 - in stable/11/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 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.23 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, 24 Feb 2017 16:02:04 -0000 Author: kib Date: Fri Feb 24 16:02:01 2017 New Revision: 314210 URL: https://svnweb.freebsd.org/changeset/base/314210 Log: MFC r313154: For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE and device npx. Modified: stable/11/sys/conf/files.i386 stable/11/sys/conf/options.i386 stable/11/sys/i386/conf/DEFAULTS stable/11/sys/i386/conf/NOTES stable/11/sys/i386/i386/elf_machdep.c stable/11/sys/i386/i386/exception.s stable/11/sys/i386/i386/initcpu.c stable/11/sys/i386/i386/machdep.c stable/11/sys/i386/i386/mp_machdep.c stable/11/sys/i386/i386/pmap.c stable/11/sys/i386/i386/ptrace_machdep.c stable/11/sys/i386/i386/support.s stable/11/sys/i386/i386/swtch.s stable/11/sys/i386/i386/trap.c stable/11/sys/i386/i386/vm86bios.s stable/11/sys/i386/i386/vm_machdep.c stable/11/sys/i386/include/atomic.h stable/11/sys/i386/isa/npx.c stable/11/sys/i386/linux/linux_ptrace.c stable/11/sys/x86/acpica/acpi_wakeup.c stable/11/sys/x86/x86/cpu_machdep.c stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/conf/files.i386 Fri Feb 24 16:02:01 2017 (r314210) @@ -528,7 +528,7 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/isa/elink.c optional ep | ie -i386/isa/npx.c optional npx +i386/isa/npx.c standard i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/isa/spic.c optional spic Modified: stable/11/sys/conf/options.i386 ============================================================================== --- stable/11/sys/conf/options.i386 Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/conf/options.i386 Fri Feb 24 16:02:01 2017 (r314210) @@ -50,8 +50,6 @@ CPU_BTB_EN opt_cpu.h CPU_CYRIX_NO_LOCK opt_cpu.h CPU_DIRECT_MAPPED_CACHE opt_cpu.h CPU_DISABLE_5X86_LSSER opt_cpu.h -CPU_DISABLE_CMPXCHG opt_global.h # XXX global, unlike other CPU_* -CPU_DISABLE_SSE opt_cpu.h CPU_ELAN opt_cpu.h CPU_ELAN_PPS opt_cpu.h CPU_ELAN_XTAL opt_cpu.h @@ -113,7 +111,6 @@ NETGRAPH_CRONYX opt_ng_cronyx.h # Device options DEV_APIC opt_apic.h DEV_ATPIC opt_atpic.h -DEV_NPX opt_npx.h # Debugging NPX_DEBUG opt_npx.h Modified: stable/11/sys/i386/conf/DEFAULTS ============================================================================== --- stable/11/sys/i386/conf/DEFAULTS Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/conf/DEFAULTS Fri Feb 24 16:02:01 2017 (r314210) @@ -9,9 +9,6 @@ machine i386 device isa options ISAPNP -# Floating point support. -device npx - # Pseudo devices. device mem # Memory and kernel memory devices device io # I/O device Modified: stable/11/sys/i386/conf/NOTES ============================================================================== --- stable/11/sys/i386/conf/NOTES Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/conf/NOTES Fri Feb 24 16:02:01 2017 (r314210) @@ -115,15 +115,6 @@ cpu I686_CPU # aka Pentium Pro(tm) # reorder). This option should not be used if you use memory mapped # I/O device(s). # -# CPU_DISABLE_CMPXCHG disables the CMPXCHG instruction on > i386 IA32 -# machines. VmWare 3.x seems to emulate this instruction poorly, causing -# the guest OS to run very slowly. This problem appears to be fixed in -# VmWare 4.x, at least in version 4.5.2, so that enabling this option with -# VmWare 4.x will result in locking operations to be 20-30 times slower. -# Enabling this with an SMP kernel will cause the kernel to be unusable. -# -# CPU_DISABLE_SSE explicitly prevents I686_CPU from turning on SSE. -# # CPU_ELAN enables support for AMDs ElanSC520 CPU. # CPU_ELAN_PPS enables precision timestamp code. # CPU_ELAN_XTAL sets the clock crystal frequency in Hz. @@ -201,8 +192,6 @@ options CPU_BLUELIGHTNING_FPU_OP_CACHE options CPU_BTB_EN options CPU_DIRECT_MAPPED_CACHE options CPU_DISABLE_5X86_LSSER -options CPU_DISABLE_CMPXCHG -#options CPU_DISABLE_SSE options CPU_ELAN options CPU_ELAN_PPS options CPU_ELAN_XTAL=32768000 @@ -313,7 +302,7 @@ device apm_saver # Requires APM # # ISA bus # -device isa # Required by npx(4) +device isa # # Options for `isa': @@ -395,8 +384,7 @@ device dpms # DPMS suspend & resume vi options X86BIOS # -# The Numeric Processing eXtension driver. This is non-optional. -device npx +# Hints for the non-optional Numeric Processing eXtension driver. hint.npx.0.flags="0x0" hint.npx.0.irq="13" Modified: stable/11/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/11/sys/i386/i386/elf_machdep.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/elf_machdep.c Fri Feb 24 16:02:01 2017 (r314210) @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, @@ -143,13 +139,10 @@ SYSINIT(kelf32, SI_SUB_EXEC, SI_ORDER_AN void elf32_dump_thread(struct thread *td, void *dst, size_t *off) { -#ifdef CPU_ENABLE_SSE void *buf; -#endif size_t len; len = 0; -#ifdef CPU_ENABLE_SSE if (use_xsave) { if (dst != NULL) { npxgetregs(td); @@ -162,7 +155,6 @@ elf32_dump_thread(struct thread *td, voi len += elf32_populate_note(NT_X86_XSTATE, NULL, NULL, cpu_max_ext_state_size, NULL); } -#endif *off = len; } Modified: stable/11/sys/i386/i386/exception.s ============================================================================== --- stable/11/sys/i386/i386/exception.s Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/exception.s Fri Feb 24 16:02:01 2017 (r314210) @@ -37,7 +37,6 @@ #include "opt_apic.h" #include "opt_atpic.h" #include "opt_hwpmc_hooks.h" -#include "opt_npx.h" #include #include Modified: stable/11/sys/i386/i386/initcpu.c ============================================================================== --- stable/11/sys/i386/i386/initcpu.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/initcpu.c Fri Feb 24 16:02:01 2017 (r314210) @@ -44,10 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - #ifdef I486_CPU static void init_5x86(void); static void init_bluelightning(void); @@ -758,12 +754,10 @@ initializecpu(void) default: break; } -#if defined(CPU_ENABLE_SSE) if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { load_cr4(rcr4() | CR4_FXSR | CR4_XMM); cpu_fxsr = hw_instruction_sse = 1; } -#endif #if defined(PAE) || defined(PAE_TABLES) if ((amd_feature & AMDID_NX) != 0) { uint64_t msr; Modified: stable/11/sys/i386/i386/machdep.c ============================================================================== --- stable/11/sys/i386/i386/machdep.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/machdep.c Fri Feb 24 16:02:01 2017 (r314210) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include "opt_maxmem.h" #include "opt_mp_watchdog.h" -#include "opt_npx.h" #include "opt_perfmon.h" #include "opt_platform.h" #include "opt_xbox.h" @@ -166,10 +165,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern register_t init386(int first); extern void dblfault_handler(void); -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - static void cpu_startup(void *); static void fpstate_drop(struct thread *td); static void get_fpcontext(struct thread *td, mcontext_t *mcp, @@ -635,14 +630,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs = td->td_frame; oonstack = sigonstack(regs->tf_esp); -#ifdef CPU_ENABLE_SSE if (cpu_max_ext_state_size > sizeof(union savefpu) && use_xsave) { xfpusave_len = cpu_max_ext_state_size - sizeof(union savefpu); xfpusave = __builtin_alloca(xfpusave_len); } else { -#else - { -#endif xfpusave_len = 0; xfpusave = NULL; } @@ -2449,9 +2440,7 @@ init386(int first) struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; -#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; -#endif int late_console; thread0.td_kstack = proc0kstack; @@ -2713,9 +2702,7 @@ init386(int first) i386_kdb_init(); msgbufinit(msgbufp, msgbufsize); -#ifdef DEV_NPX npxinit(true); -#endif /* * Set up thread0 pcb after npxinit calculated pcb + fpu save * area size. Zero out the extended state header in fpu save @@ -2723,13 +2710,11 @@ init386(int first) */ thread0.td_pcb = get_pcb_td(&thread0); bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); -#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + 1); xhdr->xstate_bv = xsave_mask; } -#endif PCPU_SET(curpcb, thread0.td_pcb); /* Move esp0 in the tss to its final place. */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ @@ -2998,17 +2983,11 @@ fill_fpregs(struct thread *td, struct fp KASSERT(td == curthread || TD_IS_SUSPENDED(td) || P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); -#ifdef DEV_NPX npxgetregs(td); -#else - bzero(fpregs, sizeof(*fpregs)); -#endif -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) npx_fill_fpregs_xmm(&get_pcb_user_save_td(td)->sv_xmm, (struct save87 *)fpregs); else -#endif /* CPU_ENABLE_SSE */ bcopy(&get_pcb_user_save_td(td)->sv_87, fpregs, sizeof(*fpregs)); return (0); @@ -3018,17 +2997,13 @@ int set_fpregs(struct thread *td, struct fpreg *fpregs) { -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) npx_set_fpregs_xmm((struct save87 *)fpregs, &get_pcb_user_save_td(td)->sv_xmm); else -#endif /* CPU_ENABLE_SSE */ bcopy(fpregs, &get_pcb_user_save_td(td)->sv_87, sizeof(*fpregs)); -#ifdef DEV_NPX npxuserinited(td); -#endif return (0); } @@ -3137,20 +3112,12 @@ static void get_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpusave, size_t xfpusave_len) { -#ifdef CPU_ENABLE_SSE size_t max_len, len; -#endif -#ifndef DEV_NPX - mcp->mc_fpformat = _MC_FPFMT_NODEV; - mcp->mc_ownedfp = _MC_FPOWNED_NONE; - bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); -#else mcp->mc_ownedfp = npxgetregs(td); bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); -#ifdef CPU_ENABLE_SSE if (!use_xsave || xfpusave_len == 0) return; max_len = cpu_max_ext_state_size - sizeof(union savefpu); @@ -3162,8 +3129,6 @@ get_fpcontext(struct thread *td, mcontex mcp->mc_flags |= _MC_HASFPXSTATE; mcp->mc_xfpustate_len = len; bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); -#endif -#endif } static int @@ -3184,16 +3149,10 @@ set_fpcontext(struct thread *td, mcontex error = 0; } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { -#ifdef DEV_NPX fpstate = (union savefpu *)&mcp->mc_fpstate; -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpstate->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; -#endif error = npxsetregs(td, fpstate, xfpustate, xfpustate_len); -#else - error = EINVAL; -#endif } else return (EINVAL); return (error); @@ -3205,10 +3164,8 @@ fpstate_drop(struct thread *td) KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); -#ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) npxdrop(); -#endif /* * XXX force a full drop of the npx. The above only drops it if we * owned it. npxgetregs() has the same bug in the !cpu_fxsr case. Modified: stable/11/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/11/sys/i386/i386/mp_machdep.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/mp_machdep.c Fri Feb 24 16:02:01 2017 (r314210) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #ifndef DEV_APIC #error The apic device is required for SMP, add "device apic" to your config file. #endif -#if defined(CPU_DISABLE_CMPXCHG) && !defined(COMPILING_LINT) -#error SMP not supported with CPU_DISABLE_CMPXCHG -#endif #endif /* not lint */ #include Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/pmap.c Fri Feb 24 16:02:01 2017 (r314210) @@ -152,10 +152,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 #endif @@ -4231,11 +4227,9 @@ pagezero(void *page) { #if defined(I686_CPU) if (cpu_class == CPUCLASS_686) { -#if defined(CPU_ENABLE_SSE) if (cpu_feature & CPUID_SSE2) sse2_pagezero(page); else -#endif i686_pagezero(page); } else #endif Modified: stable/11/sys/i386/i386/ptrace_machdep.c ============================================================================== --- stable/11/sys/i386/i386/ptrace_machdep.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/ptrace_machdep.c Fri Feb 24 16:02:01 2017 (r314210) @@ -39,11 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - -#ifdef CPU_ENABLE_SSE static int cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) { @@ -114,12 +109,10 @@ cpu_ptrace_xstate(struct thread *td, int return (error); } -#endif static int cpu_ptrace_xmm(struct thread *td, int req, void *addr, int data) { -#ifdef CPU_ENABLE_SSE struct savexmm *fpstate; int error; @@ -152,9 +145,6 @@ cpu_ptrace_xmm(struct thread *td, int re } return (error); -#else - return (EINVAL); -#endif } int Modified: stable/11/sys/i386/i386/support.s ============================================================================== --- stable/11/sys/i386/i386/support.s Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/support.s Fri Feb 24 16:02:01 2017 (r314210) @@ -29,8 +29,6 @@ * $FreeBSD$ */ -#include "opt_npx.h" - #include #include #include Modified: stable/11/sys/i386/i386/swtch.s ============================================================================== --- stable/11/sys/i386/i386/swtch.s Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/swtch.s Fri Feb 24 16:02:01 2017 (r314210) @@ -32,7 +32,6 @@ * $FreeBSD$ */ -#include "opt_npx.h" #include "opt_sched.h" #include @@ -152,7 +151,6 @@ ENTRY(cpu_switch) movl %eax,PCB_DR0(%edx) 1: -#ifdef DEV_NPX /* have we used fp, and need a save? */ cmpl %ecx,PCPU(FPCURTHREAD) jne 1f @@ -160,7 +158,6 @@ ENTRY(cpu_switch) call npxsave /* do it in a big C function */ popl %eax 1: -#endif /* Save is done. Now fire up new thread. Leave old vmspace. */ movl 4(%esp),%edi Modified: stable/11/sys/i386/i386/trap.c ============================================================================== --- stable/11/sys/i386/i386/trap.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/trap.c Fri Feb 24 16:02:01 2017 (r314210) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_isa.h" #include "opt_kdb.h" -#include "opt_npx.h" #include "opt_stack.h" #include "opt_trap.h" @@ -335,13 +334,9 @@ user_trctrap_out: break; case T_ARITHTRAP: /* arithmetic trap */ -#ifdef DEV_NPX ucode = npxtrap_x87(); if (ucode == -1) goto userout; -#else - ucode = 0; -#endif i = SIGFPE; break; @@ -475,13 +470,11 @@ user_trctrap_out: break; case T_DNA: -#ifdef DEV_NPX KASSERT(PCB_USER_FPU(td->td_pcb), ("kernel FPU ctx has leaked")); /* transparent fault (due to context switch "late") */ if (npxdna()) goto userout; -#endif uprintf("pid %d killed due to lack of floating point\n", p->p_pid); i = SIGKILL; @@ -494,13 +487,9 @@ user_trctrap_out: break; case T_XMMFLT: /* SIMD floating-point exception */ -#if defined(DEV_NPX) && !defined(CPU_DISABLE_SSE) && defined(I686_CPU) ucode = npxtrap_sse(); if (ucode == -1) goto userout; -#else - ucode = 0; -#endif i = SIGFPE; break; #ifdef KDTRACE_HOOKS @@ -524,12 +513,10 @@ user_trctrap_out: goto out; case T_DNA: -#ifdef DEV_NPX if (PCB_USER_FPU(td->td_pcb)) panic("Unregistered use of FPU in kernel"); if (npxdna()) goto out; -#endif break; case T_ARITHTRAP: /* arithmetic trap */ Modified: stable/11/sys/i386/i386/vm86bios.s ============================================================================== --- stable/11/sys/i386/i386/vm86bios.s Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/vm86bios.s Fri Feb 24 16:02:01 2017 (r314210) @@ -26,8 +26,6 @@ * $FreeBSD$ */ -#include "opt_npx.h" - #include /* miscellaneous asm macros */ #include @@ -63,7 +61,6 @@ ENTRY(vm86_bioscall) pushl %edi pushl %gs -#ifdef DEV_NPX pushfl cli movl PCPU(CURTHREAD),%ecx @@ -77,7 +74,6 @@ ENTRY(vm86_bioscall) popl %edx /* recover our pcb */ 1: popfl -#endif movl SCR_VMFRAME(%edx),%ebx /* target frame location */ movl %ebx,%edi /* destination */ Modified: stable/11/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/11/sys/i386/i386/vm_machdep.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/i386/vm_machdep.c Fri Feb 24 16:02:01 2017 (r314210) @@ -103,10 +103,6 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), @@ -156,18 +152,14 @@ void * alloc_fpusave(int flags) { void *res; -#ifdef CPU_ENABLE_SSE struct savefpu_ymm *sf; -#endif res = malloc(cpu_max_ext_state_size, M_DEVBUF, flags); -#ifdef CPU_ENABLE_SSE if (use_xsave) { sf = (struct savefpu_ymm *)res; bzero(&sf->sv_xstate.sx_hd, sizeof(sf->sv_xstate.sx_hd)); sf->sv_xstate.sx_hd.xstate_bv = xsave_mask; } -#endif return (res); } /* @@ -207,12 +199,10 @@ cpu_fork(struct thread *td1, struct proc /* Ensure that td1's pcb is up to date. */ if (td1 == curthread) td1->td_pcb->pcb_gs = rgs(); -#ifdef DEV_NPX critical_enter(); if (PCPU_GET(fpcurthread) == td1) npxsave(td1->td_pcb->pcb_save); critical_exit(); -#endif /* Point the pcb to the top of the stack */ pcb2 = get_pcb_td(td2); @@ -351,12 +341,10 @@ void cpu_thread_exit(struct thread *td) { -#ifdef DEV_NPX critical_enter(); if (td == PCPU_GET(fpcurthread)) npxdrop(); critical_exit(); -#endif /* Disable any hardware breakpoints. */ if (td->td_pcb->pcb_flags & PCB_DBREGS) { @@ -397,21 +385,17 @@ void cpu_thread_alloc(struct thread *td) { struct pcb *pcb; -#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; -#endif td->td_pcb = pcb = get_pcb_td(td); td->td_frame = (struct trapframe *)((caddr_t)pcb - 16) - 1; pcb->pcb_ext = NULL; pcb->pcb_save = get_pcb_user_save_pcb(pcb); -#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(pcb->pcb_save + 1); bzero(xhdr, sizeof(*xhdr)); xhdr->xstate_bv = xsave_mask; } -#endif } void Modified: stable/11/sys/i386/include/atomic.h ============================================================================== --- stable/11/sys/i386/include/atomic.h Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/include/atomic.h Fri Feb 24 16:02:01 2017 (r314210) @@ -169,33 +169,6 @@ struct __hack * Returns 0 on failure, non-zero on success */ -#ifdef CPU_DISABLE_CMPXCHG - -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) -{ - u_char res; - - __asm __volatile( - " pushfl ; " - " cli ; " - " cmpl %3,%1 ; " - " jne 1f ; " - " movl %2,%1 ; " - "1: " - " sete %0 ; " - " popfl ; " - "# atomic_cmpset_int" - : "=q" (res), /* 0 */ - "+m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "r" (expect) /* 3 */ - : "memory"); - return (res); -} - -#else /* !CPU_DISABLE_CMPXCHG */ - static __inline int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) { @@ -214,8 +187,6 @@ atomic_cmpset_int(volatile u_int *dst, u return (res); } -#endif /* CPU_DISABLE_CMPXCHG */ - /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. Modified: stable/11/sys/i386/isa/npx.c ============================================================================== --- stable/11/sys/i386/isa/npx.c Fri Feb 24 15:17:43 2017 (r314209) +++ stable/11/sys/i386/isa/npx.c Fri Feb 24 16:02:01 2017 (r314210) @@ -74,10 +74,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) -#define CPU_ENABLE_SSE -#endif - /* * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. */ @@ -93,7 +89,6 @@ __FBSDID("$FreeBSD$"); #define fp_divide_by_0() __asm __volatile( \ "fldz; fld1; fdiv %st,%st(1); fnop") #define frstor(addr) __asm __volatile("frstor %0" : : "m" (*(addr))) -#ifdef CPU_ENABLE_SSE #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) @@ -130,7 +125,6 @@ xsaveopt(char *addr, uint64_t mask) __asm __volatile("xsaveopt %0" : "=m" (*addr) : "a" (low), "d" (hi) : "memory"); } -#endif #else /* !(__GNUCLIKE_ASM && !lint) */ void fldcw(u_short cw); @@ -141,7 +135,6 @@ void fnstcw(caddr_t addr); void fnstsw(caddr_t addr); void fp_divide_by_0(void); void frstor(caddr_t addr); -#ifdef CPU_ENABLE_SSE void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); @@ -149,14 +142,12 @@ void stmxcsr(u_int *csr); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); void xsaveopt(char *addr, uint64_t mask); -#endif #endif /* __GNUCLIKE_ASM && !lint */ #define start_emulating() load_cr0(rcr0() | CR0_TS) #define stop_emulating() clts() -#ifdef CPU_ENABLE_SSE #define GET_FPU_CW(thread) \ (cpu_fxsr ? \ (thread)->td_pcb->pcb_save->sv_xmm.sv_env.en_cw : \ @@ -171,16 +162,7 @@ void xsaveopt(char *addr, uint64_t mask) else \ (savefpu)->sv_87.sv_env.en_cw = (value); \ } while (0) -#else /* CPU_ENABLE_SSE */ -#define GET_FPU_CW(thread) \ - (thread->td_pcb->pcb_save->sv_87.sv_env.en_cw) -#define GET_FPU_SW(thread) \ - (thread->td_pcb->pcb_save->sv_87.sv_env.en_sw) -#define SET_FPU_CW(savefpu, value) \ - (savefpu)->sv_87.sv_env.en_cw = (value) -#endif /* CPU_ENABLE_SSE */ -#ifdef CPU_ENABLE_SSE CTASSERT(sizeof(union savefpu) == 512); CTASSERT(sizeof(struct xstate_hdr) == 64); CTASSERT(sizeof(struct savefpu_ymm) == 832); @@ -200,7 +182,6 @@ CTASSERT(X86_XSTATE_XCR0_OFFSET >= offse X86_XSTATE_XCR0_OFFSET + sizeof(uint64_t) <= sizeof(struct savexmm)); static void fpu_clean_state(void); -#endif static void fpusave(union savefpu *); static void fpurstor(union savefpu *); @@ -210,21 +191,17 @@ int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); -#ifdef CPU_ENABLE_SSE int use_xsave; uint64_t xsave_mask; -#endif static uma_zone_t fpu_save_area_zone; static union savefpu *npx_initialstate; -#ifdef CPU_ENABLE_SSE struct xsave_area_elm_descr { u_int offset; u_int size; } *xsave_area_desc; static int use_xsaveopt; -#endif static volatile u_int npx_traps_while_probing; @@ -340,7 +317,6 @@ cleanup: return (hw_float); } -#ifdef CPU_ENABLE_SSE /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. @@ -376,7 +352,7 @@ npxinit_bsp1(void) if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) use_xsaveopt = 1; } -#endif + /* * Calculate the fpu save area size. @@ -384,7 +360,6 @@ npxinit_bsp1(void) static void npxinit_bsp2(void) { -#ifdef CPU_ENABLE_SSE u_int cp[4]; if (use_xsave) { @@ -397,7 +372,6 @@ npxinit_bsp2(void) do_cpuid(1, cp); cpu_feature2 = cp[2]; } else -#endif cpu_max_ext_state_size = sizeof(union savefpu); } @@ -409,25 +383,19 @@ npxinit(bool bsp) { static union savefpu dummy; register_t saveintr; -#ifdef CPU_ENABLE_SSE u_int mxcsr; -#endif u_short control; if (bsp) { if (!npx_probe()) return; -#ifdef CPU_ENABLE_SSE npxinit_bsp1(); -#endif } -#ifdef CPU_ENABLE_SSE if (use_xsave) { load_cr4(rcr4() | CR4_XSAVE); load_xcr(XCR0, xsave_mask); } -#endif /* * XCR0 shall be set up before CPU can report the save area size. @@ -444,20 +412,16 @@ npxinit(bool bsp) */ saveintr = intr_disable(); stop_emulating(); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) fninit(); else -#endif fnsave(&dummy); control = __INITIAL_NPXCW__; fldcw(control); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) { mxcsr = __INITIAL_MXCSR__; ldmxcsr(mxcsr); } -#endif start_emulating(); intr_restore(saveintr); } @@ -471,9 +435,7 @@ static void npxinitstate(void *arg __unused) { register_t saveintr; -#ifdef CPU_ENABLE_SSE int cp[4], i, max_ext_n; -#endif if (!hw_float) return; @@ -484,7 +446,6 @@ npxinitstate(void *arg __unused) stop_emulating(); fpusave(npx_initialstate); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) { if (npx_initialstate->sv_xmm.sv_env.en_mxcsr_mask) cpu_mxcsr_mask = @@ -506,11 +467,9 @@ npxinitstate(void *arg __unused) bzero(npx_initialstate->sv_xmm.sv_xmm, sizeof(npx_initialstate->sv_xmm.sv_xmm)); } else -#endif bzero(npx_initialstate->sv_87.sv_ac, sizeof(npx_initialstate->sv_87.sv_ac)); -#ifdef CPU_ENABLE_SSE /* * Create a table describing the layout of the CPU Extended * Save Area. @@ -535,7 +494,6 @@ npxinitstate(void *arg __unused) xsave_area_desc[i].size = cp[0]; } } -#endif fpu_save_area_zone = uma_zcreate("FPU_save_area", cpu_max_ext_state_size, NULL, NULL, NULL, NULL, @@ -585,10 +543,8 @@ npxformat(void) if (!hw_float) return (_MC_FPFMT_NODEV); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) return (_MC_FPFMT_XMM); -#endif return (_MC_FPFMT_387); } @@ -809,7 +765,6 @@ npxtrap_x87(void) return (fpetable[status & ((~control & 0x3f) | 0x40)]); } -#ifdef CPU_ENABLE_SSE int npxtrap_sse(void) { @@ -829,7 +784,6 @@ npxtrap_sse(void) critical_exit(); return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } -#endif /* * Implement device not available (DNA) exception @@ -868,10 +822,8 @@ npxdna(void) */ PCPU_SET(fpcurthread, curthread); -#ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpu_clean_state(); -#endif if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { /* @@ -913,11 +865,9 @@ npxsave(addr) { stop_emulating(); -#ifdef CPU_ENABLE_SSE if (use_xsaveopt) xsaveopt((char *)addr, xsave_mask); else -#endif fpusave(addr); start_emulating(); PCPU_SET(fpcurthread, NULL); @@ -968,9 +918,7 @@ npxdrop(void) * Discard pending exceptions in the !cpu_fxsr case so that unmasked * ones don't cause a panic on the next frstor. */ -#ifdef CPU_ENABLE_SSE if (!cpu_fxsr) -#endif fnclex(); td = PCPU_GET(fpcurthread); @@ -990,11 +938,9 @@ int npxgetregs(struct thread *td) { struct pcb *pcb; -#ifdef CPU_ENABLE_SSE uint64_t *xstate_bv, bit; char *sa; int max_ext_n, i; -#endif int owned; if (!hw_float) @@ -1011,9 +957,7 @@ npxgetregs(struct thread *td) critical_enter(); if (td == PCPU_GET(fpcurthread)) { fpusave(get_pcb_user_save_pcb(pcb)); -#ifdef CPU_ENABLE_SSE if (!cpu_fxsr) -#endif /* * fnsave initializes the FPU and destroys whatever * context it contains. Make sure the FPU owner @@ -1025,7 +969,6 @@ npxgetregs(struct thread *td) owned = _MC_FPOWNED_PCB; } critical_exit(); -#ifdef CPU_ENABLE_SSE if (use_xsave) { /* * Handle partially saved state. @@ -1048,7 +991,6 @@ npxgetregs(struct thread *td) *xstate_bv |= bit; } } -#endif return (owned); } @@ -1063,7 +1005,6 @@ npxuserinited(struct thread *td) pcb->pcb_flags |= PCB_NPXUSERINITDONE; } -#ifdef CPU_ENABLE_SSE int npxsetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size) { @@ -1101,16 +1042,13 @@ npxsetxstate(struct thread *td, char *xf return (0); } -#endif int npxsetregs(struct thread *td, union savefpu *addr, char *xfpustate, size_t xfpustate_size) { struct pcb *pcb; -#ifdef CPU_ENABLE_SSE int error; -#endif if (!hw_float) return (ENXIO); @@ -1118,14 +1056,12 @@ npxsetregs(struct thread *td, union save pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { -#ifdef CPU_ENABLE_SSE error = npxsetxstate(td, xfpustate, xfpustate_size); if (error != 0) { critical_exit(); return (error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Fri Feb 24 16:53:33 2017 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 1E587CEC89E; Fri, 24 Feb 2017 16:53:33 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC107110; Fri, 24 Feb 2017 16:53:32 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v1OGrSwH028385; Fri, 24 Feb 2017 08:53:28 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v1OGrRTJ028384; Fri, 24 Feb 2017 08:53:27 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201702241653.v1OGrRTJ028384@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r314210 - in stable/11/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 In-Reply-To: <201702241602.v1OG21SM034524@repo.freebsd.org> To: Konstantin Belousov Date: Fri, 24 Feb 2017 08:53:27 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 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, 24 Feb 2017 16:53:33 -0000 > Author: kib > Date: Fri Feb 24 16:02:01 2017 > New Revision: 314210 > URL: https://svnweb.freebsd.org/changeset/base/314210 > > Log: > MFC r313154: > For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE > and device npx. Um, why????? Makes it much easier to test soft float if we can remove the npx device. Or has soft float support died yet again? Yes, an i386 without an FPU is anchient by why are we removing working functionality? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-11@freebsd.org Fri Feb 24 17:14:12 2017 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 37205CECD7A; Fri, 24 Feb 2017 17:14:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C616EAD; Fri, 24 Feb 2017 17:14:11 +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 v1OHE5uo086397 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 24 Feb 2017 19:14:05 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v1OHE5uo086397 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v1OHE5VO086396; Fri, 24 Feb 2017 19:14:05 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Feb 2017 19:14:05 +0200 From: Konstantin Belousov To: "Rodney W. Grimes" 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: r314210 - in stable/11/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 Message-ID: <20170224171405.GX2092@kib.kiev.ua> References: <201702241602.v1OG21SM034524@repo.freebsd.org> <201702241653.v1OGrRTJ028384@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702241653.v1OGrRTJ028384@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.7.2 (2016-11-26) 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.23 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, 24 Feb 2017 17:14:12 -0000 On Fri, Feb 24, 2017 at 08:53:27AM -0800, Rodney W. Grimes wrote: > > Author: kib > > Date: Fri Feb 24 16:02:01 2017 > > New Revision: 314210 > > URL: https://svnweb.freebsd.org/changeset/base/314210 > > > > Log: > > MFC r313154: > > For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE > > and device npx. > > Um, why????? Makes it much easier to test soft float if we can remove > the npx device. Or has soft float support died yet again? Soft float was removed very long time ago. > > Yes, an i386 without an FPU is anchient by why are we removing working > functionality? This question makes an impression that you think that kernel would not boot on a machine without FPU. The code to tolerate such configuration is there, but it is not tested for obvious reasons. Completely different issue is that userspace requires FPU and e.g. /bin/sh traps on the next setjmp(3) call. Also, we do not run on real 386, only on 486+, and there was probably only Intel 486SX CPU model which has all 486 features but no FPU. From owner-svn-src-stable-11@freebsd.org Fri Feb 24 17:57:31 2017 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 A165DCEBA4E; Fri, 24 Feb 2017 17:57:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 7C873B9E; Fri, 24 Feb 2017 17:57:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2C68210A7B9; Fri, 24 Feb 2017 12:57:29 -0500 (EST) From: John Baldwin To: Konstantin Belousov Cc: "Rodney W. Grimes" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r314210 - in stable/11/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 Date: Fri, 24 Feb 2017 09:56:03 -0800 Message-ID: <2826708.tPzGBbFfxk@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170224171405.GX2092@kib.kiev.ua> References: <201702241602.v1OG21SM034524@repo.freebsd.org> <201702241653.v1OGrRTJ028384@pdx.rh.CN85.dnsmgr.net> <20170224171405.GX2092@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 24 Feb 2017 12:57:29 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 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, 24 Feb 2017 17:57:31 -0000 On Friday, February 24, 2017 07:14:05 PM Konstantin Belousov wrote: > On Fri, Feb 24, 2017 at 08:53:27AM -0800, Rodney W. Grimes wrote: > > > Author: kib > > > Date: Fri Feb 24 16:02:01 2017 > > > New Revision: 314210 > > > URL: https://svnweb.freebsd.org/changeset/base/314210 > > > > > > Log: > > > MFC r313154: > > > For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE > > > and device npx. > > > > Um, why????? Makes it much easier to test soft float if we can remove > > the npx device. Or has soft float support died yet again? > Soft float was removed very long time ago. I think it was gone in 5.0. > > Yes, an i386 without an FPU is anchient by why are we removing working > > functionality? > This question makes an impression that you think that kernel would not > boot on a machine without FPU. The code to tolerate such configuration > is there, but it is not tested for obvious reasons. > > Completely different issue is that userspace requires FPU and e.g. /bin/sh > traps on the next setjmp(3) call. > > Also, we do not run on real 386, only on 486+, and there was probably only > Intel 486SX CPU model which has all 486 features but no FPU. Yes, we effectively require an FPU on i386. I'd be tempted to start requiring a built-in FPU (so INT 16 vs IRQ 13) so we could further reduce diffs with amd64 and eventually have an "x86" fpu.c. That would only drop support for systems using a 486sx with an external FPU. Those systems are probably happier running FreeBSD 4.x than 12 anyway. -- John Baldwin From owner-svn-src-stable-11@freebsd.org Fri Feb 24 20:47:58 2017 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 199F9CEB080; Fri, 24 Feb 2017 20:47:58 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21FAAE1; Fri, 24 Feb 2017 20:47:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OKlvVW050288; Fri, 24 Feb 2017 20:47:57 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OKluhL050281; Fri, 24 Feb 2017 20:47:56 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201702242047.v1OKluhL050281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 24 Feb 2017 20:47:56 +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: r314220 - 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.23 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, 24 Feb 2017 20:47:58 -0000 Author: ken Date: Fri Feb 24 20:47:56 2017 New Revision: 314220 URL: https://svnweb.freebsd.org/changeset/base/314220 Log: MFC r313893 ------------------------------------------------------------------------ r313893 | ken | 2017-02-17 13:04:22 -0700 (Fri, 17 Feb 2017) | 48 lines Add task attribute support to camcontrol(8). Users can use the new generic argument, -Q task_attr, to specify a task attribute (simple, ordered, head of queue, aca) for the commands issued. The the default is simple, which works with all SCSI devices that support tagged queueing. This will mostly be useful for debugging target behavior in certain situations. You can try it out by compiling CTL with CTL_IO_DELAY turned on (in sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL LUNs: ctladm delay 0:0 -l done -t 10 camcontrol tur da34 -v And at then before the 10 second timer is up, in another terminal: camcontrol inquiry da34 -Q ordered -v The Inquiry should complete just after the TUR completes. Ordinarily it would complete first because of the delay injection, but because the task attribute is set to ordered in this case, CTL holds it up until the previous command has completed. sbin/camcontrol/camcontrol.c: Add the new generic argument, -Q, which allows the user to specify a SCSI task attribute. The user can specify task attributes by name or numerically. Add a new task_attr arguments to SCSI sub-functions. sbin/camcontrol/attrib.c, sbin/camcontrol/camcontrol.h, sbin/camcontrol/fwdownload.c, sbin/camcontrol/modeedit.c, sbin/camcontrol/persist.c, sbin/camcontrol/timestamp.c, sbin/camcontrol/zone.c: Add the new task_attr argument to SCSI sub-functions. sbin/camcontrol/camcontrol.8: Document the new -Q option, and add an example. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/11/sbin/camcontrol/attrib.c stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/camcontrol.h stable/11/sbin/camcontrol/fwdownload.c stable/11/sbin/camcontrol/modeedit.c stable/11/sbin/camcontrol/persist.c stable/11/sbin/camcontrol/timestamp.c stable/11/sbin/camcontrol/zone.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/attrib.c ============================================================================== --- stable/11/sbin/camcontrol/attrib.c Fri Feb 24 20:04:02 2017 (r314219) +++ stable/11/sbin/camcontrol/attrib.c Fri Feb 24 20:47:56 2017 (r314220) @@ -106,7 +106,8 @@ static struct scsi_nv output_format_map[ int scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout, int verbosemode, int err_recover) + int task_attr, int retry_count, int timeout, int verbosemode, + int err_recover) { union ccb *ccb = NULL; int attr_num = -1; @@ -317,7 +318,7 @@ scsiattrib(struct cam_device *device, in scsi_read_attribute(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*service_action*/ read_service_action, /*element*/ element_address, /*elem_type*/ element_type, Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Fri Feb 24 20:04:02 2017 (r314219) +++ stable/11/sbin/camcontrol/camcontrol.8 Fri Feb 24 20:47:56 2017 (r314220) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2017 +.Dd February 17, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -422,6 +422,17 @@ It may take some other actions, dependin the command. .It Fl n Ar dev_name Specify the device type to operate on, e.g.\& "da", "cd". +.It Fl Q Ar task_attr +.Tn SCSI +task attribute for the command, if it is a +.Tn SCSI +command. +This may be ordered, simple, head, or aca. +In most cases this is not needed. +The default is simple, which works with all +.Tn SCSI +devices. +The task attribute may also be specified numerically. .It Fl t Ar timeout SCSI command timeout in seconds. This overrides the default timeout for @@ -2509,7 +2520,7 @@ information if the command fails since t .Fl v switch was not specified. .Bd -literal -offset indent -camcontrol tur da1 -E -C 4 -t 50 -v +camcontrol tur da1 -E -C 4 -t 50 -Q head -v .Ed .Pp Send a test unit ready command to da1. @@ -2522,6 +2533,9 @@ flag) if the command fails. Since error recovery is turned on, the disk will be spun up if it is not currently spinning. The +.Tn SCSI +task attribute for the command will be set to Head of Queue. +The .Nm utility will report whether the disk is ready. .Bd -literal -offset indent Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Fri Feb 24 20:04:02 2017 (r314219) +++ stable/11/sbin/camcontrol/camcontrol.c Fri Feb 24 20:47:56 2017 (r314220) @@ -171,6 +171,14 @@ struct ata_set_max_pwd u_int16_t reserved2[239]; }; +static struct scsi_nv task_attrs[] = { + { "simple", MSG_SIMPLE_Q_TAG }, + { "head", MSG_HEAD_OF_Q_TAG }, + { "ordered", MSG_ORDERED_Q_TAG }, + { "iwr", MSG_IGN_WIDE_RESIDUE }, + { "aca", MSG_ACA_TASK } +}; + static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GPqsS:X"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; @@ -265,12 +273,14 @@ static int getdevlist(struct cam_device #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); #ifndef MINIMALISTIC -static int testunitready(struct cam_device *device, int retry_count, - int timeout, int quiet); +static int testunitready(struct cam_device *device, int task_attr, + int retry_count, int timeout, int quiet); static int scsistart(struct cam_device *device, int startstop, int loadeject, - int retry_count, int timeout); -static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); -static int scsiserial(struct cam_device *device, int retry_count, int timeout); + int task_attr, int retry_count, int timeout); +static int scsiinquiry(struct cam_device *device, int task_attr, + int retry_count, int timeout); +static int scsiserial(struct cam_device *device, int task_attr, + int retry_count, int timeout); #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); @@ -280,11 +290,14 @@ static int scanlun_or_reset_dev(path_id_ lun_id_t lun, int scan); #ifndef MINIMALISTIC static int readdefects(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static void modepage(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsicmd(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int smpreportgeneral(struct cam_device *device, int argc, char **argv, @@ -309,16 +322,21 @@ static int get_cpi(struct cam_device *de static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd); static int get_print_cts(struct cam_device *device, int user_settings, int quiet, struct ccb_trans_settings *cts); -static int ratecontrol(struct cam_device *device, int retry_count, - int timeout, int argc, char **argv, char *combinedopt); +static int ratecontrol(struct cam_device *device, int task_attr, + int retry_count, int timeout, int argc, char **argv, + char *combinedopt); static int scsiformat(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsisanitize(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsireportluns(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsireadcapacity(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int atasecurity(struct cam_device *device, int retry_count, int timeout, @@ -331,8 +349,8 @@ static int scsiprintoneopcode(struct cam static int scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf, uint32_t valid_len); static int scsiopcodes(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, - int verbose); + char *combinedopt, int task_attr, int retry_count, + int timeout, int verbose); static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ @@ -650,8 +668,8 @@ getdevtree(int argc, char **argv, char * #ifndef MINIMALISTIC static int -testunitready(struct cam_device *device, int retry_count, int timeout, - int quiet) +testunitready(struct cam_device *device, int task_attr, int retry_count, + int timeout, int quiet) { int error = 0; union ccb *ccb; @@ -661,7 +679,7 @@ testunitready(struct cam_device *device, scsi_test_unit_ready(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); @@ -705,7 +723,7 @@ testunitready(struct cam_device *device, static int scsistart(struct cam_device *device, int startstop, int loadeject, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { union ccb *ccb; int error = 0; @@ -716,13 +734,19 @@ scsistart(struct cam_device *device, int * If we're stopping, send an ordered tag so the drive in question * will finish any previously queued writes before stopping. If * the device isn't capable of tagged queueing, or if tagged - * queueing is turned off, the tag action is a no-op. - */ + * queueing is turned off, the tag action is a no-op. We override + * the default simple tag, although this also has the effect of + * overriding the user's wishes if he wanted to specify a simple + * tag. + */ + if ((startstop == 0) + && (task_attr == MSG_SIMPLE_Q_TAG)) + task_attr = MSG_ORDERED_Q_TAG; + scsi_start_stop(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ startstop ? MSG_SIMPLE_Q_TAG : - MSG_ORDERED_Q_TAG, + /* tag_action */ task_attr, /* start/stop */ startstop, /* load_eject */ loadeject, /* immediate */ 0, @@ -783,7 +807,7 @@ scsistart(struct cam_device *device, int int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { int c; int error = 0; @@ -812,13 +836,13 @@ scsidoinquiry(struct cam_device *device, arglist |= CAM_ARG_INQ_MASK; if (arglist & CAM_ARG_GET_STDINQ) - error = scsiinquiry(device, retry_count, timeout); + error = scsiinquiry(device, task_attr, retry_count, timeout); if (error != 0) return(error); if (arglist & CAM_ARG_GET_SERIAL) - scsiserial(device, retry_count, timeout); + scsiserial(device, task_attr, retry_count, timeout); if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); @@ -827,7 +851,8 @@ scsidoinquiry(struct cam_device *device, } static int -scsiinquiry(struct cam_device *device, int retry_count, int timeout) +scsiinquiry(struct cam_device *device, int task_attr, int retry_count, + int timeout) { union ccb *ccb; struct scsi_inquiry_data *inq_buf; @@ -889,7 +914,7 @@ scsiinquiry(struct cam_device *device, i scsi_inquiry(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* inq_buf */ (u_int8_t *)inq_buf, /* inq_len */ SHORT_INQUIRY_LENGTH, /* evpd */ 0, @@ -941,7 +966,8 @@ scsiinquiry(struct cam_device *device, i } static int -scsiserial(struct cam_device *device, int retry_count, int timeout) +scsiserial(struct cam_device *device, int task_attr, int retry_count, + int timeout) { union ccb *ccb; struct scsi_vpd_unit_serial_number *serial_buf; @@ -970,7 +996,7 @@ scsiserial(struct cam_device *device, in scsi_inquiry(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* inq_buf */ (u_int8_t *)serial_buf, /* inq_len */ sizeof(*serial_buf), /* evpd */ 1, @@ -3405,7 +3431,7 @@ static struct scsi_nv defect_list_type_m static int readdefects(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb = NULL; struct scsi_read_defect_data_hdr_10 *hdr10 = NULL; @@ -3547,7 +3573,7 @@ next_batch: scsi_read_defects(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*list_format*/ list_format, /*addr_desc_index*/ starting_offset, /*data_ptr*/ defect_list, @@ -3985,7 +4011,8 @@ reassignblocks(struct cam_device *device #ifndef MINIMALISTIC void mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retry_count, int timeout, u_int8_t *data, int datalen) + int task_attr, int retry_count, int timeout, u_int8_t *data, + int datalen) { union ccb *ccb; int retval; @@ -4000,7 +4027,7 @@ mode_sense(struct cam_device *device, in scsi_mode_sense_subpage(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* dbd */ dbd, /* pc */ pc << 6, /* page */ page, @@ -4035,8 +4062,8 @@ mode_sense(struct cam_device *device, in } void -mode_select(struct cam_device *device, int save_pages, int retry_count, - int timeout, u_int8_t *data, int datalen) +mode_select(struct cam_device *device, int save_pages, int task_attr, + int retry_count, int timeout, u_int8_t *data, int datalen) { union ccb *ccb; int retval; @@ -4051,7 +4078,7 @@ mode_select(struct cam_device *device, i scsi_mode_select(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* scsi_page_fmt */ 1, /* save_pages */ save_pages, /* param_buf */ data, @@ -4086,7 +4113,7 @@ mode_select(struct cam_device *device, i void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { char *str_subpage; int c, page = -1, subpage = -1, pc = 0; @@ -4133,16 +4160,17 @@ modepage(struct cam_device *device, int errx(1, "you must specify a mode page!"); if (list != 0) { - mode_list(device, dbd, pc, list > 1, retry_count, timeout); + mode_list(device, dbd, pc, list > 1, task_attr, retry_count, + timeout); } else { mode_edit(device, dbd, pc, page, subpage, edit, binary, - retry_count, timeout); + task_attr, retry_count, timeout); } } static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int32_t flags = CAM_DIR_NONE; @@ -4387,7 +4415,7 @@ scsicmd(struct cam_device *device, int a /*retries*/ retry_count, /*cbfcnp*/ NULL, /*flags*/ flags, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*data_ptr*/ data_ptr, /*dxfer_len*/ data_bytes, /*sense_len*/ SSD_FULL_SIZE, @@ -5498,8 +5526,8 @@ get_print_cts_bailout: } static int -ratecontrol(struct cam_device *device, int retry_count, int timeout, - int argc, char **argv, char *combinedopt) +ratecontrol(struct cam_device *device, int task_attr, int retry_count, + int timeout, int argc, char **argv, char *combinedopt) { int c; union ccb *ccb; @@ -5829,7 +5857,7 @@ ratecontrol(struct cam_device *device, i } } if (send_tur) { - retval = testunitready(device, retry_count, timeout, + retval = testunitready(device, task_attr, retry_count, timeout, (arglist & CAM_ARG_VERBOSE) ? 0 : 1); /* * If the TUR didn't succeed, just bail. @@ -5854,7 +5882,7 @@ ratecontrol_bailout: static int scsiformat(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int c; @@ -5903,7 +5931,7 @@ scsiformat(struct cam_device *device, in "following device:\n"); error = scsidoinquiry(device, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); if (error != 0) { warnx("scsiformat: error sending inquiry"); @@ -5975,7 +6003,7 @@ scsiformat(struct cam_device *device, in scsi_format_unit(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* byte2 */ byte2, /* ileave */ 0, /* data_ptr */ data_ptr, @@ -6034,7 +6062,7 @@ doreport: scsi_test_unit_ready(&ccb->csio, /* retries */ 0, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 5000); @@ -6144,7 +6172,7 @@ scsiformat_bailout: static int scsisanitize(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int8_t action = 0; @@ -6309,7 +6337,7 @@ scsisanitize(struct cam_device *device, "following device:\n"); error = scsidoinquiry(device, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); if (error != 0) { warnx("scsisanitize: error sending inquiry"); @@ -6367,7 +6395,7 @@ scsisanitize(struct cam_device *device, scsi_sanitize(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* byte2 */ byte2, /* control */ 0, /* data_ptr */ data_ptr, @@ -6442,7 +6470,7 @@ doreport: scsi_test_unit_ready(&ccb->csio, /* retries */ 0, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 5000); @@ -6554,7 +6582,7 @@ scsisanitize_bailout: static int scsireportluns(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int c, countonly, lunsonly; @@ -6631,7 +6659,7 @@ retry: scsi_report_luns(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*select_report*/ report_type, /*rpl_buf*/ lundata, /*alloc_len*/ alloc_len, @@ -6796,7 +6824,7 @@ bailout: static int scsireadcapacity(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten; @@ -6882,7 +6910,7 @@ scsireadcapacity(struct cam_device *devi scsi_read_capacity(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, &rcap, SSD_FULL_SIZE, /*timeout*/ timeout ? timeout : 5000); @@ -6924,7 +6952,7 @@ scsireadcapacity(struct cam_device *devi scsi_read_capacity_16(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*lba*/ 0, /*reladdr*/ 0, /*pmi*/ 0, @@ -8365,8 +8393,8 @@ ataaxm(struct cam_device *device, int ar int scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, int show_sa_errors, int sa_set, int service_action, - int timeout_desc, int retry_count, int timeout, int verbosemode, - uint32_t *fill_len, uint8_t **data_ptr) + int timeout_desc, int task_attr, int retry_count, int timeout, + int verbosemode, uint32_t *fill_len, uint8_t **data_ptr) { union ccb *ccb = NULL; uint8_t *buf = NULL; @@ -8433,7 +8461,7 @@ retry_alloc: scsi_report_supported_opcodes(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*options*/ options, /*req_opcode*/ opcode, /*req_service_action*/ service_action, @@ -8733,7 +8761,8 @@ bailout: static int scsiopcodes(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbosemode) + char *combinedopt, int task_attr, int retry_count, int timeout, + int verbosemode) { int c; uint32_t opcode = 0, service_action = 0; @@ -8797,8 +8826,9 @@ scsiopcodes(struct cam_device *device, i goto bailout; } retval = scsigetopcodes(device, opcode_set, opcode, show_sa_errors, - sa_set, service_action, td_set, retry_count, - timeout, verbosemode, &valid_len, &buf); + sa_set, service_action, td_set, task_attr, + retry_count, timeout, verbosemode, &valid_len, + &buf); if (retval != 0) goto bailout; @@ -8992,6 +9022,7 @@ usage(int printlong) "-u unit specify unit number, e.g. \"0\", \"5\"\n" "-E have the kernel attempt to perform SCSI error recovery\n" "-C count specify the SCSI command retry count (needs -E to work)\n" +"-Q task_attr specify ordered, simple or head tag type for SCSI cmds\n" "modepage arguments:\n" "-l list all available mode pages\n" "-m page specify the mode page to view or edit\n" @@ -9196,10 +9227,11 @@ main(int argc, char **argv) int timeout = 0, retry_count = 1; camcontrol_optret optreturn; char *tstr; - const char *mainopt = "C:En:t:u:v"; + const char *mainopt = "C:En:Q:t:u:v"; const char *subopt = NULL; char combinedopt[256]; int error = 0, optstart = 2; + int task_attr = MSG_SIMPLE_Q_TAG; int devopen = 1; #ifndef MINIMALISTIC path_id_t bus; @@ -9353,6 +9385,40 @@ main(int argc, char **argv) tstr++; device = (char *)strdup(tstr); break; + case 'Q': { + char *endptr; + int table_entry = 0; + + tstr = optarg; + while (isspace(*tstr) && (*tstr != '\0')) + tstr++; + if (isdigit(*tstr)) { + task_attr = strtol(tstr, &endptr, 0); + if (*endptr != '\0') { + errx(1, "Invalid queue option " + "%s", tstr); + } + } else { + size_t table_size; + scsi_nv_status status; + + table_size = sizeof(task_attrs) / + sizeof(task_attrs[0]); + status = scsi_get_nv(task_attrs, + table_size, tstr, &table_entry, + SCSI_NV_FLAG_IG_CASE); + if (status == SCSI_NV_FOUND) + task_attr = task_attrs[ + table_entry].value; + else { + errx(1, "%s option %s", + (status == SCSI_NV_AMBIGUOUS)? + "ambiguous" : "invalid", + tstr); + } + } + break; + } case 't': timeout = strtol(optarg, NULL, 0); if (timeout < 0) @@ -9418,19 +9484,20 @@ main(int argc, char **argv) break; #ifndef MINIMALISTIC case CAM_CMD_TUR: - error = testunitready(cam_dev, retry_count, timeout, 0); + error = testunitready(cam_dev, task_attr, retry_count, + timeout, 0); break; case CAM_CMD_INQUIRY: error = scsidoinquiry(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_IDENTIFY: error = ataidentify(cam_dev, retry_count, timeout); break; case CAM_CMD_STARTSTOP: error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT, - arglist & CAM_ARG_EJECT, retry_count, - timeout); + arglist & CAM_ARG_EJECT, task_attr, + retry_count, timeout); break; #endif /* MINIMALISTIC */ case CAM_CMD_RESCAN: @@ -9442,15 +9509,15 @@ main(int argc, char **argv) #ifndef MINIMALISTIC case CAM_CMD_READ_DEFECTS: error = readdefects(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_MODE_PAGE: modepage(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_SCSI_CMD: error = scsicmd(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_SMP_CMD: error = smpcmd(cam_dev, argc, argv, combinedopt, @@ -9480,22 +9547,23 @@ main(int argc, char **argv) error = tagcontrol(cam_dev, argc, argv, combinedopt); break; case CAM_CMD_RATE: - error = ratecontrol(cam_dev, retry_count, timeout, - argc, argv, combinedopt); + error = ratecontrol(cam_dev, task_attr, retry_count, + timeout, argc, argv, combinedopt); break; case CAM_CMD_FORMAT: error = scsiformat(cam_dev, argc, argv, - combinedopt, retry_count, timeout); + combinedopt, task_attr, retry_count, + timeout); break; case CAM_CMD_REPORTLUNS: error = scsireportluns(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_READCAP: error = scsireadcapacity(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_IDLE: case CAM_CMD_STANDBY: @@ -9514,32 +9582,38 @@ main(int argc, char **argv) break; case CAM_CMD_DOWNLOAD_FW: error = fwdownload(cam_dev, argc, argv, combinedopt, - arglist & CAM_ARG_VERBOSE, retry_count, timeout); + arglist & CAM_ARG_VERBOSE, task_attr, retry_count, + timeout); break; case CAM_CMD_SANITIZE: error = scsisanitize(cam_dev, argc, argv, - combinedopt, retry_count, timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_PERSIST: error = scsipersist(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, arglist & CAM_ARG_ERR_RECOVER); break; case CAM_CMD_ATTRIB: error = scsiattrib(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, arglist & CAM_ARG_ERR_RECOVER); break; case CAM_CMD_OPCODES: error = scsiopcodes(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_REPROBE: error = scsireprobe(cam_dev); break; case CAM_CMD_ZONE: error = zone(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_EPC: error = epc(cam_dev, argc, argv, combinedopt, @@ -9547,7 +9621,8 @@ main(int argc, char **argv) break; case CAM_CMD_TIMESTAMP: error = timestamp(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: Modified: stable/11/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.h Fri Feb 24 20:04:02 2017 (r314219) +++ stable/11/sbin/camcontrol/camcontrol.h Fri Feb 24 20:47:56 2017 (r314220) @@ -75,36 +75,39 @@ int get_ata_status(struct cam_device *de uint8_t *status); int camxferrate(struct cam_device *device); int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int printerrors, int retry_count, - int timeout); + char *combinedopt, int printerrors, int task_attr, + int retry_count, int timeout); int zone(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout, int verbosemode); + int task_attr, int retry_count, int timeout, int verbosemode); int epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbosemode); int timestamp(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, + char *combinedopt, int task_attr, int retry_count, int timeout, int verbosemode); void mode_sense(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retry_count, int timeout, uint8_t *data, - int datalen); -void mode_select(struct cam_device *device, int save_pages, int retry_count, - int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, - int edit, int binary, int retry_count, int timeout); -void mode_list(struct cam_device *device, int dbd, int pc, int subpages, + int subpage, int task_attr, int retry_count, int timeout, + uint8_t *data, int datalen); +void mode_select(struct cam_device *device, int save_pages, int task_attr, + int retry_count, int timeout, u_int8_t *data, int datalen); +void mode_edit(struct cam_device *device, int dbd, int pc, int page, + int subpage, int edit, int binary, int task_attr, int retry_count, int timeout); +void mode_list(struct cam_device *device, int dbd, int pc, int subpages, + int task_attr, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); int scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, int show_sa_errors, int sa_set, int service_action, - int timeout_desc, int retry_count, int timeout, - int verbosemode, uint32_t *fill_len, uint8_t **data_ptr); + int timeout_desc, int task_attr, int retry_count, + int timeout, int verbosemode, uint32_t *fill_len, + uint8_t **data_ptr); int scsipersist(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbose, - int err_recover); + char *combinedopt, int task_attr, int retry_count, + int timeout, int verbose, int err_recover); int scsiattrib(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbose, - int err_recover); + char *combinedopt, int task_attr, int retry_count, int timeout, + int verbose, int err_recover); char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); Modified: stable/11/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/11/sbin/camcontrol/fwdownload.c Fri Feb 24 20:04:02 2017 (r314219) +++ stable/11/sbin/camcontrol/fwdownload.c Fri Feb 24 20:47:56 2017 (r314220) @@ -263,7 +263,7 @@ static const struct fw_timeout_desc fw_t static struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev, struct ata_params *ident_buf); static int fw_get_timeout(struct cam_device *cam_dev, struct fw_vendor *vp, - int retry_count, int timeout); + int task_attr, int retry_count, int timeout); static int fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd, char *buf, const char *fw_img_path, int quiet); @@ -317,7 +317,7 @@ fw_get_vendor(struct cam_device *cam_dev static int fw_get_timeout(struct cam_device *cam_dev, struct fw_vendor *vp, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { struct scsi_report_supported_opcodes_one *one; struct scsi_report_supported_opcodes_timeout *td; @@ -349,6 +349,7 @@ fw_get_timeout(struct cam_device *cam_de /*sa_set*/ 0, /*service_action*/ 0, /*timeout_desc*/ 1, + /*task_attr*/ task_attr, /*retry_count*/ retry_count, /*timeout*/ 10000, /*verbose*/ 0, @@ -919,7 +920,8 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int printerrors, int retry_count, int timeout) + char *combinedopt, int printerrors, int task_attr, int retry_count, + int timeout) { struct fw_vendor *vp; char *fw_img_path = NULL; @@ -994,7 +996,7 @@ fwdownload(struct cam_device *device, in && (devtype == CC_DT_SCSI)) errx(1, "Unsupported device"); - retval = fw_get_timeout(device, vp, retry_count, timeout); + retval = fw_get_timeout(device, vp, task_attr, retry_count, timeout); if (retval != 0) { warnx("Unable to get a firmware download timeout value"); goto bailout; @@ -1012,8 +1014,8 @@ fwdownload(struct cam_device *device, in " into the following device:\n", fw_img_path); if (devtype == CC_DT_SCSI) { - if (scsidoinquiry(device, argc, argv, combinedopt, 0, - 5000) != 0) { + if (scsidoinquiry(device, argc, argv, combinedopt, + MSG_SIMPLE_Q_TAG, 0, 5000) != 0) { warnx("Error sending inquiry"); retval = 1; goto bailout; Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Fri Feb 24 20:04:02 2017 (r314219) +++ stable/11/sbin/camcontrol/modeedit.c Fri Feb 24 20:47:56 2017 (r314220) @@ -106,10 +106,11 @@ static int editentry_set(char *name, c int editonly); static void editlist_populate(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout); + int task_attr, int retries, + int timeout); static void editlist_save(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout); + int task_attr, int retries, int timeout); static void nameentry_create(int page, int subpage, char *name); static struct pagename *nameentry_lookup(int page, int subpage); static int load_format(const char *pagedb_path, int lpage, @@ -118,8 +119,8 @@ static int modepage_write(FILE *file, static int modepage_read(FILE *file); static void modepage_edit(void); static void modepage_dump(struct cam_device *device, int dbd, - int pc, int page, int subpage, int retries, - int timeout); + int pc, int page, int subpage, int task_attr, + int retries, int timeout); static void cleanup_editfile(void); @@ -550,7 +551,7 @@ load_format(const char *pagedb_path, int static void editlist_populate(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retries, int timeout) + int subpage, int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -562,8 +563,8 @@ editlist_populate(struct cam_device *dev STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, dbd, 1, page, subpage, retries, timeout, data, - sizeof(data)); + mode_sense(device, dbd, 1, page, subpage, task_attr, retries, timeout, + data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); @@ -581,14 +582,14 @@ editlist_populate(struct cam_device *dev buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void editlist_save(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retries, int timeout) + int subpage, int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -602,7 +603,7 @@ editlist_save(struct cam_device *device, return; /* Preload the CDB buffer with the current mode page data. */ - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); /* Initial headers & offsets. */ @@ -639,7 +640,8 @@ editlist_save(struct cam_device *device, * recorded. */ mode_select(device, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), - retries, timeout, (u_int8_t *)mh, sizeof(*mh) + hlen + len); + task_attr, retries, timeout, (u_int8_t *)mh, + sizeof(*mh) + hlen + len); } static int @@ -809,7 +811,7 @@ modepage_edit(void) static void modepage_dump(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout) + int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -818,7 +820,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_page_header_sp *mphsp; size_t indx, len; - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; @@ -853,7 +855,7 @@ cleanup_editfile(void) void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, - int edit, int binary, int retry_count, int timeout) + int edit, int binary, int task_attr, int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ @@ -884,8 +886,8 @@ mode_edit(struct cam_device *device, int exit(EX_OSFILE); } - editlist_populate(device, dbd, pc, page, subpage, retry_count, - timeout); + editlist_populate(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } if (edit) { @@ -894,10 +896,12 @@ mode_edit(struct cam_device *device, int errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, dbd, pc, page, subpage, retry_count, timeout); + editlist_save(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, dbd, pc, page, subpage, retry_count, timeout); + modepage_dump(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } else { /* Display with format. */ modepage_write(stdout, 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Fri Feb 24 21:19:41 2017 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 C6C95CEBA44; Fri, 24 Feb 2017 21:19:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 779B81ECB; Fri, 24 Feb 2017 21:19:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OLJe9D063139; Fri, 24 Feb 2017 21:19:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OLJeIo063136; Fri, 24 Feb 2017 21:19:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201702242119.v1OLJeIo063136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 24 Feb 2017 21:19: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: r314222 - in stable/11/sys/dev: iwi ral usb/wlan 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.23 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, 24 Feb 2017 21:19:41 -0000 Author: avos Date: Fri Feb 24 21:19:40 2017 New Revision: 314222 URL: https://svnweb.freebsd.org/changeset/base/314222 Log: MFC r313906: iwi, ral, zyd: fix possible use-after-free. Modified: stable/11/sys/dev/iwi/if_iwi.c stable/11/sys/dev/ral/rt2661.c stable/11/sys/dev/usb/wlan/if_zyd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/11/sys/dev/iwi/if_iwi.c Fri Feb 24 20:51:39 2017 (r314221) +++ stable/11/sys/dev/iwi/if_iwi.c Fri Feb 24 21:19:40 2017 (r314222) @@ -1979,9 +1979,9 @@ iwi_start(struct iwi_softc *sc) } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (iwi_tx_start(sc, m, ni, ac) != 0) { - ieee80211_free_node(ni); if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); break; } sc->sc_tx_timer = 5; Modified: stable/11/sys/dev/ral/rt2661.c ============================================================================== --- stable/11/sys/dev/ral/rt2661.c Fri Feb 24 20:51:39 2017 (r314221) +++ stable/11/sys/dev/ral/rt2661.c Fri Feb 24 21:19:40 2017 (r314222) @@ -1619,9 +1619,9 @@ rt2661_start(struct rt2661_softc *sc) } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (rt2661_tx_data(sc, m, ni, ac) != 0) { - ieee80211_free_node(ni); if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); break; } sc->sc_tx_timer = 5; Modified: stable/11/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/11/sys/dev/usb/wlan/if_zyd.c Fri Feb 24 20:51:39 2017 (r314221) +++ stable/11/sys/dev/usb/wlan/if_zyd.c Fri Feb 24 21:19:40 2017 (r314222) @@ -2570,10 +2570,10 @@ zyd_start(struct zyd_softc *sc) while (sc->tx_nfree > 0 && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; if (zyd_tx_start(sc, m, ni) != 0) { - ieee80211_free_node(ni); m_freem(m); if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); break; } } From owner-svn-src-stable-11@freebsd.org Fri Feb 24 21:20:50 2017 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 09039CEBC31; Fri, 24 Feb 2017 21:20:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D51EB9A; Fri, 24 Feb 2017 21:20:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OLKmVE063259; Fri, 24 Feb 2017 21:20:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OLKmCT063253; Fri, 24 Feb 2017 21:20:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702242120.v1OLKmCT063253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 24 Feb 2017 21:20: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: r314223 - in stable/11/sys/dev: hpt27xx hptnr hptrr 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.23 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, 24 Feb 2017 21:20:50 -0000 Author: pfg Date: Fri Feb 24 21:20:48 2017 New Revision: 314223 URL: https://svnweb.freebsd.org/changeset/base/314223 Log: MFC r313554: Clean redundant MIN/MAX declarations in some HighPoint drivers. The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX() internally which match the macros from sys/param.h. MIN() is not used, MAX is only used once and can be replaced with the max() version in libkern.h which operates on u_ints. MFC after: 2 weeks Modified: stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c stable/11/sys/dev/hpt27xx/ldm.h stable/11/sys/dev/hptnr/hptnr_osm_bsd.c stable/11/sys/dev/hptnr/ldm.h stable/11/sys/dev/hptrr/hptrr_osm_bsd.c stable/11/sys/dev/hptrr/ldm.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 24 21:19:40 2017 (r314222) +++ stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 24 21:20:48 2017 (r314223) @@ -297,7 +297,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_lock_vbus(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: stable/11/sys/dev/hpt27xx/ldm.h ============================================================================== --- stable/11/sys/dev/hpt27xx/ldm.h Fri Feb 24 21:19:40 2017 (r314222) +++ stable/11/sys/dev/hpt27xx/ldm.h Fri Feb 24 21:20:48 2017 (r314223) @@ -59,10 +59,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; #define hpt_time_after_eq(a, b) ((int)(a) - (int)(b) >= 0) Modified: stable/11/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- stable/11/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 24 21:19:40 2017 (r314222) +++ stable/11/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 24 21:20:48 2017 (r314223) @@ -294,7 +294,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: stable/11/sys/dev/hptnr/ldm.h ============================================================================== --- stable/11/sys/dev/hptnr/ldm.h Fri Feb 24 21:19:40 2017 (r314222) +++ stable/11/sys/dev/hptnr/ldm.h Fri Feb 24 21:20:48 2017 (r314223) @@ -58,9 +58,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; Modified: stable/11/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/11/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 24 21:19:40 2017 (r314222) +++ stable/11/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 24 21:20:48 2017 (r314223) @@ -300,7 +300,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: stable/11/sys/dev/hptrr/ldm.h ============================================================================== --- stable/11/sys/dev/hptrr/ldm.h Fri Feb 24 21:19:40 2017 (r314222) +++ stable/11/sys/dev/hptrr/ldm.h Fri Feb 24 21:20:48 2017 (r314223) @@ -58,10 +58,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; #define hpt_time_after_eq(a, b) ((long)(a) - (long)(b) >= 0) From owner-svn-src-stable-11@freebsd.org Fri Feb 24 21:35:54 2017 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 A3D1BCEC0C9; Fri, 24 Feb 2017 21:35:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72915FBA; Fri, 24 Feb 2017 21:35:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OLZrYT071462; Fri, 24 Feb 2017 21:35:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OLZrpE071461; Fri, 24 Feb 2017 21:35:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702242135.v1OLZrpE071461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 24 Feb 2017 21:35: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: r314225 - stable/11/sys/fs/ext2fs 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.23 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, 24 Feb 2017 21:35:54 -0000 Author: pfg Date: Fri Feb 24 21:35:53 2017 New Revision: 314225 URL: https://svnweb.freebsd.org/changeset/base/314225 Log: MFC r313897: ext2fs: Remove unused assignment. The value is re-assigned a few lines later without being read. Found by: Clang static analyzer Modified: stable/11/sys/fs/ext2fs/ext2_htree.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_htree.c Fri Feb 24 21:22:13 2017 (r314224) +++ stable/11/sys/fs/ext2fs/ext2_htree.c Fri Feb 24 21:35:53 2017 (r314225) @@ -766,7 +766,6 @@ ext2_htree_add_entry(struct vnode *dvp, root_entires = info.h_levels[0].h_entries; newidxblock = malloc(blksize, M_TEMP, M_WAITOK | M_ZERO); dst_node = (struct ext2fs_htree_node *)newidxblock; - dst_entries = dst_node->h_entries; memset(&dst_node->h_fake_dirent, 0, sizeof(dst_node->h_fake_dirent)); dst_node->h_fake_dirent.e2d_reclen = blksize; From owner-svn-src-stable-11@freebsd.org Sat Feb 25 00:18:42 2017 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 DB85ECEC9AF; Sat, 25 Feb 2017 00:18:42 +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 798D127E; Sat, 25 Feb 2017 00:18:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 0F61B3CC5F4; Sat, 25 Feb 2017 11:18:31 +1100 (AEDT) Date: Sat, 25 Feb 2017 11:18:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Konstantin Belousov , "Rodney W. Grimes" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r314210 - in stable/11/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 In-Reply-To: <2826708.tPzGBbFfxk@ralph.baldwin.cx> Message-ID: <20170225085937.O1026@besplex.bde.org> References: <201702241602.v1OG21SM034524@repo.freebsd.org> <201702241653.v1OGrRTJ028384@pdx.rh.CN85.dnsmgr.net> <20170224171405.GX2092@kib.kiev.ua> <2826708.tPzGBbFfxk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=Ca543Pjl c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=sDp809hHjrCLAIVfDQsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 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, 25 Feb 2017 00:18:43 -0000 On Fri, 24 Feb 2017, John Baldwin wrote: > On Friday, February 24, 2017 07:14:05 PM Konstantin Belousov wrote: >> On Fri, Feb 24, 2017 at 08:53:27AM -0800, Rodney W. Grimes wrote: >>>> Author: kib >>>> Date: Fri Feb 24 16:02:01 2017 >>>> New Revision: 314210 >>>> URL: https://svnweb.freebsd.org/changeset/base/314210 >>>> >>>> Log: >>>> MFC r313154: >>>> For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE >>>> and device npx. >>> >>> Um, why????? Since the static configuration is only useful for testing, and complicates the code, and tends to rot (it was most recently broken by only adding fcmpset() in the !CPU_DISABLE_CMPXCHG clause of atomic.h and then using fcmpset() in MI code without any ifdef). >>> Makes it much easier to test soft float if we can remove >>> the npx device. Or has soft float support died yet again? Not much easier. First you have to fix the bitrot. Than maybe rewrite the static configuration code to be less complicated and more maintainable. It is easier to use dynamic configuration for everything. This only costs a few hundred bytes (unless you have really large and complicated ifdefs to omit more code statically) and a few cycles quite often at runtime. No one cares much about the few cycles. >> Soft float was removed very long time ago. > > I think it was gone in 5.0. > >>> Yes, an i386 without an FPU is anchient by why are we removing working >>> functionality? >> This question makes an impression that you think that kernel would not >> boot on a machine without FPU. The code to tolerate such configuration >> is there, but it is not tested for obvious reasons. >> >> Completely different issue is that userspace requires FPU and e.g. /bin/sh >> traps on the next setjmp(3) call. This is my context-switching code for the FPU in setjmp(). It requires either an FPU or an emulator, and there was an emulator when it was written. When I discussed removing the static configuration code with kib, I mentioned that SSE is still not properly supported on i386, but haven't got around to responding with the details. The main one is this code in setjmp(). It is is still completely missing SSE support. So FPU+SSE states set by fenv get restored inconsistently by longjmp(). The current brokenness seems to be: - i386 restores the control word for the i387 only. fenve has dynamic SSE tests, and it sets both the x87 and the SSE control works for things like fesetround(). Then longjmp() leaves the SSE control word inconsistent. - both amd64 and i386 attempt to preserve the exception flags. This might be useful, but is quite broken. My original fixes cleared the i387 env before restoring the control word. Other systems were broken in not restoring anything or more broken in not clearing anything. According to das's commits that changed this, other systems still didn't restore the control word(s) 16 years later in 2008, and C99 doesn't require restoring the control words, but C99 does require restoring the status word. I couldn't find where C99 requires this. For the i387 or any FPU with similar or even more imprecise exceptions, leaving unmasked exceptions to trap again later would be painful. Anyway, das's changes don't really work: - kib committed my fix to stop clearing x87 exception flags in the kernel part of the SIGFPE handler in 2012. This makes x87 exceptions faults (repeat at the FP instruction that trapped, if a SIGFPE handler returns), which is too surprising for most applications, but few notice because few even unmask the traps. So it is now possible to recover the exception flags. But this is quite complicated, and far too hard to do in longjmp() from a signal handler. So the flags aren't actually preserved for the longjmp() freom a signal handler. - for the x87, there is other state to restore or clear. The status word contains the stack pointer together with the exception flags. The tag word contains the status of the 8 registers on the stack. The stack pointer can be anything provided the tag word is clear. For longjmp() from signal handlers, we depend on signal handlers getting a clean state so that there is no garbage on the stack. I'm not sure if all combinations of kernels and libraries are consistent about this (old signal handlers don't do this, but should only be used with old setjmp()/longjmp() that clear the state). For longjmp() not from signal handlers, we depend on the ABI guaranteeing that there is no garbage on the stack or in the FP env when longjmp() is called. Dynamic SSE tests can probably be done better using vdso, but only if vdso is almost free. I don't know if it requires a syscall to set up, or is automatic but costs all applications to set up. Otherwise, sigsetjmp() and siglongjmp() are already very slow (they do too many syscalls), so even another syscall to detect SSE would not make them much slower. They can share the SSE detection with fenv. This would work OK, but is inconvenient since fenv lives in libm. >> Also, we do not run on real 386, only on 486+, and there was probably only >> Intel 486SX CPU model which has all 486 features but no FPU. > > Yes, we effectively require an FPU on i386. I'd be tempted to start requiring > a built-in FPU (so INT 16 vs IRQ 13) so we could further reduce diffs with > amd64 and eventually have an "x86" fpu.c. That would only drop support for That would be backwords. amd64 should have an "x86" npx.c. The kernel does almost no FPU handling, so npx is a better name than fpu. It is even better than in 1991, since the numeric extensions are not limited to floating point ones. First there was mmx, then Intel started unimproving names with sse, then intel got tired of changing the prefix and started using nondescript sse numbers. > systems using a 486sx with an external FPU. Those systems are probably happier > running FreeBSD 4.x than 12 anyway. Bruce From owner-svn-src-stable-11@freebsd.org Sat Feb 25 00:42:19 2017 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 0F883CEB1C9; Sat, 25 Feb 2017 00:42:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0FC813B6; Sat, 25 Feb 2017 00:42:18 +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 v1P0gHBW049293; Sat, 25 Feb 2017 00:42:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1P0gHgp049292; Sat, 25 Feb 2017 00:42:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702250042.v1P0gHgp049292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 25 Feb 2017 00:42:17 +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: r314235 - stable/11 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.23 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, 25 Feb 2017 00:42:19 -0000 Author: ngie Date: Sat Feb 25 00:42:17 2017 New Revision: 314235 URL: https://svnweb.freebsd.org/changeset/base/314235 Log: MFC r313924,r313925: r313924: Quote path to doxygen/kyua in test(1) -x check This is a basic stopgap against ${LOCALBASE} containing spaces in it r313925: Include ${LOCALBASE}/bin in $PATH when running "make checkworld" Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH, which means that the tests fail when run via "make checkworld" because $PATH is restricted to exclude directory elements like "${LOCALBASE}/bin". Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sat Feb 25 00:40:50 2017 (r314234) +++ stable/11/Makefile.inc1 Sat Feb 25 00:42:17 2017 (r314235) @@ -1479,11 +1479,11 @@ sign-packages: _pkgbootstrap .PHONY # Run test suite on installed world. # checkworld: .PHONY - @if [ ! -x ${LOCALBASE}/bin/kyua ]; then \ + @if [ ! -x "${LOCALBASE}/bin/kyua" ]; then \ echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \ exit 1; \ fi - ${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile + ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile # # @@ -1492,7 +1492,7 @@ checkworld: .PHONY # Build the API documentation with doxygen # doxygen: .PHONY - @if [ ! -x ${LOCALBASE}/bin/doxygen ]; then \ + @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \ echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ exit 1; \ fi From owner-svn-src-stable-11@freebsd.org Sat Feb 25 01:52:09 2017 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 27A35CEC269; Sat, 25 Feb 2017 01:52:09 +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 DB36A1224; Sat, 25 Feb 2017 01:52:08 +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 v1P1q72T074552; Sat, 25 Feb 2017 01:52:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1P1q7Jc074551; Sat, 25 Feb 2017 01:52:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702250152.v1P1q7Jc074551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 25 Feb 2017 01:52:07 +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: r314237 - stable/11/sys/cam/ctl 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.23 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, 25 Feb 2017 01:52:09 -0000 Author: mav Date: Sat Feb 25 01:52:07 2017 New Revision: 314237 URL: https://svnweb.freebsd.org/changeset/base/314237 Log: MFC r313910: Change XCOPY memory allocations. Before this change XCOPY code could allocate memory in chunks up to 16-32MB (VMware does XCOPY in 4MB chunks by default), that could be difficult for VM subsystem to do due to KVA fragmentation, that sometimes created huge allocation delays, blocking any I/O for respective LU for that time. This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now. 1MB is also not a cookie, but ZFS also can do that for large blocks, so it should be less dramatic. As drawback this increases CPU overhead, but it still look acceptable comparing to time consumed by ZFS read/write. Modified: stable/11/sys/cam/ctl/ctl_tpc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_tpc.c Sat Feb 25 00:42:44 2017 (r314236) +++ stable/11/sys/cam/ctl/ctl_tpc.c Sat Feb 25 01:52:07 2017 (r314237) @@ -85,6 +85,7 @@ struct tpc_io { uint8_t target; uint32_t cscd; uint64_t lun; + uint8_t *buf; struct tpc_list *list; struct runl run; TAILQ_ENTRY(tpc_io) rlinks; @@ -127,7 +128,6 @@ struct tpc_list { off_t curbytes; int curops; int stage; - uint8_t *buf; off_t segsectors; off_t segbytes; int tbdio; @@ -813,9 +813,9 @@ tpc_process_b2b(struct tpc_list *list) while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tior, links); ctl_free_io(tior->io); + free(tior->buf, M_CTL); free(tior, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -874,7 +874,6 @@ tpc_process_b2b(struct tpc_list *list) return (CTL_RETVAL_ERROR); } - list->buf = malloc(numbytes, M_CTL, M_WAITOK); list->segbytes = numbytes; list->segsectors = numbytes / dstblock; donebytes = 0; @@ -894,11 +893,12 @@ tpc_process_b2b(struct tpc_list *list) tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); + tior->buf = malloc(roundbytes, M_CTL, M_WAITOK); tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); ctl_scsi_read_write(tior->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 1, /*byte2*/ 0, @@ -919,7 +919,7 @@ tpc_process_b2b(struct tpc_list *list) TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); ctl_scsi_read_write(tiow->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 0, /*byte2*/ 0, @@ -1029,9 +1029,9 @@ tpc_process_register_key(struct tpc_list while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); + free(tio->buf, M_CTL); free(tio, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -1064,9 +1064,9 @@ tpc_process_register_key(struct tpc_list TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); datalen = sizeof(struct scsi_per_res_out_parms); - list->buf = malloc(datalen, M_CTL, M_WAITOK); + tio->buf = malloc(datalen, M_CTL, M_WAITOK); ctl_scsi_persistent_res_out(tio->io, - list->buf, datalen, SPRO_REGISTER, -1, + tio->buf, datalen, SPRO_REGISTER, -1, scsi_8btou64(seg->res_key), scsi_8btou64(seg->sa_res_key), /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; @@ -1166,9 +1166,9 @@ tpc_process_wut(struct tpc_list *list) while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); + free(tio->buf, M_CTL); free(tio, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -1233,8 +1233,6 @@ tpc_process_wut(struct tpc_list *list) return (CTL_RETVAL_ERROR); } - list->buf = malloc(numbytes, M_CTL, M_WAITOK | - (list->token == NULL ? M_ZERO : 0)); list->segbytes = numbytes; list->segsectors = numbytes / dstblock; //printf("Copy chunk of %ju sectors from %ju to %ju\n", list->segsectors, @@ -1257,11 +1255,12 @@ tpc_process_wut(struct tpc_list *list) tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); + tior->buf = malloc(roundbytes, M_CTL, M_WAITOK); tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); ctl_scsi_read_write(tior->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 1, /*byte2*/ 0, @@ -1280,7 +1279,7 @@ tpc_process_wut(struct tpc_list *list) TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); ctl_scsi_read_write(tiow->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 0, /*byte2*/ 0, From owner-svn-src-stable-11@freebsd.org Sat Feb 25 08:07:30 2017 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 4123DCEC3BE; Sat, 25 Feb 2017 08:07:30 +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 1BAFA8F2; Sat, 25 Feb 2017 08:07:30 +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 v1P87Tme028665; Sat, 25 Feb 2017 08:07:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1P87SpI028662; Sat, 25 Feb 2017 08:07:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201702250807.v1P87SpI028662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 25 Feb 2017 08:07:28 +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: r314251 - in stable: 10/contrib/ipfilter/lib 10/sys/contrib/ipfilter/netinet 11/contrib/ipfilter/lib 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.23 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, 25 Feb 2017 08:07:30 -0000 Author: cy Date: Sat Feb 25 08:07:28 2017 New Revision: 314251 URL: https://svnweb.freebsd.org/changeset/base/314251 Log: MFC r312787: Currently the fragment info is placed at the top of the linked list under a shared read lock. This patch attempts to upgrade the lock to an exclusive write lock. If the exclusive write lock fails to be obtained, the current fragment is not placed at the head of the list. This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which effectively removed the section of code that performed the reordering). The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c. The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch by emulating the mutex in userspace when exercised by ipftest(1). Inspired by: NetBSD ip_frag.c r1.4 Modified: stable/11/contrib/ipfilter/lib/rwlock_emul.c stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/lib/rwlock_emul.c stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/10/ (props changed) Modified: stable/11/contrib/ipfilter/lib/rwlock_emul.c ============================================================================== --- stable/11/contrib/ipfilter/lib/rwlock_emul.c Sat Feb 25 06:11:59 2017 (r314250) +++ stable/11/contrib/ipfilter/lib/rwlock_emul.c Sat Feb 25 08:07:28 2017 (r314251) @@ -56,6 +56,27 @@ void eMrwlock_write_enter(rw, file, line } +void eMrwlock_try_upgrade(rw, file, line) + eMrwlock_t *rw; + char *file; + int line; +{ + if (rw->eMrw_magic != EMM_MAGIC) { + fprintf(stderr, "%s:eMrwlock_write_enter(%p): bad magic: %#x\n", + rw->eMrw_owner, rw, rw->eMrw_magic); + abort(); + } + if (rw->eMrw_read != 0 || rw->eMrw_write != 0) { + fprintf(stderr, + "%s:eMrwlock_try_upgrade(%p): already locked: %d/%d\n", + rw->eMrw_owner, rw, rw->eMrw_read, rw->eMrw_write); + abort(); + } + rw->eMrw_write++; + rw->eMrw_heldin = file; + rw->eMrw_heldat = line; +} + void eMrwlock_downgrade(rw, file, line) eMrwlock_t *rw; char *file; Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sat Feb 25 06:11:59 2017 (r314250) +++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sat Feb 25 08:07:28 2017 (r314251) @@ -165,6 +165,7 @@ struct ether_addr { # define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) # define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) # define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) +# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) # define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) # define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) # define RWLOCK_EXIT(x) do { \ @@ -420,6 +421,8 @@ extern void freembt __P((mb_t *)); # define MUTEX_DOWNGRADE(x) eMrwlock_downgrade(&(x)->ipf_emu, \ __FILE__, __LINE__) +# define MUTEX_TRY_UPGRADE(x) eMrwlock_try_upgrade(&(x)->ipf_emu, \ + __FILE__, __LINE__) # define READ_ENTER(x) eMrwlock_read_enter(&(x)->ipf_emu, \ __FILE__, __LINE__) # define RWLOCK_INIT(x, y) eMrwlock_init(&(x)->ipf_emu, y) @@ -670,6 +673,7 @@ extern char *ipf_getifname __P((struct i # define READ_ENTER(x) ; # define WRITE_ENTER(x) ; # define MUTEX_DOWNGRADE(x) ; +# define MUTEX_TRY_UPGRADE(x) ; # define RWLOCK_INIT(x, y) ; # define RWLOCK_EXIT(x) ; # define RW_DESTROY(x) ; Modified: stable/11/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Sat Feb 25 06:11:59 2017 (r314250) +++ stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Sat Feb 25 08:07:28 2017 (r314251) @@ -745,7 +745,7 @@ ipf_frag_lookup(softc, softf, fin, table } else if (off == 0) f->ipfr_seen0 = 1; - if (f != table[idx]) { + if (f != table[idx] && MUTEX_TRY_UPGRADE(lock)) { ipfr_t **fp; /* @@ -763,6 +763,7 @@ ipf_frag_lookup(softc, softf, fin, table table[idx]->ipfr_hprev = &f->ipfr_hnext; f->ipfr_hprev = table + idx; table[idx] = f; + MUTEX_DOWNGRADE(lock); } /* From owner-svn-src-stable-11@freebsd.org Sat Feb 25 08:47:00 2017 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 8F3B6CECCE8; Sat, 25 Feb 2017 08:47:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 298AF1B14; Sat, 25 Feb 2017 08:46:59 +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 v1P8kniW092577 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 25 Feb 2017 10:46:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v1P8kniW092577 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v1P8km15092576; Sat, 25 Feb 2017 10:46:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Feb 2017 10:46:48 +0200 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , "Rodney W. Grimes" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r314210 - in stable/11/sys: conf i386/conf i386/i386 i386/include i386/isa i386/linux x86/acpica x86/x86 Message-ID: <20170225084648.GB2092@kib.kiev.ua> References: <201702241602.v1OG21SM034524@repo.freebsd.org> <201702241653.v1OGrRTJ028384@pdx.rh.CN85.dnsmgr.net> <20170224171405.GX2092@kib.kiev.ua> <2826708.tPzGBbFfxk@ralph.baldwin.cx> <20170225085937.O1026@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170225085937.O1026@besplex.bde.org> User-Agent: Mutt/1.7.2 (2016-11-26) 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.23 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, 25 Feb 2017 08:47:00 -0000 On Sat, Feb 25, 2017 at 11:18:30AM +1100, Bruce Evans wrote: > On Fri, 24 Feb 2017, John Baldwin wrote: > > > On Friday, February 24, 2017 07:14:05 PM Konstantin Belousov wrote: > >> On Fri, Feb 24, 2017 at 08:53:27AM -0800, Rodney W. Grimes wrote: > >>>> Author: kib > >>>> Date: Fri Feb 24 16:02:01 2017 > >>>> New Revision: 314210 > >>>> URL: https://svnweb.freebsd.org/changeset/base/314210 > >>>> > >>>> Log: > >>>> MFC r313154: > >>>> For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE > >>>> and device npx. > >>> > >>> Um, why????? > > Since the static configuration is only useful for testing, and complicates > the code, and tends to rot (it was most recently broken by only adding > fcmpset() in the !CPU_DISABLE_CMPXCHG clause of atomic.h and then using > fcmpset() in MI code without any ifdef). > > >>> Makes it much easier to test soft float if we can remove > >>> the npx device. Or has soft float support died yet again? > > Not much easier. First you have to fix the bitrot. Than maybe rewrite > the static configuration code to be less complicated and more maintainable. > It is easier to use dynamic configuration for everything. This only costs > a few hundred bytes (unless you have really large and complicated ifdefs > to omit more code statically) and a few cycles quite often at runtime. No > one cares much about the few cycles. > > >> Soft float was removed very long time ago. > > > > I think it was gone in 5.0. > > > >>> Yes, an i386 without an FPU is anchient by why are we removing working > >>> functionality? > >> This question makes an impression that you think that kernel would not > >> boot on a machine without FPU. The code to tolerate such configuration > >> is there, but it is not tested for obvious reasons. > >> > >> Completely different issue is that userspace requires FPU and e.g. /bin/sh > >> traps on the next setjmp(3) call. > > This is my context-switching code for the FPU in setjmp(). It requires > either an FPU or an emulator, and there was an emulator when it was written. > > When I discussed removing the static configuration code with kib, I > mentioned that SSE is still not properly supported on i386, but haven't > got around to responding with the details. The main one is this code > in setjmp(). It is is still completely missing SSE support. So FPU+SSE > states set by fenv get restored inconsistently by longjmp(). The current > brokenness seems to be: > - i386 restores the control word for the i387 only. fenve has dynamic > SSE tests, and it sets both the x87 and the SSE control works for > things like fesetround(). Then longjmp() leaves the SSE control word > inconsistent. We do not have unused space in the jmp_buf to preserve SSE state. Do you mean to restore SSE MXCSR control bits to the same state as x87 cw ? > - both amd64 and i386 attempt to preserve the exception flags. This > might be useful, but is quite broken. > > My original fixes cleared the i387 env before restoring the control > word. Other systems were broken in not restoring anything or more > broken in not clearing anything. According to das's commits that > changed this, other systems still didn't restore the control word(s) > 16 years later in 2008, and C99 doesn't require restoring the control > words, but C99 does require restoring the status word. I couldn't > find where C99 requires this. > > For the i387 or any FPU with similar or even more imprecise exceptions, > leaving unmasked exceptions to trap again later would be painful. > > Anyway, das's changes don't really work: > - kib committed my fix to stop clearing x87 exception flags in the > kernel part of the SIGFPE handler in 2012. This makes x87 exceptions > faults (repeat at the FP instruction that trapped, if a SIGFPE handler > returns), which is too surprising for most applications, but few notice > because few even unmask the traps. So it is now possible to recover > the exception flags. But this is quite complicated, and far too hard > to do in longjmp() from a signal handler. So the flags aren't actually > preserved for the longjmp() freom a signal handler. > - for the x87, there is other state to restore or clear. The status word > contains the stack pointer together with the exception flags. The tag > word contains the status of the 8 registers on the stack. The stack > pointer can be anything provided the tag word is clear. For longjmp() > from signal handlers, we depend on signal handlers getting a clean > state so that there is no garbage on the stack. I'm not sure if all > combinations of kernels and libraries are consistent about this (old > signal handlers don't do this, but should only be used with old > setjmp()/longjmp() that clear the state). For longjmp() not from > signal handlers, we depend on the ABI guaranteeing that there is > no garbage on the stack or in the FP env when longjmp() is called. > > Dynamic SSE tests can probably be done better using vdso, but only if > vdso is almost free. I don't know if it requires a syscall to set up, > or is automatic but costs all applications to set up. Otherwise, > sigsetjmp() and siglongjmp() are already very slow (they do too many > syscalls), so even another syscall to detect SSE would not make them > much slower. They can share the SSE detection with fenv. This would > work OK, but is inconvenient since fenv lives in libm. SSE detection is done by CPUID and a single bit test, it does not require a syscall. There are some plans and WIP to bring analog of cpu_feature* variables into libc, but it is not too critically important. Libc and indirectly libthr already detect XSAVE support and use it for full context saving and for deferred signal delivery in threaded critical section. sigsetjmp and siglongjmp only execute one syscall each on x86. In principle, we can try to increase jmp_buf size to provide more hardware registers saved and restored by *jmp functions, but this is quite painful and should be proven to provide real benefits besides theoretical correctness. E.g., some high-profile application which depends on restoration of SSE state after siglongjmp from a signal handler would do it, otherwise ABI breakage makes it better to not try. > > >> Also, we do not run on real 386, only on 486+, and there was probably only > >> Intel 486SX CPU model which has all 486 features but no FPU. > > > > Yes, we effectively require an FPU on i386. I'd be tempted to start requiring > > a built-in FPU (so INT 16 vs IRQ 13) so we could further reduce diffs with > > amd64 and eventually have an "x86" fpu.c. That would only drop support for > > That would be backwords. amd64 should have an "x86" npx.c. The kernel does > almost no FPU handling, so npx is a better name than fpu. It is even better > than in 1991, since the numeric extensions are not limited to floating > point ones. First there was mmx, then Intel started unimproving names with > sse, then intel got tired of changing the prefix and started using > nondescript sse numbers. > > > systems using a 486sx with an external FPU. Those systems are probably happier > > running FreeBSD 4.x than 12 anyway. > > Bruce From owner-svn-src-stable-11@freebsd.org Sat Feb 25 19:31:16 2017 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 BDD9BCED81B; Sat, 25 Feb 2017 19:31:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B27F243; Sat, 25 Feb 2017 19:31:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1PJVFYC099612; Sat, 25 Feb 2017 19:31:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1PJVEYl099603; Sat, 25 Feb 2017 19:31:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702251931.v1PJVEYl099603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 25 Feb 2017 19:31: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: r314278 - in stable/11/contrib/libucl: . include lua src 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.23 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, 25 Feb 2017 19:31:16 -0000 Author: bapt Date: Sat Feb 25 19:31:14 2017 New Revision: 314278 URL: https://svnweb.freebsd.org/changeset/base/314278 Log: MFC r313953: Import libucl 20170219 Modified: stable/11/contrib/libucl/ChangeLog.md stable/11/contrib/libucl/README.md stable/11/contrib/libucl/configure.ac stable/11/contrib/libucl/include/ucl.h stable/11/contrib/libucl/lua/lua_ucl.c stable/11/contrib/libucl/src/ucl_emitter_utils.c stable/11/contrib/libucl/src/ucl_internal.h stable/11/contrib/libucl/src/ucl_parser.c stable/11/contrib/libucl/src/ucl_util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libucl/ChangeLog.md ============================================================================== --- stable/11/contrib/libucl/ChangeLog.md Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/ChangeLog.md Sat Feb 25 19:31:14 2017 (r314278) @@ -35,7 +35,7 @@ ### Libucl 0.7.3 -- Fixed a bug with macroes that come after an empty object +- Fixed a bug with macros that come after an empty object - Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) ### Libucl 0.8.0 Modified: stable/11/contrib/libucl/README.md ============================================================================== --- stable/11/contrib/libucl/README.md Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/README.md Sat Feb 25 19:31:14 2017 (r314278) @@ -1,6 +1,8 @@ # LIBUCL -[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138)[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) +[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) +[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* @@ -217,8 +219,8 @@ Multiline comments may be nested: UCL supports external macros both multiline and single line ones: ```nginx -.macro "sometext"; -.macro { +.macro_name "sometext"; +.macro_name { Some long text .... }; @@ -229,12 +231,12 @@ arguments themselves are the UCL object options: ```nginx -.macro(param=value) "something"; -.macro(param={key=value}) "something"; -.macro(.include "params.conf") "something"; -.macro(#this is multiline macro +.macro_name(param=value) "something"; +.macro_name(param={key=value}) "something"; +.macro_name(.include "params.conf") "something"; +.macro_name(#this is multiline macro param = [value1, value2]) "something"; -.macro(key="()") "something"; +.macro_name(key="()") "something"; ``` UCL also provide a convenient `include` macro to load content from another files Modified: stable/11/contrib/libucl/configure.ac ============================================================================== --- stable/11/contrib/libucl/configure.ac Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/configure.ac Sat Feb 25 19:31:14 2017 (r314278) @@ -39,6 +39,7 @@ AC_CHECK_HEADERS_ONCE([stdarg.h]) AC_CHECK_HEADERS_ONCE([stdbool.h]) AC_CHECK_HEADERS_ONCE([stdint.h]) AC_CHECK_HEADERS_ONCE([string.h]) +AC_CHECK_HEADERS_ONCE([strings.h]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_HEADERS_ONCE([ctype.h]) AC_CHECK_HEADERS_ONCE([errno.h]) Modified: stable/11/contrib/libucl/include/ucl.h ============================================================================== --- stable/11/contrib/libucl/include/ucl.h Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/include/ucl.h Sat Feb 25 19:31:14 2017 (r314278) @@ -154,7 +154,8 @@ typedef enum ucl_parser_flags { UCL_PARSER_NO_TIME = (1 << 2), /**< Do not parse time and treat time values as strings */ UCL_PARSER_NO_IMPLICIT_ARRAYS = (1 << 3), /** Create explicit arrays instead of implicit ones */ UCL_PARSER_SAVE_COMMENTS = (1 << 4), /** Save comments in the parser context */ - UCL_PARSER_DISABLE_MACRO = (1 << 5) /** Treat macros as comments */ + UCL_PARSER_DISABLE_MACRO = (1 << 5), /** Treat macros as comments */ + UCL_PARSER_NO_FILEVARS = (1 << 6) /** Do not set file vars */ } ucl_parser_flags_t; /** @@ -205,7 +206,8 @@ enum ucl_duplicate_strategy { enum ucl_parse_type { UCL_PARSE_UCL = 0, /**< Default ucl format */ UCL_PARSE_MSGPACK, /**< Message pack input format */ - UCL_PARSE_CSEXP /**< Canonical S-expressions */ + UCL_PARSE_CSEXP, /**< Canonical S-expressions */ + UCL_PARSE_AUTO /**< Try to detect parse type */ }; /** @@ -227,7 +229,7 @@ typedef struct ucl_object_s { const char *key; /**< Key of an object */ struct ucl_object_s *next; /**< Array handle */ struct ucl_object_s *prev; /**< Array handle */ - uint32_t keylen; /**< Lenght of a key */ + uint32_t keylen; /**< Length of a key */ uint32_t len; /**< Size of an object */ uint32_t ref; /**< Reference count */ uint16_t flags; /**< Object flags */ @@ -831,10 +833,29 @@ UCL_EXTERN ucl_object_iter_t ucl_object_ * Get the next object from the `obj`. This fucntion iterates over arrays, objects * and implicit arrays * @param iter safe iterator + * @param expand_values expand explicit arrays and objects * @return the next object in sequence */ UCL_EXTERN const ucl_object_t* ucl_object_iterate_safe (ucl_object_iter_t iter, bool expand_values); +/** + * Iteration type enumerator + */ +enum ucl_iterate_type { + UCL_ITERATE_EXPLICIT = 1 << 0, /**< Iterate just explicit arrays and objects */ + UCL_ITERATE_IMPLICIT = 1 << 1, /**< Iterate just implicit arrays */ + UCL_ITERATE_BOTH = (1 << 0) | (1 << 1), /**< Iterate both explicit and implicit arrays*/ +}; + +/** + * Get the next object from the `obj`. This fucntion iterates over arrays, objects + * and implicit arrays if needed + * @param iter safe iterator + * @param + * @return the next object in sequence + */ +UCL_EXTERN const ucl_object_t* ucl_object_iterate_full (ucl_object_iter_t iter, + enum ucl_iterate_type type); /** * Free memory associated with the safe iterator @@ -1016,6 +1037,7 @@ UCL_EXTERN bool ucl_parser_add_string_pr * Load and add data from a file * @param parser parser structure * @param filename the name of file + * @param err if *err is NULL it is set to parser error * @return true if chunk has been added and false in case of error */ UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, @@ -1025,6 +1047,7 @@ UCL_EXTERN bool ucl_parser_add_file (str * Load and add data from a file * @param parser parser structure * @param filename the name of file + * @param err if *err is NULL it is set to parser error * @param priority the desired priority of a chunk (only 4 least significant bits * are considered for this parameter) * @return true if chunk has been added and false in case of error @@ -1069,6 +1092,21 @@ UCL_EXTERN bool ucl_parser_add_fd_priori int fd, unsigned priority); /** + * Load and add data from a file descriptor + * @param parser parser structure + * @param filename the name of file + * @param err if *err is NULL it is set to parser error + * @param priority the desired priority of a chunk (only 4 least significant bits + * are considered for this parameter) + * @param strat Merge strategy to use while parsing this file + * @param parse_type Parser type to use while parsing this file + * @return true if chunk has been added and false in case of error + */ +UCL_EXTERN bool ucl_parser_add_fd_full (struct ucl_parser *parser, int fd, + unsigned priority, enum ucl_duplicate_strategy strat, + enum ucl_parse_type parse_type); + +/** * Provide a UCL_ARRAY of paths to search for include files. The object is * copied so caller must unref the object. * @param parser parser structure Modified: stable/11/contrib/libucl/lua/lua_ucl.c ============================================================================== --- stable/11/contrib/libucl/lua/lua_ucl.c Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/lua/lua_ucl.c Sat Feb 25 19:31:14 2017 (r314278) @@ -29,7 +29,6 @@ #include "ucl_internal.h" #include "lua_ucl.h" #include -#include /*** * @module ucl @@ -187,6 +186,8 @@ ucl_object_lua_push_array (lua_State *L, lua_rawseti (L, -2, i); i ++; } + + ucl_object_iterate_free (it); } else { /* Optimize allocation by preallocation of table */ @@ -482,7 +483,7 @@ static int lua_ucl_parser_init (lua_State *L) { struct ucl_parser *parser, **pparser; - int flags = 0; + int flags = UCL_PARSER_NO_FILEVARS; if (lua_gettop (L) >= 1) { flags = lua_tonumber (L, 1); @@ -524,6 +525,27 @@ lua_ucl_push_opaque (lua_State *L, ucl_o lua_setmetatable (L, -2); } +static inline enum ucl_parse_type +lua_ucl_str_to_parse_type (const char *str) +{ + enum ucl_parse_type type = UCL_PARSE_UCL; + + if (str != NULL) { + if (strcasecmp (str, "msgpack") == 0) { + type = UCL_PARSE_MSGPACK; + } + else if (strcasecmp (str, "sexp") == 0 || + strcasecmp (str, "csexp") == 0) { + type = UCL_PARSE_CSEXP; + } + else if (strcasecmp (str, "auto") == 0) { + type = UCL_PARSE_AUTO; + } + } + + return type; +} + /*** * @method parser:parse_file(name) * Parse UCL object from file. @@ -579,13 +601,19 @@ lua_ucl_parser_parse_string (lua_State * struct ucl_parser *parser; const char *string; size_t llen; + enum ucl_parse_type type = UCL_PARSE_UCL; int ret = 2; parser = lua_ucl_parser_get (L, 1); string = luaL_checklstring (L, 2, &llen); + if (lua_type (L, 3) == LUA_TSTRING) { + type = lua_ucl_str_to_parse_type (lua_tostring (L, 3)); + } + if (parser != NULL && string != NULL) { - if (ucl_parser_add_chunk (parser, (const unsigned char *)string, llen)) { + if (ucl_parser_add_chunk_full (parser, (const unsigned char *)string, + llen, 0, UCL_DUPLICATE_APPEND, type)) { lua_pushboolean (L, true); ret = 1; } @@ -761,6 +789,28 @@ lua_ucl_object_unwrap (lua_State *L) return 1; } +static inline enum ucl_emitter +lua_ucl_str_to_emit_type (const char *strtype) +{ + enum ucl_emitter format = UCL_EMIT_JSON_COMPACT; + + if (strcasecmp (strtype, "json") == 0) { + format = UCL_EMIT_JSON; + } + else if (strcasecmp (strtype, "json-compact") == 0) { + format = UCL_EMIT_JSON_COMPACT; + } + else if (strcasecmp (strtype, "yaml") == 0) { + format = UCL_EMIT_YAML; + } + else if (strcasecmp (strtype, "config") == 0 || + strcasecmp (strtype, "ucl") == 0) { + format = UCL_EMIT_CONFIG; + } + + return format; +} + /*** * @method object:tostring(type) * Unwraps opaque ucl object to string (json by default). Optionally you can @@ -787,19 +837,7 @@ lua_ucl_object_tostring (lua_State *L) if (lua_type (L, 2) == LUA_TSTRING) { const char *strtype = lua_tostring (L, 2); - if (strcasecmp (strtype, "json") == 0) { - format = UCL_EMIT_JSON; - } - else if (strcasecmp (strtype, "json-compact") == 0) { - format = UCL_EMIT_JSON_COMPACT; - } - else if (strcasecmp (strtype, "yaml") == 0) { - format = UCL_EMIT_YAML; - } - else if (strcasecmp (strtype, "config") == 0 || - strcasecmp (strtype, "ucl") == 0) { - format = UCL_EMIT_CONFIG; - } + format = lua_ucl_str_to_emit_type (strtype); } } @@ -1088,6 +1126,9 @@ lua_ucl_to_format (lua_State *L) strcasecmp (strtype, "ucl") == 0) { format = UCL_EMIT_CONFIG; } + else if (strcasecmp (strtype, "msgpack") == 0) { + format = UCL_EMIT_MSGPACK; + } } } Modified: stable/11/contrib/libucl/src/ucl_emitter_utils.c ============================================================================== --- stable/11/contrib/libucl/src/ucl_emitter_utils.c Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/src/ucl_emitter_utils.c Sat Feb 25 19:31:14 2017 (r314278) @@ -102,7 +102,7 @@ ucl_elt_string_write_json (const char *s func->ucl_emitter_append_character ('"', 1, func->ud); while (size) { - if (ucl_test_character (*p, UCL_CHARACTER_JSON_UNSAFE)) { + if (ucl_test_character (*p, UCL_CHARACTER_JSON_UNSAFE|UCL_CHARACTER_DENIED)) { if (len > 0) { func->ucl_emitter_append_len (c, len, func->ud); } @@ -128,6 +128,10 @@ ucl_elt_string_write_json (const char *s case '"': func->ucl_emitter_append_len ("\\\"", 2, func->ud); break; + default: + /* Emit unicode unknown character */ + func->ucl_emitter_append_len ("\\uFFFD", 5, func->ud); + break; } len = 0; c = ++p; @@ -138,9 +142,11 @@ ucl_elt_string_write_json (const char *s } size --; } + if (len > 0) { func->ucl_emitter_append_len (c, len, func->ud); } + func->ucl_emitter_append_character ('"', 1, func->ud); } Modified: stable/11/contrib/libucl/src/ucl_internal.h ============================================================================== --- stable/11/contrib/libucl/src/ucl_internal.h Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/src/ucl_internal.h Sat Feb 25 19:31:14 2017 (r314278) @@ -87,6 +87,9 @@ #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif #include "utlist.h" #include "utstring.h" @@ -127,19 +130,19 @@ enum ucl_parser_state { }; enum ucl_character_type { - UCL_CHARACTER_DENIED = 0, - UCL_CHARACTER_KEY = 1, - UCL_CHARACTER_KEY_START = 1 << 1, - UCL_CHARACTER_WHITESPACE = 1 << 2, - UCL_CHARACTER_WHITESPACE_UNSAFE = 1 << 3, - UCL_CHARACTER_VALUE_END = 1 << 4, - UCL_CHARACTER_VALUE_STR = 1 << 5, - UCL_CHARACTER_VALUE_DIGIT = 1 << 6, - UCL_CHARACTER_VALUE_DIGIT_START = 1 << 7, - UCL_CHARACTER_ESCAPE = 1 << 8, - UCL_CHARACTER_KEY_SEP = 1 << 9, - UCL_CHARACTER_JSON_UNSAFE = 1 << 10, - UCL_CHARACTER_UCL_UNSAFE = 1 << 11 + UCL_CHARACTER_DENIED = (1 << 0), + UCL_CHARACTER_KEY = (1 << 1), + UCL_CHARACTER_KEY_START = (1 << 2), + UCL_CHARACTER_WHITESPACE = (1 << 3), + UCL_CHARACTER_WHITESPACE_UNSAFE = (1 << 4), + UCL_CHARACTER_VALUE_END = (1 << 5), + UCL_CHARACTER_VALUE_STR = (1 << 6), + UCL_CHARACTER_VALUE_DIGIT = (1 << 7), + UCL_CHARACTER_VALUE_DIGIT_START = (1 << 8), + UCL_CHARACTER_ESCAPE = (1 << 9), + UCL_CHARACTER_KEY_SEP = (1 << 10), + UCL_CHARACTER_JSON_UNSAFE = (1 << 11), + UCL_CHARACTER_UCL_UNSAFE = (1 << 12) }; struct ucl_macro { @@ -568,4 +571,6 @@ bool ucl_parser_process_object_element ( */ bool ucl_parse_msgpack (struct ucl_parser *parser); +bool ucl_parse_csexp (struct ucl_parser *parser); + #endif /* UCL_INTERNAL_H_ */ Modified: stable/11/contrib/libucl/src/ucl_parser.c ============================================================================== --- stable/11/contrib/libucl/src/ucl_parser.c Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/src/ucl_parser.c Sat Feb 25 19:31:14 2017 (r314278) @@ -2469,8 +2469,10 @@ ucl_parser_new (int flags) parser->comments = ucl_object_typed_new (UCL_OBJECT); } - /* Initial assumption about filevars */ - ucl_parser_set_filevars (parser, NULL, false); + if (!(flags & UCL_PARSER_NO_FILEVARS)) { + /* Initial assumption about filevars */ + ucl_parser_set_filevars (parser, NULL, false); + } return parser; } @@ -2617,6 +2619,19 @@ ucl_parser_add_chunk_full (struct ucl_pa return false; } + if (parse_type == UCL_PARSE_AUTO && len > 0) { + /* We need to detect parse type by the first symbol */ + if ((*data & 0x80) == 0x80 && (*data >= 0xdc && *data <= 0xdf)) { + parse_type = UCL_PARSE_MSGPACK; + } + else if (*data == '(') { + parse_type = UCL_PARSE_CSEXP; + } + else { + parse_type = UCL_PARSE_UCL; + } + } + chunk->begin = data; chunk->remain = len; chunk->pos = chunk->begin; @@ -2643,6 +2658,8 @@ ucl_parser_add_chunk_full (struct ucl_pa return ucl_state_machine (parser); case UCL_PARSE_MSGPACK: return ucl_parse_msgpack (parser); + case UCL_PARSE_CSEXP: + return ucl_parse_csexp (parser); } } else { Modified: stable/11/contrib/libucl/src/ucl_util.c ============================================================================== --- stable/11/contrib/libucl/src/ucl_util.c Sat Feb 25 19:28:49 2017 (r314277) +++ stable/11/contrib/libucl/src/ucl_util.c Sat Feb 25 19:31:14 2017 (r314278) @@ -26,11 +26,17 @@ #include "ucl_internal.h" #include "ucl_chartable.h" #include "kvec.h" +#include #include #include /* for snprintf */ #ifndef _WIN32 #include +#include +#else +#ifndef NBBY +#define NBBY 8 +#endif #endif #ifdef HAVE_LIBGEN_H @@ -81,11 +87,6 @@ typedef kvec_t(ucl_object_t *) ucl_array #define MAP_FAILED ((void *) -1) #endif -#ifdef _WIN32 -#include -#define NBBY CHAR_BIT -#endif - static void *ucl_mmap(char *addr, size_t length, int prot, int access, int fd, off_t offset) { void *map = NULL; @@ -1854,9 +1855,11 @@ ucl_parser_add_file (struct ucl_parser * UCL_PARSE_UCL); } + bool -ucl_parser_add_fd_priority (struct ucl_parser *parser, int fd, - unsigned priority) +ucl_parser_add_fd_full (struct ucl_parser *parser, int fd, + unsigned priority, enum ucl_duplicate_strategy strat, + enum ucl_parse_type parse_type) { unsigned char *buf; size_t len; @@ -1882,7 +1885,8 @@ ucl_parser_add_fd_priority (struct ucl_p } parser->cur_file = NULL; len = st.st_size; - ret = ucl_parser_add_chunk_priority (parser, buf, len, priority); + ret = ucl_parser_add_chunk_full (parser, buf, len, priority, strat, + parse_type); if (len > 0) { ucl_munmap (buf, len); @@ -1892,6 +1896,18 @@ ucl_parser_add_fd_priority (struct ucl_p } bool +ucl_parser_add_fd_priority (struct ucl_parser *parser, int fd, + unsigned priority) +{ + if (parser == NULL) { + return false; + } + + return ucl_parser_add_fd_full(parser, fd, parser->default_priority, + UCL_DUPLICATE_APPEND, UCL_PARSE_UCL); +} + +bool ucl_parser_add_fd (struct ucl_parser *parser, int fd) { if (parser == NULL) { @@ -2488,6 +2504,10 @@ ucl_object_iterate_reset (ucl_object_ite UCL_SAFE_ITER_CHECK (rit); + if (rit->expl_it != NULL) { + UCL_FREE (sizeof (*rit->expl_it), rit->expl_it); + } + rit->impl_it = obj; rit->expl_it = NULL; @@ -2497,6 +2517,13 @@ ucl_object_iterate_reset (ucl_object_ite const ucl_object_t* ucl_object_iterate_safe (ucl_object_iter_t it, bool expand_values) { + return ucl_object_iterate_full (it, expand_values ? UCL_ITERATE_BOTH : + UCL_ITERATE_IMPLICIT); +} + +const ucl_object_t* +ucl_object_iterate_full (ucl_object_iter_t it, enum ucl_iterate_type type) +{ struct ucl_object_safe_iter *rit = UCL_SAFE_ITER (it); const ucl_object_t *ret = NULL; @@ -2509,21 +2536,23 @@ ucl_object_iterate_safe (ucl_object_iter if (rit->impl_it->type == UCL_OBJECT || rit->impl_it->type == UCL_ARRAY) { ret = ucl_object_iterate (rit->impl_it, &rit->expl_it, true); - if (ret == NULL) { + if (ret == NULL && (type & UCL_ITERATE_IMPLICIT)) { /* Need to switch to another implicit object in chain */ rit->impl_it = rit->impl_it->next; rit->expl_it = NULL; - return ucl_object_iterate_safe (it, expand_values); + + return ucl_object_iterate_safe (it, type); } } else { /* Just iterate over the implicit array */ ret = rit->impl_it; rit->impl_it = rit->impl_it->next; - if (expand_values) { + + if (type & UCL_ITERATE_EXPLICIT) { /* We flatten objects if need to expand values */ if (ret->type == UCL_OBJECT || ret->type == UCL_ARRAY) { - return ucl_object_iterate_safe (it, expand_values); + return ucl_object_iterate_safe (it, type); } } } @@ -2538,6 +2567,10 @@ ucl_object_iterate_free (ucl_object_iter UCL_SAFE_ITER_CHECK (rit); + if (rit->expl_it != NULL) { + UCL_FREE (sizeof (*rit->expl_it), rit->expl_it); + } + UCL_FREE (sizeof (*rit), it); } From owner-svn-src-stable-11@freebsd.org Sat Feb 25 19:40:00 2017 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 14AC4CEDCC8; Sat, 25 Feb 2017 19:40:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD55EBA2; Sat, 25 Feb 2017 19:39:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1PJdwAw003565; Sat, 25 Feb 2017 19:39:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1PJdw5b003564; Sat, 25 Feb 2017 19:39:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702251939.v1PJdw5b003564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 25 Feb 2017 19:39:58 +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: r314279 - stable/11/share/misc 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.23 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, 25 Feb 2017 19:40:00 -0000 Author: bapt Date: Sat Feb 25 19:39:58 2017 New Revision: 314279 URL: https://svnweb.freebsd.org/changeset/base/314279 Log: MFC r313961: Update pci_vendors to 2017.02.15 Modified: stable/11/share/misc/pci_vendors Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/pci_vendors ============================================================================== --- stable/11/share/misc/pci_vendors Sat Feb 25 19:31:14 2017 (r314278) +++ stable/11/share/misc/pci_vendors Sat Feb 25 19:39:58 2017 (r314279) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.01.08 -# Date: 2017-01-08 03:15:02 +# Version: 2017.02.15 +# Date: 2017-02-15 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -2254,6 +2254,7 @@ 1043 2016 Trinidad PRO [Radeon R9 370 OEM] 1458 2016 Trinidad PRO [Radeon R9 370 OEM] 1462 2016 Trinidad PRO [Radeon R9 370 OEM] + 1462 3050 R9 270 Gaming OC 148c 2016 Trinidad PRO [Radeon R9 370 OEM] 1682 2015 Trinidad PRO [Radeon R7 370] 174b 2016 Trinidad PRO [Radeon R9 370 OEM] @@ -5520,6 +5521,10 @@ 8056 Rockwell HCF 56K modem 808a Memory Stick Controller 81ce SxS Pro memory card +# 2nd ID + 905c SxS Pro memory card +# 2nd ID + 907f SxS Pro+ memory card 908f Aeolia ACPI 909e Aeolia Ethernet Controller (Marvell Yukon 2 Family) 909f Aeolia SATA AHCI Controller @@ -5528,6 +5533,7 @@ 90a2 Aeolia DMA Controller 90a3 Aeolia Memory (DDR3/SPM) 90a4 Aeolia USB 3.0 xHCI Host Controller + 90bc SxS Pro+ memory card 104e Oak Technology, Inc 0017 OTI-64017 0107 OTI-107 [Spitfire] @@ -6093,6 +6099,20 @@ 1077 0246 8300 Series Dual Port 10GbE Converged Network Adapter (TCP/IP Networking) 8031 8300 Series 10GbE Converged Network Adapter (FCoE) 8032 8300 Series 10GbE Converged Network Adapter (iSCSI) + 8070 FastLinQ QL41000 Series 10/25/40/50GbE Controller + 1077 0011 FastLinQ QL41212H 25GbE Adapter + 1077 0012 FastLinQ QL41112H 10GbE Adapter + 8080 FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE) + 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter + 1077 000e FastLinQ QL41162H 10GbE FCoE Adapter + 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) + 1077 000d FastLinQ QL41262H 25GbE iSCSI Adapter + 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter + 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) + 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter (SR-IOV VF) + 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF) + 1077 0011 FastLinQ QL41212H 25GbE Adapter (SR-IOV VF) + 1077 0012 FastLinQ QL41112H 10GbE Adapter (SR-IOV VF) 8430 ISP8324 1/10GbE Converged Network Controller (NIC VF) 8431 8300 Series 10GbE Converged Network Adapter (FCoE VF) 8432 ISP2432M-based 10GbE Converged Network Adapter (CNA) @@ -10584,6 +10604,7 @@ 1347 GM108M [GeForce 940M] 1348 GM108M [GeForce 945M / 945A] 1349 GM108M [GeForce 930M] + 134b GM108M [GeForce 940MX] 134d GM108M [GeForce 940MX] 134e GM108M [GeForce 930MX] 134f GM108M [GeForce 920MX] @@ -10616,6 +10637,8 @@ 13b1 GM107GLM [Quadro M1000M] 13b2 GM107GLM [Quadro M600M] 13b3 GM107GLM [Quadro K2200M] + 13b4 GM107GLM [Quadro M620 Mobile] + 13b6 GM107GLM [Quadro M1200 Mobile] 13b9 GM107GL [NVS 810] 13ba GM107GL [Quadro K2200] 13bb GM107GL [Quadro K620] @@ -10648,6 +10671,7 @@ 1427 GM206M [GeForce GTX 965M] 1430 GM206GL [Quadro M2000] 1431 GM206GL [Tesla M4] + 1436 GM206GLM [Quadro M2200 Mobile] 15f0 GP100GL 15f1 GP100GL 15f7 GP100GL [Tesla P100 PCIe 12GB] @@ -10677,28 +10701,31 @@ 1b82 GP104 1b83 GP104 1b84 GP104 [GeForce GTX 1060 3GB] - 1ba0 GP104M [GeForce GTX 1080] - 1ba1 GP104M [GeForce GTX 1070] + 1ba0 GP104M [GeForce GTX 1080 Mobile] + 1ba1 GP104M [GeForce GTX 1070 Mobile] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL - 1be0 GP104M [GeForce GTX 1080] - 1be1 GP104M [GeForce GTX 1070] + 1bb6 GP104GLM [Quadro P5000 Mobile] + 1bb7 GP104GLM [Quadro P4000 Mobile] + 1bb8 GP104GLM [Quadro P3000 Mobile] + 1be0 GP104M [GeForce GTX 1080 Mobile] + 1be1 GP104M [GeForce GTX 1070 Mobile] 1c00 GP106 1c01 GP106 1c02 GP106 [GeForce GTX 1060 3GB] 1c03 GP106 [GeForce GTX 1060 6GB] - 1c20 GP106M [GeForce GTX 1060] + 1c20 GP106M [GeForce GTX 1060 Mobile] 1c30 GP106GL 1c35 GP106 - 1c60 GP106M [GeForce GTX 1060] + 1c60 GP106M [GeForce GTX 1060 Mobile] 1c70 GP106GL 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] - 1c8c GP107M [GeForce GTX 1050 Ti] - 1c8d GP107M [GeForce GTX 1050] + 1c8c GP107M [GeForce GTX 1050 Ti Mobile] + 1c8d GP107M [GeForce GTX 1050 Mobile] 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL @@ -13224,6 +13251,7 @@ 0001 FireStream 155 0003 FireStream 50 119f Bull HN Information Systems + 1081 BXI Host Channel Adapter 11a0 Convex Computer Corporation 11a1 Hamamatsu Photonics K.K. 11a2 Sierra Research and Technology @@ -16021,6 +16049,9 @@ 509b T540-509B Unified Wire Ethernet Controller 509c T520-509C Unified Wire Ethernet Controller 509d T540-509D Unified Wire Ethernet Controller + 509e T520-509E Unified Wire Ethernet Controller + 509f T540-509F Unified Wire Ethernet Controller + 50a0 T540-50A0 Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16049,7 +16080,7 @@ 5481 T540-5081 Unified Wire Ethernet Controller 5482 T504-5082 Unified Wire Ethernet Controller 5483 T540-5083 Unified Wire Ethernet Controller - 5484 T580-5084 Unified Wire Ethernet Controller + 5484 T540-5084 Unified Wire Ethernet Controller 5485 T580-5085 Unified Wire Ethernet Controller 5486 T580-5086 Unified Wire Ethernet Controller 5487 T580-5087 Unified Wire Ethernet Controller @@ -16069,6 +16100,9 @@ 549b T540-509B Unified Wire Ethernet Controller 549c T520-509C Unified Wire Ethernet Controller 549d T540-509D Unified Wire Ethernet Controller + 549e T520-509E Unified Wire Ethernet Controller + 549f T540-509F Unified Wire Ethernet Controller + 54a0 T540-50A0 Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16097,7 +16131,7 @@ 5581 T540-5081 Unified Wire Storage Controller 5582 T504-5082 Unified Wire Storage Controller 5583 T540-5083 Unified Wire Storage Controller - 5584 T580-5084 Unified Wire Storage Controller + 5584 T540-5084 Unified Wire Storage Controller 5585 T580-5085 Unified Wire Storage Controller 5586 T580-5086 Unified Wire Storage Controller 5587 T580-5087 Unified Wire Storage Controller @@ -16117,6 +16151,9 @@ 559b T540-509B Unified Wire Storage Controller 559c T520-509C Unified Wire Storage Controller 559d T540-509D Unified Wire Storage Controller + 559e T520-509E Unified Wire Storage Controller + 559f T540-509F Unified Wire Storage Controller + 55a0 T540-50A0 Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16145,7 +16182,7 @@ 5681 T540-5081 Unified Wire Storage Controller 5682 T504-5082 Unified Wire Storage Controller 5683 T540-5083 Unified Wire Storage Controller - 5684 T580-5084 Unified Wire Storage Controller + 5684 T540-5084 Unified Wire Storage Controller 5685 T580-5085 Unified Wire Storage Controller 5686 T580-5086 Unified Wire Storage Controller 5687 T580-5087 Unified Wire Storage Controller @@ -16165,6 +16202,9 @@ 569b T540-509B Unified Wire Storage Controller 569c T520-509C Unified Wire Storage Controller 569d T540-509D Unified Wire Storage Controller + 569e T520-509E Unified Wire Storage Controller + 569f T540-509F Unified Wire Storage Controller + 56a0 T540-50A0 Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16232,7 +16272,7 @@ 5881 T540-5081 Unified Wire Ethernet Controller [VF] 5882 T504-5082 Unified Wire Ethernet Controller [VF] 5883 T540-5083 Unified Wire Ethernet Controller [VF] - 5884 T580-5084 Unified Wire Ethernet Controller [VF] + 5884 T540-5084 Unified Wire Ethernet Controller [VF] 5885 T580-5085 Unified Wire Ethernet Controller [VF] 5886 T580-5086 Unified Wire Ethernet Controller [VF] 5887 T580-5087 Unified Wire Ethernet Controller [VF] @@ -16252,6 +16292,9 @@ 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] 589d T540-509D Unified Wire Ethernet Controller [VF] + 589e T520-509E Unified Wire Ethernet Controller [VF] + 589f T540-509F Unified Wire Ethernet Controller [VF] + 58a0 T540-50A0 Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16265,6 +16308,8 @@ 6011 T6225-LL-CR Unified Wire Ethernet Controller 6014 T61100-OCP-SO Unified Wire Ethernet Controller 6015 T6201-BT Unified Wire Ethernet Controller + 6080 T6225-6080 Unified Wire Ethernet Controller + 6081 T62100-6081 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16278,6 +16323,8 @@ 6411 T6225-LL-CR Unified Wire Ethernet Controller 6414 T61100-OCP-SO Unified Wire Ethernet Controller 6415 T6201-BT Unified Wire Ethernet Controller + 6480 T6225-6080 Unified Wire Ethernet Controller + 6481 T62100-6081 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16291,6 +16338,8 @@ 6511 T6225-LL-CR Unified Wire Storage Controller 6514 T61100-OCP-SO Unified Wire Storage Controller 6515 T6201-BT Unified Wire Storage Controller + 6580 T6225-6080 Unified Wire Storage Controller + 6581 T62100-6081 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16304,6 +16353,8 @@ 6611 T6225-LL-CR Unified Wire Storage Controller 6614 T61100-OCP-SO Unified Wire Storage Controller 6615 T6201-BT Unified Wire Storage Controller + 6680 T6225-6080 Unified Wire Storage Controller + 6681 T62100-6081 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -16317,6 +16368,8 @@ 6811 T6225-LL-CR Unified Wire Ethernet Controller [VF] 6814 T61100-OCP-SO Unified Wire Ethernet Controller [VF] 6815 T6201-BT Unified Wire Ethernet Controller [VF] + 6880 T6225-6080 Unified Wire Ethernet Controller [VF] + 6881 T62100-6081 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -16516,6 +16569,7 @@ 14a2 Millennium Engineering Inc 14a3 Maverick Networks 14a4 Lite-On Technology Corporation + 22f1 M8Pe Series NVMe SSD # Wrong vendor ID used 4318 Broadcom BCM4318 [AirForce One 54g] 802.11g WLAN Controller 14a5 XIONICS Document Technologies Inc @@ -17957,6 +18011,7 @@ 1599 Delta Electronics Inc 159a General Instrument 159b Faraday Technology Corp + 4321 StorLink SL3516 (Gemini) Host Bridge 159c Stratus Computer Systems 159d Ningbo Harrison Electronics Co Ltd 159e A-Max Technology Co Ltd @@ -18013,6 +18068,7 @@ 024f MT53100 [Spectrum-2, Flash recovery mode] 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN + 0281 NPS-600 Flash Recovery 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 103c 1777 InfiniBand FDR/EN 10/40Gb Dual Port 544FLR-QSFP Adapter (Rev Cx) @@ -18872,10 +18928,18 @@ 9700 Octeon III CN73XX Network Processor 9702 CN23XX [LiquidIO II] Intelligent Adapter 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE Intelligent adapter - 177d 0004 CN2350 [LiquidIO II] 2-port 25GbE Intelligent adapter +# This was changed during the production phase to 10GbE adapter. + 177d 0004 CN2350 [LiquidIO II] 2-port 10GbE Intelligent adapter + 177d 0005 CN2360 [LiquidIO II] 2-port 10GbE Intelligent adapter + 177d 0006 CN2360 [LiquidIO II] 2-port 25GbE Intelligent adapter + 177d 0007 CN2350 [LiquidIO II] 2-port 25GbE Intelligent adapter 9703 CN23XX [LiquidIO II] NVMe Controller 9712 CN23XX [LiquidIO II] SRIOV Virtual Function 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 177d 0004 CN2350 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 177d 0005 CN2360 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 177d 0006 CN2360 [LiquidIO II] 2-port 25GbE SRIOV Virtual Function + 177d 0007 CN2350 [LiquidIO II] 2-port 25GbE SRIOV Virtual Function 9713 CN23XX [LiquidIO II] NVMe SRIOV Virtual Function 9800 Octeon Fusion CNF75XX Processor a001 ThunderX MRML(Master RML Bridge to RSL devices) @@ -19445,8 +19509,8 @@ 0155 NT100E3-1-PTP Network Adapter 1x100Gb 0165 NT80E3-2-PTP Network Adapter 2x40Gb 0175 NT20E3-2-PTP Network Adapter 2x10Gb - 0185 NT40A01-4x1 Network Adapter 4x1Gb - 01a5 NT200A01 Network Adapter 2x100Gb + 0185 NT40A01 Network Adapter + 01a5 NT200A01 Network Adapter 18f6 NextIO 1000 [Nexsis] Switch Virtual P2P PCIe Bridge 1001 [Texsis] Switch Virtual P2P PCIe Bridge @@ -19602,14 +19666,15 @@ 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter 0a03 SFC9220 10/40G Ethernet Controller - 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter + 1924 8011 SFN8022-R1 Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter - 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter + 1924 8013 SFN8042-R1 Flareon 8000 Series 10/40G Adapter 1924 8014 SFN8542-R1 Flareon Ultra 8000 Series 10/40G Adapter 1924 8016 SFN8022-R2 Flareon 8000 Series 10G Adapter 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter + 1924 801a SFN8722-R1 Flareon Ultra 8000 Series OCP 10G Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) @@ -19902,6 +19967,7 @@ 5808 DDRdrive X8 dd52 DDRdrive X1-30 19e5 Huawei Technologies Co., Ltd. + 1711 Hi1710 [iBMC Intelligent Management system chip w/VGA support] 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20101,7 +20167,7 @@ 1b03 Magnum Semiconductor, Inc, 6100 DXT/DXTPro Multiformat Broadcast HD/SD Encoder/Decoder/Transcoder 7000 D7 Multiformat Broadcast HD/SD Encoder/Decoder/Transcoder -1b08 MSC Vertriebs GmbH +1b08 MSC Technologies GmbH 1b0a Pegatron 1b13 Jaton Corp 1b1a K&F Computing Research Co. @@ -20318,6 +20384,8 @@ 0003 Ultrastar SN100 Series NVMe SSD 1014 04f5 PCIe3 1.6TB NVMe Flash Adapter 1014 04f6 PCIe3 3.2TB NVMe Flash Adapter +1c5f Beijing Memblaze Technology Co. Ltd. + 0540 PBlaze4 NVMe SSD # http://www.nicevt.ru/ (in Russian) 1c63 Science and Research Centre of Computer Technology (JSC "NICEVT") # http://www.radiotec.ru/catalog.php?cat=jr8&art=14109 @@ -20437,16 +20505,18 @@ 4022 TN9310 10GbE SFP+ Ethernet Adapter 1043 8709 XG-C100F 10GbE SFP+ Ethernet Adapter 1186 4d00 DXE-810S 10GbE SFP+ Ethernet Adapter - 1432 8103 EN-8102PF 10GbE SPF+ Ethernet Adapter + 1432 8103 10 Gigabit Ethernet SFP+ PCI Express Adapter 1fc9 3015 Ethernet Adapter 4024 TN9210 10GBase-T Ethernet Adapter 4025 TN9510 10GBase-T/NBASE-T Ethernet Adapter 105a 7203 SANLink3 NBase-T1 1186 2900 DXE-810T 10GBase-T Ethernet Adapter - 1432 8102 EN-8102P 10GbE Ethernet Adapter + 1432 8102 10 Gigabit Ethernet PCI Express Adapter 1fc9 3015 Ethernet Adapter 4026 TN9610 10GbE SFP+ Ethernet Adapter 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter + 1432 8104 10 Gigabit Ethernet PCI Express Adapter + 1fc9 3015 Ethernet Adapter 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter 1fcc StreamLabs f416 MS416 @@ -21748,6 +21818,7 @@ 0a26 Haswell-ULT Integrated Graphics Controller 0a2a Haswell-ULT Integrated Graphics Controller 0a2e Haswell-ULT Integrated Graphics Controller + 0a53 DC P3520 SSD 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -22105,7 +22176,7 @@ 8086 1019 PRO/1000 CT Desktop Connection 8086 301f D865PERL mainboard 8086 3025 D875PBZ motherboard - 8086 302c Intel 82865G Mainboard (D865GBF) + 8086 302c D865GBF Mainboard 8086 3427 S875WP1-E mainboard 101a 82547EI Gigabit Ethernet Controller (Mobile) 8086 101a PRO/1000 CT Mobile Connection @@ -22303,7 +22374,7 @@ 1096 80003ES2LAN Gigabit Ethernet Controller (Copper) 15d9 1096 Motherboard 15d9 8680 X7DVL-E-O motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 1097 631xESB/632xESB DPT LAN Controller (Fiber) 1098 80003ES2LAN Gigabit Ethernet Controller (Serdes) 1099 82546GB Gigabit Ethernet Controller (Copper) @@ -22457,6 +22528,7 @@ 103c 17d2 Ethernet 10Gb 2-port 560M Adapter 103c 18d0 Ethernet 10Gb 2-port 560FLB Adapter 1059 0111 T4007 10GbE interface + 1059 0130 T4009 10GbE interface 8086 000c Ethernet X520 10GbE Dual Port KX4-KR Mezz 10f9 82599 10 Gigabit Dual Port Network Connection 10fb 82599ES 10-Gigabit SFI/SFP+ Network Connection @@ -22862,6 +22934,7 @@ 1059 0110 T4005 1GbE interface 1059 0111 T4007 1GbE interface 1059 0120 T4008 1GbE interface + 1059 0130 T4009 1GbE interface 1538 I210 Gigabit Network Connection 1539 I211 Gigabit Network Connection 153a Ethernet Connection I217-LM @@ -23187,7 +23260,7 @@ 1a31 82845 845 [Brookdale] Chipset AGP Bridge 1a38 5000 Series Chipset DMA Engine 15d9 8680 X7DVL-E-O motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 1a48 82597EX 10GbE Ethernet Controller 8086 a01f PRO/10GbE SR Server Adapter 8086 a11f PRO/10GbE SR Server Adapter @@ -24772,13 +24845,13 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2680 631xESB/632xESB/3100 Chipset SATA IDE Controller 2681 631xESB/632xESB SATA AHCI Controller 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2682 631xESB/632xESB SATA RAID Controller 103c 31fe Adaptec Serial ATA HostRAID 2683 631xESB/632xESB SATA RAID Controller @@ -24788,31 +24861,31 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2689 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 268a 631xESB/632xESB/3100 Chipset UHCI USB Controller #3 1028 01f0 PowerEdge R900 onboard USB 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 268b 631xESB/632xESB/3100 Chipset UHCI USB Controller #4 1028 01f0 PowerEdge R900 onboard USB 15d9 8680 X7DVL-E-O motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 268c 631xESB/632xESB/3100 Chipset EHCI USB2 Controller 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2690 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 103c 31fe ProLiant DL140 G3 15d9 9680 X7DBN Motherboard @@ -24827,7 +24900,7 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 269e 631xESB/632xESB IDE Controller 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard @@ -24844,7 +24917,7 @@ 103c 2a3b Pavilion A1512X 1462 7418 Wind PC MS-7418 8086 544e DeskTop Board D945GTP - 8086 d605 Intel Desktop Board D945GCCR + 8086 d605 Desktop Board D945GCCR 2774 82955X Memory Controller Hub 2775 82955X PCI Express Root Port 2776 82945G/GZ Integrated Graphics Controller @@ -26205,8 +26278,7 @@ 8086 4010 Dual Band Wireless AC 3165 # Stone Peak 1x1 8086 4210 Dual Band Wireless AC 3165 -# Stone Peak 1x1 - 3166 Intel Dual Band Wireless-AC 3165 Plus Bluetooth + 3166 Dual Band Wireless-AC 3165 Plus Bluetooth 3200 GD31244 PCI-X SATA HBA 1775 c200 C2K onboard SATA host bus adapter 3310 IOP348 I/O Processor From owner-svn-src-stable-11@freebsd.org Sat Feb 25 20:21:40 2017 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 B33C9CEDA90; Sat, 25 Feb 2017 20:21:40 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66C18860; Sat, 25 Feb 2017 20:21:40 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1PKLd8b019797; Sat, 25 Feb 2017 20:21:39 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1PKLd7K019796; Sat, 25 Feb 2017 20:21:39 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201702252021.v1PKLd7K019796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 25 Feb 2017 20:21: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: r314281 - stable/11/sys/dev/e1000 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.23 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, 25 Feb 2017 20:21:40 -0000 Author: loos Date: Sat Feb 25 20:21:39 2017 New Revision: 314281 URL: https://svnweb.freebsd.org/changeset/base/314281 Log: Disable the driver managed queue for igb(4) when the legacy transmit interface is used. The legacy API (IGB_LEGACY_TX) is enabled when ALTQ is built into kernel. As noted in altq(9), it is responsibility of the caller to protect this queue against concurrent access and, in the igb case, the interface send queue is protected by tx queue mutex. This obviously cannot protect the driver managed queue against concurrent access from different tx queues and leads to numerous and quite strange panic traces (usually shown as packets disappearing into thin air). Improving the locking to cope with this means serialize all access to this (single) queue and produces no gain, it actually affects the performance quite noticeabily. The driver managed queue is already disabled when an ALTQ queue discipline is set on interface (in altq_enable()), because the driver managed queue can interfere with ALTQ timing (whence the reports that setting an ALTQ queue discipline on interface also fixes the issue). Disabling this additional queue keeps the ability to use if_start() to send packets to individual NIC queues while it simply eliminate the race. This is a direct commit to stable/11 as -head driver does not support ALTQ anymore. PR: 213257 PR: 212413 Discussed with: sbruno Tested by: Konstantin Kormashev Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/dev/e1000/if_igb.c Modified: stable/11/sys/dev/e1000/if_igb.c ============================================================================== --- stable/11/sys/dev/e1000/if_igb.c Sat Feb 25 20:01:17 2017 (r314280) +++ stable/11/sys/dev/e1000/if_igb.c Sat Feb 25 20:21:39 2017 (r314281) @@ -3182,7 +3182,7 @@ igb_setup_interface(device_t dev, struct #else ifp->if_start = igb_start; IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1); - ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1; + ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); #endif