From owner-svn-src-head@freebsd.org Sun May 28 00:28:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30FA6D76A36; Sun, 28 May 2017 00:28:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 012D915FE; Sun, 28 May 2017 00:28:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S0SCFv090865; Sun, 28 May 2017 00:28:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S0SCET090864; Sun, 28 May 2017 00:28:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280028.v4S0SCET090864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 00:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319019 - head/lib/libgeom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 00:28:13 -0000 Author: ngie Date: Sun May 28 00:28:11 2017 New Revision: 319019 URL: https://svnweb.freebsd.org/changeset/base/319019 Log: Remove getpagesize(3) error checking added in r317312 getpagesize(3) no longer fails as of r317436. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libgeom/geom_stats.c Modified: head/lib/libgeom/geom_stats.c ============================================================================== --- head/lib/libgeom/geom_stats.c Sun May 28 00:25:44 2017 (r319018) +++ head/lib/libgeom/geom_stats.c Sun May 28 00:28:11 2017 (r319019) @@ -87,8 +87,6 @@ geom_stats_open(void) if (statsfd < 0) return (errno); pagesize = getpagesize(); - if (pagesize == -1) - return (errno); spp = pagesize / sizeof(struct devstat); p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) { From owner-svn-src-head@freebsd.org Sun May 28 00:43:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FB4D76EDE; Sun, 28 May 2017 00:43:14 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABDCF1D5E; Sun, 28 May 2017 00:43:13 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S0hCMA098947; Sun, 28 May 2017 00:43:12 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S0hCqh098945; Sun, 28 May 2017 00:43:12 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705280043.v4S0hCqh098945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 28 May 2017 00:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319020 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 00:43:14 -0000 Author: vangyzen Date: Sun May 28 00:43:12 2017 New Revision: 319020 URL: https://svnweb.freebsd.org/changeset/base/319020 Log: Fix INSTALL_AS_USER Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that it has final authority over fooOWN and fooGRP. Reviewed by: sjg MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10810 Modified: head/share/mk/bsd.init.mk head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sun May 28 00:28:11 2017 (r319019) +++ head/share/mk/bsd.init.mk Sun May 28 00:43:12 2017 (r319020) @@ -16,6 +16,33 @@ ____: .include .MAIN: all +# Handle INSTALL_AS_USER here to maximize the chance that +# it has final authority over fooOWN and fooGRP. +.if ${MK_INSTALL_AS_USER} != "no" +.if !defined(_uid) +_uid!= id -u +.export _uid +.endif +.if ${_uid} != 0 +.if !defined(USER) +# Avoid exporting USER +.if !defined(_USER) +_USER!= id -un +.export _USER +.endif +USER= ${_USER} +.endif +.if !defined(_gid) +_gid!= id -g +.export _gid +.endif +.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE +$xOWN= ${USER} +$xGRP= ${_gid} +.endfor +.endif +.endif + # Some targets need to know when something may build. This is used to # optimize targets that are only needed when building something, such as # (not) reading in depend files. For DIRDEPS_BUILD, it will only calculate Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun May 28 00:28:11 2017 (r319019) +++ head/share/mk/bsd.own.mk Sun May 28 00:43:12 2017 (r319020) @@ -135,31 +135,6 @@ CTFCONVERT_CMD= CTFCONVERT_CMD= @: .endif -.if ${MK_INSTALL_AS_USER} != "no" -.if !defined(_uid) -_uid!= id -u -.export _uid -.endif -.if ${_uid} != 0 -.if !defined(USER) -# Avoid exporting USER -.if !defined(_USER) -_USER!= id -un -.export _USER -.endif -USER= ${_USER} -.endif -.if !defined(_gid) -_gid!= id -g -.export _gid -.endif -.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE -$xOWN= ${USER} -$xGRP= ${_gid} -.endfor -.endif -.endif - .endif # !_WITHOUT_SRCCONF # Binaries From owner-svn-src-head@freebsd.org Sun May 28 00:45:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39E5BD76FC6; Sun, 28 May 2017 00:45:30 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A1F91004; Sun, 28 May 2017 00:45:29 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S0jTaO099175; Sun, 28 May 2017 00:45:29 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S0jTJj099174; Sun, 28 May 2017 00:45:29 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705280045.v4S0jTJj099174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 28 May 2017 00:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319022 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 00:45:30 -0000 Author: vangyzen Date: Sun May 28 00:45:28 2017 New Revision: 319022 URL: https://svnweb.freebsd.org/changeset/base/319022 Log: Fix INSTALL_AS_USER with external nsswitch databases The INSTALL_AS_USER option tells "install" to use the current user name as the owner of the installed file. The "install" command executed by the build is statically linked, so it does not load nsswitch modules, such as nss_ldap.so, so it fails when the user is only defined in such a database. Fix it to use the current UID instead of user name. This works for all users. I expect it is also slightly more efficient. Reviewed by: sjg MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10862 Modified: head/share/mk/bsd.init.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sun May 28 00:45:02 2017 (r319021) +++ head/share/mk/bsd.init.mk Sun May 28 00:45:28 2017 (r319022) @@ -24,20 +24,12 @@ _uid!= id -u .export _uid .endif .if ${_uid} != 0 -.if !defined(USER) -# Avoid exporting USER -.if !defined(_USER) -_USER!= id -un -.export _USER -.endif -USER= ${_USER} -.endif .if !defined(_gid) _gid!= id -g .export _gid .endif .for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE -$xOWN= ${USER} +$xOWN= ${_uid} $xGRP= ${_gid} .endfor .endif From owner-svn-src-head@freebsd.org Sun May 28 02:15:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCD8D85BEE; Sun, 28 May 2017 02:15: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 003331B46; Sun, 28 May 2017 02:15: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 v4S2FwZY035364; Sun, 28 May 2017 02:15:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S2FvXQ035361; Sun, 28 May 2017 02:15:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280215.v4S2FvXQ035361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 02:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319026 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 02:15:59 -0000 Author: ngie Date: Sun May 28 02:15:57 2017 New Revision: 319026 URL: https://svnweb.freebsd.org/changeset/base/319026 Log: pw: add some basic testcases for groupshow and usershow - groupshow: test out -a/-g/-n . - usershow: test out -a/-n/-u . MFC after: 1 week Sponsored by: Dell EMC Isilon Added: head/usr.sbin/pw/tests/pw_groupshow_test.sh (contents, props changed) head/usr.sbin/pw/tests/pw_usershow_test.sh (contents, props changed) Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Sun May 28 01:14:59 2017 (r319025) +++ head/usr.sbin/pw/tests/Makefile Sun May 28 02:15:57 2017 (r319026) @@ -14,10 +14,12 @@ ATF_TESTS_SH= pw_etcdir_test \ pw_groupadd_test \ pw_groupdel_test \ pw_groupmod_test \ + pw_groupshow_test \ pw_useradd_test \ pw_userdel_test \ pw_usermod_test \ - pw_usernext_test + pw_usernext_test \ + pw_usershow_test .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Added: head/usr.sbin/pw/tests/pw_groupshow_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_groupshow_test.sh Sun May 28 02:15:57 2017 (r319026) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case group_show_all +group_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -a +} + +atf_test_case group_show_gid +group_show_gid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -g 0 +} + +atf_test_case group_show_name +group_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow wheel +} + +atf_test_case group_show_nonexistent_gid +group_show_nonexistent_gid_body() { + populate_etc_skel + + nonexistent_gid=4242 + no_such_name_msg="pw: unknown gid \`$nonexistent_gid'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_gid + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -g $nonexistent_gid +} + +atf_test_case group_show_nonexistent_name +group_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_name=bogus + no_such_name_msg="pw: unknown group \`$nonexistent_name'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_name + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -n $nonexistent_name +} + +atf_init_test_cases() { + atf_add_test_case group_show_all + atf_add_test_case group_show_gid + atf_add_test_case group_show_name + atf_add_test_case group_show_nonexistent_gid + atf_add_test_case group_show_nonexistent_name +} Added: head/usr.sbin/pw/tests/pw_usershow_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_usershow_test.sh Sun May 28 02:15:57 2017 (r319026) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case user_show_all +user_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -a +} + +atf_test_case user_show_name +user_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow root +} + +atf_test_case user_show_nonexistent_name +user_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_user=bogus + no_such_user_msg="pw: no such user \`$nonexistent_user'\n" + + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + $nonexistent_user + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + -n $nonexistent_user +} + +atf_test_case user_show_nonexistent_uid +user_show_nonexistent_uid_body() { + populate_etc_skel + + nonexistent_uid=4242 + no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n" + + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + $nonexistent_uid + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + -u $nonexistent_uid +} + +atf_test_case user_show_uid +user_show_uid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -u 0 +} + +atf_init_test_cases() { + atf_add_test_case user_show_all + atf_add_test_case user_show_name + atf_add_test_case user_show_nonexistent_name + atf_add_test_case user_show_nonexistent_uid + atf_add_test_case user_show_uid +} From owner-svn-src-head@freebsd.org Sun May 28 02:55:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3C7CD85853; Sun, 28 May 2017 02:55:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 945F91FB2; Sun, 28 May 2017 02:55:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S2t5hV051368; Sun, 28 May 2017 02:55:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S2t5L2051363; Sun, 28 May 2017 02:55:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280255.v4S2t5L2051363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 02:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319027 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 02:55:06 -0000 Author: ngie Date: Sun May 28 02:55:04 2017 New Revision: 319027 URL: https://svnweb.freebsd.org/changeset/base/319027 Log: lib/libc/tests/nss: use calloc appropriately The pattern used prior to this commit was `calloc(1, n * sizeof(type))`; the pattern that should be used however is `calloc(n, sizeof(type))`. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getgr_test.c head/lib/libc/tests/nss/gethostby_test.c head/lib/libc/tests/nss/getproto_test.c head/lib/libc/tests/nss/getrpc_test.c head/lib/libc/tests/nss/getserv_test.c Modified: head/lib/libc/tests/nss/getgr_test.c ============================================================================== --- head/lib/libc/tests/nss/getgr_test.c Sun May 28 02:15:57 2017 (r319026) +++ head/lib/libc/tests/nss/getgr_test.c Sun May 28 02:55:04 2017 (r319027) @@ -104,7 +104,7 @@ clone_group(struct group *dest, struct g for (cp = src->gr_mem; *cp; ++cp) ++members_num; - dest->gr_mem = calloc(1, (members_num + 1) * sizeof(char *)); + dest->gr_mem = calloc(members_num + 1, sizeof(char *)); ATF_REQUIRE(dest->gr_mem != NULL); for (cp = src->gr_mem; *cp; ++cp) { Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Sun May 28 02:15:57 2017 (r319026) +++ head/lib/libc/tests/nss/gethostby_test.c Sun May 28 02:55:04 2017 (r319027) @@ -163,8 +163,7 @@ clone_hostent(struct hostent *dest, stru for (cp = src->h_aliases; *cp; ++cp) ++aliases_num; - dest->h_aliases = calloc(1, (aliases_num + 1) * - sizeof(char *)); + dest->h_aliases = calloc(aliases_num + 1, sizeof(char *)); ATF_REQUIRE(dest->h_aliases != NULL); for (cp = src->h_aliases; *cp; ++cp) { @@ -178,7 +177,7 @@ clone_hostent(struct hostent *dest, stru for (cp = src->h_addr_list; *cp; ++cp) ++addrs_num; - dest->h_addr_list = calloc(1, (addrs_num + 1) * sizeof(char *)); + dest->h_addr_list = calloc(addrs_num + 1, sizeof(char *)); ATF_REQUIRE(dest->h_addr_list != NULL); for (cp = src->h_addr_list; *cp; ++cp) { Modified: head/lib/libc/tests/nss/getproto_test.c ============================================================================== --- head/lib/libc/tests/nss/getproto_test.c Sun May 28 02:15:57 2017 (r319026) +++ head/lib/libc/tests/nss/getproto_test.c Sun May 28 02:55:04 2017 (r319027) @@ -99,7 +99,7 @@ clone_protoent(struct protoent *dest, st for (cp = src->p_aliases; *cp; ++cp) ++aliases_num; - dest->p_aliases = calloc(1, (aliases_num+1) * sizeof(char *)); + dest->p_aliases = calloc(aliases_num + 1, sizeof(char *)); assert(dest->p_aliases != NULL); for (cp = src->p_aliases; *cp; ++cp) { Modified: head/lib/libc/tests/nss/getrpc_test.c ============================================================================== --- head/lib/libc/tests/nss/getrpc_test.c Sun May 28 02:15:57 2017 (r319026) +++ head/lib/libc/tests/nss/getrpc_test.c Sun May 28 02:55:04 2017 (r319027) @@ -100,7 +100,7 @@ clone_rpcent(struct rpcent *dest, struct for (cp = src->r_aliases; *cp; ++cp) ++aliases_num; - dest->r_aliases = calloc(1, (aliases_num + 1) * sizeof(char *)); + dest->r_aliases = calloc(aliases_num + 1, sizeof(char *)); ATF_REQUIRE(dest->r_aliases != NULL); for (cp = src->r_aliases; *cp; ++cp) { Modified: head/lib/libc/tests/nss/getserv_test.c ============================================================================== --- head/lib/libc/tests/nss/getserv_test.c Sun May 28 02:15:57 2017 (r319026) +++ head/lib/libc/tests/nss/getserv_test.c Sun May 28 02:55:04 2017 (r319027) @@ -102,7 +102,7 @@ clone_servent(struct servent *dest, stru for (cp = src->s_aliases; *cp; ++cp) ++aliases_num; - dest->s_aliases = calloc(1, (aliases_num + 1) * sizeof(char *)); + dest->s_aliases = calloc(aliases_num + 1, sizeof(char *)); ATF_REQUIRE(dest->s_aliases != NULL); for (cp = src->s_aliases; *cp; ++cp) { From owner-svn-src-head@freebsd.org Sun May 28 03:39:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BFAD85331; Sun, 28 May 2017 03:39:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE610154F; Sun, 28 May 2017 03:39:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S3dOun068296; Sun, 28 May 2017 03:39:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S3dOWG068295; Sun, 28 May 2017 03:39:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280339.v4S3dOWG068295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 03:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319028 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 03:39:26 -0000 Author: ngie Date: Sun May 28 03:39:24 2017 New Revision: 319028 URL: https://svnweb.freebsd.org/changeset/base/319028 Log: Sort make variables to suit style.Makefile(5) This is being done prior to functional changes. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/Makefile Modified: head/lib/libc/tests/nss/Makefile ============================================================================== --- head/lib/libc/tests/nss/Makefile Sun May 28 02:55:04 2017 (r319027) +++ head/lib/libc/tests/nss/Makefile Sun May 28 03:39:24 2017 (r319028) @@ -1,18 +1,13 @@ # $FreeBSD$ +.PATH: ${.CURDIR:H}/resolv + PACKAGE= tests TESTSDIR= ${TESTSBASE}/lib/libc/nss BINDIR= ${TESTSDIR} -.PATH: ${.CURDIR:H}/resolv - -${PACKAGE}FILES+= mach - -WARNS?= 1 -CFLAGS+= -I${SRCTOP}/tests - ATF_TESTS_C+= getaddrinfo_test ATF_TESTS_C+= getgr_test ATF_TESTS_C+= gethostby_test @@ -23,4 +18,10 @@ ATF_TESTS_C+= getrpc_test ATF_TESTS_C+= getserv_test ATF_TESTS_C+= getusershell_test +${PACKAGE}FILES+= mach + +WARNS?= 1 + +CFLAGS+= -I${SRCTOP}/tests + .include From owner-svn-src-head@freebsd.org Sun May 28 03:42:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B8CD85538; Sun, 28 May 2017 03:42:51 +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 AEAB41987; Sun, 28 May 2017 03:42:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S3gnKR072153; Sun, 28 May 2017 03:42:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S3gnM0072149; Sun, 28 May 2017 03:42:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280342.v4S3gnM0072149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 03:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319029 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 03:42:51 -0000 Author: ngie Date: Sun May 28 03:42:49 2017 New Revision: 319029 URL: https://svnweb.freebsd.org/changeset/base/319029 Log: Staticize functions and remove unused variables to aid with bumping WARNS MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getaddrinfo_test.c head/lib/libc/tests/nss/getgr_test.c head/lib/libc/tests/nss/getpw_test.c head/lib/libc/tests/nss/getusershell_test.c Modified: head/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 03:39:24 2017 (r319028) +++ head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 03:42:49 2017 (r319029) @@ -144,7 +144,7 @@ compare_addrinfo(struct addrinfo *ai1, s return (rv); } -void +static void free_addrinfo(struct addrinfo *ai) { if (ai == NULL) @@ -409,7 +409,7 @@ addrinfo_read_hostlist_func(struct addri return (0); } -void +static void run_tests(char *hostlist_file, char *snapshot_file, int ai_family) { struct addrinfo_test_data td, td_snap; Modified: head/lib/libc/tests/nss/getgr_test.c ============================================================================== --- head/lib/libc/tests/nss/getgr_test.c Sun May 28 03:39:24 2017 (r319028) +++ head/lib/libc/tests/nss/getgr_test.c Sun May 28 03:42:49 2017 (r319029) @@ -49,8 +49,6 @@ enum test_methods { TEST_BUILD_SNAPSHOT = 16, }; -static enum test_methods method = TEST_BUILD_SNAPSHOT; - DECLARE_TEST_DATA(group) DECLARE_TEST_FILE_SNAPSHOT(group) DECLARE_1PASS_TEST(group) Modified: head/lib/libc/tests/nss/getpw_test.c ============================================================================== --- head/lib/libc/tests/nss/getpw_test.c Sun May 28 03:39:24 2017 (r319028) +++ head/lib/libc/tests/nss/getpw_test.c Sun May 28 03:42:49 2017 (r319029) @@ -47,8 +47,6 @@ enum test_methods { TEST_BUILD_SNAPSHOT }; -static enum test_methods method = TEST_BUILD_SNAPSHOT; - DECLARE_TEST_DATA(passwd) DECLARE_TEST_FILE_SNAPSHOT(passwd) DECLARE_1PASS_TEST(passwd) Modified: head/lib/libc/tests/nss/getusershell_test.c ============================================================================== --- head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:39:24 2017 (r319028) +++ head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:42:49 2017 (r319029) @@ -48,8 +48,6 @@ struct usershell { char *path; }; -static enum test_methods method = TEST_GETUSERSHELL; - DECLARE_TEST_DATA(usershell) DECLARE_TEST_FILE_SNAPSHOT(usershell) DECLARE_2PASS_TEST(usershell) From owner-svn-src-head@freebsd.org Sun May 28 03:47:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FFDCD855F2; Sun, 28 May 2017 03:47: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 420F41B1B; Sun, 28 May 2017 03:47:59 +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 v4S3lwJ0072389; Sun, 28 May 2017 03:47:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S3lwQR072388; Sun, 28 May 2017 03:47:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280347.v4S3lwQR072388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 03:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319030 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 03:47:59 -0000 Author: ngie Date: Sun May 28 03:47:58 2017 New Revision: 319030 URL: https://svnweb.freebsd.org/changeset/base/319030 Log: Fix -Wsign-compare warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getgr_test.c Modified: head/lib/libc/tests/nss/getgr_test.c ============================================================================== --- head/lib/libc/tests/nss/getgr_test.c Sun May 28 03:42:49 2017 (r319029) +++ head/lib/libc/tests/nss/getgr_test.c Sun May 28 03:47:58 2017 (r319030) @@ -177,7 +177,7 @@ sdump_group(struct group *grp, char *buf written = snprintf(buffer, buflen, "%s:%s:%d:", grp->gr_name, grp->gr_passwd, grp->gr_gid); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -187,7 +187,7 @@ sdump_group(struct group *grp, char *buf written = snprintf(buffer, buflen, "%s%s", cp == grp->gr_mem ? "" : ",", *cp); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; From owner-svn-src-head@freebsd.org Sun May 28 03:58:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 317F2D859ED; Sun, 28 May 2017 03:58:38 +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 E5F83182B; Sun, 28 May 2017 03:58:37 +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 v4S3waZ7077603; Sun, 28 May 2017 03:58:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S3wash077602; Sun, 28 May 2017 03:58:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280358.v4S3wash077602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 03:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319031 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 03:58:38 -0000 Author: ngie Date: Sun May 28 03:58:36 2017 New Revision: 319031 URL: https://svnweb.freebsd.org/changeset/base/319031 Log: getusershell_test: staticize run_tests(..) to fix warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getusershell_test.c Modified: head/lib/libc/tests/nss/getusershell_test.c ============================================================================== --- head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:47:58 2017 (r319030) +++ head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:58:36 2017 (r319031) @@ -132,7 +132,7 @@ usershell_read_snapshot_func(struct user return (0); } -int +static int run_tests(const char *snapshot_file, enum test_methods method) { struct usershell_test_data td, td_snap; From owner-svn-src-head@freebsd.org Sun May 28 04:03:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA903D85CD2; Sun, 28 May 2017 04:03:07 +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 AC8A51ECF; Sun, 28 May 2017 04:03:07 +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 v4S436wr081410; Sun, 28 May 2017 04:03:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4366k081409; Sun, 28 May 2017 04:03:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280403.v4S4366k081409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319033 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:03:08 -0000 Author: ngie Date: Sun May 28 04:03:06 2017 New Revision: 319033 URL: https://svnweb.freebsd.org/changeset/base/319033 Log: getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getserv_test.c Modified: head/lib/libc/tests/nss/getserv_test.c ============================================================================== --- head/lib/libc/tests/nss/getserv_test.c Sun May 28 03:59:33 2017 (r319032) +++ head/lib/libc/tests/nss/getserv_test.c Sun May 28 04:03:06 2017 (r319033) @@ -177,16 +177,16 @@ sdump_servent(struct servent *serv, char written = snprintf(buffer, buflen, "%s %d %s", serv->s_name, ntohs(serv->s_port), serv->s_proto); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; if (serv->s_aliases != NULL) { if (*(serv->s_aliases) != '\0') { for (cp = serv->s_aliases; *cp; ++cp) { - written = snprintf(buffer, buflen, " %s",*cp); + written = snprintf(buffer, buflen, " %s", *cp); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -410,7 +410,7 @@ servent_test_getservent(struct servent * return (servent_test_correctness(serv, NULL)); } -int +static int run_tests(const char *snapshot_file, enum test_methods method) { struct servent_test_data td, td_snap, td_2pass; From owner-svn-src-head@freebsd.org Sun May 28 04:03:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58358D85D47; Sun, 28 May 2017 04:03: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 2A217105C; Sun, 28 May 2017 04:03: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 v4S43jZB081477; Sun, 28 May 2017 04:03:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S43jtO081476; Sun, 28 May 2017 04:03:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280403.v4S43jtO081476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319034 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:03:46 -0000 Author: ngie Date: Sun May 28 04:03:45 2017 New Revision: 319034 URL: https://svnweb.freebsd.org/changeset/base/319034 Log: getaddrinfo_test: fix -Wsign-compare warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getaddrinfo_test.c Modified: head/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 04:03:06 2017 (r319033) +++ head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 04:03:45 2017 (r319034) @@ -164,30 +164,30 @@ sdump_addrinfo(struct addrinfo *ai, char ai->ai_flags, ai->ai_family, ai->ai_socktype, ai->ai_protocol, ai->ai_addrlen); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; written = snprintf(buffer, buflen, "%s ", ai->ai_canonname == NULL ? "(null)" : ai->ai_canonname); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; if (ai->ai_addr == NULL) { written = snprintf(buffer, buflen, "(null)"); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; } else { - for (i = 0; i < ai->ai_addrlen; i++) { + for (i = 0; i < (int)ai->ai_addrlen; i++) { written = snprintf(buffer, buflen, - i + 1 != ai->ai_addrlen ? "%d." : "%d", + i + 1 != (int)ai->ai_addrlen ? "%d." : "%d", ((unsigned char *)ai->ai_addr)[i]); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -199,7 +199,7 @@ sdump_addrinfo(struct addrinfo *ai, char if (ai->ai_next != NULL) { written = snprintf(buffer, buflen, ":"); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; From owner-svn-src-head@freebsd.org Sun May 28 04:04:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6838D85DD1; Sun, 28 May 2017 04:04:33 +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 B6EB41205; Sun, 28 May 2017 04:04:33 +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 v4S44WF0081551; Sun, 28 May 2017 04:04:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S44Wjr081550; Sun, 28 May 2017 04:04:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280404.v4S44Wjr081550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319035 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:04:34 -0000 Author: ngie Date: Sun May 28 04:04:32 2017 New Revision: 319035 URL: https://svnweb.freebsd.org/changeset/base/319035 Log: getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getrpc_test.c Modified: head/lib/libc/tests/nss/getrpc_test.c ============================================================================== --- head/lib/libc/tests/nss/getrpc_test.c Sun May 28 04:03:45 2017 (r319034) +++ head/lib/libc/tests/nss/getrpc_test.c Sun May 28 04:04:32 2017 (r319035) @@ -173,16 +173,16 @@ sdump_rpcent(struct rpcent *rpc, char *b written = snprintf(buffer, buflen, "%s %d", rpc->r_name, rpc->r_number); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; if (rpc->r_aliases != NULL) { if (*(rpc->r_aliases) != '\0') { for (cp = rpc->r_aliases; *cp; ++cp) { - written = snprintf(buffer, buflen, " %s",*cp); + written = snprintf(buffer, buflen, " %s", *cp); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -400,7 +400,7 @@ rpcent_test_getrpcent(struct rpcent *rpc return (rpcent_test_correctness(rpc, NULL)); } -int +static int run_tests(const char *snapshot_file, enum test_methods method) { struct rpcent_test_data td, td_snap, td_2pass; From owner-svn-src-head@freebsd.org Sun May 28 04:05:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C11C2D85E65; Sun, 28 May 2017 04:05:20 +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 933721364; Sun, 28 May 2017 04:05:20 +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 v4S45JFZ081639; Sun, 28 May 2017 04:05:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S45J8o081638; Sun, 28 May 2017 04:05:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280405.v4S45J8o081638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319036 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:05:20 -0000 Author: ngie Date: Sun May 28 04:05:19 2017 New Revision: 319036 URL: https://svnweb.freebsd.org/changeset/base/319036 Log: getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getproto_test.c Modified: head/lib/libc/tests/nss/getproto_test.c ============================================================================== --- head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:04:32 2017 (r319035) +++ head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:05:19 2017 (r319036) @@ -172,16 +172,16 @@ sdump_protoent(struct protoent *pe, char written = snprintf(buffer, buflen, "%s %d", pe->p_name, pe->p_proto); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; if (pe->p_aliases != NULL) { if (*(pe->p_aliases) != '\0') { for (cp = pe->p_aliases; *cp; ++cp) { - written = snprintf(buffer, buflen, " %s",*cp); + written = snprintf(buffer, buflen, " %s", *cp); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -395,7 +395,7 @@ protoent_test_getprotoent(struct protoen return (protoent_test_correctness(pe, NULL)); } -int +static int run_tests(const char *snapshot_file, enum test_methods method) { struct protoent_test_data td, td_snap, td_2pass; From owner-svn-src-head@freebsd.org Sun May 28 04:11:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF534D85F43; Sun, 28 May 2017 04:11:05 +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 BA24F15C9; Sun, 28 May 2017 04:11:05 +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 v4S4B48s082720; Sun, 28 May 2017 04:11:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4B4V8082719; Sun, 28 May 2017 04:11:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280411.v4S4B4V8082719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319037 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:11:06 -0000 Author: ngie Date: Sun May 28 04:11:04 2017 New Revision: 319037 URL: https://svnweb.freebsd.org/changeset/base/319037 Log: getaddrinfo_test: mark unused function parameters __unused to fix -Wunused warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getaddrinfo_test.c Modified: head/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 04:05:19 2017 (r319036) +++ head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 04:11:04 2017 (r319037) @@ -28,7 +28,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include @@ -125,7 +125,8 @@ compare_addrinfo_(struct addrinfo *ai1, } static int -compare_addrinfo(struct addrinfo *ai1, struct addrinfo *ai2, void *mdata) +compare_addrinfo(struct addrinfo *ai1, struct addrinfo *ai2, + void *mdata __unused) { int rv; @@ -344,7 +345,7 @@ addrinfo_read_snapshot_func(struct addri } static int -addrinfo_test_correctness(struct addrinfo *ai, void *mdata) +addrinfo_test_correctness(struct addrinfo *ai, void *mdata __unused) { printf("testing correctness with the following data:\n"); From owner-svn-src-head@freebsd.org Sun May 28 04:12:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02A13D85133; Sun, 28 May 2017 04:12:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C329D17D2; Sun, 28 May 2017 04:12:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S4C2ix085084; Sun, 28 May 2017 04:12:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4C2qA085083; Sun, 28 May 2017 04:12:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280412.v4S4C2qA085083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319038 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:12:04 -0000 Author: ngie Date: Sun May 28 04:12:02 2017 New Revision: 319038 URL: https://svnweb.freebsd.org/changeset/base/319038 Log: getusershell_test: mark mdata parameter in compare_usershell __unused MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getusershell_test.c Modified: head/lib/libc/tests/nss/getusershell_test.c ============================================================================== --- head/lib/libc/tests/nss/getusershell_test.c Sun May 28 04:11:04 2017 (r319037) +++ head/lib/libc/tests/nss/getusershell_test.c Sun May 28 04:12:02 2017 (r319038) @@ -76,7 +76,8 @@ clone_usershell(struct usershell *dest, } static int -compare_usershell(struct usershell *us1, struct usershell *us2, void *mdata) +compare_usershell(struct usershell *us1, struct usershell *us2, + void *mdata __unused) { int rv; From owner-svn-src-head@freebsd.org Sun May 28 04:12:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 029BFD85226; Sun, 28 May 2017 04:12: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 C62141B05; Sun, 28 May 2017 04:12: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 v4S4Cq2q085814; Sun, 28 May 2017 04:12:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4CqHp085813; Sun, 28 May 2017 04:12:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280412.v4S4CqHp085813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319039 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:12:54 -0000 Author: ngie Date: Sun May 28 04:12:52 2017 New Revision: 319039 URL: https://svnweb.freebsd.org/changeset/base/319039 Log: getserv_test: mark unused parameters __unused to fix corresponding warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getserv_test.c Modified: head/lib/libc/tests/nss/getserv_test.c ============================================================================== --- head/lib/libc/tests/nss/getserv_test.c Sun May 28 04:12:02 2017 (r319038) +++ head/lib/libc/tests/nss/getserv_test.c Sun May 28 04:12:52 2017 (r319039) @@ -300,7 +300,7 @@ servent_fill_test_data(struct servent_te } static int -servent_test_correctness(struct servent *serv, void *mdata) +servent_test_correctness(struct servent *serv, void *mdata __unused) { printf("testing correctness with the following data:\n"); dump_servent(serv); @@ -403,7 +403,7 @@ servent_test_getservbyport(struct serven } static int -servent_test_getservent(struct servent *serv, void *mdata) +servent_test_getservent(struct servent *serv, void *mdata __unused) { /* Only correctness can be checked when doing 1-pass test for * getservent(). */ From owner-svn-src-head@freebsd.org Sun May 28 04:15:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8871DD853A1; Sun, 28 May 2017 04:15:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 558401CF5; Sun, 28 May 2017 04:15:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S4F55S085933; Sun, 28 May 2017 04:15:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4F5fB085932; Sun, 28 May 2017 04:15:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280415.v4S4F5fB085932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319040 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:15:06 -0000 Author: ngie Date: Sun May 28 04:15:05 2017 New Revision: 319040 URL: https://svnweb.freebsd.org/changeset/base/319040 Log: getrpc_test: fix -Wunused warnings - Mark unused function parameters unused. - Remove an unused function prototype. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getrpc_test.c Modified: head/lib/libc/tests/nss/getrpc_test.c ============================================================================== --- head/lib/libc/tests/nss/getrpc_test.c Sun May 28 04:12:52 2017 (r319039) +++ head/lib/libc/tests/nss/getrpc_test.c Sun May 28 04:15:05 2017 (r319040) @@ -70,8 +70,6 @@ static int rpcent_test_getrpcbyname(stru static int rpcent_test_getrpcbynumber(struct rpcent *, void *); static int rpcent_test_getrpcent(struct rpcent *, void *); -static void usage(void) __attribute__((__noreturn__)); - IMPLEMENT_TEST_DATA(rpcent) IMPLEMENT_TEST_FILE_SNAPSHOT(rpcent) IMPLEMENT_1PASS_TEST(rpcent) @@ -289,7 +287,7 @@ rpcent_fill_test_data(struct rpcent_test } static int -rpcent_test_correctness(struct rpcent *rpc, void *mdata) +rpcent_test_correctness(struct rpcent *rpc, void *mdata __unused) { printf("testing correctness with the following data:\n"); @@ -390,7 +388,7 @@ rpcent_test_getrpcbynumber(struct rpcent } static int -rpcent_test_getrpcent(struct rpcent *rpc, void *mdata) +rpcent_test_getrpcent(struct rpcent *rpc, void *mdata __unused) { /* From owner-svn-src-head@freebsd.org Sun May 28 04:15:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F01D8543B; Sun, 28 May 2017 04:15: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 A42101E52; Sun, 28 May 2017 04:15: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 v4S4Fvdx086001; Sun, 28 May 2017 04:15:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4FvfK086000; Sun, 28 May 2017 04:15:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280415.v4S4FvfK086000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319041 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:15:58 -0000 Author: ngie Date: Sun May 28 04:15:57 2017 New Revision: 319041 URL: https://svnweb.freebsd.org/changeset/base/319041 Log: getproto_test: fix -Wunused warnings Mark unused parameters __unused in functions. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getproto_test.c Modified: head/lib/libc/tests/nss/getproto_test.c ============================================================================== --- head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:15:05 2017 (r319040) +++ head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:15:57 2017 (r319041) @@ -288,7 +288,7 @@ protoent_fill_test_data(struct protoent_ } static int -protoent_test_correctness(struct protoent *pe, void *mdata) +protoent_test_correctness(struct protoent *pe, void *mdata __unused) { printf("testing correctness with the following data:\n"); dump_protoent(pe); @@ -388,7 +388,7 @@ protoent_test_getprotobynumber(struct pr } static int -protoent_test_getprotoent(struct protoent *pe, void *mdata) +protoent_test_getprotoent(struct protoent *pe, void *mdata __unused) { /* Only correctness can be checked when doing 1-pass test for * getprotoent(). */ From owner-svn-src-head@freebsd.org Sun May 28 04:34:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D63ACD85A81; Sun, 28 May 2017 04:34: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 AD8651732; Sun, 28 May 2017 04:34: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 v4S4YvMf094031; Sun, 28 May 2017 04:34:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4Yv4f094030; Sun, 28 May 2017 04:34:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280434.v4S4Yv4f094030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319042 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:34:58 -0000 Author: ngie Date: Sun May 28 04:34:57 2017 New Revision: 319042 URL: https://svnweb.freebsd.org/changeset/base/319042 Log: gethostby_test: fix multiple warning types - Fix -Wmissing-declaration warning by staticizing run_tests. - Fix -Wsign-compare warnings by casting size_t types to int for comparisons. Reindent some of the code in sdump_hostent(..) to accomodate the overall changes. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/gethostby_test.c Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Sun May 28 04:15:57 2017 (r319041) +++ head/lib/libc/tests/nss/gethostby_test.c Sun May 28 04:34:57 2017 (r319042) @@ -412,7 +412,7 @@ sdump_hostent(struct hostent *ht, char * written = snprintf(buffer, buflen, "%s %d %d", ht->h_name, ht->h_addrtype, ht->h_length); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -421,7 +421,7 @@ sdump_hostent(struct hostent *ht, char * for (cp = ht->h_aliases; *cp; ++cp) { written = snprintf(buffer, buflen, " %s",*cp); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; @@ -431,59 +431,61 @@ sdump_hostent(struct hostent *ht, char * } else { written = snprintf(buffer, buflen, " noaliases"); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; } } else { written = snprintf(buffer, buflen, " (null)"); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; } written = snprintf(buffer, buflen, " : "); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; if (ht->h_addr_list != NULL) { if (*(ht->h_addr_list) != NULL) { for (cp = ht->h_addr_list; *cp; ++cp) { - for (i = 0; i < ht->h_length; ++i ) { - written = snprintf(buffer, buflen, - i + 1 != ht->h_length ? "%d." : "%d", - (unsigned char)(*cp)[i]); - buffer += written; - if (written > buflen) - return; - buflen -= written; + for (i = 0; i < (size_t)ht->h_length; ++i) { + written = snprintf(buffer, buflen, + i + 1 != (size_t)ht->h_length ? + "%d." : "%d", + (unsigned char)(*cp)[i]); + buffer += written; + if (written > (int)buflen) + return; + buflen -= written; - if (buflen == 0) - return; - } + if (buflen == 0) + return; + } - if (*(cp + 1) ) { - written = snprintf(buffer, buflen, " "); - buffer += written; - if (written > buflen) - return; - buflen -= written; - } + if (*(cp + 1)) { + written = snprintf(buffer, buflen, + " "); + buffer += written; + if (written > (int)buflen) + return; + buflen -= written; + } } } else { written = snprintf(buffer, buflen, " noaddrs"); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; } } else { written = snprintf(buffer, buflen, " (null)"); buffer += written; - if (written > buflen) + if (written > (int)buflen) return; buflen -= written; } @@ -920,7 +922,7 @@ hostent_test_getnameinfo_eq(struct hoste return (0); } -int +static int run_tests(const char *hostlist_file, const char *snapshot_file, int af_type, enum test_methods method, bool use_ipv6_mapping) { From owner-svn-src-head@freebsd.org Sun May 28 04:41:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4826D85B8B; Sun, 28 May 2017 04:41:07 +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 7AA551ABD; Sun, 28 May 2017 04:41:07 +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 v4S4f6Jb095058; Sun, 28 May 2017 04:41:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4f6sb095057; Sun, 28 May 2017 04:41:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280441.v4S4f6sb095057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319043 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:41:07 -0000 Author: ngie Date: Sun May 28 04:41:06 2017 New Revision: 319043 URL: https://svnweb.freebsd.org/changeset/base/319043 Log: getpw_test: fix -Wunused warnings - Mark unused parameters __unused. - Put dump_passwd under DEBUG as it's only used in that case. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getpw_test.c Modified: head/lib/libc/tests/nss/getpw_test.c ============================================================================== --- head/lib/libc/tests/nss/getpw_test.c Sun May 28 04:34:57 2017 (r319042) +++ head/lib/libc/tests/nss/getpw_test.c Sun May 28 04:41:06 2017 (r319043) @@ -57,7 +57,9 @@ static int compare_passwd(struct passwd static void free_passwd(struct passwd *); static void sdump_passwd(struct passwd *, char *, size_t); +#ifdef DEBUG static void dump_passwd(struct passwd *); +#endif static int passwd_read_snapshot_func(struct passwd *, char *); @@ -95,7 +97,7 @@ clone_passwd(struct passwd *dest, struct } static int -compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata) +compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata __unused) { ATF_REQUIRE(pwd1 != NULL); ATF_REQUIRE(pwd2 != NULL); @@ -140,6 +142,7 @@ sdump_passwd(struct passwd *pwd, char *b pwd->pw_fields); } +#ifdef DEBUG static void dump_passwd(struct passwd *pwd) { @@ -150,6 +153,7 @@ dump_passwd(struct passwd *pwd) } else printf("(null)\n"); } +#endif static int passwd_read_snapshot_func(struct passwd *pwd, char *line) @@ -249,7 +253,7 @@ passwd_fill_test_data(struct passwd_test } static int -passwd_test_correctness(struct passwd *pwd, void *mdata) +passwd_test_correctness(struct passwd *pwd, void *mdata __unused) { #ifdef DEBUG @@ -361,7 +365,7 @@ passwd_test_getpwuid(struct passwd *pwd_ } static int -passwd_test_getpwent(struct passwd *pwd, void *mdata) +passwd_test_getpwent(struct passwd *pwd, void *mdata __unused) { /* Only correctness can be checked when doing 1-pass test for * getpwent(). */ From owner-svn-src-head@freebsd.org Sun May 28 04:43:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78389D85D25; Sun, 28 May 2017 04:43:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475DC1D45; Sun, 28 May 2017 04:43:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S4h2ff098232; Sun, 28 May 2017 04:43:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S4h2dQ098231; Sun, 28 May 2017 04:43:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280443.v4S4h2dQ098231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 04:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319044 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 04:43:03 -0000 Author: ngie Date: Sun May 28 04:43:02 2017 New Revision: 319044 URL: https://svnweb.freebsd.org/changeset/base/319044 Log: getgr_test: fix -Wunused warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getgr_test.c Modified: head/lib/libc/tests/nss/getgr_test.c ============================================================================== --- head/lib/libc/tests/nss/getgr_test.c Sun May 28 04:41:06 2017 (r319043) +++ head/lib/libc/tests/nss/getgr_test.c Sun May 28 04:43:02 2017 (r319044) @@ -307,7 +307,7 @@ group_fill_test_data(struct group_test_d } static int -group_test_correctness(struct group *grp, void *mdata) +group_test_correctness(struct group *grp, void *mdata __unused) { printf("testing correctness with the following data:\n"); dump_group(grp); @@ -385,7 +385,7 @@ group_test_getgrgid(struct group *grp_mo } static int -group_test_getgrent(struct group *grp, void *mdata) +group_test_getgrent(struct group *grp, void *mdata __unused) { /* Only correctness can be checked when doing 1-pass test for * getgrent(). */ From owner-svn-src-head@freebsd.org Sun May 28 05:26:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5771D85843; Sun, 28 May 2017 05:26: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 7DBC2112; Sun, 28 May 2017 05:26: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 v4S5QjmR014493; Sun, 28 May 2017 05:26:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S5Qjjs014492; Sun, 28 May 2017 05:26:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280526.v4S5Qjjs014492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 05:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319045 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 05:26:46 -0000 Author: ngie Date: Sun May 28 05:26:45 2017 New Revision: 319045 URL: https://svnweb.freebsd.org/changeset/base/319045 Log: Fix -Wunused and -Wshadow warnings MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/gethostby_test.c Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Sun May 28 04:43:02 2017 (r319044) +++ head/lib/libc/tests/nss/gethostby_test.c Sun May 28 05:26:45 2017 (r319045) @@ -87,8 +87,6 @@ static int hostent_test_gethostbyaddr(st static int hostent_test_getaddrinfo_eq(struct hostent *, void *); static int hostent_test_getnameinfo_eq(struct hostent *, void *); -static void usage(void) __attribute__((__noreturn__)); - IMPLEMENT_TEST_DATA(hostent) IMPLEMENT_TEST_FILE_SNAPSHOT(hostent) IMPLEMENT_1PASS_TEST(hostent) @@ -677,7 +675,7 @@ dump_hostent(struct hostent *result) } static int -hostent_test_correctness(struct hostent *ht, void *mdata) +hostent_test_correctness(struct hostent *ht, void *mdata __unused) { #ifdef DEBUG @@ -760,7 +758,7 @@ hostent_test_gethostbyaddr(struct hosten } static int -hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata) +hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata __unused) { struct addrinfo *ai, hints; int rv; @@ -799,7 +797,7 @@ hostent_test_getaddrinfo_eq(struct hoste } static int -hostent_test_getnameinfo_eq(struct hostent *he, void *mdata) +hostent_test_getnameinfo_eq(struct hostent *he, void *mdata __unused) { char **cp; char buffer[NI_MAXHOST]; @@ -923,14 +921,14 @@ hostent_test_getnameinfo_eq(struct hoste } static int -run_tests(const char *hostlist_file, const char *snapshot_file, int af_type, +run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type, enum test_methods method, bool use_ipv6_mapping) { struct hostent_test_data td, td_addr, td_snap; res_state statp; int rv = -2; - switch (af_type) { + switch (_af_type) { case AF_INET: ATF_REQUIRE_FEATURE("inet"); ATF_REQUIRE(!use_ipv6_mapping); @@ -939,7 +937,7 @@ run_tests(const char *hostlist_file, con ATF_REQUIRE_FEATURE("inet6"); break; default: - atf_tc_fail("unhandled address family: %d", af_type); + atf_tc_fail("unhandled address family: %d", _af_type); break; } From owner-svn-src-head@freebsd.org Sun May 28 05:31:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E607DD85A8F; Sun, 28 May 2017 05:31: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 B6764367; Sun, 28 May 2017 05:31:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S5VIGO015386; Sun, 28 May 2017 05:31:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S5VIie015385; Sun, 28 May 2017 05:31:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280531.v4S5VIie015385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 05:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319046 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 05:31:20 -0000 Author: ngie Date: Sun May 28 05:31:18 2017 New Revision: 319046 URL: https://svnweb.freebsd.org/changeset/base/319046 Log: Fix a -Wunused-but-set-variable warning reported by gcc 6.3.0 MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getaddrinfo_test.c Modified: head/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 05:26:45 2017 (r319045) +++ head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 05:31:18 2017 (r319046) @@ -310,12 +310,11 @@ addrinfo_read_snapshot_func(struct addri { struct addrinfo *ai2; char *s, *ps; - int i, rv; + int rv; printf("1 line read from snapshot:\n%s\n", line); rv = 0; - i = 0; ps = line; s = strsep(&ps, ":"); From owner-svn-src-head@freebsd.org Sun May 28 06:13:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36446D852B7; Sun, 28 May 2017 06:13:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFD481635; Sun, 28 May 2017 06:13:40 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S6DeSs034728; Sun, 28 May 2017 06:13:40 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S6DdRQ034717; Sun, 28 May 2017 06:13:39 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201705280613.v4S6DdRQ034717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 28 May 2017 06:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319047 - in head/lib/msun: . man src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 06:13:41 -0000 Author: mmel Date: Sun May 28 06:13:38 2017 New Revision: 319047 URL: https://svnweb.freebsd.org/changeset/base/319047 Log: Implement sincos, sincosf, and sincosl. The primary benefit of these functions is that argument reduction is done once instead of twice in independent calls to sin() and cos(). * lib/msun/Makefile: . Add s_sincos[fl].c to the build. . Add sincos.3 documentation. . Add appropriate MLINKS. * lib/msun/Symbol.map: . Expose sincos[fl] symbols in dynamic libm.so. * lib/msun/man/sincos.3: . Documentation for sincos[fl]. * lib/msun/src/k_sincos.h: . Kernel for sincos() function. This merges the individual kernels for sin() and cos(). The merger offered an opportunity to re-arrange the individual kernels for better performance. * lib/msun/src/k_sincosf.h: . Kernel for sincosf() function. This merges the individual kernels for sinf() and cosf(). The merger offered an opportunity to re-arrange the individual kernels for better performance. * lib/msun/src/k_sincosl.h: . Kernel for sincosl() function. This merges the individual kernels for sinl() and cosl(). The merger offered an opportunity to re-arrange the individual kernels for better performance. * lib/msun/src/math.h: . Add prototytpes for sincos[fl](). * lib/msun/src/math_private.h: . Add RETURNV macros. This is needed to reset fpsetprec on I386 hardware for a function with type void. * lib/msun/src/s_sincos.c: . Implementation of sincos() where sin() and cos() were merged into one routine and possibly re-arranged for better performance. * lib/msun/src/s_sincosf.c: . Implementation of sincosf() where sinf() and cosf() were merged into one routine and possibly re-arranged for better performance. * lib/msun/src/s_sincosl.c: . Implementation of sincosl() where sinl() and cosl() were merged into one routine and possibly re-arranged for better performance. PR: 215977, 218300 Submitted by: Steven G. Kargl MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10765 Added: head/lib/msun/man/sincos.3 (contents, props changed) head/lib/msun/src/k_sincos.h (contents, props changed) head/lib/msun/src/k_sincosf.h (contents, props changed) head/lib/msun/src/k_sincosl.h (contents, props changed) head/lib/msun/src/s_sincos.c (contents, props changed) head/lib/msun/src/s_sincosf.c (contents, props changed) head/lib/msun/src/s_sincosl.c (contents, props changed) Modified: head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/src/math.h head/lib/msun/src/math_private.h Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Sun May 28 05:31:18 2017 (r319046) +++ head/lib/msun/Makefile Sun May 28 06:13:38 2017 (r319047) @@ -73,7 +73,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c s_nexttowardf.c s_remquo.c s_remquof.c \ s_rint.c s_rintf.c s_round.c s_roundf.c \ s_scalbln.c s_scalbn.c s_scalbnf.c s_signbit.c \ - s_signgam.c s_significand.c s_significandf.c s_sin.c s_sinf.c \ + s_signgam.c s_significand.c s_significandf.c s_sin.c \ + s_sincos.c s_sincosf.c s_sinf.c \ s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c s_trunc.c s_truncf.c \ w_cabs.c w_cabsf.c w_drem.c w_dremf.c @@ -104,7 +105,8 @@ COMMON_SRCS+= catrigl.c \ s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ s_fmaxl.c s_fminl.c s_frexpl.c s_logbl.c s_logl.c s_nanl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ - s_scalbnl.c s_sinl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c + s_scalbnl.c s_sinl.c s_sincosl.c \ + s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c .endif # C99 complex functions @@ -137,7 +139,8 @@ MAN= acos.3 acosh.3 asin.3 asinh.3 atan. fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \ lgamma.3 log.3 lrint.3 lround.3 math.3 nan.3 \ nextafter.3 remainder.3 rint.3 \ - round.3 scalbn.3 signbit.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 \ + round.3 scalbn.3 signbit.3 sin.3 sincos.3 \ + sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 \ complex.3 MLINKS+=acos.3 acosf.3 acos.3 acosl.3 @@ -215,6 +218,7 @@ MLINKS+=round.3 roundf.3 round.3 roundl. MLINKS+=scalbn.3 scalbln.3 scalbn.3 scalblnf.3 scalbn.3 scalblnl.3 MLINKS+=scalbn.3 scalbnf.3 scalbn.3 scalbnl.3 MLINKS+=sin.3 sinf.3 sin.3 sinl.3 +MLINKS+=sincos.3 sincosf.3 sin.3 sincosl.3 MLINKS+=sinh.3 sinhf.3 sinh.3 sinhl.3 MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3 sqrt.3 sqrtf.3 \ sqrt.3 sqrtl.3 Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Sun May 28 05:31:18 2017 (r319046) +++ head/lib/msun/Symbol.map Sun May 28 06:13:38 2017 (r319047) @@ -294,4 +294,7 @@ FBSD_1.5 { casinl; catanl; catanhl; + sincos; + sincosf; + sincosl; }; Added: head/lib/msun/man/sincos.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/man/sincos.3 Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,82 @@ +.\" Copyright (c) 2011 Steven G. Kargl. +.\" +.\" 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$ +.\" +.Dd March 12, 2011 +.Dt SINCOS 3 +.Os +.Sh NAME +.Nm sincos , +.Nm sincosf , +.Nm sincosl +.Nd sine and cosine functions +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In math.h +.Ft void +.Fn sincos "double x" "double *s" "double *c" +.Ft void +.Fn sincosf "float x" "float *s" "float *c" +.Ft void +.Fn sincosl "long double x" "long double *s" "long double *c" +.Sh DESCRIPTION +The +.Fn sincos , +.Fn sincosf , +and +.Fn sincosl +functions compute the sine and cosine of +.Fa x . +Using these functions allows argument reduction to occur only +once instead of twice with individual invocations of +.Fn sin +and +.Fn cos . +Like +.Fn sin +and +.Fn cos , +a large magnitude argument may yield a result with little +or no significance. +.Sh RETURN VALUES +Upon returning from +.Fn sincos , +.Fn sincosf , +and +.Fn sincosl , +the memory pointed to by +.Ar "*s" +and +.Ar "*c" +are assigned the values of sine and cosine, respectively. +.Sh SEE ALSO +.Xr cos 3 , +.Xr sin 3 , +.Sh HISTORY +These functions were added to +.Fx 9.0 +to aid in writing various complex function contained in +.St -isoC-99 . + Added: head/lib/msun/src/k_sincos.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/k_sincos.h Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,52 @@ +/*- + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + * k_sin.c and k_cos.c merged by Steven G. Kargl. + */ + +#include +__FBSDID("$FreeBSD$"); + +static const double +S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ +S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */ +S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */ +S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ +S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */ +S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */ + +static const double +C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ +C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */ +C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */ +C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ +C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ +C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ + +static inline void +__kernel_sincos(double x, double y, int iy, double *sn, double *cs) +{ + double hz, r, v, w, z; + + z = x * x; + w = z * z; + r = S2 + z * (S3 + z * S4) + z * w * (S5 + z * S6); + v = z * x; + + if (iy == 0) + *sn = x + v * (S1 + z * r); + else + *sn = x - ((z * (y / 2 - v * r) - y) - v * S1); + + r = z * (C1 + z * (C2 + z * C3)) + w * w * (C4 + z * (C5 + z * C6)); + hz = z / 2; + w = 1 - hz; + *cs = w + (((1 - w) - hz) + (z * r - x * y)); +} Added: head/lib/msun/src/k_sincosf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/k_sincosf.h Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,43 @@ +/*- + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + * k_sinf.c and k_cosf.c merged by Steven G. Kargl. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */ +static const double +S1 = -0x15555554cbac77.0p-55, /* -0.166666666416265235595 */ +S2 = 0x111110896efbb2.0p-59, /* 0.0083333293858894631756 */ +S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */ +S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ + +/* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */ +static const double +C0 = -0x1ffffffd0c5e81.0p-54, /* -0.499999997251031003120 */ +C1 = 0x155553e1053a42.0p-57, /* 0.0416666233237390631894 */ +C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */ +C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ + +static inline void +__kernel_sincosdf(double x, float *sn, float *cs) +{ + double r, s, w, z; + + z = x * x; + w = z * z; + r = S3 + z * S4; + s = z * x; + *sn = (x + s * (S1 + z * S2)) + s * w * r; + r = C2 + z * C3; + *cs = ((1 + z * C0) + w * C1) + (w * z) * r; +} Added: head/lib/msun/src/k_sincosl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/k_sincosl.h Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,134 @@ +/*- + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + * k_sinl.c and k_cosl.c merged by Steven G. Kargl + */ + +#include +__FBSDID("$FreeBSD$"); + +#if LDBL_MANT_DIG == 64 /* ld80 version of k_sincosl.c. */ + +#if defined(__amd64__) || defined(__i386__) +/* Long double constants are slow on these arches, and broken on i386. */ +static const volatile double +C1hi = 0.041666666666666664, /* 0x15555555555555.0p-57 */ +C1lo = 2.2598839032744733e-18, /* 0x14d80000000000.0p-111 */ +S1hi = -0.16666666666666666, /* -0x15555555555555.0p-55 */ +S1lo = -9.2563760475949941e-18; /* -0x15580000000000.0p-109 */ +#define S1 ((long double)S1hi + S1lo) +#define C1 ((long double)C1hi + C1lo) +#else +static const long double +C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */ +S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */ +#endif + +static const double +C2 = -0.0013888888888888874, /* -0x16c16c16c16c10.0p-62 */ +C3 = 0.000024801587301571716, /* 0x1a01a01a018e22.0p-68 */ +C4 = -0.00000027557319215507120, /* -0x127e4fb7602f22.0p-74 */ +C5 = 0.0000000020876754400407278, /* 0x11eed8caaeccf1.0p-81 */ +C6 = -1.1470297442401303e-11, /* -0x19393412bd1529.0p-89 */ +C7 = 4.7383039476436467e-14, /* 0x1aac9d9af5c43e.0p-97 */ +S2 = 0.0083333333333333332, /* 0x11111111111111.0p-59 */ +S3 = -0.00019841269841269427, /* -0x1a01a01a019f81.0p-65 */ +S4 = 0.0000027557319223597490, /* 0x171de3a55560f7.0p-71 */ +S5 = -0.000000025052108218074604, /* -0x1ae64564f16cad.0p-78 */ +S6 = 1.6059006598854211e-10, /* 0x161242b90243b5.0p-85 */ +S7 = -7.6429779983024564e-13, /* -0x1ae42ebd1b2e00.0p-93 */ +S8 = 2.6174587166648325e-15; /* 0x179372ea0b3f64.0p-101 */ + +static inline void +__kernel_sincosl(long double x, long double y, int iy, long double *sn, + long double *cs) +{ + long double hz, r, v, w, z; + + z = x * x; + v = z * x; + /* + * XXX Replace Horner scheme with an algorithm suitable for CPUs + * with more complex pipelines. + */ + r = S2 + z * (S3 + z * (S4 + z * (S5 + z * (S6 + z * (S7 + z * S8))))); + + if (iy == 0) + *sn = x + v * (S1 + z * r); + else + *sn = x - ((z * (y / 2 - v * r) - y) - v * S1); + + hz = z / 2; + w = 1 - hz; + r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * (C6 + + z * C7)))))); + *cs = w + (((1 - w) - hz) + (z * r - x * y)); +} + +#elif LDBL_MANT_DIG == 113 /* ld128 version of k_sincosl.c. */ + +static const long double +C1 = 0.04166666666666666666666666666666658424671L, +C2 = -0.001388888888888888888888888888863490893732L, +C3 = 0.00002480158730158730158730158600795304914210L, +C4 = -0.2755731922398589065255474947078934284324e-6L, +C5 = 0.2087675698786809897659225313136400793948e-8L, +C6 = -0.1147074559772972315817149986812031204775e-10L, +C7 = 0.4779477332386808976875457937252120293400e-13L, +S1 = -0.16666666666666666666666666666666666606732416116558L, +S2 = 0.0083333333333333333333333333333331135404851288270047L, +S3 = -0.00019841269841269841269841269839935785325638310428717L, +S4 = 0.27557319223985890652557316053039946268333231205686e-5L, +S5 = -0.25052108385441718775048214826384312253862930064745e-7L, +S6 = 0.16059043836821614596571832194524392581082444805729e-9L, +S7 = -0.76471637318198151807063387954939213287488216303768e-12L, +S8 = 0.28114572543451292625024967174638477283187397621303e-14L; + +static const double +C8 = -0.1561920696721507929516718307820958119868e-15, +C9 = 0.4110317413744594971475941557607804508039e-18, +C10 = -0.8896592467191938803288521958313920156409e-21, +C11 = 0.1601061435794535138244346256065192782581e-23, +S9 = -0.82206352458348947812512122163446202498005154296863e-17, +S10 = 0.19572940011906109418080609928334380560135358385256e-19, +S11 = -0.38680813379701966970673724299207480965452616911420e-22, +S12 = 0.64038150078671872796678569586315881020659912139412e-25; + +static inline void +__kernel_sincosl(long double x, long double y, int iy, long double *sn, + long double *cs) +{ + long double hz, r, v, w, z; + + z = x * x; + v = z * x; + /* + * XXX Replace Horner scheme with an algorithm suitable for CPUs + * with more complex pipelines. + */ + r = S2 + z * (S3 + z * (S4 + z * (S5 + z * (S6 + z * (S7 + z * (S8 + + z * (S9 + z * (S10 + z * (S11 + z * S12))))))))); + + if (iy == 0) + *sn = x + v * (S1 + z * r); + else + *cs = x - ((z * (y / 2 - v * r) - y) - v * S1); + + hz = z / 2; + w = 1 - hz; + r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * (C6 + + z * (C7 + z * (C8 + z * (C9 + z * (C10 + z * C11)))))))))); + + *cs = w + (((1 - w) - hz) + (z * r - x * y)); +} +#else +#error "Unsupported long double format" +#endif Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sun May 28 05:31:18 2017 (r319046) +++ head/lib/msun/src/math.h Sun May 28 06:13:38 2017 (r319047) @@ -500,6 +500,9 @@ long double truncl(long double); #if __BSD_VISIBLE long double lgammal_r(long double, int *); +void sincos(double, double *, double *); +void sincosf(float, float *, float *); +void sincosl(long double, long double *, long double *); #endif __END_DECLS Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sun May 28 05:31:18 2017 (r319046) +++ head/lib/msun/src/math_private.h Sun May 28 06:13:38 2017 (r319047) @@ -306,9 +306,21 @@ do { \ fpsetprec(__oprec); \ RETURNF(__retval); \ } while (0) +#define ENTERV() \ + fp_prec_t __oprec; \ + \ + if ((__oprec = fpgetprec()) != FP_PE) \ + fpsetprec(FP_PE) +#define RETURNV() do { \ + if (__oprec != FP_PE) \ + fpsetprec(__oprec); \ + return; \ +} while (0) #else -#define ENTERI(x) +#define ENTERI() #define RETURNI(x) RETURNF(x) +#define ENTERV() +#define RETURNV() return #endif /* Default return statement if hack*_t() is not used. */ Added: head/lib/msun/src/s_sincos.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_sincos.c Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,80 @@ +/*- + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + * s_sin.c and s_cos.c merged by Steven G. Kargl. Descriptions of the + * algorithms are contained in the original files. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "math.h" +#define INLINE_REM_PIO2 +#include "math_private.h" +#include "e_rem_pio2.c" +#include "k_sincos.h" + +void +sincos(double x, double *sn, double *cs) +{ + double y[2]; + int32_t n, ix; + + /* High word of x. */ + GET_HIGH_WORD(ix, x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if (ix <= 0x3fe921fb) { + if (ix < 0x3e400000) { /* |x| < 2**-27 */ + if ((int)x == 0) { /* Generate inexact. */ + *sn = x; + *cs = 1; + return; + } + } + __kernel_sincos(x, 0, 0, sn, cs); + return; + } + + /* If x = Inf or NaN, then sin(x) = NaN and cos(x) = NaN. */ + if (ix >= 0x7ff00000) { + *sn = x - x; + *cs = x - x; + return; + } + + /* Argument reduction. */ + n = __ieee754_rem_pio2(x, y); + + switch(n & 3) { + case 0: + __kernel_sincos(y[0], y[1], 1, sn, cs); + break; + case 1: + __kernel_sincos(y[0], y[1], 1, cs, sn); + *cs = -*cs; + break; + case 2: + __kernel_sincos(y[0], y[1], 1, sn, cs); + *sn = -*sn; + *cs = -*cs; + break; + default: + __kernel_sincos(y[0], y[1], 1, cs, sn); + *sn = -*sn; + } +} + +#if (LDBL_MANT_DIG == 53) +__weak_reference(sincos, sincosl); +#endif Added: head/lib/msun/src/s_sincosf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_sincosf.c Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,126 @@ +/*- + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* s_sincosf.c -- float version of s_sincos.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + * Optimized by Bruce D. Evans. + * Merged s_sinf.c and s_cosf.c by Steven G. Kargl. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "math.h" +#define INLINE_REM_PIO2F +#include "math_private.h" +#include "e_rem_pio2f.c" +#include "k_sincosf.h" + +/* Small multiples of pi/2 rounded to double precision. */ +static const double +p1pio2 = 1*M_PI_2, /* 0x3FF921FB, 0x54442D18 */ +p2pio2 = 2*M_PI_2, /* 0x400921FB, 0x54442D18 */ +p3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ +p4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ + +void +sincosf(float x, float *sn, float *cs) +{ + float c, s; + double y; + int32_t n, hx, ix; + + GET_FLOAT_WORD(hx, x); + ix = hx & 0x7fffffff; + + if (ix <= 0x3f490fda) { /* |x| ~<= pi/4 */ + if (ix < 0x39800000) { /* |x| < 2**-12 */ + if ((int)x == 0) { + *sn = x; /* x with inexact if x != 0 */ + *cs = 1; + return; + } + } + __kernel_sincosdf(x, sn, cs); + return; + } + + if (ix <= 0x407b53d1) { /* |x| ~<= 5*pi/4 */ + if (ix <= 0x4016cbe3) { /* |x| ~<= 3pi/4 */ + if (hx > 0) { + __kernel_sincosdf(x - p1pio2, cs, sn); + *cs = -*cs; + } else { + __kernel_sincosdf(x + p1pio2, cs, sn); + *sn = -*sn; + } + } else { + if (hx > 0) + __kernel_sincosdf(x - p2pio2, sn, cs); + else + __kernel_sincosdf(x + p2pio2, sn, cs); + *sn = -*sn; + *cs = -*cs; + } + return; + } + + if (ix <= 0x40e231d5) { /* |x| ~<= 9*pi/4 */ + if (ix <= 0x40afeddf) { /* |x| ~<= 7*pi/4 */ + if (hx > 0) { + __kernel_sincosdf(x - p3pio2, cs, sn); + *sn = -*sn; + } else { + __kernel_sincosdf(x + p3pio2, cs, sn); + *cs = -*cs; + } + } else { + if (hx > 0) + __kernel_sincosdf(x - p4pio2, sn, cs); + else + __kernel_sincosdf(x + p4pio2, sn, cs); + } + return; + } + + /* If x = Inf or NaN, then sin(x) = NaN and cos(x) = NaN. */ + if (ix >= 0x7f800000) { + *sn = x - x; + *cs = x - x; + return; + } + + /* Argument reduction. */ + n = __ieee754_rem_pio2f(x, &y); + __kernel_sincosdf(y, &s, &c); + + switch(n & 3) { + case 0: + *sn = s; + *cs = c; + break; + case 1: + *sn = c; + *cs = -s; + break; + case 2: + *sn = -s; + *cs = -c; + break; + default: + *sn = -c; + *cs = s; + } +} + + Added: head/lib/msun/src/s_sincosl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_sincosl.c Sun May 28 06:13:38 2017 (r319047) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2007, 2010-2013 Steven G. Kargl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * s_sinl.c and s_cosl.c merged by Steven G. Kargl. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#ifdef __i386__ +#include +#endif + +#include "math.h" +#include "math_private.h" +#include "k_sincosl.h" + +#if LDBL_MANT_DIG == 64 +#include "../ld80/e_rem_pio2l.h" +#elif LDBL_MANT_DIG == 113 +#include "../ld128/e_rem_pio2l.h" +#else +#error "Unsupported long double format" +#endif + +void +sincosl(long double x, long double *sn, long double *cs) +{ + union IEEEl2bits z; + int e0, sgn; + long double y[2]; + + z.e = x; + sgn = z.bits.sign; + z.bits.sign = 0; + + ENTERV(); + + /* Optimize the case where x is already within range. */ + if (z.e < M_PI_4) { + /* + * If x = +-0 or x is a subnormal number, then sin(x) = x and + * cos(x) = 1. + */ + if (z.bits.exp == 0) { + *sn = x; + *cs = 1; + } else + __kernel_sincosl(x, 0, 0, sn, cs); + RETURNV(); + } + + /* If x = NaN or Inf, then sin(x) and cos(x) are NaN. */ + if (z.bits.exp == 32767) { + *sn = x - x; + *cs = x - x; + RETURNV(); + } + + /* Range reduction. */ + e0 = __ieee754_rem_pio2l(x, y); + + switch (e0 & 3) { + case 0: + __kernel_sincosl(y[0], y[1], 1, sn, cs); + break; + case 1: + __kernel_sincosl(y[0], y[1], 1, cs, sn); + *cs = -*cs; + break; + case 2: + __kernel_sincosl(y[0], y[1], 1, sn, cs); + *sn = -*sn; + *cs = -*cs; + break; + default: + __kernel_sincosl(y[0], y[1], 1, cs, sn); + *sn = -*sn; + } + + RETURNV(); +} From owner-svn-src-head@freebsd.org Sun May 28 06:26:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0594BD857B0; Sun, 28 May 2017 06:26: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 BB5C21C78; Sun, 28 May 2017 06:26:44 +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 v4S6QhKF038766; Sun, 28 May 2017 06:26:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S6QhcP038764; Sun, 28 May 2017 06:26:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280626.v4S6QhcP038764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 06:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319048 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 06:26:45 -0000 Author: ngie Date: Sun May 28 06:26:43 2017 New Revision: 319048 URL: https://svnweb.freebsd.org/changeset/base/319048 Log: Push `snapshot_file` copying down into run_tests function, and mark snapshot_file const char *. This fixes a bogus set of errors from gcc about strdup not being allowed a NULL argument. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getaddrinfo_test.c head/lib/libc/tests/nss/gethostby_test.c Modified: head/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 06:13:38 2017 (r319047) +++ head/lib/libc/tests/nss/getaddrinfo_test.c Sun May 28 06:26:43 2017 (r319048) @@ -410,11 +410,19 @@ addrinfo_read_hostlist_func(struct addri } static void -run_tests(char *hostlist_file, char *snapshot_file, int ai_family) +run_tests(char *hostlist_file, const char *snapshot_file, int ai_family) { struct addrinfo_test_data td, td_snap; + char *snapshot_file_copy; int rv; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = ai_family; hints.ai_flags = AI_CANONNAME; @@ -477,24 +485,17 @@ fin: TEST_DATA_DESTROY(addrinfo, &td_snap); TEST_DATA_DESTROY(addrinfo, &td); - free(hostlist_file); - free(snapshot_file); + free(snapshot_file_copy); } #define HOSTLIST_FILE "mach" #define RUN_TESTS(tc, snapshot_file, ai_family) do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - run_tests(_hostlist_file, _snapshot_file, ai_family); \ -} while(0) + run_tests(_hostlist_file, snapshot_file, ai_family); \ + free(_hostlist_file); \ +} while (0) ATF_TC_WITHOUT_HEAD(pf_unspec); ATF_TC_BODY(pf_unspec, tc) Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Sun May 28 06:13:38 2017 (r319047) +++ head/lib/libc/tests/nss/gethostby_test.c Sun May 28 06:26:43 2017 (r319048) @@ -924,10 +924,19 @@ static int run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type, enum test_methods method, bool use_ipv6_mapping) { + char *snapshot_file_copy; struct hostent_test_data td, td_addr, td_snap; res_state statp; int rv = -2; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + snapshot_file = snapshot_file_copy; + switch (_af_type) { case AF_INET: ATF_REQUIRE_FEATURE("inet"); @@ -946,8 +955,8 @@ run_tests(const char *hostlist_file, con if (statp == NULL || ((statp->options & RES_INIT) == 0 && res_ninit(statp) == -1)) { printf("error: can't init res_state\n"); - - return (-1); + rv = -1; + goto fin2; } if (use_ipv6_mapping) @@ -1051,6 +1060,9 @@ fin: TEST_DATA_DESTROY(hostent, &td_addr); TEST_DATA_DESTROY(hostent, &td); +fin2: + free(snapshot_file_copy); + return (rv); } @@ -1059,30 +1071,24 @@ fin: #define _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - ATF_REQUIRE(run_tests(_hostlist_file, _snapshot_file, af_type, \ + ATF_REQUIRE(run_tests(_hostlist_file, snapshot_file, af_type, \ method, use_ipv6_mapping) == 0); \ -} while(0) + free(_hostlist_file); \ +} while (0) #define RUN_HOST_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = false; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) #define RUN_IPNODE_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = true; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) ATF_TC_WITHOUT_HEAD(gethostbyaddr_ipv4); ATF_TC_BODY(gethostbyaddr_ipv4, tc) From owner-svn-src-head@freebsd.org Sun May 28 06:29:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81921D8586F; Sun, 28 May 2017 06:29:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53C6D1DE9; Sun, 28 May 2017 06:29:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S6T1os038889; Sun, 28 May 2017 06:29:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S6T18b038888; Sun, 28 May 2017 06:29:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280629.v4S6T18b038888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 06:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319049 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 06:29:02 -0000 Author: ngie Date: Sun May 28 06:29:01 2017 New Revision: 319049 URL: https://svnweb.freebsd.org/changeset/base/319049 Log: Bump WARNS from 1 to 3 after recent commits to fix warnings in the directory. Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0 MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/Makefile Modified: head/lib/libc/tests/nss/Makefile ============================================================================== --- head/lib/libc/tests/nss/Makefile Sun May 28 06:26:43 2017 (r319048) +++ head/lib/libc/tests/nss/Makefile Sun May 28 06:29:01 2017 (r319049) @@ -20,7 +20,7 @@ ATF_TESTS_C+= getusershell_test ${PACKAGE}FILES+= mach -WARNS?= 1 +WARNS?= 3 CFLAGS+= -I${SRCTOP}/tests From owner-svn-src-head@freebsd.org Sun May 28 07:04:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33C98D852A0; Sun, 28 May 2017 07:04:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 041BB10DE; Sun, 28 May 2017 07:04:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S74p2e055023; Sun, 28 May 2017 07:04:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S74pS7055022; Sun, 28 May 2017 07:04:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280704.v4S74pS7055022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 07:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319051 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 07:04:52 -0000 Author: ngie Date: Sun May 28 07:04:50 2017 New Revision: 319051 URL: https://svnweb.freebsd.org/changeset/base/319051 Log: hostent_test_getnameinfo_eq(..): initialize found_a_host to false MFC after: 1 week Reported by: Coverity CID: 1368943 Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/gethostby_test.c Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Sun May 28 06:31:52 2017 (r319050) +++ head/lib/libc/tests/nss/gethostby_test.c Sun May 28 07:04:50 2017 (r319051) @@ -884,7 +884,7 @@ hostent_test_getnameinfo_eq(struct hoste * An address might reverse resolve to hostname alias or the * official hostname, e.g. moon.vub.ac.be. */ - bool found_a_match; + bool found_a_match = false; if (strcmp(result->h_name, buffer) == 0) { found_a_match = true; From owner-svn-src-head@freebsd.org Sun May 28 07:37:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA9B7D85969; Sun, 28 May 2017 07:37:41 +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 6DC672000; Sun, 28 May 2017 07:37:41 +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 v4S7be4R067586; Sun, 28 May 2017 07:37:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S7beb3067584; Sun, 28 May 2017 07:37:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201705280737.v4S7beb3067584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 May 2017 07:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319052 - in head/sys/modules: linux linux64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 07:37:41 -0000 Author: dchagin Date: Sun May 28 07:37:40 2017 New Revision: 319052 URL: https://svnweb.freebsd.org/changeset/base/319052 Log: Strip _binary_linux_locore_o_size from ${VDSO}.so as it is a low absolute symbol, and this breaks symbol lookup in ddb. Requested by: bde@ MFC after: 1 week Modified: head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Sun May 28 07:04:50 2017 (r319051) +++ head/sys/modules/linux/Makefile Sun May 28 07:37:40 2017 (r319052) @@ -64,10 +64,12 @@ linux${SFX}_support.o: linux${SFX}_assym ${VDSO}.so: linux${SFX}_locore.o ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET} + strip -N _binary_linux${SFX}_locore_o_size ${.TARGET} .else ${VDSO}.so: linux${SFX}_locore.o ${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd \ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET} + strip -N _binary_linux_locore_o_size ${.TARGET} .endif linux${SFX}_genassym.o: Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Sun May 28 07:04:50 2017 (r319051) +++ head/sys/modules/linux64/Makefile Sun May 28 07:37:40 2017 (r319052) @@ -38,6 +38,7 @@ linux_locore.o: linux_locore.s linux_ass ${VDSO}.so: linux_locore.o ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ -S -g --binary-architecture i386:x86-64 linux_locore.o ${.TARGET} + strip -N _binary_linux_locore_o_size ${.TARGET} linux_support.o: assym.s linux_assym.h ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ From owner-svn-src-head@freebsd.org Sun May 28 07:40:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64BDFD85A03; Sun, 28 May 2017 07:40:11 +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 404ED1C4; Sun, 28 May 2017 07:40:11 +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 v4S7eAYt067742; Sun, 28 May 2017 07:40:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S7e9B1067738; Sun, 28 May 2017 07:40:09 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201705280740.v4S7e9B1067738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 May 2017 07:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319053 - in head/sys: compat/linux conf modules/linux modules/linux64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 07:40:11 -0000 Author: dchagin Date: Sun May 28 07:40:09 2017 New Revision: 319053 URL: https://svnweb.freebsd.org/changeset/base/319053 Log: On success, getrandom() Linux system call returns the number of bytes that were copied to the buffer supplied by the user. Also fix getrandom() if Linuxulator modules are built without the kernel. PR: 219464 Submitted by: Maciej Pasternacki Reported by: Maciej Pasternacki MFC after: 1 week Modified: head/sys/compat/linux/linux_misc.c head/sys/conf/config.mk head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun May 28 07:37:40 2017 (r319052) +++ head/sys/compat/linux/linux_misc.c Sun May 28 07:40:09 2017 (r319053) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#if defined(KLD_MODULE) +#include "opt_global.h" +#endif #include #include @@ -2516,6 +2519,7 @@ linux_getrandom(struct thread *td, struc { struct uio uio; struct iovec iov; + int error; if (args->flags & ~(LINUX_GRND_NONBLOCK|LINUX_GRND_RANDOM)) return (EINVAL); @@ -2532,7 +2536,10 @@ linux_getrandom(struct thread *td, struc uio.uio_rw = UIO_READ; uio.uio_td = td; - return (read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK)); + error = read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK); + if (error == 0) + td->td_retval[0] = args->count - uio.uio_resid; + return (error); } int Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Sun May 28 07:37:40 2017 (r319052) +++ head/sys/conf/config.mk Sun May 28 07:40:09 2017 (r319053) @@ -8,6 +8,8 @@ # the code here when they all produce identical results # (or should) .if !defined(KERNBUILDDIR) +opt_global.h: + echo "#define DEV_RANDOM 1" >> ${.TARGET} opt_bpf.h: echo "#define DEV_BPF 1" > ${.TARGET} .if ${MK_INET_SUPPORT} != "no" Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Sun May 28 07:37:40 2017 (r319052) +++ head/sys/modules/linux/Makefile Sun May 28 07:40:09 2017 (r319053) @@ -15,7 +15,7 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l linux${SFX}_machdep.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_time.c \ - linux_timer.c linux_vdso.c \ + linux_timer.c linux_vdso.c opt_global.h \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ device_if.h bus_if.h assym.s \ linux${SFX}_support.s Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Sun May 28 07:37:40 2017 (r319052) +++ head/sys/modules/linux64/Makefile Sun May 28 07:40:09 2017 (r319053) @@ -10,7 +10,7 @@ SRCS= linux_fork.c linux_dummy.c linux_f linux_machdep.c linux_misc.c linux_ptrace.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \ - opt_inet6.h opt_compat.h opt_posix.h opt_usb.h \ + opt_inet6.h opt_compat.h opt_global.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h assym.s \ linux_support.s DPSRCS= linux_genassym.c From owner-svn-src-head@freebsd.org Sun May 28 07:40:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D91FBD85B3F; Sun, 28 May 2017 07:40:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB5D63C2; Sun, 28 May 2017 07:40:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S7egGl067818; Sun, 28 May 2017 07:40:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S7egsx067817; Sun, 28 May 2017 07:40:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280740.v4S7egsx067817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 07:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319054 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 07:40:44 -0000 Author: ngie Date: Sun May 28 07:40:42 2017 New Revision: 319054 URL: https://svnweb.freebsd.org/changeset/base/319054 Log: hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done This plugs a leak of memory allocated via getaddrinfo. MFC after: 1 week Reported by: Coverity CID: 1346866 Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/gethostby_test.c Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Sun May 28 07:40:09 2017 (r319053) +++ head/lib/libc/tests/nss/gethostby_test.c Sun May 28 07:40:42 2017 (r319054) @@ -776,24 +776,26 @@ hostent_test_getaddrinfo_eq(struct hoste rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv == 0) { printf("not ok - shouldn't have been resolved\n"); - return (-1); - } + rv = -1; + } else + rv = 0; } else { rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv != 0) { printf("not ok - should have been resolved\n"); - return (-1); + rv = -1; + goto done; } - rv = is_hostent_equal(he, ai); if (rv != 0) { printf("not ok - addrinfo and hostent are not equal\n"); - return (-1); + rv = -1; } - } - - return (0); +done: + if (ai != NULL) + freeaddrinfo(ai); + return (rv); } static int From owner-svn-src-head@freebsd.org Sun May 28 07:44:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF433D85EC6; Sun, 28 May 2017 07:44:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F988AD0; Sun, 28 May 2017 07:44:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S7itLG071689; Sun, 28 May 2017 07:44:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S7it5j071688; Sun, 28 May 2017 07:44:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705280744.v4S7it5j071688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 May 2017 07:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319055 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 07:44:56 -0000 Author: adrian Date: Sun May 28 07:44:55 2017 New Revision: 319055 URL: https://svnweb.freebsd.org/changeset/base/319055 Log: [ar71xx] undo read-after-write to flush; some bus devices dislike this. This broke the PCI fixup on at least the AR7240 + AR9280 reference design board that I have. Tested: * Atheros AP93 reference design - AR7240 + AR9280 Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Sun May 28 07:40:42 2017 (r319054) +++ head/sys/mips/atheros/ar71xxreg.h Sun May 28 07:44:55 2017 (r319055) @@ -528,13 +528,14 @@ typedef enum { #define AR71XX_SPI_RDS 0x0C #define ATH_READ_REG(reg) \ - *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) - + *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) +/* + * Note: Don't put a flush read here; some users (eg the AR724x PCI fixup code) + * requires write-only space to certain registers. Doing the read afterwards + * causes things to break. + */ #define ATH_WRITE_REG(reg, val) \ - do { \ - *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val); \ - (void) ATH_READ_REG(reg); \ - } while (0) + *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val) static inline void ar71xx_ddr_flush(uint32_t reg) From owner-svn-src-head@freebsd.org Sun May 28 07:46:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44992D85F65; Sun, 28 May 2017 07:46:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 0FB51C44; Sun, 28 May 2017 07:45:59 +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 mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 9E07910555A; Sun, 28 May 2017 17:45:52 +1000 (AEST) Date: Sun, 28 May 2017 17:45:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dmitry Chagin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319052 - in head/sys/modules: linux linux64 In-Reply-To: <201705280737.v4S7beb3067584@repo.freebsd.org> Message-ID: <20170528174051.C1396@besplex.bde.org> References: <201705280737.v4S7beb3067584@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=pBE7GHsQ8FWS9r3ezFEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 07:46:00 -0000 On Sun, 28 May 2017, Dmitry Chagin wrote: > Log: > Strip _binary_linux_locore_o_size from ${VDSO}.so as it is a low absolute > symbol, and this breaks symbol lookup in ddb. > > Requested by: bde@ Thanks. This works because the symbol is auto-generated by the linker from the name of a file and not used at the source level or useful at the object level. Bruce From owner-svn-src-head@freebsd.org Sun May 28 08:46:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F9D8D7B2FB; Sun, 28 May 2017 08:46:42 +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 431C1BC2; Sun, 28 May 2017 08:46:42 +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 v4S8kfdN096301; Sun, 28 May 2017 08:46:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S8kfhk096300; Sun, 28 May 2017 08:46:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280846.v4S8kfhk096300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 08:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319056 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 08:46:42 -0000 Author: ngie Date: Sun May 28 08:46:41 2017 New Revision: 319056 URL: https://svnweb.freebsd.org/changeset/base/319056 Log: tests/sys/file/ftruncate_test: use an exit code of 1 instead of -1 with err*(3). An exit code of -1 is implementation defined -- it's best to stick with something well-defined (1). MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/ftruncate_test.c Modified: head/tests/sys/file/ftruncate_test.c ============================================================================== --- head/tests/sys/file/ftruncate_test.c Sun May 28 07:44:55 2017 (r319055) +++ head/tests/sys/file/ftruncate_test.c Sun May 28 08:46:41 2017 (r319056) @@ -78,34 +78,34 @@ main(void) snprintf(path, PATH_MAX, "/tmp/ftruncate.XXXXXXXXXXXXX"); fd = mkstemp(path); if (fd < 0) - err(-1, "mkstemp"); + err(1, "mkstemp"); read_only_fd = open(path, O_RDONLY); if (read_only_fd < 0) { error = errno; (void)unlink(path); errno = error; - err(-1, "open(%s, O_RDONLY)", path); + err(1, "open(%s, O_RDONLY)", path); } (void)unlink(path); if (ftruncate(fd, -1) == 0) - errx(-1, "ftruncate(fd, -1) succeeded"); + errx(1, "ftruncate(fd, -1) succeeded unexpectedly"); if (errno != EINVAL) - err(-1, "ftruncate(fd, -1) returned wrong error"); + err(1, "ftruncate(fd, -1) returned wrong error"); for (i = 0; i < lengths_count; i++) { len = lengths[i]; if (ftruncate(fd, len) < 0) - err(-1, "ftruncate(%jd) up", (intmax_t)len); + err(1, "ftruncate(%jd) up", (intmax_t)len); if (fstat(fd, &sb) < 0) - err(-1, "stat"); + err(1, "stat"); if (sb.st_size != len) errx(-1, "fstat with len=%jd returned len %jd up", (intmax_t)len, (intmax_t)sb.st_size); if (len != 0) { size = pread(fd, &ch, sizeof(ch), len - 1); if (size < 0) - err(-1, "pread on len %jd up", (intmax_t)len); + err(1, "pread on len %jd up", (intmax_t)len); if (size != sizeof(ch)) errx(-1, "pread len %jd size %jd up", (intmax_t)len, (intmax_t)size); @@ -119,9 +119,9 @@ main(void) for (i = lengths_count - 1; i >= 0; i--) { len = lengths[i]; if (ftruncate(fd, len) < 0) - err(-1, "ftruncate(%jd) down", (intmax_t)len); + err(1, "ftruncate(%jd) down", (intmax_t)len); if (fstat(fd, &sb) < 0) - err(-1, "stat"); + err(1, "stat"); if (sb.st_size != len) errx(-1, "fstat(%jd) returned %jd down", (intmax_t)len, sb.st_size); @@ -134,7 +134,7 @@ main(void) if (ftruncate(read_only_fd, 0) == 0) errx(-1, "ftruncate(read_only_fd) succeeded"); if (errno != EINVAL) - err(-1, "ftruncate(read_only_fd) returned wrong error"); + err(1, "ftruncate(read_only_fd) returned wrong error"); close(read_only_fd); /* @@ -142,22 +142,22 @@ main(void) */ fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) - err(-1, "socket(PF_UNIX, SOCK_STREAM, 0)"); + err(1, "socket(PF_UNIX, SOCK_STREAM, 0)"); if (ftruncate(fd, 0) == 0) errx(-1, "ftruncate(socket) succeeded"); if (errno != EINVAL) - err(-1, "ftruncate(socket) returned wrong error"); + err(1, "ftruncate(socket) returned wrong error"); close(fd); /* * Make sure that ftruncate on pipes doesn't work. */ if (pipe(fds) < 0) - err(-1, "pipe"); + err(1, "pipe"); if (ftruncate(fds[0], 0) == 0) errx(-1, "ftruncate(pipe) succeeded"); if (errno != EINVAL) - err(-1, "ftruncate(pipe) returned wrong error"); + err(1, "ftruncate(pipe) returned wrong error"); close(fds[0]); close(fds[1]); @@ -166,11 +166,11 @@ main(void) */ fd = kqueue(); if (fd < 0) - err(-1, "kqueue"); + err(1, "kqueue"); if (ftruncate(fds[0], 0) == 0) errx(-1, "ftruncate(kqueue) succeeded"); if (errno != EINVAL) - err(-1, "ftruncate(kqueue) returned wrong error"); + err(1, "ftruncate(kqueue) returned wrong error"); close(fd); return (0); From owner-svn-src-head@freebsd.org Sun May 28 08:46:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A687D7B354; Sun, 28 May 2017 08:46:59 +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 CB3B4CE6; Sun, 28 May 2017 08:46:58 +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 v4S8kv0s096360; Sun, 28 May 2017 08:46:57 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S8kvYF096359; Sun, 28 May 2017 08:46:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201705280846.v4S8kvYF096359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 May 2017 08:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319057 - head/sys/amd64/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 08:46:59 -0000 Author: dchagin Date: Sun May 28 08:46:57 2017 New Revision: 319057 URL: https://svnweb.freebsd.org/changeset/base/319057 Log: In r246085 some bits that are MI movied out into headers in compat/linux, but I missed that when I commited x86_64 Linuxulator. So remove the duplicates. MFC after: 1 week Modified: head/sys/amd64/linux/linux.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Sun May 28 08:46:41 2017 (r319056) +++ head/sys/amd64/linux/linux.h Sun May 28 08:46:57 2017 (r319057) @@ -101,9 +101,6 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_NAME_MAX 255 -#define LINUX_CTL_MAXNAME 10 - #define LINUX_AT_COUNT 19 /* Count of used aux entry types. */ struct l___sysctl_args @@ -117,11 +114,6 @@ struct l___sysctl_args l_ulong __spare[4]; }; -/* Scheduling policies */ -#define LINUX_SCHED_OTHER 0 -#define LINUX_SCHED_FIFO 1 -#define LINUX_SCHED_RR 2 - /* Resource limits */ #define LINUX_RLIMIT_CPU 0 #define LINUX_RLIMIT_FSIZE 1 @@ -456,20 +448,6 @@ struct l_pollfd { l_short revents; }; - -#define LINUX_CLONE_VM 0x00000100 -#define LINUX_CLONE_FS 0x00000200 -#define LINUX_CLONE_FILES 0x00000400 -#define LINUX_CLONE_SIGHAND 0x00000800 -#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ -#define LINUX_CLONE_VFORK 0x00004000 -#define LINUX_CLONE_PARENT 0x00008000 -#define LINUX_CLONE_THREAD 0x00010000 -#define LINUX_CLONE_SETTLS 0x00080000 -#define LINUX_CLONE_PARENT_SETTID 0x00100000 -#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 -#define LINUX_CLONE_CHILD_SETTID 0x01000000 - #define LINUX_ARCH_SET_GS 0x1001 #define LINUX_ARCH_SET_FS 0x1002 #define LINUX_ARCH_GET_FS 0x1003 From owner-svn-src-head@freebsd.org Sun May 28 08:52:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54AC6D7B752; Sun, 28 May 2017 08:52:14 +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 21536127C; Sun, 28 May 2017 08:52:14 +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 v4S8qD0g000393; Sun, 28 May 2017 08:52:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S8qDrI000392; Sun, 28 May 2017 08:52:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280852.v4S8qDrI000392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 08:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319058 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 08:52:14 -0000 Author: ngie Date: Sun May 28 08:52:12 2017 New Revision: 319058 URL: https://svnweb.freebsd.org/changeset/base/319058 Log: Create a deterministic file in the kyua sandbox, instead of a temporary file outside the kyua sandbox This helps ensure that the file is removed at test exit, and as a side effect, cures a warning about umasks with Coverity. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/ftruncate_test.c Modified: head/tests/sys/file/ftruncate_test.c ============================================================================== --- head/tests/sys/file/ftruncate_test.c Sun May 28 08:46:57 2017 (r319057) +++ head/tests/sys/file/ftruncate_test.c Sun May 28 08:52:12 2017 (r319058) @@ -60,14 +60,14 @@ int main(void) { int error, fd, fds[2], i, read_only_fd; - char path[PATH_MAX]; + char path[] = "ftruncate_file"; struct stat sb; ssize_t size; off_t len; char ch; /* - * Tests using a writable temporary file: grow and then shrink a file + * Tests using a writable file: grow and then shrink a file * using ftruncate and various lengths. Make sure that a negative * file length is rejected. Make sure that when we grow the file, * bytes now in the range of the file size return 0. @@ -75,10 +75,9 @@ main(void) * Save a read-only reference to the file to use later for read-only * descriptor tests. */ - snprintf(path, PATH_MAX, "/tmp/ftruncate.XXXXXXXXXXXXX"); - fd = mkstemp(path); + fd = open(path, O_RDWR|O_CREAT); if (fd < 0) - err(1, "mkstemp"); + err(1, "open(%s, O_RDWR|O_CREAT", path); read_only_fd = open(path, O_RDONLY); if (read_only_fd < 0) { error = errno; From owner-svn-src-head@freebsd.org Sun May 28 08:55:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE940D7B85D; Sun, 28 May 2017 08:55:33 +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 74203148D; Sun, 28 May 2017 08:55:33 +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 v4S8tWmi000562; Sun, 28 May 2017 08:55:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S8tWTt000561; Sun, 28 May 2017 08:55:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280855.v4S8tWTt000561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 08:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319059 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 08:55:33 -0000 Author: ngie Date: Sun May 28 08:55:32 2017 New Revision: 319059 URL: https://svnweb.freebsd.org/changeset/base/319059 Log: Use an exit code of 1 instead of -1 for reasons noted in r319056 MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/newfileops_on_fork_test.c Modified: head/tests/sys/file/newfileops_on_fork_test.c ============================================================================== --- head/tests/sys/file/newfileops_on_fork_test.c Sun May 28 08:52:12 2017 (r319058) +++ head/tests/sys/file/newfileops_on_fork_test.c Sun May 28 08:55:32 2017 (r319059) @@ -61,7 +61,7 @@ do_accept(__unused void *arg) accept_fd = accept(listen_fd, NULL, NULL); if (accept_fd < 0) - err(-1, "accept"); + err(1, "accept"); return (NULL); } @@ -73,7 +73,7 @@ do_fork(void) pid = fork(); if (pid < 0) - err(-1, "fork"); + err(1, "fork"); if (pid > 0) { waitpid(pid, NULL, 0); exit(0); @@ -84,15 +84,15 @@ do_fork(void) * listen_fd+1, and get back EBADF if it's not a valid descriptor, * and EINVAL if it is. This (currently) works fine in practice. */ - if (ftruncate(listen_fd + 1, 0 < 0)) { + if (ftruncate(listen_fd + 1, 0) < 0) { if (errno == EBADF) exit(0); else if (errno == EINVAL) - errx(-1, "file descriptor still open in child"); + errx(1, "file descriptor still open in child"); else - err(-1, "unexpected error"); + err(1, "unexpected error"); } else - errx(-1, "ftruncate succeeded"); + errx(1, "ftruncate succeeded"); } int @@ -103,18 +103,18 @@ main(__unused int argc, __unused char *a listen_fd = socket(PF_INET, SOCK_STREAM, 0); if (listen_fd < 0) - err(-1, "socket"); + err(1, "socket"); bzero(&sin, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); sin.sin_port = htons(PORT); if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "bind"); + err(1, "bind"); if (listen(listen_fd, -1) <0) - err(-1, "listen"); + err(1, "listen"); if (pthread_create(&accept_thread, NULL, do_accept, NULL) != 0) - err(-1, "pthread_create"); + err(1, "pthread_create"); sleep(1); /* Easier than using a CV. */ do_fork(); exit(0); From owner-svn-src-head@freebsd.org Sun May 28 08:57:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 649E1D7B929; Sun, 28 May 2017 08:57:09 +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 36CF61650; Sun, 28 May 2017 08:57:09 +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 v4S8v87m000673; Sun, 28 May 2017 08:57:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S8v8Dr000672; Sun, 28 May 2017 08:57:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280857.v4S8v8Dr000672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 08:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319060 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 08:57:09 -0000 Author: ngie Date: Sun May 28 08:57:08 2017 New Revision: 319060 URL: https://svnweb.freebsd.org/changeset/base/319060 Log: Use main(void) instead of main(argc __unused, argv __unused) MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/newfileops_on_fork_test.c Modified: head/tests/sys/file/newfileops_on_fork_test.c ============================================================================== --- head/tests/sys/file/newfileops_on_fork_test.c Sun May 28 08:55:32 2017 (r319059) +++ head/tests/sys/file/newfileops_on_fork_test.c Sun May 28 08:57:08 2017 (r319060) @@ -96,7 +96,7 @@ do_fork(void) } int -main(__unused int argc, __unused char *argv[]) +main(void) { struct sockaddr_in sin; pthread_t accept_thread; From owner-svn-src-head@freebsd.org Sun May 28 08:59:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9352FD7BA82; Sun, 28 May 2017 08:59:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA781895; Sun, 28 May 2017 08:59:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id h64so3357208pge.3; Sun, 28 May 2017 01:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=EJfBTcRFD37O2Bmhp6gqmQDYMQXfTPpa5+fGbIyqqE0=; b=LK6zJNvF5u7y4s/nLITZH9jz5/KyiiLgfzmz/CPuhY8U7gAE83DixsP2qXDjSwK7e4 dmDopn+sseTAfBj1G/6NpXs5qlQZq6rKu+xOm7UiOxMfOZbMr1s1yJWrwgDKsw3a/CQc p/HKHovMO89J+Y8bqxXwO9aP+hvJjEYFmfhp+S7XxetzzPBfpcolhncxhtbchTQhObJd QH6kSFDtC361TeW9d8eOau/LuXvIiXRlLZvw9d36Q/i2JTjnFN17VPieWGUmuI6Q2PcB 0LrEqohtOCL7xkGkMuw9m5Oy2UQUe6VW4Y7uS6oh4VJSC/FsOnY6xsBLHraudU6aCy2N 6g9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=EJfBTcRFD37O2Bmhp6gqmQDYMQXfTPpa5+fGbIyqqE0=; b=VwrH8MkMw+somw/wriIESdTPclDGYDSX2A51vDOKbt+QGQZK7DQJyhG3lPhNfuaxh0 wS6iv/wB31QnxusX0C96tyyrYj/eo1Ol0kOcugyGqj/+9Bl6iDiX/JIC2dD+z34rMiCF IB5JaNvTzMww27MRuf5/C7CWK/d9wsDSKWmnhd7bjkgEvImWpymDWxbuf9L1nVN+zf6t goYoEAomcRovMFEaAMCRDM7PdJzD8XsyRVwktg8na23QqiBBbmPWaP85v/oqy2N2TxJk PRj974iEObf57x8CpMtWrAydIJ0KU4ZNy+j0Je0XDWgFJQtut7lqNOhtX2FBUvD/zDdh SJnw== X-Gm-Message-State: AODbwcDZ3NiioSC13jO9JJqxPy/DFK2IRzRLIusC5Y2ZhkItyJFjBdTd N4XYib+yCBAkRygMTcs= X-Received: by 10.98.157.207 with SMTP id a76mr11701382pfk.17.1495961975736; Sun, 28 May 2017 01:59:35 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id r69sm11672668pfj.42.2017.05.28.01.59.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 May 2017 01:59:35 -0700 (PDT) Subject: Re: svn commit: r319059 - head/tests/sys/file Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5C6AB243-3F65-4001-B15E-7361616440B5"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201705280855.v4S8tWTt000561@repo.freebsd.org> Date: Sun, 28 May 2017 01:59:33 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201705280855.v4S8tWTt000561@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 08:59:36 -0000 --Apple-Mail=_5C6AB243-3F65-4001-B15E-7361616440B5 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On May 28, 2017, at 01:55, Ngie Cooper wrote: > > Author: ngie > Date: Sun May 28 08:55:32 2017 > New Revision: 319059 > URL: https://svnweb.freebsd.org/changeset/base/319059 > > Log: > Use an exit code of 1 instead of -1 for reasons noted in r319056 > > MFC after: 3 days > Sponsored by: Dell EMC Isilon Also: fix an invalid test with ftruncate. Reported by: Coverity CID: 1296041 --Apple-Mail=_5C6AB243-3F65-4001-B15E-7361616440B5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZKpF2AAoJEPWDqSZpMIYVIx4P/iaOMDuDV3RmhGTQSkk3PuF1 yX0if4yJu56XFC2I3qIszLLwwvwarqeYPN6KvWsDrqZh5iWwNolqgp3n8WH1+Il3 vYa41f+vousqy7+6wQsueuDpOItqmf2IRdTs7jO7QEK3BTkmzrohJLKNBuH6D1i/ hfnL/WAYhBYm9DZ/d5kfmHfnQqWqPMLcsUcaMQ12vFQcYGEnWOwVemqxoZARGNHc 7LsNcXcq8A4agQHuvrHRnLzRLjTe81im+oaMQOuvmZ+z2dgj5t8GcUVfiX9QwMgm wbng7ULutALLVinHGkIiw/g6jUTfq+os78l1oXXbWmK841/7YhJeXnbEYdpI3pad IWNYX8SkzuxKVuYlS03M4kzmqoE5N8Ssb3kqD8F0o0xf4irhWny76NT0ooBMBILm jcOp2YK/OH7+2VuV3QUzz/sNekyCKiQZKKVqoRFtHC7ODj1AG1UF8tO+CDltHHwk tpX/QHvXA6p5WVq2W92bDjYM7hiy48CcoEHSuDBlQNuItPtzCRYve8qc9lIg5cSV d98YeaWk3d+rm/J2vyGAExje9tLQkvLLGHZDJ1OHEdb9/2MTqJWlj8NnV3WuyO5F ZmIRjTQlAqlTKiOcOt1VHl/x0U6HU7vz3+6Vq7cHKJsZnQ2DmFl8B1hro56eTmSC ebvZQMhQKE+wmtVveO5q =Dqnk -----END PGP SIGNATURE----- --Apple-Mail=_5C6AB243-3F65-4001-B15E-7361616440B5-- From owner-svn-src-head@freebsd.org Sun May 28 09:01:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68180D7BF0B; Sun, 28 May 2017 09:01: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 3A5541D3F; Sun, 28 May 2017 09:01:59 +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 v4S91weL004699; Sun, 28 May 2017 09:01:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S91wVp004698; Sun, 28 May 2017 09:01:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280901.v4S91wVp004698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 09:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319061 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 09:01:59 -0000 Author: ngie Date: Sun May 28 09:01:58 2017 New Revision: 319061 URL: https://svnweb.freebsd.org/changeset/base/319061 Log: Don't leak accept_fd on thread completion MFC after: 3 days Reported by: Coverity CID: 1296068 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/newfileops_on_fork_test.c Modified: head/tests/sys/file/newfileops_on_fork_test.c ============================================================================== --- head/tests/sys/file/newfileops_on_fork_test.c Sun May 28 08:57:08 2017 (r319060) +++ head/tests/sys/file/newfileops_on_fork_test.c Sun May 28 09:01:58 2017 (r319061) @@ -63,6 +63,7 @@ do_accept(__unused void *arg) if (accept_fd < 0) err(1, "accept"); + close(accept_fd); return (NULL); } From owner-svn-src-head@freebsd.org Sun May 28 09:08:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDD08D8502F; Sun, 28 May 2017 09:08:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDF211F22; Sun, 28 May 2017 09:08:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S98UpM005032; Sun, 28 May 2017 09:08:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S98UFq005031; Sun, 28 May 2017 09:08:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280908.v4S98UFq005031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 09:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319062 - head/tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 09:08:32 -0000 Author: ngie Date: Sun May 28 09:08:30 2017 New Revision: 319062 URL: https://svnweb.freebsd.org/changeset/base/319062 Log: Initial `srv` before using it in bind(2) MFC after: 3 days Reported by: Coverity CID: 1357526 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/netinet/tcp_user_cookie.c Modified: head/tests/sys/netinet/tcp_user_cookie.c ============================================================================== --- head/tests/sys/netinet/tcp_user_cookie.c Sun May 28 09:01:58 2017 (r319061) +++ head/tests/sys/netinet/tcp_user_cookie.c Sun May 28 09:08:30 2017 (r319062) @@ -72,6 +72,7 @@ main(int argc, char **argv) if (sock < 0) err(EXIT_FAILURE, "socket"); + memset(&srv, 0, sizeof(srv)); srv.sin_len = sizeof(srv); srv.sin_family = AF_INET; srv.sin_port = htons(port); From owner-svn-src-head@freebsd.org Sun May 28 09:21:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB675D85447; Sun, 28 May 2017 09:21: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 A25EB15DA; Sun, 28 May 2017 09:21: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 v4S9LSwN011744; Sun, 28 May 2017 09:21:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S9LSF8011743; Sun, 28 May 2017 09:21:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280921.v4S9LSF8011743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 09:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319063 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 09:21:30 -0000 Author: ngie Date: Sun May 28 09:21:28 2017 New Revision: 319063 URL: https://svnweb.freebsd.org/changeset/base/319063 Log: Send all of `data`, not just a portion of it It was sending only a long's worth (4 or 8 bytes) of data previously (instead of the entire buffer) via send(2). MFC after: 1 week Reported by: Coverity CID: 1229966, 1229967, 1230004, 1230005 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/unix_seqpacket_test.c Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Sun May 28 09:08:30 2017 (r319062) +++ head/tests/sys/kern/unix_seqpacket_test.c Sun May 28 09:21:28 2017 (r319063) @@ -762,7 +762,7 @@ ATF_TC_BODY(shutdown_send, tc) /* ATF's isolation mechanisms will guarantee uniqueness of this file */ const char *path = "sock"; const char *data = "data"; - ssize_t ssize; + ssize_t datalen, ssize; int s, err, s2; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); @@ -786,8 +786,9 @@ ATF_TC_BODY(shutdown_send, tc) } ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR)); + datalen = strlen(data) + 1; /* +1 for the null */ /* USE MSG_NOSIGNAL so we don't get SIGPIPE */ - ssize = send(s2, data, sizeof(data), MSG_EOR | MSG_NOSIGNAL); + ssize = send(s2, data, datalen, MSG_EOR | MSG_NOSIGNAL); ATF_CHECK_EQ(EPIPE, errno); ATF_CHECK_EQ(-1, ssize); close(s); @@ -802,6 +803,7 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc) /* ATF's isolation mechanisms will guarantee uniqueness of this file */ const char *path = "sock"; const char *data = "data"; + ssize_t datalen; int s, err, s2; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); @@ -826,7 +828,8 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc) ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR)); ATF_REQUIRE(SIG_ERR != signal(SIGPIPE, shutdown_send_sigpipe_handler)); - (void)send(s2, data, sizeof(data), MSG_EOR); + datalen = strlen(data) + 1; /* +1 for the null */ + (void)send(s2, data, sizeof(*data), MSG_EOR); ATF_CHECK_EQ(1, got_sigpipe); close(s); close(s2); From owner-svn-src-head@freebsd.org Sun May 28 09:29:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30330D85594; Sun, 28 May 2017 09:29:55 +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 00A2219BD; Sun, 28 May 2017 09:29:54 +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 v4S9Ts3S013464; Sun, 28 May 2017 09:29:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S9TrO9013463; Sun, 28 May 2017 09:29:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705280929.v4S9TrO9013463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 May 2017 09:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319064 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 09:29:55 -0000 Author: kib Date: Sun May 28 09:29:53 2017 New Revision: 319064 URL: https://svnweb.freebsd.org/changeset/base/319064 Log: Update getdirentries(2) page for new struct dirent layout. Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/sys/getdirentries.2 Modified: head/lib/libc/sys/getdirentries.2 ============================================================================== --- head/lib/libc/sys/getdirentries.2 Sun May 28 09:21:28 2017 (r319063) +++ head/lib/libc/sys/getdirentries.2 Sun May 28 09:29:53 2017 (r319064) @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 3, 1995 +.Dd May 28, 2017 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -71,10 +71,11 @@ The data in the buffer is a series of .Vt dirent structures each containing the following entries: .Bd -literal -offset indent -uint32_t d_fileno; -uint16_t d_reclen; -uint8_t d_type; -uint8_t d_namlen; +ino_t d_fileno; +off_t d_off; +uint16_t d_reclen; +uint8_t d_type; +uint16_t d_namlen; char d_name[MAXNAMLEN + 1]; /* see below */ .Ed .Pp From owner-svn-src-head@freebsd.org Sun May 28 12:05:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2DB9D869DC; Sun, 28 May 2017 12:05:17 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0158AC8; Sun, 28 May 2017 12:05:17 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SC5GOj078567; Sun, 28 May 2017 12:05:16 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SC5G9t078564; Sun, 28 May 2017 12:05:16 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201705281205.v4SC5G9t078564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Sun, 28 May 2017 12:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319069 - in head/sys: dev/bhnd/cores/chipc dev/bhnd/cores/chipc/pwrctl mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 12:05:18 -0000 Author: mizhka Date: Sun May 28 12:05:16 2017 New Revision: 319069 URL: https://svnweb.freebsd.org/changeset/base/319069 Log: [mips] [bhnd] Support of old PMU for BMIPS and siba SoC - Fix typo of PLL Type 4 - Don't panic of frequency getters Submitted by: Hiroki Mori Differential Revision: https://reviews.freebsd.org/D10967 Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c head/sys/mips/broadcom/bcm_pmu.c Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcreg.h Sun May 28 10:46:34 2017 (r319068) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.h Sun May 28 12:05:16 2017 (r319069) @@ -280,7 +280,7 @@ enum { #define CHIPC_PLL_TYPE1 0x2 /* 48MHz base, 3 dividers */ #define CHIPC_PLL_TYPE2 0x4 /* 48MHz, 4 dividers */ #define CHIPC_PLL_TYPE3 0x6 /* 25MHz, 2 dividers */ -#define CHIPC_PLL_TYPE4 0x8 /* 48MHz, 4 dividers */ +#define CHIPC_PLL_TYPE4 0x1 /* 48MHz, 4 dividers */ #define CHIPC_PLL_TYPE5 0x3 /* 25MHz, 4 dividers */ #define CHIPC_PLL_TYPE6 0x5 /* 100/200 or 120/240 only */ #define CHIPC_PLL_TYPE7 0x7 /* 25MHz, 4 dividers */ Modified: head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c Sun May 28 10:46:34 2017 (r319068) +++ head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c Sun May 28 12:05:16 2017 (r319069) @@ -374,7 +374,7 @@ bhnd_pwrctl_slowclk_freq(struct bhnd_pwr } else if (PWRCTL_QUIRK(sc, SLOWCLK_CTL)) { div = bhnd_bus_read_4(sc->res, CHIPC_PLL_SLOWCLK_CTL); div = CHIPC_GET_BITS(div, CHIPC_SCC_CD); - div *= 4; + div = 4 * (div + 1); } else if (PWRCTL_QUIRK(sc, INSTACLK_CTL)) { if (max_freq) { div = 1; @@ -503,7 +503,10 @@ bhnd_pwrctl_setclk(struct bhnd_pwrctl_so if (bhnd_get_hwrev(sc->chipc_dev) == 10) return (ENODEV); - scc = bhnd_bus_read_4(sc->res, CHIPC_PLL_SLOWCLK_CTL); + if (PWRCTL_QUIRK(sc, SLOWCLK_CTL)) + scc = bhnd_bus_read_4(sc->res, CHIPC_PLL_SLOWCLK_CTL); + else + scc = bhnd_bus_read_4(sc->res, CHIPC_SYS_CLK_CTL); switch (clock) { case BHND_CLOCK_HT: @@ -520,7 +523,10 @@ bhnd_pwrctl_setclk(struct bhnd_pwrctl_so return (ENODEV); } - bhnd_bus_write_4(sc->res, CHIPC_PLL_SLOWCLK_CTL, scc); + if (PWRCTL_QUIRK(sc, SLOWCLK_CTL)) + bhnd_bus_write_4(sc->res, CHIPC_PLL_SLOWCLK_CTL, scc); + else + bhnd_bus_write_4(sc->res, CHIPC_SYS_CLK_CTL, scc); DELAY(CHIPC_PLL_DELAY); break; Modified: head/sys/mips/broadcom/bcm_pmu.c ============================================================================== --- head/sys/mips/broadcom/bcm_pmu.c Sun May 28 10:46:34 2017 (r319068) +++ head/sys/mips/broadcom/bcm_pmu.c Sun May 28 12:05:16 2017 (r319069) @@ -208,7 +208,7 @@ bcm_get_uart_rclk(struct bcm_platform *b uint64_t bcm_get_alpfreq(struct bcm_platform *bp) { if (!bcm_has_pmu(bp)) - panic("%s requires PMU\n", __FUNCTION__); + return (BHND_PMU_ALP_CLOCK); return (bhnd_pmu_alp_clock(bcm_get_pmu(bp))); } @@ -217,7 +217,7 @@ bcm_get_alpfreq(struct bcm_platform *bp) uint64_t bcm_get_ilpfreq(struct bcm_platform *bp) { if (!bcm_has_pmu(bp)) - panic("%s requires PMU\n", __FUNCTION__); + return (BHND_PMU_ILP_CLOCK); return (bhnd_pmu_ilp_clock(bcm_get_pmu(bp))); } From owner-svn-src-head@freebsd.org Sun May 28 12:14:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2AED86C5C; Sun, 28 May 2017 12:14:35 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 400DBFF9; Sun, 28 May 2017 12:14:35 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SCEYh4082847; Sun, 28 May 2017 12:14:34 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SCEYSt082845; Sun, 28 May 2017 12:14:34 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201705281214.v4SCEYSt082845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Sun, 28 May 2017 12:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319070 - head/sys/dev/etherswitch/rtl8366 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 12:14:35 -0000 Author: mizhka Date: Sun May 28 12:14:33 2017 New Revision: 319070 URL: https://svnweb.freebsd.org/changeset/base/319070 Log: [etherswitch] [rtl8366] add phy4cpu setting and support mdioproxy Tested on WZR-HP-G301NH(RTL8366RB) and WZR-HP-G300NH(RTL8366SR). Submitted by: Hiroki Mori Differential Revision: https://reviews.freebsd.org/D10740 Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c ============================================================================== --- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Sun May 28 12:05:16 2017 (r319069) +++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Sun May 28 12:14:33 2017 (r319070) @@ -54,10 +54,12 @@ #include #include #include +#include #include #include +#include "mdio_if.h" #include "iicbus_if.h" #include "miibus_if.h" #include "etherswitch_if.h" @@ -74,7 +76,9 @@ struct rtl8366rb_softc { struct ifnet *ifp[RTL8366_NUM_PHYS]; struct callout callout_tick; etherswitch_info_t info; - int chip_type; /* 0 = RTL8366RB, 1 = RTL8366SR */ + int chip_type; + int phy4cpu; + int numphys; }; #define RTL_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -145,7 +149,7 @@ rtl8366rb_probe(device_t dev) bzero(sc, sizeof(*sc)); if (smi_probe(dev) != 0) return (ENXIO); - if(sc->chip_type == 0) + if (sc->chip_type == RTL8366RB) device_set_desc(dev, "RTL8366RB Ethernet Switch Controller"); else device_set_desc(dev, "RTL8366SR Ethernet Switch Controller"); @@ -215,17 +219,23 @@ rtl8366rb_attach(device_t dev) smi_read(dev, RTL8366_CVCR, &rev, RTL_WAITOK); device_printf(dev, "rev. %d\n", rev & 0x000f); - sc->info.es_nports = RTL8366_NUM_PORTS; + sc->phy4cpu = 0; + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "phy4cpu", &sc->phy4cpu); + + sc->numphys = sc->phy4cpu ? RTL8366_NUM_PHYS - 1 : RTL8366_NUM_PHYS; + + sc->info.es_nports = sc->numphys + 1; sc->info.es_nvlangroups = RTL8366_NUM_VLANS; sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q; - if(sc->chip_type == 0) + if (sc->chip_type == RTL8366RB) sprintf(sc->info.es_name, "Realtek RTL8366RB"); else sprintf(sc->info.es_name, "Realtek RTL8366SR"); /* attach miibus and phys */ /* PHYs need an interface, so we generate a dummy one */ - for (i = 0; i < RTL8366_NUM_PHYS; i++) { + for (i = 0; i < sc->numphys; i++) { sc->ifp[i] = if_alloc(IFT_ETHER); sc->ifp[i]->if_softc = sc; sc->ifp[i]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING @@ -263,7 +273,7 @@ rtl8366rb_detach(device_t dev) sc = device_get_softc(dev); - for (i=0; i < RTL8366_NUM_PHYS; i++) { + for (i=0; i < sc->numphys; i++) { if (sc->miibus[i]) device_delete_child(dev, sc->miibus[i]); if (sc->ifp[i] != NULL) @@ -319,7 +329,7 @@ rtl833rb_miipollstat(struct rtl8366rb_so uint16_t value; int portstatus; - for (i = 0; i < RTL8366_NUM_PHYS; i++) { + for (i = 0; i < sc->numphys; i++) { mii = device_get_softc(sc->miibus[i]); if ((i % 2) == 0) { if (smi_read(sc->dev, RTL8366_PLSR_BASE + i/2, &value, RTL_NOWAIT) != 0) { @@ -365,7 +375,7 @@ smi_probe(device_t dev) iicbus = device_get_parent(dev); iicha = device_get_parent(iicbus); - for(i = 0; i < 2; ++i) { + for (i = 0; i < 2; ++i) { iicbus_reset(iicbus, IIC_FASTEST, RTL8366_IIC_ADDR, NULL); for (j=3; j--; ) { IICBUS_STOP(iicha); @@ -380,7 +390,7 @@ smi_probe(device_t dev) err = iicbus_start(iicbus, RTL8366_IIC_ADDR | RTL_IICBUS_READ, RTL_IICBUS_TIMEOUT); if (err != 0) goto out; - if(i == 0) { + if (i == 0) { bytes[0] = RTL8366RB_CIR & 0xff; bytes[1] = (RTL8366RB_CIR >> 8) & 0xff; } else { @@ -396,22 +406,22 @@ smi_probe(device_t dev) chipid = ((bytes[1] & 0xff) << 8) | (bytes[0] & 0xff); if (i == 0 && chipid == RTL8366RB_CIR_ID8366RB) { DPRINTF(dev, "chip id 0x%04x\n", chipid); - sc->chip_type = 0; + sc->chip_type = RTL8366RB; err = 0; break; } if (i == 1 && chipid == RTL8366SR_CIR_ID8366SR) { DPRINTF(dev, "chip id 0x%04x\n", chipid); - sc->chip_type = 1; + sc->chip_type = RTL8366SR; err = 0; break; } - if(i == 0) { + if (i == 0) { iicbus_stop(iicbus); iicbus_release_bus(iicbus, dev); } } - if(i == 2) + if (i == 2) err = ENXIO; out: iicbus_stop(iicbus); @@ -472,7 +482,7 @@ smi_select(device_t dev, int op, int sle RTL_SMI_ACQUIRED_ASSERT((struct rtl8366rb_softc *)device_get_softc(dev)); - if(sc->chip_type == 1) { // RTL8366SR work around + if (sc->chip_type == RTL8366SR) { // RTL8366SR work around // this is same work around at probe for (int i=3; i--; ) IICBUS_STOP(device_get_parent(device_get_parent(dev))); @@ -648,13 +658,18 @@ rtl_getport(device_t dev, etherswitch_po ifmr = &p->es_ifmr; - if (p->es_port < 0 || p->es_port >= RTL8366_NUM_PORTS) + if (p->es_port < 0 || p->es_port >= (sc->numphys + 1)) return (ENXIO); - vlangroup = RTL8366_PVCR_GET(p->es_port, - rtl_readreg(dev, RTL8366_PVCR_REG(p->es_port))); + if (sc->phy4cpu && p->es_port == sc->numphys) { + vlangroup = RTL8366_PVCR_GET(p->es_port + 1, + rtl_readreg(dev, RTL8366_PVCR_REG(p->es_port + 1))); + } else { + vlangroup = RTL8366_PVCR_GET(p->es_port, + rtl_readreg(dev, RTL8366_PVCR_REG(p->es_port))); + } p->es_pvid = sc->vid[vlangroup] & ETHERSWITCH_VID_MASK; - if (p->es_port < RTL8366_NUM_PHYS) { + if (p->es_port < sc->numphys) { mii = device_get_softc(sc->miibus[p->es_port]); ifm = &mii->mii_media; err = ifmedia_ioctl(sc->ifp[p->es_port], &p->es_ifr, ifm, SIOCGIFMEDIA); @@ -687,10 +702,11 @@ rtl_setport(device_t dev, etherswitch_po int i, err, vlangroup; struct ifmedia *ifm; struct mii_data *mii; + int port; sc = device_get_softc(dev); - if (p->es_port < 0 || p->es_port >= RTL8366_NUM_PORTS) + if (p->es_port < 0 || p->es_port >= (sc->numphys + 1)) return (ENXIO); vlangroup = -1; for (i = 0; i < RTL8366_NUM_VLANS; i++) { @@ -701,12 +717,18 @@ rtl_setport(device_t dev, etherswitch_po } if (vlangroup == -1) return (ENXIO); - err = smi_rmw(dev, RTL8366_PVCR_REG(p->es_port), - RTL8366_PVCR_VAL(p->es_port, RTL8366_PVCR_PORT_MASK), - RTL8366_PVCR_VAL(p->es_port, vlangroup), RTL_WAITOK); + if (sc->phy4cpu && p->es_port == sc->numphys) { + port = p->es_port + 1; + } else { + port = p->es_port; + } + err = smi_rmw(dev, RTL8366_PVCR_REG(port), + RTL8366_PVCR_VAL(port, RTL8366_PVCR_PORT_MASK), + RTL8366_PVCR_VAL(port, vlangroup), RTL_WAITOK); if (err) return (err); - if (p->es_port == RTL8366_CPU_PORT) + /* CPU Port */ + if (p->es_port == sc->numphys) return (0); mii = device_get_softc(sc->miibus[p->es_port]); ifm = &mii->mii_media; @@ -720,6 +742,7 @@ rtl_getvgroup(device_t dev, etherswitch_ struct rtl8366rb_softc *sc; uint16_t vmcr[3]; int i; + int member, untagged; sc = device_get_softc(dev); @@ -727,8 +750,15 @@ rtl_getvgroup(device_t dev, etherswitch_ vmcr[i] = rtl_readreg(dev, RTL8366_VMCR(i, vg->es_vlangroup)); vg->es_vid = sc->vid[vg->es_vlangroup]; - vg->es_member_ports = RTL8366_VMCR_MEMBER(vmcr); - vg->es_untagged_ports = RTL8366_VMCR_UNTAG(vmcr); + member = RTL8366_VMCR_MEMBER(vmcr); + untagged = RTL8366_VMCR_UNTAG(vmcr); + if (sc->phy4cpu) { + vg->es_member_ports = ((member & 0x20) >> 1) | (member & 0x0f); + vg->es_untagged_ports = ((untagged & 0x20) >> 1) | (untagged & 0x0f); + } else { + vg->es_member_ports = member; + vg->es_untagged_ports = untagged; + } vg->es_fid = RTL8366_VMCR_FID(vmcr); return (0); } @@ -738,6 +768,7 @@ rtl_setvgroup(device_t dev, etherswitch_ { struct rtl8366rb_softc *sc; int g; + int member, untagged; sc = device_get_softc(dev); @@ -750,16 +781,26 @@ rtl_setvgroup(device_t dev, etherswitch_ sc->vid[g] |= ETHERSWITCH_VID_VALID; rtl_writereg(dev, RTL8366_VMCR(RTL8366_VMCR_DOT1Q_REG, g), (vg->es_vid << RTL8366_VMCR_DOT1Q_VID_SHIFT) & RTL8366_VMCR_DOT1Q_VID_MASK); - if(sc->chip_type == 0) { + if (sc->phy4cpu) { + /* add space at phy4 */ + member = (vg->es_member_ports & 0x0f) | + ((vg->es_member_ports & 0x10) << 1); + untagged = (vg->es_untagged_ports & 0x0f) | + ((vg->es_untagged_ports & 0x10) << 1); + } else { + member = vg->es_member_ports; + untagged = vg->es_untagged_ports; + } + if (sc->chip_type == RTL8366RB) { rtl_writereg(dev, RTL8366_VMCR(RTL8366_VMCR_MU_REG, g), - ((vg->es_member_ports << RTL8366_VMCR_MU_MEMBER_SHIFT) & RTL8366_VMCR_MU_MEMBER_MASK) | - ((vg->es_untagged_ports << RTL8366_VMCR_MU_UNTAG_SHIFT) & RTL8366_VMCR_MU_UNTAG_MASK)); + ((member << RTL8366_VMCR_MU_MEMBER_SHIFT) & RTL8366_VMCR_MU_MEMBER_MASK) | + ((untagged << RTL8366_VMCR_MU_UNTAG_SHIFT) & RTL8366_VMCR_MU_UNTAG_MASK)); rtl_writereg(dev, RTL8366_VMCR(RTL8366_VMCR_FID_REG, g), vg->es_fid); } else { rtl_writereg(dev, RTL8366_VMCR(RTL8366_VMCR_MU_REG, g), - ((vg->es_member_ports << RTL8366_VMCR_MU_MEMBER_SHIFT) & RTL8366_VMCR_MU_MEMBER_MASK) | - ((vg->es_untagged_ports << RTL8366_VMCR_MU_UNTAG_SHIFT) & RTL8366_VMCR_MU_UNTAG_MASK) | + ((member << RTL8366_VMCR_MU_MEMBER_SHIFT) & RTL8366_VMCR_MU_MEMBER_MASK) | + ((untagged << RTL8366_VMCR_MU_UNTAG_SHIFT) & RTL8366_VMCR_MU_UNTAG_MASK) | ((vg->es_fid << RTL8366_VMCR_FID_FID_SHIFT) & RTL8366_VMCR_FID_FID_MASK)); } return (0); @@ -886,6 +927,10 @@ static device_method_t rtl8366rb_methods DEVMETHOD(miibus_readreg, rtl_readphy), DEVMETHOD(miibus_writereg, rtl_writephy), + /* MDIO interface */ + DEVMETHOD(mdio_readreg, rtl_readphy), + DEVMETHOD(mdio_writereg, rtl_writephy), + /* etherswitch interface */ DEVMETHOD(etherswitch_getconf, rtl_getconf), DEVMETHOD(etherswitch_getinfo, rtl_getinfo), @@ -907,6 +952,7 @@ static devclass_t rtl8366rb_devclass; DRIVER_MODULE(rtl8366rb, iicbus, rtl8366rb_driver, rtl8366rb_devclass, 0, 0); DRIVER_MODULE(miibus, rtl8366rb, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mdio, rtl8366rb, mdio_driver, mdio_devclass, 0, 0); DRIVER_MODULE(etherswitch, rtl8366rb, etherswitch_driver, etherswitch_devclass, 0, 0); MODULE_VERSION(rtl8366rb, 1); MODULE_DEPEND(rtl8366rb, iicbus, 1, 1, 1); /* XXX which versions? */ Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h ============================================================================== --- head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h Sun May 28 12:05:16 2017 (r319069) +++ head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h Sun May 28 12:14:33 2017 (r319070) @@ -30,6 +30,9 @@ #ifndef _DEV_ETHERSWITCH_RTL8366RBVAR_H_ #define _DEV_ETHERSWITCH_RTL8366RBVAR_H_ +#define RTL8366RB 0 +#define RTL8366SR 1 + #define RTL8366_IIC_ADDR 0xa8 #define RTL_IICBUS_TIMEOUT 100 /* us */ #define RTL_IICBUS_READ 1 @@ -173,9 +176,7 @@ (0x8000 | (1 << (((phy) & 0x1f) + 9)) | (((page) & (sc->chip_type == 0 ? 0xf : 0x7)) << 5) | ((reg) & 0x1f)) /* general characteristics of the chip */ -#define RTL8366_CPU_PORT 5 -#define RTL8366_NUM_PORTS 6 -#define RTL8366_NUM_PHYS (RTL8366_NUM_PORTS-1) +#define RTL8366_NUM_PHYS 5 #define RTL8366_NUM_VLANS 16 #define RTL8366_NUM_PHY_REG 32 From owner-svn-src-head@freebsd.org Sun May 28 15:39:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A0E3D84F83; Sun, 28 May 2017 15:39:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F414F19C8; Sun, 28 May 2017 15:39:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SFdCMe063162; Sun, 28 May 2017 15:39:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SFdBKA063157; Sun, 28 May 2017 15:39:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201705281539.v4SFdBKA063157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 28 May 2017 15:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319071 - in head/sys: conf fs/ext2fs modules/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 15:39:13 -0000 Author: pfg Date: Sun May 28 15:39:11 2017 New Revision: 319071 URL: https://svnweb.freebsd.org/changeset/base/319071 Log: Support for linux ext2fs posix-draft ACLs. This is closely tied to the Extended Attribute implementation. Submitted by: Fedor Uporov Reviewed by: kevlo, pfg Differential Revision: https://reviews.freebsd.org/D10807 Added: head/sys/fs/ext2fs/ext2_acl.c (contents, props changed) head/sys/fs/ext2fs/ext2_acl.h (contents, props changed) Modified: head/sys/conf/files head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/modules/ext2fs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 28 12:14:33 2017 (r319070) +++ head/sys/conf/files Sun May 28 15:39:11 2017 (r319071) @@ -3525,6 +3525,7 @@ geom/virstor/binstream.c optional geom_v geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.c optional geom_virstor geom/zero/g_zero.c optional geom_zero +fs/ext2fs/ext2_acl.c optional ext2fs fs/ext2fs/ext2_alloc.c optional ext2fs fs/ext2fs/ext2_balloc.c optional ext2fs fs/ext2fs/ext2_bmap.c optional ext2fs Added: head/sys/fs/ext2fs/ext2_acl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/ext2fs/ext2_acl.c Sun May 28 15:39:11 2017 (r319071) @@ -0,0 +1,521 @@ +/*- + * Copyright (c) 2017, Fedor Uporov + * 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$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +void +ext2_sync_acl_from_inode(struct inode *ip, struct acl *acl) +{ + struct acl_entry *acl_mask, *acl_group_obj; + int i; + + /* + * Update ACL_USER_OBJ, ACL_OTHER, but simply identify ACL_MASK + * and ACL_GROUP_OBJ for use after we know whether ACL_MASK is + * present. + */ + acl_mask = NULL; + acl_group_obj = NULL; + for (i = 0; i < acl->acl_cnt; i++) { + switch (acl->acl_entry[i].ae_tag) { + case ACL_USER_OBJ: + acl->acl_entry[i].ae_perm = acl_posix1e_mode_to_perm( + ACL_USER_OBJ, ip->i_mode); + acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID; + break; + + case ACL_GROUP_OBJ: + acl_group_obj = &acl->acl_entry[i]; + acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID; + break; + + case ACL_OTHER: + acl->acl_entry[i].ae_perm = acl_posix1e_mode_to_perm( + ACL_OTHER, ip->i_mode); + acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID; + break; + + case ACL_MASK: + acl_mask = &acl->acl_entry[i]; + acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID; + break; + + case ACL_USER: + case ACL_GROUP: + break; + + default: + panic("ext2_sync_acl_from_inode(): bad ae_tag"); + } + } + + if (acl_group_obj == NULL) + panic("ext2_sync_acl_from_inode(): no ACL_GROUP_OBJ"); + + if (acl_mask == NULL) { + /* + * There is no ACL_MASK, so update ACL_GROUP_OBJ. + */ + acl_group_obj->ae_perm = acl_posix1e_mode_to_perm( + ACL_GROUP_OBJ, ip->i_mode); + } else { + /* + * Update the ACL_MASK entry instead of ACL_GROUP_OBJ. + */ + acl_mask->ae_perm = acl_posix1e_mode_to_perm(ACL_GROUP_OBJ, + ip->i_mode); + } +} + +static void +ext2_sync_inode_from_acl(struct acl *acl, struct inode *ip) +{ + + ip->i_mode &= ACL_PRESERVE_MASK; + ip->i_mode |= acl_posix1e_acl_to_mode(acl); +} + +/* + * Convert from filesystem to in-memory representation. + */ +static int +ext4_acl_from_disk(char *value, size_t size, struct acl *acl) +{ + const char *end = value + size; + int n, count, s; + + if (((struct ext2_acl_header *)value)->a_version != EXT4_ACL_VERSION) + return (EINVAL); + + if (!value || size < sizeof(struct ext2_acl_header)) + return (EINVAL); + + s = size - sizeof(struct ext2_acl_header); + s -= 4 * sizeof(struct ext2_acl_entry_short); + if (s < 0) + if ((size - sizeof(struct ext2_acl_header)) % + sizeof(struct ext2_acl_entry_short)) + count = -1; + else + count = (size - sizeof(struct ext2_acl_header)) / + sizeof(struct ext2_acl_entry_short); + else + if (s % sizeof(struct ext2_acl_entry)) + count = -1; + else + count = s / sizeof(struct ext2_acl_entry) + 4; + + if (count <= 0 || count > acl->acl_maxcnt) + return (EINVAL); + + value = value + sizeof(struct ext2_acl_header); + + for (n = 0; n < count; n++) { + struct ext2_acl_entry *entry = (struct ext2_acl_entry *)value; + if ((char *)value + sizeof(struct ext2_acl_entry_short) > end) + return (EINVAL); + + acl->acl_entry[n].ae_tag = entry->ae_tag; + acl->acl_entry[n].ae_perm = entry->ae_perm; + + switch (acl->acl_entry[n].ae_tag) { + case ACL_USER_OBJ: + case ACL_GROUP_OBJ: + case ACL_MASK: + case ACL_OTHER: + value = (char *)value + sizeof(struct ext2_acl_entry_short); + break; + + case ACL_USER: + value = (char *)value + sizeof(struct ext2_acl_entry); + if ((char *)value > end) + return (EINVAL); + + acl->acl_entry[n].ae_id = entry->ae_id; + break; + + case ACL_GROUP: + value = (char *)value + sizeof(struct ext2_acl_entry); + if ((char *)value > end) + return (EINVAL); + + acl->acl_entry[n].ae_id = entry->ae_id; + break; + + default: + return (EINVAL); + } + } + + if (value != end) + return (EINVAL); + + acl->acl_cnt = count; + + return (0); +} + +static int +ext2_getacl_posix1e(struct vop_getacl_args *ap) +{ + int attrnamespace; + const char *attrname; + char *value; + int len; + int error; + + len = sizeof(*ap->a_aclp) + sizeof(struct ext2_acl_header); + value = malloc(len, M_ACL, M_WAITOK); + if (!value) + return (ENOMEM); + + switch (ap->a_type) { + case ACL_TYPE_DEFAULT: + attrnamespace = POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE; + attrname = POSIX1E_ACL_DEFAULT_EXTATTR_NAME; + break; + case ACL_TYPE_ACCESS: + attrnamespace = POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE; + attrname = POSIX1E_ACL_ACCESS_EXTATTR_NAME; + break; + default: + return (EINVAL); + } + + error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, attrnamespace, attrname, + &len, value, ap->a_td); + switch (error) { + case ENOATTR: + switch (ap->a_type) { + case ACL_TYPE_ACCESS: + ap->a_aclp->acl_cnt = 3; + ap->a_aclp->acl_entry[0].ae_tag = ACL_USER_OBJ; + ap->a_aclp->acl_entry[0].ae_id = ACL_UNDEFINED_ID; + ap->a_aclp->acl_entry[0].ae_perm = ACL_PERM_NONE; + ap->a_aclp->acl_entry[1].ae_tag = ACL_GROUP_OBJ; + ap->a_aclp->acl_entry[1].ae_id = ACL_UNDEFINED_ID; + ap->a_aclp->acl_entry[1].ae_perm = ACL_PERM_NONE; + ap->a_aclp->acl_entry[2].ae_tag = ACL_OTHER; + ap->a_aclp->acl_entry[2].ae_id = ACL_UNDEFINED_ID; + ap->a_aclp->acl_entry[2].ae_perm = ACL_PERM_NONE; + break; + + case ACL_TYPE_DEFAULT: + ap->a_aclp->acl_cnt = 0; + break; + } + case 0: + if (!error) { + error = ext4_acl_from_disk(value, len, ap->a_aclp); + if (error) + goto out; + } + + if (error == ENOATTR) + error = 0; + + if (ap->a_type == ACL_TYPE_ACCESS) + ext2_sync_acl_from_inode(VTOI(ap->a_vp), ap->a_aclp); + default: + break; + } + +out: + free(value, M_TEMP); + return (error); +} + +int +ext2_getacl(struct vop_getacl_args *ap) +{ + + if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) || + ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1)) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ENOTSUP); + + return (ext2_getacl_posix1e(ap)); +} + +/* + * Convert from in-memory to filesystem representation. + */ +static int +ext4_acl_to_disk(const struct acl *acl, size_t *size, char *value) +{ + struct ext2_acl_header *ext_acl; + int disk_size; + char *e; + size_t n; + + if (acl->acl_cnt <= 4) + disk_size = sizeof(struct ext2_acl_header) + + acl->acl_cnt * sizeof(struct ext2_acl_entry_short); + else + disk_size = sizeof(struct ext2_acl_header) + + 4 * sizeof(struct ext2_acl_entry_short) + + (acl->acl_cnt - 4) * sizeof(struct ext2_acl_entry); + + if (disk_size > *size) + return (EINVAL); + + *size = disk_size; + ext_acl = (struct ext2_acl_header *)value; + + ext_acl->a_version = EXT4_ACL_VERSION; + e = (char *)ext_acl + sizeof(struct ext2_acl_header); + for (n = 0; n < acl->acl_cnt; n++) { + const struct acl_entry *acl_e = &acl->acl_entry[n]; + struct ext2_acl_entry *entry = (struct ext2_acl_entry *)e; + entry->ae_tag = acl_e->ae_tag; + entry->ae_perm = acl_e->ae_perm; + switch (acl_e->ae_tag) { + case ACL_USER: + entry->ae_id = acl_e->ae_id; + e += sizeof(struct ext2_acl_entry); + break; + + case ACL_GROUP: + entry->ae_id = acl_e->ae_id; + e += sizeof(struct ext2_acl_entry); + break; + + case ACL_USER_OBJ: + case ACL_GROUP_OBJ: + case ACL_MASK: + case ACL_OTHER: + e += sizeof(struct ext2_acl_entry_short); + break; + + default: + return (EINVAL); + } + } + + return (0); +} + +static int +ext2_setacl_posix1e(struct vop_setacl_args *ap) +{ + struct inode *ip = VTOI(ap->a_vp); + char *value; + size_t len; + int error; + + if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) + return (EINVAL); + + /* + * If this is a set operation rather than a delete operation, + * invoke VOP_ACLCHECK() on the passed ACL to determine if it is + * valid for the target. This will include a check on ap->a_type. + */ + if (ap->a_aclp != NULL) { + /* + * Set operation. + */ + error = VOP_ACLCHECK(ap->a_vp, ap->a_type, ap->a_aclp, + ap->a_cred, ap->a_td); + if (error) + return (error); + } else { + /* + * Delete operation. + * POSIX.1e allows only deletion of the default ACL on a + * directory (ACL_TYPE_DEFAULT). + */ + if (ap->a_type != ACL_TYPE_DEFAULT) + return (EINVAL); + if (ap->a_vp->v_type != VDIR) + return (ENOTDIR); + } + + if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + return (EROFS); + + /* + * Authorize the ACL operation. + */ + if (ip->i_flags & (IMMUTABLE | APPEND)) + return (EPERM); + + /* + * Must hold VADMIN (be file owner) or have appropriate privilege. + */ + if ((error = VOP_ACCESS(ap->a_vp, VADMIN, ap->a_cred, ap->a_td))) + return (error); + + switch (ap->a_type) { + case ACL_TYPE_ACCESS: + len = sizeof(*ap->a_aclp) + sizeof(struct ext2_acl_header); + value = malloc(len, M_ACL, M_WAITOK | M_ZERO); + error = ext4_acl_to_disk(ap->a_aclp, &len, value); + if (error == 0) + error = vn_extattr_set(ap->a_vp, IO_NODELOCKED, + POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE, + POSIX1E_ACL_ACCESS_EXTATTR_NAME, len, + value, ap->a_td); + + free(value, M_ACL); + break; + + case ACL_TYPE_DEFAULT: + if (ap->a_aclp == NULL) { + error = vn_extattr_rm(ap->a_vp, IO_NODELOCKED, + POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE, + POSIX1E_ACL_DEFAULT_EXTATTR_NAME, ap->a_td); + + /* + * Attempting to delete a non-present default ACL + * will return success for portability purposes. + * (TRIX) + * + * XXX: Note that since we can't distinguish + * "that EA is not supported" from "that EA is not + * defined", the success case here overlaps the + * the ENOATTR->EOPNOTSUPP case below. + */ + if (error == ENOATTR) + error = 0; + } else { + len = sizeof(*ap->a_aclp) + sizeof(struct ext2_acl_header); + value = malloc(len, M_ACL, M_WAITOK | M_ZERO); + error = ext4_acl_to_disk(ap->a_aclp, &len, value); + if (error == 0) + error = vn_extattr_set(ap->a_vp, IO_NODELOCKED, + POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE, + POSIX1E_ACL_DEFAULT_EXTATTR_NAME, len, + value, ap->a_td); + + free(value, M_ACL); + } + break; + + default: + error = EINVAL; + } + + /* + * Map lack of attribute definition in UFS_EXTATTR into lack of + * support for ACLs on the filesystem. + */ + if (error == ENOATTR) + return (EOPNOTSUPP); + + if (error != 0) + return (error); + + if (ap->a_type == ACL_TYPE_ACCESS) { + /* + * Now that the EA is successfully updated, update the + * inode and mark it as changed. + */ + ext2_sync_inode_from_acl(ap->a_aclp, ip); + ip->i_flag |= IN_CHANGE; + error = ext2_update(ip->i_vnode, 1); + } + + VN_KNOTE_UNLOCKED(ap->a_vp, NOTE_ATTRIB); + + return (error); +} + +int +ext2_setacl(struct vop_setacl_args *ap) +{ + if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) || + ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1)) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ENOTSUP); + + return (ext2_setacl_posix1e(ap)); +} + +/* + * Check the validity of an ACL for a file. + */ +int +ext2_aclcheck(struct vop_aclcheck_args *ap) +{ + + if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) || + ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1)) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ENOTSUP); + + if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) + return (EINVAL); + + /* + * Verify we understand this type of ACL, and that it applies + * to this kind of object. + * Rely on the acl_posix1e_check() routine to verify the contents. + */ + switch (ap->a_type) { + case ACL_TYPE_ACCESS: + break; + + case ACL_TYPE_DEFAULT: + if (ap->a_vp->v_type != VDIR) + return (EINVAL); + break; + + default: + return (EINVAL); + } + + return (acl_posix1e_check(ap->a_aclp)); +} \ No newline at end of file Added: head/sys/fs/ext2fs/ext2_acl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/ext2fs/ext2_acl.h Sun May 28 15:39:11 2017 (r319071) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2017, Fedor Uporov + * 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 _FS_EXT2FS_EXT2_ACL_H_ +#define _FS_EXT2FS_EXT2_ACL_H_ + +#define EXT4_ACL_VERSION 0x0001 + +struct ext2_acl_entry { + int16_t ae_tag; + int16_t ae_perm; + int32_t ae_id; +}; + +struct ext2_acl_entry_short { + int16_t ae_tag; + int16_t ae_perm; +}; + +struct ext2_acl_header { + int32_t a_version; +}; + +void ext2_sync_acl_from_inode(struct inode *ip, struct acl *acl); + +int ext2_getacl(struct vop_getacl_args *); +int ext2_setacl(struct vop_setacl_args *); +int ext2_aclcheck(struct vop_aclcheck_args *); + +#endif /* !_FS_EXT2FS_EXT2_ACL_H_ */ Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Sun May 28 12:14:33 2017 (r319070) +++ head/sys/fs/ext2fs/ext2_extattr.c Sun May 28 15:39:11 2017 (r319071) @@ -46,35 +46,92 @@ #include #include - static int -ext2_extattr_index_to_bsd(int index) +ext2_extattr_attrnamespace_to_bsd(int attrnamespace) { - switch (index) { - case EXT4_XATTR_INDEX_SYSTEM: - return (EXTATTR_NAMESPACE_SYSTEM); - case EXT4_XATTR_INDEX_USER: - return (EXTATTR_NAMESPACE_USER); + switch (attrnamespace) { + case EXT4_XATTR_INDEX_SYSTEM: + return (EXTATTR_NAMESPACE_SYSTEM); + + case EXT4_XATTR_INDEX_USER: + return (EXTATTR_NAMESPACE_USER); + + case EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT: + return (POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE); + + case EXT4_XATTR_INDEX_POSIX_ACL_ACCESS: + return (POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE); } return (EXTATTR_NAMESPACE_EMPTY); } +static const char * +ext2_extattr_name_to_bsd(int attrnamespace, const char *name, int* name_len) +{ + + if (attrnamespace == EXT4_XATTR_INDEX_SYSTEM) + return (name); + else if (attrnamespace == EXT4_XATTR_INDEX_USER) + return (name); + else if (attrnamespace == EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT) { + *name_len = strlen(POSIX1E_ACL_DEFAULT_EXTATTR_NAME); + return (POSIX1E_ACL_DEFAULT_EXTATTR_NAME); + } else if (attrnamespace == EXT4_XATTR_INDEX_POSIX_ACL_ACCESS) { + *name_len = strlen(POSIX1E_ACL_ACCESS_EXTATTR_NAME); + return (POSIX1E_ACL_ACCESS_EXTATTR_NAME); + } + + /* + * XXX: Not all linux namespaces are mapped to bsd for now, + * return NULL, which will be converted to ENOTSUP on upper layer. + */ +#ifdef EXT2FS_DEBUG + printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace); +#endif /* DEBUG */ + + return (NULL); +} + static int -ext2_extattr_index_to_linux(int index) +ext2_extattr_attrnamespace_to_linux(int attrnamespace, const char *name) { - switch (index) { - case EXTATTR_NAMESPACE_SYSTEM: - return (EXT4_XATTR_INDEX_SYSTEM); - case EXTATTR_NAMESPACE_USER: - return (EXT4_XATTR_INDEX_USER); + if (attrnamespace == POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE && + !strcmp(name, POSIX1E_ACL_DEFAULT_EXTATTR_NAME)) + return (EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT); + + if (attrnamespace == POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE && + !strcmp(name, POSIX1E_ACL_ACCESS_EXTATTR_NAME)) + return (EXT4_XATTR_INDEX_POSIX_ACL_ACCESS); + + switch (attrnamespace) { + case EXTATTR_NAMESPACE_SYSTEM: + return (EXT4_XATTR_INDEX_SYSTEM); + + case EXTATTR_NAMESPACE_USER: + return (EXT4_XATTR_INDEX_USER); } + /* + * In this case namespace conversion should be unique, + * so this point is unreachable. + */ return (-1); } +static const char * +ext2_extattr_name_to_linux(int attrnamespace, const char *name) +{ + + if (attrnamespace == POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE || + attrnamespace == POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE) + return (""); + else + return (name); +} + int ext2_extattr_valid_attrname(int attrnamespace, const char *attrname) { @@ -114,6 +171,8 @@ ext2_extattr_inode_list(struct inode *ip struct buf *bp; struct ext2fs_extattr_dinode_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; int error; fs = ip->i_e2fs; @@ -147,17 +206,26 @@ ext2_extattr_inode_list(struct inode *ip for (entry = EXT2_IFIRST(header); !EXT2_IS_LAST_ENTRY(entry); entry = EXT2_EXTATTR_NEXT(entry)) { - if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + if (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) != + attrnamespace) continue; + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + if (uio == NULL) - *size += entry->e_name_len + 1; + *size += name_len + 1; else { - char *attr_name = malloc(entry->e_name_len + 1, M_TEMP, M_WAITOK); - attr_name[0] = entry->e_name_len; - memcpy(&attr_name[1], entry->e_name, entry->e_name_len); - error = uiomove(attr_name, entry->e_name_len + 1, uio); - free(attr_name, M_TEMP); + char *name = malloc(name_len + 1, M_TEMP, M_WAITOK); + name[0] = name_len; + memcpy(&name[1], attr_name, name_len); + error = uiomove(name, name_len + 1, uio); + free(name, M_TEMP); if (error) break; } @@ -176,6 +244,8 @@ ext2_extattr_block_list(struct inode *ip struct buf *bp; struct ext2fs_extattr_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; int error; fs = ip->i_e2fs; @@ -202,17 +272,26 @@ ext2_extattr_block_list(struct inode *ip for (entry = EXT2_FIRST_ENTRY(bp); !EXT2_IS_LAST_ENTRY(entry); entry = EXT2_EXTATTR_NEXT(entry)) { - if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + if (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) != + attrnamespace) continue; + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + if (uio == NULL) - *size += entry->e_name_len + 1; + *size += name_len + 1; else { - char *attr_name = malloc(entry->e_name_len + 1, M_TEMP, M_WAITOK); - attr_name[0] = entry->e_name_len; - memcpy(&attr_name[1], entry->e_name, entry->e_name_len); - error = uiomove(attr_name, entry->e_name_len + 1, uio); - free(attr_name, M_TEMP); + char *name = malloc(name_len + 1, M_TEMP, M_WAITOK); + name[0] = name_len; + memcpy(&name[1], attr_name, name_len); + error = uiomove(name, name_len + 1, uio); + free(name, M_TEMP); if (error) break; } @@ -231,6 +310,8 @@ ext2_extattr_inode_get(struct inode *ip, struct buf *bp; struct ext2fs_extattr_dinode_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; int error; fs = ip->i_e2fs; @@ -264,11 +345,20 @@ ext2_extattr_inode_get(struct inode *ip, for (entry = EXT2_IFIRST(header); !EXT2_IS_LAST_ENTRY(entry); entry = EXT2_EXTATTR_NEXT(entry)) { - if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + if (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) != + attrnamespace) continue; - if (strlen(name) == entry->e_name_len && - 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + + if (strlen(name) == name_len && + 0 == strncmp(attr_name, name, name_len)) { if (uio == NULL) *size += entry->e_value_size; else { @@ -294,6 +384,8 @@ ext2_extattr_block_get(struct inode *ip, struct buf *bp; struct ext2fs_extattr_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; int error; fs = ip->i_e2fs; @@ -320,11 +412,20 @@ ext2_extattr_block_get(struct inode *ip, for (entry = EXT2_FIRST_ENTRY(bp); !EXT2_IS_LAST_ENTRY(entry); entry = EXT2_EXTATTR_NEXT(entry)) { - if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + if (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) != + attrnamespace) continue; - if (strlen(name) == entry->e_name_len && - 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + + if (strlen(name) == name_len && + 0 == strncmp(attr_name, name, name_len)) { if (uio == NULL) *size += entry->e_value_size; else { @@ -411,6 +512,8 @@ ext2_extattr_inode_delete(struct inode * struct buf *bp; struct ext2fs_extattr_dinode_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; int error; fs = ip->i_e2fs; @@ -444,9 +547,20 @@ ext2_extattr_inode_delete(struct inode * /* If I am last entry, just make magic zero */ entry = EXT2_IFIRST(header); - if (EXT2_IS_LAST_ENTRY(EXT2_EXTATTR_NEXT(entry))) { - if (strlen(name) == entry->e_name_len && - 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + if ((EXT2_IS_LAST_ENTRY(EXT2_EXTATTR_NEXT(entry))) && + (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) == + attrnamespace)) { + + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + + if (strlen(name) == name_len && + 0 == strncmp(attr_name, name, name_len)) { memset(header, 0, sizeof(struct ext2fs_extattr_dinode_header)); return (bwrite(bp)); @@ -455,11 +569,20 @@ ext2_extattr_inode_delete(struct inode * for (entry = EXT2_IFIRST(header); !EXT2_IS_LAST_ENTRY(entry); entry = EXT2_EXTATTR_NEXT(entry)) { - if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + if (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) != + attrnamespace) continue; - if (strlen(name) == entry->e_name_len && - 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + + if (strlen(name) == name_len && + 0 == strncmp(attr_name, name, name_len)) { ext2_extattr_delete_entry((char *)EXT2_IFIRST(header), EXT2_IFIRST(header), entry, (char *)dinode + EXT2_INODE_SIZE(fs)); @@ -521,6 +644,8 @@ ext2_extattr_block_delete(struct inode * struct buf *bp; struct ext2fs_extattr_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; int error; fs = ip->i_e2fs; @@ -555,9 +680,20 @@ ext2_extattr_block_delete(struct inode * /* If I am last entry, clean me and free the block */ entry = EXT2_FIRST_ENTRY(bp); - if (EXT2_IS_LAST_ENTRY(EXT2_EXTATTR_NEXT(entry))) { - if (strlen(name) == entry->e_name_len && - 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + if (EXT2_IS_LAST_ENTRY(EXT2_EXTATTR_NEXT(entry)) && + (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) == + attrnamespace)) { + + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + + if (strlen(name) == name_len && + 0 == strncmp(attr_name, name, name_len)) { ip->i_blocks -= btodb(fs->e2fs_bsize); ext2_blkfree(ip, ip->i_facl, fs->e2fs_bsize); ip->i_facl = 0; @@ -570,11 +706,20 @@ ext2_extattr_block_delete(struct inode * for (entry = EXT2_FIRST_ENTRY(bp); !EXT2_IS_LAST_ENTRY(entry); entry = EXT2_EXTATTR_NEXT(entry)) { - if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + if (ext2_extattr_attrnamespace_to_bsd(entry->e_name_index) != + attrnamespace) continue; - if (strlen(name) == entry->e_name_len && - 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + name_len = entry->e_name_len; + attr_name = ext2_extattr_name_to_bsd(entry->e_name_index, + entry->e_name, &name_len); + if (!attr_name) { + brelse(bp); + return (ENOTSUP); + } + + if (strlen(name) == name_len && + 0 == strncmp(attr_name, name, name_len)) { ext2_extattr_delete_entry(bp->b_data, EXT2_FIRST_ENTRY(bp), entry, bp->b_data + bp->b_bufsize); @@ -592,15 +737,18 @@ static struct ext2fs_extattr_entry * allocate_entry(const char *name, int attrnamespace, uint16_t offs, uint32_t size, uint32_t hash) { - size_t name_len; + const char *attr_name; + int name_len; struct ext2fs_extattr_entry *entry; - name_len = strlen(name); + attr_name = ext2_extattr_name_to_linux(attrnamespace, name); + name_len = strlen(attr_name); + entry = malloc(sizeof(struct ext2fs_extattr_entry) + name_len, M_TEMP, M_WAITOK); entry->e_name_len = name_len; - entry->e_name_index = ext2_extattr_index_to_linux(attrnamespace); + entry->e_name_index = ext2_extattr_attrnamespace_to_linux(attrnamespace, name); entry->e_value_offs = offs; entry->e_value_block = 0; entry->e_value_size = size; @@ -727,6 +875,8 @@ ext2_extattr_inode_set(struct inode *ip, struct buf *bp; struct ext2fs_extattr_dinode_header *header; struct ext2fs_extattr_entry *entry; + const char *attr_name; + int name_len; size_t size = 0, max_size; int error; @@ -762,11 +912,20 @@ ext2_extattr_inode_set(struct inode *ip, /* Find if entry exist */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun May 28 16:41:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68BF5D85675; Sun, 28 May 2017 16:41:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 390891AF5; Sun, 28 May 2017 16:41:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SGfgha088232; Sun, 28 May 2017 16:41:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SGfgFJ088231; Sun, 28 May 2017 16:41:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281641.v4SGfgFJ088231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 16:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319072 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 16:41:43 -0000 Author: trasz Date: Sun May 28 16:41:42 2017 New Revision: 319072 URL: https://svnweb.freebsd.org/changeset/base/319072 Log: Make ctld(8) mention cfiscsi(4). MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.8 Modified: head/usr.sbin/ctld/ctld.8 ============================================================================== --- head/usr.sbin/ctld/ctld.8 Sun May 28 15:39:11 2017 (r319071) +++ head/usr.sbin/ctld/ctld.8 Sun May 28 16:41:42 2017 (r319072) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd May 28, 2017 .Dt CTLD 8 .Os .Sh NAME @@ -55,7 +55,9 @@ instances, removes LUNs no longer existi and creates new LUNs as necessary. After that it listens for the incoming iSCSI connections, performs authentication, and, if successful, passes the connections to the kernel part -of CTL iSCSI target, which handles it from that point. +of CTL iSCSI target, +.Xr cfiscsi 4 , +which handles it from that point. .Pp When it receives a SIGHUP signal, the .Nm @@ -105,6 +107,7 @@ The .Nm utility exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO +.Xr cfiscsi 4 , .Xr ctl 4 , .Xr ctl.conf 5 , .Xr ctladm 8 , From owner-svn-src-head@freebsd.org Sun May 28 16:53:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D67FD85A3E; Sun, 28 May 2017 16:53:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE211204; Sun, 28 May 2017 16:53:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SGrMwj095393; Sun, 28 May 2017 16:53:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SGrMk7095392; Sun, 28 May 2017 16:53:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281653.v4SGrMk7095392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 16:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319073 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 16:53:23 -0000 Author: trasz Date: Sun May 28 16:53:21 2017 New Revision: 319073 URL: https://svnweb.freebsd.org/changeset/base/319073 Log: Random tweaks to cfiscsi(4) man page. MFC after: 2 weeks Modified: head/share/man/man4/cfiscsi.4 Modified: head/share/man/man4/cfiscsi.4 ============================================================================== --- head/share/man/man4/cfiscsi.4 Sun May 28 16:41:42 2017 (r319072) +++ head/share/man/man4/cfiscsi.4 Sun May 28 16:53:21 2017 (r319073) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 29, 2017 +.Dd May 28, 2017 .Dt CFISCSI 4 .Os .Sh NAME @@ -50,9 +50,15 @@ cfiscsi_load="YES" .Sh DESCRIPTION The .Nm -subsystem provides iSCSI target device emulation via +subsystem provides the kernel component of an iSCSI target. +The target is the iSCSI server, providing LUNs backed by local files +and volumes to remote initiators. +The userspace component is provided by +.Xr ctld 8 . +.Nm +is implemented as a .Xr ctl 4 -and +frontend and uses infrastructure provided by .Xr iscsi 4 . .Sh SYSCTL VARIABLES The following variables are available as both @@ -80,7 +86,9 @@ Defaults to 5. .El .Sh SEE ALSO .Xr ctl 4 , -.Xr iscsi 4 +.Xr iscsi 4 , +.Xr ctl.conf 5 , +.Xr ctld 8 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Sun May 28 17:02:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5859ED85F96; Sun, 28 May 2017 17:02:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D06C1971; Sun, 28 May 2017 17:02:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SH2UPY099859; Sun, 28 May 2017 17:02:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SH2TjS099857; Sun, 28 May 2017 17:02:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281702.v4SH2TjS099857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 17:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319074 - in head: share/man/man4 usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 17:02:31 -0000 Author: trasz Date: Sun May 28 17:02:29 2017 New Revision: 319074 URL: https://svnweb.freebsd.org/changeset/base/319074 Log: Minor tweaks to iscsi(4) and iscsid(8). MFC after: 2 weeks Modified: head/share/man/man4/iscsi.4 head/usr.sbin/iscsid/iscsid.8 Modified: head/share/man/man4/iscsi.4 ============================================================================== --- head/share/man/man4/iscsi.4 Sun May 28 16:53:21 2017 (r319073) +++ head/share/man/man4/iscsi.4 Sun May 28 17:02:29 2017 (r319074) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 11, 2015 +.Dd May 28, 2017 .Dt ISCSI 4 .Os .Sh NAME @@ -46,18 +46,14 @@ iscsi_load="YES" .Sh DESCRIPTION The .Nm -subsystem provides the kernel component of an iSCSI initiator. +subsystem provides the kernel component of an iSCSI initiator, +responsible for implementing the Full Feature Phase of the iSCSI protocol. The initiator is the iSCSI client, which connects to an iSCSI target, providing local access to a remote block device. The userland component is provided by .Xr iscsid 8 and both the kernel and userland are configured using .Xr iscsictl 8 . -The -.Nm -subsystem is responsible for implementing the -.Qq Full Feature Phase -of the iSCSI protocol. .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 Modified: head/usr.sbin/iscsid/iscsid.8 ============================================================================== --- head/usr.sbin/iscsid/iscsid.8 Sun May 28 16:53:21 2017 (r319073) +++ head/usr.sbin/iscsid/iscsid.8 Sun May 28 17:02:29 2017 (r319074) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 2014 +.Dd May 28, 2017 .Dt ISCSID 8 .Os .Sh NAME @@ -43,12 +43,15 @@ .Sh DESCRIPTION The .Nm -daemon is responsible for performing the Login Phase of iSCSI connections, -as well as performing SendTargets discovery. +daemon is the userspace component of the iSCSI initiator, +responsible for performing the Login Phase +of iSCSI connections and the SendTargets discovery. .Pp Upon startup, the .Nm -daemon opens the iSCSI initiator device file and waits for kernel requests. +daemon opens the iSCSI initiator device file and waits for requests +from the kernel component, +.Xr iscsi 4 . .Nm does not use any configuration files. All needed information is supplied by the kernel. From owner-svn-src-head@freebsd.org Sun May 28 17:13:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46DADD8543F; Sun, 28 May 2017 17:13:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16E661016; Sun, 28 May 2017 17:13:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SHDdxE004023; Sun, 28 May 2017 17:13:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SHDdqx004022; Sun, 28 May 2017 17:13:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281713.v4SHDdqx004022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 17:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319075 - head/usr.bin/rctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 17:13:40 -0000 Author: trasz Date: Sun May 28 17:13:38 2017 New Revision: 319075 URL: https://svnweb.freebsd.org/changeset/base/319075 Log: Random tweaks to rctl(8). MFC after: 2 weeks Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sun May 28 17:02:29 2017 (r319074) +++ head/usr.bin/rctl/rctl.8 Sun May 28 17:13:38 2017 (r319075) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2016 +.Dd may 28, 2017 .Dt RCTL 8 .Os .Sh NAME @@ -84,7 +84,7 @@ Remove rules matching .Ar filter from the RCTL database. .It Fl u Ar filter -Display resource usage for a subject +Display resource utilization for a subject .Po .Sy process , .Sy user , @@ -173,7 +173,6 @@ resource would be "::maxproc". .Sh SUBJECTS .Bl -column -offset 3n "pseudoterminals" ".Sy username or numerical User ID" -.It Em subject Ta Em subject-id .It Sy process Ta numerical Process ID .It Sy user Ta user name or numerical User ID .It Sy loginclass Ta login class from @@ -182,7 +181,6 @@ resource would be .El .Sh RESOURCES .Bl -column -offset 3n "pseudoterminals" -.It Em resource .It Sy cputime Ta "CPU time, in seconds" .It Sy datasize Ta "data size, in bytes" .It Sy stacksize Ta "stack size, in bytes" @@ -211,7 +209,6 @@ resource would be .El .Sh ACTIONS .Bl -column -offset 3n "pseudoterminals" -.It Em action .It Sy deny Ta deny the allocation; not supported for .Sy cputime , .Sy wallclock , @@ -269,7 +266,7 @@ Prevent user "joe" from allocating more Remove all RCTL rules: .Dl Nm Fl r Ar \&: .Pp -Display resource usage information for jail named "www": +Display resource utilization information for jail named "www": .Dl Nm Fl hu Ar jail:www .Pp Display all the rules applicable to process with PID 512: From owner-svn-src-head@freebsd.org Sun May 28 17:25:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B878D8596C; Sun, 28 May 2017 17:25:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6840E195F; Sun, 28 May 2017 17:25:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SHPl5r008358; Sun, 28 May 2017 17:25:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SHPlUO008355; Sun, 28 May 2017 17:25:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281725.v4SHPlUO008355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 17:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319076 - in head: share/man/man4 usr.bin/rctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 17:25:48 -0000 Author: trasz Date: Sun May 28 17:25:47 2017 New Revision: 319076 URL: https://svnweb.freebsd.org/changeset/base/319076 Log: Declutter rctl(8) by moving kernel build instructions into newly created rctl(4). MFC after: 2 weeks Added: head/share/man/man4/rctl.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/usr.bin/rctl/rctl.8 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun May 28 17:13:38 2017 (r319075) +++ head/share/man/man4/Makefile Sun May 28 17:25:47 2017 (r319076) @@ -427,6 +427,7 @@ MAN= aac.4 \ ral.4 \ random.4 \ rc.4 \ + rctl.4 \ re.4 \ rgephy.4 \ rights.4 \ Added: head/share/man/man4/rctl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rctl.4 Sun May 28 17:25:47 2017 (r319076) @@ -0,0 +1,74 @@ +.\" Copyright (c) 2017 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.Dd May 28, 2017 +.Dt RCTL 4 +.Os +.Sh NAME +.Nm rctl +.Nd resource limits +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "options RACCT" +.Cd "options RCTL" +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides a flexible resource limits mechanism, +controlled by a set of rules that can be added or removed at runtime +using the +.Xr rctl 8 +management utility. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt, or +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va kern.racct.enable: No 1 +Enable +.Nm . +This defaults to 1, unless +.Cd "options RACCT_DEFAULT_TO_DISABLED" +is set in the kernel configuration file. +.El +.Sh SEE ALSO +.Xr rctl.conf 5 , +.Xr rctl 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 9.0 . +.Sh AUTHORS +The +.Nm +subsystem was developed by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sun May 28 17:13:38 2017 (r319075) +++ head/usr.bin/rctl/rctl.8 Sun May 28 17:25:47 2017 (r319076) @@ -51,13 +51,6 @@ .Fl u .Op Fl h .Ar filter Ar ... -.Pp -.Nm -requires the kernel to be compiled with: -.Bd -ragged -offset indent -.Cd "options RACCT" -.Cd "options RCTL" -.Ed .Sh DESCRIPTION When called without options, the .Nm @@ -244,19 +237,6 @@ and Not all actions are supported for all resources. Attempting to add a rule with an action not supported by a given resource will result in error. -.Sh LOADER TUNABLES -Tunables can be set at the -.Xr loader 8 -prompt, or -.Xr loader.conf 5 . -.Bl -tag -width indent -.It Va kern.racct.enable: No 1 -Enable -.Nm . -This defaults to 1, unless -.Cd "options RACCT_DEFAULT_TO_DISABLED" -is set in the kernel configuration file. -.El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -281,6 +261,7 @@ Display all rules matching user "joe": Display all rules matching login classes: .Dl Nm Ar loginclass: .Sh SEE ALSO +.Xr rctl 4 , .Xr rctl.conf 5 .Sh HISTORY The From owner-svn-src-head@freebsd.org Sun May 28 17:48:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B17D85E0D; Sun, 28 May 2017 17:48:55 +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 9734D1215; Sun, 28 May 2017 17:48:55 +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 v4SHmsJT016676; Sun, 28 May 2017 17:48:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SHmsaU016675; Sun, 28 May 2017 17:48:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201705281748.v4SHmsaU016675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 28 May 2017 17:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319077 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 17:48:55 -0000 Author: pfg Date: Sun May 28 17:48:54 2017 New Revision: 319077 URL: https://svnweb.freebsd.org/changeset/base/319077 Log: Fix potential memory leak. Moving the allocation forward, just before it's actually needed, seems sensible. Add newline character at the last line while here. Reported by: pluknet Differential Revision: https://reviews.freebsd.org/D10974 Modified: head/sys/fs/ext2fs/ext2_acl.c Modified: head/sys/fs/ext2fs/ext2_acl.c ============================================================================== --- head/sys/fs/ext2fs/ext2_acl.c Sun May 28 17:25:47 2017 (r319076) +++ head/sys/fs/ext2fs/ext2_acl.c Sun May 28 17:48:54 2017 (r319077) @@ -210,11 +210,6 @@ ext2_getacl_posix1e(struct vop_getacl_ar int len; int error; - len = sizeof(*ap->a_aclp) + sizeof(struct ext2_acl_header); - value = malloc(len, M_ACL, M_WAITOK); - if (!value) - return (ENOMEM); - switch (ap->a_type) { case ACL_TYPE_DEFAULT: attrnamespace = POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE; @@ -228,6 +223,11 @@ ext2_getacl_posix1e(struct vop_getacl_ar return (EINVAL); } + len = sizeof(*ap->a_aclp) + sizeof(struct ext2_acl_header); + value = malloc(len, M_ACL, M_WAITOK); + if (!value) + return (ENOMEM); + error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, attrnamespace, attrname, &len, value, ap->a_td); switch (error) { @@ -518,4 +518,4 @@ ext2_aclcheck(struct vop_aclcheck_args * } return (acl_posix1e_check(ap->a_aclp)); -} \ No newline at end of file +} From owner-svn-src-head@freebsd.org Sun May 28 17:50:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D8ED85E9E; Sun, 28 May 2017 17:50: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 480F91384; Sun, 28 May 2017 17:50:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SHoTdS016791; Sun, 28 May 2017 17:50:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SHoTbp016790; Sun, 28 May 2017 17:50:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705281750.v4SHoTbp016790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 17:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319078 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 17:50:30 -0000 Author: ngie Date: Sun May 28 17:50:29 2017 New Revision: 319078 URL: https://svnweb.freebsd.org/changeset/base/319078 Log: Tweak r319058 slightly - Specify an explicit mode when using O_CREAT per open(2). - Fix the error message (add missing enclosing parentheses). Submitted by: jilles MFC after: 3 days MFC with: r319058 Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/ftruncate_test.c Modified: head/tests/sys/file/ftruncate_test.c ============================================================================== --- head/tests/sys/file/ftruncate_test.c Sun May 28 17:48:54 2017 (r319077) +++ head/tests/sys/file/ftruncate_test.c Sun May 28 17:50:29 2017 (r319078) @@ -75,9 +75,9 @@ main(void) * Save a read-only reference to the file to use later for read-only * descriptor tests. */ - fd = open(path, O_RDWR|O_CREAT); + fd = open(path, O_RDWR|O_CREAT, 0600); if (fd < 0) - err(1, "open(%s, O_RDWR|O_CREAT", path); + err(1, "open(%s, O_RDWR|O_CREAT, 0600)", path); read_only_fd = open(path, O_RDONLY); if (read_only_fd < 0) { error = errno; From owner-svn-src-head@freebsd.org Sun May 28 18:07:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 277B6D86305; Sun, 28 May 2017 18:07:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1A7B1CD3; Sun, 28 May 2017 18:07:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SI7r29024556; Sun, 28 May 2017 18:07:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SI7r4X024552; Sun, 28 May 2017 18:07:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281807.v4SI7r4X024552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 18:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319079 - in head: . sbin/mount share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 18:07:55 -0000 Author: trasz Date: Sun May 28 18:07:53 2017 New Revision: 319079 URL: https://svnweb.freebsd.org/changeset/base/319079 Log: Move mount.conf(8) to mount.conf(5); it's a kernel configuration file and not an administrative utility. MFC after: 2 weeks Added: head/share/man/man5/mount.conf.5 - copied, changed from r319078, head/sbin/mount/mount.conf.8 Deleted: head/sbin/mount/mount.conf.8 Modified: head/ObsoleteFiles.inc head/sbin/mount/Makefile head/share/man/man5/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun May 28 17:50:29 2017 (r319078) +++ head/ObsoleteFiles.inc Sun May 28 18:07:53 2017 (r319079) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170529: mount.conf(8) -> mount.conf(5) +OLD_FILES+=usr/share/man/man8/mount.conf.8.gz # 20170525: remove misleading template OLD_FILES+=usr/share/misc/man.template # 20170525: disconnect the roff docs from the build Modified: head/sbin/mount/Makefile ============================================================================== --- head/sbin/mount/Makefile Sun May 28 17:50:29 2017 (r319078) +++ head/sbin/mount/Makefile Sun May 28 18:07:53 2017 (r319079) @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -MAN= mount.8 mount.conf.8 +MAN= mount.8 # We do NOT install the getmntopts.3 man page. LIBADD= util Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Sun May 28 17:50:29 2017 (r319078) +++ head/share/man/man5/Makefile Sun May 28 18:07:53 2017 (r319079) @@ -40,6 +40,7 @@ MAN= acct.5 \ make.conf.5 \ moduli.5 \ motd.5 \ + mount.conf.5 \ mqueuefs.5 \ msdosfs.5 \ networks.5 \ Copied and modified: head/share/man/man5/mount.conf.5 (from r319078, head/sbin/mount/mount.conf.8) ============================================================================== --- head/sbin/mount/mount.conf.8 Sun May 28 17:50:29 2017 (r319078, copy source) +++ head/share/man/man5/mount.conf.5 Sun May 28 18:07:53 2017 (r319079) @@ -27,7 +27,7 @@ .\" .\" .Dd October 17, 2013 -.Dt MOUNT.CONF 8 +.Dt MOUNT.CONF 5 .Os .Sh NAME .Nm mount.conf From owner-svn-src-head@freebsd.org Sun May 28 18:09:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A53D8639B; Sun, 28 May 2017 18:09:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5D4D1E2C; Sun, 28 May 2017 18:09:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SI9nH7024665; Sun, 28 May 2017 18:09:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SI9nT2024664; Sun, 28 May 2017 18:09:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281809.v4SI9nT2024664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 18:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319080 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 18:09:50 -0000 Author: trasz Date: Sun May 28 18:09:49 2017 New Revision: 319080 URL: https://svnweb.freebsd.org/changeset/base/319080 Log: Fix Xrs; they were pointing to the wrong section. MFC after: 2 weeks Modified: head/share/man/man5/mount.conf.5 Modified: head/share/man/man5/mount.conf.5 ============================================================================== --- head/share/man/man5/mount.conf.5 Sun May 28 18:07:53 2017 (r319079) +++ head/share/man/man5/mount.conf.5 Sun May 28 18:09:49 2017 (r319080) @@ -52,7 +52,7 @@ The logic for this is in .Fn vfs_mountroot_conf0 . .It The kernel will first mount -.Xr devfs 8 +.Xr devfs 5 as the root file system. .It Next, the kernel will parse the in-memory config file created in step 1 @@ -224,7 +224,7 @@ For each root file system which is mount directory .Em must exist so that the root mount logic can properly re-mount -.Xr devfs 8 . +.Xr devfs 5 . If this directory does not exist, the system may hang during the bootup process. .Sh SEE ALSO From owner-svn-src-head@freebsd.org Sun May 28 18:13:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D8ECD8672E; Sun, 28 May 2017 18:13:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD6D1395; Sun, 28 May 2017 18:13:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SIDiSt028665; Sun, 28 May 2017 18:13:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SIDiIw028664; Sun, 28 May 2017 18:13:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201705281813.v4SIDiIw028664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 May 2017 18:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319081 - head/sbin/reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 18:13:45 -0000 Author: trasz Date: Sun May 28 18:13:44 2017 New Revision: 319081 URL: https://svnweb.freebsd.org/changeset/base/319081 Log: .Xr mount.conf(5) from boot(8). MFC after: 2 weeks Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Sun May 28 18:09:49 2017 (r319080) +++ head/sbin/reboot/boot_i386.8 Sun May 28 18:13:44 2017 (r319081) @@ -350,6 +350,7 @@ requirement has not been adhered to. .Xr ddb 4 , .Xr boot.config 5 , .Xr make.conf 5 , +.Xr mount.conf 5 , .Xr ttys 5 , .Xr boot0cfg 8 , .Xr btxld 8 , From owner-svn-src-head@freebsd.org Sun May 28 18:31:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5866CD86BE8; Sun, 28 May 2017 18:31: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 1E0FE1C03; Sun, 28 May 2017 18:31: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 v4SIVEYG033827; Sun, 28 May 2017 18:31:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SIVE5v033826; Sun, 28 May 2017 18:31:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201705281831.v4SIVE5v033826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 28 May 2017 18:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319083 - head/sys/boot/i386/pxeldr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 18:31:15 -0000 Author: bapt Date: Sun May 28 18:31:13 2017 New Revision: 319083 URL: https://svnweb.freebsd.org/changeset/base/319083 Log: Followup on the user-class changes Reported by: Jose Luis Duran (via github) Modified: head/sys/boot/i386/pxeldr/pxeboot.8 Modified: head/sys/boot/i386/pxeldr/pxeboot.8 ============================================================================== --- head/sys/boot/i386/pxeldr/pxeboot.8 Sun May 28 18:18:01 2017 (r319082) +++ head/sys/boot/i386/pxeldr/pxeboot.8 Sun May 28 18:31:13 2017 (r319083) @@ -74,7 +74,7 @@ max-lease-time 120; subnet 10.0.0.0 netmask 255.255.255.0 { filename "pxeboot"; range 10.0.0.10 10.0.0.254; - if exists user-class and option user-class = "FREEBSD" { + if exists user-class and option user-class = "FreeBSD" { option root-path "tftp://10.0.0.1/FreeBSD"; } } From owner-svn-src-head@freebsd.org Sun May 28 21:20:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A7BD85BD3; Sun, 28 May 2017 21:20:57 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 158DD19C9; Sun, 28 May 2017 21:20:57 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SLKuX8002860; Sun, 28 May 2017 21:20:56 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SLKuoD002859; Sun, 28 May 2017 21:20:56 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201705282120.v4SLKuoD002859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 28 May 2017 21:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319084 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 21:20:57 -0000 Author: tsoome Date: Sun May 28 21:20:55 2017 New Revision: 319084 URL: https://svnweb.freebsd.org/changeset/base/319084 Log: Small cleanup in dev_net.c The variable servip is unused. One leftover printf and small cstyle nit. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10980 Modified: head/sys/boot/common/dev_net.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Sun May 28 18:31:13 2017 (r319083) +++ head/sys/boot/common/dev_net.c Sun May 28 21:20:55 2017 (r319084) @@ -256,7 +256,6 @@ net_getparams(int sock) { char buf[MAXHOSTNAMELEN]; n_long rootaddr, smask; - extern struct in_addr servip; #ifdef SUPPORT_BOOTP /* @@ -421,8 +420,8 @@ net_parse_rootpath() val = strchr(ptr, '/'); if (val != NULL) { snprintf(ip, sizeof(ip), "%.*s", - (int)((uintptr_t)val - (uintptr_t)ptr), ptr); - printf("%s\n", ip); + (int)((uintptr_t)val - (uintptr_t)ptr), + ptr); addr = inet_addr(ip); bcopy(val, rootpath, strlen(val) + 1); } From owner-svn-src-head@freebsd.org Sun May 28 21:30:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AA1CD85E3A; Sun, 28 May 2017 21:30:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE4F1F53; Sun, 28 May 2017 21:30:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SLU1nU006717; Sun, 28 May 2017 21:30:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SLU1FX006716; Sun, 28 May 2017 21:30:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201705282130.v4SLU1FX006716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 28 May 2017 21:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319085 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 21:30:02 -0000 Author: tsoome Date: Sun May 28 21:30:01 2017 New Revision: 319085 URL: https://svnweb.freebsd.org/changeset/base/319085 Log: use the same option list for dhcp discovery and request The DHCP client is supposed to use the same option request list for both DHCP discovery and request. This will also allow us to fill the list in single function. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10981 Modified: head/lib/libstand/bootp.c Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Sun May 28 21:20:55 2017 (r319084) +++ head/lib/libstand/bootp.c Sun May 28 21:30:01 2017 (r319085) @@ -93,6 +93,35 @@ struct in_addr dhcp_serverip; struct bootp *bootp_response; size_t bootp_response_size; +static void +bootp_fill_request(unsigned char *bp_vend) +{ + /* + * We are booting from PXE, we want to send the string + * 'PXEClient' to the DHCP server so you have the option of + * only responding to PXE aware dhcp requests. + */ + bp_vend[0] = TAG_CLASSID; + bp_vend[1] = 9; + bcopy("PXEClient", &bp_vend[2], 9); + bp_vend[11] = TAG_USER_CLASS; + /* len of each user class + number of user class */ + bp_vend[12] = 8; + /* len of the first user class */ + bp_vend[13] = 7; + bcopy("FreeBSD", &bp_vend[14], 7); + bp_vend[21] = TAG_PARAM_REQ; + bp_vend[22] = 7; + bp_vend[23] = TAG_ROOTPATH; + bp_vend[24] = TAG_HOSTNAME; + bp_vend[25] = TAG_SWAPSERVER; + bp_vend[26] = TAG_GATEWAY; + bp_vend[27] = TAG_SUBNET_MASK; + bp_vend[28] = TAG_INTF_MTU; + bp_vend[29] = TAG_SERVERID; + bp_vend[30] = TAG_END; +} + /* Fetch required bootp infomation */ void bootp(int sock) @@ -136,31 +165,8 @@ bootp(int sock) bp->bp_vend[4] = TAG_DHCP_MSGTYPE; bp->bp_vend[5] = 1; bp->bp_vend[6] = DHCPDISCOVER; + bootp_fill_request(&bp->bp_vend[7]); - /* - * We are booting from PXE, we want to send the string - * 'PXEClient' to the DHCP server so you have the option of - * only responding to PXE aware dhcp requests. - */ - bp->bp_vend[7] = TAG_CLASSID; - bp->bp_vend[8] = 9; - bcopy("PXEClient", &bp->bp_vend[9], 9); - bp->bp_vend[18] = TAG_USER_CLASS; - /* len of each user class + number of user class */ - bp->bp_vend[19] = 8; - /* len of the first user class */ - bp->bp_vend[20] = 7; - bcopy("FreeBSD", &bp->bp_vend[21], 7); - bp->bp_vend[28] = TAG_PARAM_REQ; - bp->bp_vend[29] = 7; - bp->bp_vend[30] = TAG_ROOTPATH; - bp->bp_vend[31] = TAG_HOSTNAME; - bp->bp_vend[32] = TAG_SWAPSERVER; - bp->bp_vend[33] = TAG_GATEWAY; - bp->bp_vend[34] = TAG_SUBNET_MASK; - bp->bp_vend[35] = TAG_INTF_MTU; - bp->bp_vend[36] = TAG_SERVERID; - bp->bp_vend[37] = TAG_END; #else bp->bp_vend[4] = TAG_END; #endif @@ -196,10 +202,7 @@ bootp(int sock) bp->bp_vend[20] = 4; leasetime = htonl(300); bcopy(&leasetime, &bp->bp_vend[21], 4); - bp->bp_vend[25] = TAG_CLASSID; - bp->bp_vend[26] = 9; - bcopy("PXEClient", &bp->bp_vend[27], 9); - bp->bp_vend[36] = TAG_END; + bootp_fill_request(&bp->bp_vend[25]); expected_dhcpmsgtype = DHCPACK; From owner-svn-src-head@freebsd.org Sun May 28 21:42:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31BAD862FD; Sun, 28 May 2017 21:42:48 +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 C520F17C0; Sun, 28 May 2017 21:42:48 +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 v4SLgltW014693; Sun, 28 May 2017 21:42:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SLglhx014692; Sun, 28 May 2017 21:42:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705282142.v4SLglhx014692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 May 2017 21:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319086 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 21:42:49 -0000 Author: kib Date: Sun May 28 21:42:47 2017 New Revision: 319086 URL: https://svnweb.freebsd.org/changeset/base/319086 Log: Mention that the basep argument to getdirentries(2) can be NULL. Noted by: dim Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D10972 Modified: head/lib/libc/sys/getdirentries.2 Modified: head/lib/libc/sys/getdirentries.2 ============================================================================== --- head/lib/libc/sys/getdirentries.2 Sun May 28 21:30:01 2017 (r319085) +++ head/lib/libc/sys/getdirentries.2 Sun May 28 21:42:47 2017 (r319086) @@ -125,7 +125,10 @@ or A value of zero is returned when the end of the directory has been reached. .Pp -The +If the +.Fa basep +pointer value is non-NULL , +the .Fn getdirentries system call writes the position of the block read into the location pointed to by .Fa basep . @@ -158,7 +161,7 @@ is not a valid file descriptor open for .It Bq Er EFAULT Either .Fa buf -or +or non-NULL .Fa basep point outside the allocated address space. .It Bq Er EINVAL From owner-svn-src-head@freebsd.org Sun May 28 22:38:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E88FD841A4; Sun, 28 May 2017 22:38:21 +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 006801351; Sun, 28 May 2017 22:38:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SMcK3Z034695; Sun, 28 May 2017 22:38:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SMcK8O034694; Sun, 28 May 2017 22:38:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201705282238.v4SMcK8O034694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 28 May 2017 22:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319087 - head/sys/dev/rtwn/rtl8192e/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 22:38:21 -0000 Author: avos Date: Sun May 28 22:38:19 2017 New Revision: 319087 URL: https://svnweb.freebsd.org/changeset/base/319087 Log: rtwn_usb: fix build with 'options RTWN_WITHOUT_UCODE' Modified: head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Modified: head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Sun May 28 21:42:47 2017 (r319086) +++ head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Sun May 28 22:38:19 2017 (r319087) @@ -141,11 +141,13 @@ r92eu_attach(struct rtwn_usb_softc *uc) sc->sc_vap_preattach = rtwn_nop_softc_vap; sc->sc_postattach = rtwn_nop_softc; sc->sc_detach_private = r92e_detach_private; - sc->sc_set_media_status = r92e_set_media_status; #ifndef RTWN_WITHOUT_UCODE + sc->sc_set_media_status = r92e_set_media_status; sc->sc_set_rsvd_page = r88e_set_rsvd_page; sc->sc_set_pwrmode = r92e_set_pwrmode; sc->sc_set_rssi = rtwn_nop_softc; /* XXX TODO? */ +#else + sc->sc_set_media_status = rtwn_nop_softc_int; #endif sc->sc_beacon_init = r12a_beacon_init; sc->sc_beacon_enable = r92c_beacon_enable; From owner-svn-src-head@freebsd.org Sun May 28 22:51:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7205BD84528; Sun, 28 May 2017 22:51:08 +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 2A00D18FB; Sun, 28 May 2017 22:51:08 +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 v4SMp7KJ038892; Sun, 28 May 2017 22:51:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SMp7Jn038891; Sun, 28 May 2017 22:51:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201705282251.v4SMp7Jn038891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 28 May 2017 22:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319088 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 22:51:08 -0000 Author: avos Date: Sun May 28 22:51:06 2017 New Revision: 319088 URL: https://svnweb.freebsd.org/changeset/base/319088 Log: rtwn: fix connection problems with 'options RTWN_WITHOUT_UCODE' sc_set_media_status() callback may involve some generic code in addition to firmware-specific part (e.g., link status register setup for RTL8188E); so, remove 'RTWN_WITHOUT_UCODE' ifdefs around it. Tested with RTL8188CUS, RTL8188EU and RTL8821AU, STA mode. Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sun May 28 22:38:19 2017 (r319087) +++ head/sys/dev/rtwn/if_rtwn.c Sun May 28 22:51:06 2017 (r319088) @@ -91,9 +91,9 @@ static struct ieee80211vap *rtwn_vap_cre static void rtwn_vap_delete(struct ieee80211vap *); static int rtwn_read_chipid(struct rtwn_softc *); static int rtwn_ioctl_reset(struct ieee80211vap *, u_long); -#ifndef RTWN_WITHOUT_UCODE static void rtwn_set_media_status(struct rtwn_softc *, union sec_param *); +#ifndef RTWN_WITHOUT_UCODE static int rtwn_tx_fwpkt_check(struct rtwn_softc *, struct ieee80211vap *); static int rtwn_construct_nulldata(struct rtwn_softc *, @@ -703,13 +703,13 @@ rtwn_ioctl_reset(struct ieee80211vap *va return (error); } -#ifndef RTWN_WITHOUT_UCODE static void rtwn_set_media_status(struct rtwn_softc *sc, union sec_param *data) { sc->sc_set_media_status(sc, data->macid); } +#ifndef RTWN_WITHOUT_UCODE static int rtwn_tx_fwpkt_check(struct rtwn_softc *sc, struct ieee80211vap *vap) { @@ -1743,11 +1743,9 @@ rtwn_newassoc(struct ieee80211_node *ni, return; } -#ifndef RTWN_WITHOUT_UCODE /* Notify firmware. */ id |= RTWN_MACID_VALID; rtwn_cmd_sleepable(sc, &id, sizeof(id), rtwn_set_media_status); -#endif } static void @@ -1759,10 +1757,8 @@ rtwn_node_free(struct ieee80211_node *ni RTWN_NT_LOCK(sc); if (un->id != RTWN_MACID_UNDEFINED) { sc->node_list[un->id] = NULL; -#ifndef RTWN_WITHOUT_UCODE rtwn_cmd_sleepable(sc, &un->id, sizeof(un->id), rtwn_set_media_status); -#endif } RTWN_NT_UNLOCK(sc); From owner-svn-src-head@freebsd.org Mon May 29 03:02:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62242D865DF; Mon, 29 May 2017 03:02:14 +0000 (UTC) (envelope-from freebsd@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 CD6DC1ECF; Mon, 29 May 2017 03:02:13 +0000 (UTC) (envelope-from freebsd@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 v4T322pN020241; Sun, 28 May 2017 20:02:02 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v4T31xQk020240; Sun, 28 May 2017 20:01:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201705290301.v4T31xQk020240@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r319075 - head/usr.bin/rctl In-Reply-To: <201705281713.v4SHDdqx004022@repo.freebsd.org> To: Edward Tomasz Napierala Date: Sun, 28 May 2017 20:01:59 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 03:02:14 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: trasz > Date: Sun May 28 17:13:38 2017 > New Revision: 319075 > URL: https://svnweb.freebsd.org/changeset/base/319075 > > Log: > Random tweaks to rctl(8). Please try to be descriptive of what it is your tweaking, think about having to come back in 10 years and read the svn log trying to find some change and seeing this in the log not knowing if that is the tweak your looking for or not. ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 29 03:09:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48107D86741; Mon, 29 May 2017 03:09:00 +0000 (UTC) (envelope-from freebsd@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 9D5CC1103; Mon, 29 May 2017 03:08:59 +0000 (UTC) (envelope-from freebsd@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 v4T38wLp020346; Sun, 28 May 2017 20:08:58 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v4T38w6k020345; Sun, 28 May 2017 20:08:58 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201705290308.v4T38w6k020345@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r319080 - head/share/man/man5 In-Reply-To: <201705281809.v4SI9nT2024664@repo.freebsd.org> To: Edward Tomasz Napierala Date: Sun, 28 May 2017 20:08:58 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 03:09:00 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: trasz > Date: Sun May 28 18:09:49 2017 > New Revision: 319080 > URL: https://svnweb.freebsd.org/changeset/base/319080 > > Log: > Fix Xrs; they were pointing to the wrong section. > > MFC after: 2 weeks > > Modified: > head/share/man/man5/mount.conf.5 > > Modified: head/share/man/man5/mount.conf.5 > ============================================================================== > --- head/share/man/man5/mount.conf.5 Sun May 28 18:07:53 2017 (r319079) > +++ head/share/man/man5/mount.conf.5 Sun May 28 18:09:49 2017 (r319080) > @@ -52,7 +52,7 @@ The logic for this is in > .Fn vfs_mountroot_conf0 . > .It > The kernel will first mount > -.Xr devfs 8 > +.Xr devfs 5 > as the root file system. Um, no, devfs(8) is the command, devfs(5) is the config file that descripts what devfs(8) well do. This sentence does read very well to me: The kernel will first mount devfs(8) as the root file system? Neither devfs(8) or (5) is a file system one is a utility command and the other is a config file. > .It > Next, the kernel will parse the in-memory config file created in step 1 > @@ -224,7 +224,7 @@ For each root file system which is mount > directory > .Em must > exist so that the root mount logic can properly re-mount > -.Xr devfs 8 . > +.Xr devfs 5 . Ditto > If this directory does not exist, the system > may hang during the bootup process. > .Sh SEE ALSO > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 29 06:30:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6912CA2E7B; Mon, 29 May 2017 06:30: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 A84BBCE2; Mon, 29 May 2017 06:30: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 v4T6UYU7029244; Mon, 29 May 2017 06:30:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T6UYUb029243; Mon, 29 May 2017 06:30:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201705290630.v4T6UYUb029243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 29 May 2017 06:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319096 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 06:30:35 -0000 Author: avg Date: Mon May 29 06:30:34 2017 New Revision: 319096 URL: https://svnweb.freebsd.org/changeset/base/319096 Log: zfs_lookup: fix bogus arguments to lookup of "snapshot" directory When a parent directory lookup is done at the root of a snapshot mounted under .zfs/snapshot directory, we need to look up that directory in the parent filesystem. We achieve that by doing a VOP_LOOKUP operation on a .zfs vnode with "snapshot" as a target name. But previously we also passed ISDOTDOT flag to the lookup and, because of that, the lookup actually returned the parent of the .zfs vnode, that is, a root vnode of the parent filesystem. Reported by: lev Tested by: lev MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon May 29 06:26:00 2017 (r319095) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon May 29 06:30:34 2017 (r319096) @@ -1635,7 +1635,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode cn.cn_nameptr = "snapshot"; cn.cn_namelen = strlen(cn.cn_nameptr); cn.cn_nameiop = cnp->cn_nameiop; - cn.cn_flags = cnp->cn_flags; + cn.cn_flags = cnp->cn_flags & ~ISDOTDOT; cn.cn_lkflags = cnp->cn_lkflags; error = VOP_LOOKUP(zfsctl_vp, vpp, &cn); vput(zfsctl_vp); From owner-svn-src-head@freebsd.org Mon May 29 07:15:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F6ACC2BD2; Mon, 29 May 2017 07:15:29 +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 B4A2A6E71D; Mon, 29 May 2017 07:15:29 +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 v4T7FSM9049956; Mon, 29 May 2017 07:15:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T7FSc6049955; Mon, 29 May 2017 07:15:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201705290715.v4T7FSc6049955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 29 May 2017 07:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319099 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 07:15:30 -0000 Author: cy Date: Mon May 29 07:15:28 2017 New Revision: 319099 URL: https://svnweb.freebsd.org/changeset/base/319099 Log: Revert r318789. It causes hanging NAT tcp sessions. Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Mon May 29 06:31:07 2017 (r319098) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Mon May 29 07:15:28 2017 (r319099) @@ -497,9 +497,7 @@ ipf_nat_soft_init(softc, arg) softn->ipf_nat_pending.ifq_next = NULL; for (i = 0, tq = softn->ipf_nat_tcptq; i < IPF_TCP_NSTATES; i++, tq++) { -#ifdef LARGE_NAT if (tq->ifq_ttl < softn->ipf_nat_deficmpage) -#endif tq->ifq_ttl = softn->ipf_nat_deficmpage; #ifdef LARGE_NAT else if (tq->ifq_ttl > softn->ipf_nat_defage) From owner-svn-src-head@freebsd.org Mon May 29 07:27:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7344ECC2F04; Mon, 29 May 2017 07:27:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4368F6EBC5; Mon, 29 May 2017 07:27:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T7R82S053983; Mon, 29 May 2017 07:27:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T7R8q7053982; Mon, 29 May 2017 07:27:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705290727.v4T7R8q7053982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 29 May 2017 07:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319100 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 07:27:09 -0000 Author: adrian Date: Mon May 29 07:27:08 2017 New Revision: 319100 URL: https://svnweb.freebsd.org/changeset/base/319100 Log: Update AP93 support to the new world order. * Map change: create a combined kernel+rootfs image. The instructions I'll post on the wiki (which will be for a very outdated dev board, but at least will explain the what/why for posterity) will include how to reset the boot command. Tested: * AP93 dev board (AR7240 + AR9280) Modified: head/sys/mips/conf/AP93.hints Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Mon May 29 07:15:28 2017 (r319099) +++ head/sys/mips/conf/AP93.hints Mon May 29 07:27:08 2017 (r319100) @@ -94,29 +94,15 @@ hint.map.1.readonly=1 hint.map.2.at="flash/spi0" hint.map.2.start=0x00080000 -# hint.map.2.end=0x00380000 -hint.map.2.end=0x00780000 -# hint.map.2.name="spare-rootfs" -hint.map.2.name="rootfs" -hint.map.2.readonly=1 - -#hint.map.3.at="flash/spi0" -#hint.map.3.start=0x00380000 -#hint.map.3.end=0x00480000 -#hint.map.3.name="spare-uImage" -#hint.map.3.readonly=1 - -#hint.map.4.at="flash/spi0" -#hint.map.4.start=0x00480000 -#hint.map.4.end=0x00780000 -#hint.map.4.name="rootfs" -#hint.map.4.readonly=1 +hint.map.2.end="search:0x00080000:0x10000:.!/bin/sh" +hint.map.2.name="kernel" +hint.map.2.readonly=0 hint.map.3.at="flash/spi0" -hint.map.3.start=0x00780000 +hint.map.3.start="search:0x00080000:0x10000:.!/bin/sh" hint.map.3.end=0x00880000 -hint.map.3.name="uImage" -hint.map.3.readonly=1 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 hint.map.4.at="flash/spi0" hint.map.4.start=0x00880000 From owner-svn-src-head@freebsd.org Mon May 29 07:30:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D470CC2FAA; Mon, 29 May 2017 07:30:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E52E6ED23; Mon, 29 May 2017 07:30:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T7U7aw054165; Mon, 29 May 2017 07:30:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T7U7Ni054164; Mon, 29 May 2017 07:30:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705290730.v4T7U7Ni054164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 29 May 2017 07:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319101 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 07:30:08 -0000 Author: adrian Date: Mon May 29 07:30:07 2017 New Revision: 319101 URL: https://svnweb.freebsd.org/changeset/base/319101 Log: [ar71xx] [ar724x] update to work * add EARLY_PRINTF for debugging * update module list to be much larger * add random, otherwise well, stuff doesn't work. * IPFIREWALL_DEFAULT_TO_ACCEPT Tested: * AP93 (AR7240 + AR9280) TODO: * rename to std.AR724X * unify the built module list between all of the mips24k/mips74k atheros config files - now that the HAL, hwpmc, USB, etc are per-chip/per-arch modules it is easy to just compile them all and only include the ones you care about. Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Mon May 29 07:27:08 2017 (r319100) +++ head/sys/mips/conf/AR724X_BASE Mon May 29 07:30:07 2017 (r319101) @@ -25,13 +25,14 @@ makeoptions DEBUG=-g #Build kernel with # Build these as modules so small platform builds will have the # modules already built. -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc cam" +makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_tap if_tun libalias ipfw ipfw_nat ipfw_nptv6 if_vlan if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath_main ath_pci ath_hal ath_hal_ar5212 ath_hal_ar5416 ath_hal_ar9300 ath_rate ath_dfs hwpmc hwpmc_mips24k cam" # For small memory footprints options VM_KMEM_SIZE_SCALE=1 options DDB options KDB +options EARLY_PRINTF options SCHED_4BSD #4BSD scheduler options INET #InterNETworking @@ -59,11 +60,16 @@ options NO_SYSCTL_DESCR options FFS #Berkeley Fast Filesystem options NO_FFS_SNAPSHOT + +options IPFIREWALL_DEFAULT_TO_ACCEPT + # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists # options UFS_DIRHASH #Improve performance on big directories # options MSDOSFS # Read MSDOS filesystems; useful for USB/CF +options UMTX_CHAINS=16 + device pci device ar724x_pci @@ -129,7 +135,7 @@ device loop device ether device md device bpf -#device random +device random #device if_bridge #device gif # ip[46] in ip[46] tunneling protocol #device gre # generic encapsulation - only for IPv4 in IPv4 though atm From owner-svn-src-head@freebsd.org Mon May 29 07:57:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49812CEE766; Mon, 29 May 2017 07:57:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8A56F74F; Mon, 29 May 2017 07:57:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T7v16W066287; Mon, 29 May 2017 07:57:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T7v1Dd066286; Mon, 29 May 2017 07:57:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705290757.v4T7v1Dd066286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 29 May 2017 07:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319102 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 07:57:02 -0000 Author: adrian Date: Mon May 29 07:57:01 2017 New Revision: 319102 URL: https://svnweb.freebsd.org/changeset/base/319102 Log: [AP93] fix up the arge0/arge1 hints. Modified: head/sys/mips/conf/AP93.hints Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Mon May 29 07:30:07 2017 (r319101) +++ head/sys/mips/conf/AP93.hints Mon May 29 07:57:01 2017 (r319102) @@ -15,12 +15,14 @@ hint.argemdio.0.order=0 hint.arge.0.phymask=0x10 # PHY 4 # hint.arge.0.miimode=2 # MII hint.arge.0.mdio=mdioproxy1 # Hanging off the arswitch MDIO bus +hint.arge.0.eeprommac=0x1fff0000 # arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII. hint.arge.1.phymask=0x0 # hint.arge.1.miimode=1 # GMII hint.arge.1.media=1000 # Force to 1000BaseTX/full hint.arge.1.fduplex=1 +hint.arge.1.eeprommac=0x1fff0006 # # AR7240 switch config From owner-svn-src-head@freebsd.org Mon May 29 09:20:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E17ABCF66C4; Mon, 29 May 2017 09:20:21 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1E5A7233A; Mon, 29 May 2017 09:20:21 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T9KKMx001836; Mon, 29 May 2017 09:20:20 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T9KK34001835; Mon, 29 May 2017 09:20:20 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201705290920.v4T9KK34001835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 29 May 2017 09:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319115 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 09:20:22 -0000 Author: wma Date: Mon May 29 09:20:20 2017 New Revision: 319115 URL: https://svnweb.freebsd.org/changeset/base/319115 Log: Enable wireless Atheros cards in ARMADA38X Submitted by: Bartosz Szczepanek Dominik Ermel Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D10904 Modified: head/sys/arm/conf/ARMADA38X Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Mon May 29 09:08:02 2017 (r319114) +++ head/sys/arm/conf/ARMADA38X Mon May 29 09:20:20 2017 (r319115) @@ -76,6 +76,14 @@ device iic device iicbus device twsi +# Wireless NIC cards +device wlan # 802.11 support +device ath # Atheros NIC's +device ath_pci # Atheros pci/cardbus glue +device ath_hal +device ath_rate_sample +options ATH_ENABLE_11N + # CESA device cesa device crypto From owner-svn-src-head@freebsd.org Mon May 29 09:21:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BCC9CF68B5; Mon, 29 May 2017 09:21:39 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ACDB72616; Mon, 29 May 2017 09:21:39 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T9Lc6X005829; Mon, 29 May 2017 09:21:38 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T9LcVj005828; Mon, 29 May 2017 09:21:38 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201705290921.v4T9LcVj005828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 29 May 2017 09:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319116 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 09:21:39 -0000 Author: wma Date: Mon May 29 09:21:38 2017 New Revision: 319116 URL: https://svnweb.freebsd.org/changeset/base/319116 Log: Increase timeout in Atheros HAL It turned out, that some models of the Atheros PCIe adapters (e.g. AR983x family) may fail to attach due to insufficient timeout value. Submitted by: Bartosz Szczepanek Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: adrian Differential revision: https://reviews.freebsd.org/D10903 Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon May 29 09:20:20 2017 (r319115) +++ head/sys/dev/ath/ath_hal/ah.c Mon May 29 09:21:38 2017 (r319116) @@ -302,7 +302,7 @@ ath_hal_rf_name(struct ath_hal *ah) HAL_BOOL ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val) { -#define AH_TIMEOUT 1000 +#define AH_TIMEOUT 5000 return ath_hal_waitfor(ah, reg, mask, val, AH_TIMEOUT); #undef AH_TIMEOUT } From owner-svn-src-head@freebsd.org Mon May 29 09:22:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 468C6CF6B40; Mon, 29 May 2017 09:22:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1520672939; Mon, 29 May 2017 09:22:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T9MsY2005949; Mon, 29 May 2017 09:22:54 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T9MrkD005947; Mon, 29 May 2017 09:22:53 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201705290922.v4T9MrkD005947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 29 May 2017 09:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319117 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 09:22:55 -0000 Author: wma Date: Mon May 29 09:22:53 2017 New Revision: 319117 URL: https://svnweb.freebsd.org/changeset/base/319117 Log: Introduce Genesys GL3224 quirks The Genesys chip is failing when issueing READ_CAP(16) command. Force a quirk to disable it and use READ_CAP(10) instead. Also, depending on used firmware, GL3224 can be recognized either as 'storage device' or 'mass storage class' - enable both variants in scsi_quirk_table. Submitted by: Wojciech Macek Konrad Adamczyk Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: mav Differential revision: https://reviews.freebsd.org/D10902 Modified: head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon May 29 09:21:38 2017 (r319116) +++ head/sys/cam/scsi/scsi_da.c Mon May 29 09:22:53 2017 (r319117) @@ -684,6 +684,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Genesys GL3224 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Generic*", "STORAGE DEVICE*", + "120?"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_4K | DA_Q_NO_RC16 + }, + { + /* * Genesys 6-in-1 Card Reader * PR: usb/94647 */ Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Mon May 29 09:21:38 2017 (r319116) +++ head/sys/cam/scsi/scsi_xpt.c Mon May 29 09:22:53 2017 (r319117) @@ -547,6 +547,14 @@ static struct scsi_quirk_entry scsi_quir CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255 }, { + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Generic", "STORAGE DEVICE*", "120?" }, + CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255 + }, + { + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Generic", "MassStorageClass", "1533" }, + CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255 + }, + { /* Default tagged queuing parameters for all devices */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, From owner-svn-src-head@freebsd.org Mon May 29 09:30:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F563CF6BE2; Mon, 29 May 2017 09:30:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA5072B0D; Mon, 29 May 2017 09:30:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4T9Udg4007197; Mon, 29 May 2017 09:30:39 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4T9Uccx007189; Mon, 29 May 2017 09:30:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201705290930.v4T9Uccx007189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 29 May 2017 09:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319118 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 09:30:40 -0000 Author: ae Date: Mon May 29 09:30:38 2017 New Revision: 319118 URL: https://svnweb.freebsd.org/changeset/base/319118 Log: Disable IPsec debugging code by default when IPSEC_DEBUG kernel option is not specified. Due to the long call chain IPsec code can produce the kernel stack exhaustion on the i386 architecture. The debugging code usually is not used, but it requires a lot of stack space to keep buffers for strings formatting. This patch conditionally defines macros to disable building of IPsec debugging code. IPsec currently has two sysctl variables to configure debug output: * net.key.debug variable is used to enable debug output for PF_KEY protocol. Such debug messages are produced by KEYDBG() macro and usually they can be interesting for developers. * net.inet.ipsec.debug variable is used to enable debug output for DPRINTF() macro and ipseclog() function. DPRINTF() macro usually is used for development debugging. ipseclog() function is used for debugging by administrator. The patch disables KEYDBG() and DPRINTF() macros, and formatting buffers declarations when IPSEC_DEBUG is not present in kernel config. This reduces stack requirement for up to several hundreds of bytes. The net.inet.ipsec.debug variable still can be used to enable ipseclog() messages by administrator. PR: 219476 Reported by: eugen No objection from: #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10869 Modified: head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key_debug.h head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/ipsec.h Mon May 29 09:30:38 2017 (r319118) @@ -299,7 +299,13 @@ VNET_DECLARE(int, natt_cksum_policy); #define ipseclog(x) do { if (V_ipsec_debug) log x; } while (0) /* for openbsd compatibility */ +#ifdef IPSEC_DEBUG +#define IPSEC_DEBUG_DECLARE(x) x #define DPRINTF(x) do { if (V_ipsec_debug) printf x; } while (0) +#else +#define IPSEC_DEBUG_DECLARE(x) +#define DPRINTF(x) +#endif struct inpcb; struct m_tag; Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/ipsec_input.c Mon May 29 09:30:38 2017 (r319118) @@ -117,7 +117,7 @@ __FBSDID("$FreeBSD$"); static int ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); union sockaddr_union dst_address; struct secasvar *sav; uint32_t spi; @@ -277,7 +277,7 @@ int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); struct ipsec_ctx_data ctx; struct xform_history *xh; struct secasindex *saidx; @@ -488,7 +488,7 @@ int ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); struct ipsec_ctx_data ctx; struct xform_history *xh; struct secasindex *saidx; Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/ipsec_output.c Mon May 29 09:30:38 2017 (r319118) @@ -183,7 +183,6 @@ next: static int ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx) { - char sbuf[IPSEC_ADDRSTRLEN], dbuf[IPSEC_ADDRSTRLEN]; struct ipsec_ctx_data ctx; union sockaddr_union *dst; struct secasvar *sav; @@ -230,12 +229,9 @@ ipsec4_perform_request(struct mbuf *m, s ip->ip_sum = in_cksum(m, ip->ip_hl << 2); error = ipsec_encap(&m, &sav->sah->saidx); if (error != 0) { - DPRINTF(("%s: encapsulation for SA %s->%s " - "SPI 0x%08x failed with error %d\n", __func__, - ipsec_address(&sav->sah->saidx.src, sbuf, - sizeof(sbuf)), - ipsec_address(&sav->sah->saidx.dst, dbuf, - sizeof(dbuf)), ntohl(sav->spi), error)); + DPRINTF(("%s: encapsulation for SPI 0x%08x failed " + "with error %d\n", __func__, ntohl(sav->spi), + error)); /* XXXAE: IPSEC_OSTAT_INC(tunnel); */ goto bad; } @@ -497,7 +493,6 @@ next: static int ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx) { - char sbuf[IPSEC_ADDRSTRLEN], dbuf[IPSEC_ADDRSTRLEN]; struct ipsec_ctx_data ctx; union sockaddr_union *dst; struct secasvar *sav; @@ -539,12 +534,9 @@ ipsec6_perform_request(struct mbuf *m, s } error = ipsec_encap(&m, &sav->sah->saidx); if (error != 0) { - DPRINTF(("%s: encapsulation for SA %s->%s " - "SPI 0x%08x failed with error %d\n", __func__, - ipsec_address(&sav->sah->saidx.src, sbuf, - sizeof(sbuf)), - ipsec_address(&sav->sah->saidx.dst, dbuf, - sizeof(dbuf)), ntohl(sav->spi), error)); + DPRINTF(("%s: encapsulation for SPI 0x%08x failed " + "with error %d\n", __func__, ntohl(sav->spi), + error)); /* XXXAE: IPSEC_OSTAT_INC(tunnel); */ goto bad; } Modified: head/sys/netipsec/key_debug.h ============================================================================== --- head/sys/netipsec/key_debug.h Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/key_debug.h Mon May 29 09:30:38 2017 (r319118) @@ -53,10 +53,14 @@ #define KEYDEBUG_IPSEC_DATA (KEYDEBUG_IPSEC | KEYDEBUG_DATA) #define KEYDEBUG_IPSEC_DUMP (KEYDEBUG_IPSEC | KEYDEBUG_DUMP) +#ifdef IPSEC_DEBUG #define KEYDBG(lev, arg) \ if ((V_key_debug_level & (KEYDEBUG_ ## lev)) == (KEYDEBUG_ ## lev)) { \ arg; \ } +#else +#define KEYDBG(lev, arg) +#endif /* !IPSEC_DEBUG */ VNET_DECLARE(uint32_t, key_debug_level); #define V_key_debug_level VNET(key_debug_level) Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/xform_ah.c Mon May 29 09:30:38 2017 (r319118) @@ -544,7 +544,7 @@ ah_massage_headers(struct mbuf **m0, int static int ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { - char buf[128]; + IPSEC_DEBUG_DECLARE(char buf[128]); const struct auth_hash *ahx; struct cryptodesc *crda; struct cryptop *crp; @@ -681,7 +681,7 @@ bad: static int ah_input_cb(struct cryptop *crp) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); unsigned char calc[AH_ALEN_MAX]; const struct auth_hash *ahx; struct mbuf *m; @@ -831,7 +831,7 @@ static int ah_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, u_int idx, int skip, int protoff) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); const struct auth_hash *ahx; struct cryptodesc *crda; struct xform_data *xd; Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/xform_esp.c Mon May 29 09:30:38 2017 (r319118) @@ -263,7 +263,7 @@ esp_zeroize(struct secasvar *sav) static int esp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { - char buf[128]; + IPSEC_DEBUG_DECLARE(char buf[128]); const struct auth_hash *esph; const struct enc_xform *espx; struct xform_data *xd; @@ -436,7 +436,7 @@ bad: static int esp_input_cb(struct cryptop *crp) { - char buf[128]; + IPSEC_DEBUG_DECLARE(char buf[128]); u_int8_t lastthree[3], aalg[AH_HMAC_MAXHASHLEN]; const struct auth_hash *esph; const struct enc_xform *espx; @@ -622,7 +622,7 @@ static int esp_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, u_int idx, int skip, int protoff) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); struct cryptodesc *crde = NULL, *crda = NULL; struct cryptop *crp; const struct auth_hash *esph; Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Mon May 29 09:22:53 2017 (r319117) +++ head/sys/netipsec/xform_ipcomp.c Mon May 29 09:30:38 2017 (r319118) @@ -271,7 +271,7 @@ bad: static int ipcomp_input_cb(struct cryptop *crp) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); struct cryptodesc *crd; struct xform_data *xd; struct mbuf *m; @@ -387,7 +387,7 @@ static int ipcomp_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, u_int idx, int skip, int protoff) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); const struct comp_algo *ipcompx; struct cryptodesc *crdc; struct cryptop *crp; @@ -521,7 +521,7 @@ bad: static int ipcomp_output_cb(struct cryptop *crp) { - char buf[IPSEC_ADDRSTRLEN]; + IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); struct xform_data *xd; struct secpolicy *sp; struct secasvar *sav; From owner-svn-src-head@freebsd.org Mon May 29 12:51:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6886ACFE45D; Mon, 29 May 2017 12:51:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3746F78181; Mon, 29 May 2017 12:51:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4TCp2iM090284; Mon, 29 May 2017 12:51:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TCp24h090283; Mon, 29 May 2017 12:51:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201705291251.v4TCp24h090283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 29 May 2017 12:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319125 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 12:51:03 -0000 Author: manu Date: Mon May 29 12:51:02 2017 New Revision: 319125 URL: https://svnweb.freebsd.org/changeset/base/319125 Log: mkimg: Correct an off by one error in the PMBR size The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec 2.6 page 118 table 17). This fixes warning printed by linux tools like parted or fdisk. Sponsored by: Gandi.net Modified: head/usr.bin/mkimg/gpt.c Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Mon May 29 11:37:08 2017 (r319124) +++ head/usr.bin/mkimg/gpt.c Mon May 29 12:51:02 2017 (r319125) @@ -152,7 +152,7 @@ gpt_write_pmbr(lba_t blks, void *bootcod uint32_t secs; int error; - secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks; + secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks - 1; pmbr = malloc(secsz); if (pmbr == NULL) From owner-svn-src-head@freebsd.org Mon May 29 13:10:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADCD7CFEC4A; Mon, 29 May 2017 13:10:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC03791B0; Mon, 29 May 2017 13:10:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4TDA1AE097921; Mon, 29 May 2017 13:10:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TDA1cu097919; Mon, 29 May 2017 13:10:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705291310.v4TDA1cu097919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 May 2017 13:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319132 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 13:10:02 -0000 Author: emaste Date: Mon May 29 13:10:01 2017 New Revision: 319132 URL: https://svnweb.freebsd.org/changeset/base/319132 Log: bsdgrep: bump version number and add Kyle Evans copyright The following changes have been made over the last couple of months: Features: - With bsdgrep -r, the working directory is implied if no directory is specified - bsdgrep will now behave as bsdgrep -r does when it's named rgrep - bsdgrep now understands -z/--null-data to use \0 as EOL - GNU regex compatibility is now indicated with a "GNU compatible" in the version string Fixes: - --mmap no longer hangs when coming across an EOF without an accompanying EOL - -o/--color matching generally improved, now produces earliest / longest matches - Context output now more closely aligns with GNU grep - Zero-length matches no longer exhibit broken behavior - Every output line now honors -b/-H/-n flags Tests have been added for previous regressions as well as other previously untested behaviors. Various other fixes have been commited, and refactoring for further / later improvements has taken place. (The original submission changed the version string to 2.5.2, but I decided to use 2.6.0 to reflect the addition of new features.) Submitted by: Kyle Evans Differential Revision: https://reviews.freebsd.org/D10982 Modified: head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Mon May 29 13:00:39 2017 (r319131) +++ head/usr.bin/grep/grep.h Mon May 29 13:10:01 2017 (r319132) @@ -51,7 +51,7 @@ extern nl_catd catalog; extern const char *errstr[]; -#define VERSION "2.5.1-FreeBSD" +#define VERSION "2.6.0-FreeBSD" #define GREP_FIXED 0 #define GREP_BASIC 1 Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Mon May 29 13:00:39 2017 (r319131) +++ head/usr.bin/grep/util.c Mon May 29 13:10:01 2017 (r319132) @@ -5,6 +5,7 @@ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav * Copyright (C) 2008-2010 Gabor Kovesdan + * Copyright (C) 2017 Kyle Evans * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Mon May 29 13:36:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB30ACFF970; Mon, 29 May 2017 13:36:33 +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 7795B7A3D5; Mon, 29 May 2017 13:36:33 +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 v4TDaW78010135; Mon, 29 May 2017 13:36:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TDaWTA010134; Mon, 29 May 2017 13:36:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705291336.v4TDaWTA010134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 May 2017 13:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319137 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 13:36:33 -0000 Author: kib Date: Mon May 29 13:36:32 2017 New Revision: 319137 URL: https://svnweb.freebsd.org/changeset/base/319137 Log: Correct explanation of the dynamic tokens handling. Reviewed by: emaste, jonathan Sponsored by: The FreeBSD Foundation X-Differential Revision: https://reviews.freebsd.org/D10826 Modified: head/libexec/rtld-elf/rtld.1 Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Mon May 29 13:25:55 2017 (r319136) +++ head/libexec/rtld-elf/rtld.1 Mon May 29 13:36:32 2017 (r319137) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 16, 2017 +.Dd May 20, 2017 .Dt RTLD 1 .Os .Sh NAME @@ -60,10 +60,11 @@ This is useful for C++ libraries that co .Pp When resolving dependencies for the loaded objects, .Nm -may be allowed to translate dynamic token strings in rpath and soname -by setting +translates dynamic token strings in rpath and soname. +If the .Fl "z origin" -option of the static linker +option of the static linker was set when linking the binary, +the token expansion is performed at the object load time, see .Xr ld 1 . The following strings are recognized now: .Bl -tag -width ".Pa $PLATFORM" From owner-svn-src-head@freebsd.org Mon May 29 13:38:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E525CFFA47; Mon, 29 May 2017 13:38:27 +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 3CD707A544; Mon, 29 May 2017 13:38:27 +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 v4TDcQ0I010247; Mon, 29 May 2017 13:38:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TDcQIT010246; Mon, 29 May 2017 13:38:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705291338.v4TDcQIT010246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 May 2017 13:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319138 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 13:38:27 -0000 Author: kib Date: Mon May 29 13:38:26 2017 New Revision: 319138 URL: https://svnweb.freebsd.org/changeset/base/319138 Log: Document direct execution mode for rtld. Reviewed by: emaste, jonathan (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D10826 Modified: head/libexec/rtld-elf/rtld.1 Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Mon May 29 13:36:32 2017 (r319137) +++ head/libexec/rtld-elf/rtld.1 Mon May 29 13:38:26 2017 (r319138) @@ -283,6 +283,77 @@ instead of postponing it until required. Normally, the filtees are opened at the time of the first symbol resolution from the filter object. .El +.Sh DIRECT EXECUTION MODE +.Nm +is typically used implicitly, loaded by the kernel as requested by the +.Dv PT_INTERP +program header of the executed binary. +.Fx +also supports a direct execution mode for the dynamic linker. +In this mode, the user explicitly executes +.Nm +and provides the path of the program to be linked and executed as +an argument. +This mode allows use of a non-standard dynamic linker for a program +activation without changing the binary or without changing +the installed dynamic linker. +Execution options may be specified. +.Pp +The syntax of the direct invocation is +.Bd -ragged -offset indent +.Pa /libexec/ld-elf.so.1 +.Op Fl f Ar fd +.Op Fl p +.Op Fl - +.Pa image_path +.Op Ar image arguments +.Ed +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl f Ar fd +File descriptor +.Ar fd +references the binary to be activated by +.Nm . +It must already be opened in the process when executing +.Nm . +If this option is specified, +.Ar image_path +is only used to provide the +.Va argv[0] +value to the program. +.It Fl p +If the +.Pa image_path +argument specifies a name which does not contain a slash +.Dq Li / +character, +.Nm +uses the search path provided by the environment variable +.Dv PATH +to find the binary to execute. +.It Fl - +Ends the +.Nm +options. +The argument following +.Fl - +is interpreted as the path of binary to execute. +.El +.Pp +To conform to user expectation to not break some naively restricted +execution environments, in the direct execution mode +.Nm +emulates verification of the binary execute permission +for current user. +The verification only uses Unix +.Dv DACs , +ignores +.Dv ACLs +and is racy by its nature. +The environments which rely on such restrictions are weak +and breakable on its own. .Sh FILES .Bl -tag -width ".Pa /var/run/ld-elf32.so.hints" -compact .It Pa /var/run/ld-elf.so.hints From owner-svn-src-head@freebsd.org Mon May 29 18:11:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFE53D7CB04; Mon, 29 May 2017 18:11:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FB898415B; Mon, 29 May 2017 18:11:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id b84so19599026wmh.0; Mon, 29 May 2017 11:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Ap1pOPr7aRTzYzfDfZ/KYI6se++1iaXxKmwnK2s1egQ=; b=hnTvilDSIBfzx0haY+UilX/4Pj105QNqIU/UzFLh7TEDsLIkmqZLtDsUeNd5ZlI4Uk +3494rcSWxBvZ5wK+5DoZGNHqfMVZ6yOqGWMnNXaPwjED1V/qtlDisxRnTQd1JjXAWgn hk5zT/tya509m4W0NVAmNqzhxz0o3I1yK4NQOPkALJHp2cfhVSpegOx506JMFa20RmCL aj8qHRi9Ny1rJ0uMSABvDtap1QsINbEpvNCW1ax6sMGI0RGzfhEM+QfX7+08C47gS/70 hRI/p4VDzsH/7Og6QE1cbdQ6RKTd0VozjDiiMNY90uRJZTVkogq4g95ilCF28eYWktJX iOXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Ap1pOPr7aRTzYzfDfZ/KYI6se++1iaXxKmwnK2s1egQ=; b=ZgO52kXGi/wsAIspieRct0kq5QnJUmgyVIZT/f4Ha3ONp0nMN0iGBRd9h6Eab8aZRH tcqlNhY7pVW+KdbjUr+ByV9Y0zv8zIDh8NMzssxZLsYllPl8pRQnRs4B4KgISivFnhDc ybWB2N31Xnn9QOjwADtC/5Z/i9Q3NJYF+hUpFcc6zqJQZzU/0l8uyObnRCHY97GHw3z6 xBuvegBkj2BTPT3BWkEbOY8VVbKrVH2A2Nn7CdzmcUAKP+YIZuSyLhBfCTr3xha6iHX3 uqJR8dv1O2Ck35+gjrZZN7kYxPEcvF6ybsoB9GUstwNav3MdJUCwqA/W2S5Y8Y6OGq2c Ph1Q== X-Gm-Message-State: AODbwcAlm8DXyq/wJVwVfU40JlgHY5yiR2KP9YU7wOaPJFC1f6lV/i76 1yEiRE0OG4OtvxPe X-Received: by 10.223.151.107 with SMTP id r98mr6034349wrb.6.1496081504838; Mon, 29 May 2017 11:11:44 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id m11sm16554593wmg.34.2017.05.29.11.11.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 May 2017 11:11:44 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 29 May 2017 19:11:41 +0100 From: Edward Tomasz Napierala To: "Rodney W. Grimes" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319080 - head/share/man/man5 Message-ID: <20170529181141.GA25108@brick> Mail-Followup-To: "Rodney W. Grimes" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705281809.v4SI9nT2024664@repo.freebsd.org> <201705290308.v4T38w6k020345@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201705290308.v4T38w6k020345@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 18:11:46 -0000 On 0528T2008, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: trasz > > Date: Sun May 28 18:09:49 2017 > > New Revision: 319080 > > URL: https://svnweb.freebsd.org/changeset/base/319080 > > > > Log: > > Fix Xrs; they were pointing to the wrong section. > > > > MFC after: 2 weeks > > > > Modified: > > head/share/man/man5/mount.conf.5 > > > > Modified: head/share/man/man5/mount.conf.5 > > ============================================================================== > > --- head/share/man/man5/mount.conf.5 Sun May 28 18:07:53 2017 (r319079) > > +++ head/share/man/man5/mount.conf.5 Sun May 28 18:09:49 2017 (r319080) > > @@ -52,7 +52,7 @@ The logic for this is in > > .Fn vfs_mountroot_conf0 . > > .It > > The kernel will first mount > > -.Xr devfs 8 > > +.Xr devfs 5 > > as the root file system. > > Um, no, devfs(8) is the command, devfs(5) is the config > file that descripts what devfs(8) well do. This sentence > does read very well to me: > The kernel will first mount devfs(8) as the root file system? > Neither devfs(8) or (5) is a file system one is a utility > command and the other is a config file. Erm, no - devfs(5) is the filesystem man page. The config file is devfs.rules(5). Yeah, it's kind of weird that filesystems are in section 5. From owner-svn-src-head@freebsd.org Mon May 29 18:16:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95147D7CDEB; Mon, 29 May 2017 18:16:19 +0000 (UTC) (envelope-from freebsd@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 129E184424; Mon, 29 May 2017 18:16:19 +0000 (UTC) (envelope-from freebsd@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 v4TIGHwk023352; Mon, 29 May 2017 11:16:17 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v4TIGHQg023351; Mon, 29 May 2017 11:16:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201705291816.v4TIGHQg023351@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r319080 - head/share/man/man5 In-Reply-To: <20170529181141.GA25108@brick> To: Edward Tomasz Napierala Date: Mon, 29 May 2017 11:16:17 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 18:16:19 -0000 > On 0528T2008, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > Author: trasz > > > Date: Sun May 28 18:09:49 2017 > > > New Revision: 319080 > > > URL: https://svnweb.freebsd.org/changeset/base/319080 > > > > > > Log: > > > Fix Xrs; they were pointing to the wrong section. > > > > > > MFC after: 2 weeks > > > > > > Modified: > > > head/share/man/man5/mount.conf.5 > > > > > > Modified: head/share/man/man5/mount.conf.5 > > > ============================================================================== > > > --- head/share/man/man5/mount.conf.5 Sun May 28 18:07:53 2017 (r319079) > > > +++ head/share/man/man5/mount.conf.5 Sun May 28 18:09:49 2017 (r319080) > > > @@ -52,7 +52,7 @@ The logic for this is in > > > .Fn vfs_mountroot_conf0 . > > > .It > > > The kernel will first mount > > > -.Xr devfs 8 > > > +.Xr devfs 5 > > > as the root file system. > > > > Um, no, devfs(8) is the command, devfs(5) is the config > > file that descripts what devfs(8) well do. This sentence > > does read very well to me: > > The kernel will first mount devfs(8) as the root file system? > > Neither devfs(8) or (5) is a file system one is a utility > > command and the other is a config file. > > Erm, no - devfs(5) is the filesystem man page. The config file > is devfs.rules(5). > > Yeah, it's kind of weird that filesystems are in section 5. Yes, ignore me, sorry for the noise. I realized that we had devfs(5) and devfs.rules(5) after I sent this. And yes, filesystems being in 5 is odd, but appears to be the best (for some very small value of best) fit. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 29 18:34:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FAC9D7D525; Mon, 29 May 2017 18:34: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 1DDFA85192; Mon, 29 May 2017 18:34: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 v4TIYjvg037082; Mon, 29 May 2017 18:34:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TIYjqJ037081; Mon, 29 May 2017 18:34:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705291834.v4TIYjqJ037081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 May 2017 18:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319155 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 18:34:46 -0000 Author: ngie Date: Mon May 29 18:34:45 2017 New Revision: 319155 URL: https://svnweb.freebsd.org/changeset/base/319155 Log: lib/libnv/tests/dnv_test: fix memory leaks for memory allocated via either strdup or one of the dnvlist* libcalls. Reported by: Coverity CID: 1362056-1362060 Sponsored by: Dell EMC Isilon Modified: head/lib/libnv/tests/dnv_tests.cc Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Mon May 29 18:20:29 2017 (r319154) +++ head/lib/libnv/tests/dnv_tests.cc Mon May 29 18:34:45 2017 (r319155) @@ -391,6 +391,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_string__ ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0); free(actual_val); + free(default_val); nvlist_destroy(nvl); } @@ -408,6 +409,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_string__ ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0); free(actual_val); + free(default_val); nvlist_destroy(nvl); } @@ -496,6 +498,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__ free(actual_val); free(default_val); + free(value); nvlist_destroy(nvl); } @@ -515,6 +518,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__ ATF_REQUIRE_EQ(memcmp(actual_val, default_val, actual_size), 0); free(actual_val); + free(default_val); nvlist_destroy(nvl); } @@ -535,6 +539,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__ ATF_REQUIRE_EQ(memcmp(actual_val, default_val, default_size), 0); free(actual_val); + free(default_val); nvlist_destroy(nvl); } From owner-svn-src-head@freebsd.org Mon May 29 18:39:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13B3D7D599; Mon, 29 May 2017 18:39: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 82B15852FC; Mon, 29 May 2017 18:39: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 v4TIdSCH037304; Mon, 29 May 2017 18:39:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TIdSUT037303; Mon, 29 May 2017 18:39:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705291839.v4TIdSUT037303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 May 2017 18:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319156 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 18:39:29 -0000 Author: ngie Date: Mon May 29 18:39:28 2017 New Revision: 319156 URL: https://svnweb.freebsd.org/changeset/base/319156 Log: :nvlist_unpack__duplicate_key : check the result of nvlist_pack(3) This fixes a potential NULL pointer dereference. MFC after: 3 days Reported by: Coverity CID: 1362051 Sponsored by: Dell EMC Isilon Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Mon May 29 18:34:45 2017 (r319155) +++ head/lib/libnv/tests/nv_tests.cc Mon May 29 18:39:28 2017 (r319156) @@ -640,6 +640,7 @@ ATF_TEST_CASE_BODY(nvlist_unpack__duplic nvlist_add_number(nvl, key2, 10); packed = nvlist_pack(nvl, &size); + ATF_REQUIRE(packed != NULL); /* * Mangle the packed nvlist by replacing key1 with key2, creating a From owner-svn-src-head@freebsd.org Mon May 29 18:45:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC787D7D710; Mon, 29 May 2017 18:45:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90A97856B8; Mon, 29 May 2017 18:45:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4TIjAqi041187; Mon, 29 May 2017 18:45:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TIjAOP041186; Mon, 29 May 2017 18:45:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705291845.v4TIjAOP041186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 May 2017 18:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319157 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 18:45:11 -0000 Author: ngie Date: Mon May 29 18:45:10 2017 New Revision: 319157 URL: https://svnweb.freebsd.org/changeset/base/319157 Log: fma_test: mute a warning about unreachable code on amd64 by restructuring the #ifdef block to only handle the rest of the logic in the loop in the #else case. MFC after: 3 days Reported by: Coverity CID: 1346844 Sponsored by: Dell EMC Isilon Modified: head/lib/msun/tests/fma_test.c Modified: head/lib/msun/tests/fma_test.c ============================================================================== --- head/lib/msun/tests/fma_test.c Mon May 29 18:39:28 2017 (r319156) +++ head/lib/msun/tests/fma_test.c Mon May 29 18:45:10 2017 (r319157) @@ -498,11 +498,12 @@ main(void) printf("ok %d # SKIP testcase fails assertion on " "amd64\n", j); continue; -#endif +#else printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_infinities(); printf("ok %d - fma infinities\n", j); +#endif } fesetround(FE_TONEAREST); From owner-svn-src-head@freebsd.org Mon May 29 18:49:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB354D7D83B; Mon, 29 May 2017 18:49: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 88B908595C; Mon, 29 May 2017 18:49: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 v4TInSXA041383; Mon, 29 May 2017 18:49:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TInStq041382; Mon, 29 May 2017 18:49:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705291849.v4TInStq041382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 May 2017 18:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319158 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 18:49:29 -0000 Author: ngie Date: Mon May 29 18:49:28 2017 New Revision: 319158 URL: https://svnweb.freebsd.org/changeset/base/319158 Log: logarithm_test: assert that feclearexcept succeeds This helps ensure that test preconditons are fulfilled. MFC after: 3 days Reported by: Coverity CID: 1346572 Sponsored by: Dell EMC Isilon Modified: head/lib/msun/tests/logarithm_test.c Modified: head/lib/msun/tests/logarithm_test.c ============================================================================== --- head/lib/msun/tests/logarithm_test.c Mon May 29 18:45:10 2017 (r319157) +++ head/lib/msun/tests/logarithm_test.c Mon May 29 18:49:28 2017 (r319158) @@ -137,7 +137,7 @@ run_log2_tests(void) * We should insist that log2() return exactly the correct * result and not raise an inexact exception for powers of 2. */ - feclearexcept(FE_ALL_EXCEPT); + assert(feclearexcept(FE_ALL_EXCEPT) == 0); for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { assert(log2f(ldexpf(1.0, i)) == i); assert(fetestexcept(ALL_STD_EXCEPT) == 0); From owner-svn-src-head@freebsd.org Mon May 29 19:02:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7953AD7DB68; Mon, 29 May 2017 19:02:53 +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 44CEC85FD9; Mon, 29 May 2017 19:02: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 v4TJ2qpX049606; Mon, 29 May 2017 19:02:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TJ2qMP049605; Mon, 29 May 2017 19:02:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705291902.v4TJ2qMP049605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 May 2017 19:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319159 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 19:02:53 -0000 Author: ngie Date: Mon May 29 19:02:52 2017 New Revision: 319159 URL: https://svnweb.freebsd.org/changeset/base/319159 Log: :dnvlist_get_string__default_value: fix a bogus string comparison test Check actual_value vs "5", not "5" vs itself. MFC after: 3 days Reported by: Coverity CID: 1362021 Sponsored by: Dell EMC Isilon Modified: head/lib/libnv/tests/dnv_tests.cc Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Mon May 29 18:49:28 2017 (r319158) +++ head/lib/libnv/tests/dnv_tests.cc Mon May 29 19:02:52 2017 (r319159) @@ -150,7 +150,7 @@ ATF_TEST_CASE_BODY(dnvlist_get_string__d ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, "hthth", "fd"), "fd"), 0); actual_value = dnvlist_get_string(nvl, "5", "5"); - ATF_REQUIRE_EQ(strcmp("5", "5"), 0); + ATF_REQUIRE_EQ(strcmp(actual_value, "5"), 0); nvlist_destroy(nvl); } From owner-svn-src-head@freebsd.org Mon May 29 20:11:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED6E1D7E83D; Mon, 29 May 2017 20:11:28 +0000 (UTC) (envelope-from kwm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0E2B1F6A; Mon, 29 May 2017 20:11:28 +0000 (UTC) (envelope-from kwm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4TKBRtB077480; Mon, 29 May 2017 20:11:27 GMT (envelope-from kwm@FreeBSD.org) Received: (from kwm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TKBRth077479; Mon, 29 May 2017 20:11:27 GMT (envelope-from kwm@FreeBSD.org) Message-Id: <201705292011.v4TKBRth077479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kwm set sender to kwm@FreeBSD.org using -f From: Koop Mast Date: Mon, 29 May 2017 20:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319160 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 20:11:29 -0000 Author: kwm (ports committer) Date: Mon May 29 20:11:27 2017 New Revision: 319160 URL: https://svnweb.freebsd.org/changeset/base/319160 Log: 64-bit inode commit bumped libarchive library version, record the old one. Approved by: emaste@ Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 29 19:02:52 2017 (r319159) +++ head/ObsoleteFiles.inc Mon May 29 20:11:27 2017 (r319160) @@ -112,6 +112,8 @@ OLD_FILES+=usr/share/doc/usd/21.troff/pa OLD_FILES+=usr/share/doc/usd/22.trofftut/paper.ascii.gz OLD_FILES+=usr/share/doc/usd/Title.ascii.gz OLD_FILES+=usr/share/doc/usd/contents.ascii.gz +# 20170523: 64-bit inode support, libarchive version bump +OLD_LIBS+=usr/lib/libarchive.so.6 # 20170427: NATM configuration support removed OLD_FILES+=etc/rc.d/atm1 OLD_FILES+=etc/rc.d/atm2 From owner-svn-src-head@freebsd.org Mon May 29 20:27:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DBFFD7EDE8; Mon, 29 May 2017 20:27:33 +0000 (UTC) (envelope-from kwm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 093472965; Mon, 29 May 2017 20:27:32 +0000 (UTC) (envelope-from kwm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4TKRWYq082632; Mon, 29 May 2017 20:27:32 GMT (envelope-from kwm@FreeBSD.org) Received: (from kwm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TKRWpR082631; Mon, 29 May 2017 20:27:32 GMT (envelope-from kwm@FreeBSD.org) Message-Id: <201705292027.v4TKRWpR082631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kwm set sender to kwm@FreeBSD.org using -f From: Koop Mast Date: Mon, 29 May 2017 20:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319161 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 20:27:33 -0000 Author: kwm (ports committer) Date: Mon May 29 20:27:31 2017 New Revision: 319161 URL: https://svnweb.freebsd.org/changeset/base/319161 Log: Also add libzfs and libmilter to the 64-bit inode library bump list. Make the comment more generic. Approved by: emaste@ Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 29 20:11:27 2017 (r319160) +++ head/ObsoleteFiles.inc Mon May 29 20:27:31 2017 (r319161) @@ -112,8 +112,10 @@ OLD_FILES+=usr/share/doc/usd/21.troff/pa OLD_FILES+=usr/share/doc/usd/22.trofftut/paper.ascii.gz OLD_FILES+=usr/share/doc/usd/Title.ascii.gz OLD_FILES+=usr/share/doc/usd/contents.ascii.gz -# 20170523: 64-bit inode support, libarchive version bump +# 20170523: 64-bit inode support, library version bumps +OLD_LIBS+=lib/libzfs.so.2 OLD_LIBS+=usr/lib/libarchive.so.6 +OLD_LIBS+=usr/lib/libmilter.so.5 # 20170427: NATM configuration support removed OLD_FILES+=etc/rc.d/atm1 OLD_FILES+=etc/rc.d/atm2 From owner-svn-src-head@freebsd.org Mon May 29 20:43:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9706D7F43E; Mon, 29 May 2017 20:43:01 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8126342C; Mon, 29 May 2017 20:43:01 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4TKh0Qh090576; Mon, 29 May 2017 20:43:00 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TKh0xB090575; Mon, 29 May 2017 20:43:00 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201705292043.v4TKh0xB090575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 29 May 2017 20:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319162 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 20:43:02 -0000 Author: wulf Date: Mon May 29 20:43:00 2017 New Revision: 319162 URL: https://svnweb.freebsd.org/changeset/base/319162 Log: psm: add support for evdev protocol Both relative and absolute multitouch modes are supported. To enable psm(4) evdev support one should: 1. Add `device evdev` and `options EVDEV_SUPPORT` to kernel config file 2. Add hw.psm.elantech_support=1 or hw.psm.synaptics_support=1 to /boot/loader.conf for activation of absolute mode on touchpads 3. Add kern.evdev.rcpt_mask=12 to /etc/sysctl.conf to enable psm event sourcing and disable sysmouse Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10265 Tested by: wulf, Jan Kokemueller (Lenovo devs) Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon May 29 20:27:31 2017 (r319161) +++ head/sys/dev/atkbdc/psm.c Mon May 29 20:43:00 2017 (r319162) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_psm.h" +#include "opt_evdev.h" #include #include @@ -90,6 +91,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #include #include @@ -325,8 +331,14 @@ typedef struct elantechhw { #define ELANTECH_REG_RDWR 0x00 #define ELANTECH_CUSTOM_CMD 0xf8 +#ifdef EVDEV_SUPPORT +#define ELANTECH_MAX_FINGERS 5 +#else #define ELANTECH_MAX_FINGERS PSM_FINGERS +#endif +#define ELANTECH_FINGER_MAX_P 255 +#define ELANTECH_FINGER_MAX_W 15 #define ELANTECH_FINGER_SET_XYP(pb) (finger_t) { \ .x = (((pb)->ipacket[1] & 0x0f) << 8) | (pb)->ipacket[2], \ .y = (((pb)->ipacket[4] & 0x0f) << 8) | (pb)->ipacket[5], \ @@ -418,6 +430,10 @@ struct psm_softc { /* Driver status inf int cmdcount; struct sigio *async; /* Processes waiting for SIGIO */ int extended_buttons; +#ifdef EVDEV_SUPPORT + struct evdev_dev *evdev_a; /* Absolute reporting device */ + struct evdev_dev *evdev_r; /* Relative reporting device */ +#endif }; static devclass_t psm_devclass; @@ -427,6 +443,8 @@ static devclass_t psm_devclass; #define PSM_ASLP 2 /* Waiting for mouse data */ #define PSM_SOFTARMED 4 /* Software interrupt armed */ #define PSM_NEED_SYNCBITS 8 /* Set syncbits using next data pkt */ +#define PSM_EV_OPEN_R 0x10 /* Relative evdev device is open */ +#define PSM_EV_OPEN_A 0x20 /* Absolute evdev device is open */ /* driver configuration flags (config) */ #define PSM_CONFIG_RESOLUTION 0x000f /* resolution */ @@ -532,13 +550,23 @@ static int psmattach(device_t); static int psmdetach(device_t); static int psmresume(device_t); -static d_open_t psmopen; -static d_close_t psmclose; +static d_open_t psm_cdev_open; +static d_close_t psm_cdev_close; static d_read_t psmread; static d_write_t psmwrite; static d_ioctl_t psmioctl; static d_poll_t psmpoll; +static int psmopen(struct psm_softc *); +static int psmclose(struct psm_softc *); + +#ifdef EVDEV_SUPPORT +static evdev_open_t psm_ev_open_r; +static evdev_close_t psm_ev_close_r; +static evdev_open_t psm_ev_open_a; +static evdev_close_t psm_ev_close_a; +#endif + static int enable_aux_dev(KBDC); static int disable_aux_dev(KBDC); static int get_mouse_status(KBDC, int *, int, int); @@ -668,8 +696,8 @@ static driver_t psm_driver = { static struct cdevsw psm_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, - .d_open = psmopen, - .d_close = psmclose, + .d_open = psm_cdev_open, + .d_close = psm_cdev_close, .d_read = psmread, .d_write = psmwrite, .d_ioctl = psmioctl, @@ -677,6 +705,17 @@ static struct cdevsw psm_cdevsw = { .d_name = PSM_DRIVER_NAME, }; +#ifdef EVDEV_SUPPORT +static const struct evdev_methods psm_ev_methods_r = { + .ev_open = psm_ev_open_r, + .ev_close = psm_ev_close_r, +}; +static const struct evdev_methods psm_ev_methods_a = { + .ev_open = psm_ev_open_a, + .ev_close = psm_ev_close_a, +}; +#endif + /* device I/O routines */ static int enable_aux_dev(KBDC kbdc) @@ -1197,7 +1236,8 @@ reinitialize(struct psm_softc *sc, int d splx(s); /* restore the driver state */ - if ((sc->state & PSM_OPEN) && (err == 0)) { + if ((sc->state & (PSM_OPEN | PSM_EV_OPEN_R | PSM_EV_OPEN_A)) && + (err == 0)) { /* enable the aux device and the port again */ err = doopen(sc, c); if (err != 0) @@ -1578,6 +1618,270 @@ psmprobe(device_t dev) return (0); } +#ifdef EVDEV_SUPPORT +/* Values are taken from Linux drivers for userland software compatibility */ +#define PS2_MOUSE_VENDOR 0x0002 +#define PS2_MOUSE_GENERIC_PRODUCT 0x0001 +#define PS2_MOUSE_SYNAPTICS_NAME "SynPS/2 Synaptics TouchPad" +#define PS2_MOUSE_SYNAPTICS_PRODUCT 0x0007 +#define PS2_MOUSE_TRACKPOINT_NAME "TPPS/2 IBM TrackPoint" +#define PS2_MOUSE_TRACKPOINT_PRODUCT 0x000A +#define PS2_MOUSE_ELANTECH_NAME "ETPS/2 Elantech Touchpad" +#define PS2_MOUSE_ELANTECH_ST_NAME "ETPS/2 Elantech TrackPoint" +#define PS2_MOUSE_ELANTECH_PRODUCT 0x000E + +#define ABSINFO_END { ABS_CNT, 0, 0, 0 } + +static void +psm_support_abs_bulk(struct evdev_dev *evdev, const uint16_t info[][4]) +{ + size_t i; + + for (i = 0; info[i][0] != ABS_CNT; i++) + evdev_support_abs(evdev, info[i][0], 0, info[i][1], info[i][2], + 0, 0, info[i][3]); +} + +static void +psm_push_mt_finger(struct psm_softc *sc, int id, const finger_t *f) +{ + int y = sc->synhw.minimumYCoord + sc->synhw.maximumYCoord - f->y; + + evdev_push_abs(sc->evdev_a, ABS_MT_SLOT, id); + evdev_push_abs(sc->evdev_a, ABS_MT_TRACKING_ID, id); + evdev_push_abs(sc->evdev_a, ABS_MT_POSITION_X, f->x); + evdev_push_abs(sc->evdev_a, ABS_MT_POSITION_Y, y); + evdev_push_abs(sc->evdev_a, ABS_MT_PRESSURE, f->p); +} + +static void +psm_push_st_finger(struct psm_softc *sc, const finger_t *f) +{ + int y = sc->synhw.minimumYCoord + sc->synhw.maximumYCoord - f->y; + + evdev_push_abs(sc->evdev_a, ABS_X, f->x); + evdev_push_abs(sc->evdev_a, ABS_Y, y); + evdev_push_abs(sc->evdev_a, ABS_PRESSURE, f->p); + if (sc->synhw.capPalmDetect) + evdev_push_abs(sc->evdev_a, ABS_TOOL_WIDTH, f->w); +} + +static void +psm_release_mt_slot(struct evdev_dev *evdev, int32_t slot) +{ + + evdev_push_abs(evdev, ABS_MT_SLOT, slot); + evdev_push_abs(evdev, ABS_MT_TRACKING_ID, -1); +} + +static int +psm_register(device_t dev, int model_code) +{ + struct psm_softc *sc = device_get_softc(dev); + struct evdev_dev *evdev_r; + int error, i, nbuttons, nwheels, product; + bool is_pointing_stick; + const char *name; + + name = model_name(model_code); + nbuttons = sc->hw.buttons; + product = PS2_MOUSE_GENERIC_PRODUCT; + nwheels = 0; + is_pointing_stick = false; + + switch (model_code) { + case MOUSE_MODEL_TRACKPOINT: + name = PS2_MOUSE_TRACKPOINT_NAME; + product = PS2_MOUSE_TRACKPOINT_PRODUCT; + nbuttons = 3; + is_pointing_stick = true; + break; + + case MOUSE_MODEL_ELANTECH: + name = PS2_MOUSE_ELANTECH_ST_NAME; + product = PS2_MOUSE_ELANTECH_PRODUCT; + nbuttons = 3; + is_pointing_stick = true; + break; + + case MOUSE_MODEL_MOUSEMANPLUS: + case MOUSE_MODEL_4D: + nwheels = 2; + break; + + case MOUSE_MODEL_EXPLORER: + case MOUSE_MODEL_INTELLI: + case MOUSE_MODEL_NET: + case MOUSE_MODEL_NETSCROLL: + case MOUSE_MODEL_4DPLUS: + nwheels = 1; + break; + } + + evdev_r = evdev_alloc(); + evdev_set_name(evdev_r, name); + evdev_set_phys(evdev_r, device_get_nameunit(dev)); + evdev_set_id(evdev_r, BUS_I8042, PS2_MOUSE_VENDOR, product, 0); + evdev_set_methods(evdev_r, sc, &psm_ev_methods_r); + + evdev_support_prop(evdev_r, INPUT_PROP_POINTER); + if (is_pointing_stick) + evdev_support_prop(evdev_r, INPUT_PROP_POINTING_STICK); + evdev_support_event(evdev_r, EV_SYN); + evdev_support_event(evdev_r, EV_KEY); + evdev_support_event(evdev_r, EV_REL); + evdev_support_rel(evdev_r, REL_X); + evdev_support_rel(evdev_r, REL_Y); + switch (nwheels) { + case 2: + evdev_support_rel(evdev_r, REL_HWHEEL); + /* FALLTHROUGH */ + case 1: + evdev_support_rel(evdev_r, REL_WHEEL); + } + for (i = 0; i < nbuttons; i++) + evdev_support_key(evdev_r, BTN_MOUSE + i); + + error = evdev_register_mtx(evdev_r, &Giant); + if (error) + evdev_free(evdev_r); + else + sc->evdev_r = evdev_r; + return (error); +} + +static int +psm_register_synaptics(device_t dev) +{ + struct psm_softc *sc = device_get_softc(dev); + const uint16_t synaptics_absinfo_st[][4] = { + { ABS_X, sc->synhw.minimumXCoord, + sc->synhw.maximumXCoord, sc->synhw.infoXupmm }, + { ABS_Y, sc->synhw.minimumYCoord, + sc->synhw.maximumYCoord, sc->synhw.infoYupmm }, + { ABS_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + ABSINFO_END, + }; + const uint16_t synaptics_absinfo_mt[][4] = { + { ABS_MT_SLOT, 0, PSM_FINGERS-1, 0}, + { ABS_MT_TRACKING_ID, -1, PSM_FINGERS-1, 0}, + { ABS_MT_POSITION_X, sc->synhw.minimumXCoord, + sc->synhw.maximumXCoord, sc->synhw.infoXupmm }, + { ABS_MT_POSITION_Y, sc->synhw.minimumYCoord, + sc->synhw.maximumYCoord, sc->synhw.infoYupmm }, + { ABS_MT_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + ABSINFO_END, + }; + struct evdev_dev *evdev_a; + int error, i, guest_model; + + evdev_a = evdev_alloc(); + evdev_set_name(evdev_a, PS2_MOUSE_SYNAPTICS_NAME); + evdev_set_phys(evdev_a, device_get_nameunit(dev)); + evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, + PS2_MOUSE_SYNAPTICS_PRODUCT, 0); + evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + + evdev_support_event(evdev_a, EV_SYN); + evdev_support_event(evdev_a, EV_KEY); + evdev_support_event(evdev_a, EV_ABS); + evdev_support_prop(evdev_a, INPUT_PROP_POINTER); + if (sc->synhw.capAdvancedGestures) + evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); + if (sc->synhw.capClickPad) + evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); + evdev_support_key(evdev_a, BTN_TOUCH); + evdev_support_nfingers(evdev_a, 3); + psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); + if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) + psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt); + if (sc->synhw.capPalmDetect) + evdev_support_abs(evdev_a, ABS_TOOL_WIDTH, 0, 0, 15, 0, 0, 0); + evdev_support_key(evdev_a, BTN_LEFT); + if (!sc->synhw.capClickPad) { + evdev_support_key(evdev_a, BTN_RIGHT); + if (sc->synhw.capExtended && sc->synhw.capMiddle) + evdev_support_key(evdev_a, BTN_MIDDLE); + } + if (sc->synhw.capExtended && sc->synhw.capFourButtons) { + evdev_support_key(evdev_a, BTN_BACK); + evdev_support_key(evdev_a, BTN_FORWARD); + } + if (sc->synhw.capExtended && (sc->synhw.nExtendedButtons > 0)) + for (i = 0; i < sc->synhw.nExtendedButtons; i++) + evdev_support_key(evdev_a, BTN_0 + i); + + error = evdev_register_mtx(evdev_a, &Giant); + if (!error && sc->synhw.capPassthrough) { + guest_model = sc->tpinfo.sysctl_tree != NULL ? + MOUSE_MODEL_TRACKPOINT : MOUSE_MODEL_GENERIC; + error = psm_register(dev, guest_model); + } + if (error) + evdev_free(evdev_a); + else + sc->evdev_a = evdev_a; + return (error); +} + +static int +psm_register_elantech(device_t dev) +{ + struct psm_softc *sc = device_get_softc(dev); + const uint16_t elantech_absinfo[][4] = { + { ABS_X, 0, sc->elanhw.sizex, + sc->elanhw.dpmmx }, + { ABS_Y, 0, sc->elanhw.sizey, + sc->elanhw.dpmmy }, + { ABS_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + { ABS_TOOL_WIDTH, 0, ELANTECH_FINGER_MAX_W, 0 }, + { ABS_MT_SLOT, 0, ELANTECH_MAX_FINGERS - 1, 0 }, + { ABS_MT_TRACKING_ID, -1, ELANTECH_MAX_FINGERS - 1, 0 }, + { ABS_MT_POSITION_X, 0, sc->elanhw.sizex, + sc->elanhw.dpmmx }, + { ABS_MT_POSITION_Y, 0, sc->elanhw.sizey, + sc->elanhw.dpmmy }, + { ABS_MT_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + { ABS_MT_TOUCH_MAJOR, 0, ELANTECH_FINGER_MAX_W * + sc->elanhw.dptracex, 0 }, + ABSINFO_END, + }; + struct evdev_dev *evdev_a; + int error; + + evdev_a = evdev_alloc(); + evdev_set_name(evdev_a, PS2_MOUSE_ELANTECH_NAME); + evdev_set_phys(evdev_a, device_get_nameunit(dev)); + evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, + PS2_MOUSE_ELANTECH_PRODUCT, 0); + evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + + evdev_support_event(evdev_a, EV_SYN); + evdev_support_event(evdev_a, EV_KEY); + evdev_support_event(evdev_a, EV_ABS); + evdev_support_prop(evdev_a, INPUT_PROP_POINTER); + if (sc->elanhw.issemimt) + evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); + if (sc->elanhw.isclickpad) + evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); + evdev_support_key(evdev_a, BTN_TOUCH); + evdev_support_nfingers(evdev_a, ELANTECH_MAX_FINGERS); + evdev_support_key(evdev_a, BTN_LEFT); + if (!sc->elanhw.isclickpad) + evdev_support_key(evdev_a, BTN_RIGHT); + psm_support_abs_bulk(evdev_a, elantech_absinfo); + + error = evdev_register_mtx(evdev_a, &Giant); + if (!error && sc->elanhw.hastrackpoint) + error = psm_register(dev, MOUSE_MODEL_ELANTECH); + if (error) + evdev_free(evdev_a); + else + sc->evdev_a = evdev_a; + return (error); +} +#endif + static int psmattach(device_t dev) { @@ -1609,6 +1913,24 @@ psmattach(device_t dev) sc->bdev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "bpsm%d", unit); sc->bdev->si_drv1 = sc; +#ifdef EVDEV_SUPPORT + switch (sc->hw.model) { + case MOUSE_MODEL_SYNAPTICS: + error = psm_register_synaptics(dev); + break; + + case MOUSE_MODEL_ELANTECH: + error = psm_register_elantech(dev); + break; + + default: + error = psm_register(dev, sc->hw.model); + } + + if (error) + return (error); +#endif + /* Some touchpad devices need full reinitialization after suspend. */ switch (sc->hw.model) { case MOUSE_MODEL_SYNAPTICS: @@ -1657,6 +1979,11 @@ psmdetach(device_t dev) if (sc->state & PSM_OPEN) return (EBUSY); +#ifdef EVDEV_SUPPORT + evdev_free(sc->evdev_r); + evdev_free(sc->evdev_a); +#endif + rid = KBDC_RID_AUX; bus_teardown_intr(dev, sc->intr, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); @@ -1670,13 +1997,83 @@ psmdetach(device_t dev) return (0); } +#ifdef EVDEV_SUPPORT static int -psmopen(struct cdev *dev, int flag, int fmt, struct thread *td) +psm_ev_open_r(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + int err = 0; + + /* Get device data */ + if ((sc->state & PSM_VALID) == 0) { + /* the device is no longer valid/functioning */ + return (ENXIO); + } + + if (!(sc->state & (PSM_OPEN | PSM_EV_OPEN_A))) + err = psmopen(sc); + + if (err == 0) + sc->state |= PSM_EV_OPEN_R; + + return (err); +} + +static void +psm_ev_close_r(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + + sc->state &= ~PSM_EV_OPEN_R; + + if (sc->state & (PSM_OPEN | PSM_EV_OPEN_A)) + return; + + if (sc->state & PSM_VALID) + psmclose(sc); +} + +static int +psm_ev_open_a(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + int err = 0; + + /* Get device data */ + if ((sc->state & PSM_VALID) == 0) { + /* the device is no longer valid/functioning */ + return (ENXIO); + } + + if (!(sc->state & (PSM_OPEN | PSM_EV_OPEN_R))) + err = psmopen(sc); + + if (err == 0) + sc->state |= PSM_EV_OPEN_A; + + return (err); +} + +static void +psm_ev_close_a(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + + sc->state &= ~PSM_EV_OPEN_A; + + if (sc->state & (PSM_OPEN | PSM_EV_OPEN_R)) + return; + + if (sc->state & PSM_VALID) + psmclose(sc); +} +#endif + +static int +psm_cdev_open(struct cdev *dev, int flag, int fmt, struct thread *td) { struct psm_softc *sc; - int command_byte; - int err; - int s; + int err = 0; /* Get device data */ sc = dev->si_drv1; @@ -1691,6 +2088,59 @@ psmopen(struct cdev *dev, int flag, int device_busy(devclass_get_device(psm_devclass, sc->unit)); +#ifdef EVDEV_SUPPORT + /* Already opened by evdev */ + if (!(sc->state & (PSM_EV_OPEN_R | PSM_EV_OPEN_A))) +#endif + err = psmopen(sc); + + if (err == 0) + sc->state |= PSM_OPEN; + else + device_unbusy(devclass_get_device(psm_devclass, sc->unit)); + + return (err); +} + +static int +psm_cdev_close(struct cdev *dev, int flag, int fmt, struct thread *td) +{ + struct psm_softc *sc; + int err = 0; + + /* Get device data */ + sc = dev->si_drv1; + if ((sc == NULL) || (sc->state & PSM_VALID) == 0) { + /* the device is no longer valid/functioning */ + return (ENXIO); + } + +#ifdef EVDEV_SUPPORT + /* Still opened by evdev */ + if (!(sc->state & (PSM_EV_OPEN_R | PSM_EV_OPEN_A))) +#endif + err = psmclose(sc); + + if (err == 0) { + sc->state &= ~PSM_OPEN; + /* clean up and sigio requests */ + if (sc->async != NULL) { + funsetown(&sc->async); + sc->async = NULL; + } + device_unbusy(devclass_get_device(psm_devclass, sc->unit)); + } + + return (err); +} + +static int +psmopen(struct psm_softc *sc) +{ + int command_byte; + int err; + int s; + /* Initialize state */ sc->mode.level = sc->dflt_mode.level; sc->mode.protocol = sc->dflt_mode.protocol; @@ -1750,16 +2200,13 @@ psmopen(struct cdev *dev, int flag, int err = doopen(sc, command_byte); /* done */ - if (err == 0) - sc->state |= PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); return (err); } static int -psmclose(struct cdev *dev, int flag, int fmt, struct thread *td) +psmclose(struct psm_softc *sc) { - struct psm_softc *sc = dev->si_drv1; int stat[3]; int command_byte; int s; @@ -1836,16 +2283,8 @@ psmclose(struct cdev *dev, int flag, int /* remove anything left in the output buffer */ empty_aux_buffer(sc->kbdc, 10); - /* clean up and sigio requests */ - if (sc->async != NULL) { - funsetown(&sc->async); - sc->async = NULL; - } - /* close is almost always successful */ - sc->state &= ~PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); - device_unbusy(devclass_get_device(psm_devclass, sc->unit)); return (0); } @@ -2496,7 +2935,7 @@ psmintr(void *arg) pb = &sc->pqueue[sc->pqueue_end]; /* discard the byte if the device is not open */ - if ((sc->state & PSM_OPEN) == 0) + if (!(sc->state & (PSM_OPEN | PSM_EV_OPEN_R | PSM_EV_OPEN_A))) continue; getmicrouptime(&now); @@ -2854,7 +3293,15 @@ proc_synaptics(struct psm_softc *sc, pac guest_buttons |= MOUSE_BUTTON2DOWN; if (pb->ipacket[1] & 0x02) guest_buttons |= MOUSE_BUTTON3DOWN; - +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, + guest_buttons); + evdev_sync(sc->evdev_r); + } +#endif ms->button = touchpad_buttons | guest_buttons | sc->extended_buttons; } @@ -2965,6 +3412,24 @@ proc_synaptics(struct psm_softc *sc, pac int mask = 0; maskedbits = (sc->synhw.nExtendedButtons + 1) >> 1; mask = (1 << maskedbits) - 1; +#ifdef EVDEV_SUPPORT + int i; + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + if (sc->synhw.capPassthrough) { + evdev_push_mouse_btn(sc->evdev_r, + extended_buttons); + evdev_sync(sc->evdev_r); + } + for (i = 0; i < maskedbits; i++) { + evdev_push_key(sc->evdev_a, + BTN_0 + i * 2, + pb->ipacket[4] & (1 << i)); + evdev_push_key(sc->evdev_a, + BTN_0 + i * 2 + 1, + pb->ipacket[5] & (1 << i)); + } + } +#endif pb->ipacket[4] &= ~(mask); pb->ipacket[5] &= ~(mask); } else if (!sc->syninfo.directional_scrolls && @@ -3016,6 +3481,31 @@ proc_synaptics(struct psm_softc *sc, pac if (id >= nfingers) PSM_FINGER_RESET(f[id]); +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + for (id = 0; id < PSM_FINGERS; id++) { + if (PSM_FINGER_IS_SET(f[id])) + psm_push_mt_finger(sc, id, &f[id]); + else + psm_release_mt_slot(sc->evdev_a, id); + } + evdev_push_key(sc->evdev_a, BTN_TOUCH, nfingers > 0); + evdev_push_nfingers(sc->evdev_a, nfingers); + if (nfingers > 0) + psm_push_st_finger(sc, &f[0]); + else + evdev_push_abs(sc->evdev_a, ABS_PRESSURE, 0); + evdev_push_mouse_btn(sc->evdev_a, touchpad_buttons); + if (sc->synhw.capExtended && sc->synhw.capFourButtons) { + evdev_push_key(sc->evdev_a, BTN_FORWARD, + touchpad_buttons & MOUSE_BUTTON4DOWN); + evdev_push_key(sc->evdev_a, BTN_BACK, + touchpad_buttons & MOUSE_BUTTON5DOWN); + } + evdev_sync(sc->evdev_a); + } +#endif + ms->button = touchpad_buttons; psmgestures(sc, &f[0], nfingers, ms); @@ -4015,7 +4505,12 @@ proc_elantech(struct psm_softc *sc, pack ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); - +#ifdef EVDEV_SUPPORT + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); + evdev_sync(sc->evdev_r); +#endif ms->button = touchpad_button | trackpoint_button; return (0); @@ -4042,6 +4537,31 @@ proc_elantech(struct psm_softc *sc, pack ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0); } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + for (id = 0; id < ELANTECH_MAX_FINGERS; id++) { + if (PSM_FINGER_IS_SET(f[id])) { + psm_push_mt_finger(sc, id, &f[id]); + /* Convert touch width to surface units */ + evdev_push_abs(sc->evdev_a, ABS_MT_TOUCH_MAJOR, + f[id].w * sc->elanhw.dptracex); + } + if (sc->elanaction.mask & (1 << id) && + !(mask & (1 << id))) + psm_release_mt_slot(sc->evdev_a, id); + } + evdev_push_key(sc->evdev_a, BTN_TOUCH, nfingers > 0); + evdev_push_nfingers(sc->evdev_a, nfingers); + if (nfingers > 0) { + if (PSM_FINGER_IS_SET(f[0])) + psm_push_st_finger(sc, &f[0]); + } else + evdev_push_abs(sc->evdev_a, ABS_PRESSURE, 0); + evdev_push_mouse_btn(sc->evdev_a, touchpad_button); + evdev_sync(sc->evdev_a); + } +#endif + ms->button = touchpad_button | trackpoint_button; /* Send finger 1 position to gesture processor */ @@ -4382,6 +4902,41 @@ psmsoftintr(void *arg) break; } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE && + sc->hw.model != MOUSE_MODEL_ELANTECH && + sc->hw.model != MOUSE_MODEL_SYNAPTICS) { + evdev_push_rel(sc->evdev_r, EV_REL, x); + evdev_push_rel(sc->evdev_r, EV_REL, -y); + + switch (sc->hw.model) { + case MOUSE_MODEL_EXPLORER: + case MOUSE_MODEL_INTELLI: + case MOUSE_MODEL_NET: + case MOUSE_MODEL_NETSCROLL: + case MOUSE_MODEL_4DPLUS: + evdev_push_rel(sc->evdev_r, REL_WHEEL, -z); + break; + case MOUSE_MODEL_MOUSEMANPLUS: + case MOUSE_MODEL_4D: + switch (z) { + case 1: + case -1: + evdev_push_rel(sc->evdev_r, REL_WHEEL, -z); + break; + case 2: + case -2: + evdev_push_rel(sc->evdev_r, REL_HWHEEL, z / 2); + break; + } + break; + } + + evdev_push_mouse_btn(sc->evdev_r, ms.button); + evdev_sync(sc->evdev_r); + } +#endif + /* scale values */ if (sc->mode.accelfactor >= 1) { if (x != 0) { @@ -6494,6 +7049,9 @@ psmresume(device_t dev) } DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass, 0, 0); +#ifdef EVDEV_SUPPORT +MODULE_DEPEND(psm, evdev, 1, 1, 1); +#endif #ifdef DEV_ISA From owner-svn-src-head@freebsd.org Tue May 30 02:25:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE66EA922DD; Tue, 30 May 2017 02:25:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC59716CC; Tue, 30 May 2017 02:25:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4U2Plwx034955; Tue, 30 May 2017 02:25:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4U2Plgr034954; Tue, 30 May 2017 02:25:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201705300225.v4U2Plgr034954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 30 May 2017 02:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319167 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 02:25:48 -0000 Author: mjg Date: Tue May 30 02:25:47 2017 New Revision: 319167 URL: https://svnweb.freebsd.org/changeset/base/319167 Log: mtx: fix whitespace damage in _mtx_trylock_flags_ MFC after: 3 days Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Mon May 29 22:25:56 2017 (r319166) +++ head/sys/kern/kern_mutex.c Tue May 30 02:25:47 2017 (r319167) @@ -410,10 +410,10 @@ _mtx_trylock_flags_(volatile uintptr_t *c, int opts, c if (v == tid && ((m->lock_object.lo_flags & LO_RECURSABLE) != 0 || (opts & MTX_RECURSE) != 0)) { - m->mtx_recurse++; - atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); - recursed = true; - break; + m->mtx_recurse++; + atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); + recursed = true; + break; } rval = 0; break; From owner-svn-src-head@freebsd.org Tue May 30 11:53:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 012D4B7ADE8; Tue, 30 May 2017 11:53:20 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFBEB82AED; Tue, 30 May 2017 11:53:19 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UBrJbV075764; Tue, 30 May 2017 11:53:19 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UBrIYi075761; Tue, 30 May 2017 11:53:18 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201705301153.v4UBrIYi075761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 30 May 2017 11:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319197 - head/sys/dev/ena X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 11:53:20 -0000 Author: zbb Date: Tue May 30 11:53:18 2017 New Revision: 319197 URL: https://svnweb.freebsd.org/changeset/base/319197 Log: Add mbuf defragmentation to the ENA driver When mbuf chain is too long and device cannot handle that number of segments in DMA transaction, mbuf chain will be defragmented. Initially, driver was dropping all mbuf chains that were exceeding supported number of segments. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon.com Inc. Differential revision: https://reviews.freebsd.org/D10923 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue May 30 11:03:05 2017 (r319196) +++ head/sys/dev/ena/ena.c Tue May 30 11:53:18 2017 (r319197) @@ -155,7 +155,7 @@ static void ena_update_hwassist(struct ena_adapter *); static int ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); static void ena_tx_csum(struct ena_com_tx_ctx *, struct mbuf *); -static int ena_xmit_mbuf(struct ena_ring *, struct mbuf *); +static int ena_xmit_mbuf(struct ena_ring *, struct mbuf **); static void ena_start_xmit(struct ena_ring *); static int ena_mq_start(if_t, struct mbuf *); static void ena_deferred_mq_start(void *, int); @@ -2601,9 +2601,36 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct } static int -ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf *mbuf) +ena_check_and_defragment_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf) { struct ena_adapter *adapter; + struct mbuf *defrag_mbuf; + int num_frags; + + adapter = tx_ring->adapter; + num_frags = ena_mbuf_count(*mbuf); + + /* One segment must be reserved for configuration descriptor. */ + if (num_frags < adapter->max_tx_sgl_size) + return (0); + counter_u64_add(tx_ring->tx_stats.defragment, 1); + + defrag_mbuf = m_defrag(*mbuf, M_NOWAIT); + if (defrag_mbuf == NULL) { + counter_u64_add(tx_ring->tx_stats.defragment_err, 1); + return (ENOMEM); + } + + /* If mbuf was defragmented succesfully, original mbuf is released. */ + *mbuf = defrag_mbuf; + + return (0); +} + +static int +ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf) +{ + struct ena_adapter *adapter; struct ena_tx_buffer *tx_info; struct ena_com_tx_ctx ena_tx_ctx; struct ena_com_dev *ena_dev; @@ -2617,40 +2644,40 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf *m uint16_t ena_qid; uint32_t len, nsegs, header_len; int i, rc; - int nb_hw_desc, num_frags; + int nb_hw_desc; ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); adapter = tx_ring->que->adapter; ena_dev = adapter->ena_dev; io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; - ENA_ASSERT(mbuf, "mbuf is NULL\n"); + ENA_ASSERT(*mbuf, "mbuf is NULL\n"); - num_frags = ena_mbuf_count(mbuf); - if (num_frags > (adapter->max_tx_sgl_size - 2)) { - device_printf(adapter->pdev, - "too many fragments. Last fragment: %d!\n", num_frags); - return (ENA_COM_INVAL); + rc = ena_check_and_defragment_mbuf(tx_ring, mbuf); + if (rc) { + ena_trace(ENA_WARNING, + "Failed to defragment mbuf! err: %d", rc); + return (rc); } next_to_use = tx_ring->next_to_use; req_id = tx_ring->free_tx_ids[next_to_use]; tx_info = &tx_ring->tx_buffer_info[req_id]; - tx_info->mbuf = mbuf; + tx_info->mbuf = *mbuf; tx_info->num_of_bufs = 0; ena_buf = tx_info->bufs; - len = mbuf->m_len; + len = (*mbuf)->m_len; - ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", mbuf->m_pkthdr.len); + ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", (*mbuf)->m_pkthdr.len); push_len = 0; header_len = min_t(uint32_t, len, tx_ring->tx_max_header_size); push_hdr = NULL; rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map, - mbuf, segs, &nsegs, BUS_DMA_NOWAIT); + *mbuf, segs, &nsegs, BUS_DMA_NOWAIT); if (rc || (nsegs == 0)) { ena_trace(ENA_WARNING, @@ -2678,7 +2705,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf *m ena_tx_ctx.header_len = header_len; /* Set flags and meta data */ - ena_tx_csum(&ena_tx_ctx, mbuf); + ena_tx_csum(&ena_tx_ctx, *mbuf); /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (rc != 0) { @@ -2692,7 +2719,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf *m counter_enter(); counter_u64_add_protected(tx_ring->tx_stats.cnt, 1); - counter_u64_add_protected(tx_ring->tx_stats.bytes, mbuf->m_pkthdr.len); + counter_u64_add_protected(tx_ring->tx_stats.bytes, (*mbuf)->m_pkthdr.len); counter_exit(); tx_info->tx_descs = nb_hw_desc; @@ -2740,7 +2767,7 @@ ena_start_xmit(struct ena_ring *tx_ring) if (ena_com_sq_empty_space(io_sq) < ENA_TX_CLEANUP_TRESHOLD) ena_tx_cleanup(tx_ring); - if ((ret = ena_xmit_mbuf(tx_ring, mbuf)) != 0) { + if ((ret = ena_xmit_mbuf(tx_ring, &mbuf)) != 0) { if (ret == ENA_COM_NO_MEM) { drbr_putback(adapter->ifp, tx_ring->br, mbuf); } else if (ret == ENA_COM_NO_SPACE) { Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Tue May 30 11:03:05 2017 (r319196) +++ head/sys/dev/ena/ena.h Tue May 30 11:53:18 2017 (r319197) @@ -226,6 +226,8 @@ struct ena_stats_tx { counter_u64_t doorbells; counter_u64_t missing_tx_comp; counter_u64_t bad_req_id; + counter_u64_t defragment; + counter_u64_t defragment_err; }; struct ena_stats_rx { Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Tue May 30 11:03:05 2017 (r319196) +++ head/sys/dev/ena/ena_sysctl.c Tue May 30 11:53:18 2017 (r319197) @@ -155,6 +155,14 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "stops", CTLFLAG_RD, &tx_stats->queue_stop, "Queue stops"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "defragmentations", CTLFLAG_RD, + &tx_stats->defragment, + "Mbuf defragmentations"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "defragmentation_err", CTLFLAG_RD, + &tx_stats->defragment_err, + "Mbuf defragmentation failures"); /* RX specific stats */ rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO, From owner-svn-src-head@freebsd.org Tue May 30 11:55:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C8C1B7AE5A; Tue, 30 May 2017 11:55:04 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0E1C82C41; Tue, 30 May 2017 11:55:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UBt3Ao075889; Tue, 30 May 2017 11:55:03 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UBt2GL075888; Tue, 30 May 2017 11:55:02 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201705301155.v4UBt2GL075888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 30 May 2017 11:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319198 - head/sys/dev/ena X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 11:55:04 -0000 Author: zbb Date: Tue May 30 11:55:02 2017 New Revision: 319198 URL: https://svnweb.freebsd.org/changeset/base/319198 Log: Add locks before each ena_up and ena_down Lock only ena_up and ena_down calls in ioctl handler, instead of whole ioctl. Locking ioctl with sx lock that is sleepable, is not allowed in some cases, e.g. when multicast options are being changed. Additional locking was added in deatch function to prevent race condition with ioctl function. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon.com Inc. Differential revision: https://reviews.freebsd.org/D10924 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue May 30 11:53:18 2017 (r319197) +++ head/sys/dev/ena/ena.c Tue May 30 11:55:02 2017 (r319198) @@ -2285,16 +2285,16 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) /* * Acquiring lock to prevent from running up and down routines parallel. */ - sx_xlock(&adapter->ioctl_sx); - rc = 0; switch (command) { case SIOCSIFMTU: + sx_xlock(&adapter->ioctl_sx); ena_down(adapter); ena_change_mtu(ifp, ifr->ifr_mtu); rc = ena_up(adapter); + sx_unlock(&adapter->ioctl_sx); break; case SIOCSIFFLAGS: @@ -2306,11 +2306,16 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) "ioctl promisc/allmulti\n"); } } else { + sx_xlock(&adapter->ioctl_sx); rc = ena_up(adapter); + sx_unlock(&adapter->ioctl_sx); } } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + sx_xlock(&adapter->ioctl_sx); ena_down(adapter); + sx_unlock(&adapter->ioctl_sx); + } } break; @@ -2333,8 +2338,10 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) } if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + sx_xlock(&adapter->ioctl_sx); ena_down(adapter); rc = ena_up(adapter); + sx_unlock(&adapter->ioctl_sx); } } @@ -2344,8 +2351,6 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) break; } - sx_unlock(&adapter->ioctl_sx); - return (rc); } @@ -3666,7 +3671,9 @@ ena_detach(device_t pdev) taskqueue_drain(adapter->reset_tq, &adapter->reset_task); taskqueue_free(adapter->reset_tq); + sx_xlock(&adapter->ioctl_sx); ena_down(adapter); + sx_unlock(&adapter->ioctl_sx); if (adapter->ifp != NULL) { ether_ifdetach(adapter->ifp); From owner-svn-src-head@freebsd.org Tue May 30 11:56:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 928FBB7AEDC; Tue, 30 May 2017 11:56:55 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60FD582DAC; Tue, 30 May 2017 11:56:55 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UBusgO075993; Tue, 30 May 2017 11:56:54 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UBusAl075992; Tue, 30 May 2017 11:56:54 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201705301156.v4UBusAl075992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 30 May 2017 11:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319199 - head/sys/dev/ena X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 11:56:55 -0000 Author: zbb Date: Tue May 30 11:56:54 2017 New Revision: 319199 URL: https://svnweb.freebsd.org/changeset/base/319199 Log: Add error handling to the ENA driver if init of the reset task fails Also, to simplify cleaning routine, reset task is initialized before allocating statistics and other resources. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon.com Inc. Differential revision: https://reviews.freebsd.org/D10925 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue May 30 11:55:02 2017 (r319198) +++ head/sys/dev/ena/ena.c Tue May 30 11:56:54 2017 (r319199) @@ -3604,6 +3604,18 @@ ena_attach(device_t pdev) goto err_ifp_free; } + /* Initialize reset task queue */ + TASK_INIT(&adapter->reset_task, 0, ena_reset_task, adapter); + adapter->reset_tq = taskqueue_create("ena_reset_enqueue", + M_WAITOK | M_ZERO, taskqueue_thread_enqueue, &adapter->reset_tq); + if (adapter->reset_tq == NULL) { + device_printf(adapter->pdev, + "Unable to create reset task queue\n"); + goto err_reset_tq; + } + taskqueue_start_threads(&adapter->reset_tq, 1, PI_NET, + "%s rstq", device_get_nameunit(adapter->pdev)); + /* Initialize statistics */ ena_alloc_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); @@ -3613,16 +3625,12 @@ ena_attach(device_t pdev) /* Tell the stack that the interface is not active */ if_setdrvflagbits(adapter->ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); - /* Initialize reset task queue */ - TASK_INIT(&adapter->reset_task, 0, ena_reset_task, adapter); - adapter->reset_tq = taskqueue_create("ena_reset_enqueue", - M_WAITOK | M_ZERO, taskqueue_thread_enqueue, &adapter->reset_tq); - taskqueue_start_threads(&adapter->reset_tq, 1, PI_NET, - "%s rstq", device_get_nameunit(adapter->pdev)); - adapter->running = true; return (0); +err_reset_tq: + ena_free_mgmnt_irq(adapter); + ena_disable_msix(adapter); err_ifp_free: if_detach(adapter->ifp); if_free(adapter->ifp); From owner-svn-src-head@freebsd.org Tue May 30 11:58:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10F10B7AF57; Tue, 30 May 2017 11:58:53 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE9B182F25; Tue, 30 May 2017 11:58:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UBwpdc076094; Tue, 30 May 2017 11:58:51 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UBwpv0076092; Tue, 30 May 2017 11:58:51 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201705301158.v4UBwpv0076092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 30 May 2017 11:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319200 - head/sys/dev/ena X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 11:58:53 -0000 Author: zbb Date: Tue May 30 11:58:51 2017 New Revision: 319200 URL: https://svnweb.freebsd.org/changeset/base/319200 Log: Move ENA's hw stats updating routine to separate task Initially, stats were being updated each time OS was requesting for the first statistic. To read statistics from hw, condvar was used. cv_timedwait cannot be called when unsleepable lock is held, and this happens when FreeBSD is requesting statistic. Seperate task is reading statistics from NIC each 1 second. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon.com Inc. Differential revision: https://reviews.freebsd.org/D10926 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue May 30 11:56:54 2017 (r319199) +++ head/sys/dev/ena/ena.c Tue May 30 11:58:51 2017 (r319200) @@ -141,6 +141,7 @@ static void ena_free_irqs(struct ena_adapter*); static void ena_disable_msix(struct ena_adapter *); static void ena_unmask_all_io_irqs(struct ena_adapter *); static int ena_rss_configure(struct ena_adapter *); +static void ena_update_hw_stats(void *, int); static int ena_up_complete(struct ena_adapter *); static int ena_up(struct ena_adapter *); static void ena_down(struct ena_adapter *); @@ -2058,6 +2059,25 @@ static int ena_rss_configure(struct ena_adapter *adapt return 0; } +static void +ena_update_hw_stats(void *arg, int pending) +{ + struct ena_adapter *adapter = arg; + int rc; + + for (;;) { + if (!adapter->up) + return; + + rc = ena_update_stats_counters(adapter); + if (rc) + ena_trace(ENA_WARNING, + "Error updating stats counters, rc = %d", rc); + + pause("ena update hw stats", hz); + } +} + static int ena_up_complete(struct ena_adapter *adapter) { @@ -2141,6 +2161,8 @@ ena_up(struct ena_adapter *adapter) callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, ena_timer_service, (void *)adapter, 0); + taskqueue_enqueue(adapter->stats_tq, &adapter->stats_task); + adapter->up = true; } @@ -2193,24 +2215,8 @@ ena_get_counter(if_t ifp, ift_counter cnt) { struct ena_adapter *adapter; struct ena_hw_stats *stats; - int rc; adapter = if_getsoftc(ifp); - - /* - * Update only when asking for first counter and interface is up. - * Usually asks for all statistics in sequence. - */ - if (adapter->up) { - if (cnt == 0) { - rc = ena_update_stats_counters(adapter); - if (rc) { - ena_trace(ENA_WARNING, - "Error updating stats counters, rc = %d", - rc); - } - } - } stats = &adapter->hw_stats; switch (cnt) { @@ -2501,6 +2507,10 @@ ena_down(struct ena_adapter *adapter) if_setdrvflagbits(adapter->ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + /* Drain task responsible for updating hw stats */ + while (taskqueue_cancel(adapter->stats_tq, &adapter->stats_task, NULL)) + taskqueue_drain(adapter->stats_tq, &adapter->stats_task); + ena_free_io_irq(adapter); ena_destroy_all_io_queues(adapter); @@ -3616,6 +3626,18 @@ ena_attach(device_t pdev) taskqueue_start_threads(&adapter->reset_tq, 1, PI_NET, "%s rstq", device_get_nameunit(adapter->pdev)); + /* Initialize task queue responsible for updating hw stats */ + TASK_INIT(&adapter->stats_task, 0, ena_update_hw_stats, adapter); + adapter->stats_tq = taskqueue_create_fast("ena_stats_update", + M_WAITOK | M_ZERO, taskqueue_thread_enqueue, &adapter->stats_tq); + if (adapter->stats_tq == NULL) { + device_printf(adapter->pdev, + "Unable to create taskqueue for updating hw stats\n"); + goto err_stats_tq; + } + taskqueue_start_threads(&adapter->stats_tq, 1, PI_REALTIME, + "%s stats tq", device_get_nameunit(adapter->pdev)); + /* Initialize statistics */ ena_alloc_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); @@ -3628,6 +3650,8 @@ ena_attach(device_t pdev) adapter->running = true; return (0); +err_stats_tq: + taskqueue_free(adapter->reset_tq); err_reset_tq: ena_free_mgmnt_irq(adapter); ena_disable_msix(adapter); @@ -3682,6 +3706,8 @@ ena_detach(device_t pdev) sx_xlock(&adapter->ioctl_sx); ena_down(adapter); sx_unlock(&adapter->ioctl_sx); + + taskqueue_free(adapter->stats_tq); if (adapter->ifp != NULL) { ether_ifdetach(adapter->ifp); Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Tue May 30 11:56:54 2017 (r319199) +++ head/sys/dev/ena/ena.h Tue May 30 11:58:51 2017 (r319200) @@ -403,6 +403,10 @@ struct ena_adapter { uint32_t missing_tx_max_queues; uint32_t missing_tx_threshold; + /* Task updating hw stats */ + struct task stats_task; + struct taskqueue *stats_tq; + /* Statistics */ struct ena_stats_dev dev_stats; struct ena_hw_stats hw_stats; From owner-svn-src-head@freebsd.org Tue May 30 12:00:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 131B0B7B53B; Tue, 30 May 2017 12:00:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D53FE8333B; Tue, 30 May 2017 12:00:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UC0vhl076251; Tue, 30 May 2017 12:00:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UC0vv3076250; Tue, 30 May 2017 12:00:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201705301200.v4UC0vv3076250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 30 May 2017 12:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319201 - head/sys/dev/ena X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 12:00:58 -0000 Author: zbb Date: Tue May 30 12:00:56 2017 New Revision: 319201 URL: https://svnweb.freebsd.org/changeset/base/319201 Log: Introduce additional locks when releasing TX resources and buffers in ENA There could be race condition with TX cleaning routine when cleaning mbufs, when it was called directly from main sending thread (ena_mq_start). Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon.com Inc. Differential revision: https://reviews.freebsd.org/D10927 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue May 30 11:58:51 2017 (r319200) +++ head/sys/dev/ena/ena.c Tue May 30 12:00:56 2017 (r319201) @@ -713,6 +713,7 @@ ena_free_tx_resources(struct ena_adapter *adapter, int drbr_flush(adapter->ifp, tx_ring->br); /* Free buffer DMA maps, */ + ENA_RING_MTX_LOCK(tx_ring); for (int i = 0; i < tx_ring->ring_size; i++) { m_freem(tx_ring->tx_buffer_info[i].mbuf); tx_ring->tx_buffer_info[i].mbuf = NULL; @@ -721,6 +722,7 @@ ena_free_tx_resources(struct ena_adapter *adapter, int bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map); } + ENA_RING_MTX_UNLOCK(tx_ring); /* And free allocated memory. */ ENA_MEM_FREE(adapter->ena_dev->dmadev, tx_ring->tx_buffer_info); @@ -1121,6 +1123,7 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned { struct ena_ring *tx_ring = &adapter->tx_ring[qid]; + ENA_RING_MTX_LOCK(tx_ring); for (int i = 0; i < tx_ring->ring_size; i++) { struct ena_tx_buffer *tx_info = &tx_ring->tx_buffer_info[i]; @@ -1134,6 +1137,7 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned m_free(tx_info->mbuf); tx_info->mbuf = NULL; } + ENA_RING_MTX_UNLOCK(tx_ring); return; } From owner-svn-src-head@freebsd.org Tue May 30 13:53:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 430C8B7D7E6; Tue, 30 May 2017 13:53:05 +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 0EC0E2BF6; Tue, 30 May 2017 13:53:04 +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 v4UDr4YF025487; Tue, 30 May 2017 13:53:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UDr4cl025486; Tue, 30 May 2017 13:53:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201705301353.v4UDr4cl025486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 30 May 2017 13:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319212 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 13:53:05 -0000 Author: avg Date: Tue May 30 13:53:03 2017 New Revision: 319212 URL: https://svnweb.freebsd.org/changeset/base/319212 Log: fix indentation MFC after: 4 days Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue May 30 13:46:22 2017 (r319211) +++ head/sys/x86/x86/identcpu.c Tue May 30 13:53:03 2017 (r319212) @@ -906,7 +906,7 @@ printcpuinfo(void) "\033DBE" /* Data Breakpoint extension */ "\034PTSC" /* Performance TSC */ "\035PL2I" /* L2I perf count */ - "\036MWAITX" /* MONITORX/MWAITX instructions */ + "\036MWAITX" /* MONITORX/MWAITX instructions */ "\037" "\040" ); From owner-svn-src-head@freebsd.org Tue May 30 14:32:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5D0B7E5E1; Tue, 30 May 2017 14:32:45 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB6436433D; Tue, 30 May 2017 14:32:45 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UEWio8043354; Tue, 30 May 2017 14:32:44 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UEWip8043351; Tue, 30 May 2017 14:32:44 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201705301432.v4UEWip8043351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 30 May 2017 14:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319214 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 14:32:46 -0000 Author: jtl Date: Tue May 30 14:32:44 2017 New Revision: 319214 URL: https://svnweb.freebsd.org/changeset/base/319214 Log: Enforce the limit on ICMP messages before doing work to formulate the response. Delete an unneeded rate limit for UDP under IPv6. Because ICMP6 messages have their own rate limit, it is unnecessary to apply a second rate limit to UDP messages. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D10387 Modified: head/sys/netinet/ip_icmp.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Tue May 30 13:56:38 2017 (r319213) +++ head/sys/netinet/ip_icmp.c Tue May 30 14:32:44 2017 (r319214) @@ -540,11 +540,10 @@ icmp_input(struct mbuf **mp, int *offp, int proto) ICMPSTAT_INC(icps_bmcastecho); break; } - icp->icmp_type = ICMP_ECHOREPLY; if (badport_bandlim(BANDLIM_ICMP_ECHO) < 0) goto freeit; - else - goto reflect; + icp->icmp_type = ICMP_ECHOREPLY; + goto reflect; case ICMP_TSTAMP: if (V_icmptstamprepl == 0) @@ -558,13 +557,12 @@ icmp_input(struct mbuf **mp, int *offp, int proto) ICMPSTAT_INC(icps_badlen); break; } + if (badport_bandlim(BANDLIM_ICMP_TSTAMP) < 0) + goto freeit; icp->icmp_type = ICMP_TSTAMPREPLY; icp->icmp_rtime = iptime(); icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */ - if (badport_bandlim(BANDLIM_ICMP_TSTAMP) < 0) - goto freeit; - else - goto reflect; + goto reflect; case ICMP_MASKREQ: if (V_icmpmaskrepl == 0) Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue May 30 13:56:38 2017 (r319213) +++ head/sys/netinet6/udp6_usrreq.c Tue May 30 14:32:44 2017 (r319214) @@ -104,9 +104,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include @@ -480,8 +478,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto) goto badunlocked; } if (V_udp_blackhole) - goto badunlocked; - if (badport_bandlim(BANDLIM_ICMP6_UNREACH) < 0) goto badunlocked; icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, 0); return (IPPROTO_DONE); From owner-svn-src-head@freebsd.org Tue May 30 14:41:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E99B7E843; Tue, 30 May 2017 14:41:33 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC4026488F; Tue, 30 May 2017 14:41:32 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UEfWa5050278; Tue, 30 May 2017 14:41:32 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UEfW0q050277; Tue, 30 May 2017 14:41:32 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201705301441.v4UEfW0q050277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 30 May 2017 14:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319215 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 14:41:33 -0000 Author: jtl Date: Tue May 30 14:41:31 2017 New Revision: 319215 URL: https://svnweb.freebsd.org/changeset/base/319215 Log: Fix two places in the ICMP6 code where we could dereference a NULL pointer in the icmp6_input() function. When processing an ICMP6_ECHO_REQUEST, if IP6_EXTHDR_GET fails, it will set nicmp6 and n to NULL. Therefore, we should condition our modification to nicmp6 on n being not NULL. And, when processing an ICMP6_WRUREQUEST in the (mode != FQDN) case, if m_dup_pkthdr() fails, the code will set n to NULL. However, the very next line dereferences n. Therefore, when m_dup_pkthdr() fails, we should discontinue further processing and follow the same path as when m_gethdr() fails. Reported by: clang static analyzer Reviewed by: ae MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D10941 Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Tue May 30 14:32:44 2017 (r319214) +++ head/sys/netinet6/icmp6.c Tue May 30 14:41:31 2017 (r319215) @@ -597,9 +597,9 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) sizeof(*nicmp6)); noff = off; } - nicmp6->icmp6_type = ICMP6_ECHO_REPLY; - nicmp6->icmp6_code = 0; if (n) { + nicmp6->icmp6_type = ICMP6_ECHO_REPLY; + nicmp6->icmp6_code = 0; ICMP6STAT_INC(icp6s_reflect); ICMP6STAT_INC(icp6s_outhist[ICMP6_ECHO_REPLY]); icmp6_reflect(n, noff); @@ -689,6 +689,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) */ m_free(n); n = NULL; + break; } maxhlen = M_TRAILINGSPACE(n) - (sizeof(*nip6) + sizeof(*nicmp6) + 4); From owner-svn-src-head@freebsd.org Tue May 30 14:50:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9AC8B7EA8A; Tue, 30 May 2017 14:50:29 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 982D664D8F; Tue, 30 May 2017 14:50:29 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UEoSiQ053663; Tue, 30 May 2017 14:50:28 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UEoSAV053662; Tue, 30 May 2017 14:50:28 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201705301450.v4UEoSAV053662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 30 May 2017 14:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319216 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 14:50:29 -0000 Author: jtl Date: Tue May 30 14:50:28 2017 New Revision: 319216 URL: https://svnweb.freebsd.org/changeset/base/319216 Log: Fix an unnecessary/incorrect check in the PKTOPT_EXTHDRCPY macro. This macro allocates memory and, if malloc does not return NULL, copies data into the new memory. However, it doesn't just check whether malloc returns NULL. It also checks whether we called malloc with M_NOWAIT. That is not necessary. While it may be that malloc() will only return NULL when the M_NOWAIT flag is set, we don't need to check for this when checking malloc's return value. Further, in this case, the check was not completely accurate, because it checked for flags == M_NOWAIT, rather than treating it as a bit field and checking for (flags & M_NOWAIT). Reviewed by: ae MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D10942 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue May 30 14:41:31 2017 (r319215) +++ head/sys/netinet6/ip6_output.c Tue May 30 14:50:28 2017 (r319216) @@ -2465,7 +2465,7 @@ do {\ if (src->type) {\ int hlen = (((struct ip6_ext *)src->type)->ip6e_len + 1) << 3;\ dst->type = malloc(hlen, M_IP6OPT, canwait);\ - if (dst->type == NULL && canwait == M_NOWAIT)\ + if (dst->type == NULL)\ goto bad;\ bcopy(src->type, dst->type, hlen);\ }\ From owner-svn-src-head@freebsd.org Tue May 30 15:46:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 980E0B8205D; Tue, 30 May 2017 15:46:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3642768235; Tue, 30 May 2017 15:46:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wr0-f177.google.com with SMTP id g76so3143741wrd.1; Tue, 30 May 2017 08:46:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=5P6aMxCqibTpctP981PtKgoslZpDr+GPQiv+UC+I+6E=; b=aiEP2freMqUqNs2wd3Dywv2YQf0GZYkXBXpDhyGPECbqYcKtCxVGKF7hiNYF6wq9cZ iM1eP1IArFfw82x7VR3yX94MePyUXvpAOp+zg4uXcMkRa/ktrjw9d3UCsexxGb32m0BZ V8XDBUgPVtGc4dfyy295S+bl3pt93Mw3+xCYUP2cQmfSiCoAVAh7FxbYh7WxC/ILzdu9 NZpUguE7447KJ4DKLsRu9rPUxOffvvB16xBw+ji9gJRJDXqgRh49NQaLMAhbELLJ8X3q F81QY6k8/lCjEDffP/k8fkF448WFwbUs9qgmh9nNhM57qtQAZ0gd5Bc8SDiKifX6ONTy HLSw== X-Gm-Message-State: AODbwcASYOd9co+nl5vIBQCQbbi862WcN19ejFaTnPZ7BfSVymN24kvS fU+1SWixSjUrMEW52QM= X-Received: by 10.223.160.70 with SMTP id l6mr17782373wrl.0.1496159208484; Tue, 30 May 2017 08:46:48 -0700 (PDT) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com. [74.125.82.48]) by smtp.gmail.com with ESMTPSA id j65sm17439245wmg.0.2017.05.30.08.46.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 08:46:48 -0700 (PDT) Received: by mail-wm0-f48.google.com with SMTP id e127so104443863wmg.1; Tue, 30 May 2017 08:46:48 -0700 (PDT) X-Received: by 10.80.184.129 with SMTP id l1mr16826833ede.88.1496159208165; Tue, 30 May 2017 08:46:48 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.38 with HTTP; Tue, 30 May 2017 08:46:47 -0700 (PDT) In-Reply-To: <201705262217.v4QMHiSd045273@repo.freebsd.org> References: <201705262217.v4QMHiSd045273@repo.freebsd.org> From: Conrad Meyer Date: Tue, 30 May 2017 08:46:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r318969 - in head: lib/libprocstat sys/kern sys/sys usr.bin/procstat To: svn-src-all@freebsd.org Cc: src-committers , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 15:46:57 -0000 Whoops, the commit message for this revision was slightly stale (previous version of the patch). On Fri, May 26, 2017 at 3:17 PM, Conrad Meyer wrote: > Author: cem > Date: Fri May 26 22:17:44 2017 > New Revision: 318969 > URL: https://svnweb.freebsd.org/changeset/base/318969 > > Log: > procstat(1): Add TCP socket send/recv buffer size > > Add TCP socket send and receive buffer size to procstat -f output. This should read something like: Add streaming socket send/recv buffer size Support was added for TCP and unix domain sockets, and could be added for SCTP. Best, Conrad From owner-svn-src-head@freebsd.org Tue May 30 15:51:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13109B821FA; Tue, 30 May 2017 15:51:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6565D68497; Tue, 30 May 2017 15:51:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UFpmws099489; Tue, 30 May 2017 15:51:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UFpmMb099488; Tue, 30 May 2017 15:51:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705301551.v4UFpmMb099488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 30 May 2017 15:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319219 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 15:51:50 -0000 Author: emaste Date: Tue May 30 15:51:48 2017 New Revision: 319219 URL: https://svnweb.freebsd.org/changeset/base/319219 Log: add a rescue/sh sanity check before installworld on the running system FreeBSD does not guarantee kernel forward compatibility (that is, running a newer userland on an older kernel). The documented upgrade procedure specifies that installkernel should be performed, followed by a reboot and then installworld. As a sanity check when installing onto the running system (DESTDIR is / or unset), attempt to run "sh echo OK" using rescue from the objdir. If rescue fails (e.g., because the system has not been rebooted and the "old" kernel lacks a system call required by the to-be-installed world), abort the installation. This should avoid ino64 foot-shooting when the proper upgrade procedure is not followed. Reviewed by: allanjude, gjb, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10987 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 30 15:33:27 2017 (r319218) +++ head/Makefile.inc1 Tue May 30 15:51:48 2017 (r319219) @@ -975,6 +975,22 @@ __installcheck_UGID: .PHONY fi .endfor .endif +# +# If installing over the running system (DESTDIR is / or unset) and the install +# includes rescue, try running rescue from the objdir as a sanity check. If +# rescue is not functional (e.g., because it depends on a system call not +# supported by the currently running kernel), abort the installation. +# +.if !make(distributeworld) && ${MK_RESCUE} != "no" && \ + (empty(DESTDIR) || ${DESTDIR} == "/") && empty(BYPASS_INSTALLCHECK_SH) +_installcheck_world: __installcheck_sh_check +__installcheck_sh_check: .PHONY + @if [ "`${OBJTREE}${.CURDIR}/rescue/rescue/rescue sh -c 'echo OK'`" != \ + OK ]; then \ + echo "rescue/sh check failed, installation aborted" >&2; \ + false; \ + fi +.endif # # Required install tools to be saved in a scratch dir for safety. From owner-svn-src-head@freebsd.org Tue May 30 16:31:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 009ABB8768C; Tue, 30 May 2017 16:31:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2E416E1DF; Tue, 30 May 2017 16:31:13 +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 8ABAA10AFA2; Tue, 30 May 2017 12:31:12 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318997 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfsclient kern sys Date: Sun, 28 May 2017 06:48:38 -0700 Message-ID: <2187407.D9lHvpEUce@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201705271700.v4RH0USD004310@repo.freebsd.org> References: <201705271700.v4RH0USD004310@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 30 May 2017 12:31:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 16:31:14 -0000 On Saturday, May 27, 2017 05:00:30 PM Konstantin Belousov wrote: > Author: kib > Date: Sat May 27 17:00:30 2017 > New Revision: 318997 > URL: https://svnweb.freebsd.org/changeset/base/318997 > > Log: > Use whole mnt_stat.f_fsid bits for st_dev. > > Since ino64 expanded dev_t to 64bit, make VOP_GETATTR(9) provide all > bits of mnt_stat.f_fsid as va_fsid for vnodes on filesystems which use > f_fsid. In particular, NFSv3 and sometimes NFSv4, and ZFS use this > method or reporting st_dev by stat(2). > > Provide a new helper vn_fsid() to avoid duplicating code to copy > f_fsid to va_fsid. > > Note that the change is mostly cosmetic. Its motivation is to avoid > sign-extension of f_fsid[0] into 64bit dev_t value which happens after > dev_t becomes 64bit.. > > Reviewed by: avg(zfs), rmacklem (nfs) (both for previous version) > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > head/sys/fs/nfsclient/nfs_clport.c > head/sys/kern/vfs_vnops.c > head/sys/sys/vnode.h > > Modified: head/sys/fs/nfsclient/nfs_clport.c > ============================================================================== > --- head/sys/fs/nfsclient/nfs_clport.c Sat May 27 16:53:39 2017 (r318996) > +++ head/sys/fs/nfsclient/nfs_clport.c Sat May 27 17:00:30 2017 (r318997) > @@ -490,14 +490,13 @@ nfscl_loadattrcache(struct vnode **vpp, > * from the value used for the top level server volume > * in the mounted subtree. > */ > - if (vp->v_mount->mnt_stat.f_fsid.val[0] != > - (uint32_t)np->n_vattr.na_filesid[0]) > - vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0]; > - else > - vap->va_fsid = (uint32_t)hash32_buf( > + vn_fsid(vp, vap); > + vap->va_fsid = np->n_vattr.na_filesid[0]; > + if (vap->va_fsid == np->n_vattr.na_filesid[0]) > + vap->va_fsid = hash32_buf( > np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); Won't this always be true now since you've done 'a = b; if (a == b) ...'? Also, does the assignment to 'va_fsid' before the 'if' overwrite the work of vn_fsid()? -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 30 17:16:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0CBAB88EDE; Tue, 30 May 2017 17:16:10 +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 B29207042A; Tue, 30 May 2017 17:16:10 +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 v4UHG9Yc035974; Tue, 30 May 2017 17:16:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHG9JZ035966; Tue, 30 May 2017 17:16:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201705301716.v4UHG9JZ035966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 May 2017 17:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319229 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:16:11 -0000 Author: markj Date: Tue May 30 17:16:08 2017 New Revision: 319229 URL: https://svnweb.freebsd.org/changeset/base/319229 Log: Add some miscellaneous definitions to support DRM drivers. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10985 Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/io.h head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/compat/linuxkpi/common/include/linux/module.h head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/include/linux/preempt.h head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Tue May 30 17:16:08 2017 (r319229) @@ -56,6 +56,7 @@ #define __devexit #define __exit #define __rcu +#define __malloc #define ___stringify(...) #__VA_ARGS__ #define __stringify(...) ___stringify(__VA_ARGS__) #define __attribute_const__ __attribute__((__const__)) Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Tue May 30 17:16:08 2017 (r319229) @@ -61,6 +61,23 @@ struct class { char * (*devnode)(struct device *dev, umode_t *mode); }; +struct dev_pm_ops { + int (*suspend)(struct device *dev); + int (*suspend_late)(struct device *dev); + int (*resume)(struct device *dev); + int (*resume_early)(struct device *dev); + int (*freeze)(struct device *dev); + int (*freeze_late)(struct device *dev); + int (*thaw)(struct device *dev); + int (*poweroff)(struct device *dev); + int (*poweroff_late)(struct device *dev); + int (*restore)(struct device *dev); + int (*restore_early)(struct device *dev); + int (*runtime_suspend)(struct device *dev); + int (*runtime_resume)(struct device *dev); + int (*runtime_idle)(struct device *dev); +}; + struct device { struct device *parent; struct list_head irqents; Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 30 17:16:08 2017 (r319229) @@ -36,6 +36,7 @@ #include #include +#include static inline uint32_t __raw_readl(const volatile void *addr) Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue May 30 17:16:08 2017 (r319229) @@ -87,7 +87,9 @@ #define S64_C(x) x ## LL #define U64_C(x) x ## ULL -#define BUILD_BUG_ON(x) CTASSERT(!(x)) +#define BUILD_BUG_ON(x) CTASSERT(!(x)) +#define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) +#define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ @@ -118,6 +120,8 @@ } \ unlikely(__ret); \ }) + +#define oops_in_progress SCHEDULER_STOPPED() #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) Modified: head/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/module.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/module.h Tue May 30 17:16:08 2017 (r319229) @@ -45,6 +45,8 @@ #define MODULE_AUTHOR(name) #define MODULE_DESCRIPTION(name) #define MODULE_LICENSE(name) +#define MODULE_INFO(tag, info) +#define MODULE_FIRMWARE(firmware) #define THIS_MODULE ((struct module *)0) Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 30 17:16:08 2017 (r319229) @@ -72,16 +72,20 @@ struct pci_device_id { #define PCI_VENDOR_ID_IBM 0x1014 #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_VENDOR_ID_MELLANOX 0x15b3 +#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 #define PCI_VENDOR_ID_SERVERWORKS 0x1166 #define PCI_VENDOR_ID_SONY 0x104d #define PCI_VENDOR_ID_TOPSPIN 0x1867 #define PCI_VENDOR_ID_VIA 0x1106 +#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 +#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 #define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 +#define PCI_SUBDEVICE_ID_QEMU 0x1100 #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) Modified: head/sys/compat/linuxkpi/common/include/linux/preempt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/preempt.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/preempt.h Tue May 30 17:16:08 2017 (r319229) @@ -34,4 +34,7 @@ #define in_interrupt() \ (curthread->td_intr_nesting_level || curthread->td_critnest) +#define preempt_disable() critical_enter() +#define preempt_enable() critical_exit() + #endif /* _LINUX_PREEMPT_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Tue May 30 17:16:08 2017 (r319229) @@ -65,6 +65,8 @@ typedef u64 phys_addr_t; #define DECLARE_BITMAP(n, bits) \ unsigned long n[howmany(bits, sizeof(long) * 8)] +typedef unsigned long irq_hw_number_t; + struct rcu_head { void *raw[2]; } __aligned(sizeof(void *)); From owner-svn-src-head@freebsd.org Tue May 30 17:19:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A4F8B94213; Tue, 30 May 2017 17:19:11 +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 90DDD7086C; Tue, 30 May 2017 17:19:10 +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 v4UHJ59N055971 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 May 2017 20:19:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4UHJ59N055971 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4UHJ4YE055969; Tue, 30 May 2017 20:19:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 May 2017 20:19:04 +0300 From: Konstantin Belousov To: John Baldwin Cc: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318997 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfsclient kern sys Message-ID: <20170530171904.GL82323@kib.kiev.ua> References: <201705271700.v4RH0USD004310@repo.freebsd.org> <2187407.D9lHvpEUce@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2187407.D9lHvpEUce@ralph.baldwin.cx> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:19:11 -0000 On Sun, May 28, 2017 at 06:48:38AM -0700, John Baldwin wrote: > On Saturday, May 27, 2017 05:00:30 PM Konstantin Belousov wrote: > > */ > > - if (vp->v_mount->mnt_stat.f_fsid.val[0] != > > - (uint32_t)np->n_vattr.na_filesid[0]) > > - vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0]; > > - else > > - vap->va_fsid = (uint32_t)hash32_buf( > > + vn_fsid(vp, vap); > > + vap->va_fsid = np->n_vattr.na_filesid[0]; > > + if (vap->va_fsid == np->n_vattr.na_filesid[0]) > > + vap->va_fsid = hash32_buf( > > np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); > > Won't this always be true now since you've done 'a = b; if (a == b) ...'? > Also, does the assignment to 'va_fsid' before the 'if' overwrite the work > of vn_fsid()? Thank you. Indeed, the asignment should have been removed. Below is the proposed correction. diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 509c38b8614..44c0eae0179 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -491,8 +491,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, * in the mounted subtree. */ vn_fsid(vp, vap); - vap->va_fsid = np->n_vattr.na_filesid[0]; - if (vap->va_fsid == np->n_vattr.na_filesid[0]) + if ((uint32_t)vap->va_fsid == np->n_vattr.na_filesid[0]) vap->va_fsid = hash32_buf( np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); } else From owner-svn-src-head@freebsd.org Tue May 30 18:03:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D73B958AA; Tue, 30 May 2017 18:03:36 +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 C405273481; Tue, 30 May 2017 18:03:35 +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 v4UI3YQr058781; Tue, 30 May 2017 18:03:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UI3YZT058779; Tue, 30 May 2017 18:03:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705301803.v4UI3YZT058779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 30 May 2017 18:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319246 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 18:03:36 -0000 Author: ngie Date: Tue May 30 18:03:34 2017 New Revision: 319246 URL: https://svnweb.freebsd.org/changeset/base/319246 Log: Use .Xr to reference libblacklist(3), blacklistctl(8), and blacklistd(8) MFC after: now Sponsored by: Dell EMC Isilon Modified: head/tools/build/options/WITHOUT_BLACKLIST head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT Modified: head/tools/build/options/WITHOUT_BLACKLIST ============================================================================== --- head/tools/build/options/WITHOUT_BLACKLIST Tue May 30 17:48:41 2017 (r319245) +++ head/tools/build/options/WITHOUT_BLACKLIST Tue May 30 18:03:34 2017 (r319246) @@ -1,2 +1,5 @@ .\" $FreeBSD$ -Set this if you do not want to build blacklistd/blacklistctl. +Set this if you do not want to build +.Xr blacklistd 8 +and +.Xr blacklistctl 8 . Modified: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT ============================================================================== --- head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT Tue May 30 17:48:41 2017 (r319245) +++ head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT Tue May 30 18:03:34 2017 (r319246) @@ -1,5 +1,7 @@ .\" $FreeBSD$ -Set to build some programs without blacklistd support, like +Set to build some programs without +.Xr libblacklist 3 +support, like .Xr fingerd 8 , .Xr ftpd 8 , .Xr rlogind 8 , From owner-svn-src-head@freebsd.org Tue May 30 18:06:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31463B95A96; Tue, 30 May 2017 18:06:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BA0B73840; Tue, 30 May 2017 18:06:20 +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 v4UI6KmT059155; Tue, 30 May 2017 18:06:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UI6Kmi059154; Tue, 30 May 2017 18:06:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705301806.v4UI6Kmi059154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 30 May 2017 18:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319248 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 18:06:21 -0000 Author: ngie Date: Tue May 30 18:06:19 2017 New Revision: 319248 URL: https://svnweb.freebsd.org/changeset/base/319248 Log: Regenerate src.conf(5) This contains a number of content changes due to src.opts.mk changes. Sponsored by: Dell EMC Isilon Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue May 30 18:04:55 2017 (r319247) +++ head/share/man/man5/src.conf.5 Tue May 30 18:06:19 2017 (r319248) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 21, 2017 +.Dd May 30, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -180,7 +180,10 @@ as part of the bootstrap process. This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BLACKLIST -Set this if you do not want to build blacklistd/blacklistctl. +Set this if you do not want to build +.Xr blacklistd 8 +and +.Xr blacklistctl 8 . When set, it enforces these options: .Pp .Bl -item -compact @@ -188,7 +191,9 @@ When set, it enforces these options: .Va WITHOUT_BLACKLIST_SUPPORT .El .It Va WITHOUT_BLACKLIST_SUPPORT -Set to build some programs without blacklistd support, like +Set to build some programs without +.Xr libblacklist 3 +support, like .Xr fingerd 8 , .Xr ftpd 8 , .Xr rlogind 8 , @@ -705,13 +710,34 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GDB Set to build .Xr gdb 1 . .Pp This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITHOUT_GDB_LIBEXEC +Set to install +.Xr gdb 1 +into +.Pa /usr/bin . +.Pp +This is a default setting on arm/arm, arm/armeb, arm/armv6 and sparc64/sparc64. +.It Va WITH_GDB_LIBEXEC +Set to install +.Xr gdb 1 +into +.Pa /usr/libexec . +This permits +.Xr gdb 1 +to be used as a fallback for +.Xr crashinfo 8 +if a newer version is not installed. +.Pp +This is a default setting on +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. @@ -943,12 +969,6 @@ Set to not build LLVM's lld linker. .Pp This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_LLD_IS_LD -.El .It Va WITH_LLD Set to build LLVM's lld linker. .Pp @@ -987,14 +1007,6 @@ Set to use LLVM's LLD as the system linker, instead of .Pp This is a default setting on arm64/aarch64. -When set, these options are also in effect: -.Pp -.Bl -inset -compact -.It Va WITHOUT_SYSTEM_COMPILER -(unless -.Va WITH_SYSTEM_COMPILER -is set explicitly) -.El .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp @@ -1412,24 +1424,6 @@ The and .Va WITHOUT_GCC options control those. -.Pp -This is a default setting on -arm64/aarch64. -.It Va WITH_SYSTEM_COMPILER -Set to opportunistically skip building a cross-compiler during the -bootstrap phase of the build. -If the currently installed compiler matches the planned bootstrap compiler -type and revision, then it will not be built. -This does not prevent a compiler from being built for installation though, -only for building one for the build itself. -The -.Va WITHOUT_CLANG -and -.Va WITHOUT_GCC -options control those. -.Pp -This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_TALK Set to not build or install .Xr talk 1 From owner-svn-src-head@freebsd.org Tue May 30 19:25:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 011C8BDA0C1 for ; Tue, 30 May 2017 19:25:07 +0000 (UTC) (envelope-from stephen.mcconnell@broadcom.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF0CE75F70 for ; Tue, 30 May 2017 19:25:06 +0000 (UTC) (envelope-from stephen.mcconnell@broadcom.com) Received: by mail-it0-x22c.google.com with SMTP id w68so11535310itc.0 for ; Tue, 30 May 2017 12:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc; bh=KGaU3T/IHg9vvrFF/ZJ6qw82OdGxupLPvwCSJ98tNPk=; b=AeYz/ZjELtQzrM8DtD+Xs7BdQT5RsBwwLb8HHj7npaY8k0Jg+GhTwmbA0Zizz3RjAb Ew2EVUjtqr34v0A1BvEgnQooityaa4mfkBSOkeqHQf0xWcmuY5NBwiAGW3TTxes8OlvJ ZOSfKUH9tvdzss6D6Z38E/K8IxVD6VVQOGhCo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc; bh=KGaU3T/IHg9vvrFF/ZJ6qw82OdGxupLPvwCSJ98tNPk=; b=SxvVrXZ0Rhcr0QkSjLrhuPWhKeWjrs2k4P3IUVFn4SMq0HI6CiIUwPzbNrzbpKZfi+ 3walVrEEqlA/SVQmNlaU0jHLRitB78PGa2lOStPXabJMNAXfCgJEPN9ZF4RJr0GX/D+Q deD+ugVZnONyCd3eRjzLHtb3Z3c+M0nBXh2kia/Ic9u5a6LW6y+E3NdNZCEbZU0mVez7 oGa7/4WdkPA06o7QDWGIuLs/TrmjrA2piEQifKS3aWeEmULx3MEqF4OZURUZav+7Cnvh XGWAyNFEqErrG1y8IR3mIKSgx+2hEOTRY7MGbIAY83bf8BrDkU9/1xlqiZ/O9bMxJCFA Zcrg== X-Gm-Message-State: AODbwcAFVs+N/UynOS2EnlTP4L2RiZmr0+HF2o4xkRX57Z/zOyt9po/p NWY/iy61OcAN5tjGHfrNe6lPzNSlsnER X-Received: by 10.36.238.129 with SMTP id b123mr3481448iti.10.1496172306054; Tue, 30 May 2017 12:25:06 -0700 (PDT) From: Stephen Mcconnell References: <201705251914.v4PJEi3l075183@repo.freebsd.org> <20170525191702.GB27521@FreeBSD.org> In-Reply-To: <20170525191702.GB27521@FreeBSD.org> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQLj1fAhdrBVtZQZ8rtwlWyF43D99AL+iBECn9NTsaA= Date: Tue, 30 May 2017 13:25:05 -0600 Message-ID: <5de43913ae47381a74b7b8def9d0f82c@mail.gmail.com> Subject: RE: svn commit: r318895 - in head: share/man/man4 sys/dev/mps To: Alexey Dokuchaev , Stephen McConnell Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 19:25:07 -0000 > -----Original Message----- > From: Alexey Dokuchaev [mailto:danfe@FreeBSD.org] > Sent: Thursday, May 25, 2017 1:17 PM > To: Stephen McConnell > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r318895 - in head: share/man/man4 sys/dev/mps > > On Thu, May 25, 2017 at 07:14:44PM +0000, Stephen McConnell wrote: > > New Revision: 318895 > > URL: https://svnweb.freebsd.org/changeset/base/318895 > > > > Log: > > Fix several problems with mapping code. > > > > Reviewed by: ken, scottl, asomers, ambrisko, mav > > Approved by: ken, mav > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D10878 > > It would be nice to mention, at least briefly, what were those problems in the > commit log. You're right. Normally I would have done that. Not sure why I didn't this time. > > ./danfe From owner-svn-src-head@freebsd.org Tue May 30 20:03:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D42F9BEB1FA; Tue, 30 May 2017 20:03:58 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670056.outbound.protection.outlook.com [40.107.67.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 875337735B; Tue, 30 May 2017 20:03:56 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0191.CANPRD01.PROD.OUTLOOK.COM (10.165.218.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Tue, 30 May 2017 20:03:54 +0000 Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.1124.016; Tue, 30 May 2017 20:03:54 +0000 From: Rick Macklem To: Konstantin Belousov , John Baldwin CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r318997 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfsclient kern sys Thread-Topic: svn commit: r318997 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfsclient kern sys Thread-Index: AQHS2WI0J0VJA24VSkmHe10YcdO3DKINHucAgAAtB/g= Date: Tue, 30 May 2017 20:03:54 +0000 Message-ID: References: <201705271700.v4RH0USD004310@repo.freebsd.org> <2187407.D9lHvpEUce@ralph.baldwin.cx>,<20170530171904.GL82323@kib.kiev.ua> In-Reply-To: <20170530171904.GL82323@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTXPR01MB0191; 7:pUiQNLL09grRRVlm0Uvf2gsJYSV7ziUEDZ+QXCmJ0JrUFz+VfaXJXD5agkeiRmX4PQXs/VsDTY+6OdkLAFHuIaZ7HuufU+wTuCm25omCxqJ7Ay4D2wPRw7tZzDRwSOvdPOn/laW3vrDWS7i8JVhyzIqX859s4OaglpKIHVKEUOz5AY1aEXbv2UxL7Z+VukHEG+LxQx8F34aRlRkxsOj4Jomo7Bal2qQDseY77YCS3/kkoiojL0g8mfNSk6swAXccffx79UMiP+OgqZe0NpWN9VmdLA8bhoavnGKVQIPKKyY80lfsxP/P4hXkZ67dzDsAjtnW2q2pYvr+wkloV6TfyA== x-ms-traffictypediagnostic: YTXPR01MB0191: x-ms-office365-filtering-correlation-id: 7028968d-252b-4588-a95b-08d4a797001d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:YTXPR01MB0191; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123564025)(20161123558100)(20161123560025)(20161123562025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148); SRVR:YTXPR01MB0191; BCL:0; PCL:0; RULEID:; SRVR:YTXPR01MB0191; x-forefront-prvs: 032334F434 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39840400002)(39450400003)(39400400002)(39410400002)(39850400002)(24454002)(102836003)(122556002)(74482002)(38730400002)(50986999)(305945005)(54356999)(2900100001)(8676002)(478600001)(81166006)(5660300001)(74316002)(14454004)(6246003)(76176999)(77096006)(68736007)(8936002)(53936002)(229853002)(6436002)(6506006)(39060400002)(33656002)(189998001)(4326008)(2950100002)(9686003)(25786009)(86362001)(3660700001)(3280700002)(7696004)(575784001)(2906002)(55016002)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0191; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2017 20:03:54.8520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0191 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 20:03:58 -0000 Konstantin Belousov wrote: >Thank you. >Indeed, the asignment should have been removed. Below is the proposed >correction. > >diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c >index 509c38b8614..44c0eae0179 100644 >--- a/sys/fs/nfsclient/nfs_clport.c >+++ b/sys/fs/nfsclient/nfs_clport.c >@@ -491,8 +491,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt= r *nap, void > *nvaper, > * in the mounted subtree. > */ > vn_fsid(vp, vap); > - vap->va_fsid =3D np->n_vattr.na_filesid[0]; > - if (vap->va_fsid =3D=3D np->n_vattr.na_filesid[0]) > + if ((uint32_t)vap->va_fsid =3D=3D np->n_vattr.na_filesid[= 0]) > vap->va_fsid =3D hash32_buf( > np->n_vattr.na_filesid, 2 * sizeof(uint64_t), = 0); > } else Yep. Yhis revised one looks fine to me, rick From owner-svn-src-head@freebsd.org Tue May 30 21:20:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAEEBBEE5F2; Tue, 30 May 2017 21:20:55 +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 99ABD7AC99; Tue, 30 May 2017 21:20:55 +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 v4ULKsek039194; Tue, 30 May 2017 21:20:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4ULKslG039193; Tue, 30 May 2017 21:20:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705302120.v4ULKslG039193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 May 2017 21:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319253 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 21:20:55 -0000 Author: kib Date: Tue May 30 21:20:54 2017 New Revision: 319253 URL: https://svnweb.freebsd.org/changeset/base/319253 Log: Fix bug in r318997: remove the line which overrides vn_fsid() calculation. Noted by: jhb Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue May 30 21:03:44 2017 (r319252) +++ head/sys/fs/nfsclient/nfs_clport.c Tue May 30 21:20:54 2017 (r319253) @@ -491,8 +491,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt * in the mounted subtree. */ vn_fsid(vp, vap); - vap->va_fsid = np->n_vattr.na_filesid[0]; - if (vap->va_fsid == np->n_vattr.na_filesid[0]) + if ((uint32_t)vap->va_fsid == np->n_vattr.na_filesid[0]) vap->va_fsid = hash32_buf( np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); } else From owner-svn-src-head@freebsd.org Wed May 31 03:11:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5324BF3FE5; Wed, 31 May 2017 03:11:26 +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 5153084ED7; Wed, 31 May 2017 03:11:26 +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 v4V3BP1r084663; Wed, 31 May 2017 03:11:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4V3BPXM084662; Wed, 31 May 2017 03:11:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201705310311.v4V3BPXM084662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 31 May 2017 03:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319273 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 03:11:26 -0000 Author: cy Date: Wed May 31 03:11:25 2017 New Revision: 319273 URL: https://svnweb.freebsd.org/changeset/base/319273 Log: Remove NORESOLVE (-R) option from poollist() (ippool -l). It is not used in poollist(). Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Wed May 31 00:43:52 2017 (r319272) +++ head/contrib/ipfilter/tools/ippool.c Wed May 31 03:11:25 2017 (r319273) @@ -663,7 +663,7 @@ poollist(argc, argv) poolname = NULL; role = IPL_LOGALL; - while ((c = getopt(argc, argv, "dm:M:N:o:Rt:v")) != -1) + while ((c = getopt(argc, argv, "dm:M:N:o:t:v")) != -1) switch (c) { case 'd' : @@ -689,9 +689,6 @@ poollist(argc, argv) break; case 'O' : pool_fields = parsefields(poolfields, optarg); - break; - case 'R' : - opts |= OPT_NORESOLVE; break; case 't' : type = gettype(optarg, NULL); From owner-svn-src-head@freebsd.org Wed May 31 03:44:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D619BF45E3; Wed, 31 May 2017 03:44:32 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 110611249; Wed, 31 May 2017 03:44:31 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4V3iVXf098557; Wed, 31 May 2017 03:44:31 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4V3iV1B098556; Wed, 31 May 2017 03:44:31 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201705310344.v4V3iV1B098556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Wed, 31 May 2017 03:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319274 - head/usr.bin/uname X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 03:44:32 -0000 Author: danfe (ports committer) Date: Wed May 31 03:44:31 2017 New Revision: 319274 URL: https://svnweb.freebsd.org/changeset/base/319274 Log: - Add a simple example to uname(1) manual page to show how the hardware platform (returned by -m) can be different from the machine's processor architecture (-p) - Document that make(1) sets universal MACHINE and MACHINE_ARCH variables based on these values Reviewed by: imp, manpages (bjk) Approved by: bjk, imp (implied) Differential Revision: https://reviews.freebsd.org/D10489 Modified: head/usr.bin/uname/uname.1 Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Wed May 31 03:11:25 2017 (r319273) +++ head/usr.bin/uname/uname.1 Wed May 31 03:44:31 2017 (r319274) @@ -28,7 +28,7 @@ .\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" $FreeBSD$ .\" -.Dd November 20, 2013 +.Dd May 31, 2017 .Dt UNAME 1 .Os .Sh NAME @@ -61,6 +61,11 @@ Write the version of the kernel. .It Fl m Write the type of the current hardware platform to standard output. +.Po Xr make 1 +uses it to set the +.Va MACHINE +variable. +.Pc .It Fl n Write the name of the system to standard output. .It Fl o @@ -69,6 +74,11 @@ This is a synonym for the option, for compatibility with other systems. .It Fl p Write the type of the machine processor architecture to standard output. +.Po Xr make 1 +uses it to set the +.Va MACHINE_ARCH +variable. +.Pc .It Fl r Write the current release level of the operating system to standard output. @@ -106,6 +116,19 @@ will allow the corresponding data to be set to the con of the environment variable. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +The hardware platform +.Pq Fl m +can be different from the machine's processor architecture +.Pq Fl p , +e.g., on 64-bit PowerPC, +.Fl m +would return +.Va powerpc +and +.Fl p +would return +.Va powerpc64 . .Sh SEE ALSO .Xr feature_present 3 , .Xr getosreldate 3 , From owner-svn-src-head@freebsd.org Wed May 31 05:24:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 917FBA92B66; Wed, 31 May 2017 05:24:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0E73FAC; Wed, 31 May 2017 05:24:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100] (may be forged)) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA20433; Wed, 31 May 2017 08:24:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dFw6x-000ODN-Vt; Wed, 31 May 2017 08:24:00 +0300 Subject: Re: svn commit: r317591 - head/sys/dev/drm2/radeon To: Takahashi Yoshihiro , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201704290947.v3T9lF0r075921@repo.freebsd.org> From: Andriy Gapon Message-ID: <03e500d5-76b1-fd38-04c6-90d85a2ddfa8@FreeBSD.org> Date: Wed, 31 May 2017 08:22:38 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <201704290947.v3T9lF0r075921@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 05:24:09 -0000 On 29/04/2017 12:47, Takahashi Yoshihiro wrote: > Author: nyan > Date: Sat Apr 29 09:47:15 2017 > New Revision: 317591 > URL: https://svnweb.freebsd.org/changeset/base/317591 > > Log: > Add TUNABLE_INT to radeonkms driver parameters. > They are required by PowerMac G5 DP. > > PR: 217852 > Submitted by: Hiroo Ono > MFC after: 1 week I think that this solution that I had in my private tree is a little bit more powerful: https://people.freebsd.org/~avg/radeon_drv-knobs.diff The advantage is that it is less intrusive and also provides read-only sysctl in addition to the tunables. Also, hw.drm.radeon seems like a better place for the knobs than just drm.radeon. Do you mind if I commit this? > Modified: > head/sys/dev/drm2/radeon/radeon_drv.c > > Modified: head/sys/dev/drm2/radeon/radeon_drv.c > ============================================================================== > --- head/sys/dev/drm2/radeon/radeon_drv.c Sat Apr 29 09:26:30 2017 (r317590) > +++ head/sys/dev/drm2/radeon/radeon_drv.c Sat Apr 29 09:47:15 2017 (r317591) > @@ -127,54 +127,71 @@ int radeon_pcie_gen2 = -1; > int radeon_msi = -1; > int radeon_lockup_timeout = 10000; > > +TUNABLE_INT("drm.radeon.no_wb", &radeon_no_wb); > MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); > module_param_named(no_wb, radeon_no_wb, int, 0444); > > +TUNABLE_INT("drm.radeon.modeset", &radeon_modeset); > MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); > module_param_named(modeset, radeon_modeset, int, 0400); > > +TUNABLE_INT("drm.radeon.dynclks", &radeon_dynclks); > MODULE_PARM_DESC(dynclks, "Disable/Enable dynamic clocks"); > module_param_named(dynclks, radeon_dynclks, int, 0444); > > +TUNABLE_INT("drm.radeon.r4xx_atom", &radeon_r4xx_atom); > MODULE_PARM_DESC(r4xx_atom, "Enable ATOMBIOS modesetting for R4xx"); > module_param_named(r4xx_atom, radeon_r4xx_atom, int, 0444); > > +TUNABLE_INT("drm.radeon.vramlimit", &radeon_vram_limit); > MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing"); > module_param_named(vramlimit, radeon_vram_limit, int, 0600); > > +TUNABLE_INT("drm.radeon.agpmode", &radeon_agpmode); > MODULE_PARM_DESC(agpmode, "AGP Mode (-1 == PCI)"); > module_param_named(agpmode, radeon_agpmode, int, 0444); > > +TUNABLE_INT("drm.radeon.gartsize", &radeon_gart_size); > MODULE_PARM_DESC(gartsize, "Size of PCIE/IGP gart to setup in megabytes (32, 64, etc)"); > module_param_named(gartsize, radeon_gart_size, int, 0600); > > +TUNABLE_INT("drm.radeon.benchmark", &radeon_benchmarking); > MODULE_PARM_DESC(benchmark, "Run benchmark"); > module_param_named(benchmark, radeon_benchmarking, int, 0444); > > +TUNABLE_INT("drm.radeon.test", &radeon_testing); > MODULE_PARM_DESC(test, "Run tests"); > module_param_named(test, radeon_testing, int, 0444); > > +TUNABLE_INT("drm.radeon.connector_table", &radeon_connector_table); > MODULE_PARM_DESC(connector_table, "Force connector table"); > module_param_named(connector_table, radeon_connector_table, int, 0444); > > +TUNABLE_INT("drm.radeon.tv", &radeon_tv); > MODULE_PARM_DESC(tv, "TV enable (0 = disable)"); > module_param_named(tv, radeon_tv, int, 0444); > > +TUNABLE_INT("drm.radeon.audio", &radeon_audio); > MODULE_PARM_DESC(audio, "Audio enable (1 = enable)"); > module_param_named(audio, radeon_audio, int, 0444); > > +TUNABLE_INT("drm.radeon.disp_priority", &radeon_disp_priority); > MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)"); > module_param_named(disp_priority, radeon_disp_priority, int, 0444); > > +TUNABLE_INT("drm.radeon.hw_i2c", &radeon_hw_i2c); > MODULE_PARM_DESC(hw_i2c, "hw i2c engine enable (0 = disable)"); > module_param_named(hw_i2c, radeon_hw_i2c, int, 0444); > > +TUNABLE_INT("drm.radeon.pcie_gen2", &radeon_pcie_gen2); > MODULE_PARM_DESC(pcie_gen2, "PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable)"); > module_param_named(pcie_gen2, radeon_pcie_gen2, int, 0444); > > +TUNABLE_INT("drm.radeon.msi", &radeon_msi); > MODULE_PARM_DESC(msi, "MSI support (1 = enable, 0 = disable, -1 = auto)"); > module_param_named(msi, radeon_msi, int, 0444); > > +TUNABLE_INT("drm.radeon.lockup_timeout", &radeon_lockup_timeout); > MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable)"); > module_param_named(lockup_timeout, radeon_lockup_timeout, int, 0444); > > -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed May 31 07:20:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25915AF8BF4; Wed, 31 May 2017 07:20:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCD0367A1D; Wed, 31 May 2017 07:20:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x241.google.com with SMTP id d68so1090439ita.1; Wed, 31 May 2017 00:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=xdJr061rrxuzE41mxNfLvNN4flkzE6R5j8NZpk2Fe38=; b=O1sK5qClmNilXtos4orgqRqEvtFjrAx3LAH8FfL78ouy+qxP7HUvOVY9IdLOswdqjH 1Y3koYGuwqPjo8incOxM9ANMyeVWCQ5jdjfdTV/93Ax8D6ZvR6MKNjrx++XvzFqPMXxY qW1CdAiLKv99nV7n7ctsMjMknKHUTtK7A1+sd7WetkLOlrOGxiEOB0ZCB/IMWBPji98x IU0AUng/TQExCTDWiM+IGdmBdHbqI2sSnPbSMXnVr7vJY60fb2BpjK+bGtVS4FVYdNVL lIhzxRZPDzcJR30Gopg6M4tr9OovRmERblNyf2eTuAPYBt/RCEjtMNwWrgNG2Yzle51Z wWuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=xdJr061rrxuzE41mxNfLvNN4flkzE6R5j8NZpk2Fe38=; b=VCI18hBIZzzGwXMo1FoFLjFpGHcE2OMpXcc7cIou3jd1XVtFYhUevzqk85pL06dtDh QmdN5ueCy2MMXDCfyizPrDxSEBHqsMXU+vmCaYEOAEmMOOQ0RiTXuCbD9fKe73Vk74vc nMApnooAxVNm4lQOh1JiTRfVbp0vg9px1sBV8mC0bc+iGxrVOSUBjdbr9mjp4K2xxN5j Ti4N1xemIQdQCNF+7vPuydsSr7yR10YsEvlfTwuDVJCLLtRJ1o5ha+oHo1PyHm3Vssl9 vZ3nZ8weXnuRE/W/RcHYEVWHkcC8+z87Fc/nbQSpvD3ZN6r4qmTW3QWg+XcTwS1xt2Kk uIKw== X-Gm-Message-State: AODbwcCCYidgigCRbAjRls2EsoChr2n6EFFz3gwGPGzguIsbdhSa4e0B lzQCkUZn+0/ActO72SE= X-Received: by 10.36.98.195 with SMTP id d186mr5369107itc.99.1496215248157; Wed, 31 May 2017 00:20:48 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y79sm6684785iod.13.2017.05.31.00.20.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 00:20:47 -0700 (PDT) Subject: Re: svn commit: r319125 - head/usr.bin/mkimg Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_3573CF6B-9741-42A4-80CA-343DE6225B68"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201705291251.v4TCp24h090283@repo.freebsd.org> Date: Wed, 31 May 2017 00:20:45 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201705291251.v4TCp24h090283@repo.freebsd.org> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 07:20:49 -0000 --Apple-Mail=_3573CF6B-9741-42A4-80CA-343DE6225B68 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 29, 2017, at 05:51, Emmanuel Vadot wrote: >=20 > Author: manu > Date: Mon May 29 12:51:02 2017 > New Revision: 319125 > URL: https://svnweb.freebsd.org/changeset/base/319125 >=20 > Log: > mkimg: Correct an off by one error in the PMBR size >=20 > The PMBR last sector should be number of sector - 1 (As stated in = UEFI Spec > 2.6 page 118 table 17). > This fixes warning printed by linux tools like parted or fdisk. This commit broke all of the mkimg gpt tests. For example: = https://ci.freebsd.org/job/FreeBSD-head-amd64-test/3280/testReport/junit/u= sr.bin.mkimg/mkimg_test/gpt_1x1_4096_qcow/ . -Ngie --Apple-Mail=_3573CF6B-9741-42A4-80CA-343DE6225B68 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZLm7NAAoJEPWDqSZpMIYV57AP/3IK/qsZN+psDg46mHCo2Jq7 C/SAt7qamAtD2xBJCMt/L48yn9/mgnKIv9nrCp77vpjtQw8qkXHwMbv6d9nzELlo OgoPxR6XObtUC8t9bY8J8aqPxfswR6nEaEE0kIwqGllb6uewF1Vy1aE/KuWZsZrs o0waHvumleJc70Xl21FkWrbE4rszjENzkfePYgwCNU3uBmODnoWeTyHot7qu/D7x KkAGDHWu5+S2h0Pgrv8ixerOQna8HdWw/7Yn73RpF+q+IEe/2L71rO0skjCAh3en r1XkdQcj8vbcTlSyigVyEj3nymFItXYX9gx1FyLLz4sUWokBt/RSYjNkXN7FOzEA Z/W3rkK3GxR7eVG1FB94rGppLkMj+8cORXMrNrziiP2wUbQnfw16G4sDwZTcpBEs l+dyRzjxwx1B48cjZhGXFad1t8AU1m1ORZbZ7dvsAoN+yHlIVH3UDQd9sF6u5nmy F9whfQvbHchmFU2uqhBrBzLPYo2IHb37vGGvMO+01idyr/gwDfyWj/7amMGwWAMR pCN3II4CwumVGWH4FLNp1N0SRkmC1A3TtN/Kz0KzjVl1wIFyWbkD+RTdDeb3eRXK OY9M8OxJBzwTmhMWpiU1vZAjkcOfiHj1eNuoKQRK/3aBAgmGi3qqlBO/6EkbmjOa Fy4Gh1ur8Th0+VQ0N++2 =nFCT -----END PGP SIGNATURE----- --Apple-Mail=_3573CF6B-9741-42A4-80CA-343DE6225B68-- From owner-svn-src-head@freebsd.org Wed May 31 07:42:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF5B2AF925F; Wed, 31 May 2017 07:42:15 +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 BAFE9687D2; Wed, 31 May 2017 07:42:15 +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 v4V7gE0e097189; Wed, 31 May 2017 07:42:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4V7gEgP097188; Wed, 31 May 2017 07:42:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705310742.v4V7gEgP097188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 31 May 2017 07:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319293 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 07:42:16 -0000 Author: ngie Date: Wed May 31 07:42:14 2017 New Revision: 319293 URL: https://svnweb.freebsd.org/changeset/base/319293 Log: Formalize the dependent/dependency relationship for .gz.uu vs This helps ensure that the output files are regenerated if the input files change, after the output files have been created. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.bin/mkimg/tests/Makefile Modified: head/usr.bin/mkimg/tests/Makefile ============================================================================== --- head/usr.bin/mkimg/tests/Makefile Wed May 31 06:47:56 2017 (r319292) +++ head/usr.bin/mkimg/tests/Makefile Wed May 31 07:42:14 2017 (r319293) @@ -1,5 +1,7 @@ # $FreeBSD$ +.PATH: ${.CURDIR} + PACKAGE= tests ATF_TESTS_SH= mkimg_test @@ -7,8 +9,10 @@ ATF_TESTS_SH= mkimg_test SOURCES!= cd ${.CURDIR}; echo *.uu ${PACKAGE}FILES+= ${SOURCES:S,.gz.uu,,g} -${${PACKAGE}FILES}: - uudecode -p ${.CURDIR}/${.TARGET}.gz.uu | gunzip -c > ${.TARGET} +.for f in ${${PACKAGE}FILES} +$f: $f.gz.uu + uudecode -p ${.ALLSRC} | gunzip -c > ${.TARGET} +.endfor CLEANFILES+= ${${PACKAGE}FILES}} From owner-svn-src-head@freebsd.org Wed May 31 07:49:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCC3AF939D; Wed, 31 May 2017 07:49:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5785E68B00; Wed, 31 May 2017 07:49:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4V7nnol097624; Wed, 31 May 2017 07:49:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4V7nnbM097623; Wed, 31 May 2017 07:49:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705310749.v4V7nnbM097623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 31 May 2017 07:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319294 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 07:49:50 -0000 Author: ngie Date: Wed May 31 07:49:49 2017 New Revision: 319294 URL: https://svnweb.freebsd.org/changeset/base/319294 Log: Fix "make rebase" after ^/head@r315776 "make rebase" can be used for rebasing the output files from mkimg after making a change to mkimg. This will come in handy soon, per bug 219673. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.bin/mkimg/tests/Makefile Modified: head/usr.bin/mkimg/tests/Makefile ============================================================================== --- head/usr.bin/mkimg/tests/Makefile Wed May 31 07:42:14 2017 (r319293) +++ head/usr.bin/mkimg/tests/Makefile Wed May 31 07:49:49 2017 (r319294) @@ -4,7 +4,8 @@ PACKAGE= tests -ATF_TESTS_SH= mkimg_test +_REBASE_SCRIPT= mkimg_test +ATF_TESTS_SH= ${_REBASE_SCRIPT} SOURCES!= cd ${.CURDIR}; echo *.uu ${PACKAGE}FILES+= ${SOURCES:S,.gz.uu,,g} @@ -16,7 +17,7 @@ $f: $f.gz.uu CLEANFILES+= ${${PACKAGE}FILES}} -rebase: - (cd ${.CURDIR}; atf-sh mkimg.sh rebase) +rebase: .PHONY + (cd ${.CURDIR}; atf-sh ${_REBASE_SCRIPT}.sh rebase) .include From owner-svn-src-head@freebsd.org Wed May 31 08:01:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26E66AF995D; Wed, 31 May 2017 08:01:17 +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 A25376A095; Wed, 31 May 2017 08:01:14 +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 v4V81D0j004046; Wed, 31 May 2017 08:01:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4V81CjO004032; Wed, 31 May 2017 08:01:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705310801.v4V81CjO004032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 31 May 2017 08:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319295 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 08:01:17 -0000 Author: ngie Date: Wed May 31 08:01:12 2017 New Revision: 319295 URL: https://svnweb.freebsd.org/changeset/base/319295 Log: Update the usr.bin/mkimg golden test output files after ^/head@r319125 ^/head@r319125 changed the location of the backup pmbr, requiring the output files to be regenerated, since they're binary disk dumps. The output files were regenerated with "make rebase"--fixed in ^/head@r319294. MFC with: r319125, r319294 PR: 219673 Sponsored by: Dell EMC Isilon Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,132 +1,132 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.qcow.gz -M'XL("*XS(E0``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=RYO=70`K9W;;AS7M47? -M_16ENT1)5*^UJJJK=$^`!,B;$YSS=@Z0NCX&G7=]?-CDOI"KY]2*(=J$(4.H -MB>ZMP4'9'MX\'.[^:)I.FK9OVK'9Y^;F[].'-/?^YN%'\^/O?_W;]?T_?OQV -M-R:'GSSE_K[51M/<@ZT_-V5.ST\MS6'\+^9N/@3-W7MU]@=>W;TW>SEW]=O= -MF\7/*1NT!X--FCNDUR?D]-K_[O5]=V]7[D[O\=ZNDK?;L<'^P>#O:>Z?Z?4I -M>;M'-C<\F#NYMZOD[8YL;OHI+$I@F=G<$LRU\*F5S6W!7`>?VO&<_.37]FZN -MAT\)FX.?M]=-F3O"IXS-M0_F#M<9Z#PWP*<(=Q)R-\*G"'<2,.PNY0[XSQIV%W"'?&>/.0NZ0[XQQ9R%WR'?&N+.0.^0[8]RU -M(7?(=RWCK@VY0[YK&7=MQ)WBIPAW;<2=(M^UC+LVXDZ1[UK&71MQI\AW+>.N -MC;A3Y+N6<==&W"GR7*?-XZT/ND.]ZQET?.NC[@SY+N> -M<7>,N#/DNR/C[AAQ9\AW1\;=,>0.^>[(N#N&W"'?'1EWQY`[Y+LCX^X8ZFB+L.^6YB -MW$T1=QWRW<2XFR+N.N2[B7$W1=QUR'<3XR[_9T@^AWPW,^[FB+L.^6YFW,TA -M=\AW,^-N#KE#OIL9=W/('?+=S+B;0^Z0[V;&W1QRAWPW,^[FD#ODNYEQMX3< -M(=\MC+LEY`[Y;F'<+1%W/7Z*<+=$W/7(=POC;HFXZY'O%L;=$G'7(]\MC+LE -MXJY'OEL8=TO$78]\MS#NUHB['OEN9=RM$7<]\MW*N%M#[I#O5L;=&G*'?+\VQMT6<7=$ -MOML8=WO$W1'Y;F?<[1%W1^2[G7&WA]PAW^V,NSWD#OEN9]SM(7?(=SOC;@^Y -M0[[;&7=[R!WRWLOY.POQN`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#OO).SO1N0[UM])V-^-R'>LOY.POQN1[UA_)V%_-R+?L?Y.POYN -M1+YC_9V$_=V(?,?Z.PG[NQ'YCO5W$O9W(_(=Z^\D[.]&Y#O6WTG8WXW(=ZR_ -MD["_&Y'O6'\G87\W(M^Q_D["_FY$OF/]G83]W8A\Q_H["?N["3]%N`O[NPGY -MCO5W$O9W$_(=Z^\D[.\FY#O6WTG8WTW(=ZR_D["_FY#O6'\G87\W(=^Q_D[" -M_FY"OF/]G83]W81\Q_H["?N["?F.]7<2]G<3\AWK[R3L[R;D.];?2=C?3]8?R=A?SOO).SO9N0[UM])V-_- -MR'>LOY.POYN1[UA_)V%_-R/?L?Y.POYNP4\1[L+^;D&^8_V=A/W=@GS'^CL) -M^[L%^8[U=Q+V=POR'>OO).SO%N0[UM])V-\MR'>LOY.POUN0[UA_)V%_MR#? -ML?Y.POYN0;YC_9V$_=V"?,?Z.PG[NP7YCO5W$O9W"_(=Z^\D[.\6Y#O6WTG8 -MWRW(=ZR_D["_6Y#O6'\G87^WXJ<(=V%_MR+?L?Y.POYN1;YC_9V$_=V*?,?Z -M.PG[NQ7YCO5W$O9W*_(=Z^\D[.]6Y#O6WTG8WZW(=ZR_D["_6Y'O6'\G87^W -M(M^Q_D["_FY%OF/]G83]W8I\Q_H["?N[%?F.]7<2]GOO).SO-N0[ -MUM])V-_M^"G"7=C?[]8?R=A?[^8_V=A/W= -MCGS'^CL)^[L=^8[U=Q+V=SOR'>OO).SO=N0[UM])V-_MR'>LOY.PO]N1[UA_ -M)V%_MR/?L?Y.POYN1[YC_9V$_=V.?,?Z.\T_<'--G0.^NWD*NO\OWZ365 -M.^`[9?V=NOZN2=PUF3L[X*OOU/5WSLOU/7 -MWSW)).Z>5.Z`[Y3U=^KZNR>)NR>5.^`[9?V=NO[NR>GB -M[(#OE/5WZOJ[OO\MS3.H=\ -MQ_H[=?W=TSQ7N4.^8_V=NO[N:>+N:>$.W7^GK+]3U]\]3=P]+=RA^^^4]7?J -M^KNG)W]VZ/X[9?V=NOZNG%V=0[YC_9VZ_@[,(=^Q_DY=?P?FD.]8?Z>NO\MS -MS^H<\AWK[]3U=\_R7.$.W7^GK+]3U]\]2]P]J]PAW['^3EU_]RQQ]ZQRAWS' -M^CMU_=VST\79(=^Q_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_`W/(=ZR_4]?? -MY;GG=0[YCO5WZOJ[YWFNOOU/5W+_-GOS9H?OOE/5WZOJ[LOU/7W[W*O3A=GAWS'^CMU_5TYNSJ'?,?Z.W7]'9A#OF/] -MG;K^#LPAW['^3EU_E^=>USGD.];?J>OO7N>YRAWR'>OOU/5WKQ-WKPMWZ/X[ -M9?V=NO[N=>+N=>$.W7^GK+]3U]^]/OFS0_??*>OOU/5WY>SJ'/(=Z^_4]7=@ -M#OF.]7?J^CLPAWS'^CMU_5V>>U/GD.]8?Z>NOWN3YPIWZ/X[9?V=NO[N3>+N -M3>4.^8[U=^KZNS>)NS>5.^0[UM^IZ^_>G"[.#OF.]7?J^KMR=G4.^8[U=^KZ -M.S"'?,?Z.W7]'9A#OF/]G;K^+L]=U3GD.];?J>OOKO)$.W7^GK+]3U]]=)>ZN"G?H_CME_9VZ_N[JY,\.W7^GK+]3U]^5LZMSR'>L -MOU/7WX$YY#O6WZGK[\`<\AWK[]3U=WGN;9U#OF/]G;K^[FV>*]RA^^^4]7?J -M^KNWB;NWE3OD.];?J>OOWB;NWE;ND.]8?Z>NOWM[NC@[Y#O6WZGK[\K9U3GD -M.];?J>OOP!SR'>OOU/5W8`[YCO5WZOJ[//>NSB'?L?Y.77_W+L]5[I#O6'^G -MKK][E[A[5[A#]]\IZ^_4]7?O$G?O"G?H_CME_9VZ_N[=R9\=NO].67^GKK\K -M9U?GD.]8?Z>NOP-SR'>LOU/7WX$YY#O6WZGK[_+<^SJ'?,?Z.W7]W?L\5[A# -M]]\IZ^_4]7?O$W?O*W?(=ZR_4]??O4_LOU/7 -MWY6SJW/(=ZR_4]??@3GD.];?J>OOP!SR'>OOU/5W>>ZZSB'?L?Y.H_[.T/UW -MROH[C?H[0_??*>OO-.KO#-U_IZR_TZB_,W3_G;+^3J/^SM#]=\KZ.XWZ.T/W -MWRGK[S3J[PS=?Z>LOU/2WWVH<\AWK+]3U]]]R'.%.W3_G;+^3EU_]R%Q]Z%R -MAWS'^CMU_=V'Q-V'RAWR'>OOU/5W'TX79X=\Q_H[=?U=.;LZAWS'^CMU_1V8 -M0[YC_9VZ_@[,(=^Q_L[R#]S).*G?`=\;Z.W/]G9PNS@[XSEA_9ZZ_*V=7YX#O -MC/5WYOH[,`=\9ZR_,]??@3G@.V/]G;G^+L]IG4.^8_V=N?Y.\USE#OF.]7?F -M^CM-W&GA#MU_9ZR_,]??:>)."W?H_CMC_9VY_DY/_NS0_7?&^CMS_5TYNSJ' -M?,?Z.W/]'9A#OF/]G;G^#LPAW['^SEQ_E^>LSB'?L?[.7']G>:YPA^Z_,];? -MF>OO+'%GE3OD.];?F>OO+'%GE3OD.];?F>OO['1Q=LAWK+\SU]^5LZMSR'>L -MOS/7WX$YY#O6WYGK[\`<\AWK[\SU=WFNK7/(=ZR_,]??M7FNZ.#OD.];?F>OORMG5.>0[ -MUM^9Z^_`'/(=Z^_,]7=@#OF.]7?F^KL\U]NO^M/_NS0_7?&^CMS_5TYNSJ' -M?,?Z.W/]'9A#OF/]G;G^#LPAW['^SEQ_E^>.=0[YCO5WYOJ[8YXKW*'[[XSU -M=^;ZNV/B[EBY0[YC_9VY_NZ8N#M6[I#O6']GKK\[GB[.#OF.]7?F^KMR=G4. -M^8[U=^;Z.S"'?,?Z.W/]'9A#OF/]G;G^+L\-=0[YCO5WYOJ[(<]5[I#O6']G -MKK\;$G=#X0[=?V>LOS/7WPV)NZ%PA^Z_,];?F>OOAI,_.W3_G;'^SEQ_5\ZN -MSB'?L?[.7'\'YI#O6']GKK\#<\AWK+\SU]_EN;'.(=^Q_LYOOS/5W8`[YCO5WYOH[,(=\Q_H[<_U=GOM4YY#O6']GKK_[E.<* -M=^C^.V/]G;G^[E/B[E/E#OF.]7?F^KM/B;M/E3OD.];?F>OO/ITNS@[YCO5W -MYOJ[LOS/7WWW. -M?$W>?"';K_SEA_9ZZ_^WSR9X?N -MOS/6WYGK[\K9U3GD.];?F>OOP!SR'>OOS/5W8`[YCO5WYOJ[//>ESB'?L?[. -M7'_W)<\5[M#]=\;Z.W/]W9?$W9?*'?(=Z^_,]7=?$G=?*G?(=ZR_,]???3E= -MG!WR'>OOS/5WY>SJ'/(=Z^_,]7=@#OF.]7?F^CLPAWS'^CMS_5V>^UKGD.]8 -M?V>NO_N:YRIWR'>LOS/7WWU-W'TMW*'[[XSU=^;ZNZ^)NZ^%.W3_G;'^SEQ_ -M]_7DSP[=?V>LOS/7WY6SJW/(=ZR_,]??@3GD.];?F>OOP!SR'>OOS/5W>>Y; -MG4.^8_V=N?[N6YXKW*'[[XSU=^;ZNV^)NV^5.^0[UM^9Z^^^)>Z^5>Z0[UA_ -M9ZZ_^W:Z.#OD.];?F>OORMG5.>0[UM^9Z^_`'/(=Z^_,]7=@#OF.]7=M_H&; -M^U[G@.]:UM^UKK_[GNWYM=H<)O!7 -M_A,__GS]\,\R>'MWT!\8S*_PX5S^!>GN[@ZZC::V&W?NZ>,@]][P^9L>"W_# -M3Z[OS:'OS?PKYX>N^_G98-]]-V3=LW[9@N^>?[FMW#6;.Z0#D+?[O_[MWLW -M=_OE>_>GG>>,SCW!<[=?OM>?S*$//M?^[*F#TE=W\6M[-]<='CXUW'_J_-L, -M:_:IF58R]]7-H6\?_RODW=X<,/?-\>8?6F]^@R?-LI]_L/;G;[[;##>?)G?_ -M:49O_U^FL3G*^?^RNQG\\:^_7__K;NS]];_?IM=W=W.`X`_^$^ST[FX.&-C; -MS?]YD;_=YN$<^)W>KYW>^?M/=Z>%#.I\>_)3YU7C?/7V`G\E?_$C]^O'_YY-]BFP4=[A3>#RR-^=ISG'O&S -MXSSWB)\=Y[E'_>PX#S[B9\=Y[A$_.\YSC_C9<9Y[U,^.F\';?^?X2%_$SW-R -M]V5R7YM!F\W_AV[_Z=(_O2_Y,OXO@78WO$+^+GN9]_$=_^Z)M] -8Q"_BY[E'_2+>'HXWWOOM/_VP*B?UK``` +M'XL(",]Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=RYO=70`K9W+CAS7L47G +M^HKDFVR2S8J(S*Q,OFW`!CR3C7MG]P+.Y]`HS_GQ[NH^C^ZHO1D6V!(A4"!R +MH^IP]2I*6CH\'.[^:)I.FK9OVK'9Y^;F[],W:>[]S<-OS8^___5OU_?_^/'; +MW9@Y`3Y%N).0NQ$^1;B3D+L)/D6XDY"[ +M&3Y%N).0NP4^1;B3D+L5/D6XTY"[#3Y%N".?%_>XV^%3A#N-N!/\%.%.(^X$ +M^4X9=QIQ)\AWRKC3B#M!OE/&G4;<"?*=,NXTXDZ0[Y1Q9Q%W@GQGC#N+N!/D +M.V/<6<@=\ITQ[BSD#OG.&'<6*GR+]:QET;<:?(=RWCKHNX4^2[CG'71=PI\EW'N.M"[I#O.L9=%W*'?-' +MW"'?S8R[.>0.^6YFW,TA=\AW,^-N#KE#OIL9=W/('?+=S+B;0^Z0[V;&W1)R +MAWRW,.Z6D#ODNX5QMT3<]?@IPMT2<=^6QAW2\1=CWRW,.Z6 +MB+L>^6YAW"T1=SWRW<*X6R/N>N2[E7&W1MSUR'2O\/G@._D0+B30\@=\)T<"'=RB+@;\%.8 +M.PG[NP'X3EA_)V%_-P#?">OO).SO!N`[8?V=A/W=`'PGK+^3L+\;@.^$]7<2 +M]G<#\)VP_D["_FX`OA/6WTG8WPW`=\+Z.PG[NP'X3EA_)V%_-P#?">OO).SO +M!N`[8?V=A/W=`'PGK+^3L+\;@.^$]7<2]G<#\AWK[R3L[P;D.];?2=C?C?@I +MPEW8WXW(=ZR_D["_&Y'O6'\G87\W(M^Q_D["_FY$OF/]G83]W8A\Q_H["?N[ +M$?F.]7<2]G]8?R=A?SOO).SO)OP4X2[L[R;D +M.];?2=C?3OO).SO)N0[UM])V-]-R'>LOY.POYN0[UA_)V%_-R'? +ML?Y.POYN0KYC_9V$_=V$?,?Z.PG[NPGYCO5W$O9W,WZ*OO).SO +M9N0[UM])V-_-R'>LOY.POYN1[UA_)V%_-R/?L?Y.POYN1KYC_9V$_=V,?,?Z +M.PG[NQGYCO5W$O9W,_(=Z^\D[.]FY#O6WTG8W\W(=ZR_D["_FY'O6'\G87\W +M(]^Q_D["_FY&OF/]G83]W8Q\Q_H["?N[!3]%N`O[NP7YCO5W$O9W"_(=Z^\D +M[.\6Y#O6WTG8WRW(=ZR_D["_6Y#O6'\G87^W(-^Q_D["_FY!OF/]G83]W8)\ +MQ_H["?N[!?F.]7<2]G<+\AWK[R3L[Q;D.];?2=C?+]8?R=A?[OO).SO5N0[UM])V-^MR'>LOY.POUN1[UA_ +M)V%_MR+?L?Y.POYNPT\1[L+^;D.^8_V=A/W=AGS'^CL)^[L-^8[U=Q+V=QOR +M'>OO).SO-N0[UM])V-]MR'>LOY.PO]N0[UA_)V%_MR'?L?Y.POYN0[YC_9V$ +M_=V&?,?Z.PG[NPWYCO5W$O9W&_(=Z^\D[.\VY#O6WTG8WVW(=ZR_D["_VY#O +M6'\G87^WXZ<(=V%_MR/?L?Y.POYN1[YC_9V$_=V.?,?Z.PG[NQWYCO5W$O9W +M._(=Z^\D[.]VY#O6WTG8W^W(=ZR_D["_VY'O6'\G87^W(]^Q_D["_FY'OF/] +MG83]W8Y\Q_H["?N['?F.]7<2]G<[\AWK[S1_Q\TU=0[X[N8IS)VZ_B[?I]=4 +M[H#OE/5WZOJ[)G'79.[L@)_"W*GK[YK$7?//,@=\IZR_4]??-2=W=H;NOU/6 +MWZGK[\K9U3G@.V7]G;K^#LP!WRGK[]3U=V`.^$Y9?Z>NO\MS3^H<\)VR_DY= +M?_+ +MLP.^4];?J>OORMG5.>`[9?V=NOX.S`'?*>OOU/5W8`[X3EE_IZZ_RW-/ZQSR +M'>OOU/5W3_-GOS9H?OOE/5WZOJ[LOU/7WSW+>USGD.];?J>OOGN>YRAWR'>OOU/5WSQ-WSPMWZ/X[9?V=NO[N>>+N>>$. +MW7^GK+]3U]\]/_FS0_??*>OOU/5WY>SJ'/(=Z^_4]7=@#OF.]7?J^CLPAWS' +M^CMU_5V>>U'GD.]8?Z>NOWN1YPIWZ/X[9?V=NO[N1>+N1>4.^8[U=^KZNQ>) +MNQ>5.^0[UM^IZ^]>G"[.#OF.]7?J^KMR=G4.^8[U=^KZ.S"'?,?Z.W7]'9A# +MOF/]G;K^+L^]K'/(=ZR_4]??OOO7B;N7A;NT/UWROH[=?W= +MR\3=R\(=NO].67^GKK][>?)GA^Z_4];?J>OORMG5.>0[UM^IZ^_`'/(=Z^_4 +M]7=@#OF.]7?J^KL\]ZK.(=^Q_DY=?_>0[UA_IZZ_>YWG*G?(=ZR_4]??O4[0[UM^IZ^_`'/(=Z^_4]7=Y[DV=0[YC_9VZ_NY-GBO>0[UA_IZZ_N\ISE3OD.];?J>OOKA)W +M5X4[=/^=LOY.77]WE;B[*MRA^^^4]7?J^KNKDS\[=/^=LOY.77]7SJ[.(=^Q +M_DY=?P?FD.]8?Z>NOP-SR'>LOU/7W^6YMW4.^8[U=^KZN[=YKG"'[K]3UM^I +MZ^_>)N[>5NZ0[UA_IZZ_>YNX>UNY0[YC_9VZ_N[MZ>+LD.]8?Z>NORMG5^>0 +M[UA_IZZ_`W/(=ZR_4]??@3GD.];?J>OO\MR[.H=\Q_H[=?W=NSQ7N4.^8_V= +MNO[N7>+N7>$.W7^GK+]3U]^]2]R]*]RA^^^4]7?J^KMW)W]VZ/X[9?V=NOZN +MG%V=0[YC_9VZ_@[,(=^Q_DY=?P?FD.]8?Z>NO\MS[^L<\AWK[]3U=^_S7.$. +MW7^GK+]3U]^]3]R]K]PAW['^3EU_]SYQ][YRAWS'^CMU_=W[T\79(=^Q_DY= +M?U?.KLXAW['^3EU_!^:0[UA_IZZ_`W/(=ZR_4]??Y;GK.H=\Q_H[C?H[0_?? +M*>OO-.KO#-U_IZR_TZB_,W3_G;+^3J/^SM#]=\KZ.XWZ.T/WWRGK[S3J[PS= +M?Z>LO].HOS-T_YVR_DY)?_>ASB'?L?Y.77_W(<\5[M#]=\KZ.W7]W8?$W8?* +M'?(=Z^_4]7OOU/5WY>SJ'/(=Z^_4]7=@ +M#OF.]7?J^CLPAWS'^CO+WW%SASH'?&>LO[OY@0?<93\=*G?`=\;Z.W/]W2'M +M'0IWZ/X[8_V=N?[ND+@[%.[0_7?&^CMS_=WAY,\.W7]GK+\SU]^5LZMSP'?& +M^CMS_1V8`[XSUM^9Z^_`'/"=L?[.7'^7YZ3.`=\9Z^_,]7>2YPIWZ/X[8_V= +MN?Y.TLN3RAWPG;'^SEQ_)XD[J=P!WQGK[\SU=W*Z.#O@.V/]G;G^KIQ=G0.^ +M,];?F>OOP!SPG;'^SEQ_!^:`[XSU=^;ZNSRG=0[YCO5WYOH[S7.5.^0[UM^9 +MZ^\T<:>%.W3_G;'^SEQ_IXD[+=RA^^^,]7?F^CL]^;-#]]\9Z^_,]7?E[.H< +M\AWK[\SU=V`.^8[U=^;Z.S"'?,?Z.W/]79ZS.H=\Q_H[<_V=Y;G"';K_SEA_ +M9ZZ_L\2=5>Z0[UA_9ZZ_L\2=5>Z0[UA_9ZZ_L]/%V2'?L?[.7']7SJ[.(=^Q +M_LYNOP-SR'>LOS/7W^6YMLXAW['^SEQ_U^:YRAWR'>OOS/5W +M;>*N+=RA^^^,]7?F^KLV<=<6[M#]=\;Z.W/]77OR9X?NOS/6WYGK[\K9U3GD +M.];?F>OOP!SR'>OOS/5W8`[YCO5WYOJ[/-?5.>0[UM^9Z^^Z/%>X0_??&>OO +MS/5W7>*NJ]PAW['^SEQ_UR7NNLH=\AWK[\SU=]WIXNR0[UA_9ZZ_*V=7YY#O +M6']GKK\#<\AWK+\SU]^!.>0[UM^9Z^_R7%_GD.]8?V>NO^OS7.4.^8[U=^;Z +MNSYQUQ?NT/UWQOH[<_U=G[CK"W?H_CMC_9VY_JX_^;-#]]\9Z^_,]7?E[.H< +M\AWK[\SU=V`.^8[U=^;Z.S"'?,?Z.W/]79X[UCGD.];?F>OOCGFN<(?NOS/6 +MWYGK[XZ)NV/E#OF.]7?F^KMCXNY8N4.^8_V=N?[N>+HX.^0[UM^9Z^_*V=4Y +MY#O6WYGK[\`<\AWK[\SU=V`.^8[U=^;ZNSPWU#GD.];?F>OOACQ7N4.^8_V= +MN?YN2-P-A3MT_YVQ_LYOOQL3=6+E#OF/]G;G^;CQ=G!WR'>OOS/5WY>SJ +M'/(=Z^_,]7=@#OF.]7?F^CLPAWS'^CMS_5V>^UCGD.]8?V>NO_N8YRIWR'>L +MOS/7WWU,W'TLW*'[[XSU=^;ZNX^)NX^%.W3_G;'^SEQ_]_'DSP[=?V>LOS/7 +MWY6SJW/(=ZR_,]??@3GD.];?F>OOP!SR'>OOS/5W>>Y3G4.^8_V=N?[N4YXK +MW*'[[XSU=^;ZNT^)NT^5.^0[UM^9Z^\^)>X^5>Z0[UA_9ZZ_^W2Z.#OD.];? +MF>OORMG5.>0[UM^9Z^_`'/(=Z^_,]7=@#OF.]7?F^KL\][G.(=^Q_LYNO_NNORMG5^>0[UA_9ZZ_`W/(=ZR_,]??@3GD.];?F>OO\MR7.H=\Q_H[ +M<_W=ESQ7N$/WWQGK[\SU=U\2=U\J=\AWK+\SU]]]2=Q]J=PAW['^SEQ_]^5T +M<7;(=ZR_,]??E;.K<\AWK+\SU]^!.>0[UM^9Z^_`'/(=Z^_,]7=Y[FN=0[YC +M_9VY_NYKGJO<(=^Q_LYU<(?NOS/6WYGK[[XF[KX6[M#]=\;Z.W/] +MW=>3/SMT_YVQ_LY0[UM^U^3MN +M[GN=`[YK67_7NO[N>YZKW`'?W3R%N6M=?_<]\%/D]SUV;_9[[HVO +MRQSZ_;;+4\'8.Z2#T[?Z_?[MW +M<[GG>>,SCW!<[ +M;O[/B_SM-@_GP*_T?NWTSK]>F;M'.[TQP8*^\1^@IS?=G1X^I//IP2^9'_>O +M$;T_!WZ]\BNGU]]^:IP_8R?P5_X#/WZ_?OCGW6";!A_M%=X,+H_XU7&>>\2O +MCO/<(WYUG.<>]:OC//B(7QWGN4?\ZCC//>)7QWGN4;\Z;@9O_YWC(WV(G^?D +M[F-R7YM!F\W^_F'^/9'W^PC +8?HB?YQ[U0[P]'&^\]]M_`$CJT>#UK``` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,26 +1,26 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.qcow2.gz -M'XL("*([(U0``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=S(N;W5T`*V92V_4,!"` -M[_T5+F]:6.)7DN51:$LK]=8BN'')\UB)*PK\=N+8B9/)3-PNWK6BKJSY9#O? -MC)TT2>R',$)$(1U*3K@%Z]+C -M!(5+^+J#X[C9Z"2"$V/4&A3"*7)T6QT([N1H6+KA9N0@0AX"M#CR9APT/F'' -M!R/4@>,3L<PI7!'$2B2HI7!7$*22J -MIG!-$*>1J);`\8`J/2Y%HCB%$T%"N!R)HKSC8>_V2!3E'0][5R!1 -ME'<\[%V)1%'>\;!W%1)%>B -MA]0[07DG@'>G#O?&XY!Z)RCO!/#N[2X=Y['%+O).6=!-Y]<+B/'H?4.TEY)X%WGQSNS..0>B4^)-6-L)&ZL*Y$IW=!>[Y7<"#KG[ -M".`XPB7.35C;W+4/C$W#VM8UNU(N.)\=$)`)'^]FN#KR^@WI]@B@UJPH5L`? -MX_B&=.OSR[X;Z.W60S'0@FDUX8:YZFH^OJOK&W9[_NV[@?WTTQW2+2M8Q5F1 -MLP*.CE/3_8W9IVVZ92U<[1$G*=QT+`,X<[S(Z@TRV -M+88SUIYEW)S=>F!W?[>[M["WNU^G;GR*.R.P1G=0JZ>&RIQ3T\W\@P`Q7;;$ -M8:^1_FOU3%TN=;35VSM9L$9WD*M7V-7#%\FL'IHRW;AJ8\*-N#+NZG'["C,Q -M]7M]I3NZV]WR:X'*`:.-4*5M%3$[#"YB=AA(&9]PK,E8+\YRX^'_!UG;<#8^/Z^DV8FOKW]C$\9O11-S$ -B#6YS$\\:>K+V\Q=,-N(F;G!1-W&5F>/WT3\!FKQU%1H````` +M'XL(",]Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=S(N;W5T`*V92V_<(!"` +M[_D5I.\FS=8,8'O[2)JD62FWI&IOO?AYC-1KY?:WUQALUGC&)%MVD945FD^` +MOQFPDR3FPYCB3*9,;EE;LOZW;<#V?LP;Z^YWMYO]3W=D8#PAHI`.*2;3,.&A^8 +M\?D1\L#Q0>SQ"7S]U!CG=Z3KXQ-F?'Y41N'R(`Z0J"V%*X(X@425%*X*XB02 +M55.X)HA32%1+X'A`E1Z7(E&-B[+1)%>/;>X%Q..8U&4=^!Y]]+B7CD<4N^`\@X\[UY;W!N'0^H=4-Z!Y]U;BSMQ +M.*3>`>4=>-Z=6MP[AT/J'5#>@>?=V<([CM0[H+P3GG?O+2MQ.*3>"-X)BY,.A]0[07DG/.^4Q:4.A]0[07DG/.\RB\L=#JEW@O). +M>-YM+>Z#PR'U3E#>"<^[CQ;WR>&0>B+.W7=A<5\< +M#JEWDO).>MY=6MR5PR'U3E+>2<^[:XO[.N$`BYJ\2Q*\6=S-(FE.VYSY$IWK`#SIP/)O5::M.R`@$S[>[.'JR.LWI-L3@$JQHE@` +M?XSC&]*MSR_S;J"W6PW%0`%3%/SI.3?JG-);W:6*V +M;1C.6%N6<7UVZX'=P_WFP<#.-K].[?@DMT9@C>Z@5D\.E3FGIINY!P%BNFR. +MPUXC_=?JZ;IO,*N'+Y)>/31ENG'5QH0;<67/F%6:B +MZ_?R2G=T=YOYUP"E!48;H4S;*F)V:%S$[-"XB-FA<5&S0P,C9H?&1ZB6<-/5GS^>M--N(FKG%1-W&9Z>/WT3]QQ=U%%1H````` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,15 +1,15 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.raw.gz -M'XL("/#%'50``VEM9RTQ>#$M-#`Y-BUG<'0NU52W;V`262JW42MW2JMW:@3]FC-2=#U\?A@2(C1KIP$)(Q_UR]_#C(F4X -M`*,AJ\@U'>B?Q?+L=W>[@:;JVX#^]ZF$%5!X8,`U/B@U/>,3SAQ.?9BAFO/6=K7-O+Z7US<VLL(>^M^[#3@KEUG%/"MSJ#-T%:HV@7MG&12+VH -M9?I)M7^I;M.KTU -F^C>&>/QE.,8A3KCM(>YN;99QB!..=8@;_W]*RMT?5F[7A(@+```` +M'XL("-!Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N^"C'3;SSX^U0D*^6N,E`0TB&>7;FI2^S4H8# +M,!JRC%S3@>Y)+,_N<'OH::JZ#NA_GTI8`84'!ESM@U+3,\ZA;8FXT;,<,V4M5GIP!PG`FYLM[T.:"W*<@/\'.O3_>NP,#G,"=H_+V$4 +MK(8U?[B^5UO/ZWM^><7Y\?V#8%]3NUKY8.7S&Y09W$HDJ9+M?J_;#3A-61NU +M1UR6Q-W$<1EE-3NXV$KCS%Y6V$/_>[)D4/T="^Q!.."KHB8'=Y$Y<`NQ<_=T-]1@T[ +M(K;2@91ZIM\J1:K=(^WMW7:QQ&7/_3TEY^`7C-"Q#B`L````` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,22 +1,22 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.vhd.gz -M'XL("`XUQ%4``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD+F]U=`"MF$MOVS`,@._Y -M%0QVZS!#;R>7`2O0`KMUPX9==K$=IRN&=8_VT(/WWT?*4FS9EK&T=%0CB<+/ -M)$61K(3H+P"GP1W!M>`LO2\-N#V4.P"<#$/YNPP?H6M^WK?-X]U3$:YNT\.D -M&$NEXB2O-!A\2`FJHH>X`[V'+F**5U>W%W<_;B-.!9P*(%N2E%;@ZMES#'Z[ -MZ[4CTI<[]=TC+[^=M--S[08I_"L/(`Q(.?J%CMHAIOB;&FM0ZGCTP\&A)=G3 -M2#XD$X.Q$]]9,9$:J;GD5#$8NX1S:U+GX"XV82WZ4,'`*/$NP$DH%;W'L(E^ -MF`T,E:>'7]6?AW:BG\J$BCOI)V=S.F^N"J&BXH^#!H;">@(*Q?DZ*%9_G%R.K7T7ZX680U<(]/]%=%NGK!*SK -M\X#1@RGN9'#=D/]\'FC;P:(^2(*P-J!D=D',=N2_^L"\OO7Q/*"U4%4SX.>H -M7^.7PX)Q8/84&)@"?1W,;2A<&@5-"7L% -MJWGO+3B+O+6Z96-6*8IOB:E[O25\U<']@_I[?\Q/=39&^ -M>J`*98BMKJF02-DT-`'(IJ$)^Y=10]FN+N:YJVQ4J1@S#.$8,PSA&#,,X5@S -M#`$9,PSA&#,,X1@S#.%8,PP"C>!KA`CG&R&LX>A]3=!$C6Q+0_I=$TJGYAJU -MUC[E&Z',8AC&1HAPJXT0_A>=-]9?:F(L8R-$.-9&R(5$RG26X6(C--?A.6<9 -J+C9"8G#@"\XRW'(C]-RS#,(QGF40CO$L@W#,H2*Q=]G\`YT_-4@`$P`` +M'XL("-!Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD+F]U=`"MF$MOVS`,@._] +M%2QVZS!#;R>7`2O0`KMUPX9==K$=IPN&98_VT(/WWT?*4FS9EK&T=%0CB<+/ +M)$61K(3H+P"GP>W!M>`LO2\-N"V4&P"<#$/YNPP?H6M^'MOF\?!4A*N[Z&%2 +MC*52<9)7&@P^I`15T4/O8<@]]N +M>NV(].6@OGOD];>3=GJNW2"%?^4.A`$I1[_043O$%']38PU*[?=^.-BU)'L: +MR8=D8C!VXCLK)E(C-9><*@9CEW!N3>H\Q;*(? +M9@-#Y>GA5_7GH9WHIS*AXD[ZR=F7-3[TWH&"LGY-BQ>?YQOZ +M/&#T8(H[&5PWY#^?!]IVL*@/DB"L-2B971!].?)?O6->WWI_'M!:J*H9\'/4 +MK_'+8<$X,%L*#$P.1H)58(=P]K;:9JS?S>U[N'OW\1/!O@[F-A0NC8*FA*T" +MN9UH-]]IZ[FEH]UN?E3<[<>\M.(N\M;IE8U8KB,L75O-Z3OFK@_L#\/;_G)[J[(GWU +M0!7*$%M=4R&1LFEH`I!-0Q/V+Z.&LEU=S'-7V:A2,688PC%F&,(Q9AC"L688 +M`C)F&,(Q9AC",688PK%F&`0:P=<($#$M-#`Y-BUG<'0N=FAD9BYO=70`K9??B]0P$,?? -M]Z\8\>'DQ)#?[;X("J?XMAX>OOC2'\FQB"N"B`_]X\TD[37I)H63=$/I,IW/ -MSGKM<>1];C%8EP8^RU665#C",!M\BUSP,J!5UW!7Q8XN/^<2B0 -M&N01N+N?@F2@."CYA//:U1#'=_?A$YS>W7]!V+=5+F?..`A@'&2#E#0Z5I;[ -M\3Z5&W`N(,P^;[)B11%WL\U>P`G$C3NXW"KCY)X7Y66Q>9RBJ5<;>PD#O0#; -M03<6<&\W.%VY\B2:>PW-`-J`8C!8O!@U,`;0NC8)/<&!NQ"/T##@/0*GRV=R -M";`WY-?K.3[)YHK(K;*AE#V)I4+;DMP&:WM7+J0X43M[+69/5<2Z6W"H; -MBMGK0O;R2<+LY5K7X>:LD1:GANL/]_Z^/I<-TXFDGP"4,[!:A-+: -MH6)W(*YB=R"N8G<@KFIW(+!B=R"N8G<@KF)W(*YJ=SB@H?6&..*P]@R%1H-M -M<`.1A%$-PD<@W?&_T[0SS_,$S%(8ZXW2%N35'L[P]_WA<<'Q6M210->@E..C^2JY*Y7X]\^\>>5JCR[RF -M5)R]HP8J\143"Y^C.Z6EHOP.:!%K++02?9]6\B4Q9`L9<;Y4XIO_]]D&7.U2 -.<7\-#O\`_#?S";,-```` +M'XL("-!Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD9BYO=70`K9=/J]P@$,#O +M^RFFO,/"*Q4U:K*7!RV\EMZVCY9>>LD??2RE6PJE])`/7T?-1GMQHA93C,UJ# +M,6%2YK2\LOW-V[!><&0=>Q+AIHO6[2P+8ASQN,5=\S*@E-#W-\`OBWW](;]>!_L$"QF1FV5!*7H"4X5V)7=;S.U-=R'%-;6CUV'T9+7H'4*RY&99 +M4(Q>[Z.7#Q)&+U>Z%A>B1EZEN*%N])CK&K8^[/Y]>R\+YB-)+P\4`5C-0F', +M6+$Z$%>Q.A!7L3H05[4Z$%BQ.A!7L3H05[$Z$%>U.BQ0TWI-''&8>YI"J\"T +M>(!(S"BVXYG\L><*'/O$7<<<#QYUF/OT]_X^A)MS/#>DB^FJC/&TQ, +M94NDQY>H"=>1?7>/S_>G'\\+C@>OE@#*%K4:#FJX<5>F[GX]\>\.>5RMRVQ3 +M,H[>00$5N,7$C@?KCFFJ2'<"6IS5!CJ!NI>9_$@$V41&G$N5^.'__;8>5SM5 +-[%^#W3\[9-S+LPT````` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,87 +1,87 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.vmdk.gz -M'XL("/'%'50``VEM9RTQ>#$M-#`Y-BUG<'0N=FUD:RYO=70`K5Q=C]S&$7SW -MKYC(#S829,%:DLOE@X+8D1T800!%=I*7/(2?\2&VI)P.A@WLCP^'G)HKWNT< -M*5^?]K3;8G?M=,^RN:HN,,N6'^>*UA6%*WI7GEP&-_W3\G!9?F],C^.9!RY_ -M>?77?QSX\_GAS5\Z&YOWM^]"^L[^KV=G(N3 -M]S]U'F%*K#KY%_Z`AZL]Q&EP>>]R^,/N9.\._A+G_ZYM7+\,G-#N^;6\+YJ&DATWM/>2CNZ>3\ -M[^/'O+KA[9U'',-/7)W?VU"<#R]?_/CN;:R=WUM?LGH&.L^%REV9>ZB0FB]?Z1']QV;>-7?YX>;N^YON -MVRG-#\.+PZ>.<"=?NVD#SV%=2]93R"FYL].R+U_]?#?EZ_JPLS>$FQ6QI@V_',ZQ7VQOGW]Q1O"G:>H -MR7-:X!0R);3*J5SR+Q]^+-WEVZ_<"Y_D=]\/\R>0:=&_XEQEY?NQ4T_ -M[:F'_<_P[D?"=%J'_TC4[VET/WRP\W -M;_OI1',O"=_%G8B&>K49T8_9[J -MG7QK&\1S?%@]?M6`O$[#\;L`/7.-*L0H5W"IVI6A=O2L-.HL1KV"2]7N%&I' -MSU:C.C'Z7N8:58A1KN!2M:M#[>A9:=19 -MC'H%EZI=$VI'SU:C.C'Z7JW1!J1\]6HSHQ^EW)CJ%V]!PURC\54KMB"Z[*0NWHF6M4 -M(4:Y@DO4KF*_HV>E46E4:=Q:A7<*G:L=_1L]6H3HQ^5[+L=_0<-N4848Y0HN53OV.WI6&G46HU[!I6K'?D?/5J,Z,?I=R;+? -MT7/4*/]$0@;R.@EWSD+MZ)EK5"%&N8)+U.[,?D?/2J/.8M0KN$3MSNQW]&PU -MJA.CWY4L^QT]1XWR3[74KMZ$8[^C9ZY1A1CE"BY5._8[>E8:=1:C7L&E:L=^ -M1\]6HSHQ^EW)LM_1<]0H_\3_/T%>I^'8[^B9:U0A1KF"2]6._8Z>E4:=Q:A7 -M<*G:L=_1L]6H3HQ^5[+L=_0<-H0HQR!9>J'?L=/2N- -M.HM1K^!2M6._HV>K49T8_:YDV>_H.6J4?^JD=MT67)V%VM$SUZA"C'(%EZA= -MS7Y'STJCSF+4*[A$[6KV.WJV&M6)T>]*EOV.GJ-&^:=>:M=OPK'?T3/7J$*, -M<@67JAW['3TKC3J+4:_@4K5COZ-GJU&=&/VN9-GOZ#EJE'\:I';#)AS['3US -MC2K$*%=PJ=JQW]&STJBS&/4*+E4[]CMZMAK5B='O2I;]CIZC1OFG46HW;L*Q -MW]$SUZA"C'(%EZH=^QT]*XTZBU&OX%*U8[^C9ZM1G1C]KF39[^@Y:E0FTS/( -MZR1^@_!V$O\,F?]>$?@?A[Z#\'82_PR9_UX1^!^'O -MH/P=A+_;D6SH=Q#^#LK?0?@[;%):3>AW$/X.RM]!^#ML\G=-Z'<0_@[*WT'X -M.VSR=TWH=Q#^#LK?0?B['^@_!V$O\,F?]>$?@?A[Z#\'82_VY%LZ'<0_@[*WT'X.VQ26FT6:B?\ -M'92_@_!WV.3O6O8[X>^@_!V$O\,F?]>RWPE_!^7O(/S=CF39[X2_@_)W$/X. -MFY16RWXG_!V4OX/P=]CD[UKV.^'OH/P=A+_#)G_7LM\)?P?E[R#\W8YDV>^$ -MOX/R=Q#^#IN45LM^)_P=E+^#\'?8Y.]:]COA[Z#\'82_PR9_U[+?"7\'Y>\@ -M_-V.9-GOA+^#\G<0_@Z;E%;+?B?\'92_@_!WV.3O6O8[X>^@_!V$O\,F?]>R -MWPE_!^7O(/S=CF39[X2_@_)W$/X.FY16EX7:"7\'Y>\@_!TV^;N._4[X.RA_ -M!^'OL,G?=>QWPM]!^3L(?[^@_!V$O\,FI=6QWPE_!^7O(/P=-OF[ -MCOU.^#LH?P?A[[#)WW7L=\+?0?D["'^W(UGV.^'OH/P=A+_#)J75L=\)?P?E -M[R#\'3;YNX[]3O@[*'\'X>^PR=]U['?"WT'Y.PA_MR-9]COA[Z#\'82_PR:E -MU;'?"7\'Y>\@_!TV^;N._4[X.RA_!^'OL,G?=>QWPM]!^3L(?[^@ -M_!V$O\,FI=5GH7;"WT'Y.PA_ATW^KF>_$_X.RM]!^#ML\G<]^YWP=U#^#L+? -M[4B6_4[X.RA_!^'OL$EI]>QWPM]!^3L(?X=-_JYGOQ/^#LK?0?@[;/)W/?N= -M\'=0_@["W^U(EOU.^#LH?P?A[[!):?7L=\+?0?D["'^'3?ZN9[\3_@[*WT'X -M.VSR=SW[G?!W4/X.PM_M2);]3O@[*'\'X>^P26GU['?"WT'Y.PA_ATW^KF>_ -M$_X.RM]!^#ML\G<]^YWP=U#^#L+?[4B6_4[X.RA_%\5TD-<"YY;?`#=D2^VN -M2LJO_%.LG;NZNL%:'SB.>P'SZ^GZ/8[I(GMR&1^_/LSZQ3CS6*K^ZP`7../Z -M(<[?I4SW<1^KKT2+\W41?B3A_-]%7(L[?3?25 -MB/-W$WTEXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25B/-W$WTEXOS=1%^).'\WT5#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U& -M7PG.WVWTE>#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U&7PG.WVWTE>#\W49? -M"<[?;?25X/S=1E\)SM]M])7@_-U&7PG.WVWTE>#\W49?"<[?;?25X/S=1E\) -MSM]M])7@_-U&7PG.WVWTE>#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U&7PG. -MWVWTE>#\W49?B3A_I^>S])6(\W=Z/DM?B3A_I^>S])6(\W=Z/DM?B3A_-]%7 -M(L[?3?25B/-W$WTEXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25B/-W$WTEXOS=1%^).'\W -MT5+\W41?B3A_ -M-]%7(L[?3?25B/-W$WTEXOS=1%\)SM]M])483/65&$SUE1A,]9483/65&$SU -ME1A,]9483/65&$SUE1A,]9483/65&$SUE1A,]9483/65&$SUE1A,]948L\Q0 -M7XG15%^)T51?B=%47XG15%^)T51?B=%47XG15%^)T51?B=%47XG15%^)T51? -MB=%47XG15%^)T51?B=%47WG,LLQ07WE\=*_CG7"/DUWT@4>8ZBN/QR>7\?'K -M*^;Z+7=7??QW^L#ER\/Z3P1$^W&`7.$:C@D7\.?&HO4:!C>.X;$HY^XSC'>Q -MOI+PYP>!ZXWKMW]_ET=9NJ9Y!/AWKF_>WZ+T]V,NZOGFO+PS;UE$N#GWLM/U -M??7U-^[U%V^^\V#_ND]WOKUSEWNRK:@\RGIU2*?[YS>/SXYBOKWS5/UC=379 -M/`GWV;63K9AO[SSV3\!=>Z3ABJ>B/O9.X,5\>V>-4O6MRP?7YFYL7-,GX/[P -M`.YD_,F;[SS;GES5^?L'EW#=?+/G_N1I:7>>3I/EG#BZ8^^5"!7!X5?O-&JZUK5XY7S46X'9X.-.S -MH_`WC+2[B'LX+-^8JY,;*_\%8K6,Y.7XN; -G,1A>Q#WQ#V#$M-#`Y-BUG<'0N=FUD:RYO=70`K5Q=C]S&$7SW +MKYC(#PX29,%:DLOE@X+8.3LP@@"*["0O>0@_XT/LDW(Z&!&P/SX<'=S +MI'Q]VM-NB]VUTSW+YJJZP"Q;?IPK6E<4KNA=>7(9W/1/R\-E^;TQ/8YG'KC\ +M^>HO?S_PY]>'P^6S!0P^2D*0*9P8J_>Y'![\$.[X7-3JP/0X;L+E/JI]%!C@ +MCHD#2;AB.GA\*H2K:^;#O7\A<"X"N15<^41.R62?6]UO/@O%\^O+_1JF[3W5 +MKLK=J0VF.Y6SG;OJ.!_+7#4YC1/@Y^[J^L-_W-7PH;N]?G_W+JSOZ/=V80IL>KD7_@#'J[V$*?!Y;W+X0^[R^TWUS\.AY^'VP_7[VY>@^D>_=X6 +MN2MJOQSOG]T_5H9_D\R=X-_#7?[X[=7K\,G-#N^;6\+YJ&DATWM/>2CNZ>3\ +M[^/'O+KAYLXCCN$GKL[O;2A..;]WX5^4A:MJ-R^G]-C'Z7`?4IYKU]T.S=WP +M_^M+5L]`Y[E0N2MS#Q52\^4K/:+_V,R[YBX_7M_]<-U] +M-Z7Y87AU^-P1[N1K-VW@.:QKR7H*.25W=EKVY>O_W4WYNC[L[#7AYD7,24SO +M71Y=67FL:0/GK3BZO/"OIG^:%CQE4L`[N4X+G$*FA%8YE4O^Y<./I;M\][5[Y9/\_H=A_@02KEY.,^^\[`-F\^A?A*HM +M\+Z)%?[`O+/NJKEKW%?-A^'P^=755W%G&Y]L,3^FI0T>Y;1`^\_W7,ZI<,M. +M+QL];T7?MX>F;][?#;=^>^-6M+Y$?$ZY?:3EUA$H]>*L)W5WNJS;C?@AP>19:0!Y:V:I$ +M<3G+&TH#';J[=[?+PEY)/\X?7LM>VH^+1Y?4ZA<"+G#6ZSME#ZYGN<858I0K +M0'\5RZ;?/TR_;^[7=_+K.XEGI5%G,>H5W+\FB/>/TSWYL[`1SU:C.C'Z/=4[ +M^=8VB.?XL'K\J@%YG8;C=P%ZYAI5B%&NX%*U*T/MZ%EIU%F,>@67JMTIU(Z> +MK49U8O2[DJU"[>@Y:I1_XEK49U8O2[DFU#[>@Y:I1_8H.`O$[#=:%V],PUJA"C7,&E:M>' +MVM&STJBS&/4*+E6[(=2.GJU&=6+TNY(=0^WH.6J4?RJD=L467)6%VM$SUZA" +MC'(%EZA=Q7Y'STJCSF+4*[A$[2KV.WJV&M6)T>]*EOV.GJ-&^:=2:E=NPK'? +MT3/7J$*,<@67JAW['3TKC3J+4:_@4K5COZ-GJU&=&/VN9-GOZ#EJE'\Z2>U. +MFW#L=_3,-:H0HUS!I6K'?D?/2J/.8M0KN%3MV._HV6I4)T:_*UGV.WJ.&N6? +M^"4(\CH-QWY'SURC"C'*%5RJ=NQW]*PTZBQ&O8)+U8[]CIZM1G5B]+N29;^C +MYZA1_HF$#.1U$NZH0HQR!9>HW9G]CIZ51IW%J%=PB=J=V>_HV6I4 +M)T:_*UGV.WJ.&N6?:JE=O0G'?D?/7*,*,P:5JQWY'SU:C.C'Z7N4848Y0HN4;N: +M_8Z>E4:=Q:A7<(G:U>QW]&PUJA.CWY4L^QT]1XWR3[W4KM^$8[^C9ZY1A1CE +M"BY5._8[>E8:=1:C7L&E:L=^1\]6HSHQ^EW)LM_1<]0H_S1([89-./8[>N8: +M58A1KN!2M6._HV>E46-\D^CU&[N4848Y0HN53OV.WI6&G46HU[!I6K'?D?/5J,Z,?I=R;+?T7/4J$RF9Y#7 +M2;@F6VH7/7.-*L0H5W")VC6AWT7/2J/.8M0KN$3MFM#OHF>K49T8_:YD0[^+ +MGJ-&^9()?X=-2JL)_0["WT'Y.PA_ATW^K@G]#L+?0?D["'^'3?ZN"?T.PM]! +M^3L(?[^PR=^U['?"WT'Y.PA_ATW^KF6_$_X.RM]!^+L=R;+?"7\'Y>\@_!TV +M*:V6_4[X.RA_!^'OL,G?M>QWPM]!^3L(?X=-_JYEOQ/^#LK?0?B['^PR=^U['?"WT'Y.PA_ATW^KF6_ +M$_X.RM]!^+L=R;+?"7\'Y>\@_!TV*:TN"[43_@[*WT'X.VSR=QW[G?!W4/X. +MPM]AD[_KV.^$OX/R=Q#^;D>R['?"WT'Y.PA_ATU*JV._$_X.RM]!^#ML\G<= +M^YWP=U#^#L+?89._Z]COA+^#\G<0_FY'LNQWPM]!^3L(?X=-2JMCOQ/^#LK? +M0?@[;/)W'?N=\'=0_@["WV&3O^O8[X2_@_)W$/YN1[+L=\+?0?D["'^'34JK +M8[\3_@[*WT'X.VSR=QW[G?!W4/X.PM]AD[_KV.^$OX/R=Q#^;D>R['?"WT'Y +M.PA_ATU*J\]"[82_@_)W$/X.F_Q=SWXG_!V4OX/P=]CD[WKV.^'OH/P=A+_; +MD2S[G?!W4/X.PM]AD]+JV>^$OX/R=Q#^#IO\7<]^)_P=E+^#\'?8Y.]Z]COA +M[Z#\'82_VY$L^YWP=U#^#L+?89/2ZMGOA+^#\G<0_@Z;_%W/?B?\'92_@_!W +MV.3O>O8[X>^@_!V$O]N1+/N=\'=0_@["WV&3TNK9[X2_@_)W$/X.F_Q=SWXG +M_!V4OX/P=]CD[WKV.^'OH/P=A+_;D2S[G?!W4/XNBND@KP7.+;\!;LB6VCTI +M*7_BGV+MW).K&ZSU@>.X%S!_.EV_QS%=9,\NX]/7AUF_&&<>2]5_&>`"9UP_ +MQ/F[E.D^[E/UE8CS=SY>I*]$G+_S\2)])>+\G8\7Z2L1Y^\F^DK$^;N)OA)Q +M_FZBKT2?O)OI*Q/F[B;X2 +M?O)OI*Q/F[B;X2?O]'R1OA)Q_D[/%^DK$>?O]'R1OA)Q_D[/%^DK$>?O)OI* +MQ/F[B;X2?O)OI*Q/F[B;X2?O +M)OI*Q/F[B;X27Q^.PR/GU] +MQ5R_Y>ZJC_].'[A\=5C_B8!H/PV0*US#,>$"_MQ8M%[#X,8Q/!;E'#]!HSM6 +MZ82_.`A<;UR__?N[/,K2-51UJM#.MT_O7U\=A3S[9T?5YMP>1+N +MBZ=.MF*^O?/8/P/WU",-5SP7]:EW`B_FVSMKE*IO73ZX-G=CXYH^`??[!W`G +MXT_>?.?9]N2JSM\_N(3KYIL]]R=/2[OS=)HL__,[NF/OE0@5W-'?D?EPN?GK +MX68!^]WAO[\-ZUON/(NG'^D#J>H5\UW>SZETJT3#7K=Y@_K[2E6?7J +M\&%YZI$^D*Q>LU0O<56;JO?4J3O!\:KVJS5<:UN]'-9_ +M%L`B`)JML/"W%+0[.SRG9X0,.SP\,9GAT>SO#L\'"F9T?A +M;QAI=Q'W<%B^,57P\_2]PO]\L4IWYAR3E_YG+N)/;\9@ +E>!'W<,]>Q,!'W<*87\<+?O3/[[/^_O`I!M&4````` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,6 +1,6 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.qcow.gz -M'XL("*,S(E0``VEM9RTQ>#$M-3$R+6=P="YQ8V]W+F]U=`"MG?U +M'XL(",5Q+ED``VEM9RTQ>#$M-3$R+6=P="YQ8V]W+F]U=`"MG?U M%5=OB9*HC(C[U-MNM`'/RH9[UH.ZKQQU&]ES?7PSR?,@(_=6V!!51$$%X6YD M'BTNJE2KC@Z'NV]-TTG3]DT[-<>EN?GG]"'-O7]X^-'\^-M?_GI]_]N/W^[& MY/"3I]P_M]I(FGNP]>GUN8P_0MS-Q]P[MZKLW_CU=U[LY=S5[_=O5G\ @@ -117,16 +117,16 @@ M?_OOOB?NOF?NV@-^BORYQ^[-?L^]\7690W_>=GDJ MF+OW[<=O5W>#Z+ZJMF2`T>O[P[\^=%_5K[R^[O;\6FT.,_@[_X$??[Y^^%<9 -MO+T[Z-\8S*_PX5Q^P]W=W4&WT=1^X\YC^CC(_3<\UNOTP!M^#_Y5?W^UU/VW7M'W33NDBQU::3INN+7.W[[5;[[^^__S+ -M7YO?__3W?YS'_KN^W=OK?G9MAO7V#Q_8W*L3^G9_^+=[-W?[Y7OPIYWGC,X] -MP7.W7[Z[G\RA#S[7_NRI@])7=_%S>S?7'1X^-=Y_:NR:49O^YM^&9CKW/P_F -MT!\?_RODW=XV_OR'[S;CS:?)W7^:T=O_EVEJ!CG_ -M7W;GG]M__NWZGW=C[Z__[VUZ?76;I'.[TIP8(^^`_0TYOO3@\?TOE%P4^9'_>O$;T_!WZ]\DNG=_M_ -M-9Z_QL[@[_P'?OQ^_?"ON\$V#3[:*VP/_?J(GQWGN4?\[#C//>)GQWGN43\[ -MSH./^-EQGGO$SX[SW"-^=ISG'O6SXV;P]O<<'^F+^'GNS%YKS;PVZ]#T_HLX -M^W+\XS^NK_\7O-V[WW-D7_I_\D4<_V3LC_A%_#SW\R_B/?VYS=_AAN9_O;_@'C+'O6L```` +M7YO?__3W?YS'_KN^W=OK?G9MAO7V#Q_8W*L3^G9_^+=[-W?[Y?OBM/..[VRW?WDSGTP>?:GSUU4/KJ+GYN[^:ZP\.GQOM/C5TS:M/?_-O03.?^Y\$< +M^N/C?X6\VYL#EO[\<]O?_`)/FO5X_L[6G__PW6:\^32Y^T\S>OO_,DW-(.?_ +MR^[\<_O/OUW_\V[L_?7_O4VO[^[F`,$?_`?8Z=W=',"(..1LD;_=YN$<^)7> +MKYW>^=O/=Z>%#.K\H^"GSX_XUHO?GP*]7?NGT;O^O +MQO/7V!G\G?_`C]^O'_YU-]BFP4=[A>VA7Q_QL^,\]XB?'>>Y1_SL.,\]ZF?' +M>?`1/SO.>\3/CO/_I[C(WT1/\^=V6NMF==F'9K>?Q%G +M7XY__,?U]?^"MWOW>X[L2_]/OHCCGXS]$;^(G^=^_D6\IS^W^9M[LX_X1?P\ +4]ZA?Q-O#<"/3W_X?EY=\._6L```` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,26 +1,26 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.qcow2.gz -M'XL(")4[(U0``VEM9RTQ>#$M-3$R+6=P="YQ8V]W,BYO=70`K9A+;YPP$(#O -M^15.WTT:BLVL/+(]3%:EWVM]>C`T&,P/)UKMHE[N[CJ:?]LC`>$Q$(0-2C+@9Z]+A -M@,+%?#G`<=PD.X'@8(A:@K9PDLQN;0#!G1SU2]??C,R+$(<`#8Z\&0?E!R8_ -M/T(>F!^$SD_@ZZ>&.'\@6<]/F/S\J)3"99LX0*)R"E=LX@02M:=PY29.(E$5 -MA:LW<0J):@@0F+D.B*._XMG]*Y`H -MRCN^[=T>B:*\X]O>E4@4Y1W?]JY"HBCO@/"..5R-1%'>@>?=L<4]^%P2+\#RCOPO'MI<2<. -MA_0[H+P#S[M3BWOE<$B_`\H[\+P[6WC'D7X'E'?"\^ZU9<4.A_0[07DG/.^X -MQ8'#(?U.4-X)SSMA<=+AD'XG*.^$YYVRN,3AD'XG*.^$YUUJ<9G#(?U.4-X) -MS[OO;>X#PZ']#M!>2<][SY:W">' -M0_J=I+R3GG?G%G?A<$B_DY1WTO/NTN(^CSC`HD;OXAB_+.YJ4;.`]#N9W!.W -M6^+HAY5#CK/2';3`P(RX>-H@JL"KU]?;@\`*L6*8@'\ -M/N37EUM77^;=0&>WZIN!`J;DB.OGJLII?E>[:W9S_O6;AOUPT^W+3>-J_;!4 -M)%YVG)KNU1?$/F7*+6W\U1YP@L*-QS(/IX\7:;6"PR[6_B%P1TW;%LL4RX`E):L*$O=KADL"FR?U\#YA:JV"KEUM9L(L>(%>O,*N'+Y)."BV9=EBUH>`&W#[PZB5ZN*N/KG\O -M?^F!]B::?PU06F"P#&72E`&K0^,"5H?&!:P.C0M:'1H8L#HT+F!U:%S`ZM"X -MH-71`>LXW":N<=J]/&.J8KED335/@]R.V^@G.MT:UK;^E4T#$M-3$R+6=P="YQ8V]W,BYO=70`K9A+;YPP$(#O +M^15.WTT:BLVL/[`*G*E+OM+^]&!N\F!F<;+V+5HFL^30V +MWXP-:6H^C"G.9,9DR=HMZ_^W%["]?^87ZVXWU\G^ISLR,)X24&J($X@45L*MPOB)!)5 +M4[@FB%-(5$O@>$"5'I-X=6]PCAVN1*,H[ +M\+Q[;'%/)AS'HBCOP//NJ<4]/;>X%PZ']#N@O`//NY<6=^)P +M2+\#RCOPO#NUN%<.A_0[H+P#S[NSA7<2<\[UY;5NIP2+\3E'?"\XY; +M'#@"\DYXWBF+RQP.Z7>"\DYXWN465S@XO[X'!(OQ.4=]+S[J/%?7(X +MI-])RCOI>7=N<1<.A_0[27DG/>\N+>[SA`,L:O(N3?'+XJX6-0M(OY/9/7&; +M)8Y^6#GD."O=<9LCO_3`"K!X.)#<:Z4YI\2;L#(3UE95R"\]T%TD\^\$'&KW +M`<`QPSG.3EB9VC4/C$W#VM9>9J5L<-ZZ`P(RX>-D#U='7K^AW!X`5(I5U0+X +M?^OLR[@=YN-30#!4S)"3?,5>WV\[O:7+.;\Z_?-.R'F^Y0;AK7Z(>E +M*O.RX]1TK[X@]BE3;LO5'G&"PDW',@^GCQ=YO8+#+M;](7!R+6IZZ7"/>VMP +M*IU'[;XWT +M7ZNG^_)615N]TLJ"7?0`N7J563U\D712:,ETXZJ-!3?BMI%7+]/#?7WT_7OY +M2P]T-\G\:X#2`J-E*+-V%[$Z-"YB=6A(:I]TK"Z9J5DK6UO,TR.VX2WZBTVU@;>M?V<3QF]%$W,0U;G43 +>SQMRLO;SUYMLQ$U#$M-3$R+6=P="YR87.*>+8T+K=IG%GSBCWTO[.-."OG7G[JY2UX#:Z!MB)QGS.<8^X\ -M@^;:0=F`.X!5T'3XT#I0*L079.('2*AO"W('I0)=([`_OHACA-V(K^LQ/J/& -MCLAMVD!5S^BUCL"@_D@7YKB"NWH>JV?9JK<;FR6W:0-9O2I6+U\D4C)]JEI2 -M2,+5S-5S:`[Z"/_O\SMMZ/=B?D6@&8%L$8;F#$M-3$R+6=P="YR87EIJKH,&+Z/(6S'"-6>OQ:8-8YR(N)1N>QG06BC+!?`]Q:?[X[!@')@]Z/"^!*/` +M:K#F%]?G:NMQ?(]/SW"X?WU#V,;L1I]%I4 +M.^$*$K?-XXIXMC0NMVF<6?.*/?2_LXTX*Z=>?NSE+7@-KH:F)'&?$YQC[CR# +MYLK!K@9W!*N@;O&A<:!4B"_(Q/>04-\&Y!YV"G2%P.[T(DX1=B.^KH?XC!HZ +M(K=I`U4]H]@C_+^7=]K0'<3TBD`S`-DB#,WG&-6!.$9U((Y1'8AC50<"&=6! +M.$9U((Y1'8AC54<`>LDWQ!'7#W$#NP::`HKY$*?&<2>^Q6TF7:_71O_*$,\? +CAF<#$M-3$R+6=P="YV:&0N;W5T`*V82W/3,!"`[_T5 -MF^%6!H_>=F[0F3)P*PP,%RY^I62`\&@//9C_CE:6;,NV#&G743U)E/V\+ZVV -M8JR_`(P$K:K7&Q2;Z!6QO0\01.;4D->\E_Q+;':19+ -M%5.I0D-AMY`:FC*)^Q;AJ.MRB].5@;S&+5QSJ-U>WACY']>N[U:[G/B+61GDAYKQ5;&8%*_<-V_=2:C4ZI()NUJ6[6)<1>L][MI'NSYL_5[>TQ/=31:_ -M>J#PVQ#9OB9\(2734'D@F8;*KU]"#;G:#.:Y458B%X05!G&$%09QA!4&<:05 -M!H&$%09QA!4&<805!G&D%<8"73(3-4*(\WVS]7-E_Q6=J9%L:5"_EXB2L;E* -M;+5/Z48H$0Q%V`@A;K,1DNG8^DO,C"5LA!!'V@@97TB)SC),:(26.CSF+,.$ -H1HB-#GS"6899;X0>>Y:!.,*S#,01GF4@CCA5L&^Y^`N^QF[[`!,````` +M'XL(",9Q+ED``VEM9RTQ>#$M-3$R+6=P="YV:&0N;W5T`*V82W/3,!"`[_D5 +MV^%6!H_>=F[0F3)P*PP,%RY^I62`\&@//9C_CE:6;,NV#&G743U)E/V\+ZVV +M8JR_`(P$7Q^^W`2<\3GB0SE%*"C#5XCG*?EOTVB'I +MTU%\=^[=J:?2*2*&?3CBSF9-E?X5!'AQUX#A>F\92XXROTB>5" +M=*T3F`X3PID?>V]$P50_P]F&S]/!2.I7HGYV,;!RY9Z>Z*ZR^#4`J^H\8/!@ +MC!L,KFKTGZL#;3M:U">)%Y82!$\&1%Y,_%^^M.PF56ETR85?+LHL85]%ZC[OVT:X/6[^7]_1$=Y/%KQXH +M_#9$MJ\)7TC)-%0>2*:A\NN74$.N-H-Y;I25R`5AA4$<885!'&&%01QIA4$@ +M885!'&&%01QAA4$<:86Q0)?,1(T0XGS?;/UQ;=G\!II']:``3```` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,19 +1,19 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.vhdf.gz -M'XL("&$EAE4``VEM9RTQ>#$M-3$R+6=P="YV:&1F+F]U=`"ME\V.U#`,@._S -M%$9[6+1HJR9-TO8(TB)Q&V#17KCT)UF-@$%('#C,PV,GZ3:92;HL2FM5&;G^ -M:CMVW:EK=P`(#O60N.85IW=5?)YV-SM+8^/+@/A\B!X_TU"`:2@Q1/.!N[G$+_[MY_@/W;3_<$^[J&RQDJS03]#+HE1.P=VPCW -M/@[7X3CA#/`V&6R3Q5V?9\_A&L+-&[B4Y'%BR\K5T+_MK^OR^O><5I7\6G`PH/+.:A,&8JV!V$ -M*]@=A"O8'80KVAT$+-@=A"O8'80KV!V$*]H="-1UN2%..*J]&7/>@\0A'E=- -M?ARC?P^?K6/74;B:;XW^C2&>W@Q=<(@3;G.(&YT/UA]GP18=13[\/?\+L$8ZYBD@*V?.&"E.UP`=ZB)II -M'?AW=?=X<_CQN."XCVI)(-8?6C68L_$B7!F'^W#@WRQROWJ7>$W),'N]@EK0 -M*R8,W'NWCTM%VB^@)5AMH!-D^R31CTB1+&3"V5();_[?O76XTJ6"?PUV?P'7 -':/,?LPT````` +M'XL(",9Q+ED``VEM9RTQ>#$M-3$R+6=P="YV:&1F+F]U=`"METV/TS`0AN_] +M%8,X5%I$9#NVDQQ!6B1N!1;MA4L^G%4%%"%QX-`?SXSMM'9C!Q8YL:)4DWDR +M\V8FDS+F-@`I@/6)8]YP?EO%^WEWM[,T/CP/B/>G$&Z`%0(=;D0C$W2-,3#/ +M?C%NO9PS_A:-/U]PU77;5P%NNGBM5]X0XBJ'6]*=GP=4"OI^!?R\Q"?LXU`@ +M-<@.!%[/0')0`I2\X&SN:@SCNW_W'@YO/CX0[,LU7<'1.(_036`:0L31\8UT +M'^)T'4X0;J7V@JNSN/VM>@Y7$V[:P*56'B>WO%P-_=NS=3C%8J\V]&H5M`+T +M"%.?Q7V+<+IPY4DR#QJ:$;0!Q6&3Q^J +MDX.]KGZ^\O%)[BLBM?*&G'I2;%4$!?67="'&U:75:TD]54R]SA=+:N4-6?5Z +MIUY:)`HJU;J(\ZI5+V+<4%@]36;L#WQ_KX]YP_E0Q;L#2@\L%J&5TU^ +M'&-\CY]L8/LH72.V1O_&$$\_#%-PB!-N#$M-3$R+6=P="YV;61K+F]U=`"M7%V/W,81?/>O -MF,@/#A)DP5J22_)!0.S(!HP@@&(I\4L>LOR*#Y$EY70(8F!_?#CDU%SQ;N=( -M^?I,B=O:[MKI'K+W7%U@EBT_SA6M*PI7]*X\N0QN^J?E<%E^;TS'L>8;ES^_ -M^LO?#_SY[>%P^6(!@X^2$&0*)\;J;P6PM6=Y[=[_T+@7`1R*[CR2D[)9)]:W>^^",7SZ\O]&J;M/36N -MRMVI#:8[E;.=N^HXOY>Y:G(:)\`OW:N;3_]VKX9/W>W-Q[L/87U'O[>3XRY^^?_4R7+G9X>/YEG`^:EK(]-E3'HI[.CG_ -MY_$QKVYX?^<1Q_`35^?W-A2GG#^[\"_*PE6-FY=3>NSC]'8?4IYKU]T.Y[OA -M[2\?AYD1_V -M3&E^&EX=O2'FS -MRZ,K*X\U;>"\%4>7%_[5]$_3@J=,"G@G=_GP_O##C],M[HOUYO77/Q"NGJ(F -MSVF!4\B4T"JGK5-W%GSS[98CZFI0T>Y;1`^^M[+N=4N&6G -MEXV>MZ+OV\.Y/W^\&V[]]L:M:'V)^I"IW];B?AO7GU/-.S7Z*\9=7KH7-_VT -MIQ[V7\.'GPG7+9?QM`Y_231S8.Y?3%?/##^$3UBN&+]-'FZXN_WET/WR[N9] -M/]UH[B7A^J5VTW*6W;S?S&D#IQ5>7>!4NQ?SKL;E$6[PJ^L?+7#>SU#(N*CX -ML>[R\[R\GX9S/RUMPB;7V_OI-?WTD\*XVJQ6A6+8:U8G1[ZG> -MR;>V03S'A]7CKQJ0UVDX_BY`SURC"C'*%5RJ=F6H'3TKC:K%:%9PJ=J=0NWH -MV6I4)T:_*]DJU(Z>HT;Y$W^50K;CU[)3'6I'SURC"C'*%5RJ=DVH'3TKC:K% -M:%9PJ=J=0^WHV6I4)T:_*]DVU(Z>HT;Y$QL$Y'4:K@NUHV>N4848Y0HN5;L^ -MU(Z>E4;58C0KN%3MAE`[>K8:U8G1[TIV#+6CYZA1_E1([8HMN"H+M:-GKE&% -M&.4*+E&[BOV.GI5&U6(T*[A$[2KV.WJV&M6)T>]*EOV.GJ-&^5,IM2LWX=CO -MZ)EK5"%&N8)+U8[]CIZ51M5B-"NX5.W8[^C9:E0G1K\K6?8[>HX:Y4\GJ=UI -M$X[]CIZY1A5BE"NX5.W8[^A9:50M1K."2]6._8Z>K49U8O2[DF6_H^>H4?[$ -M7X(@K]-P['?TS#6J$*-]*EOV.GJ-&^5,CM6LVX=COZ)EK5"%&N8)+U8[]CIZ51M5B-"NX5.W8[^C9 -M:E0G1K\K6?8[>HX:Y4_\_R?(ZS0<^QT]J -M'?L=/5N-ZL3H=R7+?D?/4:/\B?PCY'4:COV.GKE&%6*4*[A4[=COZ%EI5"U& -MLX)+U8[]CIZM1G5B]+N29;^CYZA1_M1)[;HMN"8+M:-GKE&%&.4*+E&[AOV. -MGI5&U6(T*[A$[1KV.WJV&M6)T>]*EOV.GJ-&^5,OM>LWX=COZ)EK5"%&N8)+ -MU8[]CIZ51M5B-"NX5.W8[^C9:E0G1K\K6?8[>HX:Y4^#U&[8A&._HV>N4848 -MY0HN53OV.WI6&E6+T:S@4K5COZ-GJU&=&/VN9-GOZ#EJE#^-4KMQ$X[]CIZY -M1A5BE"NX5.W8[^A9:50M1K."2]6._8Z>K49U8O2[DF6_H^>H49E,SR"ODW#G -M;*E=],PUJA"C7,$E:G<._2YZ5AI5B]&LX!*U.X=^%SU;C>K$Z'^@_!V$O]N1+/N=\'=0 -M_@["WV&3TFK9[X2_@_)W$/X.F_Q=RWXG_!V4OX/P=]CD[UKV.^'OH/P=A+_; -MD2S[G?!W4/X.PM]AD])JV>^$OX/R=Q#^#IO\7]V),M^)_P=E+^#\'?8I+0Z]COA[Z#\'82_PR9_U['? -M"7\'Y>\@_!TV^;N._4[X.RA_!^'O=B3+?B?\'92_@_!WV*2T.O8[X>^@_!V$ -MO\,F?]>QWPE_!^7O(/P=-OF[COU.^#LH?P?A[W8DRWXG_!V4OX/P=]BDM#KV -M.^'OH/P=A+_#)G_7L=\)?P?E[R#\'3;YNX[]3O@[*'\'X>]V),M^)_P=E+^# -M\'?8I+3Z+-1.^#LH?P?A[[#)W_7L=\+?0?D["'^'3?ZN9[\3_@[*WT'XNQW) -MLM\)?P?E[R#\'38IK9[]3O@[*'\'X>^PR=_U['?"WT'Y.PA_ATW^KF>_$_X. -MRM]!^+L=R;+?"7\'Y>\@_!TV*:V>_4[X.RA_!^'OL,G?]>QWPM]!^3L(?X=- -M_JYGOQ/^#LK?0?B['NKFZPU@>.XU[`_'JZ?H]CNLB>7,;GKP^S?C'./):J_SK`!?O)OI*Q/F[B;X2?O)OI*Q/F[B;X2?O)OI*Q/F[B;X2?O)OI*Q/F[B;X2 -M?O)OI*6+1>P^#&,1R+N;][QT?=]^ -M][U[_?4/;SW8/^[3G1_O/':NZ=U0>8CUZO!$NF\?WQW%_'CGJ?K'ZFJR>1+N -MJVLW6S$_WGGLGX"[=J3ABJ>B/O=)X,7\>&>-4O6MJTM7'_WS>_MS$N[="NYD -M?.7-3YYM3Z[J_/.#2[AN?MAS?_*TM*NGVV2Y)X[NV'LE0@5W]$]D/ES>__7P -M?@'[P^$_OP_K6YX\B^M'^HU4]8KC4U>$7]1&NFX-EUM7S_^^TI9FU6O"Q7+M -M2+^1K-YYJ5[B6VU:U+5;=X+CM]IOUG"MX.#V=X=W@XP[O#PYG>'1[0\.[P<(9WAXV%>K=&?.,?G5_\27^/7-&`R_Q#W< -BDU_BXY!.-OP\2-;P2]S#F7Z)%_[IG=D7_P=,%9H/M&4````` +M'XL(",=Q+ED``VEM9RTQ>#$M-3$R+6=P="YV;61K+F]U=`"M7%V/W,81?/>O +MF,@/#A)DP5J2R^6#@-@Y&S""`(JEQ"]Y"#_C0^23N/SY +MZB]_/_#GMX?#Y8L%##Y*0I`IG!BK][D<'OP0[OA'PJA*MKYL.]?R%P+@*Y%5SY1$[)9)];W>^^",7SZ\O]&J;M/=6N +MRMVI#:8[E;.=N^HX'\M<-3F-$^"7[NKZT[_=U?"IN[W^>/ +M_]1YA"FQZN1?^`,>KO80I\'EOMPYF:'C\TMX7S4M)#IO:<\%/=TW7!SYQ''\!-7Y_T9\V\ZZYR_OKNY^NN[=3 +MFI^&5X%.OG;3!I[#NI:LIY!3G95^^_=_=E*_KP\Y>$VY>Q)S$]-[E +MT965QYHV<-Z*H\L+_VKZIVG!4R8%O).[?+@Y_/#C=(G[8KU]\_4/A#M/49/G +MM,`I9$IHE5.YY%\^/"W=Y>VW[I5/\MU/PWP&$JY>+C/OO.P#9O/H7X2J+?"^ +MB17^P+RS[JJY:]PWS:?A\.75U3=Q9QN?;#$_IJ4-'N6T0/OS>R[G5+AEIY>- +MGK>B[]M#TSUN-_&]?M4\TZ-_HQQE]?NU74_[:F' +M_=?PX6?"=[5O*MQ>80;_.KZ1PN<]S,4,BXJOJV[ +M_#PO[Z>AZ:>E3=B$&_WJCD^O(U3JP5M-Z.YR7[49]U.`R[/0`O+0RE8EBLM9 +MWE`:Z-#=?;A=%O9*^G'^\+/LI?VX>/216OU*P`7.>GVG[,'G6:YQA1CE"M!_ +MBF73[Q^GWS?WZSOY]9W$L]*HLQCU"NZ?$\3'Q^F>_%78B&>K49T8_9[JG7QK +M&\1S?%@]?M6`O$[#\;L`/7.-*L0H5W"IVI6A=O2L-.HL1KV"2]7N%&I'SU:C +M.C'Z7N8:58A1KN!2M:M#[>A9:=19C'H% +MEZI=$VI'SU:C.C'Z7JW1!J1\]6HSHQ^EW)CJ%V]!PURC\54KMB"Z[*0NWHF6M4(4:Y +M@DO4KF*_HV>E46E4:=Q:A7<*G:L=_1L]6H3HQ^5[+L=_0<-N4848Y0HN53OV.WI6&G46HU[!I6K'?D?/5J,Z,?I=R;+?T7/4 +M*/]$0@;R.@EWSD+MZ)EK5"%&N8)+U.[,?D?/2J/.8M0KN$3MSNQW]&PUJA.C +MWY4L^QT]1XWR3[74KMZ$8[^C9ZY1A1CE"BY5._8[>E8:=1:C7L&E:L=^1\]6 +MHSHQ^EW)LM_1<]0H_\3_/T%>I^'8[^B9:U0A1KF"2]6._8Z>E4:=Q:A7<*G: +ML=_1L]6H3HQ^5[+L=_0<-H0HQR!9>J'?L=/2N-.HM1 +MK^!2M6._HV>K49T8_:YDV>_H.6J4?^JD=MT67)V%VM$SUZA"C'(%EZA=S7Y' +MSTJCSF+4*[A$[6KV.WJV&M6)T>]*EOV.GJ-&^:=>:M=OPK'?T3/7J$*,<@67 +MJAW['3TKC3J+4:_@4K5COZ-GJU&=&/VN9-GOZ#EJE'\:I';#)AS['3USC2K$ +M*%=PJ=JQW]&STJBS&/4*+E4[]CMZMAK5B='O2I;]CIZC1OFG46HW;L*QW]$S +MUZA"C'(%EZH=^QT]*XTZBU&OX%*U8[^C9ZM1G1C]KF39[^@Y:E0FTS/(ZR1< +MDRVUBYZY1A5BE"NX1.V:T.^B9Z519S'J%5RB=DWH=]&SU:A.C'Y7LJ'?1<]1 +MHWS)A+_#)J75A'X'X>^@_!V$O\,F?]>$?@?A[Z#\'82_PR9_UX1^!^'OH/P= +MA+_;D6SH=Q#^#LK?0?@[;%):3>AW$/X.RM]!^#ML\G=-Z'<0_@[*WT'X.VSR +M=TWH=Q#^#LK?0?B['^@_!V$O\,F?]>$?@?A[Z#\'82_VY%LZ'<0_@[*WT'X.VQ26FT6:B?\'92_ +M@_!WV.3O6O8[X>^@_!V$O\,F?]>RWPE_!^7O(/S=CF39[X2_@_)W$/X.FY16 +MRWXG_!V4OX/P=]CD[UKV.^'OH/P=A+_#)G_7LM\)?P?E[R#\W8YDV>^$OX/R +M=Q#^#IN45LM^)_P=E+^#\'?8Y.]:]COA[Z#\'82_PR9_U[+?"7\'Y>\@_-V. +M9-GOA+^#\G<0_@Z;E%;+?B?\'92_@_!WV.3O6O8[X>^@_!V$O\,F?]>RWPE_ +M!^7O(/S=CF39[X2_@_)W$/X.FY16EX7:"7\'Y>\@_!TV^;N._4[X.RA_!^'O +ML,G?=>QWPM]!^3L(?[^@_!V$O\,FI=6QWPE_!^7O(/P=-OF[COU. +M^#LH?P?A[[#)WW7L=\+?0?D["'^W(UGV.^'OH/P=A+_#)J75L=\)?P?E[R#\ +M'3;YNX[]3O@[*'\'X>^PR=]U['?"WT'Y.PA_MR-9]COA[Z#\'82_PR:EU;'? +M"7\'Y>\@_!TV^;N._4[X.RA_!^'OL,G?=>QWPM]!^3L(?[^@_!V$ +MO\,FI=5GH7;"WT'Y.PA_ATW^KF>_$_X.RM]!^#ML\G<]^YWP=U#^#L+?[4B6 +M_4[X.RA_!^'OL$EI]>QWPM]!^3L(?X=-_JYGOQ/^#LK?0?@[;/)W/?N=\'=0 +M_@["W^U(EOU.^#LH?P?A[[!):?7L=\+?0?D["'^'3?ZN9[\3_@[*WT'X.VSR +M=SW[G?!W4/X.PM_M2);]3O@[*'\'X>^P26GU['?"WT'Y.PA_ATW^KF>_$_X. +MRM]!^#ML\G<]^YWP=U#^#L+?[4B6_4[X.RA_%\5TD-<"YY;?`#=D2^V>E)0_ +M\4^Q=N[)U0W6^L!QW`N8/YVNW^.8+K)GE_'YZ\.L7XPSCZ7JOPYP@3.N'^+\ +M7Y^DK$^3L?+])7(L[?^7B1OA)Q_L['B_25B/-W$WTEXOS=1%^).'\W +MT5+\W41?B3A_ +M-]%7(L[?3?25B/-W$WTEXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25B/-W$WTEXOS=1%^) +M.'\WT5#\W49?"<[?;?25X/S=1E\)SM]M])7@ +M_-U&7PG.WVWTE>#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U&7PG.WVWTE>#\ +MW49?"<[?;?25X/S=1E\)SM]M])7@_-U&7PG.WVWTE>#\W49?"<[?;?25X/S= +M1E\)SM]M])7@_-U&7PG.WVWTE>#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U& +M7PG.WVWTE8CS=WJ^2%^).'^GYXOTE8CS=WJ^2%^).'^GYXOTE8CS=Q-])>+\ +MW41?B3A_-]%7(L[?3?25B/-W$WTEXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25B/-W$WTE +MXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25X/S=1E^)P51?B<%47XG!5%^)P51?B<%47XG! +M5%^)P51?B<%47XG!5%^)P51?B<%47XG!5%^)P51?B<%47XG!5%^),'QV&9^_OF*N +MWW)WU<=_IP]7EGWK*(<'/N9:?K^_:[ +M[]V;KW]XY\'^<9_N?'OGL7-U[X;*0ZQ7AV?2???XZBCFVSL_KC;A\B3<5T]= +M;,5\>^>Q?P;NJ4<:KG@NZG/O!%[,MW?6*%7?NG/ISD=__]Z^2<*]7\&=C,^\ +M^EG;GZ3)9_N=W=,?>*Q$JN*._(_/A19//]('4M4KCL^=$7Y1&^FZ-5QN73W_?:4MS:I7AY/EJ4?Z +M0+)ZS5*]Q*?:M*BG+MT)CI]JOUG#M<;5FU7YB_#D\=_I`YVN#@]G>'5X.,.KP\.97AT>T/#J\'"&5X>',[PZ/)SIU5'X&T;:?8A[ +M.'_N]5/-:W\/_W)]UJ0_CJ?U_?AV7MA7JW1GSC'YT?_,A_C3FS$8?HA[N&<_ +@Q,9"LX8>XAS/]$"_\W3NS+_X/OKS-T+1E```` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu Wed May 31 07:49:49 2017 (r319294) +++ head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu Wed May 31 08:01:12 2017 (r319295) @@ -1,132 +1,132 @@ # $FreeBSD$ begin 644 img-63x255-4096-gpt.qcow.gz -M'XL(",8S(E0``VEM9RTV,W@R-34M-#`Y-BUG<'0N<6-O=RYO=70`K9W;;AS7 -MM47?_16ENT1)5*^UJJJK=$^`!,B;$YSS=@Z0NCX&G7=]?-CDOI"KY]2*(=J$ -M(4.HB>ZMP4'9'MX\'.[^:)I.FK9OVK'9Y^;F[].'-/?^YN%'\^/O?_W;]?T_ -M?OQV-R:'GSSE_K[51M/<@ZT_-V5.ST\MS6'\+^9N/@3-W7MU]@=>W;TW>SEW -M]=O=F\7/*1NT!X--FCNDUR?D]-K_[O5]=V]7[D[O\=ZNDK?;L<'^P>#O:>Z? -MZ?4I>;M'-C<\F#NYMZOD[8YL;OHI+$I@F=G<$LRU\*F5S6W!7`>?VO&<_.37 -M]FZNAT\)FX.?M]=-F3O"IXS-M0_F#M<9Z#PWP*<(=Q)R-\*G"'<2,.PNY0[XSQIV%W"'?&>/.0NZ0[XQQ9R%WR'?&N+.0.^0[ -M8]RU(7?(=RWCK@VY0[YK&7=MQ)WBIPAW;<2=(M^UC+LVXDZ1[UK&71MQI\AW -M+>.NC;A3Y+N6<==&W"GR7*?-XZT/ND.]ZQET?.NC[@S -MY+N><7>,N#/DNR/C[AAQ9\AW1\;=,>0.^>[(N#N&W"'?'1EWQY`[Y+LCX^X8 -MZFB+L. -M^6YBW$T1=QWRW<2XFR+N.N2[B7$W1=QUR'<3XR[_9T@^AWPW,^[FB+L.^6YF -MW,TA=\AW,^-N#KE#OIL9=W/('?+=S+B;0^Z0[V;&W1QRAWPW,^[FD#ODNYEQ -MMX3<(=\MC+LEY`[Y;F'<+1%W/7Z*<+=$W/7(=POC;HFXZY'O%L;=$G'7(]\M -MC+LEXJY'OEL8=TO$78]\MS#NUHB['OEN9=RM$7<]\MW*N%M#[I#O5L;=&G*' -M?+\VQMT6 -M<7=$OML8=WO$W1'Y;F?<[1%W1^2[G7&WA]PAW^V,NSWD#OEN9]SM(7?(=SOC -M;@^Y0[[;&7=[R!WRWLOY.POQN`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?# Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C73AFBB69; Wed, 31 May 2017 09:55:15 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BC1716E2; Wed, 31 May 2017 09:55:13 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 4fa48992; Wed, 31 May 2017 11:48:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=OBbIHgY/ykD9q8G2B5hpzzlc0/8=; b=mnaAQfr+CYLNOPPYutiqqtbZuNEP nHMtRKHMgtqRk2lxyJcFBve5G+hwhHPITDwV5LyVRkYwUomWsE7e5fNWTC75/Gyz qOM6FMRQyxLredKPsODE2JZECfgtcTyPnUMSuS429YNeiErWCL76dfkoaABdtUNl t1IhtA9XeACJ3Sc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=d7Y9ILpnqtakp2T2JbT32EWEInM6PCjF5yqg3uAntRTMq3a02juumFgC mo+U+D6afn74FIuKFnO9plmDdGyF/a70l6ksrgC6h56EfJaVwj7/mI72E4JWbZ7e wO1DP0bGu2SOWZ2DQVwvDGybqWZfrPvLY2+5zS8ybx83Lpyt8jo= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 2cc055a3 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 31 May 2017 11:48:30 +0200 (CEST) Date: Wed, 31 May 2017 11:48:29 +0200 From: Emmanuel Vadot To: "Ngie Cooper (yaneurabeya)" Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319125 - head/usr.bin/mkimg Message-Id: <20170531114829.28359de76187bdd184746b5a@bidouilliste.com> In-Reply-To: References: <201705291251.v4TCp24h090283@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 09:55:15 -0000 On Wed, 31 May 2017 00:20:45 -0700 "Ngie Cooper (yaneurabeya)" wrote: > > > On May 29, 2017, at 05:51, Emmanuel Vadot wrote: > > > > Author: manu > > Date: Mon May 29 12:51:02 2017 > > New Revision: 319125 > > URL: https://svnweb.freebsd.org/changeset/base/319125 > > > > Log: > > mkimg: Correct an off by one error in the PMBR size > > > > The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec > > 2.6 page 118 table 17). > > This fixes warning printed by linux tools like parted or fdisk. > > This commit broke all of the mkimg gpt tests. For example: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/3280/testReport/junit/usr.bin.mkimg/mkimg_test/gpt_1x1_4096_qcow/ . > -Ngie Sorry about that and thanks for the fix. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed May 31 10:01:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E519AFBD7C; Wed, 31 May 2017 10:01:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C9897191A; Wed, 31 May 2017 10:01:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VA1Fk8057009; Wed, 31 May 2017 10:01:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VA1FwI057008; Wed, 31 May 2017 10:01:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311001.v4VA1FwI057008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 10:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319312 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 10:01:16 -0000 Author: hselasky Date: Wed May 31 10:01:15 2017 New Revision: 319312 URL: https://svnweb.freebsd.org/changeset/base/319312 Log: Make sure the thread's priority is restored for all three cases inside linux_synchronize_rcu_cb() in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Wed May 31 09:25:47 2017 (r319311) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Wed May 31 10:01:15 2017 (r319312) @@ -236,7 +236,6 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, c if (record->cpuid == PCPU_GET(cpuid)) { bool is_sleeping = 0; u_char prio = 0; - u_char old_prio; /* * Find the lowest priority or sleeping thread which @@ -255,13 +254,10 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, c pause("W", 1); thread_lock(td); } else { - old_prio = td->td_priority; /* set new thread priority */ sched_prio(td, prio); /* task switch */ mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - /* restore thread priority */ - sched_prio(td, old_prio); } } else { /* @@ -282,6 +278,7 @@ linux_synchronize_rcu(void) int was_bound; int old_cpu; int old_pinned; + u_char old_prio; if (RCU_SKIP()) return; @@ -301,6 +298,7 @@ linux_synchronize_rcu(void) old_cpu = PCPU_GET(cpuid); old_pinned = td->td_pinned; + old_prio = td->td_priority; td->td_pinned = 0; was_bound = sched_is_bound(td); sched_bind(td, old_cpu); @@ -319,6 +317,9 @@ linux_synchronize_rcu(void) } /* restore pinned after bind */ td->td_pinned = old_pinned; + + /* restore thread priority */ + sched_prio(td, old_prio); thread_unlock(td); PICKUP_GIANT(); From owner-svn-src-head@freebsd.org Wed May 31 12:03:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9DFBAFF25D; Wed, 31 May 2017 12:03:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 823C575A7E; Wed, 31 May 2017 12:03:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VC2x5k007001; Wed, 31 May 2017 12:02:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VC2xod006998; Wed, 31 May 2017 12:02:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311202.v4VC2xod006998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 12:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319316 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 12:03:00 -0000 Author: hselasky Date: Wed May 31 12:02:59 2017 New Revision: 319316 URL: https://svnweb.freebsd.org/changeset/base/319316 Log: Fixes for refcounting "struct linux_file" in the LinuxKPI. - Allow "struct linux_file" to be refcounted when its "_file" member is NULL by using its "f_count" field. The reference counts are transferred to the file structure when the file descriptor is installed. - Add missing vdrop() calls for error cases during open(). - Set the "_file" member of "struct linux_file" during open. This allows use of refcounting through get_file() and fput() with LinuxKPI character devices. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/file.h head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/file.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/file.h Wed May 31 10:32:13 2017 (r319315) +++ head/sys/compat/linuxkpi/common/include/linux/file.h Wed May 31 12:02:59 2017 (r319316) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,19 +60,24 @@ linux_fget(unsigned int fd) return (struct linux_file *)file->f_data; } +extern void linux_file_free(struct linux_file *filp); + static inline void fput(struct linux_file *filp) { - if (filp->_file == NULL) { - kfree(filp); - return; + if (refcount_release(filp->_file == NULL ? + &filp->f_count : &filp->_file->f_count)) { + linux_file_free(filp); } - if (refcount_release(&filp->_file->f_count)) { - _fdrop(filp->_file, curthread); - kfree(filp); - } } +static inline unsigned int +file_count(struct linux_file *filp) +{ + return (filp->_file == NULL ? + filp->f_count : filp->_file->f_count); +} + static inline void put_unused_fd(unsigned int fd) { @@ -106,6 +111,10 @@ fd_install(unsigned int fd, struct linux_file *filp) } else { filp->_file = file; finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); + + /* transfer reference count from "filp" to "file" */ + while (refcount_release(&filp->f_count) == 0) + refcount_acquire(&file->f_count); } /* drop the extra reference */ @@ -150,6 +159,8 @@ alloc_file(int mode, const struct file_operations *fop filp = kzalloc(sizeof(*filp), GFP_KERNEL); if (filp == NULL) return (NULL); + + filp->f_count = 1; filp->f_op = fops; filp->f_mode = mode; @@ -171,7 +182,7 @@ static inline struct fd fdget(unsigned int fd) return (struct fd){f}; } -#define file linux_file -#define fget linux_fget +#define file linux_file +#define fget(...) linux_fget(__VA_ARGS__) #endif /* _LINUX_FILE_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Wed May 31 10:32:13 2017 (r319315) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Wed May 31 12:02:59 2017 (r319316) @@ -79,6 +79,7 @@ struct linux_file { struct selinfo f_selinfo; struct sigio *f_sigio; struct vnode *f_vnode; + volatile u_int f_count; }; #define file linux_file @@ -218,6 +219,14 @@ iminor(struct inode *inode) { return (minor(dev2unit(inode->v_rdev))); +} + +static inline struct linux_file * +get_file(struct linux_file *f) +{ + + refcount_acquire(f->_file == NULL ? &f->f_count : &f->_file->f_count); + return (f); } static inline struct inode * Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 10:32:13 2017 (r319315) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 12:02:59 2017 (r319316) @@ -401,6 +401,20 @@ linux_file_dtor(void *cdp) kfree(filp); } +void +linux_file_free(struct linux_file *filp) +{ + if (filp->_file == NULL) { + kfree(filp); + } else { + /* + * The close method of the character device or file + * will free the linux_file structure: + */ + _fdrop(filp->_file, curthread); + } +} + static int linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) @@ -593,9 +607,12 @@ linux_dev_open(struct cdev *dev, int oflags, int devty vhold(file->f_vnode); filp->f_vnode = file->f_vnode; linux_set_current(td); + filp->_file = file; + if (filp->f_op->open) { error = -filp->f_op->open(file->f_vnode, filp); if (error) { + vdrop(filp->f_vnode); kfree(filp); goto done; } @@ -603,6 +620,7 @@ linux_dev_open(struct cdev *dev, int oflags, int devty error = devfs_set_cdevpriv(filp, linux_file_dtor); if (error) { filp->f_op->release(file->f_vnode, filp); + vdrop(filp->f_vnode); kfree(filp); } done: @@ -622,8 +640,7 @@ linux_dev_close(struct cdev *dev, int fflag, int devty if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; - devfs_clear_cdevpriv(); - + devfs_clear_cdevpriv(); return (0); } From owner-svn-src-head@freebsd.org Wed May 31 12:08:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD920AFF36B; Wed, 31 May 2017 12:08:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E00775CAD; Wed, 31 May 2017 12:08:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VC8Pih007327; Wed, 31 May 2017 12:08:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VC8PmK007326; Wed, 31 May 2017 12:08:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311208.v4VC8PmK007326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 12:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319317 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 12:08:26 -0000 Author: hselasky Date: Wed May 31 12:08:25 2017 New Revision: 319317 URL: https://svnweb.freebsd.org/changeset/base/319317 Log: Fix a reference count leak in the LinuxKPI due to calling VM open when it shouldn't be called. Background: The Linux VM open operation is called when a new VMA is created on top of the current VMA. This is done through either mremap flow or split_vma, usually due to mlock, madvise, munmap and so on. This is currently not supported by the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 12:02:59 2017 (r319316) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 12:08:25 2017 (r319317) @@ -547,20 +547,9 @@ static int linux_cdev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color) { - const struct vm_operations_struct *vm_ops; - struct vm_area_struct *vmap; - vmap = linux_cdev_handle_find(handle); - MPASS(vmap != NULL); - + MPASS(linux_cdev_handle_find(handle) != NULL); *color = 0; - - down_write(&vmap->vm_mm->mmap_sem); - vm_ops = vmap->vm_ops; - if (likely(vm_ops != NULL)) - vm_ops->open(vmap); - up_write(&vmap->vm_mm->mmap_sem); - return (0); } From owner-svn-src-head@freebsd.org Wed May 31 13:01:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80A86B795D2; Wed, 31 May 2017 13:01:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51098776E4; Wed, 31 May 2017 13:01:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VD1R2q028899; Wed, 31 May 2017 13:01:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VD1ReD028897; Wed, 31 May 2017 13:01:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311301.v4VD1ReD028897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 13:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319318 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 13:01:28 -0000 Author: hselasky Date: Wed May 31 13:01:27 2017 New Revision: 319318 URL: https://svnweb.freebsd.org/changeset/base/319318 Log: Don't acquire a reference on the VM-space when allocating the LinuxKPI task structure to avoid deadlock when tearing down the VM object during a process exit. Found by: markj @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h head/sys/compat/linuxkpi/common/src/linux_current.c head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm_types.h Wed May 31 12:08:25 2017 (r319317) +++ head/sys/compat/linuxkpi/common/include/linux/mm_types.h Wed May 31 13:01:27 2017 (r319318) @@ -38,11 +38,9 @@ struct vm_area_struct; struct task_struct; -struct vmspace; struct mm_struct { struct vm_area_struct *mmap; - struct vmspace *vmspace; atomic_t mm_count; atomic_t mm_users; size_t pinned_vm; Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Wed May 31 12:08:25 2017 (r319317) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Wed May 31 13:01:27 2017 (r319318) @@ -96,7 +96,6 @@ linux_alloc_current(struct thread *td, int flags) init_rwsem(&mm->mmap_sem); atomic_set(&mm->mm_count, 1); atomic_set(&mm->mm_users, 1); - mm->vmspace = vmspace_acquire_ref(proc); /* set mm_struct pointer */ ts->mm = mm; /* clear pointer to not free memory */ @@ -119,7 +118,7 @@ linux_get_task_mm(struct task_struct *task) struct mm_struct *mm; mm = task->mm; - if (mm != NULL && mm->vmspace != NULL) { + if (mm != NULL) { atomic_inc(&mm->mm_users); return (mm); } @@ -129,8 +128,6 @@ linux_get_task_mm(struct task_struct *task) void linux_mm_dtor(struct mm_struct *mm) { - if (mm->vmspace != NULL) - vmspace_free(mm->vmspace); free(mm, M_LINUX_CURRENT); } Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Wed May 31 12:08:25 2017 (r319317) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Wed May 31 13:01:27 2017 (r319318) @@ -268,7 +268,7 @@ get_user_pages_remote(struct task_struct *task, struct { vm_map_t map; - map = &mm->vmspace->vm_map; + map = &task->task_thread->td_proc->p_vmspace->vm_map; return (linux_get_user_pages_internal(map, start, nr_pages, !!(gup_flags & FOLL_WRITE), pages)); } From owner-svn-src-head@freebsd.org Wed May 31 13:05:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F59B796A7; Wed, 31 May 2017 13:05:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8C6977AEA; Wed, 31 May 2017 13:05:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VD5tBd032059; Wed, 31 May 2017 13:05:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VD5tSb032058; Wed, 31 May 2017 13:05:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311305.v4VD5tSb032058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 13:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319319 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 13:05:56 -0000 Author: hselasky Date: Wed May 31 13:05:54 2017 New Revision: 319319 URL: https://svnweb.freebsd.org/changeset/base/319319 Log: Remove the VMA handle from its list before calling the LinuxKPI VMA close operation to prevent other threads from reusing the VM object handle pointer. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 13:01:27 2017 (r319318) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 13:05:54 2017 (r319319) @@ -486,6 +486,15 @@ static struct rwlock linux_vma_lock; static TAILQ_HEAD(, vm_area_struct) linux_vma_head = TAILQ_HEAD_INITIALIZER(linux_vma_head); +static void +linux_cdev_handle_free(struct vm_area_struct *vmap) +{ + /* Drop reference on mm_struct */ + mmput(vmap->vm_mm); + + kfree(vmap); +} + static struct vm_area_struct * linux_cdev_handle_insert(void *handle, struct vm_area_struct *vmap) { @@ -495,20 +504,10 @@ linux_cdev_handle_insert(void *handle, struct vm_area_ TAILQ_FOREACH(ptr, &linux_vma_head, vm_entry) { if (ptr->vm_private_data == handle) { rw_wunlock(&linux_vma_lock); - kfree(vmap); + linux_cdev_handle_free(vmap); return (NULL); } } - /* - * The same VM object might be shared by multiple processes - * and the mm_struct is usually freed when a process exits. - * - * The atomic reference below makes sure the mm_struct is - * available as long as the vmap is in the linux_vma_head. - */ - if (atomic_inc_not_zero(&vmap->vm_mm->mm_users) == 0) - panic("linuxkpi: mm_users is zero\n"); - TAILQ_INSERT_TAIL(&linux_vma_head, vmap, vm_entry); rw_wunlock(&linux_vma_lock); return (vmap); @@ -517,16 +516,9 @@ linux_cdev_handle_insert(void *handle, struct vm_area_ static void linux_cdev_handle_remove(struct vm_area_struct *vmap) { - if (vmap == NULL) - return; - rw_wlock(&linux_vma_lock); TAILQ_REMOVE(&linux_vma_head, vmap, vm_entry); rw_wunlock(&linux_vma_lock); - - /* Drop reference on mm_struct */ - mmput(vmap->vm_mm); - kfree(vmap); } static struct vm_area_struct * @@ -562,13 +554,19 @@ linux_cdev_pager_dtor(void *handle) vmap = linux_cdev_handle_find(handle); MPASS(vmap != NULL); + /* + * Remove handle before calling close operation to prevent + * other threads from reusing the handle pointer. + */ + linux_cdev_handle_remove(vmap); + down_write(&vmap->vm_mm->mmap_sem); vm_ops = vmap->vm_ops; if (likely(vm_ops != NULL)) vm_ops->close(vmap); up_write(&vmap->vm_mm->mmap_sem); - linux_cdev_handle_remove(vmap); + linux_cdev_handle_free(vmap); } static struct cdev_pager_ops linux_cdev_pager_ops = { @@ -895,6 +893,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * vm_size_t size, struct vm_object **object, int nprot) { struct vm_area_struct *vmap; + struct mm_struct *mm; struct linux_file *filp; struct thread *td; struct file *file; @@ -914,6 +913,17 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * linux_set_current(td); + /* + * The same VM object might be shared by multiple processes + * and the mm_struct is usually freed when a process exits. + * + * The atomic reference below makes sure the mm_struct is + * available as long as the vmap is in the linux_vma_head. + */ + mm = current->mm; + if (atomic_inc_not_zero(&mm->mm_users) == 0) + return (EINVAL); + vmap = kzalloc(sizeof(*vmap), GFP_KERNEL); vmap->vm_start = 0; vmap->vm_end = size; @@ -922,7 +932,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * vmap->vm_flags = vmap->vm_page_prot = nprot; vmap->vm_ops = NULL; vmap->vm_file = filp; - vmap->vm_mm = current->mm; + vmap->vm_mm = mm; if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { error = EINTR; @@ -932,7 +942,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * } if (error != 0) { - kfree(vmap); + linux_cdev_handle_free(vmap); return (error); } @@ -945,7 +955,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * vmap->vm_ops->open == NULL || vmap->vm_ops->close == NULL || vmap->vm_private_data == NULL) { - kfree(vmap); + linux_cdev_handle_free(vmap); return (EINVAL); } @@ -958,6 +968,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * if (*object == NULL) { linux_cdev_handle_remove(vmap); + linux_cdev_handle_free(vmap); return (EINVAL); } } else { @@ -969,7 +980,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * *object = vm_pager_allocate(OBJT_SG, sg, vmap->vm_len, nprot, 0, curthread->td_ucred); - kfree(vmap); + linux_cdev_handle_free(vmap); if (*object == NULL) { sglist_free(sg); From owner-svn-src-head@freebsd.org Wed May 31 13:07:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5979CB7972E; Wed, 31 May 2017 13:07:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2809977C40; Wed, 31 May 2017 13:07:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VD75tM032208; Wed, 31 May 2017 13:07:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VD75jr032207; Wed, 31 May 2017 13:07:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311307.v4VD75jr032207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 13:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319320 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 13:07:06 -0000 Author: hselasky Date: Wed May 31 13:07:05 2017 New Revision: 319320 URL: https://svnweb.freebsd.org/changeset/base/319320 Log: Make sure the VMAP's "vm_file" field is referenced in a Linux compatible way by the linux_dev_mmap_single() function in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 13:05:54 2017 (r319319) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 13:07:05 2017 (r319320) @@ -489,6 +489,10 @@ static TAILQ_HEAD(, vm_area_struct) linux_vma_head = static void linux_cdev_handle_free(struct vm_area_struct *vmap) { + /* Drop reference on vm_file */ + if (vmap->vm_file != NULL) + fput(vmap->vm_file); + /* Drop reference on mm_struct */ mmput(vmap->vm_mm); @@ -931,7 +935,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * vmap->vm_pfn = 0; vmap->vm_flags = vmap->vm_page_prot = nprot; vmap->vm_ops = NULL; - vmap->vm_file = filp; + vmap->vm_file = get_file(filp); vmap->vm_mm = mm; if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { From owner-svn-src-head@freebsd.org Wed May 31 13:11:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 403FEB79D04; Wed, 31 May 2017 13:11:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F017787E5; Wed, 31 May 2017 13:11:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VDB7nb037219; Wed, 31 May 2017 13:11:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VDB7Ug037218; Wed, 31 May 2017 13:11:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311311.v4VDB7Ug037218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 13:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319321 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 13:11:08 -0000 Author: hselasky Date: Wed May 31 13:11:06 2017 New Revision: 319321 URL: https://svnweb.freebsd.org/changeset/base/319321 Log: Properly set the .d_name field in the cdevsw structure for the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 13:07:05 2017 (r319320) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 13:11:06 2017 (r319321) @@ -1011,6 +1011,7 @@ struct cdevsw linuxcdevsw = { .d_ioctl = linux_dev_ioctl, .d_mmap_single = linux_dev_mmap_single, .d_poll = linux_dev_poll, + .d_name = "lkpidev", }; static int From owner-svn-src-head@freebsd.org Wed May 31 14:53:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BCCFB7BF33; Wed, 31 May 2017 14:53:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFB8D7D882; Wed, 31 May 2017 14:53:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VErobj081900; Wed, 31 May 2017 14:53:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VEroTW081899; Wed, 31 May 2017 14:53:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201705311453.v4VEroTW081899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 31 May 2017 14:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319336 - head/usr.sbin/bootparamd/bootparamd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 14:53:51 -0000 Author: asomers Date: Wed May 31 14:53:50 2017 New Revision: 319336 URL: https://svnweb.freebsd.org/changeset/base/319336 Log: Fix uninitialized variable in bootparamd.c Restore line that was accidentally deleted in change 318790 Reported by: Coverity CID: 1375855 MFC after: 1 week X-MFC-With: 318790 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/bootparamd/bootparamd/bootparamd.c Modified: head/usr.sbin/bootparamd/bootparamd/bootparamd.c ============================================================================== --- head/usr.sbin/bootparamd/bootparamd/bootparamd.c Wed May 31 13:44:54 2017 (r319335) +++ head/usr.sbin/bootparamd/bootparamd/bootparamd.c Wed May 31 14:53:50 2017 (r319336) @@ -254,6 +254,7 @@ int blen; info of the file */ if (match) { + fid_len = strlen(fileid); #define AS_FORMAT(d) "%" #d "s" #define REXPAND(d) AS_FORMAT(d) /* Force another preprocessor expansion */ while ( ! res && (fscanf(bpf, REXPAND(INFOLEN), info)) > 0) { From owner-svn-src-head@freebsd.org Wed May 31 14:59:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2F8B7C4ED; Wed, 31 May 2017 14:59:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4807EE20; Wed, 31 May 2017 14:59:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VEx4Jv084971; Wed, 31 May 2017 14:59:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VEx4Bm084970; Wed, 31 May 2017 14:59:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201705311459.v4VEx4Bm084970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 31 May 2017 14:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319337 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 14:59:05 -0000 Author: asomers Date: Wed May 31 14:59:03 2017 New Revision: 319337 URL: https://svnweb.freebsd.org/changeset/base/319337 Log: Fix integer overflow in "camcontrol format" Reported by: Coverity CID: 1011426 MFC after: 1 week Sponsored by: Spectra Logic Corp Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed May 31 14:53:50 2017 (r319336) +++ head/sbin/camcontrol/camcontrol.c Wed May 31 14:59:03 2017 (r319337) @@ -6221,15 +6221,15 @@ doreport: if ((scsi_get_sks(sense, ccb->csio.sense_len - ccb->csio.sense_resid, sks) == 0) && (quiet == 0)) { - int val; + uint32_t val; u_int64_t percentage; val = scsi_2btoul(&sks[1]); - percentage = 10000 * val; + percentage = 10000ull * val; fprintf(stdout, "\rFormatting: %ju.%02u %% " - "(%d/%d) done", + "(%u/%d) done", (uintmax_t)(percentage / (0x10000 * 100)), (unsigned)((percentage / From owner-svn-src-head@freebsd.org Wed May 31 15:05:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89739B7C724; Wed, 31 May 2017 15:05:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 572627F2EF; Wed, 31 May 2017 15:05:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VF5ij4089205; Wed, 31 May 2017 15:05:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VF5i1I089203; Wed, 31 May 2017 15:05:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311505.v4VF5i1I089203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 15:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319338 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 15:05:45 -0000 Author: hselasky Date: Wed May 31 15:05:44 2017 New Revision: 319338 URL: https://svnweb.freebsd.org/changeset/base/319338 Log: Implement in_atomic() function in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kthread.h Wed May 31 14:59:03 2017 (r319337) +++ head/sys/compat/linuxkpi/common/include/linux/kthread.h Wed May 31 15:05:44 2017 (r319338) @@ -48,10 +48,15 @@ __task; \ }) +#define in_atomic() ({ \ + linux_in_atomic(); \ +}) + extern int kthread_stop(struct task_struct *); extern bool kthread_should_stop_task(struct task_struct *); extern bool kthread_should_stop(void); extern void linux_kthread_fn(void *); extern struct task_struct *linux_kthread_setup_and_run(struct thread *, linux_task_fn_t *, void *arg); +extern int linux_in_atomic(void); #endif /* _LINUX_KTHREAD_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 14:59:03 2017 (r319337) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 31 15:05:44 2017 (r319338) @@ -73,8 +73,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include +#include #include #include #include @@ -1677,6 +1678,13 @@ linux_on_each_cpu(void callback(void *), void *data) smp_rendezvous(smp_no_rendezvous_barrier, callback, smp_no_rendezvous_barrier, data); return (0); +} + +int +linux_in_atomic(void) +{ + + return ((curthread->td_pflags & TDP_NOFAULTING) != 0); } struct linux_cdev * From owner-svn-src-head@freebsd.org Wed May 31 16:07:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FCD9B7D713; Wed, 31 May 2017 16:07:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2EC81505; Wed, 31 May 2017 16:07:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VG7WmC015052; Wed, 31 May 2017 16:07:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VG7WcO015049; Wed, 31 May 2017 16:07:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201705311607.v4VG7WcO015049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 31 May 2017 16:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319339 - in head/bin/dd: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 16:07:33 -0000 Author: asomers Date: Wed May 31 16:07:32 2017 New Revision: 319339 URL: https://svnweb.freebsd.org/changeset/base/319339 Log: Fix integer overflow detection in dd dd(1) tried to detect whether the seek offset would overflow, but it failed to account for the case where the provided argument was negative and the file was a regular file (negative seeks are allowed for character devices). I fixed it, and added a regression test. Reported by: Coverity CID: 1368659 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Added: head/bin/dd/tests/dd2_test.sh (contents, props changed) Modified: head/bin/dd/position.c head/bin/dd/tests/Makefile Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Wed May 31 15:05:44 2017 (r319338) +++ head/bin/dd/position.c Wed May 31 16:07:32 2017 (r319339) @@ -70,7 +70,7 @@ seek_offset(IO *io) * * Bail out if the calculation of a file offset would overflow. */ - if ((io->flags & ISCHR) == 0 && n > OFF_MAX / (ssize_t)sz) + if ((io->flags & ISCHR) == 0 && (n < 0 || n > OFF_MAX / (ssize_t)sz)) errx(1, "seek offsets cannot be larger than %jd", (intmax_t)OFF_MAX); else if ((io->flags & ISCHR) != 0 && (uint64_t)n > UINT64_MAX / sz) Modified: head/bin/dd/tests/Makefile ============================================================================== --- head/bin/dd/tests/Makefile Wed May 31 15:05:44 2017 (r319338) +++ head/bin/dd/tests/Makefile Wed May 31 16:07:32 2017 (r319339) @@ -1,5 +1,10 @@ # $FreeBSD$ +.include + +.PATH: ${.CURDIR}/.. + +ATF_TESTS_SH= dd2_test NETBSD_ATF_TESTS_SH= dd_test .include Added: head/bin/dd/tests/dd2_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/dd/tests/dd2_test.sh Wed May 31 16:07:32 2017 (r319339) @@ -0,0 +1,50 @@ +# +# Copyright (c) 2017 Spectra Logic Corporation +# 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ + + +atf_test_case seek_overflow +seek_overflow_head() { + atf_set "descr" "dd(1) should reject too-large seek values" +} +seek_overflow_body() { + touch f.in + # Positive tests + seek=`echo "2^63 / 4096 - 1" | bc` + atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek + + # Negative tests + seek=`echo "2^63 / 4096" | bc` + atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ + dd if=f.in of=f.out bs=4096 seek=$seek + atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ + dd if=f.in of=f.out bs=4096 seek=-1 +} + +atf_init_test_cases() +{ + atf_add_test_case seek_overflow +} From owner-svn-src-head@freebsd.org Wed May 31 16:08:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7893CB7D798; Wed, 31 May 2017 16:08:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2EA8164F; Wed, 31 May 2017 16:08:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VG8UpP015136; Wed, 31 May 2017 16:08:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VG8Uuk015134; Wed, 31 May 2017 16:08:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311608.v4VG8Uuk015134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 16:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319340 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 16:08:31 -0000 Author: hselasky Date: Wed May 31 16:08:30 2017 New Revision: 319340 URL: https://svnweb.freebsd.org/changeset/base/319340 Log: Properly implement idr_preload() and idr_preload_end() in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/idr.h head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/include/linux/idr.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/idr.h Wed May 31 16:07:32 2017 (r319339) +++ head/sys/compat/linuxkpi/common/include/linux/idr.h Wed May 31 16:08:30 2017 (r319340) @@ -75,9 +75,8 @@ struct idr { SYSINIT(name##_ida_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, \ ida_init, &(name)) -#define idr_preload(x) do { } while (0) -#define idr_preload_end() do { } while (0) - +void idr_preload(gfp_t gfp_mask); +void idr_preload_end(void); void *idr_find(struct idr *idp, int id); void *idr_get_next(struct idr *idp, int *nextid); int idr_pre_get(struct idr *idp, gfp_t gfp_mask); Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 31 16:07:32 2017 (r319339) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 31 16:08:30 2017 (r319340) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,17 @@ __FBSDID("$FreeBSD$"); #include #include +#define MAX_IDR_LEVEL ((MAX_IDR_SHIFT + IDR_BITS - 1) / IDR_BITS) +#define MAX_IDR_FREE (MAX_IDR_LEVEL * 2) + +struct linux_idr_cache { + spinlock_t lock; + struct idr_layer *head; + unsigned count; +}; + +static DPCPU_DEFINE(struct linux_idr_cache, linux_idr_cache); + /* * IDR Implementation. * @@ -55,6 +66,96 @@ __FBSDID("$FreeBSD$"); */ static MALLOC_DEFINE(M_IDR, "idr", "Linux IDR compat"); +static struct idr_layer * +idr_preload_dequeue_locked(struct linux_idr_cache *lic) +{ + struct idr_layer *retval; + + /* check if wrong thread is trying to dequeue */ + if (mtx_owned(&lic->lock.m) == 0) + return (NULL); + + retval = lic->head; + if (likely(retval != NULL)) { + lic->head = retval->ary[0]; + lic->count--; + retval->ary[0] = NULL; + } + return (retval); +} + +static void +idr_preload_init(void *arg) +{ + int cpu; + + CPU_FOREACH(cpu) { + struct linux_idr_cache *lic = + DPCPU_ID_PTR(cpu, linux_idr_cache); + + spin_lock_init(&lic->lock); + } +} +SYSINIT(idr_preload_init, SI_SUB_LOCK, SI_ORDER_FIRST, idr_preload_init, NULL); + +static void +idr_preload_uninit(void *arg) +{ + int cpu; + + CPU_FOREACH(cpu) { + struct idr_layer *cacheval; + struct linux_idr_cache *lic = + DPCPU_ID_PTR(cpu, linux_idr_cache); + + while (1) { + spin_lock(&lic->lock); + cacheval = idr_preload_dequeue_locked(lic); + spin_unlock(&lic->lock); + + if (cacheval == NULL) + break; + free(cacheval, M_IDR); + } + spin_lock_destroy(&lic->lock); + } +} +SYSUNINIT(idr_preload_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, idr_preload_uninit, NULL); + +void +idr_preload(gfp_t gfp_mask) +{ + struct linux_idr_cache *lic; + struct idr_layer *cacheval; + + sched_pin(); + + lic = &DPCPU_GET(linux_idr_cache); + + /* fill up cache */ + spin_lock(&lic->lock); + while (lic->count < MAX_IDR_FREE) { + spin_unlock(&lic->lock); + cacheval = malloc(sizeof(*cacheval), M_IDR, M_ZERO | gfp_mask); + spin_lock(&lic->lock); + if (cacheval == NULL) + break; + cacheval->ary[0] = lic->head; + lic->head = cacheval; + lic->count++; + } +} + +void +idr_preload_end(void) +{ + struct linux_idr_cache *lic; + + lic = &DPCPU_GET(linux_idr_cache); + spin_unlock(&lic->lock); + sched_unpin(); +} + static inline int idr_max(struct idr *idr) { @@ -280,20 +381,32 @@ idr_pre_get(struct idr *idr, gfp_t gfp_mask) return (1); } -static inline struct idr_layer * -idr_get(struct idr *idr) +static struct idr_layer * +idr_free_list_get(struct idr *idp) { struct idr_layer *il; - il = idr->free; - if (il) { - idr->free = il->ary[0]; + if ((il = idp->free) != NULL) { + idp->free = il->ary[0]; il->ary[0] = NULL; - return (il); } - il = malloc(sizeof(*il), M_IDR, M_ZERO | M_NOWAIT); - if (il != NULL) + return (il); +} + +static inline struct idr_layer * +idr_get(struct idr *idp) +{ + struct idr_layer *il; + + if ((il = idr_free_list_get(idp)) != NULL) { + MPASS(il->bitmap != 0); + } else if ((il = malloc(sizeof(*il), M_IDR, M_ZERO | M_NOWAIT)) != NULL) { bitmap_fill(&il->bitmap, IDR_SIZE); + } else if ((il = idr_preload_dequeue_locked(&DPCPU_GET(linux_idr_cache))) != NULL) { + bitmap_fill(&il->bitmap, IDR_SIZE); + } else { + return (NULL); + } return (il); } From owner-svn-src-head@freebsd.org Wed May 31 16:24:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69B0FB7DDCB; Wed, 31 May 2017 16:24:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A33D82232; Wed, 31 May 2017 16:24:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VGO2NE023169; Wed, 31 May 2017 16:24:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VGO2Th023168; Wed, 31 May 2017 16:24:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705311624.v4VGO2Th023168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 16:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319341 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 16:24:03 -0000 Author: hselasky Date: Wed May 31 16:24:02 2017 New Revision: 319341 URL: https://svnweb.freebsd.org/changeset/base/319341 Log: Implement print_hex_dump(), print_hex_dump_bytes() and printk_ratelimited() in the LinuxKPI. While at it fix the inclusion guard of printk.h to be similar to the rest of the LinuxKPI header files. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/printk.h Wed May 31 16:08:30 2017 (r319340) +++ head/sys/compat/linuxkpi/common/include/linux/printk.h Wed May 31 16:24:02 2017 (r319341) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,9 +28,11 @@ * * $FreeBSD$ */ -#ifndef _FBSD_PRINTK_H_ -#define _FBSD_PRINTK_H_ +#ifndef _LINUX_PRINTK_H_ +#define _LINUX_PRINTK_H_ +#include + /* GID printing macros */ #define GID_PRINT_FMT "%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x" #define GID_PRINT_ARGS(gid_raw) htons(((u16 *)gid_raw)[0]), htons(((u16 *)gid_raw)[1]),\ @@ -38,4 +40,76 @@ htons(((u16 *)gid_raw)[4]), htons(((u16 *)gid_raw)[5]),\ htons(((u16 *)gid_raw)[6]), htons(((u16 *)gid_raw)[7]) -#endif /* _FBSD_PRINTK_H */ +enum { + DUMP_PREFIX_NONE, + DUMP_PREFIX_ADDRESS, + DUMP_PREFIX_OFFSET +}; + +static inline void +print_hex_dump(const char *level, const char *prefix_str, + const int prefix_type, const int rowsize, const int groupsize, + const void *buf, size_t len, const bool ascii) +{ + typedef const struct { long long value; } __packed *print_64p_t; + typedef const struct { uint32_t value; } __packed *print_32p_t; + typedef const struct { uint16_t value; } __packed *print_16p_t; + const void *buf_old = buf; + int row; + + while (len > 0) { + if (level != NULL) + printf("%s", level); + if (prefix_str != NULL) + printf("%s ", prefix_str); + + switch (prefix_type) { + case DUMP_PREFIX_ADDRESS: + printf("[%p] ", buf); + break; + case DUMP_PREFIX_OFFSET: + printf("[%p] ", (const char *)((const char *)buf - + (const char *)buf_old)); + break; + default: + break; + } + for (row = 0; row != rowsize; row++) { + if (groupsize == 8 && len > 7) { + printf("%016llx ", ((print_64p_t)buf)->value); + buf = (const uint8_t *)buf + 8; + len -= 8; + } else if (groupsize == 4 && len > 3) { + printf("%08x ", ((print_32p_t)buf)->value); + buf = (const uint8_t *)buf + 4; + len -= 4; + } else if (groupsize == 2 && len > 1) { + printf("%04x ", ((print_16p_t)buf)->value); + buf = (const uint8_t *)buf + 2; + len -= 2; + } else if (len > 0) { + printf("%02x ", *(const uint8_t *)buf); + buf = (const uint8_t *)buf + 1; + len--; + } else { + break; + } + } + printf("\n"); + } +} + +static inline void +print_hex_dump_bytes(const char *prefix_str, const int prefix_type, + const void *buf, size_t len) +{ + print_hex_dump(NULL, prefix_str, prefix_type, 16, 1, buf, len, 0); +} + +#define printk_ratelimited(...) do { \ + static linux_ratelimit_t __ratelimited; \ + if (linux_ratelimited(&__ratelimited)) \ + printk(__VA_ARGS__); \ +} while (0) + +#endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-head@freebsd.org Wed May 31 16:28:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13086B7DE9C; Wed, 31 May 2017 16:28:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D57A0823B3; Wed, 31 May 2017 16:28:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VGSTnE023360; Wed, 31 May 2017 16:28:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VGSTQj023359; Wed, 31 May 2017 16:28:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705311628.v4VGSTQj023359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 May 2017 16:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319342 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 16:28:31 -0000 Author: emaste Date: Wed May 31 16:28:29 2017 New Revision: 319342 URL: https://svnweb.freebsd.org/changeset/base/319342 Log: makefs: free buf in case of error CID: 270190 Submitted by: Siva Mahadevan Reported by: Coverity Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11011 Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Wed May 31 16:24:02 2017 (r319341) +++ head/usr.sbin/makefs/ffs.c Wed May 31 16:28:29 2017 (r319342) @@ -523,6 +523,7 @@ ffs_create_image(const char *image, fsinfo_t *fsopts) if (fsopts->offset != 0) if (lseek(fsopts->fd, fsopts->offset, SEEK_SET) == -1) { warn("can't seek"); + free(buf); return -1; } From owner-svn-src-head@freebsd.org Wed May 31 16:32:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 225CBB7E048; Wed, 31 May 2017 16:32:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F032D82767; Wed, 31 May 2017 16:32:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VGWY7S027165; Wed, 31 May 2017 16:32:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VGWXb4027158; Wed, 31 May 2017 16:32:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705311632.v4VGWXb4027158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 31 May 2017 16:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319343 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 16:32:35 -0000 Author: adrian Date: Wed May 31 16:32:33 2017 New Revision: 319343 URL: https://svnweb.freebsd.org/changeset/base/319343 Log: [ar71xx] rename AR724X_BASE -> std.AR724X Added: head/sys/mips/conf/std.AR724X - copied, changed from r319342, head/sys/mips/conf/AR724X_BASE Deleted: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AP91 head/sys/mips/conf/AP93 head/sys/mips/conf/ENH200 head/sys/mips/conf/PICOSTATION_M2HP head/sys/mips/conf/ROCKET_M2HP head/sys/mips/conf/WZR-300HP Modified: head/sys/mips/conf/AP91 ============================================================================== --- head/sys/mips/conf/AP91 Wed May 31 16:28:29 2017 (r319342) +++ head/sys/mips/conf/AP91 Wed May 31 16:32:33 2017 (r319343) @@ -14,7 +14,7 @@ #NO_UNIVERSE -include "AR724X_BASE" +include "std.AR724X" ident "AP91" hints "AP91.hints" Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Wed May 31 16:28:29 2017 (r319342) +++ head/sys/mips/conf/AP93 Wed May 31 16:32:33 2017 (r319343) @@ -14,7 +14,7 @@ #NO_UNIVERSE -include "AR724X_BASE" +include "std.AR724X" ident "AP93" hints "AP93.hints" Modified: head/sys/mips/conf/ENH200 ============================================================================== --- head/sys/mips/conf/ENH200 Wed May 31 16:28:29 2017 (r319342) +++ head/sys/mips/conf/ENH200 Wed May 31 16:32:33 2017 (r319343) @@ -14,7 +14,7 @@ #NO_UNIVERSE -include "AR724X_BASE" +include "std.AR724X" ident "ENH200" hints "ENH200.hints" Modified: head/sys/mips/conf/PICOSTATION_M2HP ============================================================================== --- head/sys/mips/conf/PICOSTATION_M2HP Wed May 31 16:28:29 2017 (r319342) +++ head/sys/mips/conf/PICOSTATION_M2HP Wed May 31 16:32:33 2017 (r319343) @@ -14,7 +14,7 @@ #NO_UNIVERSE -include "AR724X_BASE" +include "std.AR724X" ident "PICOSTATION_M2HP" hints "PICOSTATION_M2HP.hints" Modified: head/sys/mips/conf/ROCKET_M2HP ============================================================================== --- head/sys/mips/conf/ROCKET_M2HP Wed May 31 16:28:29 2017 (r319342) +++ head/sys/mips/conf/ROCKET_M2HP Wed May 31 16:32:33 2017 (r319343) @@ -14,7 +14,7 @@ #NO_UNIVERSE -include "AR724X_BASE" +include "std.AR724X" ident "ROCKET_M2HP" hints "ROCKET_M2HP.hints" Modified: head/sys/mips/conf/WZR-300HP ============================================================================== --- head/sys/mips/conf/WZR-300HP Wed May 31 16:28:29 2017 (r319342) +++ head/sys/mips/conf/WZR-300HP Wed May 31 16:32:33 2017 (r319343) @@ -14,7 +14,7 @@ #NO_UNIVERSE -include "AR724X_BASE" +include "std.AR724X" ident "WZR-300HP" hints "WZR-300HP.hints" Copied and modified: head/sys/mips/conf/std.AR724X (from r319342, head/sys/mips/conf/AR724X_BASE) ============================================================================== --- head/sys/mips/conf/AR724X_BASE Wed May 31 16:28:29 2017 (r319342, copy source) +++ head/sys/mips/conf/std.AR724X Wed May 31 16:32:33 2017 (r319343) @@ -9,7 +9,7 @@ # machine mips mips -ident AR724X_BASE +#ident AR724X_BASE cpu CPU_MIPS24K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 From owner-svn-src-head@freebsd.org Wed May 31 17:38:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5304B7F55F; Wed, 31 May 2017 17:38:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3971E9A; Wed, 31 May 2017 17:38:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id h64so2654424pge.3; Wed, 31 May 2017 10:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k+t8cgpRoYxlHUqOR9dSOhhJ73VtCHcqQvmBalJ2w5E=; b=PnRqv78nYQtVKkcNxaVpZOHF7KqWhPO5mwvyVEVOe1I/5KhV0RTX/MBCqztxjSr3DH Huoz65l7tx9BCwcJPo3/VMPNYGyfsUZjbbB36mk5/mtkkc8MzFuTn3MYTWTRPWowR8hT SRYESZEwXvbPQrpBSl6p5XcclOqz7eAwESG7ECknJ40izkfpHz8JJIBb9dYcDVtmlwac ZExNB8ZATjeylE9Ozngm+Yp8iCv3cUX3eqz6/X0fStbZyezkSzTx62hv5RQJOJxMIkyv 3TGHWWVSEQvT2giApJUxDfPwLT1nlHs2kL9nwctMLbKfjD5K2GsmGQ5GtH82WBXERi6x JtBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k+t8cgpRoYxlHUqOR9dSOhhJ73VtCHcqQvmBalJ2w5E=; b=iP5IfwykRKZbi25+30hf7fiVHzo4C5Zse1pQRMCtlpQQJ1jmtAI3V5trvF7LtCbhpo QLXr7eBJZ7eBpiOxrXFMcRMHmbpOm/lS43a8yWi9f9+EyTgGuLTn4DGRdruZu2I1nK/i hzIabnD39kKx/ZCHTndSvKE5dxAeiA4wQ6YCSY+KxZ7ryfnqxZ7KvlirFxtPG7LQ8JKv lijMuZX0XHpX6NDdlnIXzCoCbS+5r4mFbOF5iPogNSAy3abot/RNUwX8pYlTY5PjWS7c vdk+P+H6H2tTCLeBrUR+Y3bLSaudhzl8bUzqWddDnWDbNHIN6xrqJNs0ZfDq3dwAdcBN 0euA== X-Gm-Message-State: AODbwcB/vciTksjWpOV4kEymjzhk1YPNwXnxuRmVgqC3KPoUXTTLJXwz rm/ueEw6NihD1SMWvlo= X-Received: by 10.98.156.133 with SMTP id u5mr30150738pfk.76.1496252333927; Wed, 31 May 2017 10:38:53 -0700 (PDT) Received: from ?IPv6:2607:fb90:834d:ae5f:d516:4603:4950:1427? ([2607:fb90:834d:ae5f:d516:4603:4950:1427]) by smtp.gmail.com with ESMTPSA id p13sm34002465pfl.52.2017.05.31.10.38.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 10:38:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r319125 - head/usr.bin/mkimg From: Ngie Cooper X-Mailer: iPhone Mail (14F89) In-Reply-To: <20170531114829.28359de76187bdd184746b5a@bidouilliste.com> Date: Wed, 31 May 2017 10:38:52 -0700 Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <950A1301-50D2-490B-9598-5248AF246985@gmail.com> References: <201705291251.v4TCp24h090283@repo.freebsd.org> <20170531114829.28359de76187bdd184746b5a@bidouilliste.com> To: Emmanuel Vadot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 17:38:54 -0000 > On May 31, 2017, at 02:48, Emmanuel Vadot wrote: >=20 > On Wed, 31 May 2017 00:20:45 -0700 > "Ngie Cooper (yaneurabeya)" wrote: >=20 >>=20 >>> On May 29, 2017, at 05:51, Emmanuel Vadot wrote: >>>=20 >>> Author: manu >>> Date: Mon May 29 12:51:02 2017 >>> New Revision: 319125 >>> URL: https://svnweb.freebsd.org/changeset/base/319125 >>>=20 >>> Log: >>> mkimg: Correct an off by one error in the PMBR size >>>=20 >>> The PMBR last sector should be number of sector - 1 (As stated in UEFI S= pec >>> 2.6 page 118 table 17). >>> This fixes warning printed by linux tools like parted or fdisk. >>=20 >> This commit broke all of the mkimg gpt tests. For example: https://ci.fre= ebsd.org/job/FreeBSD-head-amd64-test/3280/testReport/junit/usr.bin.mkimg/mki= mg_test/gpt_1x1_4096_qcow/ . >> -Ngie >=20 > Sorry about that and thanks for the fix. No worries -- it turns out I broke something by accident as well, and I f= ixed both items at the same time. Take it easy :), -Ngie= From owner-svn-src-head@freebsd.org Wed May 31 19:20:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F2BEB87690; Wed, 31 May 2017 19:20:28 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F05464E2B; Wed, 31 May 2017 19:20:28 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VJKRgT097196; Wed, 31 May 2017 19:20:27 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VJKR1A097195; Wed, 31 May 2017 19:20:27 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201705311920.v4VJKR1A097195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Wed, 31 May 2017 19:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319350 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 19:20:28 -0000 Author: ivadasz Date: Wed May 31 19:20:27 2017 New Revision: 319350 URL: https://svnweb.freebsd.org/changeset/base/319350 Log: Fix typo in Driver Type A/C/D capability checks in sdhci. Use the SDHCI_CAN_DRIVE_TYPE_A/_C/_D masks to check for Driver Type support, instead of using the SDHCI_CTRL2_DRIVER_TYPE_A/_C/_D values which are meant for setting the Driver Type in the HOST_CONTROL2 register. Approved by: adrian (mentor), jmcneill Differential Revision: https://reviews.freebsd.org/D10999 Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Wed May 31 19:16:22 2017 (r319349) +++ head/sys/dev/sdhci/sdhci.c Wed May 31 19:20:27 2017 (r319350) @@ -731,11 +731,11 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, MMC_CAP_MMC_DDR52_180 | MMC_CAP_MMC_HS200_180 | MMC_CAP_MMC_HS400_180)) host_caps |= MMC_CAP_SIGNALING_180; - if (caps & SDHCI_CTRL2_DRIVER_TYPE_A) + if (caps2 & SDHCI_CAN_DRIVE_TYPE_A) host_caps |= MMC_CAP_DRIVER_TYPE_A; - if (caps & SDHCI_CTRL2_DRIVER_TYPE_C) + if (caps2 & SDHCI_CAN_DRIVE_TYPE_C) host_caps |= MMC_CAP_DRIVER_TYPE_C; - if (caps & SDHCI_CTRL2_DRIVER_TYPE_D) + if (caps2 & SDHCI_CAN_DRIVE_TYPE_D) host_caps |= MMC_CAP_DRIVER_TYPE_D; slot->host.caps = host_caps; @@ -769,9 +769,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_180) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_120) ? " 1.2V" : "", - (caps & SDHCI_CTRL2_DRIVER_TYPE_A) ? "A" : "", - (caps & SDHCI_CTRL2_DRIVER_TYPE_C) ? "C" : "", - (caps & SDHCI_CTRL2_DRIVER_TYPE_D) ? "D" : "", + (caps2 & SDHCI_CAN_DRIVE_TYPE_A) ? "A" : "", + (caps2 & SDHCI_CAN_DRIVE_TYPE_C) ? "C" : "", + (caps2 & SDHCI_CAN_DRIVE_TYPE_D) ? "D" : "", (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); if (host_caps & (MMC_CAP_MMC_DDR52 | MMC_CAP_MMC_HS200 | MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) From owner-svn-src-head@freebsd.org Wed May 31 19:37:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A28DB87D62; Wed, 31 May 2017 19:37:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B71F165C98; Wed, 31 May 2017 19:37:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VJbSTM006319; Wed, 31 May 2017 19:37:28 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VJbOSX006268; Wed, 31 May 2017 19:37:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705311937.v4VJbOSX006268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 May 2017 19:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319354 - in head/contrib/byacc: . package package/debian package/pkgsrc test/btyacc test/yacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 19:37:30 -0000 Author: jkim Date: Wed May 31 19:37:23 2017 New Revision: 319354 URL: https://svnweb.freebsd.org/changeset/base/319354 Log: MFV: r319352 Merge byacc 20170430. Modified: head/contrib/byacc/CHANGES head/contrib/byacc/MANIFEST head/contrib/byacc/VERSION head/contrib/byacc/btyaccpar.c head/contrib/byacc/btyaccpar.skel head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/defs.h head/contrib/byacc/main.c head/contrib/byacc/output.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/package/mingw-byacc.spec head/contrib/byacc/package/pkgsrc/Makefile head/contrib/byacc/test/btyacc/btyacc_calc1.tab.c head/contrib/byacc/test/btyacc/btyacc_demo.tab.c head/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c head/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c head/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c head/contrib/byacc/test/btyacc/calc.tab.c head/contrib/byacc/test/btyacc/calc1.tab.c head/contrib/byacc/test/btyacc/calc2.tab.c head/contrib/byacc/test/btyacc/calc3.tab.c head/contrib/byacc/test/btyacc/code_calc.code.c head/contrib/byacc/test/btyacc/code_error.code.c head/contrib/byacc/test/btyacc/empty.tab.c head/contrib/byacc/test/btyacc/err_inherit3.tab.c head/contrib/byacc/test/btyacc/err_inherit4.tab.c head/contrib/byacc/test/btyacc/err_syntax10.tab.c head/contrib/byacc/test/btyacc/err_syntax11.tab.c head/contrib/byacc/test/btyacc/err_syntax12.tab.c head/contrib/byacc/test/btyacc/err_syntax18.tab.c head/contrib/byacc/test/btyacc/err_syntax20.tab.c head/contrib/byacc/test/btyacc/error.tab.c head/contrib/byacc/test/btyacc/expr.oxout.tab.c head/contrib/byacc/test/btyacc/grammar.tab.c head/contrib/byacc/test/btyacc/inherit0.tab.c head/contrib/byacc/test/btyacc/inherit1.tab.c head/contrib/byacc/test/btyacc/inherit2.tab.c head/contrib/byacc/test/btyacc/ok_syntax1.tab.c head/contrib/byacc/test/btyacc/pure_calc.tab.c head/contrib/byacc/test/btyacc/pure_error.tab.c head/contrib/byacc/test/btyacc/quote_calc-s.tab.c head/contrib/byacc/test/btyacc/quote_calc.tab.c head/contrib/byacc/test/btyacc/quote_calc2-s.tab.c head/contrib/byacc/test/btyacc/quote_calc2.tab.c head/contrib/byacc/test/btyacc/quote_calc3-s.tab.c head/contrib/byacc/test/btyacc/quote_calc3.tab.c head/contrib/byacc/test/btyacc/quote_calc4-s.tab.c head/contrib/byacc/test/btyacc/quote_calc4.tab.c head/contrib/byacc/test/btyacc/rename_debug.c head/contrib/byacc/test/btyacc/varsyntax_calc1.tab.c head/contrib/byacc/test/yacc/big_l.output head/contrib/byacc/test/yacc/calc3.tab.c head/contrib/byacc/test/yacc/ok_syntax1.tab.c head/contrib/byacc/test/yacc/pure_calc.tab.c head/contrib/byacc/test/yacc/pure_error.tab.c head/contrib/byacc/yaccpar.c head/contrib/byacc/yaccpar.skel Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/CHANGES Wed May 31 19:37:23 2017 (r319354) @@ -1,3 +1,33 @@ +2017-04-30 Thomas E. Dickey + + * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, t est/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/rename_debug.c, btyaccpar.c, btyaccpar.skel: + fix another uninitialized variable warning in "make check_make" for btyacc + + * test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/calc3.tab.c, btyaccpar.c, btyaccpar.skel, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/calc3.tab.c, yaccpar.c, defs.h, yaccpar.skel, output.c: + fix some compiler warnings for "make check_make" by adding section init_vars, + which initializes the body_vars for pure-parser configuration. + +2017-04-30 Tom.Shields + + * output.c: + use YY_NO_LEAKS set in configure --with-no-leaks, in the generated code + +2017-04-30 Julien.Ramseier + + * main.c, test/yacc/big_l.output: + fix typo in unsupported-flag warning message + +2017-04-30 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2017-03-18 Thomas E. Dickey + + * config.sub: 2017-02-07 + + * config.guess: 2017-03-05 + 2017-02-01 Thomas E. Dickey * test/btyacc/expr.oxout.error, test/btyacc/expr.oxout.output, test/btyacc/expr.oxout.tab.c, test/btyacc/expr.oxout.tab.h, test/yacc/expr.oxout.error, test/yacc/expr.oxout.output, test/yacc/expr.oxout.tab.c, test/yacc/expr.oxout.tab.h: Modified: head/contrib/byacc/MANIFEST ============================================================================== --- head/contrib/byacc/MANIFEST Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/MANIFEST Wed May 31 19:37:23 2017 (r319354) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20170201, version t20170201 +MANIFEST for byacc-20170430, version t20170430 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/VERSION Wed May 31 19:37:23 2017 (r319354) @@ -1 +1 @@ -20170201 +20170430 Modified: head/contrib/byacc/btyaccpar.c ============================================================================== --- head/contrib/byacc/btyaccpar.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/btyaccpar.c Wed May 31 19:37:23 2017 (r319354) @@ -2,7 +2,7 @@ * @Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp @ */ -/* @Id: btyaccpar.skel,v 1.5 2016/12/02 22:02:28 tom Exp @ */ +/* @Id: btyaccpar.skel,v 1.6 2017/04/30 23:40:34 tom Exp @ */ #include "defs.h" @@ -449,6 +449,23 @@ const char *const body_2[] = " }", " if (yydebug)", " fprintf(stderr, \"%sdebug[<# of symbols on state stack>]\\n\", YYPREFIX);", + "#endif", + "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", + " memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));", + "#endif", + "", + 0 +}; + +const char *const init_vars[] = +{ + " yyerrflag = 0;", + " yychar = 0;", + " memset(&yyval, 0, sizeof(yyval));", + " memset(&yylval, 0, sizeof(yylval));", + "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", + " memset(&yyloc, 0, sizeof(yyloc));", + " memset(&yylloc, 0, sizeof(yylloc));", "#endif", "", 0 Modified: head/contrib/byacc/btyaccpar.skel ============================================================================== --- head/contrib/byacc/btyaccpar.skel Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/btyaccpar.skel Wed May 31 19:37:23 2017 (r319354) @@ -1,4 +1,4 @@ -/* $Id: btyaccpar.skel,v 1.5 2016/12/02 22:02:28 tom Exp $ */ +/* $Id: btyaccpar.skel,v 1.7 2017/05/01 00:13:19 tom Exp $ */ #include "defs.h" @@ -384,6 +384,19 @@ YYPARSE_DECL() } if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); +#endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + +%% init_vars + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); #endif %% body_3 Modified: head/contrib/byacc/config.guess ============================================================================== --- head/contrib/byacc/config.guess Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/config.guess Wed May 31 19:37:23 2017 (r319354) @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-01-01' +timestamp='2017-03-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -837,10 +837,11 @@ EOF UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -1342,6 +1343,9 @@ EOF exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + NSX-?:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux Modified: head/contrib/byacc/config.sub ============================================================================== --- head/contrib/byacc/config.sub Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/config.sub Wed May 31 19:37:23 2017 (r319354) @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-01-01' +timestamp='2017-02-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -947,6 +947,9 @@ case $basic_machine in ;; nsr-tandem) basic_machine=nsr-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki Modified: head/contrib/byacc/defs.h ============================================================================== --- head/contrib/byacc/defs.h Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/defs.h Wed May 31 19:37:23 2017 (r319354) @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.56 2017/02/02 00:44:38 tom Exp $ */ +/* $Id: defs.h,v 1.57 2017/04/30 23:29:11 tom Exp $ */ #ifdef HAVE_CONFIG_H #include @@ -307,6 +307,7 @@ extern const char *const hdr_defs[]; extern const char *const hdr_vars[]; extern const char *const body_1[]; extern const char *const body_vars[]; +extern const char *const init_vars[]; extern const char *const body_2[]; extern const char *const body_3[]; extern const char *const trailer[]; Modified: head/contrib/byacc/main.c ============================================================================== --- head/contrib/byacc/main.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/main.c Wed May 31 19:37:23 2017 (r319354) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.59 2017/02/02 00:44:38 tom Exp $ */ +/* $Id: main.c,v 1.60 2017/04/30 20:57:56 Julien.Ramseier Exp $ */ #include #ifndef _WIN32 @@ -266,7 +266,7 @@ setflag(int ch) #if defined(YYBTYACC) locations = 1; #else - unsupported_flag_warning("-B", "reconfigure with --enable-btyacc"); + unsupported_flag_warning("-L", "reconfigure with --enable-btyacc"); #endif break; Modified: head/contrib/byacc/output.c ============================================================================== --- head/contrib/byacc/output.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/output.c Wed May 31 19:37:23 2017 (r319354) @@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.79 2016/12/02 20:42:38 tom Exp $ */ +/* $Id: output.c,v 1.81 2017/04/30 23:23:32 tom Exp $ */ #include "defs.h" @@ -1584,7 +1584,20 @@ output_pure_parser(FILE * fp) putc_code(fp, '\n'); } +#if defined(YY_NO_LEAKS) static void +output_no_leaks(FILE * fp) +{ + putc_code(fp, '\n'); + + if (fp == code_file) + ++outline; + fputs("#define YY_NO_LEAKS 1\n", fp); + putc_code(fp, '\n'); +} +#endif + +static void output_trailing_text(void) { int c, last; @@ -1985,6 +1998,9 @@ output(void) output_prefix(fp); output_pure_parser(fp); +#if defined(YY_NO_LEAKS) + output_no_leaks(fp); +#endif output_stored_text(fp); output_stype(fp); #if defined(YYBTYACC) @@ -2068,6 +2084,10 @@ output(void) write_section(code_file, body_vars); } write_section(code_file, body_2); + if (pure_parser) + { + write_section(code_file, init_vars); + } #if defined(YYBTYACC) if (initial_action) output_initial_action(); Modified: head/contrib/byacc/package/byacc.spec ============================================================================== --- head/contrib/byacc/package/byacc.spec Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/package/byacc.spec Wed May 31 19:37:23 2017 (r319354) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20170201 +%define AppVersion 20170430 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.33 2017/02/01 09:55:04 tom Exp $ +# $XTermId: byacc.spec,v 1.34 2017/04/30 20:55:15 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/debian/changelog ============================================================================== --- head/contrib/byacc/package/debian/changelog Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/package/debian/changelog Wed May 31 19:37:23 2017 (r319354) @@ -1,3 +1,9 @@ +byacc (20170430) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Sun, 30 Apr 2017 16:55:15 -0400 + byacc (20170201) unstable; urgency=low * maintenance updates Modified: head/contrib/byacc/package/mingw-byacc.spec ============================================================================== --- head/contrib/byacc/package/mingw-byacc.spec Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/package/mingw-byacc.spec Wed May 31 19:37:23 2017 (r319354) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20170201 +%define AppVersion 20170430 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.15 2017/02/01 09:55:04 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.16 2017/04/30 20:55:15 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/pkgsrc/Makefile ============================================================================== --- head/contrib/byacc/package/pkgsrc/Makefile Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/package/pkgsrc/Makefile Wed May 31 19:37:23 2017 (r319354) @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20170201 +DISTNAME= byacc-20170430 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ Modified: head/contrib/byacc/test/btyacc/btyacc_calc1.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/btyacc_calc1.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/btyacc_calc1.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -818,7 +818,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1525,7 +1537,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1529 "btyacc_calc1.tab.c" +#line 1541 "btyacc_calc1.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/btyacc_demo.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/btyacc_demo.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/btyacc_demo.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -1330,6 +1330,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -2103,7 +2106,7 @@ case 59: #line 197 "btyacc_demo.y" { yyval.code = yystack.l_mark[-1].code; } break; -#line 2107 "btyacc_demo.tab.c" +#line 2110 "btyacc_demo.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -662,6 +662,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1225,7 +1228,7 @@ case 9: #line 86 "btyacc_destroy1.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1229 "btyacc_destroy1.tab.c" +#line 1232 "btyacc_destroy1.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -662,6 +662,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1225,7 +1228,7 @@ case 9: #line 86 "btyacc_destroy2.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1229 "btyacc_destroy2.tab.c" +#line 1232 "btyacc_destroy2.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -662,6 +662,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1225,7 +1228,7 @@ case 9: #line 89 "btyacc_destroy3.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1229 "btyacc_destroy3.tab.c" +#line 1232 "btyacc_destroy3.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/calc.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/calc.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/calc.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -657,6 +657,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1231,7 +1234,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1235 "calc.tab.c" +#line 1238 "calc.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/calc1.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/calc1.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/calc1.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -801,6 +801,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1478,7 +1481,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1482 "calc1.tab.c" +#line 1485 "calc1.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/calc2.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/calc2.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/calc2.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -670,6 +670,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1244,7 +1247,7 @@ case 18: #line 70 "calc2.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1248 "calc2.tab.c" +#line 1251 "calc2.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/calc3.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/calc3.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/calc3.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -675,7 +675,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1249,7 +1261,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1253 "calc3.tab.c" +#line 1265 "calc3.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/code_calc.code.c ============================================================================== --- head/contrib/byacc/test/btyacc/code_calc.code.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/code_calc.code.c Wed May 31 19:37:23 2017 (r319354) @@ -530,6 +530,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1104,7 +1107,7 @@ case 18: #line 67 "code_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1108 "code_calc.code.c" +#line 1111 "code_calc.code.c" default: break; } Modified: head/contrib/byacc/test/btyacc/code_error.code.c ============================================================================== --- head/contrib/byacc/test/btyacc/code_error.code.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/code_error.code.c Wed May 31 19:37:23 2017 (r319354) @@ -500,6 +500,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/empty.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/empty.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/empty.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -519,6 +519,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/err_inherit3.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit3.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_inherit3.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -619,6 +619,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1189,7 +1192,7 @@ case 13: #line 75 "err_inherit3.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1193 "err_inherit3.tab.c" +#line 1196 "err_inherit3.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/err_inherit4.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit4.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_inherit4.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -617,6 +617,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1179,7 +1182,7 @@ case 11: #line 77 "err_inherit4.y" { yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[1]; } break; -#line 1183 "err_inherit4.tab.c" +#line 1186 "err_inherit4.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/err_syntax10.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax10.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_syntax10.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -518,6 +518,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/err_syntax11.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax11.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_syntax11.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -524,6 +524,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/err_syntax12.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax12.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_syntax12.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -530,6 +530,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/err_syntax18.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax18.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_syntax18.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -527,6 +527,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1045,7 +1048,7 @@ case 1: #line 9 "err_syntax18.y" { yyval = yystack.l_mark[1]; } break; -#line 1049 "err_syntax18.tab.c" +#line 1052 "err_syntax18.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/err_syntax20.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax20.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/err_syntax20.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -522,6 +522,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1040,7 +1043,7 @@ case 1: #line 12 "err_syntax20.y" { yystack.l_mark[-1].rechk = 3; } break; -#line 1044 "err_syntax20.tab.c" +#line 1047 "err_syntax20.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/error.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/error.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/error.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -523,6 +523,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/expr.oxout.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/expr.oxout.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/expr.oxout.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -1943,6 +1943,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -2515,7 +2518,7 @@ case 10: yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} break; -#line 2519 "expr.oxout.tab.c" +#line 2522 "expr.oxout.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/grammar.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/grammar.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/grammar.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -1496,6 +1496,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -2684,7 +2687,7 @@ case 114: yyval.declarator->func_def = FUNC_ANSI; } break; -#line 2688 "grammar.tab.c" +#line 2691 "grammar.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/inherit0.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/inherit0.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/inherit0.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -542,6 +542,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1100,7 +1103,7 @@ case 11: #line 43 "inherit0.y" { yyval = yystack.l_mark[0]; } break; -#line 1104 "inherit0.tab.c" +#line 1107 "inherit0.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/inherit1.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/inherit1.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/inherit1.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -563,6 +563,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1125,7 +1128,7 @@ case 11: #line 71 "inherit1.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1129 "inherit1.tab.c" +#line 1132 "inherit1.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/inherit2.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/inherit2.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/inherit2.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -618,6 +618,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1184,7 +1187,7 @@ case 12: #line 75 "inherit2.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1188 "inherit2.tab.c" +#line 1191 "inherit2.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/ok_syntax1.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/ok_syntax1.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/ok_syntax1.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -698,7 +698,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1272,7 +1284,7 @@ case 18: #line 101 "ok_syntax1.y" { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; } break; -#line 1276 "ok_syntax1.tab.c" +#line 1288 "ok_syntax1.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/pure_calc.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/pure_calc.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/pure_calc.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -671,7 +671,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1245,7 +1257,7 @@ case 18: #line 69 "pure_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1249 "pure_calc.tab.c" +#line 1261 "pure_calc.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/pure_error.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/pure_error.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/pure_error.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -539,6 +539,18 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: head/contrib/byacc/test/btyacc/quote_calc-s.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/quote_calc-s.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/quote_calc-s.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -675,6 +675,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1249,7 +1252,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1253 "quote_calc-s.tab.c" +#line 1256 "quote_calc-s.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/quote_calc.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/quote_calc.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/quote_calc.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -681,6 +681,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1255,7 +1258,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1259 "quote_calc.tab.c" +#line 1262 "quote_calc.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/quote_calc2-s.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/quote_calc2-s.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/quote_calc2-s.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -675,6 +675,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1249,7 +1252,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1253 "quote_calc2-s.tab.c" +#line 1256 "quote_calc2-s.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/quote_calc2.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/quote_calc2.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/quote_calc2.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -681,6 +681,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1255,7 +1258,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1259 "quote_calc2.tab.c" +#line 1262 "quote_calc2.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/quote_calc3-s.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/quote_calc3-s.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/quote_calc3-s.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -676,6 +676,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1250,7 +1253,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1254 "quote_calc3-s.tab.c" +#line 1257 "quote_calc3-s.tab.c" default: break; } Modified: head/contrib/byacc/test/btyacc/quote_calc3.tab.c ============================================================================== --- head/contrib/byacc/test/btyacc/quote_calc3.tab.c Wed May 31 19:28:22 2017 (r319353) +++ head/contrib/byacc/test/btyacc/quote_calc3.tab.c Wed May 31 19:37:23 2017 (r319354) @@ -676,6 +676,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1250,7 +1253,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1254 "quote_calc3.tab.c" +#line 1257 "quote_calc3.tab.c" default: break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed May 31 21:05:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C6DBB94869; Wed, 31 May 2017 21:05:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ED18684D7; Wed, 31 May 2017 21:05:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VL5Ocu044118; Wed, 31 May 2017 21:05:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VL5OjI044117; Wed, 31 May 2017 21:05:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705312105.v4VL5OjI044117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 31 May 2017 21:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319355 - head/sys/fs/cuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 21:05:25 -0000 Author: hselasky Date: Wed May 31 21:05:24 2017 New Revision: 319355 URL: https://svnweb.freebsd.org/changeset/base/319355 Log: Minor code optimisation. Avoid locking the global CUSE lock when the polling flags are zero. MFC after: 1 week Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Wed May 31 19:37:23 2017 (r319354) +++ head/sys/fs/cuse/cuse.c Wed May 31 21:05:24 2017 (r319355) @@ -1507,8 +1507,8 @@ cuse_client_kqfilter_poll(struct cdev *dev, struct cus /* get the latest polling state from the server */ temp = cuse_client_poll(dev, POLLIN | POLLOUT, NULL); - cuse_lock(); if (temp & (POLLIN | POLLOUT)) { + cuse_lock(); if (temp & POLLIN) pcc->cflags |= CUSE_CLI_KNOTE_NEED_READ; if (temp & POLLOUT) @@ -1516,8 +1516,8 @@ cuse_client_kqfilter_poll(struct cdev *dev, struct cus /* make sure the "knote" gets woken up */ cuse_server_wakeup_locked(pcc->server); + cuse_unlock(); } - cuse_unlock(); } } From owner-svn-src-head@freebsd.org Wed May 31 21:18:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA5CB94B3C; Wed, 31 May 2017 21:18:13 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1656768C28; Wed, 31 May 2017 21:18:13 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VLICK4048620; Wed, 31 May 2017 21:18:12 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VLIBQe048612; Wed, 31 May 2017 21:18:11 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201705312118.v4VLIBQe048612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 31 May 2017 21:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319358 - in head: sbin/mdconfig sbin/mount sys/dev/md sys/fs/cd9660 sys/geom/uzip sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 21:18:13 -0000 Author: stevek Date: Wed May 31 21:18:11 2017 New Revision: 319358 URL: https://svnweb.freebsd.org/changeset/base/319358 Log: Add MD_VERIFY option to enable O_VERIFY in open for vnode type. Add -o [no]verify option to mdconfig (and document in man page.) Implement GEOM attribute MNT::verified to ask md if the backing vnode is verified. Check for MNT::verified in cd9660 mount to flag the mount as MNT_VERIFIED if the underlying device has been verified. Reviewed by: rwatson Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D2902 Modified: head/sbin/mdconfig/mdconfig.8 head/sbin/mdconfig/mdconfig.c head/sbin/mount/mount.c head/sys/dev/md/md.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/geom/uzip/g_uzip.c head/sys/sys/mdioctl.h head/sys/sys/mount.h Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Wed May 31 21:16:10 2017 (r319357) +++ head/sbin/mdconfig/mdconfig.8 Wed May 31 21:18:11 2017 (r319358) @@ -215,6 +215,14 @@ flag to forcibly destroy an disk that is still in use. .It Oo Cm no Oc Ns Cm readonly Enable/disable readonly mode. +.It Oo Cm no Oc Ns Cm verify +For +.Cm vnode +backed devices: enable/disable requesting verification of the +file used for backing store. +The type of verification depends on which security features are available. +One example of verification is testing file integrity with +checksums or cryptographic signatures. .El .It Fl u Ar unit Request a specific unit number or device name for the @@ -298,6 +306,7 @@ gnop create -o 512K md1 mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO +.Xr open 2 , .Xr md 4 , .Xr ffs 7 , .Xr gpart 8 , Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Wed May 31 21:16:10 2017 (r319357) +++ head/sbin/mdconfig/mdconfig.c Wed May 31 21:18:11 2017 (r319358) @@ -193,6 +193,10 @@ main(int argc, char **argv) mdio.md_options |= MD_RESERVE; else if (!strcmp(optarg, "noreserve")) mdio.md_options &= ~MD_RESERVE; + else if (!strcmp(optarg, "verify")) + mdio.md_options |= MD_VERIFY; + else if (!strcmp(optarg, "noverify")) + mdio.md_options &= ~MD_VERIFY; else errx(1, "unknown option: %s", optarg); break; Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Wed May 31 21:16:10 2017 (r319357) +++ head/sbin/mount/mount.c Wed May 31 21:18:11 2017 (r319358) @@ -115,6 +115,7 @@ static struct opt { { MNT_NFS4ACLS, "nfsv4acls" }, { MNT_GJOURNAL, "gjournal" }, { MNT_AUTOMOUNTED, "automounted" }, + { MNT_VERIFIED, "verified" }, { 0, NULL } }; Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed May 31 21:16:10 2017 (r319357) +++ head/sys/dev/md/md.c Wed May 31 21:18:11 2017 (r319358) @@ -88,6 +88,7 @@ #include #include #include +#include #include #include @@ -949,6 +950,8 @@ unmapped_step: sc->cred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); + if (error == 0) + sc->flags &= ~MD_VERIFY; } if (pb != NULL) { @@ -1143,6 +1146,8 @@ md_kthread(void *arg) } mtx_unlock(&sc->queue_mtx); if (bp->bio_cmd == BIO_GETATTR) { + int isv = ((sc->flags & MD_VERIFY) != 0); + if ((sc->fwsectors && sc->fwheads && (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors) || @@ -1150,6 +1155,8 @@ md_kthread(void *arg) sc->fwheads))) || g_handleattr_int(bp, "GEOM::candelete", 1)) error = -1; + else if (g_handleattr_int(bp, "MNT::verified", isv)) + error = -1; else error = EOPNOTSUPP; } else { @@ -1352,7 +1359,8 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, * If the user specified that this is a read only device, don't * set the FWRITE mask before trying to open the backing store. */ - flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE); + flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \ + | ((mdio->md_options & MD_VERIFY) ? 0 : O_VERIFY); NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td); error = vn_open(&nd, &flags, 0, NULL); if (error != 0) @@ -1380,7 +1388,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, sc->fwsectors = mdio->md_fwsectors; if (mdio->md_fwheads != 0) sc->fwheads = mdio->md_fwheads; - sc->flags = mdio->md_options & (MD_FORCE | MD_ASYNC); + sc->flags = mdio->md_options & (MD_FORCE | MD_ASYNC | MD_VERIFY); if (!(flags & FWRITE)) sc->flags |= MD_READONLY; sc->vnode = nd.ni_vp; @@ -1523,6 +1531,8 @@ mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, * Note the truncation. */ + if ((mdio->md_options & MD_VERIFY) != 0) + return (EINVAL); npage = mdio->md_mediasize / PAGE_SIZE; if (mdio->md_fwsectors != 0) sc->fwsectors = mdio->md_fwsectors; Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Wed May 31 21:16:10 2017 (r319357) +++ head/sys/fs/cd9660/cd9660_vfsops.c Wed May 31 21:18:11 2017 (r319358) @@ -215,6 +215,7 @@ iso_mountfs(devvp, mp) int iso_bsize; int iso_blknum; int joliet_level; + int isverified = 0; struct iso_volume_descriptor *vdp = NULL; struct iso_primary_descriptor *pri = NULL; struct iso_sierra_primary_descriptor *pri_sierra = NULL; @@ -229,6 +230,8 @@ iso_mountfs(devvp, mp) dev_ref(dev); g_topology_lock(); error = g_vfs_open(devvp, &cp, "cd9660", 0); + if (error == 0) + g_getattr("MNT::verified", cp, &isverified); g_topology_unlock(); VOP_UNLOCK(devvp, 0); if (error) @@ -377,6 +380,8 @@ iso_mountfs(devvp, mp) mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; mp->mnt_maxsymlinklen = 0; MNT_ILOCK(mp); + if (isverified) + mp->mnt_flag |= MNT_VERIFIED; mp->mnt_flag |= MNT_LOCAL; mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Wed May 31 21:16:10 2017 (r319357) +++ head/sys/geom/uzip/g_uzip.c Wed May 31 21:18:11 2017 (r319358) @@ -464,6 +464,27 @@ g_uzip_start(struct bio *bp) sc = gp->softc; sc->req_total++; + if (bp->bio_cmd == BIO_GETATTR) { + struct bio *bp2; + struct g_consumer *cp; + struct g_geom *gp; + struct g_provider *pp; + + /* pass on MNT:* requests and ignore others */ + if (strncmp(bp->bio_attribute, "MNT:", 4) == 0) { + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + bp2->bio_done = g_std_done; + pp = bp->bio_to; + gp = pp->geom; + cp = LIST_FIRST(&gp->consumer); + g_io_request(bp2, cp); + return; + } + } if (bp->bio_cmd != BIO_READ) { g_io_deliver(bp, EOPNOTSUPP); return; Modified: head/sys/sys/mdioctl.h ============================================================================== --- head/sys/sys/mdioctl.h Wed May 31 21:16:10 2017 (r319357) +++ head/sys/sys/mdioctl.h Wed May 31 21:18:11 2017 (r319358) @@ -88,5 +88,6 @@ struct md_ioctl { #define MD_COMPRESS 0x10 /* Compression mode */ #define MD_FORCE 0x20 /* Don't try to prevent foot-shooting */ #define MD_ASYNC 0x40 /* Asynchronous mode */ +#define MD_VERIFY 0x80 /* Open file with O_VERIFY (vnode only) */ #endif /* _SYS_MDIOCTL_H_*/ Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Wed May 31 21:16:10 2017 (r319357) +++ head/sys/sys/mount.h Wed May 31 21:18:11 2017 (r319358) @@ -314,6 +314,7 @@ void __mnt_vnode_markerfree_active(struct vno #define MNT_ROOTFS 0x0000000000004000ULL /* identifies the root fs */ #define MNT_USER 0x0000000000008000ULL /* mounted by a user */ #define MNT_IGNORE 0x0000000000800000ULL /* do not show entry in df */ +#define MNT_VERIFIED 0x0000000400000000ULL /* filesystem is verified */ /* * Mask of flags that are visible to statfs(). @@ -329,7 +330,7 @@ void __mnt_vnode_markerfree_active(struct vno MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW | \ MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS | \ - MNT_NFS4ACLS | MNT_AUTOMOUNTED) + MNT_NFS4ACLS | MNT_AUTOMOUNTED | MNT_VERIFIED) /* Mask of flags that can be updated. */ #define MNT_UPDATEMASK (MNT_NOSUID | MNT_NOEXEC | \ From owner-svn-src-head@freebsd.org Wed May 31 21:31:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C96B950C7; Wed, 31 May 2017 21:31:16 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91A6A6A8D9; Wed, 31 May 2017 21:31:16 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VLVFsv054266; Wed, 31 May 2017 21:31:15 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VLVFnb054265; Wed, 31 May 2017 21:31:15 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201705312131.v4VLVFnb054265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 31 May 2017 21:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319361 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 21:31:16 -0000 Author: stevek Date: Wed May 31 21:31:15 2017 New Revision: 319361 URL: https://svnweb.freebsd.org/changeset/base/319361 Log: parse.c parse_string When parse_semi fails, free s before returning parse.c parse_numeric_aggregate The memory assigned to bufp is complicated, it can either be from the input parameter buf or allocated locally. Introduce a new variable lbufp to track when it is assigned locally and to free it when appropriate. Submitted by: Thomas Rix Reviewed by: jhb Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9899 Modified: head/sbin/dhclient/parse.c Modified: head/sbin/dhclient/parse.c ============================================================================== --- head/sbin/dhclient/parse.c Wed May 31 21:20:42 2017 (r319360) +++ head/sbin/dhclient/parse.c Wed May 31 21:31:15 2017 (r319361) @@ -131,8 +131,10 @@ parse_string(FILE *cfile) error("no memory for string %s.", val); memcpy(s, val, valsize); - if (!parse_semi(cfile)) + if (!parse_semi(cfile)) { + free(s); return (NULL); + } return (s); } @@ -246,9 +248,10 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *bu char *val, *t; size_t valsize; pair c = NULL; + unsigned char *lbufp = NULL; if (!bufp && *max) { - bufp = malloc(*max * size / 8); + lbufp = bufp = malloc(*max * size / 8); if (!bufp) error("can't allocate space for numeric aggregate"); } else @@ -265,6 +268,7 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *bu parse_warn("too few numbers."); if (token != SEMI) skip_to_semi(cfile); + free(lbufp); return (NULL); } token = next_token(&val, cfile); @@ -281,6 +285,7 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *bu (base != 16 || token != NUMBER_OR_NAME)) { parse_warn("expecting numeric value."); skip_to_semi(cfile); + free(lbufp); return (NULL); } /* @@ -302,6 +307,7 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *bu /* If we had to cons up a list, convert it now. */ if (c) { + free(lbufp); bufp = malloc(count * size / 8); if (!bufp) error("can't allocate space for numeric aggregate."); From owner-svn-src-head@freebsd.org Wed May 31 22:01:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6BF8B95A60; Wed, 31 May 2017 22:01:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 367716E75A; Wed, 31 May 2017 22:01:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id b84so135654790wmh.0; Wed, 31 May 2017 15:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=laV6EJtAv+mctmxM60ZrG9If9yPiv7Ps52D/8y6XvDE=; b=NQnL5MceklY9rV5pzG9pUeLCqhnIsW3R+4lcBpOwJWgYSx8zJSwZDb88B5crStNVE5 KytGJOIOs6sz0RFnh0xfmZtY/LzoyBJWxDsbX+cAEptPKP81n7bBpKkUsPyOILE2XmFi s9Uv8QPMrDxBmcLPicKMt4aeVL57Jo7lH8Uoy1xK1q/D5w0R1X5/kgB+M3qU59w3zw5w HFS4+zJtwNGIROOyIZ6hGm+Wr8QDles6mTYo/W75stBxY5cWV8CfGsqFoMS9IwbFcKEK zHLZ0MdOoBy+ioiw8IeTqXNPInPyF1f8mMxsALR+oVUXCX0JcDsOvDuHSMnhXWtVgIzm PgRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=laV6EJtAv+mctmxM60ZrG9If9yPiv7Ps52D/8y6XvDE=; b=Elo44NW0fuhFksoq1f9hAhk5Kpup10z6lknpUkRP9rUCsBrjaBhGHD3TvmFxQYkjUV lzs//e5NF9cQHi7ljv4nsNxki0P0ffivhwbaOdnUvIo5n8sY/JwO8e6tvSZ3+a8fZyfr xzKPUR4xoH+akxt9f4O3IHPqnP8Js0DrKoxt4h25otlUt0ebBKKZUU2R0r+b0Zjhwg1I YCnHtXtCTTprU8A/x5D16l2nUg9JPMWD8aXvYUyD4BUAXE45OHIj8ezknC/nH1YKk3LT SFPqt6rBi/eofDag03GVoHRUfkDmEXGlm8jPkS+LlXUNR1j15I6PsgMFGEPk+7ZeaP0L pQMA== X-Gm-Message-State: AODbwcDnkHqyqzdySXhoq8QNifa+kP78NczibVR3b5G/0L+UT+kV2VLe yC2Q9oxWdnZU+ZVU X-Received: by 10.28.29.6 with SMTP id d6mr7276590wmd.71.1496268093625; Wed, 31 May 2017 15:01:33 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id x37sm31109185wrb.42.2017.05.31.15.01.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 15:01:33 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 31 May 2017 22:33:47 +0100 From: Edward Tomasz Napierala To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319075 - head/usr.bin/rctl Message-ID: <20170531213347.GA3597@brick> Mail-Followup-To: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705281713.v4SHDdqx004022@repo.freebsd.org> <201705290301.v4T31xQk020240@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201705290301.v4T31xQk020240@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 22:01:35 -0000 On 0528T2001, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: trasz > > Date: Sun May 28 17:13:38 2017 > > New Revision: 319075 > > URL: https://svnweb.freebsd.org/changeset/base/319075 > > > > Log: > > Random tweaks to rctl(8). > > Please try to be descriptive of what it is your tweaking, > think about having to come back in 10 years and read the > svn log trying to find some change and seeing this in > the log not knowing if that is the tweak your looking > for or not. Thanks. You're right; I'll try to be less sloppy next time. From owner-svn-src-head@freebsd.org Thu Jun 1 00:01:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C76BED63A; Thu, 1 Jun 2017 00:01:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A87F271B76; Thu, 1 Jun 2017 00:01:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5101KJ0014303; Thu, 1 Jun 2017 00:01:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5101JtX014290; Thu, 1 Jun 2017 00:01:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201706010001.v5101JtX014290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 1 Jun 2017 00:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319365 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 00:01:22 -0000 Author: jkim Date: Thu Jun 1 00:01:19 2017 New Revision: 319365 URL: https://svnweb.freebsd.org/changeset/base/319365 Log: Merge ACPICA 20170531. Added: head/sys/contrib/dev/acpica/common/dmswitch.c - copied, changed from r319363, vendor-sys/acpica/dist/source/common/dmswitch.c head/sys/contrib/dev/acpica/components/utilities/utresdecode.c - copied, changed from r319363, vendor-sys/acpica/dist/source/components/utilities/utresdecode.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahids.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslexternal.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslhelpers.y head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvdisasm.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/acuuid.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 31 22:41:07 2017 (r319364) +++ head/sys/conf/files Thu Jun 1 00:01:19 2017 (r319365) @@ -488,6 +488,7 @@ contrib/dev/acpica/components/utilities/utobject.c opt contrib/dev/acpica/components/utilities/utosi.c optional acpi contrib/dev/acpica/components/utilities/utownerid.c optional acpi contrib/dev/acpica/components/utilities/utpredef.c optional acpi +contrib/dev/acpica/components/utilities/utresdecode.c optional acpi acpi_debug contrib/dev/acpica/components/utilities/utresrc.c optional acpi contrib/dev/acpica/components/utilities/utstate.c optional acpi contrib/dev/acpica/components/utilities/utstring.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Thu Jun 1 00:01:19 2017 (r319365) @@ -21,9 +21,10 @@ stripdirs="generate libraries parsers preprocessor tes stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \ - acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ - osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ - oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c utprint.c" + acwin.h acwin64.h acwinex.h dspkginit.c new_table.txt \ + osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \ + osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \ + readme.txt utclib.c utprint.c" # include files to canonify src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/changes.txt Thu Jun 1 00:01:19 2017 (r319365) @@ -1,4 +1,134 @@ ---------------------------------------- +31 May 2017. Summary of changes for version 20170531: + + +0) ACPI 6.2 support: + +The ACPI specification version 6.2 has been released and is available at +http://uefi.org/specifications + +This version of ACPICA fully supports the ACPI 6.2 specification. Changes +are summarized below. + +New ACPI tables (Table Compiler/Disassembler/Templates): + HMAT (Heterogeneous Memory Attributes Table) + WSMT (Windows SMM Security Mitigation Table) + PPTT (Processor Properties Topology Table) + +New subtables for existing ACPI tables: + HEST (New subtable, Arch-deferred machine check) + SRAT (New subtable, Arch-specific affinity structure) + PCCT (New subtables, Extended PCC subspaces (types 3 and 4)) + +Simple updates for existing ACPI tables: + BGRT (two new flag bits) + HEST (New bit defined for several subtables, GHES_ASSIST) + +New Resource Descriptors and Resource macros (Compiler/Disassembler): + PinConfig() + PinFunction() + PinGroup() + PinGroupConfig() + PinGroupFunction() + New type for hardware error notification (section 18.3.2.9) + +New predefined names/methods (Compiler/Interpreter): + _HMA (Heterogeneous Memory Attributes) + _LSI (Label Storage Information) + _LSR (Label Storage Read) + _LSW (Label Storage Write) + +ASL grammar/macro changes (Compiler): + For() ASL macro, implemented with the AML while operator + Extensions to Concatenate operator + Support for multiple definition blocks in same ASL file + Clarification for Buffer operator + Allow executable AML code underneath all scopes (Devices, etc.) + Clarification/change for the _OSI return value + ASL grammar update for reference operators + Allow a zero-length string for AML filename in DefinitionBlock + +Miscellaneous: + New device object notification value + Remove a notify value (0x0C) for graceful shutdown + New UUIDs for processor/cache properties and + physical package property + New _HID, ACPI0014 (Wireless Power Calibration Device) + + +1) ACPICA kernel-resident subsystem: + +Added support to disable ACPI events on hardware-reduced platforms. +Eliminates error messages of the form "Could not enable fixed event". Lv +Zheng + +Fixed a problem using Device/Thermal objects with the ObjectType and +DerefOf ASL operators. This support had not been fully/properly +implemented. + +Fixed a problem where if a Buffer object containing a resource template +was longer than the actual resource template, an error was generated -- +even though the AML is legal. This case has been seen in the field. + +Fixed a problem with the header definition of the MADT PCAT_COMPAT flag. +The values for DUAL_PIC and MULTIPLE_APIC were reversed. + +Added header file changes for the TPM2 ACPI table. Update to new version +of the TCG specification. Adds a new TPM2 subtable for ARM SMC. + +Exported the external interfaces AcpiAcquireMutex and AcpiReleaseMutex. +These interfaces are intended to be used only in conjunction with the +predefined _DLM method (Device Lock Method). "This object appears in a +device scope when AML access to the device must be synchronized with the +OS environment". + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 143.1K Code, 60.0K Data, 203.1K Total + Debug Version: 204.0K Code, 84.3K Data, 288.3K Total + Previous Release: + Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total + Debug Version: 207.5K Code, 82.7K Data, 290.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem where an External() declaration could not refer to +a Field Unit. Erik Schmauss. + +Disassembler: Improved support for the Switch/Case operators. This +feature will disassemble AML code back to the original Switch operators +when possible, instead of an If..Else sequence. David Box + +iASL and disassembler: Improved the handling of multiple extraneous +parentheses for both ASL input and disassembled ASL output. + +Improved the behavior of the iASL compiler and disassembler to detect +improper use of external declarations + +Disassembler: Now aborts immediately upon detection of an unknown AML +opcode. The AML parser has no real way to recover from this, and can +result in the creation of an ill-formed parse tree that causes errors +later during the disassembly. + +All tools: Fixed a problem where the Unix application OSL did not handle +control-c correctly. For example, a control-c could incorrectly wake the +debugger. + +AcpiExec: Improved the Control-C handling and added a handler for +segmentation faults (SIGSEGV). Supports both Windows and Unix-like +environments. + +Reduced the verbosity of the generic unix makefiles. Previously, each +compilation displayed the full set of compiler options. This has been +eliminated as the options are easily inspected within the makefiles. Each +compilation now results in a single line of output. + +---------------------------------------- 03 March 2017. Summary of changes for version 20170303: Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/acfileio.c Thu Jun 1 00:01:19 2017 (r319365) @@ -531,8 +531,6 @@ AcValidateTableHeader ( if (!AcpiUtValidNameseg (TableHeader.Signature)) { - fprintf (stderr, "Invalid table signature: 0x%8.8X\n", - *ACPI_CAST_PTR (UINT32, TableHeader.Signature)); return (AE_BAD_SIGNATURE); } Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu Jun 1 00:01:19 2017 (r319365) @@ -316,11 +316,6 @@ FlGenerateFilename ( */ NewFilename = UtStringCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); - if (!NewFilename) - { - return (NULL); - } - strcpy (NewFilename, InputFilename); /* Try to find the last dot in the filename */ @@ -364,11 +359,6 @@ FlStrdup ( NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); - if (!NewString) - { - return (NULL); - } - strcpy (NewString, String); return (NewString); } Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/adisasm.c Thu Jun 1 00:01:19 2017 (r319365) @@ -537,7 +537,7 @@ AdDisassembleOneTable ( * the entire tree with the new information (namely, the * number of arguments per method) */ - if (AcpiDmGetExternalMethodCount ()) + if (AcpiDmGetUnresolvedExternalMethodCount ()) { Status = AdReparseOneTable (Table, File, OwnerId); if (ACPI_FAILURE (Status)) @@ -553,7 +553,7 @@ AdDisassembleOneTable ( * 1) Convert fixed-offset references to resource descriptors * to symbolic references (Note: modifies namespace) */ - AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); + AcpiDmConvertParseObjects (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); /* Optional displays */ @@ -616,7 +616,7 @@ AdReparseOneTable ( fprintf (stderr, "\nFound %u external control methods, " "reparsing with new information\n", - AcpiDmGetExternalMethodCount ()); + AcpiDmGetUnresolvedExternalMethodCount ()); /* Reparse, rebuild namespace */ @@ -642,7 +642,7 @@ AdReparseOneTable ( /* New namespace, add the external definitions first */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); /* For -ca option: clear the list of comment addresses. */ Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu Jun 1 00:01:19 2017 (r319365) @@ -208,11 +208,16 @@ AcpiDmInspectPossibleArgs ( ACPI_PARSE_OBJECT *Op); static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmCommonDescendingOp ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); +static ACPI_STATUS +AcpiDmProcessResourceDescriptors ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); /******************************************************************************* * @@ -395,21 +400,21 @@ AcpiDmCrossReferenceNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmConvertResourceIndexes + * FUNCTION: AcpiDmConvertParseObjects * * PARAMETERS: ParseTreeRoot - Root of the parse tree * NamespaceRoot - Root of the internal namespace * * RETURN: None * - * DESCRIPTION: Convert fixed-offset references to resource descriptors to - * symbolic references. Should only be called after namespace has - * been cross referenced. + * DESCRIPTION: Begin parse tree walk to perform conversions needed for + * disassembly. These include resource descriptors and switch/case + * operations. * ******************************************************************************/ void -AcpiDmConvertResourceIndexes ( +AcpiDmConvertParseObjects ( ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot) { @@ -443,9 +448,14 @@ AcpiDmConvertResourceIndexes ( Info.Level = 0; Info.WalkState = WalkState; - AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp, + AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmCommonDescendingOp, AcpiDmCommonAscendingOp, &Info); ACPI_FREE (WalkState); + + if (AcpiGbl_TempListHead) { + AcpiDmClearTempList(); + } + return; } @@ -737,7 +747,6 @@ AcpiDmLoadDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); /* Only interested in operators that create new names */ @@ -754,7 +763,7 @@ AcpiDmLoadDescendingOp ( { /* For all named operators, get the new name */ - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) { @@ -875,7 +884,6 @@ AcpiDmXrefDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if ((!(OpInfo->Flags & AML_NAMED)) && @@ -885,26 +893,7 @@ AcpiDmXrefDescendingOp ( { goto Exit; } - else if (Op->Common.Parent && - Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP) - { - /* External() NamePath */ - Path = Op->Common.Value.String; - ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer; - if (ObjectType == ACPI_TYPE_METHOD) - { - ParamCount = (UINT32) - Op->Common.Next->Common.Next->Common.Value.Integer; - } - - Flags |= ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_OPCODE; - AcpiDmAddOpToExternalList (Op, Path, - (UINT8) ObjectType, ParamCount, Flags); - - goto Exit; - } - /* Get the NamePath from the appropriate place */ if (OpInfo->Flags & AML_NAMED) @@ -924,9 +913,10 @@ AcpiDmXrefDescendingOp ( Path = NextOp->Common.Value.String; } } - else if (Op->Common.AmlOpcode == AML_SCOPE_OP) + else if (Op->Common.AmlOpcode == AML_SCOPE_OP || + Op->Common.AmlOpcode == AML_EXTERNAL_OP) { - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; } } else if (OpInfo->Flags & AML_CREATE) @@ -1060,21 +1050,59 @@ Exit: return (AE_OK); } +/******************************************************************************* + * + * FUNCTION: AcpiDmCommonDescendingOp + * + * PARAMETERS: ASL_WALK_CALLBACK + * + * RETURN: ACPI_STATUS + * + * DESCRIPTION: Perform parse tree preprocessing before main disassembly walk. + * + ******************************************************************************/ +static ACPI_STATUS +AcpiDmCommonDescendingOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context) +{ + ACPI_STATUS Status; + + /* Resource descriptor conversion */ + + Status = AcpiDmProcessResourceDescriptors (Op, Level, Context); + + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Switch/Case conversion */ + + Status = AcpiDmProcessSwitch (Op); + + return (AE_OK); +} + + /******************************************************************************* * - * FUNCTION: AcpiDmResourceDescendingOp + * FUNCTION: AcpiDmProcessResourceDescriptors * * PARAMETERS: ASL_WALK_CALLBACK * - * RETURN: None + * RETURN: ACPI_STATUS * - * DESCRIPTION: Process one parse op during symbolic resource index conversion. + * DESCRIPTION: Convert fixed-offset references to resource descriptors to + * symbolic references. Should only be called after namespace has + * been cross referenced. * ******************************************************************************/ static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmProcessResourceDescriptors ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) @@ -1085,7 +1113,6 @@ AcpiDmResourceDescendingOp ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status; - WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -1111,10 +1138,10 @@ AcpiDmResourceDescendingOp ( * If so, convert the reference into a symbolic reference. */ AcpiDmCheckResourceReference (Op, WalkState); + return (AE_OK); } - /******************************************************************************* * * FUNCTION: AcpiDmCommonAscendingOp @@ -1135,14 +1162,11 @@ AcpiDmCommonAscendingOp ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; ACPI_OBJECT_TYPE ObjectType; /* Close scope if necessary */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if (AcpiNsOpensScope (ObjectType)) @@ -1152,7 +1176,6 @@ AcpiDmCommonAscendingOp ( return (AE_OK); } - /******************************************************************************* * Modified: head/sys/contrib/dev/acpica/common/ahids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahids.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahids.c Thu Jun 1 00:01:19 2017 (r319365) @@ -187,6 +187,7 @@ const AH_DEVICE_ID AslDeviceIds[] = {"ACPI0011", "Generic Buttons Device"}, {"ACPI0012", "NVDIMM Root Device"}, {"ACPI0013", "Generic Event Device"}, + {"ACPI0014", "Wireless Power Calibration Device"}, {"ADMA0F28", "Intel Audio DMA"}, {"AMCR0F28", "Intel Audio Machine Driver"}, {"ATK4001", "Asus Radio Control Button"}, Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Thu Jun 1 00:01:19 2017 (r319365) @@ -254,6 +254,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"), AH_PREDEF ("_FSL", "Fan Set Level", "Control method that sets the fan device's speed level (performance state)"), AH_PREDEF ("_FST", "Fan Status", "Returns current status information for a fan device"), + AH_PREDEF ("_FUN", "Function Number", "Resource descriptor field"), AH_PREDEF ("_GAI", "Get Averaging Interval", "Returns the power meter averaging interval"), AH_PREDEF ("_GCP", "Get Capabilities", "Get device time capabilities"), AH_PREDEF ("_GHL", "Get Hardware Limit", "Returns the hardware limit enforced by the power meter"), @@ -270,6 +271,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_GWS", "Get Wake Status", "Return status of wake alarms"), AH_PREDEF ("_HE_", "High-Edge", "Interrupt triggering, Resource Descriptor field"), AH_PREDEF ("_HID", "Hardware ID", "Returns a device's Plug and Play Hardware ID"), + AH_PREDEF ("_HMA", "Heterogeneous Memory Attributes", "Returns a list of HMAT structures."), AH_PREDEF ("_HOT", "Hot Temperature", "Returns the critical temperature for sleep (entry to S4)"), AH_PREDEF ("_HPP", "Hot Plug Parameters", "Returns a list of hot-plug information for a PCI device"), AH_PREDEF ("_HPX", "Hot Plug Parameter Extensions", "Returns a list of hot-plug information for a PCI device. Supersedes _HPP"), @@ -287,6 +289,9 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"), AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"), AH_PREDEF ("_LPI", "Low Power Idle States", "Returns a list of supported low power idle states"), + AH_PREDEF ("_LSI", "Label Storage Information", "Returns information about the Label Storage Area associated with the NVDIMM object."), + AH_PREDEF ("_LSR", "Label Storage Read", "Returns label data from the Label Storage Area of the NVDIMM object."), + AH_PREDEF ("_LSW", "Label Storage Write", "Writes label data in to the Label Storage Area of the NVDIMM object."), AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"), AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"), AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"), @@ -439,6 +444,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_UPC", "USB Port Capabilities", "Returns a list of USB port capabilities"), AH_PREDEF ("_UPD", "User Presence Detect", "Returns user detection information"), AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"), + AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahtable.c Thu Jun 1 00:01:19 2017 (r319365) @@ -218,6 +218,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_FPDT, "Firmware Performance Data Table"}, {ACPI_SIG_GTDT, "Generic Timer Description Table"}, {ACPI_SIG_HEST, "Hardware Error Source Table"}, + {ACPI_SIG_HMAT, "Heterogeneous Memory Attributes Table"}, {ACPI_SIG_HPET, "High Precision Event Timer table"}, {ACPI_SIG_IORT, "IO Remapping Table"}, {ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"}, @@ -232,6 +233,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, + {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, {ACPI_RSDP_NAME,"Root System Description Pointer"}, {ACPI_SIG_RSDT, "Root System Description Table"}, @@ -253,6 +255,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_WDDT, "Watchdog Description Table"}, {ACPI_SIG_WDRT, "Watchdog Resource Table"}, {ACPI_SIG_WPBT, "Windows Platform Binary Table"}, + {ACPI_SIG_WSMT, "Windows SMM Security Migrations Table"}, {ACPI_SIG_XENV, "Xen Environment table"}, {ACPI_SIG_XSDT, "Extended System Description Table"}, {NULL, NULL} Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Thu Jun 1 00:01:19 2017 (r319365) @@ -186,6 +186,10 @@ const AH_UUID Gbl_AcpiUuids[] = {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + {"[Processor Properties]", NULL}, + {"Cache Properties", UUID_CACHE_PROPERTIES}, + {"Physical Package Property", UUID_PHYSICAL_PROPERTY}, + {"[Miscellaneous]", NULL}, {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/dmextern.c Thu Jun 1 00:01:19 2017 (r319365) @@ -199,7 +199,10 @@ static const char *AcpiGbl_DmTypeNames[] = #define METHOD_SEPARATORS " \t,()\n" +static const char *ExternalConflictMessage = + " // Conflicts with a later declaration"; + /* Local prototypes */ static const char * @@ -211,6 +214,16 @@ AcpiDmNormalizeParentPrefix ( ACPI_PARSE_OBJECT *Op, char *Path); +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath); + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path); + static void AcpiDmAddPathToExternalList ( char *Path, @@ -226,7 +239,22 @@ AcpiDmCreateNewExternal ( UINT32 Value, UINT16 Flags); +static void +AcpiDmCheckForExternalConflict ( + char *Path); +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node); + + +static void +AcpiDmConflictingDeclaration ( + char *Path); + + /******************************************************************************* * * FUNCTION: AcpiDmGetObjectTypeName @@ -582,7 +610,7 @@ AcpiDmGetExternalsFromFile ( { /* Add the external(s) to the namespace */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); AcpiOsPrintf ("%s: Imported %u external method definitions\n", Gbl_ExternalRefFilename, ImportCount); @@ -698,6 +726,86 @@ AcpiDmAddOpToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmGetExternalAndInternalPath + * + * PARAMETERS: Node - Namespace node for object to be added + * ExternalPath - Will contain the external path of the node + * InternalPath - Will contain the internal path of the node + * + * RETURN: None + * + * DESCRIPTION: Get the External and Internal path from the given node. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath) +{ + ACPI_STATUS Status; + + + if (!Node) + { + return (AE_BAD_PARAMETER); + } + + /* Get the full external and internal pathnames to the node */ + + *ExternalPath = AcpiNsGetExternalPathname (Node); + if (!*ExternalPath) + { + return (AE_BAD_PATHNAME); + } + + Status = AcpiNsInternalizeName (*ExternalPath, InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (*ExternalPath); + return (Status); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmRemoveRootPrefix + * + * PARAMETERS: Path - Remove Root prefix from this Path + * + * RETURN: None + * + * DESCRIPTION: Remove the root prefix character '\' from Path. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path) +{ + char *InputPath = *Path; + + + if ((*InputPath == AML_ROOT_PREFIX) && (InputPath[1])) + { + if (!memmove(InputPath, InputPath+1, strlen(InputPath))) + { + return (AE_ERROR); + } + + *Path = InputPath; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddNodeToExternalList * * PARAMETERS: Node - Namespace node for object to be added @@ -727,46 +835,27 @@ AcpiDmAddNodeToExternalList ( { char *ExternalPath; char *InternalPath; - char *Temp; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (DmAddNodeToExternalList); - - if (!Node) - { - return_VOID; - } - /* Get the full external and internal pathnames to the node */ - ExternalPath = AcpiNsGetExternalPathname (Node); - if (!ExternalPath) - { - return_VOID; - } - - Status = AcpiNsInternalizeName (ExternalPath, &InternalPath); + Status = AcpiDmGetExternalAndInternalPath (Node, &ExternalPath, &InternalPath); if (ACPI_FAILURE (Status)) { - ACPI_FREE (ExternalPath); return_VOID; } /* Remove the root backslash */ - if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) + Status = AcpiDmRemoveRootPrefix (&ExternalPath); + if (ACPI_FAILURE (Status)) { - Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); - if (!Temp) - { - return_VOID; - } - - strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); - ExternalPath = Temp; + ACPI_FREE (InternalPath); + return_VOID; } /* Create the new External() declaration node */ @@ -1013,68 +1102,171 @@ AcpiDmCreateNewExternal ( /******************************************************************************* * - * FUNCTION: AcpiDmAddExternalsToNamespace + * FUNCTION: AcpiDmResolveExternal * - * PARAMETERS: None + * PARAMETERS: Path - Path of the external + * Type - Type of the external + * Node - Input node for AcpiNsLookup * + * RETURN: Status + * + * DESCRIPTION: Resolve the external within the namespace by AcpiNsLookup. + * If the returned node is an external and has the same type + * we assume that it was either an existing external or a + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + + + Status = AcpiNsLookup (NULL, Path, Type, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + NULL, Node); + + if (!Node) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "while adding external to namespace [%s]", Path)); + } + + /* Note the asl code "external(a) external(a)" is acceptable ASL */ + + else if ((*Node)->Type == Type && + (*Node)->Flags & ANOBJ_IS_EXTERNAL) + { + return (AE_OK); + } + else + { + ACPI_EXCEPTION ((AE_INFO, AE_ERROR, + "[%s] has conflicting declarations", Path)); + } + + return (AE_ERROR); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmCreateSubobjectForExternal + * + * PARAMETERS: Type - Type of the external + * Node - Namespace node from AcpiNsLookup + * ParamCount - Value to be used for Method + * * RETURN: None * - * DESCRIPTION: Add all externals to the namespace. Allows externals to be + * DESCRIPTION: Add one external to the namespace. Allows external to be * "resolved". * ******************************************************************************/ void -AcpiDmAddExternalsToNamespace ( - void) +AcpiDmCreateSubobjectForExternal ( + UINT8 Type, + ACPI_NAMESPACE_NODE **Node, + UINT32 ParamCount) { - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - while (External) + switch (Type) { - /* Add the external name (object) into the namespace */ + case ACPI_TYPE_METHOD: - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + /* For methods, we need to save the argument count */ - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "while adding external to namespace [%s]", - External->Path)); - } + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + ObjDesc->Method.ParamCount = (UINT8) ParamCount; + (*Node)->Object = ObjDesc; + break; - else switch (External->Type) - { - case ACPI_TYPE_METHOD: + case ACPI_TYPE_REGION: - /* For methods, we need to save the argument count */ + /* Regions require a region sub-object */ - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - ObjDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = ObjDesc; - break; + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + ObjDesc->Region.Node = *Node; + (*Node)->Object = ObjDesc; + break; - case ACPI_TYPE_REGION: + default: - /* Regions require a region sub-object */ + break; + } +} - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); - ObjDesc->Region.Node = Node; - Node->Object = ObjDesc; - break; - default: +/******************************************************************************* + * + * FUNCTION: AcpiDmAddOneExternalToNamespace + * + * PARAMETERS: Path - External parse object + * Type - Type of parse object + * ParamCount - External method parameter count + * + * RETURN: None + * + * DESCRIPTION: Add one external to the namespace by resolvign the external + * (by performing a namespace lookup) and annotating the resulting + * namespace node with the approperiate information if the type + * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. + * + ******************************************************************************/ - break; - } +void +AcpiDmAddOneExternalToNamespace ( + char *Path, + UINT8 Type, + UINT32 ParamCount) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + Status = AcpiDmResolveExternal (Path, Type, &Node); + + if (ACPI_FAILURE (Status)) + { + return; + } + + AcpiDmCreateSubobjectForExternal (Type, &Node, ParamCount); + +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddExternalListToNamespace + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Add all externals within AcpiGbl_ExternalList to the namespace. + * Allows externals to be "resolved". + * + ******************************************************************************/ + +void +AcpiDmAddExternalListToNamespace ( + void) +{ + ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; + + + while (External) + { + AcpiDmAddOneExternalToNamespace (External->InternalPath, + External->Type, External->Value); External = External->Next; } } @@ -1082,23 +1274,28 @@ AcpiDmAddExternalsToNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmGetExternalMethodCount + * FUNCTION: AcpiDmGetUnresolvedExternalMethodCount * * PARAMETERS: None * - * RETURN: The number of control method externals in the external list + * RETURN: The number of unresolved control method externals in the + * external list * - * DESCRIPTION: Return the number of method externals that have been generated. - * If any control method externals have been found, we must - * re-parse the entire definition block with the new information - * (number of arguments for the methods.) This is limitation of - * AML, we don't know the number of arguments from the control - * method invocation itself. + * DESCRIPTION: Return the number of unresolved external methods that have been + * generated. If any unresolved control method externals have been + * found, we must re-parse the entire definition block with the new + * information (number of arguments for the methods.) + * This is limitation of AML, we don't know the number of arguments + * from the control method invocation itself. * + * Note: resolved external control methods are external control + * methods encoded with the AML_EXTERNAL_OP bytecode within the + * AML being disassembled. + * ******************************************************************************/ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 1 02:31:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B336DBF1335; Thu, 1 Jun 2017 02:31:15 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8137976391; Thu, 1 Jun 2017 02:31:15 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v512VEDw074396; Thu, 1 Jun 2017 02:31:14 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v512VE6F074395; Thu, 1 Jun 2017 02:31:14 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201706010231.v512VE6F074395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Thu, 1 Jun 2017 02:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319368 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 02:31:15 -0000 Author: rene (doc,ports committer) Date: Thu Jun 1 02:31:14 2017 New Revision: 319368 URL: https://svnweb.freebsd.org/changeset/base/319368 Log: Welcome back bapt@ to portmgr Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Thu Jun 1 00:50:58 2017 (r319367) +++ head/share/misc/organization.dot Thu Jun 1 02:31:14 2017 (r319368) @@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretary\ncore-secret doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bdrewery, feld\nmat, rene, swills"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nfeld, mat, rene, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] From owner-svn-src-head@freebsd.org Thu Jun 1 05:09:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA214AF7297; Thu, 1 Jun 2017 05:09:06 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4CE383310; Thu, 1 Jun 2017 05:09:06 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6395B5A9F12; Thu, 1 Jun 2017 05:03:39 +0000 (UTC) Date: Thu, 1 Jun 2017 05:03:39 +0000 From: Brooks Davis To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Message-ID: <20170601050339.GA48398@spindle.one-eyed-alien.net> References: <201705310801.v4V81CjO004032@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline In-Reply-To: <201705310801.v4V81CjO004032@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 05:09:07 -0000 --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: > Author: ngie > Date: Wed May 31 08:01:12 2017 > New Revision: 319295 > URL: https://svnweb.freebsd.org/changeset/base/319295 >=20 > Log: > Update the usr.bin/mkimg golden test output files after ^/head@r319125 > =20 > ^/head@r319125 changed the location of the backup pmbr, requiring the > output files to be regenerated, since they're binary disk dumps. > =20 > The output files were regenerated with "make rebase"--fixed in > ^/head@r319294. These should not be stored uuencoded. It serves no purpose other than bloating the repo and causing spammy commit mails like this one where we got a huge tail of garbage output. -- Brooks --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJZL6AqAAoJEKzQXbSebgfAEg4H/0f045fAAf4RyrTbOVb+jyDP yEDK4uFNHjB1OTaoexbGSfwv5U0Ub8zOyMZUD+jkYS1dLvQepaPE5dZDWJLGxy6+ D6FkRjeTkFRasavCKqnAH0QtO0rduLzP/5UvRpxR6dNIfGvTvNgQ+sPfBfYWtYvf MyHcgWp9YUJnxg3V39BcZA4Qlsb4LNV7Iyg48oTSW4VA6G8yvQH4sinsreWW9mi1 m9rqtxGdLknQUcQkKR1TGB7uwKGaboVpQurJ81dHpRdWcF2ZMmIujVLMTaytFldx eKf5FMEt2++93nF0h04m5WJzPikokRLbCxpc4DCtdcg4qpt+2HbFn3f5exInvYc= =VOr/ -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v-- From owner-svn-src-head@freebsd.org Thu Jun 1 06:06:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77E1B79D38; Thu, 1 Jun 2017 06:06:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 753A8649E5; Thu, 1 Jun 2017 06:06:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id f27so6714681pfe.0; Wed, 31 May 2017 23:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=iLeso6bHhTujEVy9zuJ6kt5CO1rYEnX2xmduDQM/x80=; b=bEFbLlYkxBk9542J+ctlL3tOqrfGVW2uBKHKh7vJ9ycibySZdWop5iKLYOl9fUjgZ+ XJ1lbUc+kJKQGCbnG5queV0GyuSqN04xGiiLKoL3SWBmeqfbNbfIkb0XxlZ7coCPFs2T F2fqlhAs78OhFAFcSolmBGdtW7sO0+4rF8H7oAsVGkm45YAcI5LtvoPvkqjlNH+e3Ypu h74eJOP+y8MTh7u0Eb0wTEZa9OjuDNdTANvUN00YqzXNFb9NI5h0E+8Q9Dr7PLdbUFIt UgX9AlLhe0B/j9rGcrKLO+81gj4Oo0w6psCWA2bk8uTVUGuENggrGhLamxwJ7NvmP23E 7x0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=iLeso6bHhTujEVy9zuJ6kt5CO1rYEnX2xmduDQM/x80=; b=VE1b5BmA0mEhwrmGSu/W4tblKr+ifFNomKTWt1zAuz64B0XUOQMCET2t9pZysbNdzX sf0nc6NmXTDa4sNeiyd3TYKTOXLEQFopC5pIFWwowmZSvKgywG6I3cMFEnJPaisQDppX Z99CU2PeStzkdKp7nhH3MsEol1HOByig9z41eOvGCF2xQ8juAGnrjY3SvXRPAD9XBRs5 eKJhHXQ+AlRrY5SdGKJJnyEcxn9Y/JLr3TneZalJ0fJ9kPowNVTgZtAmYU/0GWRQl27P RSBBogRiEWfkVZoNy2YxneIwOYalRrW8SCqoFJIjqH5PH5y7eMyfZfIxVFCQF7JByA2+ 9G6Q== X-Gm-Message-State: AODbwcDi54SgY/spnWqedUxlWnZpEIJAGi8NYiBEIruIbjs4V5rkdCTC frvOpYoawkidTcUtLs4= X-Received: by 10.98.19.206 with SMTP id 75mr34496057pft.208.1496297197773; Wed, 31 May 2017 23:06:37 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id f86sm32096191pfj.128.2017.05.31.23.06.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 23:06:37 -0700 (PDT) From: "Ngie Cooper (yaneurabeya)" Message-Id: <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_DA06CB10-94EA-4DD7-B34D-674163D3BACC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Date: Wed, 31 May 2017 23:06:50 -0700 In-Reply-To: <20170601050339.GA48398@spindle.one-eyed-alien.net> Cc: Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Brooks Davis References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 06:06:38 -0000 --Apple-Mail=_DA06CB10-94EA-4DD7-B34D-674163D3BACC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 31, 2017, at 10:03 PM, Brooks Davis wrote: >=20 > On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: >> Author: ngie >> Date: Wed May 31 08:01:12 2017 >> New Revision: 319295 >> URL: https://svnweb.freebsd.org/changeset/base/319295 >>=20 >> Log: >> Update the usr.bin/mkimg golden test output files after = ^/head@r319125 >>=20 >> ^/head@r319125 changed the location of the backup pmbr, requiring = the >> output files to be regenerated, since they're binary disk dumps. >>=20 >> The output files were regenerated with "make rebase"--fixed in >> ^/head@r319294. >=20 > These should not be stored uuencoded. It serves no purpose other > than bloating the repo and causing spammy commit mails like this one > where we got a huge tail of garbage output. Hi Brooks, I=E2=80=99m not entirely sure why the files were uuencoded to be = honest. I think that=E2=80=99s a good question for Marcel and some of = the folks at Juniper, since they wrote the tool/tests. Thanks! -Ngie PS I agree based on what little I know, but I don=E2=80=99t necessarily = know what trade offs were made with writing these tests. --Apple-Mail=_DA06CB10-94EA-4DD7-B34D-674163D3BACC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJZL676AAoJEPWDqSZpMIYVaFEP/0TYeegYaOrr06PMIZWAILpK GSU+tTobSMU4CBEkyQaUuQACCcvytTaeRwDItpspCTUP97A5vHADDKgV9onBBp2f RSLiWaE23EQ1X+auLQOkm8ihKic8fvLQhlpXxCDyVanguByhn8LaIv2rMnWiADbF pdWPvi8mkmg+wO1c/uhJGjs7Wy/QTw5XVljBmd+d10ElKpWUGam5SL2FVuyA42Yh NPp6Jz+4CdpYpt89+O2FGdX3ZiUSIprOODNesPWzEHCIBfDBU2FnYipZZzDa1acD /j/T4msKUfNT4zQwGXS72yf57gEsgUY8LNzZ2Xx2JGZ+TrKKBgA79P3zZsgMOF7E nL2Fg/7bNxElfAP1jdb4rOBEY7F23tEZsLHGXIDIW1d6dBf5Cowao2vv+EpKVC8l QRSWflLEAw3zqGLj2s58aJjJUj16VmmYb3hBkdp9rNw/o7vJn5VsIcz336OpJ8LA s/NbJoSmPsnj8zPkHqu1gOTNj38jQu87Pm+asWG3u2Dfr5eYJ+FZi/A1BmI4ikPD +mCjwKfUt1luYeue9sWw/ouzV9GMomuEDllXOhAl9fB2nOtR6hciOfKyx7BNfnAW kFff7F9wuuddRU/pFpawuIsHZ/4nh3lf9G9JLbiAauDtUm+y45sHZrwbvnjDGWxd Ko9D8ZKiZKRFU9RcRDfp =5SHd -----END PGP SIGNATURE----- --Apple-Mail=_DA06CB10-94EA-4DD7-B34D-674163D3BACC-- From owner-svn-src-head@freebsd.org Thu Jun 1 06:12:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6006FB7A645; Thu, 1 Jun 2017 06:12:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E95A64DC2; Thu, 1 Jun 2017 06:12:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v516CQ5b067876; Thu, 1 Jun 2017 06:12:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v516CPGj067866; Thu, 1 Jun 2017 06:12:25 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706010612.v516CPGj067866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 1 Jun 2017 06:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319369 - in head: lib/libc/rpc lib/libc/xdr sys/rpc sys/xdr usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 06:12:27 -0000 Author: delphij Date: Thu Jun 1 06:12:25 2017 New Revision: 319369 URL: https://svnweb.freebsd.org/changeset/base/319369 Log: * limit size of buffers to RPC_MAXDATASIZE * don't leak memory * be more picky about bad parameters From: https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt via NetBSD. Reviewed by: emaste, cem (earlier version) Differential Revision: https://reviews.freebsd.org/D10922 MFC after: 3 days Modified: head/lib/libc/rpc/rpc_generic.c head/lib/libc/rpc/rpcb_prot.c head/lib/libc/rpc/rpcb_st_xdr.c head/lib/libc/xdr/xdr.c head/sys/rpc/rpc_generic.c head/sys/rpc/rpcb_clnt.c head/sys/rpc/rpcb_prot.c head/sys/xdr/xdr.c head/usr.sbin/rpcbind/rpcb_svc_com.c Modified: head/lib/libc/rpc/rpc_generic.c ============================================================================== --- head/lib/libc/rpc/rpc_generic.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/lib/libc/rpc/rpc_generic.c Thu Jun 1 06:12:25 2017 (r319369) @@ -609,6 +609,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf switch (af) { case AF_INET: + if (nbuf->len < sizeof(*sin)) + return NULL; sin = nbuf->buf; if (inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf) == NULL) @@ -620,6 +622,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf break; #ifdef INET6 case AF_INET6: + if (nbuf->len < sizeof(*sin6)) + return NULL; sin6 = nbuf->buf; if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6) == NULL) @@ -658,6 +662,10 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr) port = 0; sin = NULL; + + if (uaddr == NULL) + return NULL; + addrstr = strdup(uaddr); if (addrstr == NULL) return NULL; Modified: head/lib/libc/rpc/rpcb_prot.c ============================================================================== --- head/lib/libc/rpc/rpcb_prot.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/lib/libc/rpc/rpcb_prot.c Thu Jun 1 06:12:25 2017 (r319369) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" bool_t @@ -62,13 +63,13 @@ xdr_rpcb(XDR *xdrs, RPCB *objp) if (!xdr_rpcvers(xdrs, &objp->r_vers)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_netid, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_addr, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_addr, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_owner, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_owner, RPC_MAXDATASIZE)) { return (FALSE); } return (TRUE); @@ -162,19 +163,19 @@ xdr_rpcblist(XDR *xdrs, RPCBLIST **rp) bool_t xdr_rpcb_entry(XDR *xdrs, rpcb_entry *objp) { - if (!xdr_string(xdrs, &objp->r_maddr, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_maddr, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_nc_netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_nc_netid, RPC_MAXDATASIZE)) { return (FALSE); } if (!xdr_u_int32_t(xdrs, &objp->r_nc_semantics)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_nc_protofmly, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_nc_protofmly, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_nc_proto, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_nc_proto, RPC_MAXDATASIZE)) { return (FALSE); } return (TRUE); @@ -289,7 +290,7 @@ xdr_rpcb_rmtcallres(XDR *xdrs, struct rpcb_rmtcallres bool_t dummy; struct r_rpcb_rmtcallres *objp = (struct r_rpcb_rmtcallres *)(void *)p; - if (!xdr_string(xdrs, &objp->addr, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->addr, RPC_MAXDATASIZE)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->results.results_len)) { Modified: head/lib/libc/rpc/rpcb_st_xdr.c ============================================================================== --- head/lib/libc/rpc/rpcb_st_xdr.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/lib/libc/rpc/rpcb_st_xdr.c Thu Jun 1 06:12:25 2017 (r319369) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include +#include #include "un-namespace.h" /* Link list of all the stats about getport and getaddr */ @@ -63,7 +64,7 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp) if (!xdr_int(xdrs, &objp->failure)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); } @@ -115,7 +116,7 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *ob IXDR_PUT_INT32(buf, objp->failure); IXDR_PUT_INT32(buf, objp->indirect); } - if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); } pnext = &objp->next; @@ -154,7 +155,7 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *ob objp->failure = (int)IXDR_GET_INT32(buf); objp->indirect = (int)IXDR_GET_INT32(buf); } - if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); } if (!xdr_pointer(xdrs, (char **) pnext, @@ -182,7 +183,7 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *ob if (!xdr_int(xdrs, &objp->indirect)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); } if (!xdr_pointer(xdrs, (char **) pnext, Modified: head/lib/libc/xdr/xdr.c ============================================================================== --- head/lib/libc/xdr/xdr.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/lib/libc/xdr/xdr.c Thu Jun 1 06:12:25 2017 (r319369) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include "un-namespace.h" @@ -64,7 +66,6 @@ typedef u_quad_t u_longlong_t; /* ANSI unsign */ #define XDR_FALSE ((long) 0) #define XDR_TRUE ((long) 1) -#define LASTUNSIGNED ((u_int) 0-1) /* * for unit alignment @@ -561,6 +562,7 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int m { char *sp = *cpp; /* sp is the actual string pointer */ u_int nodesize; + bool_t ret, allocated = FALSE; /* * first deal with the length since xdr bytes are counted @@ -584,6 +586,7 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int m } if (sp == NULL) { *cpp = sp = mem_alloc(nodesize); + allocated = TRUE; } if (sp == NULL) { warnx("xdr_bytes: out of memory"); @@ -592,7 +595,14 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int m /* FALLTHROUGH */ case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, nodesize)); + ret = xdr_opaque(xdrs, sp, nodesize); + if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) { + if (allocated == TRUE) { + free(sp); + *cpp = NULL; + } + } + return (ret); case XDR_FREE: if (sp != NULL) { @@ -683,6 +693,7 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) char *sp = *cpp; /* sp is the actual string pointer */ u_int size; u_int nodesize; + bool_t ret, allocated = FALSE; /* * first deal with the length since xdr strings are counted-strings @@ -716,8 +727,10 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) if (nodesize == 0) { return (TRUE); } - if (sp == NULL) + if (sp == NULL) { *cpp = sp = mem_alloc(nodesize); + allocated = TRUE; + } if (sp == NULL) { warnx("xdr_string: out of memory"); return (FALSE); @@ -726,7 +739,14 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) /* FALLTHROUGH */ case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, size)); + ret = xdr_opaque(xdrs, sp, size); + if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) { + if (allocated == TRUE) { + free(sp); + *cpp = NULL; + } + } + return (ret); case XDR_FREE: mem_free(sp, nodesize); @@ -744,7 +764,7 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) bool_t xdr_wrapstring(XDR *xdrs, char **cpp) { - return xdr_string(xdrs, cpp, LASTUNSIGNED); + return xdr_string(xdrs, cpp, RPC_MAXDATASIZE); } /* Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/sys/rpc/rpc_generic.c Thu Jun 1 06:12:25 2017 (r319369) @@ -311,6 +311,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf switch (af) { case AF_INET: + if (nbuf->len < sizeof(*sin)) + return NULL; sin = nbuf->buf; if (inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf) == NULL) @@ -323,6 +325,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf break; #ifdef INET6 case AF_INET6: + if (nbuf->len < sizeof(*sin6)) + return NULL; sin6 = nbuf->buf; if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6) == NULL) @@ -366,6 +370,10 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr) port = 0; sin = NULL; + + if (uaddr == NULL) + return NULL; + addrstr = strdup(uaddr, M_RPC); if (addrstr == NULL) return NULL; Modified: head/sys/rpc/rpcb_clnt.c ============================================================================== --- head/sys/rpc/rpcb_clnt.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/sys/rpc/rpcb_clnt.c Thu Jun 1 06:12:25 2017 (r319369) @@ -1287,6 +1287,11 @@ xdr_netbuf(XDR *xdrs, struct netbuf *objp) return (FALSE); } pp = &objp->buf; + + if (objp->maxlen > RPC_MAXDATASIZE) { + return (FALSE); + } + dummy = xdr_bytes(xdrs, (char **) pp, (u_int *)&(objp->len), objp->maxlen); return (dummy); Modified: head/sys/rpc/rpcb_prot.c ============================================================================== --- head/sys/rpc/rpcb_prot.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/sys/rpc/rpcb_prot.c Thu Jun 1 06:12:25 2017 (r319369) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include bool_t @@ -74,13 +75,13 @@ xdr_rpcb(XDR *xdrs, RPCB *objp) if (!xdr_uint32_t(xdrs, &objp->r_vers)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_netid, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_addr, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_addr, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_owner, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_owner, RPC_MAXDATASIZE)) { return (FALSE); } return (TRUE); @@ -175,19 +176,19 @@ xdr_rpcblist(XDR *xdrs, RPCBLIST **rp) bool_t xdr_rpcb_entry(XDR *xdrs, rpcb_entry *objp) { - if (!xdr_string(xdrs, &objp->r_maddr, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_maddr, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_nc_netid, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_nc_netid, RPC_MAXDATASIZE)) { return (FALSE); } if (!xdr_uint32_t(xdrs, &objp->r_nc_semantics)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_nc_protofmly, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_nc_protofmly, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_string(xdrs, &objp->r_nc_proto, (u_int)~0)) { + if (!xdr_string(xdrs, &objp->r_nc_proto, RPC_MAXDATASIZE)) { return (FALSE); } return (TRUE); Modified: head/sys/xdr/xdr.c ============================================================================== --- head/sys/xdr/xdr.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/sys/xdr/xdr.c Thu Jun 1 06:12:25 2017 (r319369) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -62,7 +64,6 @@ typedef u_quad_t u_longlong_t; /* ANSI unsign */ #define XDR_FALSE ((long) 0) #define XDR_TRUE ((long) 1) -#define LASTUNSIGNED ((u_int) 0-1) /* * for unit alignment @@ -503,6 +504,7 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int m { char *sp = *cpp; /* sp is the actual string pointer */ u_int nodesize; + bool_t ret, allocated = FALSE; /* * first deal with the length since xdr bytes are counted @@ -526,6 +528,7 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int m } if (sp == NULL) { *cpp = sp = mem_alloc(nodesize); + allocated = TRUE; } if (sp == NULL) { printf("xdr_bytes: out of memory"); @@ -534,7 +537,14 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int m /* FALLTHROUGH */ case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, nodesize)); + ret = xdr_opaque(xdrs, sp, nodesize); + if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) { + if (allocated == TRUE) { + mem_free(sp, nodesize); + *cpp = NULL; + } + } + return (ret); case XDR_FREE: if (sp != NULL) { @@ -622,6 +632,7 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) char *sp = *cpp; /* sp is the actual string pointer */ u_int size; u_int nodesize; + bool_t ret, allocated = FALSE; /* * first deal with the length since xdr strings are counted-strings @@ -655,8 +666,10 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) if (nodesize == 0) { return (TRUE); } - if (sp == NULL) + if (sp == NULL) { *cpp = sp = mem_alloc(nodesize); + allocated = TRUE; + } if (sp == NULL) { printf("xdr_string: out of memory"); return (FALSE); @@ -665,7 +678,14 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) /* FALLTHROUGH */ case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, size)); + ret = xdr_opaque(xdrs, sp, size); + if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) { + if (allocated == TRUE) { + mem_free(sp, nodesize); + *cpp = NULL; + } + } + return (ret); case XDR_FREE: mem_free(sp, nodesize); @@ -683,7 +703,7 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) bool_t xdr_wrapstring(XDR *xdrs, char **cpp) { - return xdr_string(xdrs, cpp, LASTUNSIGNED); + return xdr_string(xdrs, cpp, RPC_MAXDATASIZE); } /* Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_svc_com.c Thu Jun 1 02:31:14 2017 (r319368) +++ head/usr.sbin/rpcbind/rpcb_svc_com.c Thu Jun 1 06:12:25 2017 (r319369) @@ -55,6 +55,7 @@ #include #ifdef PORTMAP #include +#include #include #endif /* PORTMAP */ #include @@ -418,7 +419,8 @@ rpcbproc_taddr2uaddr_com(void *arg, struct svc_req *rq static bool_t xdr_encap_parms(XDR *xdrs, struct encap_parms *epp) { - return (xdr_bytes(xdrs, &(epp->args), (u_int *) &(epp->arglen), ~0)); + return (xdr_bytes(xdrs, &(epp->args), (u_int *) &(epp->arglen), + RPC_MAXDATASIZE)); } /* From owner-svn-src-head@freebsd.org Thu Jun 1 06:51:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F29B7E547; Thu, 1 Jun 2017 06:51:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F79667009; Thu, 1 Jun 2017 06:51:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id f27so6958922pfe.0; Wed, 31 May 2017 23:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=WEPNI3+yX3/Pg85Y2q1TI8uM68J8fOsITwz9IPIU+jQ=; b=ackxw2BaFIwB/3Dv2cTJX/awbeuqA19xV3ZUQzayuKst2IzhUneEoBRBLCICcnUGc2 vZZOOv7O06ORiWuhq92LfymQB1jJjCCu0f0OBor3Hz2B4l10ceGa0g43xNiqnTB6iBfV mW9FvFT3nnMNNKG4/huZWyMusUkidUVuHp1nUH1aJQZp5ua0Y0hn8WPuyDLsIhDnk9vc G2t4i0ph8dqcAjiht17+aswL4L3INQyW170zlOZHCkZ9OxhX7lkmbYqBBGMiFD85j/Tv NKsoWNEWOYaOGKqO+eUHSQp0qNAq7LCDGxs1oMpemtP49IuE3uGIQozFUzukXWsjp+Vv SETA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=WEPNI3+yX3/Pg85Y2q1TI8uM68J8fOsITwz9IPIU+jQ=; b=nDSgyRsPwlZk6cz+qHFLn5WMaRZ0eZNi1XjKh2mWPt4NNRGaQy47S5PG0T34u+NiPN Ss/3fytu4aQIFZSFUky8qE9FQr9Rc3c/fc7MvTADkX7az9W3tBJmIt8gc//AaOPbvvbj JVcpjtKGoFYB0dHwZdekkAFFx461rRLdTQu+vAnyqSXm7Vg+b4gL7umLx3dXm15I1EOr z0vNf08vMfmkz7ytw8hrGeVo+ibJMcz7iBfd5my27UmbjxCn2+lo9/9qMShshqv7oZVy 6pcdh8RKK8Tf1BOEm//RNoeiK9mF9jPdxesTJs46FGIDe2fDm10uLfXRc00p7D/5wVNd 4/Sw== X-Gm-Message-State: AODbwcDp6fMJdHi6WI56R9FkDOi3fmhMfEdG6XVnqLMAhM+z8QIYvVsj Wa/XgrY7+Hc/Dxuryhc= X-Received: by 10.98.222.133 with SMTP id h127mr33631614pfg.63.1496299907589; Wed, 31 May 2017 23:51:47 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id h28sm35819805pfd.55.2017.05.31.23.51.46 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 23:51:46 -0700 (PDT) Subject: Re: svn commit: r316286 - in head: lib/libprocstat sys/kern sys/sys usr.bin/gcore usr.bin/procstat Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C7CF6341-8A87-4E5A-909F-E8B30384B141"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201703301821.v2UILbYW005136@repo.freebsd.org> Date: Wed, 31 May 2017 23:51:44 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2F4F9FEA-F8F4-4F71-A88F-8ABF795C0B2C@gmail.com> References: <201703301821.v2UILbYW005136@repo.freebsd.org> To: Tycho Nightingale X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 06:51:49 -0000 --Apple-Mail=_C7CF6341-8A87-4E5A-909F-E8B30384B141 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Mar 30, 2017, at 11:21, Tycho Nightingale wrote: > > Author: tychon > Date: Thu Mar 30 18:21:36 2017 > New Revision: 316286 > URL: https://svnweb.freebsd.org/changeset/base/316286 > > Log: > Add support for capturing 'struct ptrace_lwpinfo' for signals > resulting in a process dumping core in the corefile. > > Also extend procstat to view select members of 'struct ptrace_lwpinfo' > from the contents of the note. > > Sponsored by: Dell EMC Isilon Hi Tycho, Should this be MFCed? Thanks, -Ngie --Apple-Mail=_C7CF6341-8A87-4E5A-909F-E8B30384B141 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZL7mBAAoJEPWDqSZpMIYV3jMP/17m0n3qWFyWcRXvJlAhGego roNMs7XXgXTKVgB29PWmEPC8O0dl8gig/6yodx1e6T9bI2oqNajrZuhdNtPVswEB +t3Mfps0NB+dpvFquhw1wpeVNtT8rAbkdrar/IRME5XA+WF7c5VM/erQ056ycIVj J/dYV9SRBucDILF2M0EJO+ALD/SbmfopEE1HYeB1viR9Yfu4NveIhGFBFdLVZ6zN xQOZ7d0a0OU89cG/g2c5olA9axHDcBeAoT313HxFqUtlz6s6nF3V4nbdVrSc9x0s TT0kfJNKAoZEZ1SWhaDgjOZAi1moLy9jCHqEDOnxW9YPVlqqb2dfqF0nwfYVQyBx lwCe0bjgSN41J/p/ZoVYqpbx5fx5POaOnGR0hlUCboNQHvqunbFjuslpuntO+ITi 745vnAysNqcOf0ecZYeTUE/psn1gWdAEsiptWv7h2zzcXst9D15sDCxQ1s4AlxLH wz9BiBc/OtP5jO59dW6yZV8ESMshGYzduyOeIXEPeUvU1StLYQ+gTL5pAf4esB/I MBPGNvti1I3uqETTSp16OnM1Vm1AV0/D3CXrfoivvnWqLdPzNA4CGAyZH6Dgy/YV YEnMvLMFf0joD8j2rPFS0UtGolig0MNzovSLeOdyjoewgps7ll57AU2HIGJbEvvx +G4Jblg9X9yy6g2ZgcU6 =MDGY -----END PGP SIGNATURE----- --Apple-Mail=_C7CF6341-8A87-4E5A-909F-E8B30384B141-- From owner-svn-src-head@freebsd.org Thu Jun 1 09:34:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0511DBF6B61; Thu, 1 Jun 2017 09:34:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC06F715E0; Thu, 1 Jun 2017 09:34:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v519YpF7051446; Thu, 1 Jun 2017 09:34:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v519Yp6o051442; Thu, 1 Jun 2017 09:34:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706010934.v519Yp6o051442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Jun 2017 09:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319409 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 09:34:53 -0000 Author: hselasky Date: Thu Jun 1 09:34:51 2017 New Revision: 319409 URL: https://svnweb.freebsd.org/changeset/base/319409 Log: Add generic kqueue() and kevent() support to the LinuxKPI character devices. The implementation allows read and write filters to be created and piggybacks on the poll() file operation to determine when a filter should trigger. The piggyback mechanism is simply to check for the EWOULDBLOCK or EAGAIN return code from read(), write() or ioctl() system calls and then update the kqueue() polling state bits. The implementation is similar to the one found in the cuse(3) module. Refer to sys/fs/cuse/*.[ch] for more details. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/file.h head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/poll.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/file.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/file.h Thu Jun 1 09:21:25 2017 (r319408) +++ head/sys/compat/linuxkpi/common/include/linux/file.h Thu Jun 1 09:34:51 2017 (r319409) @@ -151,20 +151,18 @@ get_unused_fd_flags(int flags) return fd; } +extern struct linux_file *linux_file_alloc(void); + static inline struct linux_file * alloc_file(int mode, const struct file_operations *fops) { struct linux_file *filp; - filp = kzalloc(sizeof(*filp), GFP_KERNEL); - if (filp == NULL) - return (NULL); - - filp->f_count = 1; + filp = linux_file_alloc(); filp->f_op = fops; filp->f_mode = mode; - return filp; + return (filp); } struct fd { Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Thu Jun 1 09:21:25 2017 (r319408) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Thu Jun 1 09:34:51 2017 (r319409) @@ -41,6 +41,7 @@ #include #include #include +#include struct module; struct kiocb; @@ -80,6 +81,15 @@ struct linux_file { struct sigio *f_sigio; struct vnode *f_vnode; volatile u_int f_count; + + /* kqfilter support */ + int f_kqflags; +#define LINUX_KQ_FLAG_HAS_READ (1 << 0) +#define LINUX_KQ_FLAG_HAS_WRITE (1 << 1) +#define LINUX_KQ_FLAG_NEED_READ (1 << 2) +#define LINUX_KQ_FLAG_NEED_WRITE (1 << 3) + /* protects f_selinfo.si_note */ + spinlock_t f_kqlock; }; #define file linux_file Modified: head/sys/compat/linuxkpi/common/include/linux/poll.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/poll.h Thu Jun 1 09:21:25 2017 (r319408) +++ head/sys/compat/linuxkpi/common/include/linux/poll.h Thu Jun 1 09:34:51 2017 (r319409) @@ -46,4 +46,6 @@ poll_wait(struct linux_file *filp, wait_queue_head_t * selrecord(curthread, &filp->f_selinfo); } +extern void linux_poll_wakeup(struct linux_file *); + #endif /* _LINUX_POLL_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Jun 1 09:21:25 2017 (r319408) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Jun 1 09:34:51 2017 (r319409) @@ -402,6 +402,63 @@ linux_file_dtor(void *cdp) kfree(filp); } +static void +linux_kq_lock(void *arg) +{ + spinlock_t *s = arg; + + spin_lock(s); +} +static void +linux_kq_unlock(void *arg) +{ + spinlock_t *s = arg; + + spin_unlock(s); +} + +static void +linux_kq_lock_owned(void *arg) +{ +#ifdef INVARIANTS + spinlock_t *s = arg; + + mtx_assert(&s->m, MA_OWNED); +#endif +} + +static void +linux_kq_lock_unowned(void *arg) +{ +#ifdef INVARIANTS + spinlock_t *s = arg; + + mtx_assert(&s->m, MA_NOTOWNED); +#endif +} + +static void +linux_dev_kqfilter_poll(struct linux_file *); + +struct linux_file * +linux_file_alloc(void) +{ + struct linux_file *filp; + + filp = kzalloc(sizeof(*filp), GFP_KERNEL); + + /* set initial refcount */ + filp->f_count = 1; + + /* setup fields needed by kqueue support */ + spin_lock_init(&filp->f_kqlock); + knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, + linux_kq_lock, linux_kq_unlock, + linux_kq_lock_owned, linux_kq_lock_unowned); + + return (filp); +} + void linux_file_free(struct linux_file *filp) { @@ -592,15 +649,17 @@ linux_dev_open(struct cdev *dev, int oflags, int devty ldev = dev->si_drv1; if (ldev == NULL) return (ENODEV); - filp = kzalloc(sizeof(*filp), GFP_KERNEL); + + filp = linux_file_alloc(); filp->f_dentry = &filp->f_dentry_store; filp->f_op = ldev->ops; filp->f_flags = file->f_flag; vhold(file->f_vnode); filp->f_vnode = file->f_vnode; - linux_set_current(td); filp->_file = file; + linux_set_current(td); + if (filp->f_op->open) { error = -filp->f_op->open(file->f_vnode, filp); if (error) { @@ -793,6 +852,8 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t current->bsd_ioctl_len = 0; } + if (error == EWOULDBLOCK) + linux_dev_kqfilter_poll(filp); return (error); } @@ -824,8 +885,11 @@ linux_dev_read(struct cdev *dev, struct uio *uio, int ((uint8_t *)uio->uio_iov->iov_base) + bytes; uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; - } else + } else { error = -bytes; + if (error == EWOULDBLOCK) + linux_dev_kqfilter_poll(filp); + } } else error = ENXIO; @@ -860,8 +924,11 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int ((uint8_t *)uio->uio_iov->iov_base) + bytes; uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; - } else + } else { error = -bytes; + if (error == EWOULDBLOCK) + linux_dev_kqfilter_poll(filp); + } } else error = ENXIO; @@ -893,7 +960,140 @@ error: return (events & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); } +void +linux_poll_wakeup(struct linux_file *filp) +{ + /* this function should be NULL-safe */ + if (filp == NULL) + return; + + selwakeup(&filp->f_selinfo); + + spin_lock(&filp->f_kqlock); + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ | + LINUX_KQ_FLAG_NEED_WRITE; + + /* make sure the "knote" gets woken up */ + KNOTE_LOCKED(&filp->f_selinfo.si_note, 1); + spin_unlock(&filp->f_kqlock); +} + +static void +linux_dev_kqfilter_detach(struct knote *kn) +{ + struct linux_file *filp = kn->kn_hook; + + spin_lock(&filp->f_kqlock); + knlist_remove(&filp->f_selinfo.si_note, kn, 1); + spin_unlock(&filp->f_kqlock); +} + static int +linux_dev_kqfilter_read_event(struct knote *kn, long hint) +{ + struct linux_file *filp = kn->kn_hook; + + mtx_assert(&filp->f_kqlock.m, MA_OWNED); + + return ((filp->f_kqflags & LINUX_KQ_FLAG_NEED_READ) ? 1 : 0); +} + +static int +linux_dev_kqfilter_write_event(struct knote *kn, long hint) +{ + struct linux_file *filp = kn->kn_hook; + + mtx_assert(&filp->f_kqlock.m, MA_OWNED); + + return ((filp->f_kqflags & LINUX_KQ_FLAG_NEED_WRITE) ? 1 : 0); +} + +static struct filterops linux_dev_kqfiltops_read = { + .f_isfd = 1, + .f_detach = linux_dev_kqfilter_detach, + .f_event = linux_dev_kqfilter_read_event, +}; + +static struct filterops linux_dev_kqfiltops_write = { + .f_isfd = 1, + .f_detach = linux_dev_kqfilter_detach, + .f_event = linux_dev_kqfilter_write_event, +}; + +static void +linux_dev_kqfilter_poll(struct linux_file *filp) +{ + int temp; + + spin_lock(&filp->f_kqlock); + temp = (filp->f_kqflags & (LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE)); + filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | LINUX_KQ_FLAG_NEED_WRITE); + spin_unlock(&filp->f_kqlock); + + if (temp != 0) { + /* get the latest polling state */ + temp = filp->f_op->poll(filp, NULL); + + if (temp & (POLLIN | POLLOUT)) { + spin_lock(&filp->f_kqlock); + if (temp & POLLIN) + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ; + if (temp & POLLOUT) + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_WRITE; + + /* make sure the "knote" gets woken up */ + KNOTE_LOCKED(&filp->f_selinfo.si_note, 0); + spin_unlock(&filp->f_kqlock); + } + } +} + +static int +linux_dev_kqfilter(struct cdev *dev, struct knote *kn) +{ + struct linux_file *filp; + struct file *file; + struct thread *td; + int error; + + td = curthread; + file = td->td_fpop; + if (dev->si_drv1 == NULL) + return (ENXIO); + if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) + return (error); + filp->f_flags = file->f_flag; + if (filp->f_op->poll == NULL) + return (EINVAL); + + spin_lock(&filp->f_kqlock); + switch (kn->kn_filter) { + case EVFILT_READ: + filp->f_kqflags |= LINUX_KQ_FLAG_HAS_READ; + kn->kn_fop = &linux_dev_kqfiltops_read; + kn->kn_hook = filp; + knlist_add(&filp->f_selinfo.si_note, kn, 1); + break; + case EVFILT_WRITE: + filp->f_kqflags |= LINUX_KQ_FLAG_HAS_WRITE; + kn->kn_fop = &linux_dev_kqfiltops_write; + kn->kn_hook = filp; + knlist_add(&filp->f_selinfo.si_note, kn, 1); + break; + default: + error = EINVAL; + break; + } + spin_unlock(&filp->f_kqlock); + + if (error == 0) { + linux_set_current(td); + linux_dev_kqfilter_poll(filp); + } + return (error); +} + +static int linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, int nprot) { @@ -1012,6 +1212,7 @@ struct cdevsw linuxcdevsw = { .d_ioctl = linux_dev_ioctl, .d_mmap_single = linux_dev_mmap_single, .d_poll = linux_dev_poll, + .d_kqfilter = linux_dev_kqfilter, .d_name = "lkpidev", }; From owner-svn-src-head@freebsd.org Thu Jun 1 09:53:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BD69BF84D1; Thu, 1 Jun 2017 09:53:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C209723CF; Thu, 1 Jun 2017 09:53:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v519ruA8059270; Thu, 1 Jun 2017 09:53:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v519rud7059269; Thu, 1 Jun 2017 09:53:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706010953.v519rud7059269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Jun 2017 09:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319410 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 09:53:57 -0000 Author: hselasky Date: Thu Jun 1 09:53:55 2017 New Revision: 319410 URL: https://svnweb.freebsd.org/changeset/base/319410 Log: Translate the ERESTARTSYS error code into ERESTART in the LinuxKPI ioctl(), read() and write() system call handlers. This error code is internal to the kernel and should not be seen by user-space programs according to Linux. Submitted by: Yanko Yankulov MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Jun 1 09:34:51 2017 (r319409) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Jun 1 09:53:55 2017 (r319410) @@ -854,6 +854,8 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t if (error == EWOULDBLOCK) linux_dev_kqfilter_poll(filp); + else if (error == ERESTARTSYS) + error = ERESTART; return (error); } @@ -889,6 +891,8 @@ linux_dev_read(struct cdev *dev, struct uio *uio, int error = -bytes; if (error == EWOULDBLOCK) linux_dev_kqfilter_poll(filp); + else if (error == ERESTARTSYS) + error = ERESTART; } } else error = ENXIO; @@ -928,6 +932,8 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int error = -bytes; if (error == EWOULDBLOCK) linux_dev_kqfilter_poll(filp); + else if (error == ERESTARTSYS) + error = ERESTART; } } else error = ENXIO; From owner-svn-src-head@freebsd.org Thu Jun 1 09:14:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CDABF571D; Thu, 1 Jun 2017 09:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62115709A0; Thu, 1 Jun 2017 09:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v519EnBA043229; Thu, 1 Jun 2017 09:14:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v519EnCo043228; Thu, 1 Jun 2017 09:14:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201706010914.v519EnCo043228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 1 Jun 2017 09:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319406 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 09:14:50 -0000 Author: manu Date: Thu Jun 1 09:14:49 2017 New Revision: 319406 URL: https://svnweb.freebsd.org/changeset/base/319406 Log: ipfw.8: Note that the ipfw_nat kernel module must be loaded or that the IPFIREWALL_NAT options must be in the kernel config in order to use in-kernel nat. MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Thu Jun 1 09:14:43 2017 (r319405) +++ head/sbin/ipfw/ipfw.8 Thu Jun 1 09:14:49 2017 (r319406) @@ -2896,6 +2896,11 @@ the packets are dropped. .Nm support in-kernel NAT using the kernel version of .Xr libalias 3 . +The kernel module +.Cm ipfw_nat +should be loaded or kernel should have +.Cm options IPFIREWALL_NAT +to be able use NAT. .Pp The nat configuration command is the following: .Bd -ragged -offset indent From owner-svn-src-head@freebsd.org Thu Jun 1 10:04:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7462DAF7EF6; Thu, 1 Jun 2017 10:04:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 456BD73481; Thu, 1 Jun 2017 10:04:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51A4CWx063644; Thu, 1 Jun 2017 10:04:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51A4C1L063643; Thu, 1 Jun 2017 10:04:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201706011004.v51A4C1L063643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 1 Jun 2017 10:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319412 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 10:04:13 -0000 Author: ae Date: Thu Jun 1 10:04:12 2017 New Revision: 319412 URL: https://svnweb.freebsd.org/changeset/base/319412 Log: Build kdebug_secreplay() function only when IPSEC_DEBUG is defined. This should fix the build on sparc. Reported by: emaste X-MFC with: r319118 Modified: head/sys/netipsec/key_debug.c Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Thu Jun 1 10:03:41 2017 (r319411) +++ head/sys/netipsec/key_debug.c Thu Jun 1 10:04:12 2017 (r319412) @@ -77,10 +77,6 @@ static void kdebug_sadb_x_sa2(struct sadb_ext *); static void kdebug_sadb_x_sa_replay(struct sadb_ext *); static void kdebug_sadb_x_natt(struct sadb_ext *); -#ifdef _KERNEL -static void kdebug_secreplay(struct secreplay *); -#endif - #ifndef _KERNEL #define panic(fmt, ...) { printf(fmt, ## __VA_ARGS__); exit(-1); } #endif @@ -724,6 +720,7 @@ kdebug_secash(struct secashead *sah, const char *inden printf("}\n"); } +#ifdef IPSEC_DEBUG static void kdebug_secreplay(struct secreplay *rpl) { @@ -745,6 +742,7 @@ kdebug_secreplay(struct secreplay *rpl) } printf(" }\n"); } +#endif /* IPSEC_DEBUG */ static void kdebug_secnatt(struct secnatt *natt) From owner-svn-src-head@freebsd.org Thu Jun 1 10:39:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6273DAF98A9; Thu, 1 Jun 2017 10:39:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3291374973; Thu, 1 Jun 2017 10:39:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51Ad0Jq075490; Thu, 1 Jun 2017 10:39:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Ad0jR075489; Thu, 1 Jun 2017 10:39:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706011039.v51Ad0jR075489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Jun 2017 10:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319413 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 10:39:01 -0000 Author: hselasky Date: Thu Jun 1 10:39:00 2017 New Revision: 319413 URL: https://svnweb.freebsd.org/changeset/base/319413 Log: Free hardware queue resource after port is stopped in the mlx4en(4) driver. Else if the port is up the resource might still be busy and the MTT free will fail. PR: 216493 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Thu Jun 1 10:04:12 2017 (r319412) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Thu Jun 1 10:39:00 2017 (r319413) @@ -1731,13 +1731,12 @@ void mlx4_en_destroy_netdev(struct net_device *dev) mutex_unlock(&mdev->state_lock); } - if (priv->allocated) - mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); - mutex_lock(&mdev->state_lock); mlx4_en_stop_port(dev); mutex_unlock(&mdev->state_lock); + if (priv->allocated) + mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); cancel_delayed_work(&priv->stats_task); cancel_delayed_work(&priv->service_task); From owner-svn-src-head@freebsd.org Thu Jun 1 10:44:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE365AF9B5C; Thu, 1 Jun 2017 10:44:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B033974E07; Thu, 1 Jun 2017 10:44:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51Aimfl079655; Thu, 1 Jun 2017 10:44:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51AimGF079654; Thu, 1 Jun 2017 10:44:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706011044.v51AimGF079654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Jun 2017 10:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319414 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 10:44:50 -0000 Author: hselasky Date: Thu Jun 1 10:44:48 2017 New Revision: 319414 URL: https://svnweb.freebsd.org/changeset/base/319414 Log: Allow communication between functions on the same host when using the mlx4en(4) driver in SRIOV mode. Place a copy of the destination MAC address in the send WQE only under SRIOV/eSwitch configuration or when the device is in selftest. This allows communication between functions on the same host. PR: 216493 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c Thu Jun 1 10:39:00 2017 (r319413) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c Thu Jun 1 10:44:48 2017 (r319414) @@ -661,18 +661,6 @@ static void mlx4_bf_copy(void __iomem *dst, volatile u __iowrite64_copy(dst, __DEVOLATILE(void *, src), bytecnt / 8); } -static u64 mlx4_en_mac_to_u64(u8 *addr) -{ - u64 mac = 0; - int i; - - for (i = 0; i < ETHER_ADDR_LEN; i++) { - mac <<= 8; - mac |= addr[i]; - } - return mac; -} - static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp) { enum { @@ -770,8 +758,18 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_desc->ctrl.ins_vlan = 0; } - /* clear immediate field */ - tx_desc->ctrl.imm = 0; + if (unlikely(mlx4_is_mfunc(priv->mdev->dev) || priv->validate_loopback)) { + /* + * Copy destination MAC address to WQE. This allows + * loopback in eSwitch, so that VFs and PF can + * communicate with each other: + */ + m_copydata(mb, 0, 2, __DEVOLATILE(void *, &tx_desc->ctrl.srcrb_flags16[0])); + m_copydata(mb, 2, 4, __DEVOLATILE(void *, &tx_desc->ctrl.imm)); + } else { + /* clear immediate field */ + tx_desc->ctrl.imm = 0; + } /* Handle LSO (TSO) packets */ if (mb->m_pkthdr.csum_flags & CSUM_TSO) { @@ -929,22 +927,6 @@ skip_dma: mlx4_en_store_inline_lso_header(dseg_inline, ihs, owner_bit); else mlx4_en_store_inline_header(dseg_inline, ihs, owner_bit); - - if (unlikely(priv->validate_loopback)) { - /* Copy dst mac address to wqe */ - struct ether_header *ethh; - u64 mac; - u32 mac_l, mac_h; - - ethh = mtod(mb, struct ether_header *); - mac = mlx4_en_mac_to_u64(ethh->ether_dhost); - if (mac) { - mac_h = (u32) ((mac & 0xffff00000000ULL) >> 16); - mac_l = (u32) (mac & 0xffffffff); - tx_desc->ctrl.srcrb_flags |= cpu_to_be32(mac_h); - tx_desc->ctrl.imm = cpu_to_be32(mac_l); - } - } /* update producer counter */ ring->prod += tx_info->nr_txbb; From owner-svn-src-head@freebsd.org Thu Jun 1 14:18:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EACDDAFDF4F for ; Thu, 1 Jun 2017 14:18:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm27.bullet.mail.ne1.yahoo.com (nm27.bullet.mail.ne1.yahoo.com [98.138.90.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B255C7B87F for ; Thu, 1 Jun 2017 14:18:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1496326679; bh=/sqy9LDySgwv9FxxYPzWRVGeg97UIAl1s6zkLPFHT9U=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=Reu86pmyqK1bbnzRsyerDo5ENOCJm0EI4j543SrgcbX2jq17Fq7B0N4dvCten+YFepJDViv9WDG2wTWR43XCX3u8XHZlUhFfgaDdneoU36/LjQrW2gFN5O+ZINGfLpFYPEPI8o5t6DXOlGg6eS39EE/gqNSTlC7aVS6NYyZj2wekqEbOyQ8K5RYr898GMi9tdtp3PsTifb1dRBU6mIW0G2IFagd1ZMbR4w6b7I/cD/llqCZl2k9mN+i4wAK3U22P0rKK7YVAVQ0Nue33IKpo6Cxnp5cqnK1XCp31J5zYyYeC2+5cX/zb/V1N9qh3AZSy2MVLpcNZ3itoiCJLDTah6w== Received: from [98.138.100.114] by nm27.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jun 2017 14:17:59 -0000 Received: from [98.138.226.31] by tm105.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jun 2017 14:17:59 -0000 Received: from [127.0.0.1] by smtp202.mail.ne1.yahoo.com with NNFMP; 01 Jun 2017 14:17:59 -0000 X-Yahoo-Newman-Id: 695425.44477.bm@smtp202.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: h8r0nbkVM1kSgqtlhIFa8wt6OukTaqquH3pIoVPQbv1T4fb BAN6k.jvmDlpkXh4z5G83562HU6lw2XrGwHxXa_QYk5PqBNPTuuQJuPdmkRo h68KIBzdlB1vFaYGNpRD0FyCvOFJdpdDk5DMvtXqgF.EJ.StzXAIDm5NdDb7 3cCS3XRyVkrkRV1IrKtJmizA2WXh.H9AVTWeSgLE9BqgmHjgKD.pgy8GgzBM U6x_KegG9zzL84yAoPpOuPK5TEFfL7mnFiSXHm9Q220_Y9LvoEkbQbHQ9LeZ BN6cvI_lgWcKF_Y2vZseulEGYcI92khkZd27uULvWNCRxgeB_FBkrRxIeQmd v2_huLs.a7Qxpnwq.GglJthDPdRImIRt9LeFH_161rQX0rMCPk_eboTU6NjR xmS08EZCOANo9tzLKCRIQOwCdzu3tgVy7as_H8uPlI2NowiLU4bGwNPsZdVc mLeuoh.pP2dO3cxupAvQKri7gZ3Pz0OgxS6ztBiezYEQe8ArvnAq3N6mHq2V yhn7jcTW73KPiERwP1xpaQJZgFmpMCZQSbvrCXAnU8E38Sqg- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests To: "Ngie Cooper (yaneurabeya)" , Brooks Davis Cc: Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> From: Pedro Giffuni Organization: FreeBSD Message-ID: <7d59fb7c-7ac6-c545-103d-6185a2ee5c93@FreeBSD.org> Date: Thu, 1 Jun 2017 09:17:57 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 14:18:07 -0000 On 06/01/17 01:06, Ngie Cooper (yaneurabeya) wrote: >> On May 31, 2017, at 10:03 PM, Brooks Davis wrote: >> >> On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: >>> Author: ngie >>> Date: Wed May 31 08:01:12 2017 >>> New Revision: 319295 >>> URL: https://svnweb.freebsd.org/changeset/base/319295 >>> >>> Log: >>> Update the usr.bin/mkimg golden test output files after ^/head@r319125 >>> >>> ^/head@r319125 changed the location of the backup pmbr, requiring the >>> output files to be regenerated, since they're binary disk dumps. >>> >>> The output files were regenerated with "make rebase"--fixed in >>> ^/head@r319294. >> These should not be stored uuencoded. It serves no purpose other >> than bloating the repo and causing spammy commit mails like this one >> where we got a huge tail of garbage output. > Hi Brooks, > I’m not entirely sure why the files were uuencoded to be honest. I think that’s a good question for Marcel and some of the folks at Juniper, since they wrote the tool/tests. for the record, it used to be a common practice. I think it's legacy from the CVS days. Pedro. From owner-svn-src-head@freebsd.org Thu Jun 1 15:03:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA855AFEE09; Thu, 1 Jun 2017 15:03:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99B537D68D; Thu, 1 Jun 2017 15:03:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51F3h99086762; Thu, 1 Jun 2017 15:03:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51F3hqg086761; Thu, 1 Jun 2017 15:03:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201706011503.v51F3hqg086761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Jun 2017 15:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319432 - head/usr.bin/rctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 15:03:44 -0000 Author: trasz Date: Thu Jun 1 15:03:43 2017 New Revision: 319432 URL: https://svnweb.freebsd.org/changeset/base/319432 Log: Use proper capitalization with .Dd. Submitted by: oshogbo MFC after: 2 weeks Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Thu Jun 1 14:58:26 2017 (r319431) +++ head/usr.bin/rctl/rctl.8 Thu Jun 1 15:03:43 2017 (r319432) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd may 28, 2017 +.Dd May 28, 2017 .Dt RCTL 8 .Os .Sh NAME From owner-svn-src-head@freebsd.org Thu Jun 1 15:11:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA215AFF07C; Thu, 1 Jun 2017 15:11:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A4277DCCA; Thu, 1 Jun 2017 15:11:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51FBIG7087485; Thu, 1 Jun 2017 15:11:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51FBIYf087483; Thu, 1 Jun 2017 15:11:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201706011511.v51FBIYf087483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Jun 2017 15:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319433 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 15:11:19 -0000 Author: tuexen Date: Thu Jun 1 15:11:18 2017 New Revision: 319433 URL: https://svnweb.freebsd.org/changeset/base/319433 Log: Improve comments to describe what the code does. Reported by: jtl Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Jun 1 15:03:43 2017 (r319432) +++ head/sys/netinet/tcp_input.c Thu Jun 1 15:11:18 2017 (r319433) @@ -2011,8 +2011,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru /* * If the state is SYN_SENT: - * if seg contains a RST, then drop the connection. - * if seg does not contain SYN, then drop it. + * if seg contains a RST with valid ACK (SEQ.ACK has already + * been verified), then drop the connection. + * if seg contains a RST without an ACK, drop the seg. + * if seg does not contain SYN, then drop the seg. * Otherwise this is an acceptable SYN segment * initialize tp->rcv_nxt and tp->irs * if seg contains ack then advance tp->snd_una Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Thu Jun 1 15:03:43 2017 (r319432) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Jun 1 15:11:18 2017 (r319433) @@ -497,8 +497,10 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, str /* * If the state is SYN_SENT: - * if seg contains a RST, then drop the connection. - * if seg does not contain SYN, then drop it. + * if seg contains a RST with valid ACK (SEQ.ACK has already + * been verified), then drop the connection. + * if seg contains a RST without an ACK, drop the seg. + * if seg does not contain SYN, then drop the seg. * Otherwise this is an acceptable SYN segment * initialize tp->rcv_nxt and tp->irs * if seg contains ack then advance tp->snd_una From owner-svn-src-head@freebsd.org Thu Jun 1 15:28:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3FCAFF6EA; Thu, 1 Jun 2017 15:28:53 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 555267E976; Thu, 1 Jun 2017 15:28:52 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from marcels-mbp.int.brkt.com (cerberus.brkt.com [208.185.168.138]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id v51FBoLf069685 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 1 Jun 2017 08:11:51 -0700 (PDT) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Message-Id: <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Date: Thu, 1 Jun 2017 08:11:45 -0700 In-Reply-To: <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> Cc: Brooks Davis , Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: "Ngie Cooper (yaneurabeya)" References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> X-Mailer: Apple Mail (2.3273) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.xcllnt.net [50.0.150.214]); Thu, 01 Jun 2017 08:11:51 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 15:28:53 -0000 > On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya) = wrote: >=20 >=20 >> On May 31, 2017, at 10:03 PM, Brooks Davis = wrote: >>=20 >> On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: >>> Author: ngie >>> Date: Wed May 31 08:01:12 2017 >>> New Revision: 319295 >>> URL: https://svnweb.freebsd.org/changeset/base/319295 >>>=20 >>> Log: >>> Update the usr.bin/mkimg golden test output files after = ^/head@r319125 >>>=20 >>> ^/head@r319125 changed the location of the backup pmbr, requiring = the >>> output files to be regenerated, since they're binary disk dumps. >>>=20 >>> The output files were regenerated with "make rebase"--fixed in >>> ^/head@r319294. >>=20 >> These should not be stored uuencoded. It serves no purpose other >> than bloating the repo and causing spammy commit mails like this one >> where we got a huge tail of garbage output. >=20 > Hi Brooks, > I=E2=80=99m not entirely sure why the files were uuencoded to be = honest. I think that=E2=80=99s a good question for Marcel and some of = the folks at Juniper, since they wrote the tool/tests. Result files used to start off as binary files. uuencoding is a given = in that case. I eventually switched to using hexdump -C, because that = makes it easier to analyze and understand differences. The uuencoding = was kept to remain independent of version control system, file = attributes and end-of-line characteristics of the host machine: nothing = more annoying that checking out textual result files and have test = failures because =E2=80=98\n=E2=80=99 was replaced by =E2=80=98\r\n=E2=80=99= . Even if the files aren=E2=80=99t unencoded, there=E2=80=99s always = someone who treats it as spammy and a tail of garbage. It=E2=80=99s just = a knee-jerk reaction to seeing something that isn=E2=80=99t understood, = I think. As such, there=E2=80=99s no reason to change =E2=80=94 in fact, = changing would be bloating the repo. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@freebsd.org Thu Jun 1 15:32:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DC10AFF94E; Thu, 1 Jun 2017 15:32:40 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2702C7EF12; Thu, 1 Jun 2017 15:32:40 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id b68so21630774ywe.3; Thu, 01 Jun 2017 08:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=G1Dp3QLzQWCa4w/uvjLo8LkdmzAKan+et9zn+iUbRLc=; b=QpZLDcKgyWUgQDfuDTd2d3FLrPRrXgHw1F51Po8nnkQOSn61pNhsN4iBlK01ExKfyU glRvyvR3Fe0AOKZuRDrFOZHQDsT7iaPvI8rORdieSgvnV0fIN7HFArcrz8NITZbmPe3H v8Ew50y9TrJ/zr+Doyv2T5gUa/j25ZsNo5PJ+yINPB+QPOsau8EVuoYL6JSsgxCefFzw oS0o0egsrGrEaDQ6nU0jweRWk+oWiTdR+1RTBRFuaZxoR+9LyKQCYROhX1bwzN62Ux77 VB9l6nFlb8uL//eID4ixIIYyEhAd0guCb1K2oRu5GxKaSYf05VDQNKqD2rNET3oehsiQ idVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=G1Dp3QLzQWCa4w/uvjLo8LkdmzAKan+et9zn+iUbRLc=; b=nZaAXMIni6AU2cFW0JqDYmqtdKDCJeksjh75t9Tj+dPg+9Hgf+1FLxtidKS+SZTdcO QYMWVtaO1HSmUlDO6sfFcA4sSeagEWZHtaknRFBiGtO3+mC6EyVQbnK9UufzBMXiOqMx JZ8xPEknp0yGP1mT1hnO8b4z8L/mYfdb3tIH5rbLdO92vUiQdZq9uXg790GeH21tXU8i CplshH7YQcvMhgGkKyRlB5W0N5u32ZpT9XlQazXu5qTDdPgtn4t4jcAnKuwWlG2e/x9f g6uQgS680HOmtkLgR1MtS4XMoyxn6O2hOdxSgO1KAtgbgJF2h4XXzBbpfPOQmbtRS8bQ lPqA== X-Gm-Message-State: AODbwcAx5zhcdGxRHh36sECO3Nyvjt3yWF3O0x1/1He/Xn2OWZ8rVDb/ lwQw6ULtryQul8nw060OzbZSqFrZnA== X-Received: by 10.129.156.5 with SMTP id t5mr1876512ywg.257.1496331159235; Thu, 01 Jun 2017 08:32:39 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.13.206.199 with HTTP; Thu, 1 Jun 2017 08:32:38 -0700 (PDT) In-Reply-To: <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> From: Alan Somers Date: Thu, 1 Jun 2017 09:32:38 -0600 X-Google-Sender-Auth: FpqHpPjDSXq7Jz6EUXQSwn20Ax8 Message-ID: Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests To: Marcel Moolenaar Cc: "Ngie Cooper (yaneurabeya)" , Brooks Davis , Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 15:32:40 -0000 On Thu, Jun 1, 2017 at 9:11 AM, Marcel Moolenaar wrote: > > On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya) > wrote: > > > On May 31, 2017, at 10:03 PM, Brooks Davis wrote: > > On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: > > Author: ngie > Date: Wed May 31 08:01:12 2017 > New Revision: 319295 > URL: https://svnweb.freebsd.org/changeset/base/319295 > > Log: > Update the usr.bin/mkimg golden test output files after ^/head@r319125 > > ^/head@r319125 changed the location of the backup pmbr, requiring the > output files to be regenerated, since they're binary disk dumps. > > The output files were regenerated with "make rebase"--fixed in > ^/head@r319294. > > > These should not be stored uuencoded. It serves no purpose other > than bloating the repo and causing spammy commit mails like this one > where we got a huge tail of garbage output. > > > Hi Brooks, > I=E2=80=99m not entirely sure why the files were uuencoded to be honest. = I think > that=E2=80=99s a good question for Marcel and some of the folks at Junipe= r, since > they wrote the tool/tests. > > > Result files used to start off as binary files. uuencoding is a given in > that case. I eventually switched to using hexdump -C, because that makes= it > easier to analyze and understand differences. The uuencoding was kept to > remain independent of version control system, file attributes and > end-of-line characteristics of the host machine: nothing more annoying th= at > checking out textual result files and have test failures because =E2=80= =98\n=E2=80=99 was > replaced by =E2=80=98\r\n=E2=80=99. > > Even if the files aren=E2=80=99t unencoded, there=E2=80=99s always someon= e who treats it as > spammy and a tail of garbage. It=E2=80=99s just a knee-jerk reaction to s= eeing > something that isn=E2=80=99t understood, I think. As such, there=E2=80=99= s no reason to > change =E2=80=94 in fact, changing would be bloating the repo. > > -- > Marcel Moolenaar > marcel@xcllnt.net If the files are binary, then why not store them as binary files? Subversion can handle that. That way the tests won't need to decode them, svn clients won't change their line endings, and commit mail won't include their diffs. -Alan From owner-svn-src-head@freebsd.org Thu Jun 1 15:35:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73226AFFA70; Thu, 1 Jun 2017 15:35:38 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44A5D7F0F6; Thu, 1 Jun 2017 15:35:37 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from marcels-mbp.int.brkt.com (cerberus.brkt.com [208.185.168.138]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id v51FZZVG069823 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 1 Jun 2017 08:35:36 -0700 (PDT) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Message-Id: <7BA69054-D85F-49B5-8EB0-948DFC1A998E@xcllnt.net> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Date: Thu, 1 Jun 2017 08:35:30 -0700 In-Reply-To: Cc: "Ngie Cooper (yaneurabeya)" , Brooks Davis , Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" To: Alan Somers References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> X-Mailer: Apple Mail (2.3273) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.xcllnt.net [50.0.150.214]); Thu, 01 Jun 2017 08:35:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 15:35:38 -0000 > On Jun 1, 2017, at 8:32 AM, Alan Somers wrote: >=20 > On Thu, Jun 1, 2017 at 9:11 AM, Marcel Moolenaar = wrote: >>=20 >> On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya) >> wrote: >>=20 >>=20 >> On May 31, 2017, at 10:03 PM, Brooks Davis = wrote: >>=20 >> On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: >>=20 >> Author: ngie >> Date: Wed May 31 08:01:12 2017 >> New Revision: 319295 >> URL: https://svnweb.freebsd.org/changeset/base/319295 >>=20 >> Log: >> Update the usr.bin/mkimg golden test output files after = ^/head@r319125 >>=20 >> ^/head@r319125 changed the location of the backup pmbr, requiring the >> output files to be regenerated, since they're binary disk dumps. >>=20 >> The output files were regenerated with "make rebase"--fixed in >> ^/head@r319294. >>=20 >>=20 >> These should not be stored uuencoded. It serves no purpose other >> than bloating the repo and causing spammy commit mails like this one >> where we got a huge tail of garbage output. >>=20 >>=20 >> Hi Brooks, >> I=E2=80=99m not entirely sure why the files were uuencoded to be = honest. I think >> that=E2=80=99s a good question for Marcel and some of the folks at = Juniper, since >> they wrote the tool/tests. >>=20 >>=20 >> Result files used to start off as binary files. uuencoding is a = given in >> that case. I eventually switched to using hexdump -C, because that = makes it >> easier to analyze and understand differences. The uuencoding was = kept to >> remain independent of version control system, file attributes and >> end-of-line characteristics of the host machine: nothing more = annoying that >> checking out textual result files and have test failures because = =E2=80=98\n=E2=80=99 was >> replaced by =E2=80=98\r\n=E2=80=99. >>=20 >> Even if the files aren=E2=80=99t unencoded, there=E2=80=99s always = someone who treats it as >> spammy and a tail of garbage. It=E2=80=99s just a knee-jerk reaction = to seeing >> something that isn=E2=80=99t understood, I think. As such, there=E2=80=99= s no reason to >> change =E2=80=94 in fact, changing would be bloating the repo. >>=20 >> -- >> Marcel Moolenaar >> marcel@xcllnt.net >=20 > If the files are binary, then why not store them as binary files? A 100MB image, committed as binary file is 100MB of data. The hexdump -C equivalent is often only a few hundred bytes (due to the many zeroes). The repo bloat argument has grounds for binary files. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@freebsd.org Thu Jun 1 16:02:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD10B794FF; Thu, 1 Jun 2017 16:02:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D36C805D1; Thu, 1 Jun 2017 16:02:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id w69so7357514pfk.1; Thu, 01 Jun 2017 09:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Fd6bi4m28giFDV99hoBLJUfU8tIWGeTxQAYWNeIygcs=; b=I579PQo17ZOOEumyvHhyA/um5vpN/TjqLLO43ysPTCTnK4u/hcq7TtJxVYegwLDnyi RfEKNFKppp8ShFHM2uX2Kj1KTfOHOe5hLdMhlNs2JY2FMvWkmHH1a1049Y4q4bPzuVkk kXSDIqDIQammfPGP3Q/rJbuYqJTPASUj+GF5wuLPutM411H3ElITKuHlhWKDKwCePi6k ThMyEM+Wd1qyeV/uIiPW7Ajk9ZBKSQepIrE0w5C/bVMYIkF/fvs1UWNpHJosEbT2zyRB na3sWzOuRLnMXS5pC2R3bN/vKLHXDhI2CYp3IRH/m0Olctq6cBolr4AzOXrgN/6pRq64 OgzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Fd6bi4m28giFDV99hoBLJUfU8tIWGeTxQAYWNeIygcs=; b=njAGPRYefAxKUSFXQirdy6NKledhz44wB8St1wu/yqeCIDVvH6+XpBjAdkDwKxPUPJ ADDm4Ty1AFyI3wggCO3TZKjnBlSH3TnB9qDLYwg3XPxDdJmGUyL4tJnHDBFGgMXqnY4R eMMFqaIPgGmGCQET8F+PxNL4Toj8dmSWawQ0qIEUBQKPjS0tgBZzOtc75mqK8CqhwD62 4WALjNgFGGH/VB0MD6LhCPo9QL2zswzk5vmgWeZJv+sU9RK7Xkh22bhKI4WyC4MT1QHB W1pIoj09x6CalKFheDnk39NPlghKi3uR0H9BzIwIHT8OCyZe+eLU8NLeiaFytxFRercX o0ZQ== X-Gm-Message-State: AODbwcB0iEG0Qyo1/vzPf2UHTWxvVQkDe1Hwy0C3iL3h/4Mz9+WhyFfZ 78xfAVBf5AnaqZ+e6kk= X-Received: by 10.99.114.66 with SMTP id c2mr1768656pgn.130.1496332923642; Thu, 01 Jun 2017 09:02:03 -0700 (PDT) Received: from [192.168.20.13] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e124sm34485391pfc.64.2017.06.01.09.02.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 09:02:02 -0700 (PDT) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests From: Ngie Cooper X-Mailer: iPhone Mail (14F89) In-Reply-To: <7BA69054-D85F-49B5-8EB0-948DFC1A998E@xcllnt.net> Date: Thu, 1 Jun 2017 09:02:02 -0700 Cc: Alan Somers , Brooks Davis , Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <4B2F447B-6BBF-4716-A329-7B748F963E6A@gmail.com> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> <7BA69054-D85F-49B5-8EB0-948DFC1A998E@xcllnt.net> To: Marcel Moolenaar Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 16:02:04 -0000 > On Jun 1, 2017, at 08:35, Marcel Moolenaar wrote: >=20 >=20 >> On Jun 1, 2017, at 8:32 AM, Alan Somers wrote: ... >> If the files are binary, then why not store them as binary files? >=20 > A 100MB image, committed as binary file is 100MB of data. The hexdump -C > equivalent is often only a few hundred bytes (due to the many zeroes). > The repo bloat argument has grounds for binary files. hexdump still has a number of formatting bugs... I guess I should go back an= d write some tests/fix the issues, almost a decade after I tried to take the= m on originally... Thanks! -Ngie= From owner-svn-src-head@freebsd.org Thu Jun 1 16:17:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C606BB79B0A; Thu, 1 Jun 2017 16:17:47 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8268C811BB; Thu, 1 Jun 2017 16:17:47 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 49F255A9F12; Thu, 1 Jun 2017 16:17:46 +0000 (UTC) Date: Thu, 1 Jun 2017 16:17:46 +0000 From: Brooks Davis To: Marcel Moolenaar Cc: "Ngie Cooper (yaneurabeya)" , Ngie Cooper , Marcel Moolenaar , "Simon J. Gerraty" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Message-ID: <20170601161746.GB60464@spindle.one-eyed-alien.net> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <78A8D734-A627-437D-AE63-BA94C543C36B@xcllnt.net> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 16:17:47 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 01, 2017 at 08:11:45AM -0700, Marcel Moolenaar wrote: >=20 > > On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya) wrote: > >=20 > >=20 > >> On May 31, 2017, at 10:03 PM, Brooks Davis wrote: > >>=20 > >> On Wed, May 31, 2017 at 08:01:12AM +0000, Ngie Cooper wrote: > >>> Author: ngie > >>> Date: Wed May 31 08:01:12 2017 > >>> New Revision: 319295 > >>> URL: https://svnweb.freebsd.org/changeset/base/319295 > >>>=20 > >>> Log: > >>> Update the usr.bin/mkimg golden test output files after ^/head@r319125 > >>>=20 > >>> ^/head@r319125 changed the location of the backup pmbr, requiring the > >>> output files to be regenerated, since they're binary disk dumps. > >>>=20 > >>> The output files were regenerated with "make rebase"--fixed in > >>> ^/head@r319294. > >>=20 > >> These should not be stored uuencoded. It serves no purpose other > >> than bloating the repo and causing spammy commit mails like this one > >> where we got a huge tail of garbage output. > >=20 > > Hi Brooks, > > I???m not entirely sure why the files were uuencoded to be honest. I t= hink that???s a good question for Marcel and some of the folks at Juniper, = since they wrote the tool/tests. >=20 > Result files used to start off as binary files. uuencoding is a given in= that case. I eventually switched to using hexdump -C, because that makes = it easier to analyze and understand differences. The uuencoding was kept t= o remain independent of version control system, file attributes and end-of-= line characteristics of the host machine: nothing more annoying that checki= ng out textual result files and have test failures because ???\n??? was rep= laced by ???\r\n???. >=20 > Even if the files aren???t unencoded, there???s always someone who treats= it as spammy and a tail of garbage. It???s just a knee-jerk reaction to se= eing something that isn???t understood, I think. As such, there???s no reas= on to change ??? in fact, changing would be bloating the repo. hexdump -C would make sense. Direct commits of the compressed files would also make sense. Uuencoding gzip'd data is absurd given that we don't (and never again will) support repositories that don't support binary data. The diffs produced are meaningless. I don't advocate replacing these files agressively, but when updating files we should be thinking about switching away from uuencoding. -- Brooks --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJZMD4pAAoJEKzQXbSebgfAjW4H+QGMqrRUeCAi0jQlsSwDFR3W qF1MLBfpnHrUKBqbbqfd+8Pd6SHlZN/9zdE6JX+8P1b/ymZnKHuZhDAyBSxDqUje 5gWFJBFCFECSeWSztGi40CWb+bW2XnbKwH/1HkdeVHzZS+o7OYSSL8cxgtJ2Kw7i i+1juzJjRaGtfW9rVjMOmPg2Kk38WXCYFqlFGXE3tcOIXVVoGG7+hAavqlUpp78h XZzQaW7OKJwc0LDDfldbiwsR6G2HKsakHaxGNKqRCDhzSkZOxuzj5NKnI8GMKlBN moAykgnQJtwB1LDlcuf1/WQpyBZtdY8NBtVdoGXUMspMWY64rrZJbx1CVHtVyCs= =kDef -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- From owner-svn-src-head@freebsd.org Thu Jun 1 16:44:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5A29B7A39E; Thu, 1 Jun 2017 16:44:40 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 954E5820CB; Thu, 1 Jun 2017 16:44:40 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51GidRW029412; Thu, 1 Jun 2017 16:44:39 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51GidaT029411; Thu, 1 Jun 2017 16:44:39 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201706011644.v51GidaT029411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Thu, 1 Jun 2017 16:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319443 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 16:44:40 -0000 Author: stevek Date: Thu Jun 1 16:44:39 2017 New Revision: 319443 URL: https://svnweb.freebsd.org/changeset/base/319443 Log: When sysctlbyname fails, free buf before returning. Submitted by: Thomas Rix Reviewed by: jhb Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9867 Modified: head/lib/libutil/kinfo_getvmobject.c Modified: head/lib/libutil/kinfo_getvmobject.c ============================================================================== --- head/lib/libutil/kinfo_getvmobject.c Thu Jun 1 16:03:01 2017 (r319442) +++ head/lib/libutil/kinfo_getvmobject.c Thu Jun 1 16:44:39 2017 (r319443) @@ -46,8 +46,10 @@ kinfo_getvmobject(int *cntp) buf = NULL; for (i = 0; i < 3; i++) { - if (sysctlbyname("vm.objects", NULL, &len, NULL, 0) < 0) + if (sysctlbyname("vm.objects", NULL, &len, NULL, 0) < 0) { + free(buf); return (NULL); + } buf = reallocf(buf, len); if (buf == NULL) return (NULL); From owner-svn-src-head@freebsd.org Thu Jun 1 16:49:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B409AB7A426; Thu, 1 Jun 2017 16:49:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 842A3822AC; Thu, 1 Jun 2017 16:49:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51GnmkW029672; Thu, 1 Jun 2017 16:49:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51GnmT5029670; Thu, 1 Jun 2017 16:49:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706011649.v51GnmT5029670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Jun 2017 16:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319444 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 16:49:49 -0000 Author: hselasky Date: Thu Jun 1 16:49:48 2017 New Revision: 319444 URL: https://svnweb.freebsd.org/changeset/base/319444 Log: Make sure the selrecord() function is only called from within system polling contexts in the LinuxKPI. After the kqueue() support was added to the LinuxKPI in r319409 the Linux poll file operation will be used outside the system file polling callback function, which can cause a NULL-pointer panic inside selrecord() because curthread->td_sel is set to NULL. This patch moves the selrecord() call away from poll_wait() and to the system file poll callback function in the LinuxKPI, which essentially wraps the Linux one. This is similar to what the cuse(3) module is currently doing. Refer to sys/fs/cuse/*.[ch] for more details. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/poll.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/poll.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/poll.h Thu Jun 1 16:44:39 2017 (r319443) +++ head/sys/compat/linuxkpi/common/include/linux/poll.h Thu Jun 1 16:49:48 2017 (r319444) @@ -43,7 +43,7 @@ typedef struct poll_table_struct { static inline void poll_wait(struct linux_file *filp, wait_queue_head_t *wait_address, poll_table *p) { - selrecord(curthread, &filp->f_selinfo); + /* NOP */ } extern void linux_poll_wakeup(struct linux_file *); Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Jun 1 16:44:39 2017 (r319443) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Jun 1 16:49:48 2017 (r319444) @@ -956,9 +956,10 @@ linux_dev_poll(struct cdev *dev, int events, struct th file = td->td_fpop; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll) + if (filp->f_op->poll != NULL) { + selrecord(td, &filp->f_selinfo); revents = filp->f_op->poll(filp, NULL) & events; - else + } else revents = 0; return (revents); @@ -1263,9 +1264,10 @@ linux_file_poll(struct file *file, int events, struct filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll) + if (filp->f_op->poll != NULL) { + selrecord(td, &filp->f_selinfo); revents = filp->f_op->poll(filp, NULL) & events; - else + } else revents = 0; return (revents); From owner-svn-src-head@freebsd.org Thu Jun 1 16:59:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 693D4B7A716; Thu, 1 Jun 2017 16:59:16 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0094.outbound.protection.outlook.com [104.47.36.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E35C08298E; Thu, 1 Jun 2017 16:59:15 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jY98coKYjCaW4DH6DIpbvilf3WUQy+BXg1E+aDVRmPA=; b=E3TuQqqu+qhHScVQ20IQblJ2K3V1c9ML2dgFPRC1AQIaVZx3wYn4sGEnS9/SR7RHQ5UmeVCt4fR3Je2AwltEaGxm0PhCavTrVWWvTcLT7fBHohnmKwr7QJ5aP4RK95HBKnMCmyhWEqnXzZFTjZLcdsFQTaZqgzymJG961x+ENLY= Received: from BL2PR05CA0050.namprd05.prod.outlook.com (10.255.226.50) by CY1PR05MB1979.namprd05.prod.outlook.com (10.162.216.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.6; Thu, 1 Jun 2017 16:59:13 +0000 Received: from DM3NAM05FT046.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::200) by BL2PR05CA0050.outlook.office365.com (2a01:111:e400:c04::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.6 via Frontend Transport; Thu, 1 Jun 2017 16:59:13 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.12) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=fail action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.12) by DM3NAM05FT046.mail.protection.outlook.com (10.152.98.160) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256) id 15.1.1075.12 via Frontend Transport; Thu, 1 Jun 2017 16:59:12 +0000 Received: from p-mailhub01.juniper.net (10.160.2.17) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 1 Jun 2017 09:58:38 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id v51GwcQC000850; Thu, 1 Jun 2017 09:58:38 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 5A6DA38551F; Thu, 1 Jun 2017 09:58:38 -0700 (PDT) To: "Ngie Cooper (yaneurabeya)" CC: Brooks Davis , Ngie Cooper , "Marcel Moolenaar" , src-committers , , , Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests In-Reply-To: <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> Comments: In-reply-to: "Ngie Cooper (yaneurabeya)" message dated "Wed, 31 May 2017 23:06:50 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <84743.1496336318.1@kaos.jnpr.net> Date: Thu, 1 Jun 2017 09:58:38 -0700 Message-ID: <84744.1496336318@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39450400003)(39840400002)(39410400002)(39400400002)(39860400002)(2980300002)(24454002)(189002)(199003)(9170700003)(53936002)(9686003)(76506005)(229853002)(53416004)(97756001)(1411001)(50226002)(356003)(110136004)(478600001)(107886003)(6266002)(76176999)(50986999)(6246003)(2906002)(38730400002)(23726003)(47776003)(7696004)(305945005)(117636001)(7126002)(46406003)(4326008)(77096006)(189998001)(50466002)(55016002)(5660300001)(86362001)(8676002)(81166006)(106466001)(2950100002)(8936002)(2810700001)(39060400002)(6916009)(105596002)(54906002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR05MB1979; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM05FT046; 1:ekwy1P0Qm9SpWxgD/Cdjz5K03W/0g81Y0mfIhZ5Lp/nvpeKP8Dgufao3gZdpdenaa7e1bFlWVj0wFoNBv/MFCvWx77h+s0NUUCZB3wZzYVqHP0C6KpFIVoOS//xgdP3ngo1/dr0wi17uMEk0Jzvixm1fvTg8as4U8OVcEWgA6X9dawSim38D7G+gt4s8tlZRB3Y9n45y5gg8aleAVpUMMztq7W9IB/IgSHjA8Nfhwfm8bWMZjmXwLqYpLzFtPrPyTJWtq7q7klH/f4Rg9a0R8GEoAxiY1OhNaYPMraaJa9etSKuWPXlY7Jd2rd0stRBVdeY05UAs75pCQaHCGosb7u/AI1eVhWcoj3nppg8OCctK4FiTK1/+6kGd1oTldp9OXn3UArAp/gS9lgMWLT2idChWmOKxKPmxxNJj2lr/rTFymgL4r0Tv+pcxtVFSkW4VBJV166AVudx1eWEF/H9/C31wIY6alGp9RMFWMhMQ7z9EdWicH7jf5BTqZ3U/H8yKy3IPgnc2sE38xLDxiGiGcHNDjHoVxxGrDUMKM2A12PQ= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR05MB1979: X-MS-Office365-Filtering-Correlation-Id: 0537de90-2783-4e22-908d-08d4a90f87aa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:CY1PR05MB1979; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1979; 3:M3FfFJI2tTwUQyRTo4xottbNd2/p2DGGaCtt6Mu9kke/dpG20Xz2mKUUBJtE0e09A5UkpDtX2H5Cr/TBGgCPGjOQLHu2Js0GLxxp0oFzcyAXSp7jvv+A8DLuMgmxE2Twgs7Eachj6i+4h7ZmdlbX9KwFeJUFMJT35qmh7AAcUW8/ChIYPooiHlSAGrUWDlJQrddBEUBRvogKnHJrH/y8E0reKzYP2sAKe2eNXqyvE99HjWwZoFaM5DnwkMzAKBys54/gCOiE1p4kVVmVIM1nJJfds1Mds2AVH6281rWNl7uRUyBzgPOw9qg8UIGlMsYPkLNVUxo9dX/mvuIk1/zeCAKjAKEkNcKbwJ18pMAp7Vq/AljjKCc+6a4lx7l/L2HOpMKRJtuhNwmzPuJj6FW+76VhkHlclgLxrYY9ZPmspz3jgmSXNt5roHyp7L3OKrimAOQMLanL8OKFkBo5iV70aQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1979; 25:IIRWbXRtuNR3gEPvrTQw26f64fLsk7ypgYGPCba08UDUHFNN5pKmnDFuM6HGj4aQRIIUkXDbjh+DpvsA/yIxi9qp6DlmveTNNArS6gprt+AWtIiJW4+t51kiyLLHbhMdLorYlo5sdMCM2ObUU43nQpK7iK3V/Xo2R20ZA0Jdaq8KPT+D5PvLHYYV1aAZlru3PEwHMDwW1uwKstodl08DUcRYFHhMIsFuVvOBKGfRQK4MU9pzyZcLlOTGqBY7zVjnpquLhsfcyVmUkwtfmjsKEw02378bgigDQtwXkuYY4Z5eiOTAPS26rPpWMhGKc7XWGYR9Gh3lf/hGHNR23HYf20SgctvXSbrGxUmp4SSTvcRPF1qsHn6vKWUKYabW1fXhDXbaHuFx1/XB0P6SRyqJ6oQUORnTjStRi8kJ8QSd/t0xDnGoCrw/KTLBX26ZIUJCR7a9EIMJgMF7p0zHIrpsJxo/QKeMkEYi/T+a6gNWHpI=; 31:iL2oYzuVi39OMcnQCI8Q9L3kgqpnPF9mj1dUyhUcSGX8go0JyUjpIm+kYQRcvYcCRb7IOl4R54h+Lh4uKr+gYFs4JI0X0IJm+AbSK6j4rUa/1Habbs9FN/POsFGcWNP3rUrme4GExjzCLHyRu5ItjaMZrhWbJYmpUZ5ChQUhGokvzVIjfe+jmNeRnWD6zsS04Q3NX6PMECls0+3SSQanIfjb8HhScC7XClfOzQocSFFmQBjp77U0KA/Y7oQ+kkdW X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1979; 20:gA2707i+Rkj/rxOxQxdLHJvhJmH5LKIOxslGjcF2V47js6/mFzlrr6JBos1aTxruXvwnKW3O3jFaRSb9vj44pxL4+UVFnVBg/JDxxUBxBRWKL/yt7xH1Pp2zbK8VgGEw+IXC/DfNQSzxIfbmZ/27jSiprq3IA2F83VKekN4yQ9AW92PrzxEGc/9VYwXLQ8AAKErVJSyd21ASJbsvagWkhY/3e90rf6yOTaPcEUXqK4rrIU9fZmkIiExVucxTPMDi/ntihlBeBJ7XwwdQPMzM8IkqfYSa5X8/8UH3q1nUnymVs7zAcjSv8W+HNy1A2bHZo0DBXE6IlSe7k4VEPTq0Fkld2Zx8hJ5ifopuWoq2sNvNrE2Pn3IoTu4vhcPUsWu8tVZQ+i7PsBU++kMEYk1bxi+QxErhA9isNr0NQJEXKDBkwOzpUrtha4vs6DhXEHExOSNVCKTkoxVIhSEh7VDJ9W9Vt4zhWWo69bTlPL5YAkrjx69oe1cTEx/JVWrXnG6p X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(3002001)(93006095)(93003095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR05MB1979; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR05MB1979; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1979; 4:aVYTI12LiVDvXNytDp44RzLZ5JecIkYO1BH6gsB5s/?= =?us-ascii?Q?lZgbp9YiOJ++7coFXiQKaL5VesJ5/8RdmSQeae4EqRguV3ISCCsYZ+Fn6LGI?= =?us-ascii?Q?L8JIA8zaBtGiAinfnfw8diLuNM31fwKRhqcQtfy/spUcYc7PQS/kv/xYG4pw?= =?us-ascii?Q?3RYfVhTxrzWl6l9M8VRb3RHQDVZOa3lhxNrQ1M30jf6+IW4X5jCGdUMPPs71?= =?us-ascii?Q?XPsCdEYQJlqaAXUiObNL43UTxISwK3Xk04UMdhfLIEwf+7oDTWi6xYFKvb2o?= =?us-ascii?Q?3IXamBgk3cJuDmly/gfekKitIbL+Ofg7WOxttZVQYsd2fxhihY7M1n5GMTGI?= =?us-ascii?Q?BbYhvtpK/gaIyGZNtFsXU1Q1b4TtbeH7lIudMMgX1y39oh8Wdds4RNPyqb7J?= =?us-ascii?Q?6nnblqNadktuSKwNGLGJZrttpiYHIaGTyU/zRjqXNbifn+TNBhnTFiSxgbwx?= =?us-ascii?Q?40t8ovxi/JGq8CtBKLK603PU6Eqyn3cngyVMdRzV60C8gVDSf3YlYZGJkxWc?= =?us-ascii?Q?cBiWRYZ8r9QRGEpCg+15Dztm9YBTuAYsFWT20M0FmYovAxHkua1tIsIBNqvG?= =?us-ascii?Q?ObhVoqjSyKY/5dVyIqqkhKh7YWRAWr3H2v02flM8Sc8MHLgkZQSSSFrbflEC?= =?us-ascii?Q?wXgCVFwXQ+hCC7W8ekJkxG4xyNBdSB4aacPrzsY51PeuxKxfm7p8SSzAthcY?= =?us-ascii?Q?nTeDBnoCoC41DRdC840b351ObrI8DsYzuXUnBYvrh0nDlIATGYr9jlIQatrF?= =?us-ascii?Q?dT/hiaggjff9IbiAgxgZ1na8G7nbrKe+O8P6wlK4ft2UOfapsM8e1s47vON2?= =?us-ascii?Q?rz2nb3Whlj0bWx9AVNYix2WliHmEs4lLt5cE45UGQigIZdkB0GhHyQ7FL3a1?= =?us-ascii?Q?BSBcRMIa0IW9SUgoK55hRiFNVnMIPamZbAHdies8SbelI2N/doY5DChZzHIY?= =?us-ascii?Q?rf5G56u03UlUa/N7wYx/pxcFLjs6n6TGZfKilMQkqW1mQk3wcdGc/q3XEm08?= =?us-ascii?Q?oAKMxVKDqovbuiCCbnWOPsNeLqeorbrMSVRp/gqNfzJ6HA0/VjqeRcTlYhIp?= =?us-ascii?Q?EEKUsatgoX87g5CJ8qjBJIu3siVqPW8uoQuUD9qsfVlKV1Aoqgyrcv8xgUMc?= =?us-ascii?Q?spofOr5kz62FdVS+EwmaAAaA+eCnpUVqIwXExNLgqfFo7mkAf+8ijkWcbx9g?= =?us-ascii?Q?koYleIeUiKp3L13wNfZ+wjEntByI/CEMr/?= X-Forefront-PRVS: 0325F6C77B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1979; 23:MYV2ryP4G+/L2SpviKIi7uoYQLMMVhxfnKvtI+2kd?= =?us-ascii?Q?5SenNURQ1VL97aQ47Tsrn34h9yn7Xk4vo2lmQOm9pJ/swIovo8z2YR6U0zZ/?= =?us-ascii?Q?As8tBtHqnCeAdI4XG+lVUA98afFMA71lZLwqC6p6GxYZzeyBuWTQR9QKbLJ7?= =?us-ascii?Q?B2+beTyF7VaQaYhlteZq+/CsSp3iKK0ma0VUDHCNa1gjtJ8mV44Q26StRKRc?= =?us-ascii?Q?YZgRjPX+r74I46SBsnrsWppUOt5UBEnmc4fojdMycKwLqFmgpl0haaYBSSnO?= =?us-ascii?Q?+zZNIZhWRk8RXeDOuMZa8dqwtHppc5pxRz8YdwPR2SGHNoSTvxnoBS+jxfSg?= =?us-ascii?Q?8fCJXr355n9Emhrj2dOPAoSS5d42A8N6bLJTdcTXU+WHWTPTXuxE97sdFPVD?= =?us-ascii?Q?C0S3j/sZPaMpWC5tm1kPzAZQTiUz8+f8K9JT340AGgUX0enk8I9TFARqybbY?= =?us-ascii?Q?alotc0pUtf73ijExtmaKTKLeJ1us7Hh0RXxzlZN6Qgs6aKhGUrk+0g1fOnrl?= =?us-ascii?Q?hNAPuKlAuZl+hpqUZruE56CaV9tV8upfJKzR2Yk3ndN5ZQa0id2TAwOAZTOu?= =?us-ascii?Q?Lbzu+tb4o3FKGcCXXiOsSexF/ICKL2Re7OA5C+y1/xcUA+Jm1FgV6vUklnZw?= =?us-ascii?Q?3KoVNI0SAMTXi620L6N5mplzeAdWiMOU9PTaQDZJh1nxWD3xdRQSAYTmWbYT?= =?us-ascii?Q?I9HWPriSW6qhRyp54kJ3ziMqZna5fBhpirX0d1fL0F7RABl6p2kc/nDaFHrf?= =?us-ascii?Q?tpMARX0XxdEpVvAO6NinDyCwqmk6bdz6WkDOnOCgVJZVk15jSS30L7IqgZ/2?= =?us-ascii?Q?lSaqosyOA/U8CxVSAJxBD/GRWgNu6JCV/H4+t8bBP1rEidrOEBhwk4XXe9ww?= =?us-ascii?Q?b0nwshH+GcDrhFauQYDZLIehQsjGxncEDGzrgc+DNsXhJJkwMwaX3GSflz3x?= =?us-ascii?Q?5BxWuvfPlRVXyfQ2UJ85lmJcC4t4/MNd9GNxKZqlU6aKhfZDG91F1OGvuV/r?= =?us-ascii?Q?mTl3gmAHwkC4f0bwKBzhCTKy1ErWrhZnins9/pXYWsMzO+I6n84Li9+TKAhT?= =?us-ascii?Q?7X7xeAp+Yx/qa6dLYndVw9q56C94n/KQZKyvdsIfZqbxXHQqZG1g/SKDG+Cx?= =?us-ascii?Q?ftQrtVsj5Timh8zlglWUKOoGDBLOCWS+MTtIBCMjJZQOHiSQM5l8GnjG1TI6?= =?us-ascii?Q?DwktfNTmZ2gJmXmkTPWyo7UpEdEkrZVcEcfs1EkidGMjmn9QxYqH61jAc67L?= =?us-ascii?Q?J76GPHYpVKsu7WxIbvx8780IqoBs8RMcHKTqTftCtFRdcYzSUhvTfbG8flNk?= =?us-ascii?Q?9yw+3Ysw4EoipWGhu9KnP01+SGqQZYxVuLakyZyH3Bf?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1979; 6:eFf+ScxH9Y719xxoliLPtcH4UVv6eITWeQdLeZ8qID/hZ/QvaVeVXHP2Tk/2Ju6TTefY2JSr10FJqbO83Kn4ilPK9Cd3qgugKk6G8Xv/w2Dn4Gnqlli5DyWeRn6nBNJQl5fdOBYXYYFctpp78u2jsvoSc4+hG7TdB5MrZXAA0oa8IL8WCkmZ8rqOXgXbwe8puaqYfS8QCRUojsBStURP0wFXz5zRllb6s8jszeTMYmwcCeg876L1YR8WZrqfKoULfFuU8jy1C+0iikzYfBLJCyCqKEJZriqs3PquBxD1fMZShxBzJEPXJVXHcPeW6e2J3lz1wze1jmlP2BHibgDa6A0T7EqbZaj7LMXOHvkkAI+RQG6Ziwp1DDswENxky1AiqQunAig9dtu9M7Yt2H9D6J9paHk/yt3XThfyHTKZ0ID4kUW02qTLMzLOt0WftL4drJ+DP+ZOTAy8UTXMDLc71JBSTfO0zI4P7HHAMqNz+ANdV3Hj6wpo3YQC6/fwniV/XgLKWVOt6tzrqvAP6JzyN56XLSzCQ1xkk2wOnSamqgU= X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1979; 5:ukGpuqYlptRgASw5jCiPaHm+EWgOG8toasB3pwumE//OsrQB6VKPFV0hCsNvN79kbinjLQVb5qpl9YTOlKQ+rz42BWzmmKSwbuKcaOXM2fn1JtEhFM3LArF0E3aCeXUYhMOPRAgYxfmey5b+q8WwUoBBOSMB6fVt9tyENc/nkfiaHkl4C70RGzDFUBHl6+ZOno1b8ZuZHHjnT+mjIthZSM6oDwP3M1V4HkJBYESbtiZRF9QFsi/xH9MaHAWOBYUwv4bFmE+BYS3xq5rKVPXWsQw2QNzHDx3hSyNc2muMUqMm53laUm3M1rruCbQXomXiL0DoE0cVePg0MlrfjYosl4em/TQdAjiN221E8qpWCgWveUzDsDbFsHQRUQgHLu/7k1TZiERTBC9OK4Vr/VlMJh/RphLdLm0GnrAk2sGwdSwJDp6KBtIoykvE5QQUxVFVZlKPCH4a1wtk58Z/Y1ADmfSP8oe+w8QifYJ81+vlrV1IOmYSuH8XH3N9+j0duNj/; 24:qznwAkdqkyEl6qn/w6glqwro0ajW7RX1l/1O/glPTfuTT2ontTTk2392WpxpGejmxm6hByVe4MPnLr7DyKfw0SbdpDbCAFcfYVyePzKhLsg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1979; 7:ZVMUlN2gPJzdL6Cq/aGiXg2vuqCLQpD9JnSVcKr7WiU5/GDR541ZKX3Pig5iC7XOQ5rcAUaFy9y8LuEeByBKDIv22O8HwFclz76SLFIkyylnD2JHiO3dBIDeI4C9Jb9ngSUol1l7aOmsmCJb+bWH0PfdKeB+hN+0KYZpeCFhKkBjkYMNdV4JGG2rdpWzb4Zp2V9OT5OqJaHWnE/QONKi4biTJvI5biHOaSv64gCFxdVBniFHfzN59mWrXLhgC+MGUn5lrjiDB012z5jc6+JvXjo7I7CLxCguQl5/oda0keA0460QjmA1DM/2NuRQ5dC/SkCcn74VdcPSbKaFhJzJUA== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 16:59:12.3281 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1979 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 16:59:16 -0000 Ngie Cooper (yaneurabeya) wrote: > > These should not be stored uuencoded. It serves no purpose other > > than bloating the repo and causing spammy commit mails like this one > > where we got a huge tail of garbage output. The tests appear to contain generated filesystem images. eg. img-1x1-512-mbr.vmdk.gz.uu Is storing img-1x1-512-mbr.vmdk.gz any more palatable? One option would be to store a sha256 hash of the result. If the image generated by the test hashes to the correct value - you pass. Of course if the test fails, you are completely in the dark as to how/why. With the current arrangment, marcel at least has something he can examine to see where the output generation went wrong. From owner-svn-src-head@freebsd.org Thu Jun 1 17:16:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 192B1B7ACD1; Thu, 1 Jun 2017 17:16:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E10EC8337B; Thu, 1 Jun 2017 17:16:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3B1B921BD; Thu, 1 Jun 2017 17:16:42 +0000 (UTC) Date: Thu, 1 Jun 2017 17:16:42 +0000 From: Alexey Dokuchaev To: "Simon J. Gerraty" Cc: "Ngie Cooper (yaneurabeya)" , Marcel Moolenaar , src-committers , svn-src-all@FreeBSD.org, Brooks Davis , svn-src-head@FreeBSD.org, Ngie Cooper Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Message-ID: <20170601171642.GA601@FreeBSD.org> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <84744.1496336318@kaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84744.1496336318@kaos.jnpr.net> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 17:16:43 -0000 On Thu, Jun 01, 2017 at 09:58:38AM -0700, Simon J. Gerraty wrote: > One option would be to store a sha256 hash of the result. > If the image generated by the test hashes to the correct value - you > pass. That should be preferred. Storing binary blobs in VCS is bad practice. > Of course if the test fails, you are completely in the dark as to > how/why. Not really: you checkout previous version (which produces correct hash) and store generated image for later inspection and diffing. > Is storing img-1x1-512-mbr.vmdk.gz any more palatable? This is barely acceptable, but only if image was zerofied/sparsed prior to compression. Also, the image should be of the minimal (sufficient) working size. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 1 18:26:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E2B6B7BCA2; Thu, 1 Jun 2017 18:26:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69D7E96; Thu, 1 Jun 2017 18:26:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51IQvHK070488; Thu, 1 Jun 2017 18:26:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51IQvFx070487; Thu, 1 Jun 2017 18:26:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706011826.v51IQvFx070487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 1 Jun 2017 18:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319448 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 18:26:58 -0000 Author: glebius Date: Thu Jun 1 18:26:57 2017 New Revision: 319448 URL: https://svnweb.freebsd.org/changeset/base/319448 Log: Simplify boot pages management in UMA. It is simply a contigous virtual memory pointer and number of pages. There is no need to build a linked list here. Just increment pointer and decrement counter. The only functional difference to old allocator is that before we gave pages from topmost and down to lowest, and now we give them in normal ascending order. While here remove padalign from a mutex that is unused at runtime. Reviewed by: alc Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 1 17:07:13 2017 (r319447) +++ head/sys/vm/uma_core.c Thu Jun 1 18:26:57 2017 (r319448) @@ -140,13 +140,16 @@ static LIST_HEAD(,uma_zone) uma_cachezones = /* This RW lock protects the keg list */ static struct rwlock_padalign uma_rwlock; -/* Linked list of boot time pages */ -static LIST_HEAD(,uma_slab) uma_boot_pages = - LIST_HEAD_INITIALIZER(uma_boot_pages); +/* + * Pointer and counter to pool of pages, that is preallocated at + * startup to bootstrap UMA. Early zones continue to use the pool + * until it is depleted, so allocations may happen after boot, thus + * we need a mutex to protect it. + */ +static char *bootmem; +static int boot_pages; +static struct mtx uma_boot_pages_mtx; -/* This mutex protects the boot time pages list */ -static struct mtx_padalign uma_boot_pages_mtx; - static struct sx uma_drain_lock; /* Is the VM done starting up? */ @@ -1034,36 +1037,24 @@ static void * startup_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *pflag, int wait) { uma_keg_t keg; - uma_slab_t tmps; - int pages, check_pages; + void *mem; + int pages; keg = zone_first_keg(zone); pages = howmany(bytes, PAGE_SIZE); - check_pages = pages - 1; KASSERT(pages > 0, ("startup_alloc can't reserve 0 pages\n")); /* * Check our small startup cache to see if it has pages remaining. */ mtx_lock(&uma_boot_pages_mtx); - - /* First check if we have enough room. */ - tmps = LIST_FIRST(&uma_boot_pages); - while (tmps != NULL && check_pages-- > 0) - tmps = LIST_NEXT(tmps, us_link); - if (tmps != NULL) { - /* - * It's ok to lose tmps references. The last one will - * have tmps->us_data pointing to the start address of - * "pages" contiguous pages of memory. - */ - while (pages-- > 0) { - tmps = LIST_FIRST(&uma_boot_pages); - LIST_REMOVE(tmps, us_link); - } + if (pages <= boot_pages) { + mem = bootmem; + boot_pages -= pages; + bootmem += pages * PAGE_SIZE; mtx_unlock(&uma_boot_pages_mtx); - *pflag = tmps->us_flags; - return (tmps->us_data); + *pflag = UMA_SLAB_BOOT; + return (mem); } mtx_unlock(&uma_boot_pages_mtx); if (booted < UMA_STARTUP2) @@ -1748,11 +1739,9 @@ zone_foreach(void (*zfunc)(uma_zone_t)) /* Public functions */ /* See uma.h */ void -uma_startup(void *bootmem, int boot_pages) +uma_startup(void *mem, int npages) { struct uma_zctor_args args; - uma_slab_t slab; - int i; #ifdef UMA_DEBUG printf("Creating uma keg headers zone and keg.\n"); @@ -1773,16 +1762,9 @@ uma_startup(void *bootmem, int boot_pages) /* The initial zone has no Per cpu queues so it's smaller */ zone_ctor(kegs, sizeof(struct uma_zone), &args, M_WAITOK); -#ifdef UMA_DEBUG - printf("Filling boot free list.\n"); -#endif - for (i = 0; i < boot_pages; i++) { - slab = (uma_slab_t)((uint8_t *)bootmem + (i * UMA_SLAB_SIZE)); - slab->us_data = (uint8_t *)slab; - slab->us_flags = UMA_SLAB_BOOT; - LIST_INSERT_HEAD(&uma_boot_pages, slab, us_link); - } mtx_init(&uma_boot_pages_mtx, "UMA boot pages", NULL, MTX_DEF); + bootmem = mem; + boot_pages = npages; #ifdef UMA_DEBUG printf("Creating uma zone headers zone and keg.\n"); From owner-svn-src-head@freebsd.org Thu Jun 1 18:27:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7583CB7BCEC; Thu, 1 Jun 2017 18:27:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D9441E0; Thu, 1 Jun 2017 18:27:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id u26so8126932pfd.2; Thu, 01 Jun 2017 11:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=d5T5DiW1azUMCdgU6fO5gaNT0Ga90Fqig2abiRnRkuA=; b=BhtvR6hN/hR0sOqJcwsPX8xRN9VEGAD2NWwj1Xq0WsqEPvmXimw1FKhVPmDaitIDoW uP98NgYsW0Dxf/DtvbXe3cA98QsYSJmEMZo1RdOCI0qeWP1su5PuD3gBkX3iNdmTdE7c cVov377WW5kHCif4HtXxz9T1SYItKkbZW15YwJt173RpBNnQH8oGVRAj79sMtkUHMdv8 Uu+xPZb+gpag1kKTgJG7nCBbi0Cd14Q5NaeyoflVJKaVulJ4VvX1hA6o1uDqsuJTnMIZ LrlmVd8Ekx1YFy2s2okPP0yTC3rgLxkvBfJriuqWtWGqNTXVI8tAuPuqyhl23E9JNE6q lI9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=d5T5DiW1azUMCdgU6fO5gaNT0Ga90Fqig2abiRnRkuA=; b=JKAtwxm9oOJ3fUxkAJwwMJfIiKR1OfZNOCZFQ7JULr8z+ugqjXGKLyRbiwMnodeGuK 15AIgFJpaU/lts4cOd7m6xlMavAiGo1i+wMeBJou1xKwyqWvR7dPaTx6TbRinqNuguX1 KqEeMicAiw2bn96yZENHtjGX83ADLUV2ZJWzOHNH5UCs1m2725I1EuvHFtgYNJZDsTSh A4CCygHmyP49fi62jD6Hiqqs/p2iCgpf9rKskdkzg/UDqoacBA2lTaC3sbcqKg46gqI8 Odow85UpHzMew/JEnK01HnTiOjlsIpbqyAsv0kBIagkGyObS6K87i2CBwSj8AZpPLSpN VYCw== X-Gm-Message-State: AODbwcA2yi6xqjncVL2GRz2F+SFxoGrDeUWSz2fYuEm97918vo/5orAF UWhKYQbtC0peR6hn6r8= X-Received: by 10.84.234.1 with SMTP id m1mr68427869plk.41.1496341641538; Thu, 01 Jun 2017 11:27:21 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id x5sm37326323pfi.94.2017.06.01.11.27.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 11:27:20 -0700 (PDT) Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_70298DD0-5C10-4996-8206-E9E727E1224C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170601171642.GA601@FreeBSD.org> Date: Thu, 1 Jun 2017 11:27:18 -0700 Cc: "Simon J. Gerraty" , Marcel Moolenaar , src-committers , svn-src-all@FreeBSD.org, Brooks Davis , svn-src-head@FreeBSD.org, Ngie Cooper Message-Id: References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <84744.1496336318@kaos.jnpr.net> <20170601171642.GA601@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 18:27:22 -0000 --Apple-Mail=_70298DD0-5C10-4996-8206-E9E727E1224C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 1, 2017, at 10:16, Alexey Dokuchaev wrote: >=20 > On Thu, Jun 01, 2017 at 09:58:38AM -0700, Simon J. Gerraty wrote: >> One option would be to store a sha256 hash of the result. >> If the image generated by the test hashes to the correct value - you >> pass. >=20 > That should be preferred. Storing binary blobs in VCS is bad = practice. >=20 >> Of course if the test fails, you are completely in the dark as to >> how/why. >=20 > Not really: you checkout previous version (which produces correct = hash) > and store generated image for later inspection and diffing. >=20 >> Is storing img-1x1-512-mbr.vmdk.gz any more palatable? >=20 > This is barely acceptable, but only if image was zerofied/sparsed = prior > to compression. Also, the image should be of the minimal (sufficient) > working size. I vote for not checking in the SHAs. If something fails (as = someone else mentioned on the lists), it=E2=80=99s really hard to debug = why it failed. I think marcel@=E2=80=99s proposal for hexdump -C text dumps are = the best way to handle this. Thanks, -Ngie --Apple-Mail=_70298DD0-5C10-4996-8206-E9E727E1224C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZMFyHAAoJEPWDqSZpMIYVOWkP/RiWtIzJXiUBzKzgBvUwbTT+ JFLyYY1F+YqKUJsJLInOzF4rKiO7nVVb0edvr10EYFjkfkttItxwnYZAzrjdbHrc nipBzXmuOgDf0zUy8MHOucvIa+IdQ7fgdcX42dB9r3pb1E7ZTwxd3ju++eW8CWZc u0VlxX5L9/hgA5Q8rh2yS+V1PQt/mNS0iO2cM39JJtr8nhJ5cz6KAPIn0+7bErLq CA4xydgjEsBSZb77oAymE+MpYKsoa2j1HW+qaJUSIfV+dNuaUmM91w4i2E0WjEeV iQ/AierBY0QBtUgjBQZUcMgLp3wOdFQG94HlUnQqs86ejrmFCRj44YGBDH2lubpQ axxu6U0y6ja4R7XQxu1gKZaIrOMkbB2pCHFL0XUV3Iv3uSAt8fam75ZhA8X+xvvZ PGag0NDoDO+v0LS2FazyZpgPuvdSnbiFDN7w3eCH6SOf/o0+/gN4LmD2MB2m9bRc b97ra7RHmEbg1syJTxZVolQFqCNx3j3AX7FIdNKOTXNy8Vgr0Z4AxwjaGATlXKM8 4htHWFfEKzJsa31AID3+PnRacqrlDkruxVhofNMDseoJduwrC3P+G2PP4xXNx8Hy E5XZjfRJZEJu9mJJODffx5Jb7RHyBhSh4g3yh2KTbjEmD/4lHgM3t6tHczP3x68d jLLwfqSS/hufMCaecIWt =YJ/f -----END PGP SIGNATURE----- --Apple-Mail=_70298DD0-5C10-4996-8206-E9E727E1224C-- From owner-svn-src-head@freebsd.org Thu Jun 1 18:36:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC5A6B7C179; Thu, 1 Jun 2017 18:36:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6DE6E64; Thu, 1 Jun 2017 18:36:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51Iaqhd074593; Thu, 1 Jun 2017 18:36:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Iaq8x074592; Thu, 1 Jun 2017 18:36:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706011836.v51Iaq8x074592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 1 Jun 2017 18:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319450 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 18:36:53 -0000 Author: glebius Date: Thu Jun 1 18:36:52 2017 New Revision: 319450 URL: https://svnweb.freebsd.org/changeset/base/319450 Log: As old prophecy says, some day UMA_DEBUG printfs shall be made CTRs. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 1 18:35:04 2017 (r319449) +++ head/sys/vm/uma_core.c Thu Jun 1 18:36:52 2017 (r319450) @@ -50,13 +50,6 @@ #include __FBSDID("$FreeBSD$"); -/* I should really use ktr.. */ -/* -#define UMA_DEBUG 1 -#define UMA_DEBUG_ALLOC 1 -#define UMA_DEBUG_ALLOC_1 1 -*/ - #include "opt_ddb.h" #include "opt_param.h" #include "opt_vm.h" @@ -822,6 +815,9 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star int i; uint8_t flags; + CTR4(KTR_UMA, "keg_free_slab keg %s(%p) slab %p, returning %d bytes", + keg->uk_name, keg, slab, PAGE_SIZE * keg->uk_ppera); + mem = slab->us_data; flags = slab->us_flags; i = start; @@ -832,10 +828,6 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star } if (keg->uk_flags & UMA_ZONE_OFFPAGE) zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE); -#ifdef UMA_DEBUG - printf("%s: Returning %d bytes.\n", keg->uk_name, - PAGE_SIZE * keg->uk_ppera); -#endif keg->uk_freef(mem, PAGE_SIZE * keg->uk_ppera, flags); } @@ -858,9 +850,8 @@ keg_drain(uma_keg_t keg) if (keg->uk_flags & UMA_ZONE_NOFREE || keg->uk_freef == NULL) return; -#ifdef UMA_DEBUG - printf("%s free items: %u\n", keg->uk_name, keg->uk_free); -#endif + CTR3(KTR_UMA, "keg_drain %s(%p) free items: %u", + keg->uk_name, keg, keg->uk_free); KEG_LOCK(keg); if (keg->uk_free == 0) goto finished; @@ -950,9 +941,6 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int wai slab = NULL; mem = NULL; -#ifdef UMA_DEBUG - printf("alloc_slab: Allocating a new slab for %s\n", keg->uk_name); -#endif allocf = keg->uk_allocf; KEG_UNLOCK(keg); @@ -1017,6 +1005,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int wai out: KEG_LOCK(keg); + CTR3(KTR_UMA, "keg_alloc_slab: allocated slab %p for %s(%p)", + slab, keg->uk_name, keg); + if (slab != NULL) { if (keg->uk_flags & UMA_ZONE_HASH) UMA_HASH_INSERT(&keg->uk_hash, slab, mem); @@ -1274,15 +1265,13 @@ keg_small_init(uma_keg_t keg) keg->uk_ipers = slabsize / keg->uk_rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); -#ifdef UMA_DEBUG - printf("UMA decided we need offpage slab headers for " - "keg: %s, calculated wastedspace = %d, " + CTR6(KTR_UMA, "UMA decided we need offpage slab headers for " + "keg: %s(%p), calculated wastedspace = %d, " "maximum wasted space allowed = %d, " "calculated ipers = %d, " - "new wasted space = %d\n", keg->uk_name, wastedspace, + "new wasted space = %d\n", keg->uk_name, keg, wastedspace, slabsize / UMA_MAX_WASTE, keg->uk_ipers, slabsize - keg->uk_ipers * keg->uk_rsize); -#endif keg->uk_flags |= UMA_ZONE_OFFPAGE; } @@ -1492,13 +1481,10 @@ keg_ctor(void *mem, int size, void *udata, int flags) if (keg->uk_flags & UMA_ZONE_HASH) hash_alloc(&keg->uk_hash); -#ifdef UMA_DEBUG - printf("UMA: %s(%p) size %d(%d) flags %#x ipers %d ppera %d out %d free %d\n", - zone->uz_name, zone, keg->uk_size, keg->uk_rsize, keg->uk_flags, - keg->uk_ipers, keg->uk_ppera, + CTR5(KTR_UMA, "keg_ctor %p zone %s(%p) out %d free %d\n", + keg, zone->uz_name, zone, (keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free, keg->uk_free); -#endif LIST_INSERT_HEAD(&keg->uk_zones, zone, uz_link); @@ -1743,9 +1729,6 @@ uma_startup(void *mem, int npages) { struct uma_zctor_args args; -#ifdef UMA_DEBUG - printf("Creating uma keg headers zone and keg.\n"); -#endif rw_init(&uma_rwlock, "UMA lock"); /* "manually" create the initial zone */ @@ -1766,9 +1749,6 @@ uma_startup(void *mem, int npages) bootmem = mem; boot_pages = npages; -#ifdef UMA_DEBUG - printf("Creating uma zone headers zone and keg.\n"); -#endif args.name = "UMA Zones"; args.size = sizeof(struct uma_zone) + (sizeof(struct uma_cache) * (mp_maxid + 1)); @@ -1782,10 +1762,6 @@ uma_startup(void *mem, int npages) /* The initial zone has no Per cpu queues so it's smaller */ zone_ctor(zones, sizeof(struct uma_zone), &args, M_WAITOK); -#ifdef UMA_DEBUG - printf("Creating slab and hash zones.\n"); -#endif - /* Now make a zone for slab headers */ slabzone = uma_zcreate("UMA Slabs", sizeof(struct uma_slab), @@ -1800,10 +1776,6 @@ uma_startup(void *mem, int npages) bucket_init(); booted = UMA_STARTUP; - -#ifdef UMA_DEBUG - printf("UMA startup complete.\n"); -#endif } /* see uma.h */ @@ -1813,9 +1785,6 @@ uma_startup2(void) booted = UMA_STARTUP2; bucket_enable(); sx_init(&uma_drain_lock, "umadrain"); -#ifdef UMA_DEBUG - printf("UMA startup2 complete.\n"); -#endif } /* @@ -1826,14 +1795,9 @@ uma_startup2(void) static void uma_startup3(void) { -#ifdef UMA_DEBUG - printf("Starting callout.\n"); -#endif + callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); -#ifdef UMA_DEBUG - printf("UMA startup3 complete.\n"); -#endif } static uma_keg_t @@ -2073,11 +2037,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); /* This is the fast path allocation */ -#ifdef UMA_DEBUG_ALLOC_1 - printf("Allocating one item from %s(%p)\n", zone->uz_name, zone); -#endif - CTR3(KTR_UMA, "uma_zalloc_arg thread %x zone %s flags %d", curthread, - zone->uz_name, flags); + CTR4(KTR_UMA, "uma_zalloc_arg thread %x zone %s(%p) flags %d", + curthread, zone->uz_name, zone, flags); if (flags & M_WAITOK) { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, @@ -2150,9 +2111,9 @@ zalloc_start: */ bucket = cache->uc_freebucket; if (bucket != NULL && bucket->ub_cnt > 0) { -#ifdef UMA_DEBUG_ALLOC - printf("uma_zalloc: Swapping empty with alloc.\n"); -#endif + CTR2(KTR_UMA, + "uma_zalloc: zone %s(%p) swapping empty with alloc", + zone->uz_name, zone); cache->uc_freebucket = cache->uc_allocbucket; cache->uc_allocbucket = bucket; goto zalloc_start; @@ -2233,6 +2194,8 @@ zalloc_start: * will use the just filled bucket. */ bucket = zone_alloc_bucket(zone, udata, flags); + CTR3(KTR_UMA, "uma_zalloc: zone %s(%p) bucket zone returned %p", + zone->uz_name, zone, bucket); if (bucket != NULL) { ZONE_LOCK(zone); critical_enter(); @@ -2254,10 +2217,6 @@ zalloc_start: /* * We may not be able to get a bucket so return an actual item. */ -#ifdef UMA_DEBUG - printf("uma_zalloc_arg: Bucketzone returned NULL\n"); -#endif - zalloc_item: item = zone_alloc_item(zone, udata, flags); @@ -2563,9 +2522,6 @@ zone_alloc_item(uma_zone_t zone, void *udata, int flag item = NULL; -#ifdef UMA_DEBUG_ALLOC - printf("INTERNAL: Allocating one item from %s(%p)\n", zone->uz_name, zone); -#endif if (zone->uz_import(zone->uz_arg, &item, 1, flags) != 1) goto fail; atomic_add_long(&zone->uz_allocs, 1); @@ -2594,9 +2550,14 @@ zone_alloc_item(uma_zone_t zone, void *udata, int flag if (flags & M_ZERO) uma_zero_item(item, zone); + CTR3(KTR_UMA, "zone_alloc_item item %p from %s(%p)", item, + zone->uz_name, zone); + return (item); fail: + CTR2(KTR_UMA, "zone_alloc_item failed from %s(%p)", + zone->uz_name, zone); atomic_add_long(&zone->uz_fails, 1); return (NULL); } @@ -2613,9 +2574,6 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); -#ifdef UMA_DEBUG_ALLOC_1 - printf("Freeing item %p to %s(%p)\n", item, zone->uz_name, zone); -#endif CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread, zone->uz_name); @@ -2727,9 +2685,9 @@ zfree_start: /* Can we throw this on the zone full list? */ if (bucket != NULL) { -#ifdef UMA_DEBUG_ALLOC - printf("uma_zfree: Putting old bucket on the free list.\n"); -#endif + CTR3(KTR_UMA, + "uma_zfree: zone %s(%p) putting bucket %p on free list", + zone->uz_name, zone, bucket); /* ub_cnt is pointing to the last free item */ KASSERT(bucket->ub_cnt != 0, ("uma_zfree: Attempting to insert an empty bucket onto the full list.\n")); @@ -2744,10 +2702,9 @@ zfree_start: zone->uz_count++; ZONE_UNLOCK(zone); -#ifdef UMA_DEBUG_ALLOC - printf("uma_zfree: Allocating new free bucket.\n"); -#endif bucket = bucket_alloc(zone, udata, M_NOWAIT); + CTR3(KTR_UMA, "uma_zfree: zone %s(%p) allocated bucket %p", + zone->uz_name, zone, bucket); if (bucket) { critical_enter(); cpu = curcpu; @@ -3138,9 +3095,7 @@ static void uma_reclaim_locked(bool kmem_danger) { -#ifdef UMA_DEBUG - printf("UMA: vm asked us to release pages!\n"); -#endif + CTR0(KTR_UMA, "UMA: vm asked us to release pages!"); sx_assert(&uma_drain_lock, SA_XLOCKED); bucket_enable(); zone_foreach(zone_drain); From owner-svn-src-head@freebsd.org Thu Jun 1 19:21:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2620DB7CEDA; Thu, 1 Jun 2017 19:21:32 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9A812F46; Thu, 1 Jun 2017 19:21:31 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51JLUdi094343; Thu, 1 Jun 2017 19:21:30 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51JLUqE094342; Thu, 1 Jun 2017 19:21:30 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201706011921.v51JLUqE094342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Thu, 1 Jun 2017 19:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319453 - head/contrib/telnet/telnetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 19:21:32 -0000 Author: stevek Date: Thu Jun 1 19:21:30 2017 New Revision: 319453 URL: https://svnweb.freebsd.org/changeset/base/319453 Log: Fix memory leak in edithost The problem is that when the parameter 'pat' is null, the function locally allocates a NULL string but never frees it. Instead of tracking the local alloc, it is noted that the while(*pat) never enters when there is a local alloc. So instead of doing the local alloc, check that 'pat' is null before the while(*pat) loop. Found using clang's static analyzer - scan-build Submitted by: Thomas Rix Reviewed by: markm Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9689 Modified: head/contrib/telnet/telnetd/utility.c Modified: head/contrib/telnet/telnetd/utility.c ============================================================================== --- head/contrib/telnet/telnetd/utility.c Thu Jun 1 18:39:54 2017 (r319452) +++ head/contrib/telnet/telnetd/utility.c Thu Jun 1 19:21:30 2017 (r319453) @@ -360,30 +360,30 @@ edithost(char *pat, char *host) { char *res = editedhost; - if (!pat) - pat = strdup(""); - while (*pat) { - switch (*pat) { + if (pat) { + while (*pat) { + switch (*pat) { - case '#': - if (*host) - host++; - break; + case '#': + if (*host) + host++; + break; - case '@': - if (*host) - *res++ = *host++; - break; + case '@': + if (*host) + *res++ = *host++; + break; - default: - *res++ = *pat; - break; + default: + *res++ = *pat; + break; + } + if (res == &editedhost[sizeof editedhost - 1]) { + *res = '\0'; + return; + } + pat++; } - if (res == &editedhost[sizeof editedhost - 1]) { - *res = '\0'; - return; - } - pat++; } if (*host) (void) strncpy(res, host, From owner-svn-src-head@freebsd.org Thu Jun 1 19:27:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95576B7D079; Thu, 1 Jun 2017 19:27:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6407839D1; Thu, 1 Jun 2017 19:27:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51JRcsq095447; Thu, 1 Jun 2017 19:27:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51JRcMd095446; Thu, 1 Jun 2017 19:27:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706011927.v51JRcMd095446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Jun 2017 19:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319454 - head/tests/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 19:27:39 -0000 Author: jhb Date: Thu Jun 1 19:27:38 2017 New Revision: 319454 URL: https://svnweb.freebsd.org/changeset/base/319454 Log: Honor the requested crid when running a test. Otherwise, the kernel is free to choose an aribtrary crypto device rather than the requested device subverting tests that force the use of a specific device. MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D10762 Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Thu Jun 1 19:21:30 2017 (r319453) +++ head/tests/sys/opencrypto/cryptodev.py Thu Jun 1 19:27:38 2017 (r319454) @@ -173,10 +173,7 @@ class Crypto: if not cipher and not mac: raise ValueError('one of cipher or mac MUST be specified.') - ses.crid = CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE - #ses.crid = CRYPTOCAP_F_HARDWARE - #ses.crid = CRYPTOCAP_F_SOFTWARE - #ses.crid = 0 + ses.crid = crid #print `ses` s = array.array('B', ses.pack_hdr()) #print `s` From owner-svn-src-head@freebsd.org Thu Jun 1 19:46:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A37AB7D4BB; Thu, 1 Jun 2017 19:46:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE8136448D; Thu, 1 Jun 2017 19:46:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51JknUH003420; Thu, 1 Jun 2017 19:46:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Jknsv003419; Thu, 1 Jun 2017 19:46:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706011946.v51Jknsv003419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 1 Jun 2017 19:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319455 - head/tests/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 19:46:50 -0000 Author: ngie Date: Thu Jun 1 19:46:48 2017 New Revision: 319455 URL: https://svnweb.freebsd.org/changeset/base/319455 Log: Fix up `TEST_METADATA` - `TEST_METADATA.foo` should be `TEST_METADATA.run_tests`: this will unbreak trying to run the tests on a system without python installed in $PATH. - The tests require root because they load aesni(4) and/or cryptodev(4) if not already loaded. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/Makefile Modified: head/tests/sys/opencrypto/Makefile ============================================================================== --- head/tests/sys/opencrypto/Makefile Thu Jun 1 19:27:38 2017 (r319454) +++ head/tests/sys/opencrypto/Makefile Thu Jun 1 19:46:48 2017 (r319455) @@ -7,7 +7,9 @@ BINDIR= ${TESTSDIR} PLAIN_TESTS_SH= runtests -TEST_METADATA.foo+=required_programs="python" +TEST_METADATA.runtests+= required_programs="python" +TEST_METADATA.runtests+= required_user="root" + PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py ${PACKAGE}FILES+= ${PYMODULES} From owner-svn-src-head@freebsd.org Thu Jun 1 19:58:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA36B7D94D; Thu, 1 Jun 2017 19:58:41 +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 BEE1864F0A; Thu, 1 Jun 2017 19:58:41 +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 v51Jwedu009396; Thu, 1 Jun 2017 19:58:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51JwemR009395; Thu, 1 Jun 2017 19:58:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706011958.v51JwemR009395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 1 Jun 2017 19:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319456 - head/tests/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 19:58:42 -0000 Author: ngie Date: Thu Jun 1 19:58:40 2017 New Revision: 319456 URL: https://svnweb.freebsd.org/changeset/base/319456 Log: tests/sys/opencrypto/runtests: apply minor polish to test script - Refactor kld loading/unloading logic: -- Use a loop instead of an unrolled one. -- Check for the module being loaded before trying to load it, to reduce noise when loading modules that are already loaded. -- Don't mute stderr from kldload -- it could be potentially useful to the tester. -- In the event that the test script was terminated early, it would leave the modules still attached to the system (which is undesirable). Always unload the modules at test end with EXIT/SIGINT/SIGTERM so the system is returned to its former operating state as best possible. Unload the modules in reverse order, in part for consistency and/or dependency reasons. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/runtests.sh Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Thu Jun 1 19:46:48 2017 (r319455) +++ head/tests/sys/opencrypto/runtests.sh Thu Jun 1 19:58:40 2017 (r319456) @@ -29,21 +29,34 @@ # $FreeBSD$ # -set -e +set -ex if [ ! -d /usr/local/share/nist-kat ]; then echo 'Skipping, nist-kat package not installed for test vectors.' exit 0 fi -if kldload aesni 2>/dev/null; then - unloadaesni=1 -fi +loaded_modules= +cleanup_tests() +{ + trap - EXIT INT TERM -if kldload cryptodev 2>/dev/null; then - unloadcdev=1 -fi + set +e + # Unload modules in reverse order + for loaded_module in $(echo $loaded_modules | tr ' ' '\n' | sort -r); do + kldunload $loaded_module + done +} +trap cleanup_tests EXIT INT TERM + +for required_module in aesni cryptodev; do + if ! kldstat -q -m $required_module; then + kldload $required_module + loaded_modules="$loaded_modules $required_module" + fi +done + # Run software crypto test oldcdas=$(sysctl -e kern.cryptodevallowsoft) sysctl kern.cryptodevallowsoft=1 @@ -51,10 +64,3 @@ sysctl kern.cryptodevallowsoft=1 python $(dirname $0)/cryptotest.py sysctl "$oldcdas" - -if [ x"$unloadcdev" = x"1" ]; then - kldunload cryptodev -fi -if [ x"$unloadaesni" = x"1" ]; then - kldunload aesni -fi From owner-svn-src-head@freebsd.org Thu Jun 1 20:03:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51D66B7DC96; Thu, 1 Jun 2017 20:03:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B4E266039; Thu, 1 Jun 2017 20:03:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51K3KC8014204; Thu, 1 Jun 2017 20:03:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51K3KUf014203; Thu, 1 Jun 2017 20:03:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706012003.v51K3KUf014203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Jun 2017 20:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319457 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:03:21 -0000 Author: bdrewery Date: Thu Jun 1 20:03:20 2017 New Revision: 319457 URL: https://svnweb.freebsd.org/changeset/base/319457 Log: META_MODE users should build with -DNO_META_IGNORE_HOST once after ino64 upgrade. See r301467 for more details. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 1 19:58:40 2017 (r319456) +++ head/UPDATING Thu Jun 1 20:03:20 2017 (r319457) @@ -92,6 +92,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: a reboot is required after installing the new kernel before installing world. + Users using META_MODE to build should also use -DNO_META_IGNORE_HOST + to 'make' for the first build after upgrading. + 20170424: The NATM framework including the en(4), fatm(4), hatm(4), and patm(4) devices has been removed. Consumers should plan a From owner-svn-src-head@freebsd.org Thu Jun 1 20:06:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 593CDB7DD3C; Thu, 1 Jun 2017 20:06:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34BDB661AC; Thu, 1 Jun 2017 20:06:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4DC3361B1; Thu, 1 Jun 2017 20:06:05 +0000 (UTC) Date: Thu, 1 Jun 2017 20:06:05 +0000 From: Alexey Dokuchaev To: "Ngie Cooper (yaneurabeya)" Cc: Marcel Moolenaar , Brooks Davis , svn-src-all@FreeBSD.org, "Simon J. Gerraty" , src-committers , svn-src-head@FreeBSD.org, Ngie Cooper Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Message-ID: <20170601200605.GA66626@FreeBSD.org> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <84744.1496336318@kaos.jnpr.net> <20170601171642.GA601@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:06:06 -0000 On Thu, Jun 01, 2017 at 11:27:18AM -0700, Ngie Cooper (yaneurabeya) wrote: > ... > I vote for not checking in the SHAs. If something fails (as someone else > mentioned on the lists), it's really hard to debug why it failed. Like I've said, it's not "really" hard. Check out previous version and generate image with correct hash, there is no strong reason to commit the image other than minor usability improvement of not having to check out previous version. Then again, just my $.02 -- I'm not the one doing actual work here. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 1 20:11:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5A37B7DDE8; Thu, 1 Jun 2017 20:11:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8506566404; Thu, 1 Jun 2017 20:11:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51KBQPG015321; Thu, 1 Jun 2017 20:11:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KBQ95015320; Thu, 1 Jun 2017 20:11:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012011.v51KBQ95015320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319458 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:11:27 -0000 Author: dim Date: Thu Jun 1 20:11:26 2017 New Revision: 319458 URL: https://svnweb.freebsd.org/changeset/base/319458 Log: Add a few missed files to ObsoleteFiles.inc. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jun 1 20:03:20 2017 (r319457) +++ head/ObsoleteFiles.inc Thu Jun 1 20:11:26 2017 (r319458) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20170601: old libifconfig and libifc +OLD_FILES+=usr/lib/libifc.a +OLD_FILES+=usr/lib/libifc_p.a +OLD_FILES+=usr/lib/libifconfig.a +OLD_FILES+=usr/lib/libifconfig_p.a # 20170529: mount.conf(8) -> mount.conf(5) OLD_FILES+=usr/share/man/man8/mount.conf.8.gz # 20170525: remove misleading template @@ -116,6 +121,9 @@ OLD_FILES+=usr/share/doc/usd/contents.ascii.gz OLD_LIBS+=lib/libzfs.so.2 OLD_LIBS+=usr/lib/libarchive.so.6 OLD_LIBS+=usr/lib/libmilter.so.5 +OLD_LIBS+=usr/lib32/libzfs.so.2 +OLD_LIBS+=usr/lib32/libarchive.so.6 +OLD_LIBS+=usr/lib32/libmilter.so.5 # 20170427: NATM configuration support removed OLD_FILES+=etc/rc.d/atm1 OLD_FILES+=etc/rc.d/atm2 From owner-svn-src-head@freebsd.org Thu Jun 1 20:14:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8A89B7DF6D; Thu, 1 Jun 2017 20:14:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7D26670E; Thu, 1 Jun 2017 20:14:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id w69so8703462pfk.1; Thu, 01 Jun 2017 13:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=EjWS/XWt9Plf+y1ICKgTp5LSleIIWjYHQby5IEomw1M=; b=gcXvRf9Tqz4ycHlwPw1WCDkV+ju7RW7BPOJSGmbZVY5HmqEcwTYiE4jwb3RtcUn/iB PLnY8kP7yK7pPtqCbtZRsrLQ0VVhl/oEG5p2ZfdTADx306w8hdm4B/s1rPV/EGyeoBUa 4emLHXl6ORhA0gPvzEGxPVUWuUWGlH9EEE4UZI1dJipD57yY8qzPN/avZ0HFAuCm8mk9 sIUIFButWweExzVFeEjd7y9phiw1WCRdZ2AvPGyY3LTB2YCiaZrRhORduubpgAjlf6Qr OwdGmdA0RAIDxwaXsh3ke+ceozYUf/3ZdrcxVBnj94gahM+o9fUBNibWwQ/dyPUBioDv p+Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=EjWS/XWt9Plf+y1ICKgTp5LSleIIWjYHQby5IEomw1M=; b=cD0qF82dV2sEafU9aPScL2W19tuAdqkvjYKEPdq7wO+BUvManFO2mJ+3IL5iNQnGiq Midt+LoXiuT83FMxEq7faWCVbIvU5iD/LCmdW9BNoHx92ci/cK0UUdWIFxv0d00sUpVm lIwu2Q+zo4u8YKS0dLXMqWbrQRpTjlfFat6pm0RDvXcAir0Yx/KnvriXBnONyQPGPxC8 OvzsdQrIrRqfVuM7+mj9bqwamqz41dzm/fwdcKsIbciYmILnfhwO3dMJOF1JOSrB4b2e FPgowjkRikHGfOX+GfmEVPXW9jrzGD6v1zPXR0GbPhMjdF2Yh/DC382fL0og+bgFyPZm Pibg== X-Gm-Message-State: AODbwcAcS2kmsqZR0OXk4fZ2LBjV99EJx1Is4nbt2Zm0a74NCnjP/KBU 8ceb1OJKAiOQP8U/w0g= X-Received: by 10.98.60.8 with SMTP id j8mr1940363pfa.216.1496348083856; Thu, 01 Jun 2017 13:14:43 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k9sm35150204pga.40.2017.06.01.13.14.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 13:14:42 -0700 (PDT) Subject: Re: svn commit: r319295 - head/usr.bin/mkimg/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BE29C8A1-C058-4F55-BECE-85459E728C42"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170601200605.GA66626@FreeBSD.org> Date: Thu, 1 Jun 2017 13:14:41 -0700 Cc: Marcel Moolenaar , Brooks Davis , svn-src-all@FreeBSD.org, "Simon J. Gerraty" , src-committers , svn-src-head@FreeBSD.org, Ngie Cooper Message-Id: <8EE5D277-E03A-4B90-BDF0-9C0A521567FC@gmail.com> References: <201705310801.v4V81CjO004032@repo.freebsd.org> <20170601050339.GA48398@spindle.one-eyed-alien.net> <7FC9CB7D-CF96-4ACA-A38C-E82836127BA4@gmail.com> <84744.1496336318@kaos.jnpr.net> <20170601171642.GA601@FreeBSD.org> <20170601200605.GA66626@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:14:44 -0000 --Apple-Mail=_BE29C8A1-C058-4F55-BECE-85459E728C42 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 1, 2017, at 13:06, Alexey Dokuchaev wrote: >=20 > On Thu, Jun 01, 2017 at 11:27:18AM -0700, Ngie Cooper (yaneurabeya) = wrote: >> ... >> I vote for not checking in the SHAs. If something fails (as someone = else >> mentioned on the lists), it's really hard to debug why it failed. >=20 > Like I've said, it's not "really" hard. Check out previous version = and > generate image with correct hash, there is no strong reason to commit = the > image other than minor usability improvement of not having to check = out > previous version. >=20 > Then again, just my $.02 -- I'm not the one doing actual work here. That=E2=80=99s assuming there aren=E2=80=99t endianness issues, = and less intuitive issues (take the usr.sbin/sa tests for example =E2=80=94= BLEH). With binary files like this, it=E2=80=99s best to do an = abbreviated dump of sorts. Thanks, -Ngie --Apple-Mail=_BE29C8A1-C058-4F55-BECE-85459E728C42 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZMHWxAAoJEPWDqSZpMIYVoQsQAKmil2mH2qrbtQB2/pF4WfIV 6Ep3021wEZYEI6i9ojmkmwhWeLUbBBxRmqgH01QnZBLSjqQl1Drhf8dGJ4IN8zBQ 1qXTmMk14M91r9qj3Ux339W/HsLCk1/LfbryGzTNWk8J8bfesFFwYBwtNKA7MZnd UTNwEIsbrkOEKbStERPVG9cXWDFS5Z0sz4Oq5mN4DooZ2XQtJ2TqvZ8p08R+gf/D 3NfAs8IgMD7ZWr41/jmd2Dmbw0kHJMSt+HybUOrQe2N1IrwEOugaEnmrJXaKtMBW 5HR9m638sn8J13prCPf/O+WAcOmdRmz+VwGpZnLXU1Bx9EUUdBQtP0Ipg8GJe/Px O+pR3kQE0VwVWlNPRWoUQXP6l7rUX2uAIGsL0dIGN4ZzcMdPo+cZclxBhA4H3LUc Hqo0m8CKQHN2RXHlH+68VbmDIYxo0weyZV5/S36Pqhlbb+AG0lRmKllOd/ndOcEP g2ZDAuH2oyDXaJSDB1R0HoFlnZtCP1Wy1SaaZgDyZjmk9pHwjGd2QzIjMfWkp0Da P5SleimxKpjV7TeKLc5Py3DnujraHqSZxJnzQCzBK4xgoCeDDLNyvQkRW/zmod9L PAhjCGU642VKFl3p0dr3NgnFX/QPUpd4aJP8Ft8d9Ndb3XDHBl41aah2QGDfyK/X wSuwHvtHVSQULtzzulO0 =B45j -----END PGP SIGNATURE----- --Apple-Mail=_BE29C8A1-C058-4F55-BECE-85459E728C42-- From owner-svn-src-head@freebsd.org Thu Jun 1 20:29:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78573B7E1C8; Thu, 1 Jun 2017 20:29:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A93A66CD6; Thu, 1 Jun 2017 20:29:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51KTmcc022419; Thu, 1 Jun 2017 20:29:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KTmmX022418; Thu, 1 Jun 2017 20:29:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706012029.v51KTmmX022418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Jun 2017 20:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319459 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:29:49 -0000 Author: bdrewery Date: Thu Jun 1 20:29:48 2017 New Revision: 319459 URL: https://svnweb.freebsd.org/changeset/base/319459 Log: Revert r319457. META_MODE users actually do not need to do anything special assuming they have COMPAT_FREEBSD11 enabled. The host tools in WORLDTMP will continue to work just fine. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 1 20:11:26 2017 (r319458) +++ head/UPDATING Thu Jun 1 20:29:48 2017 (r319459) @@ -92,9 +92,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: a reboot is required after installing the new kernel before installing world. - Users using META_MODE to build should also use -DNO_META_IGNORE_HOST - to 'make' for the first build after upgrading. - 20170424: The NATM framework including the en(4), fatm(4), hatm(4), and patm(4) devices has been removed. Consumers should plan a From owner-svn-src-head@freebsd.org Thu Jun 1 20:46:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A518B7E7B8; Thu, 1 Jun 2017 20:46:45 +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 D73D8676ED; Thu, 1 Jun 2017 20:46:44 +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 v51KkhYd030738; Thu, 1 Jun 2017 20:46:43 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Kkh1I030737; Thu, 1 Jun 2017 20:46:43 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201706012046.v51Kkh1I030737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 1 Jun 2017 20:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319460 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:46:45 -0000 Author: avos Date: Thu Jun 1 20:46:43 2017 New Revision: 319460 URL: https://svnweb.freebsd.org/changeset/base/319460 Log: net80211: initialize i_seq for A-MPDU frames. Fragment number field (part of i_seq) is used for AAD calculation; as a result, without this patch every driver without h/w crypto support need to clear it before ieee80211_crypto_encap(). Also fixes rtwn(4) A-MPDU Tx with dev.rtwn.%d.hwcrypto tunable set to 0 (h/w crypto is disabled). Tested with: * Intel 6205, STA mode. * RTL8188EU, STA mode. Differential Revision: https://reviews.freebsd.org/D10753 Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 1 20:29:48 2017 (r319459) +++ head/sys/net80211/ieee80211_output.c Thu Jun 1 20:46:43 2017 (r319460) @@ -779,6 +779,9 @@ ieee80211_send_setup( tap = &ni->ni_tx_ampdu[tid]; if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) { m->m_flags |= M_AMPDU_MPDU; + + /* NB: zero out i_seq field (for s/w encryption etc) */ + *(uint16_t *)&wh->i_seq[0] = 0; } else { if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK, type & IEEE80211_FC0_SUBTYPE_MASK)) @@ -1610,6 +1613,9 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8 *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); + } else { + /* NB: zero out i_seq field (for s/w encryption etc) */ + *(uint16_t *)wh->i_seq = 0; } } else { /* From owner-svn-src-head@freebsd.org Thu Jun 1 21:05:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D01CB7F009; Thu, 1 Jun 2017 21:05:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6F568E5D; Thu, 1 Jun 2017 21:05:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51L5v3X039606; Thu, 1 Jun 2017 21:05:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51L5v34039605; Thu, 1 Jun 2017 21:05:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012105.v51L5v34039605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 21:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319473 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 21:05:58 -0000 Author: dim Date: Thu Jun 1 21:05:56 2017 New Revision: 319473 URL: https://svnweb.freebsd.org/changeset/base/319473 Log: For arm targets, place ABI at the end of the target triple For some reason, we have been inserting the ABI specification into the middle of the target triple, when building LLVM, like so: armv6-gnueabi-freebsd12.0 This is the wrong way around. LLVM even auto-canonicalizes it to: armv6--freebsd12.0-gnueabi Let's do this the right way in llvm.build.mk instead. While here, define a proper VENDOR macro which can be overridden easily. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10846 Modified: head/lib/clang/llvm.build.mk Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Thu Jun 1 20:59:33 2017 (r319472) +++ head/lib/clang/llvm.build.mk Thu Jun 1 21:05:56 2017 (r319473) @@ -25,16 +25,17 @@ BUILD_ARCH?= ${MACHINE_ARCH} # arm (for armv4 and armv5 CPUs) always uses the soft float ABI. # For all other targets, we stick with 'unknown'. .if ${TARGET_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") -TARGET_ABI= gnueabihf +TARGET_ABI= -gnueabihf .elif ${TARGET_ARCH:Marm*} -TARGET_ABI= gnueabi +TARGET_ABI= -gnueabi .else -TARGET_ABI= unknown +TARGET_ABI= .endif +VENDOR= unknown OS_VERSION= freebsd12.0 -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${TARGET_ABI}-${OS_VERSION} -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-unknown-${OS_VERSION} +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI} +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION} CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" CFLAGS+= -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" From owner-svn-src-head@freebsd.org Thu Jun 1 21:07:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49152B7F09F; Thu, 1 Jun 2017 21:07:26 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24E2368FF0; Thu, 1 Jun 2017 21:07:26 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51L7PSI039710; Thu, 1 Jun 2017 21:07:25 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51L7Pnj039708; Thu, 1 Jun 2017 21:07:25 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201706012107.v51L7Pnj039708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Jun 2017 21:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319474 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 21:07:26 -0000 Author: vangyzen Date: Thu Jun 1 21:07:25 2017 New Revision: 319474 URL: https://svnweb.freebsd.org/changeset/base/319474 Log: getenv(9): rename to "kern_getenv", etc. Update the documentation to catch up with r273174, which renamed getenv -> kern_getenv setenv -> kern_setenv unsetenv -> kern_unsetenv Leave the old links in place to support finger memory. MFC after: 3 days Sponsored by: Dell EMC Modified: head/share/man/man9/Makefile head/share/man/man9/getenv.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jun 1 21:05:56 2017 (r319473) +++ head/share/man/man9/Makefile Thu Jun 1 21:07:25 2017 (r319474) @@ -857,6 +857,9 @@ MLINKS+=getenv.9 freeenv.9 \ getenv.9 getenv_quad.9 \ getenv.9 getenv_uint.9 \ getenv.9 getenv_ulong.9 \ + getenv.9 kern_getenv.9 \ + getenv.9 kern_setenv.9 \ + getenv.9 kern_unsetenv.9 \ getenv.9 setenv.9 \ getenv.9 testenv.9 \ getenv.9 unsetenv.9 Modified: head/share/man/man9/getenv.9 ============================================================================== --- head/share/man/man9/getenv.9 Thu Jun 1 21:05:56 2017 (r319473) +++ head/share/man/man9/getenv.9 Thu Jun 1 21:07:25 2017 (r319474) @@ -27,21 +27,21 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2015 +.Dd June 1, 2017 .Dt GETENV 9 .Os .Sh NAME .Nm freeenv , -.Nm getenv , +.Nm kern_getenv , .Nm getenv_int , .Nm getenv_long , .Nm getenv_string , .Nm getenv_quad , .Nm getenv_uint , .Nm getenv_ulong , -.Nm setenv , +.Nm kern_setenv , .Nm testenv , -.Nm unsetenv +.Nm kern_unsetenv .Nd kernel environment variable functions .Sh SYNOPSIS .In sys/param.h @@ -49,7 +49,7 @@ .Ft void .Fn freeenv "char *env" .Ft char * -.Fn getenv "const char *name" +.Fn kern_getenv "const char *name" .Ft int .Fn getenv_int "const char *name" "int *data" .Ft int @@ -63,41 +63,41 @@ .Ft int .Fn getenv_ulong "const char *name" "unsigned long *data" .Ft int -.Fn setenv "const char *name" "const char *value" +.Fn kern_setenv "const char *name" "const char *value" .Ft int .Fn testenv "const char *name" .Ft int -.Fn unsetenv "const char *name" +.Fn kern_unsetenv "const char *name" .Sh DESCRIPTION These functions set, unset, fetch, and parse variables from the kernel's environment. .Pp The -.Fn getenv +.Fn kern_getenv function obtains the current value of the kernel environment variable .Fa name and returns a pointer to the string value. The caller should not modify the string pointed to by the return value. The -.Fn getenv +.Fn kern_getenv function may allocate temporary storage, so the .Fn freeenv function must be called to release any allocated resources when the value returned by -.Fn getenv +.Fn kern_getenv is no longer needed. .Pp The .Fn freeenv function is used to release the resources allocated by a previous call to -.Fn getenv . +.Fn kern_getenv . The .Fa env argument passed to .Fn freeenv is the pointer returned by the earlier call to -.Fn getenv . +.Fn kern_getenv . Like .Xr free 3 , the @@ -107,7 +107,7 @@ argument can be in which case no action occurs. .Pp The -.Fn setenv +.Fn kern_setenv function inserts or resets the kernel environment variable .Fa name to @@ -120,7 +120,7 @@ This function can fail if an internal limit on the num variables is exceeded. .Pp The -.Fn unsetenv +.Fn kern_unsetenv function deletes the kernel environment variable .Fa name . .Pp @@ -196,15 +196,15 @@ characters of its value are copied to the buffer point followed by a null character and a non-zero value is returned. .Sh RETURN VALUES The -.Fn getenv +.Fn kern_getenv function returns a pointer to an environment variable's value on success or .Dv NULL if the variable does not exist. .Pp The -.Fn setenv +.Fn kern_setenv and -.Fn unsetenv +.Fn kern_unsetenv functions return zero on success and -1 on failure. .Pp The From owner-svn-src-head@freebsd.org Thu Jun 1 21:07:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B14DB7F0C0; Thu, 1 Jun 2017 21:07:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A1F26A032; Thu, 1 Jun 2017 21:07:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51L7WMc039763; Thu, 1 Jun 2017 21:07:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51L7WHr039762; Thu, 1 Jun 2017 21:07:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706012107.v51L7WHr039762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Jun 2017 21:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319475 - head/tools/tools/crypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 21:07:33 -0000 Author: jhb Date: Thu Jun 1 21:07:32 2017 New Revision: 319475 URL: https://svnweb.freebsd.org/changeset/base/319475 Log: Fix some new errors and a warning in cryptotest. - Use a new 'char *key' to allocate storage for keys and assign the pointer to the session2_op 'const char *' members after the key is initialized. - Mark the 'find' variable used in crfind() static so that crfind() doesn't return a pointer to stack garbage. Reported by: olivier (1) MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/tools/tools/crypto/cryptotest.c Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Thu Jun 1 21:07:25 2017 (r319474) +++ head/tools/tools/crypto/cryptotest.c Thu Jun 1 21:07:32 2017 (r319475) @@ -216,7 +216,7 @@ crlookup(const char *devname) const char * crfind(int crid) { - struct crypt_find_op find; + static struct crypt_find_op find; bzero(&find, sizeof(find)); find.crid = crid; @@ -252,7 +252,7 @@ runtest(struct alg *alg, int count, int size, u_long c { int i, fd = crget(); struct timeval start, stop, dt; - char *cleartext, *ciphertext, *originaltext; + char *cleartext, *ciphertext, *originaltext, *key; struct session2_op sop; struct crypt_op cop; char iv[EALG_MAX_BLOCK_LEN]; @@ -260,19 +260,21 @@ runtest(struct alg *alg, int count, int size, u_long c bzero(&sop, sizeof(sop)); if (!alg->ishash) { sop.keylen = (alg->minkeylen + alg->maxkeylen)/2; - sop.key = (char *) malloc(sop.keylen); - if (sop.key == NULL) + key = (char *) malloc(sop.keylen); + if (key == NULL) err(1, "malloc (key)"); for (i = 0; i < sop.keylen; i++) - sop.key[i] = rdigit(); + key[i] = rdigit(); + sop.key = key; sop.cipher = alg->code; } else { sop.mackeylen = (alg->minkeylen + alg->maxkeylen)/2; - sop.mackey = (char *) malloc(sop.mackeylen); - if (sop.mackey == NULL) + key = (char *) malloc(sop.mackeylen); + if (key == NULL) err(1, "malloc (mac)"); for (i = 0; i < sop.mackeylen; i++) - sop.mackey[i] = rdigit(); + key[i] = rdigit(); + sop.mackey = key; sop.mac = alg->code; } sop.crid = crid; From owner-svn-src-head@freebsd.org Thu Jun 1 21:20:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1338FB7F2BF; Thu, 1 Jun 2017 21:20:46 +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 D65BA6A63B; Thu, 1 Jun 2017 21:20:45 +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 v51LKikY044184; Thu, 1 Jun 2017 21:20:44 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51LKiNF044182; Thu, 1 Jun 2017 21:20:44 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201706012120.v51LKiNF044182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 1 Jun 2017 21:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319476 - in head/sys/dev/rtwn: rtl8192c rtl8812a X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 21:20:46 -0000 Author: avos Date: Thu Jun 1 21:20:44 2017 New Revision: 319476 URL: https://svnweb.freebsd.org/changeset/base/319476 Log: rtwn: drop obsolete (since r319460) code. Tested with RTL8188EU, STA mode. Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx.c head/sys/dev/rtwn/rtl8812a/r12a_tx.c Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_tx.c Thu Jun 1 21:07:32 2017 (r319475) +++ head/sys/dev/rtwn/rtl8192c/r92c_tx.c Thu Jun 1 21:20:44 2017 (r319476) @@ -331,8 +331,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80 if (m->m_flags & M_AMPDU_MPDU) { seqno = ni->ni_txseqs[tid]; - /* NB: clear Fragment Number field. */ - *(uint16_t *)wh->i_seq = 0; ni->ni_txseqs[tid]++; } else seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE; Modified: head/sys/dev/rtwn/rtl8812a/r12a_tx.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_tx.c Thu Jun 1 21:07:32 2017 (r319475) +++ head/sys/dev/rtwn/rtl8812a/r12a_tx.c Thu Jun 1 21:20:44 2017 (r319476) @@ -338,8 +338,6 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80 if (m->m_flags & M_AMPDU_MPDU) { seqno = ni->ni_txseqs[tid]; - /* NB: clear Fragment Number field. */ - *(uint16_t *)wh->i_seq = 0; ni->ni_txseqs[tid]++; } else seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE; From owner-svn-src-head@freebsd.org Thu Jun 1 21:23:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABD6FB7F487; Thu, 1 Jun 2017 21:23:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 849F76AA0D; Thu, 1 Jun 2017 21:23:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51LN4bH047817; Thu, 1 Jun 2017 21:23:04 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51LN4WP047814; Thu, 1 Jun 2017 21:23:04 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201706012123.v51LN4WP047814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Jun 2017 21:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319477 - in head: etc/rc.d usr.sbin/crashinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 21:23:05 -0000 Author: vangyzen Date: Thu Jun 1 21:23:04 2017 New Revision: 319477 URL: https://svnweb.freebsd.org/changeset/base/319477 Log: crashinfo: add "batch" mode and use it during boot In batch mode, most messages go into the core.txt.N file instead of stdout. Reviewed by: jhb MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10429 Modified: head/etc/rc.d/savecore head/usr.sbin/crashinfo/crashinfo.8 head/usr.sbin/crashinfo/crashinfo.sh Modified: head/etc/rc.d/savecore ============================================================================== --- head/etc/rc.d/savecore Thu Jun 1 21:20:44 2017 (r319476) +++ head/etc/rc.d/savecore Thu Jun 1 21:23:04 2017 (r319477) @@ -70,7 +70,7 @@ savecore_start() if savecore -C "${dev}" >/dev/null; then savecore ${savecore_flags} ${dumpdir} ${dumpdev} if checkyesno crashinfo_enable; then - ${crashinfo_program} -d ${dumpdir} + ${crashinfo_program} -b -d ${dumpdir} fi sync else Modified: head/usr.sbin/crashinfo/crashinfo.8 ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.8 Thu Jun 1 21:20:44 2017 (r319476) +++ head/usr.sbin/crashinfo/crashinfo.8 Thu Jun 1 21:23:04 2017 (r319477) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2008 +.Dd April 19, 2017 .Dt CRASHINFO 8 .Os .Sh NAME @@ -88,6 +88,12 @@ and .Pp The options are as follows: .Bl -tag -width indent +.It Fl b +Run in batch mode. Write most messages to the +.Pa core.txt.XX +file instead of the terminal. This flag is used when +.Nm +is run during boot. .It Fl d Ar crashdir Specify an alternate core dump directory. The default crash dump directory is Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Thu Jun 1 21:20:44 2017 (r319476) +++ head/usr.sbin/crashinfo/crashinfo.sh Thu Jun 1 21:23:04 2017 (r319477) @@ -31,7 +31,8 @@ usage() { - echo "usage: crashinfo [-d crashdir] [-n dumpnr] [-k kernel] [core]" + echo "usage: crashinfo [-b] [-d crashdir] [-n dumpnr]" \ + "[-k kernel] [core]" exit 1 } @@ -93,12 +94,16 @@ find_kernel() done } +BATCH=false CRASHDIR=/var/crash DUMPNR= KERNEL= -while getopts "d:n:k:" opt; do +while getopts "bd:n:k:" opt; do case "$opt" in + b) + BATCH=true + ;; d) CRASHDIR=$OPTARG ;; @@ -153,6 +158,11 @@ INFO=$CRASHDIR/info.$DUMPNR FILE=$CRASHDIR/core.txt.$DUMPNR HOSTNAME=`hostname` +if $BATCH; then + echo "Writing crash summary to $FILE." + exec > $FILE 2>&1 +fi + find_gdb if [ -z "$GDB" ]; then echo "Unable to find a kernel debugger." @@ -181,8 +191,6 @@ elif [ ! -e $KERNEL ]; then exit 1 fi -echo "Writing crash summary to $FILE." - umask 077 # Simulate uname @@ -191,7 +199,10 @@ osrelease=$(gdb_command $KERNEL 'printf "%s", osreleas version=$(gdb_command $KERNEL 'printf "%s", version' | tr '\t\n' ' ') machine=$(gdb_command $KERNEL 'printf "%s", machine') -exec > $FILE 2>&1 +if ! $BATCH; then + echo "Writing crash summary to $FILE." + exec > $FILE 2>&1 +fi echo "$HOSTNAME dumped core - see $VMCORE" echo From owner-svn-src-head@freebsd.org Thu Jun 1 23:04:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC8DB82D6C; Thu, 1 Jun 2017 23:04:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA79C70727; Thu, 1 Jun 2017 23:04:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51N4ik3088489; Thu, 1 Jun 2017 23:04:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51N4it3088487; Thu, 1 Jun 2017 23:04:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706012304.v51N4it3088487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Jun 2017 23:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319481 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 23:04:46 -0000 Author: bdrewery Date: Thu Jun 1 23:04:44 2017 New Revision: 319481 URL: https://svnweb.freebsd.org/changeset/base/319481 Log: META_MODE: Move ignoring of /usr/local/etc/libmap.d to proper place. This was added in r318194 but local.meta.sys.mk is only used for DIRDEPS_BUILD. Modified: head/share/mk/local.meta.sys.mk head/share/mk/sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Thu Jun 1 22:59:41 2017 (r319480) +++ head/share/mk/local.meta.sys.mk Thu Jun 1 23:04:44 2017 (r319481) @@ -283,6 +283,3 @@ META_MODE+= missing-meta=yes .if empty(META_MODE:Mnofilemon) META_MODE+= missing-filemon=yes .endif -# We do not want everything out-of-date just because -# some unrelated shared lib updated this. -.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Jun 1 22:59:41 2017 (r319480) +++ head/share/mk/sys.mk Thu Jun 1 23:04:44 2017 (r319481) @@ -91,7 +91,11 @@ META_MODE?= normal /usr/share \ .endif - +.if !empty(.MAKE.MODE:Mmeta) +# We do not want everything out-of-date just because +# some unrelated shared lib updated this. +.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d +.endif .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed From owner-svn-src-head@freebsd.org Fri Jun 2 00:19:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE4EB95822; Fri, 2 Jun 2017 00:19:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B547E73E4F; Fri, 2 Jun 2017 00:19:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id CD9C4B59F; Fri, 2 Jun 2017 00:19:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 60BB075AB; Fri, 2 Jun 2017 00:19:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id q7p7as36gQAP; Fri, 2 Jun 2017 00:19:13 +0000 (UTC) Subject: Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7CB0675A6 To: "O. Hartmann" , Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Navdeep Parhar References: <201705231638.v4NGcAq1005935@repo.freebsd.org> <20170523191129.57183b1c@thor.intern.walstatt.dynvpn.de> <5d1d0149-7994-a870-0f6d-1499a9efba75@FreeBSD.org> <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> Date: Thu, 1 Jun 2017 17:18:51 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V1icEwmXx3OlJCduuuPnMlWWOmacs37qK" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 00:19:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --V1icEwmXx3OlJCduuuPnMlWWOmacs37qK Content-Type: multipart/mixed; boundary="mT8j5N0At4DUgVariKKhLPGTGoVCmmqqc"; protected-headers="v1" From: Bryan Drewery To: "O. Hartmann" , Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Navdeep Parhar Message-ID: <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> Subject: Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390 References: <201705231638.v4NGcAq1005935@repo.freebsd.org> <20170523191129.57183b1c@thor.intern.walstatt.dynvpn.de> <5d1d0149-7994-a870-0f6d-1499a9efba75@FreeBSD.org> <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> --mT8j5N0At4DUgVariKKhLPGTGoVCmmqqc Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/23/2017 12:00 PM, O. Hartmann wrote: > Am Tue, 23 May 2017 12:52:35 -0500 > Pedro Giffuni schrieb: >=20 >> On 23/05/2017 12:12, O. Hartmann wrote: >>> Am Tue, 23 May 2017 16:38:10 +0000 (UTC) >>> "Pedro F. Giffuni" schrieb: >>> =20 >>>> Author: pfg >>>> Date: Tue May 23 16:38:10 2017 >>>> New Revision: 318750 >>>> URL: https://svnweb.freebsd.org/changeset/base/318750 >>>> >>>> Log: >>>> Bring some rough support for FreeBSD S/390 to the GNU toolchain. >>>> =20 >>>> This is no-op and only for reference: the S/390 port seems to be = elusive >>>> in the BSDs so it is convenient to keep some trace from past effo= rts. >>>> It is likely newer attempts will focus on a newer toolchain using= clang >>>> instead. >>>> =20 >>>> Obtained from: Perforce depot/projects/s390 >>>> >>>> Added: >>>> head/contrib/binutils/ld/emulparams/elf64_s390_fbsd.sh (content= s, props changed) >>>> head/contrib/binutils/ld/emulparams/elf_s390_fbsd.sh (contents,= props changed) >>>> head/contrib/gcc/config/s390/freebsd.h >>>> - copied, changed from r318546, head/contrib/gcc/config/s390/l= inux.h >>>> Modified: >>>> head/contrib/binutils/bfd/config.bfd >>>> head/contrib/binutils/ld/configure.tgt >>>> head/contrib/gcc/config.gcc =20 >> ... >>>> Buildworld fails on r318751 with a "Segmentation fault" error as sho= wn below: >>>> >>>> Building /usr/obj/usr/src/lib/libkiconv/_libinstall >>>> --- lib/libmd__L --- >>>> --- skein_block_asm.o --- >>>> Segmentation fault >>>> *** [skein_block_asm.o] Error code 139 >>>> >>>> make[4]: stopped in /usr/src/lib/libmd >>>> .ERROR_TARGET=3D'skein_block_asm.o' >>>> .ERROR_META_FILE=3D'/usr/obj/usr/src/lib/libmd/skein_block_asm.o.met= a' >>>> .MAKE.LEVEL=3D'4' >>>> MAKEFILE=3D'' >>>> >>>> >>>> Host is running recent CURRENT: FreeBSD 12.0-CURRENT #124 r318748: T= ue May 23 >>>> 18:52:59 CEST 2017 amd64 =20 >> >> It shouldn't be related to this change: >> >> 1) This only affects s390 configuration which is never activated >> 2) I did run a tinderbox build to make sure nothing was affected (the = >> only thing failing was an unrelated powerpc warning that was fixed). >> >> Pedro. >=20 > Hello, >=20 > the problem could be resolved by deleting the /usr/obj folder and start= a clean build > again. >=20 I think this is fallout from ino64 combined with META_MODE. META_MODE assumes that host tools will be ABI-compatible and generally does not [force] rebuild them very often. So the act of upgrading to ino64 host and then doing another build, your ld and various other host tools will still be running pre-ino64 binaries via COMPAT_FREEBSD11. I think the bug in this system is that it is possible for some of these tools to get mixed-ABI objects linked together resulting in differing ideas of what 'struct stat' is for example. This could be possible since META_MODE won't force rebuild all objects for a directory/tool but it may rebuild 1 object for some reason or just relink the resulting binary. Here's an example of what I'm talking about with the host ld object files= : > -rwxr-xr-x 1 root wheel 1857312 Jun 1 12:59 ld.bfd* =20 > -rwxr-xr-x 1 root wheel 931304 Jun 1 12:59 ld.bfd.debug* =20 > -rw-r--r-- 1 root wheel 978 Jun 1 12:59 ld.bfd.debug.meta =20 > -rwxr-xr-x 1 root wheel 2600311 Jun 1 12:59 ld.bfd.full* =20 > -rw-r--r-- 1 root wheel 3988 Jun 1 12:59 ld.bfd.full.meta =20 > -rw-r--r-- 1 root wheel 999 Jun 1 12:59 ld.bfd.meta =20 > -rw-r--r-- 1 root wheel 154400 Apr 18 16:12 ldcref.o =20 > -rw-r--r-- 1 root wheel 4553 Apr 18 16:12 ldcref.o.meta =20 > -rw-r--r-- 1 root wheel 137088 May 11 14:14 ldctor.o =20 > -rw-r--r-- 1 root wheel 4348 May 11 14:14 ldctor.o.meta =20 > -rw-r--r-- 1 root wheel 205 Oct 11 2016 ldemul-list.h =20 > -rw-r--r-- 1 root wheel 814 Oct 11 2016 ldemul-list.h.meta =20 > -rw-r--r-- 1 root wheel 144088 Oct 13 2016 ldemul.o =20 > -rw-r--r-- 1 root wheel 4374 Oct 13 2016 ldemul.o.meta =20 The object files predate ino64 but the linked binaries do not. I did not dig into these object files more but I suspect somewhere there are mixed-ABI object files hitting this bug or that just linking pre-ino64 objects may cause a problem. I don't think linking would be a problem though. Anyway the fix for this would be to either 'make cleanworld' after upgrading to ino64, use -DNO_META_IGNORE_HOST for the first build after, or wait for my fix. I will commit a fix to force rebuild host tools through known major ABI changes to avoid this problem. For discussion of why META_MODE tries to not rebuild host tools see r301467. The gist is that a simple 'buildworld->installworld->buildworld' causes everything to rebuild due to changed host file timestamps. Really it would be better if filemon/META_MODE used file content hashing like ccache did. Then timestamps wouldn't cause such a problem here. --=20 Regards, Bryan Drewery --mT8j5N0At4DUgVariKKhLPGTGoVCmmqqc-- --V1icEwmXx3OlJCduuuPnMlWWOmacs37qK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZMK7vAAoJEDXXcbtuRpfPKAMH/Rj4xVb3O4EZMzBZdCQmR7Uz T7w4qB39FNFIaq6gZ4hMclAdAAVBl2T8vdk9KleTo3c+hggabLLf7JI/ZVKQvVct sG7cEYSBipWLVPzoN6d+M7vBj5yQ2958qhWi+UFn9NctwS/kUOW0CIWv9g5zGZtp ZQVpDmFCZ5/FNtPpvDHN3ADzULfgPIqRnk3WYOWwg3XZ7s0nVjP0aLBmu/Bj/IGX Q1kxUbif5sXvQ6LReEWzIH+orwJsqoIdaA6k6JaBD4pvRIZs8E4N7FBhaOmmbfnx J9AZfpycF7Ii8eIsP6jmuvZplBZ4ax8dPq07K2/VlgVXOCTXqa5LynCtMiYcY84= =FryF -----END PGP SIGNATURE----- --V1icEwmXx3OlJCduuuPnMlWWOmacs37qK-- From owner-svn-src-head@freebsd.org Fri Jun 2 00:51:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BA45BD33C8; Fri, 2 Jun 2017 00:51:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34D207509F; Fri, 2 Jun 2017 00:51:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 60481BE09; Fri, 2 Jun 2017 00:51:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 7B75E7657; Fri, 2 Jun 2017 00:51:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id yo2EVzHmM98z; Fri, 2 Jun 2017 00:51:15 +0000 (UTC) Subject: Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 2DCF7764F From: Bryan Drewery To: "O. Hartmann" , Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Navdeep Parhar References: <201705231638.v4NGcAq1005935@repo.freebsd.org> <20170523191129.57183b1c@thor.intern.walstatt.dynvpn.de> <5d1d0149-7994-a870-0f6d-1499a9efba75@FreeBSD.org> <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Thu, 1 Jun 2017 17:51:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DUJJ56CjpPj27HEroA56SwHNsIRO6aDHj" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 00:51:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DUJJ56CjpPj27HEroA56SwHNsIRO6aDHj Content-Type: multipart/mixed; boundary="9MCl0U2rDHlPTguCD2TQFdJJLllQsN8Nw"; protected-headers="v1" From: Bryan Drewery To: "O. Hartmann" , Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Navdeep Parhar Message-ID: Subject: Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390 References: <201705231638.v4NGcAq1005935@repo.freebsd.org> <20170523191129.57183b1c@thor.intern.walstatt.dynvpn.de> <5d1d0149-7994-a870-0f6d-1499a9efba75@FreeBSD.org> <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> In-Reply-To: <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> --9MCl0U2rDHlPTguCD2TQFdJJLllQsN8Nw Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/1/2017 5:18 PM, Bryan Drewery wrote: > On 5/23/2017 12:00 PM, O. Hartmann wrote: >> Am Tue, 23 May 2017 12:52:35 -0500 >> Pedro Giffuni schrieb: >> >>> On 23/05/2017 12:12, O. Hartmann wrote: >>>> Am Tue, 23 May 2017 16:38:10 +0000 (UTC) >>>> "Pedro F. Giffuni" schrieb: >>>> =20 >>>>> Author: pfg >>>>> Date: Tue May 23 16:38:10 2017 >>>>> New Revision: 318750 >>>>> URL: https://svnweb.freebsd.org/changeset/base/318750 >>>>> >>>>> Log: >>>>> Bring some rough support for FreeBSD S/390 to the GNU toolchain.= >>>>> =20 >>>>> This is no-op and only for reference: the S/390 port seems to be= elusive >>>>> in the BSDs so it is convenient to keep some trace from past eff= orts. >>>>> It is likely newer attempts will focus on a newer toolchain usin= g clang >>>>> instead. >>>>> =20 >>>>> Obtained from: Perforce depot/projects/s390 >>>>> >>>>> Added: >>>>> head/contrib/binutils/ld/emulparams/elf64_s390_fbsd.sh (conten= ts, props changed) >>>>> head/contrib/binutils/ld/emulparams/elf_s390_fbsd.sh (contents= , props changed) >>>>> head/contrib/gcc/config/s390/freebsd.h >>>>> - copied, changed from r318546, head/contrib/gcc/config/s390/= linux.h >>>>> Modified: >>>>> head/contrib/binutils/bfd/config.bfd >>>>> head/contrib/binutils/ld/configure.tgt >>>>> head/contrib/gcc/config.gcc =20 >>> ... >>>>> Buildworld fails on r318751 with a "Segmentation fault" error as sh= own below: >>>>> >>>>> Building /usr/obj/usr/src/lib/libkiconv/_libinstall >>>>> --- lib/libmd__L --- >>>>> --- skein_block_asm.o --- >>>>> Segmentation fault >>>>> *** [skein_block_asm.o] Error code 139 >>>>> >>>>> make[4]: stopped in /usr/src/lib/libmd >>>>> .ERROR_TARGET=3D'skein_block_asm.o' >>>>> .ERROR_META_FILE=3D'/usr/obj/usr/src/lib/libmd/skein_block_asm.o.me= ta' >>>>> .MAKE.LEVEL=3D'4' >>>>> MAKEFILE=3D'' >>>>> >>>>> >>>>> Host is running recent CURRENT: FreeBSD 12.0-CURRENT #124 r318748: = Tue May 23 >>>>> 18:52:59 CEST 2017 amd64 =20 >>> >>> It shouldn't be related to this change: >>> >>> 1) This only affects s390 configuration which is never activated >>> 2) I did run a tinderbox build to make sure nothing was affected (the= =20 >>> only thing failing was an unrelated powerpc warning that was fixed). >>> >>> Pedro. >> >> Hello, >> >> the problem could be resolved by deleting the /usr/obj folder and star= t a clean build >> again. >> >=20 > I think this is fallout from ino64 combined with META_MODE. META_MODE > assumes that host tools will be ABI-compatible and generally does not > [force] rebuild them very often. So the act of upgrading to ino64 host= > and then doing another build, your ld and various other host tools will= > still be running pre-ino64 binaries via COMPAT_FREEBSD11. I think the > bug in this system is that it is possible for some of these tools to ge= t > mixed-ABI objects linked together resulting in differing ideas of what > 'struct stat' is for example. This could be possible since META_MODE > won't force rebuild all objects for a directory/tool but it may rebuild= > 1 object for some reason or just relink the resulting binary. >=20 > Here's an example of what I'm talking about with the host ld object fil= es: >=20 >> -rwxr-xr-x 1 root wheel 1857312 Jun 1 12:59 ld.bfd* =20 >> -rwxr-xr-x 1 root wheel 931304 Jun 1 12:59 ld.bfd.debug* =20 >> -rw-r--r-- 1 root wheel 978 Jun 1 12:59 ld.bfd.debug.meta =20 >> -rwxr-xr-x 1 root wheel 2600311 Jun 1 12:59 ld.bfd.full* =20 >> -rw-r--r-- 1 root wheel 3988 Jun 1 12:59 ld.bfd.full.meta =20 >> -rw-r--r-- 1 root wheel 999 Jun 1 12:59 ld.bfd.meta =20 >> -rw-r--r-- 1 root wheel 154400 Apr 18 16:12 ldcref.o =20 >> -rw-r--r-- 1 root wheel 4553 Apr 18 16:12 ldcref.o.meta =20 >> -rw-r--r-- 1 root wheel 137088 May 11 14:14 ldctor.o =20 >> -rw-r--r-- 1 root wheel 4348 May 11 14:14 ldctor.o.meta =20 >> -rw-r--r-- 1 root wheel 205 Oct 11 2016 ldemul-list.h =20 >> -rw-r--r-- 1 root wheel 814 Oct 11 2016 ldemul-list.h.meta =20 >> -rw-r--r-- 1 root wheel 144088 Oct 13 2016 ldemul.o =20 >> -rw-r--r-- 1 root wheel 4374 Oct 13 2016 ldemul.o.meta =20 >=20 > The object files predate ino64 but the linked binaries do not. I did > not dig into these object files more but I suspect somewhere there are > mixed-ABI object files hitting this bug or that just linking pre-ino64 > objects may cause a problem. I don't think linking would be a problem > though. This commit did cause a mixed-ABI object issue that I predicted. Built before, updated, built again and targets.o is rebuilt. > Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targmatch.h= > Skipping meta for .depend: no commands > Skipping meta for afterdepend: .PHONY > Skipping meta for depend: .PHONY > Skipping meta for objwarn: .PHONY > Skipping meta for beforebuild: .PHONY > Skipping meta for .WAIT_1: .PHONY > /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targets.o.meta: 81: = file '/usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/./targmatch.h' i= s newer than the target... > Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targets.o targets.o is the only relevant object file I could find in the broken objtree given to me that was post-ino64. It doesn't directly use any of the changes structs that I can see, but the mixed-ABI proof is enough for me to put the understanding of this to rest. In case I wasn't clear, this commit is perfectly fine. It just triggered a META_MODE bug. >=20 > Anyway the fix for this would be to either 'make cleanworld' after > upgrading to ino64, use -DNO_META_IGNORE_HOST for the first build after= , > or wait for my fix. I will commit a fix to force rebuild host tools > through known major ABI changes to avoid this problem. >=20 > For discussion of why META_MODE tries to not rebuild host tools see > r301467. The gist is that a simple > 'buildworld->installworld->buildworld' causes everything to rebuild due= > to changed host file timestamps. Really it would be better if > filemon/META_MODE used file content hashing like ccache did. Then > timestamps wouldn't cause such a problem here. >=20 --=20 Regards, Bryan Drewery --9MCl0U2rDHlPTguCD2TQFdJJLllQsN8Nw-- --DUJJ56CjpPj27HEroA56SwHNsIRO6aDHj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZMLaCAAoJEDXXcbtuRpfPY8IIAMNo7636uQaGIP5L3hh/8OcV 4wYK4JqED4Syn+H21q5yHx1oJ3uu3L2wglezfL6B7d+2/KgvwvNa8QOz8S63duOa De+QhT5KfevK8kPqou6bPwC2jFtv8EUW4nojcS6mO4XOwW3zJq0hD+0hi4QG2+OQ 1t41qMSzapYCZjKg0wEY+Yt9Fza1afZuXyH6S5gyMDsL3mtatA13CO3JCdwpQh3+ iMkpqJlSOvI27Z5FQHhyeHFN0/29k5eGaEF3CCRy/FXXyMUvb5U1abz9b598ghu8 yapJTWjmldLfS3TWWhNHp3mXL0Rm7Ff6V2Er8NLpu10EMED33H4rE25aO4N0ZAQ= =H2Pf -----END PGP SIGNATURE----- --DUJJ56CjpPj27HEroA56SwHNsIRO6aDHj-- From owner-svn-src-head@freebsd.org Fri Jun 2 00:58:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 173ECBD35F5; Fri, 2 Jun 2017 00:58:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D27D37540C; Fri, 2 Jun 2017 00:58:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v520vx6S036063; Fri, 2 Jun 2017 00:57:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v520vxke036062; Fri, 2 Jun 2017 00:57:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706020057.v520vxke036062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 2 Jun 2017 00:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319485 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 00:58:01 -0000 Author: bdrewery Date: Fri Jun 2 00:57:59 2017 New Revision: 319485 URL: https://svnweb.freebsd.org/changeset/base/319485 Log: native-xtools: Connect lld. This will ensure that aarch64 gets a working native /usr/bin/ld rather than requiring the aarch64-binutils hack in Poudriere, or emulating the aarch64 lld. PR: 217189 Reported by: swills, jbeich Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jun 2 00:29:23 2017 (r319484) +++ head/Makefile.inc1 Fri Jun 2 00:57:59 2017 (r319485) @@ -2019,6 +2019,7 @@ native-xtools: .PHONY ${_gcc_tools} \ ${_clang_libs} \ ${_clang} \ + ${_lld} \ sbin/md5 \ sbin/sysctl \ usr.bin/diff \ From owner-svn-src-head@freebsd.org Fri Jun 2 01:12:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 722A3BD3CF3 for ; Fri, 2 Jun 2017 01:12:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm2-vm5.bullet.mail.ne1.yahoo.com (nm2-vm5.bullet.mail.ne1.yahoo.com [98.138.91.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A2875D48 for ; Fri, 2 Jun 2017 01:12:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1496365940; bh=DSNBu+jv+eGGMUVGU0gkvPPws2jRKUsfAYds1lxlU3s=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=nyqPLc2YzrUgyeNaart12PmblusabJmxLkufZTYAZueuJpR+791hlMDFut9yahf5xcVlNDdJ9x/7pEo1cNGf3pxz58hfivJiPy2AxNYg9eaZGPQ7Ga7XEt30uJwpbtC8wmKwePFcB9pAiRWJCOWIFCADZ98XLQ43BTxTDqKkEQoDl/y6hx9PxUQubSkrwmlcHWtZ3zIdo+hVi3RjacGnzVqaWeQzoGUmNdj3gusP99na3JLEaOg7cPyoDBB5JEpNzPGvQ4klbgXzAaQ+foVVW0HlZ0gtbn/yGfKAeiYTiBnFwuvM3i7DFzbVpuFq7AkJZQD63+mUg2JZhVfyrJCfHw== Received: from [98.138.100.117] by nm2.bullet.mail.ne1.yahoo.com with NNFMP; 02 Jun 2017 01:12:20 -0000 Received: from [98.138.226.125] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 02 Jun 2017 01:12:20 -0000 Received: from [127.0.0.1] by smtp204.mail.ne1.yahoo.com with NNFMP; 02 Jun 2017 01:12:20 -0000 X-Yahoo-Newman-Id: 360710.65729.bm@smtp204.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: f11FTckVM1mdnhoNp8gicB1CmHGtkdDItiSXRyXWIY7tAeP WbShqSppHeZVrlVd5gS2choa9E7bUZRpapgSlexKGeoQzcRHFq47MJO3hhQg KVEGzujICRX5F3iBKCnw8wAbeDOvYpsSLCwm9lza5gW.L9m4uolU1JrEDq89 iXqDCa8x8Bj7ez8kWvg9XVP.8_W.PuhkXGPBm.hORpR3MlsV0uKLv2BuGH2I Ja.vGi9dzZVlilJQlW.05pevVsMLRkPuFEuxu9dcs0.wS5YHYjxc1I8oz_ws WoelhviPlcSmnAfbhfDyNmd4VyvDiyYY9ziUQwDEJOtj6dOiMwsfv4wYUtI6 wJWpbLfJnhFKNSIIgOm7Ckdslf1BN0OMIfhvHZ264a9FQ.nXfBONET1P6eUu OBBjCr5hSzBA2H6gQIxAV8QV4_k6woGEU_5M0rLhadGvMgde.JWur7rGKakp srIMg87cPTG8zcyNvaFKFbcFAb56m5J5a88GYpUQVvXfi0z.zC7bxC1aSlhN n66q63tPWcOnH80dwaVrxZBu4PVEO1b5P0jqdxAsVbk4u X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390 To: Bryan Drewery , "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Navdeep Parhar References: <201705231638.v4NGcAq1005935@repo.freebsd.org> <20170523191129.57183b1c@thor.intern.walstatt.dynvpn.de> <5d1d0149-7994-a870-0f6d-1499a9efba75@FreeBSD.org> <20170523210039.555a2f41@thor.intern.walstatt.dynvpn.de> <768df353-3e43-1da7-4a94-0acc1c741ad4@FreeBSD.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Thu, 1 Jun 2017 20:12:18 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 01:12:27 -0000 Hi; On 06/01/17 19:51, Bryan Drewery wrote: ... >> Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targmatch.h >> Skipping meta for .depend: no commands >> Skipping meta for afterdepend: .PHONY >> Skipping meta for depend: .PHONY >> Skipping meta for objwarn: .PHONY >> Skipping meta for beforebuild: .PHONY >> Skipping meta for .WAIT_1: .PHONY >> /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targets.o.meta: 81: file '/usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/./targmatch.h' is newer than the target... >> Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targets.o > targets.o is the only relevant object file I could find in the broken > objtree given to me that was post-ino64. It doesn't directly use any of > the changes structs that I can see, but the mixed-ABI proof is enough > for me to put the understanding of this to rest. > > In case I wasn't clear, this commit is perfectly fine. It just > triggered a META_MODE bug. > Thanks for the research. Adding new platform support in a toolchain that is dying is indeed an unusual change. I won't do it again ;). Pedro. From owner-svn-src-head@freebsd.org Fri Jun 2 02:35:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB03BEE38D; Fri, 2 Jun 2017 02:35:17 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A66737795B; Fri, 2 Jun 2017 02:35:17 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v522ZGZa076105; Fri, 2 Jun 2017 02:35:16 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v522ZGeC076100; Fri, 2 Jun 2017 02:35:16 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706020235.v522ZGeC076100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Jun 2017 02:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319487 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 02:35:17 -0000 Author: araujo Date: Fri Jun 2 02:35:16 2017 New Revision: 319487 URL: https://svnweb.freebsd.org/changeset/base/319487 Log: Add VNC Authentication support based on RFC6143 section 7.2.2. Submitted by: Fabian Freyer Reworked by: myself Reviewed by: grehan, rgrimes and jilles MFC after: 1 week. Relnotes: Yes. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D10818 Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/pci_fbuf.c head/usr.sbin/bhyve/rfb.c head/usr.sbin/bhyve/rfb.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Fri Jun 2 01:00:40 2017 (r319486) +++ head/usr.sbin/bhyve/Makefile Fri Jun 2 02:35:16 2017 (r319487) @@ -2,6 +2,8 @@ # $FreeBSD$ # +.include + PROG= bhyve PACKAGE= bhyve @@ -62,6 +64,12 @@ SRCS= \ SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread z + +.if ${MK_OPENSSL} == "no" +CFLAGS+=-DNO_OPENSSL +.else +LIBADD+= crypto +.endif CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000 CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri Jun 2 01:00:40 2017 (r319486) +++ head/usr.sbin/bhyve/bhyve.8 Fri Jun 2 02:35:16 2017 (r319487) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2017 +.Dd May 22, 2017 .Dt BHYVE 8 .Os .Sh NAME @@ -309,7 +309,7 @@ Emergency write is advertised, but no-op at present. .Pp Framebuffer devices: .Bl -tag -width 10n -.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc +.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc .Bl -tag -width 8n .It Ar IP:port An @@ -368,6 +368,11 @@ Instruct to only boot upon the initiation of a VNC connection, simplifying the installation of operating systems that require immediate keyboard input. This can be removed for post-installation use. +.It password +This type of authentication is known to be cryptographically weak and is not +intended for use on untrusted networks. +Many implementations will want to use stronger security, such as running +the session over an encrypted channel provided by IPsec or SSH. .El .El .Pp Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Fri Jun 2 01:00:40 2017 (r319486) +++ head/usr.sbin/bhyve/pci_fbuf.c Fri Jun 2 02:35:16 2017 (r319487) @@ -93,6 +93,7 @@ struct pci_fbuf_softc { /* rfb server */ char *rfb_host; + char *rfb_password; int rfb_port; int rfb_wait; int vga_enabled; @@ -285,7 +286,8 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o goto done; } else if (sc->memregs.height == 0) sc->memregs.height = 1080; - + } else if (!strcmp(xopts, "password")) { + sc->rfb_password = config; } else { pci_fbuf_usage(xopts); ret = -1; @@ -407,7 +409,7 @@ pci_fbuf_init(struct vmctx *ctx, struct pci_devinst *p memset((void *)sc->fb_base, 0, FB_SIZE); - error = rfb_init(sc->rfb_host, sc->rfb_port, sc->rfb_wait); + error = rfb_init(sc->rfb_host, sc->rfb_port, sc->rfb_wait, sc->rfb_password); done: if (error) free(sc); Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Fri Jun 2 01:00:40 2017 (r319486) +++ head/usr.sbin/bhyve/rfb.c Fri Jun 2 02:35:16 2017 (r319487) @@ -60,10 +60,23 @@ __FBSDID("$FreeBSD$"); #include "rfb.h" #include "sockstream.h" +#ifndef NO_OPENSSL +#include +#endif + static int rfb_debug = 0; #define DPRINTF(params) if (rfb_debug) printf params #define WPRINTF(params) printf params +#define AUTH_LENGTH 16 +#define PASSWD_LENGTH 8 + +#define SECURITY_TYPE_NONE 1 +#define SECURITY_TYPE_VNC_AUTH 2 + +#define AUTH_FAILED_UNAUTH 1 +#define AUTH_FAILED_ERROR 2 + struct rfb_softc { int sfd; pthread_t tid; @@ -72,10 +85,12 @@ struct rfb_softc { int width, height; - bool enc_raw_ok; - bool enc_zlib_ok; - bool enc_resize_ok; + char *password; + bool enc_raw_ok; + bool enc_zlib_ok; + bool enc_resize_ok; + z_stream zstream; uint8_t *zbuf; int zbuflen; @@ -208,7 +223,7 @@ static void rfb_send_resize_update_msg(struct rfb_softc *rc, int cfd) { struct rfb_srvr_updt_msg supdt_msg; - struct rfb_srvr_rect_hdr srect_hdr; + struct rfb_srvr_rect_hdr srect_hdr; /* Number of rectangles: 1 */ supdt_msg.type = 0; @@ -739,8 +754,19 @@ rfb_handle(struct rfb_softc *rc, int cfd) { const char *vbuf = "RFB 003.008\n"; unsigned char buf[80]; + unsigned char *message; + +#ifndef NO_OPENSSL + unsigned char challenge[AUTH_LENGTH]; + unsigned char keystr[PASSWD_LENGTH]; + unsigned char crypt_expected[AUTH_LENGTH]; + + DES_key_schedule ks; + int i; +#endif + pthread_t tid; - uint32_t sres; + uint32_t sres; int len; rc->cfd = cfd; @@ -751,19 +777,91 @@ rfb_handle(struct rfb_softc *rc, int cfd) /* 1b. Read client version */ len = read(cfd, buf, sizeof(buf)); - /* 2a. Send security type 'none' */ + /* 2a. Send security type */ buf[0] = 1; - buf[1] = 1; /* none */ +#ifndef NO_OPENSSL + if (rc->password) + buf[1] = SECURITY_TYPE_VNC_AUTH; + else + buf[1] = SECURITY_TYPE_NONE; +#else + buf[1] = SECURITY_TYPE_NONE; +#endif + stream_write(cfd, buf, 2); - /* 2b. Read agreed security type */ len = stream_read(cfd, buf, 1); - /* 2c. Write back a status of 0 */ - sres = 0; + /* 2c. Do VNC authentication */ + switch (buf[0]) { + case SECURITY_TYPE_NONE: + sres = 0; + break; + case SECURITY_TYPE_VNC_AUTH: + /* + * The client encrypts the challenge with DES, using a password + * supplied by the user as the key. + * To form the key, the password is truncated to + * eight characters, or padded with null bytes on the right. + * The client then sends the resulting 16-bytes response. + */ +#ifndef NO_OPENSSL + strncpy(keystr, rc->password, PASSWD_LENGTH); + + /* VNC clients encrypts the challenge with all the bit fields + * in each byte of the password mirrored. + * Here we flip each byte of the keystr. + */ + for (i = 0; i < PASSWD_LENGTH; i++) { + keystr[i] = (keystr[i] & 0xF0) >> 4 + | (keystr[i] & 0x0F) << 4; + keystr[i] = (keystr[i] & 0xCC) >> 2 + | (keystr[i] & 0x33) << 2; + keystr[i] = (keystr[i] & 0xAA) >> 1 + | (keystr[i] & 0x55) << 1; + } + + /* Initialize a 16-byte random challenge */ + arc4random_buf(challenge, sizeof(challenge)); + stream_write(cfd, challenge, AUTH_LENGTH); + + /* Receive the 16-byte challenge response */ + stream_read(cfd, buf, AUTH_LENGTH); + + memcpy(crypt_expected, challenge, AUTH_LENGTH); + + /* Encrypt the Challenge with DES */ + DES_set_key((C_Block *)keystr, &ks); + DES_ecb_encrypt((C_Block *)challenge, + (C_Block *)crypt_expected, &ks, DES_ENCRYPT); + DES_ecb_encrypt((C_Block *)(challenge + PASSWD_LENGTH), + (C_Block *)(crypt_expected + PASSWD_LENGTH), + &ks, DES_ENCRYPT); + + if (memcmp(crypt_expected, buf, AUTH_LENGTH) != 0) { + message = "Auth Failed: Invalid Password."; + sres = htonl(1); + } else + sres = 0; +#else + sres = 0; + WPRINTF(("Auth not supported, no OpenSSL in your system")); +#endif + + break; + } + + /* 2d. Write back a status */ stream_write(cfd, &sres, 4); + if (sres) { + *((uint32_t *) buf) = htonl(strlen(message)); + stream_write(cfd, buf, 4); + stream_write(cfd, message, strlen(message)); + goto done; + } + /* 3a. Read client shared-flag byte */ len = stream_read(cfd, buf, 1); @@ -869,7 +967,7 @@ sse42_supported(void) } int -rfb_init(char *hostname, int port, int wait) +rfb_init(char *hostname, int port, int wait, char *password) { struct rfb_softc *rc; struct sockaddr_in sin; @@ -886,6 +984,8 @@ rfb_init(char *hostname, int port, int wait) sizeof(uint32_t)); rc->crc_width = RFB_MAX_WIDTH; rc->crc_height = RFB_MAX_HEIGHT; + + rc->password = password; rc->sfd = socket(AF_INET, SOCK_STREAM, 0); if (rc->sfd < 0) { Modified: head/usr.sbin/bhyve/rfb.h ============================================================================== --- head/usr.sbin/bhyve/rfb.h Fri Jun 2 01:00:40 2017 (r319486) +++ head/usr.sbin/bhyve/rfb.h Fri Jun 2 02:35:16 2017 (r319487) @@ -31,6 +31,6 @@ #define RFB_PORT 5900 -int rfb_init(char *hostname, int port, int wait); +int rfb_init(char *hostname, int port, int wait, char *password); #endif /* _RFB_H_ */ From owner-svn-src-head@freebsd.org Fri Jun 2 02:37:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92670BEE46A; Fri, 2 Jun 2017 02:37:18 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 610F077AF3; Fri, 2 Jun 2017 02:37:18 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v522bHKP076209; Fri, 2 Jun 2017 02:37:17 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v522bHrO076208; Fri, 2 Jun 2017 02:37:17 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706020237.v522bHrO076208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Jun 2017 02:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319488 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 02:37:18 -0000 Author: araujo Date: Fri Jun 2 02:37:17 2017 New Revision: 319488 URL: https://svnweb.freebsd.org/changeset/base/319488 Log: Bump manpage date. Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri Jun 2 02:35:16 2017 (r319487) +++ head/usr.sbin/bhyve/bhyve.8 Fri Jun 2 02:37:17 2017 (r319488) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 22, 2017 +.Dd June 2, 2017 .Dt BHYVE 8 .Os .Sh NAME From owner-svn-src-head@freebsd.org Fri Jun 2 03:26:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCDAFBEEE0E; Fri, 2 Jun 2017 03:26:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98BC97925E; Fri, 2 Jun 2017 03:26:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v523Pxll096867; Fri, 2 Jun 2017 03:25:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v523PxDP096866; Fri, 2 Jun 2017 03:25:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706020325.v523PxDP096866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Jun 2017 03:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319489 - head/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 03:26:01 -0000 Author: jhb Date: Fri Jun 2 03:25:59 2017 New Revision: 319489 URL: https://svnweb.freebsd.org/changeset/base/319489 Log: Add -H as an alias for --speed-large-file to match GNU diff. This is undocumented to match GNU diff where -H is also undocumented. Some existing software (such as kompare) uses this option by default. Reviewed by: emaste, rpokala Differential Revision: https://reviews.freebsd.org/D11022 Modified: head/usr.bin/diff/diff.c Modified: head/usr.bin/diff/diff.c ============================================================================== --- head/usr.bin/diff/diff.c Fri Jun 2 02:37:17 2017 (r319488) +++ head/usr.bin/diff/diff.c Fri Jun 2 03:25:59 2017 (r319489) @@ -46,7 +46,7 @@ struct stat stb1, stb2; struct excludes *excludes_list; regex_t ignore_re; -#define OPTIONS "0123456789aBbC:cdD:efhI:iL:lnNPpqrS:sTtU:uwX:x:" +#define OPTIONS "0123456789aBbC:cdD:efHhI:iL:lnNPpqrS:sTtU:uwX:x:" enum { OPT_TSIZE = CHAR_MAX + 1, OPT_STRIPCR, @@ -54,7 +54,6 @@ enum { OPT_NO_IGN_FN_CASE, OPT_NORMAL, OPT_HORIZON_LINES, - OPT_SPEED_LARGE_FILES, OPT_CHANGED_GROUP_FORMAT, }; @@ -66,6 +65,7 @@ static struct option longopts[] = { { "minimal", no_argument, 0, 'd' }, { "ed", no_argument, 0, 'e' }, { "forward-ed", no_argument, 0, 'f' }, + { "speed-large-files", no_argument, NULL, 'H' }, { "ignore-matching-lines", required_argument, 0, 'I' }, { "ignore-case", no_argument, 0, 'i' }, { "paginate", no_argument, NULL, 'l' }, @@ -88,7 +88,6 @@ static struct option longopts[] = { { "horizon-lines", required_argument, NULL, OPT_HORIZON_LINES }, { "no-ignore-file-name-case", no_argument, NULL, OPT_NO_IGN_FN_CASE }, { "normal", no_argument, NULL, OPT_NORMAL }, - { "speed-large-files", no_argument, NULL, OPT_SPEED_LARGE_FILES}, { "strip-trailing-cr", no_argument, NULL, OPT_STRIPCR }, { "tabsize", optional_argument, NULL, OPT_TSIZE }, { "changed-group-format", required_argument, NULL, OPT_CHANGED_GROUP_FORMAT}, @@ -159,6 +158,9 @@ main(int argc, char **argv) case 'f': diff_format = D_REVERSE; break; + case 'H': + /* ignore but needed for compatibility with GNU diff */ + break; case 'h': /* silently ignore for backwards compatibility */ break; @@ -252,8 +254,6 @@ main(int argc, char **argv) usage(); } break; - case OPT_SPEED_LARGE_FILES: - break; /* ignore but needed for compatibility with GNU diff */ case OPT_STRIPCR: dflags |= D_STRIPCR; break; From owner-svn-src-head@freebsd.org Fri Jun 2 03:53:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDFBBBEF336; Fri, 2 Jun 2017 03:53:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E4C279C2C; Fri, 2 Jun 2017 03:53:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v523rY5w008998; Fri, 2 Jun 2017 03:53:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v523rYLv008996; Fri, 2 Jun 2017 03:53:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706020353.v523rYLv008996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Jun 2017 03:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319490 - in head: . lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 03:53:35 -0000 Author: jhb Date: Fri Jun 2 03:53:34 2017 New Revision: 319490 URL: https://svnweb.freebsd.org/changeset/base/319490 Log: Remove stale cap_rights_get(2) manpage. The documentation moved to section 3 several years ago, but 'man cap_rights_get' pulls up cap_rights_limit(2) (which is MLINKed to cap_rights_get.2) instead of cap_rights_get(3). MFC after: 1 week Modified: head/ObsoleteFiles.inc head/lib/libc/sys/Makefile.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jun 2 03:25:59 2017 (r319489) +++ head/ObsoleteFiles.inc Fri Jun 2 03:53:34 2017 (r319490) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170601: remove stale manpage +OLD_FILES+=usr/share/man/man2/cap_rights_get.2.gz # 20170601: old libifconfig and libifc OLD_FILES+=usr/lib/libifc.a OLD_FILES+=usr/lib/libifc_p.a Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Fri Jun 2 03:25:59 2017 (r319489) +++ head/lib/libc/sys/Makefile.inc Fri Jun 2 03:53:34 2017 (r319490) @@ -350,7 +350,6 @@ MLINKS+=brk.2 sbrk.2 MLINKS+=cap_enter.2 cap_getmode.2 MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2 MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2 -MLINKS+=cap_rights_limit.2 cap_rights_get.2 MLINKS+=chdir.2 fchdir.2 MLINKS+=chflags.2 chflagsat.2 \ chflags.2 fchflags.2 \ From owner-svn-src-head@freebsd.org Fri Jun 2 07:03:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7129BBF1703; Fri, 2 Jun 2017 07:03:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C91E7D911; Fri, 2 Jun 2017 07:03:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5273V9I085288; Fri, 2 Jun 2017 07:03:31 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5273V5A085287; Fri, 2 Jun 2017 07:03:31 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201706020703.v5273V5A085287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 2 Jun 2017 07:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319491 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 07:03:32 -0000 Author: cperciva Date: Fri Jun 2 07:03:31 2017 New Revision: 319491 URL: https://svnweb.freebsd.org/changeset/base/319491 Log: Skip setting the MTU in the netfront driver (xn# devices) if the new MTU is the same as the old MTU. In particular, on Amazon EC2 "T2" instances without this change, the network interface is reinitialized every 30 minutes due to the MTU being (re)set when a new DHCP lease is obtained, causing packets to be dropped, along with annoying syslog messages about the link state changing. As a side note, the behaviour this commit fixes was responsible for exposing the locking problems fixed via r318523 and r318631. Maintainers of other network interface drivers may wish to consider making the corresponding change; the handling of SIOCSIFMTU does not seem to exhibit a great deal of consistency between drivers. MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Jun 2 03:53:34 2017 (r319490) +++ head/sys/dev/xen/netfront/netfront.c Fri Jun 2 07:03:31 2017 (r319491) @@ -1767,6 +1767,9 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #endif break; case SIOCSIFMTU: + if (ifp->if_mtu == ifr->ifr_mtu) + break; + ifp->if_mtu = ifr->ifr_mtu; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xn_ifinit(sc); From owner-svn-src-head@freebsd.org Fri Jun 2 10:30:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2A4ABF4606; Fri, 2 Jun 2017 10:30:41 +0000 (UTC) (envelope-from prvs=319e99cc0=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 901418282E; Fri, 2 Jun 2017 10:30:39 +0000 (UTC) (envelope-from prvs=319e99cc0=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.39,284,1493683200"; d="scan'208";a="47113062" Date: Fri, 2 Jun 2017 11:29:22 +0100 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Colin Percival CC: , , Subject: Re: svn commit: r319491 - head/sys/dev/xen/netfront Message-ID: <20170602102922.stlu47ceumggu6o7@dhcp-3-128.uk.xensource.com> References: <201706020703.v5273V5A085287@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201706020703.v5273V5A085287@repo.freebsd.org> User-Agent: NeoMutt/20170428 (1.8.2) X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 10:30:41 -0000 On Fri, Jun 02, 2017 at 07:03:31AM +0000, Colin Percival wrote: > Author: cperciva > Date: Fri Jun 2 07:03:31 2017 > New Revision: 319491 > URL: https://svnweb.freebsd.org/changeset/base/319491 > > Log: > Skip setting the MTU in the netfront driver (xn# devices) if the new MTU > is the same as the old MTU. In particular, on Amazon EC2 "T2" instances > without this change, the network interface is reinitialized every 30 > minutes due to the MTU being (re)set when a new DHCP lease is obtained, > causing packets to be dropped, along with annoying syslog messages about > the link state changing. > > As a side note, the behaviour this commit fixes was responsible for > exposing the locking problems fixed via r318523 and r318631. > > Maintainers of other network interface drivers may wish to consider making > the corresponding change; the handling of SIOCSIFMTU does not seem to > exhibit a great deal of consistency between drivers. Is there any reason this check (ifp->if_mtu == ifr->ifr_mtu) is not done at a higher level for all the drivers? It seems pointless to add this chunk everywhere. Roger. From owner-svn-src-head@freebsd.org Fri Jun 2 13:33:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10CA2BF8130; Fri, 2 Jun 2017 13:33:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF53A299A; Fri, 2 Jun 2017 13:33:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52DXp7A044144; Fri, 2 Jun 2017 13:33:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52DXo79044142; Fri, 2 Jun 2017 13:33:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706021333.v52DXo79044142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Jun 2017 13:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319493 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 13:33:52 -0000 Author: jhb Date: Fri Jun 2 13:33:50 2017 New Revision: 319493 URL: https://svnweb.freebsd.org/changeset/base/319493 Log: Decode the arguments passed to __cap_rights_get() and cap_rights_limit(). Submitted by: tobik Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Fri Jun 2 09:54:41 2017 (r319492) +++ head/usr.bin/truss/syscall.h Fri Jun 2 13:33:50 2017 (r319493) @@ -28,6 +28,7 @@ * Kevent -- a pointer to an array of struct kevents. Prints all elements. * Pathconf -- the 2nd argument of pathconf(). * Utrace -- utrace(2) buffer. + * CapRights -- a pointer to a cap_rights_t. Prints all set capabilities. * * In addition, the pointer types (String, Ptr) may have OUT masked in -- * this means that the data is set on *return* from the system call -- or @@ -47,7 +48,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, - Sockoptname, Msgflags, + Sockoptname, Msgflags, CapRights, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Fri Jun 2 09:54:41 2017 (r319492) +++ head/usr.bin/truss/syscalls.c Fri Jun 2 13:33:50 2017 (r319493) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); * arguments. */ +#include #include #include #include @@ -76,6 +77,8 @@ __FBSDID("$FreeBSD$"); */ static struct syscall decoded_syscalls[] = { /* Native ABI */ + { .name = "__cap_rights_get", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Int, 1 }, { CapRights | OUT, 2 } } }, { .name = "__getcwd", .ret_type = 1, .nargs = 2, .args = { { Name | OUT, 0 }, { Int, 1 } } }, { .name = "_umtx_op", .ret_type = 1, .nargs = 5, @@ -96,6 +99,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } }, { .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights, 1 } } }, + { .name = "cap_rights_limit", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { CapRights, 1 } } }, { .name = "chdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "chflags", .ret_type = 1, .nargs = 2, @@ -1976,6 +1981,18 @@ print_arg(struct syscall_args *sc, unsigned long *args case Msgflags: print_mask_arg(sysdecode_msg_flags, fp, args[sc->offset]); break; + case CapRights: { + cap_rights_t rights; + + if (get_struct(pid, (void *)args[sc->offset], &rights, + sizeof(rights)) != -1) { + fputs("{ ", fp); + sysdecode_cap_rights(fp, &rights); + fputs(" }", fp); + } else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp); From owner-svn-src-head@freebsd.org Fri Jun 2 14:01:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B7C1BF851B; Fri, 2 Jun 2017 14:01:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAE0933FE; Fri, 2 Jun 2017 14:01:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52E1HvG052658; Fri, 2 Jun 2017 14:01:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52E1H1k052657; Fri, 2 Jun 2017 14:01:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706021401.v52E1H1k052657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 2 Jun 2017 14:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319494 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 14:01:19 -0000 Author: andrew Date: Fri Jun 2 14:01:17 2017 New Revision: 319494 URL: https://svnweb.freebsd.org/changeset/base/319494 Log: Fix device lookup of for the stdout-path chosen property. The stdout-path chosen property may include the serial connection details, e.g. the baud rate. When passing the device to OF_finddevice we need to strip off this information as it will cause the lookup to fail. Reviewed by: emaste, manu Differential Revision: https://reviews.freebsd.org/D6846 Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Fri Jun 2 13:33:50 2017 (r319493) +++ head/sys/dev/uart/uart_bus_fdt.c Fri Jun 2 14:01:17 2017 (r319494) @@ -117,9 +117,18 @@ static int phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node) { char buf[64]; + char *sep; if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0) return (ENXIO); + /* + * stdout-path may have a ':' to separate the device from the + * connection settings. Split the string so we just pass the former + * to OF_finddevice. + */ + sep = strchr(buf, ':'); + if (sep != NULL) + *sep = '\0'; if ((*node = OF_finddevice(buf)) == -1) return (ENXIO); From owner-svn-src-head@freebsd.org Fri Jun 2 14:17:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826F7BF8932; Fri, 2 Jun 2017 14:17:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC473C31; Fri, 2 Jun 2017 14:17:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52EHEUr060360; Fri, 2 Jun 2017 14:17:14 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52EHE4S060359; Fri, 2 Jun 2017 14:17:14 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201706021417.v52EHE4S060359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 2 Jun 2017 14:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319496 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 14:17:15 -0000 Author: cognet Date: Fri Jun 2 14:17:14 2017 New Revision: 319496 URL: https://svnweb.freebsd.org/changeset/base/319496 Log: - Don't bother flushing the data cache for pages we're about to unmap, there's no need to. - Remove pmap_is_current(), pmap_[pte|l3]_valid_cacheable as there were only used to know if we had to write back pages. - In pmap_remove_pages(), don't bother invalidating each page in the TLB, we're about to flush the whole TLB anyway. This makes make world 8-9% faster on my hardware. Reviewed by: andrew Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Jun 2 14:08:08 2017 (r319495) +++ head/sys/arm64/arm64/pmap.c Fri Jun 2 14:17:14 2017 (r319496) @@ -495,14 +495,6 @@ pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_ } static __inline int -pmap_is_current(pmap_t pmap) -{ - - return ((pmap == pmap_kernel()) || - (pmap == curthread->td_proc->p_vmspace->vm_map.pmap)); -} - -static __inline int pmap_l3_valid(pt_entry_t l3) { @@ -510,24 +502,8 @@ pmap_l3_valid(pt_entry_t l3) } -/* Is a level 1 or 2entry a valid block and cacheable */ CTASSERT(L1_BLOCK == L2_BLOCK); -static __inline int -pmap_pte_valid_cacheable(pt_entry_t pte) -{ - return (((pte & ATTR_DESCR_MASK) == L1_BLOCK) && - ((pte & ATTR_IDX_MASK) == ATTR_IDX(CACHED_MEMORY))); -} - -static __inline int -pmap_l3_valid_cacheable(pt_entry_t l3) -{ - - return (((l3 & ATTR_DESCR_MASK) == L3_PAGE) && - ((l3 & ATTR_IDX_MASK) == ATTR_IDX(CACHED_MEMORY))); -} - #define PTE_SYNC(pte) cpu_dcache_wb_range((vm_offset_t)pte, sizeof(*pte)) /* @@ -1180,8 +1156,6 @@ pmap_kremove(vm_offset_t va) KASSERT(pte != NULL, ("pmap_kremove: Invalid address")); KASSERT(lvl == 3, ("pmap_kremove: Invalid pte level %d", lvl)); - if (pmap_l3_valid_cacheable(pmap_load(pte))) - cpu_dcache_wb_range(va, L3_SIZE); pmap_load_clear(pte); PTE_SYNC(pte); pmap_invalidate_page(kernel_pmap, va); @@ -1292,8 +1266,6 @@ pmap_qremove(vm_offset_t sva, int count) KASSERT(lvl == 3, ("Invalid device pagetable level: %d != 3", lvl)); if (pte != NULL) { - if (pmap_l3_valid_cacheable(pmap_load(pte))) - cpu_dcache_wb_range(va, L3_SIZE); pmap_load_clear(pte); PTE_SYNC(pte); } @@ -2295,8 +2267,6 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if (pmap_is_current(pmap) && pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(va, L3_SIZE); old_l3 = pmap_load_clear(l3); PTE_SYNC(l3); pmap_invalidate_page(pmap, va); @@ -2518,9 +2488,6 @@ retry: pte = pmap_l2_to_l3(pde, pv->pv_va); tpte = pmap_load(pte); - if (pmap_is_current(pmap) && - pmap_l3_valid_cacheable(tpte)) - cpu_dcache_wb_range(pv->pv_va, L3_SIZE); pmap_load_clear(pte); PTE_SYNC(pte); pmap_invalidate_page(pmap, pv->pv_va); @@ -3004,10 +2971,6 @@ havel3: } goto validate; } - - /* Flush the cache, there might be uncommitted data in it */ - if (pmap_is_current(pmap) && pmap_l3_valid_cacheable(orig_l3)) - cpu_dcache_wb_range(va, L3_SIZE); } else { /* * Increment the counters. @@ -3673,20 +3636,8 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad pte %#jx", (uintmax_t)tpte)); - if (pmap_is_current(pmap)) { - if (lvl == 2 && - pmap_l3_valid_cacheable(tpte)) { - cpu_dcache_wb_range(pv->pv_va, - L3_SIZE); - } else if (lvl == 1 && - pmap_pte_valid_cacheable(tpte)) { - cpu_dcache_wb_range(pv->pv_va, - L2_SIZE); - } - } pmap_load_clear(pte); PTE_SYNC(pte); - pmap_invalidate_page(pmap, pv->pv_va); /* * Update the vm_page_t clean/reference bits. From owner-svn-src-head@freebsd.org Fri Jun 2 15:12:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CE81BF97EB; Fri, 2 Jun 2017 15:12:33 +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 1A0E965A16; Fri, 2 Jun 2017 15:12:33 +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 v52FCWnj084553; Fri, 2 Jun 2017 15:12:32 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52FCWxg084551; Fri, 2 Jun 2017 15:12:32 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201706021512.v52FCWxg084551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 2 Jun 2017 15:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319498 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 15:12:33 -0000 Author: loos Date: Fri Jun 2 15:12:32 2017 New Revision: 319498 URL: https://svnweb.freebsd.org/changeset/base/319498 Log: style(9) fixes, remove unnecessary headers, remove duplicate #defines and in some cases, shuffle the code around to simplify locking. No functional changes. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/etherswitch/e6000sw/e6000swreg.h Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Fri Jun 2 15:11:43 2017 (r319497) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Fri Jun 2 15:12:32 2017 (r319498) @@ -28,40 +28,25 @@ #include __FBSDID("$FreeBSD$"); -#include #include -#include -#include +#include +#include #include #include -#include #include -#include -#include -#include -#include -#include +#include +#include #include #include #include -#include -#include - -#include -#include -#include - #include -#include #include #include -#include #include #include -#include #include "e6000swreg.h" #include "etherswitch_if.h" @@ -71,14 +56,10 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_E6000SW); MALLOC_DEFINE(M_E6000SW, "e6000sw", "e6000sw switch"); -#define E6000SW_LOCK(_sc) \ - sx_xlock(&(_sc)->sx) -#define E6000SW_UNLOCK(_sc) \ - sx_unlock(&(_sc)->sx) -#define E6000SW_LOCK_ASSERT(_sc, _what) \ - sx_assert(&(_sc)->sx, (_what)) -#define E6000SW_TRYLOCK(_sc) \ - sx_tryxlock(&(_sc)->sx) +#define E6000SW_LOCK(_sc) sx_xlock(&(_sc)->sx) +#define E6000SW_UNLOCK(_sc) sx_unlock(&(_sc)->sx) +#define E6000SW_LOCK_ASSERT(_sc, _what) sx_assert(&(_sc)->sx, (_what)) +#define E6000SW_TRYLOCK(_sc) sx_tryxlock(&(_sc)->sx) typedef struct e6000sw_softc { device_t dev; @@ -108,46 +89,43 @@ static etherswitch_info_t etherswitch_info = { .es_name = "Marvell 6000 series switch" }; -static void e6000sw_identify(driver_t *driver, device_t parent); -static int e6000sw_probe(device_t dev); -static int e6000sw_attach(device_t dev); -static int e6000sw_detach(device_t dev); -static int e6000sw_readphy(device_t dev, int phy, int reg); -static int e6000sw_writephy(device_t dev, int phy, int reg, int data); -static etherswitch_info_t* e6000sw_getinfo(device_t dev); -static void e6000sw_lock(device_t dev); -static void e6000sw_unlock(device_t dev); -static int e6000sw_getport(device_t dev, etherswitch_port_t *p); -static int e6000sw_setport(device_t dev, etherswitch_port_t *p); -static int e6000sw_readreg_wrapper(device_t dev, int addr_reg); -static int e6000sw_writereg_wrapper(device_t dev, int addr_reg, int val); -static int e6000sw_readphy_wrapper(device_t dev, int phy, int reg); -static int e6000sw_writephy_wrapper(device_t dev, int phy, int reg, int data); -static int e6000sw_getvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg); -static int e6000sw_setvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg); -static int e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg); -static int e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg); -static void e6000sw_setup(device_t dev, e6000sw_softc_t *sc); -static void e6000sw_port_vlan_conf(e6000sw_softc_t *sc); -static void e6000sw_tick(void *arg); -static void e6000sw_set_atustat(device_t dev, e6000sw_softc_t *sc, int bin, - int flag); -static int e6000sw_atu_flush(device_t dev, e6000sw_softc_t *sc, int flag); -static __inline void e6000sw_writereg(e6000sw_softc_t *sc, int addr, int reg, - int val); -static __inline uint32_t e6000sw_readreg(e6000sw_softc_t *sc, int addr, - int reg); -static int e6000sw_ifmedia_upd(struct ifnet *ifp); -static void e6000sw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); -static int e6000sw_atu_mac_table(device_t dev, e6000sw_softc_t *sc, struct - atu_opt *atu, int flag); -static int e6000sw_get_pvid(e6000sw_softc_t *sc, int port, int *pvid); -static int e6000sw_set_pvid(e6000sw_softc_t *sc, int port, int pvid); -static __inline int e6000sw_is_cpuport(e6000sw_softc_t *sc, int port); -static __inline int e6000sw_is_fixedport(e6000sw_softc_t *sc, int port); -static __inline int e6000sw_is_phyport(e6000sw_softc_t *sc, int port); -static __inline struct mii_data *e6000sw_miiforphy(e6000sw_softc_t *sc, - unsigned int phy); +static void e6000sw_identify(driver_t *, device_t); +static int e6000sw_probe(device_t); +static int e6000sw_attach(device_t); +static int e6000sw_detach(device_t); +static int e6000sw_readphy(device_t, int, int); +static int e6000sw_writephy(device_t, int, int, int); +static etherswitch_info_t* e6000sw_getinfo(device_t); +static void e6000sw_lock(device_t); +static void e6000sw_unlock(device_t); +static int e6000sw_getport(device_t, etherswitch_port_t *); +static int e6000sw_setport(device_t, etherswitch_port_t *); +static int e6000sw_readreg_wrapper(device_t, int); +static int e6000sw_writereg_wrapper(device_t, int, int); +static int e6000sw_readphy_wrapper(device_t, int, int); +static int e6000sw_writephy_wrapper(device_t, int, int, int); +static int e6000sw_getvgroup_wrapper(device_t, etherswitch_vlangroup_t *); +static int e6000sw_setvgroup_wrapper(device_t, etherswitch_vlangroup_t *); +static int e6000sw_setvgroup(device_t, etherswitch_vlangroup_t *); +static int e6000sw_getvgroup(device_t, etherswitch_vlangroup_t *); +static void e6000sw_setup(device_t, e6000sw_softc_t *); +static void e6000sw_port_vlan_conf(e6000sw_softc_t *); +static void e6000sw_tick(void *); +static void e6000sw_set_atustat(device_t, e6000sw_softc_t *, int, int); +static int e6000sw_atu_flush(device_t, e6000sw_softc_t *, int); +static __inline void e6000sw_writereg(e6000sw_softc_t *, int, int, int); +static __inline uint32_t e6000sw_readreg(e6000sw_softc_t *, int, int); +static int e6000sw_ifmedia_upd(struct ifnet *); +static void e6000sw_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int e6000sw_atu_mac_table(device_t, e6000sw_softc_t *, struct atu_opt *, + int); +static int e6000sw_get_pvid(e6000sw_softc_t *, int, int *); +static int e6000sw_set_pvid(e6000sw_softc_t *, int, int); +static __inline int e6000sw_is_cpuport(e6000sw_softc_t *, int); +static __inline int e6000sw_is_fixedport(e6000sw_softc_t *, int); +static __inline int e6000sw_is_phyport(e6000sw_softc_t *, int); +static __inline struct mii_data *e6000sw_miiforphy(e6000sw_softc_t *, + unsigned int); static device_method_t e6000sw_methods[] = { /* device interface */ @@ -190,14 +168,17 @@ DRIVER_MODULE(etherswitch, e6000sw, etherswitch_driver DRIVER_MODULE(miibus, e6000sw, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(e6000sw, mdio, 1, 1, 1); -#define SMI_CMD 0 -#define SMI_CMD_BUSY (1<<15) -#define SMI_CMD_OP_READ ((2<<10)|SMI_CMD_BUSY|(1<<12)) -#define SMI_CMD_OP_WRITE ((1<<10)|SMI_CMD_BUSY|(1<<12)) -#define SMI_DATA 1 +#define SMI_CMD 0 +#define SMI_CMD_BUSY (1 << 15) +#define SMI_CMD_OP_READ ((2 << 10) | SMI_CMD_BUSY | (1 << 12)) +#define SMI_CMD_OP_WRITE ((1 << 10) | SMI_CMD_BUSY | (1 << 12)) +#define SMI_DATA 1 -#define MDIO_READ(dev, addr, reg) MDIO_READREG(device_get_parent(dev), (addr), (reg)) -#define MDIO_WRITE(dev, addr, reg, val) MDIO_WRITEREG(device_get_parent(dev), (addr), (reg), (val)) +#define MDIO_READ(dev, addr, reg) \ + MDIO_READREG(device_get_parent(dev), (addr), (reg)) +#define MDIO_WRITE(dev, addr, reg, val) \ + MDIO_WRITEREG(device_get_parent(dev), (addr), (reg), (val)) + static void e6000sw_identify(driver_t *driver, device_t parent) { @@ -211,8 +192,8 @@ e6000sw_probe(device_t dev) { e6000sw_softc_t *sc; const char *description; - unsigned int id; phandle_t dsa_node, switch_node; + uint32_t id; dsa_node = fdt_find_compatible(OF_finddevice("/"), "marvell,dsa", 0); @@ -235,8 +216,8 @@ e6000sw_probe(device_t dev) /* Lock is necessary due to assertions. */ sx_init(&sc->sx, "e6000sw"); E6000SW_LOCK(sc); - id = e6000sw_readreg(sc, REG_PORT(0), SWITCH_ID); + E6000SW_UNLOCK(sc); switch (id & 0xfff0) { case 0x3520: @@ -249,7 +230,6 @@ e6000sw_probe(device_t dev) description = "Marvell 88E6176"; break; default: - E6000SW_UNLOCK(sc); sx_destroy(&sc->sx); device_printf(dev, "Unrecognized device, id 0x%x.\n", id); return (ENXIO); @@ -257,8 +237,6 @@ e6000sw_probe(device_t dev) device_set_desc(dev, description); - E6000SW_UNLOCK(sc); - return (BUS_PROBE_DEFAULT); } @@ -433,9 +411,9 @@ e6000sw_poll_done(e6000sw_softc_t *sc) { int i; - for (i = 0; i < 16; i++) { + for (i = 0; i < E6000SW_SMI_TIMEOUT; i++) { - if (!(e6000sw_readreg(sc, REG_GLOBAL2, PHY_CMD) & + if (!(e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG) & (1 << PHY_CMD_SMI_BUSY))) return (0); @@ -457,8 +435,6 @@ e6000sw_readphy(device_t dev, int phy, int reg) int err; sc = device_get_softc(dev); - val = 0; - if (!e6000sw_is_phyport(sc, phy) || reg >= E6000SW_NUM_PHY_REGS) { device_printf(dev, "Wrong register address.\n"); return (EINVAL); @@ -472,7 +448,7 @@ e6000sw_readphy(device_t dev, int phy, int reg) return (err); } - val |= 1 << PHY_CMD_SMI_BUSY; + val = 1 << PHY_CMD_SMI_BUSY; val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE; val |= PHY_CMD_OPCODE_READ << PHY_CMD_OPCODE; val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK; @@ -485,10 +461,9 @@ e6000sw_readphy(device_t dev, int phy, int reg) return (err); } - val = e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG) - & PHY_DATA_MASK; + val = e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG); - return (val); + return (val & PHY_DATA_MASK); } static int @@ -499,8 +474,6 @@ e6000sw_writephy(device_t dev, int phy, int reg, int d int err; sc = device_get_softc(dev); - val = 0; - if (!e6000sw_is_phyport(sc, phy) || reg >= E6000SW_NUM_PHY_REGS) { device_printf(dev, "Wrong register address.\n"); return (EINVAL); @@ -514,22 +487,20 @@ e6000sw_writephy(device_t dev, int phy, int reg, int d return (err); } + val = 1 << PHY_CMD_SMI_BUSY; val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE; - val |= 1 << PHY_CMD_SMI_BUSY; val |= PHY_CMD_OPCODE_WRITE << PHY_CMD_OPCODE; val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK; val |= (phy << PHY_CMD_DEV_ADDR) & PHY_CMD_DEV_ADDR_MASK; e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG, - data & PHY_DATA_MASK); + data & PHY_DATA_MASK); e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val); err = e6000sw_poll_done(sc); - if (err != 0) { + if (err != 0) device_printf(dev, "Timeout while waiting for switch\n"); - return (err); - } - return (0); + return (err); } static int @@ -589,18 +560,14 @@ e6000sw_getport(device_t dev, etherswitch_port_t *p) int err; struct ifmediareq *ifmr; - err = 0; e6000sw_softc_t *sc = device_get_softc(dev); E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); - E6000SW_LOCK(sc); + if (p->es_port >= sc->num_ports || p->es_port < 0) + return (EINVAL); - if (p->es_port >= sc->num_ports || - p->es_port < 0) { - err = EINVAL; - goto out; - } - + err = 0; + E6000SW_LOCK(sc); e6000sw_get_pvid(sc, p->es_port, &p->es_pvid); if (e6000sw_is_cpuport(sc, p->es_port)) { @@ -623,9 +590,8 @@ e6000sw_getport(device_t dev, etherswitch_port_t *p) err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, &mii->mii_media, SIOCGIFMEDIA); } - -out: E6000SW_UNLOCK(sc); + return (err); } @@ -636,18 +602,14 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) int err; struct mii_data *mii; - err = 0; sc = device_get_softc(dev); E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); - E6000SW_LOCK(sc); + if (p->es_port >= sc->num_ports || p->es_port < 0) + return (EINVAL); - if (p->es_port >= sc->num_ports || - p->es_port < 0) { - err = EINVAL; - goto out; - } - + err = 0; + E6000SW_LOCK(sc); if (p->es_pvid != 0) e6000sw_set_pvid(sc, p->es_port, p->es_pvid); if (!e6000sw_is_cpuport(sc, p->es_port)) { @@ -655,9 +617,8 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, &mii->mii_media, SIOCSIFMEDIA); } - -out: E6000SW_UNLOCK(sc); + return (err); } @@ -773,12 +734,10 @@ e6000sw_flush_port(e6000sw_softc_t *sc, int port) { uint32_t reg; - reg = e6000sw_readreg(sc, REG_PORT(port), - PORT_VLAN_MAP); + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); reg &= ~PORT_VLAN_MAP_TABLE_MASK; reg &= ~PORT_VLAN_MAP_FID_MASK; - e6000sw_writereg(sc, REG_PORT(port), - PORT_VLAN_MAP, reg); + e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, reg); if (sc->vgroup[port] != E6000SW_PORT_NO_VGROUP) { /* * If port belonged somewhere, owner-group @@ -795,14 +754,12 @@ e6000sw_port_assign_vgroup(e6000sw_softc_t *sc, int po { uint32_t reg; - reg = e6000sw_readreg(sc, REG_PORT(port), - PORT_VLAN_MAP); + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); reg &= ~PORT_VLAN_MAP_TABLE_MASK; reg &= ~PORT_VLAN_MAP_FID_MASK; reg |= members & ~(1 << port); reg |= (fid << PORT_VLAN_MAP_FID) & PORT_VLAN_MAP_FID_MASK; - e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, - reg); + e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, reg); sc->vgroup[port] = vgroup; } @@ -897,19 +854,18 @@ e6000sw_ifmedia_sts(struct ifnet *ifp, struct ifmediar ifmr->ifm_status = mii->mii_media_status; } - static int e6000sw_smi_waitready(e6000sw_softc_t *sc, int phy) { int i; for (i = 0; i < E6000SW_SMI_TIMEOUT; i++) { - if ((MDIO_READ(sc->dev, phy, SMI_CMD) - & SMI_CMD_BUSY) == 0) - return 0; + if ((MDIO_READ(sc->dev, phy, SMI_CMD) & SMI_CMD_BUSY) == 0) + return (0); + DELAY(1); } - return 1; + return (1); } static __inline uint32_t @@ -925,8 +881,8 @@ e6000sw_readreg(e6000sw_softc_t *sc, int addr, int reg printf("e6000sw: readreg timeout\n"); return (0xffff); } - MDIO_WRITE(sc->dev, sc->sw_addr, SMI_CMD, SMI_CMD_OP_READ | - (addr << 5) | reg); + MDIO_WRITE(sc->dev, sc->sw_addr, SMI_CMD, + SMI_CMD_OP_READ | (addr << 5) | reg); if (e6000sw_smi_waitready(sc, sc->sw_addr)) { printf("e6000sw: readreg timeout\n"); return (0xffff); @@ -951,14 +907,12 @@ e6000sw_writereg(e6000sw_softc_t *sc, int addr, int re return; } MDIO_WRITE(sc->dev, sc->sw_addr, SMI_DATA, val); - MDIO_WRITE(sc->dev, sc->sw_addr, SMI_CMD, SMI_CMD_OP_WRITE | - (addr << 5) | reg); + MDIO_WRITE(sc->dev, sc->sw_addr, SMI_CMD, + SMI_CMD_OP_WRITE | (addr << 5) | reg); if (e6000sw_smi_waitready(sc, sc->sw_addr)) { printf("e6000sw: readreg timeout\n"); return; } - - return; } static __inline int Modified: head/sys/dev/etherswitch/e6000sw/e6000swreg.h ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000swreg.h Fri Jun 2 15:11:43 2017 (r319497) +++ head/sys/dev/etherswitch/e6000sw/e6000swreg.h Fri Jun 2 15:12:32 2017 (r319498) @@ -155,8 +155,6 @@ struct atu_opt { #define SMI_PHY_CMD_REG 0x18 #define SMI_PHY_DATA_REG 0x19 -#define PHY_CMD 0x18 -#define PHY_DATA 0x19 #define PHY_DATA_MASK 0xffff #define PHY_CMD_SMI_BUSY 15 From owner-svn-src-head@freebsd.org Fri Jun 2 15:32:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEBCCBF9C4D; Fri, 2 Jun 2017 15:32:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F49066183; Fri, 2 Jun 2017 15:32:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52FWBvt093067; Fri, 2 Jun 2017 15:32:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52FWBao093066; Fri, 2 Jun 2017 15:32:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201706021532.v52FWBao093066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 2 Jun 2017 15:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319499 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 15:32:12 -0000 Author: trasz Date: Fri Jun 2 15:32:11 2017 New Revision: 319499 URL: https://svnweb.freebsd.org/changeset/base/319499 Log: Consistently use lowercase hex numbers in ascii(7). MFC after: 2 weeks Modified: head/share/man/man7/ascii.7 Modified: head/share/man/man7/ascii.7 ============================================================================== --- head/share/man/man7/ascii.7 Fri Jun 2 15:12:32 2017 (r319498) +++ head/share/man/man7/ascii.7 Fri Jun 2 15:32:11 2017 (r319499) @@ -64,9 +64,9 @@ The set: .Bd -literal -offset left 00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL -08 BS 09 HT 0A LF 0B VT 0C FF 0D CR 0E SO 0F SI +08 BS 09 HT 0a LF 0b VT 0c FF 0d CR 0e SO 0f SI 10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB -18 CAN 19 EM 1A SUB 1B ESC 1C FS 1D GS 1E RS 1F US +18 CAN 19 EM 1a SUB 1b ESC 1c FS 1d GS 1e RS 1f US 20 SP 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' 28 ( 29 ) 2a * 2b + 2c , 2d - 2e . 2f / 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 From owner-svn-src-head@freebsd.org Fri Jun 2 16:30:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA24BFACC6; Fri, 2 Jun 2017 16:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D15268DC7; Fri, 2 Jun 2017 16:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52GUeYv016829; Fri, 2 Jun 2017 16:30:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52GUeTM016828; Fri, 2 Jun 2017 16:30:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706021630.v52GUeTM016828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Jun 2017 16:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319500 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 16:30:41 -0000 Author: hselasky Date: Fri Jun 2 16:30:40 2017 New Revision: 319500 URL: https://svnweb.freebsd.org/changeset/base/319500 Log: Add support for setting the non-blocking I/O flag for LinuxKPI character devices. In Linux the FIONBIO IOCTL is handled by the kernel and not the drivers. Also need return success for the FIOASYNC ioctl due to existing logic in kern_fcntl() even though it is not supported currently. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jun 2 15:32:11 2017 (r319499) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jun 2 16:30:40 2017 (r319500) @@ -826,6 +826,10 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t return (error); filp->f_flags = file->f_flag; + /* the LinuxKPI supports blocking and non-blocking I/O */ + if (cmd == FIONBIO || cmd == FIOASYNC) + return (0); + linux_set_current(td); size = IOCPARM_LEN(cmd); /* refer to logic in sys_ioctl() */ From owner-svn-src-head@freebsd.org Fri Jun 2 16:52:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9354BFB46F; Fri, 2 Jun 2017 16:52:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A37946AC5F; Fri, 2 Jun 2017 16:52:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52GqITU028921; Fri, 2 Jun 2017 16:52:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52GqIS7028920; Fri, 2 Jun 2017 16:52:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706021652.v52GqIS7028920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Jun 2017 16:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319501 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 16:52:19 -0000 Author: hselasky Date: Fri Jun 2 16:52:18 2017 New Revision: 319501 URL: https://svnweb.freebsd.org/changeset/base/319501 Log: Improve kqueue() support in the LinuxKPI. Some applications using the kqueue() does not set non-blocking I/O mode for event driven read of file descriptors. This means the LinuxKPI internal kqueue read and write event flags must be updated before the next read and/or write system call. Else the read and/or write system call may block. This can happen when there is no more data to read following a previous read event. Then the application also gets blocked from processing other events. This situation can also be solved by the applications setting and using non-blocking I/O mode. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jun 2 16:30:40 2017 (r319500) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jun 2 16:52:18 2017 (r319501) @@ -438,7 +438,7 @@ linux_kq_lock_unowned(void *arg) } static void -linux_dev_kqfilter_poll(struct linux_file *); +linux_dev_kqfilter_poll(struct linux_file *, int); struct linux_file * linux_file_alloc(void) @@ -856,9 +856,11 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t current->bsd_ioctl_len = 0; } - if (error == EWOULDBLOCK) - linux_dev_kqfilter_poll(filp); - else if (error == ERESTARTSYS) + if (error == EWOULDBLOCK) { + /* update kqfilter status, if any */ + linux_dev_kqfilter_poll(filp, + LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE); + } else if (error == ERESTARTSYS) error = ERESTART; return (error); } @@ -893,14 +895,15 @@ linux_dev_read(struct cdev *dev, struct uio *uio, int uio->uio_resid -= bytes; } else { error = -bytes; - if (error == EWOULDBLOCK) - linux_dev_kqfilter_poll(filp); - else if (error == ERESTARTSYS) + if (error == ERESTARTSYS) error = ERESTART; } } else error = ENXIO; + /* update kqfilter status, if any */ + linux_dev_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ); + return (error); } @@ -934,14 +937,15 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int uio->uio_resid -= bytes; } else { error = -bytes; - if (error == EWOULDBLOCK) - linux_dev_kqfilter_poll(filp); - else if (error == ERESTARTSYS) + if (error == ERESTARTSYS) error = ERESTART; } } else error = ENXIO; + /* update kqfilter status, if any */ + linux_dev_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_WRITE); + return (error); } @@ -1032,21 +1036,20 @@ static struct filterops linux_dev_kqfiltops_write = { }; static void -linux_dev_kqfilter_poll(struct linux_file *filp) +linux_dev_kqfilter_poll(struct linux_file *filp, int kqflags) { int temp; - spin_lock(&filp->f_kqlock); - temp = (filp->f_kqflags & (LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE)); - filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | LINUX_KQ_FLAG_NEED_WRITE); - spin_unlock(&filp->f_kqlock); - - if (temp != 0) { + if (filp->f_kqflags & kqflags) { /* get the latest polling state */ temp = filp->f_op->poll(filp, NULL); + spin_lock(&filp->f_kqlock); + /* clear kqflags */ + filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | + LINUX_KQ_FLAG_NEED_WRITE); + /* update kqflags */ if (temp & (POLLIN | POLLOUT)) { - spin_lock(&filp->f_kqlock); if (temp & POLLIN) filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ; if (temp & POLLOUT) @@ -1054,8 +1057,8 @@ linux_dev_kqfilter_poll(struct linux_file *filp) /* make sure the "knote" gets woken up */ KNOTE_LOCKED(&filp->f_selinfo.si_note, 0); - spin_unlock(&filp->f_kqlock); } + spin_unlock(&filp->f_kqlock); } } @@ -1099,7 +1102,10 @@ linux_dev_kqfilter(struct cdev *dev, struct knote *kn) if (error == 0) { linux_set_current(td); - linux_dev_kqfilter_poll(filp); + + /* update kqfilter status, if any */ + linux_dev_kqfilter_poll(filp, + LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE); } return (error); } From owner-svn-src-head@freebsd.org Fri Jun 2 17:31:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C79E7BFBE13; Fri, 2 Jun 2017 17:31:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A19E26EB51; Fri, 2 Jun 2017 17:31:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52HVPj3043370; Fri, 2 Jun 2017 17:31:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52HVPFx043365; Fri, 2 Jun 2017 17:31:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706021731.v52HVPFx043365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 2 Jun 2017 17:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319502 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 17:31:26 -0000 Author: glebius Date: Fri Jun 2 17:31:25 2017 New Revision: 319502 URL: https://svnweb.freebsd.org/changeset/base/319502 Log: For UNIX sockets make vnode point not to the socket, but to the UNIX PCB, since the latter is the thing that links together VFS and sockets. While here, make the union in the struct vnode anonymous. Modified: head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jun 2 16:52:18 2017 (r319501) +++ head/sys/kern/uipc_usrreq.c Fri Jun 2 17:31:25 2017 (r319502) @@ -552,7 +552,7 @@ restart: UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); - VOP_UNP_BIND(vp, unp->unp_socket); + VOP_UNP_BIND(vp, unp); unp->unp_vnode = vp; unp->unp_addr = soun; unp->unp_flags &= ~UNP_BINDING; @@ -670,9 +670,6 @@ uipc_detach(struct socket *so) UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); - /* - * XXXRW: Should assert vp->v_socket == so. - */ if ((vp = unp->unp_vnode) != NULL) { VOP_UNP_DETACH(vp); unp->unp_vnode = NULL; @@ -1386,11 +1383,12 @@ unp_connectat(int fd, struct socket *so, struct sockad * and to protect simultaneous locking of multiple pcbs. */ UNP_LINK_WLOCK(); - VOP_UNP_CONNECT(vp, &so2); - if (so2 == NULL) { + VOP_UNP_CONNECT(vp, &unp2); + if (unp2 == NULL) { error = ECONNREFUSED; goto bad2; } + so2 = unp2->unp_socket; if (so->so_type != so2->so_type) { error = EPROTOTYPE; goto bad2; @@ -2454,7 +2452,6 @@ unp_scan(struct mbuf *m0, void (*op)(struct filedescen void vfs_unp_reclaim(struct vnode *vp) { - struct socket *so; struct unpcb *unp; int active; @@ -2464,10 +2461,7 @@ vfs_unp_reclaim(struct vnode *vp) active = 0; UNP_LINK_WLOCK(); - VOP_UNP_CONNECT(vp, &so); - if (so == NULL) - goto done; - unp = sotounpcb(so); + VOP_UNP_CONNECT(vp, &unp); if (unp == NULL) goto done; UNP_PCB_LOCK(unp); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Jun 2 16:52:18 2017 (r319501) +++ head/sys/kern/vfs_default.c Fri Jun 2 17:31:25 2017 (r319502) @@ -1128,7 +1128,7 @@ int vop_stdunp_bind(struct vop_unp_bind_args *ap) { - ap->a_vp->v_socket = ap->a_socket; + ap->a_vp->v_unpcb = ap->a_unpcb; return (0); } @@ -1136,7 +1136,7 @@ int vop_stdunp_connect(struct vop_unp_connect_args *ap) { - *ap->a_socket = ap->a_vp->v_socket; + *ap->a_unpcb = ap->a_vp->v_unpcb; return (0); } @@ -1144,7 +1144,7 @@ int vop_stdunp_detach(struct vop_unp_detach_args *ap) { - ap->a_vp->v_socket = NULL; + ap->a_vp->v_unpcb = NULL; return (0); } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jun 2 16:52:18 2017 (r319501) +++ head/sys/kern/vfs_subr.c Fri Jun 2 17:31:25 2017 (r319502) @@ -2994,7 +2994,10 @@ _vdrop(struct vnode *vp, bool locked) /* XXX Elsewhere we detect an already freed vnode via NULL v_op. */ vp->v_op = NULL; #endif - bzero(&vp->v_un, sizeof(vp->v_un)); + vp->v_mountedhere = NULL; + vp->v_unpcb = NULL; + vp->v_rdev = NULL; + vp->v_fifoinfo = NULL; vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; vp->v_iflag = 0; vp->v_vflag = 0; Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Jun 2 16:52:18 2017 (r319501) +++ head/sys/kern/vnode_if.src Fri Jun 2 17:31:25 2017 (r319502) @@ -662,7 +662,7 @@ vop_advise { vop_unp_bind { IN struct vnode *vp; - IN struct socket *socket; + IN struct unpcb *unpcb; }; @@ -670,7 +670,7 @@ vop_unp_bind { vop_unp_connect { IN struct vnode *vp; - OUT struct socket **socket; + OUT struct unpcb **unpcb; }; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jun 2 16:52:18 2017 (r319501) +++ head/sys/sys/vnode.h Fri Jun 2 17:31:25 2017 (r319502) @@ -112,14 +112,13 @@ struct vnode { /* * Type specific fields, only one applies to any given vnode. - * See #defines below for renaming to v_* namespace. */ union { - struct mount *vu_mount; /* v ptr to mountpoint (VDIR) */ - struct socket *vu_socket; /* v unix domain net (VSOCK) */ - struct cdev *vu_cdev; /* v device (VCHR, VBLK) */ - struct fifoinfo *vu_fifoinfo; /* v fifo (VFIFO) */ - } v_un; + struct mount *v_mountedhere; /* v ptr to mountpoint (VDIR) */ + struct unpcb *v_unpcb; /* v unix domain net (VSOCK) */ + struct cdev *v_rdev; /* v device (VCHR, VBLK) */ + struct fifoinfo *v_fifoinfo; /* v fifo (VFIFO) */ + }; /* * vfs_hash: (mount + inode) -> vnode hash. The hash value @@ -175,11 +174,6 @@ struct vnode { #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ -#define v_mountedhere v_un.vu_mount -#define v_socket v_un.vu_socket -#define v_rdev v_un.vu_cdev -#define v_fifoinfo v_un.vu_fifoinfo - #define bo2vnode(bo) __containerof((bo), struct vnode, v_bufobj) /* XXX: These are temporary to avoid a source sweep at this time */ @@ -200,7 +194,7 @@ struct xvnode { long xv_numoutput; /* num of writes in progress */ enum vtype xv_type; /* vnode type */ union { - void *xvu_socket; /* socket, if VSOCK */ + void *xvu_socket; /* unpcb, if VSOCK */ void *xvu_fifo; /* fifo, if VFIFO */ dev_t xvu_rdev; /* maj/min, if VBLK/VCHR */ struct { From owner-svn-src-head@freebsd.org Fri Jun 2 17:39:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F1FBFBEB0; Fri, 2 Jun 2017 17:39:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0656EF4C; Fri, 2 Jun 2017 17:39:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52Hd5s9045501; Fri, 2 Jun 2017 17:39:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52Hd5Js045499; Fri, 2 Jun 2017 17:39:05 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706021739.v52Hd5Js045499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 2 Jun 2017 17:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319503 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 17:39:06 -0000 Author: glebius Date: Fri Jun 2 17:39:05 2017 New Revision: 319503 URL: https://svnweb.freebsd.org/changeset/base/319503 Log: Remove write only flag UNP_HAVEPCCACHED. Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jun 2 17:31:25 2017 (r319502) +++ head/sys/kern/uipc_usrreq.c Fri Jun 2 17:39:05 2017 (r319503) @@ -758,7 +758,6 @@ uipc_listen(struct socket *so, int backlog, struct thr error = solisten_proto_check(so); if (error == 0) { cru2x(td->td_ucred, &unp->unp_peercred); - unp->unp_flags |= UNP_HAVEPCCACHED; solisten_proto(so, backlog); } SOCK_UNLOCK(so); @@ -1429,8 +1428,6 @@ unp_connectat(int fd, struct socket *so, struct sockad * listen(); uipc_listen() cached that process's credentials * at that time so we can use them now. */ - KASSERT(unp2->unp_flags & UNP_HAVEPCCACHED, - ("unp_connect: listener without cached peercred")); memcpy(&unp->unp_peercred, &unp2->unp_peercred, sizeof(unp->unp_peercred)); unp->unp_flags |= UNP_HAVEPC; @@ -2495,10 +2492,6 @@ db_print_unpflags(int unp_flags) comma = 0; if (unp_flags & UNP_HAVEPC) { db_printf("%sUNP_HAVEPC", comma ? ", " : ""); - comma = 1; - } - if (unp_flags & UNP_HAVEPCCACHED) { - db_printf("%sUNP_HAVEPCCACHED", comma ? ", " : ""); comma = 1; } if (unp_flags & UNP_WANTCRED) { Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Fri Jun 2 17:31:25 2017 (r319502) +++ head/sys/sys/unpcb.h Fri Jun 2 17:39:05 2017 (r319503) @@ -92,14 +92,8 @@ struct unpcb { * and is really the credentials of the connected peer. This is used * to determine whether the contents should be sent to the user or * not. - * - * UNP_HAVEPCCACHED - indicates that the unp_peercred member is filled - * in, but does *not* contain the credentials of the connected peer - * (there may not even be a peer). This is set in unp_listen() when - * it fills in unp_peercred for later consumption by unp_connect(). */ #define UNP_HAVEPC 0x001 -#define UNP_HAVEPCCACHED 0x002 #define UNP_WANTCRED 0x004 /* credentials wanted */ #define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ From owner-svn-src-head@freebsd.org Fri Jun 2 17:43:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D565DAF80CC; Fri, 2 Jun 2017 17:43:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4CAF6F423; Fri, 2 Jun 2017 17:43:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52HhlrB049505; Fri, 2 Jun 2017 17:43:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52HhlZe049504; Fri, 2 Jun 2017 17:43:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706021743.v52HhlZe049504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 2 Jun 2017 17:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319504 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 17:43:48 -0000 Author: glebius Date: Fri Jun 2 17:43:47 2017 New Revision: 319504 URL: https://svnweb.freebsd.org/changeset/base/319504 Log: Style: unwrap lines that doesn't have a good reason to be wrapped. Modified: head/sys/kern/uipc_accf.c Modified: head/sys/kern/uipc_accf.c ============================================================================== --- head/sys/kern/uipc_accf.c Fri Jun 2 17:39:05 2017 (r319503) +++ head/sys/kern/uipc_accf.c Fri Jun 2 17:43:47 2017 (r319504) @@ -130,8 +130,7 @@ accept_filt_generic_mod_event(module_t mod, int event, switch (event) { case MOD_LOAD: - p = malloc(sizeof(*p), M_ACCF, - M_WAITOK); + p = malloc(sizeof(*p), M_ACCF, M_WAITOK); bcopy(accfp, p, sizeof(*p)); error = accept_filt_add(p); break; @@ -168,8 +167,7 @@ do_getopt_accept_filter(struct socket *so, struct sock int error; error = 0; - afap = malloc(sizeof(*afap), M_TEMP, - M_WAITOK | M_ZERO); + afap = malloc(sizeof(*afap), M_TEMP, M_WAITOK | M_ZERO); SOCK_LOCK(so); if ((so->so_options & SO_ACCEPTCONN) == 0) { error = EINVAL; @@ -227,8 +225,7 @@ do_setopt_accept_filter(struct socket *so, struct sock * Pre-allocate any memory we may need later to avoid blocking at * untimely moments. This does not optimize for invalid arguments. */ - afap = malloc(sizeof(*afap), M_TEMP, - M_WAITOK); + afap = malloc(sizeof(*afap), M_TEMP, M_WAITOK); error = sooptcopyin(sopt, afap, sizeof *afap, sizeof *afap); afap->af_name[sizeof(afap->af_name)-1] = '\0'; afap->af_arg[sizeof(afap->af_arg)-1] = '\0'; @@ -247,12 +244,10 @@ do_setopt_accept_filter(struct socket *so, struct sock * attached properly, 'newaf' is NULLed to avoid a free() * while in use. */ - newaf = malloc(sizeof(*newaf), M_ACCF, M_WAITOK | - M_ZERO); + newaf = malloc(sizeof(*newaf), M_ACCF, M_WAITOK | M_ZERO); if (afp->accf_create != NULL && afap->af_name[0] != '\0') { size_t len = strlen(afap->af_name) + 1; - newaf->so_accept_filter_str = malloc(len, M_ACCF, - M_WAITOK); + newaf->so_accept_filter_str = malloc(len, M_ACCF, M_WAITOK); strcpy(newaf->so_accept_filter_str, afap->af_name); } From owner-svn-src-head@freebsd.org Fri Jun 2 17:49:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F97AF8176; Fri, 2 Jun 2017 17:49:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA0596F5E9; Fri, 2 Jun 2017 17:49:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52HnLcF049737; Fri, 2 Jun 2017 17:49:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52HnLsj049734; Fri, 2 Jun 2017 17:49:21 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706021749.v52HnLsj049734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 2 Jun 2017 17:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319505 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 17:49:23 -0000 Author: glebius Date: Fri Jun 2 17:49:21 2017 New Revision: 319505 URL: https://svnweb.freebsd.org/changeset/base/319505 Log: Rename accept filter getopt/setopt functions, so that they are prefixed with module name and match other functions in the module. There is no functional change. Modified: head/sys/kern/uipc_accf.c head/sys/kern/uipc_socket.c head/sys/sys/sockopt.h Modified: head/sys/kern/uipc_accf.c ============================================================================== --- head/sys/kern/uipc_accf.c Fri Jun 2 17:43:47 2017 (r319504) +++ head/sys/kern/uipc_accf.c Fri Jun 2 17:49:21 2017 (r319505) @@ -161,7 +161,7 @@ accept_filt_generic_mod_event(module_t mod, int event, } int -do_getopt_accept_filter(struct socket *so, struct sockopt *sopt) +accept_filt_getopt(struct socket *so, struct sockopt *sopt) { struct accept_filter_arg *afap; int error; @@ -189,7 +189,7 @@ out: } int -do_setopt_accept_filter(struct socket *so, struct sockopt *sopt) +accept_filt_setopt(struct socket *so, struct sockopt *sopt) { struct accept_filter_arg *afap; struct accept_filter *afp; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jun 2 17:43:47 2017 (r319504) +++ head/sys/kern/uipc_socket.c Fri Jun 2 17:49:21 2017 (r319505) @@ -452,7 +452,7 @@ sodealloc(struct socket *so) &so->so_snd.sb_hiwat, 0, RLIM_INFINITY); /* remove accept filter if one is present. */ if (so->so_accf != NULL) - do_setopt_accept_filter(so, NULL); + accept_filt_setopt(so, NULL); #ifdef MAC mac_socket_destroy(so); #endif @@ -2526,7 +2526,7 @@ sosetopt(struct socket *so, struct sockopt *sopt) } else { switch (sopt->sopt_name) { case SO_ACCEPTFILTER: - error = do_setopt_accept_filter(so, sopt); + error = accept_filt_setopt(so, sopt); if (error) goto bad; break; @@ -2784,7 +2784,7 @@ sogetopt(struct socket *so, struct sockopt *sopt) } else { switch (sopt->sopt_name) { case SO_ACCEPTFILTER: - error = do_getopt_accept_filter(so, sopt); + error = accept_filt_getopt(so, sopt); break; case SO_LINGER: Modified: head/sys/sys/sockopt.h ============================================================================== --- head/sys/sys/sockopt.h Fri Jun 2 17:43:47 2017 (r319504) +++ head/sys/sys/sockopt.h Fri Jun 2 17:49:21 2017 (r319505) @@ -64,8 +64,8 @@ int sooptcopyout(struct sockopt *sopt, const void *buf int soopt_getm(struct sockopt *sopt, struct mbuf **mp); int soopt_mcopyin(struct sockopt *sopt, struct mbuf *m); int soopt_mcopyout(struct sockopt *sopt, struct mbuf *m); -int do_getopt_accept_filter(struct socket *so, struct sockopt *sopt); -int do_setopt_accept_filter(struct socket *so, struct sockopt *sopt); +int accept_filt_getopt(struct socket *, struct sockopt *); +int accept_filt_setopt(struct socket *, struct sockopt *); int so_setsockopt(struct socket *so, int level, int optname, void *optval, size_t optlen); From owner-svn-src-head@freebsd.org Fri Jun 2 17:57:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1B4AF83E0; Fri, 2 Jun 2017 17:57:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE376FAD5; Fri, 2 Jun 2017 17:57:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52HvRfp053606; Fri, 2 Jun 2017 17:57:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52HvRW1053605; Fri, 2 Jun 2017 17:57:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201706021757.v52HvRW1053605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 2 Jun 2017 17:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319506 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 17:57:28 -0000 Author: np Date: Fri Jun 2 17:57:27 2017 New Revision: 319506 URL: https://svnweb.freebsd.org/changeset/base/319506 Log: cxgbe(4): Update the statistics for compound tx work requests once per work request, not once per frame. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Jun 2 17:49:21 2017 (r319505) +++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 2 17:57:27 2017 (r319506) @@ -4581,12 +4581,8 @@ write_txpkts_wr(struct sge_txq *txq, struct fw_eth_tx_ if (checkwrap && (uintptr_t)cpl == (uintptr_t)&eq->desc[eq->sidx]) cpl = (void *)&eq->desc[0]; - txq->txpkts0_pkts += txp->npkt; - txq->txpkts0_wrs++; } else { cpl = flitp; - txq->txpkts1_pkts += txp->npkt; - txq->txpkts1_wrs++; } /* Checksum offload */ @@ -4619,6 +4615,14 @@ write_txpkts_wr(struct sge_txq *txq, struct fw_eth_tx_ write_gl_to_txd(txq, m, (caddr_t *)(&flitp), checkwrap); + } + + if (txp->wr_type == 0) { + txq->txpkts0_pkts += txp->npkt; + txq->txpkts0_wrs++; + } else { + txq->txpkts1_pkts += txp->npkt; + txq->txpkts1_wrs++; } txsd = &txq->sdesc[eq->pidx]; From owner-svn-src-head@freebsd.org Fri Jun 2 18:39:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29009AF955B; Fri, 2 Jun 2017 18:39:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F414D72F4A; Fri, 2 Jun 2017 18:39:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52IdsG2074483; Fri, 2 Jun 2017 18:39:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52IdrZJ074478; Fri, 2 Jun 2017 18:39:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706021839.v52IdrZJ074478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Jun 2017 18:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319507 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 18:39:55 -0000 Author: emaste Date: Fri Jun 2 18:39:53 2017 New Revision: 319507 URL: https://svnweb.freebsd.org/changeset/base/319507 Log: msdosfs: use mem{cpy,move,set} instead of bcopy,bzero This somewhat simplifies use of msdosfs code in userland (for makefs), reduces diffs with NetBSD and is standard C as of C89. Reviewed by: imp MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11014 Modified: head/sys/fs/msdosfs/denode.h head/sys/fs/msdosfs/msdosfs_conv.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_fat.c head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/denode.h ============================================================================== --- head/sys/fs/msdosfs/denode.h Fri Jun 2 17:57:27 2017 (r319506) +++ head/sys/fs/msdosfs/denode.h Fri Jun 2 18:39:53 2017 (r319507) @@ -179,7 +179,7 @@ struct denode { #define DE_INTERNALIZE32(dep, dp) \ ((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16) #define DE_INTERNALIZE(dep, dp) \ - (bcopy((dp)->deName, (dep)->de_Name, 11), \ + (memcpy((dep)->de_Name, (dp)->deName, 11), \ (dep)->de_Attributes = (dp)->deAttributes, \ (dep)->de_LowerCase = (dp)->deLowerCase, \ (dep)->de_CHun = (dp)->deCHundredth, \ @@ -193,7 +193,7 @@ struct denode { (FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0)) #define DE_EXTERNALIZE(dp, dep) \ - (bcopy((dep)->de_Name, (dp)->deName, 11), \ + (memcpy((dp)->deName, (dep)->de_Name, 11), \ (dp)->deAttributes = (dep)->de_Attributes, \ (dp)->deLowerCase = (dep)->de_LowerCase, \ (dp)->deCHundredth = (dep)->de_CHun, \ Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Fri Jun 2 17:57:27 2017 (r319506) +++ head/sys/fs/msdosfs/msdosfs_conv.c Fri Jun 2 18:39:53 2017 (r319507) @@ -536,7 +536,7 @@ unix2winfn(const u_char *un, size_t unlen, struct wine /* * Initialize winentry to some useful default */ - for (wcp = (uint8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff); + memset(wep, 0xff, sizeof(*wep)); wep->weCnt = cnt; wep->weAttributes = ATTR_WIN95; wep->weReserved1 = 0; @@ -1043,11 +1043,11 @@ mbnambuf_write(struct mbnambuf *nbp, char *name, int i sizeof(nbp->nb_buf)) return (ENAMETOOLONG); - bcopy(slot + WIN_CHARS, slot + count, nbp->nb_len); + memmove(slot + count, slot + WIN_CHARS, nbp->nb_len); } /* Copy in the substring to its slot and update length so far. */ - bcopy(name, slot, count); + memcpy(slot, name, count); nbp->nb_len = newlen; nbp->nb_last_id = id; @@ -1069,7 +1069,7 @@ mbnambuf_flush(struct mbnambuf *nbp, struct dirent *dp mbnambuf_init(nbp); return (NULL); } - bcopy(&nbp->nb_buf[0], dp->d_name, nbp->nb_len); + memcpy(dp->d_name, &nbp->nb_buf[0], nbp->nb_len); dp->d_name[nbp->nb_len] = '\0'; dp->d_namlen = nbp->nb_len; Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Fri Jun 2 17:57:27 2017 (r319506) +++ head/sys/fs/msdosfs/msdosfs_denode.c Fri Jun 2 18:39:53 2017 (r319507) @@ -410,7 +410,7 @@ detrunc(struct denode *dep, u_long length, int flags, #endif return (error); } - bzero(bp->b_data + boff, pmp->pm_bpcluster - boff); + memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); if (flags & IO_SYNC) bwrite(bp); else Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Fri Jun 2 17:57:27 2017 (r319506) +++ head/sys/fs/msdosfs/msdosfs_fat.c Fri Jun 2 18:39:53 2017 (r319507) @@ -335,7 +335,7 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u /* getblk() never fails */ bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0, 0); - bcopy(bp->b_data, bpn->b_data, bp->b_bcount); + memcpy(bpn->b_data, bp->b_data, bp->b_bcount); /* Force the clean bit on in the other copies. */ if (cleanfat == 16) ((uint8_t *)bpn->b_data)[3] |= 0x80; Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Jun 2 17:57:27 2017 (r319506) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Jun 2 18:39:53 2017 (r319507) @@ -165,7 +165,7 @@ msdosfs_create(struct vop_create_args *ap) if ((cnp->cn_flags & HASBUF) == 0) panic("msdosfs_create: no name"); #endif - bzero(&ndirent, sizeof(ndirent)); + memset(&ndirent, 0, sizeof(ndirent)); error = uniqdosname(pdep, cnp, ndirent.de_Name); if (error) goto bad; @@ -1156,13 +1156,13 @@ abortit: * we moved a directory, then update its .. entry to point * to the new parent directory. */ - bcopy(ip->de_Name, oldname, 11); - bcopy(toname, ip->de_Name, 11); /* update denode */ + memcpy(oldname, ip->de_Name, 11); + memcpy(ip->de_Name, toname, 11); /* update denode */ dp->de_fndoffset = to_diroffset; dp->de_fndcnt = to_count; error = createde(ip, dp, (struct denode **)0, tcnp); if (error) { - bcopy(oldname, ip->de_Name, 11); + memcpy(ip->de_Name, oldname, 11); if (newparent) VOP_UNLOCK(fdvp, 0); VOP_UNLOCK(fvp, 0); @@ -1178,7 +1178,7 @@ abortit: * to pass the correct name to createde(). Undo this. */ if ((ip->de_Attributes & ATTR_DIRECTORY) != 0) - bcopy(oldname, ip->de_Name, 11); + memcpy(ip->de_Name, oldname, 11); ip->de_refcnt++; zp->de_fndoffset = from_diroffset; error = removede(zp, ip); @@ -1324,7 +1324,7 @@ msdosfs_mkdir(struct vop_mkdir_args *ap) if (error) goto bad2; - bzero(&ndirent, sizeof(ndirent)); + memset(&ndirent, 0, sizeof(ndirent)); ndirent.de_pmp = pmp; ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE; getnanotime(&ts); @@ -1338,8 +1338,8 @@ msdosfs_mkdir(struct vop_mkdir_args *ap) bn = cntobn(pmp, newcluster); /* always succeeds */ bp = getblk(pmp->pm_devvp, bn, pmp->pm_bpcluster, 0, 0, 0); - bzero(bp->b_data, pmp->pm_bpcluster); - bcopy(&dosdirtemplate, bp->b_data, sizeof dosdirtemplate); + memset(bp->b_data, 0, pmp->pm_bpcluster); + memcpy(bp->b_data, &dosdirtemplate, sizeof dosdirtemplate); denp = (struct direntry *)bp->b_data; putushort(denp[0].deStartCluster, newcluster); putushort(denp[0].deCDate, ndirent.de_CDate); @@ -1504,7 +1504,7 @@ msdosfs_readdir(struct vop_readdir_args *ap) /* * To be safe, initialize dirbuf */ - bzero(dirbuf.d_name, sizeof(dirbuf.d_name)); + memset(dirbuf.d_name, 0, sizeof(dirbuf.d_name)); /* * If the user buffer is smaller than the size of one dos directory From owner-svn-src-head@freebsd.org Fri Jun 2 19:40:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 934E1AFA3C5 for ; Fri, 2 Jun 2017 19:40:35 +0000 (UTC) (envelope-from 0100015c6a52c2bd-bd20846f-2206-411a-9488-38aeec23acbf-000000@amazonses.com) Received: from a8-13.smtp-out.amazonses.com (a8-13.smtp-out.amazonses.com [54.240.8.13]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 574F674F06 for ; Fri, 2 Jun 2017 19:40:35 +0000 (UTC) (envelope-from 0100015c6a52c2bd-bd20846f-2206-411a-9488-38aeec23acbf-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1496432428; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=0mVBrsGAyI7XcG2eK0US9wzIHW2/7FBUZJzaf4f2U/c=; b=uTLccF0lQAjb8dY3HOYz0NFf0sNz6Irq4dWU/VeNgjdjAlKq1L4ty5IAVvASKFSn gCJZdNl6OJkqJJi51KrBhWSoPMqK7Su/DeMemw+QNRRhNxRvyQ3rJFoAFBkUH9Mly1p 0UbVie3j2/qCTe+0K357UtQk0Zyxg44FBaDULEiE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1496432428; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=0mVBrsGAyI7XcG2eK0US9wzIHW2/7FBUZJzaf4f2U/c=; b=iyRgl1VzCpXC6upD3vKiBvAYKAX64/uVrWAhIMi9msiJoTPj8HXG5+m5vR8twSbQ 0QxY9Pql1nBnybUcCma3Y/cZTCm6L9XrckQ/k1SBKbp1EntJ4qeFgv/C3wzy6qYij0/ DdE1nXB1kjIvUvjKRMfby3z32O0c9q+u9JsftEvY= Subject: Re: svn commit: r319491 - head/sys/dev/xen/netfront To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <201706020703.v5273V5A085287@repo.freebsd.org> <20170602102922.stlu47ceumggu6o7@dhcp-3-128.uk.xensource.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <0100015c6a52c2bd-bd20846f-2206-411a-9488-38aeec23acbf-000000@email.amazonses.com> Date: Fri, 2 Jun 2017 19:40:27 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170602102922.stlu47ceumggu6o7@dhcp-3-128.uk.xensource.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-SES-Outgoing: 2017.06.02-54.240.8.13 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 19:40:35 -0000 On 06/02/17 03:29, Roger Pau Monn� wrote: > On Fri, Jun 02, 2017 at 07:03:31AM +0000, Colin Percival wrote: >> Skip setting the MTU in the netfront driver (xn# devices) if the new MTU >> is the same as the old MTU. [...] >> Maintainers of other network interface drivers may wish to consider making >> the corresponding change; the handling of SIOCSIFMTU does not seem to >> exhibit a great deal of consistency between drivers. > > Is there any reason this check (ifp->if_mtu == ifr->ifr_mtu) is not > done at a higher level for all the drivers? It seems pointless to add > this chunk everywhere. I wondered about that. Some drivers already do this (if_sk, if_age, if_jme, if_tx, if_bge, if_vge, ...) but every driver seems to spell it differently; and many drivers do things beyond merely recording the new value and re-initializing. I certainly have no objection to seeing a more generic handling of interface MTU setting, but I don't know enough about the network stack to do this myself. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Fri Jun 2 20:25:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D484FAFAEA2; Fri, 2 Jun 2017 20:25:26 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A370176527; Fri, 2 Jun 2017 20:25:26 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52KPPW8020225; Fri, 2 Jun 2017 20:25:25 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52KPPuT020224; Fri, 2 Jun 2017 20:25:25 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201706022025.v52KPPuT020224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 2 Jun 2017 20:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319508 - head/usr.bin/last X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 20:25:26 -0000 Author: stevek Date: Fri Jun 2 20:25:25 2017 New Revision: 319508 URL: https://svnweb.freebsd.org/changeset/base/319508 Log: Fix a memory leak with last free memory allocated to 'buf' Submitted by: Thomas Rix Reviewed by: ed Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9850 Modified: head/usr.bin/last/last.c Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Fri Jun 2 18:39:53 2017 (r319507) +++ head/usr.bin/last/last.c Fri Jun 2 20:25:25 2017 (r319508) @@ -243,7 +243,7 @@ wtmp(void) /* Display them in reverse order. */ while (amount > 0) doentry(&buf[--amount]); - + free(buf); tm = localtime(&t); (void) strftime(ct, sizeof(ct), "%+", tm); printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct); From owner-svn-src-head@freebsd.org Fri Jun 2 22:35:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DCD5AFC725; Fri, 2 Jun 2017 22:35:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A20A792FD; Fri, 2 Jun 2017 22:35:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52MZIYj072442; Fri, 2 Jun 2017 22:35:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52MZI2b072440; Fri, 2 Jun 2017 22:35:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706022235.v52MZI2b072440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Jun 2017 22:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319509 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 22:35:19 -0000 Author: jhb Date: Fri Jun 2 22:35:18 2017 New Revision: 319509 URL: https://svnweb.freebsd.org/changeset/base/319509 Log: Decode the argument passed to cap_getmode(). The returned integer value is output. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Fri Jun 2 20:25:25 2017 (r319508) +++ head/usr.bin/truss/syscall.h Fri Jun 2 22:35:18 2017 (r319509) @@ -48,7 +48,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, - Sockoptname, Msgflags, CapRights, + Sockoptname, Msgflags, CapRights, PUInt, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Fri Jun 2 20:25:25 2017 (r319508) +++ head/usr.bin/truss/syscalls.c Fri Jun 2 22:35:18 2017 (r319509) @@ -99,6 +99,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } }, { .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights, 1 } } }, + { .name = "cap_getmode", .ret_type = 1, .nargs = 1, + .args = { { PUInt | OUT, 0 } } }, { .name = "cap_rights_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapRights, 1 } } }, { .name = "chdir", .ret_type = 1, .nargs = 1, @@ -1190,6 +1192,16 @@ print_arg(struct syscall_args *sc, unsigned long *args case UInt: fprintf(fp, "%u", (unsigned int)args[sc->offset]); break; + case PUInt: { + unsigned int val; + + if (get_struct(pid, (void *)args[sc->offset], &val, + sizeof(val)) == 0) + fprintf(fp, "{ %u }", val); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case LongHex: fprintf(fp, "0x%lx", args[sc->offset]); break; From owner-svn-src-head@freebsd.org Sat Jun 3 02:42:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99D76B7BBE3; Sat, 3 Jun 2017 02:42:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 662CC7FFAC; Sat, 3 Jun 2017 02:42:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v532gnXG072042; Sat, 3 Jun 2017 02:42:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v532gni4072040; Sat, 3 Jun 2017 02:42:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706030242.v532gni4072040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Jun 2017 02:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319510 - head/contrib/xz/src/liblzma/check X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 02:42:50 -0000 Author: emaste Date: Sat Jun 3 02:42:49 2017 New Revision: 319510 URL: https://svnweb.freebsd.org/changeset/base/319510 Log: xz: set noexec stack flag on FreeBSD Will also be proposed upstream. Reviewed by: delphij Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11033 Modified: head/contrib/xz/src/liblzma/check/crc32_x86.S head/contrib/xz/src/liblzma/check/crc64_x86.S Modified: head/contrib/xz/src/liblzma/check/crc32_x86.S ============================================================================== --- head/contrib/xz/src/liblzma/check/crc32_x86.S Fri Jun 2 22:35:18 2017 (r319509) +++ head/contrib/xz/src/liblzma/check/crc32_x86.S Sat Jun 3 02:42:49 2017 (r319510) @@ -299,6 +299,6 @@ LZMA_CRC32: * use __linux__ here, but I don't know a way to detect when * we are using GNU assembler. */ -#if defined(__ELF__) && defined(__linux__) +#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__)) .section .note.GNU-stack,"",@progbits #endif Modified: head/contrib/xz/src/liblzma/check/crc64_x86.S ============================================================================== --- head/contrib/xz/src/liblzma/check/crc64_x86.S Fri Jun 2 22:35:18 2017 (r319509) +++ head/contrib/xz/src/liblzma/check/crc64_x86.S Sat Jun 3 02:42:49 2017 (r319510) @@ -282,6 +282,6 @@ LZMA_CRC64: * use __linux__ here, but I don't know a way to detect when * we are using GNU assembler. */ -#if defined(__ELF__) && defined(__linux__) +#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__)) .section .note.GNU-stack,"",@progbits #endif From owner-svn-src-head@freebsd.org Sat Jun 3 03:40:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3736FB7E525; Sat, 3 Jun 2017 03:40:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02BCF82449; Sat, 3 Jun 2017 03:40:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v533eCql093538; Sat, 3 Jun 2017 03:40:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v533eBR5093536; Sat, 3 Jun 2017 03:40:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706030340.v533eBR5093536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Jun 2017 03:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319513 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 03:40:13 -0000 Author: emaste Date: Sat Jun 3 03:40:11 2017 New Revision: 319513 URL: https://svnweb.freebsd.org/changeset/base/319513 Log: linux vdso: pass -fPIC to the assembler, not linker -fPIC has no effect on linking although it seems to be ignored by GNU ld.bfd. However, it causes ld.lld to terminate with an invalid argument error. This is equivalent to r296057 but for the kernel (not modules) case. MFC after: 2 months Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Jun 3 03:15:57 2017 (r319512) +++ head/sys/conf/files.amd64 Sat Jun 3 03:40:11 2017 (r319513) @@ -46,7 +46,7 @@ linux32_assym.h optional compat_linux32 \ # linux32_locore.o optional compat_linux32 \ dependency "linux32_assym.h $S/amd64/linux32/linux32_locore.s" \ - compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux32_locore.o" # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Jun 3 03:15:57 2017 (r319512) +++ head/sys/conf/files.i386 Sat Jun 3 03:40:11 2017 (r319513) @@ -33,7 +33,7 @@ linux_assym.h optional compat_linux \ # linux_locore.o optional compat_linux \ dependency "linux_assym.h $S/i386/linux/linux_locore.s" \ - compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux_locore.o" # From owner-svn-src-head@freebsd.org Sat Jun 3 07:38:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55459B95A4B; Sat, 3 Jun 2017 07:38:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id CC0E134C6; Sat, 3 Jun 2017 07:38:28 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 9AA22425C28; Sat, 3 Jun 2017 17:05:33 +1000 (AEST) Date: Sat, 3 Jun 2017 17:05:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319507 - head/sys/fs/msdosfs In-Reply-To: <201706021839.v52IdrZJ074478@repo.freebsd.org> Message-ID: <20170603161546.D939@besplex.bde.org> References: <201706021839.v52IdrZJ074478@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=GCT6H45XDI6av1AEreMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 07:38:29 -0000 On Fri, 2 Jun 2017, Ed Maste wrote: > Log: > msdosfs: use mem{cpy,move,set} instead of bcopy,bzero > > This somewhat simplifies use of msdosfs code in userland (for makefs), > reduces diffs with NetBSD and is standard C as of C89. This is a style bug in the kernel. The kernel should use the standard BSD functions bcopy() and bzero(). bzero() is better designed than memset() for zeroing. bcopy() is essentially the same as memmove(), but is implemented more optimally (the non-use of memmove() in the kernel used to be implememented by by not having it, but someone broke this by adding an memmove() wrapper which is an extern function that calls bcopy(). This is even slower than the inline wrappers used to break intentionally leaving out some of the other functions). memcpy() became a non-style-bug in the kernel when dg optimized some networking code by using it. It was supposed to be used only for small fixed-sized copies when the compiler can and does inlines it. The extern memcpy() unfortunately had to be implemented so that compiling with -O0 (which turns off inlining) is used, so that the code doesn't need ifdefs for -O0. This became nonsense when -ffreestanding killed inlining of all Standard C functions. The slow support function for -O0 is used in all cases where memcpy() is used. It turns out to be not very slow, at least on x86. On x86, it was never optimized like bcopy() was, but the optimizations for bcopy() were very MD and are now not attempted, so memcpy() is now just bcopy() with the support for overlapping copies removed, so is slightly faster. On newer x86, "rep movs[any]" is as fast as anything for large copies, but has a large startup overhead so is a bad method for small copies, but is used in all cases. Compiler inlines wouldn't use it for small copies, but the threshold for using it is very MD so always using it is not too bad as a default. memset() has a bad inline implementation. It just calls bzero() when the fill byte is zero. Otherwise, it slowly stores 1 byte per iteration. memset() is also extern in libkern with the same bad implementation, and and it takes complicated macros to get the inline version. memcmp() used to have a worse inline implementation that wrapped bcmp(). This was broken since bcmp() is boolean while memcmp() is 3-state. This has been fixed by using the extern libkern version which is a copy of the generic libc version. Except it is a bug for memcmp() to exist in the kernel. > Modified: head/sys/fs/msdosfs/msdosfs_conv.c > ============================================================================== > --- head/sys/fs/msdosfs/msdosfs_conv.c Fri Jun 2 17:57:27 2017 (r319506) > +++ head/sys/fs/msdosfs/msdosfs_conv.c Fri Jun 2 18:39:53 2017 (r319507) > @@ -536,7 +536,7 @@ unix2winfn(const u_char *un, size_t unlen, struct wine > /* > * Initialize winentry to some useful default > */ > - for (wcp = (uint8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff); > + memset(wep, 0xff, sizeof(*wep)); > wep->weCnt = cnt; > wep->weAttributes = ATTR_WIN95; > wep->weReserved1 = 0; memset() uses the same slow loop as the old inline code. Unfortunately, there is no bset() function in the bcopy family, so the unusual case of setting to nonzero had to be handled inline. Bruce From owner-svn-src-head@freebsd.org Sat Jun 3 10:38:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D11EBEEE1E; Sat, 3 Jun 2017 10:38:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0661A670C2; Sat, 3 Jun 2017 10:38:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53AcgVt064128; Sat, 3 Jun 2017 10:38:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53Acg0G064126; Sat, 3 Jun 2017 10:38:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031038.v53Acg0G064126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 10:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319514 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 10:38:43 -0000 Author: andrew Date: Sat Jun 3 10:38:41 2017 New Revision: 319514 URL: https://svnweb.freebsd.org/changeset/base/319514 Log: Mark the non-INTRNG armv6 configs with NO_UNIVERSE to prepare for INTRNG being always enabled on armv6. Modified: head/sys/arm/conf/AML8726 head/sys/arm/conf/ARMADAXP Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Sat Jun 3 03:40:11 2017 (r319513) +++ head/sys/arm/conf/AML8726 Sat Jun 3 10:38:41 2017 (r319514) @@ -18,6 +18,9 @@ # # $FreeBSD$ +# TODO: Port to INTRNG +#NO_UNIVERSE + ident AML8726 include "std.armv6" Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sat Jun 3 03:40:11 2017 (r319513) +++ head/sys/arm/conf/ARMADAXP Sat Jun 3 10:38:41 2017 (r319514) @@ -18,6 +18,9 @@ # # $FreeBSD$ +# TODO: Port to INTRNG +#NO_UNIVERSE + ident MV-88F78XX0 include "std.armv6" From owner-svn-src-head@freebsd.org Sat Jun 3 10:40:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1624BEEECC; Sat, 3 Jun 2017 10:40:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BB90672D8; Sat, 3 Jun 2017 10:40:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53Aejk1064914; Sat, 3 Jun 2017 10:40:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53AejVP064913; Sat, 3 Jun 2017 10:40:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031040.v53AejVP064913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 10:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319515 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 10:40:46 -0000 Author: andrew Date: Sat Jun 3 10:40:45 2017 New Revision: 319515 URL: https://svnweb.freebsd.org/changeset/base/319515 Log: Make it an error to build armv6 without INTRNG enabled. Most kernel configs have been updated for this, with the exception of the two marked as NO_UNIVERSE in r319514. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Jun 3 10:38:41 2017 (r319514) +++ head/sys/arm/arm/machdep.c Sat Jun 3 10:40:45 2017 (r319515) @@ -103,6 +103,10 @@ __FBSDID("$FreeBSD$"); #error FreeBSD/arm doesn't provide compatibility with releases prior to 10 #endif +#if __ARM_ARCH >= 6 && !defined(INTRNG) +#error armv6 requires INTRNG +#endif + struct pcpu __pcpu[MAXCPU]; struct pcpu *pcpup = &__pcpu[0]; From owner-svn-src-head@freebsd.org Sat Jun 3 13:13:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47FEBF15FE; Sat, 3 Jun 2017 13:13:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 917EB6EED2; Sat, 3 Jun 2017 13:13:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53DDvo9028428; Sat, 3 Jun 2017 13:13:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53DDvCp028427; Sat, 3 Jun 2017 13:13:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706031313.v53DDvCp028427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Jun 2017 13:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319516 - head/contrib/compiler-rt/lib/tsan/rtl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 13:13:58 -0000 Author: emaste Date: Sat Jun 3 13:13:57 2017 New Revision: 319516 URL: https://svnweb.freebsd.org/changeset/base/319516 Log: tsan: set noexec stack on aarch64 This may be refined upstream. Reviewed by: dim MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11034 Modified: head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Modified: head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S ============================================================================== --- head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Sat Jun 3 10:40:45 2017 (r319515) +++ head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Sat Jun 3 13:13:57 2017 (r319516) @@ -252,7 +252,7 @@ __sigsetjmp: CFI_ENDPROC .size __sigsetjmp, .-__sigsetjmp -#if defined(__linux__) +#if defined(__FreeBSD__) || defined(__linux__) /* We do not need executable stack. */ .section .note.GNU-stack,"",@progbits #endif From owner-svn-src-head@freebsd.org Sat Jun 3 14:10:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32ACABF2238; Sat, 3 Jun 2017 14:10:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F162470A56; Sat, 3 Jun 2017 14:10:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53EA9dN050219; Sat, 3 Jun 2017 14:10:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53EA9V1050218; Sat, 3 Jun 2017 14:10:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706031410.v53EA9V1050218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Jun 2017 14:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319517 - head/lib/libsysdecode X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 14:10:11 -0000 Author: jhb Date: Sat Jun 3 14:10:09 2017 New Revision: 319517 URL: https://svnweb.freebsd.org/changeset/base/319517 Log: Add a cross-reference to sysdecode_socket_protocol(3). Modified: head/lib/libsysdecode/sysdecode.3 Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Sat Jun 3 13:13:57 2017 (r319516) +++ head/lib/libsysdecode/sysdecode.3 Sat Jun 3 14:10:09 2017 (r319517) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd June 3, 2017 .Dt SYSDECODE 3 .Os .Sh NAME @@ -76,6 +76,7 @@ A placeholder for use when the ABI is not known. .Xr sysdecode_mask 3 , .Xr sysdecode_quotactl_cmd 3 , .Xr sysdecode_sigcode 3 , +.Xr sysdecode_socket_protocol 3 , .Xr sysdecode_sockopt_name 3 , .Xr sysdecode_syscallnames 3 , .Xr sysdecode_utrace 3 From owner-svn-src-head@freebsd.org Sat Jun 3 14:12:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E62BF2427; Sat, 3 Jun 2017 14:12:18 +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 82BBC70E71; Sat, 3 Jun 2017 14:12:18 +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 v53ECH1U054030; Sat, 3 Jun 2017 14:12:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53ECHoW054029; Sat, 3 Jun 2017 14:12:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706031412.v53ECHoW054029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Jun 2017 14:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319518 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 14:12:18 -0000 Author: kib Date: Sat Jun 3 14:12:17 2017 New Revision: 319518 URL: https://svnweb.freebsd.org/changeset/base/319518 Log: Ensure that cached struct thread does not keep spurious td_su reference on an UFS mount point. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Jun 3 14:10:09 2017 (r319517) +++ head/sys/kern/kern_proc.c Sat Jun 3 14:12:17 2017 (r319518) @@ -226,6 +226,8 @@ proc_dtor(void *mem, int size, void *arg) #endif /* Free all OSD associated to this thread. */ osd_thread_exit(td); + td_softdep_cleanup(td); + MPASS(td->td_su == NULL); /* Make sure all thread destructors are executed */ EVENTHANDLER_INVOKE(thread_dtor, td); From owner-svn-src-head@freebsd.org Sat Jun 3 14:15:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 212CFBF24E5; Sat, 3 Jun 2017 14:15:16 +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 D2E717101C; Sat, 3 Jun 2017 14:15: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 v53EFEeV054172; Sat, 3 Jun 2017 14:15:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53EFETM054171; Sat, 3 Jun 2017 14:15:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706031415.v53EFETM054171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Jun 2017 14:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319519 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 14:15:16 -0000 Author: kib Date: Sat Jun 3 14:15:14 2017 New Revision: 319519 URL: https://svnweb.freebsd.org/changeset/base/319519 Log: Clean possible td_su reference on the struct mount being unmounted as the last step of ffs_unmount(). It is possible that the mount point is recorded for cleanup in AST context while softdep flush is executed during unmount. The workitems are flushed by other means for the unmount, but the stray reference to struct mount blocks destruction of mount. Check for the situation and manually call vfs_rel() before returning from ffs_unmount(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Jun 3 14:12:17 2017 (r319518) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Jun 3 14:15:14 2017 (r319519) @@ -1319,6 +1319,10 @@ ffs_unmount(mp, mntflags) MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; MNT_IUNLOCK(mp); + if (td->td_su == mp) { + td->td_su = NULL; + vfs_rel(mp); + } return (error); fail: From owner-svn-src-head@freebsd.org Sat Jun 3 14:22:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C59C9BF2837; Sat, 3 Jun 2017 14:22:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94B6E715D6; Sat, 3 Jun 2017 14:22:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53EMG4E058344; Sat, 3 Jun 2017 14:22:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53EMFGH058336; Sat, 3 Jun 2017 14:22:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706031422.v53EMFGH058336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Jun 2017 14:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319520 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 14:22:17 -0000 Author: jhb Date: Sat Jun 3 14:22:15 2017 New Revision: 319520 URL: https://svnweb.freebsd.org/changeset/base/319520 Log: Decode the 'who' argument passed to getrusage(). Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant passed as the first argument to getrusage(). Use this function in both kdump and truss to decode the first argument to getrusage(). PR: 215448 Submitted by: Anton Yuzhaninov MFC after: 1 month Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_enum.3 head/usr.bin/kdump/kdump.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Sat Jun 3 14:15:14 2017 (r319519) +++ head/lib/libsysdecode/Makefile Sat Jun 3 14:22:15 2017 (r319520) @@ -32,6 +32,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_fadvice.3 \ sysdecode_enum.3 sysdecode_fcntl_cmd.3 \ sysdecode_enum.3 sysdecode_getfsstat_mode.3 \ + sysdecode_enum.3 sysdecode_getrusage_who.3 \ sysdecode_enum.3 sysdecode_idtype.3 \ sysdecode_enum.3 sysdecode_ipproto.3 \ sysdecode_enum.3 sysdecode_kldsym_cmd.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Sat Jun 3 14:15:14 2017 (r319519) +++ head/lib/libsysdecode/flags.c Sat Jun 3 14:22:15 2017 (r319520) @@ -487,6 +487,13 @@ sysdecode_getfsstat_mode(int mode) } const char * +sysdecode_getrusage_who(int who) +{ + + return (lookup_value(rusage, who)); +} + +const char * sysdecode_kldsym_cmd(int cmd) { Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Sat Jun 3 14:15:14 2017 (r319519) +++ head/lib/libsysdecode/mktables Sat Jun 3 14:22:15 2017 (r319520) @@ -114,6 +114,7 @@ gen_table "quotactlcmds" "Q_[A-Z]+[[:space:]]+0x[0- gen_table "rebootopt" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h" gen_table "rforkflags" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h" gen_table "rlimit" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" +gen_table "rusage" "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" "sys/resource.h" gen_table "schedpolicy" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" gen_table "sendfileflags" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" gen_table "shmatflags" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Sat Jun 3 14:15:14 2017 (r319519) +++ head/lib/libsysdecode/sysdecode.h Sat Jun 3 14:22:15 2017 (r319520) @@ -55,6 +55,7 @@ bool sysdecode_filemode(FILE *_fp, int _mode, int *_re bool sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem); int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error); const char *sysdecode_getfsstat_mode(int _mode); +const char *sysdecode_getrusage_who(int _who); const char *sysdecode_idtype(int _idtype); const char *sysdecode_ioctlname(unsigned long _val); const char *sysdecode_ipproto(int _protocol); Modified: head/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_enum.3 Sat Jun 3 14:15:14 2017 (r319519) +++ head/lib/libsysdecode/sysdecode_enum.3 Sat Jun 3 14:22:15 2017 (r319520) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd June 3, 2017 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nm sysdecode_fadvice , .Nm sysdecode_fcntl_cmd , .Nm sysdecode_getfsstat_mode , +.Nm sysdecode_getrusage_who , .Nm sysdecode_idtype , .Nm sysdecode_ipproto , .Nm sysdecode_kldsym_cmd , @@ -89,6 +90,8 @@ .Ft const char * .Fn sysdecode_getfsstat_mode "int mode" .Ft const char * +.Fn sysdecode_getrusage_who "int who" +.Ft const char * .Fn sysdecode_idtype "int idtype" .Ft const char * .Fn sysdecode_ipproto "int protocol" @@ -188,6 +191,7 @@ Most of these functions decode an argument passed to a .It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request .It Fn sysdecode_rlimit Ta Xr getrlimit 2 Ta Fa resource .It Fn sysdecode_rtprio_function Ta Xr rtprio 2 Ta Fa function +.It Fn sysdecode_getrusage_who Ta Xr getrusage 2 Ta Fa who .It Fn sysdecode_scheduler_policy Ta Xr sched_setscheduler 2 Ta Fa policy .It Fn sysdecode_semctl_cmd Ta Xr semctl 2 Ta Fa cmd .It Fn sysdecode_shmctl_cmd Ta Xr shmctl 2 Ta Fa cmd Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Jun 3 14:15:14 2017 (r319519) +++ head/usr.bin/kdump/kdump.c Sat Jun 3 14:22:15 2017 (r319520) @@ -1190,6 +1190,13 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) narg--; c = ','; break; + case SYS_getrusage: + putchar('('); + print_integer_arg(sysdecode_getrusage_who, *ip); + ip++; + narg--; + c = ','; + break; case SYS_quotactl: print_number(ip, narg, c); putchar(','); Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Sat Jun 3 14:15:14 2017 (r319519) +++ head/usr.bin/truss/syscall.h Sat Jun 3 14:22:15 2017 (r319520) @@ -42,8 +42,8 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open, - Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, - Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, + Fcntlflag, Rusage, RusageWho, BinString, Shutdown, Resource, Rlimit, + Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long, Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Jun 3 14:15:14 2017 (r319519) +++ head/usr.bin/truss/syscalls.c Sat Jun 3 14:22:15 2017 (r319520) @@ -176,7 +176,7 @@ static struct syscall decoded_syscalls[] = { { .name = "getrlimit", .ret_type = 1, .nargs = 2, .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } }, { .name = "getrusage", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { Rusage | OUT, 1 } } }, + .args = { { RusageWho, 0 }, { Rusage | OUT, 1 } } }, { .name = "getsid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "getsockname", .ret_type = 1, .nargs = 3, @@ -1595,6 +1595,9 @@ print_arg(struct syscall_args *sc, unsigned long *args break; case Resource: print_integer_arg(sysdecode_rlimit, fp, args[sc->offset]); + break; + case RusageWho: + print_integer_arg(sysdecode_getrusage_who, fp, args[sc->offset]); break; case Pathconf: fputs(xlookup(pathconf_arg, args[sc->offset]), fp); From owner-svn-src-head@freebsd.org Sat Jun 3 14:28:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E5CBF2C0A; Sat, 3 Jun 2017 14:28:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0393071A6D; Sat, 3 Jun 2017 14:28:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53ESKte058699; Sat, 3 Jun 2017 14:28:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53ESKXx058698; Sat, 3 Jun 2017 14:28:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706031428.v53ESKXx058698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Jun 2017 14:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319521 - head/usr.sbin/makefs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 14:28:21 -0000 Author: emaste Date: Sat Jun 3 14:28:19 2017 New Revision: 319521 URL: https://svnweb.freebsd.org/changeset/base/319521 Log: makefs: rename variable for NetBSD diff reduction Modified: head/usr.sbin/makefs/ffs/buf.c Modified: head/usr.sbin/makefs/ffs/buf.c ============================================================================== --- head/usr.sbin/makefs/ffs/buf.c Sat Jun 3 14:22:15 2017 (r319520) +++ head/usr.sbin/makefs/ffs/buf.c Sat Jun 3 14:28:19 2017 (r319521) @@ -60,7 +60,7 @@ bread(struct vnode *vp, daddr_t blkno, int size, struc { off_t offset; ssize_t rv; - fsinfo_t *fsinfo = vp->fs; + fsinfo_t *fs = vp->fs; assert (bpp != NULL); @@ -68,7 +68,7 @@ bread(struct vnode *vp, daddr_t blkno, int size, struc printf("%s: blkno %lld size %d\n", __func__, (long long)blkno, size); *bpp = getblk(vp, blkno, size, 0, 0, 0); - offset = (*bpp)->b_blkno * fsinfo->sectorsize + fsinfo->offset; + offset = (*bpp)->b_blkno * fs->sectorsize + fs->offset; if (debug & DEBUG_BUF_BREAD) printf("%s: blkno %lld offset %lld bcount %ld\n", __func__, (long long)(*bpp)->b_blkno, (long long) offset, From owner-svn-src-head@freebsd.org Sat Jun 3 14:45:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B55BF3184; Sat, 3 Jun 2017 14:45:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 518497259C; Sat, 3 Jun 2017 14:45:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53EjkCo067200; Sat, 3 Jun 2017 14:45:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53EjkGH067199; Sat, 3 Jun 2017 14:45:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031445.v53EjkGH067199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 14:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319522 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 14:45:47 -0000 Author: andrew Date: Sat Jun 3 14:45:46 2017 New Revision: 319522 URL: https://svnweb.freebsd.org/changeset/base/319522 Log: Remove RT1310 from universe as it fails to build. Modified: head/sys/arm/conf/RT1310 Modified: head/sys/arm/conf/RT1310 ============================================================================== --- head/sys/arm/conf/RT1310 Sat Jun 3 14:28:19 2017 (r319521) +++ head/sys/arm/conf/RT1310 Sat Jun 3 14:45:46 2017 (r319522) @@ -3,6 +3,8 @@ # # $FreeBSD$ # +# TODO: This fails to build under universe, irnore it until it's fixed +#NO_UNIVERSE ident RT1310 include "std.arm" From owner-svn-src-head@freebsd.org Sat Jun 3 15:39:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36B2ABF419C; Sat, 3 Jun 2017 15:39:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F18787487D; Sat, 3 Jun 2017 15:39:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FdOVp088391; Sat, 3 Jun 2017 15:39:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FdNuD088387; Sat, 3 Jun 2017 15:39:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031539.v53FdNuD088387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 15:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319535 - in head/sys/arm: conf freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:39:25 -0000 Author: andrew Date: Sat Jun 3 15:39:23 2017 New Revision: 319535 URL: https://svnweb.freebsd.org/changeset/base/319535 Log: Enable MULTIDELAY in the i.MX5 kernel configs. This will help adding them to GENERIC. Modified: head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53 head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Sat Jun 3 15:21:33 2017 (r319534) +++ head/sys/arm/conf/EFIKA_MX Sat Jun 3 15:39:23 2017 (r319535) @@ -31,6 +31,7 @@ options SCHED_4BSD # 4BSD scheduler #options MD_ROOT # MD is a potential root device #options NFSD # Network Filesystem Server options PLATFORM +options MULTIDELAY options INCLUDE_CONFIG_FILE # Include this file in kernel # NFS root from boopt/dhcp Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Sat Jun 3 15:21:33 2017 (r319534) +++ head/sys/arm/conf/IMX53 Sat Jun 3 15:39:23 2017 (r319535) @@ -28,6 +28,7 @@ options SOC_IMX53 options SCHED_4BSD # 4BSD scheduler #options NFSD # Network Filesystem Server options PLATFORM +options MULTIDELAY options INCLUDE_CONFIG_FILE # Include this file in kernel # kernel/memory size reduction Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Sat Jun 3 15:21:33 2017 (r319534) +++ head/sys/arm/freescale/imx/imx51_machdep.c Sat Jun 3 15:39:23 2017 (r319535) @@ -99,4 +99,4 @@ static platform_method_t imx51_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 0); +FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 100); Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Sat Jun 3 15:21:33 2017 (r319534) +++ head/sys/arm/freescale/imx/imx53_machdep.c Sat Jun 3 15:39:23 2017 (r319535) @@ -95,5 +95,4 @@ static platform_method_t imx53_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 0); - +FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 100); From owner-svn-src-head@freebsd.org Sat Jun 3 15:40:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94254BF428E; Sat, 3 Jun 2017 15:40:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FEC074AC6; Sat, 3 Jun 2017 15:40:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FeYgm088495; Sat, 3 Jun 2017 15:40:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FeYvR088494; Sat, 3 Jun 2017 15:40:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031540.v53FeYvR088494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 15:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319536 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:40:35 -0000 Author: andrew Date: Sat Jun 3 15:40:34 2017 New Revision: 319536 URL: https://svnweb.freebsd.org/changeset/base/319536 Log: Add MULTIDELAY to the Beaglebone kenrel config to help moving it to GENERIC. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sat Jun 3 15:39:23 2017 (r319535) +++ head/sys/arm/conf/BEAGLEBONE Sat Jun 3 15:40:34 2017 (r319536) @@ -29,6 +29,7 @@ include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x am335x_dmtpps" options INTRNG +options MULTIDELAY options SCHED_4BSD # 4BSD scheduler options PLATFORM From owner-svn-src-head@freebsd.org Sat Jun 3 15:48:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64DF4BF45A9; Sat, 3 Jun 2017 15:48:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 395EB74F34; Sat, 3 Jun 2017 15:48:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53Fm3IJ092555; Sat, 3 Jun 2017 15:48:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53Fm3tG092554; Sat, 3 Jun 2017 15:48:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031548.v53Fm3tG092554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 15:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319537 - head/sys/arm/versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:48:05 -0000 Author: andrew Date: Sat Jun 3 15:48:03 2017 New Revision: 319537 URL: https://svnweb.freebsd.org/changeset/base/319537 Log: Add MULTIDELAY support to the sp804 driver. Modified: head/sys/arm/versatile/sp804.c Modified: head/sys/arm/versatile/sp804.c ============================================================================== --- head/sys/arm/versatile/sp804.c Sat Jun 3 15:40:34 2017 (r319536) +++ head/sys/arm/versatile/sp804.c Sat Jun 3 15:48:03 2017 (r319537) @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef MULTIDELAY +#include /* For arm_set_delay */ +#endif + #include #include #include @@ -109,6 +113,7 @@ struct sp804_timer_softc { bus_space_write_4(sc->bst, sc->bsh, reg, val) static unsigned sp804_timer_tc_get_timecount(struct timecounter *); +static void sp804_timer_delay(int, void *); static unsigned sp804_timer_tc_get_timecount(struct timecounter *tc) @@ -287,6 +292,10 @@ sp804_timer_attach(device_t dev) (sp804_timer_tc_read_4(SP804_PRIMECELL_ID0 + i*4) & 0xff); } +#ifdef MULTIDELAY + arm_set_delay(sp804_timer_delay, sc); +#endif + device_printf(dev, "PrimeCell ID: %08x\n", id); sc->timer_initialized = 1; @@ -310,11 +319,36 @@ static devclass_t sp804_timer_devclass; DRIVER_MODULE(sp804_timer, simplebus, sp804_timer_driver, sp804_timer_devclass, 0, 0); +static void +sp804_timer_delay(int usec, void *arg) +{ + struct sp804_timer_softc *sc = arg; + int32_t counts; + uint32_t first, last; + + /* Get the number of times to count */ + counts = usec * ((sc->tc.tc_frequency / 1000000) + 1); + + first = sp804_timer_tc_get_timecount(&sc->tc); + + while (counts > 0) { + last = sp804_timer_tc_get_timecount(&sc->tc); + if (last == first) + continue; + if (last > first) { + counts -= (int32_t)(last - first); + } else { + counts -= (int32_t)((0xFFFFFFFF - first) + last); + } + first = last; + } +} + +#ifndef MULTIDELAY void DELAY(int usec) { int32_t counts; - uint32_t first, last; device_t timer_dev; struct sp804_timer_softc *sc; int timer_initialized = 0; @@ -336,23 +370,8 @@ DELAY(int usec) for (counts = 200; counts > 0; counts--) /* Prevent gcc from optimizing out the loop */ cpufunc_nullop(); - return; + } else { + sp804_timer_delay(usec, sc); } - - /* Get the number of times to count */ - counts = usec * ((sc->tc.tc_frequency / 1000000) + 1); - - first = sp804_timer_tc_get_timecount(&sc->tc); - - while (counts > 0) { - last = sp804_timer_tc_get_timecount(&sc->tc); - if (last == first) - continue; - if (last>first) { - counts -= (int32_t)(last - first); - } else { - counts -= (int32_t)((0xFFFFFFFF - first) + last); - } - first = last; - } } +#endif From owner-svn-src-head@freebsd.org Sat Jun 3 15:56:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4598CBF4829; Sat, 3 Jun 2017 15:56:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A1C753B7; Sat, 3 Jun 2017 15:56:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FutI0096752; Sat, 3 Jun 2017 15:56:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FutIR096751; Sat, 3 Jun 2017 15:56:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031556.v53FutIR096751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 15:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319538 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:56:56 -0000 Author: andrew Date: Sat Jun 3 15:56:54 2017 New Revision: 319538 URL: https://svnweb.freebsd.org/changeset/base/319538 Log: Add MULTIDELAY support to the mpcore timer driver. This is needed when using this with GENERIC. While here remove the weak symbol, it doesn't seem to be needed anymore. Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sat Jun 3 15:48:03 2017 (r319537) +++ head/sys/arm/arm/mpcore_timer.c Sat Jun 3 15:56:54 2017 (r319538) @@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef MULTIDELAY +#include /* For arm_set_delay */ +#endif + #include #include #include @@ -115,6 +119,8 @@ static boolean_t arm_tmr_freq_varies; #define tmr_gbl_read_4(sc, reg) bus_read_4((sc)->gbl_mem, reg) #define tmr_gbl_write_4(sc, reg, val) bus_write_4((sc)->gbl_mem, reg, val) +static void arm_tmr_delay(int, void *); + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -431,6 +437,11 @@ arm_tmr_attach(device_t dev) if (tc_err != 0 && et_err != 0) { return (ENXIO); } + +#ifdef MULTIDELAY + arm_set_delay(arm_tmr_delay, sc); +#endif + return (0); } @@ -482,37 +493,14 @@ arm_tmr_change_frequency(uint64_t newfreq) et_change_frequency(arm_tmr_et, newfreq); } -/** - * DELAY - Delay for at least usec microseconds. - * @usec: number of microseconds to delay by - * - * This function is called all over the kernel and is suppose to provide a - * consistent delay. This function may also be called before the console - * is setup so no printf's can be called here. - * - * RETURNS: - * nothing - */ -static void __used /* Must emit function code for the weak ref below. */ -arm_tmr_DELAY(int usec) +static void +arm_tmr_delay(int usec, void *arg) { - struct arm_tmr_softc *sc; + struct arm_tmr_softc *sc = arg; int32_t counts_per_usec; int32_t counts; uint32_t first, last; - /* Check the timers are setup, if not just use a for loop for the meantime */ - if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) { - for (; usec > 0; usec--) - for (counts = 200; counts > 0; counts--) - cpufunc_nullop(); /* Prevent gcc from optimizing - * out the loop - */ - return; - } - - sc = arm_tmr_tc->tc_priv; - /* Get the number of times to count */ counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); @@ -536,10 +524,34 @@ arm_tmr_DELAY(int usec) } } -/* - * Supply a DELAY() implementation via weak linkage. A platform may want to use - * the mpcore per-cpu eventtimers but provide its own DELAY() routine, - * especially when the core frequency can change on the fly. +#ifndef MULTIDELAY +/** + * DELAY - Delay for at least usec microseconds. + * @usec: number of microseconds to delay by + * + * This function is called all over the kernel and is suppose to provide a + * consistent delay. This function may also be called before the console + * is setup so no printf's can be called here. + * + * RETURNS: + * nothing */ -__weak_reference(arm_tmr_DELAY, DELAY); +void +DELAY(int usec) +{ + struct arm_tmr_softc *sc; + int32_t counts; + /* Check the timers are setup, if not just use a for loop for the meantime */ + if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) { + for (; usec > 0; usec--) + for (counts = 200; counts > 0; counts--) + cpufunc_nullop(); /* Prevent gcc from optimizing + * out the loop + */ + } else { + sc = arm_tmr_tc->tc_priv; + arm_tmr_delay(usec, sc); + } +} +#endif From owner-svn-src-head@freebsd.org Sat Jun 3 16:18:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B0EBF4DA1; Sat, 3 Jun 2017 16:18:52 +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 3F79F75F4E; Sat, 3 Jun 2017 16:18:52 +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 v53GIpsu005433; Sat, 3 Jun 2017 16:18:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53GIpLC005431; Sat, 3 Jun 2017 16:18:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706031618.v53GIpLC005431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Jun 2017 16:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319539 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 16:18:52 -0000 Author: kib Date: Sat Jun 3 16:18:50 2017 New Revision: 319539 URL: https://svnweb.freebsd.org/changeset/base/319539 Log: Mitigate several problems with the softdep_request_cleanup() on busy host. Problems start appearing when there are several threads all doing operations on a UFS volume and the SU workqueue needs a cleanup. It is possible that each thread calling softdep_request_cleanup() owns the lock for some dirty vnode (e.g. all of them are executing mkdir(2), mknod(2), creat(2) etc) and all vnodes which must be flushed are locked by corresponding thread. Then, we get all the threads simultaneously entering softdep_request_cleanup(). There are two problems: - Several threads execute MNT_VNODE_FOREACH_ALL() loops in parallel. Due to the locking, they quickly start executing 'in phase' with the speed of the slowest thread. - Since each thread already owns the lock for a dirty vnode, other threads non-blocking attempt to lock the vnode owned by other thread fail, and loops executing without making the progress. Retry logic does not allow the situation to recover. The result is a livelock. Fix these problems by making the following changes: - Allow only one thread to enter MNT_VNODE_FOREACH_ALL() loop per mp. A new flag FLUSH_RC_ACTIVE guards the loop. - If there were failed locking attempts during the loop, abort retry even if there are still work items on the mp work list. An assumption is that the items will be cleaned when other thread either fsyncs its vnode, or unlock and allow yet another thread to make the progress. It is possible now that some calls would get undeserved ENOSPC from ffs_alloc(), because the cleanup is not aggressive enough. But I do not see how can we reliably clean up workitems if calling softdep_request_cleanup() while still owning the vnode lock. I thought about scheme where ffs_alloc() returns ERESTART and saves the retry counter somewhere in struct thread, to return to the top level, unlock the vnode and retry. But IMO the very rare (and unproven) spurious ENOSPC is not worth the complications. Reported and tested by: pho Style and comments by: mckusick Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Jun 3 15:56:54 2017 (r319538) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Jun 3 16:18:50 2017 (r319539) @@ -901,6 +901,7 @@ static int pagedep_find(struct pagedep_hashhead *, ino struct pagedep **); static void pause_timer(void *); static int request_cleanup(struct mount *, int); +static int softdep_request_cleanup_flush(struct mount *, struct ufsmount *); static void schedule_cleanup(struct mount *); static void softdep_ast_cleanup_proc(struct thread *); static int process_worklist_item(struct mount *, int, int); @@ -13274,10 +13275,9 @@ softdep_request_cleanup(fs, vp, cred, resource) { struct ufsmount *ump; struct mount *mp; - struct vnode *lvp, *mvp; long starttime; ufs2_daddr_t needed; - int error; + int error, failed_vnode; /* * If we are being called because of a process doing a @@ -13368,41 +13368,88 @@ retry: * to the worklist that we can then process to reap addition * resources. We walk the vnodes associated with the mount point * until we get the needed worklist requests that we can reap. + * + * If there are several threads all needing to clean the same + * mount point, only one is allowed to walk the mount list. + * When several threads all try to walk the same mount list, + * they end up competing with each other and often end up in + * livelock. This approach ensures that forward progress is + * made at the cost of occational ENOSPC errors being returned + * that might otherwise have been avoided. */ + error = 1; if ((resource == FLUSH_BLOCKS_WAIT && fs->fs_cstotal.cs_nbfree <= needed) || (resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 && fs->fs_cstotal.cs_nifree <= needed)) { - MNT_VNODE_FOREACH_ALL(lvp, mp, mvp) { - if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) { - VI_UNLOCK(lvp); - continue; + ACQUIRE_LOCK(ump); + if ((ump->um_softdep->sd_flags & FLUSH_RC_ACTIVE) == 0) { + ump->um_softdep->sd_flags |= FLUSH_RC_ACTIVE; + FREE_LOCK(ump); + failed_vnode = softdep_request_cleanup_flush(mp, ump); + ACQUIRE_LOCK(ump); + ump->um_softdep->sd_flags &= ~FLUSH_RC_ACTIVE; + FREE_LOCK(ump); + if (ump->softdep_on_worklist > 0) { + stat_cleanup_retries += 1; + if (!failed_vnode) + goto retry; } - if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, - curthread)) - continue; - if (lvp->v_vflag & VV_NOSYNC) { /* unlinked */ - vput(lvp); - continue; - } - (void) ffs_syncvnode(lvp, MNT_NOWAIT, 0); - vput(lvp); + } else { + FREE_LOCK(ump); + error = 0; } - lvp = ump->um_devvp; - if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { - VOP_FSYNC(lvp, MNT_NOWAIT, curthread); - VOP_UNLOCK(lvp, 0); - } - if (ump->softdep_on_worklist > 0) { - stat_cleanup_retries += 1; - goto retry; - } stat_cleanup_failures += 1; } if (time_second - starttime > stat_cleanup_high_delay) stat_cleanup_high_delay = time_second - starttime; UFS_LOCK(ump); - return (1); + return (error); +} + +/* + * Scan the vnodes for the specified mount point flushing out any + * vnodes that can be locked without waiting. Finally, try to flush + * the device associated with the mount point if it can be locked + * without waiting. + * + * We return 0 if we were able to lock every vnode in our scan. + * If we had to skip one or more vnodes, we return 1. + */ +static int +softdep_request_cleanup_flush(mp, ump) + struct mount *mp; + struct ufsmount *ump; +{ + struct thread *td; + struct vnode *lvp, *mvp; + int failed_vnode; + + failed_vnode = 0; + td = curthread; + MNT_VNODE_FOREACH_ALL(lvp, mp, mvp) { + if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) { + VI_UNLOCK(lvp); + continue; + } + if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, + td) != 0) { + failed_vnode = 1; + continue; + } + if (lvp->v_vflag & VV_NOSYNC) { /* unlinked */ + vput(lvp); + continue; + } + (void) ffs_syncvnode(lvp, MNT_NOWAIT, 0); + vput(lvp); + } + lvp = ump->um_devvp; + if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { + VOP_FSYNC(lvp, MNT_NOWAIT, td); + VOP_UNLOCK(lvp, 0); + } + return (failed_vnode); } static bool Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Sat Jun 3 15:56:54 2017 (r319538) +++ head/sys/ufs/ffs/softdep.h Sat Jun 3 16:18:50 2017 (r319539) @@ -1065,6 +1065,7 @@ struct mount_softdeps { #define FLUSH_EXIT 0x0001 /* time to exit */ #define FLUSH_CLEANUP 0x0002 /* need to clear out softdep structures */ #define FLUSH_STARTING 0x0004 /* flush thread not yet started */ +#define FLUSH_RC_ACTIVE 0x0008 /* a thread is flushing the mount point */ /* * Keep the old names from when these were in the ufsmount structure. From owner-svn-src-head@freebsd.org Sat Jun 3 16:19:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97263BF4E18; Sat, 3 Jun 2017 16:19:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6141A76096; Sat, 3 Jun 2017 16:19:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53GJXef005502; Sat, 3 Jun 2017 16:19:33 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53GJX5F005501; Sat, 3 Jun 2017 16:19:33 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706031619.v53GJX5F005501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 3 Jun 2017 16:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319540 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 16:19:34 -0000 Author: alc Date: Sat Jun 3 16:19:33 2017 New Revision: 319540 URL: https://svnweb.freebsd.org/changeset/base/319540 Log: The data type returned by vmoff() is too narrow in its range. This could break the transmission of files longer than 4 GB on 32-bit architectures. Reviewed by: glebius, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10019 Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sat Jun 3 16:18:50 2017 (r319539) +++ head/sys/kern/kern_sendfile.c Sat Jun 3 16:19:33 2017 (r319540) @@ -207,12 +207,12 @@ xfsize(int i, int n, off_t off, off_t len) /* * Helper function to get offset within object for i page. */ -static inline vm_offset_t +static inline vm_ooffset_t vmoff(int i, off_t off) { if (i == 0) - return ((vm_offset_t)off); + return ((vm_ooffset_t)off); return (trunc_page(off + i * PAGE_SIZE)); } From owner-svn-src-head@freebsd.org Sat Jun 3 16:24:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B675EBF4FE8; Sat, 3 Jun 2017 16:24:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 811F876483; Sat, 3 Jun 2017 16:24:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53GOHEr009336; Sat, 3 Jun 2017 16:24:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53GOH5x009333; Sat, 3 Jun 2017 16:24:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031624.v53GOH5x009333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 16:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319541 - in head/sys/arm: annapurna/alpine arm versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 16:24:18 -0000 Author: andrew Date: Sat Jun 3 16:24:17 2017 New Revision: 319541 URL: https://svnweb.freebsd.org/changeset/base/319541 Log: Stop making cpu_initclocks weak when using event timers. A weak symbol could be overridden in the SoC specific code, but this would break GENERIC as it is likely to be incorrect. Remove the versatile implementation of cpu_initclocks as it's unneeded. Deleted: head/sys/arm/versatile/versatile_timer.c Modified: head/sys/arm/annapurna/alpine/files.alpine head/sys/arm/arm/machdep.c head/sys/arm/versatile/files.versatile Modified: head/sys/arm/annapurna/alpine/files.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/files.alpine Sat Jun 3 16:19:33 2017 (r319540) +++ head/sys/arm/annapurna/alpine/files.alpine Sat Jun 3 16:24:17 2017 (r319541) @@ -3,7 +3,6 @@ kern/kern_clocksource.c standard arm/versatile/sp804.c standard -arm/versatile/versatile_timer.c standard dev/uart/uart_dev_ns8250.c optional uart arm/annapurna/alpine/common.c standard Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Jun 3 16:19:33 2017 (r319540) +++ head/sys/arm/arm/machdep.c Sat Jun 3 16:24:17 2017 (r319541) @@ -301,6 +301,7 @@ cpu_idle_wakeup(int cpu) return (0); } +#ifdef NO_EVENTTIMERS /* * Most ARM platforms don't need to do anything special to init their clocks * (they get intialized during normal device attachment), and by not defining a @@ -311,8 +312,14 @@ cpu_idle_wakeup(int cpu) void arm_generic_initclocks(void) { +} +__weak_reference(arm_generic_initclocks, cpu_initclocks); -#ifndef NO_EVENTTIMERS +#else +void +cpu_initclocks(void) +{ + #ifdef SMP if (PCPU_GET(cpuid) == 0) cpu_initclocks_bsp(); @@ -321,9 +328,8 @@ arm_generic_initclocks(void) #else cpu_initclocks_bsp(); #endif -#endif } -__weak_reference(arm_generic_initclocks, cpu_initclocks); +#endif #ifdef MULTIDELAY void Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Sat Jun 3 16:19:33 2017 (r319540) +++ head/sys/arm/versatile/files.versatile Sat Jun 3 16:24:17 2017 (r319541) @@ -8,6 +8,5 @@ arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci arm/versatile/versatile_scm.c standard arm/versatile/versatile_sic.c standard -arm/versatile/versatile_timer.c standard kern/kern_clocksource.c standard From owner-svn-src-head@freebsd.org Sat Jun 3 17:24:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C1BABF5D3B; Sat, 3 Jun 2017 17:24:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03B4A77AB5; Sat, 3 Jun 2017 17:24:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53HOEvC033296; Sat, 3 Jun 2017 17:24:14 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53HOEm1033295; Sat, 3 Jun 2017 17:24:14 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706031724.v53HOEm1033295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 3 Jun 2017 17:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319542 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 17:24:15 -0000 Author: alc Date: Sat Jun 3 17:24:13 2017 New Revision: 319542 URL: https://svnweb.freebsd.org/changeset/base/319542 Log: Eliminate duplication of the pmap and pv list unlock operations in pmap_enter() by implementing a single return path. Otherwise, the duplication will only increase with the upcoming support for psind == 1. Reviewed by: kib (some time ago) Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jun 3 16:24:17 2017 (r319541) +++ head/sys/amd64/amd64/pmap.c Sat Jun 3 17:24:13 2017 (r319542) @@ -4313,6 +4313,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pv_entry_t pv; vm_paddr_t opa, pa; vm_page_t mpte, om; + int rv; boolean_t nosleep; PG_A = pmap_accessed_bit(pmap); @@ -4387,10 +4388,8 @@ retry: mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va), nosleep ? NULL : &lock); if (mpte == NULL && nosleep) { - if (lock != NULL) - rw_wunlock(lock); - PMAP_UNLOCK(pmap); - return (KERN_RESOURCE_SHORTAGE); + rv = KERN_RESOURCE_SHORTAGE; + goto out; } goto retry; } else @@ -4516,10 +4515,12 @@ unchanged: vm_reserv_level_iffullpop(m) == 0) pmap_promote_pde(pmap, pde, va, &lock); + rv = KERN_SUCCESS; +out: if (lock != NULL) rw_wunlock(lock); PMAP_UNLOCK(pmap); - return (KERN_SUCCESS); + return (rv); } /* From owner-svn-src-head@freebsd.org Sat Jun 3 17:56:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBD1BF6254; Sat, 3 Jun 2017 17:56:32 +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 5C59478510; Sat, 3 Jun 2017 17:56:32 +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 v53HuV2P045505; Sat, 3 Jun 2017 17:56:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53HuVum045504; Sat, 3 Jun 2017 17:56:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706031756.v53HuVum045504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Jun 2017 17:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319543 - head/bin/dd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 17:56:32 -0000 Author: ngie Date: Sat Jun 3 17:56:31 2017 New Revision: 319543 URL: https://svnweb.freebsd.org/changeset/base/319543 Log: Stylistic tweaks Move opening braces of functions from the last column to column 0. MFC after: 18 days MFC with: r319339 Sponsored by: Dell EMC Isilon Modified: head/bin/dd/tests/dd2_test.sh Modified: head/bin/dd/tests/dd2_test.sh ============================================================================== --- head/bin/dd/tests/dd2_test.sh Sat Jun 3 17:24:13 2017 (r319542) +++ head/bin/dd/tests/dd2_test.sh Sat Jun 3 17:56:31 2017 (r319543) @@ -27,10 +27,12 @@ atf_test_case seek_overflow -seek_overflow_head() { +seek_overflow_head() +{ atf_set "descr" "dd(1) should reject too-large seek values" } -seek_overflow_body() { +seek_overflow_body() +{ touch f.in # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` From owner-svn-src-head@freebsd.org Sat Jun 3 17:59:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D36C0BF6404; Sat, 3 Jun 2017 17:59:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1C6378799; Sat, 3 Jun 2017 17:59:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53HxAV5045791; Sat, 3 Jun 2017 17:59:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53HxAEV045790; Sat, 3 Jun 2017 17:59:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706031759.v53HxAEV045790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Jun 2017 17:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319544 - head/bin/dd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 17:59:11 -0000 Author: ngie Date: Sat Jun 3 17:59:10 2017 New Revision: 319544 URL: https://svnweb.freebsd.org/changeset/base/319544 Log: Mark :seek_overflow as an expected failure MFC after: 18 days MFC with: r319339 PR: 219757 Sponsored by: Dell EMC Isilon Modified: head/bin/dd/tests/dd2_test.sh Modified: head/bin/dd/tests/dd2_test.sh ============================================================================== --- head/bin/dd/tests/dd2_test.sh Sat Jun 3 17:56:31 2017 (r319543) +++ head/bin/dd/tests/dd2_test.sh Sat Jun 3 17:59:10 2017 (r319544) @@ -33,6 +33,8 @@ seek_overflow_head() } seek_overflow_body() { + atf_expect_fail "fails with 'dd: truncating f.out: File too large' - bug 219757" + touch f.in # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` From owner-svn-src-head@freebsd.org Sat Jun 3 18:10:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59C02BF6830; Sat, 3 Jun 2017 18:10:05 +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 27ADF78DAA; Sat, 3 Jun 2017 18:10:05 +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 v53IA47b049948; Sat, 3 Jun 2017 18:10:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53IA47S049947; Sat, 3 Jun 2017 18:10:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706031810.v53IA47S049947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Jun 2017 18:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319545 - head/usr.sbin/newsyslog/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 18:10:05 -0000 Author: ngie Date: Sat Jun 3 18:10:04 2017 New Revision: 319545 URL: https://svnweb.freebsd.org/changeset/base/319545 Log: Don't execute the TODO cases in a subshell This messes up the testcase counter, as seen in bug 219756. PR: 212160, 219756 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- head/usr.sbin/newsyslog/tests/legacy_test.sh Sat Jun 3 17:59:10 2017 (r319544) +++ head/usr.sbin/newsyslog/tests/legacy_test.sh Sat Jun 3 18:10:04 2017 (r319545) @@ -380,7 +380,6 @@ tests_time_rotate() { sleep 1.1 - ( TODO="rotate time 2-4 fail today; bug 212160" begin "rotate time 2 ${name_postfix}" @@ -404,7 +403,7 @@ tests_time_rotate() { ckfe ${LOGFNAME} chkfcnt 3 ${dir}${LOGFNAME}.*${ext} end - ) + unset TODO begin "noaction ${name_postfix}" ofiles=`ls -1 ${dir}${LOGFNAME}.*${ext} | tr -d '\n'` From owner-svn-src-head@freebsd.org Sat Jun 3 18:12:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A93FBF6991; Sat, 3 Jun 2017 18:12:01 +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 48BBF78FE1; Sat, 3 Jun 2017 18:12:01 +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 v53IC0nX053803; Sat, 3 Jun 2017 18:12:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53IC0so053802; Sat, 3 Jun 2017 18:12:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706031812.v53IC0so053802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Jun 2017 18:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319546 - head/usr.sbin/newsyslog/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 18:12:01 -0000 Author: ngie Date: Sat Jun 3 18:12:00 2017 New Revision: 319546 URL: https://svnweb.freebsd.org/changeset/base/319546 Log: Fix the testplan after ^/head@r318960 The number of executed testcases is 128, not 126. MFC after: 18 days MFC with: r318960 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- head/usr.sbin/newsyslog/tests/legacy_test.sh Sat Jun 3 18:10:04 2017 (r319545) +++ head/usr.sbin/newsyslog/tests/legacy_test.sh Sat Jun 3 18:12:00 2017 (r319546) @@ -454,7 +454,7 @@ tests_rfc5424() { tmpdir_clean } -echo 1..126 +echo 1..128 mkdir -p ${TMPDIR} cd ${TMPDIR} From owner-svn-src-head@freebsd.org Sat Jun 3 18:20:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DF33BF6ADA; Sat, 3 Jun 2017 18:20:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED96C794AB; Sat, 3 Jun 2017 18:20:24 +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 v53IKOJQ054374; Sat, 3 Jun 2017 18:20:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53IKO16054373; Sat, 3 Jun 2017 18:20:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706031820.v53IKO16054373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Jun 2017 18:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319548 - head/usr.sbin/newsyslog/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 18:20:25 -0000 Author: ngie Date: Sat Jun 3 18:20:23 2017 New Revision: 319548 URL: https://svnweb.freebsd.org/changeset/base/319548 Log: Remove TODO for sub testcases added for bug 212160 On closer inspection, the past failures no longer occur on ^/head. PR: 212160 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- head/usr.sbin/newsyslog/tests/legacy_test.sh Sat Jun 3 18:18:34 2017 (r319547) +++ head/usr.sbin/newsyslog/tests/legacy_test.sh Sat Jun 3 18:20:23 2017 (r319548) @@ -380,8 +380,6 @@ tests_time_rotate() { sleep 1.1 - TODO="rotate time 2-4 fail today; bug 212160" - begin "rotate time 2 ${name_postfix}" run_newsyslog ${newsyslog_args} ckfe ${LOGFNAME} @@ -403,7 +401,6 @@ tests_time_rotate() { ckfe ${LOGFNAME} chkfcnt 3 ${dir}${LOGFNAME}.*${ext} end - unset TODO begin "noaction ${name_postfix}" ofiles=`ls -1 ${dir}${LOGFNAME}.*${ext} | tr -d '\n'` From owner-svn-src-head@freebsd.org Sat Jun 3 18:29:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B68ABF6E5F; Sat, 3 Jun 2017 18:29:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4913479BBC; Sat, 3 Jun 2017 18:29:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53ITILa058753; Sat, 3 Jun 2017 18:29:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53ITIwT058752; Sat, 3 Jun 2017 18:29:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201706031829.v53ITIwT058752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 3 Jun 2017 18:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319551 - head/bin/dd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 18:29:19 -0000 Author: asomers Date: Sat Jun 3 18:29:18 2017 New Revision: 319551 URL: https://svnweb.freebsd.org/changeset/base/319551 Log: Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS Split the postive and negative parts into separate test cases. The positive test case can only run on ZFS, because only ZFS supports files that large. PR: 219757 Reported by: ngie MFC after: 18 days X-MFC-with: 319339 Modified: head/bin/dd/tests/dd2_test.sh Modified: head/bin/dd/tests/dd2_test.sh ============================================================================== --- head/bin/dd/tests/dd2_test.sh Sat Jun 3 18:25:36 2017 (r319550) +++ head/bin/dd/tests/dd2_test.sh Sat Jun 3 18:29:18 2017 (r319551) @@ -26,21 +26,35 @@ # $FreeBSD$ -atf_test_case seek_overflow -seek_overflow_head() +atf_test_case max_seek +max_seek_head() { - atf_set "descr" "dd(1) should reject too-large seek values" + atf_set "descr" "dd(1) can seek by the maximum amount" } -seek_overflow_body() +max_seek_body() { - atf_expect_fail "fails with 'dd: truncating f.out: File too large' - bug 219757" + case `df -T . | tail -n 1 | cut -wf 2` in + "ufs") + atf_skip "UFS's maximum file size is too small";; + "zfs") ;; # ZFS is fine + "tmpfs") + atf_skip "tmpfs can't create arbitrarily large spare files";; + *) atf_skip "Unknown file system";; + esac touch f.in - # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek +} - # Negative tests +atf_test_case seek_overflow +seek_overflow_head() +{ + atf_set "descr" "dd(1) should reject too-large seek values" +} +seek_overflow_body() +{ + touch f.in seek=`echo "2^63 / 4096" | bc` atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ dd if=f.in of=f.out bs=4096 seek=$seek @@ -50,5 +64,6 @@ seek_overflow_body() atf_init_test_cases() { - atf_add_test_case seek_overflow + atf_add_test_case max_seek + atf_add_test_case seek_overflow } From owner-svn-src-head@freebsd.org Sat Jun 3 18:37:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D658FBF6FE8; Sat, 3 Jun 2017 18:37:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8D079F84; Sat, 3 Jun 2017 18:37:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x243.google.com with SMTP id i206so16297139ita.3; Sat, 03 Jun 2017 11:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=RECcfuDd1h2/fGg/wB2qYeLsNgMUBRcLTnpqqwCukTM=; b=RQZ3ywfdcMdxDJrgNMm5mbMz4wU/PxyZMB0/Kdgnn6I26tEZUlevopNIFQo86/PHET oxMpXIFi13aYgjtAzFDj+/gzJRpN6YMCBRaoC5IX+aqEhqq/ck141+tLLQDeMLt9SPH3 /hkhj28uki/pAKwm/QKv2z8b5CGtpOXtqYWZ88YmPTwkENsU0LihYwmUylFjrQ7buRJ1 PYASuppSD2wG1BgU4HkACpcBIXdxrYg08HnRoewR1sMnTJKb22l9kO76UqkxBka7FIx8 d/Hs3Bk7VkZVfrIxXizaRjaT1Jg6hDPgpqhYwraoQP6sWEO0yB9yplI42NsUYRvUEVy7 wLnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=RECcfuDd1h2/fGg/wB2qYeLsNgMUBRcLTnpqqwCukTM=; b=jfJF2m4++5ZipWq6FriXYxAz8FvWrFsyTn5VF5+y89Mw+PS2h/+5DoQtOLAvRn8h7H 0W4tOj5n8zvhAVeEoBLsmOgZfkhaDuWThdiKchvMArdXdG/Pld2h41eh6FnmcHgwMvIM iaHpQh3XRAueu1CDGHFXx4TxDf2Lr6gfP8rScRyJxdEkzuPEgJY1ovBZxKoRyxwVmk4A D+u4d18k4JNu+4/bEkgCLXPHdH1ZZRo0T3vd5mmS/Z6RIYbMJbmJzyhRF8mx2Nx18bZC AUSsdyVKwR807cgr9RvrdwOCG5wcq48lY4MpWhzWJb705lQeKdRHFLWhcpTJ9FofEt/l /HFg== X-Gm-Message-State: AODbwcAJFmLQ1Z46GZIVQc3oQWmIpLH02CHXKy81FqW/UJTqT/NCvu5X KQBJR/rO/I9xp2r+Aig= X-Received: by 10.107.58.10 with SMTP id h10mr13766772ioa.205.1496515063762; Sat, 03 Jun 2017 11:37:43 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c10sm11617735ioj.48.2017.06.03.11.37.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Jun 2017 11:37:43 -0700 (PDT) Subject: Re: svn commit: r319551 - head/bin/dd/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BBAA6824-6264-4320-8993-D8B0D1E64E14"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201706031829.v53ITIwT058752@repo.freebsd.org> Date: Sat, 3 Jun 2017 11:37:41 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201706031829.v53ITIwT058752@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 18:37:44 -0000 --Apple-Mail=_BBAA6824-6264-4320-8993-D8B0D1E64E14 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 3, 2017, at 11:29, Alan Somers wrote: >=20 > Author: asomers > Date: Sat Jun 3 18:29:18 2017 > New Revision: 319551 > URL: https://svnweb.freebsd.org/changeset/base/319551 >=20 > Log: > Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS >=20 > Split the postive and negative parts into separate test cases. The = positive > test case can only run on ZFS, because only ZFS supports files that = large. >=20 > PR: 219757 > Reported by: ngie > MFC after: 18 days > X-MFC-with: 319339 Thanks :)! -Ngie --Apple-Mail=_BBAA6824-6264-4320-8993-D8B0D1E64E14 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZMwH1AAoJEPWDqSZpMIYVwcEP/iTiJ/6yjBPGtheUdAle+cFm a+RlwMEkEjXQzoyopPX9Wo8B7c2uGPfgcTJ+mtMlh/6Q6wy2WEkojuE4rsk2jo3o ArDA/i7OAg9o8MdiYbrUhwHwusCuuhN0oRygdPmt8O5TKdUNS8fmDO9Uog0ukT3b P+AqoLsElYi2lxgDVWViaijFRF5fBA9Sdcal2VHKS+DmUGsU9hf1olFnBU5MK2Yh tu8DiYJKZSqJh7EF27M6NUkaU0g5yqMJqe8IjWhEzuC5BWY5d2uvGJjm6UcjNsR6 9g2371LGy5Q37z+QBBUhovskFbpCY2ttXgWUp7P1o0z0v/XuSBnDfxtMIKvDrgat VqJ/j66Wp8ZM5JYLepCue3bTB64uKLscuCK1UIUibYAaUMHr0wBOxNuKjP5VbqKt PnU3vwO8kHG4c7FMzvbBMdjbUko7IP2mJlVXfOyZoIZUzoj58YgOsgXP1VtLck29 LTaQbDyJd13dEUMcyCtQpHmP0jX2IhJxN5GcbFyLRvXsAUHygrsA2FMxjiTYb/t/ q1xpJtAnblamRN+AhLY0/Oi90nLeFRQg3wf6WGyqzs07wJTkdi+LWa2VKmkQU4lS 0XKEimrNzWMX4EuDJz1oJEjKJ0b1hU3EpcJYPUkR/t8+mXmGpwX0NS2NMqK3gkV4 jzaUDy9Z/5JM4X7lbAUv =yLDs -----END PGP SIGNATURE----- --Apple-Mail=_BBAA6824-6264-4320-8993-D8B0D1E64E14-- From owner-svn-src-head@freebsd.org Sat Jun 3 19:05:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55AEBF74C0; Sat, 3 Jun 2017 19:05:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 758EF7AB84; Sat, 3 Jun 2017 19:05:13 +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 A491510AFA2; Sat, 3 Jun 2017 15:05:11 -0400 (EDT) From: John Baldwin To: Baptiste Daroussin Cc: rgrimes@freebsd.org, Ngie Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r318441 - in head/etc: . cron.d Date: Sat, 03 Jun 2017 12:05:08 -0700 Message-ID: <1833775.llHFF7vaD6@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <9570430.uB7Ojud3DG@ralph.baldwin.cx> References: <201705180625.v4I6Pd9j062495@repo.freebsd.org> <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net> <9570430.uB7Ojud3DG@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 03 Jun 2017 15:05:11 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 19:05:13 -0000 On Friday, May 19, 2017 09:17:23 AM John Baldwin wrote: > On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote: > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote: > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote: > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote: > > > > > > Author: ngie > > > > > > Date: Thu May 18 06:25:39 2017 > > > > > > New Revision: 318441 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/318441 > > > > > > > > > > > > Log: > > > > > > Handle the cron.d entry for MK_AT in cron conditionally > > > > > > > > > > > > Install /etc/cron.d/at if MK_AT != no, always using it, which tries > > > > > > to run a non-existent program via cron(8) every 5 minutes with the > > > > > > default /etc/crontab, prior to this commit. > > > > > > > > > > > > SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at > > > > > > because atrun(8) executes programs, which may rely on environment > > > > > > currently set via /etc/crontab. > > > > > > > > > > > > Noted by: bdrewery (in an internal review) > > > > > > MFC after: 2 months > > > > > > Relnotes: yes (may need to add environmental modifications to > > > > > > /etc/cron.d/at) > > > > > > Sponsored by: Dell EMC Isilon > > > > > > > > > > > > Added: > > > > > > head/etc/cron.d/ > > > > > > head/etc/cron.d/Makefile (contents, props changed) > > > > > > head/etc/cron.d/at (contents, props changed) > > > > > > Modified: > > > > > > head/etc/Makefile > > > > > > head/etc/crontab > > > > > > > > > > > > Modified: head/etc/Makefile > > > > > > ============================================================================== > > > > > > --- head/etc/Makefile Thu May 18 06:15:42 2017 (r318440) > > > > > > +++ head/etc/Makefile Thu May 18 06:25:39 2017 (r318441) > > > > > > @@ -8,6 +8,7 @@ FILESGROUPS= FILES > > > > > > # No need as it is empty and just causes rebuilds since this file does so much. > > > > > > UPDATE_DEPENDFILE= no > > > > > > SUBDIR= \ > > > > > > + cron.d \ > > > > > > newsyslog.conf.d \ > > > > > > syslog.d > > > > > > > > > > The thread on the newsyslog clearly shows that this is a contriversial change. > > > > > > > > > > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files > > > > > to suite Dell/EMC/Isilon's needs. It is in conflict with the needs and > > > > > desires of others. > > > > > > > > Has multiple people has stated, on the newsyslog thread. this is not a > > > > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases > > > > 1. Consistency > > > > as a project we do support building WITHOUT_FOO there is no reason to install > > > > syslog, cron configuration for FOO if the system was built without foo > > > > > > Though it doesn't _hurt_, and breaking POLA has to be worth it, not just > > > because it looks nice. > > > > > > > 2. Packaging base > > > > if one does not install at there is no need for the at crontab to be installed > > > > (same reason as 1.) > > > > > > This is a viable reason except that it isn't fully baked yet. > > > > > > > 3. Large deployment of freebsd farms > > > > Being able to administrate thousands of FreeBSD machines, one often ends up > > > > using tools like puppet, chef, ansible, cfengine. When programmatically > > > > handling configuration management it is way easier and safer to simple > > > > add/removes files in a directory rather than mangling^Winplace editing files. > > > > > > There's nothing preventing you now from deploying split files and an empty > > > global configuration file since the daemons support foo.d. You don't require > > > that to change in upstream since you should be using some sort of VCS to > > > manage your configuration as it is. > > > > > > > 4. Ports/packages > > > > On can provide easily sample configuration for cron, syslog (not only) and the > > > > admin can decide to use it or not easily (ususally this is done by making > > > > symlinks from the said file which would live in share/* into the .d directory. > > > > > > > > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more. > > > > > > The support for broken out files has long been there, but the base system has > > > not used them previously for default config shipped during a release. That > > > is in fact a new trend. > > > > > > However, the current approach seems to be the absolute worst way to do this. > > > If someone wants to use the existing base system image and modify it with > > > config management, they now have to use a mix of styles (for some services > > > edit a global config file for certain settings, but use a dedicated file for > > > other settings for the same service, or for the same settings but a different > > > service). It's also the worst case for humans trying to work with our system > > > as the division between which services are broken out vs global is > > > inconsistent and arbitrary. > > > > > > Once you split up the files you make a merge conflict for anyone trying to do > > > an upgrade. If we do this piecemail then we create N merge conflicts for users > > > to deal with as opposed to if you split it up all at once. > > > > > > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we should > > > switch to splitting up config files for reasons A and B and let's do this for > > > 12.0 but not merge to stable so there is a clear flag day / sign post for users > > > to manage upgrades". Instead there have been a couple of commits and any > > > not-in-100%-agreement opinions are ignored. > > > > > That's true, another thing is the way it is done, there is no simple way to > > disable the at cron from an admin point of view rather than rm /etc/cron.d/at > > for an end user which an upgrade will bring back. > > I think an upgrade won't bring the file back necessarily (etcupdate warns you > that a removed file changed, but it doesn't bring it back, I think a similar > strategy might be sensible for pkg as well). > > To be clear, my main thoughts are that if we are going to start using conf.d > for the base system: > > 1) We should be intentional about deciding to use that approach in general > (so discuss it first, though perhaps we've had enough discussion in the > current threads). > > 2) When converting a utility from a global foo.conf to a conf.d style, I > think we should convert it all at once, not piecemeal so that there's just > one painful update for users to work through instead of N updates to the > same file. > > 3) This is probably a sufficiently large POLA violation to not MFC, but be > part of a new X.0. Ping? bapt@ agreed with this, but I haven't seen any other feedback? If others agree then we should either revert back to a single foo.conf or we should fully split newsyslog.conf and syslogd.conf out to individual files. -- John Baldwin From owner-svn-src-head@freebsd.org Sat Jun 3 19:11:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E7B9BF784E; Sat, 3 Jun 2017 19:11:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7C27AF1D; Sat, 3 Jun 2017 19:11:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53JBWsi075825; Sat, 3 Jun 2017 19:11:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53JBWo0075807; Sat, 3 Jun 2017 19:11:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031911.v53JBWo0075807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 19:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319552 - in head/sys/arm: conf xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 19:11:34 -0000 Author: andrew Date: Sat Jun 3 19:11:32 2017 New Revision: 319552 URL: https://svnweb.freebsd.org/changeset/base/319552 Log: Port the Xilinx code to use PLATFORM and PLATFORM_SMP. This will help move it to be part of the armv6 GENERIC kernel. Added: head/sys/arm/xilinx/zy7_mp.h (contents, props changed) Modified: head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Sat Jun 3 18:29:18 2017 (r319551) +++ head/sys/arm/conf/ZEDBOARD Sat Jun 3 19:11:32 2017 (r319552) @@ -27,6 +27,8 @@ include "../xilinx/std.zynq7" makeoptions MODULES_EXTRA="dtb/zynq" options SCHED_ULE # ULE scheduler +options PLATFORM # Platform based SoC +options PLATFORM_SMP #options NFSSD # Network Filesystem Server options SMP # Enable multiple cores Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sat Jun 3 18:29:18 2017 (r319551) +++ head/sys/arm/xilinx/zy7_machdep.c Sat Jun 3 19:11:32 2017 (r319552) @@ -33,6 +33,8 @@ * (v1.4) November 16, 2012. Xilinx doc UG585. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -47,41 +49,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include +#include "platform_if.h" + void (*zynq7_cpu_reset)(void); -vm_offset_t -platform_lastaddr(void) -{ - - return (devmap_lastaddr()); -} - -void -platform_probe_and_attach(void) -{ - -} - -void -platform_gpio_init(void) -{ -} - -void -platform_late_init(void) -{ -} - /* * Set up static device mappings. Not strictly necessary -- simplebus will * dynamically establish mappings as needed -- but doing it this way gets us * nice efficient 1MB section mappings. */ -int -platform_devmap_init(void) +static int +zynq7_devmap_init(platform_t plat) { devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE); @@ -90,8 +73,8 @@ platform_devmap_init(void) return (0); } -void -cpu_reset(void) +static void +zynq7_do_cpu_reset(platform_t plat) { if (zynq7_cpu_reset != NULL) (*zynq7_cpu_reset)(); @@ -100,3 +83,17 @@ cpu_reset(void) for (;;) ; } + +static platform_method_t zynq7_methods[] = { + PLATFORMMETHOD(platform_devmap_init, zynq7_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, zynq7_do_cpu_reset), + +#ifdef SMP + PLATFORMMETHOD(platform_mp_setmaxid, zynq7_mp_setmaxid), + PLATFORMMETHOD(platform_mp_start_ap, zynq7_mp_start_ap), +#endif + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(zynq7, "zynq7", 0, "xlnx,zynq-7000", 0); Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Sat Jun 3 18:29:18 2017 (r319551) +++ head/sys/arm/xilinx/zy7_mp.c Sat Jun 3 19:11:32 2017 (r319552) @@ -22,6 +22,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); #include @@ -38,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #define ZYNQ7_CPU1_ENTRY 0xfffffff0 @@ -47,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define SCU_CONTROL_ENABLE (1 << 0) void -platform_mp_setmaxid(void) +zynq7_mp_setmaxid(platform_t plat) { mp_maxid = 1; @@ -55,7 +59,7 @@ platform_mp_setmaxid(void) } void -platform_mp_start_ap(void) +zynq7_mp_start_ap(platform_t plat) { bus_space_handle_t scu_handle; bus_space_handle_t ocm_handle; Added: head/sys/arm/xilinx/zy7_mp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_mp.h Sat Jun 3 19:11:32 2017 (r319552) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2017 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ZY7_MP_H_ +#define _ZY7_MP_H_ + +void zynq7_mp_setmaxid(platform_t); +void zynq7_mp_start_ap(platform_t); + +#endif /* _ZY7_MP_H_ */ From owner-svn-src-head@freebsd.org Sat Jun 3 20:02:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ABBDBF8450; Sat, 3 Jun 2017 20:02:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB8E7C78B; Sat, 3 Jun 2017 20:02:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53K2Da5099039; Sat, 3 Jun 2017 20:02:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53K2C0J098143; Sat, 3 Jun 2017 20:02:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706032002.v53K2C0J098143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 20:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319553 - in head/sys/arm: conf samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 20:02:14 -0000 Author: andrew Date: Sat Jun 3 20:02:12 2017 New Revision: 319553 URL: https://svnweb.freebsd.org/changeset/base/319553 Log: Port the Samsung ARM code to use PLATFORM and PLATFORM_SMP. This will help move it into the GENERIC kernel config. Added: head/sys/arm/samsung/exynos/exynos5_mp.h (contents, props changed) Deleted: head/sys/arm/samsung/exynos/exynos5_common.c Modified: head/sys/arm/conf/EXYNOS5.common head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/samsung/exynos/files.exynos5 Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Sat Jun 3 19:11:32 2017 (r319552) +++ head/sys/arm/conf/EXYNOS5.common Sat Jun 3 20:02:12 2017 (r319553) @@ -22,6 +22,8 @@ makeoptions WERROR="-Werror" include "std.armv6" options SCHED_ULE # ULE scheduler +options PLATFORM # Platform based SoC +options PLATFORM_SMP options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Sat Jun 3 19:11:32 2017 (r319552) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Sat Jun 3 20:02:12 2017 (r319553) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ -#include "opt_ddb.h" #include "opt_platform.h" #include @@ -37,40 +36,26 @@ __FBSDID("$FreeBSD$"); #include +#include + #include #include +#include #include #include +#include -vm_offset_t -platform_lastaddr(void) -{ +#include - return (devmap_lastaddr()); -} +#include "platform_if.h" -void -platform_probe_and_attach(void) -{ +static platform_devmap_init_t exynos5_devmap_init; +static platform_cpu_reset_t exynos5_cpu_reset; -} - -void -platform_gpio_init(void) +static int +exynos5_devmap_init(platform_t plat) { -} - -void -platform_late_init(void) -{ - -} - -int -platform_devmap_init(void) -{ - /* CHIP ID */ devmap_add_entry(0x10000000, 0x100000); @@ -82,3 +67,28 @@ platform_devmap_init(void) return (0); } + +static void +exynos5_cpu_reset(platform_t plat) +{ + bus_space_handle_t bsh; + + bus_space_map(fdtbus_bs_tag, 0x10040400, 0x1000, 0, &bsh); + bus_space_write_4(fdtbus_bs_tag, bsh, 0, 1); + + while (1); +} + +static platform_method_t exynos5_methods[] = { + PLATFORMMETHOD(platform_devmap_init, exynos5_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, exynos5_cpu_reset), + +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, exynos5_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, exynos5_mp_setmaxid), +#endif + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(exynos5, "exynos5", 0, "samsung,exynos5", 0); Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Sat Jun 3 19:11:32 2017 (r319552) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Sat Jun 3 20:02:12 2017 (r319553) @@ -40,7 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include + #define EXYNOS_CHIPID 0x10000000 #define EXYNOS5250_SOC_ID 0x43520000 @@ -71,7 +74,7 @@ exynos_get_soc_id(void) } void -platform_mp_setmaxid(void) +exynos5_mp_setmaxid(platform_t plat) { if (exynos_get_soc_id() == EXYNOS5420_SOC_ID) @@ -83,7 +86,7 @@ platform_mp_setmaxid(void) } void -platform_mp_start_ap(void) +exynos5_mp_start_ap(platform_t plat) { bus_addr_t sysram, pmu; int err, i, j; Added: head/sys/arm/samsung/exynos/exynos5_mp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/exynos5_mp.h Sat Jun 3 20:02:12 2017 (r319553) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2017 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _EXYNOS5_MP_H_ +#define _EXYNOS5_MP_H_ + +void exynos5_mp_setmaxid(platform_t); +void exynos5_mp_start_ap(platform_t); + +#endif /* _EXYNOS5_MP_H_ */ Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Sat Jun 3 19:11:32 2017 (r319552) +++ head/sys/arm/samsung/exynos/files.exynos5 Sat Jun 3 20:02:12 2017 (r319553) @@ -4,7 +4,6 @@ kern/kern_clocksource.c standard arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp -arm/samsung/exynos/exynos5_common.c standard arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/exynos5_combiner.c standard arm/samsung/exynos/exynos5_pad.c optional gpio From owner-svn-src-head@freebsd.org Sat Jun 3 20:14:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A93EBF8748; Sat, 3 Jun 2017 20:14:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1A87CDB2; Sat, 3 Jun 2017 20:14:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53KElLS003842; Sat, 3 Jun 2017 20:14:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53KElLw003839; Sat, 3 Jun 2017 20:14:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706032014.v53KElLw003839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 20:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319554 - in head/sys/arm: conf freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 20:14:48 -0000 Author: andrew Date: Sat Jun 3 20:14:46 2017 New Revision: 319554 URL: https://svnweb.freebsd.org/changeset/base/319554 Log: Port the Vybrid code to PLATFORM to help move it into GENERIC. Deleted: head/sys/arm/freescale/vybrid/vf_common.c Modified: head/sys/arm/conf/VYBRID head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/freescale/vybrid/vf_machdep.c Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Sat Jun 3 20:02:12 2017 (r319553) +++ head/sys/arm/conf/VYBRID Sat Jun 3 20:14:46 2017 (r319554) @@ -25,6 +25,7 @@ include "../freescale/vybrid/std.vybrid" makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler +options PLATFORM # Platform based SoC #options NANDFS # NAND Filesystem #options SMP # Enable multiple cores Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Sat Jun 3 20:02:12 2017 (r319553) +++ head/sys/arm/freescale/vybrid/files.vybrid Sat Jun 3 20:14:46 2017 (r319554) @@ -3,7 +3,6 @@ kern/kern_clocksource.c standard arm/freescale/vybrid/vf_machdep.c standard -arm/freescale/vybrid/vf_common.c standard arm/freescale/vybrid/vf_ccm.c standard arm/freescale/vybrid/vf_anadig.c standard arm/freescale/vybrid/vf_iomuxc.c standard Modified: head/sys/arm/freescale/vybrid/vf_machdep.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_machdep.c Sat Jun 3 20:02:12 2017 (r319553) +++ head/sys/arm/freescale/vybrid/vf_machdep.c Sat Jun 3 20:14:46 2017 (r319554) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ -#include "opt_ddb.h" #include "opt_platform.h" #include @@ -32,46 +31,56 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -#include +#include + #include -#include +#include #include +#include -vm_offset_t -platform_lastaddr(void) -{ +#include - return (devmap_lastaddr()); -} +#include "platform_if.h" -void -platform_probe_and_attach(void) +static int +vf_devmap_init(platform_t plat) { + devmap_add_entry(0x40000000, 0x100000); + + return (0); } -void -platform_gpio_init(void) +static void +vf_cpu_reset(platform_t plat) { + phandle_t src; + uint32_t paddr; + bus_addr_t vaddr; -} + if (src_swreset() == 0) + goto end; -void -platform_late_init(void) -{ + src = OF_finddevice("src"); + if ((src != 0) && (OF_getencprop(src, "reg", &paddr, sizeof(paddr))) > 0) { + if (bus_space_map(fdtbus_bs_tag, paddr, 0x10, 0, &vaddr) == 0) { + bus_space_write_4(fdtbus_bs_tag, vaddr, 0x00, SW_RST); + } + } +end: + while (1); } -int -platform_devmap_init(void) -{ +static platform_method_t vf_methods[] = { + PLATFORMMETHOD(platform_devmap_init, vf_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, vf_cpu_reset), - devmap_add_entry(0x40000000, 0x100000); + PLATFORMMETHOD_END, +}; - return (0); -} +FDT_PLATFORM_DEF(vf, "vybrid", 0, "freescale,vybrid", 0); From owner-svn-src-head@freebsd.org Sat Jun 3 20:49:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE795BF8D21; Sat, 3 Jun 2017 20:49:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A84FD7D8EF; Sat, 3 Jun 2017 20:49:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id v14so1820322pgn.1; Sat, 03 Jun 2017 13:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=nmdxQoe417gH4GFAdXORQanvX88Sh1U66uj/FiwmR/8=; b=JPljxPwFz+jKQJ50hYVh28xh+zB9k0Yl5JNOS34h30g427fTZQL0iFItMbIMhI+6H9 6+FgdDXevyJhYkGyYOVjM9Odm2nnbbFuEQqsPia8AeghbE7ziPwcwSevk+rHVGPT+4q2 Omd85z2DjJpvobU3wxCRBkNTcX191zNU34TGhuhsWK5s5MfdGflkflTvf5jx9ZGa0V4J LQJDN2lmVOVIzgepEQNWrGhvMvFzSDpVwzVBHq8ocZrVlhEQZGDWQslcOi+5VH5AwWON /CjkLD3/ziELwCJ9/peCIiFXsW2lgMouBPGlfk93+g8scn2i5APiDAoSEgwCyDiG8XIS v0Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=nmdxQoe417gH4GFAdXORQanvX88Sh1U66uj/FiwmR/8=; b=VnE7tvDQg+VdSDou9na+PXV2oCAKVMvn/Dl4OBJFT/54gZ1+KSKkwPlEF0YnHenvrs HW7AYDXPBCByZ9IKn5WpTDuA0wYmmqM7c6sWr5zmtMVWZ1kUIvcZSsew1XrRn+pRtrMl +kWvKvtIWffRu3TKxe5dnqNAb5szrKBJ5LKkO9kuaCzqP6ghAm7YRBCY9+AJJ+NCDvaV 7GOmcuGl7RZEQaemWyG5dQWLJYdbuAyI7XYmhUfltvpHC6sO5ZFXALjVjf8dmGcAhg1Q fpMbZWhvTRACuBn0Ma/UqMILRDS6n9MjSE9z+ynbaAwLE1DBzOBKMwfcWTFsgrL8neRT Lobg== X-Gm-Message-State: AODbwcBtn8lTaG/ndd86gc8u5LHVMnaKEW71sgOZVPvyq31DTDLAwTJ9 4pkbkqTU6LM93BRF2lc= X-Received: by 10.98.152.214 with SMTP id d83mr12992356pfk.7.1496522976001; Sat, 03 Jun 2017 13:49:36 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d75sm49969634pfj.75.2017.06.03.13.49.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Jun 2017 13:49:35 -0700 (PDT) Subject: Re: svn commit: r318441 - in head/etc: . cron.d Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EBD02BC4-9A70-4AEA-8053-E39C7D35234E"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <1833775.llHFF7vaD6@ralph.baldwin.cx> Date: Sat, 3 Jun 2017 13:49:34 -0700 Cc: Baptiste Daroussin , rgrimes@freebsd.org, Ngie Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-Id: <16687E47-B9A1-4386-BFCD-FB9E1F5C3D90@gmail.com> References: <201705180625.v4I6Pd9j062495@repo.freebsd.org> <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net> <9570430.uB7Ojud3DG@ralph.baldwin.cx> <1833775.llHFF7vaD6@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 20:49:37 -0000 --Apple-Mail=_EBD02BC4-9A70-4AEA-8053-E39C7D35234E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 3, 2017, at 12:05, John Baldwin wrote: =E2=80=A6 > Ping? bapt@ agreed with this, but I haven't seen any other feedback? = If others > agree then we should either revert back to a single foo.conf or we = should fully > split newsyslog.conf and syslogd.conf out to individual files. Please, no. The single monolithic foo.conf idea may have made sense back = in the day, but with the various knobs that are available for building = the system, for ease-of-use/intuitiveness the feature makes sense. I planned on introducing more of these files for other areas of the = system that aren=E2=80=99t currently being handled=E2=80=94 like = bsnmpd=E2=80=99s logging, etc. I think the modularization makes sense. Thanks, -Ngie --Apple-Mail=_EBD02BC4-9A70-4AEA-8053-E39C7D35234E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZMyDeAAoJEPWDqSZpMIYVxEYP/0nEbnES1R/b0xtEULrJ+K1o S5Erc4KLAeVPIyambAHMC6CegZcUwTrEQyOa95zxO0OzywzaIsFaZFC3HbSmVgXf PNXYxc4+ZdSY9DBqsrRun+TlU+yZc5pv2E5PiMj+DapOdavrODZfKxemfK9QDq5i pfgNe1YoYlpzEZ3vlTFuH1oPRqFDvmJvM03yb6iuw/lFOwzP0xp+mly/UUGWUKiL eDjJviC1hLESkmW6PPDFabgkeBpLNU6H6C95LhnjLX+au6dJLDPHZTeCVgmftCLj Rcr/jya3Nytm56QR5JcJKf+80efhYGC8kUu6glXu9lNmwlBNLSU1aiOX3cL1uy0f xgbHkV/2TLtCo+JcpgKWa/en39DQ4Soj789F05wm9qOlQHzkbgRLdqTLSiadvJdl 1xHEjVBi7MHcppvxJWafP+hgTHnCRXmESBLOeWPLtDgGqkS6vrfBJioz3vyCuMxr xPKqjVtmtwqd+Ftaq8IcPMKftjmJzkeVTvJbj5mtNvEcc8Dx8WrbLR5AP9NY1R5/ bn1YcmkKt9fhOIvhoc3QJzHi7yhRgQa+KrLbQAi0WtqkMXhj8SGeXLBAzstFZZFL +AkBJKIGdSuYtSBqtqnHfobNcLZ/QY2x6XyDqUZZZBKofff4ZmF5RAhJGmxsYwgS gKhuNA5DscgOtxrrV6Vf =FgnK -----END PGP SIGNATURE----- --Apple-Mail=_EBD02BC4-9A70-4AEA-8053-E39C7D35234E-- From owner-svn-src-head@freebsd.org Sat Jun 3 21:53:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3ED6BF9B58; Sat, 3 Jun 2017 21:53:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A23DE7F271; Sat, 3 Jun 2017 21:53:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53LrwpZ044031; Sat, 3 Jun 2017 21:53:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53LrwFP044028; Sat, 3 Jun 2017 21:53:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201706032153.v53LrwFP044028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 3 Jun 2017 21:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319556 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 21:53:59 -0000 Author: tuexen Date: Sat Jun 3 21:53:58 2017 New Revision: 319556 URL: https://svnweb.freebsd.org/changeset/base/319556 Log: Fix the ICMP6 handling for TCP. The ICMP6 packets might not be contained in a single mbuf. So don't assume this. Keep the IPv4 and IPv6 code in sync and make explicit that the syncache code only need the TCP sequence number, not the complete TCP header. MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Jun 3 20:39:48 2017 (r319555) +++ head/sys/netinet/tcp_subr.c Sat Jun 3 21:53:58 2017 (r319556) @@ -1963,16 +1963,16 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) if (inp != NULL && PRC_IS_REDIRECT(cmd)) { /* signal EHOSTDOWN, as it flushes the cached route */ inp = (*notify)(inp, EHOSTDOWN); - if (inp != NULL) - INP_WUNLOCK(inp); - } else if (inp != NULL) { + goto out; + } + icmp_tcp_seq = th->th_seq; + if (inp != NULL) { if (!(inp->inp_flags & INP_TIMEWAIT) && !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { - icmp_tcp_seq = ntohl(th->th_seq); tp = intotcpcb(inp); - if (SEQ_GEQ(icmp_tcp_seq, tp->snd_una) && - SEQ_LT(icmp_tcp_seq, tp->snd_max)) { + if (SEQ_GEQ(ntohl(icmp_tcp_seq), tp->snd_una) && + SEQ_LT(ntohl(icmp_tcp_seq), tp->snd_max)) { if (cmd == PRC_MSGSIZE) { /* * MTU discovery: @@ -1980,7 +1980,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) * in the route to the suggested new * value (if given) and then notify. */ - mtu = ntohs(icp->icmp_nextmtu); + mtu = ntohs(icp->icmp_nextmtu); /* * If no alternative MTU was * proposed, try the next smaller @@ -2011,16 +2011,17 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) inetctlerrmap[cmd]); } } - if (inp != NULL) - INP_WUNLOCK(inp); } else { bzero(&inc, sizeof(inc)); inc.inc_fport = th->th_dport; inc.inc_lport = th->th_sport; inc.inc_faddr = faddr; inc.inc_laddr = ip->ip_src; - syncache_unreach(&inc, th); + syncache_unreach(&inc, icmp_tcp_seq); } +out: + if (inp != NULL) + INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); } #endif /* INET */ @@ -2030,7 +2031,6 @@ void tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) { struct in6_addr *dst; - struct tcphdr *th; struct inpcb *(*notify)(struct inpcb *, int) = tcp_notify; struct ip6_hdr *ip6; struct mbuf *m; @@ -2040,11 +2040,14 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) struct ip6ctlparam *ip6cp = NULL; const struct sockaddr_in6 *sa6_src = NULL; struct in_conninfo inc; + struct tcp_ports { + uint16_t th_sport; + uint16_t th_dport; + } t_ports; tcp_seq icmp_tcp_seq; unsigned int mtu; unsigned int off; - if (sa->sa_family != AF_INET6 || sa->sa_len != sizeof(struct sockaddr_in6)) return; @@ -2093,27 +2096,31 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) /* Check if we can safely get the ports from the tcp hdr */ if (m == NULL || (m->m_pkthdr.len < - (int32_t) (off + offsetof(struct tcphdr, th_seq)))) { + (int32_t) (off + sizeof(struct tcp_ports)))) { return; } - - th = (struct tcphdr *) mtodo(ip6cp->ip6c_m, ip6cp->ip6c_off); + bzero(&t_ports, sizeof(struct tcp_ports)); + m_copydata(m, off, sizeof(struct tcp_ports), (caddr_t)&t_ports); INP_INFO_RLOCK(&V_tcbinfo); - inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, th->th_dport, - &ip6->ip6_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL); + inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, t_ports.th_dport, + &ip6->ip6_src, t_ports.th_sport, INPLOOKUP_WLOCKPCB, NULL); if (inp != NULL && PRC_IS_REDIRECT(cmd)) { /* signal EHOSTDOWN, as it flushes the cached route */ inp = (*notify)(inp, EHOSTDOWN); - if (inp != NULL) - INP_WUNLOCK(inp); - } else if (inp != NULL) { + goto out; + } + off += sizeof(struct tcp_ports); + if (m->m_pkthdr.len < (int32_t) (off + sizeof(tcp_seq))) { + goto out; + } + m_copydata(m, off, sizeof(tcp_seq), (caddr_t)&icmp_tcp_seq); + if (inp != NULL) { if (!(inp->inp_flags & INP_TIMEWAIT) && !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { - icmp_tcp_seq = ntohl(th->th_seq); tp = intotcpcb(inp); - if (SEQ_GEQ(icmp_tcp_seq, tp->snd_una) && - SEQ_LT(icmp_tcp_seq, tp->snd_max)) { + if (SEQ_GEQ(ntohl(icmp_tcp_seq), tp->snd_una) && + SEQ_LT(ntohl(icmp_tcp_seq), tp->snd_max)) { if (cmd == PRC_MSGSIZE) { /* * MTU discovery: @@ -2130,22 +2137,20 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) */ if (mtu < IPV6_MMTU) mtu = IPV6_MMTU - 8; - - bzero(&inc, sizeof(inc)); inc.inc_fibnum = M_GETFIB(m); inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = *dst; if (in6_setscope(&inc.inc6_faddr, m->m_pkthdr.rcvif, NULL)) - goto unlock_inp; - + goto out; /* * Only process the offered MTU if it * is smaller than the current one. */ if (mtu < tp->t_maxseg + - (sizeof (*th) + sizeof (*ip6))) { + sizeof (struct tcphdr) + + sizeof (struct ip6_hdr)) { tcp_hc_updatemtu(&inc, mtu); tcp_mtudisc(inp, mtu); ICMP6STAT_INC(icp6s_pmtuchg); @@ -2155,19 +2160,19 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) inet6ctlerrmap[cmd]); } } -unlock_inp: - if (inp != NULL) - INP_WUNLOCK(inp); } else { bzero(&inc, sizeof(inc)); inc.inc_fibnum = M_GETFIB(m); inc.inc_flags |= INC_ISIPV6; - inc.inc_fport = th->th_dport; - inc.inc_lport = th->th_sport; + inc.inc_fport = t_ports.th_dport; + inc.inc_lport = t_ports.th_sport; inc.inc6_faddr = *dst; inc.inc6_laddr = ip6->ip6_src; - syncache_unreach(&inc, th); + syncache_unreach(&inc, icmp_tcp_seq); } +out: + if (inp != NULL) + INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); } #endif /* INET6 */ Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Jun 3 20:39:48 2017 (r319555) +++ head/sys/netinet/tcp_syncache.c Sat Jun 3 21:53:58 2017 (r319556) @@ -602,7 +602,7 @@ syncache_badack(struct in_conninfo *inc) } void -syncache_unreach(struct in_conninfo *inc, struct tcphdr *th) +syncache_unreach(struct in_conninfo *inc, tcp_seq th_seq) { struct syncache *sc; struct syncache_head *sch; @@ -613,7 +613,7 @@ syncache_unreach(struct in_conninfo *inc, struct tcphd goto done; /* If the sequence number != sc_iss, then it's a bogus ICMP msg */ - if (ntohl(th->th_seq) != sc->sc_iss) + if (ntohl(th_seq) != sc->sc_iss) goto done; /* Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Sat Jun 3 20:39:48 2017 (r319555) +++ head/sys/netinet/tcp_syncache.h Sat Jun 3 21:53:58 2017 (r319556) @@ -38,7 +38,7 @@ void syncache_init(void); #ifdef VIMAGE void syncache_destroy(void); #endif -void syncache_unreach(struct in_conninfo *, struct tcphdr *); +void syncache_unreach(struct in_conninfo *, tcp_seq); int syncache_expand(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct socket **, struct mbuf *); int syncache_add(struct in_conninfo *, struct tcpopt *, From owner-svn-src-head@freebsd.org Sat Jun 3 22:30:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0A71BFA190; Sat, 3 Jun 2017 22:30:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1E77FE1E; Sat, 3 Jun 2017 22:30:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53MUUCu056537; Sat, 3 Jun 2017 22:30:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53MUUAB056536; Sat, 3 Jun 2017 22:30:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201706032230.v53MUUAB056536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 3 Jun 2017 22:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319557 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 22:30:32 -0000 Author: cem Date: Sat Jun 3 22:30:30 2017 New Revision: 319557 URL: https://svnweb.freebsd.org/changeset/base/319557 Log: ext2fs(4): Fix a number of broken flag checks Introduced in r319071. Reported by: Coverity CIDs: 1375847, 1375848, 1375849 Sponsored by: Dell EMC Isilon Modified: head/sys/fs/ext2fs/ext2_acl.c Modified: head/sys/fs/ext2fs/ext2_acl.c ============================================================================== --- head/sys/fs/ext2fs/ext2_acl.c Sat Jun 3 21:53:58 2017 (r319556) +++ head/sys/fs/ext2fs/ext2_acl.c Sat Jun 3 22:30:30 2017 (r319557) @@ -276,7 +276,7 @@ ext2_getacl(struct vop_getacl_args *ap) { if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) || - ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1)) + ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0)) return (EOPNOTSUPP); if (ap->a_type == ACL_TYPE_NFS4) @@ -473,7 +473,7 @@ int ext2_setacl(struct vop_setacl_args *ap) { if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) || - ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1)) + ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0)) return (EOPNOTSUPP); if (ap->a_type == ACL_TYPE_NFS4) @@ -490,7 +490,7 @@ ext2_aclcheck(struct vop_aclcheck_args *ap) { if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) || - ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1)) + ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0)) return (EOPNOTSUPP); if (ap->a_type == ACL_TYPE_NFS4) From owner-svn-src-head@freebsd.org Sat Jun 3 22:39:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F0FBFA3EC; Sat, 3 Jun 2017 22:39:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D196C80234; Sat, 3 Jun 2017 22:39:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53Mdott060469; Sat, 3 Jun 2017 22:39:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53Mdo5q060468; Sat, 3 Jun 2017 22:39:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201706032239.v53Mdo5q060468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 3 Jun 2017 22:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319558 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 22:39:52 -0000 Author: cem Date: Sat Jun 3 22:39:50 2017 New Revision: 319558 URL: https://svnweb.freebsd.org/changeset/base/319558 Log: ext2fs(4): Fix a null dererence and clean an unclear switch Coverity warned that the switch statement fell through. While this was intentional, the pattern wasn't especially clear. I just changed it to a conventional if pattern. Reported by: Coverity CIDs: 1375851 (false positive), 1375853 Sponsored by: Dell EMC Isilon Modified: head/sys/fs/ext2fs/ext2_acl.c Modified: head/sys/fs/ext2fs/ext2_acl.c ============================================================================== --- head/sys/fs/ext2fs/ext2_acl.c Sat Jun 3 22:30:30 2017 (r319557) +++ head/sys/fs/ext2fs/ext2_acl.c Sat Jun 3 22:39:50 2017 (r319558) @@ -127,13 +127,18 @@ ext2_sync_inode_from_acl(struct acl *acl, struct inode static int ext4_acl_from_disk(char *value, size_t size, struct acl *acl) { - const char *end = value + size; + const char *end; int n, count, s; + if (value == NULL) + return (EINVAL); + + end = value + size; + if (((struct ext2_acl_header *)value)->a_version != EXT4_ACL_VERSION) return (EINVAL); - if (!value || size < sizeof(struct ext2_acl_header)) + if (size < sizeof(struct ext2_acl_header)) return (EINVAL); s = size - sizeof(struct ext2_acl_header); @@ -230,8 +235,7 @@ ext2_getacl_posix1e(struct vop_getacl_args *ap) error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, attrnamespace, attrname, &len, value, ap->a_td); - switch (error) { - case ENOATTR: + if (error == ENOATTR) { switch (ap->a_type) { case ACL_TYPE_ACCESS: ap->a_aclp->acl_cnt = 3; @@ -250,21 +254,20 @@ ext2_getacl_posix1e(struct vop_getacl_args *ap) ap->a_aclp->acl_cnt = 0; break; } - case 0: - if (!error) { - error = ext4_acl_from_disk(value, len, ap->a_aclp); - if (error) - goto out; - } + } else if (error != 0) + goto out; - if (error == ENOATTR) - error = 0; - - if (ap->a_type == ACL_TYPE_ACCESS) - ext2_sync_acl_from_inode(VTOI(ap->a_vp), ap->a_aclp); - default: - break; + if (!error) { + error = ext4_acl_from_disk(value, len, ap->a_aclp); + if (error) + goto out; } + + if (error == ENOATTR) + error = 0; + + if (ap->a_type == ACL_TYPE_ACCESS) + ext2_sync_acl_from_inode(VTOI(ap->a_vp), ap->a_aclp); out: free(value, M_TEMP); From owner-svn-src-head@freebsd.org Sat Jun 3 22:54:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F88BFA78C; Sat, 3 Jun 2017 22:54:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2160380904; Sat, 3 Jun 2017 22:54:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id f27so16493233pfe.0; Sat, 03 Jun 2017 15:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Bv1ogT90RuC+xirZVXkDvQDpzJvonn1wDJGSjENaNZc=; b=K11CUy7uOEnvD4Q7hdsC+1W1jW1jIYfN5/0bC0HsQS0WpCeHHjQF6BDXjtceFbQE8v oOC9odzDaDfmuIfgmFosRaWswIYLp9Sumq/q5A1dAqrAhvN1+GQy0Qf3Xt82G43jYZLc KLD+hyX9IZRn8wYR2ImiOrbqlPdCj/geFe/RdibcYcRQfm/pXE+bD3ke6pQLnACpcKPN tlrwELmV6zripr9Xh+sevM4GLvzbduCoErwLyqJqvqwZlGaLCtjf/wE5GRkHdyWePrmt LY1clhoW6lmqffMOcCWDLYSgvx+8QSVRyST7DIXy6grfjYRwWGtXwa7xFx/1p3lYqipo yj4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Bv1ogT90RuC+xirZVXkDvQDpzJvonn1wDJGSjENaNZc=; b=gWKBiTWBdO1r1sFs37Px9orLXiWvPJ6nbuDDh0sH3bE5jWzXRhzRbdOwNZvNm0JKXY JX/R12J5S1qOXZJp+vT/CZOmRv/UcWRuTihh5RVjmr406hTmAaZn+f1MIC5qYaMNluc8 SoHpDpyA3FKmYy3/cAPhItm7TTxrxg31Aaq64na4/3dqDLvi9zV1cuvDof34LZRnl6Cf Qlhc2USlLODzHqxRCMYvJwZiC9mVVsbOcn1WIcHW9V+rxt+7DkDj3nPKTSIs230ZCD9j 1OX5XIATV5GTHY9hn33OMxpAk0zlwrR4YVk0mTFdcNzvV7C39q7HntFOPQK1Zk8HMX1x uiLA== X-Gm-Message-State: AODbwcDxRN2ABLoGJgsiaKTvNfmE71N0bgeYE5khfPxpPRGqulVIIDos E4GHsqyn4hA6r1sL8ZY= X-Received: by 10.99.116.7 with SMTP id p7mr13595796pgc.162.1496530497521; Sat, 03 Jun 2017 15:54:57 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id f1sm40906041pgc.8.2017.06.03.15.54.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Jun 2017 15:54:56 -0700 (PDT) Subject: Re: svn commit: r319557 - head/sys/fs/ext2fs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1D3E8610-C022-4EFD-9E5A-1FE1DCE071B2"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201706032230.v53MUUAB056536@repo.freebsd.org> Date: Sat, 3 Jun 2017 15:54:55 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Pedro Giffuni Message-Id: <25EB123A-EAF7-4ADD-8834-93C2618315B6@gmail.com> References: <201706032230.v53MUUAB056536@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 22:54:58 -0000 --Apple-Mail=_1D3E8610-C022-4EFD-9E5A-1FE1DCE071B2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jun 3, 2017, at 15:30, Conrad Meyer wrote: > > Author: cem > Date: Sat Jun 3 22:30:30 2017 > New Revision: 319557 > URL: https://svnweb.freebsd.org/changeset/base/319557 > > Log: > ext2fs(4): Fix a number of broken flag checks > > Introduced in r319071. > > Reported by: Coverity > CIDs: 1375847, 1375848, 1375849 > Sponsored by: Dell EMC Isilon Did pjg review this? -Ngie --Apple-Mail=_1D3E8610-C022-4EFD-9E5A-1FE1DCE071B2 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZMz4/AAoJEPWDqSZpMIYV2Q4P/347qtY1TQSHp1aVe/3NAmmg md/oSGKbf0O7z23jqhxqLFZ7HiZ95igvkxpprBIbsl2+Bdv47Xb7KMBos9C18V2M Ndxaw4O68uSOM94Qs4yhDX0mof6/pSWMkTy+RXdsrePwVY0QCJRXx/glCXmMOkJ1 VaAvlBbPJkVcwmxUV3vqJ7xHYEp9uAQeShEx9QQ47xNdACK4k5+Yy3LSuJ3AQELE BftJ++KFZB4oi+tQafpegAsuOgo3hdneXwMkepdVo+KhDNYKCRbyzrgAPAem+chB I1PLff8WKTeo9o1YHXjhQgulsZkutHmIhN3Iv+Urg72GA/kgkk3dCDE0UIDcs7vV vk0mOQ55HoT2HPjvDEJLDek9crWdk8uhTLUzGwQsgm7UIRv0ges509pS4jTDb/0S 2vcboEvH4oXUFMK4sWJCWwx2W4oa0cm+L3voAEuSP0h5a3gc7W7yy6Nyt43OR2On 0UM5WyMtVUdAAnin6HwbBmQGureU0S/02kzIAMTEsrPwv5Lx2rfZaodkvKldpINT aeawjzTS6P11f3eCEP8ozS5ocA32yzYme3oJV7Pm/aCDpH3qm4zPfbf26b/cDjaR U4InVq+TGGUGs0YpluW9DEmAA74oylFu8jeyd7r+wT9C8HbXebdtXZaTArNPPWlb mS03+odhEuXZ+VmyG22h =8kdk -----END PGP SIGNATURE----- --Apple-Mail=_1D3E8610-C022-4EFD-9E5A-1FE1DCE071B2-- From owner-svn-src-head@freebsd.org Sat Jun 3 23:13:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA133BFAB40; Sat, 3 Jun 2017 23:13:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A298080F51; Sat, 3 Jun 2017 23:13:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53NDkFB076155; Sat, 3 Jun 2017 23:13:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53NDkWr076154; Sat, 3 Jun 2017 23:13:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706032313.v53NDkWr076154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Jun 2017 23:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319559 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 23:13:48 -0000 Author: bdrewery Date: Sat Jun 3 23:13:46 2017 New Revision: 319559 URL: https://svnweb.freebsd.org/changeset/base/319559 Log: native-xtools: Connect makewhatis. This speeds up some port staging, namely perl. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jun 3 22:39:50 2017 (r319558) +++ head/Makefile.inc1 Sat Jun 3 23:13:46 2017 (r319559) @@ -1964,7 +1964,7 @@ NXBMAKE= ${NXBENV} ${MAKE} \ MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \ MK_GDB=no MK_TESTS=no \ SSP_CFLAGS= \ - MK_HTML=no NO_LINT=yes MK_MAN=no \ + MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ @@ -2038,6 +2038,8 @@ native-xtools: .PHONY usr.bin/lex \ usr.bin/limits \ usr.bin/lorder \ + ${_libopenbsd} \ + ${_makewhatis} \ usr.bin/mktemp \ usr.bin/mt \ usr.bin/patch \