From owner-svn-src-stable@freebsd.org Sun Jun 25 05:46:04 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2773D8A133; Sun, 25 Jun 2017 05:46:04 +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 8044E84C40; Sun, 25 Jun 2017 05:46:04 +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 v5P5k3nU031976; Sun, 25 Jun 2017 05:46:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5P5k3CR031975; Sun, 25 Jun 2017 05:46:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706250546.v5P5k3CR031975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 25 Jun 2017 05:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320325 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jun 2017 05:46:04 -0000 Author: delphij Date: Sun Jun 25 05:46:03 2017 New Revision: 320325 URL: https://svnweb.freebsd.org/changeset/base/320325 Log: MFC r320216: Fix use-after-free introduced in r300388. In r300388, endnetconfig() was called on nc_handle which would release the associated netconfig structure, which means tmpnconf->nc_netid would be a use-after-free. Solve this by doing endnetconfig() in return paths instead. Reported by: jemalloc via kevlo Reviewed by: cem, ngie (earlier version) Modified: stable/10/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Sun Jun 25 01:41:07 2017 (r320324) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Sun Jun 25 05:46:03 2017 (r320325) @@ -499,14 +499,15 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } - endnetconfig(nc_handle); if (tmpnconf == NULL) { + endnetconfig(nc_handle); rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); return (NULL); } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ + endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-stable@freebsd.org Sun Jun 25 06:55:44 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 673B5D8B08B; Sun, 25 Jun 2017 06:55:44 +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 28E0116F0; Sun, 25 Jun 2017 06:55:44 +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 v5P6thF3060060; Sun, 25 Jun 2017 06:55:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5P6thTV060059; Sun, 25 Jun 2017 06:55:43 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706250655.v5P6thTV060059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 25 Jun 2017 06:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r320326 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jun 2017 06:55:44 -0000 Author: delphij Date: Sun Jun 25 06:55:42 2017 New Revision: 320326 URL: https://svnweb.freebsd.org/changeset/base/320326 Log: MFC r320216: Fix use-after-free introduced in r300388. In r300388, endnetconfig() was called on nc_handle which would release the associated netconfig structure, which means tmpnconf->nc_netid would be a use-after-free. Solve this by doing endnetconfig() in return paths instead. Reported by: jemalloc via kevlo Reviewed by: cem, ngie (earlier version) Modified: stable/9/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/9/lib/libc/rpc/rpcb_clnt.c Sun Jun 25 05:46:03 2017 (r320325) +++ stable/9/lib/libc/rpc/rpcb_clnt.c Sun Jun 25 06:55:42 2017 (r320326) @@ -508,14 +508,15 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } - endnetconfig(nc_handle); if (tmpnconf == NULL) { + endnetconfig(nc_handle); rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); return (NULL); } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ + endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-stable@freebsd.org Sun Jun 25 17:42:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD256D96614; Sun, 25 Jun 2017 17:42:28 +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 86EF377C2C; Sun, 25 Jun 2017 17:42:28 +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 v5PHgR0R030865; Sun, 25 Jun 2017 17:42:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5PHgRMf030864; Sun, 25 Jun 2017 17:42:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201706251742.v5PHgRMf030864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 25 Jun 2017 17:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320330 - stable/11/lib/libc/rpc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jun 2017 17:42:28 -0000 Author: delphij Date: Sun Jun 25 17:42:27 2017 New Revision: 320330 URL: https://svnweb.freebsd.org/changeset/base/320330 Log: MFC r320216: Fix use-after-free introduced in r300388. In r300388, endnetconfig() was called on nc_handle which would release the associated netconfig structure, which means tmpnconf->nc_netid would be a use-after-free. Solve this by doing endnetconfig() in return paths instead. Reported by: jemalloc via kevlo Reviewed by: cem, ngie (earlier version) Approved by: re (kib) Modified: stable/11/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/11/lib/libc/rpc/rpcb_clnt.c Sun Jun 25 15:21:51 2017 (r320329) +++ stable/11/lib/libc/rpc/rpcb_clnt.c Sun Jun 25 17:42:27 2017 (r320330) @@ -499,14 +499,15 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } - endnetconfig(nc_handle); if (tmpnconf == NULL) { + endnetconfig(nc_handle); rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); return (NULL); } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ + endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-stable@freebsd.org Sun Jun 25 18:01:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9BA8D96A69; Sun, 25 Jun 2017 18:01:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77F00782AB; Sun, 25 Jun 2017 18:01:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5PI1Rx0038162; Sun, 25 Jun 2017 18:01:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5PI1Ram038161; Sun, 25 Jun 2017 18:01:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706251801.v5PI1Ram038161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 25 Jun 2017 18:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320331 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jun 2017 18:01:28 -0000 Author: gjb Date: Sun Jun 25 18:01:27 2017 New Revision: 320331 URL: https://svnweb.freebsd.org/changeset/base/320331 Log: Fix an incorrect revision number. Submitted by: David Marec Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Jun 25 17:42:27 2017 (r320330) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Jun 25 18:01:27 2017 (r320331) @@ -882,7 +882,7 @@ multiple threads emit a UDP log_in_vain message concurrently. - The TCP stack has been changed to use the estimated RTT instead of timestamps for receive buffer auto resizing. From owner-svn-src-stable@freebsd.org Mon Jun 26 02:00:23 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72738D9EA21; Mon, 26 Jun 2017 02:00:23 +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 3FA0DEA; Mon, 26 Jun 2017 02:00:23 +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 v5Q20Me7034040; Mon, 26 Jun 2017 02:00:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q20M0A034039; Mon, 26 Jun 2017 02:00:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201706260200.v5Q20M0A034039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Jun 2017 02:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320346 - stable/10/contrib/libstdc++/config/abi/pre X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 02:00:23 -0000 Author: emaste Date: Mon Jun 26 02:00:22 2017 New Revision: 320346 URL: https://svnweb.freebsd.org/changeset/base/320346 Log: MFC r317159: libstdc++: fix symbol version script for LLD LLD is less tolerant of inconsistencies in the symbol version script. - Add a ; on the last entry in a version block - Remove duplicated symbols, retaining those in the earliest block PR: 214796 Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/libstdc++/config/abi/pre/gnu.ver Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libstdc++/config/abi/pre/gnu.ver ============================================================================== --- stable/10/contrib/libstdc++/config/abi/pre/gnu.ver Mon Jun 26 00:43:04 2017 (r320345) +++ stable/10/contrib/libstdc++/config/abi/pre/gnu.ver Mon Jun 26 02:00:22 2017 (r320346) @@ -121,7 +121,7 @@ GLIBCXX_3.4 { std::__moneypunct_cache*; std::__numpunct_cache*; std::__timepunct_cache*; - __gnu_debug::_Error_formatter* + __gnu_debug::_Error_formatter*; }; # Names not in an 'extern' block are mangled names. @@ -604,34 +604,6 @@ GLIBCXX_3.4.4 { } GLIBCXX_3.4.3; GLIBCXX_3.4.5 { - - # std::string - _ZNKSs11_M_disjunctEPKc; - _ZNKSs15_M_check_lengthE[jm][jm]PKc; - _ZNSs4_Rep26_M_set_length_and_sharableE*; - _ZNSs7_M_copyEPcPKc[jm]; - _ZNSs7_M_moveEPcPKc[jm]; - _ZNSs9_M_assignEPc[jm]c; - - # std::wstring - _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw; - _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthE[jm][jm]PKc; - _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableE*; - _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKw[jm]; - _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKw[jm]; - _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPw[jm]w; - - _ZNKSt13basic_fstreamI[cw]St11char_traitsI[cw]EE7is_openEv; - _ZNKSt14basic_ifstreamI[cw]St11char_traitsI[cw]EE7is_openEv; - _ZNKSt14basic_ofstreamI[cw]St11char_traitsI[cw]EE7is_openEv; - - _ZNSi6ignoreE[ilv]; - _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[ilv]; - - _ZNSt11char_traitsI[cw]E2eqERK[cw]S2_; - - _ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv; - } GLIBCXX_3.4.4; GLIBCXX_3.4.6 { @@ -642,8 +614,6 @@ GLIBCXX_3.4.6 { _ZNSt6locale5facet13_S_get_c_nameEv; _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv; - - _ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv; _ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv; From owner-svn-src-stable@freebsd.org Mon Jun 26 02:34:01 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CD91D9F458; Mon, 26 Jun 2017 02:34:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFFBC15ED; Mon, 26 Jun 2017 02:34:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5Q2Y0LR050180; Mon, 26 Jun 2017 02:34:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q2Y0rB050179; Mon, 26 Jun 2017 02:34:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201706260234.v5Q2Y0rB050179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 26 Jun 2017 02:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320348 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 02:34:01 -0000 Author: sephe Date: Mon Jun 26 02:33:59 2017 New Revision: 320348 URL: https://svnweb.freebsd.org/changeset/base/320348 Log: MFC 320184 hyperv/storvsc: Reduce log verbosity On some windows hosts TEST_UNIT_READY command will return SRB_STATUS_ERROR and sense data "NOT READY asc:3a,1 (Medium not present - tray closed)", this occurs periodically, and not hurt anything else. So, we prefer to ignore this kind of errors. PR: 219973 Submitted by: Hongjiang Zhang Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11271 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 26 02:25:19 2017 (r320347) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 26 02:33:59 2017 (r320348) @@ -2095,6 +2095,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp) struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; + const struct scsi_generic *cmd; /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { @@ -2145,16 +2146,14 @@ storvsc_io_done(struct hv_storvsc_request *reqp) callout_drain(&reqp->callout); } #endif + cmd = (const struct scsi_generic *) + ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; int srb_status = SRB_STATUS(vm_srb->srb_status); if (vm_srb->scsi_status == SCSI_STATUS_OK) { - const struct scsi_generic *cmd; - - cmd = (const struct scsi_generic *) - ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? - csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); if (srb_status != SRB_STATUS_SUCCESS) { /* * If there are errors, for example, invalid LUN, @@ -2252,11 +2251,23 @@ storvsc_io_done(struct hv_storvsc_request *reqp) } } } else { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc scsi_status = %d\n", - vm_srb->scsi_status); - mtx_unlock(&sc->hs_lock); + /** + * On Some Windows hosts TEST_UNIT_READY command can return + * SRB_STATUS_ERROR and sense data, for example, asc=0x3a,1 + * "(Medium not present - tray closed)". This error can be + * ignored since it will be sent to host periodically. + */ + boolean_t unit_not_ready = \ + vm_srb->scsi_status == SCSI_STATUS_CHECK_COND && + cmd->opcode == TEST_UNIT_READY && + srb_status == SRB_STATUS_ERROR; + if (!unit_not_ready && bootverbose) { + mtx_lock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, + "storvsc scsi_status = %d, srb_status = %d\n", + vm_srb->scsi_status, srb_status); + mtx_unlock(&sc->hs_lock); + } ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; } From owner-svn-src-stable@freebsd.org Mon Jun 26 05:42:37 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 332AEDA1FAC; Mon, 26 Jun 2017 05:42:37 +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 028C566F00; Mon, 26 Jun 2017 05:42:36 +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 v5Q5gabx030134; Mon, 26 Jun 2017 05:42:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q5gaZ4030133; Mon, 26 Jun 2017 05:42:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706260542.v5Q5gaZ4030133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 26 Jun 2017 05:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320349 - stable/11/etc/ntp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 05:42:37 -0000 Author: cy Date: Mon Jun 26 05:42:35 2017 New Revision: 320349 URL: https://svnweb.freebsd.org/changeset/base/320349 Log: MFC r320242, r320256: Update leap-seconds to leap-seconds.3676924800. As per https://datacenter.iers.org/eop/-/somos/5Rgv/latest/16: INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS) SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE SERVICE DE LA ROTATION TERRESTRE OBSERVATOIRE DE PARIS 61, Av. de l'Observatoire 75014 PARIS (France) Tel. : 33 (0) 1 40 51 23 35 FAX : 33 (0) 1 40 51 22 91 Internet : services.iers@obspm.fr Paris, 9 January 2017 Bulletin C 53 To authorities responsible for the measurement and distribution of time INFORMATION ON UTC - TAI NO leap second will be introduced at the end of June 2017. The difference between Coordinated Universal Time UTC and the International Atomic Time TAI is : from 2017 January 1, 0h UTC, until further notice : UTC-TAI = -37 s Leap seconds can be introduced in UTC at the end of the months of December or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every six months, either to announce a time step in UTC, or to confirm that there will be no time step at the next possible date. Christian BIZOUARD Director Earth Orientation Center of IERS Observatoire de Paris, France Obtained from: ftp://time.nist.gov/pub/leap-seconds.3676924800 Approved by: re@ (delphij@) Modified: stable/11/etc/ntp/leap-seconds Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp/leap-seconds ============================================================================== --- stable/11/etc/ntp/leap-seconds Mon Jun 26 02:33:59 2017 (r320348) +++ stable/11/etc/ntp/leap-seconds Mon Jun 26 05:42:35 2017 (r320349) @@ -1,10 +1,10 @@ # # In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until +# a comment, which continues from that symbol until # the end of the line. A plain comment line has a # whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace # character in column 2. # # A blank line should be ignored. @@ -15,17 +15,22 @@ # are transmitted by almost all time services. # # The first column shows an epoch as a number of seconds -# since 1900.0 and the second column shows the number of -# seconds that must be added to UTC to compute TAI for -# any timestamp at or after that epoch. The value on -# each line is valid from the indicated initial instant -# until the epoch given on the next one or indefinitely -# into the future if there is no next line. +# since 1 January 1900, 00:00:00 (1900.0 is also used to +# indicate the same epoch.) Both of these time stamp formats +# ignore the complexities of the time scales that were +# used before the current definition of UTC at the start +# of 1972. (See note 3 below.) +# The second column shows the number of seconds that +# must be added to UTC to compute TAI for any timestamp +# at or after that epoch. The value on each line is +# valid from the indicated initial instant until the +# epoch given on the next one or indefinitely into the +# future if there is no next line. # (The comment on each line shows the representation of -# the corresponding initial epoch in the usual +# the corresponding initial epoch in the usual # day-month-year format. The epoch always begins at # 00:00:00 UTC on the indicated day. See Note 5 below.) -# +# # Important notes: # # 1. Coordinated Universal Time (UTC) is often referred to @@ -33,7 +38,7 @@ # longer used, and the use of GMT to designate UTC is # discouraged. # -# 2. The UTC time scale is realized by many national +# 2. The UTC time scale is realized by many national # laboratories and timing centers. Each laboratory # identifies its realization with its name: Thus # UTC(NIST), UTC(USNO), etc. The differences among @@ -42,12 +47,12 @@ # and can be ignored for many purposes. These differences # are tabulated in Circular T, which is published monthly # by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.fr for more information. +# (BIPM). See www.bipm.org for more information. # -# 3. The current defintion of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before than epoch, and it can be -# quite difficult to compute precise timestamps and time +# 3. The current definition of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before that epoch, and it can be +# quite difficult to compute precise timestamps and time # intervals in those "prehistoric" days. For more information, # consult: # @@ -58,36 +63,34 @@ # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, # July, 1991. # -# 4. The insertion of leap seconds into UTC is currently the -# responsibility of the International Earth Rotation Service, -# which is located at the Paris Observatory: +# 4. The decision to insert a leap second into UTC is currently +# the responsibility of the International Earth Rotation and +# Reference Systems Service. (The name was changed from the +# International Earth Rotation Service, but the acronym IERS +# is still used.) # -# Central Bureau of IERS -# 61, Avenue de l'Observatoire -# 75014 Paris, France. +# Leap seconds are announced by the IERS in its Bulletin C. # -# Leap seconds are announced by the IERS in its Bulletin C +# See www.iers.org for more details. # -# See hpiers.obspm.fr or www.iers.org for more details. +# Every national laboratory and timing center uses the +# data from the BIPM and the IERS to construct UTC(lab), +# their local realization of UTC. # -# All national laboratories and timing centers use the -# data from the BIPM and the IERS to construct their -# local realizations of UTC. -# # Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the # foreseeable future. # # 5. If your system keeps time as the number of seconds since # some epoch (e.g., NTP timestamps), then the algorithm for # assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI # timestamp would be obtained by advancing to the next entry in the # following table when the time equivalent to 23:59:59 UTC # is used for the second time. Thus the leap second which @@ -102,7 +105,7 @@ # # If your system realizes the leap second by repeating 00:00:00 UTC twice # (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivlent to +# in the table must occur the second time that a time equivalent to # 00:00:00 UTC is used. Thus, using the same example as above: # # ... @@ -112,66 +115,94 @@ # ... # # in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. +# time scale with no discontinuity in the time interval. However, +# although the long-term behavior of the time scale is correct in both +# methods, the second method is technically not correct because it adds +# the extra second to the wrong day. # -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch # during the leap second does not arise. # +# Some systems implement leap seconds by amortizing the leap second +# over the last few minutes of the day. The frequency of the local +# clock is decreased (or increased) to realize the positive (or +# negative) leap second. This method removes the time step described +# above. Although the long-term behavior of the time scale is correct +# in this case, this method introduces an error during the adjustment +# period both in time and in frequency with respect to the official +# definition of UTC. +# # Questions or comments to: -# Jeff Prillaman -# Time Service Department -# US Naval Observatory -# Washington, DC -# jeffrey.prillaman@usno.navy.mil +# Judah Levine +# Time and Frequency Division +# NIST +# Boulder, Colorado +# Judah.Levine@nist.gov # -# Last Update of leap second values: 6 Jul 2016 +# Last Update of leap second values: 8 July 2016 # -# The following line shows this last update date in NTP timestamp +# The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to # the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two +# be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3676752000 +#$ 3676924800 # -# The data in this file will be updated periodically as new leap +# The NTP timestamps are in units of seconds since the NTP epoch, +# which is 1 January 1900, 00:00:00. The Modified Julian Day number +# corresponding to the NTP time stamp, X, can be computed as +# +# X/86400 + 15020 +# +# where the first term converts seconds to days and the second +# term adds the MJD corresponding to the time origin defined above. +# The integer portion of the result is the integer MJD for that +# day, and any remainder is the time of day, expressed as the +# fraction of the day since 0 hours UTC. The conversion from day +# fraction to seconds or to hours, minutes, and seconds may involve +# rounding or truncation, depending on the method used in the +# computation. +# +# The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic +# above, the update time (in NTP format) will be added to the basic # file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to +# In addition, the generic name leap-seconds.list will always point to # the most recent version of the file. # # This update procedure will be performed only when a new leap second -# is announced. +# is announced. # # The following entry specifies the expiration date of the data -# in this file in units of seconds since 1900.0. This expiration date -# will be changed at least twice per year whether or not a new leap -# second is announced. These semi-annual changes will be made no -# later than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, +# in this file in units of seconds since the origin at the instant +# 1 January 1900, 00:00:00. This expiration date will be changed +# at least twice per year whether or not a new leap second is +# announced. These semi-annual changes will be made no later +# than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, # respectively. (These are the customary effective dates for new # leap seconds.) This expiration date will be identified by a # unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an +# In the unlikely event that a leap second is announced with an # effective date other than 30 June or 31 December, then this # file will be edited to include that leap second as soon as it is # announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will # be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file +# current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 52 -# File expires on: 1 Jun 2017 +# Updated through IERS Bulletin C53 +# File expires on: 28 December 2017 # -#@ 3705264000 +#@ 3723408000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -205,16 +236,15 @@ # the following special comment contains the # hash value of the data in this file computed # use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/sha for +# by FIPS 180-1. See the files in ~/pub/sha for # the details of how this hash value is # computed. Note that the hash computation # ignores comments and whitespace characters # in data lines. It includes the NTP values -# of both the last modification time and the +# of both the last modification time and the # expiration time of the file, but not the # white space on those lines. # the hash line is also ignored in the # computation. # -#h 63f8fea8 587c099d abcf130a ad525eae 3e105052 -# +#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d From owner-svn-src-stable@freebsd.org Mon Jun 26 05:43:45 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4972DA202A; Mon, 26 Jun 2017 05:43:45 +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 B0ED06702D; Mon, 26 Jun 2017 05:43:45 +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 v5Q5hiJB030221; Mon, 26 Jun 2017 05:43:44 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q5hipu030220; Mon, 26 Jun 2017 05:43:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706260543.v5Q5hipu030220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 26 Jun 2017 05:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320350 - stable/10/etc/ntp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 05:43:46 -0000 Author: cy Date: Mon Jun 26 05:43:44 2017 New Revision: 320350 URL: https://svnweb.freebsd.org/changeset/base/320350 Log: MFC r320242, r320256: Update leap-seconds to leap-seconds.3676924800. As per https://datacenter.iers.org/eop/-/somos/5Rgv/latest/16: INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS) SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE SERVICE DE LA ROTATION TERRESTRE OBSERVATOIRE DE PARIS 61, Av. de l'Observatoire 75014 PARIS (France) Tel. : 33 (0) 1 40 51 23 35 FAX : 33 (0) 1 40 51 22 91 Internet : services.iers@obspm.fr Paris, 9 January 2017 Bulletin C 53 To authorities responsible for the measurement and distribution of time INFORMATION ON UTC - TAI NO leap second will be introduced at the end of June 2017. The difference between Coordinated Universal Time UTC and the International Atomic Time TAI is : from 2017 January 1, 0h UTC, until further notice : UTC-TAI = -37 s Leap seconds can be introduced in UTC at the end of the months of December or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every six months, either to announce a time step in UTC, or to confirm that there will be no time step at the next possible date. Christian BIZOUARD Director Earth Orientation Center of IERS Observatoire de Paris, France Obtained from: ftp://time.nist.gov/pub/leap-seconds.3676924800 Modified: stable/10/etc/ntp/leap-seconds Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/ntp/leap-seconds ============================================================================== --- stable/10/etc/ntp/leap-seconds Mon Jun 26 05:42:35 2017 (r320349) +++ stable/10/etc/ntp/leap-seconds Mon Jun 26 05:43:44 2017 (r320350) @@ -1,10 +1,10 @@ # # In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until +# a comment, which continues from that symbol until # the end of the line. A plain comment line has a # whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace # character in column 2. # # A blank line should be ignored. @@ -15,17 +15,22 @@ # are transmitted by almost all time services. # # The first column shows an epoch as a number of seconds -# since 1900.0 and the second column shows the number of -# seconds that must be added to UTC to compute TAI for -# any timestamp at or after that epoch. The value on -# each line is valid from the indicated initial instant -# until the epoch given on the next one or indefinitely -# into the future if there is no next line. +# since 1 January 1900, 00:00:00 (1900.0 is also used to +# indicate the same epoch.) Both of these time stamp formats +# ignore the complexities of the time scales that were +# used before the current definition of UTC at the start +# of 1972. (See note 3 below.) +# The second column shows the number of seconds that +# must be added to UTC to compute TAI for any timestamp +# at or after that epoch. The value on each line is +# valid from the indicated initial instant until the +# epoch given on the next one or indefinitely into the +# future if there is no next line. # (The comment on each line shows the representation of -# the corresponding initial epoch in the usual +# the corresponding initial epoch in the usual # day-month-year format. The epoch always begins at # 00:00:00 UTC on the indicated day. See Note 5 below.) -# +# # Important notes: # # 1. Coordinated Universal Time (UTC) is often referred to @@ -33,7 +38,7 @@ # longer used, and the use of GMT to designate UTC is # discouraged. # -# 2. The UTC time scale is realized by many national +# 2. The UTC time scale is realized by many national # laboratories and timing centers. Each laboratory # identifies its realization with its name: Thus # UTC(NIST), UTC(USNO), etc. The differences among @@ -42,12 +47,12 @@ # and can be ignored for many purposes. These differences # are tabulated in Circular T, which is published monthly # by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.fr for more information. +# (BIPM). See www.bipm.org for more information. # -# 3. The current defintion of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before than epoch, and it can be -# quite difficult to compute precise timestamps and time +# 3. The current definition of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before that epoch, and it can be +# quite difficult to compute precise timestamps and time # intervals in those "prehistoric" days. For more information, # consult: # @@ -58,36 +63,34 @@ # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, # July, 1991. # -# 4. The insertion of leap seconds into UTC is currently the -# responsibility of the International Earth Rotation Service, -# which is located at the Paris Observatory: +# 4. The decision to insert a leap second into UTC is currently +# the responsibility of the International Earth Rotation and +# Reference Systems Service. (The name was changed from the +# International Earth Rotation Service, but the acronym IERS +# is still used.) # -# Central Bureau of IERS -# 61, Avenue de l'Observatoire -# 75014 Paris, France. +# Leap seconds are announced by the IERS in its Bulletin C. # -# Leap seconds are announced by the IERS in its Bulletin C +# See www.iers.org for more details. # -# See hpiers.obspm.fr or www.iers.org for more details. +# Every national laboratory and timing center uses the +# data from the BIPM and the IERS to construct UTC(lab), +# their local realization of UTC. # -# All national laboratories and timing centers use the -# data from the BIPM and the IERS to construct their -# local realizations of UTC. -# # Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the # foreseeable future. # # 5. If your system keeps time as the number of seconds since # some epoch (e.g., NTP timestamps), then the algorithm for # assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI # timestamp would be obtained by advancing to the next entry in the # following table when the time equivalent to 23:59:59 UTC # is used for the second time. Thus the leap second which @@ -102,7 +105,7 @@ # # If your system realizes the leap second by repeating 00:00:00 UTC twice # (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivlent to +# in the table must occur the second time that a time equivalent to # 00:00:00 UTC is used. Thus, using the same example as above: # # ... @@ -112,66 +115,94 @@ # ... # # in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. +# time scale with no discontinuity in the time interval. However, +# although the long-term behavior of the time scale is correct in both +# methods, the second method is technically not correct because it adds +# the extra second to the wrong day. # -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch # during the leap second does not arise. # +# Some systems implement leap seconds by amortizing the leap second +# over the last few minutes of the day. The frequency of the local +# clock is decreased (or increased) to realize the positive (or +# negative) leap second. This method removes the time step described +# above. Although the long-term behavior of the time scale is correct +# in this case, this method introduces an error during the adjustment +# period both in time and in frequency with respect to the official +# definition of UTC. +# # Questions or comments to: -# Jeff Prillaman -# Time Service Department -# US Naval Observatory -# Washington, DC -# jeffrey.prillaman@usno.navy.mil +# Judah Levine +# Time and Frequency Division +# NIST +# Boulder, Colorado +# Judah.Levine@nist.gov # -# Last Update of leap second values: 6 Jul 2016 +# Last Update of leap second values: 8 July 2016 # -# The following line shows this last update date in NTP timestamp +# The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to # the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two +# be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3676752000 +#$ 3676924800 # -# The data in this file will be updated periodically as new leap +# The NTP timestamps are in units of seconds since the NTP epoch, +# which is 1 January 1900, 00:00:00. The Modified Julian Day number +# corresponding to the NTP time stamp, X, can be computed as +# +# X/86400 + 15020 +# +# where the first term converts seconds to days and the second +# term adds the MJD corresponding to the time origin defined above. +# The integer portion of the result is the integer MJD for that +# day, and any remainder is the time of day, expressed as the +# fraction of the day since 0 hours UTC. The conversion from day +# fraction to seconds or to hours, minutes, and seconds may involve +# rounding or truncation, depending on the method used in the +# computation. +# +# The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic +# above, the update time (in NTP format) will be added to the basic # file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to +# In addition, the generic name leap-seconds.list will always point to # the most recent version of the file. # # This update procedure will be performed only when a new leap second -# is announced. +# is announced. # # The following entry specifies the expiration date of the data -# in this file in units of seconds since 1900.0. This expiration date -# will be changed at least twice per year whether or not a new leap -# second is announced. These semi-annual changes will be made no -# later than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, +# in this file in units of seconds since the origin at the instant +# 1 January 1900, 00:00:00. This expiration date will be changed +# at least twice per year whether or not a new leap second is +# announced. These semi-annual changes will be made no later +# than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, # respectively. (These are the customary effective dates for new # leap seconds.) This expiration date will be identified by a # unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an +# In the unlikely event that a leap second is announced with an # effective date other than 30 June or 31 December, then this # file will be edited to include that leap second as soon as it is # announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will # be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file +# current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 52 -# File expires on: 1 Jun 2017 +# Updated through IERS Bulletin C53 +# File expires on: 28 December 2017 # -#@ 3705264000 +#@ 3723408000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -205,16 +236,15 @@ # the following special comment contains the # hash value of the data in this file computed # use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/sha for +# by FIPS 180-1. See the files in ~/pub/sha for # the details of how this hash value is # computed. Note that the hash computation # ignores comments and whitespace characters # in data lines. It includes the NTP values -# of both the last modification time and the +# of both the last modification time and the # expiration time of the file, but not the # white space on those lines. # the hash line is also ignored in the # computation. # -#h 63f8fea8 587c099d abcf130a ad525eae 3e105052 -# +#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d From owner-svn-src-stable@freebsd.org Mon Jun 26 05:56:50 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C978ADA22C9; Mon, 26 Jun 2017 05:56:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8281567534; Mon, 26 Jun 2017 05:56:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5Q5uniu034243; Mon, 26 Jun 2017 05:56:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q5unK3034242; Mon, 26 Jun 2017 05:56:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201706260556.v5Q5unK3034242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 26 Jun 2017 05:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320351 - stable/11/sys/dev/hyperv/storvsc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 05:56:50 -0000 Author: sephe Date: Mon Jun 26 05:56:49 2017 New Revision: 320351 URL: https://svnweb.freebsd.org/changeset/base/320351 Log: MFC 320184 hyperv/storvsc: Reduce log verbosity On some windows hosts TEST_UNIT_READY command will return SRB_STATUS_ERROR and sense data "NOT READY asc:3a,1 (Medium not present - tray closed)", this occurs periodically, and not hurt anything else. So, we prefer to ignore this kind of errors. Approved by: re (delphij) PR: 219973 Submitted by: Hongjiang Zhang Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11271 Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 26 05:43:44 2017 (r320350) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 26 05:56:49 2017 (r320351) @@ -2095,6 +2095,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp) struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; + const struct scsi_generic *cmd; /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { @@ -2145,16 +2146,14 @@ storvsc_io_done(struct hv_storvsc_request *reqp) callout_drain(&reqp->callout); } #endif + cmd = (const struct scsi_generic *) + ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; int srb_status = SRB_STATUS(vm_srb->srb_status); if (vm_srb->scsi_status == SCSI_STATUS_OK) { - const struct scsi_generic *cmd; - - cmd = (const struct scsi_generic *) - ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? - csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); if (srb_status != SRB_STATUS_SUCCESS) { /* * If there are errors, for example, invalid LUN, @@ -2252,11 +2251,23 @@ storvsc_io_done(struct hv_storvsc_request *reqp) } } } else { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc scsi_status = %d\n", - vm_srb->scsi_status); - mtx_unlock(&sc->hs_lock); + /** + * On Some Windows hosts TEST_UNIT_READY command can return + * SRB_STATUS_ERROR and sense data, for example, asc=0x3a,1 + * "(Medium not present - tray closed)". This error can be + * ignored since it will be sent to host periodically. + */ + boolean_t unit_not_ready = \ + vm_srb->scsi_status == SCSI_STATUS_CHECK_COND && + cmd->opcode == TEST_UNIT_READY && + srb_status == SRB_STATUS_ERROR; + if (!unit_not_ready && bootverbose) { + mtx_lock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, + "storvsc scsi_status = %d, srb_status = %d\n", + vm_srb->scsi_status, srb_status); + mtx_unlock(&sc->hs_lock); + } ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; } From owner-svn-src-stable@freebsd.org Mon Jun 26 09:32:59 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 236D7DA5AFB; Mon, 26 Jun 2017 09:32:59 +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 E5A197111A; Mon, 26 Jun 2017 09:32:58 +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 v5Q9WwnP023674; Mon, 26 Jun 2017 09:32:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q9WwKP023673; Mon, 26 Jun 2017 09:32:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706260932.v5Q9WwKP023673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 26 Jun 2017 09:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320354 - stable/11/sys/dev/jedec_ts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 09:32:59 -0000 Author: avg Date: Mon Jun 26 09:32:57 2017 New Revision: 320354 URL: https://svnweb.freebsd.org/changeset/base/320354 Log: MFC r320259: jedec_ts: read device id from the correct register Approved by: re (marius) Modified: stable/11/sys/dev/jedec_ts/jedec_ts.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/jedec_ts/jedec_ts.c ============================================================================== --- stable/11/sys/dev/jedec_ts/jedec_ts.c Mon Jun 26 09:13:25 2017 (r320353) +++ stable/11/sys/dev/jedec_ts/jedec_ts.c Mon Jun 26 09:32:57 2017 (r320354) @@ -114,7 +114,7 @@ ts_attach(device_t dev) device_printf(dev, "failed to read Manufacturer ID\n"); return (ENXIO); } - err = ts_readw_be(dev, 6, &devid); + err = ts_readw_be(dev, 7, &devid); if (err != 0) { device_printf(dev, "failed to read Device ID\n"); return (ENXIO); From owner-svn-src-stable@freebsd.org Mon Jun 26 09:34:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AA20DA5B73; Mon, 26 Jun 2017 09:34:42 +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 586E971270; Mon, 26 Jun 2017 09:34:42 +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 v5Q9YfGP023848; Mon, 26 Jun 2017 09:34:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5Q9YfHK023847; Mon, 26 Jun 2017 09:34:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706260934.v5Q9YfHK023847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 26 Jun 2017 09:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320355 - stable/10/sys/dev/jedec_ts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 09:34:42 -0000 Author: avg Date: Mon Jun 26 09:34:41 2017 New Revision: 320355 URL: https://svnweb.freebsd.org/changeset/base/320355 Log: MFC r320259: jedec_ts: read device id from the correct register Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c ============================================================================== --- stable/10/sys/dev/jedec_ts/jedec_ts.c Mon Jun 26 09:32:57 2017 (r320354) +++ stable/10/sys/dev/jedec_ts/jedec_ts.c Mon Jun 26 09:34:41 2017 (r320355) @@ -114,7 +114,7 @@ ts_attach(device_t dev) device_printf(dev, "failed to read Manufacturer ID\n"); return (ENXIO); } - err = ts_readw_be(dev, 6, &devid); + err = ts_readw_be(dev, 7, &devid); if (err != 0) { device_printf(dev, "failed to read Device ID\n"); return (ENXIO); From owner-svn-src-stable@freebsd.org Mon Jun 26 12:17:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD01DA90E2; Mon, 26 Jun 2017 12:17:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0DF76563; Mon, 26 Jun 2017 12:17:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QCH4eP090153; Mon, 26 Jun 2017 12:17:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QCH4nM090152; Mon, 26 Jun 2017 12:17:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706261217.v5QCH4nM090152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Jun 2017 12:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320356 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 12:17:05 -0000 Author: kib Date: Mon Jun 26 12:17:04 2017 New Revision: 320356 URL: https://svnweb.freebsd.org/changeset/base/320356 Log: MFC r320108: Allow negative aio_offset only for the read and write LIO ops on device nodes. Approved by: re (marius) Modified: stable/11/sys/kern/vfs_aio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_aio.c ============================================================================== --- stable/11/sys/kern/vfs_aio.c Mon Jun 26 09:34:41 2017 (r320355) +++ stable/11/sys/kern/vfs_aio.c Mon Jun 26 12:17:04 2017 (r320356) @@ -1550,7 +1550,9 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru goto aqueue_fail; } - if (opcode != LIO_SYNC && job->uaiocb.aio_offset == -1LL) { + if ((opcode == LIO_READ || opcode == LIO_WRITE) && + job->uaiocb.aio_offset < 0 && + (fp->f_vnode == NULL || fp->f_vnode->v_type != VCHR)) { error = EINVAL; goto aqueue_fail; } From owner-svn-src-stable@freebsd.org Mon Jun 26 12:30:40 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7D6DDA99BD; Mon, 26 Jun 2017 12:30:40 +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 7E8CB77047; Mon, 26 Jun 2017 12:30:40 +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 v5QCUduZ094395; Mon, 26 Jun 2017 12:30:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QCUdaT094392; Mon, 26 Jun 2017 12:30:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706261230.v5QCUdaT094392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Jun 2017 12:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320357 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 12:30:40 -0000 Author: kib Date: Mon Jun 26 12:30:39 2017 New Revision: 320357 URL: https://svnweb.freebsd.org/changeset/base/320357 Log: MFC r320125: Fix batched unload for DMAR busdma in qi mode. Approved by: re (marius) Modified: stable/11/sys/x86/iommu/intel_ctx.c stable/11/sys/x86/iommu/intel_dmar.h stable/11/sys/x86/iommu/intel_qi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/11/sys/x86/iommu/intel_ctx.c Mon Jun 26 12:17:04 2017 (r320356) +++ stable/11/sys/x86/iommu/intel_ctx.c Mon Jun 26 12:30:39 2017 (r320357) @@ -703,7 +703,7 @@ dmar_domain_unload_entry(struct dmar_map_entry *entry, if (unit->qi_enabled) { DMAR_LOCK(unit); dmar_qi_invalidate_locked(entry->domain, entry->start, - entry->end - entry->start, &entry->gseq); + entry->end - entry->start, &entry->gseq, true); if (!free) entry->flags |= DMAR_MAP_ENTRY_QI_NF; TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); @@ -715,16 +715,14 @@ dmar_domain_unload_entry(struct dmar_map_entry *entry, } } -static struct dmar_qi_genseq * -dmar_domain_unload_gseq(struct dmar_domain *domain, - struct dmar_map_entry *entry, struct dmar_qi_genseq *gseq) +static bool +dmar_domain_unload_emit_wait(struct dmar_domain *domain, + struct dmar_map_entry *entry) { - if (TAILQ_NEXT(entry, dmamap_link) != NULL) - return (NULL); - if (domain->batch_no++ % dmar_batch_coalesce != 0) - return (NULL); - return (gseq); + if (TAILQ_NEXT(entry, dmamap_link) == NULL) + return (true); + return (domain->batch_no++ % dmar_batch_coalesce == 0); } void @@ -733,7 +731,6 @@ dmar_domain_unload(struct dmar_domain *domain, { struct dmar_unit *unit; struct dmar_map_entry *entry, *entry1; - struct dmar_qi_genseq gseq; int error; unit = domain->dmar; @@ -757,17 +754,11 @@ dmar_domain_unload(struct dmar_domain *domain, KASSERT(unit->qi_enabled, ("loaded entry left")); DMAR_LOCK(unit); TAILQ_FOREACH(entry, entries, dmamap_link) { - entry->gseq.gen = 0; - entry->gseq.seq = 0; dmar_qi_invalidate_locked(domain, entry->start, entry->end - - entry->start, dmar_domain_unload_gseq(domain, entry, - &gseq)); + entry->start, &entry->gseq, + dmar_domain_unload_emit_wait(domain, entry)); } - TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { - entry->gseq = gseq; - TAILQ_REMOVE(entries, entry, dmamap_link); - TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); - } + TAILQ_CONCAT(&unit->tlb_flush_entries, entries, dmamap_link); DMAR_UNLOCK(unit); } Modified: stable/11/sys/x86/iommu/intel_dmar.h ============================================================================== --- stable/11/sys/x86/iommu/intel_dmar.h Mon Jun 26 12:17:04 2017 (r320356) +++ stable/11/sys/x86/iommu/intel_dmar.h Mon Jun 26 12:30:39 2017 (r320357) @@ -305,7 +305,7 @@ void dmar_disable_qi_intr(struct dmar_unit *unit); int dmar_init_qi(struct dmar_unit *unit); void dmar_fini_qi(struct dmar_unit *unit); void dmar_qi_invalidate_locked(struct dmar_domain *domain, dmar_gaddr_t start, - dmar_gaddr_t size, struct dmar_qi_genseq *pseq); + dmar_gaddr_t size, struct dmar_qi_genseq *psec, bool emit_wait); void dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit); void dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit); void dmar_qi_invalidate_iec_glob(struct dmar_unit *unit); Modified: stable/11/sys/x86/iommu/intel_qi.c ============================================================================== --- stable/11/sys/x86/iommu/intel_qi.c Mon Jun 26 12:17:04 2017 (r320356) +++ stable/11/sys/x86/iommu/intel_qi.c Mon Jun 26 12:30:39 2017 (r320357) @@ -171,7 +171,8 @@ dmar_qi_emit_wait_descr(struct dmar_unit *unit, uint32 } static void -dmar_qi_emit_wait_seq(struct dmar_unit *unit, struct dmar_qi_genseq *pseq) +dmar_qi_emit_wait_seq(struct dmar_unit *unit, struct dmar_qi_genseq *pseq, + bool emit_wait) { struct dmar_qi_genseq gsec; uint32_t seq; @@ -192,7 +193,10 @@ dmar_qi_emit_wait_seq(struct dmar_unit *unit, struct d seq = unit->inv_waitd_seq++; pseq->gen = unit->inv_waitd_gen; pseq->seq = seq; - dmar_qi_emit_wait_descr(unit, seq, true, true, false); + if (emit_wait) { + dmar_qi_ensure(unit, 1); + dmar_qi_emit_wait_descr(unit, seq, true, true, false); + } } static void @@ -215,7 +219,7 @@ dmar_qi_wait_for_seq(struct dmar_unit *unit, const str void dmar_qi_invalidate_locked(struct dmar_domain *domain, dmar_gaddr_t base, - dmar_gaddr_t size, struct dmar_qi_genseq *pseq) + dmar_gaddr_t size, struct dmar_qi_genseq *pseq, bool emit_wait) { struct dmar_unit *unit; dmar_gaddr_t isize; @@ -232,10 +236,7 @@ dmar_qi_invalidate_locked(struct dmar_domain *domain, DMAR_IQ_DESCR_IOTLB_DID(domain->domain), base | am); } - if (pseq != NULL) { - dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_seq(unit, pseq); - } + dmar_qi_emit_wait_seq(unit, pseq, emit_wait); dmar_qi_advance_tail(unit); } @@ -247,7 +248,7 @@ dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *u DMAR_ASSERT_LOCKED(unit); dmar_qi_ensure(unit, 2); dmar_qi_emit(unit, DMAR_IQ_DESCR_CTX_INV | DMAR_IQ_DESCR_CTX_GLOB, 0); - dmar_qi_emit_wait_seq(unit, &gseq); + dmar_qi_emit_wait_seq(unit, &gseq, true); dmar_qi_advance_tail(unit); dmar_qi_wait_for_seq(unit, &gseq, false); } @@ -261,7 +262,7 @@ dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit dmar_qi_ensure(unit, 2); dmar_qi_emit(unit, DMAR_IQ_DESCR_IOTLB_INV | DMAR_IQ_DESCR_IOTLB_GLOB | DMAR_IQ_DESCR_IOTLB_DW | DMAR_IQ_DESCR_IOTLB_DR, 0); - dmar_qi_emit_wait_seq(unit, &gseq); + dmar_qi_emit_wait_seq(unit, &gseq, true); dmar_qi_advance_tail(unit); dmar_qi_wait_for_seq(unit, &gseq, false); } @@ -274,7 +275,7 @@ dmar_qi_invalidate_iec_glob(struct dmar_unit *unit) DMAR_ASSERT_LOCKED(unit); dmar_qi_ensure(unit, 2); dmar_qi_emit(unit, DMAR_IQ_DESCR_IEC_INV, 0); - dmar_qi_emit_wait_seq(unit, &gseq); + dmar_qi_emit_wait_seq(unit, &gseq, true); dmar_qi_advance_tail(unit); dmar_qi_wait_for_seq(unit, &gseq, false); } @@ -298,7 +299,7 @@ dmar_qi_invalidate_iec(struct dmar_unit *unit, u_int s DMAR_IQ_DESCR_IEC_IM(l), 0); } dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_seq(unit, &gseq); + dmar_qi_emit_wait_seq(unit, &gseq, true); dmar_qi_advance_tail(unit); /* @@ -344,8 +345,7 @@ dmar_qi_task(void *arg, int pending __unused) entry = TAILQ_FIRST(&unit->tlb_flush_entries); if (entry == NULL) break; - if ((entry->gseq.gen == 0 && entry->gseq.seq == 0) || - !dmar_qi_seq_processed(unit, &entry->gseq)) + if (!dmar_qi_seq_processed(unit, &entry->gseq)) break; TAILQ_REMOVE(&unit->tlb_flush_entries, entry, dmamap_link); DMAR_UNLOCK(unit); @@ -432,7 +432,7 @@ dmar_fini_qi(struct dmar_unit *unit) DMAR_LOCK(unit); /* quisce */ dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_seq(unit, &gseq); + dmar_qi_emit_wait_seq(unit, &gseq, true); dmar_qi_advance_tail(unit); dmar_qi_wait_for_seq(unit, &gseq, false); /* only after the quisce, disable queue */ From owner-svn-src-stable@freebsd.org Mon Jun 26 12:37:13 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A2FCDA9C1A; Mon, 26 Jun 2017 12:37:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4F21774B1; Mon, 26 Jun 2017 12:37:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QCbBoP098193; Mon, 26 Jun 2017 12:37:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QCbBgY098192; Mon, 26 Jun 2017 12:37:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706261237.v5QCbBgY098192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Jun 2017 12:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320358 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 12:37:13 -0000 Author: kib Date: Mon Jun 26 12:37:11 2017 New Revision: 320358 URL: https://svnweb.freebsd.org/changeset/base/320358 Log: MFC r320121: Ignore the P_SYSTEM process flag, and do not request VM_MAP_WIRE_SYSTEM mode when wiring the newly grown stack. Approved by: re (marius) Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Mon Jun 26 12:30:39 2017 (r320357) +++ stable/11/sys/vm/vm_map.c Mon Jun 26 12:37:11 2017 (r320358) @@ -3891,9 +3891,7 @@ Retry: vm_map_wire(map, (stack_entry == next_entry) ? addr : addr - grow_amount, (stack_entry == next_entry) ? stack_entry->start : addr, - (p->p_flag & P_SYSTEM) - ? VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES - : VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); } out: From owner-svn-src-stable@freebsd.org Mon Jun 26 15:23:13 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF6C1D89C2C; Mon, 26 Jun 2017 15:23:13 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1E37D068; Mon, 26 Jun 2017 15:23:13 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QFNCI4068094; Mon, 26 Jun 2017 15:23:12 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QFNCBZ068093; Mon, 26 Jun 2017 15:23:12 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201706261523.v5QFNCBZ068093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 26 Jun 2017 15:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320361 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 15:23:13 -0000 Author: ken Date: Mon Jun 26 15:23:12 2017 New Revision: 320361 URL: https://svnweb.freebsd.org/changeset/base/320361 Log: MFC r320123: Fix a potential sleep while holding a mutex in the sa(4) driver. If the user issues a MTIOCEXTGET ioctl, and the tape drive in question has a serial number that is longer than 80 characters, we malloc a buffer in saextget() to hold the output of cam_strvis(). Since a mutex is held in that codepath, doing a M_WAITOK malloc could lead to sleeping while holding a mutex. Change it to a M_NOWAIT malloc and bail out if we fail to allocate the memory. Devices with serial numbers longer than 80 bytes are very rare (I don't recall seeing one), so this should be a very unusual case to hit. But it is a bug that should be fixed. sys/cam/scsi/scsi_sa.c: In saextget(), if we need to malloc a buffer to hold the output of cam_strvis(), don't wait for the memory. Fail and return an error if we can't allocate the memory immediately. PR: kern/220094 Submitted by: Jia-Ju Bai Sponsored by: Spectra Logic Modified: stable/10/sys/cam/scsi/scsi_sa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sa.c Mon Jun 26 13:14:41 2017 (r320360) +++ stable/10/sys/cam/scsi/scsi_sa.c Mon Jun 26 15:23:12 2017 (r320361) @@ -4464,7 +4464,18 @@ saextget(struct cdev *dev, struct cam_periph *periph, if (cgd.serial_num_len > sizeof(tmpstr)) { ts2_len = cgd.serial_num_len + 1; ts2_malloc = 1; - tmpstr2 = malloc(ts2_len, M_SCSISA, M_WAITOK | M_ZERO); + tmpstr2 = malloc(ts2_len, M_SCSISA, M_NOWAIT | M_ZERO); + /* + * The 80 characters allocated on the stack above + * will handle the vast majority of serial numbers. + * If we run into one that is larger than that, and + * we can't malloc the length without blocking, + * bail out with an out of memory error. + */ + if (tmpstr2 == NULL) { + error = ENOMEM; + goto extget_bailout; + } } else { ts2_len = sizeof(tmpstr); ts2_malloc = 0; From owner-svn-src-stable@freebsd.org Mon Jun 26 17:29:33 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B92C8D8CAC2; Mon, 26 Jun 2017 17:29:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F35811D8; Mon, 26 Jun 2017 17:29:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QHTWmS017699; Mon, 26 Jun 2017 17:29:32 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QHTWME017698; Mon, 26 Jun 2017 17:29:32 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201706261729.v5QHTWME017698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 26 Jun 2017 17:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320365 - stable/11/sbin/newfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 17:29:33 -0000 Author: mckusick Date: Mon Jun 26 17:29:32 2017 New Revision: 320365 URL: https://svnweb.freebsd.org/changeset/base/320365 Log: MFC of 320176: Allow '_' in labels when specifying -L to newfs. PR: 220163 Reported by: Keve Nagy Reviewed by: kib Approved by: re@ (Xin Li) Modified: stable/11/sbin/newfs/newfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/newfs/newfs.c ============================================================================== --- stable/11/sbin/newfs/newfs.c Mon Jun 26 16:28:46 2017 (r320364) +++ stable/11/sbin/newfs/newfs.c Mon Jun 26 17:29:32 2017 (r320365) @@ -150,7 +150,8 @@ main(int argc, char *argv[]) case 'L': volumelabel = optarg; i = -1; - while (isalnum(volumelabel[++i])); + while (isalnum(volumelabel[++i]) || + volumelabel[i] == '_'); if (volumelabel[i] != '\0') { errx(1, "bad volume label. Valid characters are alphanumerics."); } From owner-svn-src-stable@freebsd.org Mon Jun 26 17:33:34 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B1DBD8CD1E; Mon, 26 Jun 2017 17:33:34 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19E4581648; Mon, 26 Jun 2017 17:33:34 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QHXXUF021628; Mon, 26 Jun 2017 17:33:33 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QHXXTk021627; Mon, 26 Jun 2017 17:33:33 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201706261733.v5QHXXTk021627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 26 Jun 2017 17:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320366 - stable/10/sbin/newfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 17:33:34 -0000 Author: mckusick Date: Mon Jun 26 17:33:33 2017 New Revision: 320366 URL: https://svnweb.freebsd.org/changeset/base/320366 Log: MFC of 320176: Allow '_' in labels when specifying -L to newfs. PR: 220163 Reported by: Keve Nagy Reviewed by: kib Modified: stable/10/sbin/newfs/newfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/newfs/newfs.c ============================================================================== --- stable/10/sbin/newfs/newfs.c Mon Jun 26 17:29:32 2017 (r320365) +++ stable/10/sbin/newfs/newfs.c Mon Jun 26 17:33:33 2017 (r320366) @@ -153,7 +153,8 @@ main(int argc, char *argv[]) case 'L': volumelabel = optarg; i = -1; - while (isalnum(volumelabel[++i])); + while (isalnum(volumelabel[++i]) || + volumelabel[i] == '_'); if (volumelabel[i] != '\0') { errx(1, "bad volume label. Valid characters are alphanumerics."); } From owner-svn-src-stable@freebsd.org Mon Jun 26 18:23:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A9CAD8DFCE; Mon, 26 Jun 2017 18:23:42 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE3C0831FA; Mon, 26 Jun 2017 18:23:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QINfrg041933; Mon, 26 Jun 2017 18:23:41 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QINe9K041931; Mon, 26 Jun 2017 18:23:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201706261823.v5QINe9K041931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 26 Jun 2017 18:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320368 - stable/10/sys/dev/qlxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 18:23:42 -0000 Author: davidcs Date: Mon Jun 26 18:23:40 2017 New Revision: 320368 URL: https://svnweb.freebsd.org/changeset/base/320368 Log: MFC r320175 Add pkts_cnt_oversized to stats. Modified: stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_hw.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 18:11:48 2017 (r320367) +++ stable/10/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 18:23:40 2017 (r320368) @@ -1554,6 +1554,8 @@ qla_rcv_stats(qla_host_t *ha, q80_rcv_stats_t *rstat) rstat->lro_flows_active); device_printf(dev, "%s: pkts_droped_unknown\t\t%" PRIu64 "\n", __func__, rstat->pkts_droped_unknown); + device_printf(dev, "%s: pkts_cnt_oversized\t\t%" PRIu64 "\n", + __func__, rstat->pkts_cnt_oversized); } static void Modified: stable/10/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 18:11:48 2017 (r320367) +++ stable/10/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 18:23:40 2017 (r320368) @@ -748,6 +748,7 @@ typedef struct _q80_rcv_stats { uint64_t lro_flows_deleted; uint64_t lro_flows_active; uint64_t pkts_droped_unknown; + uint64_t pkts_cnt_oversized; } __packed q80_rcv_stats_t; typedef struct _q80_xmt_stats { From owner-svn-src-stable@freebsd.org Mon Jun 26 19:34:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8965AD8F6AB; Mon, 26 Jun 2017 19:34:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49529820; Mon, 26 Jun 2017 19:34:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (d-24-245-127-120.cpe.metrocast.net [24.245.127.120]) by mail.baldwin.cx (Postfix) with ESMTPSA id 792AA10AB01; Mon, 26 Jun 2017 15:34:40 -0400 (EDT) Subject: Re: svn commit: r320222 - in stable/10: etc etc/cron.d etc/mtree etc/newsyslog.conf.d etc/pam.d etc/syslog.d tools/build/mk usr.sbin/cron/cron usr.sbin/cron/lib usr.sbin/syslogd To: Ngie Cooper References: <201706220708.v5M78IYv080609@repo.freebsd.org> <223428BC-9035-4435-B8EB-9A72EDCDD225@gmail.com> <52481168-DCDD-4D6A-8F68-1EBDA44513D1@gmail.com> Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: John Baldwin Message-ID: <126a318e-61a3-bfdc-e1dd-b16a67734d30@FreeBSD.org> Date: Mon, 26 Jun 2017 15:34:40 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <52481168-DCDD-4D6A-8F68-1EBDA44513D1@gmail.com> Content-Type: text/plain; charset=shift_jis Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 26 Jun 2017 15:34:40 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 19:34:42 -0000 On 6/22/17 10:08 AM, Ngie Cooper wrote: > >> On Jun 22, 2017, at 03:28, John Baldwin wrote: >> >>> On 6/22/17 4:02 AM, Ngie Cooper (yaneurabeya) wrote: >>> >>>> On Jun 22, 2017, at 00:35, John Baldwin wrote: >>> >>> c >>> >>>> Please revert the breakout of the existing config files. I think that splitting >>>> up the conf files is too disruptive of a change (POLA) for stable branches. >>> >>> Done in r320229 and r320230. >> >> I haven't checked if this was merged to 11, but if so, I think they should also >> stay a single conf file in 11 for the same reason. > > No, it wasn't merged to 11, so no further action required here. > >>>> This was agreed to by other folks in the followup thread to the commits in >>>> head that you continue to ignore. >>> >>> >>>> In head please either fully split up the files or revert to a single file >>>> (another part of that thread you continue to ignore). >>> >>> My eyes glazed over trying to read through all of the posts. I seem to have missed the point where a proposed change was made to split up the config files further. Could this please be summarized again? >> >> I think that having the files partially split up is the worst of both >> worlds as folks writing config management rules, etc. have to use >> different approaches depending on the rule. I think that is a headache >> and would rather have the config either be all in a single file, or all >> be split up into conf.d/ so that it is consistent. I also think that >> when splitting up a conf file we should do it all at once so that there is >> only one painful /etc merge instead of several of them. > > This still doesn't answer my concern fully. In what way are the config files in base not broken down 100%, i.e., what action can I take to resolve your concerns about it not being fully modularized? I think syslog.conf having kerberos.log is likely the last issue, but I would really like clarification in order to move forward. Hmm, I had assumed that in a fully modularized form we wouldn't have foo.conf at all, but _only_ files in conf.d. However, looking at the files it does seem that there are some system-wide entries that aren't part of a specific program and that those should probably stay in foo.conf. I do think there are some remaining entries that are for a single program though: For syslog.conf: - /var/log/cron probably belongs in /etc/syslog.d/cron.conf? - commented out lines for /var/log/devd.log belong in /etc/syslogd.d/devd.conf? For newsyslog.conf: - /var/log/cron -> cron.conf - /var/log/{daily,monthly,security,weekly}.log -> periodic.conf - /var/log/init.log -> init.conf? - /var/log/kerberos.log -> kerberos.conf - /var/log/devd.log -> devd.conf -- John Baldwin From owner-svn-src-stable@freebsd.org Mon Jun 26 19:36:25 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8450FD8F9D6; Mon, 26 Jun 2017 19:36:25 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 544FDEE8; Mon, 26 Jun 2017 19:36:25 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QJaOMS071911; Mon, 26 Jun 2017 19:36:24 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QJaOAN071909; Mon, 26 Jun 2017 19:36:24 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201706261936.v5QJaOAN071909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 26 Jun 2017 19:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320370 - stable/11/sys/dev/qlxgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 19:36:25 -0000 Author: davidcs Date: Mon Jun 26 19:36:24 2017 New Revision: 320370 URL: https://svnweb.freebsd.org/changeset/base/320370 Log: MFC r320175 Add pkts_cnt_oversized to stats. Approved by: re(marius) Modified: stable/11/sys/dev/qlxgbe/ql_hw.c stable/11/sys/dev/qlxgbe/ql_hw.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 18:28:00 2017 (r320369) +++ stable/11/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 19:36:24 2017 (r320370) @@ -1554,6 +1554,8 @@ qla_rcv_stats(qla_host_t *ha, q80_rcv_stats_t *rstat) rstat->lro_flows_active); device_printf(dev, "%s: pkts_droped_unknown\t\t%" PRIu64 "\n", __func__, rstat->pkts_droped_unknown); + device_printf(dev, "%s: pkts_cnt_oversized\t\t%" PRIu64 "\n", + __func__, rstat->pkts_cnt_oversized); } static void Modified: stable/11/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 18:28:00 2017 (r320369) +++ stable/11/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 19:36:24 2017 (r320370) @@ -748,6 +748,7 @@ typedef struct _q80_rcv_stats { uint64_t lro_flows_deleted; uint64_t lro_flows_active; uint64_t pkts_droped_unknown; + uint64_t pkts_cnt_oversized; } __packed q80_rcv_stats_t; typedef struct _q80_xmt_stats { From owner-svn-src-stable@freebsd.org Mon Jun 26 19:40:12 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E305D8FFBD; Mon, 26 Jun 2017 19:40:12 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED9942545; Mon, 26 Jun 2017 19:40:11 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5QJeBw2073990; Mon, 26 Jun 2017 19:40:11 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5QJeAXh073987; Mon, 26 Jun 2017 19:40:10 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201706261940.v5QJeAXh073987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 26 Jun 2017 19:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r320371 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 19:40:12 -0000 Author: davidcs Date: Mon Jun 26 19:40:10 2017 New Revision: 320371 URL: https://svnweb.freebsd.org/changeset/base/320371 Log: MFC r320175 Add pkts_cnt_oversized to stats. Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 19:36:24 2017 (r320370) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 19:40:10 2017 (r320371) @@ -1554,6 +1554,8 @@ qla_rcv_stats(qla_host_t *ha, q80_rcv_stats_t *rstat) rstat->lro_flows_active); device_printf(dev, "%s: pkts_droped_unknown\t\t%" PRIu64 "\n", __func__, rstat->pkts_droped_unknown); + device_printf(dev, "%s: pkts_cnt_oversized\t\t%" PRIu64 "\n", + __func__, rstat->pkts_cnt_oversized); } static void Modified: stable/9/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 19:36:24 2017 (r320370) +++ stable/9/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 19:40:10 2017 (r320371) @@ -748,6 +748,7 @@ typedef struct _q80_rcv_stats { uint64_t lro_flows_deleted; uint64_t lro_flows_active; uint64_t pkts_droped_unknown; + uint64_t pkts_cnt_oversized; } __packed q80_rcv_stats_t; typedef struct _q80_xmt_stats { From owner-svn-src-stable@freebsd.org Tue Jun 27 09:42:58 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04578DA5D67; Tue, 27 Jun 2017 09:42:58 +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 C133D837E6; Tue, 27 Jun 2017 09:42:57 +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 v5R9guDx024904; Tue, 27 Jun 2017 09:42:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5R9gusL024903; Tue, 27 Jun 2017 09:42:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706270942.v5R9gusL024903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Jun 2017 09:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320401 - stable/11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 09:42:58 -0000 Author: kib Date: Tue Jun 27 09:42:56 2017 New Revision: 320401 URL: https://svnweb.freebsd.org/changeset/base/320401 Log: MFC r320313: Fix typo. Approved by: re (marius) Modified: stable/11/lib/libc/sys/mmap.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/mmap.2 ============================================================================== --- stable/11/lib/libc/sys/mmap.2 Tue Jun 27 08:49:47 2017 (r320400) +++ stable/11/lib/libc/sys/mmap.2 Tue Jun 27 09:42:56 2017 (r320401) @@ -69,7 +69,7 @@ current) offsets in the object. In particular, the .Fa offset value cannot be negative. -If the object is truncated and the process later accesses a pages that +If the object is truncated and the process later accesses a page that is wholly within the truncated region, the access is aborted and a .Dv SIGBUS signal is delivered to the process. From owner-svn-src-stable@freebsd.org Tue Jun 27 10:09:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CA83DA640A; Tue, 27 Jun 2017 10:09:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B19084439; Tue, 27 Jun 2017 10:09:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5RA91td033769; Tue, 27 Jun 2017 10:09:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5RA91lr033768; Tue, 27 Jun 2017 10:09:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706271009.v5RA91lr033768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Jun 2017 10:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320402 - stable/11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 10:09:02 -0000 Author: kib Date: Tue Jun 27 10:09:00 2017 New Revision: 320402 URL: https://svnweb.freebsd.org/changeset/base/320402 Log: MFC r320314: Remove the description of MAP_HASSEMAPHORE. Approved by: re (marius) Modified: stable/11/lib/libc/sys/mmap.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/mmap.2 ============================================================================== --- stable/11/lib/libc/sys/mmap.2 Tue Jun 27 09:42:56 2017 (r320401) +++ stable/11/lib/libc/sys/mmap.2 Tue Jun 27 10:09:00 2017 (r320402) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd February 4, 2017 +.Dd June 22, 2017 .Dt MMAP 2 .Os .Sh NAME @@ -199,9 +199,6 @@ In contrast, if .Dv MAP_EXCL is specified, the request will fail if a mapping already exists within the range. -.It Dv MAP_HASSEMAPHORE -Notify the kernel that the region may contain semaphores and that special -handling may be necessary. .It Dv MAP_NOCORE Region is not included in a core file. .It Dv MAP_NOSYNC From owner-svn-src-stable@freebsd.org Tue Jun 27 10:50:50 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22583DA6E99; Tue, 27 Jun 2017 10:50:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6711B98; Tue, 27 Jun 2017 10:50:49 +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 v5RAonUa050160; Tue, 27 Jun 2017 10:50:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5RAonNV050159; Tue, 27 Jun 2017 10:50:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706271050.v5RAonNV050159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Jun 2017 10:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320404 - stable/11/sys/i386/isa X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 10:50:50 -0000 Author: kib Date: Tue Jun 27 10:50:48 2017 New Revision: 320404 URL: https://svnweb.freebsd.org/changeset/base/320404 Log: MFC r320307: Fix indent. Approved by: re (marius) Modified: stable/11/sys/i386/isa/npx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/isa/npx.c ============================================================================== --- stable/11/sys/i386/isa/npx.c Tue Jun 27 10:45:13 2017 (r320403) +++ stable/11/sys/i386/isa/npx.c Tue Jun 27 10:50:48 2017 (r320404) @@ -1157,7 +1157,7 @@ npx_set_fpregs_xmm(struct save87 *sv_87, struct savexm for (i = 0; i < 8; ++i) { sv_xmm->sv_fp[i].fp_acc = sv_87->sv_ac[i]; if ((penv_87->en_tw & (3 << i * 2)) != (3 << i * 2)) - penv_xmm->en_tw |= 1 << i; + penv_xmm->en_tw |= 1 << i; } } From owner-svn-src-stable@freebsd.org Tue Jun 27 12:56:38 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A75FDA9FC8; Tue, 27 Jun 2017 12:56:38 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4327651EF; Tue, 27 Jun 2017 12:56:37 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5RCuaBP002746; Tue, 27 Jun 2017 12:56:36 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5RCuaBj002745; Tue, 27 Jun 2017 12:56:36 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201706271256.v5RCuaBj002745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 27 Jun 2017 12:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320405 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 12:56:38 -0000 Author: ken Date: Tue Jun 27 12:56:36 2017 New Revision: 320405 URL: https://svnweb.freebsd.org/changeset/base/320405 Log: MFC r320123: Fix a potential sleep while holding a mutex in the sa(4) driver. If the user issues a MTIOCEXTGET ioctl, and the tape drive in question has a serial number that is longer than 80 characters, we malloc a buffer in saextget() to hold the output of cam_strvis(). Since a mutex is held in that codepath, doing a M_WAITOK malloc could lead to sleeping while holding a mutex. Change it to a M_NOWAIT malloc and bail out if we fail to allocate the memory. Devices with serial numbers longer than 80 bytes are very rare (I don't recall seeing one), so this should be a very unusual case to hit. But it is a bug that should be fixed. sys/cam/scsi/scsi_sa.c: In saextget(), if we need to malloc a buffer to hold the output of cam_strvis(), don't wait for the memory. Fail and return an error if we can't allocate the memory immediately. PR: kern/220094 Submitted by: Jia-Ju Bai Sponsored by: Spectra Logic Approved by: re (gjb) Modified: stable/11/sys/cam/scsi/scsi_sa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sa.c Tue Jun 27 10:50:48 2017 (r320404) +++ stable/11/sys/cam/scsi/scsi_sa.c Tue Jun 27 12:56:36 2017 (r320405) @@ -4465,7 +4465,18 @@ saextget(struct cdev *dev, struct cam_periph *periph, if (cgd.serial_num_len > sizeof(tmpstr)) { ts2_len = cgd.serial_num_len + 1; ts2_malloc = 1; - tmpstr2 = malloc(ts2_len, M_SCSISA, M_WAITOK | M_ZERO); + tmpstr2 = malloc(ts2_len, M_SCSISA, M_NOWAIT | M_ZERO); + /* + * The 80 characters allocated on the stack above + * will handle the vast majority of serial numbers. + * If we run into one that is larger than that, and + * we can't malloc the length without blocking, + * bail out with an out of memory error. + */ + if (tmpstr2 == NULL) { + error = ENOMEM; + goto extget_bailout; + } } else { ts2_len = sizeof(tmpstr); ts2_malloc = 0; From owner-svn-src-stable@freebsd.org Wed Jun 28 04:01:30 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D52D97486; Wed, 28 Jun 2017 04:01:30 +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 730CF64498; Wed, 28 Jun 2017 04:01:30 +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 v5S41T6x086139; Wed, 28 Jun 2017 04:01:29 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S41TkD086135; Wed, 28 Jun 2017 04:01:29 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706280401.v5S41TkD086135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 28 Jun 2017 04:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320429 - in stable/11/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Commit-Revision: 320429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 04:01:30 -0000 Author: alc Date: Wed Jun 28 04:01:29 2017 New Revision: 320429 URL: https://svnweb.freebsd.org/changeset/base/320429 Log: MFC r314310 Refine the fix from r312954. Specifically, add a new PDE-only flag, PG_PROMOTED, that indicates whether lingering 4KB page mappings might need to be flushed on a PDE change that restricts or destroys a 2MB page mapping. This flag allows the pmap to avoid range invalidations that are both unnecessary and costly. Approved by: re (kib) Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/amd64/include/pmap.h stable/11/sys/i386/i386/pmap.c stable/11/sys/i386/include/pmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Wed Jun 28 02:30:32 2017 (r320428) +++ stable/11/sys/amd64/amd64/pmap.c Wed Jun 28 04:01:29 2017 (r320429) @@ -613,6 +613,8 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, + pd_entry_t pde); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, @@ -1838,6 +1840,27 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_ } #endif /* !SMP */ +static void +pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde) +{ + + /* + * When the PDE has PG_PROMOTED set, the 2MB page mapping was created + * by a promotion that did not invalidate the 512 4KB page mappings + * that might exist in the TLB. Consequently, at this point, the TLB + * may hold both 4KB and 2MB page mappings for the address range [va, + * va + NBPDR). Therefore, the entire range must be invalidated here. + * In contrast, when PG_PROMOTED is clear, the TLB will not hold any + * 4KB page mappings for the address range [va, va + NBPDR), and so a + * single INVLPG suffices to invalidate the 2MB page mapping from the + * TLB. + */ + if ((pde & PG_PROMOTED) != 0) + pmap_invalidate_range(pmap, va, va + NBPDR - 1); + else + pmap_invalidate_page(pmap, va); +} + #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void @@ -3472,7 +3495,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v SLIST_INIT(&free); sva = trunc_2mpage(va); pmap_remove_pde(pmap, pde, sva, &free, lockp); - pmap_invalidate_range(pmap, sva, sva + NBPDR - 1); + if ((oldpde & PG_G) == 0) + pmap_invalidate_pde_page(pmap, sva, oldpde); pmap_free_zero_pages(&free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" " in pmap %p", va, pmap); @@ -3612,25 +3636,8 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse oldpde = pte_load_clear(pdq); if (oldpde & PG_W) pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; - - /* - * When workaround_erratum383 is false, a promotion to a 2M - * page mapping does not invalidate the 512 4K page mappings - * from the TLB. Consequently, at this point, the TLB may - * hold both 4K and 2M page mappings. Therefore, the entire - * range of addresses must be invalidated here. In contrast, - * when workaround_erratum383 is true, a promotion does - * invalidate the 512 4K page mappings, and so a single INVLPG - * suffices to invalidate the 2M page mapping. - */ - if ((oldpde & PG_G) != 0) { - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } - + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); if (oldpde & PG_MANAGED) { CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME); @@ -4010,16 +4017,16 @@ retry: if ((prot & VM_PROT_EXECUTE) == 0) newpde |= pg_nx; if (newpde != oldpde) { - if (!atomic_cmpset_long(pde, oldpde, newpde)) + /* + * As an optimization to future operations on this PDE, clear + * PG_PROMOTED. The impending invalidation will remove any + * lingering 4KB page mappings from the TLB. + */ + if (!atomic_cmpset_long(pde, oldpde, newpde & ~PG_PROMOTED)) goto retry; - if (oldpde & PG_G) { - /* See pmap_remove_pde() for explanation. */ - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } else + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); + else anychanged = TRUE; } return (anychanged); @@ -4272,7 +4279,7 @@ setpte: if (workaround_erratum383) pmap_update_pde(pmap, va, pde, PG_PS | newpde); else - pde_store(pde, PG_PS | newpde); + pde_store(pde, PG_PROMOTED | PG_PS | newpde); atomic_add_long(&pmap_pde_promotions, 1); CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#lx" @@ -4585,7 +4592,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); /* - * Map the superpage. + * Map the superpage. (This is not a promoted mapping; there will not + * be any lingering 4KB page mappings in the TLB.) */ pde_store(pde, newpde); Modified: stable/11/sys/amd64/include/pmap.h ============================================================================== --- stable/11/sys/amd64/include/pmap.h Wed Jun 28 02:30:32 2017 (r320428) +++ stable/11/sys/amd64/include/pmap.h Wed Jun 28 04:01:29 2017 (r320429) @@ -109,6 +109,7 @@ #define PG_MANAGED X86_PG_AVAIL2 #define EPT_PG_EMUL_V X86_PG_AVAIL(52) #define EPT_PG_EMUL_RW X86_PG_AVAIL(53) +#define PG_PROMOTED X86_PG_AVAIL(54) /* PDE only */ #define PG_FRAME (0x000ffffffffff000ul) #define PG_PS_FRAME (0x000fffffffe00000ul) Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Wed Jun 28 02:30:32 2017 (r320428) +++ stable/11/sys/i386/i386/pmap.c Wed Jun 28 04:01:29 2017 (r320429) @@ -301,6 +301,8 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_page_t m, vm_prot_t prot, vm_page_t mpte); static void pmap_flush_page(vm_page_t m); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, + pd_entry_t pde); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static boolean_t pmap_is_modified_pvh(struct md_page *pvh); static boolean_t pmap_is_referenced_pvh(struct md_page *pvh); @@ -1259,6 +1261,27 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_ } #endif /* !SMP */ +static void +pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde) +{ + + /* + * When the PDE has PG_PROMOTED set, the 2- or 4MB page mapping was + * created by a promotion that did not invalidate the 512 or 1024 4KB + * page mappings that might exist in the TLB. Consequently, at this + * point, the TLB may hold both 4KB and 2- or 4MB page mappings for + * the address range [va, va + NBPDR). Therefore, the entire range + * must be invalidated here. In contrast, when PG_PROMOTED is clear, + * the TLB will not hold any 4KB page mappings for the address range + * [va, va + NBPDR), and so a single INVLPG suffices to invalidate the + * 2- or 4MB page mapping from the TLB. + */ + if ((pde & PG_PROMOTED) != 0) + pmap_invalidate_range(pmap, va, va + NBPDR - 1); + else + pmap_invalidate_page(pmap, va); +} + #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void @@ -2649,7 +2672,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse SLIST_INIT(&free); sva = trunc_4mpage(va); pmap_remove_pde(pmap, pde, sva, &free); - pmap_invalidate_range(pmap, sva, sva + NBPDR - 1); + if ((oldpde & PG_G) == 0) + pmap_invalidate_pde_page(pmap, sva, oldpde); pmap_free_zero_pages(&free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#x" " in pmap %p", va, pmap); @@ -2819,23 +2843,9 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse /* * Machines that don't support invlpg, also don't support * PG_G. - * - * When workaround_erratum383 is false, a promotion to a 2M/4M - * page mapping does not invalidate the 512/1024 4K page mappings - * from the TLB. Consequently, at this point, the TLB may - * hold both 4K and 2M/4M page mappings. Therefore, the entire - * range of addresses must be invalidated here. In contrast, - * when workaround_erratum383 is true, a promotion does - * invalidate the 512/1024 4K page mappings, and so a single INVLPG - * suffices to invalidate the 2M/4M page mapping. */ - if ((oldpde & PG_G) != 0) { - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE; if (oldpde & PG_MANAGED) { @@ -3143,16 +3153,16 @@ retry: newpde |= pg_nx; #endif if (newpde != oldpde) { - if (!pde_cmpset(pde, oldpde, newpde)) + /* + * As an optimization to future operations on this PDE, clear + * PG_PROMOTED. The impending invalidation will remove any + * lingering 4KB page mappings from the TLB. + */ + if (!pde_cmpset(pde, oldpde, newpde & ~PG_PROMOTED)) goto retry; - if (oldpde & PG_G) { - /* See pmap_remove_pde() for explanation. */ - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } else + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); + else anychanged = TRUE; } return (anychanged); @@ -3437,9 +3447,9 @@ setpte: if (workaround_erratum383) pmap_update_pde(pmap, va, pde, PG_PS | newpde); else if (pmap == kernel_pmap) - pmap_kenter_pde(va, PG_PS | newpde); + pmap_kenter_pde(va, PG_PROMOTED | PG_PS | newpde); else - pde_store(pde, PG_PS | newpde); + pde_store(pde, PG_PROMOTED | PG_PS | newpde); pmap_pde_promotions++; CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#x" @@ -3722,7 +3732,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t pmap->pm_stats.resident_count += NBPDR / PAGE_SIZE; /* - * Map the superpage. + * Map the superpage. (This is not a promoted mapping; there will not + * be any lingering 4KB page mappings in the TLB.) */ pde_store(pde, newpde); Modified: stable/11/sys/i386/include/pmap.h ============================================================================== --- stable/11/sys/i386/include/pmap.h Wed Jun 28 02:30:32 2017 (r320428) +++ stable/11/sys/i386/include/pmap.h Wed Jun 28 04:01:29 2017 (r320429) @@ -71,6 +71,7 @@ /* Our various interpretations of the above */ #define PG_W PG_AVAIL1 /* "Wired" pseudoflag */ #define PG_MANAGED PG_AVAIL2 +#define PG_PROMOTED PG_AVAIL3 /* PDE only */ #if defined(PAE) || defined(PAE_TABLES) #define PG_FRAME (0x000ffffffffff000ull) #define PG_PS_FRAME (0x000fffffffe00000ull) From owner-svn-src-stable@freebsd.org Wed Jun 28 04:23:22 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 792C2D97A58; Wed, 28 Jun 2017 04:23:22 +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 3CE6664F19; Wed, 28 Jun 2017 04:23:22 +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 v5S4NLkA097074; Wed, 28 Jun 2017 04:23:21 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S4NLQA097070; Wed, 28 Jun 2017 04:23:21 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706280423.v5S4NLQA097070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 28 Jun 2017 04:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320432 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Commit-Revision: 320432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 04:23:22 -0000 Author: alc Date: Wed Jun 28 04:23:20 2017 New Revision: 320432 URL: https://svnweb.freebsd.org/changeset/base/320432 Log: MFC r314310 Refine the fix from r312954. Specifically, add a new PDE-only flag, PG_PROMOTED, that indicates whether lingering 4KB page mappings might need to be flushed on a PDE change that restricts or destroys a 2MB page mapping. This flag allows the pmap to avoid range invalidations that are both unnecessary and costly. Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/include/pmap.h stable/10/sys/i386/i386/pmap.c stable/10/sys/i386/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Wed Jun 28 04:19:54 2017 (r320431) +++ stable/10/sys/amd64/amd64/pmap.c Wed Jun 28 04:23:20 2017 (r320432) @@ -455,6 +455,8 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, + pd_entry_t pde); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); @@ -1777,6 +1779,27 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_ } #endif /* !SMP */ +static void +pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde) +{ + + /* + * When the PDE has PG_PROMOTED set, the 2MB page mapping was created + * by a promotion that did not invalidate the 512 4KB page mappings + * that might exist in the TLB. Consequently, at this point, the TLB + * may hold both 4KB and 2MB page mappings for the address range [va, + * va + NBPDR). Therefore, the entire range must be invalidated here. + * In contrast, when PG_PROMOTED is clear, the TLB will not hold any + * 4KB page mappings for the address range [va, va + NBPDR), and so a + * single INVLPG suffices to invalidate the 2MB page mapping from the + * TLB. + */ + if ((pde & PG_PROMOTED) != 0) + pmap_invalidate_range(pmap, va, va + NBPDR - 1); + else + pmap_invalidate_page(pmap, va); +} + #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void @@ -3418,7 +3441,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v SLIST_INIT(&free); sva = trunc_2mpage(va); pmap_remove_pde(pmap, pde, sva, &free, lockp); - pmap_invalidate_range(pmap, sva, sva + NBPDR - 1); + if ((oldpde & PG_G) == 0) + pmap_invalidate_pde_page(pmap, sva, oldpde); pmap_free_zero_pages(&free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" " in pmap %p", va, pmap); @@ -3559,25 +3583,8 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse oldpde = pte_load_clear(pdq); if (oldpde & PG_W) pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; - - /* - * When workaround_erratum383 is false, a promotion to a 2M - * page mapping does not invalidate the 512 4K page mappings - * from the TLB. Consequently, at this point, the TLB may - * hold both 4K and 2M page mappings. Therefore, the entire - * range of addresses must be invalidated here. In contrast, - * when workaround_erratum383 is true, a promotion does - * invalidate the 512 4K page mappings, and so a single INVLPG - * suffices to invalidate the 2M page mapping. - */ - if ((oldpde & PG_G) != 0) { - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } - + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); if (oldpde & PG_MANAGED) { CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME); @@ -3930,16 +3937,16 @@ retry: if ((prot & VM_PROT_EXECUTE) == 0) newpde |= pg_nx; if (newpde != oldpde) { - if (!atomic_cmpset_long(pde, oldpde, newpde)) + /* + * As an optimization to future operations on this PDE, clear + * PG_PROMOTED. The impending invalidation will remove any + * lingering 4KB page mappings from the TLB. + */ + if (!atomic_cmpset_long(pde, oldpde, newpde & ~PG_PROMOTED)) goto retry; - if (oldpde & PG_G) { - /* See pmap_remove_pde() for explanation. */ - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } else + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); + else anychanged = TRUE; } return (anychanged); @@ -4210,7 +4217,7 @@ setpte: if (workaround_erratum383) pmap_update_pde(pmap, va, pde, PG_PS | newpde); else - pde_store(pde, PG_PS | newpde); + pde_store(pde, PG_PROMOTED | PG_PS | newpde); atomic_add_long(&pmap_pde_promotions, 1); CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#lx" @@ -4519,7 +4526,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); /* - * Map the superpage. + * Map the superpage. (This is not a promoted mapping; there will not + * be any lingering 4KB page mappings in the TLB.) */ pde_store(pde, newpde); Modified: stable/10/sys/amd64/include/pmap.h ============================================================================== --- stable/10/sys/amd64/include/pmap.h Wed Jun 28 04:19:54 2017 (r320431) +++ stable/10/sys/amd64/include/pmap.h Wed Jun 28 04:23:20 2017 (r320432) @@ -109,6 +109,7 @@ #define PG_MANAGED X86_PG_AVAIL2 #define EPT_PG_EMUL_V X86_PG_AVAIL(52) #define EPT_PG_EMUL_RW X86_PG_AVAIL(53) +#define PG_PROMOTED X86_PG_AVAIL(54) /* PDE only */ #define PG_FRAME (0x000ffffffffff000ul) #define PG_PS_FRAME (0x000fffffffe00000ul) Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Wed Jun 28 04:19:54 2017 (r320431) +++ stable/10/sys/i386/i386/pmap.c Wed Jun 28 04:23:20 2017 (r320432) @@ -317,6 +317,8 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_page_t m, vm_prot_t prot, vm_page_t mpte); static void pmap_flush_page(vm_page_t m); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, + pd_entry_t pde); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static boolean_t pmap_is_modified_pvh(struct md_page *pvh); static boolean_t pmap_is_referenced_pvh(struct md_page *pvh); @@ -1215,6 +1217,27 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_ } #endif /* !SMP */ +static void +pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde) +{ + + /* + * When the PDE has PG_PROMOTED set, the 2- or 4MB page mapping was + * created by a promotion that did not invalidate the 512 or 1024 4KB + * page mappings that might exist in the TLB. Consequently, at this + * point, the TLB may hold both 4KB and 2- or 4MB page mappings for + * the address range [va, va + NBPDR). Therefore, the entire range + * must be invalidated here. In contrast, when PG_PROMOTED is clear, + * the TLB will not hold any 4KB page mappings for the address range + * [va, va + NBPDR), and so a single INVLPG suffices to invalidate the + * 2- or 4MB page mapping from the TLB. + */ + if ((pde & PG_PROMOTED) != 0) + pmap_invalidate_range(pmap, va, va + NBPDR - 1); + else + pmap_invalidate_page(pmap, va); +} + #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) void @@ -2724,7 +2747,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse SLIST_INIT(&free); sva = trunc_4mpage(va); pmap_remove_pde(pmap, pde, sva, &free); - pmap_invalidate_range(pmap, sva, sva + NBPDR - 1); + if ((oldpde & PG_G) == 0) + pmap_invalidate_pde_page(pmap, sva, oldpde); pmap_free_zero_pages(&free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#x" " in pmap %p", va, pmap); @@ -2895,23 +2919,9 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse /* * Machines that don't support invlpg, also don't support * PG_G. - * - * When workaround_erratum383 is false, a promotion to a 2M/4M - * page mapping does not invalidate the 512/1024 4K page mappings - * from the TLB. Consequently, at this point, the TLB may - * hold both 4K and 2M/4M page mappings. Therefore, the entire - * range of addresses must be invalidated here. In contrast, - * when workaround_erratum383 is true, a promotion does - * invalidate the 512/1024 4K page mappings, and so a single INVLPG - * suffices to invalidate the 2M/4M page mapping. */ - if ((oldpde & PG_G) != 0) { - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE; if (oldpde & PG_MANAGED) { @@ -3220,16 +3230,16 @@ retry: newpde |= pg_nx; #endif if (newpde != oldpde) { - if (!pde_cmpset(pde, oldpde, newpde)) + /* + * As an optimization to future operations on this PDE, clear + * PG_PROMOTED. The impending invalidation will remove any + * lingering 4KB page mappings from the TLB. + */ + if (!pde_cmpset(pde, oldpde, newpde & ~PG_PROMOTED)) goto retry; - if (oldpde & PG_G) { - /* See pmap_remove_pde() for explanation. */ - if (workaround_erratum383) - pmap_invalidate_page(kernel_pmap, sva); - else - pmap_invalidate_range(kernel_pmap, sva, - sva + NBPDR - 1); - } else + if ((oldpde & PG_G) != 0) + pmap_invalidate_pde_page(kernel_pmap, sva, oldpde); + else anychanged = TRUE; } return (anychanged); @@ -3514,9 +3524,9 @@ setpte: if (workaround_erratum383) pmap_update_pde(pmap, va, pde, PG_PS | newpde); else if (pmap == kernel_pmap) - pmap_kenter_pde(va, PG_PS | newpde); + pmap_kenter_pde(va, PG_PROMOTED | PG_PS | newpde); else - pde_store(pde, PG_PS | newpde); + pde_store(pde, PG_PROMOTED | PG_PS | newpde); pmap_pde_promotions++; CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#x" @@ -3787,7 +3797,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t pmap->pm_stats.resident_count += NBPDR / PAGE_SIZE; /* - * Map the superpage. + * Map the superpage. (This is not a promoted mapping; there will not + * be any lingering 4KB page mappings in the TLB.) */ pde_store(pde, newpde); Modified: stable/10/sys/i386/include/pmap.h ============================================================================== --- stable/10/sys/i386/include/pmap.h Wed Jun 28 04:19:54 2017 (r320431) +++ stable/10/sys/i386/include/pmap.h Wed Jun 28 04:23:20 2017 (r320432) @@ -71,6 +71,7 @@ /* Our various interpretations of the above */ #define PG_W PG_AVAIL1 /* "Wired" pseudoflag */ #define PG_MANAGED PG_AVAIL2 +#define PG_PROMOTED PG_AVAIL3 /* PDE only */ #if defined(PAE) || defined(PAE_TABLES) #define PG_FRAME (0x000ffffffffff000ull) #define PG_PS_FRAME (0x000fffffffe00000ull) From owner-svn-src-stable@freebsd.org Wed Jun 28 04:25:22 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE0ED97B6B; Wed, 28 Jun 2017 04:25:22 +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 DEE0B651B2; Wed, 28 Jun 2017 04:25:21 +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 v5S4PLLb097237; Wed, 28 Jun 2017 04:25:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S4PL5d097236; Wed, 28 Jun 2017 04:25:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706280425.v5S4PL5d097236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 28 Jun 2017 04:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320434 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 04:25:22 -0000 Author: kib Date: Wed Jun 28 04:25:20 2017 New Revision: 320434 URL: https://svnweb.freebsd.org/changeset/base/320434 Log: MFC r320201: Assert that the protection of a new map entry is a subset of the max protection. Approved by: re (delphij) Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed Jun 28 04:24:10 2017 (r320433) +++ stable/11/sys/vm/vm_map.c Wed Jun 28 04:25:20 2017 (r320434) @@ -1190,6 +1190,8 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof ("vm_map_insert: kmem or kernel object and COW")); KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, ("vm_map_insert: paradoxical MAP_NOFAULT request")); + KASSERT((prot & ~max) == 0, + ("prot %#x is not subset of max_prot %#x", prot, max)); /* * Check that the start and end points are not bogus. From owner-svn-src-stable@freebsd.org Wed Jun 28 04:53:08 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 572AFD980D8; Wed, 28 Jun 2017 04:53:08 +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 246CD65BDA; Wed, 28 Jun 2017 04:53:08 +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 v5S4r7gL009508; Wed, 28 Jun 2017 04:53:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S4r7cf009507; Wed, 28 Jun 2017 04:53:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706280453.v5S4r7cf009507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 28 Jun 2017 04:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320435 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 04:53:08 -0000 Author: kib Date: Wed Jun 28 04:53:06 2017 New Revision: 320435 URL: https://svnweb.freebsd.org/changeset/base/320435 Log: MFC r320201: Assert that the protection of a new map entry is a subset of the max protection. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Wed Jun 28 04:25:20 2017 (r320434) +++ stable/10/sys/vm/vm_map.c Wed Jun 28 04:53:06 2017 (r320435) @@ -1143,6 +1143,8 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof ("vm_map_insert: kmem or kernel object and COW")); KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, ("vm_map_insert: paradoxical MAP_NOFAULT request")); + KASSERT((prot & ~max) == 0, + ("prot %#x is not subset of max_prot %#x", prot, max)); /* * Check that the start and end points are not bogus. From owner-svn-src-stable@freebsd.org Wed Jun 28 05:20:29 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08B2D98419; Wed, 28 Jun 2017 05:20:29 +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 6CAF066563; Wed, 28 Jun 2017 05:20:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5S5KSk7018233; Wed, 28 Jun 2017 05:20:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S5KSFJ018232; Wed, 28 Jun 2017 05:20:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706280520.v5S5KSFJ018232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 28 Jun 2017 05:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320436 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 05:20:29 -0000 Author: kib Date: Wed Jun 28 05:20:28 2017 New Revision: 320436 URL: https://svnweb.freebsd.org/changeset/base/320436 Log: MFC r320202: Call pmap_copy() only for map entries which have the backing object instantiated. Approved by: re (delphij) Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed Jun 28 04:53:06 2017 (r320435) +++ stable/11/sys/vm/vm_map.c Wed Jun 28 05:20:28 2017 (r320436) @@ -3239,6 +3239,10 @@ vm_map_copy_entry( fake_entry->next = curthread->td_map_def_user; curthread->td_map_def_user = fake_entry; } + + pmap_copy(dst_map->pmap, src_map->pmap, + dst_entry->start, dst_entry->end - dst_entry->start, + src_entry->start); } else { dst_entry->object.vm_object = NULL; dst_entry->offset = 0; @@ -3248,9 +3252,6 @@ vm_map_copy_entry( *fork_charge += size; } } - - pmap_copy(dst_map->pmap, src_map->pmap, dst_entry->start, - dst_entry->end - dst_entry->start, src_entry->start); } else { /* * We don't want to make writeable wired pages copy-on-write. From owner-svn-src-stable@freebsd.org Wed Jun 28 05:21:01 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69251D984A7; Wed, 28 Jun 2017 05:21:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 380F3666CD; Wed, 28 Jun 2017 05:21:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5S5L08o021242; Wed, 28 Jun 2017 05:21:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S5L0xl021241; Wed, 28 Jun 2017 05:21:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201706280521.v5S5L0xl021241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 28 Jun 2017 05:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320437 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 05:21:01 -0000 Author: kib Date: Wed Jun 28 05:21:00 2017 New Revision: 320437 URL: https://svnweb.freebsd.org/changeset/base/320437 Log: MFC r320202: Call pmap_copy() only for map entries which have the backing object instantiated. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Wed Jun 28 05:20:28 2017 (r320436) +++ stable/10/sys/vm/vm_map.c Wed Jun 28 05:21:00 2017 (r320437) @@ -3185,6 +3185,10 @@ vm_map_copy_entry( fake_entry->next = curthread->td_map_def_user; curthread->td_map_def_user = fake_entry; } + + pmap_copy(dst_map->pmap, src_map->pmap, + dst_entry->start, dst_entry->end - dst_entry->start, + src_entry->start); } else { dst_entry->object.vm_object = NULL; dst_entry->offset = 0; @@ -3194,9 +3198,6 @@ vm_map_copy_entry( *fork_charge += size; } } - - pmap_copy(dst_map->pmap, src_map->pmap, dst_entry->start, - dst_entry->end - dst_entry->start, src_entry->start); } else { /* * We don't want to make writeable wired pages copy-on-write. From owner-svn-src-stable@freebsd.org Wed Jun 28 05:28:17 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 325BAD986FE; Wed, 28 Jun 2017 05:28:17 +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 F417366AB0; Wed, 28 Jun 2017 05:28:16 +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 v5S5SGwl022197; Wed, 28 Jun 2017 05:28:16 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S5SGkP022196; Wed, 28 Jun 2017 05:28:16 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706280528.v5S5SGkP022196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 28 Jun 2017 05:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320438 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 320438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 05:28:17 -0000 Author: alc Date: Wed Jun 28 05:28:15 2017 New Revision: 320438 URL: https://svnweb.freebsd.org/changeset/base/320438 Log: MFC r315518 Avoid unnecessary calls to vm_map_protect() in elf_load_section(). Typically, when elf_load_section() unconditionally passed VM_PROT_ALL to elf_map_insert(), it was needlessly enabling execute access on the mapping, and it would later have to call vm_map_protect() to correct the mapping's access rights. Now, instead, elf_load_section() always passes its parameter "prot" to elf_map_insert(). So, elf_load_section() must only call vm_map_protect() if it needs to remove the write access that was temporarily granted to perform a copyout(). Approved by: re (kib) Modified: stable/11/sys/kern/imgact_elf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/imgact_elf.c ============================================================================== --- stable/11/sys/kern/imgact_elf.c Wed Jun 28 05:21:00 2017 (r320437) +++ stable/11/sys/kern/imgact_elf.c Wed Jun 28 05:28:15 2017 (r320438) @@ -596,7 +596,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof /* This had damn well better be true! */ if (map_len != 0) { rv = __elfN(map_insert)(imgp, map, NULL, 0, map_addr, - map_addr + map_len, VM_PROT_ALL, 0); + map_addr + map_len, prot, 0); if (rv != KERN_SUCCESS) return (EINVAL); } @@ -617,10 +617,12 @@ __elfN(load_section)(struct image_params *imgp, vm_oof } /* - * set it to the specified protection. + * Remove write access to the page if it was only granted by map_insert + * to allow copyout. */ - vm_map_protect(map, trunc_page(map_addr), round_page(map_addr + - map_len), prot, FALSE); + if ((prot & VM_PROT_WRITE) == 0) + vm_map_protect(map, trunc_page(map_addr), round_page(map_addr + + map_len), prot, FALSE); return (0); } From owner-svn-src-stable@freebsd.org Wed Jun 28 06:13:59 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923D1D99248; Wed, 28 Jun 2017 06:13:59 +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 525B667E38; Wed, 28 Jun 2017 06:13:59 +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 v5S6Dwus042446; Wed, 28 Jun 2017 06:13:58 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S6Dw69042445; Wed, 28 Jun 2017 06:13:58 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706280613.v5S6Dw69042445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 28 Jun 2017 06:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320439 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 06:13:59 -0000 Author: alc Date: Wed Jun 28 06:13:58 2017 New Revision: 320439 URL: https://svnweb.freebsd.org/changeset/base/320439 Log: MFC r281720 Eliminate an unused variable. Modified: stable/10/sys/vm/device_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/device_pager.c ============================================================================== --- stable/10/sys/vm/device_pager.c Wed Jun 28 05:28:15 2017 (r320438) +++ stable/10/sys/vm/device_pager.c Wed Jun 28 06:13:58 2017 (r320439) @@ -292,7 +292,6 @@ static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot, vm_page_t *mres) { - vm_pindex_t pidx; vm_paddr_t paddr; vm_page_t m_paddr, page; struct cdev *dev; @@ -302,7 +301,6 @@ old_dev_pager_fault(vm_object_t object, vm_ooffset_t o vm_memattr_t memattr, memattr1; int ref, ret; - pidx = OFF_TO_IDX(offset); memattr = object->memattr; VM_OBJECT_WUNLOCK(object); From owner-svn-src-stable@freebsd.org Wed Jun 28 06:40:14 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9CC0D99995; Wed, 28 Jun 2017 06:40:14 +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 6AEA568818; Wed, 28 Jun 2017 06:40: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 v5S6eDPc050884; Wed, 28 Jun 2017 06:40:13 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5S6eDRk050883; Wed, 28 Jun 2017 06:40:13 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201706280640.v5S6eDRk050883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 28 Jun 2017 06:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320440 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 06:40:14 -0000 Author: alc Date: Wed Jun 28 06:40:13 2017 New Revision: 320440 URL: https://svnweb.freebsd.org/changeset/base/320440 Log: MFC r281771 Eliminate an unused variable. Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Wed Jun 28 06:13:58 2017 (r320439) +++ stable/10/sys/vm/uma_core.c Wed Jun 28 06:40:13 2017 (r320440) @@ -308,9 +308,8 @@ bucket_init(void) { struct uma_bucket_zone *ubz; int size; - int i; - for (i = 0, ubz = &bucket_zones[0]; ubz->ubz_entries != 0; ubz++) { + for (ubz = &bucket_zones[0]; ubz->ubz_entries != 0; ubz++) { size = roundup(sizeof(struct uma_bucket), sizeof(void *)); size += sizeof(void *) * ubz->ubz_entries; ubz->ubz_zone = uma_zcreate(ubz->ubz_name, size, From owner-svn-src-stable@freebsd.org Wed Jun 28 12:20:53 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B03CDA1077; Wed, 28 Jun 2017 12:20:53 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ACEC76E62; Wed, 28 Jun 2017 12:20:53 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1dQBxb-0009sr-Ok; Wed, 28 Jun 2017 15:20:43 +0300 Date: Wed, 28 Jun 2017 15:20:43 +0300 From: Slawa Olhovchenkov To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r317711 - stable/10/sys/dev/ixgbe Message-ID: <20170628122043.GE18123@zxy.spb.ru> References: <201705022257.v42MvRvo014209@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201705022257.v42MvRvo014209@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 12:20:53 -0000 On Tue, May 02, 2017 at 10:57:27PM +0000, Eric Joyner wrote: > Author: erj > Date: Tue May 2 22:57:27 2017 > New Revision: 317711 > URL: https://svnweb.freebsd.org/changeset/base/317711 > > Log: > ixgbe(4): Fix build issue when compiling with netmap enabled > > Sponsored by: Intel Corporation After this (and r315333) netmap like broken: packets don't received anymore. ix0: port 0xd020-0xd03f mem 0xfb280000-0xfb2fffff,0xfb704000-0xfb707fff irq 34 at device 0.0 on pci5 work at r313387 From owner-svn-src-stable@freebsd.org Wed Jun 28 21:08:22 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E3A2DA9DBB; Wed, 28 Jun 2017 21:08:22 +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 5C98D283D; Wed, 28 Jun 2017 21:08:22 +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 v5SL8LH2011880; Wed, 28 Jun 2017 21:08:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5SL8L3x011875; Wed, 28 Jun 2017 21:08:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201706282108.v5SL8L3x011875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 28 Jun 2017 21:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320457 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 320457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 21:08:22 -0000 Author: tuexen Date: Wed Jun 28 21:08:21 2017 New Revision: 320457 URL: https://svnweb.freebsd.org/changeset/base/320457 Log: MFC r320263: Use a longer buffer for messages in ERROR chunks. MFC r320264: Check the length of a COOKIE chunk before accessing fields in it. MFC r320300: Handle sctp_get_next_param() in a consistent way. Approved by: re (marius@) Modified: stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_pcb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Wed Jun 28 20:28:47 2017 (r320456) +++ stable/11/sys/netinet/sctp_auth.c Wed Jun 28 21:08:21 2017 (r320457) @@ -1434,7 +1434,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str if (plen > sizeof(random_store)) break; phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)random_store, min(plen, sizeof(random_store))); + (struct sctp_paramhdr *)random_store, plen); if (phdr == NULL) return; /* save the random and length for the key */ @@ -1447,7 +1447,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str if (plen > sizeof(hmacs_store)) break; phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)hmacs_store, min(plen, sizeof(hmacs_store))); + (struct sctp_paramhdr *)hmacs_store, plen); if (phdr == NULL) return; /* save the hmacs list and num for the key */ @@ -1469,7 +1469,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str if (plen > sizeof(chunks_store)) break; phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)chunks_store, min(plen, sizeof(chunks_store))); + (struct sctp_paramhdr *)chunks_store, plen); if (phdr == NULL) return; chunks = (struct sctp_auth_chunk_list *)phdr; @@ -1814,7 +1814,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint int sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit) { - struct sctp_paramhdr *phdr, parm_buf; + struct sctp_paramhdr *phdr, param_buf; uint16_t ptype, plen; int peer_supports_asconf = 0; int peer_supports_auth = 0; @@ -1823,7 +1823,7 @@ sctp_validate_init_auth_params(struct mbuf *m, int off uint8_t saw_asconf_ack = 0; /* go through each of the params. */ - phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); + phdr = sctp_get_next_param(m, offset, ¶m_buf, sizeof(param_buf)); while (phdr) { ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); @@ -1837,11 +1837,15 @@ sctp_validate_init_auth_params(struct mbuf *m, int off if (ptype == SCTP_SUPPORTED_CHUNK_EXT) { /* A supported extension chunk */ struct sctp_supported_chunk_types_param *pr_supported; - uint8_t local_store[SCTP_PARAM_BUFFER_SIZE]; + uint8_t local_store[SCTP_SMALL_CHUNK_STORE]; int num_ent, i; + if (plen > sizeof(local_store)) { + break; + } phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)&local_store, min(plen, sizeof(local_store))); + (struct sctp_paramhdr *)&local_store, + plen); if (phdr == NULL) { return (-1); } @@ -1859,7 +1863,6 @@ sctp_validate_init_auth_params(struct mbuf *m, int off } } } else if (ptype == SCTP_RANDOM) { - got_random = 1; /* enforce the random length */ if (plen != (sizeof(struct sctp_auth_random) + SCTP_AUTH_RANDOM_SIZE_REQUIRED)) { @@ -1867,20 +1870,23 @@ sctp_validate_init_auth_params(struct mbuf *m, int off "SCTP: invalid RANDOM len\n"); return (-1); } + got_random = 1; } else if (ptype == SCTP_HMAC_LIST) { - uint8_t store[SCTP_PARAM_BUFFER_SIZE]; struct sctp_auth_hmac_algo *hmacs; + uint8_t store[SCTP_PARAM_BUFFER_SIZE]; int num_hmacs; - if (plen > sizeof(store)) + if (plen > sizeof(store)) { break; + } phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)store, min(plen, sizeof(store))); - if (phdr == NULL) + (struct sctp_paramhdr *)store, + plen); + if (phdr == NULL) { return (-1); + } hmacs = (struct sctp_auth_hmac_algo *)phdr; - num_hmacs = (plen - sizeof(*hmacs)) / - sizeof(hmacs->hmac_ids[0]); + num_hmacs = (plen - sizeof(*hmacs)) / sizeof(hmacs->hmac_ids[0]); /* validate the hmac list */ if (sctp_verify_hmac_param(hmacs, num_hmacs)) { SCTPDBG(SCTP_DEBUG_AUTH1, @@ -1889,18 +1895,19 @@ sctp_validate_init_auth_params(struct mbuf *m, int off } got_hmacs = 1; } else if (ptype == SCTP_CHUNK_LIST) { - int i, num_chunks; + struct sctp_auth_chunk_list *chunks; uint8_t chunks_store[SCTP_SMALL_CHUNK_STORE]; + int i, num_chunks; - /* did the peer send a non-empty chunk list? */ - struct sctp_auth_chunk_list *chunks = NULL; - + if (plen > sizeof(chunks_store)) { + break; + } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)chunks_store, - min(plen, sizeof(chunks_store))); - if (phdr == NULL) + plen); + if (phdr == NULL) { return (-1); - + } /*- * Flip through the list and mark that the * peer supports asconf/asconf_ack. @@ -1922,8 +1929,8 @@ sctp_validate_init_auth_params(struct mbuf *m, int off if (offset >= limit) { break; } - phdr = sctp_get_next_param(m, offset, &parm_buf, - sizeof(parm_buf)); + phdr = sctp_get_next_param(m, offset, ¶m_buf, + sizeof(param_buf)); } /* validate authentication required parameters */ if (got_random && got_hmacs) { Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Wed Jun 28 20:28:47 2017 (r320456) +++ stable/11/sys/netinet/sctp_constants.h Wed Jun 28 21:08:21 2017 (r320457) @@ -758,7 +758,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SPLIT_POINT_MIN 2904 /* Maximum length of diagnostic information in error causes */ -#define SCTP_DIAG_INFO_LEN 64 +#define SCTP_DIAG_INFO_LEN 128 /* ABORT CODES and other tell-tale location * codes are generated by adding the below Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Wed Jun 28 20:28:47 2017 (r320456) +++ stable/11/sys/netinet/sctp_input.c Wed Jun 28 21:08:21 2017 (r320457) @@ -2444,6 +2444,12 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in cookie_offset = offset + sizeof(struct sctp_chunkhdr); cookie_len = ntohs(cp->ch.chunk_length); + if (cookie_len < sizeof(struct sctp_cookie_echo_chunk) + + sizeof(struct sctp_init_chunk) + + sizeof(struct sctp_init_ack_chunk) + SCTP_SIGNATURE_SIZE) { + /* cookie too small */ + return (NULL); + } if ((cookie->peerport != sh->src_port) || (cookie->myport != sh->dest_port) || (cookie->my_vtag != sh->v_tag)) { @@ -2456,12 +2462,6 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in */ return (NULL); } - if (cookie_len < sizeof(struct sctp_cookie_echo_chunk) + - sizeof(struct sctp_init_chunk) + - sizeof(struct sctp_init_ack_chunk) + SCTP_SIGNATURE_SIZE) { - /* cookie too small */ - return (NULL); - } /* * split off the signature into its own mbuf (since it should not be * calculated in the sctp_hmac_m() call). @@ -3620,7 +3620,7 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stc struct sctp_stream_reset_response *respin) { uint16_t type; - int lparm_len; + int lparam_len; struct sctp_association *asoc = &stcb->asoc; struct sctp_tmit_chunk *chk; struct sctp_stream_reset_request *req_param; @@ -3637,12 +3637,12 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stc if (req_param != NULL) { stcb->asoc.str_reset_seq_out++; type = ntohs(req_param->ph.param_type); - lparm_len = ntohs(req_param->ph.param_length); + lparam_len = ntohs(req_param->ph.param_length); if (type == SCTP_STR_RESET_OUT_REQUEST) { int no_clear = 0; req_out_param = (struct sctp_stream_reset_out_request *)req_param; - number_entries = (lparm_len - sizeof(struct sctp_stream_reset_out_request)) / sizeof(uint16_t); + number_entries = (lparam_len - sizeof(struct sctp_stream_reset_out_request)) / sizeof(uint16_t); asoc->stream_reset_out_is_outstanding = 0; if (asoc->stream_reset_outstanding) asoc->stream_reset_outstanding--; @@ -3668,7 +3668,7 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stc } } else if (type == SCTP_STR_RESET_IN_REQUEST) { req_in_param = (struct sctp_stream_reset_in_request *)req_param; - number_entries = (lparm_len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t); + number_entries = (lparam_len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t); if (asoc->stream_reset_outstanding) asoc->stream_reset_outstanding--; if (action == SCTP_STREAM_RESET_RESULT_DENIED) { Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Wed Jun 28 20:28:47 2017 (r320456) +++ stable/11/sys/netinet/sctp_output.c Wed Jun 28 21:08:21 2017 (r320457) @@ -1940,7 +1940,7 @@ static struct mbuf * sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t *len) { #if defined(INET) || defined(INET6) - struct sctp_paramhdr *parmh; + struct sctp_paramhdr *paramh; struct mbuf *mret; uint16_t plen; #endif @@ -1962,7 +1962,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa #if defined(INET) || defined(INET6) if (M_TRAILINGSPACE(m) >= plen) { /* easy side we just drop it on the end */ - parmh = (struct sctp_paramhdr *)(SCTP_BUF_AT(m, SCTP_BUF_LEN(m))); + paramh = (struct sctp_paramhdr *)(SCTP_BUF_AT(m, SCTP_BUF_LEN(m))); mret = m; } else { /* Need more space */ @@ -1976,7 +1976,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa return (m); } mret = SCTP_BUF_NEXT(mret); - parmh = mtod(mret, struct sctp_paramhdr *); + paramh = mtod(mret, struct sctp_paramhdr *); } /* now add the parameter */ switch (ifa->address.sa.sa_family) { @@ -1987,9 +1987,9 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa struct sockaddr_in *sin; sin = &ifa->address.sin; - ipv4p = (struct sctp_ipv4addr_param *)parmh; - parmh->param_type = htons(SCTP_IPV4_ADDRESS); - parmh->param_length = htons(plen); + ipv4p = (struct sctp_ipv4addr_param *)paramh; + paramh->param_type = htons(SCTP_IPV4_ADDRESS); + paramh->param_length = htons(plen); ipv4p->addr = sin->sin_addr.s_addr; SCTP_BUF_LEN(mret) += plen; break; @@ -2002,9 +2002,9 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa struct sockaddr_in6 *sin6; sin6 = &ifa->address.sin6; - ipv6p = (struct sctp_ipv6addr_param *)parmh; - parmh->param_type = htons(SCTP_IPV6_ADDRESS); - parmh->param_length = htons(plen); + ipv6p = (struct sctp_ipv6addr_param *)paramh; + paramh->param_type = htons(SCTP_IPV6_ADDRESS); + paramh->param_length = htons(plen); memcpy(ipv6p->addr, &sin6->sin6_addr, sizeof(ipv6p->addr)); /* clear embedded scope in the address */ @@ -5141,7 +5141,10 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_ s.param_length = htons(sizeof(s) + plen); m_copyback(op_err, err_at, sizeof(s), (caddr_t)&s); err_at += sizeof(s); - phdr = sctp_get_next_param(mat, at, (struct sctp_paramhdr *)tempbuf, min(sizeof(tempbuf), plen)); + if (plen > sizeof(tempbuf)) { + plen = sizeof(tempbuf); + } + phdr = sctp_get_next_param(mat, at, (struct sctp_paramhdr *)tempbuf, plen); if (phdr == NULL) { sctp_m_freem(op_err); /* @@ -5209,7 +5212,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_ if (plen > sizeof(tempbuf)) { plen = sizeof(tempbuf); } - phdr = sctp_get_next_param(mat, at, (struct sctp_paramhdr *)tempbuf, min(sizeof(tempbuf), plen)); + phdr = sctp_get_next_param(mat, at, (struct sctp_paramhdr *)tempbuf, plen); if (phdr == NULL) { sctp_m_freem(op_err); /* @@ -5390,10 +5393,12 @@ sctp_are_there_new_addresses(struct sctp_association * { struct sctp_ipv4addr_param *p4, p4_buf; + if (plen != sizeof(struct sctp_ipv4addr_param)) { + return (1); + } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p4_buf, sizeof(p4_buf)); - if (plen != sizeof(struct sctp_ipv4addr_param) || - phdr == NULL) { + if (phdr == NULL) { return (1); } if (asoc->scope.ipv4_addr_legal) { @@ -5409,10 +5414,12 @@ sctp_are_there_new_addresses(struct sctp_association * { struct sctp_ipv6addr_param *p6, p6_buf; + if (plen != sizeof(struct sctp_ipv6addr_param)) { + return (1); + } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p6_buf, sizeof(p6_buf)); - if (plen != sizeof(struct sctp_ipv6addr_param) || - phdr == NULL) { + if (phdr == NULL) { return (1); } if (asoc->scope.ipv6_addr_legal) { @@ -9000,7 +9007,7 @@ sctp_send_cookie_echo(struct mbuf *m, */ int at; struct mbuf *cookie; - struct sctp_paramhdr parm, *phdr; + struct sctp_paramhdr param, *phdr; struct sctp_chunkhdr *hdr; struct sctp_tmit_chunk *chk; uint16_t ptype, plen; @@ -9010,7 +9017,7 @@ sctp_send_cookie_echo(struct mbuf *m, cookie = NULL; at = offset + sizeof(struct sctp_init_chunk); for (;;) { - phdr = sctp_get_next_param(m, at, &parm, sizeof(parm)); + phdr = sctp_get_next_param(m, at, ¶m, sizeof(param)); if (phdr == NULL) { return (-3); } Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Wed Jun 28 20:28:47 2017 (r320456) +++ stable/11/sys/netinet/sctp_pcb.c Wed Jun 28 21:08:21 2017 (r320457) @@ -2046,7 +2046,7 @@ sctp_findassociation_special_addr(struct mbuf *m, int struct sctphdr *sh, struct sctp_inpcb **inp_p, struct sctp_nets **netp, struct sockaddr *dst) { - struct sctp_paramhdr *phdr, parm_buf; + struct sctp_paramhdr *phdr, param_buf; #if defined(INET) || defined(INET6) struct sctp_tcb *stcb; uint16_t ptype; @@ -2074,7 +2074,7 @@ sctp_findassociation_special_addr(struct mbuf *m, int offset += sizeof(struct sctp_init_chunk); - phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); + phdr = sctp_get_next_param(m, offset, ¶m_buf, sizeof(param_buf)); while (phdr != NULL) { /* now we must see if we want the parameter */ #if defined(INET) || defined(INET6) @@ -2088,10 +2088,10 @@ sctp_findassociation_special_addr(struct mbuf *m, int if (ptype == SCTP_IPV4_ADDRESS && plen == sizeof(struct sctp_ipv4addr_param)) { /* Get the rest of the address */ - struct sctp_ipv4addr_param ip4_parm, *p4; + struct sctp_ipv4addr_param ip4_param, *p4; phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)&ip4_parm, min(plen, sizeof(ip4_parm))); + (struct sctp_paramhdr *)&ip4_param, sizeof(ip4_param)); if (phdr == NULL) { return (NULL); } @@ -2109,10 +2109,10 @@ sctp_findassociation_special_addr(struct mbuf *m, int if (ptype == SCTP_IPV6_ADDRESS && plen == sizeof(struct sctp_ipv6addr_param)) { /* Get the rest of the address */ - struct sctp_ipv6addr_param ip6_parm, *p6; + struct sctp_ipv6addr_param ip6_param, *p6; phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)&ip6_parm, min(plen, sizeof(ip6_parm))); + (struct sctp_paramhdr *)&ip6_param, sizeof(ip6_param)); if (phdr == NULL) { return (NULL); } @@ -2127,8 +2127,8 @@ sctp_findassociation_special_addr(struct mbuf *m, int } #endif offset += SCTP_SIZE32(plen); - phdr = sctp_get_next_param(m, offset, &parm_buf, - sizeof(parm_buf)); + phdr = sctp_get_next_param(m, offset, ¶m_buf, + sizeof(param_buf)); } return (NULL); } @@ -2301,7 +2301,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int off { struct sctp_tcb *stcb; union sctp_sockstore remote_store; - struct sctp_paramhdr parm_buf, *phdr; + struct sctp_paramhdr param_buf, *phdr; int ptype; int zero_address = 0; #ifdef INET @@ -2313,7 +2313,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int off memset(&remote_store, 0, sizeof(remote_store)); phdr = sctp_get_next_param(m, offset + sizeof(struct sctp_asconf_chunk), - &parm_buf, sizeof(struct sctp_paramhdr)); + ¶m_buf, sizeof(struct sctp_paramhdr)); if (phdr == NULL) { SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf lookup addr\n", __func__); @@ -2333,7 +2333,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int off } p6 = (struct sctp_ipv6addr_param *)sctp_get_next_param(m, offset + sizeof(struct sctp_asconf_chunk), - &p6_buf.ph, sizeof(*p6)); + &p6_buf.ph, sizeof(p6_buf)); if (p6 == NULL) { SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf v6 lookup addr\n", __func__); @@ -2360,7 +2360,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int off } p4 = (struct sctp_ipv4addr_param *)sctp_get_next_param(m, offset + sizeof(struct sctp_asconf_chunk), - &p4_buf.ph, sizeof(*p4)); + &p4_buf.ph, sizeof(p4_buf)); if (p4 == NULL) { SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf v4 lookup addr\n", __func__); @@ -6026,7 +6026,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s */ struct sctp_inpcb *inp; struct sctp_nets *net, *nnet, *net_tmp; - struct sctp_paramhdr *phdr, parm_buf; + struct sctp_paramhdr *phdr, param_buf; struct sctp_tcb *stcb_tmp; uint16_t ptype, plen; struct sockaddr *sa; @@ -6136,7 +6136,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s return (-4); } /* now we must go through each of the params. */ - phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); + phdr = sctp_get_next_param(m, offset, ¶m_buf, sizeof(param_buf)); while (phdr) { ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); @@ -6374,7 +6374,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)&lstore, - min(plen, sizeof(lstore))); + plen); if (phdr == NULL) { return (-24); } @@ -6427,8 +6427,11 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s uint8_t local_store[SCTP_PARAM_BUFFER_SIZE]; int num_ent, i; + if (plen > sizeof(local_store)) { + return (-35); + } phdr = sctp_get_next_param(m, offset, - (struct sctp_paramhdr *)&local_store, min(sizeof(local_store), plen)); + (struct sctp_paramhdr *)&local_store, plen); if (phdr == NULL) { return (-25); } @@ -6475,7 +6478,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)random_store, - min(sizeof(random_store), plen)); + plen); if (phdr == NULL) return (-26); p_random = (struct sctp_auth_random *)phdr; @@ -6498,7 +6501,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)hmacs_store, - min(plen, sizeof(hmacs_store))); + plen); if (phdr == NULL) return (-28); hmacs = (struct sctp_auth_hmac_algo *)phdr; @@ -6529,7 +6532,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)chunks_store, - min(plen, sizeof(chunks_store))); + plen); if (phdr == NULL) return (-30); chunks = (struct sctp_auth_chunk_list *)phdr; @@ -6577,8 +6580,8 @@ next_param: if (offset >= limit) { break; } - phdr = sctp_get_next_param(m, offset, &parm_buf, - sizeof(parm_buf)); + phdr = sctp_get_next_param(m, offset, ¶m_buf, + sizeof(param_buf)); } /* Now check to see if we need to purge any addresses */ TAILQ_FOREACH_SAFE(net, &stcb->asoc.nets, sctp_next, nnet) { From owner-svn-src-stable@freebsd.org Thu Jun 29 12:49:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295E9D9CC87; Thu, 29 Jun 2017 12:49: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 EC8D7833A1; Thu, 29 Jun 2017 12:49: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 v5TCn4ra097909; Thu, 29 Jun 2017 12:49:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5TCn436097908; Thu, 29 Jun 2017 12:49:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706291249.v5TCn436097908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 29 Jun 2017 12:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320469 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 320469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 12:49:05 -0000 Author: avg Date: Thu Jun 29 12:49:03 2017 New Revision: 320469 URL: https://svnweb.freebsd.org/changeset/base/320469 Log: MFC r320353: linux_getdents, linux_readdir: fix mismatch between malloc and free tags Approved by: re (gjb) Modified: stable/11/sys/compat/linux/linux_file.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Thu Jun 29 06:28:54 2017 (r320468) +++ stable/11/sys/compat/linux/linux_file.c Thu Jun 29 12:49:03 2017 (r320469) @@ -394,9 +394,9 @@ linux_getdents(struct thread *td, struct linux_getdent td->td_retval[0] = retval; out: - free(lbuf, M_LINUX); + free(lbuf, M_TEMP); out1: - free(buf, M_LINUX); + free(buf, M_TEMP); return (error); } @@ -522,9 +522,9 @@ linux_readdir(struct thread *td, struct linux_readdir_ if (error == 0) td->td_retval[0] = linuxreclen; - free(lbuf, M_LINUX); + free(lbuf, M_TEMP); out: - free(buf, M_LINUX); + free(buf, M_TEMP); return (error); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ From owner-svn-src-stable@freebsd.org Thu Jun 29 17:29:08 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D799BDA1A77; Thu, 29 Jun 2017 17:29:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD1867954; Thu, 29 Jun 2017 17:29:08 +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 v5THT7cA013036; Thu, 29 Jun 2017 17:29:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5THT7Jg013035; Thu, 29 Jun 2017 17:29:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706291729.v5THT7Jg013035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Jun 2017 17:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320474 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/10/sys/cam/scsi X-SVN-Commit-Revision: 320474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 17:29:09 -0000 Author: markj Date: Thu Jun 29 17:29:07 2017 New Revision: 320474 URL: https://svnweb.freebsd.org/changeset/base/320474 Log: MFC r320372: Fix a memory leak in ses_get_elm_devnames(). Modified: stable/10/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_enc_ses.c Thu Jun 29 16:39:55 2017 (r320473) +++ stable/10/sys/cam/scsi/scsi_enc_ses.c Thu Jun 29 17:29:07 2017 (r320474) @@ -2687,10 +2687,11 @@ ses_get_elm_devnames(enc_softc_t *enc, encioc_elm_devn cam_periph_unlock(enc->periph); sbuf_new(&sb, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, &enc->enc_cache.elm_map[elmdn->elm_idx], - ses_elmdevname_callback, &sb); + ses_elmdevname_callback, &sb); sbuf_finish(&sb); elmdn->elm_names_len = sbuf_len(&sb); copyout(sbuf_data(&sb), elmdn->elm_devnames, elmdn->elm_names_len + 1); + sbuf_delete(&sb); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); } From owner-svn-src-stable@freebsd.org Thu Jun 29 17:34:50 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E131DA1D9B; Thu, 29 Jun 2017 17:34:50 +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 076DA680B9; Thu, 29 Jun 2017 17:34:49 +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 v5THYn6Y017098; Thu, 29 Jun 2017 17:34:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5THYnb5017097; Thu, 29 Jun 2017 17:34:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706291734.v5THYnb5017097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Jun 2017 17:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320475 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 320475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 17:34:50 -0000 Author: markj Date: Thu Jun 29 17:34:48 2017 New Revision: 320475 URL: https://svnweb.freebsd.org/changeset/base/320475 Log: MFC r320372: Fix a memory leak in ses_get_elm_devnames(). Approved by: re (gjb) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu Jun 29 17:29:07 2017 (r320474) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu Jun 29 17:34:48 2017 (r320475) @@ -2684,10 +2684,11 @@ ses_get_elm_devnames(enc_softc_t *enc, encioc_elm_devn cam_periph_unlock(enc->periph); sbuf_new(&sb, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, &enc->enc_cache.elm_map[elmdn->elm_idx], - ses_elmdevname_callback, &sb); + ses_elmdevname_callback, &sb); sbuf_finish(&sb); elmdn->elm_names_len = sbuf_len(&sb); copyout(sbuf_data(&sb), elmdn->elm_devnames, elmdn->elm_names_len + 1); + sbuf_delete(&sb); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); } From owner-svn-src-stable@freebsd.org Thu Jun 29 23:57:36 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26E4DA875C; Thu, 29 Jun 2017 23:57:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1BF3788FC; Thu, 29 Jun 2017 23:57:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5TNvZKC076831; Thu, 29 Jun 2017 23:57:35 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5TNvZxe076829; Thu, 29 Jun 2017 23:57:35 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201706292357.v5TNvZxe076829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 29 Jun 2017 23:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320487 - in stable/11/sys: conf sys X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11/sys: conf sys X-SVN-Commit-Revision: 320487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 23:57:37 -0000 Author: gjb Date: Thu Jun 29 23:57:35 2017 New Revision: 320487 URL: https://svnweb.freebsd.org/changeset/base/320487 Log: - Update stable/11 to 11.1-PRERELEASE for the duration of the 11.1-RELEASE cycle. - Reset __FreeBSD_version for 11.1-STABLE. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh stable/11/sys/sys/param.h Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu Jun 29 23:56:50 2017 (r320486) +++ stable/11/sys/conf/newvers.sh Thu Jun 29 23:57:35 2017 (r320487) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="BETA3" +BRANCH="PRERELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Thu Jun 29 23:56:50 2017 (r320486) +++ stable/11/sys/sys/param.h Thu Jun 29 23:57:35 2017 (r320487) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100514 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Fri Jun 30 09:34:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD937D8D0B8; Fri, 30 Jun 2017 09:34:52 +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 899EF2620; Fri, 30 Jun 2017 09:34:52 +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 v5U9Yp32026880; Fri, 30 Jun 2017 09:34:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5U9Yo8k026872; Fri, 30 Jun 2017 09:34:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706300934.v5U9Yo8k026872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 30 Jun 2017 09:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320496 - in stable/10: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/10: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 320496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 09:34:52 -0000 Author: avg Date: Fri Jun 30 09:34:50 2017 New Revision: 320496 URL: https://svnweb.freebsd.org/changeset/base/320496 Log: MFC r308782: After some ZIL changes 6 years ago zil_slog_limit got partially broken due to zl_itx_list_sz not updated when async itx'es upgraded to sync. Actually because of other changes about that time zl_itx_list_sz is not really required to implement the functionality, so this patch removes some unneeded broken code and variables. Original idea of zil_slog_limit was to reduce chance of SLOG abuse by single heavy logger, that increased latency for other (more latency critical) loggers, by pushing heavy log out into the main pool instead of SLOG. Beside huge latency increase for heavy writers, this implementation caused double write of all data, since the log records were explicitly prepared for SLOG. Since we now have I/O scheduler, I've found it can be much more efficient to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG. Existing ZIL implementation had problem with space efficiency when it has to write large chunks of data into log blocks of limited size. In some cases efficiency stopped to almost as low as 50%. In case of ZIL stored on spinning rust, that also reduced log write speed in half, since head had to uselessly fly over allocated but not written areas. This change improves the situation by offloading problematic operations from z*_log_write() to zil_lwb_commit(), which knows real situation of log blocks allocation and can split large requests into pieces much more efficiently. Also as side effect it removes one of two data copy operations done by ZIL code WR_COPIED case. While there, untangle and unify code of z*_log_write() functions. Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing block boundary, that may also improve efficiency if ZPL is made to do that. Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jun 30 09:34:50 2017 (r320496) @@ -1371,7 +1371,6 @@ ztest_log_write(ztest_ds_t *zd, dmu_tx_t *tx, lr_write itx->itx_private = zd; itx->itx_wr_state = write_state; itx->itx_sync = (ztest_random(8) == 0); - itx->itx_sod += (write_state == WR_NEED_COPY ? lr->lr_length : 0); bcopy(&lr->lr_common + 1, &itx->itx_lr + 1, sizeof (*lr) - sizeof (lr_t)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jun 30 09:34:50 2017 (r320496) @@ -369,7 +369,6 @@ typedef struct itx { void *itx_private; /* type-specific opaque data */ itx_wr_state_t itx_wr_state; /* write state */ uint8_t itx_sync; /* synchronous transaction */ - uint64_t itx_sod; /* record size on disk */ uint64_t itx_oid; /* object id */ lr_t itx_lr; /* common part of log record */ /* followed by type-specific part of lr_xx_t and its immediate data */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Fri Jun 30 09:34:50 2017 (r320496) @@ -42,6 +42,7 @@ extern "C" { typedef struct lwb { zilog_t *lwb_zilog; /* back pointer to log struct */ blkptr_t lwb_blk; /* on disk address of this log blk */ + boolean_t lwb_slog; /* lwb_blk is on SLOG device */ int lwb_nused; /* # used bytes in buffer */ int lwb_sz; /* size of block and buffer */ char *lwb_buf; /* log write buffer */ @@ -62,7 +63,6 @@ typedef struct itxs { typedef struct itxg { kmutex_t itxg_lock; /* lock for this structure */ uint64_t itxg_txg; /* txg for this chain */ - uint64_t itxg_sod; /* total size on disk for this txg */ itxs_t *itxg_itxs; /* sync and async itxs */ } itxg_t; @@ -120,7 +120,6 @@ struct zilog { kcondvar_t zl_cv_batch[2]; /* batch condition variables */ itxg_t zl_itxg[TXG_SIZE]; /* intent log txg chains */ list_t zl_itx_commit_list; /* itx list to be committed */ - uint64_t zl_itx_list_sz; /* total size of records on list */ uint64_t zl_cur_used; /* current commit log size used */ list_t zl_lwb_list; /* in-flight log write list */ kmutex_t zl_vdev_lock; /* protects zl_vdev_tree */ @@ -142,6 +141,8 @@ typedef struct zil_bp_node { #define ZIL_MAX_LOG_DATA (SPA_OLD_MAXBLOCKSIZE - sizeof (zil_chain_t) - \ sizeof (lr_write_t)) +#define ZIL_MAX_COPIED_DATA \ + ((SPA_OLD_MAXBLOCKSIZE - sizeof (zil_chain_t)) / 2 - sizeof (lr_write_t)) #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Jun 30 09:34:50 2017 (r320496) @@ -546,7 +546,7 @@ extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, ui const blkptr_t *bp, uint64_t size, enum zio_flag flags); extern int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, - blkptr_t *old_bp, uint64_t size, boolean_t use_slog); + blkptr_t *old_bp, uint64_t size, boolean_t *slog); extern void zio_free_zil(spa_t *spa, uint64_t txg, blkptr_t *bp); extern void zio_flush(zio_t *zio, vdev_t *vd); extern zio_t *zio_trim(zio_t *zio, spa_t *spa, vdev_t *vd, uint64_t offset, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jun 30 09:34:50 2017 (r320496) @@ -459,21 +459,18 @@ void zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, znode_t *zp, offset_t off, ssize_t resid, int ioflag) { + uint32_t blocksize = zp->z_blksz; itx_wr_state_t write_state; - boolean_t slogging; uintptr_t fsync_cnt; - ssize_t immediate_write_sz; if (zil_replaying(zilog, tx) || zp->z_unlinked) return; - immediate_write_sz = (zilog->zl_logbias == ZFS_LOGBIAS_THROUGHPUT) - ? 0 : zfs_immediate_write_sz; - - slogging = spa_has_slogs(zilog->zl_spa) && - (zilog->zl_logbias == ZFS_LOGBIAS_LATENCY); - if (resid > immediate_write_sz && !slogging && resid <= zp->z_blksz) + if (zilog->zl_logbias == ZFS_LOGBIAS_THROUGHPUT) write_state = WR_INDIRECT; + else if (!spa_has_slogs(zilog->zl_spa) && + resid >= zfs_immediate_write_sz) + write_state = WR_INDIRECT; else if (ioflag & (FSYNC | FDSYNC)) write_state = WR_COPIED; else @@ -486,30 +483,26 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype while (resid) { itx_t *itx; lr_write_t *lr; - ssize_t len; + itx_wr_state_t wr_state = write_state; + ssize_t len = resid; - /* - * If the write would overflow the largest block then split it. - */ - if (write_state != WR_INDIRECT && resid > ZIL_MAX_LOG_DATA) - len = SPA_OLD_MAXBLOCKSIZE >> 1; - else - len = resid; + if (wr_state == WR_COPIED && resid > ZIL_MAX_COPIED_DATA) + wr_state = WR_NEED_COPY; + else if (wr_state == WR_INDIRECT) + len = MIN(blocksize - P2PHASE(off, blocksize), resid); itx = zil_itx_create(txtype, sizeof (*lr) + - (write_state == WR_COPIED ? len : 0)); + (wr_state == WR_COPIED ? len : 0)); lr = (lr_write_t *)&itx->itx_lr; - if (write_state == WR_COPIED && dmu_read(zp->z_zfsvfs->z_os, + if (wr_state == WR_COPIED && dmu_read(zp->z_zfsvfs->z_os, zp->z_id, off, len, lr + 1, DMU_READ_NO_PREFETCH) != 0) { zil_itx_destroy(itx); itx = zil_itx_create(txtype, sizeof (*lr)); lr = (lr_write_t *)&itx->itx_lr; - write_state = WR_NEED_COPY; + wr_state = WR_NEED_COPY; } - itx->itx_wr_state = write_state; - if (write_state == WR_NEED_COPY) - itx->itx_sod += len; + itx->itx_wr_state = wr_state; lr->lr_foid = zp->z_id; lr->lr_offset = off; lr->lr_length = len; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Jun 30 09:34:50 2017 (r320496) @@ -90,6 +90,15 @@ TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled) SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, "Enable ZFS TRIM"); +/* + * Limit SLOG write size per commit executed with synchronous priority. + * Any writes above that executed with lower (asynchronous) priority to + * limit potential SLOG device abuse by single active ZIL writer. + */ +uint64_t zil_slog_limit = 768 * 1024; +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, zil_slog_limit, CTLFLAG_RWTUN, + &zil_slog_limit, 0, "Maximal SLOG commit size with sync priority"); + static kmem_cache_t *zil_lwb_cache; #define LWB_EMPTY(lwb) ((BP_GET_LSIZE(&lwb->lwb_blk) - \ @@ -449,13 +458,14 @@ zil_free_log_record(zilog_t *zilog, lr_t *lrc, void *t } static lwb_t * -zil_alloc_lwb(zilog_t *zilog, blkptr_t *bp, uint64_t txg) +zil_alloc_lwb(zilog_t *zilog, blkptr_t *bp, boolean_t slog, uint64_t txg) { lwb_t *lwb; lwb = kmem_cache_alloc(zil_lwb_cache, KM_SLEEP); lwb->lwb_zilog = zilog; lwb->lwb_blk = *bp; + lwb->lwb_slog = slog; lwb->lwb_buf = zio_buf_alloc(BP_GET_LSIZE(bp)); lwb->lwb_max_txg = txg; lwb->lwb_zio = NULL; @@ -539,6 +549,7 @@ zil_create(zilog_t *zilog) dmu_tx_t *tx = NULL; blkptr_t blk; int error = 0; + boolean_t slog = FALSE; /* * Wait for any previous destroy to complete. @@ -567,7 +578,7 @@ zil_create(zilog_t *zilog) } error = zio_alloc_zil(zilog->zl_spa, txg, &blk, NULL, - ZIL_MIN_BLKSZ, zilog->zl_logbias == ZFS_LOGBIAS_LATENCY); + ZIL_MIN_BLKSZ, &slog); if (error == 0) zil_init_log_chain(zilog, &blk); @@ -577,7 +588,7 @@ zil_create(zilog_t *zilog) * Allocate a log write buffer (lwb) for the first log block. */ if (error == 0) - lwb = zil_alloc_lwb(zilog, &blk, txg); + lwb = zil_alloc_lwb(zilog, &blk, slog, txg); /* * If we just allocated the first log block, commit our transaction @@ -910,6 +921,7 @@ static void zil_lwb_write_init(zilog_t *zilog, lwb_t *lwb) { zbookmark_phys_t zb; + zio_priority_t prio; SET_BOOKMARK(&zb, lwb->lwb_blk.blk_cksum.zc_word[ZIL_ZC_OBJSET], ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, @@ -920,9 +932,13 @@ zil_lwb_write_init(zilog_t *zilog, lwb_t *lwb) ZIO_FLAG_CANFAIL); } if (lwb->lwb_zio == NULL) { + if (zilog->zl_cur_used <= zil_slog_limit || !lwb->lwb_slog) + prio = ZIO_PRIORITY_SYNC_WRITE; + else + prio = ZIO_PRIORITY_ASYNC_WRITE; lwb->lwb_zio = zio_rewrite(zilog->zl_root_zio, zilog->zl_spa, 0, &lwb->lwb_blk, lwb->lwb_buf, BP_GET_LSIZE(&lwb->lwb_blk), - zil_lwb_write_done, lwb, ZIO_PRIORITY_SYNC_WRITE, + zil_lwb_write_done, lwb, prio, ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE, &zb); } } @@ -942,16 +958,6 @@ uint64_t zil_block_buckets[] = { }; /* - * Use the slog as long as the logbias is 'latency' and the current commit size - * is less than the limit or the total list size is less than 2X the limit. - * Limit checking is disabled by setting zil_slog_limit to UINT64_MAX. - */ -uint64_t zil_slog_limit = 1024 * 1024; -#define USE_SLOG(zilog) (((zilog)->zl_logbias == ZFS_LOGBIAS_LATENCY) && \ - (((zilog)->zl_cur_used < zil_slog_limit) || \ - ((zilog)->zl_itx_list_sz < (zil_slog_limit << 1)))) - -/* * Start a log block write and advance to the next log block. * Calls are serialized. */ @@ -966,6 +972,7 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb, boolea uint64_t txg; uint64_t zil_blksz, wsz; int i, error; + boolean_t slog; if (BP_GET_CHECKSUM(&lwb->lwb_blk) == ZIO_CHECKSUM_ZILOG2) { zilc = (zil_chain_t *)lwb->lwb_buf; @@ -1022,8 +1029,7 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb, boolea BP_ZERO(bp); /* pass the old blkptr in order to spread log blocks across devs */ - error = zio_alloc_zil(spa, txg, bp, &lwb->lwb_blk, zil_blksz, - USE_SLOG(zilog)); + error = zio_alloc_zil(spa, txg, bp, &lwb->lwb_blk, zil_blksz, &slog); if (error == 0) { ASSERT3U(bp->blk_birth, ==, txg); bp->blk_cksum = lwb->lwb_blk.blk_cksum; @@ -1032,7 +1038,7 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb, boolea /* * Allocate a new log write buffer (lwb). */ - nlwb = zil_alloc_lwb(zilog, bp, txg); + nlwb = zil_alloc_lwb(zilog, bp, slog, txg); /* Record the block for later vdev flushing */ zil_add_block(zilog, &lwb->lwb_blk); @@ -1071,12 +1077,13 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb, boolea static lwb_t * zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb) { - lr_t *lrc = &itx->itx_lr; /* common log record */ - lr_write_t *lrw = (lr_write_t *)lrc; + lr_t *lrcb, *lrc = &itx->itx_lr; /* common log record */ + lr_write_t *lrwb, *lrw = (lr_write_t *)lrc; char *lr_buf; uint64_t txg = lrc->lrc_txg; uint64_t reclen = lrc->lrc_reclen; uint64_t dlen = 0; + uint64_t dnow, lwb_sp; if (lwb == NULL) return (NULL); @@ -1091,25 +1098,30 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb) zil_lwb_write_init(zilog, lwb); +cont: /* * If this record won't fit in the current log block, start a new one. + * For WR_NEED_COPY optimize layout for minimal number of chunks, but + * try to keep wasted space withing reasonable range (12%). */ - if (lwb->lwb_nused + reclen + dlen > lwb->lwb_sz) { + lwb_sp = lwb->lwb_sz - lwb->lwb_nused; + if (reclen > lwb_sp || (reclen + dlen > lwb_sp && + lwb_sp < ZIL_MAX_LOG_DATA / 8 && (dlen % ZIL_MAX_LOG_DATA == 0 || + lwb_sp < reclen + dlen % ZIL_MAX_LOG_DATA))) { lwb = zil_lwb_write_start(zilog, lwb, B_FALSE); if (lwb == NULL) return (NULL); zil_lwb_write_init(zilog, lwb); ASSERT(LWB_EMPTY(lwb)); - if (lwb->lwb_nused + reclen + dlen > lwb->lwb_sz) { - txg_wait_synced(zilog->zl_dmu_pool, txg); - return (lwb); - } + lwb_sp = lwb->lwb_sz - lwb->lwb_nused; + ASSERT3U(reclen + MIN(dlen, sizeof(uint64_t)), <=, lwb_sp); } + dnow = MIN(dlen, lwb_sp - reclen); lr_buf = lwb->lwb_buf + lwb->lwb_nused; bcopy(lrc, lr_buf, reclen); - lrc = (lr_t *)lr_buf; - lrw = (lr_write_t *)lrc; + lrcb = (lr_t *)lr_buf; + lrwb = (lr_write_t *)lrcb; /* * If it's a write, fetch the data or get its blkptr as appropriate. @@ -1121,16 +1133,19 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb) char *dbuf; int error; - if (dlen) { - ASSERT(itx->itx_wr_state == WR_NEED_COPY); + if (itx->itx_wr_state == WR_NEED_COPY) { dbuf = lr_buf + reclen; - lrw->lr_common.lrc_reclen += dlen; + lrcb->lrc_reclen += dnow; + if (lrwb->lr_length > dnow) + lrwb->lr_length = dnow; + lrw->lr_offset += dnow; + lrw->lr_length -= dnow; } else { ASSERT(itx->itx_wr_state == WR_INDIRECT); dbuf = NULL; } error = zilog->zl_get_data( - itx->itx_private, lrw, dbuf, lwb->lwb_zio); + itx->itx_private, lrwb, dbuf, lwb->lwb_zio); if (error == EIO) { txg_wait_synced(zilog->zl_dmu_pool, txg); return (lwb); @@ -1149,12 +1164,18 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb) * equal to the itx sequence number because not all transactions * are synchronous, and sometimes spa_sync() gets there first. */ - lrc->lrc_seq = ++zilog->zl_lr_seq; /* we are single threaded */ - lwb->lwb_nused += reclen + dlen; + lrcb->lrc_seq = ++zilog->zl_lr_seq; /* we are single threaded */ + lwb->lwb_nused += reclen + dnow; lwb->lwb_max_txg = MAX(lwb->lwb_max_txg, txg); ASSERT3U(lwb->lwb_nused, <=, lwb->lwb_sz); ASSERT0(P2PHASE(lwb->lwb_nused, sizeof (uint64_t))); + dlen -= dnow; + if (dlen > 0) { + zilog->zl_cur_used += reclen; + goto cont; + } + return (lwb); } @@ -1168,7 +1189,6 @@ zil_itx_create(uint64_t txtype, size_t lrsize) itx = kmem_alloc(offsetof(itx_t, itx_lr) + lrsize, KM_SLEEP); itx->itx_lr.lrc_txtype = txtype; itx->itx_lr.lrc_reclen = lrsize; - itx->itx_sod = lrsize; /* if write & WR_NEED_COPY will be increased */ itx->itx_lr.lrc_seq = 0; /* defensive */ itx->itx_sync = B_TRUE; /* default is synchronous */ @@ -1317,11 +1337,8 @@ zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *t * this itxg. Save the itxs for release below. * This should be rare. */ - atomic_add_64(&zilog->zl_itx_list_sz, -itxg->itxg_sod); - itxg->itxg_sod = 0; clean = itxg->itxg_itxs; } - ASSERT(itxg->itxg_sod == 0); itxg->itxg_txg = txg; itxs = itxg->itxg_itxs = kmem_zalloc(sizeof (itxs_t), KM_SLEEP); @@ -1333,8 +1350,6 @@ zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *t } if (itx->itx_sync) { list_insert_tail(&itxs->i_sync_list, itx); - atomic_add_64(&zilog->zl_itx_list_sz, itx->itx_sod); - itxg->itxg_sod += itx->itx_sod; } else { avl_tree_t *t = &itxs->i_async_tree; uint64_t foid = ((lr_ooo_t *)&itx->itx_lr)->lr_foid; @@ -1382,8 +1397,6 @@ zil_clean(zilog_t *zilog, uint64_t synced_txg) ASSERT3U(itxg->itxg_txg, <=, synced_txg); ASSERT(itxg->itxg_txg != 0); ASSERT(zilog->zl_clean_taskq != NULL); - atomic_add_64(&zilog->zl_itx_list_sz, -itxg->itxg_sod); - itxg->itxg_sod = 0; clean_me = itxg->itxg_itxs; itxg->itxg_itxs = NULL; itxg->itxg_txg = 0; @@ -1407,7 +1420,6 @@ zil_get_commit_list(zilog_t *zilog) { uint64_t otxg, txg; list_t *commit_list = &zilog->zl_itx_commit_list; - uint64_t push_sod = 0; if (spa_freeze_txg(zilog->zl_spa) != UINT64_MAX) /* ziltest support */ otxg = ZILTEST_TXG; @@ -1439,12 +1451,9 @@ zil_get_commit_list(zilog_t *zilog) ASSERT(zilog_is_dirty_in_txg(zilog, txg) || spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); list_move_tail(commit_list, &itxg->itxg_itxs->i_sync_list); - push_sod += itxg->itxg_sod; - itxg->itxg_sod = 0; mutex_exit(&itxg->itxg_lock); } - atomic_add_64(&zilog->zl_itx_list_sz, -push_sod); } /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jun 30 09:34:50 2017 (r320496) @@ -2943,20 +2943,21 @@ zio_dva_unallocate(zio_t *zio, zio_gang_node_t *gn, bl */ int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, blkptr_t *old_bp, - uint64_t size, boolean_t use_slog) + uint64_t size, boolean_t *slog) { int error = 1; ASSERT(txg > spa_syncing_txg(spa)); - if (use_slog) { - error = metaslab_alloc(spa, spa_log_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID, NULL); - } - - if (error) { + error = metaslab_alloc(spa, spa_log_class(spa), size, + new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID, NULL); + if (error == 0) { + *slog = TRUE; + } else { error = metaslab_alloc(spa, spa_normal_class(spa), size, new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID, NULL); + if (error == 0) + *slog = FALSE; } if (error == 0) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jun 30 07:48:08 2017 (r320495) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jun 30 09:34:50 2017 (r320496) @@ -1362,54 +1362,44 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_t *tx, offset_ { uint32_t blocksize = zv->zv_volblocksize; zilog_t *zilog = zv->zv_zilog; - boolean_t slogging; - ssize_t immediate_write_sz; + itx_wr_state_t write_state; if (zil_replaying(zilog, tx)) return; - immediate_write_sz = (zilog->zl_logbias == ZFS_LOGBIAS_THROUGHPUT) - ? 0 : zvol_immediate_write_sz; + if (zilog->zl_logbias == ZFS_LOGBIAS_THROUGHPUT) + write_state = WR_INDIRECT; + else if (!spa_has_slogs(zilog->zl_spa) && + resid >= blocksize && blocksize > zvol_immediate_write_sz) + write_state = WR_INDIRECT; + else if (sync) + write_state = WR_COPIED; + else + write_state = WR_NEED_COPY; - slogging = spa_has_slogs(zilog->zl_spa) && - (zilog->zl_logbias == ZFS_LOGBIAS_LATENCY); - while (resid) { itx_t *itx; lr_write_t *lr; - ssize_t len; - itx_wr_state_t write_state; + itx_wr_state_t wr_state = write_state; + ssize_t len = resid; - /* - * Unlike zfs_log_write() we can be called with - * upto DMU_MAX_ACCESS/2 (5MB) writes. - */ - if (blocksize > immediate_write_sz && !slogging && - resid >= blocksize && off % blocksize == 0) { - write_state = WR_INDIRECT; /* uses dmu_sync */ - len = blocksize; - } else if (sync) { - write_state = WR_COPIED; - len = MIN(ZIL_MAX_LOG_DATA, resid); - } else { - write_state = WR_NEED_COPY; - len = MIN(ZIL_MAX_LOG_DATA, resid); - } + if (wr_state == WR_COPIED && resid > ZIL_MAX_COPIED_DATA) + wr_state = WR_NEED_COPY; + else if (wr_state == WR_INDIRECT) + len = MIN(blocksize - P2PHASE(off, blocksize), resid); itx = zil_itx_create(TX_WRITE, sizeof (*lr) + - (write_state == WR_COPIED ? len : 0)); + (wr_state == WR_COPIED ? len : 0)); lr = (lr_write_t *)&itx->itx_lr; - if (write_state == WR_COPIED && dmu_read(zv->zv_objset, + if (wr_state == WR_COPIED && dmu_read(zv->zv_objset, ZVOL_OBJ, off, len, lr + 1, DMU_READ_NO_PREFETCH) != 0) { zil_itx_destroy(itx); itx = zil_itx_create(TX_WRITE, sizeof (*lr)); lr = (lr_write_t *)&itx->itx_lr; - write_state = WR_NEED_COPY; + wr_state = WR_NEED_COPY; } - itx->itx_wr_state = write_state; - if (write_state == WR_NEED_COPY) - itx->itx_sod += len; + itx->itx_wr_state = wr_state; lr->lr_foid = ZVOL_OBJ; lr->lr_offset = off; lr->lr_length = len; From owner-svn-src-stable@freebsd.org Fri Jun 30 21:32:50 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ADA7D9AF2F; Fri, 30 Jun 2017 21:32:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 002267D919; Fri, 30 Jun 2017 21:32:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5ULWn0m030248; Fri, 30 Jun 2017 21:32:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5ULWmg0030245; Fri, 30 Jun 2017 21:32:48 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201706302132.v5ULWmg0030245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 30 Jun 2017 21:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320510 - in stable/10/bin/sh: . tests/expansion X-SVN-Group: stable-10 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in stable/10/bin/sh: . tests/expansion X-SVN-Commit-Revision: 320510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 21:32:50 -0000 Author: jilles Date: Fri Jun 30 21:32:48 2017 New Revision: 320510 URL: https://svnweb.freebsd.org/changeset/base/320510 Log: MFC r315005: sh: Fix executing wrong command with ${x#$(y)}$(z). The parsed internal representation of words consists of a byte string with a list of nodes (commands in command substitution). Each unescaped CTLBACKQ or CTLBACKQ | CTLQUOTE byte corresponds to an entry in the list. If param in ${param#%##%%word} is not set, the word is not expanded (in a deviation of POSIX shared with other ash variants and ksh93). Erroneously, the pointer in the list of commands (argbackq) was not advanced. This caused the wrong command to be executed later if the outer word contained another command substitution. Example: echo "${unsetvar#$(echo a)}$(echo b)" wrote "a" but should write "b". Added: stable/10/bin/sh/tests/expansion/cmdsubst23.0 - copied unchanged from r315005, head/bin/sh/tests/expansion/cmdsubst23.0 Modified: stable/10/bin/sh/expand.c stable/10/bin/sh/tests/expansion/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Fri Jun 30 20:27:51 2017 (r320509) +++ stable/10/bin/sh/expand.c Fri Jun 30 21:32:48 2017 (r320510) @@ -740,8 +740,10 @@ again: /* jump here after setting a variable with ${va case VSTRIMLEFTMAX: case VSTRIMRIGHT: case VSTRIMRIGHTMAX: - if (!set) + if (!set) { + set = 1; break; + } /* * Terminate the string and start recording the pattern * right after it Modified: stable/10/bin/sh/tests/expansion/Makefile ============================================================================== --- stable/10/bin/sh/tests/expansion/Makefile Fri Jun 30 20:27:51 2017 (r320509) +++ stable/10/bin/sh/tests/expansion/Makefile Fri Jun 30 21:32:48 2017 (r320510) @@ -43,6 +43,7 @@ FILES+= cmdsubst19.0 FILES+= cmdsubst20.0 FILES+= cmdsubst21.0 FILES+= cmdsubst22.0 +FILES+= cmdsubst23.0 FILES+= export1.0 FILES+= export2.0 FILES+= export3.0 Copied: stable/10/bin/sh/tests/expansion/cmdsubst23.0 (from r315005, head/bin/sh/tests/expansion/cmdsubst23.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/expansion/cmdsubst23.0 Fri Jun 30 21:32:48 2017 (r320510, copy of r315005, head/bin/sh/tests/expansion/cmdsubst23.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +unset n +x=abcd +[ "X${n#$(echo a)}X${x#$(echo ab)}X$(echo abc)X" = XXcdXabcX ] From owner-svn-src-stable@freebsd.org Fri Jun 30 22:16:29 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F6ED9C428; Fri, 30 Jun 2017 22:16:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9452A80271; Fri, 30 Jun 2017 22:16:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5UMGS4n050048; Fri, 30 Jun 2017 22:16:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5UMGSoI050046; Fri, 30 Jun 2017 22:16:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201706302216.v5UMGSoI050046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 30 Jun 2017 22:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320518 - in stable/10: etc/mtree usr.bin/compress usr.bin/compress/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/compress usr.bin/compress/tests X-SVN-Commit-Revision: 320518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 22:16:29 -0000 Author: jilles Date: Fri Jun 30 22:16:28 2017 New Revision: 320518 URL: https://svnweb.freebsd.org/changeset/base/320518 Log: MFC r318591: compress: Add basic tests. Added: stable/10/usr.bin/compress/tests/ - copied from r318591, head/usr.bin/compress/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/compress/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Fri Jun 30 22:14:22 2017 (r320517) +++ stable/10/etc/mtree/BSD.tests.dist Fri Jun 30 22:16:28 2017 (r320518) @@ -576,6 +576,8 @@ .. cmp .. + compress + .. cpio .. col Modified: stable/10/usr.bin/compress/Makefile ============================================================================== --- stable/10/usr.bin/compress/Makefile Fri Jun 30 22:14:22 2017 (r320517) +++ stable/10/usr.bin/compress/Makefile Fri Jun 30 22:16:28 2017 (r320518) @@ -1,6 +1,8 @@ # @(#)Makefile 8.2 (Berkeley) 4/17/94 # $FreeBSD$ +.include + PROG= compress SRCS= compress.c zopen.c LINKS= ${BINDIR}/compress ${BINDIR}/uncompress @@ -8,5 +10,9 @@ MLINKS= compress.1 uncompress.1 # XXX zopen is not part of libc # MAN=zopen.3 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include From owner-svn-src-stable@freebsd.org Sat Jul 1 03:30:48 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDA0FDA5926; Sat, 1 Jul 2017 03:30: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 8C80065726; Sat, 1 Jul 2017 03:30: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 v613Ul2N077173; Sat, 1 Jul 2017 03:30:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v613Ulvm077172; Sat, 1 Jul 2017 03:30:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707010330.v613Ulvm077172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Jul 2017 03:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320523 - stable/11/sys/amd64/ia32 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/ia32 X-SVN-Commit-Revision: 320523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 03:30:48 -0000 Author: kib Date: Sat Jul 1 03:30:47 2017 New Revision: 320523 URL: https://svnweb.freebsd.org/changeset/base/320523 Log: MFC r320308: Translate between abridged and full x87 tags for compat32 ptrace(PT_GETFPREGS). Modified: stable/11/sys/amd64/ia32/ia32_reg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/ia32/ia32_reg.c ============================================================================== --- stable/11/sys/amd64/ia32/ia32_reg.c Sat Jul 1 02:19:48 2017 (r320522) +++ stable/11/sys/amd64/ia32/ia32_reg.c Sat Jul 1 03:30:47 2017 (r320523) @@ -156,7 +156,7 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs) /* FPU control/status */ penv_87->en_cw = penv_xmm->en_cw; penv_87->en_sw = penv_xmm->en_sw; - penv_87->en_tw = penv_xmm->en_tw; + /* * XXX for en_fip/fcs/foo/fos, check if the fxsave format * uses the old-style layout for 32 bit user apps. If so, @@ -170,9 +170,13 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs) /* Entry into the kernel always sets TF_HASSEGS */ penv_87->en_fos = td->td_frame->tf_ds; - /* FPU registers */ - for (i = 0; i < 8; ++i) + /* FPU registers and tags */ + penv_87->en_tw = 0xffff; + for (i = 0; i < 8; ++i) { sv_87->sv_ac[i] = sv_fpu->sv_fp[i].fp_acc; + if ((penv_xmm->en_tw & (1 << i)) != 0) + penv_87->en_tw &= ~(3 << i * 2); + } return (0); } @@ -189,15 +193,19 @@ set_fpregs32(struct thread *td, struct fpreg32 *regs) /* FPU control/status */ penv_xmm->en_cw = penv_87->en_cw; penv_xmm->en_sw = penv_87->en_sw; - penv_xmm->en_tw = penv_87->en_tw; penv_xmm->en_rip = penv_87->en_fip; /* penv_87->en_fcs and en_fos ignored, see above */ penv_xmm->en_opcode = penv_87->en_opcode; penv_xmm->en_rdp = penv_87->en_foo; - /* FPU registers */ - for (i = 0; i < 8; ++i) + /* FPU registers and tags */ + penv_xmm->en_tw = 0; + for (i = 0; i < 8; ++i) { sv_fpu->sv_fp[i].fp_acc = sv_87->sv_ac[i]; + if ((penv_87->en_tw & (3 << i * 2)) != (3 << i * 2)) + penv_xmm->en_tw |= 1 << i; + } + for (i = 8; i < 16; ++i) bzero(&sv_fpu->sv_fp[i].fp_acc, sizeof(sv_fpu->sv_fp[i].fp_acc)); fpuuserinited(td); From owner-svn-src-stable@freebsd.org Sat Jul 1 03:33:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 930A4DA5B7F; Sat, 1 Jul 2017 03:33: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 5F5B965AB0; Sat, 1 Jul 2017 03:33: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 v613XQvu081110; Sat, 1 Jul 2017 03:33:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v613XQG6081109; Sat, 1 Jul 2017 03:33:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707010333.v613XQG6081109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Jul 2017 03:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320524 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 03:33:27 -0000 Author: kib Date: Sat Jul 1 03:33:26 2017 New Revision: 320524 URL: https://svnweb.freebsd.org/changeset/base/320524 Log: MFC r320316: Do not try to unmark MAP_ENTRY_IN_TRANSITION marked by other thread. Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Sat Jul 1 03:30:47 2017 (r320523) +++ stable/11/sys/vm/vm_map.c Sat Jul 1 03:33:26 2017 (r320524) @@ -2712,9 +2712,6 @@ done: } for (entry = first_entry; entry != &map->header && entry->start < end; entry = entry->next) { - if ((entry->eflags & MAP_ENTRY_WIRE_SKIPPED) != 0) - goto next_entry_done; - /* * If VM_MAP_WIRE_HOLESOK was specified, an empty * space in the unwired region could have been mapped @@ -2722,7 +2719,7 @@ done: * pages or draining MAP_ENTRY_IN_TRANSITION. * Moreover, another thread could be simultaneously * wiring this new mapping entry. Detect these cases - * and skip any entries marked as in transition by us. + * and skip any entries marked as in transition not by us. */ if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 || entry->wiring_thread != curthread) { @@ -2730,6 +2727,9 @@ done: ("vm_map_wire: !HOLESOK and new/changed entry")); continue; } + + if ((entry->eflags & MAP_ENTRY_WIRE_SKIPPED) != 0) + goto next_entry_done; if (rv == KERN_SUCCESS) { if (user_wire) From owner-svn-src-stable@freebsd.org Sat Jul 1 03:38:14 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA64DA5D24; Sat, 1 Jul 2017 03:38:14 +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 141AD65CF4; Sat, 1 Jul 2017 03:38:14 +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 v613cDB1081349; Sat, 1 Jul 2017 03:38:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v613cDDT081348; Sat, 1 Jul 2017 03:38:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707010338.v613cDDT081348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Jul 2017 03:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320525 - stable/10/sys/amd64/ia32 X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/amd64/ia32 X-SVN-Commit-Revision: 320525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 03:38:14 -0000 Author: kib Date: Sat Jul 1 03:38:12 2017 New Revision: 320525 URL: https://svnweb.freebsd.org/changeset/base/320525 Log: MFC r320308: Translate between abridged and full x87 tags for compat32 ptrace(PT_GETFPREGS). Modified: stable/10/sys/amd64/ia32/ia32_reg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/ia32/ia32_reg.c ============================================================================== --- stable/10/sys/amd64/ia32/ia32_reg.c Sat Jul 1 03:33:26 2017 (r320524) +++ stable/10/sys/amd64/ia32/ia32_reg.c Sat Jul 1 03:38:12 2017 (r320525) @@ -156,7 +156,7 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs) /* FPU control/status */ penv_87->en_cw = penv_xmm->en_cw; penv_87->en_sw = penv_xmm->en_sw; - penv_87->en_tw = penv_xmm->en_tw; + /* * XXX for en_fip/fcs/foo/fos, check if the fxsave format * uses the old-style layout for 32 bit user apps. If so, @@ -170,9 +170,13 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs) /* Entry into the kernel always sets TF_HASSEGS */ penv_87->en_fos = td->td_frame->tf_ds; - /* FPU registers */ - for (i = 0; i < 8; ++i) + /* FPU registers and tags */ + penv_87->en_tw = 0xffff; + for (i = 0; i < 8; ++i) { sv_87->sv_ac[i] = sv_fpu->sv_fp[i].fp_acc; + if ((penv_xmm->en_tw & (1 << i)) != 0) + penv_87->en_tw &= ~(3 << i * 2); + } return (0); } @@ -189,15 +193,19 @@ set_fpregs32(struct thread *td, struct fpreg32 *regs) /* FPU control/status */ penv_xmm->en_cw = penv_87->en_cw; penv_xmm->en_sw = penv_87->en_sw; - penv_xmm->en_tw = penv_87->en_tw; penv_xmm->en_rip = penv_87->en_fip; /* penv_87->en_fcs and en_fos ignored, see above */ penv_xmm->en_opcode = penv_87->en_opcode; penv_xmm->en_rdp = penv_87->en_foo; - /* FPU registers */ - for (i = 0; i < 8; ++i) + /* FPU registers and tags */ + penv_xmm->en_tw = 0; + for (i = 0; i < 8; ++i) { sv_fpu->sv_fp[i].fp_acc = sv_87->sv_ac[i]; + if ((penv_87->en_tw & (3 << i * 2)) != (3 << i * 2)) + penv_xmm->en_tw |= 1 << i; + } + for (i = 8; i < 16; ++i) bzero(&sv_fpu->sv_fp[i].fp_acc, sizeof(sv_fpu->sv_fp[i].fp_acc)); fpuuserinited(td); From owner-svn-src-stable@freebsd.org Sat Jul 1 03:39:39 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF710DA5E39; Sat, 1 Jul 2017 03:39:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B90C65E8D; Sat, 1 Jul 2017 03:39:39 +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 v613dcRv081449; Sat, 1 Jul 2017 03:39:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v613dcBR081448; Sat, 1 Jul 2017 03:39:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707010339.v613dcBR081448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Jul 2017 03:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320526 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 03:39:39 -0000 Author: kib Date: Sat Jul 1 03:39:38 2017 New Revision: 320526 URL: https://svnweb.freebsd.org/changeset/base/320526 Log: MFC r320316: Do not try to unmark MAP_ENTRY_IN_TRANSITION marked by other thread. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sat Jul 1 03:38:12 2017 (r320525) +++ stable/10/sys/vm/vm_map.c Sat Jul 1 03:39:38 2017 (r320526) @@ -2658,9 +2658,6 @@ done: } for (entry = first_entry; entry != &map->header && entry->start < end; entry = entry->next) { - if ((entry->eflags & MAP_ENTRY_WIRE_SKIPPED) != 0) - goto next_entry_done; - /* * If VM_MAP_WIRE_HOLESOK was specified, an empty * space in the unwired region could have been mapped @@ -2668,7 +2665,7 @@ done: * pages or draining MAP_ENTRY_IN_TRANSITION. * Moreover, another thread could be simultaneously * wiring this new mapping entry. Detect these cases - * and skip any entries marked as in transition by us. + * and skip any entries marked as in transition not by us. */ if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 || entry->wiring_thread != curthread) { @@ -2676,6 +2673,9 @@ done: ("vm_map_wire: !HOLESOK and new/changed entry")); continue; } + + if ((entry->eflags & MAP_ENTRY_WIRE_SKIPPED) != 0) + goto next_entry_done; if (rv == KERN_SUCCESS) { if (user_wire) From owner-svn-src-stable@freebsd.org Sat Jul 1 12:57:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BF0BD88E20; Sat, 1 Jul 2017 12:57:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17A6B8494C; Sat, 1 Jul 2017 12:57:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v61Cv111009872; Sat, 1 Jul 2017 12:57:01 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61Cv01m009869; Sat, 1 Jul 2017 12:57:00 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201707011257.v61Cv01m009869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 1 Jul 2017 12:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320531 - in stable/10/bin/sh: . tests/builtins X-SVN-Group: stable-10 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in stable/10/bin/sh: . tests/builtins X-SVN-Commit-Revision: 320531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 12:57:02 -0000 Author: jilles Date: Sat Jul 1 12:57:00 2017 New Revision: 320531 URL: https://svnweb.freebsd.org/changeset/base/320531 Log: MFC r317912: sh: Fix INTOFF leak after a builtin with different locale settings. After executing a builtin with different locale settings such as LC_ALL=C true SIGINT handling was left disabled indefinitely. Added: stable/10/bin/sh/tests/builtins/locale2.0 - copied unchanged from r317912, head/bin/sh/tests/builtins/locale2.0 Modified: stable/10/bin/sh/tests/builtins/Makefile stable/10/bin/sh/var.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/tests/builtins/Makefile ============================================================================== --- stable/10/bin/sh/tests/builtins/Makefile Sat Jul 1 10:04:42 2017 (r320530) +++ stable/10/bin/sh/tests/builtins/Makefile Sat Jul 1 12:57:00 2017 (r320531) @@ -100,6 +100,7 @@ FILES+= local4.0 .if ${MK_NLS} != "no" FILES+= locale1.0 .endif +FILES+= locale2.0 FILES+= printf1.0 FILES+= printf2.0 FILES+= printf3.0 Copied: stable/10/bin/sh/tests/builtins/locale2.0 (from r317912, head/bin/sh/tests/builtins/locale2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/builtins/locale2.0 Sat Jul 1 12:57:00 2017 (r320531, copy of r317912, head/bin/sh/tests/builtins/locale2.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +$SH -c 'LC_ALL=C true; kill -INT $$; echo continued' +r=$? +[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = INT ] Modified: stable/10/bin/sh/var.c ============================================================================== --- stable/10/bin/sh/var.c Sat Jul 1 10:04:42 2017 (r320530) +++ stable/10/bin/sh/var.c Sat Jul 1 12:57:00 2017 (r320531) @@ -506,7 +506,7 @@ bltinunsetlocale(void) if (localevar(lp->text)) { setlocale(LC_ALL, ""); updatecharset(); - return; + break; } } INTON; From owner-svn-src-stable@freebsd.org Sat Jul 1 13:03:04 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 424ACD8904D; Sat, 1 Jul 2017 13:03:04 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1078284D48; Sat, 1 Jul 2017 13:03:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v61D33ca013853; Sat, 1 Jul 2017 13:03:03 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61D33bg013851; Sat, 1 Jul 2017 13:03:03 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201707011303.v61D33bg013851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 1 Jul 2017 13:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320532 - in stable/10/usr.bin/compress: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in stable/10/usr.bin/compress: . tests X-SVN-Commit-Revision: 320532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 13:03:04 -0000 Author: jilles Date: Sat Jul 1 13:03:02 2017 New Revision: 320532 URL: https://svnweb.freebsd.org/changeset/base/320532 Log: MFC r318592: compress: Allow uncompress -c with multiple pathnames, as required by POSIX. Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating the uncompressed data. Passing multiple pathnames to compress -c remains disallowed, since the result cannot be decompressed. PR: 219387 Modified: stable/10/usr.bin/compress/compress.c stable/10/usr.bin/compress/tests/compress_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/compress/compress.c ============================================================================== --- stable/10/usr.bin/compress/compress.c Sat Jul 1 12:57:00 2017 (r320531) +++ stable/10/usr.bin/compress/compress.c Sat Jul 1 13:03:02 2017 (r320532) @@ -128,7 +128,7 @@ main(int argc, char *argv[]) exit (eval); } - if (cat == 1 && argc > 1) + if (cat == 1 && style == COMPRESS && argc > 1) errx(1, "the -c option permits only a single file argument"); for (; *argv; ++argv) Modified: stable/10/usr.bin/compress/tests/compress_test.sh ============================================================================== --- stable/10/usr.bin/compress/tests/compress_test.sh Sat Jul 1 12:57:00 2017 (r320531) +++ stable/10/usr.bin/compress/tests/compress_test.sh Sat Jul 1 13:03:02 2017 (r320532) @@ -161,6 +161,27 @@ compress_uncompress_file_2_body() atf_check cmp file2 expectfile2 } +atf_test_case compress_uncompress_file_minusc_1 +compress_uncompress_file_minusc_1_head() +{ + atf_set "descr" \ + "Test compressing and uncompressing some data, passing two filenames to uncompress -c" +} +compress_uncompress_file_minusc_1_body() +{ + printf '%01000d\n' 7 8 >expectfile1 + printf '%01000d\n' 8 7 >expectfile2 + cp expectfile1 file1 + cp expectfile2 file2 + atf_check compress file1 file2 + atf_check -s exit:1 cmp -s file1.Z expectfile1 + atf_check -s exit:1 cmp -s file2.Z expectfile2 + atf_check -s exit:1 cmp -s file1.Z file2.Z + atf_check -x 'uncompress -c file1.Z file2.Z >all' + atf_check -x 'cat expectfile1 expectfile2 >expectall' + atf_check cmp all expectall +} + atf_init_test_cases() { atf_add_test_case uncompress_file_1 @@ -171,4 +192,5 @@ atf_init_test_cases() atf_add_test_case compress_uncompress_minusc_1 atf_add_test_case compress_uncompress_file_1 atf_add_test_case compress_uncompress_file_2 + atf_add_test_case compress_uncompress_file_minusc_1 } From owner-svn-src-stable@freebsd.org Sat Jul 1 19:06:16 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13BB1D90469; Sat, 1 Jul 2017 19:06:16 +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 D71656E824; Sat, 1 Jul 2017 19:06:15 +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 v61J6FIU061865; Sat, 1 Jul 2017 19:06:15 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61J6F0n061864; Sat, 1 Jul 2017 19:06:15 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707011906.v61J6F0n061864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 19:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320548 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 19:06:16 -0000 Author: alc Date: Sat Jul 1 19:06:14 2017 New Revision: 320548 URL: https://svnweb.freebsd.org/changeset/base/320548 Log: MFC r319605 The variable "breakout" is used like a Boolean, so actually define it as one. Modified: stable/11/sys/vm/vm_pageout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Sat Jul 1 18:48:15 2017 (r320547) +++ stable/11/sys/vm/vm_pageout.c Sat Jul 1 19:06:14 2017 (r320548) @@ -1802,6 +1802,7 @@ vm_pageout_oom(int shortage) vm_offset_t size, bigsize; struct thread *td; struct vmspace *vm; + bool breakout; /* * We keep the process bigproc locked once we find it to keep anyone @@ -1815,8 +1816,6 @@ vm_pageout_oom(int shortage) bigsize = 0; sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - int breakout; - PROC_LOCK(p); /* @@ -1833,7 +1832,7 @@ vm_pageout_oom(int shortage) * If the process is in a non-running type state, * don't touch it. Check all the threads individually. */ - breakout = 0; + breakout = false; FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (!TD_ON_RUNQ(td) && @@ -1842,7 +1841,7 @@ vm_pageout_oom(int shortage) !TD_IS_SUSPENDED(td) && !TD_IS_SWAPPED(td)) { thread_unlock(td); - breakout = 1; + breakout = true; break; } thread_unlock(td); From owner-svn-src-stable@freebsd.org Sat Jul 1 19:24:55 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4261DD90AC7; Sat, 1 Jul 2017 19:24:55 +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 0C3F56F088; Sat, 1 Jul 2017 19:24:54 +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 v61JOsje070118; Sat, 1 Jul 2017 19:24:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61JOshm070117; Sat, 1 Jul 2017 19:24:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707011924.v61JOshm070117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 19:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320550 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 19:24:55 -0000 Author: alc Date: Sat Jul 1 19:24:53 2017 New Revision: 320550 URL: https://svnweb.freebsd.org/changeset/base/320550 Log: MFC r319605 The variable "breakout" is used like a Boolean, so actually define it as one. Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Sat Jul 1 19:10:59 2017 (r320549) +++ stable/10/sys/vm/vm_pageout.c Sat Jul 1 19:24:53 2017 (r320550) @@ -1611,6 +1611,7 @@ vm_pageout_oom(int shortage) vm_offset_t size, bigsize; struct thread *td; struct vmspace *vm; + bool breakout; /* * We keep the process bigproc locked once we find it to keep anyone @@ -1624,8 +1625,6 @@ vm_pageout_oom(int shortage) bigsize = 0; sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - int breakout; - PROC_LOCK(p); /* @@ -1642,7 +1641,7 @@ vm_pageout_oom(int shortage) * If the process is in a non-running type state, * don't touch it. Check all the threads individually. */ - breakout = 0; + breakout = false; FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (!TD_ON_RUNQ(td) && @@ -1651,7 +1650,7 @@ vm_pageout_oom(int shortage) !TD_IS_SUSPENDED(td) && !TD_IS_SWAPPED(td)) { thread_unlock(td); - breakout = 1; + breakout = true; break; } thread_unlock(td); From owner-svn-src-stable@freebsd.org Sat Jul 1 19:47:14 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1C6D90FFA; Sat, 1 Jul 2017 19:47:14 +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 996966F96C; Sat, 1 Jul 2017 19:47: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 v61JlDm5078574; Sat, 1 Jul 2017 19:47:13 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61JlD3f078573; Sat, 1 Jul 2017 19:47:13 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707011947.v61JlD3f078573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 19:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320551 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 19:47:14 -0000 Author: alc Date: Sat Jul 1 19:47:13 2017 New Revision: 320551 URL: https://svnweb.freebsd.org/changeset/base/320551 Log: MFC r320181 Eliminate an unused macro. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Sat Jul 1 19:24:53 2017 (r320550) +++ stable/11/sys/vm/swap_pager.c Sat Jul 1 19:47:13 2017 (r320551) @@ -133,7 +133,6 @@ __FBSDID("$FreeBSD$"); * Unused disk addresses within a swap area are allocated and managed * using a blist. */ -#define SWCORRECT(n) (sizeof(void *) * (n) / sizeof(daddr_t)) #define SWAP_META_PAGES (SWB_NPAGES * 2) #define SWAP_META_MASK (SWAP_META_PAGES - 1) From owner-svn-src-stable@freebsd.org Sat Jul 1 20:08:47 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A3EED9163D; Sat, 1 Jul 2017 20:08:47 +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 CB9A2701FC; Sat, 1 Jul 2017 20:08:46 +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 v61K8khH086605; Sat, 1 Jul 2017 20:08:46 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61K8k7Y086604; Sat, 1 Jul 2017 20:08:46 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707012008.v61K8k7Y086604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 20:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320552 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 20:08:47 -0000 Author: alc Date: Sat Jul 1 20:08:45 2017 New Revision: 320552 URL: https://svnweb.freebsd.org/changeset/base/320552 Log: MFC r320181 Eliminate an unused macro. Modified: stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Sat Jul 1 19:47:13 2017 (r320551) +++ stable/10/sys/vm/swap_pager.c Sat Jul 1 20:08:45 2017 (r320552) @@ -133,7 +133,6 @@ __FBSDID("$FreeBSD$"); * Unused disk addresses within a swap area are allocated and managed * using a blist. */ -#define SWCORRECT(n) (sizeof(void *) * (n) / sizeof(daddr_t)) #define SWAP_META_PAGES (SWB_NPAGES * 2) #define SWAP_META_MASK (SWAP_META_PAGES - 1) From owner-svn-src-stable@freebsd.org Sat Jul 1 21:54:12 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5720D93A67; Sat, 1 Jul 2017 21:54:12 +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 AEE0E740C3; Sat, 1 Jul 2017 21:54:12 +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 v61LsBaV034168; Sat, 1 Jul 2017 21:54:11 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61LsBFG034167; Sat, 1 Jul 2017 21:54:11 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707012154.v61LsBFG034167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 21:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320556 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 21:54:13 -0000 Author: alc Date: Sat Jul 1 21:54:11 2017 New Revision: 320556 URL: https://svnweb.freebsd.org/changeset/base/320556 Log: MFC r320049 Pages that are passed to swap_pager_putpages() should already be fully dirty. Assert that they are fully dirty rather than redundantly calling vm_page_dirty() on them. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Sat Jul 1 21:34:57 2017 (r320555) +++ stable/11/sys/vm/swap_pager.c Sat Jul 1 21:54:11 2017 (r320556) @@ -1370,7 +1370,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *m, mreq->pindex, blk + j ); - vm_page_dirty(mreq); + MPASS(mreq->dirty == VM_PAGE_BITS_ALL); mreq->oflags |= VPO_SWAPINPROG; bp->b_pages[j] = mreq; } From owner-svn-src-stable@freebsd.org Sat Jul 1 22:21:12 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C626DD940E2; Sat, 1 Jul 2017 22:21:12 +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 8FF9C74BDE; Sat, 1 Jul 2017 22:21:12 +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 v61MLBmv044664; Sat, 1 Jul 2017 22:21:11 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61MLBcm044663; Sat, 1 Jul 2017 22:21:11 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707012221.v61MLBcm044663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 22:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320557 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 320557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 22:21:12 -0000 Author: alc Date: Sat Jul 1 22:21:11 2017 New Revision: 320557 URL: https://svnweb.freebsd.org/changeset/base/320557 Log: MFC r320049 Pages that are passed to swap_pager_putpages() should already be fully dirty. Assert that they are fully dirty rather than redundantly calling vm_page_dirty() on them. Modified: stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Sat Jul 1 21:54:11 2017 (r320556) +++ stable/10/sys/vm/swap_pager.c Sat Jul 1 22:21:11 2017 (r320557) @@ -1400,7 +1400,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *m, mreq->pindex, blk + j ); - vm_page_dirty(mreq); + MPASS(mreq->dirty == VM_PAGE_BITS_ALL); rtvals[i+j] = VM_PAGER_OK; mreq->oflags |= VPO_SWAPINPROG;