From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:01:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E663668; Sun, 1 Mar 2015 00:01:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F644CA2; Sun, 1 Mar 2015 00:01:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2101bjJ072357; Sun, 1 Mar 2015 00:01:37 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2101bu7072355; Sun, 1 Mar 2015 00:01:37 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010001.t2101bu7072355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279421 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:01:38 -0000 Author: rstone Date: Sun Mar 1 00:01:36 2015 New Revision: 279421 URL: https://svnweb.freebsd.org/changeset/base/279421 Log: Make libnv headers includable from C++ Differential Revision: https://reviews.freebsd.org/D1868 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/dnv.h head/lib/libnv/nv.h Modified: head/lib/libnv/dnv.h ============================================================================== --- head/lib/libnv/dnv.h Sat Feb 28 23:59:29 2015 (r279420) +++ head/lib/libnv/dnv.h Sun Mar 1 00:01:36 2015 (r279421) @@ -45,6 +45,8 @@ struct nvlist; typedef struct nvlist nvlist_t; #endif +__BEGIN_DECLS + /* * The dnvlist_get functions returns value associated with the given name. * If it returns a pointer, the pointer represents internal buffer and should @@ -103,4 +105,6 @@ nvlist_t *dnvlist_takev_nvlist(nvlist_t int dnvlist_takev_descriptor(nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0); void *dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0); +__END_DECLS + #endif /* !_DNV_H_ */ Modified: head/lib/libnv/nv.h ============================================================================== --- head/lib/libnv/nv.h Sat Feb 28 23:59:29 2015 (r279420) +++ head/lib/libnv/nv.h Sun Mar 1 00:01:36 2015 (r279421) @@ -63,6 +63,8 @@ typedef struct nvlist nvlist_t; */ #define NV_FLAG_IGNORE_CASE 0x01 +__BEGIN_DECLS + nvlist_t *nvlist_create(int flags); void nvlist_destroy(nvlist_t *nvl); int nvlist_error(const nvlist_t *nvl); @@ -272,4 +274,6 @@ void nvlist_freev_nvlist(nvlist_t *nvl, void nvlist_freev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); void nvlist_freev_binary(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +__END_DECLS + #endif /* !_NV_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:01:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D6E67A6; Sun, 1 Mar 2015 00:01:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88719CA6; Sun, 1 Mar 2015 00:01:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2101j1w072444; Sun, 1 Mar 2015 00:01:45 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2101jGO072443; Sun, 1 Mar 2015 00:01:45 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010001.t2101jGO072443@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279422 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:01:45 -0000 Author: rstone Date: Sun Mar 1 00:01:44 2015 New Revision: 279422 URL: https://svnweb.freebsd.org/changeset/base/279422 Log: Tests of basic nvlist add functions Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/Makefile Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Sun Mar 1 00:01:36 2015 (r279421) +++ head/lib/libnv/tests/Makefile Sun Mar 1 00:01:44 2015 (r279422) @@ -2,6 +2,8 @@ TESTSDIR= ${TESTSBASE}/lib/libnv +ATF_TESTS_CXX= nv_tests + TAP_TESTS_C+= nvlist_add_test TAP_TESTS_C+= nvlist_exists_test TAP_TESTS_C+= nvlist_free_test @@ -11,6 +13,6 @@ TAP_TESTS_C+= nvlist_send_recv_test LIBADD+= nv -WARNS?= 6 +WARNS?= 3 .include From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:05:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C1E195D; Sun, 1 Mar 2015 00:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 472B2CCA; Sun, 1 Mar 2015 00:05:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2105k4T074159; Sun, 1 Mar 2015 00:05:46 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2105kAm074158; Sun, 1 Mar 2015 00:05:46 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010005.t2105kAm074158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279423 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:05:46 -0000 Author: rstone Date: Sun Mar 1 00:05:45 2015 New Revision: 279423 URL: https://svnweb.freebsd.org/changeset/base/279423 Log: Revert r279422. My "apply patch and commit" script wasn't adding new files properly. Pointy hat to: rstone Modified: head/lib/libnv/tests/Makefile Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Sun Mar 1 00:01:44 2015 (r279422) +++ head/lib/libnv/tests/Makefile Sun Mar 1 00:05:45 2015 (r279423) @@ -2,8 +2,6 @@ TESTSDIR= ${TESTSBASE}/lib/libnv -ATF_TESTS_CXX= nv_tests - TAP_TESTS_C+= nvlist_add_test TAP_TESTS_C+= nvlist_exists_test TAP_TESTS_C+= nvlist_free_test @@ -13,6 +11,6 @@ TAP_TESTS_C+= nvlist_send_recv_test LIBADD+= nv -WARNS?= 3 +WARNS?= 6 .include From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:08:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 5B6A0B4F; Sun, 1 Mar 2015 00:08:33 +0000 (UTC) Date: Sun, 1 Mar 2015 00:08:33 +0000 From: Alexey Dokuchaev To: Bruce Evans Subject: Re: svn commit: r279338 - head/sys/arm/include Message-ID: <20150301000833.GA94231@FreeBSD.org> References: <201502262305.t1QN5lmY075787@svn.freebsd.org> <20150227125241.E802@besplex.bde.org> <1425050306.1281.13.camel@freebsd.org> <20150228122429.M1198@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150228122429.M1198@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:08:33 -0000 On Sat, Feb 28, 2015 at 12:38:00PM +1100, Bruce Evans wrote: > On Fri, 27 Feb 2015, Ian Lepore wrote: > > ::sigh:: As usual, thousands of words, maybe there's actionable info in > > there, but I sure don't have time to ferret it out. > > > > If there's something simple you'd like me to do, please say so. Simply. > > Just back out the change. For extra credit, back it out for i386 too. > For too much work, fix the 17 calls with bogus casts. Bruce, just for the record (I'm pretty sure there're other folks wondering of the same): why won't you step in with your commit bit and help fix many of these issues you point out by yourself? ./danfe From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:20:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4382DA5; Sun, 1 Mar 2015 00:20:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE4CBDE1; Sun, 1 Mar 2015 00:20:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210KwNI079955; Sun, 1 Mar 2015 00:20:58 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210Kv8m079953; Sun, 1 Mar 2015 00:20:57 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010020.t210Kv8m079953@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279424 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:20:59 -0000 Author: rstone Date: Sun Mar 1 00:20:57 2015 New Revision: 279424 URL: https://svnweb.freebsd.org/changeset/base/279424 Log: Tests of basic nvlist add functions Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/lib/libnv/tests/nv_tests.cc (contents, props changed) Modified: head/lib/libnv/tests/Makefile Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Sun Mar 1 00:05:45 2015 (r279423) +++ head/lib/libnv/tests/Makefile Sun Mar 1 00:20:57 2015 (r279424) @@ -2,6 +2,8 @@ TESTSDIR= ${TESTSBASE}/lib/libnv +ATF_TESTS_CXX= nv_tests + TAP_TESTS_C+= nvlist_add_test TAP_TESTS_C+= nvlist_exists_test TAP_TESTS_C+= nvlist_free_test @@ -11,6 +13,6 @@ TAP_TESTS_C+= nvlist_send_recv_test LIBADD+= nv -WARNS?= 6 +WARNS?= 3 .include Added: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:20:57 2015 (r279424) @@ -0,0 +1,2076 @@ +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +/* + * Test that a newly created nvlist has no errors, and is empty. + */ +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); +ATF_TEST_CASE_BODY(nvlist_create__is_empty) +{ + nvlist_t *nvl; + int type; + void *it; + + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + it = NULL; + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "key"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(nvl, key); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_null(nvl, key)); + ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "name"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_bool(nvl, key, true); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); + ATF_REQUIRE(nvlist_exists_bool(nvl, key)); + ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); + ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_number__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + uint64_t value; + int type; + + key = "foo123"; + value = 71965; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_number(nvl, key, value); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); + ATF_REQUIRE(nvlist_exists_number(nvl, key)); + ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); + ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_string__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + const char *value; + int type; + + key = "test"; + value = "fgjdkgjdk"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_string(nvl, key, value); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_string(nvl, key)); + ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); + ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(nvlist_get_string(nvl, key) != value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key, *subkey; + nvlist_t *sublist; + const nvlist_t *value; + int type; + + key = "test"; + subkey = "subkey"; + sublist = nvlist_create(0); + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(sublist, subkey); + nvlist_add_nvlist(nvl, key, sublist); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); + ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); + + value = nvlist_get_nvlist(nvl, key); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(sublist != value); + + value = nvlist_getf_nvlist(nvl, "%s", key); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + ATF_REQUIRE(sublist != value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(sublist); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + void *value; + const void *ret_value; + size_t value_size, ret_size; + int type; + + key = "binary"; + value_size = 13; + value = malloc(value_size); + memset(value, 0xa5, value_size); + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_binary(nvl, key, value, value_size); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_binary(nvl, key)); + ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); + + ret_value = nvlist_get_binary(nvl, key, &ret_size); + ATF_REQUIRE_EQ(value_size, ret_size); + ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(value != ret_value); + + ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); + ATF_REQUIRE_EQ(value_size, ret_size); + ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); + ATF_REQUIRE(value != ret_value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); + free(value); +} + +ATF_INIT_TEST_CASES(tp) +{ + ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); + ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); +} +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include +/* + * Test that a newly created nvlist has no errors, and is empty. + */ +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); +ATF_TEST_CASE_BODY(nvlist_create__is_empty) +{ + nvlist_t *nvl; + int type; + void *it; + + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + it = NULL; + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "key"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(nvl, key); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_null(nvl, key)); + ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "name"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_bool(nvl, key, true); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); + ATF_REQUIRE(nvlist_exists_bool(nvl, key)); + ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); + ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_number__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + uint64_t value; + int type; + + key = "foo123"; + value = 71965; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_number(nvl, key, value); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); + ATF_REQUIRE(nvlist_exists_number(nvl, key)); + ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); + ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_string__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + const char *value; + int type; + + key = "test"; + value = "fgjdkgjdk"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_string(nvl, key, value); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_string(nvl, key)); + ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); + ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(nvlist_get_string(nvl, key) != value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key, *subkey; + nvlist_t *sublist; + const nvlist_t *value; + int type; + + key = "test"; + subkey = "subkey"; + sublist = nvlist_create(0); + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(sublist, subkey); + nvlist_add_nvlist(nvl, key, sublist); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); + ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); + + value = nvlist_get_nvlist(nvl, key); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(sublist != value); + + value = nvlist_getf_nvlist(nvl, "%s", key); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + ATF_REQUIRE(sublist != value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(sublist); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + void *value; + const void *ret_value; + size_t value_size, ret_size; + int type; + + key = "binary"; + value_size = 13; + value = malloc(value_size); + memset(value, 0xa5, value_size); + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_binary(nvl, key, value, value_size); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_binary(nvl, key)); + ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); + + ret_value = nvlist_get_binary(nvl, key, &ret_size); + ATF_REQUIRE_EQ(value_size, ret_size); + ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(value != ret_value); + + ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); + ATF_REQUIRE_EQ(value_size, ret_size); + ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); + ATF_REQUIRE(value != ret_value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); + free(value); +} + +ATF_INIT_TEST_CASES(tp) +{ + ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); + ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); +} +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include +/* + * Test that a newly created nvlist has no errors, and is empty. + */ +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); +ATF_TEST_CASE_BODY(nvlist_create__is_empty) +{ + nvlist_t *nvl; + int type; + void *it; + + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + it = NULL; + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "key"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(nvl, key); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_null(nvl, key)); + ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "name"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_bool(nvl, key, true); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); + ATF_REQUIRE(nvlist_exists_bool(nvl, key)); + ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); + ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_number__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + uint64_t value; + int type; + + key = "foo123"; + value = 71965; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_number(nvl, key, value); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); + ATF_REQUIRE(nvlist_exists_number(nvl, key)); + ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); + ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_string__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + const char *value; + int type; + + key = "test"; + value = "fgjdkgjdk"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_string(nvl, key, value); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_string(nvl, key)); + ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); + ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(nvlist_get_string(nvl, key) != value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key, *subkey; + nvlist_t *sublist; + const nvlist_t *value; + int type; + + key = "test"; + subkey = "subkey"; + sublist = nvlist_create(0); + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(sublist, subkey); + nvlist_add_nvlist(nvl, key, sublist); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); + ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); + + value = nvlist_get_nvlist(nvl, key); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(sublist != value); + + value = nvlist_getf_nvlist(nvl, "%s", key); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + ATF_REQUIRE(sublist != value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(sublist); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + void *value; + const void *ret_value; + size_t value_size, ret_size; + int type; + + key = "binary"; + value_size = 13; + value = malloc(value_size); + memset(value, 0xa5, value_size); + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_binary(nvl, key, value, value_size); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_binary(nvl, key)); + ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); + + ret_value = nvlist_get_binary(nvl, key, &ret_size); + ATF_REQUIRE_EQ(value_size, ret_size); + ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); + + /* nvlist_add_* is required to clone the value, so check for that. */ + ATF_REQUIRE(value != ret_value); + + ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); + ATF_REQUIRE_EQ(value_size, ret_size); + ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); + ATF_REQUIRE(value != ret_value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + + nvlist_destroy(nvl); + free(value); +} + +ATF_INIT_TEST_CASES(tp) +{ + ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); + ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); +} +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include +#include +#include +#include +#include + +/* + * Test that a newly created nvlist has no errors, and is empty. + */ +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); +ATF_TEST_CASE_BODY(nvlist_create__is_empty) +{ + nvlist_t *nvl; + int type; + void *it; + + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + it = NULL; + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); +ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) +{ + nvlist_t *nvl; + void *it; + const char *key; + int type; + + key = "key"; + nvl = nvlist_create(0); + + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + + nvlist_add_null(nvl, key); + + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_null(nvl, key)); + ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:21:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41BC8EDF; Sun, 1 Mar 2015 00:21:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C539DEB; Sun, 1 Mar 2015 00:21:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210LPQW080689; Sun, 1 Mar 2015 00:21:25 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210LPGp080688; Sun, 1 Mar 2015 00:21:25 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010021.t210LPGp080688@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279425 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:21:25 -0000 Author: rstone Date: Sun Mar 1 00:21:24 2015 New Revision: 279425 URL: https://svnweb.freebsd.org/changeset/base/279425 Log: Add tests for nvlist_clone Differential Revision: https://reviews.freebsd.org/D1870 Reviewed by: pjd, jfv MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:20:57 2015 (r279424) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:24 2015 (r279425) @@ -288,6 +288,122 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__si free(value); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__empty_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__empty_nvlist) +{ + nvlist_t *nvl, *clone; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + clone = nvlist_clone(nvl); + ATF_REQUIRE(clone != NULL); + ATF_REQUIRE(clone != nvl); + ATF_REQUIRE(nvlist_empty(clone)); + + nvlist_destroy(clone); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nonempty_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__nonempty_nvlist) +{ + nvlist_t *nvl, *clone; + const char *key; + void *it; + uint64_t value; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + value = 684874; + nvlist_add_number(nvl, key, value); + + clone = nvlist_clone(nvl); + ATF_REQUIRE(clone != NULL); + ATF_REQUIRE(clone != nvl); + ATF_REQUIRE(nvlist_exists_number(clone, key)); + ATF_REQUIRE_EQ(nvlist_get_number(clone, key), value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(clone, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), NULL); + + nvlist_destroy(clone); + nvlist_destroy(nvl); +} + +static const char * const test_subnvlist_key = "nvlist"; + +static const char * const test_string_key = "string"; +static const char * const test_string_val = "59525"; + +static nvlist_t* +create_test_nvlist(void) +{ + nvlist_t *nvl, *sublist; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + sublist = nvlist_create(0); + ATF_REQUIRE(sublist != NULL); + + nvlist_add_string(sublist, test_string_key, test_string_val); + nvlist_move_nvlist(nvl, test_subnvlist_key, sublist); + + return (nvl); +} + +static void +verify_test_nvlist(const nvlist_t *nvl) +{ + void *it; + const nvlist_t *value; + int type; + + ATF_REQUIRE(nvlist_exists_nvlist(nvl, test_subnvlist_key)); + + value = nvlist_get_nvlist(nvl, test_subnvlist_key); + + ATF_REQUIRE(nvlist_exists_string(value, test_string_key)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(value, test_string_key), test_string_val), 0); + ATF_REQUIRE(nvlist_get_string(value, test_string_key) != test_string_val); + + /* Iterate over both nvlists; ensure that each has only the one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(value, &type, &it), + test_string_key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), NULL); + + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), + test_subnvlist_key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nested_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__nested_nvlist) +{ + nvlist_t *nvl, *clone; + + nvl = create_test_nvlist(); + clone = nvlist_clone(nvl); + + ATF_REQUIRE(clone != NULL); + ATF_REQUIRE(clone != nvl); + verify_test_nvlist(clone); + + nvlist_destroy(clone); + nvlist_destroy(nvl); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); @@ -297,6 +413,10 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); + + ATF_ADD_TEST_CASE(tp, nvlist_clone__empty_nvlist); + ATF_ADD_TEST_CASE(tp, nvlist_clone__nonempty_nvlist); + ATF_ADD_TEST_CASE(tp, nvlist_clone__nested_nvlist); } /*- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:21:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C17E177; Sun, 1 Mar 2015 00:21:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1F5ADED; Sun, 1 Mar 2015 00:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210LVWh081211; Sun, 1 Mar 2015 00:21:31 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210LVjj081210; Sun, 1 Mar 2015 00:21:31 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010021.t210LVjj081210@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279426 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:21:31 -0000 Author: rstone Date: Sun Mar 1 00:21:30 2015 New Revision: 279426 URL: https://svnweb.freebsd.org/changeset/base/279426 Log: Add tests for nvlist_pack/unpack Differential Revision: https://reviews.freebsd.org/D1871 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:24 2015 (r279425) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:30 2015 (r279426) @@ -31,6 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + /* * Test that a newly created nvlist has no errors, and is empty. */ @@ -404,6 +408,183 @@ ATF_TEST_CASE_BODY(nvlist_clone__nested_ nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__empty_nvlist); +ATF_TEST_CASE_BODY(nvlist_pack__empty_nvlist) +{ + nvlist_t *nvl, *unpacked; + void *packed; + size_t packed_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + + unpacked = nvlist_unpack(packed, packed_size); + ATF_REQUIRE(unpacked != NULL); + ATF_REQUIRE(unpacked != nvl); + ATF_REQUIRE(nvlist_empty(unpacked)); + + nvlist_destroy(unpacked); + nvlist_destroy(nvl); + free(packed); +} + +static void +verify_null(const nvlist_t *nvl, int type) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); +} + +static void +verify_number(const nvlist_t *nvl, const char *name, int type, uint64_t value) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, name), value); +} + +static void +verify_string(const nvlist_t *nvl, const char *name, int type, + const char * value) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, name), value), 0); +} + +static void +verify_nvlist(const nvlist_t *nvl, const char *name, int type) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + verify_test_nvlist(nvlist_get_nvlist(nvl, name)); +} + +static void +verify_binary(const nvlist_t *nvl, const char *name, int type, + const void * value, size_t size) +{ + const void *actual_value; + size_t actual_size; + + ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); + actual_value = nvlist_get_binary(nvl, name, &actual_size); + ATF_REQUIRE_EQ(size, actual_size); + ATF_REQUIRE_EQ(memcmp(value, actual_value, size), 0); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__multiple_values); +ATF_TEST_CASE_BODY(nvlist_pack__multiple_values) +{ + std::ostringstream msg; + std::set keys_seen; + nvlist_t *nvl, *unpacked, *nvvalue; + const char *nullkey, *numkey, *strkey, *nvkey, *binkey, *name; + int numvalue; + const char * strvalue; + void *binvalue, *packed, *it; + size_t binsize, packed_size; + int type; + + nvl = nvlist_create(0); + + nullkey = "null"; + nvlist_add_null(nvl, nullkey); + + numkey = "number"; + numvalue = 939853984; + nvlist_add_number(nvl, numkey, numvalue); + + strkey = "string"; + strvalue = "jfieutijf"; + nvlist_add_string(nvl, strkey, strvalue); + + nvkey = "nvlist"; + nvvalue = create_test_nvlist(); + nvlist_move_nvlist(nvl, nvkey, nvvalue); + + binkey = "binary"; + binsize = 4; + binvalue = malloc(binsize); + memset(binvalue, 'b', binsize); + nvlist_move_binary(nvl, binkey, binvalue, binsize); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + + unpacked = nvlist_unpack(packed, packed_size); + ATF_REQUIRE(unpacked != 0); + + it = NULL; + while ((name = nvlist_next(unpacked, &type, &it)) != NULL) { + /* Ensure that we see every key only once. */ + ATF_REQUIRE_EQ(keys_seen.count(name), 0); + + if (strcmp(name, nullkey) == 0) + verify_null(unpacked, type); + else if (strcmp(name, numkey) == 0) + verify_number(unpacked, name, type, numvalue); + else if (strcmp(name, strkey) == 0) + verify_string(unpacked, name, type, strvalue); + else if (strcmp(name, nvkey) == 0) + verify_nvlist(unpacked, name, type); + else if (strcmp(name, binkey) == 0) + verify_binary(unpacked, name, type, binvalue, binsize); + else { + msg << "Unexpected key :'" << name << "'"; + ATF_FAIL(msg.str().c_str()); + } + + keys_seen.insert(name); + } + + /* Ensure that we saw every key. */ + ATF_REQUIRE_EQ(keys_seen.size(), 5); + + nvlist_destroy(nvl); + nvlist_destroy(unpacked); + free(packed); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_unpack__duplicate_key); +ATF_TEST_CASE_BODY(nvlist_unpack__duplicate_key) +{ + nvlist_t *nvl, *unpacked; + const char *key1, *key2; + void *packed, *keypos; + size_t size, keylen; + + nvl = nvlist_create(0); + + key1 = "key1"; + keylen = strlen(key1); + nvlist_add_number(nvl, key1, 5); + + key2 = "key2"; + ATF_REQUIRE_EQ(keylen, strlen(key2)); + nvlist_add_number(nvl, key2, 10); + + packed = nvlist_pack(nvl, &size); + + /* + * Mangle the packed nvlist by replacing key1 with key2, creating a + * packed nvlist with a duplicate key. + */ + keypos = memmem(packed, size, key1, keylen); + ATF_REQUIRE(keypos != NULL); + memcpy(keypos, key2, keylen); + + unpacked = nvlist_unpack(packed, size); + ATF_REQUIRE(nvlist_error(unpacked) != 0); + + free(packed); + nvlist_destroy(nvl); + nvlist_destroy(unpacked); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); @@ -417,6 +598,10 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_clone__empty_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_clone__nonempty_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_clone__nested_nvlist); + + ATF_ADD_TEST_CASE(tp, nvlist_pack__empty_nvlist); + ATF_ADD_TEST_CASE(tp, nvlist_pack__multiple_values); + ATF_ADD_TEST_CASE(tp, nvlist_unpack__duplicate_key); } /*- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:21:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 423E823C; Sun, 1 Mar 2015 00:21:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2565FDF5; Sun, 1 Mar 2015 00:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210LcHH081281; Sun, 1 Mar 2015 00:21:38 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210LcDB081280; Sun, 1 Mar 2015 00:21:38 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010021.t210LcDB081280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279427 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:21:38 -0000 Author: rstone Date: Sun Mar 1 00:21:37 2015 New Revision: 279427 URL: https://svnweb.freebsd.org/changeset/base/279427 Log: Add test cases for nvlist_move_* Differential Revision: https://reviews.freebsd.org/D1872 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:30 2015 (r279426) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:37 2015 (r279427) @@ -585,6 +585,83 @@ ATF_TEST_CASE_BODY(nvlist_unpack__duplic nvlist_destroy(unpacked); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_string__single_insert); +ATF_TEST_CASE_BODY(nvlist_move_string__single_insert) +{ + nvlist_t *nvl; + const char *key; + char *value; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + value = strdup("testval"); + ATF_REQUIRE(value != NULL); + + nvlist_move_string(nvl, key, value); + ATF_REQUIRE_EQ(nvlist_get_string(nvl, key), value); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__null_child); +ATF_TEST_CASE_BODY(nvlist_move_nvlist__null_child) +{ + nvlist_t *parent; + + parent = nvlist_create(0); + + nvlist_move_nvlist(parent, "test", NULL); + + ATF_REQUIRE(nvlist_error(parent) != 0); + + nvlist_destroy(parent); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__single_insert); +ATF_TEST_CASE_BODY(nvlist_move_nvlist__single_insert) +{ + nvlist_t *nvl; + const char *key; + nvlist_t *value; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + value = nvlist_create(0); + ATF_REQUIRE(value != NULL); + + nvlist_move_nvlist(nvl, key, value); + ATF_REQUIRE_EQ(nvlist_get_nvlist(nvl, key), value); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_binary__single_insert); +ATF_TEST_CASE_BODY(nvlist_move_binary__single_insert) +{ + nvlist_t *nvl; + const char *key; + void *value; + size_t size, actual_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + size = 73; + value = malloc(size); + ATF_REQUIRE(value != NULL); + + nvlist_move_binary(nvl, key, value, size); + ATF_REQUIRE_EQ(nvlist_get_binary(nvl, key, &actual_size), value); + ATF_REQUIRE_EQ(size, actual_size); + + nvlist_destroy(nvl); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); @@ -602,6 +679,11 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_pack__empty_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_pack__multiple_values); ATF_ADD_TEST_CASE(tp, nvlist_unpack__duplicate_key); + + ATF_ADD_TEST_CASE(tp, nvlist_move_string__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__null_child); + ATF_ADD_TEST_CASE(tp, nvlist_move_binary__single_insert); } /*- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:21:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7274395; Sun, 1 Mar 2015 00:21:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92219E88; Sun, 1 Mar 2015 00:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210LilO083189; Sun, 1 Mar 2015 00:21:44 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210Lin5083188; Sun, 1 Mar 2015 00:21:44 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010021.t210Lin5083188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279428 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:21:44 -0000 Author: rstone Date: Sun Mar 1 00:21:43 2015 New Revision: 279428 URL: https://svnweb.freebsd.org/changeset/base/279428 Log: Add tests for nvlist_take_* Differential Revision: https://reviews.freebsd.org/D1873 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:37 2015 (r279427) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:43 2015 (r279428) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -662,6 +663,286 @@ ATF_TEST_CASE_BODY(nvlist_move_binary__s nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_bool__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + bool testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "boolkey"; + testval = false; + nvlist_add_bool(nvl, testkey, testval); + + ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_bool__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + bool testval, otherval1; + nvlist_t *otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "boolkey"; + testval = true; + nvlist_add_bool(nvl, testkey, testval); + + otherkey1 = "key1"; + otherval1 = false; + nvlist_add_bool(nvl, otherkey1, otherval1); + + otherkey2 = "key2"; + otherval2 = create_test_nvlist(); + nvlist_move_nvlist(nvl, otherkey2, otherval2); + + ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval); + + ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey1)); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey1), otherval1); + + ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey2)); + verify_test_nvlist(nvlist_get_nvlist(nvl, otherkey2)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_number__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + uint64_t testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testval = std::numeric_limits::max(); + nvlist_add_number(nvl, testkey, testval); + + ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_number__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + uint64_t testval, otherval1; + const char *otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + otherkey1 = "key1"; + otherval1 = 5; + nvlist_add_number(nvl, otherkey1, otherval1); + + testkey = "numkey"; + testval = 1654; + nvlist_add_number(nvl, testkey, testval); + + otherkey2 = "key2"; + otherval2 = "string"; + nvlist_add_string(nvl, otherkey2, otherval2); + + ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval); + + ATF_REQUIRE(nvlist_exists_number(nvl, otherkey1)); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, otherkey1), otherval1); + + ATF_REQUIRE(nvlist_exists_string(nvl, otherkey2)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey2), otherval2), 0); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_string__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + const char *testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testval = "nvlist"; + nvlist_add_string(nvl, testkey, testval); + + ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_string__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + const char *testval, *otherval1; + bool otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + otherkey1 = "key1"; + otherval1 = "fjdifjdk"; + nvlist_add_string(nvl, otherkey1, otherval1); + + otherkey2 = "key2"; + otherval2 = true; + nvlist_add_bool(nvl, otherkey2, otherval2); + + testkey = "strkey"; + testval = "1654"; + nvlist_add_string(nvl, testkey, testval); + + ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0); + + ATF_REQUIRE(nvlist_exists_string(nvl, otherkey1)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey1), otherval1), 0); + + ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2)); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_nvlist__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + nvlist_t *testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testval = create_test_nvlist(); + nvlist_move_nvlist(nvl, testkey, testval); + + verify_test_nvlist(nvlist_take_nvlist(nvl, testkey)); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_nvlist__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + nvlist_t *testval, *otherval1; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "strkey"; + testval = create_test_nvlist(); + nvlist_move_nvlist(nvl, testkey, testval); + + otherkey1 = "key1"; + otherval1 = nvlist_create(0); + nvlist_move_nvlist(nvl, otherkey1, otherval1); + + otherkey2 = "key2"; + nvlist_add_null(nvl, otherkey2); + + verify_test_nvlist(nvlist_take_nvlist(nvl, testkey)); + + ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey1)); + ATF_REQUIRE(nvlist_empty(nvlist_get_nvlist(nvl, otherkey1))); + + ATF_REQUIRE(nvlist_exists_null(nvl, otherkey2)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_binary__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + void *testval; + const void *actual_val; + size_t testsize, actual_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testsize = 457; + testval = malloc(testsize); + memset(testval, '5', testsize); + nvlist_move_binary(nvl, testkey, testval, testsize); + + actual_val = nvlist_take_binary(nvl, testkey, &actual_size); + ATF_REQUIRE_EQ(testsize, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, testval, testsize), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_binary__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + const void *actual_value; + char testval[] = "gjiertj"; + char otherval1[] = "fdreg"; + size_t testsize, othersize, actual_size; + bool otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + otherkey1 = "key1"; + othersize = sizeof(otherval1); + nvlist_add_binary(nvl, otherkey1, otherval1, othersize); + + otherkey2 = "key2"; + otherval2 = true; + nvlist_add_bool(nvl, otherkey2, otherval2); + + testkey = "strkey"; + testsize = sizeof(testval); + nvlist_add_binary(nvl, testkey, testval, testsize); + + actual_value = nvlist_take_binary(nvl, testkey, &actual_size); + ATF_REQUIRE_EQ(testsize, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, testval, testsize), 0); + + ATF_REQUIRE(nvlist_exists_binary(nvl, otherkey1)); + actual_value = nvlist_get_binary(nvl, otherkey1, &actual_size); + ATF_REQUIRE_EQ(othersize, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, otherval1, othersize), 0); + + ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2)); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2); + + nvlist_destroy(nvl); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); @@ -684,6 +965,17 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__null_child); ATF_ADD_TEST_CASE(tp, nvlist_move_binary__single_insert); + + ATF_ADD_TEST_CASE(tp, nvlist_take_bool__single_remove); + ATF_ADD_TEST_CASE(tp, nvlist_take_bool__other_keys_unchanged); + ATF_ADD_TEST_CASE(tp, nvlist_take_number__single_remove); + ATF_ADD_TEST_CASE(tp, nvlist_take_number__other_keys_unchanged); + ATF_ADD_TEST_CASE(tp, nvlist_take_string__single_remove); + ATF_ADD_TEST_CASE(tp, nvlist_take_string__other_keys_unchanged); + ATF_ADD_TEST_CASE(tp, nvlist_take_nvlist__single_remove); + ATF_ADD_TEST_CASE(tp, nvlist_take_nvlist__other_keys_unchanged); + ATF_ADD_TEST_CASE(tp, nvlist_take_binary__single_remove); + ATF_ADD_TEST_CASE(tp, nvlist_take_binary__other_keys_unchanged); } /*- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:21:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26CEE4CE; Sun, 1 Mar 2015 00:21:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08F96E8E; Sun, 1 Mar 2015 00:21:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210LorV083249; Sun, 1 Mar 2015 00:21:50 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210LoJA083248; Sun, 1 Mar 2015 00:21:50 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010021.t210LoJA083248@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279429 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:21:51 -0000 Author: rstone Date: Sun Mar 1 00:21:50 2015 New Revision: 279429 URL: https://svnweb.freebsd.org/changeset/base/279429 Log: Add tests for nvlist_free* functions Differential Revision: https://reviews.freebsd.org/D1874 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:43 2015 (r279428) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:21:50 2015 (r279429) @@ -943,6 +943,198 @@ ATF_TEST_CASE_BODY(nvlist_take_binary__o nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_null); +ATF_TEST_CASE_BODY(nvlist_free__single_null) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_null(nvl, key); + + nvlist_free(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_bool); +ATF_TEST_CASE_BODY(nvlist_free__single_bool) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_bool(nvl, key, true); + + nvlist_free(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_number); +ATF_TEST_CASE_BODY(nvlist_free__single_number) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_number(nvl, key, 584); + + nvlist_free(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_string); +ATF_TEST_CASE_BODY(nvlist_free__single_string) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_string(nvl, key, "gjkfkjd"); + + nvlist_free(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_nvlist); +ATF_TEST_CASE_BODY(nvlist_free__single_nvlist) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_nvlist(nvl, key, nvlist_create(0)); + + nvlist_free(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_binary); +ATF_TEST_CASE_BODY(nvlist_free__single_binary) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_binary(nvl, key, "jgjgfd", 6); + + nvlist_free(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_null__single_null); +ATF_TEST_CASE_BODY(nvlist_free_null__single_null) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_null(nvl, key); + + nvlist_free_null(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_bool__single_bool); +ATF_TEST_CASE_BODY(nvlist_free_bool__single_bool) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_bool(nvl, key, true); + + nvlist_free_bool(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_number__single_number); +ATF_TEST_CASE_BODY(nvlist_free_number__single_number) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_number(nvl, key, 584); + + nvlist_free_number(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_string__single_string); +ATF_TEST_CASE_BODY(nvlist_free_string__single_string) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_string(nvl, key, "gjkfkjd"); + + nvlist_free_string(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_nvlist__single_nvlist); +ATF_TEST_CASE_BODY(nvlist_free_nvlist__single_nvlist) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_nvlist(nvl, key, nvlist_create(0)); + + nvlist_free_nvlist(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_binary__single_binary); +ATF_TEST_CASE_BODY(nvlist_free_binary__single_binary) +{ + nvlist_t *nvl; + const char *key; + + nvl = nvlist_create(0); + key = "test"; + nvlist_add_binary(nvl, key, "jgjgfd", 6); + + nvlist_free_binary(nvl, key); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); @@ -976,6 +1168,20 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_take_nvlist__other_keys_unchanged); ATF_ADD_TEST_CASE(tp, nvlist_take_binary__single_remove); ATF_ADD_TEST_CASE(tp, nvlist_take_binary__other_keys_unchanged); + + ATF_ADD_TEST_CASE(tp, nvlist_free__single_null); + ATF_ADD_TEST_CASE(tp, nvlist_free__single_bool); + ATF_ADD_TEST_CASE(tp, nvlist_free__single_number); + ATF_ADD_TEST_CASE(tp, nvlist_free__single_string); + ATF_ADD_TEST_CASE(tp, nvlist_free__single_nvlist); + ATF_ADD_TEST_CASE(tp, nvlist_free__single_binary); + + ATF_ADD_TEST_CASE(tp, nvlist_free_null__single_null); + ATF_ADD_TEST_CASE(tp, nvlist_free_bool__single_bool); + ATF_ADD_TEST_CASE(tp, nvlist_free_number__single_number); + ATF_ADD_TEST_CASE(tp, nvlist_free_string__single_string); + ATF_ADD_TEST_CASE(tp, nvlist_free_nvlist__single_nvlist); + ATF_ADD_TEST_CASE(tp, nvlist_free_binary__single_binary); } /*- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:21:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4A4660F; Sun, 1 Mar 2015 00:21:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE5F3E94; Sun, 1 Mar 2015 00:21:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210Lvia083310; Sun, 1 Mar 2015 00:21:57 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210LvvM083308; Sun, 1 Mar 2015 00:21:57 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010021.t210LvvM083308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279430 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:21:58 -0000 Author: rstone Date: Sun Mar 1 00:21:56 2015 New Revision: 279430 URL: https://svnweb.freebsd.org/changeset/base/279430 Log: Add tests for dnv_get_* Differential Revision: https://reviews.freebsd.org/D1875 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/lib/libnv/tests/dnv_tests.cc (contents, props changed) Modified: head/lib/libnv/tests/Makefile Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Sun Mar 1 00:21:50 2015 (r279429) +++ head/lib/libnv/tests/Makefile Sun Mar 1 00:21:56 2015 (r279430) @@ -2,7 +2,9 @@ TESTSDIR= ${TESTSBASE}/lib/libnv -ATF_TESTS_CXX= nv_tests +ATF_TESTS_CXX= \ + dnv_tests \ + nv_tests \ TAP_TESTS_C+= nvlist_add_test TAP_TESTS_C+= nvlist_exists_test Added: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/dnv_tests.cc Sun Mar 1 00:21:56 2015 (r279430) @@ -0,0 +1,289 @@ +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__present); +ATF_TEST_CASE_BODY(dnvlist_get_bool__present) +{ + nvlist_t *nvl; + const char *key; + bool value; + + nvl = nvlist_create(0); + + key = "name"; + value = true; + nvlist_add_bool(nvl, key, value); + + ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), value); + ATF_REQUIRE_EQ(dnvlist_getf_bool(nvl, false, "%c%s", 'n', "ame"), value); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__default_value); +ATF_TEST_CASE_BODY(dnvlist_get_bool__default_value) +{ + nvlist_t *nvl; + const char *key; + + key = "123"; + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), false); + ATF_REQUIRE_EQ(dnvlist_getf_bool(nvl, true, "%d", 123), true); + + nvlist_add_bool(nvl, key, true); + + ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "otherkey", true), true); + ATF_REQUIRE_EQ(dnvlist_getf_bool(nvl, false, "%d%c", 12, 'c'), false); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_number__present); +ATF_TEST_CASE_BODY(dnvlist_get_number__present) +{ + nvlist_t *nvl; + const char *key; + uint64_t value; + + nvl = nvlist_create(0); + + key = "key"; + value = 48952; + nvlist_add_number(nvl, key, value); + + ATF_REQUIRE_EQ(dnvlist_get_number(nvl, key, 19), value); + ATF_REQUIRE_EQ(dnvlist_getf_number(nvl, 65, "key"), value); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_number__default_value); +ATF_TEST_CASE_BODY(dnvlist_get_number__default_value) +{ + nvlist_t *nvl; + const char *key; + + key = "123"; + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_get_number(nvl, key, 5), 5); + ATF_REQUIRE_EQ(dnvlist_getf_number(nvl, 12, "%s", key), 12); + + nvlist_add_number(nvl, key, 24841); + + ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "hthth", 184), 184); + ATF_REQUIRE_EQ(dnvlist_getf_number(nvl, 5641, "%d", 1234), 5641); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_string__present); +ATF_TEST_CASE_BODY(dnvlist_get_string__present) +{ + nvlist_t *nvl; + const char *key; + const char *value, *actual_value; + + nvl = nvlist_create(0); + + key = "string"; + value = "fjdojfdi"; + nvlist_add_string(nvl, key, value); + + ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, key, "g"), value), 0); + + actual_value = dnvlist_getf_string(nvl, "rs", "%s", key); + ATF_REQUIRE_EQ(strcmp(actual_value, value), 0); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_string__default_value); +ATF_TEST_CASE_BODY(dnvlist_get_string__default_value) +{ + nvlist_t *nvl; + const char *key; + const char *actual_value; + + key = "123"; + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, key, "bar"), "bar"), 0); + + actual_value = dnvlist_getf_string(nvl, "d", "%s", key); + ATF_REQUIRE_EQ(strcmp(actual_value, "d"), 0); + + nvlist_add_string(nvl, key, "cxhweh"); + + ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, "hthth", "fd"), "fd"), 0); + actual_value = dnvlist_getf_string(nvl, "5", "%s", "5"); + ATF_REQUIRE_EQ(strcmp("5", "5"), 0); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_nvlist__present); +ATF_TEST_CASE_BODY(dnvlist_get_nvlist__present) +{ + nvlist_t *nvl; + const char *key; + nvlist_t *value; + const nvlist_t *actual_value; + + nvl = nvlist_create(0); + + key = "nvlist"; + value = nvlist_create(0); + nvlist_move_nvlist(nvl, key, value); + + actual_value = dnvlist_get_nvlist(nvl, key, NULL); + ATF_REQUIRE(actual_value != NULL); + ATF_REQUIRE(nvlist_empty(actual_value)); + + actual_value = dnvlist_getf_nvlist(nvl, NULL, "%s", key); + ATF_REQUIRE(actual_value != NULL); + ATF_REQUIRE(nvlist_empty(actual_value)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_nvlist__default_value); +ATF_TEST_CASE_BODY(dnvlist_get_nvlist__default_value) +{ + nvlist_t *nvl; + const char *key; + nvlist_t *dummy; + + key = "123"; + nvl = nvlist_create(0); + dummy = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, key, dummy), dummy); + ATF_REQUIRE_EQ(dnvlist_getf_nvlist(nvl, dummy, "%s", key), dummy); + + nvlist_move_nvlist(nvl, key, nvlist_create(0)); + ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, "456", dummy), dummy); + ATF_REQUIRE_EQ(dnvlist_getf_nvlist(nvl, dummy, "%s", "gh"), dummy); + + nvlist_destroy(nvl); +} + +static void +set_const_binary_value(const void *&value, size_t &size, const char *str) +{ + + value = str; + size = strlen(str) + 1; /* +1 to include '\0' */ +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_binary__present); +ATF_TEST_CASE_BODY(dnvlist_get_binary__present) +{ + nvlist_t *nvl; + const char *k; + const void *value, *actual_value; + size_t value_size, actual_size; + + nvl = nvlist_create(0); + + k = "binary"; + set_const_binary_value(value, value_size, "fjdojfdi"); + nvlist_add_binary(nvl, k, value, value_size); + + actual_value = dnvlist_get_binary(nvl, k, &actual_size, "g", 1); + ATF_REQUIRE_EQ(value_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, value, actual_size), 0); + + actual_value = dnvlist_getf_binary(nvl, &actual_size, "g", 1, "%s", k); + ATF_REQUIRE_EQ(value_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, value, actual_size), 0); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_binary__default_value); +ATF_TEST_CASE_BODY(dnvlist_get_binary__default_value) +{ + nvlist_t *nvl; + const char *key; + const void *default_value, *actual_value; + size_t default_size, actual_size; + + key = "123"; + nvl = nvlist_create(0); + + set_const_binary_value(default_value, default_size, "bar"); + actual_value = dnvlist_get_binary(nvl, key, &actual_size, default_value, + default_size); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); + + set_const_binary_value(default_value, default_size, "atf"); + actual_value = dnvlist_getf_binary(nvl, &actual_size, default_value, + default_size, "%s", key); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); + + nvlist_add_binary(nvl, key, "test", 4); + + set_const_binary_value(default_value, default_size, "bthrg"); + actual_value = dnvlist_get_binary(nvl, "k", &actual_size, default_value, + default_size); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); + + set_const_binary_value(default_value, default_size, + "rrhgrythtyrtgbrhgrtdsvdfbtjlkul"); + actual_value = dnvlist_getf_binary(nvl, &actual_size, default_value, + default_size, "s"); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); + + nvlist_destroy(nvl); +} + +ATF_INIT_TEST_CASES(tp) +{ + ATF_ADD_TEST_CASE(tp, dnvlist_get_bool__present); + ATF_ADD_TEST_CASE(tp, dnvlist_get_bool__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_get_number__present); + ATF_ADD_TEST_CASE(tp, dnvlist_get_number__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_get_string__present); + ATF_ADD_TEST_CASE(tp, dnvlist_get_string__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_get_nvlist__present); + ATF_ADD_TEST_CASE(tp, dnvlist_get_nvlist__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__present); + ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__default_value); +} From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF3474F; Sun, 1 Mar 2015 00:22:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F39CE9D; Sun, 1 Mar 2015 00:22:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210M4uV083411; Sun, 1 Mar 2015 00:22:04 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210M48s083410; Sun, 1 Mar 2015 00:22:04 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210M48s083410@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279431 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:04 -0000 Author: rstone Date: Sun Mar 1 00:22:03 2015 New Revision: 279431 URL: https://svnweb.freebsd.org/changeset/base/279431 Log: Add tests for dnvlist_take_* Differential Revision: https://reviews.freebsd.org/D1876 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/dnv_tests.cc Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Sun Mar 1 00:21:56 2015 (r279430) +++ head/lib/libnv/tests/dnv_tests.cc Sun Mar 1 00:22:03 2015 (r279431) @@ -274,6 +274,278 @@ ATF_TEST_CASE_BODY(dnvlist_get_binary__d nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__present); +ATF_TEST_CASE_BODY(dnvlist_take_bool__present) +{ + nvlist_t *nvl; + const char *key; + bool value; + + nvl = nvlist_create(0); + + key = "name"; + value = true; + nvlist_add_bool(nvl, key, value); + + ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, key, false), value); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__empty); +ATF_TEST_CASE_BODY(dnvlist_take_bool__empty) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, "123", false), false); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_bool__default_value) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + nvlist_add_bool(nvl, "key", true); + + ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, "otherkey", true), true); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__present); +ATF_TEST_CASE_BODY(dnvlist_take_number__present) +{ + nvlist_t *nvl; + const char *key; + uint64_t value; + + nvl = nvlist_create(0); + + key = "name"; + value = 194154; + nvlist_add_number(nvl, key, value); + + ATF_REQUIRE_EQ(dnvlist_take_number(nvl, key, 2), value); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__empty); +ATF_TEST_CASE_BODY(dnvlist_take_number__empty) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_take_number(nvl, "123", 126484), 126484); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_number__default_value) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + nvlist_add_number(nvl, "key", 12); + + ATF_REQUIRE_EQ(dnvlist_take_number(nvl, "otherkey", 13), 13); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__present); +ATF_TEST_CASE_BODY(dnvlist_take_string__present) +{ + nvlist_t *nvl; + const char *key; + const char *value; + char *default_val, *actual_val; + + nvl = nvlist_create(0); + + key = "name"; + value = "wrowm"; + default_val = strdup("default"); + nvlist_add_string(nvl, key, value); + + actual_val = dnvlist_take_string(nvl, key, default_val); + ATF_REQUIRE_EQ(strcmp(actual_val, value), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + free(actual_val); + free(default_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__empty); +ATF_TEST_CASE_BODY(dnvlist_take_string__empty) +{ + nvlist_t *nvl; + char *default_val, *actual_val; + + nvl = nvlist_create(0); + default_val = strdup(""); + + actual_val = dnvlist_take_string(nvl, "123", default_val); + ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_string__default_value) +{ + nvlist_t *nvl; + char *default_val, *actual_val; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "key", "foobar"); + default_val = strdup("other"); + + actual_val = dnvlist_take_string(nvl, "otherkey", default_val); + ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__present); +ATF_TEST_CASE_BODY(dnvlist_take_nvlist__present) +{ + nvlist_t *nvl; + const char *key; + nvlist_t *value, *default_val, *actual_val; + + nvl = nvlist_create(0); + + key = "name"; + value = nvlist_create(0); + default_val = nvlist_create(0); + nvlist_move_nvlist(nvl, key, value); + + actual_val = dnvlist_take_nvlist(nvl, key, default_val); + ATF_REQUIRE_EQ(actual_val, value); + ATF_REQUIRE(nvlist_empty(nvl)); + + free(actual_val); + free(default_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__empty); +ATF_TEST_CASE_BODY(dnvlist_take_nvlist__empty) +{ + nvlist_t *nvl, *actual_val; + + nvl = nvlist_create(0); + + actual_val = dnvlist_take_nvlist(nvl, "123", NULL); + ATF_REQUIRE_EQ(actual_val, NULL); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_nvlist__default_value) +{ + nvlist_t *nvl; + nvlist_t *default_val, *actual_val; + + nvl = nvlist_create(0); + nvlist_move_nvlist(nvl, "key", nvlist_create(0)); + default_val = nvlist_create(0); + + actual_val = dnvlist_take_nvlist(nvl, "otherkey", default_val); + ATF_REQUIRE_EQ(actual_val, default_val); + + free(actual_val); + nvlist_destroy(nvl); +} + +static void +set_binary_value(void *&value, size_t &size, const char *str) +{ + + value = strdup(str); + size = strlen(str) + 1; /* +1 to include '\0' */ +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__present); +ATF_TEST_CASE_BODY(dnvlist_take_binary__present) +{ + nvlist_t *nvl; + const char *key; + void *value, *default_val, *actual_val; + size_t value_size, default_size, actual_size; + + nvl = nvlist_create(0); + + key = "name"; + set_binary_value(value, value_size, "fkdojvmo908"); + set_binary_value(default_val, default_size, "16546"); + nvlist_add_binary(nvl, key, value, value_size); + + actual_val = dnvlist_take_binary(nvl, key, &actual_size, default_val, + default_size); + ATF_REQUIRE_EQ(value_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, value, value_size), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + free(actual_val); + free(default_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__empty); +ATF_TEST_CASE_BODY(dnvlist_take_binary__empty) +{ + nvlist_t *nvl; + void *default_val, *actual_val; + size_t default_size, actual_size; + + nvl = nvlist_create(0); + set_binary_value(default_val, default_size, "\xa8\x89\x49\xff\xe2\x08"); + + actual_val = dnvlist_take_binary(nvl, "123", &actual_size, default_val, + default_size); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, default_val, actual_size), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_binary__default_value) +{ + nvlist_t *nvl; + void *default_val, *actual_val; + size_t default_size, actual_size; + + nvl = nvlist_create(0); + nvlist_add_binary(nvl, "key", "foobar", 6); + set_binary_value(default_val, default_size, "vbhag"); + + actual_val = dnvlist_take_binary(nvl, "otherkey", &actual_size, + default_val, default_size); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, default_val, default_size), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, dnvlist_get_bool__present); @@ -286,4 +558,20 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, dnvlist_get_nvlist__default_value); ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__present); ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__default_value); + + ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_number__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_number__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_number__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_string__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_string__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_string__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__default_value); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E041D88B; Sun, 1 Mar 2015 00:22:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2874EA1; Sun, 1 Mar 2015 00:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210MAuO083478; Sun, 1 Mar 2015 00:22:10 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MAgR083477; Sun, 1 Mar 2015 00:22:10 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MAgR083477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279432 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:11 -0000 Author: rstone Date: Sun Mar 1 00:22:09 2015 New Revision: 279432 URL: https://svnweb.freebsd.org/changeset/base/279432 Log: Extend the unit test to fix the bug caught in r277925 Differential Revision: https://reviews.freebsd.org/D1888 MFC After: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/tests/nvlist_send_recv_test.c Modified: head/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_send_recv_test.c Sun Mar 1 00:22:03 2015 (r279431) +++ head/lib/libnv/tests/nvlist_send_recv_test.c Sun Mar 1 00:22:09 2015 (r279432) @@ -58,8 +58,10 @@ static void child(int sock) { nvlist_t *nvl; + nvlist_t *empty; nvl = nvlist_create(0); + empty = nvlist_create(0); nvlist_add_bool(nvl, "nvlist/bool/true", true); nvlist_add_bool(nvl, "nvlist/bool/false", false); @@ -75,6 +77,7 @@ child(int sock) nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", STDERR_FILENO); nvlist_add_binary(nvl, "nvlist/binary/x", "x", 1); nvlist_add_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")); + nvlist_move_nvlist(nvl, "nvlist/nvlist/empty", empty); nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); nvlist_send(sock, nvl); @@ -86,7 +89,7 @@ static void parent(int sock) { nvlist_t *nvl; - const nvlist_t *cnvl; + const nvlist_t *cnvl, *empty; const char *name, *cname; void *cookie, *ccookie; int type, ctype; @@ -190,6 +193,13 @@ parent(int sock) name = nvlist_next(nvl, &type, &cookie); CHECK(name != NULL); CHECK(type == NV_TYPE_NVLIST); + CHECK(strcmp(name, "nvlist/nvlist/empty") == 0); + cnvl = nvlist_get_nvlist(nvl, name); + CHECK(nvlist_empty(cnvl)); + + name = nvlist_next(nvl, &type, &cookie); + CHECK(name != NULL); + CHECK(type == NV_TYPE_NVLIST); CHECK(strcmp(name, "nvlist/nvlist") == 0); cnvl = nvlist_get_nvlist(nvl, name); @@ -284,6 +294,13 @@ parent(int sock) CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz")); cname = nvlist_next(cnvl, &ctype, &ccookie); + CHECK(cname != NULL); + CHECK(ctype == NV_TYPE_NVLIST); + CHECK(strcmp(cname, "nvlist/nvlist/empty") == 0); + empty = nvlist_get_nvlist(cnvl, cname); + CHECK(nvlist_empty(empty)); + + cname = nvlist_next(cnvl, &ctype, &ccookie); CHECK(cname == NULL); name = nvlist_next(nvl, &type, &cookie); @@ -296,7 +313,7 @@ main(void) int status, socks[2]; pid_t pid; - printf("1..126\n"); + printf("1..134\n"); fflush(stdout); if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7A5D9C5; Sun, 1 Mar 2015 00:22:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1532EA8; Sun, 1 Mar 2015 00:22:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210MHbx083545; Sun, 1 Mar 2015 00:22:17 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MHVC083540; Sun, 1 Mar 2015 00:22:17 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MHVC083540@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279433 - in head/sys: conf libkern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:18 -0000 Author: rstone Date: Sun Mar 1 00:22:16 2015 New Revision: 279433 URL: https://svnweb.freebsd.org/changeset/base/279433 Log: Implement asprintf in libkern Differential Revision: https://reviews.freebsd.org/D1877 Reviewed by: pjd, jfv MFC After: 1 month Sponsored by: Sandvine Inc. Added: head/sys/libkern/asprintf.c (contents, props changed) Modified: head/sys/conf/files head/sys/sys/systm.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 1 00:22:09 2015 (r279432) +++ head/sys/conf/files Sun Mar 1 00:22:16 2015 (r279433) @@ -3216,6 +3216,7 @@ kgssapi/gsstest.c optional kgssapi_debu # the file should be moved to conf/files. from here. # libkern/arc4random.c standard +libkern/asprintf.c standard libkern/bcd.c standard libkern/bsearch.c standard libkern/crc32.c standard Added: head/sys/libkern/asprintf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/asprintf.c Sun Mar 1 00:22:16 2015 (r279433) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +int +vasprintf(char **buf, struct malloc_type *mtp, const char *format, va_list va) +{ + int len, ret; + va_list tmp_va; + char dummy; + + va_copy(tmp_va, va); + len = vsnprintf(&dummy, 0, format, tmp_va); + va_end(tmp_va); + if (len < 0) { + *buf = NULL; + return (len); + } + + /* Account for null terminator. */ + len += 1; + *buf = malloc(len, mtp, M_NOWAIT); + if (*buf == NULL) + return (-1); + + ret = vsnprintf(*buf, len, format, va); + if (ret < 0) { + free(*buf, mtp); + *buf = NULL; + } + + return (ret); +} + +int +asprintf(char **buf, struct malloc_type *mtp, const char *format, ...) +{ + int ret; + va_list va; + + va_start(va, format); + ret = vasprintf(buf, mtp, format, va); + va_end(va); + + return (ret); +} Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sun Mar 1 00:22:09 2015 (r279432) +++ head/sys/sys/systm.h Sun Mar 1 00:22:16 2015 (r279433) @@ -205,11 +205,15 @@ int kvprintf(char const *, void (*)(int, __va_list) __printflike(1, 0); void log(int, const char *, ...) __printflike(2, 3); void log_console(struct uio *); +int asprintf(char **ret, struct malloc_type *mtp, const char *format, + ...) __printflike(3, 4); int printf(const char *, ...) __printflike(1, 2); int snprintf(char *, size_t, const char *, ...) __printflike(3, 4); int sprintf(char *buf, const char *, ...) __printflike(2, 3); int uprintf(const char *, ...) __printflike(1, 2); int vprintf(const char *, __va_list) __printflike(1, 0); +int vasprintf(char **ret, struct malloc_type *mtp, const char *format, + __va_list ap) __printflike(3, 0); int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0); int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1022B08; Sun, 1 Mar 2015 00:22:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BB3EB0; Sun, 1 Mar 2015 00:22:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210MPiB083630; Sun, 1 Mar 2015 00:22:25 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MOpI083624; Sun, 1 Mar 2015 00:22:24 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MOpI083624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279434 - in head/lib/libnv: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:26 -0000 Author: rstone Date: Sun Mar 1 00:22:23 2015 New Revision: 279434 URL: https://svnweb.freebsd.org/changeset/base/279434 Log: Add function to force an nvlist into the error state Add an nvlist_set_error() function that can be used to force an nvlist into the error state. This is useful both for writing tests and for writing APIs that use nvlists internally. Differential Revision: https://reviews.freebsd.org/D1878 Reviewed by: pjd, jfv MFC After: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/Makefile head/lib/libnv/nv.3 head/lib/libnv/nv.h head/lib/libnv/nvlist.c head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Sun Mar 1 00:22:16 2015 (r279433) +++ head/lib/libnv/Makefile Sun Mar 1 00:22:23 2015 (r279434) @@ -22,6 +22,7 @@ MLINKS+=nv.3 libnv.3 \ MLINKS+=nv.3 nvlist_create.3 \ nv.3 nvlist_destroy.3 \ nv.3 nvlist_error.3 \ + nv.3 nvlist_set_error.3 \ nv.3 nvlist_empty.3 \ nv.3 nvlist_clone.3 \ nv.3 nvlist_dump.3 \ Modified: head/lib/libnv/nv.3 ============================================================================== --- head/lib/libnv/nv.3 Sun Mar 1 00:22:16 2015 (r279433) +++ head/lib/libnv/nv.3 Sun Mar 1 00:22:23 2015 (r279434) @@ -35,6 +35,7 @@ .Nm nvlist_create , .Nm nvlist_destroy , .Nm nvlist_error , +.Nm nvlist_set_error , .Nm nvlist_empty , .Nm nvlist_exists , .Nm nvlist_free , @@ -63,6 +64,8 @@ .Fn nvlist_destroy "nvlist_t *nvl" .Ft int .Fn nvlist_error "const nvlist_t *nvl" +.Ft void +.Fn nvlist_set_error "nvlist_t *nvl, int error" .Ft bool .Fn nvlist_empty "const nvlist_t *nvl" .\" @@ -248,8 +251,17 @@ the error will be returned. .Pp The +.Fn nvlist_set_error +function sets an nvlist to be in the error state. +Subsequent calls to +.Fn nvlist_error +will return the given error value. +This function cannot be used to clear the error state from an nvlist. +This function does nothing if the nvlist is already in the error state. +.Pp +The .Fn nvlist_empty -functions returns +function returns .Dv true if the given nvlist is empty and .Dv false Modified: head/lib/libnv/nv.h ============================================================================== --- head/lib/libnv/nv.h Sun Mar 1 00:22:16 2015 (r279433) +++ head/lib/libnv/nv.h Sun Mar 1 00:22:23 2015 (r279434) @@ -69,6 +69,7 @@ nvlist_t *nvlist_create(int flags); void nvlist_destroy(nvlist_t *nvl); int nvlist_error(const nvlist_t *nvl); bool nvlist_empty(const nvlist_t *nvl); +void nvlist_set_error(nvlist_t *nvl, int error); nvlist_t *nvlist_clone(const nvlist_t *nvl); Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Sun Mar 1 00:22:16 2015 (r279433) +++ head/lib/libnv/nvlist.c Sun Mar 1 00:22:23 2015 (r279434) @@ -137,6 +137,20 @@ nvlist_destroy(nvlist_t *nvl) errno = serrno; } +void +nvlist_set_error(nvlist_t *nvl, int error) +{ + + PJDLOG_ASSERT(error != 0); + + /* + * Check for error != 0 so that we don't do the wrong thing if somebody + * tries to abuse this API when asserts are disabled. + */ + if (nvl != NULL && error != 0 && nvl->nvl_error == 0) + nvl->nvl_error = error; +} + int nvlist_error(const nvlist_t *nvl) { Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:22:16 2015 (r279433) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:22:23 2015 (r279434) @@ -409,6 +409,22 @@ ATF_TEST_CASE_BODY(nvlist_clone__nested_ nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__error_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__error_nvlist) +{ + nvlist_t *nvl, *clone; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + nvlist_set_error(nvl, ENOMEM); + + clone = nvlist_clone(nvl); + ATF_REQUIRE(clone == NULL); + + nvlist_destroy(nvl); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__empty_nvlist); ATF_TEST_CASE_BODY(nvlist_pack__empty_nvlist) { @@ -550,6 +566,24 @@ ATF_TEST_CASE_BODY(nvlist_pack__multiple free(packed); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__error_nvlist); +ATF_TEST_CASE_BODY(nvlist_pack__error_nvlist) +{ + nvlist_t *nvl; + void *packed; + size_t size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + nvlist_set_error(nvl, ENOMEM); + + packed = nvlist_pack(nvl, &size); + ATF_REQUIRE(packed == NULL); + + nvlist_destroy(nvl); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_unpack__duplicate_key); ATF_TEST_CASE_BODY(nvlist_unpack__duplicate_key) { @@ -1148,9 +1182,11 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_clone__empty_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_clone__nonempty_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_clone__nested_nvlist); + ATF_ADD_TEST_CASE(tp, nvlist_clone__error_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_pack__empty_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_pack__multiple_values); + ATF_ADD_TEST_CASE(tp, nvlist_pack__error_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_unpack__duplicate_key); ATF_ADD_TEST_CASE(tp, nvlist_move_string__single_insert); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52551C42; Sun, 1 Mar 2015 00:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C045EB4; Sun, 1 Mar 2015 00:22:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210MXdc083690; Sun, 1 Mar 2015 00:22:33 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MWMg083686; Sun, 1 Mar 2015 00:22:32 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MWMg083686@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279435 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:33 -0000 Author: rstone Date: Sun Mar 1 00:22:31 2015 New Revision: 279435 URL: https://svnweb.freebsd.org/changeset/base/279435 Log: Don't allocate memory for operations that do not insert Almost every operation performed on an nvlist was allocating a new string to hold the key name. The nvlist_exists* family of functions would always return false if they failed to allocate the string. The rest of the functions would outright abort(). Fix the non-varargs variants of the functions to perform the requested operations directly and the varargs versions to allocate the string and call into the non-varargs versions. The varargs versions are still broken and really can't be fixed, so we might consider axing them entirely. However, now the non- varargs functions are always safe to call. Differential Revision: https://reviews.freebsd.org/D1879 Reviewed by: pjd, jfv MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libnv/dnvlist.c head/lib/libnv/nv_impl.h head/lib/libnv/nvlist.c Modified: head/lib/libnv/dnvlist.c ============================================================================== --- head/lib/libnv/dnvlist.c Sun Mar 1 00:22:23 2015 (r279434) +++ head/lib/libnv/dnvlist.c Sun Mar 1 00:22:31 2015 (r279435) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "nv.h" #include "nv_impl.h" @@ -44,7 +45,10 @@ ftype \ dnvlist_get_##type(const nvlist_t *nvl, const char *name, ftype defval) \ { \ \ - return (dnvlist_getf_##type(nvl, defval, "%s", name)); \ + if (nvlist_exists_##type(nvl, name)) \ + return (nvlist_get_##type(nvl, name)); \ + else \ + return (defval); \ } DNVLIST_GET(bool, bool) @@ -59,8 +63,16 @@ const void * dnvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep, const void *defval, size_t defsize) { + const void *value; - return (dnvlist_getf_binary(nvl, sizep, defval, defsize, "%s", name)); + if (nvlist_exists_binary(nvl, name)) + value = nvlist_get_binary(nvl, name, sizep); + else { + if (sizep != NULL) + *sizep = defsize; + value = defval; + } + return (value); } #define DNVLIST_GETF(ftype, type) \ @@ -106,15 +118,14 @@ ftype \ dnvlist_getv_##type(const nvlist_t *nvl, ftype defval, \ const char *namefmt, va_list nameap) \ { \ - va_list cnameap; \ + char *name; \ ftype value; \ \ - va_copy(cnameap, nameap); \ - if (nvlist_existsv_##type(nvl, namefmt, cnameap)) \ - value = nvlist_getv_##type(nvl, namefmt, nameap); \ - else \ - value = defval; \ - va_end(cnameap); \ + vasprintf(&name, namefmt, nameap); \ + if (name == NULL) \ + return (defval); \ + value = dnvlist_get_##type(nvl, name, defval); \ + free(name); \ return (value); \ } @@ -130,18 +141,18 @@ const void * dnvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const void *defval, size_t defsize, const char *namefmt, va_list nameap) { - va_list cnameap; + char *name; const void *value; - va_copy(cnameap, nameap); - if (nvlist_existsv_binary(nvl, namefmt, cnameap)) { - value = nvlist_getv_binary(nvl, sizep, namefmt, nameap); + vasprintf(&name, namefmt, nameap); + if (name != NULL) { + value = dnvlist_get_binary(nvl, name, sizep, defval, defsize); + free(name); } else { if (sizep != NULL) *sizep = defsize; value = defval; } - va_end(cnameap); return (value); } @@ -150,7 +161,10 @@ ftype \ dnvlist_take_##type(nvlist_t *nvl, const char *name, ftype defval) \ { \ \ - return (dnvlist_takef_##type(nvl, defval, "%s", name)); \ + if (nvlist_exists_##type(nvl, name)) \ + return (nvlist_take_##type(nvl, name)); \ + else \ + return (defval); \ } DNVLIST_TAKE(bool, bool) @@ -165,8 +179,16 @@ void * dnvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep, void *defval, size_t defsize) { + void *value; - return (dnvlist_takef_binary(nvl, sizep, defval, defsize, "%s", name)); + if (nvlist_exists_binary(nvl, name)) + value = nvlist_take_binary(nvl, name, sizep); + else { + if (sizep != NULL) + *sizep = defsize; + value = defval; + } + return (value); } #define DNVLIST_TAKEF(ftype, type) \ @@ -212,15 +234,14 @@ ftype \ dnvlist_takev_##type(nvlist_t *nvl, ftype defval, const char *namefmt, \ va_list nameap) \ { \ - va_list cnameap; \ + char *name; \ ftype value; \ \ - va_copy(cnameap, nameap); \ - if (nvlist_existsv_##type(nvl, namefmt, cnameap)) \ - value = nvlist_takev_##type(nvl, namefmt, nameap); \ - else \ - value = defval; \ - va_end(cnameap); \ + vasprintf(&name, namefmt, nameap); \ + if (name == NULL) \ + return (defval); \ + value = dnvlist_take_##type(nvl, name, defval); \ + free(name); \ return (value); \ } @@ -236,17 +257,18 @@ void * dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, va_list nameap) { - va_list cnameap; + char *name; void *value; - va_copy(cnameap, nameap); - if (nvlist_existsv_binary(nvl, namefmt, cnameap)) { - value = nvlist_takev_binary(nvl, sizep, namefmt, nameap); + vasprintf(&name, namefmt, nameap); + if (name != NULL) { + value = dnvlist_take_binary(nvl, name, sizep, defval, defsize); + free(name); } else { if (sizep != NULL) *sizep = defsize; value = defval; } - va_end(cnameap); + return (value); } Modified: head/lib/libnv/nv_impl.h ============================================================================== --- head/lib/libnv/nv_impl.h Sun Mar 1 00:22:23 2015 (r279434) +++ head/lib/libnv/nv_impl.h Sun Mar 1 00:22:31 2015 (r279435) @@ -97,14 +97,6 @@ const void *nvpair_get_binary(const nvpa void nvpair_free(nvpair_t *nvp); -const nvpair_t *nvlist_getf_nvpair(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); - -const nvpair_t *nvlist_getv_nvpair(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); - -nvpair_t *nvlist_takef_nvpair(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); - -nvpair_t *nvlist_takev_nvpair(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); - nvpair_t *nvpair_createf_null(const char *namefmt, ...) __printflike(1, 2); nvpair_t *nvpair_createf_bool(bool value, const char *namefmt, ...) __printflike(2, 3); nvpair_t *nvpair_createf_number(uint64_t value, const char *namefmt, ...) __printflike(2, 3); Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Sun Mar 1 00:22:23 2015 (r279434) +++ head/lib/libnv/nvlist.c Sun Mar 1 00:22:31 2015 (r279435) @@ -208,29 +208,23 @@ nvlist_empty(const nvlist_t *nvl) } static void -nvlist_report_missing(int type, const char *namefmt, va_list nameap) +nvlist_report_missing(int type, const char *name) { - char *name; - vasprintf(&name, namefmt, nameap); PJDLOG_ABORT("Element '%s' of type %s doesn't exist.", - name != NULL ? name : "N/A", nvpair_type_string(type)); + name, nvpair_type_string(type)); } static nvpair_t * -nvlist_findv(const nvlist_t *nvl, int type, const char *namefmt, va_list nameap) +nvlist_find(const nvlist_t *nvl, int type, const char *name) { nvpair_t *nvp; - char *name; NVLIST_ASSERT(nvl); PJDLOG_ASSERT(nvl->nvl_error == 0); PJDLOG_ASSERT(type == NV_TYPE_NONE || (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST)); - if (vasprintf(&name, namefmt, nameap) < 0) - return (NULL); - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; nvp = nvlist_next_nvpair(nvl, nvp)) { if (type != NV_TYPE_NONE && nvpair_type(nvp) != type) @@ -245,8 +239,6 @@ nvlist_findv(const nvlist_t *nvl, int ty break; } - free(name); - if (nvp == NULL) errno = ENOENT; @@ -257,7 +249,12 @@ bool nvlist_exists_type(const nvlist_t *nvl, const char *name, int type) { - return (nvlist_existsf_type(nvl, type, "%s", name)); + NVLIST_ASSERT(nvl); + PJDLOG_ASSERT(nvl->nvl_error == 0); + PJDLOG_ASSERT(type == NV_TYPE_NONE || + (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST)); + + return (nvlist_find(nvl, type, name) != NULL); } bool @@ -277,20 +274,33 @@ bool nvlist_existsv_type(const nvlist_t *nvl, int type, const char *namefmt, va_list nameap) { + char *name; + bool exists; - NVLIST_ASSERT(nvl); - PJDLOG_ASSERT(nvl->nvl_error == 0); - PJDLOG_ASSERT(type == NV_TYPE_NONE || - (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST)); + vasprintf(&name, namefmt, nameap); + if (name == NULL) + return (false); - return (nvlist_findv(nvl, type, namefmt, nameap) != NULL); + exists = nvlist_exists_type(nvl, name, type); + free(name); + return (exists); } void nvlist_free_type(nvlist_t *nvl, const char *name, int type) { + nvpair_t *nvp; + + NVLIST_ASSERT(nvl); + PJDLOG_ASSERT(nvl->nvl_error == 0); + PJDLOG_ASSERT(type == NV_TYPE_NONE || + (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST)); - nvlist_freef_type(nvl, type, "%s", name); + nvp = nvlist_find(nvl, type, name); + if (nvp != NULL) + nvlist_free_nvpair(nvl, nvp); + else + nvlist_report_missing(type, name); } void @@ -306,21 +316,13 @@ nvlist_freef_type(nvlist_t *nvl, int typ void nvlist_freev_type(nvlist_t *nvl, int type, const char *namefmt, va_list nameap) { - va_list cnameap; - nvpair_t *nvp; - - NVLIST_ASSERT(nvl); - PJDLOG_ASSERT(nvl->nvl_error == 0); - PJDLOG_ASSERT(type == NV_TYPE_NONE || - (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST)); + char *name; - va_copy(cnameap, nameap); - nvp = nvlist_findv(nvl, type, namefmt, cnameap); - va_end(cnameap); - if (nvp != NULL) - nvlist_free_nvpair(nvl, nvp); - else - nvlist_report_missing(type, namefmt, nameap); + vasprintf(&name, namefmt, nameap); + if (name == NULL) + nvlist_report_missing(type, ""); + nvlist_free_type(nvl, name, type); + free(name); } nvlist_t * @@ -1031,24 +1033,24 @@ bool nvlist_exists(const nvlist_t *nvl, const char *name) { - return (nvlist_existsf(nvl, "%s", name)); + return (nvlist_find(nvl, NV_TYPE_NONE, name) != NULL); } -#define NVLIST_EXISTS(type) \ +#define NVLIST_EXISTS(type, TYPE) \ bool \ nvlist_exists_##type(const nvlist_t *nvl, const char *name) \ { \ \ - return (nvlist_existsf_##type(nvl, "%s", name)); \ + return (nvlist_find(nvl, NV_TYPE_##TYPE, name) != NULL); \ } -NVLIST_EXISTS(null) -NVLIST_EXISTS(bool) -NVLIST_EXISTS(number) -NVLIST_EXISTS(string) -NVLIST_EXISTS(nvlist) -NVLIST_EXISTS(descriptor) -NVLIST_EXISTS(binary) +NVLIST_EXISTS(null, NULL) +NVLIST_EXISTS(bool, BOOL) +NVLIST_EXISTS(number, NUMBER) +NVLIST_EXISTS(string, STRING) +NVLIST_EXISTS(nvlist, NVLIST) +NVLIST_EXISTS(descriptor, DESCRIPTOR) +NVLIST_EXISTS(binary, BINARY) #undef NVLIST_EXISTS @@ -1090,27 +1092,41 @@ NVLIST_EXISTSF(binary) bool nvlist_existsv(const nvlist_t *nvl, const char *namefmt, va_list nameap) { + char *name; + bool exists; + + vasprintf(&name, namefmt, nameap); + if (name == NULL) + return (false); - return (nvlist_findv(nvl, NV_TYPE_NONE, namefmt, nameap) != NULL); + exists = nvlist_exists(nvl, name); + free(name); + return (exists); } -#define NVLIST_EXISTSV(type, TYPE) \ +#define NVLIST_EXISTSV(type) \ bool \ nvlist_existsv_##type(const nvlist_t *nvl, const char *namefmt, \ va_list nameap) \ { \ + char *name; \ + bool exists; \ \ - return (nvlist_findv(nvl, NV_TYPE_##TYPE, namefmt, nameap) != \ - NULL); \ + vasprintf(&name, namefmt, nameap); \ + if (name == NULL) \ + return (false); \ + exists = nvlist_exists_##type(nvl, name); \ + free(name); \ + return (exists); \ } -NVLIST_EXISTSV(null, NULL) -NVLIST_EXISTSV(bool, BOOL) -NVLIST_EXISTSV(number, NUMBER) -NVLIST_EXISTSV(string, STRING) -NVLIST_EXISTSV(nvlist, NVLIST) -NVLIST_EXISTSV(descriptor, DESCRIPTOR) -NVLIST_EXISTSV(binary, BINARY) +NVLIST_EXISTSV(null) +NVLIST_EXISTSV(bool) +NVLIST_EXISTSV(number) +NVLIST_EXISTSV(string) +NVLIST_EXISTSV(nvlist) +NVLIST_EXISTSV(descriptor) +NVLIST_EXISTSV(binary) #undef NVLIST_EXISTSV @@ -1561,28 +1577,43 @@ nvlist_movev_binary(nvlist_t *nvl, void nvlist_move_nvpair(nvl, nvp); } -#define NVLIST_GET(ftype, type) \ +const nvpair_t * +nvlist_get_nvpair(const nvlist_t *nvl, const char *name) +{ + + return (nvlist_find(nvl, NV_TYPE_NONE, name)); +} + +#define NVLIST_GET(ftype, type, TYPE) \ ftype \ nvlist_get_##type(const nvlist_t *nvl, const char *name) \ { \ + const nvpair_t *nvp; \ \ - return (nvlist_getf_##type(nvl, "%s", name)); \ + nvp = nvlist_find(nvl, NV_TYPE_##TYPE, name); \ + if (nvp == NULL) \ + nvlist_report_missing(NV_TYPE_##TYPE, name); \ + return (nvpair_get_##type(nvp)); \ } -NVLIST_GET(const nvpair_t *, nvpair) -NVLIST_GET(bool, bool) -NVLIST_GET(uint64_t, number) -NVLIST_GET(const char *, string) -NVLIST_GET(const nvlist_t *, nvlist) -NVLIST_GET(int, descriptor) +NVLIST_GET(bool, bool, BOOL) +NVLIST_GET(uint64_t, number, NUMBER) +NVLIST_GET(const char *, string, STRING) +NVLIST_GET(const nvlist_t *, nvlist, NVLIST) +NVLIST_GET(int, descriptor, DESCRIPTOR) #undef NVLIST_GET const void * nvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep) { + nvpair_t *nvp; + + nvp = nvlist_find(nvl, NV_TYPE_BINARY, name); + if (nvp == NULL) + nvlist_report_missing(NV_TYPE_BINARY, name); - return (nvlist_getf_binary(nvl, sizep, "%s", name)); + return (nvpair_get_binary(nvp, sizep)); } #define NVLIST_GETF(ftype, type) \ @@ -1599,7 +1630,6 @@ nvlist_getf_##type(const nvlist_t *nvl, return (value); \ } -NVLIST_GETF(const nvpair_t *, nvpair) NVLIST_GETF(bool, bool) NVLIST_GETF(uint64_t, number) NVLIST_GETF(const char *, string) @@ -1621,27 +1651,21 @@ nvlist_getf_binary(const nvlist_t *nvl, return (value); } -const nvpair_t * -nvlist_getv_nvpair(const nvlist_t *nvl, const char *namefmt, va_list nameap) -{ - - return (nvlist_findv(nvl, NV_TYPE_NONE, namefmt, nameap)); -} - #define NVLIST_GETV(ftype, type, TYPE) \ ftype \ nvlist_getv_##type(const nvlist_t *nvl, const char *namefmt, \ va_list nameap) \ { \ - va_list cnameap; \ - const nvpair_t *nvp; \ + char *name; \ + ftype value; \ \ - va_copy(cnameap, nameap); \ - nvp = nvlist_findv(nvl, NV_TYPE_##TYPE, namefmt, cnameap); \ - va_end(cnameap); \ - if (nvp == NULL) \ - nvlist_report_missing(NV_TYPE_##TYPE, namefmt, nameap); \ - return (nvpair_get_##type(nvp)); \ + vasprintf(&name, namefmt, nameap); \ + if (name == NULL) \ + nvlist_report_missing(NV_TYPE_##TYPE, ""); \ + value = nvlist_get_##type(nvl, name); \ + free(name); \ + \ + return (value); \ } NVLIST_GETV(bool, bool, BOOL) @@ -1656,40 +1680,56 @@ const void * nvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt, va_list nameap) { - va_list cnameap; - const nvpair_t *nvp; + char *name; + const void *binary; - va_copy(cnameap, nameap); - nvp = nvlist_findv(nvl, NV_TYPE_BINARY, namefmt, cnameap); - va_end(cnameap); - if (nvp == NULL) - nvlist_report_missing(NV_TYPE_BINARY, namefmt, nameap); + vasprintf(&name, namefmt, nameap); + if (name == NULL) + nvlist_report_missing(NV_TYPE_BINARY, ""); - return (nvpair_get_binary(nvp, sizep)); + binary = nvlist_get_binary(nvl, name, sizep); + free(name); + return (binary); } -#define NVLIST_TAKE(ftype, type) \ +#define NVLIST_TAKE(ftype, type, TYPE) \ ftype \ nvlist_take_##type(nvlist_t *nvl, const char *name) \ { \ + nvpair_t *nvp; \ + ftype value; \ \ - return (nvlist_takef_##type(nvl, "%s", name)); \ + nvp = nvlist_find(nvl, NV_TYPE_##TYPE, name); \ + if (nvp == NULL) \ + nvlist_report_missing(NV_TYPE_##TYPE, name); \ + value = (ftype)(intptr_t)nvpair_get_##type(nvp); \ + nvlist_remove_nvpair(nvl, nvp); \ + nvpair_free_structure(nvp); \ + return (value); \ } -NVLIST_TAKE(nvpair_t *, nvpair) -NVLIST_TAKE(bool, bool) -NVLIST_TAKE(uint64_t, number) -NVLIST_TAKE(char *, string) -NVLIST_TAKE(nvlist_t *, nvlist) -NVLIST_TAKE(int, descriptor) +NVLIST_TAKE(bool, bool, BOOL) +NVLIST_TAKE(uint64_t, number, NUMBER) +NVLIST_TAKE(char *, string, STRING) +NVLIST_TAKE(nvlist_t *, nvlist, NVLIST) +NVLIST_TAKE(int, descriptor, DESCRIPTOR) #undef NVLIST_TAKE void * nvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep) { + nvpair_t *nvp; + void *value; + + nvp = nvlist_find(nvl, NV_TYPE_BINARY, name); + if (nvp == NULL) + nvlist_report_missing(NV_TYPE_BINARY, name); - return (nvlist_takef_binary(nvl, sizep, "%s", name)); + value = (void *)(intptr_t)nvpair_get_binary(nvp, sizep); + nvlist_remove_nvpair(nvl, nvp); + nvpair_free_structure(nvp); + return (value); } #define NVLIST_TAKEF(ftype, type) \ @@ -1706,7 +1746,6 @@ nvlist_takef_##type(nvlist_t *nvl, const return (value); \ } -NVLIST_TAKEF(nvpair_t *, nvpair) NVLIST_TAKEF(bool, bool) NVLIST_TAKEF(uint64_t, number) NVLIST_TAKEF(char *, string) @@ -1728,33 +1767,18 @@ nvlist_takef_binary(nvlist_t *nvl, size_ return (value); } -nvpair_t * -nvlist_takev_nvpair(nvlist_t *nvl, const char *namefmt, va_list nameap) -{ - nvpair_t *nvp; - - nvp = nvlist_findv(nvl, NV_TYPE_NONE, namefmt, nameap); - if (nvp != NULL) - nvlist_remove_nvpair(nvl, nvp); - return (nvp); -} - #define NVLIST_TAKEV(ftype, type, TYPE) \ ftype \ nvlist_takev_##type(nvlist_t *nvl, const char *namefmt, va_list nameap) \ { \ - va_list cnameap; \ - nvpair_t *nvp; \ + char *name; \ ftype value; \ \ - va_copy(cnameap, nameap); \ - nvp = nvlist_findv(nvl, NV_TYPE_##TYPE, namefmt, cnameap); \ - va_end(cnameap); \ - if (nvp == NULL) \ - nvlist_report_missing(NV_TYPE_##TYPE, namefmt, nameap); \ - value = (ftype)(intptr_t)nvpair_get_##type(nvp); \ - nvlist_remove_nvpair(nvl, nvp); \ - nvpair_free_structure(nvp); \ + vasprintf(&name, namefmt, nameap); \ + if (name == NULL) \ + nvlist_report_missing(NV_TYPE_##TYPE, ""); \ + value = nvlist_take_##type(nvl, name); \ + free(name); \ return (value); \ } @@ -1770,20 +1794,16 @@ void * nvlist_takev_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt, va_list nameap) { - va_list cnameap; - nvpair_t *nvp; - void *value; + char *name; + void *binary; - va_copy(cnameap, nameap); - nvp = nvlist_findv(nvl, NV_TYPE_BINARY, namefmt, cnameap); - va_end(cnameap); - if (nvp == NULL) - nvlist_report_missing(NV_TYPE_BINARY, namefmt, nameap); + vasprintf(&name, namefmt, nameap); + if (name == NULL) + nvlist_report_missing(NV_TYPE_BINARY, ""); - value = (void *)(intptr_t)nvpair_get_binary(nvp, sizep); - nvlist_remove_nvpair(nvl, nvp); - nvpair_free_structure(nvp); - return (value); + binary = nvlist_take_binary(nvl, name, sizep); + free(name); + return (binary); } void @@ -1801,24 +1821,24 @@ void nvlist_free(nvlist_t *nvl, const char *name) { - nvlist_freef(nvl, "%s", name); + nvlist_free_type(nvl, name, NV_TYPE_NONE); } -#define NVLIST_FREE(type) \ +#define NVLIST_FREE(type, TYPE) \ void \ nvlist_free_##type(nvlist_t *nvl, const char *name) \ { \ \ - nvlist_freef_##type(nvl, "%s", name); \ + nvlist_free_type(nvl, name, NV_TYPE_##TYPE); \ } -NVLIST_FREE(null) -NVLIST_FREE(bool) -NVLIST_FREE(number) -NVLIST_FREE(string) -NVLIST_FREE(nvlist) -NVLIST_FREE(descriptor) -NVLIST_FREE(binary) +NVLIST_FREE(null, NULL) +NVLIST_FREE(bool, BOOL) +NVLIST_FREE(number, NUMBER) +NVLIST_FREE(string, STRING) +NVLIST_FREE(nvlist, NVLIST) +NVLIST_FREE(descriptor, DESCRIPTOR) +NVLIST_FREE(binary, BINARY) #undef NVLIST_FREE @@ -1864,8 +1884,13 @@ nvlist_freev(nvlist_t *nvl, const char * void \ nvlist_freev_##type(nvlist_t *nvl, const char *namefmt, va_list nameap) \ { \ + char *name; \ \ - nvlist_freev_type(nvl, NV_TYPE_##TYPE, namefmt, nameap); \ + vasprintf(&name, namefmt, nameap); \ + if (name == NULL) \ + nvlist_report_missing(NV_TYPE_##TYPE, ""); \ + nvlist_free_##type(nvl, name); \ + free(name); \ } NVLIST_FREEV(null, NULL) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5B81E01; Sun, 1 Mar 2015 00:22:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1123EBB; Sun, 1 Mar 2015 00:22:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210Md6J083773; Sun, 1 Mar 2015 00:22:39 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MdOr083768; Sun, 1 Mar 2015 00:22:39 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MdOr083768@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279436 - in head/lib/libnv: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:40 -0000 Author: rstone Date: Sun Mar 1 00:22:38 2015 New Revision: 279436 URL: https://svnweb.freebsd.org/changeset/base/279436 Log: Prevent creation of an invalid nvlist If an nvlist is set as a child of another nvlist with nvlist_move_nvlist then fail the operation and set the parent nvlist to the error state. Differential Revision: https://reviews.freebsd.org/D1880 Reviewers: jfv MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/lib/libnv/nvpair.c head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/nvpair.c ============================================================================== --- head/lib/libnv/nvpair.c Sun Mar 1 00:22:31 2015 (r279435) +++ head/lib/libnv/nvpair.c Sun Mar 1 00:22:38 2015 (r279436) @@ -1128,6 +1128,12 @@ nvpair_movev_nvlist(nvlist_t *value, con return (NULL); } + if (nvlist_error(value) != 0) { + errno = nvlist_error(value); + nvlist_destroy(value); + return (NULL); + } + nvp = nvpair_allocv(NV_TYPE_NVLIST, (uint64_t)(uintptr_t)value, 0, namefmt, nameap); if (nvp == NULL) Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:22:31 2015 (r279435) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:22:38 2015 (r279436) @@ -243,6 +243,22 @@ ATF_TEST_CASE_BODY(nvlist_add_nvlist__si nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__child_with_error); +ATF_TEST_CASE_BODY(nvlist_add_nvlist__child_with_error) +{ + nvlist_t *nvl, *parent; + + nvl = nvlist_create(0); + parent = nvlist_create(0); + + nvlist_set_error(nvl, EBADF); + nvlist_add_nvlist(parent, "test", nvl); + ATF_REQUIRE_EQ(nvlist_error(parent), EBADF); + + nvlist_destroy(nvl); + nvlist_destroy(parent); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) { @@ -654,6 +670,21 @@ ATF_TEST_CASE_BODY(nvlist_move_nvlist__n nvlist_destroy(parent); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__child_with_error); +ATF_TEST_CASE_BODY(nvlist_move_nvlist__child_with_error) +{ + nvlist_t *nvl, *parent; + + nvl = nvlist_create(0); + parent = nvlist_create(0); + + nvlist_set_error(nvl, EBADF); + nvlist_move_nvlist(parent, "test", nvl); + ATF_REQUIRE_EQ(nvlist_error(parent), EBADF); + + nvlist_destroy(parent); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__single_insert); ATF_TEST_CASE_BODY(nvlist_move_nvlist__single_insert) { @@ -1177,6 +1208,7 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); + ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__child_with_error); ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_clone__empty_nvlist); @@ -1192,6 +1224,7 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_move_string__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__null_child); + ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__child_with_error); ATF_ADD_TEST_CASE(tp, nvlist_move_binary__single_insert); ATF_ADD_TEST_CASE(tp, nvlist_take_bool__single_remove); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F358F3F; Sun, 1 Mar 2015 00:22:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49823EC4; Sun, 1 Mar 2015 00:22:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210MkFh083828; Sun, 1 Mar 2015 00:22:46 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MkXI083827; Sun, 1 Mar 2015 00:22:46 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MkXI083827@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279437 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:46 -0000 Author: rstone Date: Sun Mar 1 00:22:45 2015 New Revision: 279437 URL: https://svnweb.freebsd.org/changeset/base/279437 Log: Allow Illumos code to co-exist with nv(9) Differential Revision: https://reviews.freebsd.org/D1881 Reviewed by: jfv, will Suggested by: pjd MFC after: 1 month Sponsored by: Sandvine Inc Added: head/sys/cddl/compat/opensolaris/sys/nvpair.h (contents, props changed) Added: head/sys/cddl/compat/opensolaris/sys/nvpair.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/sys/nvpair.h Sun Mar 1 00:22:45 2015 (r279437) @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2014 Sandvine Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_NVPAIR_H_ +#define _OPENSOLARIS_SYS_NVPAIR_H_ + +/* + * Some of the symbols in the Illumos nvpair library conflict with symbols + * provided by nv(9), so we use this preprocessor hack to avoid the conflict. + * + * This list was generated by: + * cat nv.h nv_impl.h nvlist_* nvpair_impl.h | \ + * sed -nE 's/^[[:alnum:]_][[:alnum:]_ ]*[[:space:]]+[*]*([[:alnum:]_]+)\(.*$/#define \1 illumos_\1/p' | \ + * sort -u + */ +#define nvlist_add_binary illumos_nvlist_add_binary +#define nvlist_add_bool illumos_nvlist_add_bool +#define nvlist_add_descriptor illumos_nvlist_add_descriptor +#define nvlist_add_null illumos_nvlist_add_null +#define nvlist_add_number illumos_nvlist_add_number +#define nvlist_add_nvlist illumos_nvlist_add_nvlist +#define nvlist_add_nvpair illumos_nvlist_add_nvpair +#define nvlist_add_string illumos_nvlist_add_string +#define nvlist_add_stringf illumos_nvlist_add_stringf +#define nvlist_add_stringv illumos_nvlist_add_stringv +#define nvlist_addf_binary illumos_nvlist_addf_binary +#define nvlist_addf_bool illumos_nvlist_addf_bool +#define nvlist_addf_descriptor illumos_nvlist_addf_descriptor +#define nvlist_addf_null illumos_nvlist_addf_null +#define nvlist_addf_number illumos_nvlist_addf_number +#define nvlist_addf_nvlist illumos_nvlist_addf_nvlist +#define nvlist_addf_string illumos_nvlist_addf_string +#define nvlist_addv_binary illumos_nvlist_addv_binary +#define nvlist_addv_bool illumos_nvlist_addv_bool +#define nvlist_addv_descriptor illumos_nvlist_addv_descriptor +#define nvlist_addv_null illumos_nvlist_addv_null +#define nvlist_addv_number illumos_nvlist_addv_number +#define nvlist_addv_nvlist illumos_nvlist_addv_nvlist +#define nvlist_addv_string illumos_nvlist_addv_string +#define nvlist_check_header illumos_nvlist_check_header +#define nvlist_clone illumos_nvlist_clone +#define nvlist_create illumos_nvlist_create +#define nvlist_descriptors illumos_nvlist_descriptors +#define nvlist_destroy illumos_nvlist_destroy +#define nvlist_dump illumos_nvlist_dump +#define nvlist_empty illumos_nvlist_empty +#define nvlist_error illumos_nvlist_error +#define nvlist_exists illumos_nvlist_exists +#define nvlist_exists_binary illumos_nvlist_exists_binary +#define nvlist_exists_bool illumos_nvlist_exists_bool +#define nvlist_exists_descriptor illumos_nvlist_exists_descriptor +#define nvlist_exists_null illumos_nvlist_exists_null +#define nvlist_exists_number illumos_nvlist_exists_number +#define nvlist_exists_nvlist illumos_nvlist_exists_nvlist +#define nvlist_exists_string illumos_nvlist_exists_string +#define nvlist_exists_type illumos_nvlist_exists_type +#define nvlist_existsf illumos_nvlist_existsf +#define nvlist_existsf_binary illumos_nvlist_existsf_binary +#define nvlist_existsf_bool illumos_nvlist_existsf_bool +#define nvlist_existsf_descriptor illumos_nvlist_existsf_descriptor +#define nvlist_existsf_null illumos_nvlist_existsf_null +#define nvlist_existsf_number illumos_nvlist_existsf_number +#define nvlist_existsf_nvlist illumos_nvlist_existsf_nvlist +#define nvlist_existsf_string illumos_nvlist_existsf_string +#define nvlist_existsf_type illumos_nvlist_existsf_type +#define nvlist_existsv illumos_nvlist_existsv +#define nvlist_existsv_binary illumos_nvlist_existsv_binary +#define nvlist_existsv_bool illumos_nvlist_existsv_bool +#define nvlist_existsv_descriptor illumos_nvlist_existsv_descriptor +#define nvlist_existsv_null illumos_nvlist_existsv_null +#define nvlist_existsv_number illumos_nvlist_existsv_number +#define nvlist_existsv_nvlist illumos_nvlist_existsv_nvlist +#define nvlist_existsv_string illumos_nvlist_existsv_string +#define nvlist_existsv_type illumos_nvlist_existsv_type +#define nvlist_fdump illumos_nvlist_fdump +#define nvlist_first_nvpair illumos_nvlist_first_nvpair +#define nvlist_free illumos_nvlist_free +#define nvlist_free_binary illumos_nvlist_free_binary +#define nvlist_free_bool illumos_nvlist_free_bool +#define nvlist_free_descriptor illumos_nvlist_free_descriptor +#define nvlist_free_null illumos_nvlist_free_null +#define nvlist_free_number illumos_nvlist_free_number +#define nvlist_free_nvlist illumos_nvlist_free_nvlist +#define nvlist_free_nvpair illumos_nvlist_free_nvpair +#define nvlist_free_string illumos_nvlist_free_string +#define nvlist_free_type illumos_nvlist_free_type +#define nvlist_freef illumos_nvlist_freef +#define nvlist_freef_binary illumos_nvlist_freef_binary +#define nvlist_freef_bool illumos_nvlist_freef_bool +#define nvlist_freef_descriptor illumos_nvlist_freef_descriptor +#define nvlist_freef_null illumos_nvlist_freef_null +#define nvlist_freef_number illumos_nvlist_freef_number +#define nvlist_freef_nvlist illumos_nvlist_freef_nvlist +#define nvlist_freef_string illumos_nvlist_freef_string +#define nvlist_freef_type illumos_nvlist_freef_type +#define nvlist_freev illumos_nvlist_freev +#define nvlist_freev_binary illumos_nvlist_freev_binary +#define nvlist_freev_bool illumos_nvlist_freev_bool +#define nvlist_freev_descriptor illumos_nvlist_freev_descriptor +#define nvlist_freev_null illumos_nvlist_freev_null +#define nvlist_freev_number illumos_nvlist_freev_number +#define nvlist_freev_nvlist illumos_nvlist_freev_nvlist +#define nvlist_freev_string illumos_nvlist_freev_string +#define nvlist_freev_type illumos_nvlist_freev_type +#define nvlist_get_binary illumos_nvlist_get_binary +#define nvlist_get_bool illumos_nvlist_get_bool +#define nvlist_get_descriptor illumos_nvlist_get_descriptor +#define nvlist_get_number illumos_nvlist_get_number +#define nvlist_get_nvlist illumos_nvlist_get_nvlist +#define nvlist_get_nvpair illumos_nvlist_get_nvpair +#define nvlist_get_string illumos_nvlist_get_string +#define nvlist_getf_binary illumos_nvlist_getf_binary +#define nvlist_getf_bool illumos_nvlist_getf_bool +#define nvlist_getf_descriptor illumos_nvlist_getf_descriptor +#define nvlist_getf_number illumos_nvlist_getf_number +#define nvlist_getf_nvlist illumos_nvlist_getf_nvlist +#define nvlist_getf_string illumos_nvlist_getf_string +#define nvlist_getv_binary illumos_nvlist_getv_binary +#define nvlist_getv_bool illumos_nvlist_getv_bool +#define nvlist_getv_descriptor illumos_nvlist_getv_descriptor +#define nvlist_getv_number illumos_nvlist_getv_number +#define nvlist_getv_nvlist illumos_nvlist_getv_nvlist +#define nvlist_getv_string illumos_nvlist_getv_string +#define nvlist_move_binary illumos_nvlist_move_binary +#define nvlist_move_descriptor illumos_nvlist_move_descriptor +#define nvlist_move_nvlist illumos_nvlist_move_nvlist +#define nvlist_move_nvpair illumos_nvlist_move_nvpair +#define nvlist_move_string illumos_nvlist_move_string +#define nvlist_movef_binary illumos_nvlist_movef_binary +#define nvlist_movef_descriptor illumos_nvlist_movef_descriptor +#define nvlist_movef_nvlist illumos_nvlist_movef_nvlist +#define nvlist_movef_string illumos_nvlist_movef_string +#define nvlist_movev_binary illumos_nvlist_movev_binary +#define nvlist_movev_descriptor illumos_nvlist_movev_descriptor +#define nvlist_movev_nvlist illumos_nvlist_movev_nvlist +#define nvlist_movev_string illumos_nvlist_movev_string +#define nvlist_ndescriptors illumos_nvlist_ndescriptors +#define nvlist_next illumos_nvlist_next +#define nvlist_next_nvpair illumos_nvlist_next_nvpair +#define nvlist_pack illumos_nvlist_pack +#define nvlist_prev_nvpair illumos_nvlist_prev_nvpair +#define nvlist_recv illumos_nvlist_recv +#define nvlist_remove_nvpair illumos_nvlist_remove_nvpair +#define nvlist_report_missing illumos_nvlist_report_missing +#define nvlist_send illumos_nvlist_send +#define nvlist_set_error illumos_nvlist_set_error +#define nvlist_size illumos_nvlist_size +#define nvlist_take_binary illumos_nvlist_take_binary +#define nvlist_take_bool illumos_nvlist_take_bool +#define nvlist_take_descriptor illumos_nvlist_take_descriptor +#define nvlist_take_number illumos_nvlist_take_number +#define nvlist_take_nvlist illumos_nvlist_take_nvlist +#define nvlist_take_nvpair illumos_nvlist_take_nvpair +#define nvlist_take_string illumos_nvlist_take_string +#define nvlist_takef_binary illumos_nvlist_takef_binary +#define nvlist_takef_bool illumos_nvlist_takef_bool +#define nvlist_takef_descriptor illumos_nvlist_takef_descriptor +#define nvlist_takef_number illumos_nvlist_takef_number +#define nvlist_takef_nvlist illumos_nvlist_takef_nvlist +#define nvlist_takef_string illumos_nvlist_takef_string +#define nvlist_takev_binary illumos_nvlist_takev_binary +#define nvlist_takev_bool illumos_nvlist_takev_bool +#define nvlist_takev_descriptor illumos_nvlist_takev_descriptor +#define nvlist_takev_number illumos_nvlist_takev_number +#define nvlist_takev_nvlist illumos_nvlist_takev_nvlist +#define nvlist_takev_string illumos_nvlist_takev_string +#define nvlist_unpack illumos_nvlist_unpack +#define nvlist_xfer illumos_nvlist_xfer +#define nvlist_xpack illumos_nvlist_xpack +#define nvlist_xunpack illumos_nvlist_xunpack +#define nvpair_allocv illumos_nvpair_allocv +#define nvpair_assert illumos_nvpair_assert +#define nvpair_clone illumos_nvpair_clone +#define nvpair_create_binary illumos_nvpair_create_binary +#define nvpair_create_bool illumos_nvpair_create_bool +#define nvpair_create_descriptor illumos_nvpair_create_descriptor +#define nvpair_create_null illumos_nvpair_create_null +#define nvpair_create_number illumos_nvpair_create_number +#define nvpair_create_nvlist illumos_nvpair_create_nvlist +#define nvpair_create_string illumos_nvpair_create_string +#define nvpair_create_stringf illumos_nvpair_create_stringf +#define nvpair_create_stringv illumos_nvpair_create_stringv +#define nvpair_createf_binary illumos_nvpair_createf_binary +#define nvpair_createf_bool illumos_nvpair_createf_bool +#define nvpair_createf_descriptor illumos_nvpair_createf_descriptor +#define nvpair_createf_null illumos_nvpair_createf_null +#define nvpair_createf_number illumos_nvpair_createf_number +#define nvpair_createf_nvlist illumos_nvpair_createf_nvlist +#define nvpair_createf_string illumos_nvpair_createf_string +#define nvpair_createv_binary illumos_nvpair_createv_binary +#define nvpair_createv_bool illumos_nvpair_createv_bool +#define nvpair_createv_descriptor illumos_nvpair_createv_descriptor +#define nvpair_createv_null illumos_nvpair_createv_null +#define nvpair_createv_number illumos_nvpair_createv_number +#define nvpair_createv_nvlist illumos_nvpair_createv_nvlist +#define nvpair_createv_string illumos_nvpair_createv_string +#define nvpair_free illumos_nvpair_free +#define nvpair_free_structure illumos_nvpair_free_structure +#define nvpair_get_binary illumos_nvpair_get_binary +#define nvpair_get_bool illumos_nvpair_get_bool +#define nvpair_get_descriptor illumos_nvpair_get_descriptor +#define nvpair_get_number illumos_nvpair_get_number +#define nvpair_get_nvlist illumos_nvpair_get_nvlist +#define nvpair_get_string illumos_nvpair_get_string +#define nvpair_header_size illumos_nvpair_header_size +#define nvpair_insert illumos_nvpair_insert +#define nvpair_move_binary illumos_nvpair_move_binary +#define nvpair_move_descriptor illumos_nvpair_move_descriptor +#define nvpair_move_nvlist illumos_nvpair_move_nvlist +#define nvpair_move_string illumos_nvpair_move_string +#define nvpair_movef_binary illumos_nvpair_movef_binary +#define nvpair_movef_descriptor illumos_nvpair_movef_descriptor +#define nvpair_movef_nvlist illumos_nvpair_movef_nvlist +#define nvpair_movef_string illumos_nvpair_movef_string +#define nvpair_movev_binary illumos_nvpair_movev_binary +#define nvpair_movev_descriptor illumos_nvpair_movev_descriptor +#define nvpair_movev_nvlist illumos_nvpair_movev_nvlist +#define nvpair_movev_string illumos_nvpair_movev_string +#define nvpair_name illumos_nvpair_name +#define nvpair_next illumos_nvpair_next +#define nvpair_nvlist illumos_nvpair_nvlist +#define nvpair_pack illumos_nvpair_pack +#define nvpair_pack_descriptor illumos_nvpair_pack_descriptor +#define nvpair_prev illumos_nvpair_prev +#define nvpair_remove illumos_nvpair_remove +#define nvpair_size illumos_nvpair_size +#define nvpair_type illumos_nvpair_type +#define nvpair_type_string illumos_nvpair_type_string +#define nvpair_unpack illumos_nvpair_unpack +#define nvpair_unpack_descriptor illumos_nvpair_unpack_descriptor + +#include_next + +#endif From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:22:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24F6613C; Sun, 1 Mar 2015 00:22:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EAE5ECF; Sun, 1 Mar 2015 00:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210MtWW083912; Sun, 1 Mar 2015 00:22:55 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210MrC3083899; Sun, 1 Mar 2015 00:22:53 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010022.t210MrC3083899@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279438 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:22:55 -0000 Author: rstone Date: Sun Mar 1 00:22:53 2015 New Revision: 279438 URL: https://svnweb.freebsd.org/changeset/base/279438 Log: Add macros to make code compile in kernel Make it possible to compile libnv in the kernel. Mostly this involves wrapping functions that have a different signature in the kernel and in userland (e.g. malloc()) in a macro that will conditionally expand to the right API depending on whether the code is being compiled for the kernel or not. I have also #ifdef'ed out all of file descriptor-handling code, as well as the unsafe varargs functions. Differential Revision: https://reviews.freebsd.org/D1882 Reviewed by: jfv MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/lib/libnv/dnv.h head/lib/libnv/dnvlist.c head/lib/libnv/nv.h head/lib/libnv/nv_impl.h head/lib/libnv/nvlist.c head/lib/libnv/nvlist_impl.h head/lib/libnv/nvpair.c head/lib/libnv/nvpair_impl.h Modified: head/lib/libnv/dnv.h ============================================================================== --- head/lib/libnv/dnv.h Sun Mar 1 00:22:45 2015 (r279437) +++ head/lib/libnv/dnv.h Sun Mar 1 00:22:53 2015 (r279438) @@ -34,9 +34,11 @@ #include +#ifndef _KERNEL #include #include #include +#endif #ifndef _NVLIST_T_DECLARED #define _NVLIST_T_DECLARED @@ -62,6 +64,7 @@ const nvlist_t *dnvlist_get_nvlist(const int dnvlist_get_descriptor(const nvlist_t *nvl, const char *name, int defval); const void *dnvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep, const void *defval, size_t defsize); +#ifndef _KERNEL bool dnvlist_getf_bool(const nvlist_t *nvl, bool defval, const char *namefmt, ...) __printflike(3, 4); uint64_t dnvlist_getf_number(const nvlist_t *nvl, uint64_t defval, const char *namefmt, ...) __printflike(3, 4); const char *dnvlist_getf_string(const nvlist_t *nvl, const char *defval, const char *namefmt, ...) __printflike(3, 4); @@ -75,6 +78,7 @@ const char *dnvlist_getv_string(const nv const nvlist_t *dnvlist_getv_nvlist(const nvlist_t *nvl, const nvlist_t *defval, const char *namefmt, va_list nameap) __printflike(3, 0); int dnvlist_getv_descriptor(const nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0); const void *dnvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0); +#endif /* * The dnvlist_take functions returns value associated with the given name and @@ -91,6 +95,7 @@ nvlist_t *dnvlist_take_nvlist(nvlist_t * int dnvlist_take_descriptor(nvlist_t *nvl, const char *name, int defval); void *dnvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep, void *defval, size_t defsize); +#ifndef _KERNEL bool dnvlist_takef_bool(nvlist_t *nvl, bool defval, const char *namefmt, ...) __printflike(3, 4); uint64_t dnvlist_takef_number(nvlist_t *nvl, uint64_t defval, const char *namefmt, ...) __printflike(3, 4); char *dnvlist_takef_string(nvlist_t *nvl, char *defval, const char *namefmt, ...) __printflike(3, 4); @@ -104,6 +109,7 @@ char *dnvlist_takev_string(nvlist_t *nvl nvlist_t *dnvlist_takev_nvlist(nvlist_t *nvl, nvlist_t *defval, const char *namefmt, va_list nameap) __printflike(3, 0); int dnvlist_takev_descriptor(nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0); void *dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0); +#endif __END_DECLS Modified: head/lib/libnv/dnvlist.c ============================================================================== --- head/lib/libnv/dnvlist.c Sun Mar 1 00:22:45 2015 (r279437) +++ head/lib/libnv/dnvlist.c Sun Mar 1 00:22:53 2015 (r279438) @@ -30,10 +30,22 @@ #include __FBSDID("$FreeBSD$"); +#ifdef _KERNEL + +#include +#include +#include +#include +#include + +#include + +#else #include #include #include #include +#endif #include "nv.h" #include "nv_impl.h" @@ -55,7 +67,9 @@ DNVLIST_GET(bool, bool) DNVLIST_GET(uint64_t, number) DNVLIST_GET(const char *, string) DNVLIST_GET(const nvlist_t *, nvlist) +#ifndef _KERNEL DNVLIST_GET(int, descriptor) +#endif #undef DNVLIST_GET @@ -75,6 +89,7 @@ dnvlist_get_binary(const nvlist_t *nvl, return (value); } +#ifndef _KERNEL #define DNVLIST_GETF(ftype, type) \ ftype \ dnvlist_getf_##type(const nvlist_t *nvl, ftype defval, \ @@ -144,10 +159,10 @@ dnvlist_getv_binary(const nvlist_t *nvl, char *name; const void *value; - vasprintf(&name, namefmt, nameap); + nv_vasprintf(&name, namefmt, nameap); if (name != NULL) { value = dnvlist_get_binary(nvl, name, sizep, defval, defsize); - free(name); + nv_free(name); } else { if (sizep != NULL) *sizep = defsize; @@ -155,6 +170,7 @@ dnvlist_getv_binary(const nvlist_t *nvl, } return (value); } +#endif #define DNVLIST_TAKE(ftype, type) \ ftype \ @@ -171,7 +187,9 @@ DNVLIST_TAKE(bool, bool) DNVLIST_TAKE(uint64_t, number) DNVLIST_TAKE(char *, string) DNVLIST_TAKE(nvlist_t *, nvlist) +#ifndef _KERNEL DNVLIST_TAKE(int, descriptor) +#endif #undef DNVLIST_TAKE @@ -191,6 +209,7 @@ dnvlist_take_binary(nvlist_t *nvl, const return (value); } +#ifndef _KERNEL #define DNVLIST_TAKEF(ftype, type) \ ftype \ dnvlist_takef_##type(nvlist_t *nvl, ftype defval, \ @@ -260,10 +279,10 @@ dnvlist_takev_binary(nvlist_t *nvl, size char *name; void *value; - vasprintf(&name, namefmt, nameap); + nv_vasprintf(&name, namefmt, nameap); if (name != NULL) { value = dnvlist_take_binary(nvl, name, sizep, defval, defsize); - free(name); + nv_free(name); } else { if (sizep != NULL) *sizep = defsize; @@ -272,3 +291,4 @@ dnvlist_takev_binary(nvlist_t *nvl, size return (value); } +#endif Modified: head/lib/libnv/nv.h ============================================================================== --- head/lib/libnv/nv.h Sun Mar 1 00:22:45 2015 (r279437) +++ head/lib/libnv/nv.h Sun Mar 1 00:22:53 2015 (r279438) @@ -34,10 +34,12 @@ #include +#ifndef _KERNEL #include #include #include #include +#endif #ifndef _NVLIST_T_DECLARED #define _NVLIST_T_DECLARED @@ -63,6 +65,10 @@ typedef struct nvlist nvlist_t; */ #define NV_FLAG_IGNORE_CASE 0x01 +#if defined(_KERNEL) && defined(MALLOC_DECLARE) +MALLOC_DECLARE(M_NVLIST); +#endif + __BEGIN_DECLS nvlist_t *nvlist_create(int flags); @@ -73,8 +79,10 @@ void nvlist_set_error(nvlist_t *nvl, i nvlist_t *nvlist_clone(const nvlist_t *nvl); +#ifndef _KERNEL void nvlist_dump(const nvlist_t *nvl, int fd); void nvlist_fdump(const nvlist_t *nvl, FILE *fp); +#endif size_t nvlist_size(const nvlist_t *nvl); void *nvlist_pack(const nvlist_t *nvl, size_t *sizep); @@ -101,7 +109,9 @@ bool nvlist_exists_bool(const nvlist_t * bool nvlist_exists_number(const nvlist_t *nvl, const char *name); bool nvlist_exists_string(const nvlist_t *nvl, const char *name); bool nvlist_exists_nvlist(const nvlist_t *nvl, const char *name); +#ifndef _KERNEL bool nvlist_exists_descriptor(const nvlist_t *nvl, const char *name); +#endif bool nvlist_exists_binary(const nvlist_t *nvl, const char *name); /* @@ -115,9 +125,13 @@ void nvlist_add_bool(nvlist_t *nvl, cons void nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value); void nvlist_add_string(nvlist_t *nvl, const char *name, const char *value); void nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...) __printflike(3, 4); +#ifdef _VA_LIST_DECLARED void nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt, va_list valueap) __printflike(3, 0); +#endif void nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value); +#ifndef _KERNEL void nvlist_add_descriptor(nvlist_t *nvl, const char *name, int value); +#endif void nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value, size_t size); /* @@ -127,7 +141,9 @@ void nvlist_add_binary(nvlist_t *nvl, co void nvlist_move_string(nvlist_t *nvl, const char *name, char *value); void nvlist_move_nvlist(nvlist_t *nvl, const char *name, nvlist_t *value); +#ifndef _KERNEL void nvlist_move_descriptor(nvlist_t *nvl, const char *name, int value); +#endif void nvlist_move_binary(nvlist_t *nvl, const char *name, void *value, size_t size); /* @@ -140,7 +156,9 @@ bool nvlist_get_bool(const nvlist_t *n uint64_t nvlist_get_number(const nvlist_t *nvl, const char *name); const char *nvlist_get_string(const nvlist_t *nvl, const char *name); const nvlist_t *nvlist_get_nvlist(const nvlist_t *nvl, const char *name); +#ifndef _KERNEL int nvlist_get_descriptor(const nvlist_t *nvl, const char *name); +#endif const void *nvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep); /* @@ -153,7 +171,9 @@ bool nvlist_take_bool(nvlist_t *nvl, c uint64_t nvlist_take_number(nvlist_t *nvl, const char *name); char *nvlist_take_string(nvlist_t *nvl, const char *name); nvlist_t *nvlist_take_nvlist(nvlist_t *nvl, const char *name); +#ifndef _KERNEL int nvlist_take_descriptor(nvlist_t *nvl, const char *name); +#endif void *nvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep); /* @@ -169,14 +189,21 @@ void nvlist_free_bool(nvlist_t *nvl, con void nvlist_free_number(nvlist_t *nvl, const char *name); void nvlist_free_string(nvlist_t *nvl, const char *name); void nvlist_free_nvlist(nvlist_t *nvl, const char *name); +#ifndef _KERNEL void nvlist_free_descriptor(nvlist_t *nvl, const char *name); +#endif void nvlist_free_binary(nvlist_t *nvl, const char *name); /* * Below are the same functions, but which operate on format strings and * variable argument lists. + * + * Functions that are not inserting a new pair into the nvlist cannot handle + * a failure to allocate the memory to hold the new name. Therefore these + * functions are not provided in the kernel. */ +#ifndef _KERNEL bool nvlist_existsf(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); bool nvlist_existsf_type(const nvlist_t *nvl, int type, const char *namefmt, ...) __printflike(3, 4); @@ -198,33 +225,47 @@ bool nvlist_existsv_string(const nvlist_ bool nvlist_existsv_nvlist(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); bool nvlist_existsv_descriptor(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); bool nvlist_existsv_binary(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +#endif void nvlist_addf_null(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); void nvlist_addf_bool(nvlist_t *nvl, bool value, const char *namefmt, ...) __printflike(3, 4); void nvlist_addf_number(nvlist_t *nvl, uint64_t value, const char *namefmt, ...) __printflike(3, 4); void nvlist_addf_string(nvlist_t *nvl, const char *value, const char *namefmt, ...) __printflike(3, 4); void nvlist_addf_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt, ...) __printflike(3, 4); +#ifndef _KERNEL void nvlist_addf_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) __printflike(3, 4); +#endif void nvlist_addf_binary(nvlist_t *nvl, const void *value, size_t size, const char *namefmt, ...) __printflike(4, 5); +#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED) void nvlist_addv_null(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); void nvlist_addv_bool(nvlist_t *nvl, bool value, const char *namefmt, va_list nameap) __printflike(3, 0); void nvlist_addv_number(nvlist_t *nvl, uint64_t value, const char *namefmt, va_list nameap) __printflike(3, 0); void nvlist_addv_string(nvlist_t *nvl, const char *value, const char *namefmt, va_list nameap) __printflike(3, 0); void nvlist_addv_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt, va_list nameap) __printflike(3, 0); +#ifndef _KERNEL void nvlist_addv_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) __printflike(3, 0); +#endif void nvlist_addv_binary(nvlist_t *nvl, const void *value, size_t size, const char *namefmt, va_list nameap) __printflike(4, 0); +#endif void nvlist_movef_string(nvlist_t *nvl, char *value, const char *namefmt, ...) __printflike(3, 4); void nvlist_movef_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt, ...) __printflike(3, 4); +#ifndef _KERNEL void nvlist_movef_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) __printflike(3, 4); +#endif void nvlist_movef_binary(nvlist_t *nvl, void *value, size_t size, const char *namefmt, ...) __printflike(4, 5); +#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED) void nvlist_movev_string(nvlist_t *nvl, char *value, const char *namefmt, va_list nameap) __printflike(3, 0); void nvlist_movev_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt, va_list nameap) __printflike(3, 0); +#ifndef _KERNEL void nvlist_movev_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) __printflike(3, 0); +#endif void nvlist_movev_binary(nvlist_t *nvl, void *value, size_t size, const char *namefmt, va_list nameap) __printflike(4, 0); +#endif +#ifndef _KERNEL bool nvlist_getf_bool(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); uint64_t nvlist_getf_number(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); const char *nvlist_getf_string(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); @@ -274,6 +315,7 @@ void nvlist_freev_string(nvlist_t *nvl, void nvlist_freev_nvlist(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); void nvlist_freev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); void nvlist_freev_binary(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +#endif /* _KERNEL */ __END_DECLS Modified: head/lib/libnv/nv_impl.h ============================================================================== --- head/lib/libnv/nv_impl.h Sun Mar 1 00:22:45 2015 (r279437) +++ head/lib/libnv/nv_impl.h Sun Mar 1 00:22:53 2015 (r279438) @@ -46,6 +46,37 @@ typedef struct nvpair nvpair_t; #define NV_FLAG_BIG_ENDIAN 0x80 +#ifdef _KERNEL +#define nv_malloc(size) malloc((size), M_NVLIST, M_NOWAIT) +#define nv_calloc(n, size) malloc((n) * (size), M_NVLIST, \ + M_NOWAIT | M_ZERO) +#define nv_realloc(buf, size) realloc((buf), (size), M_NVLIST, \ + M_NOWAIT) +#define nv_free(buf) free((buf), M_NVLIST) +#define nv_strdup(buf) strdup((buf), M_NVLIST) +#define nv_vasprintf(ptr, ...) vasprintf(ptr, M_NVLIST, __VA_ARGS__) + +#define SAVE_ERRNO(var) ((void)(var)) +#define RESTORE_ERRNO(var) ((void)(var)) + +#define ERRNO_OR_DEFAULT(default) (default) + +#else + +#define nv_malloc(size) malloc((size)) +#define nv_calloc(n, size) calloc((n), (size)) +#define nv_realloc(buf, size) realloc((buf), (size)) +#define nv_free(buf) free((buf)) +#define nv_strdup(buf) strdup((buf)) +#define nv_vasprintf(ptr, ...) vasprintf(ptr, __VA_ARGS__) + +#define SAVE_ERRNO(var) (var) = errno +#define RESTORE_ERRNO(var) errno = (var) + +#define ERRNO_OR_DEFAULT(default) (errno == 0 ? (default) : errno) + +#endif + int *nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp); size_t nvlist_ndescriptors(const nvlist_t *nvl); Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Sun Mar 1 00:22:45 2015 (r279437) +++ head/lib/libnv/nvlist.c Sun Mar 1 00:22:53 2015 (r279438) @@ -33,6 +33,18 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef _KERNEL + +#include +#include +#include +#include +#include + +#include + +#else #include #include @@ -44,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#endif #ifdef HAVE_PJDLOG #include @@ -56,6 +69,11 @@ __FBSDID("$FreeBSD$"); #include "nvpair_impl.h" #ifndef HAVE_PJDLOG +#ifdef _KERNEL +#define PJDLOG_ASSERT(...) MPASS(__VA_ARGS__) +#define PJDLOG_RASSERT(expr, ...) KASSERT(expr, (__VA_ARGS__)) +#define PJDLOG_ABORT(...) panic(__VA_ARGS__) +#else #include #define PJDLOG_ASSERT(...) assert(__VA_ARGS__) #define PJDLOG_RASSERT(expr, ...) assert(expr) @@ -66,6 +84,7 @@ __FBSDID("$FreeBSD$"); abort(); \ } while (0) #endif +#endif #define NV_FLAG_PRIVATE_MASK (NV_FLAG_BIG_ENDIAN) #define NV_FLAG_PUBLIC_MASK (NV_FLAG_IGNORE_CASE) @@ -85,6 +104,10 @@ struct nvlist { PJDLOG_ASSERT((nvl)->nvl_magic == NVLIST_MAGIC); \ } while (0) +#ifdef _KERNEL +MALLOC_DEFINE(M_NVLIST, "nvlist", "kernel nvlist"); +#endif + #define NVPAIR_ASSERT(nvp) nvpair_assert(nvp) #define NVLIST_HEADER_MAGIC 0x6c @@ -104,7 +127,7 @@ nvlist_create(int flags) PJDLOG_ASSERT((flags & ~(NV_FLAG_PUBLIC_MASK)) == 0); - nvl = malloc(sizeof(*nvl)); + nvl = nv_malloc(sizeof(*nvl)); nvl->nvl_error = 0; nvl->nvl_flags = flags; nvl->nvl_parent = NULL; @@ -123,7 +146,7 @@ nvlist_destroy(nvlist_t *nvl) if (nvl == NULL) return; - serrno = errno; + SAVE_ERRNO(serrno); NVLIST_ASSERT(nvl); @@ -132,9 +155,9 @@ nvlist_destroy(nvlist_t *nvl) nvpair_free(nvp); } nvl->nvl_magic = 0; - free(nvl); + nv_free(nvl); - errno = serrno; + RESTORE_ERRNO(serrno); } void @@ -240,7 +263,7 @@ nvlist_find(const nvlist_t *nvl, int typ } if (nvp == NULL) - errno = ENOENT; + RESTORE_ERRNO(ENOENT); return (nvp); } @@ -257,6 +280,7 @@ nvlist_exists_type(const nvlist_t *nvl, return (nvlist_find(nvl, type, name) != NULL); } +#ifndef _KERNEL bool nvlist_existsf_type(const nvlist_t *nvl, int type, const char *namefmt, ...) { @@ -277,14 +301,15 @@ nvlist_existsv_type(const nvlist_t *nvl, char *name; bool exists; - vasprintf(&name, namefmt, nameap); + nv_vasprintf(&name, namefmt, nameap); if (name == NULL) return (false); exists = nvlist_exists_type(nvl, name, type); - free(name); + nv_free(name); return (exists); } +#endif void nvlist_free_type(nvlist_t *nvl, const char *name, int type) @@ -303,6 +328,7 @@ nvlist_free_type(nvlist_t *nvl, const ch nvlist_report_missing(type, name); } +#ifndef _KERNEL void nvlist_freef_type(nvlist_t *nvl, int type, const char *namefmt, ...) { @@ -318,12 +344,13 @@ nvlist_freev_type(nvlist_t *nvl, int typ { char *name; - vasprintf(&name, namefmt, nameap); + nv_vasprintf(&name, namefmt, nameap); if (name == NULL) nvlist_report_missing(type, ""); nvlist_free_type(nvl, name, type); - free(name); + nv_free(name); } +#endif nvlist_t * nvlist_clone(const nvlist_t *nvl) @@ -334,7 +361,7 @@ nvlist_clone(const nvlist_t *nvl) NVLIST_ASSERT(nvl); if (nvl->nvl_error != 0) { - errno = nvl->nvl_error; + RESTORE_ERRNO(nvl->nvl_error); return (NULL); } @@ -353,6 +380,7 @@ nvlist_clone(const nvlist_t *nvl) return (newnvl); } +#ifndef _KERNEL static bool nvlist_dump_error_check(const nvlist_t *nvl, int fd, int level) { @@ -453,6 +481,7 @@ nvlist_fdump(const nvlist_t *nvl, FILE * fflush(fp); nvlist_dump(nvl, fileno(fp)); } +#endif /* * The function obtains size of the nvlist after nvlist_pack(). @@ -501,6 +530,7 @@ out: return (size); } +#ifndef _KERNEL static int * nvlist_xdescriptors(const nvlist_t *nvl, int *descs, int level) { @@ -526,7 +556,9 @@ nvlist_xdescriptors(const nvlist_t *nvl, return (descs); } +#endif +#ifndef _KERNEL int * nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) { @@ -534,7 +566,7 @@ nvlist_descriptors(const nvlist_t *nvl, int *fds; nitems = nvlist_ndescriptors(nvl); - fds = malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); if (fds == NULL) return (NULL); if (nitems > 0) @@ -544,10 +576,12 @@ nvlist_descriptors(const nvlist_t *nvl, *nitemsp = nitems; return (fds); } +#endif static size_t nvlist_xndescriptors(const nvlist_t *nvl, int level) { +#ifndef _KERNEL const nvpair_t *nvp; size_t ndescs; @@ -570,6 +604,9 @@ nvlist_xndescriptors(const nvlist_t *nvl } return (ndescs); +#else + return (0); +#endif } size_t @@ -614,12 +651,12 @@ nvlist_xpack(const nvlist_t *nvl, int64_ NVLIST_ASSERT(nvl); if (nvl->nvl_error != 0) { - errno = nvl->nvl_error; + RESTORE_ERRNO(nvl->nvl_error); return (NULL); } size = nvlist_size(nvl); - buf = malloc(size); + buf = nv_malloc(size); if (buf == NULL) return (NULL); @@ -635,7 +672,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_ nvpair_init_datasize(nvp); ptr = nvpair_pack_header(nvp, ptr, &left); if (ptr == NULL) { - free(buf); + nv_free(buf); return (NULL); } switch (nvpair_type(nvp)) { @@ -664,9 +701,11 @@ nvlist_xpack(const nvlist_t *nvl, int64_ } ptr = nvpair_pack_nvlist_up(ptr, &left); break; +#ifndef _KERNEL case NV_TYPE_DESCRIPTOR: ptr = nvpair_pack_descriptor(nvp, ptr, fdidxp, &left); break; +#endif case NV_TYPE_BINARY: ptr = nvpair_pack_binary(nvp, ptr, &left); break; @@ -674,7 +713,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_ PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp)); } if (ptr == NULL) { - free(buf); + nv_free(buf); return (NULL); } while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { @@ -702,12 +741,12 @@ nvlist_pack(const nvlist_t *nvl, size_t NVLIST_ASSERT(nvl); if (nvl->nvl_error != 0) { - errno = nvl->nvl_error; + RESTORE_ERRNO(nvl->nvl_error); return (NULL); } if (nvlist_ndescriptors(nvl) > 0) { - errno = EOPNOTSUPP; + RESTORE_ERRNO(EOPNOTSUPP); return (NULL); } @@ -719,11 +758,11 @@ nvlist_check_header(struct nvlist_header { if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { - errno = EINVAL; + RESTORE_ERRNO(EINVAL); return (false); } if ((nvlhdrp->nvlh_flags & ~NV_FLAG_ALL_MASK) != 0) { - errno = EINVAL; + RESTORE_ERRNO(EINVAL); return (false); } #if BYTE_ORDER == BIG_ENDIAN @@ -775,7 +814,7 @@ nvlist_unpack_header(nvlist_t *nvl, cons return (ptr); failed: - errno = EINVAL; + RESTORE_ERRNO(EINVAL); return (NULL); } @@ -822,10 +861,12 @@ nvlist_xunpack(const void *buf, size_t s &tmpnvl); nvlist_set_parent(tmpnvl, nvp); break; +#ifndef _KERNEL case NV_TYPE_DESCRIPTOR: ptr = nvpair_unpack_descriptor(isbe, nvp, ptr, &left, fds, nfds); break; +#endif case NV_TYPE_BINARY: ptr = nvpair_unpack_binary(isbe, nvp, ptr, &left); break; @@ -859,6 +900,7 @@ nvlist_unpack(const void *buf, size_t si return (nvlist_xunpack(buf, size, NULL, 0)); } +#ifndef _KERNEL int nvlist_send(int sock, const nvlist_t *nvl) { @@ -968,6 +1010,7 @@ nvlist_xfer(int sock, nvlist_t *nvl) nvlist_destroy(nvl); return (nvlist_recv(sock)); } +#endif nvpair_t * nvlist_first_nvpair(const nvlist_t *nvl) @@ -1049,11 +1092,14 @@ NVLIST_EXISTS(bool, BOOL) NVLIST_EXISTS(number, NUMBER) NVLIST_EXISTS(string, STRING) NVLIST_EXISTS(nvlist, NVLIST) +#ifndef _KERNEL NVLIST_EXISTS(descriptor, DESCRIPTOR) +#endif NVLIST_EXISTS(binary, BINARY) #undef NVLIST_EXISTS +#ifndef _KERNEL bool nvlist_existsf(const nvlist_t *nvl, const char *namefmt, ...) { @@ -1084,7 +1130,9 @@ NVLIST_EXISTSF(bool) NVLIST_EXISTSF(number) NVLIST_EXISTSF(string) NVLIST_EXISTSF(nvlist) +#ifndef _KERNEL NVLIST_EXISTSF(descriptor) +#endif NVLIST_EXISTSF(binary) #undef NVLIST_EXISTSF @@ -1095,12 +1143,12 @@ nvlist_existsv(const nvlist_t *nvl, cons char *name; bool exists; - vasprintf(&name, namefmt, nameap); + nv_vasprintf(&name, namefmt, nameap); if (name == NULL) return (false); exists = nvlist_exists(nvl, name); - free(name); + nv_free(name); return (exists); } @@ -1129,6 +1177,7 @@ NVLIST_EXISTSV(descriptor) NVLIST_EXISTSV(binary) #undef NVLIST_EXISTSV +#endif void nvlist_add_nvpair(nvlist_t *nvl, const nvpair_t *nvp) @@ -1138,17 +1187,19 @@ nvlist_add_nvpair(nvlist_t *nvl, const n NVPAIR_ASSERT(nvp); if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } if (nvlist_exists(nvl, nvpair_name(nvp))) { - nvl->nvl_error = errno = EEXIST; + nvl->nvl_error = EEXIST; + RESTORE_ERRNO(nvlist_error(nvl)); return; } newnvp = nvpair_clone(nvp); if (newnvp == NULL) { - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvlist_error(nvl)); return; } @@ -1200,14 +1251,15 @@ nvlist_add_stringv(nvlist_t *nvl, const nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_create_stringv(name, valuefmt, valueap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } @@ -1218,12 +1270,14 @@ nvlist_add_nvlist(nvlist_t *nvl, const c nvlist_addf_nvlist(nvl, value, "%s", name); } +#ifndef _KERNEL void nvlist_add_descriptor(nvlist_t *nvl, const char *name, int value) { nvlist_addf_descriptor(nvl, value, "%s", name); } +#endif void nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value, @@ -1284,6 +1338,7 @@ nvlist_addf_nvlist(nvlist_t *nvl, const va_end(nameap); } +#ifndef _KERNEL void nvlist_addf_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) { @@ -1293,6 +1348,7 @@ nvlist_addf_descriptor(nvlist_t *nvl, in nvlist_addv_descriptor(nvl, value, namefmt, nameap); va_end(nameap); } +#endif void nvlist_addf_binary(nvlist_t *nvl, const void *value, size_t size, @@ -1311,14 +1367,15 @@ nvlist_addv_null(nvlist_t *nvl, const ch nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_createv_null(namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } @@ -1328,14 +1385,15 @@ nvlist_addv_bool(nvlist_t *nvl, bool val nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_createv_bool(value, namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } @@ -1346,14 +1404,15 @@ nvlist_addv_number(nvlist_t *nvl, uint64 nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_createv_number(value, namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } @@ -1364,14 +1423,15 @@ nvlist_addv_string(nvlist_t *nvl, const nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_createv_string(value, namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } @@ -1382,17 +1442,19 @@ nvlist_addv_nvlist(nvlist_t *nvl, const nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_createv_nvlist(value, namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } +#ifndef _KERNEL void nvlist_addv_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) @@ -1410,6 +1472,7 @@ nvlist_addv_descriptor(nvlist_t *nvl, in else nvlist_move_nvpair(nvl, nvp); } +#endif void nvlist_addv_binary(nvlist_t *nvl, const void *value, size_t size, @@ -1418,14 +1481,15 @@ nvlist_addv_binary(nvlist_t *nvl, const nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_createv_binary(value, size, namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else nvlist_move_nvpair(nvl, nvp); } @@ -1438,12 +1502,13 @@ nvlist_move_nvpair(nvlist_t *nvl, nvpair if (nvlist_error(nvl) != 0) { nvpair_free(nvp); - errno = nvlist_error(nvl); + RESTORE_ERRNO(nvlist_error(nvl)); return; } if (nvlist_exists(nvl, nvpair_name(nvp))) { nvpair_free(nvp); - nvl->nvl_error = errno = EEXIST; + nvl->nvl_error = EEXIST; + RESTORE_ERRNO(nvl->nvl_error); return; } @@ -1460,7 +1525,9 @@ nvlist_move_##type(nvlist_t *nvl, const NVLIST_MOVE(char *, string) NVLIST_MOVE(nvlist_t *, nvlist) +#ifndef _KERNEL NVLIST_MOVE(int, descriptor) +#endif #undef NVLIST_MOVE @@ -1485,7 +1552,9 @@ nvlist_movef_##type(nvlist_t *nvl, vtype NVLIST_MOVEF(char *, string) NVLIST_MOVEF(nvlist_t *, nvlist) +#ifndef _KERNEL NVLIST_MOVEF(int, descriptor) +#endif #undef NVLIST_MOVEF @@ -1507,15 +1576,16 @@ nvlist_movev_string(nvlist_t *nvl, char nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - free(value); - errno = nvlist_error(nvl); + nv_free(value); + RESTORE_ERRNO(nvlist_error(nvl)); return; } nvp = nvpair_movev_string(value, namefmt, nameap); - if (nvp == NULL) - nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM); - else + if (nvp == NULL) { + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); + RESTORE_ERRNO(nvl->nvl_error); + } else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:34:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8A1EAB7; Sun, 1 Mar 2015 00:34:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0B4A105; Sun, 1 Mar 2015 00:34:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210YUq2089159; Sun, 1 Mar 2015 00:34:30 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210YSe3089143; Sun, 1 Mar 2015 00:34:28 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010034.t210YSe3089143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279439 - in head: lib/libnv sys/conf sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:34:30 -0000 Author: rstone Date: Sun Mar 1 00:34:27 2015 New Revision: 279439 URL: https://svnweb.freebsd.org/changeset/base/279439 Log: Move libnv into the kernel and hook it into the kernel build Differential Revision: https://reviews.freebsd.org/D1883 Reviewed by: jfv MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/sys/kern/subr_dnvlist.c - copied, changed from r279438, head/lib/libnv/dnvlist.c head/sys/kern/subr_nvlist.c - copied, changed from r279438, head/lib/libnv/nvlist.c head/sys/kern/subr_nvpair.c - copied, changed from r279438, head/lib/libnv/nvpair.c head/sys/sys/dnv.h - copied unchanged from r279438, head/lib/libnv/dnv.h head/sys/sys/nv.h - copied unchanged from r279438, head/lib/libnv/nv.h head/sys/sys/nv_impl.h - copied unchanged from r279438, head/lib/libnv/nv_impl.h head/sys/sys/nvlist_impl.h - copied unchanged from r279438, head/lib/libnv/nvlist_impl.h head/sys/sys/nvpair_impl.h - copied unchanged from r279438, head/lib/libnv/nvpair_impl.h Deleted: head/lib/libnv/dnv.h head/lib/libnv/dnvlist.c head/lib/libnv/nv.h head/lib/libnv/nv_impl.h head/lib/libnv/nvlist.c head/lib/libnv/nvlist_impl.h head/lib/libnv/nvpair.c head/lib/libnv/nvpair_impl.h Modified: head/lib/libnv/Makefile head/sys/conf/files Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Sun Mar 1 00:22:53 2015 (r279438) +++ head/lib/libnv/Makefile Sun Mar 1 00:34:27 2015 (r279439) @@ -7,10 +7,13 @@ SHLIBDIR?= /lib LIB= nv SHLIB_MAJOR= 0 -SRCS= dnvlist.c +.PATH: ${.CURDIR}/../../sys/kern ${.CURDIR}/../../sys/sys +CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR} + +SRCS= subr_dnvlist.c SRCS+= msgio.c -SRCS+= nvlist.c -SRCS+= nvpair.c +SRCS+= subr_nvlist.c +SRCS+= subr_nvpair.c INCS= dnv.h INCS+= nv.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 1 00:22:53 2015 (r279438) +++ head/sys/conf/files Sun Mar 1 00:34:27 2015 (r279439) @@ -3076,6 +3076,7 @@ kern/subr_clock.c standard kern/subr_counter.c standard kern/subr_devstat.c standard kern/subr_disk.c standard +kern/subr_dnvlist.c standard kern/subr_eventhandler.c standard kern/subr_fattime.c standard kern/subr_firmware.c optional firmware @@ -3089,6 +3090,8 @@ kern/subr_mbpool.c optional libmbpool kern/subr_mchain.c optional libmchain kern/subr_module.c standard kern/subr_msgbuf.c standard +kern/subr_nvlist.c standard +kern/subr_nvpair.c standard kern/subr_param.c standard kern/subr_pcpu.c standard kern/subr_pctrie.c standard Copied and modified: head/sys/kern/subr_dnvlist.c (from r279438, head/lib/libnv/dnvlist.c) ============================================================================== --- head/lib/libnv/dnvlist.c Sun Mar 1 00:22:53 2015 (r279438, copy source) +++ head/sys/kern/subr_dnvlist.c Sun Mar 1 00:34:27 2015 (r279439) @@ -47,10 +47,10 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "nv.h" -#include "nv_impl.h" +#include +#include -#include "dnv.h" +#include #define DNVLIST_GET(ftype, type) \ ftype \ Copied and modified: head/sys/kern/subr_nvlist.c (from r279438, head/lib/libnv/nvlist.c) ============================================================================== --- head/lib/libnv/nvlist.c Sun Mar 1 00:22:53 2015 (r279438, copy source) +++ head/sys/kern/subr_nvlist.c Sun Mar 1 00:34:27 2015 (r279439) @@ -56,17 +56,18 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include "msgio.h" #endif #ifdef HAVE_PJDLOG #include #endif -#include "msgio.h" -#include "nv.h" -#include "nv_impl.h" -#include "nvlist_impl.h" -#include "nvpair_impl.h" +#include +#include +#include +#include #ifndef HAVE_PJDLOG #ifdef _KERNEL Copied and modified: head/sys/kern/subr_nvpair.c (from r279438, head/lib/libnv/nvpair.c) ============================================================================== --- head/lib/libnv/nvpair.c Sun Mar 1 00:22:53 2015 (r279438, copy source) +++ head/sys/kern/subr_nvpair.c Sun Mar 1 00:34:27 2015 (r279439) @@ -52,17 +52,18 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include "common_impl.h" #endif #ifdef HAVE_PJDLOG #include #endif -#include "common_impl.h" -#include "nv.h" -#include "nv_impl.h" -#include "nvlist_impl.h" -#include "nvpair_impl.h" +#include +#include +#include +#include #ifndef HAVE_PJDLOG #ifdef _KERNEL Copied: head/sys/sys/dnv.h (from r279438, head/lib/libnv/dnv.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/dnv.h Sun Mar 1 00:34:27 2015 (r279439, copy of r279438, head/lib/libnv/dnv.h) @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DNV_H_ +#define _DNV_H_ + +#include + +#ifndef _KERNEL +#include +#include +#include +#endif + +#ifndef _NVLIST_T_DECLARED +#define _NVLIST_T_DECLARED +struct nvlist; + +typedef struct nvlist nvlist_t; +#endif + +__BEGIN_DECLS + +/* + * The dnvlist_get functions returns value associated with the given name. + * If it returns a pointer, the pointer represents internal buffer and should + * not be freed by the caller. + * If no element of the given name and type exists, the function will return + * provided default value. + */ + +bool dnvlist_get_bool(const nvlist_t *nvl, const char *name, bool defval); +uint64_t dnvlist_get_number(const nvlist_t *nvl, const char *name, uint64_t defval); +const char *dnvlist_get_string(const nvlist_t *nvl, const char *name, const char *defval); +const nvlist_t *dnvlist_get_nvlist(const nvlist_t *nvl, const char *name, const nvlist_t *defval); +int dnvlist_get_descriptor(const nvlist_t *nvl, const char *name, int defval); +const void *dnvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep, const void *defval, size_t defsize); + +#ifndef _KERNEL +bool dnvlist_getf_bool(const nvlist_t *nvl, bool defval, const char *namefmt, ...) __printflike(3, 4); +uint64_t dnvlist_getf_number(const nvlist_t *nvl, uint64_t defval, const char *namefmt, ...) __printflike(3, 4); +const char *dnvlist_getf_string(const nvlist_t *nvl, const char *defval, const char *namefmt, ...) __printflike(3, 4); +const nvlist_t *dnvlist_getf_nvlist(const nvlist_t *nvl, const nvlist_t *defval, const char *namefmt, ...) __printflike(3, 4); +int dnvlist_getf_descriptor(const nvlist_t *nvl, int defval, const char *namefmt, ...) __printflike(3, 4); +const void *dnvlist_getf_binary(const nvlist_t *nvl, size_t *sizep, const void *defval, size_t defsize, const char *namefmt, ...) __printflike(5, 6); + +bool dnvlist_getv_bool(const nvlist_t *nvl, bool defval, const char *namefmt, va_list nameap) __printflike(3, 0); +uint64_t dnvlist_getv_number(const nvlist_t *nvl, uint64_t defval, const char *namefmt, va_list nameap) __printflike(3, 0); +const char *dnvlist_getv_string(const nvlist_t *nvl, const char *defval, const char *namefmt, va_list nameap) __printflike(3, 0); +const nvlist_t *dnvlist_getv_nvlist(const nvlist_t *nvl, const nvlist_t *defval, const char *namefmt, va_list nameap) __printflike(3, 0); +int dnvlist_getv_descriptor(const nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0); +const void *dnvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0); +#endif + +/* + * The dnvlist_take functions returns value associated with the given name and + * remove corresponding nvpair. + * If it returns a pointer, the caller has to free it. + * If no element of the given name and type exists, the function will return + * provided default value. + */ + +bool dnvlist_take_bool(nvlist_t *nvl, const char *name, bool defval); +uint64_t dnvlist_take_number(nvlist_t *nvl, const char *name, uint64_t defval); +char *dnvlist_take_string(nvlist_t *nvl, const char *name, char *defval); +nvlist_t *dnvlist_take_nvlist(nvlist_t *nvl, const char *name, nvlist_t *defval); +int dnvlist_take_descriptor(nvlist_t *nvl, const char *name, int defval); +void *dnvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep, void *defval, size_t defsize); + +#ifndef _KERNEL +bool dnvlist_takef_bool(nvlist_t *nvl, bool defval, const char *namefmt, ...) __printflike(3, 4); +uint64_t dnvlist_takef_number(nvlist_t *nvl, uint64_t defval, const char *namefmt, ...) __printflike(3, 4); +char *dnvlist_takef_string(nvlist_t *nvl, char *defval, const char *namefmt, ...) __printflike(3, 4); +nvlist_t *dnvlist_takef_nvlist(nvlist_t *nvl, nvlist_t *defval, const char *namefmt, ...) __printflike(3, 4); +int dnvlist_takef_descriptor(nvlist_t *nvl, int defval, const char *namefmt, ...) __printflike(3, 4); +void *dnvlist_takef_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, ...) __printflike(5, 6); + +bool dnvlist_takev_bool(nvlist_t *nvl, bool defval, const char *namefmt, va_list nameap) __printflike(3, 0); +uint64_t dnvlist_takev_number(nvlist_t *nvl, uint64_t defval, const char *namefmt, va_list nameap) __printflike(3, 0); +char *dnvlist_takev_string(nvlist_t *nvl, char *defval, const char *namefmt, va_list nameap) __printflike(3, 0); +nvlist_t *dnvlist_takev_nvlist(nvlist_t *nvl, nvlist_t *defval, const char *namefmt, va_list nameap) __printflike(3, 0); +int dnvlist_takev_descriptor(nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0); +void *dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0); +#endif + +__END_DECLS + +#endif /* !_DNV_H_ */ Copied: head/sys/sys/nv.h (from r279438, head/lib/libnv/nv.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/nv.h Sun Mar 1 00:34:27 2015 (r279439, copy of r279438, head/lib/libnv/nv.h) @@ -0,0 +1,322 @@ +/*- + * Copyright (c) 2009-2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NV_H_ +#define _NV_H_ + +#include + +#ifndef _KERNEL +#include +#include +#include +#include +#endif + +#ifndef _NVLIST_T_DECLARED +#define _NVLIST_T_DECLARED +struct nvlist; + +typedef struct nvlist nvlist_t; +#endif + +#define NV_NAME_MAX 2048 + +#define NV_TYPE_NONE 0 + +#define NV_TYPE_NULL 1 +#define NV_TYPE_BOOL 2 +#define NV_TYPE_NUMBER 3 +#define NV_TYPE_STRING 4 +#define NV_TYPE_NVLIST 5 +#define NV_TYPE_DESCRIPTOR 6 +#define NV_TYPE_BINARY 7 + +/* + * Perform case-insensitive lookups of provided names. + */ +#define NV_FLAG_IGNORE_CASE 0x01 + +#if defined(_KERNEL) && defined(MALLOC_DECLARE) +MALLOC_DECLARE(M_NVLIST); +#endif + +__BEGIN_DECLS + +nvlist_t *nvlist_create(int flags); +void nvlist_destroy(nvlist_t *nvl); +int nvlist_error(const nvlist_t *nvl); +bool nvlist_empty(const nvlist_t *nvl); +void nvlist_set_error(nvlist_t *nvl, int error); + +nvlist_t *nvlist_clone(const nvlist_t *nvl); + +#ifndef _KERNEL +void nvlist_dump(const nvlist_t *nvl, int fd); +void nvlist_fdump(const nvlist_t *nvl, FILE *fp); +#endif + +size_t nvlist_size(const nvlist_t *nvl); +void *nvlist_pack(const nvlist_t *nvl, size_t *sizep); +nvlist_t *nvlist_unpack(const void *buf, size_t size); + +int nvlist_send(int sock, const nvlist_t *nvl); +nvlist_t *nvlist_recv(int sock); +nvlist_t *nvlist_xfer(int sock, nvlist_t *nvl); + +const char *nvlist_next(const nvlist_t *nvl, int *typep, void **cookiep); + +const nvlist_t *nvlist_get_parent(const nvlist_t *nvl, void **cookiep); + +/* + * The nvlist_exists functions check if the given name (optionally of the given + * type) exists on nvlist. + */ + +bool nvlist_exists(const nvlist_t *nvl, const char *name); +bool nvlist_exists_type(const nvlist_t *nvl, const char *name, int type); + +bool nvlist_exists_null(const nvlist_t *nvl, const char *name); +bool nvlist_exists_bool(const nvlist_t *nvl, const char *name); +bool nvlist_exists_number(const nvlist_t *nvl, const char *name); +bool nvlist_exists_string(const nvlist_t *nvl, const char *name); +bool nvlist_exists_nvlist(const nvlist_t *nvl, const char *name); +#ifndef _KERNEL +bool nvlist_exists_descriptor(const nvlist_t *nvl, const char *name); +#endif +bool nvlist_exists_binary(const nvlist_t *nvl, const char *name); + +/* + * The nvlist_add functions add the given name/value pair. + * If a pointer is provided, nvlist_add will internally allocate memory for the + * given data (in other words it won't consume provided buffer). + */ + +void nvlist_add_null(nvlist_t *nvl, const char *name); +void nvlist_add_bool(nvlist_t *nvl, const char *name, bool value); +void nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value); +void nvlist_add_string(nvlist_t *nvl, const char *name, const char *value); +void nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...) __printflike(3, 4); +#ifdef _VA_LIST_DECLARED +void nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt, va_list valueap) __printflike(3, 0); +#endif +void nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value); +#ifndef _KERNEL +void nvlist_add_descriptor(nvlist_t *nvl, const char *name, int value); +#endif +void nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value, size_t size); + +/* + * The nvlist_move functions add the given name/value pair. + * The functions consumes provided buffer. + */ + +void nvlist_move_string(nvlist_t *nvl, const char *name, char *value); +void nvlist_move_nvlist(nvlist_t *nvl, const char *name, nvlist_t *value); +#ifndef _KERNEL +void nvlist_move_descriptor(nvlist_t *nvl, const char *name, int value); +#endif +void nvlist_move_binary(nvlist_t *nvl, const char *name, void *value, size_t size); + +/* + * The nvlist_get functions returns value associated with the given name. + * If it returns a pointer, the pointer represents internal buffer and should + * not be freed by the caller. + */ + +bool nvlist_get_bool(const nvlist_t *nvl, const char *name); +uint64_t nvlist_get_number(const nvlist_t *nvl, const char *name); +const char *nvlist_get_string(const nvlist_t *nvl, const char *name); +const nvlist_t *nvlist_get_nvlist(const nvlist_t *nvl, const char *name); +#ifndef _KERNEL +int nvlist_get_descriptor(const nvlist_t *nvl, const char *name); +#endif +const void *nvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep); + +/* + * The nvlist_take functions returns value associated with the given name and + * remove the given entry from the nvlist. + * The caller is responsible for freeing received data. + */ + +bool nvlist_take_bool(nvlist_t *nvl, const char *name); +uint64_t nvlist_take_number(nvlist_t *nvl, const char *name); +char *nvlist_take_string(nvlist_t *nvl, const char *name); +nvlist_t *nvlist_take_nvlist(nvlist_t *nvl, const char *name); +#ifndef _KERNEL +int nvlist_take_descriptor(nvlist_t *nvl, const char *name); +#endif +void *nvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep); + +/* + * The nvlist_free functions removes the given name/value pair from the nvlist + * and frees memory associated with it. + */ + +void nvlist_free(nvlist_t *nvl, const char *name); +void nvlist_free_type(nvlist_t *nvl, const char *name, int type); + +void nvlist_free_null(nvlist_t *nvl, const char *name); +void nvlist_free_bool(nvlist_t *nvl, const char *name); +void nvlist_free_number(nvlist_t *nvl, const char *name); +void nvlist_free_string(nvlist_t *nvl, const char *name); +void nvlist_free_nvlist(nvlist_t *nvl, const char *name); +#ifndef _KERNEL +void nvlist_free_descriptor(nvlist_t *nvl, const char *name); +#endif +void nvlist_free_binary(nvlist_t *nvl, const char *name); + +/* + * Below are the same functions, but which operate on format strings and + * variable argument lists. + * + * Functions that are not inserting a new pair into the nvlist cannot handle + * a failure to allocate the memory to hold the new name. Therefore these + * functions are not provided in the kernel. + */ + +#ifndef _KERNEL +bool nvlist_existsf(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_type(const nvlist_t *nvl, int type, const char *namefmt, ...) __printflike(3, 4); + +bool nvlist_existsf_null(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_bool(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_number(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_string(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_nvlist(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_descriptor(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +bool nvlist_existsf_binary(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); + +bool nvlist_existsv(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_type(const nvlist_t *nvl, int type, const char *namefmt, va_list nameap) __printflike(3, 0); + +bool nvlist_existsv_null(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_bool(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_number(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_string(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_nvlist(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_descriptor(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +bool nvlist_existsv_binary(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +#endif + +void nvlist_addf_null(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_addf_bool(nvlist_t *nvl, bool value, const char *namefmt, ...) __printflike(3, 4); +void nvlist_addf_number(nvlist_t *nvl, uint64_t value, const char *namefmt, ...) __printflike(3, 4); +void nvlist_addf_string(nvlist_t *nvl, const char *value, const char *namefmt, ...) __printflike(3, 4); +void nvlist_addf_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt, ...) __printflike(3, 4); +#ifndef _KERNEL +void nvlist_addf_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) __printflike(3, 4); +#endif +void nvlist_addf_binary(nvlist_t *nvl, const void *value, size_t size, const char *namefmt, ...) __printflike(4, 5); + +#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED) +void nvlist_addv_null(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_addv_bool(nvlist_t *nvl, bool value, const char *namefmt, va_list nameap) __printflike(3, 0); +void nvlist_addv_number(nvlist_t *nvl, uint64_t value, const char *namefmt, va_list nameap) __printflike(3, 0); +void nvlist_addv_string(nvlist_t *nvl, const char *value, const char *namefmt, va_list nameap) __printflike(3, 0); +void nvlist_addv_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt, va_list nameap) __printflike(3, 0); +#ifndef _KERNEL +void nvlist_addv_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) __printflike(3, 0); +#endif +void nvlist_addv_binary(nvlist_t *nvl, const void *value, size_t size, const char *namefmt, va_list nameap) __printflike(4, 0); +#endif + +void nvlist_movef_string(nvlist_t *nvl, char *value, const char *namefmt, ...) __printflike(3, 4); +void nvlist_movef_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt, ...) __printflike(3, 4); +#ifndef _KERNEL +void nvlist_movef_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) __printflike(3, 4); +#endif +void nvlist_movef_binary(nvlist_t *nvl, void *value, size_t size, const char *namefmt, ...) __printflike(4, 5); + +#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED) +void nvlist_movev_string(nvlist_t *nvl, char *value, const char *namefmt, va_list nameap) __printflike(3, 0); +void nvlist_movev_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt, va_list nameap) __printflike(3, 0); +#ifndef _KERNEL +void nvlist_movev_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) __printflike(3, 0); +#endif +void nvlist_movev_binary(nvlist_t *nvl, void *value, size_t size, const char *namefmt, va_list nameap) __printflike(4, 0); +#endif + +#ifndef _KERNEL +bool nvlist_getf_bool(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +uint64_t nvlist_getf_number(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +const char *nvlist_getf_string(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +const nvlist_t *nvlist_getf_nvlist(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +int nvlist_getf_descriptor(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +const void *nvlist_getf_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt, ...) __printflike(3, 4); + +bool nvlist_getv_bool(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +uint64_t nvlist_getv_number(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +const char *nvlist_getv_string(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +const nvlist_t *nvlist_getv_nvlist(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +int nvlist_getv_descriptor(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +const void *nvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt, va_list nameap) __printflike(3, 0); + +bool nvlist_takef_bool(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +uint64_t nvlist_takef_number(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +char *nvlist_takef_string(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +nvlist_t *nvlist_takef_nvlist(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +int nvlist_takef_descriptor(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void *nvlist_takef_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt, ...) __printflike(3, 4); + +bool nvlist_takev_bool(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +uint64_t nvlist_takev_number(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +char *nvlist_takev_string(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +nvlist_t *nvlist_takev_nvlist(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +int nvlist_takev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void *nvlist_takev_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt, va_list nameap) __printflike(3, 0); + +void nvlist_freef(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_type(nvlist_t *nvl, int type, const char *namefmt, ...) __printflike(3, 4); + +void nvlist_freef_null(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_bool(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_number(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_string(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_nvlist(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_descriptor(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); +void nvlist_freef_binary(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3); + +void nvlist_freev(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_type(nvlist_t *nvl, int type, const char *namefmt, va_list nameap) __printflike(3, 0); + +void nvlist_freev_null(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_bool(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_number(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_string(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_nvlist(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +void nvlist_freev_binary(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +#endif /* _KERNEL */ + +__END_DECLS + +#endif /* !_NV_H_ */ Copied: head/sys/sys/nv_impl.h (from r279438, head/lib/libnv/nv_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/nv_impl.h Sun Mar 1 00:34:27 2015 (r279439, copy of r279438, head/lib/libnv/nv_impl.h) @@ -0,0 +1,157 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NV_IMPL_H_ +#define _NV_IMPL_H_ + +#ifndef _NVPAIR_T_DECLARED +#define _NVPAIR_T_DECLARED +struct nvpair; + +typedef struct nvpair nvpair_t; +#endif + +#define NV_TYPE_NVLIST_UP 255 + +#define NV_TYPE_FIRST NV_TYPE_NULL +#define NV_TYPE_LAST NV_TYPE_BINARY + +#define NV_FLAG_BIG_ENDIAN 0x80 + +#ifdef _KERNEL +#define nv_malloc(size) malloc((size), M_NVLIST, M_NOWAIT) +#define nv_calloc(n, size) malloc((n) * (size), M_NVLIST, \ + M_NOWAIT | M_ZERO) +#define nv_realloc(buf, size) realloc((buf), (size), M_NVLIST, \ + M_NOWAIT) +#define nv_free(buf) free((buf), M_NVLIST) +#define nv_strdup(buf) strdup((buf), M_NVLIST) +#define nv_vasprintf(ptr, ...) vasprintf(ptr, M_NVLIST, __VA_ARGS__) + +#define SAVE_ERRNO(var) ((void)(var)) +#define RESTORE_ERRNO(var) ((void)(var)) + +#define ERRNO_OR_DEFAULT(default) (default) + +#else + +#define nv_malloc(size) malloc((size)) +#define nv_calloc(n, size) calloc((n), (size)) +#define nv_realloc(buf, size) realloc((buf), (size)) +#define nv_free(buf) free((buf)) +#define nv_strdup(buf) strdup((buf)) +#define nv_vasprintf(ptr, ...) vasprintf(ptr, __VA_ARGS__) + +#define SAVE_ERRNO(var) (var) = errno +#define RESTORE_ERRNO(var) errno = (var) + +#define ERRNO_OR_DEFAULT(default) (errno == 0 ? (default) : errno) + +#endif + +int *nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp); +size_t nvlist_ndescriptors(const nvlist_t *nvl); + +nvpair_t *nvlist_first_nvpair(const nvlist_t *nvl); +nvpair_t *nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp); +nvpair_t *nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp); + +void nvlist_add_nvpair(nvlist_t *nvl, const nvpair_t *nvp); + +void nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp); + +void nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent); + +const nvpair_t *nvlist_get_nvpair(const nvlist_t *nvl, const char *name); + +nvpair_t *nvlist_take_nvpair(nvlist_t *nvl, const char *name); + +/* Function removes the given nvpair from the nvlist. */ +void nvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *nvp); + +void nvlist_free_nvpair(nvlist_t *nvl, nvpair_t *nvp); + +int nvpair_type(const nvpair_t *nvp); +const char *nvpair_name(const nvpair_t *nvp); + +nvpair_t *nvpair_clone(const nvpair_t *nvp); + +nvpair_t *nvpair_create_null(const char *name); +nvpair_t *nvpair_create_bool(const char *name, bool value); +nvpair_t *nvpair_create_number(const char *name, uint64_t value); +nvpair_t *nvpair_create_string(const char *name, const char *value); +nvpair_t *nvpair_create_stringf(const char *name, const char *valuefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_create_stringv(const char *name, const char *valuefmt, va_list valueap) __printflike(2, 0); +nvpair_t *nvpair_create_nvlist(const char *name, const nvlist_t *value); +nvpair_t *nvpair_create_descriptor(const char *name, int value); +nvpair_t *nvpair_create_binary(const char *name, const void *value, size_t size); + +nvpair_t *nvpair_move_string(const char *name, char *value); +nvpair_t *nvpair_move_nvlist(const char *name, nvlist_t *value); +nvpair_t *nvpair_move_descriptor(const char *name, int value); +nvpair_t *nvpair_move_binary(const char *name, void *value, size_t size); + +bool nvpair_get_bool(const nvpair_t *nvp); +uint64_t nvpair_get_number(const nvpair_t *nvp); +const char *nvpair_get_string(const nvpair_t *nvp); +const nvlist_t *nvpair_get_nvlist(const nvpair_t *nvp); +int nvpair_get_descriptor(const nvpair_t *nvp); +const void *nvpair_get_binary(const nvpair_t *nvp, size_t *sizep); + +void nvpair_free(nvpair_t *nvp); + +nvpair_t *nvpair_createf_null(const char *namefmt, ...) __printflike(1, 2); +nvpair_t *nvpair_createf_bool(bool value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_createf_number(uint64_t value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_createf_string(const char *value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_createf_nvlist(const nvlist_t *value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_createf_descriptor(int value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_createf_binary(const void *value, size_t size, const char *namefmt, ...) __printflike(3, 4); + +nvpair_t *nvpair_createv_null(const char *namefmt, va_list nameap) __printflike(1, 0); +nvpair_t *nvpair_createv_bool(bool value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_createv_number(uint64_t value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_createv_string(const char *value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_createv_nvlist(const nvlist_t *value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_createv_descriptor(int value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_createv_binary(const void *value, size_t size, const char *namefmt, va_list nameap) __printflike(3, 0); + +nvpair_t *nvpair_movef_string(char *value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_movef_nvlist(nvlist_t *value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_movef_descriptor(int value, const char *namefmt, ...) __printflike(2, 3); +nvpair_t *nvpair_movef_binary(void *value, size_t size, const char *namefmt, ...) __printflike(3, 4); + +nvpair_t *nvpair_movev_string(char *value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_movev_nvlist(nvlist_t *value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_movev_descriptor(int value, const char *namefmt, va_list nameap) __printflike(2, 0); +nvpair_t *nvpair_movev_binary(void *value, size_t size, const char *namefmt, va_list nameap) __printflike(3, 0); + +#endif /* !_NV_IMPL_H_ */ Copied: head/sys/sys/nvlist_impl.h (from r279438, head/lib/libnv/nvlist_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/nvlist_impl.h Sun Mar 1 00:34:27 2015 (r279439, copy of r279438, head/lib/libnv/nvlist_impl.h) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NVLIST_IMPL_H_ +#define _NVLIST_IMPL_H_ + +#ifndef _KERNEL +#include +#endif + +#include "nv.h" + +void *nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep); +nvlist_t *nvlist_xunpack(const void *buf, size_t size, const int *fds, + size_t nfds); + +nvpair_t *nvlist_get_nvpair_parent(const nvlist_t *nvl); +const unsigned char *nvlist_unpack_header(nvlist_t *nvl, + const unsigned char *ptr, size_t nfds, bool *isbep, size_t *leftp); + +#endif /* !_NVLIST_IMPL_H_ */ Copied: head/sys/sys/nvpair_impl.h (from r279438, head/lib/libnv/nvpair_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/nvpair_impl.h Sun Mar 1 00:34:27 2015 (r279439, copy of r279438, head/lib/libnv/nvpair_impl.h) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2009-2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NVPAIR_IMPL_H_ +#define _NVPAIR_IMPL_H_ + +#include + +#ifndef _KERNEL +#include +#endif + +#include "nv.h" + +TAILQ_HEAD(nvl_head, nvpair); + +void nvpair_assert(const nvpair_t *nvp); +nvlist_t *nvpair_nvlist(const nvpair_t *nvp); +nvpair_t *nvpair_next(const nvpair_t *nvp); +nvpair_t *nvpair_prev(const nvpair_t *nvp); +void nvpair_insert(struct nvl_head *head, nvpair_t *nvp, nvlist_t *nvl); +void nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl); +size_t nvpair_header_size(void); +size_t nvpair_size(const nvpair_t *nvp); +const unsigned char *nvpair_unpack(bool isbe, const unsigned char *ptr, + size_t *leftp, nvpair_t **nvpp); +void nvpair_free_structure(nvpair_t *nvp); +void nvpair_init_datasize(nvpair_t *nvp); +const char *nvpair_type_string(int type); + +/* Pack functions. */ +unsigned char *nvpair_pack_header(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_bool(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_number(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_string(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_descriptor(const nvpair_t *nvp, unsigned char *ptr, + int64_t *fdidxp, size_t *leftp); +unsigned char *nvpair_pack_binary(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_nvlist_up(unsigned char *ptr, size_t *leftp); + +/* Unpack data functions. */ +const unsigned char *nvpair_unpack_header(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_null(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_bool(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_number(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_string(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_nvlist(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp, size_t nvlist, nvlist_t **child); +const unsigned char *nvpair_unpack_descriptor(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp, const int *fds, size_t nfds); +const unsigned char *nvpair_unpack_binary(bool isbe, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); + +#endif /* !_NVPAIR_IMPL_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:37:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A078ADA4; Sun, 1 Mar 2015 00:37:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89F15138; Sun, 1 Mar 2015 00:37:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210bOYT089608; Sun, 1 Mar 2015 00:37:24 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210bOUe089607; Sun, 1 Mar 2015 00:37:24 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010037.t210bOUe089607@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279440 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:37:24 -0000 Author: rstone Date: Sun Mar 1 00:37:23 2015 New Revision: 279440 URL: https://svnweb.freebsd.org/changeset/base/279440 Log: Fix build of nv_tests.cc nv_tests.cc managed to get two copies of several functions due to me applying a patch in an unclean working tree. My kingdom for an "svn clean" command. MFC after: 1 month X-MFC-With: r279424 Modified: head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:34:27 2015 (r279439) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:37:23 2015 (r279440) @@ -1252,1779 +1252,3 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_free_nvlist__single_nvlist); ATF_ADD_TEST_CASE(tp, nvlist_free_binary__single_binary); } -/*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include - -#include -/* - * Test that a newly created nvlist has no errors, and is empty. - */ -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); -ATF_TEST_CASE_BODY(nvlist_create__is_empty) -{ - nvlist_t *nvl; - int type; - void *it; - - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - - ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - ATF_REQUIRE(nvlist_empty(nvl)); - - it = NULL; - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - int type; - - key = "key"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_null(nvl, key); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_null(nvl, key)); - ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NULL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - int type; - - key = "name"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_bool(nvl, key, true); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); - ATF_REQUIRE(nvlist_exists_bool(nvl, key)); - ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); - ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); - ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_number__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - uint64_t value; - int type; - - key = "foo123"; - value = 71965; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_number(nvl, key, value); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); - ATF_REQUIRE(nvlist_exists_number(nvl, key)); - ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); - ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); - ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_string__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - const char *value; - int type; - - key = "test"; - value = "fgjdkgjdk"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_string(nvl, key, value); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_string(nvl, key)); - ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); - ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); - ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(nvlist_get_string(nvl, key) != value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key, *subkey; - nvlist_t *sublist; - const nvlist_t *value; - int type; - - key = "test"; - subkey = "subkey"; - sublist = nvlist_create(0); - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_null(sublist, subkey); - nvlist_add_nvlist(nvl, key, sublist); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); - ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); - - value = nvlist_get_nvlist(nvl, key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(sublist != value); - - value = nvlist_getf_nvlist(nvl, "%s", key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - ATF_REQUIRE(sublist != value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(sublist); - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - void *value; - const void *ret_value; - size_t value_size, ret_size; - int type; - - key = "binary"; - value_size = 13; - value = malloc(value_size); - memset(value, 0xa5, value_size); - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_binary(nvl, key, value, value_size); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_binary(nvl, key)); - ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); - - ret_value = nvlist_get_binary(nvl, key, &ret_size); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(value != ret_value); - - ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - ATF_REQUIRE(value != ret_value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); - free(value); -} - -ATF_INIT_TEST_CASES(tp) -{ - ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); - ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); -} -/*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include - -#include -/* - * Test that a newly created nvlist has no errors, and is empty. - */ -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); -ATF_TEST_CASE_BODY(nvlist_create__is_empty) -{ - nvlist_t *nvl; - int type; - void *it; - - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - - ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - ATF_REQUIRE(nvlist_empty(nvl)); - - it = NULL; - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - int type; - - key = "key"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_null(nvl, key); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_null(nvl, key)); - ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NULL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - int type; - - key = "name"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_bool(nvl, key, true); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); - ATF_REQUIRE(nvlist_exists_bool(nvl, key)); - ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); - ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); - ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_number__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - uint64_t value; - int type; - - key = "foo123"; - value = 71965; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_number(nvl, key, value); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); - ATF_REQUIRE(nvlist_exists_number(nvl, key)); - ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); - ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); - ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_string__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - const char *value; - int type; - - key = "test"; - value = "fgjdkgjdk"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_string(nvl, key, value); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_string(nvl, key)); - ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); - ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); - ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(nvlist_get_string(nvl, key) != value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key, *subkey; - nvlist_t *sublist; - const nvlist_t *value; - int type; - - key = "test"; - subkey = "subkey"; - sublist = nvlist_create(0); - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_null(sublist, subkey); - nvlist_add_nvlist(nvl, key, sublist); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); - ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); - - value = nvlist_get_nvlist(nvl, key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(sublist != value); - - value = nvlist_getf_nvlist(nvl, "%s", key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - ATF_REQUIRE(sublist != value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(sublist); - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - void *value; - const void *ret_value; - size_t value_size, ret_size; - int type; - - key = "binary"; - value_size = 13; - value = malloc(value_size); - memset(value, 0xa5, value_size); - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_binary(nvl, key, value, value_size); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_binary(nvl, key)); - ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); - - ret_value = nvlist_get_binary(nvl, key, &ret_size); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(value != ret_value); - - ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - ATF_REQUIRE(value != ret_value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); - free(value); -} - -ATF_INIT_TEST_CASES(tp) -{ - ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); - ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); -} -/*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include - -#include -#include -#include -#include -#include - -/* - * Test that a newly created nvlist has no errors, and is empty. - */ -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty); -ATF_TEST_CASE_BODY(nvlist_create__is_empty) -{ - nvlist_t *nvl; - int type; - void *it; - - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - - ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - ATF_REQUIRE(nvlist_empty(nvl)); - - it = NULL; - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_null__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - int type; - - key = "key"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_null(nvl, key); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_null(nvl, key)); - ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NULL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - int type; - - key = "name"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_bool(nvl, key, true); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); - ATF_REQUIRE(nvlist_exists_bool(nvl, key)); - ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); - ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); - ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_number__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - uint64_t value; - int type; - - key = "foo123"; - value = 71965; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_number(nvl, key, value); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); - ATF_REQUIRE(nvlist_exists_number(nvl, key)); - ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); - ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); - ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_string__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - const char *value; - int type; - - key = "test"; - value = "fgjdkgjdk"; - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_string(nvl, key, value); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_string(nvl, key)); - ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); - ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); - ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(nvlist_get_string(nvl, key) != value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key, *subkey; - nvlist_t *sublist; - const nvlist_t *value; - int type; - - key = "test"; - subkey = "subkey"; - sublist = nvlist_create(0); - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_null(sublist, subkey); - nvlist_add_nvlist(nvl, key, sublist); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); - ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); - - value = nvlist_get_nvlist(nvl, key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(sublist != value); - - value = nvlist_getf_nvlist(nvl, "%s", key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - ATF_REQUIRE(sublist != value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(sublist); - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); -ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) -{ - nvlist_t *nvl; - void *it; - const char *key; - void *value; - const void *ret_value; - size_t value_size, ret_size; - int type; - - key = "binary"; - value_size = 13; - value = malloc(value_size); - memset(value, 0xa5, value_size); - nvl = nvlist_create(0); - - ATF_REQUIRE(nvl != NULL); - ATF_REQUIRE(!nvlist_exists(nvl, key)); - - nvlist_add_binary(nvl, key, value, value_size); - - ATF_REQUIRE(!nvlist_empty(nvl)); - ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); - ATF_REQUIRE(nvlist_exists_binary(nvl, key)); - ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); - - ret_value = nvlist_get_binary(nvl, key, &ret_size); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - - /* nvlist_add_* is required to clone the value, so check for that. */ - ATF_REQUIRE(value != ret_value); - - ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - ATF_REQUIRE(value != ret_value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); - - nvlist_destroy(nvl); - free(value); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__empty_nvlist); -ATF_TEST_CASE_BODY(nvlist_clone__empty_nvlist) -{ - nvlist_t *nvl, *clone; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - clone = nvlist_clone(nvl); - ATF_REQUIRE(clone != NULL); - ATF_REQUIRE(clone != nvl); - ATF_REQUIRE(nvlist_empty(clone)); - - nvlist_destroy(clone); - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nonempty_nvlist); -ATF_TEST_CASE_BODY(nvlist_clone__nonempty_nvlist) -{ - nvlist_t *nvl, *clone; - const char *key; - void *it; - uint64_t value; - int type; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - key = "testkey"; - value = 684874; - nvlist_add_number(nvl, key, value); - - clone = nvlist_clone(nvl); - ATF_REQUIRE(clone != NULL); - ATF_REQUIRE(clone != nvl); - ATF_REQUIRE(nvlist_exists_number(clone, key)); - ATF_REQUIRE_EQ(nvlist_get_number(clone, key), value); - - /* Iterate over the nvlist; ensure that it has only our one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(clone, &type, &it), key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), NULL); - - nvlist_destroy(clone); - nvlist_destroy(nvl); -} - -static const char * const test_subnvlist_key = "nvlist"; - -static const char * const test_string_key = "string"; -static const char * const test_string_val = "59525"; - -static nvlist_t* -create_test_nvlist(void) -{ - nvlist_t *nvl, *sublist; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - sublist = nvlist_create(0); - ATF_REQUIRE(sublist != NULL); - - nvlist_add_string(sublist, test_string_key, test_string_val); - nvlist_move_nvlist(nvl, test_subnvlist_key, sublist); - - return (nvl); -} - -static void -verify_test_nvlist(const nvlist_t *nvl) -{ - void *it; - const nvlist_t *value; - int type; - - ATF_REQUIRE(nvlist_exists_nvlist(nvl, test_subnvlist_key)); - - value = nvlist_get_nvlist(nvl, test_subnvlist_key); - - ATF_REQUIRE(nvlist_exists_string(value, test_string_key)); - ATF_REQUIRE_EQ(strcmp(nvlist_get_string(value, test_string_key), test_string_val), 0); - ATF_REQUIRE(nvlist_get_string(value, test_string_key) != test_string_val); - - /* Iterate over both nvlists; ensure that each has only the one key. */ - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(value, &type, &it), - test_string_key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), NULL); - - it = NULL; - ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), - test_subnvlist_key), 0); - ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nested_nvlist); -ATF_TEST_CASE_BODY(nvlist_clone__nested_nvlist) -{ - nvlist_t *nvl, *clone; - - nvl = create_test_nvlist(); - clone = nvlist_clone(nvl); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:39:27 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2BBBEF6; Sun, 1 Mar 2015 00:39:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3155146; Sun, 1 Mar 2015 00:39:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210dRCO089906; Sun, 1 Mar 2015 00:39:27 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210dRdd089905; Sun, 1 Mar 2015 00:39:27 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010039.t210dRdd089905@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279441 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:39:28 -0000 Author: rstone Date: Sun Mar 1 00:39:26 2015 New Revision: 279441 URL: https://svnweb.freebsd.org/changeset/base/279441 Log: Refactor PCI device creation Refactor creation of PCI devices into helper methods that can be used by the VF creation code. Differential Revision: https://reviews.freebsd.org/D67 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 00:37:23 2015 (r279440) +++ head/sys/dev/pci/pci.c Sun Mar 1 00:39:26 2015 (r279441) @@ -122,6 +122,9 @@ static int pci_remap_intr_method(device static uint16_t pci_get_rid_method(device_t dev, device_t child); +static struct pci_devinfo * pci_fill_devinfo(device_t pcib, int d, int b, int s, + int f, uint16_t vid, uint16_t did, size_t size); + static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), @@ -595,74 +598,82 @@ struct pci_devinfo * pci_read_device(device_t pcib, int d, int b, int s, int f, size_t size) { #define REG(n, w) PCIB_READ_CONFIG(pcib, b, s, f, n, w) - pcicfgregs *cfg = NULL; - struct pci_devinfo *devlist_entry; - struct devlist *devlist_head; + uint16_t vid, did; - devlist_head = &pci_devq; + vid = REG(PCIR_VENDOR, 2); + did = REG(PCIR_DEVICE, 2); + if (vid != 0xffff) + return (pci_fill_devinfo(pcib, d, b, s, f, vid, did, size)); + + return (NULL); +} + +static struct pci_devinfo * +pci_fill_devinfo(device_t pcib, int d, int b, int s, int f, uint16_t vid, + uint16_t did, size_t size) +{ + struct pci_devinfo *devlist_entry; + pcicfgregs *cfg; - devlist_entry = NULL; + devlist_entry = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); - if (REG(PCIR_DEVVENDOR, 4) != 0xfffffffful) { - devlist_entry = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); + cfg = &devlist_entry->cfg; - cfg = &devlist_entry->cfg; + cfg->domain = d; + cfg->bus = b; + cfg->slot = s; + cfg->func = f; + cfg->vendor = vid; + cfg->device = did; + cfg->cmdreg = REG(PCIR_COMMAND, 2); + cfg->statreg = REG(PCIR_STATUS, 2); + cfg->baseclass = REG(PCIR_CLASS, 1); + cfg->subclass = REG(PCIR_SUBCLASS, 1); + cfg->progif = REG(PCIR_PROGIF, 1); + cfg->revid = REG(PCIR_REVID, 1); + cfg->hdrtype = REG(PCIR_HDRTYPE, 1); + cfg->cachelnsz = REG(PCIR_CACHELNSZ, 1); + cfg->lattimer = REG(PCIR_LATTIMER, 1); + cfg->intpin = REG(PCIR_INTPIN, 1); + cfg->intline = REG(PCIR_INTLINE, 1); + + cfg->mingnt = REG(PCIR_MINGNT, 1); + cfg->maxlat = REG(PCIR_MAXLAT, 1); + + cfg->mfdev = (cfg->hdrtype & PCIM_MFDEV) != 0; + cfg->hdrtype &= ~PCIM_MFDEV; + STAILQ_INIT(&cfg->maps); + + pci_fixancient(cfg); + pci_hdrtypedata(pcib, b, s, f, cfg); + + if (REG(PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT) + pci_read_cap(pcib, cfg); + + STAILQ_INSERT_TAIL(&pci_devq, devlist_entry, pci_links); + + devlist_entry->conf.pc_sel.pc_domain = cfg->domain; + devlist_entry->conf.pc_sel.pc_bus = cfg->bus; + devlist_entry->conf.pc_sel.pc_dev = cfg->slot; + devlist_entry->conf.pc_sel.pc_func = cfg->func; + devlist_entry->conf.pc_hdr = cfg->hdrtype; + + devlist_entry->conf.pc_subvendor = cfg->subvendor; + devlist_entry->conf.pc_subdevice = cfg->subdevice; + devlist_entry->conf.pc_vendor = cfg->vendor; + devlist_entry->conf.pc_device = cfg->device; + + devlist_entry->conf.pc_class = cfg->baseclass; + devlist_entry->conf.pc_subclass = cfg->subclass; + devlist_entry->conf.pc_progif = cfg->progif; + devlist_entry->conf.pc_revid = cfg->revid; - cfg->domain = d; - cfg->bus = b; - cfg->slot = s; - cfg->func = f; - cfg->vendor = REG(PCIR_VENDOR, 2); - cfg->device = REG(PCIR_DEVICE, 2); - cfg->cmdreg = REG(PCIR_COMMAND, 2); - cfg->statreg = REG(PCIR_STATUS, 2); - cfg->baseclass = REG(PCIR_CLASS, 1); - cfg->subclass = REG(PCIR_SUBCLASS, 1); - cfg->progif = REG(PCIR_PROGIF, 1); - cfg->revid = REG(PCIR_REVID, 1); - cfg->hdrtype = REG(PCIR_HDRTYPE, 1); - cfg->cachelnsz = REG(PCIR_CACHELNSZ, 1); - cfg->lattimer = REG(PCIR_LATTIMER, 1); - cfg->intpin = REG(PCIR_INTPIN, 1); - cfg->intline = REG(PCIR_INTLINE, 1); - - cfg->mingnt = REG(PCIR_MINGNT, 1); - cfg->maxlat = REG(PCIR_MAXLAT, 1); - - cfg->mfdev = (cfg->hdrtype & PCIM_MFDEV) != 0; - cfg->hdrtype &= ~PCIM_MFDEV; - STAILQ_INIT(&cfg->maps); - - pci_fixancient(cfg); - pci_hdrtypedata(pcib, b, s, f, cfg); - - if (REG(PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT) - pci_read_cap(pcib, cfg); - - STAILQ_INSERT_TAIL(devlist_head, devlist_entry, pci_links); - - devlist_entry->conf.pc_sel.pc_domain = cfg->domain; - devlist_entry->conf.pc_sel.pc_bus = cfg->bus; - devlist_entry->conf.pc_sel.pc_dev = cfg->slot; - devlist_entry->conf.pc_sel.pc_func = cfg->func; - devlist_entry->conf.pc_hdr = cfg->hdrtype; - - devlist_entry->conf.pc_subvendor = cfg->subvendor; - devlist_entry->conf.pc_subdevice = cfg->subdevice; - devlist_entry->conf.pc_vendor = cfg->vendor; - devlist_entry->conf.pc_device = cfg->device; - - devlist_entry->conf.pc_class = cfg->baseclass; - devlist_entry->conf.pc_subclass = cfg->subclass; - devlist_entry->conf.pc_progif = cfg->progif; - devlist_entry->conf.pc_revid = cfg->revid; + pci_numdevs++; + pci_generation++; - pci_numdevs++; - pci_generation++; - } return (devlist_entry); -#undef REG } +#undef REG static void pci_read_cap(device_t pcib, pcicfgregs *cfg) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:39:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1BFEB3; Sun, 1 Mar 2015 00:39:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC71B149; Sun, 1 Mar 2015 00:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210dYjG089962; Sun, 1 Mar 2015 00:39:34 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210dYTB089960; Sun, 1 Mar 2015 00:39:34 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010039.t210dYTB089960@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279442 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:39:35 -0000 Author: rstone Date: Sun Mar 1 00:39:33 2015 New Revision: 279442 URL: https://svnweb.freebsd.org/changeset/base/279442 Log: Refactor PCI resource allocation Refactor PCI resource allocation code to allow a request for a memory-mapped I/O window that is a multiple of a requested size. This is needed by the SR-IOV code because the VF BARs are all allocated contiguously. We can't just allocate a resource that is a multiple of a single VF BAR because the size of an allocation implies its alignment requirement. Differential Revision: https://reviews.freebsd.org/D71 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 00:39:26 2015 (r279441) +++ head/sys/dev/pci/pci.c Sun Mar 1 00:39:33 2015 (r279442) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); static int pci_has_quirk(uint32_t devid, int quirk); static pci_addr_t pci_mapbase(uint64_t mapreg); static const char *pci_maptype(uint64_t mapreg); -static int pci_mapsize(uint64_t testval); static int pci_maprange(uint64_t mapreg); static pci_addr_t pci_rombase(uint64_t mapreg); static int pci_romsize(uint64_t testval); @@ -487,7 +486,7 @@ pci_maptype(uint64_t mapreg) /* return log2 of map size decoded for memory or port map */ -static int +int pci_mapsize(uint64_t testval) { int ln2size; @@ -2620,8 +2619,9 @@ pci_memen(device_t dev) return (pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_MEMEN) != 0; } -static void -pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, pci_addr_t *testvalp) +void +pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, pci_addr_t *testvalp, + int *bar64) { struct pci_devinfo *dinfo; pci_addr_t map, testval; @@ -2641,6 +2641,8 @@ pci_read_bar(device_t dev, int reg, pci_ pci_write_config(dev, reg, map, 4); *mapp = map; *testvalp = testval; + if (bar64 != NULL) + *bar64 = 0; return; } @@ -2682,6 +2684,8 @@ pci_read_bar(device_t dev, int reg, pci_ *mapp = map; *testvalp = testval; + if (bar64 != NULL) + *bar64 = (ln2range == 64); } static void @@ -2736,7 +2740,7 @@ pci_bar_enabled(device_t dev, struct pci return ((cmd & PCIM_CMD_PORTEN) != 0); } -static struct pci_map * +struct pci_map * pci_add_bar(device_t dev, int reg, pci_addr_t value, pci_addr_t size) { struct pci_devinfo *dinfo; @@ -2807,7 +2811,7 @@ pci_add_map(device_t bus, device_t dev, return (barlen); } - pci_read_bar(dev, reg, &map, &testval); + pci_read_bar(dev, reg, &map, &testval, NULL); if (PCI_BAR_MEM(map)) { type = SYS_RES_MEMORY; if (map & PCIM_BAR_MEM_PREFETCH) @@ -4463,7 +4467,7 @@ DB_SHOW_COMMAND(pciregs, db_pci_dump) static struct resource * pci_reserve_map(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + u_long start, u_long end, u_long count, u_int num, u_int flags) { struct pci_devinfo *dinfo = device_get_ivars(child); struct resource_list *rl = &dinfo->resources; @@ -4487,7 +4491,7 @@ pci_reserve_map(device_t dev, device_t c * have a atapci device in legacy mode and it fails * here, that other code is broken. */ - pci_read_bar(child, *rid, &map, &testval); + pci_read_bar(child, *rid, &map, &testval, NULL); /* * Determine the size of the BAR and ignore BARs with a size @@ -4529,7 +4533,7 @@ pci_reserve_map(device_t dev, device_t c * situation where we might allocate the excess to * another driver, which won't work. */ - count = (pci_addr_t)1 << mapsize; + count = ((pci_addr_t)1 << mapsize) * num; if (RF_ALIGNMENT(flags) < mapsize) flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize); if (PCI_BAR_MEM(map) && (map & PCIM_BAR_MEM_PREFETCH)) @@ -4560,8 +4564,8 @@ out: } struct resource * -pci_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) +pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_long num, u_int flags) { struct pci_devinfo *dinfo; struct resource_list *rl; @@ -4569,10 +4573,6 @@ pci_alloc_resource(device_t dev, device_ struct resource *res; pcicfgregs *cfg; - if (device_get_parent(child) != dev) - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - type, rid, start, end, count, flags)); - /* * Perform lazy resource allocation */ @@ -4629,7 +4629,7 @@ pci_alloc_resource(device_t dev, device_ rle = resource_list_find(rl, type, *rid); if (rle == NULL) { res = pci_reserve_map(dev, child, type, rid, start, end, - count, flags); + count, num, flags); if (res == NULL) return (NULL); } @@ -4638,6 +4638,19 @@ pci_alloc_resource(device_t dev, device_ start, end, count, flags)); } +struct resource * +pci_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + + if (device_get_parent(child) != dev) + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, + type, rid, start, end, count, flags)); + + return (pci_alloc_multi_resource(dev, child, type, rid, start, end, + count, 1, flags)); +} + int pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Sun Mar 1 00:39:26 2015 (r279441) +++ head/sys/dev/pci/pci_private.h Sun Mar 1 00:39:33 2015 (r279442) @@ -140,4 +140,14 @@ void pci_cfg_restore(device_t, struct p */ void pci_cfg_save(device_t, struct pci_devinfo *, int); +int pci_mapsize(uint64_t testval); +void pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, + pci_addr_t *testvalp, int *bar64); +struct pci_map *pci_add_bar(device_t dev, int reg, pci_addr_t value, + pci_addr_t size); + +struct resource *pci_alloc_multi_resource(device_t dev, device_t child, + int type, int *rid, u_long start, u_long end, u_long count, + u_long num, u_int flags); + #endif /* _PCI_PRIVATE_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:39:42 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A58C71E9; Sun, 1 Mar 2015 00:39:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8606E14D; Sun, 1 Mar 2015 00:39:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210dgFO090028; Sun, 1 Mar 2015 00:39:42 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210dfeH090021; Sun, 1 Mar 2015 00:39:41 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010039.t210dfeH090021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279443 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:39:42 -0000 Author: rstone Date: Sun Mar 1 00:39:40 2015 New Revision: 279443 URL: https://svnweb.freebsd.org/changeset/base/279443 Log: Add some pcib methods to get ARI-related information Differential Revision: https://reviews.freebsd.org/D72 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcib_support.c head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sun Mar 1 00:39:33 2015 (r279442) +++ head/sys/dev/pci/pci_pci.c Sun Mar 1 00:39:40 2015 (r279443) @@ -64,6 +64,9 @@ static void pcib_write_config(device_t static int pcib_ari_maxslots(device_t dev); static int pcib_ari_maxfuncs(device_t dev); static int pcib_try_enable_ari(device_t pcib, device_t dev); +static int pcib_ari_enabled(device_t pcib); +static void pcib_ari_decode_rid(device_t pcib, uint16_t rid, + int *bus, int *slot, int *func); static device_method_t pcib_methods[] = { /* Device interface */ @@ -104,6 +107,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), DEVMETHOD(pcib_get_rid, pcib_ari_get_rid), DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), + DEVMETHOD(pcib_ari_enabled, pcib_ari_enabled), + DEVMETHOD(pcib_decode_rid, pcib_ari_decode_rid), DEVMETHOD_END }; @@ -1883,6 +1888,24 @@ pcib_ari_maxfuncs(device_t dev) return (PCI_FUNCMAX); } +static void +pcib_ari_decode_rid(device_t pcib, uint16_t rid, int *bus, int *slot, + int *func) +{ + struct pcib_softc *sc; + + sc = device_get_softc(pcib); + + *bus = PCI_RID2BUS(rid); + if (sc->flags & PCIB_ENABLE_ARI) { + *slot = PCIE_ARI_RID2SLOT(rid); + *func = PCIE_ARI_RID2FUNC(rid); + } else { + *slot = PCI_RID2SLOT(rid); + *func = PCI_RID2FUNC(rid); + } +} + /* * Since we are a child of a PCI bus, its parent must support the pcib interface. */ @@ -2014,6 +2037,16 @@ pcib_power_for_sleep(device_t pcib, devi return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } +static int +pcib_ari_enabled(device_t pcib) +{ + struct pcib_softc *sc; + + sc = device_get_softc(pcib); + + return ((sc->flags & PCIB_ENABLE_ARI) != 0); +} + static uint16_t pcib_ari_get_rid(device_t pcib, device_t dev) { Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Sun Mar 1 00:39:33 2015 (r279442) +++ head/sys/dev/pci/pcib_if.m Sun Mar 1 00:39:40 2015 (r279443) @@ -39,6 +39,13 @@ CODE { { return (PCI_INVALID_IRQ); } + + static int + pcib_null_ari_enabled(device_t pcib) + { + + return (0); + } }; # @@ -182,3 +189,21 @@ METHOD int try_enable_ari { device_t dev; }; +# +# Return non-zero if PCI ARI is enabled, or zero otherwise +# +METHOD int ari_enabled { + device_t pcib; +} DEFAULT pcib_null_ari_enabled; + +# +# Decode a PCI Routing Identifier (RID) into PCI bus/slot/function +# +METHOD void decode_rid { + device_t pcib; + uint16_t rid; + int *bus; + int *slot; + int *func; +} DEFAULT pcib_decode_rid; + Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Sun Mar 1 00:39:33 2015 (r279442) +++ head/sys/dev/pci/pcib_private.h Sun Mar 1 00:39:40 2015 (r279443) @@ -170,5 +170,7 @@ int pcib_alloc_msix(device_t pcib, devi int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); uint16_t pcib_get_rid(device_t pcib, device_t dev); +void pcib_decode_rid(device_t pcib, uint16_t rid, int *bus, + int *slot, int *func); #endif Modified: head/sys/dev/pci/pcib_support.c ============================================================================== --- head/sys/dev/pci/pcib_support.c Sun Mar 1 00:39:33 2015 (r279442) +++ head/sys/dev/pci/pcib_support.c Sun Mar 1 00:39:40 2015 (r279443) @@ -66,3 +66,13 @@ pcib_get_rid(device_t pcib, device_t dev return (PCI_RID(bus, slot, func)); } +void +pcib_decode_rid(device_t pcib, uint16_t rid, int *bus, int *slot, + int *func) +{ + + *bus = PCI_RID2BUS(rid); + *slot = PCI_RID2SLOT(rid); + *func = PCI_RID2FUNC(rid); +} + Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Sun Mar 1 00:39:33 2015 (r279442) +++ head/sys/dev/pci/pcireg.h Sun Mar 1 00:39:40 2015 (r279443) @@ -68,6 +68,10 @@ #define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) #define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) +#define PCIE_ARI_RID2SLOT(rid) (0) +#define PCIE_ARI_RID2FUNC(rid) \ + (((rid) >> PCI_RID_FUNC_SHIFT) & PCIE_ARI_FUNCMAX) + #define PCIE_ARI_SLOT(func) (((func) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) #define PCIE_ARI_FUNC(func) (((func) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:39:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62E9731F; Sun, 1 Mar 2015 00:39:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E29F151; Sun, 1 Mar 2015 00:39:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210dn54090089; Sun, 1 Mar 2015 00:39:49 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210dm23090086; Sun, 1 Mar 2015 00:39:48 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010039.t210dm23090086@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279444 - in head/sys/amd64/vmm: . io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:39:49 -0000 Author: rstone Date: Sun Mar 1 00:39:48 2015 New Revision: 279444 URL: https://svnweb.freebsd.org/changeset/base/279444 Log: Allow passthrough devices to be hinted. Allow the ppt driver to attach to devices that were hinted to be passthrough devices by the PCI code creating them with a driver name of "ppt". Add a tunable that allows the IOMMU to be forced to be used. With SR-IOV passthrough devices the VFs may be created after vmm.ko is loaded. The current code will not initialize the IOMMU in that case, meaning that the passthrough devices can't actually be used. Differential Revision: https://reviews.freebsd.org/D73 Reviewed by: neel MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/amd64/vmm/io/ppt.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Sun Mar 1 00:39:40 2015 (r279443) +++ head/sys/amd64/vmm/io/ppt.c Sun Mar 1 00:39:48 2015 (r279444) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); /* XXX locking */ -#define MAX_PPTDEVS (sizeof(pptdevs) / sizeof(pptdevs[0])) #define MAX_MSIMSGS 32 /* @@ -77,9 +76,10 @@ struct pptintr_arg { /* pptintr(pptin uint64_t msg_data; }; -static struct pptdev { +struct pptdev { device_t dev; struct vm *vm; /* owner of this device */ + TAILQ_ENTRY(pptdev) next; struct vm_memory_segment mmio[MAX_MMIOSEGS]; struct { int num_msgs; /* guest state */ @@ -99,7 +99,7 @@ static struct pptdev { void **cookie; struct pptintr_arg *arg; } msix; -} pptdevs[64]; +}; SYSCTL_DECL(_hw_vmm); SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW, 0, "bhyve passthru devices"); @@ -108,6 +108,8 @@ static int num_pptdevs; SYSCTL_INT(_hw_vmm_ppt, OID_AUTO, devices, CTLFLAG_RD, &num_pptdevs, 0, "number of pci passthru devices"); +static TAILQ_HEAD(, pptdev) pptdev_list = TAILQ_HEAD_INITIALIZER(pptdev_list); + static int ppt_probe(device_t dev) { @@ -125,26 +127,30 @@ ppt_probe(device_t dev) * - be allowed by administrator to be used in this role * - be an endpoint device */ - if (vmm_is_pptdev(bus, slot, func) && - (dinfo->cfg.hdrtype & PCIM_HDRTYPE) == PCIM_HDRTYPE_NORMAL) + if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL) + return (ENXIO); + else if (vmm_is_pptdev(bus, slot, func)) return (0); else - return (ENXIO); + /* + * Returning BUS_PROBE_NOWILDCARD here matches devices that the + * SR-IOV infrastructure specified as "ppt" passthrough devices. + * All normal devices that did not have "ppt" specified as their + * driver will not be matched by this. + */ + return (BUS_PROBE_NOWILDCARD); } static int ppt_attach(device_t dev) { - int n; + struct pptdev *ppt; - if (num_pptdevs >= MAX_PPTDEVS) { - printf("ppt_attach: maximum number of pci passthrough devices " - "exceeded\n"); - return (ENXIO); - } + ppt = device_get_softc(dev); - n = num_pptdevs++; - pptdevs[n].dev = dev; + num_pptdevs++; + TAILQ_INSERT_TAIL(&pptdev_list, ppt, next); + ppt->dev = dev; if (bootverbose) device_printf(dev, "attached\n"); @@ -155,10 +161,14 @@ ppt_attach(device_t dev) static int ppt_detach(device_t dev) { - /* - * XXX check whether there are any pci passthrough devices assigned - * to guests before we allow this driver to detach. - */ + struct pptdev *ppt; + + ppt = device_get_softc(dev); + + if (ppt->vm != NULL) + return (EBUSY); + num_pptdevs--; + TAILQ_REMOVE(&pptdev_list, ppt, next); return (0); } @@ -172,22 +182,23 @@ static device_method_t ppt_methods[] = { }; static devclass_t ppt_devclass; -DEFINE_CLASS_0(ppt, ppt_driver, ppt_methods, 0); +DEFINE_CLASS_0(ppt, ppt_driver, ppt_methods, sizeof(struct pptdev)); DRIVER_MODULE(ppt, pci, ppt_driver, ppt_devclass, NULL, NULL); static struct pptdev * ppt_find(int bus, int slot, int func) { device_t dev; - int i, b, s, f; + struct pptdev *ppt; + int b, s, f; - for (i = 0; i < num_pptdevs; i++) { - dev = pptdevs[i].dev; + TAILQ_FOREACH(ppt, &pptdev_list, next) { + dev = ppt->dev; b = pci_get_bus(dev); s = pci_get_slot(dev); f = pci_get_function(dev); if (bus == b && slot == s && func == f) - return (&pptdevs[i]); + return (ppt); } return (NULL); } @@ -297,11 +308,12 @@ ppt_avail_devices(void) int ppt_assigned_devices(struct vm *vm) { - int i, num; + struct pptdev *ppt; + int num; num = 0; - for (i = 0; i < num_pptdevs; i++) { - if (pptdevs[i].vm == vm) + TAILQ_FOREACH(ppt, &pptdev_list, next) { + if (ppt->vm == vm) num++; } return (num); @@ -310,12 +322,11 @@ ppt_assigned_devices(struct vm *vm) boolean_t ppt_is_mmio(struct vm *vm, vm_paddr_t gpa) { - int i, n; + int i; struct pptdev *ppt; struct vm_memory_segment *seg; - for (n = 0; n < num_pptdevs; n++) { - ppt = &pptdevs[n]; + TAILQ_FOREACH(ppt, &pptdev_list, next) { if (ppt->vm != vm) continue; @@ -377,12 +388,13 @@ ppt_unassign_device(struct vm *vm, int b int ppt_unassign_all(struct vm *vm) { - int i, bus, slot, func; + struct pptdev *ppt; + int bus, slot, func; device_t dev; - for (i = 0; i < num_pptdevs; i++) { - if (pptdevs[i].vm == vm) { - dev = pptdevs[i].dev; + TAILQ_FOREACH(ppt, &pptdev_list, next) { + if (ppt->vm == vm) { + dev = ppt->dev; bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sun Mar 1 00:39:40 2015 (r279443) +++ head/sys/amd64/vmm/vmm.c Sun Mar 1 00:39:48 2015 (r279444) @@ -217,6 +217,11 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, trace_gues &trace_guest_exceptions, 0, "Trap into hypervisor on all guest exceptions and reflect them back"); +static int vmm_force_iommu = 0; +TUNABLE_INT("hw.vmm.force_iommu", &vmm_force_iommu); +SYSCTL_INT(_hw_vmm, OID_AUTO, force_iommu, CTLFLAG_RDTUN, &vmm_force_iommu, 0, + "Force use of I/O MMU even if no passthrough devices were found."); + static void vcpu_cleanup(struct vm *vm, int i, bool destroy) { @@ -321,7 +326,7 @@ vmm_handler(module_t mod, int what, void switch (what) { case MOD_LOAD: vmmdev_init(); - if (ppt_avail_devices() > 0) + if (vmm_force_iommu || ppt_avail_devices() > 0) iommu_init(); error = vmm_init(); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:39:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26125458; Sun, 1 Mar 2015 00:39:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D424156; Sun, 1 Mar 2015 00:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210dtUY090162; Sun, 1 Mar 2015 00:39:55 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210dtaI090157; Sun, 1 Mar 2015 00:39:55 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010039.t210dtaI090157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279445 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:39:56 -0000 Author: rstone Date: Sun Mar 1 00:39:55 2015 New Revision: 279445 URL: https://svnweb.freebsd.org/changeset/base/279445 Log: Document pci_iov_attach/detach in pci.9 Differential Revision: https://reviews.freebsd.org/D74 Reviewed by: bcr, wblock, emaste MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Mar 1 00:39:48 2015 (r279444) +++ head/share/man/man9/Makefile Sun Mar 1 00:39:55 2015 (r279445) @@ -1159,6 +1159,8 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ pci.9 pci_get_vpd_readonly.9 \ + pci.9 pci_iov_attach.9 \ + pci.9 pci_iov_detach.9 \ pci.9 pci_msi_count.9 \ pci.9 pci_msix_count.9 \ pci.9 pci_pending_msix.9 \ Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Sun Mar 1 00:39:48 2015 (r279444) +++ head/share/man/man9/pci.9 Sun Mar 1 00:39:55 2015 (r279445) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd May 24, 2014 .Dt PCI 9 .Os .Sh NAME @@ -46,6 +46,8 @@ .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , .Nm pci_get_vpd_readonly , +.Nm pci_iov_attach , +.Nm pci_iov_detach , .Nm pci_msi_count , .Nm pci_msix_count , .Nm pci_pending_msix , @@ -95,6 +97,10 @@ .Ft int .Fn pci_get_vpd_readonly "device_t dev" "const char *kw" "const char **vptr" .Ft int +.Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema" +.Ft int +.Fn pci_iov_detach "device_t dev" +.Ft int .Fn pci_msi_count "device_t dev" .Ft int .Fn pci_msix_count "device_t dev" @@ -434,6 +440,75 @@ then the function will fail with .Er EOPNOTSUPP . .Pp The +.Fn pci_iov_attach +function is used to advertise that the given device +.Pq and associated device driver +supports PCI Single-Root I/O Virtualization +.Po SR-IOV Pc . +A driver that supports SR-IOV must implement the +.Xr PCI_INIT_IOV 9 , +.Xr PCI_ADD_VF 9 +and +.Xr PCI_UNIT_IOV 9 +methods. +This function should be called during the +.Xr DEVICE_ATTACH 9 +method. +If this function returns an error, it is recommended that the device driver +still successfully attaches, but runs with SR-IOV disabled. +The +.Fa pf_schema +and +.Fa vf_schema +parameters are used to define what device-specific configuration parameters the +device driver accepts when SR-IOV is enabled for the Physical Function +.Pq PF +and for individual Virtual Functions +.Pq VFs +respectively. +See +.Xr pci_iov_schema 9 +for details on how to construct the schema. +If either the +.Pa pf_schema +or +.Pa vf_schema +is invalid or specifies parameter names that conflict with parameter names that +are already in use, +.Fn pci_iov_attach +will return an error and SR-IOV will not be available on the PF device. +If a driver does not accept configuration parameters for either the PF device +or the VF devices, the driver must pass an empty schema for that device. +The SR-IOV infrastructure takes ownership of the +.Fa pf_schema +and +.Fa vf_schema +and is responsible for freeing them. +The driver must never free the schemas itself. +.Pp +The +.Fn pci_iov_detach +function is used to advise the SR-IOV infrastructure that the driver for the +given device is attempting to detach and that all SR-IOV resources for the +device must be released. +This function must be called during the +.Xr DEVICE_DETACH 9 +method if +.Fn pci_iov_attach +was successfully called on the device and +.Fn pci_iov_detach +has not subsequently been called on the device and returned no error. +If this function returns an error, the +.Xr DEVICE_DETACH 9 +method must fail and return an error, as detaching the PF driver while VF +devices are active would cause system instability. +This function is safe to call and will always succeed if +.Fn pci_iov_attach +previously failed with an error on the given device, or if +.Fn pci_iov_attach +was never called on the device. +.Pp +The .Fn pci_save_state and .Fn pci_restore_state From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E63A58E; Sun, 1 Mar 2015 00:40:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8817915C; Sun, 1 Mar 2015 00:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210e3Ea090298; Sun, 1 Mar 2015 00:40:03 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210e23K090293; Sun, 1 Mar 2015 00:40:02 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210e23K090293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279446 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:03 -0000 Author: rstone Date: Sun Mar 1 00:40:01 2015 New Revision: 279446 URL: https://svnweb.freebsd.org/changeset/base/279446 Log: Add manpages for SR-IOV enable/disable driver interface Differential Revision: https://reviews.freebsd.org/D75 Reviewed by: wblock MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/share/man/man9/PCI_ADD_VF.9 (contents, props changed) head/share/man/man9/PCI_INIT_IOV.9 (contents, props changed) head/share/man/man9/PCI_UNINIT_IOV.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Mar 1 00:39:55 2015 (r279445) +++ head/share/man/man9/Makefile Sun Mar 1 00:40:01 2015 (r279446) @@ -195,6 +195,9 @@ MAN= accept_filter.9 \ p_candebug.9 \ p_cansee.9 \ pci.9 \ + PCI_ADD_VF.9 \ + PCI_INIT_IOV.9 \ + PCI_UNINIT_IOV.9 \ pfil.9 \ pfind.9 \ pget.9 \ Added: head/share/man/man9/PCI_ADD_VF.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/PCI_ADD_VF.9 Sun Mar 1 00:40:01 2015 (r279446) @@ -0,0 +1,113 @@ +.\" +.\" Copyright (c) 2014 Sandvine Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 24, 2014 +.Dt PCI_ADD_VF 9 +.Os +.Sh NAME +.Nm PCI_ADD_VF +.Nd inform a PF driver that a VF is being created +.Sh SYNOPSIS +.In sys/bus.h +.In machine/stdarg.h +.In sys/nv.h +.In dev/pci/pcireg.h +.In dev/pci/pcivar.h +.Ft int +.Fn PCI_ADD_VF "device_t dev" "uint16_t vfnum" "const nvlist_t *vf_config" +.Sh DESCRIPTION +The +.Fn PCI_ADD_VF +method is called by the PCI Single-Root I/O Virtualization +.Pq SR-IOV +infrastructure when it is initializating a new Virtual Function (VF) as a child +of the given Physical Function (PF) device. +This method will not be called until a successful call to +.Xr PCI_INIT_IOV 9 +has been made. +It is not guaranteed that this method will be called following a successful call +to +.Xr PCI_INIT_IOV 9 . +If the infrastructure encounters a failure to allocate resources following the +call to +.Xr PCI_INIT_IOV 9 , +the VF creation will be aborted and +.Xr PCI_UNINIT_IOV 9 +will be called immediately without any preceding calls to +.Nm . +.Pp +The index of the VF being initialized is passed in the +.Fa vfnum +argument. +VFs are always numbered sequentially starting at 0. +.Pp +If the driver requested device-specific configuration parameters via a VF schema +in its call to +.Xr pci_iov_attach 9 , +those parameters will be contained in the +.Pa vf_config +argument. +All configuration parameters that were either set as required parameters or that +had a default value set in the VF schema are guaranteed to be present in +.Fa vf_config . +Configuration parameters that were neither set as required nor were given a +default value are optional and may or may not be present in +.Fa vf_config . +.Fa vf_config +will not contain any configuration parameters that were not specified in the VF +schema. +All configuration parameters will have the correct type and will be in the range +of valid values specified in the schema. +.Pp +Note that it is possible for the user to set different configuration values on +different VF devices that are children of the same PF. +The PF driver must not cache configuration parameters passed in previous calls +to +.Fn PCI_ADD_VF +for other VFs and apply those parameters to the current VF. +.Pp +This function will not be called twice for the same +.Fa vf_num +on the same PF device without +.Xr PCI_UNINIT_IOV 9 +and +.Xr PCI_INIT_IOV 9 +first being called, in that order. +.Sh RETURN VALUES +This method returns 0 on success, otherwise an appropriate error is returned. +If this method returns an error then the current VF device will be destroyed +but the rest of the VF devices will be created and SR-IOV will be enabled on +the PF. +.Sh SEE ALSO +.Xr nv 9 , +.Xr pci 9 , +.Xr pci_iov_schema 9 , +.Xr PCI_INIT_IOV 9 , +.Xr PCI_UNINIT_IOV 9 +.Sh AUTHORS +This manual page was written by +.An Ryan Stone Aq Mt rstone@FreeBSD.org . Added: head/share/man/man9/PCI_INIT_IOV.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/PCI_INIT_IOV.9 Sun Mar 1 00:40:01 2015 (r279446) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2014 Sandvine Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 24, 2014 +.Dt PCI_INIT_IOV 9 +.Os +.Sh NAME +.Nm PCI_INIT_IOV +.Nd enable SR-IOV on a PF device +.Sh SYNOPSIS +.In sys/bus.h +.In machine/stdarg.h +.In sys/nv.h +.In dev/pci/pcireg.h +.In dev/pci/pcivar.h +.Ft int +.Fn PCI_INIT_IOV "device_t dev" "uint16_t num_vfs" "const nvlist_t *pf_config" +.Sh DESCRIPTION +The +.Fn PCI_INIT_IOV +method is called by the PCI Single-Root I/O Virtualization (SR-IOV) +infrastucture when the user requests that SR-IOV be enabled on a Physical +Function (PF). +The number of Virtual Functions (VFs) that will be created is passed to this +method in the +.Fa num_vfs +argument. +.Pp +If the driver requested device-specific PF configuration parameters via a PF +schema in its call to +.Xr pci_iov_attach 9 , +those parameters will be available in the +.Fa pf_config +argument. +All configuration parameters that were either set as required parameters or that +had a default value set in the PF schema are guaranteed to be present in +.Fa pf_config . +Configuration parameters that were neither set as required nor were given a +default value are optional and may or may not be present in +.Fa pf_config . +.Fa pf_config +will not contain any configuration parameters that were not specified in the PF +schema. +All configuration parameters will have the correct type and are in the range of +valid values specified in the schema. +.Pp +If this method returns successfully, then this method will not be called again +on the same device until after a call to +.Xr PCI_UNINIT_IOV . +.Sh RETURN VALUES +Returns 0 on success, otherwise an appropriate error is returned. +If this method returns an error then the SR-IOV configuration will be aborted +and no VFs will be created. +.Sh SEE ALSO +.Xr nv 9 , +.Xr pci 9 , +.Xr pci_iov_schema 9 , +.Xr PCI_ADD_VF 9 , +.Xr PCI_UNINIT_IOV 9 +.Sh AUTHORS +This manual page was written by +.An Ryan Stone Aq Mt rstone@FreeBSD.org . Added: head/share/man/man9/PCI_UNINIT_IOV.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/PCI_UNINIT_IOV.9 Sun Mar 1 00:40:01 2015 (r279446) @@ -0,0 +1,64 @@ +.\" +.\" Copyright (c) 2014 Sandvine Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 24, 2014 +.Dt PCI_UNINIT_IOV 9 +.Os +.Sh NAME +.Nm PCI_UNINIT_IOV +.Nd disable SR-IOV on a PF device +.Sh SYNOPSIS +.In sys/bus.h +.In dev/pci/pcireg.h +.In dev/pci/pcivar.h +.Ft void +.Fn PCI_UNINIT_IOV "device_t dev" +.Sh DESCRIPTION +The +.Fn PCI_UNINIT_IOV +method is called by the PCI Single-Root I/O Virtualization (SR-IOV) +infrastructure when the user requests that SR-IOV be disabled on a Physical +Function (PF). +When this method is called, the PF driver must release any SR-IOV-related +resources that it has allocated and disable any device-specific SR-IOV +configuration in the device. +.Pp +This method will only be called following a successful call to +.Xr PCI_INIT_IOV . +It is not guaranteed that +.Xr PCI_ADD_VF +will have been called for any Virtual Function (VF) after the call to +.Xr PCI_INIT_IOV +and before the call to +.Nm . +.Sh SEE ALSO +.Xr pci 9 , +.Xr PCI_ADD_VF 9 , +.Xr PCI_INIT_IOV 9 +.Sh AUTHORS +This manual page was written by +.An Ryan Stone Aq Mt rstone@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:14 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 235406C7; Sun, 1 Mar 2015 00:40:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C594163; Sun, 1 Mar 2015 00:40:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210eDrZ091020; Sun, 1 Mar 2015 00:40:13 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210eAVe090587; Sun, 1 Mar 2015 00:40:10 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210eAVe090587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279447 - in head/sys: amd64/conf conf dev/acpica dev/pci i386/conf sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:14 -0000 Author: rstone Date: Sun Mar 1 00:40:09 2015 New Revision: 279447 URL: https://svnweb.freebsd.org/changeset/base/279447 Log: Implement interface to create SR-IOV Virtual Functions Implement the interace to create SR-IOV Virtual Functions (VFs). When a driver registers that they support SR-IOV by calling pci_setup_iov(), the SR-IOV code creates a new node in /dev/iov for that device. An ioctl can be invoked on that device to create VFs and have the driver initialize them. At this point, allocating memory I/O windows (BARs) is not supported. Differential Revision: https://reviews.freebsd.org/D76 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/sys/dev/pci/pci_iov.c (contents, props changed) head/sys/dev/pci/pci_iov_private.h (contents, props changed) head/sys/sys/iov.h (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files head/sys/conf/options head/sys/dev/acpica/acpi_pci.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_private.h head/sys/dev/pci/pcireg.h head/sys/dev/pci/pcivar.h head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/amd64/conf/GENERIC Sun Mar 1 00:40:09 2015 (r279447) @@ -97,6 +97,7 @@ device cpufreq device acpi options ACPI_DMAR device pci +options PCI_IOV # PCI SR-IOV support # Floppy drives device fdc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/conf/files Sun Mar 1 00:40:09 2015 (r279447) @@ -2031,6 +2031,7 @@ dev/pci/ignore_pci.c optional pci dev/pci/isa_pci.c optional pci isa dev/pci/pci.c optional pci dev/pci/pci_if.m standard +dev/pci/pci_iov.c optional pci pci_iov dev/pci/pci_pci.c optional pci dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/conf/options Sun Mar 1 00:40:09 2015 (r279447) @@ -173,6 +173,7 @@ NO_SYSCTL_DESCR opt_global.h NSWBUF_MIN opt_swap.h MBUF_PACKET_ZONE_DISABLE opt_global.h PANIC_REBOOT_WAIT_TIME opt_panic.h +PCI_IOV opt_global.h PPC_DEBUG opt_ppc.h PPC_PROBE_CHIPSET opt_ppc.h PPS_SYNC opt_ntp.h Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/dev/acpica/acpi_pci.c Sun Mar 1 00:40:09 2015 (r279447) @@ -84,6 +84,11 @@ static int acpi_pci_set_powerstate_metho static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child); +#ifdef PCI_IOV +static device_t acpi_pci_create_iov_child(device_t bus, device_t pf, + uint16_t rid, uint16_t vid, uint16_t did); +#endif + static device_method_t acpi_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_pci_probe), @@ -98,6 +103,9 @@ static device_method_t acpi_pci_methods[ /* PCI interface */ DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), +#ifdef PCI_IOV + DEVMETHOD(pci_create_iov_child, acpi_pci_create_iov_child), +#endif DEVMETHOD_END }; @@ -345,3 +353,23 @@ acpi_pci_get_dma_tag(device_t bus, devic return (pci_get_dma_tag(bus, child)); } #endif + +#ifdef PCI_IOV +static device_t +acpi_pci_create_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, + uint16_t did) +{ + struct acpi_pci_devinfo *dinfo; + device_t vf; + + vf = pci_add_iov_child(bus, pf, sizeof(struct acpi_pci_devinfo), rid, + vid, did); + if (vf == NULL) + return (NULL); + + dinfo = device_get_ivars(vf); + dinfo->ap_handle = NULL; + return (vf); +} +#endif + Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/dev/pci/pci.c Sun Mar 1 00:40:09 2015 (r279447) @@ -189,6 +189,11 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_msix_count, pci_msix_count_method), DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD(pci_child_added, pci_child_added_method), +#ifdef PCI_IOV + DEVMETHOD(pci_iov_attach, pci_iov_attach_method), + DEVMETHOD(pci_iov_detach, pci_iov_detach_method), + DEVMETHOD(pci_create_iov_child, pci_create_iov_child_method), +#endif DEVMETHOD_END }; @@ -643,6 +648,9 @@ pci_fill_devinfo(device_t pcib, int d, i cfg->hdrtype &= ~PCIM_MFDEV; STAILQ_INIT(&cfg->maps); + cfg->devinfo_size = size; + cfg->iov = NULL; + pci_fixancient(cfg); pci_hdrtypedata(pcib, b, s, f, cfg); @@ -3546,6 +3554,51 @@ pci_add_children(device_t dev, int domai #undef REG } +#ifdef PCI_IOV +device_t +pci_add_iov_child(device_t bus, device_t pf, size_t size, uint16_t rid, + uint16_t vid, uint16_t did) +{ + struct pci_devinfo *pf_dinfo, *vf_dinfo; + device_t pcib; + int busno, slot, func; + + pf_dinfo = device_get_ivars(pf); + + /* + * Do a sanity check that we have been passed the correct size. If this + * test fails then likely the pci subclass hasn't implemented the + * pci_create_iov_child method like it's supposed it. + */ + if (size != pf_dinfo->cfg.devinfo_size) { + device_printf(pf, + "PCI subclass does not properly implement PCI_IOV\n"); + return (NULL); + } + + pcib = device_get_parent(bus); + + PCIB_DECODE_RID(pcib, rid, &busno, &slot, &func); + + vf_dinfo = pci_fill_devinfo(pcib, pci_get_domain(pcib), busno, slot, func, + vid, did, size); + + vf_dinfo->cfg.flags |= PCICFG_VF; + pci_add_child(bus, vf_dinfo); + + return (vf_dinfo->cfg.dev); +} + +device_t +pci_create_iov_child_method(device_t bus, device_t pf, uint16_t rid, + uint16_t vid, uint16_t did) +{ + + return (pci_add_iov_child(bus, pf, sizeof(struct pci_devinfo), rid, vid, + did)); +} +#endif + void pci_add_child(device_t bus, struct pci_devinfo *dinfo) { Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/dev/pci/pci_if.m Sun Mar 1 00:40:09 2015 (r279447) @@ -36,6 +36,14 @@ CODE { { return (0); } + + static device_t + null_create_iov_child(device_t bus, device_t pf, uint16_t rid, + uint16_t vid, uint16_t did) + { + device_printf(bus, "PCI_IOV not implemented on this bus.\n"); + return (NULL); + } }; @@ -189,3 +197,36 @@ METHOD void child_added { device_t dev; device_t child; }; + +METHOD int iov_attach { + device_t dev; + device_t child; +}; + +METHOD int iov_detach { + device_t dev; + device_t child; +}; + +METHOD int init_iov { + device_t dev; + uint16_t num_vfs; +}; + +METHOD void uninit_iov { + device_t dev; +}; + +METHOD int add_vf { + device_t dev; + uint16_t vfnum; +}; + +METHOD device_t create_iov_child { + device_t bus; + device_t pf; + uint16_t rid; + uint16_t vid; + uint16_t did; +} DEFAULT null_create_iov_child; + Added: head/sys/dev/pci/pci_iov.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:09 2015 (r279447) @@ -0,0 +1,385 @@ +/*- + * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "pci_if.h" +#include "pcib_if.h" + +static MALLOC_DEFINE(M_SRIOV, "sr_iov", "PCI SR-IOV allocations"); + +static d_ioctl_t pci_iov_ioctl; + +static struct cdevsw iov_cdevsw = { + .d_version = D_VERSION, + .d_name = "iov", + .d_ioctl = pci_iov_ioctl +}; + +#define IOV_READ(d, r, w) \ + pci_read_config((d)->cfg.dev, (d)->cfg.iov->iov_pos + r, w) + +#define IOV_WRITE(d, r, v, w) \ + pci_write_config((d)->cfg.dev, (d)->cfg.iov->iov_pos + r, v, w) + +int +pci_iov_attach_method(device_t bus, device_t dev) +{ + device_t pcib; + struct pci_devinfo *dinfo; + struct pcicfg_iov *iov; + uint32_t version; + int error; + int iov_pos; + + dinfo = device_get_ivars(dev); + pcib = device_get_parent(bus); + + error = pci_find_extcap(dev, PCIZ_SRIOV, &iov_pos); + + if (error != 0) + return (error); + + version = pci_read_config(dev, iov_pos, 4); + if (PCI_EXTCAP_VER(version) != 1) { + if (bootverbose) + device_printf(dev, + "Unsupported version of SR-IOV (%d) detected\n", + PCI_EXTCAP_VER(version)); + + return (ENXIO); + } + + iov = malloc(sizeof(*dinfo->cfg.iov), M_SRIOV, M_WAITOK | M_ZERO); + + mtx_lock(&Giant); + if (dinfo->cfg.iov != NULL) { + error = EBUSY; + goto cleanup; + } + + iov->iov_pos = iov_pos; + + iov->iov_cdev = make_dev(&iov_cdevsw, device_get_unit(dev), + UID_ROOT, GID_WHEEL, 0600, "iov/%s", device_get_nameunit(dev)); + + if (iov->iov_cdev == NULL) { + error = ENOMEM; + goto cleanup; + } + + dinfo->cfg.iov = iov; + iov->iov_cdev->si_drv1 = dinfo; + mtx_unlock(&Giant); + + return (0); + +cleanup: + free(iov, M_SRIOV); + mtx_unlock(&Giant); + return (error); +} + +int +pci_iov_detach_method(device_t bus, device_t dev) +{ + struct pci_devinfo *dinfo; + struct pcicfg_iov *iov; + + mtx_lock(&Giant); + dinfo = device_get_ivars(dev); + iov = dinfo->cfg.iov; + + if (iov == NULL) { + mtx_unlock(&Giant); + return (0); + } + + if (iov->iov_num_vfs != 0) { + mtx_unlock(&Giant); + return (EBUSY); + } + + dinfo->cfg.iov = NULL; + + if (iov->iov_cdev) { + destroy_dev(iov->iov_cdev); + iov->iov_cdev = NULL; + } + + free(iov, M_SRIOV); + mtx_unlock(&Giant); + + return (0); +} + +/* + * Set the ARI_EN bit in the lowest-numbered PCI function with the SR-IOV + * capability. This bit is only writeable on the lowest-numbered PF but + * affects all PFs on the device. + */ +static int +pci_iov_set_ari(device_t bus) +{ + device_t lowest; + device_t *devlist; + int i, error, devcount, lowest_func, lowest_pos, iov_pos, dev_func; + uint16_t iov_ctl; + + /* If ARI is disabled on the downstream port there is nothing to do. */ + if (!PCIB_ARI_ENABLED(device_get_parent(bus))) + return (0); + + error = device_get_children(bus, &devlist, &devcount); + + if (error != 0) + return (error); + + lowest = NULL; + for (i = 0; i < devcount; i++) { + if (pci_find_extcap(devlist[i], PCIZ_SRIOV, &iov_pos) == 0) { + dev_func = pci_get_function(devlist[i]); + if (lowest == NULL || dev_func < lowest_func) { + lowest = devlist[i]; + lowest_func = dev_func; + lowest_pos = iov_pos; + } + } + } + + /* + * If we called this function some device must have the SR-IOV + * capability. + */ + KASSERT(lowest != NULL, + ("Could not find child of %s with SR-IOV capability", + device_get_nameunit(bus))); + + iov_ctl = pci_read_config(lowest, iov_pos + PCIR_SRIOV_CTL, 2); + iov_ctl |= PCIM_SRIOV_ARI_EN; + pci_write_config(lowest, iov_pos + PCIR_SRIOV_CTL, iov_ctl, 2); + free(devlist, M_TEMP); + return (0); +} + +static int +pci_iov_config_page_size(struct pci_devinfo *dinfo) +{ + uint32_t page_cap, page_size; + + page_cap = IOV_READ(dinfo, PCIR_SRIOV_PAGE_CAP, 4); + + /* + * If the system page size is less than the smallest SR-IOV page size + * then round up to the smallest SR-IOV page size. + */ + if (PAGE_SHIFT < PCI_SRIOV_BASE_PAGE_SHIFT) + page_size = (1 << 0); + else + page_size = (1 << (PAGE_SHIFT - PCI_SRIOV_BASE_PAGE_SHIFT)); + + /* Check that the device supports the system page size. */ + if (!(page_size & page_cap)) + return (ENXIO); + + IOV_WRITE(dinfo, PCIR_SRIOV_PAGE_SIZE, page_size, 4); + return (0); +} + +static void +pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const char *driver, + uint16_t first_rid, uint16_t rid_stride) +{ + device_t bus, dev, vf; + struct pcicfg_iov *iov; + struct pci_devinfo *vfinfo; + size_t size; + int i, error; + uint16_t vid, did, next_rid; + + iov = dinfo->cfg.iov; + dev = dinfo->cfg.dev; + bus = device_get_parent(dev); + size = dinfo->cfg.devinfo_size; + next_rid = first_rid; + vid = pci_get_vendor(dev); + did = IOV_READ(dinfo, PCIR_SRIOV_VF_DID, 2); + + for (i = 0; i < iov->iov_num_vfs; i++, next_rid += rid_stride) { + + + vf = PCI_CREATE_IOV_CHILD(bus, dev, next_rid, vid, did); + if (vf == NULL) + break; + + vfinfo = device_get_ivars(vf); + + vfinfo->cfg.iov = iov; + vfinfo->cfg.vf.index = i; + + error = PCI_ADD_VF(dev, i); + if (error != 0) { + device_printf(dev, "Failed to add VF %d\n", i); + pci_delete_child(bus, vf); + } + } + + bus_generic_attach(bus); +} + +static int +pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg) +{ + device_t bus, dev; + const char *driver; + struct pci_devinfo *dinfo; + struct pcicfg_iov *iov; + int error; + uint16_t rid_off, rid_stride; + uint16_t first_rid, last_rid; + uint16_t iov_ctl; + uint16_t total_vfs; + int iov_inited; + + mtx_lock(&Giant); + dinfo = cdev->si_drv1; + iov = dinfo->cfg.iov; + dev = dinfo->cfg.dev; + bus = device_get_parent(dev); + iov_inited = 0; + + if (iov->iov_num_vfs != 0) { + mtx_unlock(&Giant); + return (EBUSY); + } + + total_vfs = IOV_READ(dinfo, PCIR_SRIOV_TOTAL_VFS, 2); + + if (arg->num_vfs > total_vfs) { + error = EINVAL; + goto out; + } + + /* + * If we are creating passthrough devices then force the ppt driver to + * attach to prevent a VF driver from claming the VFs. + */ + if (arg->passthrough) + driver = "ppt"; + else + driver = NULL; + + error = pci_iov_config_page_size(dinfo); + if (error != 0) + goto out; + + error = pci_iov_set_ari(bus); + if (error != 0) + goto out; + + error = PCI_INIT_IOV(dev, arg->num_vfs); + + if (error != 0) + goto out; + + iov_inited = 1; + IOV_WRITE(dinfo, PCIR_SRIOV_NUM_VFS, arg->num_vfs, 2); + + rid_off = IOV_READ(dinfo, PCIR_SRIOV_VF_OFF, 2); + rid_stride = IOV_READ(dinfo, PCIR_SRIOV_VF_STRIDE, 2); + + first_rid = pci_get_rid(dev) + rid_off; + last_rid = first_rid + (arg->num_vfs - 1) * rid_stride; + + /* We don't yet support allocating extra bus numbers for VFs. */ + if (pci_get_bus(dev) != PCI_RID2BUS(last_rid)) { + error = ENOSPC; + goto out; + } + + iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2); + iov_ctl &= ~(PCIM_SRIOV_VF_EN | PCIM_SRIOV_VF_MSE); + IOV_WRITE(dinfo, PCIR_SRIOV_CTL, iov_ctl, 2); + + iov->iov_num_vfs = arg->num_vfs; + + iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2); + iov_ctl |= PCIM_SRIOV_VF_EN; + IOV_WRITE(dinfo, PCIR_SRIOV_CTL, iov_ctl, 2); + + /* Per specification, we must wait 100ms before accessing VFs. */ + pause("iov", roundup(hz, 10)); + pci_iov_enumerate_vfs(dinfo, driver, first_rid, rid_stride); + mtx_unlock(&Giant); + + return (0); +out: + if (iov_inited) + PCI_UNINIT_IOV(dev); + iov->iov_num_vfs = 0; + mtx_unlock(&Giant); + return (error); +} + +static int +pci_iov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + + switch (cmd) { + case IOV_CONFIG: + return (pci_iov_config(dev, (struct pci_iov_arg *)data)); + default: + return (EINVAL); + } +} + Added: head/sys/dev/pci/pci_iov_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:09 2015 (r279447) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PCI_IOV_PRIVATE_H_ +#define _PCI_IOV_PRIVATE_H_ + +struct pcicfg_iov { + struct cdev *iov_cdev; + + int iov_pos; + int iov_num_vfs; +}; + +#endif + Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/dev/pci/pci_private.h Sun Mar 1 00:40:09 2015 (r279447) @@ -51,6 +51,8 @@ extern int pci_do_power_suspend; void pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); +device_t pci_add_iov_child(device_t bus, device_t pf, size_t dinfo_size, + uint16_t rid, uint16_t vid, uint16_t did); void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask); int pci_attach_common(device_t dev); @@ -150,4 +152,10 @@ struct resource *pci_alloc_multi_resourc int type, int *rid, u_long start, u_long end, u_long count, u_long num, u_int flags); +int pci_iov_attach_method(device_t bus, device_t dev); +int pci_iov_detach_method(device_t bus, device_t dev); + +device_t pci_create_iov_child_method(device_t bus, device_t pf, + uint16_t rid, uint16_t vid, uint16_t did); + #endif /* _PCI_PRIVATE_H_ */ Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/dev/pci/pcireg.h Sun Mar 1 00:40:09 2015 (r279447) @@ -924,3 +924,21 @@ #define PCIR_SERIAL_LOW 0x04 #define PCIR_SERIAL_HIGH 0x08 +/* SR-IOV definitions */ +#define PCIR_SRIOV_CTL 0x08 +#define PCIM_SRIOV_VF_EN 0x01 +#define PCIM_SRIOV_VF_MSE 0x08 /* Memory space enable. */ +#define PCIM_SRIOV_ARI_EN 0x10 +#define PCIR_SRIOV_TOTAL_VFS 0x0E +#define PCIR_SRIOV_NUM_VFS 0x10 +#define PCIR_SRIOV_VF_OFF 0x14 +#define PCIR_SRIOV_VF_STRIDE 0x16 +#define PCIR_SRIOV_VF_DID 0x1A +#define PCIR_SRIOV_PAGE_CAP 0x1C +#define PCIR_SRIOV_PAGE_SIZE 0x20 + +#define PCI_SRIOV_BASE_PAGE_SHIFT 12 + +#define PCIR_SRIOV_BARS 0x24 +#define PCIR_SRIOV_BAR(x) (PCIR_SRIOV_BARS + (x) * 4) + Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/dev/pci/pcivar.h Sun Mar 1 00:40:09 2015 (r279447) @@ -143,6 +143,12 @@ struct pcicfg_pcix { uint8_t pcix_location; /* Offset of PCI-X capability registers. */ }; +struct pcicfg_vf { + int index; +}; + +#define PCICFG_VF 0x0001 /* Device is an SR-IOV Virtual Function */ + /* config header information common to all header types */ typedef struct pcicfg { struct device *dev; /* device which owns this */ @@ -179,6 +185,9 @@ typedef struct pcicfg { uint8_t slot; /* config space slot address */ uint8_t func; /* config space function number */ + uint32_t flags; /* flags defined above */ + size_t devinfo_size; /* Size of devinfo for this bus type. */ + struct pcicfg_pp pp; /* Power management */ struct pcicfg_vpd vpd; /* Vital product data */ struct pcicfg_msi msi; /* PCI MSI */ @@ -186,6 +195,8 @@ typedef struct pcicfg { struct pcicfg_ht ht; /* HyperTransport */ struct pcicfg_pcie pcie; /* PCI Express */ struct pcicfg_pcix pcix; /* PCI-X */ + struct pcicfg_iov *iov; /* SR-IOV */ + struct pcicfg_vf vf; /* SR-IOV Virtual Function */ } pcicfgregs; /* additional type 1 device config header information (PCI to PCI bridge) */ @@ -513,6 +524,18 @@ pci_child_added(device_t dev) return (PCI_CHILD_ADDED(device_get_parent(dev), dev)); } +static __inline int +pci_iov_attach(device_t dev) +{ + return (PCI_IOV_ATTACH(device_get_parent(dev), dev)); +} + +static __inline int +pci_iov_detach(device_t dev) +{ + return (PCI_IOV_DETACH(device_get_parent(dev), dev)); +} + device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Mar 1 00:40:01 2015 (r279446) +++ head/sys/i386/conf/GENERIC Sun Mar 1 00:40:09 2015 (r279447) @@ -97,6 +97,7 @@ device cpufreq # Bus support. device acpi device pci +options PCI_IOV # PCI SR-IOV support # Floppy drives device fdc Added: head/sys/sys/iov.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/iov.h Sun Mar 1 00:40:09 2015 (r279447) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_IOV_H_ +#define _SYS_IOV_H_ + +#include + +struct pci_iov_arg +{ + int num_vfs; + int passthrough; +}; + +#define IOV_CONFIG _IOWR('p', 10, struct pci_iov_arg) + +#endif + From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08882802; Sun, 1 Mar 2015 00:40:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6F7C166; Sun, 1 Mar 2015 00:40:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210eKo5091082; Sun, 1 Mar 2015 00:40:20 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210eKTk091080; Sun, 1 Mar 2015 00:40:20 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210eKTk091080@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279448 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:21 -0000 Author: rstone Date: Sun Mar 1 00:40:19 2015 New Revision: 279448 URL: https://svnweb.freebsd.org/changeset/base/279448 Log: Emulate the Device ID and Vendor ID registers for VFs The SR-IOV standard requires VFs to read all-ones when the VID and DID registers are read. The VMM (hypervisor) is required to emulate them instead. Make pci_read_config() do this emulation. Change pci_user.c to use pci_read_config() to read config space registers instead of going directly to the pcib so that the emulated VID/DID registers work correctly on VFs. This is required both for pciconf and bhyve PCI passthrough. Differential Revision: https://reviews.freebsd.org/D77 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 00:40:09 2015 (r279447) +++ head/sys/dev/pci/pci.c Sun Mar 1 00:40:19 2015 (r279448) @@ -4880,6 +4880,37 @@ pci_read_config_method(device_t dev, dev struct pci_devinfo *dinfo = device_get_ivars(child); pcicfgregs *cfg = &dinfo->cfg; +#ifdef PCI_IOV + /* + * SR-IOV VFs don't implement the VID or DID registers, so we have to + * emulate them here. + */ + if (cfg->flags & PCICFG_VF) { + if (reg == PCIR_VENDOR) { + switch (width) { + case 4: + return (cfg->device << 16 | cfg->vendor); + case 2: + return (cfg->vendor); + case 1: + return (cfg->vendor & 0xff); + default: + return (0xffffffff); + } + } else if (reg == PCIR_DEVICE) { + switch (width) { + /* Note that an unaligned 4-byte read is an error. */ + case 2: + return (cfg->device); + case 1: + return (cfg->device & 0xff); + default: + return (0xffffffff); + } + } + } +#endif + return (PCIB_READ_CONFIG(device_get_parent(dev), cfg->bus, cfg->slot, cfg->func, reg, width)); } Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Sun Mar 1 00:40:09 2015 (r279447) +++ head/sys/dev/pci/pci_user.c Sun Mar 1 00:40:19 2015 (r279448) @@ -492,7 +492,7 @@ pci_list_vpd(device_t dev, struct pci_li static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { - device_t pcidev, brdev; + device_t pcidev; void *confdata; const char *name; struct devlist *devlist_head; @@ -922,37 +922,25 @@ getconfexit: io->pi_sel.pc_bus, io->pi_sel.pc_dev, io->pi_sel.pc_func); if (pcidev) { - brdev = device_get_parent( - device_get_parent(pcidev)); - #ifdef PRE7_COMPAT if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_OLD) #else if (cmd == PCIOCWRITE) #endif - PCIB_WRITE_CONFIG(brdev, - io->pi_sel.pc_bus, - io->pi_sel.pc_dev, - io->pi_sel.pc_func, + pci_write_config(pcidev, io->pi_reg, io->pi_data, io->pi_width); #ifdef PRE7_COMPAT else if (cmd == PCIOCREAD_OLD) io_old->pi_data = - PCIB_READ_CONFIG(brdev, - io->pi_sel.pc_bus, - io->pi_sel.pc_dev, - io->pi_sel.pc_func, + pci_read_config(pcidev, io->pi_reg, io->pi_width); #endif else io->pi_data = - PCIB_READ_CONFIG(brdev, - io->pi_sel.pc_bus, - io->pi_sel.pc_dev, - io->pi_sel.pc_func, + pci_read_config(pcidev, io->pi_reg, io->pi_width); error = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D257D939; Sun, 1 Mar 2015 00:40:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC3E716D; Sun, 1 Mar 2015 00:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210eSJU093011; Sun, 1 Mar 2015 00:40:28 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210eRTK093003; Sun, 1 Mar 2015 00:40:27 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210eRTK093003@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279449 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:29 -0000 Author: rstone Date: Sun Mar 1 00:40:26 2015 New Revision: 279449 URL: https://svnweb.freebsd.org/changeset/base/279449 Log: Allocate PCI I/O memory spaces for VFs When creating VFs, we must size each SR-IOV BAR on the PF and allocate a configuous I/O memory window large enough for every VF. However, the window only needs to be aligned to a boundary equal to the size of the window for a single VF. When a VF attempts to allocate an I/O memory resource, we must intercept the request in the pci driver and pass it off to the SR-IOV code, which will allocate the correct window from the pre-allocated memory space for the PF. Inform the pci driver about the size and address of the BARs on the VF when the VF is created. This is required by pciconf -b and bhyve. Differential Revision: https://reviews.freebsd.org/D78 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_iov_private.h head/sys/dev/pci/pci_private.h head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 00:40:19 2015 (r279448) +++ head/sys/dev/pci/pci.c Sun Mar 1 00:40:26 2015 (r279449) @@ -4695,11 +4695,30 @@ struct resource * pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { +#ifdef PCI_IOV + struct pci_devinfo *dinfo; +#endif if (device_get_parent(child) != dev) return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); +#ifdef PCI_IOV + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (type) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (NULL); + case SYS_RES_MEMORY: + return (pci_vf_alloc_mem_resource(dev, child, rid, + start, end, count, flags)); + } + + /* Fall through for other types of resource allocations. */ + } +#endif + return (pci_alloc_multi_resource(dev, child, type, rid, start, end, count, 1, flags)); } @@ -4718,6 +4737,22 @@ pci_release_resource(device_t dev, devic dinfo = device_get_ivars(child); cfg = &dinfo->cfg; + +#ifdef PCI_IOV + if (dinfo->cfg.flags & PCICFG_VF) { + switch (type) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EDOOFUS); + case SYS_RES_MEMORY: + return (pci_vf_release_mem_resource(dev, child, rid, + r)); + } + + /* Fall through for other types of resource allocations. */ + } +#endif + #ifdef NEW_PCIB /* * PCI-PCI bridge I/O window resources are not BARs. For Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:19 2015 (r279448) +++ head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:26 2015 (r279449) @@ -106,7 +106,6 @@ pci_iov_attach_method(device_t bus, devi error = EBUSY; goto cleanup; } - iov->iov_pos = iov_pos; iov->iov_cdev = make_dev(&iov_cdevsw, device_get_unit(dev), @@ -162,6 +161,56 @@ pci_iov_detach_method(device_t bus, devi return (0); } +static int +pci_iov_alloc_bar(struct pci_devinfo *dinfo, int bar, pci_addr_t bar_shift) +{ + struct resource *res; + struct pcicfg_iov *iov; + device_t dev, bus; + u_long start, end; + pci_addr_t bar_size; + int rid; + + iov = dinfo->cfg.iov; + dev = dinfo->cfg.dev; + bus = device_get_parent(dev); + rid = iov->iov_pos + PCIR_SRIOV_BAR(bar); + bar_size = 1 << bar_shift; + + res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, &rid, 0ul, + ~0ul, 1, iov->iov_num_vfs, RF_ACTIVE); + + if (res == NULL) + return (ENXIO); + + iov->iov_bar[bar].res = res; + iov->iov_bar[bar].bar_size = bar_size; + iov->iov_bar[bar].bar_shift = bar_shift; + + start = rman_get_start(res); + end = rman_get_end(res); + return (rman_manage_region(&iov->rman, start, end)); +} + +static void +pci_iov_add_bars(struct pcicfg_iov *iov, struct pci_devinfo *dinfo) +{ + struct pci_iov_bar *bar; + uint64_t bar_start; + int i; + + for (i = 0; i <= PCIR_MAX_BAR_0; i++) { + bar = &iov->iov_bar[i]; + if (bar->res != NULL) { + bar_start = rman_get_start(bar->res) + + dinfo->cfg.vf.index * bar->bar_size; + + pci_add_bar(dinfo->cfg.dev, PCIR_BAR(i), bar_start, + bar->bar_shift); + } + } +} + /* * Set the ARI_EN bit in the lowest-numbered PCI function with the SR-IOV * capability. This bit is only writeable on the lowest-numbered PF but @@ -235,6 +284,63 @@ pci_iov_config_page_size(struct pci_devi return (0); } +static int +pci_iov_init_rman(device_t pf, struct pcicfg_iov *iov) +{ + int error; + + iov->rman.rm_start = 0; + iov->rman.rm_end = ~0ul; + iov->rman.rm_type = RMAN_ARRAY; + snprintf(iov->rman_name, sizeof(iov->rman_name), "%s VF I/O memory", + device_get_nameunit(pf)); + iov->rman.rm_descr = iov->rman_name; + + error = rman_init(&iov->rman); + if (error != 0) + return (error); + + iov->iov_flags |= IOV_RMAN_INITED; + return (0); +} + +static int +pci_iov_setup_bars(struct pci_devinfo *dinfo) +{ + device_t dev; + struct pcicfg_iov *iov; + pci_addr_t bar_value, testval; + int i, last_64, error; + + iov = dinfo->cfg.iov; + dev = dinfo->cfg.dev; + last_64 = 0; + + for (i = 0; i <= PCIR_MAX_BAR_0; i++) { + /* + * If a PCI BAR is a 64-bit wide BAR, then it spans two + * consecutive registers. Therefore if the last BAR that + * we looked at was a 64-bit BAR, we need to skip this + * register as it's the second half of the last BAR. + */ + if (!last_64) { + pci_read_bar(dev, + iov->iov_pos + PCIR_SRIOV_BAR(i), + &bar_value, &testval, &last_64); + + if (testval != 0) { + error = pci_iov_alloc_bar(dinfo, i, + pci_mapsize(testval)); + if (error != 0) + return (error); + } + } else + last_64 = 0; + } + + return (0); +} + static void pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const char *driver, uint16_t first_rid, uint16_t rid_stride) @@ -266,6 +372,8 @@ pci_iov_enumerate_vfs(struct pci_devinfo vfinfo->cfg.iov = iov; vfinfo->cfg.vf.index = i; + pci_iov_add_bars(iov, vfinfo); + error = PCI_ADD_VF(dev, i); if (error != 0) { device_printf(dev, "Failed to add VF %d\n", i); @@ -283,7 +391,7 @@ pci_iov_config(struct cdev *cdev, struct const char *driver; struct pci_devinfo *dinfo; struct pcicfg_iov *iov; - int error; + int i, error; uint16_t rid_off, rid_stride; uint16_t first_rid, last_rid; uint16_t iov_ctl; @@ -350,10 +458,18 @@ pci_iov_config(struct cdev *cdev, struct iov_ctl &= ~(PCIM_SRIOV_VF_EN | PCIM_SRIOV_VF_MSE); IOV_WRITE(dinfo, PCIR_SRIOV_CTL, iov_ctl, 2); + error = pci_iov_init_rman(dev, iov); + if (error != 0) + goto out; + iov->iov_num_vfs = arg->num_vfs; + error = pci_iov_setup_bars(dinfo); + if (error != 0) + goto out; + iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2); - iov_ctl |= PCIM_SRIOV_VF_EN; + iov_ctl |= PCIM_SRIOV_VF_EN | PCIM_SRIOV_VF_MSE; IOV_WRITE(dinfo, PCIR_SRIOV_CTL, iov_ctl, 2); /* Per specification, we must wait 100ms before accessing VFs. */ @@ -365,6 +481,22 @@ pci_iov_config(struct cdev *cdev, struct out: if (iov_inited) PCI_UNINIT_IOV(dev); + + for (i = 0; i <= PCIR_MAX_BAR_0; i++) { + if (iov->iov_bar[i].res != NULL) { + pci_release_resource(bus, dev, SYS_RES_MEMORY, + iov->iov_pos + PCIR_SRIOV_BAR(i), + iov->iov_bar[i].res); + pci_delete_resource(bus, dev, SYS_RES_MEMORY, + iov->iov_pos + PCIR_SRIOV_BAR(i)); + iov->iov_bar[i].res = NULL; + } + } + + if (iov->iov_flags & IOV_RMAN_INITED) { + rman_fini(&iov->rman); + iov->iov_flags &= ~IOV_RMAN_INITED; + } iov->iov_num_vfs = 0; mtx_unlock(&Giant); return (error); @@ -383,3 +515,92 @@ pci_iov_ioctl(struct cdev *dev, u_long c } } +struct resource * +pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, u_long start, + u_long end, u_long count, u_int flags) +{ + struct pci_devinfo *dinfo; + struct pcicfg_iov *iov; + struct pci_map *map; + struct resource *res; + struct resource_list_entry *rle; + u_long bar_start, bar_end; + pci_addr_t bar_length; + int error; + + dinfo = device_get_ivars(child); + iov = dinfo->cfg.iov; + + map = pci_find_bar(child, *rid); + if (map == NULL) + return (NULL); + + bar_length = 1 << map->pm_size; + bar_start = map->pm_value; + bar_end = bar_start + bar_length - 1; + + /* Make sure that the resource fits the constraints. */ + if (bar_start >= end || bar_end <= bar_start || count != 1) + return (NULL); + + /* Clamp the resource to the constraints if necessary. */ + if (bar_start < start) + bar_start = start; + if (bar_end > end) + bar_end = end; + bar_length = bar_end - bar_start + 1; + + res = rman_reserve_resource(&iov->rman, bar_start, bar_end, + bar_length, flags, child); + if (res == NULL) + return (NULL); + + rle = resource_list_add(&dinfo->resources, SYS_RES_MEMORY, *rid, + bar_start, bar_end, 1); + if (rle == NULL) { + rman_release_resource(res); + return (NULL); + } + + rman_set_rid(res, *rid); + + if (flags & RF_ACTIVE) { + error = bus_activate_resource(child, SYS_RES_MEMORY, *rid, res); + if (error != 0) { + resource_list_delete(&dinfo->resources, SYS_RES_MEMORY, + *rid); + rman_release_resource(res); + return (NULL); + } + } + rle->res = res; + + return (res); +} + +int +pci_vf_release_mem_resource(device_t dev, device_t child, int rid, + struct resource *r) +{ + struct pci_devinfo *dinfo; + struct resource_list_entry *rle; + int error; + + dinfo = device_get_ivars(child); + + if (rman_get_flags(r) & RF_ACTIVE) { + error = bus_deactivate_resource(child, SYS_RES_MEMORY, rid, r); + if (error != 0) + return (error); + } + + rle = resource_list_find(&dinfo->resources, SYS_RES_MEMORY, rid); + if (rle != NULL) { + rle->res = NULL; + resource_list_delete(&dinfo->resources, SYS_RES_MEMORY, + rid); + } + + return (rman_release_resource(r)); +} + Modified: head/sys/dev/pci/pci_iov_private.h ============================================================================== --- head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:19 2015 (r279448) +++ head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:26 2015 (r279449) @@ -29,12 +29,26 @@ #ifndef _PCI_IOV_PRIVATE_H_ #define _PCI_IOV_PRIVATE_H_ +struct pci_iov_bar { + struct resource *res; + + pci_addr_t bar_size; + pci_addr_t bar_shift; +}; + struct pcicfg_iov { struct cdev *iov_cdev; + + struct pci_iov_bar iov_bar[PCIR_MAX_BAR_0 + 1]; + struct rman rman; + char rman_name[64]; int iov_pos; int iov_num_vfs; + uint32_t iov_flags; }; +#define IOV_RMAN_INITED 0x0001 + #endif Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Sun Mar 1 00:40:19 2015 (r279448) +++ head/sys/dev/pci/pci_private.h Sun Mar 1 00:40:26 2015 (r279449) @@ -158,4 +158,9 @@ int pci_iov_detach_method(device_t bus, device_t pci_create_iov_child_method(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did); +struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child, + int *rid, u_long start, u_long end, u_long count, + u_int flags); +int pci_vf_release_mem_resource(device_t dev, device_t child, + int rid, struct resource *r); #endif /* _PCI_PRIVATE_H_ */ Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sun Mar 1 00:40:19 2015 (r279448) +++ head/sys/dev/pci/pcivar.h Sun Mar 1 00:40:26 2015 (r279449) @@ -50,7 +50,7 @@ struct pcicfg_pp { struct pci_map { pci_addr_t pm_value; /* Raw BAR value */ pci_addr_t pm_size; - uint8_t pm_reg; + uint16_t pm_reg; STAILQ_ENTRY(pci_map) pm_link; }; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63D3CA71; Sun, 1 Mar 2015 00:40:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43EBF173; Sun, 1 Mar 2015 00:40:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210ea8o093073; Sun, 1 Mar 2015 00:40:36 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210eZWY093070; Sun, 1 Mar 2015 00:40:35 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210eZWY093070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279450 - in head/sys: dev/pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:36 -0000 Author: rstone Date: Sun Mar 1 00:40:34 2015 New Revision: 279450 URL: https://svnweb.freebsd.org/changeset/base/279450 Log: Add interface to destroy SR-IOV VFs Differential Revision: https://reviews.freebsd.org/D79 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_iov_private.h head/sys/sys/iov.h Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:26 2015 (r279449) +++ head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:34 2015 (r279450) @@ -143,7 +143,7 @@ pci_iov_detach_method(device_t bus, devi return (0); } - if (iov->iov_num_vfs != 0) { + if (iov->iov_num_vfs != 0 || iov->iov_flags & IOV_BUSY) { mtx_unlock(&Giant); return (EBUSY); } @@ -405,10 +405,11 @@ pci_iov_config(struct cdev *cdev, struct bus = device_get_parent(dev); iov_inited = 0; - if (iov->iov_num_vfs != 0) { + if ((iov->iov_flags & IOV_BUSY) || iov->iov_num_vfs != 0) { mtx_unlock(&Giant); return (EBUSY); } + iov->iov_flags |= IOV_BUSY; total_vfs = IOV_READ(dinfo, PCIR_SRIOV_TOTAL_VFS, 2); @@ -498,10 +499,113 @@ out: iov->iov_flags &= ~IOV_RMAN_INITED; } iov->iov_num_vfs = 0; + iov->iov_flags &= ~IOV_BUSY; mtx_unlock(&Giant); return (error); } +/* Return true if child is a VF of the given PF. */ +static int +pci_iov_is_child_vf(struct pcicfg_iov *pf, device_t child) +{ + struct pci_devinfo *vfinfo; + + vfinfo = device_get_ivars(child); + + if (!(vfinfo->cfg.flags & PCICFG_VF)) + return (0); + + return (pf == vfinfo->cfg.iov); +} + +static int +pci_iov_delete(struct cdev *cdev) +{ + device_t bus, dev, vf, *devlist; + struct pci_devinfo *dinfo; + struct pcicfg_iov *iov; + int i, error, devcount; + uint32_t iov_ctl; + + mtx_lock(&Giant); + dinfo = cdev->si_drv1; + iov = dinfo->cfg.iov; + dev = dinfo->cfg.dev; + bus = device_get_parent(dev); + devlist = NULL; + + if (iov->iov_flags & IOV_BUSY) { + mtx_unlock(&Giant); + return (EBUSY); + } + + if (iov->iov_num_vfs == 0) { + mtx_unlock(&Giant); + return (ECHILD); + } + + iov->iov_flags |= IOV_BUSY; + + error = device_get_children(bus, &devlist, &devcount); + + if (error != 0) + goto out; + + for (i = 0; i < devcount; i++) { + vf = devlist[i]; + + if (!pci_iov_is_child_vf(iov, vf)) + continue; + + error = device_detach(vf); + if (error != 0) { + device_printf(dev, + "Could not disable SR-IOV: failed to detach VF %s\n", + device_get_nameunit(vf)); + goto out; + } + } + + for (i = 0; i < devcount; i++) { + vf = devlist[i]; + + if (pci_iov_is_child_vf(iov, vf)) + pci_delete_child(bus, vf); + } + PCI_UNINIT_IOV(dev); + + iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2); + iov_ctl &= ~(PCIM_SRIOV_VF_EN | PCIM_SRIOV_VF_MSE); + IOV_WRITE(dinfo, PCIR_SRIOV_CTL, iov_ctl, 2); + IOV_WRITE(dinfo, PCIR_SRIOV_NUM_VFS, 0, 2); + + iov->iov_num_vfs = 0; + + for (i = 0; i <= PCIR_MAX_BAR_0; i++) { + if (iov->iov_bar[i].res != NULL) { + pci_release_resource(bus, dev, SYS_RES_MEMORY, + iov->iov_pos + PCIR_SRIOV_BAR(i), + iov->iov_bar[i].res); + pci_delete_resource(bus, dev, SYS_RES_MEMORY, + iov->iov_pos + PCIR_SRIOV_BAR(i)); + iov->iov_bar[i].res = NULL; + } + } + + if (iov->iov_flags & IOV_RMAN_INITED) { + rman_fini(&iov->rman); + iov->iov_flags &= ~IOV_RMAN_INITED; + } + + error = 0; +out: + free(devlist, M_TEMP); + iov->iov_flags &= ~IOV_BUSY; + mtx_unlock(&Giant); + return (error); +} + + static int pci_iov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -510,6 +614,8 @@ pci_iov_ioctl(struct cdev *dev, u_long c switch (cmd) { case IOV_CONFIG: return (pci_iov_config(dev, (struct pci_iov_arg *)data)); + case IOV_DELETE: + return (pci_iov_delete(dev)); default: return (EINVAL); } Modified: head/sys/dev/pci/pci_iov_private.h ============================================================================== --- head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:26 2015 (r279449) +++ head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:34 2015 (r279450) @@ -49,6 +49,7 @@ struct pcicfg_iov { }; #define IOV_RMAN_INITED 0x0001 +#define IOV_BUSY 0x0002 #endif Modified: head/sys/sys/iov.h ============================================================================== --- head/sys/sys/iov.h Sun Mar 1 00:40:26 2015 (r279449) +++ head/sys/sys/iov.h Sun Mar 1 00:40:34 2015 (r279450) @@ -38,6 +38,7 @@ struct pci_iov_arg }; #define IOV_CONFIG _IOWR('p', 10, struct pci_iov_arg) +#define IOV_DELETE _IO('p', 11) #endif From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94016BB0; Sun, 1 Mar 2015 00:40:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9D2179; Sun, 1 Mar 2015 00:40:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210ejLG093342; Sun, 1 Mar 2015 00:40:45 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210eg5X093140; Sun, 1 Mar 2015 00:40:42 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210eg5X093140@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279451 - in head/sys: conf dev/pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:45 -0000 Author: rstone Date: Sun Mar 1 00:40:42 2015 New Revision: 279451 URL: https://svnweb.freebsd.org/changeset/base/279451 Log: Add infrastructure for exporting config schema from PF drivers Differential Revision: https://reviews.freebsd.org/D80 MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/sys/dev/pci/pci_iov_schema.c (contents, props changed) head/sys/dev/pci/schema_private.h (contents, props changed) head/sys/sys/iov_schema.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_iov_private.h head/sys/dev/pci/pci_private.h head/sys/dev/pci/pcivar.h head/sys/sys/iov.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/conf/files Sun Mar 1 00:40:42 2015 (r279451) @@ -2032,6 +2032,7 @@ dev/pci/isa_pci.c optional pci isa dev/pci/pci.c optional pci dev/pci/pci_if.m standard dev/pci/pci_iov.c optional pci pci_iov +dev/pci/pci_iov_schema.c optional pci pci_iov dev/pci/pci_pci.c optional pci dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/dev/pci/pci_if.m Sun Mar 1 00:40:42 2015 (r279451) @@ -46,6 +46,10 @@ CODE { } }; +HEADER { + struct nvlist; +} + METHOD u_int32_t read_config { device_t dev; @@ -201,6 +205,8 @@ METHOD void child_added { METHOD int iov_attach { device_t dev; device_t child; + struct nvlist *pf_schema; + struct nvlist *vf_schema; }; METHOD int iov_detach { Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:42 2015 (r279451) @@ -46,11 +46,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include #include #include #include #include +#include #include "pci_if.h" #include "pcib_if.h" @@ -71,18 +76,30 @@ static struct cdevsw iov_cdevsw = { #define IOV_WRITE(d, r, v, w) \ pci_write_config((d)->cfg.dev, (d)->cfg.iov->iov_pos + r, v, w) +static nvlist_t *pci_iov_build_schema(nvlist_t **pf_schema, + nvlist_t **vf_schema); +static void pci_iov_build_pf_schema(nvlist_t *schema, + nvlist_t **driver_schema); +static void pci_iov_build_vf_schema(nvlist_t *schema, + nvlist_t **driver_schema); +static nvlist_t *pci_iov_get_pf_subsystem_schema(void); +static nvlist_t *pci_iov_get_vf_subsystem_schema(void); + int -pci_iov_attach_method(device_t bus, device_t dev) +pci_iov_attach_method(device_t bus, device_t dev, nvlist_t *pf_schema, + nvlist_t *vf_schema) { device_t pcib; struct pci_devinfo *dinfo; struct pcicfg_iov *iov; + nvlist_t *schema; uint32_t version; int error; int iov_pos; dinfo = device_get_ivars(dev); pcib = device_get_parent(bus); + schema = NULL; error = pci_find_extcap(dev, PCIZ_SRIOV, &iov_pos); @@ -108,6 +125,13 @@ pci_iov_attach_method(device_t bus, devi } iov->iov_pos = iov_pos; + schema = pci_iov_build_schema(&pf_schema, &vf_schema); + if (schema == NULL) { + error = ENOMEM; + goto cleanup; + } + iov->iov_schema = schema; + iov->iov_cdev = make_dev(&iov_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "iov/%s", device_get_nameunit(dev)); @@ -123,6 +147,9 @@ pci_iov_attach_method(device_t bus, devi return (0); cleanup: + nvlist_destroy(schema); + nvlist_destroy(pf_schema); + nvlist_destroy(vf_schema); free(iov, M_SRIOV); mtx_unlock(&Giant); return (error); @@ -154,6 +181,7 @@ pci_iov_detach_method(device_t bus, devi destroy_dev(iov->iov_cdev); iov->iov_cdev = NULL; } + nvlist_destroy(iov->iov_schema); free(iov, M_SRIOV); mtx_unlock(&Giant); @@ -161,6 +189,115 @@ pci_iov_detach_method(device_t bus, devi return (0); } +static nvlist_t * +pci_iov_build_schema(nvlist_t **pf, nvlist_t **vf) +{ + nvlist_t *schema, *pf_driver, *vf_driver; + + /* We always take ownership of the schemas. */ + pf_driver = *pf; + *pf = NULL; + vf_driver = *vf; + *vf = NULL; + + schema = pci_iov_schema_alloc_node(); + if (schema == NULL) + goto cleanup; + + pci_iov_build_pf_schema(schema, &pf_driver); + pci_iov_build_vf_schema(schema, &vf_driver); + + if (nvlist_error(schema) != 0) + goto cleanup; + + return (schema); + +cleanup: + nvlist_destroy(schema); + nvlist_destroy(pf_driver); + nvlist_destroy(vf_driver); + return (NULL); +} + +static void +pci_iov_build_pf_schema(nvlist_t *schema, nvlist_t **driver_schema) +{ + nvlist_t *pf_schema, *iov_schema; + + pf_schema = pci_iov_schema_alloc_node(); + if (pf_schema == NULL) { + nvlist_set_error(schema, ENOMEM); + return; + } + + iov_schema = pci_iov_get_pf_subsystem_schema(); + + /* + * Note that if either *driver_schema or iov_schema is NULL, then + * nvlist_move_nvlist will put the schema in the error state and + * SR-IOV will fail to initialize later, so we don't have to explicitly + * handle that case. + */ + nvlist_move_nvlist(pf_schema, DRIVER_CONFIG_NAME, *driver_schema); + nvlist_move_nvlist(pf_schema, IOV_CONFIG_NAME, iov_schema); + nvlist_move_nvlist(schema, PF_CONFIG_NAME, pf_schema); + *driver_schema = NULL; +} + +static void +pci_iov_build_vf_schema(nvlist_t *schema, nvlist_t **driver_schema) +{ + nvlist_t *vf_schema, *iov_schema; + + vf_schema = pci_iov_schema_alloc_node(); + if (vf_schema == NULL) { + nvlist_set_error(schema, ENOMEM); + return; + } + + iov_schema = pci_iov_get_vf_subsystem_schema(); + + /* + * Note that if either *driver_schema or iov_schema is NULL, then + * nvlist_move_nvlist will put the schema in the error state and + * SR-IOV will fail to initialize later, so we don't have to explicitly + * handle that case. + */ + nvlist_move_nvlist(vf_schema, DRIVER_CONFIG_NAME, *driver_schema); + nvlist_move_nvlist(vf_schema, IOV_CONFIG_NAME, iov_schema); + nvlist_move_nvlist(schema, VF_SCHEMA_NAME, vf_schema); + *driver_schema = NULL; +} + +static nvlist_t * +pci_iov_get_pf_subsystem_schema(void) +{ + nvlist_t *pf; + + pf = pci_iov_schema_alloc_node(); + if (pf == NULL) + return (NULL); + + pci_iov_schema_add_uint16(pf, "num_vfs", IOV_SCHEMA_REQUIRED, -1); + pci_iov_schema_add_string(pf, "device", IOV_SCHEMA_REQUIRED, NULL); + + return (pf); +} + +static nvlist_t * +pci_iov_get_vf_subsystem_schema(void) +{ + nvlist_t *vf; + + vf = pci_iov_schema_alloc_node(); + if (vf == NULL) + return (NULL); + + pci_iov_schema_add_bool(vf, "passthrough", IOV_SCHEMA_HASDEFAULT, 0); + + return (vf); +} + static int pci_iov_alloc_bar(struct pci_devinfo *dinfo, int bar, pci_addr_t bar_shift) { @@ -605,6 +742,50 @@ out: return (error); } +static int +pci_iov_get_schema_ioctl(struct cdev *cdev, struct pci_iov_schema *output) +{ + struct pci_devinfo *dinfo; + void *packed; + size_t output_len, size; + int error; + + packed = NULL; + + mtx_lock(&Giant); + dinfo = cdev->si_drv1; + packed = nvlist_pack(dinfo->cfg.iov->iov_schema, &size); + mtx_unlock(&Giant); + + if (packed == NULL) { + error = ENOMEM; + goto fail; + } + + output_len = output->len; + output->len = size; + if (size <= output_len) { + error = copyout(packed, output->schema, size); + + if (error != 0) + goto fail; + + output->error = 0; + } else + /* + * If we return an error then the ioctl code won't copyout + * output back to userland, so we flag the error in the struct + * instead. + */ + output->error = EMSGSIZE; + + error = 0; + +fail: + free(packed, M_NVLIST); + + return (error); +} static int pci_iov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, @@ -616,6 +797,9 @@ pci_iov_ioctl(struct cdev *dev, u_long c return (pci_iov_config(dev, (struct pci_iov_arg *)data)); case IOV_DELETE: return (pci_iov_delete(dev)); + case IOV_GET_SCHEMA: + return (pci_iov_get_schema_ioctl(dev, + (struct pci_iov_schema *)data)); default: return (EINVAL); } Modified: head/sys/dev/pci/pci_iov_private.h ============================================================================== --- head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/dev/pci/pci_iov_private.h Sun Mar 1 00:40:42 2015 (r279451) @@ -38,6 +38,7 @@ struct pci_iov_bar { struct pcicfg_iov { struct cdev *iov_cdev; + nvlist_t *iov_schema; struct pci_iov_bar iov_bar[PCIR_MAX_BAR_0 + 1]; struct rman rman; Added: head/sys/dev/pci/pci_iov_schema.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pci_iov_schema.c Sun Mar 1 00:40:42 2015 (r279451) @@ -0,0 +1,208 @@ +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +static const char *pci_iov_schema_valid_types[] = { + "bool", + "string", + "uint8_t", + "uint16_t", + "uint32_t", + "uint64_t", + "unicast-mac", +}; + +static void +pci_iov_schema_add_type(nvlist_t *entry, const char *type) +{ + int i, error; + + error = EINVAL; + for (i = 0; i < nitems(pci_iov_schema_valid_types); i++) { + if (strcmp(type, pci_iov_schema_valid_types[i]) == 0) { + error = 0; + break; + } + } + + if (error != 0) { + nvlist_set_error(entry, error); + return; + } + + nvlist_add_string(entry, "type", type); +} + +static void +pci_iov_schema_add_required(nvlist_t *entry, uint32_t flags) +{ + + if (flags & IOV_SCHEMA_REQUIRED) { + if (flags & IOV_SCHEMA_HASDEFAULT) { + nvlist_set_error(entry, EINVAL); + return; + } + + nvlist_add_bool(entry, "required", 1); + } +} + +void +pci_iov_schema_add_bool(nvlist_t *schema, const char *name, uint32_t flags, + int defaultVal) +{ + nvlist_t *entry; + + entry = nvlist_create(NV_FLAG_IGNORE_CASE); + if (entry == NULL) { + nvlist_set_error(schema, ENOMEM); + return; + } + + pci_iov_schema_add_type(entry, "bool"); + if (flags & IOV_SCHEMA_HASDEFAULT) + nvlist_add_bool(entry, "default", defaultVal); + pci_iov_schema_add_required(entry, flags); + + nvlist_move_nvlist(schema, name, entry); +} + +void +pci_iov_schema_add_string(nvlist_t *schema, const char *name, uint32_t flags, + const char *defaultVal) +{ + nvlist_t *entry; + + entry = nvlist_create(NV_FLAG_IGNORE_CASE); + if (entry == NULL) { + nvlist_set_error(schema, ENOMEM); + return; + } + + pci_iov_schema_add_type(entry, "string"); + if (flags & IOV_SCHEMA_HASDEFAULT) + nvlist_add_string(entry, "default", defaultVal); + pci_iov_schema_add_required(entry, flags); + + nvlist_move_nvlist(schema, name, entry); +} + +static void +pci_iov_schema_int(nvlist_t *schema, const char *name, const char *type, + uint32_t flags, uint64_t defaultVal) +{ + nvlist_t *entry; + + entry = nvlist_create(NV_FLAG_IGNORE_CASE); + if (entry == NULL) { + nvlist_set_error(schema, ENOMEM); + return; + } + + pci_iov_schema_add_type(entry, type); + if (flags & IOV_SCHEMA_HASDEFAULT) + nvlist_add_number(entry, "default", defaultVal); + pci_iov_schema_add_required(entry, flags); + + nvlist_move_nvlist(schema, name, entry); +} + +void +pci_iov_schema_add_uint8(nvlist_t *schema, const char *name, uint32_t flags, + uint8_t defaultVal) +{ + + pci_iov_schema_int(schema, name, "uint8_t", flags, defaultVal); +} + +void +pci_iov_schema_add_uint16(nvlist_t *schema, const char *name, uint32_t flags, + uint16_t defaultVal) +{ + + pci_iov_schema_int(schema, name, "uint16_t", flags, defaultVal); +} + +void +pci_iov_schema_add_uint32(nvlist_t *schema, const char *name, uint32_t flags, + uint32_t defaultVal) +{ + + pci_iov_schema_int(schema, name, "uint32_t", flags, defaultVal); +} + +void +pci_iov_schema_add_uint64(nvlist_t *schema, const char *name, uint32_t flags, + uint64_t defaultVal) +{ + + pci_iov_schema_int(schema, name, "uint64_t", flags, defaultVal); +} + +void +pci_iov_schema_add_unicast_mac(nvlist_t *schema, const char *name, + uint32_t flags, const uint8_t * defaultVal) +{ + nvlist_t *entry; + + entry = nvlist_create(NV_FLAG_IGNORE_CASE); + if (entry == NULL) { + nvlist_set_error(schema, ENOMEM); + return; + } + + pci_iov_schema_add_type(entry, "unicast-mac"); + if (flags & IOV_SCHEMA_HASDEFAULT) + nvlist_add_binary(entry, "default", defaultVal, ETHER_ADDR_LEN); + pci_iov_schema_add_required(entry, flags); + + nvlist_move_nvlist(schema, name, entry); +} + +/* Allocate a new empty schema node. */ +nvlist_t * +pci_iov_schema_alloc_node(void) +{ + + return (nvlist_create(NV_FLAG_IGNORE_CASE)); +} \ No newline at end of file Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/dev/pci/pci_private.h Sun Mar 1 00:40:42 2015 (r279451) @@ -152,7 +152,8 @@ struct resource *pci_alloc_multi_resourc int type, int *rid, u_long start, u_long end, u_long count, u_long num, u_int flags); -int pci_iov_attach_method(device_t bus, device_t dev); +int pci_iov_attach_method(device_t bus, device_t dev, + struct nvlist *pf_schema, struct nvlist *vf_schema); int pci_iov_detach_method(device_t bus, device_t dev); device_t pci_create_iov_child_method(device_t bus, device_t pf, Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/dev/pci/pcivar.h Sun Mar 1 00:40:42 2015 (r279451) @@ -39,6 +39,8 @@ typedef uint64_t pci_addr_t; +struct nvlist; + /* Interesting values for PCI power management */ struct pcicfg_pp { uint16_t pp_cap; /* PCI power management capabilities */ @@ -525,9 +527,10 @@ pci_child_added(device_t dev) } static __inline int -pci_iov_attach(device_t dev) +pci_iov_attach(device_t dev, struct nvlist *pf_schema, struct nvlist *vf_schema) { - return (PCI_IOV_ATTACH(device_get_parent(dev), dev)); + return (PCI_IOV_ATTACH(device_get_parent(dev), dev, pf_schema, + vf_schema)); } static __inline int Added: head/sys/dev/pci/schema_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/schema_private.h Sun Mar 1 00:40:42 2015 (r279451) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2014 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SCHEMA_PRIVATE_H_ +#define _SCHEMA_PRIVATE_H_ + +int pci_iov_schema_validate_config(const nvlist_t *, nvlist_t *); +uint16_t pci_iov_config_get_num_vfs(const nvlist_t *); + +#endif Modified: head/sys/sys/iov.h ============================================================================== --- head/sys/sys/iov.h Sun Mar 1 00:40:34 2015 (r279450) +++ head/sys/sys/iov.h Sun Mar 1 00:40:42 2015 (r279451) @@ -31,14 +31,141 @@ #include +#define PF_CONFIG_NAME "PF" +#define VF_SCHEMA_NAME "VF" + +#define DRIVER_CONFIG_NAME "DRIVER" +#define IOV_CONFIG_NAME "IOV" + +#define TYPE_SCHEMA_NAME "TYPE" +#define DEFAULT_SCHEMA_NAME "DEFAULT" +#define REQUIRED_SCHEMA_NAME "REQUIRED" + struct pci_iov_arg { int num_vfs; int passthrough; }; +/* + * Because each PF device is expected to expose a unique set of possible + * configurations, the SR-IOV infrastructure dynamically queries the PF + * driver for its capabilities. These capabilities are exposed to userland + * with a configuration schema. The schema is exported from the kernel as a + * packed nvlist. See nv(3) for the details of the nvlist API. The expected + * format of the nvlist is: + * + * BASIC RULES + * 1) All keys are case-insensitive. + * 2) No keys that are not specified below may exist at any level of the + * schema. + * 3) All keys are mandatory unless explicitly documented as optional. If a + * key is mandatory then the associated value is also mandatory. + * 4) Order of keys is irrelevant. + * + * TOP LEVEL + * 1) There must be a top-level key with the name PF_CONFIG_NAME. The value + * associated with this key is a nvlist that follows the device schema + * node format. The parameters in this node specify the configuration + * parameters that may be applied to a PF. + * 2) There must be a top-level key with the name VF_SCHEMA_NAME. The value + * associated with this key is a nvlist that follows the device schema + * node format. The parameters in this node specify the configuration + * parameters that may be applied to a VF. + * + * DEVICE SCHEMA NODE + * 1) There must be a key with the name DRIVER_CONFIG_NAME. The value + * associated with this key is a nvlist that follows the device/subsystem + * schema node format. The parameters in this node specify the + * configuration parameters that are specific to a particular device + * driver. + * 2) There must be a key with the name IOV_CONFIG_NAME. The value associated + * with this key is an nvlist that follows the device/subsystem schema node + * format. The parameters in this node specify the configuration + * parameters that are applied by the SR-IOV infrastructure. + * + * DEVICE/SUBSYSTEM SCHEMA NODE + * 1) All keys in the device/subsystem schema node are optional. + * 2) Each key specifies the name of a valid configuration parameter that may + * be applied to the device/subsystem combination specified by this node. + * The value associated with the key specifies the format of valid + * configuration values, and must be a nvlist in parameter schema node + * format. + * + * PARAMETER SCHEMA NODE + * 1) The parameter schema node must contain a key with the name + * TYPE_SCHEMA_NAME. The value associated with this key must be a string. + * This string specifies the type of value that the parameter specified by + * this node must take. The string must have one of the following values: + * - "bool" - The configuration value must be a boolean. + * - "mac-addr" - The configuration value must be a binary value. In + * addition, the value must be exactly 6 bytes long and + * the value must not be a multicast or broadcast mac. + * - "uint8_t" - The configuration value must be a integer value in + * the range [0, UINT8_MAX]. + * - "uint16_t" - The configuration value must be a integer value in + * the range [0, UINT16_MAX]. + * - "uint32_t" - The configuration value must be a integer value in + * the range [0, UINT32_MAX]. + * - "uint64_t" - The configuration value must be a integer value in + * the range [0, UINT64_MAX]. + * 2) The parameter schema may contain a key with the name + * REQUIRED_SCHEMA_NAME. This key is optional. If this key is present, the + * value associated with it must have a boolean type. If the value is true, + * then the parameter specified by this schema is a required parameter. All + * valid configurations must include all required parameters. + * 3) The parameter schema may contain a key with the name DEFAULT_SCHEMA_NAME. + * This key is optional. This key must not be present if the parameter + * specified by this schema is required. If this key is present, the value + * associated with the parent key must follow all restrictions specified by + * the type specified by this schema. If a configuration does not supply a + * value for the parameter specified by this schema, then the kernel will + * apply the value associated with this key in its place. + * + * The following is an example of a valid schema, as printed by nvlist_dump. + * Keys are printed followed by the type of the value in parantheses. The + * value is displayed following a colon. The indentation level reflects the + * level of nesting of nvlists. String values are displayed between [] + * brackets. Binary values are shown with the length of the binary value (in + * bytes) followed by the actual binary values. + * + * PF (NVLIST): + * IOV (NVLIST): + * num_vfs (NVLIST): + * type (STRING): [uint16_t] + * required (BOOL): TRUE + * device (NVLIST): + * type (STRING): [string] + * required (BOOL): TRUE + * DRIVER (NVLIST): + * VF (NVLIST): + * IOV (NVLIST): + * passthrough (NVLIST): + * type (STRING): [bool] + * default (BOOL): FALSE + * DRIVER (NVLIST): + * mac-addr (NVLIST): + * type (STRING): [mac-addr] + * default (BINARY): 6 000000000000 + * vlan (NVLIST): + * type (STRING): [uint16_t] + * spoof-check (NVLIST): + * type (STRING): [bool] + * default (BOOL): TRUE + * allow-set-mac (NVLIST): + * type (STRING): [bool] + * default (BOOL): FALSE + */ +struct pci_iov_schema +{ + void *schema; + size_t len; + int error; +}; + #define IOV_CONFIG _IOWR('p', 10, struct pci_iov_arg) #define IOV_DELETE _IO('p', 11) +#define IOV_GET_SCHEMA _IOWR('p', 12, struct pci_iov_schema) #endif Added: head/sys/sys/iov_schema.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/iov_schema.h Sun Mar 1 00:40:42 2015 (r279451) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_IOV_SCHEMA_H_ +#define _SYS_IOV_SCHEMA_H_ + +#define IOV_SCHEMA_HASDEFAULT (1 << 0) +#define IOV_SCHEMA_REQUIRED (1 << 1) + +nvlist_t *pci_iov_schema_alloc_node(void); + +void pci_iov_schema_add_bool(nvlist_t *schema, const char *name, + uint32_t flags, int defaultVal); +void pci_iov_schema_add_string(nvlist_t *schema, const char *name, + uint32_t flags, const char *defaultVal); +void pci_iov_schema_add_uint8(nvlist_t *schema, const char *name, + uint32_t flags, uint8_t defaultVal); +void pci_iov_schema_add_uint16(nvlist_t *schema, const char *name, + uint32_t flags, uint16_t defaultVal); +void pci_iov_schema_add_uint32(nvlist_t *schema, const char *name, + uint32_t flags, uint32_t defaultVal); +void pci_iov_schema_add_uint64(nvlist_t *schema, const char *name, + uint32_t flags, uint64_t defaultVal); +void pci_iov_schema_add_unicast_mac(nvlist_t *schema, const char *name, + uint32_t flags, const uint8_t * defaultVal); + +#endif From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48AD8CE6; Sun, 1 Mar 2015 00:40:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B5917C; Sun, 1 Mar 2015 00:40:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210eqLS093669; Sun, 1 Mar 2015 00:40:52 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210epK0093667; Sun, 1 Mar 2015 00:40:51 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210epK0093667@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279452 - in head/sys: dev/pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:52 -0000 Author: rstone Date: Sun Mar 1 00:40:51 2015 New Revision: 279452 URL: https://svnweb.freebsd.org/changeset/base/279452 Log: Add function to validate the consistency of SR-IOV config Add a function that validates that the user-provided SR-IOV configuration is valid. This includes basic checks that the structure of the configuration is correct (e.g. all required configuration nodes are present) as well as validating against a configuration schema. The schema validation consists of: - Ensuring that all required config parameters are present. - If the schema defines a default value for a parameter, adding the default value if the parameter is not set. - Ensuring that no parameters are specified in the config that are not defined in the schema. - Ensuring that have the correct type defined in the schema. - Ensuring that no configuration nodes are present for devices that do not exist. For example, if 2 VFs are configured, then we validate that a node called VF-5 does not exist. Differential Revision: https://reviews.freebsd.org/D81 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci_iov_schema.c head/sys/sys/iov.h Modified: head/sys/dev/pci/pci_iov_schema.c ============================================================================== --- head/sys/dev/pci/pci_iov_schema.c Sun Mar 1 00:40:42 2015 (r279451) +++ head/sys/dev/pci/pci_iov_schema.c Sun Mar 1 00:40:51 2015 (r279452) @@ -29,47 +29,72 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include #include #include +#include #include #include +#include + #include -static const char *pci_iov_schema_valid_types[] = { - "bool", - "string", - "uint8_t", - "uint16_t", - "uint32_t", - "uint64_t", - "unicast-mac", +struct config_type_validator; +typedef int (validate_func)(const struct config_type_validator *, + const nvlist_t *, const char *name); + +static validate_func pci_iov_schema_validate_bool; +static validate_func pci_iov_schema_validate_string; +static validate_func pci_iov_schema_validate_uint; +static validate_func pci_iov_schema_validate_unicast_mac; + +struct config_type_validator { + const char *type_name; + validate_func *validate; + uintmax_t limit; }; -static void -pci_iov_schema_add_type(nvlist_t *entry, const char *type) +static struct config_type_validator pci_iov_schema_validators[] = { + { "bool", pci_iov_schema_validate_bool }, + { "string", pci_iov_schema_validate_string }, + { "uint8_t", pci_iov_schema_validate_uint, UINT8_MAX }, + { "uint16_t", pci_iov_schema_validate_uint, UINT16_MAX }, + { "uint32_t", pci_iov_schema_validate_uint, UINT32_MAX }, + { "uint64_t", pci_iov_schema_validate_uint, UINT64_MAX }, + { "unicast-mac", pci_iov_schema_validate_unicast_mac }, +}; + +static const struct config_type_validator * +pci_iov_schema_find_validator(const char *type) { - int i, error; + struct config_type_validator *validator; + int i; - error = EINVAL; - for (i = 0; i < nitems(pci_iov_schema_valid_types); i++) { - if (strcmp(type, pci_iov_schema_valid_types[i]) == 0) { - error = 0; - break; - } + for (i = 0; i < nitems(pci_iov_schema_validators); i++) { + validator = &pci_iov_schema_validators[i]; + if (strcmp(type, validator->type_name) == 0) + return (validator); } - if (error != 0) { - nvlist_set_error(entry, error); + return (NULL); +} + +static void +pci_iov_schema_add_type(nvlist_t *entry, const char *type) +{ + + if (pci_iov_schema_find_validator(type) == NULL) { + nvlist_set_error(entry, EINVAL); return; } - nvlist_add_string(entry, "type", type); } @@ -199,10 +224,385 @@ pci_iov_schema_add_unicast_mac(nvlist_t nvlist_move_nvlist(schema, name, entry); } +static int +pci_iov_schema_validate_bool(const struct config_type_validator * validator, + const nvlist_t *config, const char *name) +{ + + if (!nvlist_exists_bool(config, name)) + return (EINVAL); + return (0); +} + +static int +pci_iov_schema_validate_string(const struct config_type_validator * validator, + const nvlist_t *config, const char *name) +{ + + if (!nvlist_exists_string(config, name)) + return (EINVAL); + return (0); +} + +static int +pci_iov_schema_validate_uint(const struct config_type_validator * validator, + const nvlist_t *config, const char *name) +{ + uint64_t value; + + if (!nvlist_exists_number(config, name)) + return (EINVAL); + + value = nvlist_get_number(config, name); + + if (value > validator->limit) + return (EINVAL); + + return (0); +} + +static int +pci_iov_schema_validate_unicast_mac( + const struct config_type_validator * validator, + const nvlist_t *config, const char *name) +{ + const uint8_t *mac; + size_t size; + + if (!nvlist_exists_binary(config, name)) + return (EINVAL); + + mac = nvlist_get_binary(config, name, &size); + + if (size != ETHER_ADDR_LEN) + return (EINVAL); + + if (ETHER_IS_MULTICAST(mac)) + return (EINVAL); + + return (0); +} + +static void +pci_iov_config_add_default(const nvlist_t *param_schema, const char *name, + nvlist_t *config) +{ + const void *binary; + size_t len; + + if (nvlist_exists_binary(param_schema, "default")) { + binary = nvlist_get_binary(param_schema, "default", &len); + nvlist_add_binary(config, name, binary, len); + } else if (nvlist_exists_bool(param_schema, "default")) + nvlist_add_bool(config, name, + nvlist_get_bool(param_schema, "default")); + else if (nvlist_exists_number(param_schema, "default")) + nvlist_add_number(config, name, + nvlist_get_number(param_schema, "default")); + else if (nvlist_exists_nvlist(param_schema, "default")) + nvlist_add_nvlist(config, name, + nvlist_get_nvlist(param_schema, "default")); + else if (nvlist_exists_string(param_schema, "default")) + nvlist_add_string(config, name, + nvlist_get_string(param_schema, "default")); + else + panic("Unexpected nvlist type"); +} + +/* + * Validate that all required parameters from the schema are specified in the + * config. If any parameter with a default value is not specified in the + * config, add it to config. + */ +static int +pci_iov_schema_validate_required(const nvlist_t *schema, nvlist_t *config) +{ + const nvlist_t *param_schema; + const char *name; + void *cookie; + int type; + + cookie = NULL; + while ((name = nvlist_next(schema, &type, &cookie)) != NULL) { + param_schema = nvlist_get_nvlist(schema, name); + + if (dnvlist_get_bool(param_schema, "required", 0)) { + if (!nvlist_exists(config, name)) + return (EINVAL); + } + + if (nvlist_exists(param_schema, "default") && + !nvlist_exists(config, name)) + pci_iov_config_add_default(param_schema, name, config); + } + + return (nvlist_error(config)); +} + +static int +pci_iov_schema_validate_param(const nvlist_t *schema_param, const char *name, + const nvlist_t *config) +{ + const struct config_type_validator *validator; + const char *type; + + type = nvlist_get_string(schema_param, "type"); + validator = pci_iov_schema_find_validator(type); + + KASSERT(validator != NULL, + ("Schema was not validated: Unknown type %s", type)); + + return (validator->validate(validator, config, name)); +} + +/* + * Validate that all parameters in config are defined in the schema. Also + * validate that the type of the parameter matches the type in the schema. + */ +static int +pci_iov_schema_validate_types(const nvlist_t *schema, const nvlist_t *config) +{ + const nvlist_t *schema_param; + void *cookie; + const char *name; + int type, error; + + cookie = NULL; + while ((name = nvlist_next(config, &type, &cookie)) != NULL) { + if (!nvlist_exists_nvlist(schema, name)) + return (EINVAL); + + schema_param = nvlist_get_nvlist(schema, name); + + error = pci_iov_schema_validate_param(schema_param, name, + config); + + if (error != 0) + return (error); + } + + return (0); +} + +static int +pci_iov_schema_validate_device(const nvlist_t *schema, nvlist_t *config, + const char *schema_device, const char *config_device) +{ + const nvlist_t *device_schema, *iov_schema, *driver_schema; + nvlist_t *device_config, *iov_config, *driver_config; + int error; + + device_config = NULL; + iov_config = NULL; + driver_config = NULL; + + device_schema = nvlist_get_nvlist(schema, schema_device); + iov_schema = nvlist_get_nvlist(device_schema, IOV_CONFIG_NAME); + driver_schema = nvlist_get_nvlist(device_schema, DRIVER_CONFIG_NAME); + + device_config = dnvlist_take_nvlist(config, config_device, NULL); + if (device_config == NULL) { + error = EINVAL; + goto out; + } + + iov_config = dnvlist_take_nvlist(device_config, IOV_CONFIG_NAME, NULL); + if (iov_config == NULL) { + error = EINVAL; + goto out; + } + + driver_config = dnvlist_take_nvlist(device_config, DRIVER_CONFIG_NAME, + NULL); + if (driver_config == NULL) { + error = EINVAL; + goto out; + } + + error = pci_iov_schema_validate_required(iov_schema, iov_config); + if (error != 0) + goto out; + + error = pci_iov_schema_validate_required(driver_schema, driver_config); + if (error != 0) + goto out; + + error = pci_iov_schema_validate_types(iov_schema, iov_config); + if (error != 0) + goto out; + + error = pci_iov_schema_validate_types(driver_schema, driver_config); + if (error != 0) + goto out; + +out: + /* Note that these functions handle NULL pointers safely. */ + nvlist_move_nvlist(device_config, IOV_CONFIG_NAME, iov_config); + nvlist_move_nvlist(device_config, DRIVER_CONFIG_NAME, driver_config); + nvlist_move_nvlist(config, config_device, device_config); + + return (error); +} + +static int +pci_iov_schema_validate_vfs(const nvlist_t *schema, nvlist_t *config, + uint16_t num_vfs) +{ + char device[VF_MAX_NAME]; + int i, error; + + for (i = 0; i < num_vfs; i++) { + snprintf(device, sizeof(device), VF_PREFIX"%d", i); + + error = pci_iov_schema_validate_device(schema, config, + VF_SCHEMA_NAME, device); + if (error != 0) + return (error); + } + + return (0); +} + +/* + * Validate that the device node only has IOV and DRIVER subnodes. + */ +static int +pci_iov_schema_validate_device_subsystems(const nvlist_t *config) +{ + void *cookie; + const char *name; + int type; + + cookie = NULL; + while ((name = nvlist_next(config, &type, &cookie)) != NULL) { + if (strcasecmp(name, IOV_CONFIG_NAME) == 0) + continue; + else if (strcasecmp(name, DRIVER_CONFIG_NAME) == 0) + continue; + + return (EINVAL); + } + + return (0); +} + +/* + * Validate that the string is a valid device node name. It must either be "PF" + * or "VF-n", where n is an integer in the range [0, num_vfs). + */ +static int +pci_iov_schema_validate_dev_name(const char *name, uint16_t num_vfs) +{ + const char *number_start; + char *endp; + u_long vf_num; + + if (strcasecmp(PF_CONFIG_NAME, name) == 0) + return (0); + + /* Ensure that we start with "VF-" */ + if (strncasecmp(name, VF_PREFIX, VF_PREFIX_LEN) != 0) + return (EINVAL); + + number_start = name + VF_PREFIX_LEN; + + /* Filter out name == "VF-" (no number) */ + if (number_start[0] == '\0') + return (EINVAL); + + /* Disallow leading whitespace or +/- */ + if (!isdigit(number_start[0])) + return (EINVAL); + + vf_num = strtoul(number_start, &endp, 10); + if (*endp != '\0') + return (EINVAL); + + /* Disallow leading zeros on VF-[1-9][0-9]* */ + if (vf_num != 0 && number_start[0] == '0') + return (EINVAL); + + /* Disallow leading zeros on VF-0 */ + if (vf_num == 0 && number_start[1] != '\0') + return (EINVAL); + + if (vf_num >= num_vfs) + return (EINVAL); + + return (0); +} + +/* + * Validate that there are no device nodes in config other than the ones for + * the PF and the VFs. This includes validating that all config nodes of the + * form VF-n specify a VF number that is < num_vfs. + */ +static int +pci_iov_schema_validate_device_names(const nvlist_t *config, uint16_t num_vfs) +{ + const nvlist_t *device; + void *cookie; + const char *name; + int type, error; + + cookie = NULL; + while ((name = nvlist_next(config, &type, &cookie)) != NULL) { + error = pci_iov_schema_validate_dev_name(name, num_vfs); + if (error != 0) + return (error); + + /* + * Note that as this is a valid PF/VF node, we know that + * pci_iov_schema_validate_device() has already checked that + * the PF/VF node is an nvlist. + */ + device = nvlist_get_nvlist(config, name); + error = pci_iov_schema_validate_device_subsystems(device); + if (error != 0) + return (error); + } + + return (0); +} + +int +pci_iov_schema_validate_config(const nvlist_t *schema, nvlist_t *config) +{ + int error; + uint16_t num_vfs; + + error = pci_iov_schema_validate_device(schema, config, PF_CONFIG_NAME, + PF_CONFIG_NAME); + if (error != 0) + return (error); + + num_vfs = pci_iov_config_get_num_vfs(config); + + error = pci_iov_schema_validate_vfs(schema, config, num_vfs); + if (error != 0) + return (error); + + return (pci_iov_schema_validate_device_names(config, num_vfs)); +} + +/* + * Return value of the num_vfs parameter. config must have already been + * validated, which guarantees that the parameter exists. + */ +uint16_t +pci_iov_config_get_num_vfs(const nvlist_t *config) +{ + const nvlist_t *pf, *iov; + + pf = nvlist_get_nvlist(config, PF_CONFIG_NAME); + iov = nvlist_get_nvlist(pf, IOV_CONFIG_NAME); + return (nvlist_get_number(iov, "num_vfs")); +} + /* Allocate a new empty schema node. */ nvlist_t * pci_iov_schema_alloc_node(void) { return (nvlist_create(NV_FLAG_IGNORE_CASE)); -} \ No newline at end of file +} Modified: head/sys/sys/iov.h ============================================================================== --- head/sys/sys/iov.h Sun Mar 1 00:40:42 2015 (r279451) +++ head/sys/sys/iov.h Sun Mar 1 00:40:51 2015 (r279452) @@ -34,6 +34,11 @@ #define PF_CONFIG_NAME "PF" #define VF_SCHEMA_NAME "VF" +#define VF_PREFIX "VF-" +#define VF_PREFIX_LEN 3 +#define VF_NUM_LEN 5 /* The maximum VF num is 65535. */ +#define VF_MAX_NAME (VF_PREFIX_LEN + VF_NUM_LEN + 1) + #define DRIVER_CONFIG_NAME "DRIVER" #define IOV_CONFIG_NAME "IOV" From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:40:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7ED9AE1C; Sun, 1 Mar 2015 00:40:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA31181; Sun, 1 Mar 2015 00:40:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210exxC093750; Sun, 1 Mar 2015 00:40:59 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210ewSw093743; Sun, 1 Mar 2015 00:40:58 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010040.t210ewSw093743@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279453 - in head/sys: dev/pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:40:59 -0000 Author: rstone Date: Sun Mar 1 00:40:57 2015 New Revision: 279453 URL: https://svnweb.freebsd.org/changeset/base/279453 Log: Pass SR-IOV configuration to kernel using an nvlist Pass all SR-IOV configuration to the kernel using an nvlist. The main benefit that this offers is flexibility. It allows a driver to accept any number of parameters of any type supported by the SR-IOV configuration infrastructure with having to make any changes outside of the driver. It also offers the user very fine-grained control over the configuration of the VFs -- if they want, they can have different configuration applied to every VF. Differential Revision: https://reviews.freebsd.org/D82 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_iov.c head/sys/sys/iov.h Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Sun Mar 1 00:40:51 2015 (r279452) +++ head/sys/dev/pci/pci_if.m Sun Mar 1 00:40:57 2015 (r279453) @@ -217,6 +217,7 @@ METHOD int iov_detach { METHOD int init_iov { device_t dev; uint16_t num_vfs; + const struct nvlist *config; }; METHOD void uninit_iov { @@ -226,6 +227,7 @@ METHOD void uninit_iov { METHOD int add_vf { device_t dev; uint16_t vfnum; + const struct nvlist *config; }; METHOD device_t create_iov_child { Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:51 2015 (r279452) +++ head/sys/dev/pci/pci_iov.c Sun Mar 1 00:40:57 2015 (r279453) @@ -70,6 +70,18 @@ static struct cdevsw iov_cdevsw = { .d_ioctl = pci_iov_ioctl }; +SYSCTL_DECL(_hw_pci); + +/* + * The maximum amount of memory we will allocate for user configuration of an + * SR-IOV device. 1MB ought to be enough for anyone, but leave this + * configurable just in case. + */ +static u_long pci_iov_max_config = 1024 * 1024; +SYSCTL_ULONG(_hw_pci, OID_AUTO, iov_max_config, CTLFLAG_RWTUN, + &pci_iov_max_config, 0, "Maximum allowed size of SR-IOV configuration."); + + #define IOV_READ(d, r, w) \ pci_read_config((d)->cfg.dev, (d)->cfg.iov->iov_pos + r, w) @@ -348,6 +360,51 @@ pci_iov_add_bars(struct pcicfg_iov *iov, } } +static int +pci_iov_parse_config(struct pcicfg_iov *iov, struct pci_iov_arg *arg, + nvlist_t **ret) +{ + void *packed_config; + nvlist_t *config; + int error; + + config = NULL; + packed_config = NULL; + + if (arg->len > pci_iov_max_config) { + error = EMSGSIZE; + goto out; + } + + packed_config = malloc(arg->len, M_SRIOV, M_WAITOK); + + error = copyin(arg->config, packed_config, arg->len); + if (error != 0) + goto out; + + config = nvlist_unpack(packed_config, arg->len); + if (config == NULL) { + error = EINVAL; + goto out; + } + + error = pci_iov_schema_validate_config(iov->iov_schema, config); + if (error != 0) + goto out; + + error = nvlist_error(config); + if (error != 0) + goto out; + + *ret = config; + config = NULL; + +out: + nvlist_destroy(config); + free(packed_config, M_SRIOV); + return (error); +} + /* * Set the ARI_EN bit in the lowest-numbered PCI function with the SR-IOV * capability. This bit is only writeable on the lowest-numbered PF but @@ -422,6 +479,16 @@ pci_iov_config_page_size(struct pci_devi } static int +pci_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t *config) +{ + const nvlist_t *device, *driver_config; + + device = nvlist_get_nvlist(config, PF_CONFIG_NAME); + driver_config = nvlist_get_nvlist(device, DRIVER_CONFIG_NAME); + return (PCI_INIT_IOV(dev, num_vfs, driver_config)); +} + +static int pci_iov_init_rman(device_t pf, struct pcicfg_iov *iov) { int error; @@ -479,9 +546,11 @@ pci_iov_setup_bars(struct pci_devinfo *d } static void -pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const char *driver, +pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const nvlist_t *config, uint16_t first_rid, uint16_t rid_stride) { + char device_name[VF_MAX_NAME]; + const nvlist_t *device, *driver_config, *iov_config; device_t bus, dev, vf; struct pcicfg_iov *iov; struct pci_devinfo *vfinfo; @@ -498,12 +567,23 @@ pci_iov_enumerate_vfs(struct pci_devinfo did = IOV_READ(dinfo, PCIR_SRIOV_VF_DID, 2); for (i = 0; i < iov->iov_num_vfs; i++, next_rid += rid_stride) { - + snprintf(device_name, sizeof(device_name), VF_PREFIX"%d", i); + device = nvlist_get_nvlist(config, device_name); + iov_config = nvlist_get_nvlist(device, IOV_CONFIG_NAME); + driver_config = nvlist_get_nvlist(device, DRIVER_CONFIG_NAME); vf = PCI_CREATE_IOV_CHILD(bus, dev, next_rid, vid, did); if (vf == NULL) break; + /* + * If we are creating passthrough devices then force the ppt + * driver to attach to prevent a VF driver from claiming the + * VFs. + */ + if (nvlist_get_bool(iov_config, "passthrough")) + device_set_devclass(vf, "ppt"); + vfinfo = device_get_ivars(vf); vfinfo->cfg.iov = iov; @@ -511,7 +591,7 @@ pci_iov_enumerate_vfs(struct pci_devinfo pci_iov_add_bars(iov, vfinfo); - error = PCI_ADD_VF(dev, i); + error = PCI_ADD_VF(dev, i, driver_config); if (error != 0) { device_printf(dev, "Failed to add VF %d\n", i); pci_delete_child(bus, vf); @@ -525,14 +605,14 @@ static int pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg) { device_t bus, dev; - const char *driver; struct pci_devinfo *dinfo; struct pcicfg_iov *iov; + nvlist_t *config; int i, error; uint16_t rid_off, rid_stride; uint16_t first_rid, last_rid; uint16_t iov_ctl; - uint16_t total_vfs; + uint16_t num_vfs, total_vfs; int iov_inited; mtx_lock(&Giant); @@ -541,6 +621,7 @@ pci_iov_config(struct cdev *cdev, struct dev = dinfo->cfg.dev; bus = device_get_parent(dev); iov_inited = 0; + config = NULL; if ((iov->iov_flags & IOV_BUSY) || iov->iov_num_vfs != 0) { mtx_unlock(&Giant); @@ -548,22 +629,17 @@ pci_iov_config(struct cdev *cdev, struct } iov->iov_flags |= IOV_BUSY; - total_vfs = IOV_READ(dinfo, PCIR_SRIOV_TOTAL_VFS, 2); + error = pci_iov_parse_config(iov, arg, &config); + if (error != 0) + goto out; - if (arg->num_vfs > total_vfs) { + num_vfs = pci_iov_config_get_num_vfs(config); + total_vfs = IOV_READ(dinfo, PCIR_SRIOV_TOTAL_VFS, 2); + if (num_vfs > total_vfs) { error = EINVAL; goto out; } - /* - * If we are creating passthrough devices then force the ppt driver to - * attach to prevent a VF driver from claming the VFs. - */ - if (arg->passthrough) - driver = "ppt"; - else - driver = NULL; - error = pci_iov_config_page_size(dinfo); if (error != 0) goto out; @@ -572,19 +648,18 @@ pci_iov_config(struct cdev *cdev, struct if (error != 0) goto out; - error = PCI_INIT_IOV(dev, arg->num_vfs); - + error = pci_init_iov(dev, num_vfs, config); if (error != 0) goto out; - iov_inited = 1; - IOV_WRITE(dinfo, PCIR_SRIOV_NUM_VFS, arg->num_vfs, 2); + + IOV_WRITE(dinfo, PCIR_SRIOV_NUM_VFS, num_vfs, 2); rid_off = IOV_READ(dinfo, PCIR_SRIOV_VF_OFF, 2); rid_stride = IOV_READ(dinfo, PCIR_SRIOV_VF_STRIDE, 2); first_rid = pci_get_rid(dev) + rid_off; - last_rid = first_rid + (arg->num_vfs - 1) * rid_stride; + last_rid = first_rid + (num_vfs - 1) * rid_stride; /* We don't yet support allocating extra bus numbers for VFs. */ if (pci_get_bus(dev) != PCI_RID2BUS(last_rid)) { @@ -600,7 +675,7 @@ pci_iov_config(struct cdev *cdev, struct if (error != 0) goto out; - iov->iov_num_vfs = arg->num_vfs; + iov->iov_num_vfs = num_vfs; error = pci_iov_setup_bars(dinfo); if (error != 0) @@ -612,7 +687,10 @@ pci_iov_config(struct cdev *cdev, struct /* Per specification, we must wait 100ms before accessing VFs. */ pause("iov", roundup(hz, 10)); - pci_iov_enumerate_vfs(dinfo, driver, first_rid, rid_stride); + pci_iov_enumerate_vfs(dinfo, config, first_rid, rid_stride); + + nvlist_destroy(config); + iov->iov_flags &= ~IOV_BUSY; mtx_unlock(&Giant); return (0); @@ -635,6 +713,8 @@ out: rman_fini(&iov->rman); iov->iov_flags &= ~IOV_RMAN_INITED; } + + nvlist_destroy(config); iov->iov_num_vfs = 0; iov->iov_flags &= ~IOV_BUSY; mtx_unlock(&Giant); Modified: head/sys/sys/iov.h ============================================================================== --- head/sys/sys/iov.h Sun Mar 1 00:40:51 2015 (r279452) +++ head/sys/sys/iov.h Sun Mar 1 00:40:57 2015 (r279453) @@ -46,12 +46,6 @@ #define DEFAULT_SCHEMA_NAME "DEFAULT" #define REQUIRED_SCHEMA_NAME "REQUIRED" -struct pci_iov_arg -{ - int num_vfs; - int passthrough; -}; - /* * Because each PF device is expected to expose a unique set of possible * configurations, the SR-IOV infrastructure dynamically queries the PF @@ -168,7 +162,94 @@ struct pci_iov_schema int error; }; -#define IOV_CONFIG _IOWR('p', 10, struct pci_iov_arg) +/* + * SR-IOV configuration is passed to the kernel as a packed nvlist. See nv(3) + * for the details of the nvlist API. The expected format of the nvlist is: + * + * BASIC RULES + * 1) All keys are case-insensitive. + * 2) No keys that are not specified below may exist at any level of the + * config nvlist. + * 3) Unless otherwise specified, all keys are optional. It should go without + * saying a key being mandatory is transitive: that is, if a key is + * specified to contain a sub-nodes that contains a mandatory key, then + * the outer key is implicitly mandatory. If a key is mandatory then the + * associated value is also mandatory. + * 4) Order of keys is irrelevant. + * + * TOP LEVEL OF CONFIG NVLIST + * 1) All keys specified in this section are mandatory. + * 2) There must be a top-level key with the name PF_CONFIG_NAME. The value + * associated is an nvlist that follows the "device node" format. The + * parameters in this node specify parameters that apply to the PF. + * 3) For every VF being configured (this is set via the "num_vfs" parameter + * in the PF section), there must be a top-level key whose name is VF_PREFIX + * immediately followed by the index of the VF as a decimal integer. For + * example, this would be VF-0 for the first VF. VFs are numbered starting + * from 0. The value associated with this key follows the "device node" + * format. The parameters in this node specify configuration that applies + * to the VF specified in the key. Leading zeros are not permitted in VF + * index. Configuration for the second VF must be specified in a node with + * the key VF-1. VF-01 is not a valid key. + * + * DEVICE NODES + * 1) All keys specified in this section are mandatory. + * 2) The device node must contain a key with the name DRIVER_CONFIG_NAME. The + * value associated with this key is an nvlist following the subsystem node + * format. The parameters in this key specify configuration that is specific + * to a particular device driver. + * 3) The device node must contain a key with the name IOV_CONFIG_NAME. The + * value associated with this key is an nvlist following the subsystem node + * format. The parameters in this key specify configuration that is consumed + * by the SR-IOV infrastructure. + * + * SUBSYSTEM NODES + * 1) A subsystem node specifies configuration parameters that apply to a + * particular subsystem (driver or infrastructure) of a particular device + * (PF or individual VF). + * Note: We will refer to the section of the configuration schema that + * specifies the parameters for this subsystem and device + * configuration as the device/subystem schema. + * 2) The subsystem node must contain only keys that correspond to parameters + * that are specified in the device/subsystem schema. + * 3) Every parameter specified as required in the device/subsystem schema is + * a mandatory key in the subsystem node. + * Note: All parameters that are not required in device/subsystem schema are + * optional keys. In particular, any parameter specified to have a + * default value in the device/subsystem schema is optional. The + * kernel is responsible for applying default values. + * 4) The value of every parameter in the device node must conform to the + * restrictions of the type specified for that parameter in the device/ + * subsystem schema. + * + * The following is an example of a valid configuration, when validated against + * the schema example given above. + * + * PF (NVLIST): + * driver (NVLIST): + * iov (NVLIST): + * num_vfs (NUMBER): 3 (3) (0x3) + * device (STRING): [ix0] + * VF-0 (NVLIST): + * driver (NVLIST): + * vlan (NUMBER): 1000 (1000) (0x3e8) + * iov (NVLIST): + * passthrough (BOOL): TRUE + * VF-1 (NVLIST): + * driver (NVLIST): + * iov (NVLIST): + * VF-2 (NVLIST): + * driver (NVLIST): + * mac-addr (BINARY): 6 020102030405 + * iov (NVLIST): + */ +struct pci_iov_arg +{ + void *config; + size_t len; +}; + +#define IOV_CONFIG _IOW('p', 10, struct pci_iov_arg) #define IOV_DELETE _IO('p', 11) #define IOV_GET_SCHEMA _IOWR('p', 12, struct pci_iov_schema) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:41:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E4FBF57; Sun, 1 Mar 2015 00:41:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7963F18E; Sun, 1 Mar 2015 00:41:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210fIiY094314; Sun, 1 Mar 2015 00:41:18 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210fI2v094313; Sun, 1 Mar 2015 00:41:18 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010041.t210fI2v094313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279454 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:41:18 -0000 Author: rstone Date: Sun Mar 1 00:41:17 2015 New Revision: 279454 URL: https://svnweb.freebsd.org/changeset/base/279454 Log: Add main() for iovctl and hook iovctl into build Differential Revision: https://reviews.freebsd.org/D87 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Mar 1 00:40:57 2015 (r279453) +++ head/usr.sbin/Makefile Sun Mar 1 00:41:17 2015 (r279454) @@ -35,6 +35,7 @@ SUBDIR= adduser \ i2c \ ifmcstat \ iostat \ + iovctl \ kldxref \ mailwrapper \ makefs \ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:44:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8D3A173; Sun, 1 Mar 2015 00:44:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4012240; Sun, 1 Mar 2015 00:44:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210iFXr094783; Sun, 1 Mar 2015 00:44:15 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210iFjw094782; Sun, 1 Mar 2015 00:44:15 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010044.t210iFjw094782@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279455 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:44:16 -0000 Author: rstone Date: Sun Mar 1 00:44:15 2015 New Revision: 279455 URL: https://svnweb.freebsd.org/changeset/base/279455 Log: Revert r279454. The new directory didn't get added to svn properly. Pointy hat to: rstone Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Mar 1 00:41:17 2015 (r279454) +++ head/usr.sbin/Makefile Sun Mar 1 00:44:15 2015 (r279455) @@ -35,7 +35,6 @@ SUBDIR= adduser \ i2c \ ifmcstat \ iostat \ - iovctl \ kldxref \ mailwrapper \ makefs \ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:47:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 174BB2E6; Sun, 1 Mar 2015 00:47:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC33D260; Sun, 1 Mar 2015 00:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210lcHl095258; Sun, 1 Mar 2015 00:47:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210lcuH095256; Sun, 1 Mar 2015 00:47:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503010047.t210lcuH095256@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 1 Mar 2015 00:47:38 +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: r279456 - in stable: 10/contrib/libcxxrt 9/contrib/libcxxrt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:47:39 -0000 Author: dim Date: Sun Mar 1 00:47:37 2015 New Revision: 279456 URL: https://svnweb.freebsd.org/changeset/base/279456 Log: MFC r279307: Make libcxxrt's parsing of DWARF exception handling tables work on architectures with strict alignment, by using memcpy() instead of directly reading fields. Reported by: Daisuke Aoyama Reviewed by: imp, bapt Tested by: bapt Differential Revision: https://reviews.freebsd.org/D1967 MFC r279310: Since newer versions of compiler-rt require unwind.h, and we want to use the copy in libcxxrt for it, fix the arm-specific header to define the _Unwind_Action type. Submitted by: andrew Modified: stable/9/contrib/libcxxrt/dwarf_eh.h stable/9/contrib/libcxxrt/unwind-arm.h Directory Properties: stable/9/contrib/libcxxrt/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/libcxxrt/dwarf_eh.h stable/10/contrib/libcxxrt/unwind-arm.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/libcxxrt/dwarf_eh.h ============================================================================== --- stable/9/contrib/libcxxrt/dwarf_eh.h Sun Mar 1 00:44:15 2015 (r279455) +++ stable/9/contrib/libcxxrt/dwarf_eh.h Sun Mar 1 00:47:37 2015 (r279456) @@ -218,15 +218,17 @@ static int64_t read_sleb128(dw_eh_ptr_t static uint64_t read_value(char encoding, dw_eh_ptr_t *data) { enum dwarf_data_encoding type = get_encoding(encoding); - uint64_t v; switch (type) { // Read fixed-length types #define READ(dwarf, type) \ case dwarf:\ - v = static_cast(*reinterpret_cast(*data));\ - *data += sizeof(type);\ - break; + {\ + type t;\ + memcpy(&t, *data, sizeof t);\ + *data += sizeof t;\ + return static_cast(t);\ + } READ(DW_EH_PE_udata2, uint16_t) READ(DW_EH_PE_udata4, uint32_t) READ(DW_EH_PE_udata8, uint64_t) @@ -237,15 +239,11 @@ static uint64_t read_value(char encoding #undef READ // Read variable-length types case DW_EH_PE_sleb128: - v = read_sleb128(data); - break; + return read_sleb128(data); case DW_EH_PE_uleb128: - v = read_uleb128(data); - break; + return read_uleb128(data); default: abort(); } - - return v; } /** Modified: stable/9/contrib/libcxxrt/unwind-arm.h ============================================================================== --- stable/9/contrib/libcxxrt/unwind-arm.h Sun Mar 1 00:44:15 2015 (r279455) +++ stable/9/contrib/libcxxrt/unwind-arm.h Sun Mar 1 00:47:37 2015 (r279456) @@ -36,6 +36,8 @@ _URC_FATAL_PHASE1_ERROR = _URC_FAILURE } _Unwind_Reason_Code; +typedef int _Unwind_Action; + typedef uint32_t _Unwind_State; #ifdef __clang__ static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:47:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF86B2E7; Sun, 1 Mar 2015 00:47:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC13261; Sun, 1 Mar 2015 00:47:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210ld1p095268; Sun, 1 Mar 2015 00:47:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210ldc2095263; Sun, 1 Mar 2015 00:47:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503010047.t210ldc2095263@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 1 Mar 2015 00:47:39 +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: r279456 - in stable: 10/contrib/libcxxrt 9/contrib/libcxxrt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:47:39 -0000 Author: dim Date: Sun Mar 1 00:47:37 2015 New Revision: 279456 URL: https://svnweb.freebsd.org/changeset/base/279456 Log: MFC r279307: Make libcxxrt's parsing of DWARF exception handling tables work on architectures with strict alignment, by using memcpy() instead of directly reading fields. Reported by: Daisuke Aoyama Reviewed by: imp, bapt Tested by: bapt Differential Revision: https://reviews.freebsd.org/D1967 MFC r279310: Since newer versions of compiler-rt require unwind.h, and we want to use the copy in libcxxrt for it, fix the arm-specific header to define the _Unwind_Action type. Submitted by: andrew Modified: stable/10/contrib/libcxxrt/dwarf_eh.h stable/10/contrib/libcxxrt/unwind-arm.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libcxxrt/dwarf_eh.h stable/9/contrib/libcxxrt/unwind-arm.h Directory Properties: stable/9/contrib/libcxxrt/ (props changed) Modified: stable/10/contrib/libcxxrt/dwarf_eh.h ============================================================================== --- stable/10/contrib/libcxxrt/dwarf_eh.h Sun Mar 1 00:44:15 2015 (r279455) +++ stable/10/contrib/libcxxrt/dwarf_eh.h Sun Mar 1 00:47:37 2015 (r279456) @@ -218,15 +218,17 @@ static int64_t read_sleb128(dw_eh_ptr_t static uint64_t read_value(char encoding, dw_eh_ptr_t *data) { enum dwarf_data_encoding type = get_encoding(encoding); - uint64_t v; switch (type) { // Read fixed-length types #define READ(dwarf, type) \ case dwarf:\ - v = static_cast(*reinterpret_cast(*data));\ - *data += sizeof(type);\ - break; + {\ + type t;\ + memcpy(&t, *data, sizeof t);\ + *data += sizeof t;\ + return static_cast(t);\ + } READ(DW_EH_PE_udata2, uint16_t) READ(DW_EH_PE_udata4, uint32_t) READ(DW_EH_PE_udata8, uint64_t) @@ -237,15 +239,11 @@ static uint64_t read_value(char encoding #undef READ // Read variable-length types case DW_EH_PE_sleb128: - v = read_sleb128(data); - break; + return read_sleb128(data); case DW_EH_PE_uleb128: - v = read_uleb128(data); - break; + return read_uleb128(data); default: abort(); } - - return v; } /** Modified: stable/10/contrib/libcxxrt/unwind-arm.h ============================================================================== --- stable/10/contrib/libcxxrt/unwind-arm.h Sun Mar 1 00:44:15 2015 (r279455) +++ stable/10/contrib/libcxxrt/unwind-arm.h Sun Mar 1 00:47:37 2015 (r279456) @@ -36,6 +36,8 @@ _URC_FATAL_PHASE1_ERROR = _URC_FAILURE } _Unwind_Reason_Code; +typedef int _Unwind_Action; + typedef uint32_t _Unwind_State; #ifdef __clang__ static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:52:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83090574; Sun, 1 Mar 2015 00:52:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D45A341; Sun, 1 Mar 2015 00:52:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210qGLH099709; Sun, 1 Mar 2015 00:52:16 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210qGsS099708; Sun, 1 Mar 2015 00:52:16 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010052.t210qGsS099708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279457 - head/usr.sbin/iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:52:16 -0000 Author: rstone Date: Sun Mar 1 00:52:15 2015 New Revision: 279457 URL: https://svnweb.freebsd.org/changeset/base/279457 Log: Add a manpage for iovctl(8) Differential Revision: https://reviews.freebsd.org/D83 Reviewed by: wblock MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/usr.sbin/iovctl/ head/usr.sbin/iovctl/iovctl.8 (contents, props changed) Added: head/usr.sbin/iovctl/iovctl.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/iovctl.8 Sun Mar 1 00:52:15 2015 (r279457) @@ -0,0 +1,123 @@ +.\" +.\" Copyright (c) 2014 Sandvine Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 21, 2014 +.Dt IOVCTL 8 +.Os +.Sh NAME +.Nm iovctl +.Nd "PCI SR-IOV configuration utility" +.Sh SYNOPSIS +.Nm +.Fl C +.Op Fl f Ar config-file +.Op Fl n +.Nm +.Fl D +.Op Fl f Ar config-file | Fl d Ar device +.Op Fl n +.Nm +.Fl S +.Op Fl f Ar config-file | Fl d Ar device +.Sh DESCRIPTION +The +.Nm +utility creates or destroys PCI Single-Root I/O Virtualization +.Pq SR-IOV +Virtual Functions +.Po VFs Pc . +When invoked with the +.Fl C +flag, +.Nm +creates VFs as children of the Physical Function +.Pq PF +configured in the specified configuration file. +When invoked with the +.Fl D +flag, +.Nm +destroys all VFs that are children of the specified device. +Available PF devices can be seen in +.Pa /dev/iov/ . +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl C +Enable SR-IOV on the specified PF device and create VF children. +This operation will fail if the PF already has VF children. +This option must be used in conjunction with the +.Fl f +option. +.It Fl d Ar device +Specify the PF device to use for the given operation. +.Ar device +may either be the name of a PF device, or a full path name to a node in +.Pa /dev/iov/ . +This option may not be used with the +.Fl C +option. +.It Fl D +Delete all VF children of the specified PF device. +This operation will fail if SR-IOV is not currently enabled on the specified +device. +.It Fl f Ar config-file +Specify the pathname of the configuration file. +For the +.Fl C +option, this file will be used to specify all configuration values. +For the +.Fl D +and +.Fl S +options, this file will only be used to specify the name of the PF device. +.Pp +See +.Xr iovctl.conf +for a description of the config file format and documentation of the +configuration parameters that apply to all PF drivers. +See the PF driver manual page for configuration parameters specific to +particular hardware. +.It Fl n +Perform a dry-run. +Perform all validation of the specified action and print what would be done, +but do not perform the actual creation or destruction of VFs. +This option may not be used with the +.Fl S +flag. +.It Fl S +Read the configuration schema from the specified device and print its contents +to stdout. +This action may be used to discover the configuration parameters supported on +a given PF device. +.El +.Sh SEE ALSO +.Xr iovctl.conf 5 , +.Xr rc.conf 5 +.Sh AUTHORS +This manual page was written by +.An Ryan Stone Aq Mt rstone@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:52:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDD606AA; Sun, 1 Mar 2015 00:52:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7B89344; Sun, 1 Mar 2015 00:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210qMBI099765; Sun, 1 Mar 2015 00:52:22 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210qMHC099764; Sun, 1 Mar 2015 00:52:22 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010052.t210qMHC099764@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279458 - head/usr.sbin/iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:52:22 -0000 Author: rstone Date: Sun Mar 1 00:52:21 2015 New Revision: 279458 URL: https://svnweb.freebsd.org/changeset/base/279458 Log: Add manpage documenting iovctl config file format. Differential Revision: https://reviews.freebsd.org/D84 Reviewed by: emaste, bcr, wblock MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/usr.sbin/iovctl/iovctl.conf.5 (contents, props changed) Added: head/usr.sbin/iovctl/iovctl.conf.5 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/iovctl.conf.5 Sun Mar 1 00:52:21 2015 (r279458) @@ -0,0 +1,167 @@ +.\" +.\" Copyright (c) 2014 Sandvine Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 21, 2014 +.Dt IOVCTL.CONF 5 +.Os +.Sh NAME +.Nm iovctl.conf +.Nd IOVCTL configuration file +.Sh DESCRIPTION +The +.Nm +file is the configuration file for the +.Xr iovctl 8 +program. +This file specifies configuration parameters for a single Physical Function +.Pq PF +device. +To configure SR-IOV on multiple PF devices, use one configuration file for each +PF. +The locations of all +.Xr iovctl 9 +configuration files are specified in +.Xr rc.conf 5 . +.Pp +The +.Nm +file uses UCL format. +UCL syntax is documented at the official UCL website: +http://github.com/vstakhov/libucl. +.Pp +There are three types of sections in the +.Nm +file. +A section is a key at the top level of the file with a list as its value. +The list may contain the keys specified in the +.Sx OPTIONS +section of this manual page. +Individual PF driver implementations may specify additional device-specific +configuration keys that they will accept. +The order in which sections appear in +.Nm +is ignored. +No two sections may have the same key. +For example, two sections for VF-1 must not be defined. +.Pp +The first section type is the PF section. +This section always has the key "PF"; therefore, only one such section may be +defined. +This section defines configuration parameters that apply to the PF as a whole. +.Pp +The second section type is the VF section. +This section has the key "VF-" followed by a VF index. +VF indices start at 0 and always increment by 1. +Valid VF indices are in the range of 0 to +.Po num_vfs - 1 Pc . +The VF index must be given as a decimal integer with no leading zeros. +This section defines configuration parameters that apply to a single VF. +.Pp +The third section type is the default section. +This section always has the key "DEFAULT"; therefore, only one such section may +be specified. +This section defines default configuration parameters that apply to all VFs. +All configuration keys that are valid to be applied to a VF are valid in this +section. +An individual VF section may override a default specified in this section by +providing a different value for the configuration parameter. +Note that the default section applies to ALL VFs. +The default section must appear before any VF sections. +The default may appear before or after the PF section. +.Pp +The following option types are supported: +.Bl -tag -width indent +.It boolean +Accepts a boolean value of true or false. +.It mac-addr +Accepts a unicast MAC address specified as a string of the form +xx:xx:xx:xx:xx:xx, where xx is one or two hexadecimal digits. +.It string +Accepts any string value. +.It uint8_t +Accepts any integer in the range 0-255, inclusive. +.It uint16_t +Accepts any integer in the range 0-65535, inclusive. +.It uint32_t +Accepts any integer in the range 0-2**32, inclusive. +.It uint64_t +Accepts any integer in the range 0-2**64, inclusive. +.El +.Sh OPTIONS +The following parameters are accepted by all PF drivers: +.Bl -tag -width indent +.It device Pq string +This parameter specifies the name of the PF device. +This parameter is required to be specified. +.It num_vfs Pq uint16_t +This parameter specifies the number of VF children to create. +This parameter may not be zero. +The maximum value of this parameter is device-specific. +.El +.Pp +The following parameters are accepted by all VFs: +.Bl -tag -width indent +.It passthrough Pq boolean +This parameter controls whether the VF is reserved for the use of the +.Xr bhyve 8 +hypervisor as a PCI passthrough device. +If this parameter is set to true, then the VF will be reserved as a PCI +passthrough device and it will not be accessible from the host OS. +The default value of this parameter is false. +.El +.Pp +See the PF driver manual page for configuration parameters specific to +particular hardware. +.Sh EXAMPLES +This sample file will create 3 VFs as children of the ix0 device. +VF-1 and VF-2 are set as +.Xr bhyve 8 +passthrough devices through the use of the default section. +VF-0 is not configured as a passthrough device as it explicitly overrides the +default. +VF-0 also sets a device-specific parameter named mac-addr. +.Bd -literal .offset ident +PF { + device : "ix0"; + num_vfs : 3; +} + +DEFAULT { + passthrough : true; +} + +VF-0 { + mac-addr : "02:56:48:7e:d9:f7"; + passthrough : false; +} +.Ed +.Sh SEE ALSO +.Xr iovctl 8 , +.Xr rc.conf 5 +.Sh AUTHORS +This manual page was written by +.An Ryan Stone Aq Mt rstone@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:52:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AB8E7E8; Sun, 1 Mar 2015 00:52:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34DF4349; Sun, 1 Mar 2015 00:52:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210qTWK099826; Sun, 1 Mar 2015 00:52:29 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210qTBs099821; Sun, 1 Mar 2015 00:52:29 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010052.t210qTBs099821@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279459 - head/usr.sbin/iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:52:29 -0000 Author: rstone Date: Sun Mar 1 00:52:28 2015 New Revision: 279459 URL: https://svnweb.freebsd.org/changeset/base/279459 Log: Add iovctl functions for validating config Add an function to iovctl that validates the configuration against a schema. This function is able to assume that the parser has done most of the validation already and it's only responsible for applying default VF values specified in the config file, confirming that all required parameters have been set and that no invalid VF numbers have been specified. Differential Revision: https://reviews.freebsd.org/D85 Reviewed by: bcr MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/usr.sbin/iovctl/validate.c (contents, props changed) Added: head/usr.sbin/iovctl/validate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/validate.c Sun Mar 1 00:52:28 2015 (r279459) @@ -0,0 +1,274 @@ +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include + +#include "iovctl.h" + +/* + * Returns a writeable pointer to the configuration for the given device. + * If no configuration exists, a new nvlist with empty driver and iov + * sections is allocated and returned. + * + * Returning a writeable pointer requires removing the configuration from config + * using nvlist_take. It is the responsibility of the caller to re-insert the + * nvlist in config with nvlist_move_nvlist. + */ +static nvlist_t * +find_config(nvlist_t *config, const char * device) +{ + nvlist_t *subsystem, *empty_driver, *empty_iov; + + subsystem = dnvlist_take_nvlist(config, device, NULL); + + if (subsystem != NULL) + return (subsystem); + + empty_driver = nvlist_create(NV_FLAG_IGNORE_CASE); + if (empty_driver == NULL) + err(1, "Could not allocate config nvlist"); + + empty_iov = nvlist_create(NV_FLAG_IGNORE_CASE); + if (empty_iov == NULL) + err(1, "Could not allocate config nvlist"); + + subsystem = nvlist_create(NV_FLAG_IGNORE_CASE); + if (subsystem == NULL) + err(1, "Could not allocate config nvlist"); + + nvlist_move_nvlist(subsystem, DRIVER_CONFIG_NAME, empty_driver); + nvlist_move_nvlist(subsystem, IOV_CONFIG_NAME, empty_iov); + + return (subsystem); +} + +static uint16_t +parse_vf_num(const char *key, regmatch_t *matches) +{ + u_long vf_num; + + vf_num = strtoul(key + matches[1].rm_so, NULL, 10); + + if (vf_num > UINT16_MAX) + errx(1, "VF number %lu is too large to be valid", + vf_num); + + return (vf_num); +} + +/* + * Apply the default values specified in device_defaults to the specified + * subsystem in the given device_config. + * + * This function assumes that the values specified in device_defaults have + * already been validated. + */ +static void +apply_subsystem_defaults(nvlist_t *device_config, const char *subsystem, + const nvlist_t *device_defaults) +{ + nvlist_t *config; + const nvlist_t *defaults; + const char *name; + void *cookie; + size_t len; + const void *bin; + int type; + + config = nvlist_take_nvlist(device_config, subsystem); + defaults = nvlist_get_nvlist(device_defaults, subsystem); + + cookie = NULL; + while ((name = nvlist_next(defaults, &type, &cookie)) != NULL) { + if (nvlist_exists(config, name)) + continue; + + switch (type) { + case NV_TYPE_BOOL: + nvlist_add_bool(config, name, + nvlist_get_bool(defaults, name)); + break; + case NV_TYPE_NUMBER: + nvlist_add_number(config, name, + nvlist_get_number(defaults, name)); + break; + case NV_TYPE_STRING: + nvlist_add_string(config, name, + nvlist_get_string(defaults, name)); + break; + case NV_TYPE_NVLIST: + nvlist_add_nvlist(config, name, + nvlist_get_nvlist(defaults, name)); + break; + case NV_TYPE_BINARY: + bin = nvlist_get_binary(defaults, name, &len); + nvlist_add_binary(config, name, bin, len); + break; + default: + errx(1, "Unexpected type '%d'", type); + } + } + nvlist_move_nvlist(device_config, subsystem, config); +} + +/* + * Iterate over every subsystem in the given VF device and apply default values + * for parameters that were not configured with a value. + * + * This function assumes that the values specified in defaults have already been + * validated. + */ +static void +apply_defaults(nvlist_t *vf, const nvlist_t *defaults) +{ + + apply_subsystem_defaults(vf, DRIVER_CONFIG_NAME, defaults); + apply_subsystem_defaults(vf, IOV_CONFIG_NAME, defaults); +} + +/* + * Validate that all required parameters have been configured in the specified + * subsystem. + */ +static void +validate_subsystem(const nvlist_t *device, const nvlist_t *device_schema, + const char *subsystem_name, const char *config_name) +{ + const nvlist_t *subsystem, *schema, *config; + const char *name; + void *cookie; + int type; + + subsystem = nvlist_get_nvlist(device, subsystem_name); + schema = nvlist_get_nvlist(device_schema, subsystem_name); + + cookie = NULL; + while ((name = nvlist_next(schema, &type, &cookie)) != NULL) { + config = nvlist_get_nvlist(schema, name); + + if (dnvlist_get_bool(config, REQUIRED_SCHEMA_NAME, false)) { + if (!nvlist_exists(subsystem, name)) + errx(1, + "Required parameter '%s' not found in '%s'", + name, config_name); + } + } +} + +/* + * Validate that all required parameters have been configured in all subsystems + * in the device. + */ +static void +validate_device(const nvlist_t *device, const nvlist_t *schema, + const char *config_name) +{ + + validate_subsystem(device, schema, DRIVER_CONFIG_NAME, config_name); + validate_subsystem(device, schema, IOV_CONFIG_NAME, config_name); +} + +static uint16_t +get_num_vfs(const nvlist_t *pf) +{ + const nvlist_t *iov; + + iov = nvlist_get_nvlist(pf, IOV_CONFIG_NAME); + return (nvlist_get_number(iov, "num_vfs")); +} + +/* + * Validates the configuration that has been parsed into config using the given + * config schema. Note that the parser is required to not insert configuration + * keys that are not valid in the schema, and to not insert configuration values + * that are of the incorrect type. Therefore this function will not validate + * either condition. This function is only responsible for inserting config + * file defaults in individual VF sections and removing the DEFAULT_SCHEMA_NAME + * subsystem from config, validating that all required parameters in the schema + * are present in each PF and VF subsystem, and that there is no VF subsystem + * section whose number exceeds num_vfs. + */ +void +validate_config(nvlist_t *config, const nvlist_t *schema, const regex_t *vf_pat) +{ + char device_name[VF_MAX_NAME]; + regmatch_t matches[2]; + nvlist_t *defaults, *pf, *vf; + const nvlist_t *vf_schema; + const char *key; + void *cookie; + int i, type; + uint16_t vf_num, num_vfs; + + pf = find_config(config, PF_CONFIG_NAME); + validate_device(pf, nvlist_get_nvlist(schema, PF_CONFIG_NAME), + PF_CONFIG_NAME); + nvlist_move_nvlist(config, PF_CONFIG_NAME, pf); + + num_vfs = get_num_vfs(pf); + vf_schema = nvlist_get_nvlist(schema, VF_SCHEMA_NAME); + + if (num_vfs == 0) + errx(1, "PF.num_vfs must be at least 1"); + + defaults = dnvlist_take_nvlist(config, DEFAULT_SCHEMA_NAME, NULL); + + for (i = 0; i < num_vfs; i++) { + snprintf(device_name, sizeof(device_name), VF_PREFIX"%d", + i); + + vf = find_config(config, device_name); + + if (defaults != NULL) + apply_defaults(vf, defaults); + + validate_device(vf, vf_schema, device_name); + nvlist_move_nvlist(config, device_name, vf); + } + nvlist_destroy(defaults); + + cookie = NULL; + while ((key = nvlist_next(config, &type, &cookie)) != NULL) { + if (regexec(vf_pat, key, nitems(matches), matches, 0) == 0) { + vf_num = parse_vf_num(key, matches); + if (vf_num >= num_vfs) + errx(1, + "VF number %d is out of bounds (num_vfs=%d)", + vf_num, num_vfs); + } + } +} + From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:52:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D221A91F; Sun, 1 Mar 2015 00:52:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4A2F34D; Sun, 1 Mar 2015 00:52:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210qZ3e099894; Sun, 1 Mar 2015 00:52:35 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210qZwc099893; Sun, 1 Mar 2015 00:52:35 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010052.t210qZwc099893@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279460 - head/usr.sbin/iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:52:35 -0000 Author: rstone Date: Sun Mar 1 00:52:34 2015 New Revision: 279460 URL: https://svnweb.freebsd.org/changeset/base/279460 Log: Add functions for parsing the iovctl config file Add two functions for parsing the iovctl config file. The config file is parsed using libucl[1], which accepts most YAML files and a superset of JSON. The first function is an ad-hoc parser that searches the file for the PF.DEVICE configuration value. We need to know that value in order to fetch the schema from the kernel, and we need the schema in order to be able to fully parse the file. The second function parses the config file and validates it against a schema. This function will exit with an error message if any validation error occurs. If it succeeds, the configuration is returned as an nvlist suitable for passing to the kernel. [1] https://github.com/vstakhov/libucl Differential Revision: https://reviews.freebsd.org/D86 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/usr.sbin/iovctl/parse.c (contents, props changed) Added: head/usr.sbin/iovctl/parse.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/parse.c Sun Mar 1 00:52:34 2015 (r279460) @@ -0,0 +1,416 @@ +/*- + * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iovctl.h" + +static void +report_config_error(const char *key, const ucl_object_t *obj, const char *type) +{ + + errx(1, "Value '%s' of key '%s' is not of type %s", + ucl_object_tostring(obj), key, type); +} + +/* + * Verifies that the value specified in the config file is a boolean value, and + * then adds the value to the configuration. + */ +static void +add_bool_config(const char *key, const ucl_object_t *obj, nvlist_t *config) +{ + bool val; + + if (!ucl_object_toboolean_safe(obj, &val)) + report_config_error(key, obj, "bool"); + + nvlist_add_bool(config, key, val); +} + +/* + * Verifies that the value specified in the config file is a string, and then + * adds the value to the configuration. + */ +static void +add_string_config(const char *key, const ucl_object_t *obj, nvlist_t *config) +{ + const char *val; + + if (!ucl_object_tostring_safe(obj, &val)) + report_config_error(key, obj, "string"); + + nvlist_add_string(config, key, val); +} + +/* + * Verifies that the value specified in the config file is a integer value + * within the specified range, and then adds the value to the configuration. + */ +static void +add_uint_config(const char *key, const ucl_object_t *obj, nvlist_t *config, + const char *type, uint64_t max) +{ + int64_t val; + uint64_t uval; + + /* I must use a signed type here as libucl doesn't provide unsigned. */ + if (!ucl_object_toint_safe(obj, &val)) + report_config_error(key, obj, type); + + if (val < 0) + report_config_error(key, obj, type); + + uval = val; + if (uval > max) + report_config_error(key, obj, type); + + nvlist_add_number(config, key, uval); +} + +/* + * Verifies that the value specified in the config file is a unicast MAC + * address, and then adds the value to the configuration. + */ +static void +add_unicast_mac_config(const char *key, const ucl_object_t *obj, nvlist_t *config) +{ + uint8_t mac[ETHER_ADDR_LEN]; + const char *val, *token; + char *parse, *orig_parse, *tokpos, *endpos; + size_t len; + u_long value; + int i; + + if (!ucl_object_tostring_safe(obj, &val)) + report_config_error(key, obj, "unicast-mac"); + + parse = strdup(val); + orig_parse = parse; + + i = 0; + while ((token = strtok_r(parse, ":", &tokpos)) != NULL) { + parse = NULL; + + len = strlen(token); + if (len < 1 || len > 2) + report_config_error(key, obj, "unicast-mac"); + + value = strtoul(token, &endpos, 16); + + if (*endpos != '\0') + report_config_error(key, obj, "unicast-mac"); + + if (value > UINT8_MAX) + report_config_error(key, obj, "unicast-mac"); + + if (i >= ETHER_ADDR_LEN) + report_config_error(key, obj, "unicast-mac"); + + mac[i] = value; + i++; + } + + free(orig_parse); + + if (i != ETHER_ADDR_LEN) + report_config_error(key, obj, "unicast-mac"); + + if (ETHER_IS_MULTICAST(mac)) + errx(1, "Value '%s' of key '%s' is a multicast address", + ucl_object_tostring(obj), key); + + nvlist_add_binary(config, key, mac, ETHER_ADDR_LEN); +} + +/* + * Validates that the given configuation value has the right type as specified + * in the schema, and then adds the value to the configuation node. + */ +static void +add_config(const char *key, const ucl_object_t *obj, nvlist_t *config, + const nvlist_t *schema) +{ + const char *type; + + type = nvlist_get_string(schema, TYPE_SCHEMA_NAME); + + if (strcasecmp(type, "bool") == 0) + add_bool_config(key, obj, config); + else if (strcasecmp(type, "string") == 0) + add_string_config(key, obj, config); + else if (strcasecmp(type, "uint8_t") == 0) + add_uint_config(key, obj, config, type, UINT8_MAX); + else if (strcasecmp(type, "uint16_t") == 0) + add_uint_config(key, obj, config, type, UINT16_MAX); + else if (strcasecmp(type, "uint32_t") == 0) + add_uint_config(key, obj, config, type, UINT32_MAX); + else if (strcasecmp(type, "uint64_t") == 0) + add_uint_config(key, obj, config, type, UINT64_MAX); + else if (strcasecmp(type, "unicast-mac") == 0) + add_unicast_mac_config(key, obj, config); + else + errx(1, "Unexpected type '%s' in schema", type); +} + +/* + * Parses all values specified in a device section in the configuration file, + * validates that the key/value pair is valid in the schema, and then adds + * the key/value pair to the correct subsystem in the config. + */ +static void +parse_device_config(const ucl_object_t *top, nvlist_t *config, + const char *subsystem, const nvlist_t *schema) +{ + ucl_object_iter_t it; + const ucl_object_t *obj; + nvlist_t *subsystem_config, *driver_config, *iov_config; + const nvlist_t *driver_schema, *iov_schema; + const char *key; + + if (nvlist_exists(config, subsystem)) + errx(1, "Multiple definitions of '%s' in config file", + subsystem); + + driver_schema = nvlist_get_nvlist(schema, DRIVER_CONFIG_NAME); + iov_schema = nvlist_get_nvlist(schema, IOV_CONFIG_NAME); + + driver_config = nvlist_create(NV_FLAG_IGNORE_CASE); + if (driver_config == NULL) + err(1, "Could not allocate config nvlist"); + + iov_config = nvlist_create(NV_FLAG_IGNORE_CASE); + if (iov_config == NULL) + err(1, "Could not allocate config nvlist"); + + subsystem_config = nvlist_create(NV_FLAG_IGNORE_CASE); + if (subsystem_config == NULL) + err(1, "Could not allocate config nvlist"); + + it = NULL; + while ((obj = ucl_iterate_object(top, &it, true)) != NULL) { + key = ucl_object_key(obj); + + if (nvlist_exists_nvlist(iov_schema, key)) + add_config(key, obj, iov_config, + nvlist_get_nvlist(iov_schema, key)); + else if (nvlist_exists_nvlist(driver_schema, key)) + add_config(key, obj, driver_config, + nvlist_get_nvlist(driver_schema, key)); + else + errx(1, "%s: Invalid config key '%s'", subsystem, key); + } + + nvlist_move_nvlist(subsystem_config, DRIVER_CONFIG_NAME, driver_config); + nvlist_move_nvlist(subsystem_config, IOV_CONFIG_NAME, iov_config); + nvlist_move_nvlist(config, subsystem, subsystem_config); +} + +/* + * Parses the specified config file using the given schema, and returns an + * nvlist containing the configuration specified by the file. + * + * Exits with a message to stderr and an error if any config validation fails. + */ +nvlist_t * +parse_config_file(const char *filename, const nvlist_t *schema) +{ + ucl_object_iter_t it; + struct ucl_parser *parser; + ucl_object_t *top; + const ucl_object_t *obj; + nvlist_t *config; + const nvlist_t *pf_schema, *vf_schema; + const char *errmsg, *key; + regex_t vf_pat; + int regex_err, processed_vf; + + regex_err = regcomp(&vf_pat, "^"VF_PREFIX"([1-9][0-9]*|0)$", + REG_EXTENDED | REG_ICASE); + if (regex_err != 0) + errx(1, "Could not compile VF regex"); + + parser = ucl_parser_new(0); + if (parser == NULL) + err(1, "Could not allocate parser"); + + if (!ucl_parser_add_file(parser, filename)) + err(1, "Could not open '%s' for reading", filename); + + errmsg = ucl_parser_get_error(parser); + if (errmsg != NULL) + errx(1, "Could not parse '%s': %s", filename, errmsg); + + config = nvlist_create(NV_FLAG_IGNORE_CASE); + if (config == NULL) + err(1, "Could not allocate config nvlist"); + + pf_schema = nvlist_get_nvlist(schema, PF_CONFIG_NAME); + vf_schema = nvlist_get_nvlist(schema, VF_SCHEMA_NAME); + + processed_vf = 0; + top = ucl_parser_get_object(parser); + it = NULL; + while ((obj = ucl_iterate_object(top, &it, true)) != NULL) { + key = ucl_object_key(obj); + + if (strcasecmp(key, PF_CONFIG_NAME) == 0) + parse_device_config(obj, config, key, pf_schema); + else if (strcasecmp(key, DEFAULT_SCHEMA_NAME) == 0) { + /* + * Enforce that the default section must come before all + * VF sections. This will hopefully prevent confusing + * the user by having a default value apply to a VF + * that was declared earlier in the file. + * + * This also gives us the flexibility to extend the file + * format in the future to allow for multiple default + * sections that do only apply to subsequent VF + * sections. + */ + if (processed_vf) + errx(1, + "'default' section must precede all VF sections"); + + parse_device_config(obj, config, key, vf_schema); + } else if (regexec(&vf_pat, key, 0, NULL, 0) == 0) { + processed_vf = 1; + parse_device_config(obj, config, key, vf_schema); + } else + errx(1, "Unexpected top-level node: %s", key); + } + + validate_config(config, schema, &vf_pat); + + ucl_object_unref(top); + ucl_parser_free(parser); + regfree(&vf_pat); + + return (config); +} + +/* + * Parse the PF configuration section for and return the value specified for + * the device parameter, or NULL if the device is not specified. + */ +static const char * +find_pf_device(const ucl_object_t *pf) +{ + ucl_object_iter_t it; + const ucl_object_t *obj; + const char *key, *device; + + it = NULL; + while ((obj = ucl_iterate_object(pf, &it, true)) != NULL) { + key = ucl_object_key(obj); + + if (strcasecmp(key, "device") == 0) { + if (!ucl_object_tostring_safe(obj, &device)) + err(1, + "Config PF.device must be a string"); + + return (device); + } + } + + return (NULL); +} + +/* + * Manually parse the config file looking for the name of the PF device. We + * have to do this separately because we need the config schema to call the + * normal config file parsing code, and we need to know the name of the PF + * device so that we can fetch the schema from it. + * + * This will always exit on failure, so if it returns then it is guaranteed to + * have returned a valid device name. + */ +char * +find_device(const char *filename) +{ + char *device; + const char *deviceName; + ucl_object_iter_t it; + struct ucl_parser *parser; + ucl_object_t *top; + const ucl_object_t *obj; + const char *errmsg, *key; + int error; + + device = NULL; + deviceName = NULL; + + parser = ucl_parser_new(0); + if (parser == NULL) + err(1, "Could not allocate parser"); + + if (!ucl_parser_add_file(parser, filename)) + err(1, "Could not open '%s' for reading", filename); + + errmsg = ucl_parser_get_error(parser); + if (errmsg != NULL) + errx(1, "Could not parse '%s': %s", filename, errmsg); + + top = ucl_parser_get_object (parser); + it = NULL; + while ((obj = ucl_iterate_object(top, &it, true)) != NULL) { + key = ucl_object_key(obj); + + if (strcasecmp(key, PF_CONFIG_NAME) == 0) { + deviceName = find_pf_device(obj); + break; + } + } + + if (deviceName == NULL) + errx(1, "Config file does not specify device"); + + error = asprintf(&device, "/dev/iov/%s", deviceName); + if (error < 0) + err(1, "Could not allocate memory for device"); + + ucl_object_unref(top); + ucl_parser_free(parser); + + return (device); +} From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:52:43 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45780A5E; Sun, 1 Mar 2015 00:52:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EDF0351; Sun, 1 Mar 2015 00:52:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210qhrZ099958; Sun, 1 Mar 2015 00:52:43 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210qgAs099954; Sun, 1 Mar 2015 00:52:42 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010052.t210qgAs099954@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279461 - in head/usr.sbin: . iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:52:43 -0000 Author: rstone Date: Sun Mar 1 00:52:41 2015 New Revision: 279461 URL: https://svnweb.freebsd.org/changeset/base/279461 Log: Add main() for iovctl and hook iovctl into build Differential Revision: https://reviews.freebsd.org/D87 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/usr.sbin/iovctl/Makefile (contents, props changed) head/usr.sbin/iovctl/iovctl.c (contents, props changed) head/usr.sbin/iovctl/iovctl.h (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Mar 1 00:52:34 2015 (r279460) +++ head/usr.sbin/Makefile Sun Mar 1 00:52:41 2015 (r279461) @@ -35,6 +35,7 @@ SUBDIR= adduser \ i2c \ ifmcstat \ iostat \ + iovctl \ kldxref \ mailwrapper \ makefs \ Added: head/usr.sbin/iovctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/Makefile Sun Mar 1 00:52:41 2015 (r279461) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +PROG= iovctl +SRCS= iovctl.c parse.c validate.c +LIBADD= nv ucl m + +CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include + +WARNS?=6 + +MAN= \ + iovctl.8 \ + iovctl.conf.5 \ + +.include +.include + Added: head/usr.sbin/iovctl/iovctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/iovctl.c Sun Mar 1 00:52:41 2015 (r279461) @@ -0,0 +1,403 @@ +/*- + * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iovctl.h" + +static void config_action(const char *filename, int dryrun); +static void delete_action(const char *device, int dryrun); +static void print_schema(const char *device); + +/* + * Fetch the config schema from the kernel via ioctl. This function has to + * call the ioctl twice: the first returns the amount of memory that we need + * to allocate for the schema, and the second actually fetches the schema. + */ +static nvlist_t * +get_schema(int fd) +{ + struct pci_iov_schema arg; + nvlist_t *schema; + int error; + + /* Do the ioctl() once to fetch the size of the schema. */ + arg.schema = NULL; + arg.len = 0; + arg.error = 0; + error = ioctl(fd, IOV_GET_SCHEMA, &arg); + if (error != 0) + err(1, "Could not fetch size of config schema"); + + arg.schema = malloc(arg.len); + if (arg.schema == NULL) + err(1, "Could not allocate %zu bytes for schema", + arg.len); + + /* Now do the ioctl() for real to get the schema. */ + error = ioctl(fd, IOV_GET_SCHEMA, &arg); + if (error != 0 || arg.error != 0) { + if (arg.error != 0) + errno = arg.error; + err(1, "Could not fetch config schema"); + } + + schema = nvlist_unpack(arg.schema, arg.len); + if (schema == NULL) + err(1, "Could not unpack schema"); + + free(arg.schema); + return (schema); +} + +/* + * Call the ioctl that activates SR-IOV and creates the VFs. + */ +static void +config_iov(int fd, const char *dev_name, const nvlist_t *config, int dryrun) +{ + struct pci_iov_arg arg; + int error; + + arg.config = nvlist_pack(config, &arg.len); + if (arg.config == NULL) + err(1, "Could not pack configuration"); + + if (dryrun) { + printf("Would enable SR-IOV on device '%s'.\n", dev_name); + printf( + "The following configuration parameters would be used:\n"); + nvlist_fdump(config, stdout); + printf( + "The configuration parameters consume %zu bytes when packed.\n", + arg.len); + } else { + error = ioctl(fd, IOV_CONFIG, &arg); + if (error != 0) + err(1, "Failed to configure SR-IOV"); + } + + free(arg.config); +} + +static int +open_device(const char *dev_name) +{ + char *dev; + int fd; + size_t copied, size; + long path_max; + + path_max = pathconf("/dev", _PC_PATH_MAX); + if (path_max < 0) + err(1, "Could not get maximum path length"); + + size = path_max; + dev = malloc(size); + if (dev == NULL) + err(1, "Could not allocate memory for device path"); + + if (dev_name[0] == '/') + copied = strlcpy(dev, dev_name, size); + else + copied = snprintf(dev, size, "/dev/iov/%s", dev_name); + + /* >= to account for null terminator. */ + if (copied >= size) + errx(1, "Provided file name too long"); + + fd = open(dev, O_RDWR); + if (fd < 0) + err(1, "Could not open device '%s'", dev); + + free(dev); + return (fd); +} + +static void +usage(void) +{ + + warnx("Usage: iovctl -C -f [-n]"); + warnx(" iovctl -D [-d | -f ] [-n]"); + warnx(" iovctl -S [-d | -f ]"); + exit(1); + +} + +enum main_action { + NONE, + CONFIG, + DELETE, + PRINT_SCHEMA, +}; + +int +main(int argc, char **argv) +{ + char *device; + const char *filename; + int ch, dryrun; + enum main_action action; + + device = NULL; + filename = NULL; + dryrun = 0; + action = NONE; + + while ((ch = getopt(argc, argv, "Cd:Df:nS")) != -1) { + switch (ch) { + case 'C': + if (action != NONE) { + warnx( + "Only one of -C, -D or -S may be specified"); + usage(); + } + action = CONFIG; + break; + case 'd': + device = strdup(optarg); + break; + case 'D': + if (action != NONE) { + warnx( + "Only one of -C, -D or -S may be specified"); + usage(); + } + action = DELETE; + break; + case 'f': + filename = optarg; + break; + case 'n': + dryrun = 1; + break; + case 'S': + if (action != NONE) { + warnx( + "Only one of -C, -D or -S may be specified"); + usage(); + } + action = PRINT_SCHEMA; + break; + case '?': + warnx("Unrecognized argument '-%c'\n", optopt); + usage(); + break; + } + } + + if (device != NULL && filename != NULL) { + warnx("Only one of the -d and -f flags may be specified"); + usage(); + } + + if (device == NULL && filename == NULL) { + warnx("Either the -d or -f flag must be specified"); + usage(); + } + + switch (action) { + case CONFIG: + if (filename == NULL) { + warnx("-d flag cannot be used with the -C flag"); + usage(); + } + config_action(filename, dryrun); + break; + case DELETE: + if (device == NULL) + device = find_device(filename); + delete_action(device, dryrun); + free(device); + break; + case PRINT_SCHEMA: + if (dryrun) { + warnx("-n flag cannot be used with the -S flag"); + usage(); + } + if (device == NULL) + device = find_device(filename); + print_schema(device); + free(device); + break; + default: + usage(); + break; + } + + exit(0); +} + +static void +config_action(const char *filename, int dryrun) +{ + char *dev; + nvlist_t *schema, *config; + int fd; + + dev = find_device(filename); + fd = open(dev, O_RDWR); + if (fd < 0) + err(1, "Could not open device '%s'", dev); + + schema = get_schema(fd); + config = parse_config_file(filename, schema); + if (config == NULL) + errx(1, "Could not parse config"); + + config_iov(fd, dev, config, dryrun); + + nvlist_destroy(config); + nvlist_destroy(schema); + free(dev); + close(fd); +} + +static void +delete_action(const char *dev_name, int dryrun) +{ + int fd, error; + + fd = open_device(dev_name); + + if (dryrun) + printf("Would attempt to delete all VF children of '%s'\n", + dev_name); + else { + error = ioctl(fd, IOV_DELETE); + if (error != 0) + err(1, "Failed to delete VFs"); + } + + close(fd); +} + +static void +print_default_value(const nvlist_t *parameter, const char *type) +{ + const uint8_t *mac; + size_t size; + + if (strcasecmp(type, "bool") == 0) + printf(" (default = %s)", + nvlist_get_bool(parameter, DEFAULT_SCHEMA_NAME) ? "true" : + "false"); + else if (strcasecmp(type, "string") == 0) + printf(" (default = %s)", + nvlist_get_string(parameter, DEFAULT_SCHEMA_NAME)); + else if (strcasecmp(type, "uint8_t") == 0) + printf(" (default = %ju)", + (uintmax_t)nvlist_get_number(parameter, + DEFAULT_SCHEMA_NAME)); + else if (strcasecmp(type, "uint16_t") == 0) + printf(" (default = %ju)", + (uintmax_t)nvlist_get_number(parameter, + DEFAULT_SCHEMA_NAME)); + else if (strcasecmp(type, "uint32_t") == 0) + printf(" (default = %ju)", + (uintmax_t)nvlist_get_number(parameter, + DEFAULT_SCHEMA_NAME)); + else if (strcasecmp(type, "uint64_t") == 0) + printf(" (default = %ju)", + (uintmax_t)nvlist_get_number(parameter, + DEFAULT_SCHEMA_NAME)); + else if (strcasecmp(type, "unicast-mac") == 0) { + mac = nvlist_get_binary(parameter, DEFAULT_SCHEMA_NAME, &size); + printf(" (default = %02x:%02x:%02x:%02x:%02x:%02x)", mac[0], + mac[1], mac[2], mac[3], mac[4], mac[5]); + } else + errx(1, "Unexpected type in schema: '%s'", type); +} + +static void +print_subsystem_schema(const nvlist_t * subsystem_schema) +{ + const char *name, *type; + const nvlist_t *parameter; + void *it; + int nvtype; + + it = NULL; + while ((name = nvlist_next(subsystem_schema, &nvtype, &it)) != NULL) { + parameter = nvlist_get_nvlist(subsystem_schema, name); + type = nvlist_get_string(parameter, TYPE_SCHEMA_NAME); + + printf("\t%s : %s", name, type); + if (dnvlist_get_bool(parameter, REQUIRED_SCHEMA_NAME, false)) + printf(" (required)"); + else if (nvlist_exists(parameter, DEFAULT_SCHEMA_NAME)) + print_default_value(parameter, type); + else + printf(" (optional)"); + printf("\n"); + } +} + +static void +print_schema(const char *dev_name) +{ + nvlist_t *schema; + const nvlist_t *iov_schema, *driver_schema, *pf_schema, *vf_schema; + int fd; + + fd = open_device(dev_name); + schema = get_schema(fd); + + pf_schema = nvlist_get_nvlist(schema, PF_CONFIG_NAME); + iov_schema = nvlist_get_nvlist(pf_schema, IOV_CONFIG_NAME); + driver_schema = nvlist_get_nvlist(pf_schema, DRIVER_CONFIG_NAME); + printf( +"The following configuration parameters may be configured on the PF:\n"); + print_subsystem_schema(iov_schema); + print_subsystem_schema(driver_schema); + + vf_schema = nvlist_get_nvlist(schema, VF_SCHEMA_NAME); + iov_schema = nvlist_get_nvlist(vf_schema, IOV_CONFIG_NAME); + driver_schema = nvlist_get_nvlist(vf_schema, DRIVER_CONFIG_NAME); + printf( +"\nThe following configuration parameters may be configured on a VF:\n"); + print_subsystem_schema(iov_schema); + print_subsystem_schema(driver_schema); + + nvlist_destroy(schema); + close(fd); +} Added: head/usr.sbin/iovctl/iovctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/iovctl/iovctl.h Sun Mar 1 00:52:41 2015 (r279461) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef IOVCTL_H +#define IOVCTL_H + +char * find_device(const char *); +nvlist_t * parse_config_file(const char *, const nvlist_t *); +void validate_config(nvlist_t *, const nvlist_t *, const regex_t *); + +#endif + From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:57:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B87DBE4; Sun, 1 Mar 2015 00:57:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6603E371; Sun, 1 Mar 2015 00:57:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210v2uB000736; Sun, 1 Mar 2015 00:57:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210v2Xe000735; Sun, 1 Mar 2015 00:57:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503010057.t210v2Xe000735@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 1 Mar 2015 00:57:02 +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: r279462 - stable/10/sys/arm/ti/am335x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:57:02 -0000 Author: dim Date: Sun Mar 1 00:57:01 2015 New Revision: 279462 URL: https://svnweb.freebsd.org/changeset/base/279462 Log: MFC r279311: In sys/arm/ti/am335x/am335x_rtc.c, fix a clang 3.6.0 warning about am33x_rtc_softc::sc_irq_res (which is an array) never being NULL. Submitted by: andrew Modified: stable/10/sys/arm/ti/am335x/am335x_rtc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/am335x/am335x_rtc.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_rtc.c Sun Mar 1 00:52:41 2015 (r279461) +++ stable/10/sys/arm/ti/am335x/am335x_rtc.c Sun Mar 1 00:57:01 2015 (r279462) @@ -137,7 +137,7 @@ am335x_rtc_detach(device_t dev) struct am335x_rtc_softc *sc; sc = device_get_softc(dev); - if (sc->sc_irq_res) + if (sc->sc_irq_res[0] != NULL) bus_release_resources(dev, am335x_rtc_irq_spec, sc->sc_irq_res); if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:58:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 234C8D1A; Sun, 1 Mar 2015 00:58:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8E937E; Sun, 1 Mar 2015 00:58:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210wOlp000980; Sun, 1 Mar 2015 00:58:24 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210wNVj000967; Sun, 1 Mar 2015 00:58:23 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010058.t210wNVj000967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279463 - in head: etc/defaults etc/rc.d share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:58:25 -0000 Author: rstone Date: Sun Mar 1 00:58:23 2015 New Revision: 279463 URL: https://svnweb.freebsd.org/changeset/base/279463 Log: Add an rc.d script to invoke iovctl(8) during boot Differential Revision: https://reviews.freebsd.org/D88 Reviewed by: wblock, emaste, allanjude MFC after: 1 month Relnotes: yes Sponsored by: Sandvine Inc. Added: head/etc/rc.d/iovctl (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/netif head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Mar 1 00:57:01 2015 (r279462) +++ head/etc/defaults/rc.conf Sun Mar 1 00:58:23 2015 (r279463) @@ -667,6 +667,8 @@ casperd_enable="YES" # casperd(8) daemon rctl_enable="NO" # Load rctl(8) rules on boot rctl_rules="/etc/rctl.conf" # rctl(8) ruleset. See rctl.conf(5). +iovctl_files="" # Config files for iovctl(8) + ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## ############################################################## Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Mar 1 00:57:01 2015 (r279462) +++ head/etc/rc.d/Makefile Sun Mar 1 00:58:23 2015 (r279463) @@ -44,6 +44,7 @@ FILES= DAEMON \ hostid \ hostid_save \ hostname \ + iovctl \ ip6addrctl \ ipfilter \ ipfs \ Added: head/etc/rc.d/iovctl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/iovctl Sun Mar 1 00:58:23 2015 (r279463) @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: iovctl +# REQUIRE: FILESYSTEMS sysctl + +. /etc/rc.subr + +name="iovctl" +command="/usr/sbin/iovctl" +start_cmd="iovctl_start" +stop_cmd="iovctl_stop" + +run_iovctl() +{ + local _f flag + + flag=$1 + for _f in ${iovctl_files} ; do + if [ -r ${_f} ]; then + ${command} ${flag} -f ${_f} > /dev/null + fi + done +} + +iovctl_start() +{ + run_iovctl -E +} + +iovctl_stop() +{ + run_iovctl -D +} + +load_rc_config $name +run_rc_command "$1" Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sun Mar 1 00:57:01 2015 (r279462) +++ head/etc/rc.d/netif Sun Mar 1 00:58:23 2015 (r279463) @@ -26,7 +26,7 @@ # # PROVIDE: netif -# REQUIRE: atm1 FILESYSTEMS serial sppp sysctl +# REQUIRE: atm1 FILESYSTEMS iovctl serial sppp sysctl # REQUIRE: ipfilter ipfs # KEYWORD: nojailvnet Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun Mar 1 00:57:01 2015 (r279462) +++ head/share/man/man5/rc.conf.5 Sun Mar 1 00:58:23 2015 (r279463) @@ -4447,6 +4447,11 @@ This variables contains the .Xr rctl.conf 5 ruleset to load for .Xr rctl 8 . +.It Va iovctl_files +.Pq Vt str +A space-separated list of configuration files used by +.Xr iovctl 8 . +The default value is an empty string. .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4500,6 +4505,7 @@ ruleset to load for .Xr hcsecd 8 , .Xr ifconfig 8 , .Xr inetd 8 , +.Xr iovctl 8 , .Xr ipf 8 , .Xr ipfw 8 , .Xr ipnat 8 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:59:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28B5E8A; Sun, 1 Mar 2015 00:59:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A38D5387; Sun, 1 Mar 2015 00:59:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210xMXD001157; Sun, 1 Mar 2015 00:59:22 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210xMEB001154; Sun, 1 Mar 2015 00:59:22 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010059.t210xMEB001154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279464 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:59:23 -0000 Author: rstone Date: Sun Mar 1 00:59:21 2015 New Revision: 279464 URL: https://svnweb.freebsd.org/changeset/base/279464 Log: Document the interface for defining a configuration schema Differential Revision: https://reviews.freebsd.org/D89 Reviewed by: wblock, emaste, allanjude MFC after: 1 month Sponsored by: Sandvine Inc. Added: head/share/man/man9/pci_iov_schema.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Mar 1 00:58:23 2015 (r279463) +++ head/share/man/man9/Makefile Sun Mar 1 00:59:21 2015 (r279464) @@ -197,6 +197,7 @@ MAN= accept_filter.9 \ pci.9 \ PCI_ADD_VF.9 \ PCI_INIT_IOV.9 \ + pci_iov_schema.9 \ PCI_UNINIT_IOV.9 \ pfil.9 \ pfind.9 \ @@ -1175,6 +1176,14 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_set_max_read_req.9 \ pci.9 pci_write_config.9 +MLINKS+=pci_iov_schema.9 pci_iov_schema_alloc_node.9 \ + pci_iov_schema.9 pci_iov_schema_add_bool.9 \ + pci_iov_schema.9 pci_iov_schema_add_string.9 \ + pci_iov_schema.9 pci_iov_schema_add_uint8.9 \ + pci_iov_schema.9 pci_iov_schema_add_uint16.9 \ + pci_iov_schema.9 pci_iov_schema_add_uint32.9 \ + pci_iov_schema.9 pci_iov_schema_add_uint64.9 \ + pci_iov_schema.9 pci_iov_schema_add_unicast_mac.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_head_register.9 \ pfil.9 pfil_head_unregister.9 \ Added: head/share/man/man9/pci_iov_schema.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/pci_iov_schema.9 Sun Mar 1 00:59:21 2015 (r279464) @@ -0,0 +1,265 @@ +.\" +.\" Copyright (c) 2014 Sandvine Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 25, 2014 +.Dt pci_iov_schema 9 +.Os +.Sh NAME +.Nm pci_iov_schema , +.Nm pci_iov_schema_alloc_node , +.Nm pci_iov_schema_add_bool , +.Nm pci_iov_schema_add_string , +.Nm pci_iov_schema_add_uint8 , +.Nm pci_iov_schema_add_uint16 , +.Nm pci_iov_schema_add_uint32 , +.Nm pci_iov_schema_add_uint64 , +.Nm pci_iov_schema_add_unicast_mac +.Nd PCI SR-IOV config schema interface +.Sh SYNOPSIS +.In machine/stdarg.h +.In sys/nv.h +.In sys/iov_schema.h +.Ft nvlist_t * +.Fn pci_iov_schema_alloc_node "void" +.Ft void +.Fn pci_iov_schema_add_bool "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "int defaultVal" +.Ft void +.Fn pci_iov_schema_add_string "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "const char *defaultVal" +.Ft void +.Fn pci_iov_schema_add_uint8 "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "uint8_t defaultVal" +.Ft void +.Fn pci_iov_schema_add_uint16 "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "uint16_t defaultVal" +.Ft void +.Fn pci_iov_schema_add_uint32 "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "uint32_t defaultVal" +.Ft void +.Fn pci_iov_schema_add_uint64 "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "uint64_t defaultVal" +.Ft void +.Fn pci_iov_schema_add_unicast_mac "nvlist_t *schema" "const char *name" \ +"uint32_t flags" "const uint8_t *defaultVal" +.Sh DESCRIPTION +The PCI Single-Root I/O Virtualization +.Pq SR-IOV +configuration schema is a data +structure that describes the device-specific configuration parameters that a PF +driver will accept when SR-IOV is enabled on the PF device. +Each PF driver defines two schema instances: the PF schema and the VF schema. +The PF schema describes configuration that applies to the PF device as a whole. +The VF schema describes configuration that applies to an individual VF device. +Different VF devices may have different configuration applied to them, as long +as the configuration for each VF conforms to the VF schema. +.Pp +A PF driver builds a configuration schema by first allocating a schema node and +then adding configuration parameter specifications to the schema. +The configuration parameter specification consists of a name and a value type. +.Pp +Configuration parameter names are case-insensitive. +It is an error to specify two or more configuration parameters with the same +name. +It is also an error to specific a configuration parameter that uses the same +name as a configuration parameter used by the SR-IOV infrastructure. +See +.Xr iovctl.conf 5 +for documentation of all configuration parameters used by the SR-IOV +infrastructure. +.Pp +The parameter type constrains the possible values that the configuration +parameter may take. +.Pp +A configuration parameter may be specified as a required parameter by setting +the +.Dv IOV_SCHEMA_REQUIRED +flag in the +.Pa flags +argument. +Required parameters must be specified by the user when SR-IOV is enabled. +If the user does not specify a required parameter, the SR-IOV infrastructure +will abort the request to enable SR-IOV and return an error to the user. +.Pp +Alternatively, a configuration parameter may be given a default value by +setting the +.Dv IOV_SCHEMA_HASDEFAULT +flag in the +.Pa flags +argument. +If a configuration parameter has a default value but the user has not specified +a value for that parameter, then the SR-IOV infrastructure will apply +.Pa defaultVal +for that parameter in the configuration before passing it to the PF driver. +It is an error for the value of the +.Pa defaultVal +parameter to not conform to the restrictions of the specified type. +If this flag is not specified then the +.Pa defaultVal +argument is ignored. +This flag is not compatible with the +.Dv IOV_SCHEMA_REQUIRED +flag; it is an error to specify both on the same parameter. +.Pp +The SR-IOV infrastructure guarantees that all configuration parameters that are +either specified as required or given a default value will be present in the +configuration passed to the PF driver. +Configuration parameters that are neither specified as required nor given a +default value are optional and may or may not be present in the configuration +passed to the PF driver. +.Pp +It is highly recommended that a PF driver reserve the use of optional parameters +for configuration that is truly optional. +For example, a Network Interface PF device might have the option to encapsulate +all traffic to and from a VF device in a vlan tag. +The PF driver could expose that option as a "vlan" parameter accepting an +integer argument specifying the vlan tag. +In this case, it would be appropriate to set the "vlan" parameter as an optional +parameter as it would be legitimate for a VF to be configured to have no vlan +tagging enabled at all. +.Pp +Alternatively, if the PF device had an boolean option that controlled whether +the VF was allowed to change its MAC address, it would not be appropriate to +set this parameter as optional. +The PF driver must either allow the MAC to change or not, so it would be more +appropriate for the PF driver to document the default behaviour by specifying +a default value in the schema +.Po or potentially force the user to make the choice by setting the parameter +to be required +.Pc . +.Pp +Configuration parameters that have security implications must default to the +most secure configuration possible. +.Pp +All device-specific configuration parameters must be documented in the manual +page for the PF driver, or in a separate manual page that is cross-referenced +from the main driver manual page. +.Pp +It is not necessary for a PF driver to check for failure from any of these +functions. +If an error occurs, it is flagged in the schema. +The +.Xr pci_iov_attach 9 +function checks for this error and will fail to initialize SR-IOV on the PF +device if an error is set in the schema. +If this occurs, it is recommended that the PF driver still succeed in attaching +and run with SR-IOV disabled on the device. +.Pp +The +.Fn pci_iov_schema_alloc_node +function is used to allocate an empty configuration schema. +It is not necessary to check for failure from this function. +The SR-IOV infrastructure will gracefully handle failure to allocate a schema +and will simply not enable SR-IOV on the PF device. +.Pp +The +.Fn pci_iov_schema_add_bool +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a boolean type. +Boolean values can only take the value true or false (1 or 0, respectively). +.Pp +The +.Fn pci_iov_schema_add_string +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a string type. +String values are standard C strings. +.Pp +The +.Fn pci_iov_schema_add_uint8 +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a +.Vt uint8_t +type. +Values of type +.Vt uint8_t +are unsigned integers in the range 0 to 255, inclusive. +.Pp +The +.Fn pci_iov_schema_add_uint16 +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a +.Vt uint16_t +type. +Values of type +.Vt uint16_t +are unsigned integers in the range 0 to 65535, inclusive. +.Pp +The +.Fn pci_iov_schema_add_uint32 +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a +.Vt uint32_t +type. +Values of type +.Vt uint32_t +are unsigned integers in the range 0 to +.Po 2**32 - 1 Pc , +inclusive. +.Pp +The +.Fn pci_iov_schema_add_uint64 +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a +.Vt uint64_t +type. +Values of type +.Vt uint64_t +are unsigned integers in the range 0 to +.Po 2**64 - 1 Pc , +inclusive. +.Pp +The +.Fn pci_iov_schema_add_unicast_mac +function is used to specify a configuration parameter in the given schema with +the name +.Pa name +and having a unicast-mac type. +Values of type unicast-mac are binary values exactly 6 bytes long. +The MAC address is guaranteed to not be a multicast or broadcast address. +.Sh RETURN VALUES +The +.Fn pci_iov_schema_alloc_node +function returns a pointer to the allocated schema, or NULL if a failure occurs. +.Sh SEE ALSO +.Xr pci 9 , +.Xr PCI_ADD_VF 9 , +.Xr PCI_INIT_IOV 9 +.Sh AUTHORS +This manual page was written by +.An Ryan Stone Aq rstone@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:59:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFF74FBF; Sun, 1 Mar 2015 00:59:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA97C389; Sun, 1 Mar 2015 00:59:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210xTmM001229; Sun, 1 Mar 2015 00:59:29 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210xTNo001223; Sun, 1 Mar 2015 00:59:29 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010059.t210xTNo001223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279465 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:59:29 -0000 Author: rstone Date: Sun Mar 1 00:59:28 2015 New Revision: 279465 URL: https://svnweb.freebsd.org/changeset/base/279465 Log: Validate the schema that the PF driver passed to us Differential Revision: https://reviews.freebsd.org/D90 Reviewed by: emaste MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_iov_schema.c head/sys/dev/pci/schema_private.h Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Sun Mar 1 00:59:21 2015 (r279464) +++ head/sys/dev/pci/pci_iov.c Sun Mar 1 00:59:28 2015 (r279465) @@ -142,6 +142,10 @@ pci_iov_attach_method(device_t bus, devi error = ENOMEM; goto cleanup; } + + error = pci_iov_validate_schema(schema); + if (error != 0) + goto cleanup; iov->iov_schema = schema; iov->iov_cdev = make_dev(&iov_cdevsw, device_get_unit(dev), Modified: head/sys/dev/pci/pci_iov_schema.c ============================================================================== --- head/sys/dev/pci/pci_iov_schema.c Sun Mar 1 00:59:21 2015 (r279464) +++ head/sys/dev/pci/pci_iov_schema.c Sun Mar 1 00:59:28 2015 (r279465) @@ -50,26 +50,66 @@ __FBSDID("$FreeBSD$"); struct config_type_validator; typedef int (validate_func)(const struct config_type_validator *, const nvlist_t *, const char *name); +typedef int (default_validate_t)(const struct config_type_validator *, + const nvlist_t *); static validate_func pci_iov_schema_validate_bool; static validate_func pci_iov_schema_validate_string; static validate_func pci_iov_schema_validate_uint; static validate_func pci_iov_schema_validate_unicast_mac; +static default_validate_t pci_iov_validate_bool_default; +static default_validate_t pci_iov_validate_string_default; +static default_validate_t pci_iov_validate_uint_default; +static default_validate_t pci_iov_validate_unicast_mac_default; + struct config_type_validator { const char *type_name; validate_func *validate; + default_validate_t *default_validate; uintmax_t limit; }; static struct config_type_validator pci_iov_schema_validators[] = { - { "bool", pci_iov_schema_validate_bool }, - { "string", pci_iov_schema_validate_string }, - { "uint8_t", pci_iov_schema_validate_uint, UINT8_MAX }, - { "uint16_t", pci_iov_schema_validate_uint, UINT16_MAX }, - { "uint32_t", pci_iov_schema_validate_uint, UINT32_MAX }, - { "uint64_t", pci_iov_schema_validate_uint, UINT64_MAX }, - { "unicast-mac", pci_iov_schema_validate_unicast_mac }, + { + .type_name = "bool", + .validate = pci_iov_schema_validate_bool, + .default_validate = pci_iov_validate_bool_default + }, + { + .type_name = "string", + .validate = pci_iov_schema_validate_string, + .default_validate = pci_iov_validate_string_default + }, + { + .type_name = "uint8_t", + .validate = pci_iov_schema_validate_uint, + .default_validate = pci_iov_validate_uint_default, + .limit = UINT8_MAX + }, + { + .type_name = "uint16_t", + .validate = pci_iov_schema_validate_uint, + .default_validate = pci_iov_validate_uint_default, + .limit = UINT16_MAX + }, + { + .type_name = "uint32_t", + .validate = pci_iov_schema_validate_uint, + .default_validate = pci_iov_validate_uint_default, + .limit = UINT32_MAX + }, + { + .type_name = "uint64_t", + .validate = pci_iov_schema_validate_uint, + .default_validate = pci_iov_validate_uint_default, + .limit = UINT64_MAX + }, + { + .type_name = "unicast-mac", + .validate = pci_iov_schema_validate_unicast_mac, + .default_validate = pci_iov_validate_unicast_mac_default, + }, }; static const struct config_type_validator * @@ -309,6 +349,227 @@ pci_iov_config_add_default(const nvlist_ panic("Unexpected nvlist type"); } +static int +pci_iov_validate_bool_default(const struct config_type_validator * validator, + const nvlist_t *param) +{ + + if (!nvlist_exists_bool(param, DEFAULT_SCHEMA_NAME)) + return (EINVAL); + return (0); +} + +static int +pci_iov_validate_string_default(const struct config_type_validator * validator, + const nvlist_t *param) +{ + + if (!nvlist_exists_string(param, DEFAULT_SCHEMA_NAME)) + return (EINVAL); + return (0); +} + +static int +pci_iov_validate_uint_default(const struct config_type_validator * validator, + const nvlist_t *param) +{ + uint64_t defaultVal; + + if (!nvlist_exists_number(param, DEFAULT_SCHEMA_NAME)) + return (EINVAL); + + defaultVal = nvlist_get_number(param, DEFAULT_SCHEMA_NAME); + if (defaultVal > validator->limit) + return (EINVAL); + return (0); +} + +static int +pci_iov_validate_unicast_mac_default( + const struct config_type_validator * validator, const nvlist_t *param) +{ + const uint8_t *mac; + size_t size; + + if (!nvlist_exists_binary(param, DEFAULT_SCHEMA_NAME)) + return (EINVAL); + + mac = nvlist_get_binary(param, DEFAULT_SCHEMA_NAME, &size); + if (size != ETHER_ADDR_LEN) + return (EINVAL); + + if (ETHER_IS_MULTICAST(mac)) + return (EINVAL); + return (0); +} + +static int +pci_iov_validate_param_schema(const nvlist_t *schema) +{ + const struct config_type_validator *validator; + const char *type; + int error; + + /* All parameters must define a type. */ + if (!nvlist_exists_string(schema, TYPE_SCHEMA_NAME)) + return (EINVAL); + type = nvlist_get_string(schema, TYPE_SCHEMA_NAME); + + validator = pci_iov_schema_find_validator(type); + if (validator == NULL) + return (EINVAL); + + /* Validate that the default value conforms to the type. */ + if (nvlist_exists(schema, DEFAULT_SCHEMA_NAME)) { + error = validator->default_validate(validator, schema); + if (error != 0) + return (error); + + /* Required and Default are mutually exclusive. */ + if (nvlist_exists(schema, REQUIRED_SCHEMA_NAME)) + return (EINVAL); + } + + /* The "Required" field must be a bool. */ + if (nvlist_exists(schema, REQUIRED_SCHEMA_NAME)) { + if (!nvlist_exists_bool(schema, REQUIRED_SCHEMA_NAME)) + return (EINVAL); + } + + return (0); +} + +static int +pci_iov_validate_subsystem_schema(const nvlist_t *dev_schema, const char *name) +{ + const nvlist_t *sub_schema, *param_schema; + const char *param_name; + void *it; + int type, error; + + if (!nvlist_exists_nvlist(dev_schema, name)) + return (EINVAL); + sub_schema = nvlist_get_nvlist(dev_schema, name); + + it = NULL; + while ((param_name = nvlist_next(sub_schema, &type, &it)) != NULL) { + if (type != NV_TYPE_NVLIST) + return (EINVAL); + param_schema = nvlist_get_nvlist(sub_schema, param_name); + + error = pci_iov_validate_param_schema(param_schema); + if (error != 0) + return (error); + } + + return (0); +} + +/* + * Validate that the driver schema does not define any configuration parameters + * whose names collide with configuration parameters defined in the iov schema. + */ +static int +pci_iov_validate_param_collisions(const nvlist_t *dev_schema) +{ + const nvlist_t *iov_schema, *driver_schema; + const char *name; + void *it; + int type; + + driver_schema = nvlist_get_nvlist(dev_schema, DRIVER_CONFIG_NAME); + iov_schema = nvlist_get_nvlist(dev_schema, IOV_CONFIG_NAME); + + it = NULL; + while ((name = nvlist_next(driver_schema, &type, &it)) != NULL) { + if (nvlist_exists(iov_schema, name)) + return (EINVAL); + } + + return (0); +} + +/* + * Validate that we only have IOV and DRIVER subsystems beneath the given + * device schema node. + */ +static int +pci_iov_validate_schema_subsystems(const nvlist_t *dev_schema) +{ + const char *name; + void *it; + int type; + + it = NULL; + while ((name = nvlist_next(dev_schema, &type, &it)) != NULL) { + if (strcmp(name, IOV_CONFIG_NAME) != 0 && + strcmp(name, DRIVER_CONFIG_NAME) != 0) + return (EINVAL); + } + + return (0); +} + +static int +pci_iov_validate_device_schema(const nvlist_t *schema, const char *name) +{ + const nvlist_t *dev_schema; + int error; + + if (!nvlist_exists_nvlist(schema, name)) + return (EINVAL); + dev_schema = nvlist_get_nvlist(schema, name); + + error = pci_iov_validate_subsystem_schema(dev_schema, IOV_CONFIG_NAME); + if (error != 0) + return (error); + + error = pci_iov_validate_subsystem_schema(dev_schema, + DRIVER_CONFIG_NAME); + if (error != 0) + return (error); + + error = pci_iov_validate_param_collisions(dev_schema); + if (error != 0) + return (error); + + return (pci_iov_validate_schema_subsystems(dev_schema)); +} + +/* Validate that we only have PF and VF devices beneath the top-level schema. */ +static int +pci_iov_validate_schema_devices(const nvlist_t *dev_schema) +{ + const char *name; + void *it; + int type; + + it = NULL; + while ((name = nvlist_next(dev_schema, &type, &it)) != NULL) { + if (strcmp(name, PF_CONFIG_NAME) != 0 && + strcmp(name, VF_SCHEMA_NAME) != 0) + return (EINVAL); + } + + return (0); +} + +int +pci_iov_validate_schema(const nvlist_t *schema) +{ + int error; + + error = pci_iov_validate_device_schema(schema, PF_CONFIG_NAME); + if (error != 0) + return (error); + + error = pci_iov_validate_device_schema(schema, VF_SCHEMA_NAME); + if (error != 0) + return (error); + + return (pci_iov_validate_schema_devices(schema)); +} + /* * Validate that all required parameters from the schema are specified in the * config. If any parameter with a default value is not specified in the Modified: head/sys/dev/pci/schema_private.h ============================================================================== --- head/sys/dev/pci/schema_private.h Sun Mar 1 00:59:21 2015 (r279464) +++ head/sys/dev/pci/schema_private.h Sun Mar 1 00:59:28 2015 (r279465) @@ -29,6 +29,8 @@ #ifndef _SCHEMA_PRIVATE_H_ #define _SCHEMA_PRIVATE_H_ +int pci_iov_validate_schema(const nvlist_t *schema); + int pci_iov_schema_validate_config(const nvlist_t *, nvlist_t *); uint16_t pci_iov_config_get_num_vfs(const nvlist_t *); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 00:59:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 128E817E; Sun, 1 Mar 2015 00:59:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E72CD38D; Sun, 1 Mar 2015 00:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t210xanQ001292; Sun, 1 Mar 2015 00:59:36 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t210xaDk001287; Sun, 1 Mar 2015 00:59:36 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010059.t210xaDk001287@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 00:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279466 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 00:59:37 -0000 Author: rstone Date: Sun Mar 1 00:59:35 2015 New Revision: 279466 URL: https://svnweb.freebsd.org/changeset/base/279466 Log: Teach pciconf how to dump out SR-IOV capability Differential Revision: https://reviews.freebsd.org/D1639 Reviewed by: jhb MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/pciconf.c head/usr.sbin/pciconf/pciconf.h Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Sun Mar 1 00:59:28 2015 (r279465) +++ head/usr.sbin/pciconf/cap.c Sun Mar 1 00:59:35 2015 (r279466) @@ -37,6 +37,7 @@ static const char rcsid[] = #include #include +#include #include #include @@ -636,7 +637,7 @@ ecap_aer(int fd, struct pci_conf *p, uin printf(" %d fatal", bitcount32(sta & mask)); printf(" %d non-fatal", bitcount32(sta & ~mask)); sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_COR_STATUS, 4); - printf(" %d corrected", bitcount32(sta)); + printf(" %d corrected\n", bitcount32(sta)); } static void @@ -652,6 +653,7 @@ ecap_vc(int fd, struct pci_conf *p, uint if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0) printf(" lowpri VC0-VC%d", (cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) >> 4); + printf("\n"); } static void @@ -664,7 +666,7 @@ ecap_sernum(int fd, struct pci_conf *p, return; low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); - printf(" %08x%08x", high, low); + printf(" %08x%08x\n", high, low); } static void @@ -676,7 +678,7 @@ ecap_vendor(int fd, struct pci_conf *p, if (ver < 1) return; val = read_config(fd, &p->pc_sel, ptr + 4, 4); - printf(" ID %d", val & 0xffff); + printf(" ID %d\n", val & 0xffff); } static void @@ -688,7 +690,69 @@ ecap_sec_pcie(int fd, struct pci_conf *p if (ver < 1) return; val = read_config(fd, &p->pc_sel, ptr + 8, 4); - printf(" lane errors %#x", val); + printf(" lane errors %#x\n", val); +} + +static const char * +check_enabled(int value) +{ + + return (value ? "enabled" : "disabled"); +} + +static void +ecap_sriov(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) +{ + const char *comma, *enabled; + uint16_t iov_ctl, total_vfs, num_vfs, vf_offset, vf_stride, vf_did; + uint32_t page_caps, page_size, page_shift, size; + int i; + + printf("SR-IOV %d ", ver); + + iov_ctl = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_CTL, 2); + printf("IOV %s, Memory Space %s, ARI %s\n", + check_enabled(iov_ctl & PCIM_SRIOV_VF_EN), + check_enabled(iov_ctl & PCIM_SRIOV_VF_MSE), + check_enabled(iov_ctl & PCIM_SRIOV_ARI_EN)); + + total_vfs = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_TOTAL_VFS, 2); + num_vfs = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_NUM_VFS, 2); + printf(" "); + printf("%d VFs configured out of %d supported\n", num_vfs, total_vfs); + + vf_offset = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_VF_OFF, 2); + vf_stride = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_VF_STRIDE, 2); + printf(" "); + printf("First VF RID Offset 0x%04x, VF RID Stride 0x%04x\n", vf_offset, + vf_stride); + + vf_did = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_VF_DID, 2); + printf(" VF Device ID 0x%04x\n", vf_did); + + page_caps = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_PAGE_CAP, 4); + page_size = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_PAGE_SIZE, 4); + printf(" "); + printf("Page Sizes: "); + comma = ""; + while (page_caps != 0) { + page_shift = ffs(page_caps) - 1; + + if (page_caps & page_size) + enabled = " (enabled)"; + else + enabled = ""; + + size = (1 << (page_shift + PCI_SRIOV_BASE_PAGE_SHIFT)); + printf("%s%d%s", comma, size, enabled); + comma = ", "; + + page_caps &= ~(1 << page_shift); + } + printf("\n"); + + for (i = 0; i <= PCIR_MAX_BAR_0; i++) + print_bar(fd, p, "iov bar ", ptr + PCIR_SRIOV_BAR(i)); } struct { @@ -704,7 +768,6 @@ struct { { PCIZ_ACS, "ACS" }, { PCIZ_ARI, "ARI" }, { PCIZ_ATS, "ATS" }, - { PCIZ_SRIOV, "SRIOV" }, { PCIZ_MULTICAST, "Multicast" }, { PCIZ_RESIZE_BAR, "Resizable BAR" }, { PCIZ_DPA, "DPA" }, @@ -743,6 +806,9 @@ list_ecaps(int fd, struct pci_conf *p) case PCIZ_SEC_PCIE: ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap)); break; + case PCIZ_SRIOV: + ecap_sriov(fd, p, ptr, PCI_EXTCAP_VER(ecap)); + break; default: name = "unknown"; for (i = 0; ecap_names[i].name != NULL; i++) @@ -750,10 +816,9 @@ list_ecaps(int fd, struct pci_conf *p) name = ecap_names[i].name; break; } - printf("%s %d", name, PCI_EXTCAP_VER(ecap)); + printf("%s %d\n", name, PCI_EXTCAP_VER(ecap)); break; } - printf("\n"); ptr = PCI_EXTCAP_NEXTPTR(ecap); if (ptr == 0) break; Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Sun Mar 1 00:59:28 2015 (r279465) +++ head/usr.sbin/pciconf/pciconf.c Sun Mar 1 00:59:35 2015 (r279466) @@ -263,10 +263,7 @@ list_devs(const char *name, int verbose, static void list_bars(int fd, struct pci_conf *p) { - struct pci_bar_io bar; - uint64_t base; - const char *type; - int i, range, max; + int i, max; switch (p->pc_hdr & PCIM_HDRTYPE) { case PCIM_HDRTYPE_NORMAL: @@ -282,40 +279,50 @@ list_bars(int fd, struct pci_conf *p) return; } - for (i = 0; i <= max; i++) { - bar.pbi_sel = p->pc_sel; - bar.pbi_reg = PCIR_BAR(i); - if (ioctl(fd, PCIOCGETBAR, &bar) < 0) - continue; - if (PCI_BAR_IO(bar.pbi_base)) { - type = "I/O Port"; + for (i = 0; i <= max; i++) + print_bar(fd, p, "bar ", PCIR_BAR(i)); +} + +void +print_bar(int fd, struct pci_conf *p, const char *label, uint16_t bar_offset) +{ + uint64_t base; + const char *type; + struct pci_bar_io bar; + int range; + + bar.pbi_sel = p->pc_sel; + bar.pbi_reg = bar_offset; + if (ioctl(fd, PCIOCGETBAR, &bar) < 0) + return; + if (PCI_BAR_IO(bar.pbi_base)) { + type = "I/O Port"; + range = 32; + base = bar.pbi_base & PCIM_BAR_IO_BASE; + } else { + if (bar.pbi_base & PCIM_BAR_MEM_PREFETCH) + type = "Prefetchable Memory"; + else + type = "Memory"; + switch (bar.pbi_base & PCIM_BAR_MEM_TYPE) { + case PCIM_BAR_MEM_32: range = 32; - base = bar.pbi_base & PCIM_BAR_IO_BASE; - } else { - if (bar.pbi_base & PCIM_BAR_MEM_PREFETCH) - type = "Prefetchable Memory"; - else - type = "Memory"; - switch (bar.pbi_base & PCIM_BAR_MEM_TYPE) { - case PCIM_BAR_MEM_32: - range = 32; - break; - case PCIM_BAR_MEM_1MB: - range = 20; - break; - case PCIM_BAR_MEM_64: - range = 64; - break; - default: - range = -1; - } - base = bar.pbi_base & ~((uint64_t)0xf); + break; + case PCIM_BAR_MEM_1MB: + range = 20; + break; + case PCIM_BAR_MEM_64: + range = 64; + break; + default: + range = -1; } - printf(" bar [%02x] = type %s, range %2d, base %#jx, ", - PCIR_BAR(i), type, range, (uintmax_t)base); - printf("size %ju, %s\n", (uintmax_t)bar.pbi_length, - bar.pbi_enabled ? "enabled" : "disabled"); + base = bar.pbi_base & ~((uint64_t)0xf); } + printf(" %s[%02x] = type %s, range %2d, base %#jx, ", + label, bar_offset, type, range, (uintmax_t)base); + printf("size %ju, %s\n", (uintmax_t)bar.pbi_length, + bar.pbi_enabled ? "enabled" : "disabled"); } static void Modified: head/usr.sbin/pciconf/pciconf.h ============================================================================== --- head/usr.sbin/pciconf/pciconf.h Sun Mar 1 00:59:28 2015 (r279465) +++ head/usr.sbin/pciconf/pciconf.h Sun Mar 1 00:59:35 2015 (r279466) @@ -37,6 +37,7 @@ void list_caps(int fd, struct pci_conf * void list_errors(int fd, struct pci_conf *p); uint8_t pci_find_cap(int fd, struct pci_conf *p, uint8_t id); uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id); +void print_bar(int fd, struct pci_conf *p, const char *label, uint16_t bar); uint32_t read_config(int fd, struct pcisel *sel, long reg, int width); #endif From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 01:02:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84F31309; Sun, 1 Mar 2015 01:02:52 +0000 (UTC) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53DF5630; Sun, 1 Mar 2015 01:02:52 +0000 (UTC) Received: by iebtr6 with SMTP id tr6so39756788ieb.10; Sat, 28 Feb 2015 17:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qfSNgpGskJtBZolhOtZZYffa01OlX34LonczvNkoAmU=; b=Jb0j/O7E+v/R4CWz+K8of+IByNY5znzbonAPwv9Sm+X/JNLApR0g4ulVHZGOCOPIMC HtR/xKDWRNBsRXRtyonui2iYBkU9OK2kXP7AWeaZyglPbaAOLM4Lmh+kfMW0YehjOdC+ b32j4laYmXdtESTT/USohMjUgYfZdC4dBF3Qzhsz37aJDeRtzsytO52rQf/ryl7osSYm c2pPXFKB/TxzIqPgg+aOdf5ayTyEqgoIaEShRCFBUZAK3BLQhv/JMkgYFMfU0KkY+rWR a3o8UVWP7aM51avF+3qhnX3seAmRkl5t7BadV5XYuLkwZm9ywwSiOzSVz72dt4vWSMQE O70w== MIME-Version: 1.0 X-Received: by 10.107.168.5 with SMTP id r5mr27444871ioe.87.1425171771133; Sat, 28 Feb 2015 17:02:51 -0800 (PST) Received: by 10.107.156.75 with HTTP; Sat, 28 Feb 2015 17:02:51 -0800 (PST) In-Reply-To: <201503010059.t210xaDk001287@svn.freebsd.org> References: <201503010059.t210xaDk001287@svn.freebsd.org> Date: Sat, 28 Feb 2015 20:02:51 -0500 Message-ID: Subject: Re: svn commit: r279466 - head/usr.sbin/pciconf From: Ryan Stone To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 01:02:52 -0000 Here's some sample output for the capability: ecap 0010[160] = SR-IOV 1 IOV enabled, Memory Space enabled, ARI enabled 4 VFs configured out of 128 supported First VF RID Offset 0x0010, VF RID Stride 0x0001 VF Device ID 0x154c Page Sizes: 4096 (enabled), 8192, 65536, 262144, 1048576, 4194304 Please note that this looks at the standard PCIe capability in the device, and so it cannot be used to check whether a device driver supports SR-IOV in FreeBSD. To see what devices have SR-IOV supported enabled on your machine, check for device nodes in /dev/iov. From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 01:08:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D793575; Sun, 1 Mar 2015 01:08:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66F8B668; Sun, 1 Mar 2015 01:08:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2118Fvj006069; Sun, 1 Mar 2015 01:08:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2118F4C006068; Sun, 1 Mar 2015 01:08:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503010108.t2118F4C006068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 1 Mar 2015 01:08:15 +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: r279467 - in stable: 10/sys/arm/arm 10/sys/arm/ti 10/sys/arm/ti/am335x 10/sys/arm/ti/omap4 9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 01:08:15 -0000 Author: dim Date: Sun Mar 1 01:08:14 2015 New Revision: 279467 URL: https://svnweb.freebsd.org/changeset/base/279467 Log: MFC r279312: Fix a number of -Wcast-qual warnings under sys/arm. No functional change. Submitted by: andrew Modified: stable/9/sys/arm/arm/disassem.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/arm/arm/disassem.c stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c stable/10/sys/arm/ti/ti_scm.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/arm/arm/disassem.c ============================================================================== --- stable/9/sys/arm/arm/disassem.c Sun Mar 1 00:59:35 2015 (r279466) +++ stable/9/sys/arm/arm/disassem.c Sun Mar 1 01:08:14 2015 (r279467) @@ -277,7 +277,7 @@ static void disassemble_printaddr(u_int vm_offset_t disasm(const disasm_interface_t *di, vm_offset_t loc, int altfmt) { - struct arm32_insn *i_ptr = (struct arm32_insn *)&arm32_i; + const struct arm32_insn *i_ptr = arm32_i; u_int insn; int matchp; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 01:08:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DBD05E5; Sun, 1 Mar 2015 01:08:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC719669; Sun, 1 Mar 2015 01:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2118GRL006079; Sun, 1 Mar 2015 01:08:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2118FVl006074; Sun, 1 Mar 2015 01:08:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503010108.t2118FVl006074@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 1 Mar 2015 01:08:15 +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: r279467 - in stable: 10/sys/arm/arm 10/sys/arm/ti 10/sys/arm/ti/am335x 10/sys/arm/ti/omap4 9/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 01:08:17 -0000 Author: dim Date: Sun Mar 1 01:08:14 2015 New Revision: 279467 URL: https://svnweb.freebsd.org/changeset/base/279467 Log: MFC r279312: Fix a number of -Wcast-qual warnings under sys/arm. No functional change. Submitted by: andrew Modified: stable/10/sys/arm/arm/disassem.c stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c stable/10/sys/arm/ti/ti_scm.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/arm/arm/disassem.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/arm/arm/disassem.c ============================================================================== --- stable/10/sys/arm/arm/disassem.c Sun Mar 1 00:59:35 2015 (r279466) +++ stable/10/sys/arm/arm/disassem.c Sun Mar 1 01:08:14 2015 (r279467) @@ -289,7 +289,7 @@ static void disassemble_printaddr(u_int vm_offset_t disasm(const disasm_interface_t *di, vm_offset_t loc, int altfmt) { - struct arm32_insn *i_ptr = (struct arm32_insn *)&arm32_i; + const struct arm32_insn *i_ptr = arm32_i; u_int insn; int matchp; Modified: stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c Sun Mar 1 00:59:35 2015 (r279466) +++ stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c Sun Mar 1 01:08:14 2015 (r279467) @@ -308,8 +308,8 @@ const struct ti_scm_padconf ti_padconf_d const struct ti_scm_device ti_scm_dev = { .padconf_muxmode_mask = 0x7, .padconf_sate_mask = 0x78, - .padstate = (struct ti_scm_padstate *) &ti_padstate_devmap, - .padconf = (struct ti_scm_padconf *) &ti_padconf_devmap, + .padstate = ti_padstate_devmap, + .padconf = ti_padconf_devmap, }; int Modified: stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c Sun Mar 1 00:59:35 2015 (r279466) +++ stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c Sun Mar 1 01:08:14 2015 (r279467) @@ -352,8 +352,8 @@ const struct ti_scm_padconf ti_padconf_d const struct ti_scm_device ti_scm_dev = { .padconf_muxmode_mask = CONTROL_PADCONF_MUXMODE_MASK, .padconf_sate_mask = CONTROL_PADCONF_SATE_MASK, - .padstate = (struct ti_scm_padstate *) &ti_padstate_devmap, - .padconf = (struct ti_scm_padconf *) &ti_padconf_devmap, + .padstate = ti_padstate_devmap, + .padconf = ti_padconf_devmap, }; int Modified: stable/10/sys/arm/ti/ti_scm.h ============================================================================== --- stable/10/sys/arm/ti/ti_scm.h Sun Mar 1 00:59:35 2015 (r279466) +++ stable/10/sys/arm/ti/ti_scm.h Sun Mar 1 01:08:14 2015 (r279467) @@ -59,8 +59,8 @@ struct ti_scm_padstate { struct ti_scm_device { uint16_t padconf_muxmode_mask; uint16_t padconf_sate_mask; - struct ti_scm_padstate *padstate; - struct ti_scm_padconf *padconf; + const struct ti_scm_padstate *padstate; + const struct ti_scm_padconf *padconf; }; struct ti_scm_softc { From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 02:31:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89F5EF14; Sun, 1 Mar 2015 02:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75FEBDF1; Sun, 1 Mar 2015 02:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t212VSCb047038; Sun, 1 Mar 2015 02:31:28 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t212VSgL047037; Sun, 1 Mar 2015 02:31:28 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201503010231.t212VSgL047037@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 1 Mar 2015 02:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279468 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 02:31:28 -0000 Author: neel Date: Sun Mar 1 02:31:27 2015 New Revision: 279468 URL: https://svnweb.freebsd.org/changeset/base/279468 Log: Free up the IPI slot used by IPI_STOP_HARD. Change the numeric value of IPI_STOP_HARD so it doesn't occupy a valid IPI slot. This can be done because IPI_STOP_HARD is actually delivered via NMI. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D1983 Modified: head/sys/x86/include/apicvar.h Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Sun Mar 1 01:08:14 2015 (r279467) +++ head/sys/x86/include/apicvar.h Sun Mar 1 02:31:27 2015 (r279468) @@ -126,7 +126,12 @@ #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ #define IPI_SUSPEND (APIC_IPI_INTS + 8) /* Suspend CPU until restarted. */ -#define IPI_STOP_HARD (APIC_IPI_INTS + 9) /* Stop CPU with a NMI. */ + +/* + * IPI_STOP_HARD does not need to occupy a slot in the IPI vector space since + * it is delivered using an NMI anyways. + */ +#define IPI_STOP_HARD 255 /* Stop CPU with a NMI. */ /* * The spurious interrupt can share the priority class with the IPIs since From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 02:45:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20527240; Sun, 1 Mar 2015 02:45:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C183ED8; Sun, 1 Mar 2015 02:45:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t212jkRM052685; Sun, 1 Mar 2015 02:45:46 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t212jkZ3052684; Sun, 1 Mar 2015 02:45:46 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010245.t212jkZ3052684@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 02:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279469 - head/usr.sbin/iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 02:45:47 -0000 Author: rstone Date: Sun Mar 1 02:45:46 2015 New Revision: 279469 URL: https://svnweb.freebsd.org/changeset/base/279469 Log: Correct a typo. X-MFC-With: r279458 Modified: head/usr.sbin/iovctl/iovctl.conf.5 Modified: head/usr.sbin/iovctl/iovctl.conf.5 ============================================================================== --- head/usr.sbin/iovctl/iovctl.conf.5 Sun Mar 1 02:31:27 2015 (r279468) +++ head/usr.sbin/iovctl/iovctl.conf.5 Sun Mar 1 02:45:46 2015 (r279469) @@ -91,7 +91,7 @@ An individual VF section may override a providing a different value for the configuration parameter. Note that the default section applies to ALL VFs. The default section must appear before any VF sections. -The default may appear before or after the PF section. +The default section may appear before or after the PF section. .Pp The following option types are supported: .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:22:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A98E77; Sun, 1 Mar 2015 04:22:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74036B55; Sun, 1 Mar 2015 04:22:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t214MCJ8099890; Sun, 1 Mar 2015 04:22:12 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t214M7Ib099859; Sun, 1 Mar 2015 04:22:07 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010422.t214M7Ib099859@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 04:22: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: r279470 - in stable/10: sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/dev/pci sys/x86/iommu usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:22:12 -0000 Author: rstone Date: Sun Mar 1 04:22:06 2015 New Revision: 279470 URL: https://svnweb.freebsd.org/changeset/base/279470 Log: MFC r264007,r264008,r264009,r264011,r264012,r264013 MFC support for PCI Alternate RID Interpretation. ARI is an optional PCIe feature that allows PCI devices to present up to 256 functions on a bus. This is effectively a prerequisite for PCI SR-IOV support. r264007: Add a method to get the PCI RID for a device. Reviewed by: kib MFC after: 2 months Sponsored by: Sandvine Inc. r264008: Re-implement the DMAR I/O MMU code in terms of PCI RIDs Under the hood the VT-d spec is really implemented in terms of PCI RIDs instead of bus/slot/function, even though the spec makes pains to convert back to bus/slot/function in examples. However working with bus/slot/function is not correct when PCI ARI is in use, so convert to using RIDs in most cases. bus/slot/function will only be used when reporting errors to a user. Reviewed by: kib MFC after: 2 months Sponsored by: Sandvine Inc. r264009: Re-write bhyve's I/O MMU handling in terms of PCI RID. Reviewed by: neel MFC after: 2 months Sponsored by: Sandvine Inc. r264011: Add support for PCIe ARI PCIe Alternate RID Interpretation (ARI) is an optional feature that allows devices to have up to 256 different functions. It is implemented by always setting the PCI slot number to 0 and re-purposing the 5 bits used to encode the slot number to instead contain the function number. Combined with the original 3 bits allocated for the function number, this allows for 256 functions. This is enabled by default, but it's expected to be a no-op on currently supported hardware. It's a prerequisite for supporting PCI SR-IOV, and I want the ARI support to go in early to help shake out any bugs in it. ARI can be disabled by setting the tunable hw.pci.enable_ari=0. Reviewed by: kib MFC after: 2 months Sponsored by: Sandvine Inc. r264012: Print status of ARI capability in pciconf -c Teach pciconf how to print out the status (enabled/disabled) of the ARI capability on PCI Root Complexes and Downstream Ports. MFC after: 2 months Sponsored by: Sandvine Inc. r264013: Add missing copyright date. MFC after: 2 months Added: stable/10/sys/dev/pci/pcib_support.c - copied, changed from r264007, head/sys/dev/pci/pcib_support.c Modified: stable/10/sys/amd64/vmm/amd/amdv.c stable/10/sys/amd64/vmm/intel/vtd.c stable/10/sys/amd64/vmm/io/iommu.c stable/10/sys/amd64/vmm/io/iommu.h stable/10/sys/amd64/vmm/io/ppt.c stable/10/sys/conf/files stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_if.m stable/10/sys/dev/pci/pci_pci.c stable/10/sys/dev/pci/pcib_if.m stable/10/sys/dev/pci/pcib_private.h stable/10/sys/dev/pci/pcireg.h stable/10/sys/dev/pci/pcivar.h stable/10/sys/x86/iommu/busdma_dmar.c stable/10/sys/x86/iommu/intel_ctx.c stable/10/sys/x86/iommu/intel_dmar.h stable/10/sys/x86/iommu/intel_drv.c stable/10/sys/x86/iommu/intel_fault.c stable/10/sys/x86/iommu/intel_utils.c stable/10/usr.sbin/pciconf/cap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/amd/amdv.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/amdv.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/amd64/vmm/amd/amdv.c Sun Mar 1 04:22:06 2015 (r279470) @@ -99,14 +99,14 @@ amd_iommu_remove_mapping(void *domain, v } static void -amd_iommu_add_device(void *domain, int bus, int slot, int func) +amd_iommu_add_device(void *domain, uint16_t rid) { printf("amd_iommu_add_device: not implemented\n"); } static void -amd_iommu_remove_device(void *domain, int bus, int slot, int func) +amd_iommu_remove_device(void *domain, uint16_t rid) { printf("amd_iommu_remove_device: not implemented\n"); Modified: stable/10/sys/amd64/vmm/intel/vtd.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vtd.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/amd64/vmm/intel/vtd.c Sun Mar 1 04:22:06 2015 (r279470) @@ -99,6 +99,8 @@ struct vtdmap { #define VTD_PTE_SUPERPAGE (1UL << 7) #define VTD_PTE_ADDR_M (0x000FFFFFFFFFF000UL) +#define VTD_RID2IDX(rid) (((rid) & 0xff) * 2) + struct domain { uint64_t *ptp; /* first level page table page */ int pt_levels; /* number of page table levels */ @@ -360,27 +362,24 @@ vtd_disable(void) } static void -vtd_add_device(void *arg, int bus, int slot, int func) +vtd_add_device(void *arg, uint16_t rid) { int idx; uint64_t *ctxp; struct domain *dom = arg; vm_paddr_t pt_paddr; struct vtdmap *vtdmap; - - if (bus < 0 || bus > PCI_BUSMAX || - slot < 0 || slot > PCI_SLOTMAX || - func < 0 || func > PCI_FUNCMAX) - panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); + uint8_t bus; vtdmap = vtdmaps[0]; + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; pt_paddr = vtophys(dom->ptp); - idx = (slot << 3 | func) * 2; + idx = VTD_RID2IDX(rid); if (ctxp[idx] & VTD_CTX_PRESENT) { - panic("vtd_add_device: device %d/%d/%d is already owned by " - "domain %d", bus, slot, func, + panic("vtd_add_device: device %x is already owned by " + "domain %d", rid, (uint16_t)(ctxp[idx + 1] >> 8)); } @@ -404,19 +403,16 @@ vtd_add_device(void *arg, int bus, int s } static void -vtd_remove_device(void *arg, int bus, int slot, int func) +vtd_remove_device(void *arg, uint16_t rid) { int i, idx; uint64_t *ctxp; struct vtdmap *vtdmap; + uint8_t bus; - if (bus < 0 || bus > PCI_BUSMAX || - slot < 0 || slot > PCI_SLOTMAX || - func < 0 || func > PCI_FUNCMAX) - panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); - + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; - idx = (slot << 3 | func) * 2; + idx = VTD_RID2IDX(rid); /* * Order is important. The 'present' bit is must be cleared first. Modified: stable/10/sys/amd64/vmm/io/iommu.c ============================================================================== --- stable/10/sys/amd64/vmm/io/iommu.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/amd64/vmm/io/iommu.c Sun Mar 1 04:22:06 2015 (r279470) @@ -109,19 +109,19 @@ IOMMU_REMOVE_MAPPING(void *domain, vm_pa } static __inline void -IOMMU_ADD_DEVICE(void *domain, int bus, int slot, int func) +IOMMU_ADD_DEVICE(void *domain, uint16_t rid) { if (ops != NULL && iommu_avail) - (*ops->add_device)(domain, bus, slot, func); + (*ops->add_device)(domain, rid); } static __inline void -IOMMU_REMOVE_DEVICE(void *domain, int bus, int slot, int func) +IOMMU_REMOVE_DEVICE(void *domain, uint16_t rid) { if (ops != NULL && iommu_avail) - (*ops->remove_device)(domain, bus, slot, func); + (*ops->remove_device)(domain, rid); } static __inline void @@ -196,7 +196,8 @@ iommu_init(void) continue; /* everything else belongs to the host domain */ - iommu_add_device(host_domain, bus, slot, func); + iommu_add_device(host_domain, + pci_get_rid(dev)); } } } @@ -263,17 +264,17 @@ iommu_host_domain(void) } void -iommu_add_device(void *dom, int bus, int slot, int func) +iommu_add_device(void *dom, uint16_t rid) { - IOMMU_ADD_DEVICE(dom, bus, slot, func); + IOMMU_ADD_DEVICE(dom, rid); } void -iommu_remove_device(void *dom, int bus, int slot, int func) +iommu_remove_device(void *dom, uint16_t rid) { - IOMMU_REMOVE_DEVICE(dom, bus, slot, func); + IOMMU_REMOVE_DEVICE(dom, rid); } void Modified: stable/10/sys/amd64/vmm/io/iommu.h ============================================================================== --- stable/10/sys/amd64/vmm/io/iommu.h Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/amd64/vmm/io/iommu.h Sun Mar 1 04:22:06 2015 (r279470) @@ -39,8 +39,8 @@ typedef uint64_t (*iommu_create_mapping_ vm_paddr_t hpa, uint64_t len); typedef uint64_t (*iommu_remove_mapping_t)(void *domain, vm_paddr_t gpa, uint64_t len); -typedef void (*iommu_add_device_t)(void *domain, int bus, int slot, int func); -typedef void (*iommu_remove_device_t)(void *dom, int bus, int slot, int func); +typedef void (*iommu_add_device_t)(void *domain, uint16_t rid); +typedef void (*iommu_remove_device_t)(void *dom, uint16_t rid); typedef void (*iommu_invalidate_tlb_t)(void *dom); struct iommu_ops { @@ -69,7 +69,7 @@ void iommu_destroy_domain(void *dom); void iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len); void iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len); -void iommu_add_device(void *dom, int bus, int slot, int func); -void iommu_remove_device(void *dom, int bus, int slot, int func); +void iommu_add_device(void *dom, uint16_t rid); +void iommu_remove_device(void *dom, uint16_t rid); void iommu_invalidate_tlb(void *domain); #endif Modified: stable/10/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/amd64/vmm/io/ppt.c Sun Mar 1 04:22:06 2015 (r279470) @@ -346,7 +346,7 @@ ppt_assign_device(struct vm *vm, int bus return (EBUSY); ppt->vm = vm; - iommu_add_device(vm_iommu_domain(vm), bus, slot, func); + iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); return (0); } return (ENOENT); @@ -367,7 +367,7 @@ ppt_unassign_device(struct vm *vm, int b ppt_unmap_mmio(vm, ppt); ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); - iommu_remove_device(vm_iommu_domain(vm), bus, slot, func); + iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); ppt->vm = NULL; return (0); } Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/conf/files Sun Mar 1 04:22:06 2015 (r279470) @@ -1992,6 +1992,7 @@ dev/pci/pci_pci.c optional pci dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard +dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci dev/pdq/if_fea.c optional fea eisa Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pci.c Sun Mar 1 04:22:06 2015 (r279470) @@ -121,6 +121,8 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); +static uint16_t pci_get_rid_method(device_t dev, device_t child); + static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), @@ -175,6 +177,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_release_msi, pci_release_msi_method), DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), + DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD_END }; @@ -358,6 +361,11 @@ TUNABLE_INT("hw.pci.clear_bars", &pci_cl SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, "Ignore firmware-assigned resources for BARs."); +static int pci_enable_ari = 1; +TUNABLE_INT("hw.pci.enable_ari", &pci_enable_ari); +SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, + 0, "Enable support for PCIe Alternative RID Interpretation"); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -3292,6 +3300,19 @@ pci_add_resources(device_t bus, device_t } } +static struct pci_devinfo * +pci_identify_function(device_t pcib, device_t dev, int domain, int busno, + int slot, int func, size_t dinfo_size) +{ + struct pci_devinfo *dinfo; + + dinfo = pci_read_device(pcib, domain, busno, slot, func, dinfo_size); + if (dinfo != NULL) + pci_add_child(dev, dinfo); + + return (dinfo); +} + void pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size) { @@ -3301,6 +3322,24 @@ pci_add_children(device_t dev, int domai int maxslots; int s, f, pcifunchigh; uint8_t hdrtype; + int first_func; + + /* + * Try to detect a device at slot 0, function 0. If it exists, try to + * enable ARI. We must enable ARI before detecting the rest of the + * functions on this bus as ARI changes the set of slots and functions + * that are legal on this bus. + */ + dinfo = pci_identify_function(pcib, dev, domain, busno, 0, 0, + dinfo_size); + if (dinfo != NULL && pci_enable_ari) + PCIB_TRY_ENABLE_ARI(pcib, dinfo->cfg.dev); + + /* + * Start looking for new devices on slot 0 at function 1 because we + * just identified the device at slot 0, function 0. + */ + first_func = 1; KASSERT(dinfo_size >= sizeof(struct pci_devinfo), ("dinfo_size too small")); @@ -3313,14 +3352,13 @@ pci_add_children(device_t dev, int domai if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) continue; if (hdrtype & PCIM_MFDEV) - pcifunchigh = PCI_FUNCMAX; - for (f = 0; f <= pcifunchigh; f++) { - dinfo = pci_read_device(pcib, domain, busno, s, f, + pcifunchigh = PCIB_MAXFUNCS(pcib); + for (f = first_func; f <= pcifunchigh; f++) + pci_identify_function(pcib, dev, domain, busno, s, f, dinfo_size); - if (dinfo != NULL) { - pci_add_child(dev, dinfo); - } - } + + /* For slots after slot 0 we need to check for function 0. */ + first_func = 0; } #undef REG } @@ -4877,3 +4915,10 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } + +static uint16_t +pci_get_rid_method(device_t dev, device_t child) +{ + + return (PCIB_GET_RID(device_get_parent(dev), child)); +} Modified: stable/10/sys/dev/pci/pci_if.m ============================================================================== --- stable/10/sys/dev/pci/pci_if.m Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pci_if.m Sun Mar 1 04:22:06 2015 (r279470) @@ -159,3 +159,9 @@ METHOD int msix_count { device_t dev; device_t child; } DEFAULT null_msi_count; + +METHOD uint16_t get_rid { + device_t dev; + device_t child; +}; + Modified: stable/10/sys/dev/pci/pci_pci.c ============================================================================== --- stable/10/sys/dev/pci/pci_pci.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pci_pci.c Sun Mar 1 04:22:06 2015 (r279470) @@ -56,6 +56,14 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); +static uint16_t pcib_ari_get_rid(device_t pcib, device_t dev); +static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, + u_int f, u_int reg, int width); +static void pcib_write_config(device_t dev, u_int b, u_int s, + u_int f, u_int reg, uint32_t val, int width); +static int pcib_ari_maxslots(device_t dev); +static int pcib_ari_maxfuncs(device_t dev); +static int pcib_try_enable_ari(device_t pcib, device_t dev); static device_method_t pcib_methods[] = { /* Device interface */ @@ -83,7 +91,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), + DEVMETHOD(pcib_maxslots, pcib_ari_maxslots), + DEVMETHOD(pcib_maxfuncs, pcib_ari_maxfuncs), DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), @@ -93,6 +102,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), + DEVMETHOD(pcib_get_rid, pcib_ari_get_rid), + DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD_END }; @@ -1630,27 +1641,94 @@ pcib_alloc_resource(device_t dev, device #endif /* + * If ARI is enabled on this downstream port, translate the function number + * to the non-ARI slot/function. The downstream port will convert it back in + * hardware. If ARI is not enabled slot and func are not modified. + */ +static __inline void +pcib_xlate_ari(device_t pcib, int bus, int *slot, int *func) +{ + struct pcib_softc *sc; + int ari_func; + + sc = device_get_softc(pcib); + ari_func = *func; + + if (sc->flags & PCIB_ENABLE_ARI) { + KASSERT(*slot == 0, + ("Non-zero slot number with ARI enabled!")); + *slot = PCIE_ARI_SLOT(ari_func); + *func = PCIE_ARI_FUNC(ari_func); + } +} + + +static void +pcib_enable_ari(struct pcib_softc *sc, uint32_t pcie_pos) +{ + uint32_t ctl2; + + ctl2 = pci_read_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, 4); + ctl2 |= PCIEM_CTL2_ARI; + pci_write_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, ctl2, 4); + + sc->flags |= PCIB_ENABLE_ARI; +} + +/* * PCIB interface. */ int pcib_maxslots(device_t dev) { - return(PCI_SLOTMAX); + return (PCI_SLOTMAX); +} + +static int +pcib_ari_maxslots(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + + if (sc->flags & PCIB_ENABLE_ARI) + return (PCIE_ARI_SLOTMAX); + else + return (PCI_SLOTMAX); +} + +static int +pcib_ari_maxfuncs(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + + if (sc->flags & PCIB_ENABLE_ARI) + return (PCIE_ARI_FUNCMAX); + else + return (PCI_FUNCMAX); } /* * Since we are a child of a PCI bus, its parent must support the pcib interface. */ -uint32_t +static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) { - return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, width)); + + pcib_xlate_ari(dev, b, &s, &f); + return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, + f, reg, width)); } -void +static void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width) { - PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, val, width); + + pcib_xlate_ari(dev, b, &s, &f); + PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, + reg, val, width); } /* @@ -1762,3 +1840,83 @@ pcib_power_for_sleep(device_t pcib, devi bus = device_get_parent(pcib); return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } + +static uint16_t +pcib_ari_get_rid(device_t pcib, device_t dev) +{ + struct pcib_softc *sc; + uint8_t bus, slot, func; + + sc = device_get_softc(pcib); + + if (sc->flags & PCIB_ENABLE_ARI) { + bus = pci_get_bus(dev); + func = pci_get_function(dev); + + return (PCI_ARI_RID(bus, func)); + } else { + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + + return (PCI_RID(bus, slot, func)); + } +} + +/* + * Check that the downstream port (pcib) and the endpoint device (dev) both + * support ARI. If so, enable it and return 0, otherwise return an error. + */ +static int +pcib_try_enable_ari(device_t pcib, device_t dev) +{ + struct pcib_softc *sc; + int error; + uint32_t cap2; + int ari_cap_off; + uint32_t ari_ver; + uint32_t pcie_pos; + + sc = device_get_softc(pcib); + + /* + * ARI is controlled in a register in the PCIe capability structure. + * If the downstream port does not have the PCIe capability structure + * then it does not support ARI. + */ + error = pci_find_cap(pcib, PCIY_EXPRESS, &pcie_pos); + if (error != 0) + return (ENODEV); + + /* Check that the PCIe port advertises ARI support. */ + cap2 = pci_read_config(pcib, pcie_pos + PCIER_DEVICE_CAP2, 4); + if (!(cap2 & PCIEM_CAP2_ARI)) + return (ENODEV); + + /* + * Check that the endpoint device advertises ARI support via the ARI + * extended capability structure. + */ + error = pci_find_extcap(dev, PCIZ_ARI, &ari_cap_off); + if (error != 0) + return (ENODEV); + + /* + * Finally, check that the endpoint device supports the same version + * of ARI that we do. + */ + ari_ver = pci_read_config(dev, ari_cap_off, 4); + if (PCI_EXTCAP_VER(ari_ver) != PCIB_SUPPORTED_ARI_VER) { + if (bootverbose) + device_printf(pcib, + "Unsupported version of ARI (%d) detected\n", + PCI_EXTCAP_VER(ari_ver)); + + return (ENXIO); + } + + pcib_enable_ari(sc, pcie_pos); + + return (0); +} + Modified: stable/10/sys/dev/pci/pcib_if.m ============================================================================== --- stable/10/sys/dev/pci/pcib_if.m Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pcib_if.m Sun Mar 1 04:22:06 2015 (r279470) @@ -27,7 +27,9 @@ # #include +#include #include +#include INTERFACE pcib; @@ -47,6 +49,14 @@ METHOD int maxslots { }; # +# +# Return the number of functions on the attached PCI bus. +# +METHOD int maxfuncs { + device_t dev; +} DEFAULT pcib_maxfuncs; + +# # Read configuration space on the PCI bus. The bus, slot and func # arguments determine the device which is being read and the reg # argument is a byte offset into configuration space for that @@ -154,3 +164,21 @@ METHOD int power_for_sleep { device_t dev; int *pstate; }; + +# +# Return the PCI Routing Identifier (RID) for the device. +# +METHOD uint16_t get_rid { + device_t pcib; + device_t dev; +} DEFAULT pcib_get_rid; + +# +# Enable Alternative RID Interpretation if both the downstream port (pcib) +# and the endpoint device (dev) both support it. +# +METHOD int try_enable_ari { + device_t pcib; + device_t dev; +}; + Modified: stable/10/sys/dev/pci/pcib_private.h ============================================================================== --- stable/10/sys/dev/pci/pcib_private.h Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pcib_private.h Sun Mar 1 04:22:06 2015 (r279470) @@ -93,6 +93,7 @@ struct pcib_softc #define PCIB_SUBTRACTIVE 0x1 #define PCIB_DISABLE_MSI 0x2 #define PCIB_DISABLE_MSIX 0x4 +#define PCIB_ENABLE_ARI 0x8 uint16_t command; /* command register */ u_int domain; /* domain number */ u_int pribus; /* primary bus number */ @@ -115,6 +116,8 @@ struct pcib_softc uint8_t seclat; /* secondary bus latency timer */ }; +#define PCIB_SUPPORTED_ARI_VER 1 + typedef uint32_t pci_read_config_fn(int b, int s, int f, int reg, int width); #ifdef NEW_PCIB @@ -135,13 +138,13 @@ int pcib_release_resource(device_t dev, struct resource *r); #endif int pcib_maxslots(device_t dev); -uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); -void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width); +int pcib_maxfuncs(device_t dev); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); int pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int pcib_release_msi(device_t pcib, device_t dev, int count, int *irqs); int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); +uint16_t pcib_get_rid(device_t pcib, device_t dev); #endif Copied and modified: stable/10/sys/dev/pci/pcib_support.c (from r264007, head/sys/dev/pci/pcib_support.c) ============================================================================== --- head/sys/dev/pci/pcib_support.c Tue Apr 1 15:47:24 2014 (r264007, copy source) +++ stable/10/sys/dev/pci/pcib_support.c Sun Mar 1 04:22:06 2015 (r279470) @@ -1,5 +1,5 @@ /* - * Copyright (c) Sandvine Inc. All rights reserved. + * Copyright (c) 2014 Sandvine Inc. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,12 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +int +pcib_maxfuncs(device_t dev) +{ + return (PCI_FUNCMAX); +} + uint16_t pcib_get_rid(device_t pcib, device_t dev) { Modified: stable/10/sys/dev/pci/pcireg.h ============================================================================== --- stable/10/sys/dev/pci/pcireg.h Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pcireg.h Sun Mar 1 04:22:06 2015 (r279470) @@ -48,6 +48,29 @@ #define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 +#define PCIE_ARI_SLOTMAX 0 +#define PCIE_ARI_FUNCMAX 255 + +#define PCI_RID_BUS_SHIFT 8 +#define PCI_RID_SLOT_SHIFT 3 +#define PCI_RID_FUNC_SHIFT 0 + +#define PCI_RID(bus, slot, func) \ + ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ + (((slot) & PCI_SLOTMAX) << PCI_RID_SLOT_SHIFT) | \ + (((func) & PCI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) + +#define PCI_ARI_RID(bus, func) \ + ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ + (((func) & PCIE_ARI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) + +#define PCI_RID2BUS(rid) (((rid) >> PCI_RID_BUS_SHIFT) & PCI_BUSMAX) +#define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) +#define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) + +#define PCIE_ARI_SLOT(func) (((func) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) +#define PCIE_ARI_FUNC(func) (((func) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) + /* PCI config header registers for all devices */ #define PCIR_DEVVENDOR 0x00 @@ -775,6 +798,7 @@ #define PCIEM_ROOT_STA_PME_STATUS 0x00010000 #define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 +#define PCIEM_CAP2_ARI 0x20 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f #define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 @@ -895,3 +919,4 @@ /* Serial Number definitions */ #define PCIR_SERIAL_LOW 0x04 #define PCIR_SERIAL_HIGH 0x08 + Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/dev/pci/pcivar.h Sun Mar 1 04:22:06 2015 (r279470) @@ -482,6 +482,12 @@ pci_msix_count(device_t dev) return (PCI_MSIX_COUNT(device_get_parent(dev), dev)); } +static __inline uint16_t +pci_get_rid(device_t dev) +{ + return (PCI_GET_RID(device_get_parent(dev), dev)); +} + device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); Modified: stable/10/sys/x86/iommu/busdma_dmar.c ============================================================================== --- stable/10/sys/x86/iommu/busdma_dmar.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/x86/iommu/busdma_dmar.c Sun Mar 1 04:22:06 2015 (r279470) @@ -93,7 +93,7 @@ dmar_bus_dma_is_dev_disabled(int domain, * bounce mapping. */ static device_t -dmar_get_requester(device_t dev, int *bus, int *slot, int *func) +dmar_get_requester(device_t dev, uint16_t *rid) { devclass_t pci_class; device_t pci, pcib, requester; @@ -102,9 +102,7 @@ dmar_get_requester(device_t dev, int *bu pci_class = devclass_find("pci"); requester = dev; - *bus = pci_get_bus(dev); - *slot = pci_get_slot(dev); - *func = pci_get_function(dev); + *rid = pci_get_rid(dev); /* * Walk the bridge hierarchy from the target device to the @@ -161,8 +159,7 @@ dmar_get_requester(device_t dev, int *bu * same page tables for taken and * non-taken transactions. */ - *bus = pci_get_bus(dev); - *slot = *func = 0; + *rid = PCI_RID(pci_get_bus(dev), 0, 0); } else { /* * Neither the device nor the bridge @@ -171,9 +168,7 @@ dmar_get_requester(device_t dev, int *bu * will use the bridge's BSF as the * requester ID. */ - *bus = pci_get_bus(pcib); - *slot = pci_get_slot(pcib); - *func = pci_get_function(pcib); + *rid = pci_get_rid(pcib); } } /* @@ -193,9 +188,9 @@ dmar_instantiate_ctx(struct dmar_unit *d device_t requester; struct dmar_ctx *ctx; bool disabled; - int bus, slot, func; + uint16_t rid; - requester = dmar_get_requester(dev, &bus, &slot, &func); + requester = dmar_get_requester(dev, &rid); /* * If the user requested the IOMMU disabled for the device, we @@ -204,9 +199,10 @@ dmar_instantiate_ctx(struct dmar_unit *d * Instead provide the identity mapping for the device * context. */ - disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(dev), bus, - slot, func); - ctx = dmar_get_ctx(dmar, requester, bus, slot, func, disabled, rmrr); + disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(requester), + pci_get_bus(requester), pci_get_slot(requester), + pci_get_function(requester)); + ctx = dmar_get_ctx(dmar, requester, rid, disabled, rmrr); if (ctx == NULL) return (NULL); if (disabled) { Modified: stable/10/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/10/sys/x86/iommu/intel_ctx.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/x86/iommu/intel_ctx.c Sun Mar 1 04:22:06 2015 (r279470) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); @@ -106,14 +107,14 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, { dmar_ctx_entry_t *ctxp; - ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + ctx->bus, + ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->rid), DMAR_PGF_NOALLOC | DMAR_PGF_WAITOK, sfp); - ctxp += ((ctx->slot & 0x1f) << 3) + (ctx->func & 0x7); + ctxp += ctx->rid & 0xff; return (ctxp); } static void -ctx_tag_init(struct dmar_ctx *ctx) +ctx_tag_init(struct dmar_ctx *ctx, device_t dev) { bus_addr_t maxaddr; @@ -127,6 +128,7 @@ ctx_tag_init(struct dmar_ctx *ctx) ctx->ctx_tag.common.nsegments = BUS_SPACE_UNRESTRICTED; ctx->ctx_tag.common.maxsegsz = maxaddr; ctx->ctx_tag.ctx = ctx; + ctx->ctx_tag.owner = dev; /* XXXKIB initialize tag further */ } @@ -139,7 +141,10 @@ ctx_id_entry_init(struct dmar_ctx *ctx, unit = ctx->dmar; KASSERT(ctxp->ctx1 == 0 && ctxp->ctx2 == 0, ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", - unit->unit, ctx->bus, ctx->slot, ctx->func, ctxp->ctx1, + unit->unit, pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), + ctxp->ctx1, ctxp->ctx2)); ctxp->ctx2 = DMAR_CTX2_DID(ctx->domain); ctxp->ctx2 |= ctx->awlvl; @@ -229,7 +234,7 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi } static struct dmar_ctx * -dmar_get_ctx_alloc(struct dmar_unit *dmar, int bus, int slot, int func) +dmar_get_ctx_alloc(struct dmar_unit *dmar, uint16_t rid) { struct dmar_ctx *ctx; @@ -239,9 +244,7 @@ dmar_get_ctx_alloc(struct dmar_unit *dma TASK_INIT(&ctx->unload_task, 0, dmar_ctx_unload_task, ctx); mtx_init(&ctx->lock, "dmarctx", NULL, MTX_DEF); ctx->dmar = dmar; - ctx->bus = bus; - ctx->slot = slot; - ctx->func = func; + ctx->rid = rid; return (ctx); } @@ -264,19 +267,22 @@ dmar_ctx_dtr(struct dmar_ctx *ctx, bool } struct dmar_ctx * -dmar_get_ctx(struct dmar_unit *dmar, device_t dev, int bus, int slot, int func, - bool id_mapped, bool rmrr_init) +dmar_get_ctx(struct dmar_unit *dmar, device_t dev, uint16_t rid, bool id_mapped, + bool rmrr_init) { struct dmar_ctx *ctx, *ctx1; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; - int error, mgaw; + int bus, slot, func, error, mgaw; bool enable; + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); - ctx = dmar_find_ctx_locked(dmar, bus, slot, func); + ctx = dmar_find_ctx_locked(dmar, rid); error = 0; if (ctx == NULL) { /* @@ -285,7 +291,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev */ DMAR_UNLOCK(dmar); dmar_ensure_ctx_page(dmar, bus); - ctx1 = dmar_get_ctx_alloc(dmar, bus, slot, func); + ctx1 = dmar_get_ctx_alloc(dmar, rid); if (id_mapped) { /* @@ -353,7 +359,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * Recheck the contexts, other thread might have * already allocated needed one. */ - ctx = dmar_find_ctx_locked(dmar, bus, slot, func); + ctx = dmar_find_ctx_locked(dmar, rid); if (ctx == NULL) { ctx = ctx1; ctx->ctx_tag.owner = dev; @@ -365,7 +371,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev TD_PINNED_ASSERT; return (NULL); } - ctx_tag_init(ctx); + ctx_tag_init(ctx, dev); /* * This is the first activated context for the @@ -527,14 +533,14 @@ dmar_free_ctx(struct dmar_ctx *ctx) } struct dmar_ctx * -dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, int slot, int func) +dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid) { struct dmar_ctx *ctx; DMAR_ASSERT_LOCKED(dmar); LIST_FOREACH(ctx, &dmar->contexts, link) { - if (ctx->bus == bus && ctx->slot == slot && ctx->func == func) + if (ctx->rid == rid) return (ctx); } return (NULL); Modified: stable/10/sys/x86/iommu/intel_dmar.h ============================================================================== --- stable/10/sys/x86/iommu/intel_dmar.h Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/x86/iommu/intel_dmar.h Sun Mar 1 04:22:06 2015 (r279470) @@ -74,9 +74,7 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar #define DMAR_MAP_ENTRY_TM 0x8000 /* Transient */ struct dmar_ctx { - int bus; /* pci bus/slot/func */ - int slot; - int func; + uint16_t rid; /* pci RID */ int domain; /* DID */ int mgaw; /* Real max address width */ int agaw; /* Adjusted guest address width */ @@ -272,12 +270,11 @@ void ctx_free_pgtbl(struct dmar_ctx *ctx struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); -struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, - int bus, int slot, int func, bool id_mapped, bool rmrr_init); +struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, + uint16_t rid, bool id_mapped, bool rmrr_init); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); -struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, - int slot, int func); +struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); void dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free); void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep); Modified: stable/10/sys/x86/iommu/intel_drv.c ============================================================================== --- stable/10/sys/x86/iommu/intel_drv.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/x86/iommu/intel_drv.c Sun Mar 1 04:22:06 2015 (r279470) @@ -1006,7 +1006,9 @@ dmar_print_ctx(struct dmar_ctx *ctx, boo db_printf( " @%p pci%d:%d:%d dom %d mgaw %d agaw %d pglvl %d end %jx\n" " refs %d flags %x pgobj %p map_ents %u loads %lu unloads %lu\n", - ctx, ctx->bus, ctx->slot, ctx->func, ctx->domain, ctx->mgaw, + ctx, pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), ctx->domain, ctx->mgaw, ctx->agaw, ctx->pglvl, (uintmax_t)ctx->end, ctx->refs, ctx->flags, ctx->pgtbl_obj, ctx->entries_cnt, ctx->loads, ctx->unloads); @@ -1079,8 +1081,10 @@ DB_FUNC(dmar_ctx, db_dmar_print_ctx, db_ for (i = 0; i < dmar_devcnt; i++) { unit = device_get_softc(dmar_devs[i]); LIST_FOREACH(ctx, &unit->contexts, link) { - if (domain == unit->segment && bus == ctx->bus && - device == ctx->slot && function == ctx->func) { + if (domain == unit->segment && + bus == pci_get_bus(ctx->ctx_tag.owner) && + device == pci_get_slot(ctx->ctx_tag.owner) && + function == pci_get_function(ctx->ctx_tag.owner)) { dmar_print_ctx(ctx, show_mappings); goto out; } Modified: stable/10/sys/x86/iommu/intel_fault.c ============================================================================== --- stable/10/sys/x86/iommu/intel_fault.c Sun Mar 1 02:45:46 2015 (r279469) +++ stable/10/sys/x86/iommu/intel_fault.c Sun Mar 1 04:22:06 2015 (r279470) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -203,19 +205,28 @@ dmar_fault_task(void *arg, int pending _ DMAR_FAULT_UNLOCK(unit); sid = DMAR_FRCD2_SID(fault_rec[1]); - bus = (sid >> 8) & 0xf; - slot = (sid >> 3) & 0x1f; - func = sid & 0x7; printf("DMAR%d: ", unit->unit); DMAR_LOCK(unit); - ctx = dmar_find_ctx_locked(unit, bus, slot, func); + ctx = dmar_find_ctx_locked(unit, sid); if (ctx == NULL) { printf(":"); + + /* + * Note that the slot and function will not be correct + * if ARI is in use, but without a ctx entry we have + * no way of knowing whether ARI is in use or not. + */ + bus = PCI_RID2BUS(sid); + slot = PCI_RID2SLOT(sid); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:26:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC6BE203; Sun, 1 Mar 2015 04:26:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8F32B7A; Sun, 1 Mar 2015 04:26:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t214Qm1T000608; Sun, 1 Mar 2015 04:26:48 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t214Qm0d000607; Sun, 1 Mar 2015 04:26:48 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010426.t214Qm0d000607@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 04:26: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: r279471 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:26:49 -0000 Author: rstone Date: Sun Mar 1 04:26:47 2015 New Revision: 279471 URL: https://svnweb.freebsd.org/changeset/base/279471 Log: MFC r264091 Correct a PCI enumeration bug introduced in r264011 Ensure that first_func is set to 0 on every iteration of the PCI slot enumeration loop after the first. There is a continue statement that would cause first_func to stay at 1 any PCI device where slot 0 has no functions until we find a slot that does have a function. This would cause us to not enumerate the first PCI function on the device. Credit to markj@ for spotting the bug. X-MFC-With: r264011 Modified: stable/10/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Sun Mar 1 04:22:06 2015 (r279470) +++ stable/10/sys/dev/pci/pci.c Sun Mar 1 04:26:47 2015 (r279471) @@ -3344,7 +3344,7 @@ pci_add_children(device_t dev, int domai KASSERT(dinfo_size >= sizeof(struct pci_devinfo), ("dinfo_size too small")); maxslots = PCIB_MAXSLOTS(pcib); - for (s = 0; s <= maxslots; s++) { + for (s = 0; s <= maxslots; s++, first_func = 0) { pcifunchigh = 0; f = 0; DELAY(1); @@ -3356,9 +3356,6 @@ pci_add_children(device_t dev, int domai for (f = first_func; f <= pcifunchigh; f++) pci_identify_function(pcib, dev, domain, busno, s, f, dinfo_size); - - /* For slots after slot 0 we need to check for function 0. */ - first_func = 0; } #undef REG } From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:28:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80981346; Sun, 1 Mar 2015 04:28:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C76EB88; Sun, 1 Mar 2015 04:28:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t214SVnO000876; Sun, 1 Mar 2015 04:28:31 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t214SVwB000871; Sun, 1 Mar 2015 04:28:31 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010428.t214SVwB000871@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 04:28:31 +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: r279472 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:28:31 -0000 Author: rstone Date: Sun Mar 1 04:28:30 2015 New Revision: 279472 URL: https://svnweb.freebsd.org/changeset/base/279472 Log: MFC r265107 Be consistent with the whitespace in the rest of these files. X-MFC-With: r264007 Modified: stable/10/sys/dev/pci/pci_if.m stable/10/sys/dev/pci/pcib_if.m Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pci_if.m ============================================================================== --- stable/10/sys/dev/pci/pci_if.m Sun Mar 1 04:26:47 2015 (r279471) +++ stable/10/sys/dev/pci/pci_if.m Sun Mar 1 04:28:30 2015 (r279472) @@ -161,7 +161,7 @@ METHOD int msix_count { } DEFAULT null_msi_count; METHOD uint16_t get_rid { - device_t dev; - device_t child; + device_t dev; + device_t child; }; Modified: stable/10/sys/dev/pci/pcib_if.m ============================================================================== --- stable/10/sys/dev/pci/pcib_if.m Sun Mar 1 04:26:47 2015 (r279471) +++ stable/10/sys/dev/pci/pcib_if.m Sun Mar 1 04:28:30 2015 (r279472) @@ -169,8 +169,8 @@ METHOD int power_for_sleep { # Return the PCI Routing Identifier (RID) for the device. # METHOD uint16_t get_rid { - device_t pcib; - device_t dev; + device_t pcib; + device_t dev; } DEFAULT pcib_get_rid; # From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:30:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAFB5491; Sun, 1 Mar 2015 04:30:47 +0000 (UTC) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2D64C24; Sun, 1 Mar 2015 04:30:47 +0000 (UTC) Received: by igbhl2 with SMTP id hl2so9765433igb.3; Sat, 28 Feb 2015 20:30:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LEk3XyIgVCGhjBJs2eJ5NJDmAZrXWkvD1XKwejLQu1Y=; b=DffVUtzeyVZu2aKL2GJhTgZn8qbfy0Nj+5FspEY6exxgnXE0tn9LSWM17q7fk+TYfM UD7e2olweo0AUlFJu2HYUbs9Y8DncmAVYAA2JNcoxH+lLRTFv8qGAi41qO/2D+ya5j+g gUU0eYpH0d7QMz15J73fXAw14v5TvazfHwwcEHKCZE7Zv/CtrSyZrcEubLSwrqTt7BlA PWib9mh/hTvkAXw0byLEwy+SAhawTm40xo7F6KGThCstijuBdlnZrhi6Lzw8R0Sqyr3D XWbEzYKyA81uZAIogZv7xvHDQAiPxppPlNIW8KDbgqHh97o5qa0PPgkKEyVSyPUGHQD6 A3wQ== MIME-Version: 1.0 X-Received: by 10.42.150.130 with SMTP id a2mr24181580icw.69.1425184246917; Sat, 28 Feb 2015 20:30:46 -0800 (PST) Received: by 10.107.156.75 with HTTP; Sat, 28 Feb 2015 20:30:46 -0800 (PST) In-Reply-To: <201503010426.t214Qm0d000607@svn.freebsd.org> References: <201503010426.t214Qm0d000607@svn.freebsd.org> Date: Sat, 28 Feb 2015 23:30:46 -0500 Message-ID: Subject: Re: svn commit: r279471 - stable/10/sys/dev/pci From: Ryan Stone To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:30:48 -0000 On Sat, Feb 28, 2015 at 11:26 PM, Ryan Stone wrote: > Author: rstone > Date: Sun Mar 1 04:26:47 2015 > New Revision: 279471 > URL: https://svnweb.freebsd.org/changeset/base/279471 > > Log: > MFC r264091 > > Correct a PCI enumeration bug introduced in r264011 > > Ensure that first_func is set to 0 on every iteration of the PCI slot > enumeration loop after the first. There is a continue statement that would > cause first_func to stay at 1 any PCI device where slot 0 has no functions > until we find a slot that does have a function. This would cause us to > not enumerate the first PCI function on the device. > > Credit to markj@ for spotting the bug. > > X-MFC-With: r264011 So I didn't get an MFC notice for this one (and I very nearly forgot to MFC it, which would have been fairly disastrous for somebody :( ). Is my understanding of the X-MFC-With: tag incorrect? I thought that setting it would cause me to get a reminder at the same time as r264011 From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:36:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFB9D621; Sun, 1 Mar 2015 04:36:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A77C54; Sun, 1 Mar 2015 04:36:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t214aLeO005485; Sun, 1 Mar 2015 04:36:21 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t214aLHb005484; Sun, 1 Mar 2015 04:36:21 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010436.t214aLHb005484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 04:36: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: r279473 - stable/10/usr.bin/systat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:36:21 -0000 Author: rstone Date: Sun Mar 1 04:36:20 2015 New Revision: 279473 URL: https://svnweb.freebsd.org/changeset/base/279473 Log: MFC r272284 Fix integer truncation in affecting systat -ifstat The "systat -ifstat" command was using a u_int to store byte counters. With a 10Gbps or faster interface, this overflows within the default 5 second refresh period. Switch to using a uint64_t across the board, which matches the size used for all counters as of r263102. PR: 182448 MFC after: 1 week Sponsored by: Sandvine Inc Modified: stable/10/usr.bin/systat/ifstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/systat/ifstat.c ============================================================================== --- stable/10/usr.bin/systat/ifstat.c Sun Mar 1 04:28:30 2015 (r279472) +++ stable/10/usr.bin/systat/ifstat.c Sun Mar 1 04:36:20 2015 (r279473) @@ -68,14 +68,14 @@ struct if_stat { struct ifmibdata if_mib; struct timeval tv; struct timeval tv_lastchanged; - u_long if_in_curtraffic; - u_long if_out_curtraffic; - u_long if_in_traffic_peak; - u_long if_out_traffic_peak; - u_long if_in_curpps; - u_long if_out_curpps; - u_long if_in_pps_peak; - u_long if_out_pps_peak; + uint64_t if_in_curtraffic; + uint64_t if_out_curtraffic; + uint64_t if_in_traffic_peak; + uint64_t if_out_traffic_peak; + uint64_t if_in_curpps; + uint64_t if_out_curpps; + uint64_t if_in_pps_peak; + uint64_t if_out_pps_peak; u_int if_row; /* Index into ifmib sysctl */ u_int if_ypos; /* 0 if not being displayed */ u_int display; @@ -263,8 +263,8 @@ fetchifstat(void) struct if_stat *ifp = NULL; struct timeval tv, new_tv, old_tv; double elapsed = 0.0; - u_int new_inb, new_outb, old_inb, old_outb = 0; - u_int new_inp, new_outp, old_inp, old_outp = 0; + uint64_t new_inb, new_outb, old_inb, old_outb = 0; + uint64_t new_inp, new_outp, old_inp, old_outp = 0; SLIST_FOREACH(ifp, &curlist, link) { /* From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:39:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECA94772; Sun, 1 Mar 2015 04:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D911BC6D; Sun, 1 Mar 2015 04:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t214d8ma005865; Sun, 1 Mar 2015 04:39:08 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t214d8Ju005864; Sun, 1 Mar 2015 04:39:08 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503010439.t214d8Ju005864@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sun, 1 Mar 2015 04:39:08 +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: r279474 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:39:09 -0000 Author: rstone Date: Sun Mar 1 04:39:07 2015 New Revision: 279474 URL: https://svnweb.freebsd.org/changeset/base/279474 Log: MFC r277649: vmspace_release() may sleep if the last reference is being released, so add a WITNESS_WARN() to catch cases where it is called with a non-sleepable lock held. MFC after: 1 month Sponsored by: Sandvine Inc. 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 Sun Mar 1 04:36:20 2015 (r279473) +++ stable/10/sys/vm/vm_map.c Sun Mar 1 04:39:07 2015 (r279474) @@ -342,6 +342,9 @@ void vmspace_free(struct vmspace *vm) { + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "vmspace_free() called with non-sleepable lock held"); + if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 04:40:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C58A48A7; Sun, 1 Mar 2015 04:40:49 +0000 (UTC) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 941FECF8; Sun, 1 Mar 2015 04:40:49 +0000 (UTC) Received: by iecrd18 with SMTP id rd18so40272105iec.8; Sat, 28 Feb 2015 20:40:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YC3tN5p826A+Aedd+Ese0VTVJmZyejHjFpYp6F0IuE4=; b=zQmQ+S3K31Z5TWZiEEVOutHWQqUh+D/KF9YEOXQ92mUa7UU/F4l/+YA+ONeMqf6N0m HM038wln8eeBoo0vQzJqRM+QlZQTk6lPaEaiDqrL0i9OaBNNcwRdIiaGSrzgQk5qVfhC BAGmDOMz4gVXaQ6eMsXQofHlckyXE+VJxZbRq/IgTCnIuY85gdtkbteGBOrhm9ujAPgo AWUz5UfOIg/IwdHpTbnYzkYI6sru4q7oN65BA8YZZN8nPmNZRxouJeD9HpMuxrFiNyuT zvJp/kQhNIiPV4khYHPsQbuPa4cMwA0ZatQnQX8CNm/FM+AioqbLrq0Jwxe0fM9rm6LO cuLg== MIME-Version: 1.0 X-Received: by 10.42.210.20 with SMTP id gi20mr24214878icb.34.1425184848904; Sat, 28 Feb 2015 20:40:48 -0800 (PST) Received: by 10.107.156.75 with HTTP; Sat, 28 Feb 2015 20:40:48 -0800 (PST) In-Reply-To: <20150222120659.GA28811@zxy.spb.ru> References: <201409291738.s8THcpxo038996@svn.freebsd.org> <20150222120659.GA28811@zxy.spb.ru> Date: Sat, 28 Feb 2015 23:40:48 -0500 Message-ID: Subject: Re: svn commit: r272284 - head/usr.bin/systat From: Ryan Stone To: Slawa Olhovchenkov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 04:40:49 -0000 On Sun, Feb 22, 2015 at 7:06 AM, Slawa Olhovchenkov wrote: > No NFC yet. Thanks for the reminder. This was MFC'ed to stable/10 in r279473 From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 05:25:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9CFD1D10; Sun, 1 Mar 2015 05:25:41 +0000 (UTC) Received: from mail-pd0-x230.google.com (mail-pd0-x230.google.com [IPv6:2607:f8b0:400e:c02::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71BA79EA; Sun, 1 Mar 2015 05:25:41 +0000 (UTC) Received: by pdbft15 with SMTP id ft15so8749796pdb.11; Sat, 28 Feb 2015 21:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=UiaVok6ujR4r9YUWFjFuaQjuUyX7qryBmdeVrgLb2vI=; b=oxaylL7JxPRCO/s7HnY/Pc68gUz7OHY3fITiSoBgCKUyaGP8yR2UHYMEt8JmwENojZ Cg5rpjGcEhF9p9BwdI5LzYR4n6Wjhn5g0aCj959vR3fyN3Vec0CMv4r7P5dbFQzIXm4Y oB1jZLgD6bOxUJkXV9g9kNx/8CG5dWRMYfGuQStGETJP4XiQecjrwr63aG2cRbUUvg3N GXbOz4C81z8k7+/od7ZghxW0mekrXsQmWjrVvsB3A5ASBH98YCFWILvaLeC7Mjmbzg/a LFs9+lCqMDZH+v1om3XrKMOSV5UogALEftQVG1L18s76WYGYiBG17gaPk3X3fP/YxDmj wyeQ== X-Received: by 10.70.134.163 with SMTP id pl3mr36446498pdb.45.1425187541004; Sat, 28 Feb 2015 21:25:41 -0800 (PST) Received: from [192.168.1.69] (107-222-186-3.lightspeed.sntcca.sbcglobal.net. [107.222.186.3]) by mx.google.com with ESMTPSA id f8sm8212275pdm.68.2015.02.28.21.25.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Feb 2015 21:25:39 -0800 (PST) Sender: Justin Hibbits Message-ID: <54F2A2D0.8060604@freebsd.org> Date: Sat, 28 Feb 2015 21:25:36 -0800 From: Justin Hibbits User-Agent: Mozilla/5.0 (X11; FreeBSD powerpc; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ryan Stone , Ryan Stone Subject: Re: svn commit: r279471 - stable/10/sys/dev/pci References: <201503010426.t214Qm0d000607@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 05:25:41 -0000 On 02/28/15 20:30, Ryan Stone wrote: > So I didn't get an MFC notice for this one (and I very nearly forgot > to MFC it, which would have been fairly disastrous for somebody :( ). > Is my understanding of the X-MFC-With: tag incorrect? I thought that > setting it would cause me to get a reminder at the same time as > r264011 > I think that's just a note to yourself. I've never gotten a notice when I use that, I just have to remember. - Justin From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 06:05:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7176F347; Sun, 1 Mar 2015 06:05:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D30AED5; Sun, 1 Mar 2015 06:05:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t216516N047353; Sun, 1 Mar 2015 06:05:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21651wX047352; Sun, 1 Mar 2015 06:05:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503010605.t21651wX047352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 06:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279476 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 06:05:02 -0000 Author: adrian Date: Sun Mar 1 06:05:01 2015 New Revision: 279476 URL: https://svnweb.freebsd.org/changeset/base/279476 Log: Add QCA955x support to the EHCI setup path. Tested: * QCA AP135 development board, USB rootfs. Modified: head/sys/mips/atheros/ar71xx_ehci.c Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Sun Mar 1 05:18:02 2015 (r279475) +++ head/sys/mips/atheros/ar71xx_ehci.c Sun Mar 1 06:05:01 2015 (r279476) @@ -162,6 +162,8 @@ ar71xx_ehci_attach(device_t self) case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: + case AR71XX_SOC_QCA9556: + case AR71XX_SOC_QCA9558: sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; break; default: @@ -258,4 +260,6 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; DRIVER_MODULE(ehci, nexus, ehci_driver, ehci_devclass, 0, 0); +DRIVER_MODULE(ehci, apb, ehci_driver, ehci_devclass, 0, 0); + MODULE_DEPEND(ehci, usb, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 05:18:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EA171B92; Sun, 1 Mar 2015 05:18:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 593E58F1; Sun, 1 Mar 2015 05:18:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t215I3Ao024333; Sun, 1 Mar 2015 05:18:03 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t215I3ad024332; Sun, 1 Mar 2015 05:18:03 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201503010518.t215I3ad024332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 1 Mar 2015 05:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279475 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 05:18:03 -0000 Author: alc Date: Sun Mar 1 05:18:02 2015 New Revision: 279475 URL: https://svnweb.freebsd.org/changeset/base/279475 Log: Use RW_NEW rather than calling bzero(). Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Mar 1 04:39:07 2015 (r279474) +++ head/sys/vm/vm_object.c Sun Mar 1 05:18:02 2015 (r279475) @@ -196,8 +196,7 @@ vm_object_zinit(void *mem, int size, int vm_object_t object; object = (vm_object_t)mem; - bzero(&object->lock, sizeof(object->lock)); - rw_init_flags(&object->lock, "vm object", RW_DUPOK); + rw_init_flags(&object->lock, "vm object", RW_DUPOK | RW_NEW); /* These are true for any object that has been freed */ object->rtree.rt_root = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 06:52:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4751685E; Sun, 1 Mar 2015 06:52:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32E2F389; Sun, 1 Mar 2015 06:52:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t216qOwY069938; Sun, 1 Mar 2015 06:52:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t216qOUD069937; Sun, 1 Mar 2015 06:52:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503010652.t216qOUD069937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 06:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279477 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 06:52:24 -0000 Author: adrian Date: Sun Mar 1 06:52:23 2015 New Revision: 279477 URL: https://svnweb.freebsd.org/changeset/base/279477 Log: Make QCA955X_GMAC_REG_ETH_CFG defined like most other registers like this. Modified: head/sys/mips/atheros/qca955xreg.h Modified: head/sys/mips/atheros/qca955xreg.h ============================================================================== --- head/sys/mips/atheros/qca955xreg.h Sun Mar 1 06:05:01 2015 (r279476) +++ head/sys/mips/atheros/qca955xreg.h Sun Mar 1 06:52:23 2015 (r279477) @@ -188,7 +188,7 @@ /* GMAC Interface */ -#define QCA955X_GMAC_REG_ETH_CFG 0x00 /* XXX register base? */ +#define QCA955X_GMAC_REG_ETH_CFG (QCA955X_GMAC_BASE + 0x00) #define QCA955X_ETH_CFG_RGMII_EN BIT(0) #define QCA955X_ETH_CFG_GE0_SGMII BIT(6) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 06:55:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93AC3A23; Sun, 1 Mar 2015 06:55:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5593A4; Sun, 1 Mar 2015 06:55:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t216t0nq070281; Sun, 1 Mar 2015 06:55:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t216t0ZY070276; Sun, 1 Mar 2015 06:55:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503010655.t216t0ZY070276@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 06:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279478 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 06:55:00 -0000 Author: adrian Date: Sun Mar 1 06:54:59 2015 New Revision: 279478 URL: https://svnweb.freebsd.org/changeset/base/279478 Log: Add Ethernet PLL values for the QCA955x. These are the same as the AR934x. Obtained from: Linux openwrt Modified: head/sys/mips/atheros/qca955xreg.h Modified: head/sys/mips/atheros/qca955xreg.h ============================================================================== --- head/sys/mips/atheros/qca955xreg.h Sun Mar 1 06:52:23 2015 (r279477) +++ head/sys/mips/atheros/qca955xreg.h Sun Mar 1 06:54:59 2015 (r279478) @@ -193,4 +193,9 @@ #define QCA955X_ETH_CFG_RGMII_EN BIT(0) #define QCA955X_ETH_CFG_GE0_SGMII BIT(6) +/* XXX Same as AR934x values */ +#define QCA955X_PLL_VAL_1000 0x16000000 +#define QCA955X_PLL_VAL_100 0x00000101 +#define QCA955X_PLL_VAL_10 0x00001616 + #endif /* __QCA955XREG_H__ */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 06:59:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D288D7E; Sun, 1 Mar 2015 06:59:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F36823E6; Sun, 1 Mar 2015 06:59:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t216xW3Y070806; Sun, 1 Mar 2015 06:59:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t216xWKA070805; Sun, 1 Mar 2015 06:59:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503010659.t216xWKA070805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 06:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279479 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 06:59:33 -0000 Author: adrian Date: Sun Mar 1 06:59:32 2015 New Revision: 279479 URL: https://svnweb.freebsd.org/changeset/base/279479 Log: Flesh out some more QCA955x ethernet PLL setup. Modified: head/sys/mips/atheros/qca955x_chip.c Modified: head/sys/mips/atheros/qca955x_chip.c ============================================================================== --- head/sys/mips/atheros/qca955x_chip.c Sun Mar 1 06:54:59 2015 (r279478) +++ head/sys/mips/atheros/qca955x_chip.c Sun Mar 1 06:59:32 2015 (r279479) @@ -189,26 +189,21 @@ qca955x_chip_set_mii_speed(uint32_t unit return; } -/* - * XXX TODO !! - */ static void qca955x_chip_set_pll_ge(int unit, int speed, uint32_t pll) { -#if 0 switch (unit) { case 0: - ATH_WRITE_REG(AR934X_PLL_ETH_XMII_CONTROL_REG, pll); + ATH_WRITE_REG(QCA955X_PLL_ETH_XMII_CONTROL_REG, pll); break; case 1: - /* XXX nothing */ + ATH_WRITE_REG(QCA955X_PLL_ETH_SGMII_CONTROL_REG, pll); break; default: printf("%s: invalid PLL set for arge unit: %d\n", __func__, unit); return; } -#endif } static void @@ -241,27 +236,23 @@ qca955x_chip_ddr_flush_ip2(void) static uint32_t qca955x_chip_get_eth_pll(unsigned int mac, int speed) { -#if 0 uint32_t pll; switch (speed) { case 10: - pll = AR934X_PLL_VAL_10; + pll = QCA955X_PLL_VAL_10; break; case 100: - pll = AR934X_PLL_VAL_100; + pll = QCA955X_PLL_VAL_100; break; case 1000: - pll = AR934X_PLL_VAL_1000; + pll = QCA955X_PLL_VAL_1000; break; default: printf("%s%d: invalid speed %d\n", __func__, mac, speed); pll = 0; } return (pll); -#else - return (0); -#endif } static void @@ -275,24 +266,17 @@ qca955x_chip_reset_ethernet_switch(void) #endif } -#if 0 static void qca955x_configure_gmac(uint32_t gmac_cfg) { uint32_t reg; - reg = ATH_READ_REG(AR934X_GMAC_REG_ETH_CFG); + reg = ATH_READ_REG(QCA955X_GMAC_REG_ETH_CFG); printf("%s: ETH_CFG=0x%08x\n", __func__, reg); - - reg &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 | - AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE | - AR934X_ETH_CFG_SW_PHY_SWAP); - + reg &= ~(QCA955X_ETH_CFG_RGMII_EN | QCA955X_ETH_CFG_GE0_SGMII); reg |= gmac_cfg; - - ATH_WRITE_REG(AR934X_GMAC_REG_ETH_CFG, reg); + ATH_WRITE_REG(QCA955X_GMAC_REG_ETH_CFG, reg); } -#endif static void qca955x_chip_init_usb_peripheral(void) @@ -326,17 +310,15 @@ qca955x_chip_reset_wmac(void) static void qca955x_chip_init_gmac(void) { -#if 0 long gmac_cfg; - if (resource_long_value("ar934x_gmac", 0, "gmac_cfg", + if (resource_long_value("qca955x_gmac", 0, "gmac_cfg", &gmac_cfg) == 0) { printf("%s: gmac_cfg=0x%08lx\n", __func__, (long) gmac_cfg); - ar934x_configure_gmac((uint32_t) gmac_cfg); + qca955x_configure_gmac((uint32_t) gmac_cfg); } -#endif } /* From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 07:00:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83BA0EE3; Sun, 1 Mar 2015 07:00:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554303F2; Sun, 1 Mar 2015 07:00:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2170ZGk071617; Sun, 1 Mar 2015 07:00:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2170ZOV071616; Sun, 1 Mar 2015 07:00:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503010700.t2170ZOV071616@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 07:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279480 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 07:00:35 -0000 Author: adrian Date: Sun Mar 1 07:00:34 2015 New Revision: 279480 URL: https://svnweb.freebsd.org/changeset/base/279480 Log: Add very initial QCA955x awareness to the GPIO code. There's a lot more to come - the QCA955x has a bunch more GPIO MUX configuration, reminiscent of what the ARM chips let you do - but it'll have to come later. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Sun Mar 1 06:59:32 2015 (r279479) +++ head/sys/mips/atheros/ar71xx_gpio.c Sun Mar 1 07:00:34 2015 (r279480) @@ -50,9 +50,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include +#include #include "gpio_if.h" @@ -96,7 +97,9 @@ ar71xx_gpio_function_enable(struct ar71x { if (ar71xx_soc == AR71XX_SOC_AR9341 || ar71xx_soc == AR71XX_SOC_AR9342 || - ar71xx_soc == AR71XX_SOC_AR9344) + ar71xx_soc == AR71XX_SOC_AR9344 || + ar71xx_soc == AR71XX_SOC_QCA9556 || + ar71xx_soc == AR71XX_SOC_QCA9558) GPIO_SET_BITS(sc, AR934X_GPIO_REG_FUNC, mask); else GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); @@ -107,7 +110,9 @@ ar71xx_gpio_function_disable(struct ar71 { if (ar71xx_soc == AR71XX_SOC_AR9341 || ar71xx_soc == AR71XX_SOC_AR9342 || - ar71xx_soc == AR71XX_SOC_AR9344) + ar71xx_soc == AR71XX_SOC_AR9344 || + ar71xx_soc == AR71XX_SOC_QCA9556 || + ar71xx_soc == AR71XX_SOC_QCA9558) GPIO_CLEAR_BITS(sc, AR934X_GPIO_REG_FUNC, mask); else GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); @@ -169,6 +174,9 @@ ar71xx_gpio_pin_max(device_t dev, int *m case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: *maxpin = AR934X_GPIO_COUNT - 1; + case AR71XX_SOC_QCA9556: + case AR71XX_SOC_QCA9558: + *maxpin = QCA955X_GPIO_COUNT - 1; break; default: *maxpin = AR71XX_GPIO_PINS - 1; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 09:28:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2252FEA; Sun, 1 Mar 2015 09:28:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCE7D670; Sun, 1 Mar 2015 09:28:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t219SdCv039940; Sun, 1 Mar 2015 09:28:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t219Sdxa039939; Sun, 1 Mar 2015 09:28:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503010928.t219Sdxa039939@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 1 Mar 2015 09:28:39 +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: r279481 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 09:28:40 -0000 Author: mav Date: Sun Mar 1 09:28:39 2015 New Revision: 279481 URL: https://svnweb.freebsd.org/changeset/base/279481 Log: MFC r279277: Fix memory leak on incorrect initiator portal. Submitted by: Dmitry Luhtionov Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Sun Mar 1 07:00:34 2015 (r279480) +++ stable/10/usr.sbin/ctld/ctld.c Sun Mar 1 09:28:39 2015 (r279481) @@ -400,6 +400,7 @@ auth_portal_new(struct auth_group *ag, c return (ap); error: + free(ap); log_errx(1, "Incorrect initiator portal '%s'", portal); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 09:30:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B3911A2; Sun, 1 Mar 2015 09:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75D3C67A; Sun, 1 Mar 2015 09:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t219U0RF040227; Sun, 1 Mar 2015 09:30:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t219U0iQ040226; Sun, 1 Mar 2015 09:30:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503010930.t219U0iQ040226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 1 Mar 2015 09:30: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: r279482 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 09:30:00 -0000 Author: mav Date: Sun Mar 1 09:29:59 2015 New Revision: 279482 URL: https://svnweb.freebsd.org/changeset/base/279482 Log: MFC r279276: Add checks for malloc() failures. Submitted by: Dmitry Luhtionov Modified: stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Sun Mar 1 09:28:39 2015 (r279481) +++ stable/10/usr.sbin/ctld/kernel.c Sun Mar 1 09:29:59 2015 (r279482) @@ -864,7 +864,10 @@ kernel_port_add(struct port *port) bzero(&req, sizeof(req)); strlcpy(req.driver, "iscsi", sizeof(req.driver)); req.reqtype = CTL_REQ_CREATE; + req.num_args = 5; req.args = malloc(req.num_args * sizeof(*req.args)); + if (req.args == NULL) + log_err(1, "malloc"); n = 0; req.args[n].namelen = sizeof("port_id"); req.args[n].name = __DECONST(char *, "port_id"); @@ -978,6 +981,8 @@ kernel_port_remove(struct port *port) req.reqtype = CTL_REQ_REMOVE; req.num_args = 2; req.args = malloc(req.num_args * sizeof(*req.args)); + if (req.args == NULL) + log_err(1, "malloc"); str_arg(&req.args[0], "cfiscsi_target", targ->t_name); snprintf(tagstr, sizeof(tagstr), "%d", pg->pg_tag); str_arg(&req.args[1], "cfiscsi_portal_group_tag", tagstr); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 10:04:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E825A586; Sun, 1 Mar 2015 10:04:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B913CA0C; Sun, 1 Mar 2015 10:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21A4FGE058400; Sun, 1 Mar 2015 10:04:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21A4EkE058398; Sun, 1 Mar 2015 10:04:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503011004.t21A4EkE058398@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 1 Mar 2015 10:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279483 - head/sys/cddl/dev/dtrace/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 10:04:16 -0000 Author: andrew Date: Sun Mar 1 10:04:14 2015 New Revision: 279483 URL: https://svnweb.freebsd.org/changeset/base/279483 Log: Fix the dtrace ARM atomic compare-and-set functions. These functions are expected to return the data in the memory location pointed at by target after the operation. The FreeBSD atomic functions previously used return either 0 or 1 to indicate if the comparison succeeded or not respectively. With this change these functions only support ARMv6 and later are supported by these functions. Sponsored by: ABT Systems Ltd Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Sun Mar 1 09:29:59 2015 (r279482) +++ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Sun Mar 1 10:04:14 2015 (r279483) @@ -195,3 +195,25 @@ ENTRY(dtrace_caller) mov r0, #-1 RET END(dtrace_caller) + +/* +uint32_t +dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) + +void * +dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new) +*/ +ENTRY(dtrace_cas32) +EENTRY(dtrace_casptr) +1: ldrex r3, [r0] /* Load target */ + cmp r3, r1 /* Check if *target == cmp */ + bne 2f /* No, return */ + strex r3, r2, [r0] /* Store new to target */ + cmp r3, #0 /* Did the store succeed? */ + bne 1b /* No, try again */ + mov r0, r2 /* Return the new value of the store */ +2: movne r0, r3 /* The first compare failed, return */ + /* the value loaded from memory */ + RET +EEND(dtrace_casptr) +END(dtrace_cas32) Modified: head/sys/cddl/dev/dtrace/arm/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Sun Mar 1 09:29:59 2015 (r279482) +++ head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Sun Mar 1 10:04:14 2015 (r279483) @@ -262,34 +262,3 @@ dtrace_fuword64(void *uaddr) } return (dtrace_fuword64_nocheck(uaddr)); } - -#define __with_interrupts_disabled(expr) \ - do { \ - u_int cpsr_save, tmp; \ - \ - __asm __volatile( \ - "mrs %0, cpsr;" \ - "orr %1, %0, %2;" \ - "msr cpsr_fsxc, %1;" \ - : "=r" (cpsr_save), "=r" (tmp) \ - : "I" (PSR_I | PSR_F) \ - : "cc" ); \ - (expr); \ - __asm __volatile( \ - "msr cpsr_fsxc, %0" \ - : /* no output */ \ - : "r" (cpsr_save) \ - : "cc" ); \ - } while(0) - -uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) -{ - return atomic_cmpset_32((uint32_t*)target, (uint32_t)cmp, (uint32_t)new); - -} - -void * dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new) -{ - return (void*)dtrace_cas32((uint32_t*)target, (uint32_t)cmp, (uint32_t)new); -} - From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 10:29:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27E5494F; Sun, 1 Mar 2015 10:29:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1254FC3D; Sun, 1 Mar 2015 10:29:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21ATm2X069418; Sun, 1 Mar 2015 10:29:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21ATmoE069417; Sun, 1 Mar 2015 10:29:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503011029.t21ATmoE069417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 Mar 2015 10:29: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: r279484 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 10:29:49 -0000 Author: kib Date: Sun Mar 1 10:29:48 2015 New Revision: 279484 URL: https://svnweb.freebsd.org/changeset/base/279484 Log: MFC r276867: Fix DMAR context allocations for the devices behind PCIe->PCI bridges after dmar driver was converted to use rids. The bus component to calculate context page must be taken from the requestor rid, which is a bridge, and not from the device bus number. Modified: stable/10/sys/x86/iommu/intel_ctx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/10/sys/x86/iommu/intel_ctx.c Sun Mar 1 10:04:14 2015 (r279483) +++ stable/10/sys/x86/iommu/intel_ctx.c Sun Mar 1 10:29:48 2015 (r279484) @@ -290,7 +290,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * higher chance to succeed if the sleep is allowed. */ DMAR_UNLOCK(dmar); - dmar_ensure_ctx_page(dmar, bus); + dmar_ensure_ctx_page(dmar, PCI_RID2BUS(rid)); ctx1 = dmar_get_ctx_alloc(dmar, rid); if (id_mapped) { From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 10:35:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C25BFAB3; Sun, 1 Mar 2015 10:35:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9350DCE9; Sun, 1 Mar 2015 10:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21AZt7p073937; Sun, 1 Mar 2015 10:35:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21AZsk8073934; Sun, 1 Mar 2015 10:35:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503011035.t21AZsk8073934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 Mar 2015 10:35: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: r279485 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 10:35:55 -0000 Author: kib Date: Sun Mar 1 10:35:54 2015 New Revision: 279485 URL: https://svnweb.freebsd.org/changeset/base/279485 Log: MFC r276948: Print rid when announcing DMAR context creation. Print sid when fault occurs. Modified: stable/10/sys/x86/iommu/intel_ctx.c stable/10/sys/x86/iommu/intel_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/10/sys/x86/iommu/intel_ctx.c Sun Mar 1 10:29:48 2015 (r279484) +++ stable/10/sys/x86/iommu/intel_ctx.c Sun Mar 1 10:35:54 2015 (r279485) @@ -383,10 +383,10 @@ dmar_get_ctx(struct dmar_unit *dmar, dev LIST_INSERT_HEAD(&dmar->contexts, ctx, link); ctx_id_entry_init(ctx, ctxp); device_printf(dev, - "dmar%d pci%d:%d:%d:%d domain %d mgaw %d " + "dmar%d pci%d:%d:%d:%d rid %x domain %d mgaw %d " "agaw %d %s-mapped\n", dmar->unit, dmar->segment, bus, slot, - func, ctx->domain, ctx->mgaw, ctx->agaw, + func, rid, ctx->domain, ctx->mgaw, ctx->agaw, id_mapped ? "id" : "re"); } else { dmar_ctx_dtr(ctx1, true, true); Modified: stable/10/sys/x86/iommu/intel_fault.c ============================================================================== --- stable/10/sys/x86/iommu/intel_fault.c Sun Mar 1 10:29:48 2015 (r279484) +++ stable/10/sys/x86/iommu/intel_fault.c Sun Mar 1 10:35:54 2015 (r279485) @@ -230,8 +230,9 @@ dmar_fault_task(void *arg, int pending _ } DMAR_UNLOCK(unit); printf( - "pci%d:%d:%d fault acc %x adt 0x%x reason 0x%x addr %jx\n", - bus, slot, func, DMAR_FRCD2_T(fault_rec[1]), + "pci%d:%d:%d sid %x fault acc %x adt 0x%x reason 0x%x " + "addr %jx\n", + bus, slot, func, sid, DMAR_FRCD2_T(fault_rec[1]), DMAR_FRCD2_AT(fault_rec[1]), DMAR_FRCD2_FR(fault_rec[1]), (uintmax_t)fault_rec[0]); DMAR_FAULT_LOCK(unit); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 10:39:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78CF7C08; Sun, 1 Mar 2015 10:39:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62F1DD0B; Sun, 1 Mar 2015 10:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21AdJUn074564; Sun, 1 Mar 2015 10:39:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21AdJ15074563; Sun, 1 Mar 2015 10:39:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503011039.t21AdJ15074563@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 Mar 2015 10:39:19 +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: r279486 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 10:39:20 -0000 Author: kib Date: Sun Mar 1 10:39:19 2015 New Revision: 279486 URL: https://svnweb.freebsd.org/changeset/base/279486 Log: MFC r276949: (only to ease merging of r279117). MFC r279117: Revert r276949 and redo the fix for PCIe/PCI bridges, which do not follow specification and do not provide PCIe capability. Modified: stable/10/sys/x86/iommu/busdma_dmar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/busdma_dmar.c ============================================================================== --- stable/10/sys/x86/iommu/busdma_dmar.c Sun Mar 1 10:35:54 2015 (r279485) +++ stable/10/sys/x86/iommu/busdma_dmar.c Sun Mar 1 10:39:19 2015 (r279486) @@ -96,11 +96,13 @@ static device_t dmar_get_requester(device_t dev, uint16_t *rid) { devclass_t pci_class; - device_t pci, pcib, requester; + device_t l, pci, pcib, pcip, pcibp, requester; int cap_offset; + uint16_t pcie_flags; + bool bridge_is_pcie; pci_class = devclass_find("pci"); - requester = dev; + l = requester = dev; *rid = pci_get_rid(dev); @@ -110,19 +112,17 @@ dmar_get_requester(device_t dev, uint16_ * unit. */ for (;;) { - pci = device_get_parent(dev); - KASSERT(pci != NULL, ("NULL parent for pci%d:%d:%d:%d", - pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev))); + pci = device_get_parent(l); + KASSERT(pci != NULL, ("dmar_get_requester(%s): NULL parent " + "for %s", device_get_name(dev), device_get_name(l))); KASSERT(device_get_devclass(pci) == pci_class, - ("Non-pci parent for pci%d:%d:%d:%d", - pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev))); + ("dmar_get_requester(%s): non-pci parent %s for %s", + device_get_name(dev), device_get_name(pci), + device_get_name(l))); pcib = device_get_parent(pci); - KASSERT(pcib != NULL, ("NULL bridge for pci%d:%d:%d:%d", - pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev))); + KASSERT(pcib != NULL, ("dmar_get_requester(%s): NULL bridge " + "for %s", device_get_name(dev), device_get_name(pci))); /* * The parent of our "bridge" isn't another PCI bus, @@ -130,19 +130,46 @@ dmar_get_requester(device_t dev, uint16_ * port, and the requester ID won't be translated * further. */ - if (device_get_devclass(device_get_parent(pcib)) != pci_class) + pcip = device_get_parent(pcib); + if (device_get_devclass(pcip) != pci_class) break; + pcibp = device_get_parent(pcip); - if (pci_find_cap(dev, PCIY_EXPRESS, &cap_offset) != 0) { + if (pci_find_cap(l, PCIY_EXPRESS, &cap_offset) == 0) { + /* + * Do not stop the loop even if the target + * device is PCIe, because it is possible (but + * unlikely) to have a PCI->PCIe bridge + * somewhere in the hierarchy. + */ + l = pcib; + } else { /* * Device is not PCIe, it cannot be seen as a - * requester by DMAR unit. + * requester by DMAR unit. Check whether the + * bridge is PCIe. */ + bridge_is_pcie = pci_find_cap(pcib, PCIY_EXPRESS, + &cap_offset) == 0; requester = pcib; - /* Check whether the bus above is PCIe. */ - if (pci_find_cap(pcib, PCIY_EXPRESS, - &cap_offset) == 0) { + /* + * Check for a buggy PCIe/PCI bridge that + * doesn't report the express capability. If + * the bridge above it is express but isn't a + * PCI bridge, then we know pcib is actually a + * PCIe/PCI bridge. + */ + if (!bridge_is_pcie && pci_find_cap(pcibp, + PCIY_EXPRESS, &cap_offset) == 0) { + pcie_flags = pci_read_config(pcibp, + cap_offset + PCIER_FLAGS, 2); + if ((pcie_flags & PCIEM_FLAGS_TYPE) != + PCIEM_TYPE_PCI_BRIDGE) + bridge_is_pcie = true; + } + + if (bridge_is_pcie) { /* * The current device is not PCIe, but * the bridge above it is. This is a @@ -159,7 +186,8 @@ dmar_get_requester(device_t dev, uint16_ * same page tables for taken and * non-taken transactions. */ - *rid = PCI_RID(pci_get_bus(dev), 0, 0); + *rid = PCI_RID(pci_get_bus(l), 0, 0); + l = pcibp; } else { /* * Neither the device nor the bridge @@ -169,15 +197,9 @@ dmar_get_requester(device_t dev, uint16_ * requester ID. */ *rid = pci_get_rid(pcib); + l = pcib; } } - /* - * Do not stop the loop even if the target device is - * PCIe, because it is possible (but unlikely) to have - * a PCI->PCIe bridge somewhere in the hierarchy. - */ - - dev = pcib; } return (requester); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 12:47:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E29A2C08; Sun, 1 Mar 2015 12:47:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3070AB1; Sun, 1 Mar 2015 12:47:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21ClbQo035969; Sun, 1 Mar 2015 12:47:37 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21Clb2p035966; Sun, 1 Mar 2015 12:47:37 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201503011247.t21Clb2p035966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sun, 1 Mar 2015 12:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279487 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 12:47:38 -0000 Author: dumbbell Date: Sun Mar 1 12:47:36 2015 New Revision: 279487 URL: https://svnweb.freebsd.org/changeset/base/279487 Log: vgapci: New vga_pci_repost() function This can be used to restore the VGA mode after a KMS driver is unloaded. Differential Revision: https://reviews.freebsd.org/D687 Modified: head/sys/dev/pci/pcivar.h head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sun Mar 1 10:39:19 2015 (r279486) +++ head/sys/dev/pci/pcivar.h Sun Mar 1 12:47:36 2015 (r279487) @@ -591,5 +591,6 @@ struct pcicfg_vpd *pci_fetch_vpd_list(de int vga_pci_is_boot_display(device_t dev); void * vga_pci_map_bios(device_t dev, size_t *size); void vga_pci_unmap_bios(device_t dev, void *bios); +int vga_pci_repost(device_t dev); #endif /* _PCIVAR_H_ */ Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sun Mar 1 10:39:19 2015 (r279486) +++ head/sys/dev/pci/vga_pci.c Sun Mar 1 12:47:36 2015 (r279487) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* To re-POST the card. */ + struct vga_resource { struct resource *vr_res; int vr_refs; @@ -194,6 +196,36 @@ vga_pci_unmap_bios(device_t dev, void *b vr->vr_res); } +int +vga_pci_repost(device_t dev) +{ +#if defined(__amd64__) || defined(__i386__) + x86regs_t regs; + + if (!vga_pci_is_boot_display(dev)) + return (EINVAL); + + if (x86bios_get_orm(VGA_PCI_BIOS_SHADOW_ADDR) == NULL) + return (ENOTSUP); + + x86bios_init_regs(®s); + + regs.R_AH = pci_get_bus(dev); + regs.R_AL = (pci_get_slot(dev) << 3) | (pci_get_function(dev) & 0x07); + regs.R_DL = 0x80; + + device_printf(dev, "REPOSTing\n"); + x86bios_call(®s, X86BIOS_PHYSTOSEG(VGA_PCI_BIOS_SHADOW_ADDR + 3), + X86BIOS_PHYSTOOFF(VGA_PCI_BIOS_SHADOW_ADDR + 3)); + + x86bios_get_intr(0x10); + + return (0); +#else + return (ENOTSUP); +#endif +} + static int vga_pci_probe(device_t dev) { From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 12:54:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8622E5E; Sun, 1 Mar 2015 12:54:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90D9EBDE; Sun, 1 Mar 2015 12:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21CsPSN040305; Sun, 1 Mar 2015 12:54:25 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21CsNX1040293; Sun, 1 Mar 2015 12:54:23 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201503011254.t21CsNX1040293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sun, 1 Mar 2015 12:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279488 - in head/sys: dev/drm2 dev/drm2/radeon dev/fb dev/vt dev/vt/hw/fb dev/vt/hw/vga sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 12:54:25 -0000 Author: dumbbell Date: Sun Mar 1 12:54:22 2015 New Revision: 279488 URL: https://svnweb.freebsd.org/changeset/base/279488 Log: vt(4): Add support to "downgrade" from eg. vt_fb to vt_vga The main purpose of this feature is to be able to unload a KMS driver. When going back from the current vt(4) backend to the previous backend, the previous backend is reinitialized with the special VDF_DOWNGRADE flag set. Then the current driver is terminated with the new "vd_fini" callback. In the case of vt_fb and vt_vga, this allows the former to pass the vgapci device vt_fb used to vt_vga so the device can be rePOSTed. Differential Revision: https://reviews.freebsd.org/D687 Modified: head/sys/dev/drm2/drm_fb_helper.c head/sys/dev/drm2/radeon/radeon_fb.c head/sys/dev/fb/fbd.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/hw/fb/vt_fb.h head/sys/dev/vt/hw/vga/vt_vga.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/sys/fbio.h Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/drm2/drm_fb_helper.c Sun Mar 1 12:54:22 2015 (r279488) @@ -937,19 +937,21 @@ int drm_fb_helper_single_fb_probe(struct info->fb_priv = sc; info->enter = &vt_kms_postswitch; + kdev = fb_helper->dev->device; + info->fb_video_dev = device_get_parent(kdev); + /* set the fb pointer */ for (i = 0; i < fb_helper->crtc_count; i++) { fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; } if (new_fb) { - device_t fbd; int ret; - kdev = fb_helper->dev->device; - fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); - if (fbd != NULL) - ret = device_probe_and_attach(fbd); + info->fb_fbd_dev = device_add_child(kdev, "fbd", + device_get_unit(kdev)); + if (info->fb_fbd_dev != NULL) + ret = device_probe_and_attach(info->fb_fbd_dev); else ret = ENODEV; #ifdef DEV_VT Modified: head/sys/dev/drm2/radeon/radeon_fb.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_fb.c Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/drm2/radeon/radeon_fb.c Sun Mar 1 12:54:22 2015 (r279488) @@ -291,6 +291,8 @@ static int radeon_fbdev_destroy(struct d if (rfbdev->helper.fbdev) { info = rfbdev->helper.fbdev; + if (info->fb_fbd_dev != NULL) + device_delete_child(dev->device, info->fb_fbd_dev); free(info->fb_priv, DRM_MEM_KMS); free(info, DRM_MEM_KMS); } Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/fb/fbd.c Sun Mar 1 12:54:22 2015 (r279488) @@ -263,6 +263,8 @@ fbd_unregister(struct fb_info* info) LIST_FOREACH_SAFE(entry, &fb_list_head, fb_list, tmp) { if (entry->fb_info == info) { LIST_REMOVE(entry, fb_list); + if (LIST_EMPTY(&fb_list_head)) + vt_fb_detach(info); free(entry, M_DEVBUF); return (0); } Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/vt/hw/fb/vt_fb.c Sun Mar 1 12:54:22 2015 (r279488) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); static struct vt_driver vt_fb_driver = { .vd_name = "fb", .vd_init = vt_fb_init, + .vd_fini = vt_fb_fini, .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, @@ -419,6 +420,7 @@ vt_fb_init(struct vt_device *vd) info = vd->vd_softc; vd->vd_height = info->fb_height; vd->vd_width = info->fb_width; + vd->vd_video_dev = info->fb_video_dev; if (info->fb_size == 0) return (CN_DEAD); @@ -442,6 +444,13 @@ vt_fb_init(struct vt_device *vd) return (CN_INTERNAL); } +void +vt_fb_fini(struct vt_device *vd, void *softc) +{ + + vd->vd_video_dev = NULL; +} + int vt_fb_attach(struct fb_info *info) { @@ -451,6 +460,15 @@ vt_fb_attach(struct fb_info *info) return (0); } +int +vt_fb_detach(struct fb_info *info) +{ + + vt_deallocate(&vt_fb_driver, info); + + return (0); +} + void vt_fb_suspend(struct vt_device *vd) { Modified: head/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.h Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/vt/hw/fb/vt_fb.h Sun Mar 1 12:54:22 2015 (r279488) @@ -35,8 +35,10 @@ int vt_fb_attach(struct fb_info *info); void vt_fb_resume(struct vt_device *vd); void vt_fb_suspend(struct vt_device *vd); +int vt_fb_detach(struct fb_info *info); vd_init_t vt_fb_init; +vd_fini_t vt_fb_fini; vd_blank_t vt_fb_blank; vd_bitblt_text_t vt_fb_bitblt_text; vd_bitblt_bmp_t vt_fb_bitblt_bitmap; Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/vt/hw/vga/vt_vga.c Sun Mar 1 12:54:22 2015 (r279488) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -1213,6 +1214,9 @@ vga_init(struct vt_device *vd) sc = vd->vd_softc; textmode = 0; + if (vd->vd_flags & VDF_DOWNGRADE && vd->vd_video_dev != NULL) + vga_pci_repost(vd->vd_video_dev); + #if defined(__amd64__) || defined(__i386__) sc->vga_fb_tag = X86_BUS_SPACE_MEM; sc->vga_fb_handle = KERNBASE + VGA_MEM_BASE; Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/vt/vt.h Sun Mar 1 12:54:22 2015 (r279488) @@ -89,7 +89,8 @@ SYSCTL_INT(_kern_vt, OID_AUTO, _name, CT struct vt_driver; -void vt_allocate(struct vt_driver *, void *); +void vt_allocate(const struct vt_driver *, void *); +void vt_deallocate(const struct vt_driver *, void *); typedef unsigned int vt_axis_t; @@ -124,6 +125,9 @@ struct vt_device { struct vt_pastebuf vd_pastebuf; /* (?) Copy/paste buf. */ const struct vt_driver *vd_driver; /* (c) Graphics driver. */ void *vd_softc; /* (u) Driver data. */ + const struct vt_driver *vd_prev_driver;/* (?) Previous driver. */ + void *vd_prev_softc; /* (?) Previous driver data. */ + device_t vd_video_dev; /* (?) Video adapter. */ #ifndef SC_NO_CUTPASTE struct vt_mouse_cursor *vd_mcursor; /* (?) Cursor bitmap. */ term_color_t vd_mcursor_fg; /* (?) Cursor fg color. */ @@ -150,6 +154,7 @@ struct vt_device { #define VDF_INITIALIZED 0x20 /* vtterm_cnprobe already done. */ #define VDF_MOUSECURSOR 0x40 /* Mouse cursor visible. */ #define VDF_QUIET_BELL 0x80 /* Disable bell. */ +#define VDF_DOWNGRADE 0x8000 /* The driver is being downgraded. */ int vd_keyboard; /* (G) Keyboard index. */ unsigned int vd_kbstate; /* (?) Device unit. */ unsigned int vd_unit; /* (c) Device unit. */ @@ -301,6 +306,7 @@ struct vt_window { typedef int vd_init_t(struct vt_device *vd); typedef int vd_probe_t(struct vt_device *vd); +typedef void vd_fini_t(struct vt_device *vd, void *softc); typedef void vd_postswitch_t(struct vt_device *vd); typedef void vd_blank_t(struct vt_device *vd, term_color_t color); typedef void vd_bitblt_text_t(struct vt_device *vd, const struct vt_window *vw, @@ -323,6 +329,7 @@ struct vt_driver { /* Console attachment. */ vd_probe_t *vd_probe; vd_init_t *vd_init; + vd_fini_t *vd_fini; /* Drawing. */ vd_blank_t *vd_blank; Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/dev/vt/vt_core.c Sun Mar 1 12:54:22 2015 (r279488) @@ -180,6 +180,8 @@ static struct vt_window vt_conswindow; static struct vt_device vt_consdev = { .vd_driver = NULL, .vd_softc = NULL, + .vd_prev_driver = NULL, + .vd_prev_softc = NULL, .vd_flags = VDF_INVALID, .vd_windows = { [VT_CONSWINDOW] = &vt_conswindow, }, .vd_curwindow = &vt_conswindow, @@ -2598,31 +2600,11 @@ vt_resize(struct vt_device *vd) } } -void -vt_allocate(struct vt_driver *drv, void *softc) +static void +vt_replace_backend(const struct vt_driver *drv, void *softc) { struct vt_device *vd; - if (!vty_enabled(VTY_VT)) - return; - - if (main_vd->vd_driver == NULL) { - main_vd->vd_driver = drv; - printf("VT: initialize with new VT driver \"%s\".\n", - drv->vd_name); - } else { - /* - * Check if have rights to replace current driver. For example: - * it is bad idea to replace KMS driver with generic VGA one. - */ - if (drv->vd_priority <= main_vd->vd_driver->vd_priority) { - printf("VT: Driver priority %d too low. Current %d\n ", - drv->vd_priority, main_vd->vd_driver->vd_priority); - return; - } - printf("VT: Replacing driver \"%s\" with new \"%s\".\n", - main_vd->vd_driver->vd_name, drv->vd_name); - } vd = main_vd; if (vd->vd_flags & VDF_ASYNC) { @@ -2644,9 +2626,44 @@ vt_allocate(struct vt_driver *drv, void VT_LOCK(vd); vd->vd_flags &= ~VDF_TEXTMODE; - vd->vd_driver = drv; - vd->vd_softc = softc; - vd->vd_driver->vd_init(vd); + if (drv != NULL) { + /* + * We want to upgrade from the current driver to the + * given driver. + */ + + vd->vd_prev_driver = vd->vd_driver; + vd->vd_prev_softc = vd->vd_softc; + vd->vd_driver = drv; + vd->vd_softc = softc; + + vd->vd_driver->vd_init(vd); + } else if (vd->vd_prev_driver != NULL && vd->vd_prev_softc != NULL) { + /* + * No driver given: we want to downgrade to the previous + * driver. + */ + const struct vt_driver *old_drv; + void *old_softc; + + old_drv = vd->vd_driver; + old_softc = vd->vd_softc; + + vd->vd_driver = vd->vd_prev_driver; + vd->vd_softc = vd->vd_prev_softc; + vd->vd_prev_driver = NULL; + vd->vd_prev_softc = NULL; + + vd->vd_flags |= VDF_DOWNGRADE; + + vd->vd_driver->vd_init(vd); + + if (old_drv->vd_fini) + old_drv->vd_fini(vd, old_softc); + + vd->vd_flags &= ~VDF_DOWNGRADE; + } + VT_UNLOCK(vd); /* Update windows sizes and initialize last items. */ @@ -2692,6 +2709,52 @@ vt_resume_handler(void *priv) } void +vt_allocate(const struct vt_driver *drv, void *softc) +{ + + if (!vty_enabled(VTY_VT)) + return; + + if (main_vd->vd_driver == NULL) { + main_vd->vd_driver = drv; + printf("VT: initialize with new VT driver \"%s\".\n", + drv->vd_name); + } else { + /* + * Check if have rights to replace current driver. For example: + * it is bad idea to replace KMS driver with generic VGA one. + */ + if (drv->vd_priority <= main_vd->vd_driver->vd_priority) { + printf("VT: Driver priority %d too low. Current %d\n ", + drv->vd_priority, main_vd->vd_driver->vd_priority); + return; + } + printf("VT: Replacing driver \"%s\" with new \"%s\".\n", + main_vd->vd_driver->vd_name, drv->vd_name); + } + + vt_replace_backend(drv, softc); +} + +void +vt_deallocate(const struct vt_driver *drv, void *softc) +{ + + if (!vty_enabled(VTY_VT)) + return; + + if (main_vd->vd_prev_driver == NULL || + main_vd->vd_driver != drv || + main_vd->vd_softc != softc) + return; + + printf("VT: Switching back from \"%s\" to \"%s\".\n", + main_vd->vd_driver->vd_name, main_vd->vd_prev_driver->vd_name); + + vt_replace_backend(NULL, NULL); +} + +void vt_suspend(struct vt_device *vd) { int error; Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Sun Mar 1 12:47:36 2015 (r279487) +++ head/sys/sys/fbio.h Sun Mar 1 12:54:22 2015 (r279488) @@ -128,6 +128,9 @@ struct fb_info { struct cdev *fb_cdev; + device_t fb_fbd_dev; /* "fbd" device. */ + device_t fb_video_dev; /* Video adapter. */ + fb_enter_t *enter; fb_leave_t *leave; fb_setblankmode_t *setblankmode; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 15:03:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21671A5C; Sun, 1 Mar 2015 15:03:32 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E3F0A1A; Sun, 1 Mar 2015 15:03:30 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B943125D385E; Sun, 1 Mar 2015 15:03:21 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 75158C76FD5; Sun, 1 Mar 2015 15:03:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id rWHSFvBdq0fU; Sun, 1 Mar 2015 15:03:18 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:49e4:e093:2f28:d615] (unknown [IPv6:fde9:577b:c1a9:4410:49e4:e093:2f28:d615]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 332AFC76FCD; Sun, 1 Mar 2015 15:03:16 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279487 - head/sys/dev/pci From: "Bjoern A. Zeeb" In-Reply-To: <201503011247.t21Clb2p035966@svn.freebsd.org> Date: Sun, 1 Mar 2015 15:02:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <106186A9-DB74-4709-AAEE-7784731FD526@FreeBSD.org> References: <201503011247.t21Clb2p035966@svn.freebsd.org> To: Jean-Sebastien Pedron X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 15:03:32 -0000 > On 01 Mar 2015, at 12:47 , Jean-Sebastien Pedron = wrote: >=20 > Author: dumbbell > Date: Sun Mar 1 12:47:36 2015 > New Revision: 279487 > URL: https://svnweb.freebsd.org/changeset/base/279487 >=20 > Log: > vgapci: New vga_pci_repost() function >=20 > This can be used to restore the VGA mode after a KMS driver is = unloaded. >=20 > Differential Revision: https://reviews.freebsd.org/D687 I think this broke a couple of i386 and pc98 kernel configs: pc98 GENERIC-NODEBUG kernel failed, check _.pc98.GENERIC-NODEBUG for = details pc98 GENERIC kernel failed, check _.pc98.GENERIC for details pc98 LINT kernel failed, check _.pc98.LINT for details i386 XBOX kernel failed, check _.i386.XBOX for details i386 XEN kernel failed, check _.i386.XEN for details linking kernel.debug vga_pci.o: In function `vga_pci_repost': /scratch/tmp/bz/head.svn/sys/dev/pci/vga_pci.c:(.text+0x591): undefined = reference to `x86bios_get_orm' /scratch/tmp/bz/head.svn/sys/dev/pci/vga_pci.c:(.text+0x5ac): undefined = reference to `x86bios_init_regs' /scratch/tmp/bz/head.svn/sys/dev/pci/vga_pci.c:(.text+0x701): undefined = reference to `x86bios_call' /scratch/tmp/bz/head.svn/sys/dev/pci/vga_pci.c:(.text+0x70d): undefined = reference to `x86bios_get_intr' --- kernel.debug --- >=20 > Modified: > head/sys/dev/pci/pcivar.h > head/sys/dev/pci/vga_pci.c >=20 > Modified: head/sys/dev/pci/pcivar.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/pci/pcivar.h Sun Mar 1 10:39:19 2015 = (r279486) > +++ head/sys/dev/pci/pcivar.h Sun Mar 1 12:47:36 2015 = (r279487) > @@ -591,5 +591,6 @@ struct pcicfg_vpd *pci_fetch_vpd_list(de > int vga_pci_is_boot_display(device_t dev); > void * vga_pci_map_bios(device_t dev, size_t *size); > void vga_pci_unmap_bios(device_t dev, void *bios); > +int vga_pci_repost(device_t dev); >=20 > #endif /* _PCIVAR_H_ */ >=20 > Modified: head/sys/dev/pci/vga_pci.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/pci/vga_pci.c Sun Mar 1 10:39:19 2015 = (r279486) > +++ head/sys/dev/pci/vga_pci.c Sun Mar 1 12:47:36 2015 = (r279487) > @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); > #include > #include >=20 > +#include /* To re-POST the card. */ > + > struct vga_resource { > struct resource *vr_res; > int vr_refs; > @@ -194,6 +196,36 @@ vga_pci_unmap_bios(device_t dev, void *b > vr->vr_res); > } >=20 > +int > +vga_pci_repost(device_t dev) > +{ > +#if defined(__amd64__) || defined(__i386__) > + x86regs_t regs; > + > + if (!vga_pci_is_boot_display(dev)) > + return (EINVAL); > + > + if (x86bios_get_orm(VGA_PCI_BIOS_SHADOW_ADDR) =3D=3D NULL) > + return (ENOTSUP); > + > + x86bios_init_regs(®s); > + > + regs.R_AH =3D pci_get_bus(dev); > + regs.R_AL =3D (pci_get_slot(dev) << 3) | (pci_get_function(dev) = & 0x07); > + regs.R_DL =3D 0x80; > + > + device_printf(dev, "REPOSTing\n"); > + x86bios_call(®s, X86BIOS_PHYSTOSEG(VGA_PCI_BIOS_SHADOW_ADDR + = 3), > + X86BIOS_PHYSTOOFF(VGA_PCI_BIOS_SHADOW_ADDR + 3)); > + > + x86bios_get_intr(0x10); > + > + return (0); > +#else > + return (ENOTSUP); > +#endif > +} > + > static int > vga_pci_probe(device_t dev) > { >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 18:26:27 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83D27554; Sun, 1 Mar 2015 18:26:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F374198; Sun, 1 Mar 2015 18:26:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21IQRNm099997; Sun, 1 Mar 2015 18:26:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21IQRJa099996; Sun, 1 Mar 2015 18:26:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503011826.t21IQRJa099996@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 1 Mar 2015 18:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279489 - head/sbin/mount_fusefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 18:26:27 -0000 Author: trasz Date: Sun Mar 1 18:26:26 2015 New Revision: 279489 URL: https://svnweb.freebsd.org/changeset/base/279489 Log: Make the "automounted" flag work for FUSE filesystems. PR: 192852 Submitted by: taku at tackymt.homeip.net (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_fusefs/mount_fusefs.c Modified: head/sbin/mount_fusefs/mount_fusefs.c ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.c Sun Mar 1 12:54:22 2015 (r279488) +++ head/sbin/mount_fusefs/mount_fusefs.c Sun Mar 1 18:26:26 2015 (r279489) @@ -73,6 +73,13 @@ static struct mntopt mopts[] = { { "subtype=", 0, ALTF_SUBTYPE, 1 }, #define ALTF_SYNC_UNMOUNT 0x80 { "sync_unmount", 0, ALTF_SYNC_UNMOUNT, 1 }, + /* + * MOPT_AUTOMOUNTED, included by MOPT_STDOPTS, does not fit into + * the 'flags' argument to nmount(2). We have to abuse altflags + * to pass it, as string, via iovec. + */ + #define ALTF_AUTOMOUNTED 0x100 + { "automounted", 0, ALTF_AUTOMOUNTED, 1 }, /* Linux specific options, we silently ignore them */ { "fsname=", 0, 0x00, 1 }, { "fd=", 0, 0x00, 1 }, From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 19:27:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE717574; Sun, 1 Mar 2015 19:27:04 +0000 (UTC) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E2569BD; Sun, 1 Mar 2015 19:27:04 +0000 (UTC) Received: from 2a02-8428-011b-e000-0290-f5ff-fe9d-b78c.rev.sfr.net ([2a02:8428:11b:e000:290:f5ff:fe9d:b78c] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1YS9W2-0009Xz-L2; Sun, 01 Mar 2015 20:27:02 +0100 Message-ID: <54F367FE.1020700@FreeBSD.org> Date: Sun, 01 Mar 2015 20:26:54 +0100 From: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r279487 - head/sys/dev/pci References: <201503011247.t21Clb2p035966@svn.freebsd.org> <106186A9-DB74-4709-AAEE-7784731FD526@FreeBSD.org> In-Reply-To: <106186A9-DB74-4709-AAEE-7784731FD526@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HVtPKu7mcSFcBMqjLc2iKuvw2VfLveewJ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 19:27:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HVtPKu7mcSFcBMqjLc2iKuvw2VfLveewJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01.03.2015 16:02, Bjoern A. Zeeb wrote: >> Author: dumbbell >> Date: Sun Mar 1 12:47:36 2015 >> New Revision: 279487 >> URL: https://svnweb.freebsd.org/changeset/base/279487 >> >> Log: >> vgapci: New vga_pci_repost() function >=20 > I think this broke a couple of i386 and pc98 kernel configs: I'm sorry, I'm trying to reproduce that right now. Thank you for the heads-up. --=20 Jean-S=C3=A9bastien P=C3=A9dron --HVtPKu7mcSFcBMqjLc2iKuvw2VfLveewJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJU82gAXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMpoQP/1SJSlG8YRmTHK41rqOxk0q4 3iBLhD90Tpm4RJJdLIxTTkk+QeZY6yQ3PPSAVcRYqXPQi/56tzAXCB8AdYq+IkNe v2FSiSfiP1rxiCviqSsc9k3nLeAqJgc0xH2hlaLGxoB84pndUmViycySoYP7F8xi +jNseHx+CCtqhprEn81ZuXeabX0RBKfL/ADz68W3Ho4Npyy5Vc+hth9EMHvpkgYA uBUoKUEqLSQSVGHtQhcjD6uc+QjqbJcn58qhmr1LMTXJUV1nppHWQdFGNQqgKmVK egwzOz1/5CoXwM1zMUFGnqz/dZBcVHueW2Exts32jV5hthGpWvV61oe+GHmKA7ms /ADS2zPpjNb1v39qmKxt2D26Y20/iUODeXN/qLU+jEuj0ydrkwNCnvyi3qq5wkbl UyXYZ6/KqQ5LlwZ2RuC3ES9u31MWYveOjjDib+ehz1qD83cOwkzEkFw2E93ZvQiP K8/avBoeWpJeDkNfy+rHsUhRTHuVFFXwVA/se8GZaOlyhLjtD5t+ky5CwDLqCkUM dlhgBvEuQ/KxMJeIbPW4VQRsleXqz5jdtpJP0EuTGUBiokYo1aYm5bl/l0UzNUNX Q+uhZevpfozDsQSANqSobWQKIgwpmbQtGk3ocXsqBhYAFfKibp70Nh25Pjgni0LJ cQPc4N2f32hFuR7SKk+C =YBUC -----END PGP SIGNATURE----- --HVtPKu7mcSFcBMqjLc2iKuvw2VfLveewJ-- From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 20:22:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 693AB194; Sun, 1 Mar 2015 20:22:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 498B4F0D; Sun, 1 Mar 2015 20:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21KMTa6056364; Sun, 1 Mar 2015 20:22:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21KMTER056363; Sun, 1 Mar 2015 20:22:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503012022.t21KMTER056363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 20:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279490 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 20:22:29 -0000 Author: adrian Date: Sun Mar 1 20:22:28 2015 New Revision: 279490 URL: https://svnweb.freebsd.org/changeset/base/279490 Log: Bump the port mask on the AR8327 ethernet switch from 0x3f to 0x7f. So, it turns out that the AR8327 has 7 ports internally: * GMAC0 / external (CPU) MAC0 * GMAC1 / port1 -> GMAC5 / port5: external switch port PHYs * GMAC6 / external (CPU) MAC1 Now, depending upon how things are wired up, the second CPU port (MAC1) can be wired to either the switch (port6), or through port5's PHY, bypassing the GMAC+switch entirely. Ie, it can pretend to be a boring PHY, saving system designers from having to include a separate PHY for a "WAN" port. Here's the rub - the AP135 board (QCA955x SoC) hooks up arge0 to the second CPU port on the AR8327, but it's hooked up as RGMII. So, in order to hook it up to the rest of the switch, it isn't configured as a separate PHY - OpenWRT has it setup as connected via RGMII to GMAC6 and (I'm guessing) it's set to be a WAN port by configuring up port-based VLANs or something. Thus, with a port mask of 0x3f, GMAC6 was never allowed to receive traffic from any other port. It could transmit fine, but not receive anything. So, now it works enough for me to continue doing board bootstrapping. Note, this isn't enough to make the QCA955x + AR8327 work - there's a bunch of uncommitted work to both the platform SoC (interrupt handling, ethernet, etc) and the ethernet switch (register access space, setup, etc) that needs to happen. However, this particular change is also relevant to other SoCs, like the AR934x and AR7161, both of which can be glued to this switch. Tested: * AP135 development board TODO: * Figure out whether I can somehow abuse another port mode to have this be a pass-through PHY, or whether I should just create some more boot time hints to explicitly set up port-based isolation so this works in a more useful way by default. Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 1 18:26:26 2015 (r279489) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 1 20:22:28 2015 (r279490) @@ -683,7 +683,7 @@ ar8327_port_init(struct arswitch_softc * t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; /* So this allows traffic to any port except ourselves */ - t |= (0x3f & ~(1 << port)); + t |= (0x7f & ~(1 << port)); arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), t); } @@ -736,7 +736,7 @@ ar8327_reset_vlans(struct arswitch_softc arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(i), t); /* Ports can see other ports */ - t = (0x3f & ~(1 << i)); /* all ports besides us */ + t = (0x7f & ~(1 << i)); /* all ports besides us */ t |= AR8327_PORT_LOOKUP_LEARN; /* in_port_only, forward */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 20:26:05 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4084B2F7; Sun, 1 Mar 2015 20:26:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21301F2B; Sun, 1 Mar 2015 20:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21KQ5Ct056853; Sun, 1 Mar 2015 20:26:05 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21KQ4Sr056850; Sun, 1 Mar 2015 20:26:04 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201503012026.t21KQ4Sr056850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Sun, 1 Mar 2015 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279491 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 20:26:05 -0000 Author: kargl Date: Sun Mar 1 20:26:03 2015 New Revision: 279491 URL: https://svnweb.freebsd.org/changeset/base/279491 Log: When j0() and j1() were converted to j0f() and j1f(), the threshold values for the different invervals were not converted correctly. Adjust the threshold values to values, which should agree with the comments. Reported by: cognet (j1f only) Discussed with: pfg, bde Reviewed by: bde Modified: head/lib/msun/src/e_j0f.c head/lib/msun/src/e_j1f.c Modified: head/lib/msun/src/e_j0f.c ============================================================================== --- head/lib/msun/src/e_j0f.c Sun Mar 1 20:22:28 2015 (r279490) +++ head/lib/msun/src/e_j0f.c Sun Mar 1 20:26:03 2015 (r279491) @@ -62,7 +62,7 @@ __ieee754_j0f(float x) * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x) * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x) */ - if(ix>0x54000000) z = (invsqrtpi*cc)/sqrtf(x); + if(ix>0x58000000) z = (invsqrtpi*cc)/sqrtf(x); /* |x|>2**49 */ else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*cc-v*ss)/sqrtf(x); @@ -136,14 +136,14 @@ __ieee754_y0f(float x) if ((s*c)0x54800000) z = (invsqrtpi*ss)/sqrtf(x); + if(ix>0x58000000) z = (invsqrtpi*ss)/sqrtf(x); /* |x|>2**49 */ else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*ss+v*cc)/sqrtf(x); } return z; } - if(ix<=0x32000000) { /* x < 2**-27 */ + if(ix<=0x39000000) { /* x < 2**-13 */ return(u00 + tpi*__ieee754_logf(x)); } z = x*x; @@ -232,8 +232,8 @@ static const float pS2[5] = { GET_FLOAT_WORD(ix,x); ix &= 0x7fffffff; if(ix>=0x41000000) {p = pR8; q= pS8;} - else if(ix>=0x40f71c58){p = pR5; q= pS5;} - else if(ix>=0x4036db68){p = pR3; q= pS3;} + else if(ix>=0x409173eb){p = pR5; q= pS5;} + else if(ix>=0x4036d917){p = pR3; q= pS3;} else {p = pR2; q= pS2;} /* ix>=0x40000000 */ z = one/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); @@ -327,8 +327,8 @@ static const float qS2[6] = { GET_FLOAT_WORD(ix,x); ix &= 0x7fffffff; if(ix>=0x41000000) {p = qR8; q= qS8;} - else if(ix>=0x40f71c58){p = qR5; q= qS5;} - else if(ix>=0x4036db68){p = qR3; q= qS3;} + else if(ix>=0x409173eb){p = qR5; q= qS5;} + else if(ix>=0x4036d917){p = qR3; q= qS3;} else {p = qR2; q= qS2;} /* ix>=0x40000000 */ z = one/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); Modified: head/lib/msun/src/e_j1f.c ============================================================================== --- head/lib/msun/src/e_j1f.c Sun Mar 1 20:22:28 2015 (r279490) +++ head/lib/msun/src/e_j1f.c Sun Mar 1 20:26:03 2015 (r279491) @@ -63,7 +63,7 @@ __ieee754_j1f(float x) * j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x) * y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x) */ - if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(y); + if(ix>0x58000000) z = (invsqrtpi*cc)/sqrtf(y); /* |x|>2**49 */ else { u = ponef(y); v = qonef(y); z = invsqrtpi*(u*cc-v*ss)/sqrtf(y); @@ -71,7 +71,7 @@ __ieee754_j1f(float x) if(hx<0) return -z; else return z; } - if(ix<0x32000000) { /* |x|<2**-27 */ + if(ix<0x39000000) { /* |x|<2**-13 */ if(huge+x>one) return (float)0.5*x;/* inexact if x!=0 necessary */ } z = x*x; @@ -129,14 +129,14 @@ __ieee754_y1f(float x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x); + if(ix>0x58000000) z = (invsqrtpi*ss)/sqrtf(x); /* |x|>2**49 */ else { u = ponef(x); v = qonef(x); z = invsqrtpi*(u*ss+v*cc)/sqrtf(x); } return z; } - if(ix<=0x24800000) { /* x < 2**-54 */ + if(ix<=0x33000000) { /* x < 2**-25 */ return(-tpi/x); } z = x*x; @@ -227,8 +227,8 @@ static const float ps2[5] = { GET_FLOAT_WORD(ix,x); ix &= 0x7fffffff; if(ix>=0x41000000) {p = pr8; q= ps8;} - else if(ix>=0x40f71c58){p = pr5; q= ps5;} - else if(ix>=0x4036db68){p = pr3; q= ps3;} + else if(ix>=0x409173eb){p = pr5; q= ps5;} + else if(ix>=0x4036d917){p = pr3; q= ps3;} else {p = pr2; q= ps2;} /* ix>=0x40000000 */ z = one/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); @@ -322,9 +322,9 @@ static const float qs2[6] = { int32_t ix; GET_FLOAT_WORD(ix,x); ix &= 0x7fffffff; - if(ix>=0x40200000) {p = qr8; q= qs8;} - else if(ix>=0x40f71c58){p = qr5; q= qs5;} - else if(ix>=0x4036db68){p = qr3; q= qs3;} + if(ix>=0x41000000) {p = qr8; q= qs8;} + else if(ix>=0x409173eb){p = qr5; q= qs5;} + else if(ix>=0x4036d917){p = qr3; q= qs3;} else {p = qr2; q= qs2;} /* ix>=0x40000000 */ z = one/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 20:32:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62CE7466; Sun, 1 Mar 2015 20:32:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3312DFE3; Sun, 1 Mar 2015 20:32:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21KWaq5061144; Sun, 1 Mar 2015 20:32:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21KWaCm061143; Sun, 1 Mar 2015 20:32:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503012032.t21KWaCm061143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 Mar 2015 20:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279492 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 20:32:36 -0000 Author: adrian Date: Sun Mar 1 20:32:35 2015 New Revision: 279492 URL: https://svnweb.freebsd.org/changeset/base/279492 Log: AR8327: Disable energy-efficient ethernet support in the PHYs. I noticed that openwrt/linux does this, citing "instability", so until they figure out why I'm going to disable it here as well. Tested: * QCA AP135 - QCA955x SoC + AR8327 switch. Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 1 20:26:03 2015 (r279491) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 1 20:32:35 2015 (r279492) @@ -66,7 +66,11 @@ static void ar8327_phy_fixup(struct arswitch_softc *sc, int phy) { - + if (bootverbose) + device_printf(sc->sc_dev, + "%s: called; phy=%d; chiprev=%d\n", __func__, + phy, + sc->chip_rev); switch (sc->chip_rev) { case 1: /* For 100M waveform */ @@ -385,23 +389,23 @@ ar8327_fetch_pdata_pad(struct arswitch_s sbuf, &val) == 0) pc->pipe_rxclk_sel = val; -#if 0 - device_printf(sc->sc_dev, - "%s: pad %d: mode=%d, rxclk_sel=%d, txclk_sel=%d, " - "txclk_delay_sel=%d, rxclk_delay_sel=%d, txclk_delay_en=%d, " - "rxclk_enable_en=%d, sgmii_delay_en=%d, pipe_rxclk_sel=%d\n", - __func__, - pad, - pc->mode, - pc->rxclk_sel, - pc->txclk_sel, - pc->txclk_delay_sel, - pc->rxclk_delay_sel, - pc->txclk_delay_en, - pc->rxclk_delay_en, - pc->sgmii_delay_en, - pc->pipe_rxclk_sel); -#endif + if (bootverbose) { + device_printf(sc->sc_dev, + "%s: pad %d: mode=%d, rxclk_sel=%d, txclk_sel=%d, " + "txclk_delay_sel=%d, rxclk_delay_sel=%d, txclk_delay_en=%d, " + "rxclk_enable_en=%d, sgmii_delay_en=%d, pipe_rxclk_sel=%d\n", + __func__, + pad, + pc->mode, + pc->rxclk_sel, + pc->txclk_sel, + pc->txclk_delay_sel, + pc->rxclk_delay_sel, + pc->txclk_delay_en, + pc->rxclk_delay_en, + pc->sgmii_delay_en, + pc->pipe_rxclk_sel); + } return (1); } @@ -637,6 +641,15 @@ ar8327_hw_global_setup(struct arswitch_s arswitch_modifyreg(sc->sc_dev, AR8327_REG_MODULE_EN, AR8327_MODULE_EN_MIB, AR8327_MODULE_EN_MIB); + /* Disable EEE on all ports due to stability issues */ + t = arswitch_readreg(sc->sc_dev, AR8327_REG_EEE_CTRL); + t |= AR8327_EEE_CTRL_DISABLE_PHY(0) | + AR8327_EEE_CTRL_DISABLE_PHY(1) | + AR8327_EEE_CTRL_DISABLE_PHY(2) | + AR8327_EEE_CTRL_DISABLE_PHY(3) | + AR8327_EEE_CTRL_DISABLE_PHY(4); + arswitch_writereg(sc->sc_dev, AR8327_REG_EEE_CTRL, t); + /* Set the right number of ports */ sc->info.es_nports = 6; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 20:32:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A81F59D; Sun, 1 Mar 2015 20:32:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD2BFE6; Sun, 1 Mar 2015 20:32:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21KWnHO061213; Sun, 1 Mar 2015 20:32:49 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21KWmkZ061206; Sun, 1 Mar 2015 20:32:48 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201503012032.t21KWmkZ061206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Sun, 1 Mar 2015 20:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279493 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 20:32:49 -0000 Author: kargl Date: Sun Mar 1 20:32:47 2015 New Revision: 279493 URL: https://svnweb.freebsd.org/changeset/base/279493 Log: Give compilers a stronger hint to inline the functions pzero[f], qzero[f], pone[f], and qone[f]. While here fix the function declarations in accordance with style(9). Modified: head/lib/msun/src/e_j0.c head/lib/msun/src/e_j0f.c head/lib/msun/src/e_j1.c head/lib/msun/src/e_j1f.c Modified: head/lib/msun/src/e_j0.c ============================================================================== --- head/lib/msun/src/e_j0.c Sun Mar 1 20:32:35 2015 (r279492) +++ head/lib/msun/src/e_j0.c Sun Mar 1 20:32:47 2015 (r279493) @@ -268,7 +268,8 @@ static const double pS2[5] = { 1.46576176948256193810e+01, /* 0x402D50B3, 0x44391809 */ }; - static double pzero(double x) +static __inline double +pzero(double x) { const double *p,*q; double z,r,s; @@ -363,7 +364,8 @@ static const double qS2[6] = { -5.31095493882666946917e+00, /* 0xC0153E6A, 0xF8B32931 */ }; - static double qzero(double x) +static __inline double +qzero(double x) { const double *p,*q; double s,r,z; Modified: head/lib/msun/src/e_j0f.c ============================================================================== --- head/lib/msun/src/e_j0f.c Sun Mar 1 20:32:35 2015 (r279492) +++ head/lib/msun/src/e_j0f.c Sun Mar 1 20:32:47 2015 (r279493) @@ -224,7 +224,8 @@ static const float pS2[5] = { 1.4657617569e+01, /* 0x416a859a */ }; - static float pzerof(float x) +static __inline float +pzerof(float x) { const float *p,*q; float z,r,s; @@ -319,7 +320,8 @@ static const float qS2[6] = { -5.3109550476e+00, /* 0xc0a9f358 */ }; - static float qzerof(float x) +static __inline float +qzerof(float x) { const float *p,*q; float s,r,z; Modified: head/lib/msun/src/e_j1.c ============================================================================== --- head/lib/msun/src/e_j1.c Sun Mar 1 20:32:35 2015 (r279492) +++ head/lib/msun/src/e_j1.c Sun Mar 1 20:32:47 2015 (r279493) @@ -262,7 +262,8 @@ static const double ps2[5] = { 8.36463893371618283368e+00, /* 0x4020BAB1, 0xF44E5192 */ }; - static double pone(double x) +static __inline double +pone(double x) { const double *p,*q; double z,r,s; @@ -358,7 +359,8 @@ static const double qs2[6] = { -4.95949898822628210127e+00, /* 0xC013D686, 0xE71BE86B */ }; - static double qone(double x) +static __inline double +qone(double x) { const double *p,*q; double s,r,z; Modified: head/lib/msun/src/e_j1f.c ============================================================================== --- head/lib/msun/src/e_j1f.c Sun Mar 1 20:32:35 2015 (r279492) +++ head/lib/msun/src/e_j1f.c Sun Mar 1 20:32:47 2015 (r279493) @@ -219,7 +219,8 @@ static const float ps2[5] = { 8.3646392822e+00, /* 0x4105d590 */ }; - static float ponef(float x) +static __inline float +ponef(float x) { const float *p,*q; float z,r,s; @@ -315,7 +316,8 @@ static const float qs2[6] = { -4.9594988823e+00, /* 0xc09eb437 */ }; - static float qonef(float x) +static __inline float +qonef(float x) { const float *p,*q; float s,r,z; From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 20:54:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FA86A40; Sun, 1 Mar 2015 20:54:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11AE8235; Sun, 1 Mar 2015 20:54:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21KsUJt070740; Sun, 1 Mar 2015 20:54:30 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21KsUIZ070737; Sun, 1 Mar 2015 20:54:30 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201503012054.t21KsUIZ070737@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sun, 1 Mar 2015 20:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279494 - in head/sys: conf dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 20:54:31 -0000 Author: dumbbell Date: Sun Mar 1 20:54:29 2015 New Revision: 279494 URL: https://svnweb.freebsd.org/changeset/base/279494 Log: Record the dependency to x86bios in vga_pci This fixes the build of XEN and XBOX kernels on i386, which was broken in r279487. While here, do not build vga_pci_repost() on PC98. Reported by: bz@ Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/pci/vga_pci.c Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Mar 1 20:32:47 2015 (r279493) +++ head/sys/conf/files.amd64 Sun Mar 1 20:54:29 2015 (r279494) @@ -513,10 +513,10 @@ compat/ndis/winx64_wrap.S optional ndisa libkern/memmove.c standard libkern/memset.c standard # -# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +# x86 real mode BIOS emulator, required by atkbdc/dpms/pci/vesa # -compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | pci | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | pci | vesa # # bvm console # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Mar 1 20:32:47 2015 (r279493) +++ head/sys/conf/files.i386 Sun Mar 1 20:54:29 2015 (r279494) @@ -531,9 +531,9 @@ i386/xbox/xboxfb.c optional xboxfb dev/fb/boot_font.c optional xboxfb i386/xbox/pic16l.s optional xbox # -# x86 real mode BIOS support, required by atkbdc/dpms/vesa +# x86 real mode BIOS support, required by atkbdc/dpms/pci/vesa # -compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | pci | vesa # # bvm console # Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sun Mar 1 20:32:47 2015 (r279493) +++ head/sys/dev/pci/vga_pci.c Sun Mar 1 20:54:29 2015 (r279494) @@ -199,7 +199,7 @@ vga_pci_unmap_bios(device_t dev, void *b int vga_pci_repost(device_t dev) { -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) x86regs_t regs; if (!vga_pci_is_boot_display(dev)) @@ -633,3 +633,4 @@ static driver_t vga_pci_driver = { static devclass_t vga_devclass; DRIVER_MODULE(vgapci, pci, vga_pci_driver, vga_devclass, 0, 0); +MODULE_DEPEND(vgapci, x86bios, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:03:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 356CFF0C; Sun, 1 Mar 2015 21:03:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA573F3; Sun, 1 Mar 2015 21:03:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21L3YC9075608; Sun, 1 Mar 2015 21:03:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21L3YEl075607; Sun, 1 Mar 2015 21:03:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503012103.t21L3YEl075607@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 1 Mar 2015 21:03:34 +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: r279495 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:03:35 -0000 Author: ngie Date: Sun Mar 1 21:03:34 2015 New Revision: 279495 URL: https://svnweb.freebsd.org/changeset/base/279495 Log: MFC r278891: Add the mnt_lockref field to the ddb(4) 'show mount' command Differential Revision: https://reviews.freebsd.org/D1688 Submitted by: Conrad Meyer Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Sun Mar 1 20:54:29 2015 (r279494) +++ stable/10/sys/kern/vfs_subr.c Sun Mar 1 21:03:34 2015 (r279495) @@ -3182,6 +3182,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); + db_printf(" mnt_lockref = %d\n", mp->mnt_lockref); db_printf(" mnt_secondary_writes = %d\n", mp->mnt_secondary_writes); db_printf(" mnt_secondary_accwrites = %d\n", mp->mnt_secondary_accwrites); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:20:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6B0731A; Sun, 1 Mar 2015 21:20:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A74636E6; Sun, 1 Mar 2015 21:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LKJuG081484; Sun, 1 Mar 2015 21:20:19 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LKJaU081483; Sun, 1 Mar 2015 21:20:19 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503012120.t21LKJaU081483@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 1 Mar 2015 21:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279496 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:20:20 -0000 Author: nwhitehorn Date: Sun Mar 1 21:20:18 2015 New Revision: 279496 URL: https://svnweb.freebsd.org/changeset/base/279496 Log: Merge r278429 from ppc64: Fix an extremely subtle concurrency bug triggered by running on 32-thread POWER8 systems. During thread switch, there was a very small window when the stack pointer was set to the stack pointer of the outgoing thread, but after the lock on that thread had already been released. If, during that window, the outgoing thread were rescheduled on another CPU and begin execution and an exception were taken on the original CPU, the trap handler and the outgoing thread would simultaneously execute on the same stack, causing memory corruption. Fix this by making sure to release the old thread only after cpu_switch() is done with its stack. MFC after: 2 weeks Modified: head/sys/powerpc/powerpc/swtch32.S Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Sun Mar 1 21:03:34 2015 (r279495) +++ head/sys/powerpc/powerpc/swtch32.S Sun Mar 1 21:20:18 2015 (r279496) @@ -71,6 +71,8 @@ */ ENTRY(cpu_throw) mr %r2, %r4 + li %r14,0 /* Tell cpu_switchin not to release a thread */ + b cpu_switchin /* @@ -119,7 +121,6 @@ ENTRY(cpu_switch) bl pmap_deactivate /* Deactivate the current pmap */ sync /* Make sure all of that finished */ - stw %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) @@ -133,7 +134,15 @@ blocked_loop: isync #endif - mfsprg %r7,0 /* Get the pcpu pointer */ + lwz %r17,TD_PCB(%r2) /* Get new current PCB */ + lwz %r1,PCB_SP(%r17) /* Load new stack pointer */ + + /* Release old thread now that we have a stack pointer set up */ + cmpwi %r14,0 + beq- 1f + stw %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ + +1: mfsprg %r7,0 /* Get the pcpu pointer */ stw %r2,PC_CURTHREAD(%r7) /* Store new current thread */ lwz %r17,TD_PCB(%r2) /* Store new current PCB */ stw %r17,PC_CURPCB(%r7) From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:22:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6602A46B; Sun, 1 Mar 2015 21:22:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5075E7E1; Sun, 1 Mar 2015 21:22:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LMZCj085224; Sun, 1 Mar 2015 21:22:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LMYi2085221; Sun, 1 Mar 2015 21:22:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503012122.t21LMYi2085221@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 1 Mar 2015 21:22:34 +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: r279497 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:22:35 -0000 Author: ngie Date: Sun Mar 1 21:22:34 2015 New Revision: 279497 URL: https://svnweb.freebsd.org/changeset/base/279497 Log: Unbreak rcorUnbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to BEFORE: in utx Modified: stable/10/etc/rc.d/LOGIN stable/10/etc/rc.d/utx Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/LOGIN ============================================================================== --- stable/10/etc/rc.d/LOGIN Sun Mar 1 21:20:18 2015 (r279496) +++ stable/10/etc/rc.d/LOGIN Sun Mar 1 21:22:34 2015 (r279497) @@ -4,7 +4,7 @@ # # PROVIDE: LOGIN -# REQUIRE: DAEMON utx +# REQUIRE: DAEMON # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case Modified: stable/10/etc/rc.d/utx ============================================================================== --- stable/10/etc/rc.d/utx Sun Mar 1 21:20:18 2015 (r279496) +++ stable/10/etc/rc.d/utx Sun Mar 1 21:22:34 2015 (r279497) @@ -5,6 +5,7 @@ # PROVIDE: utx # REQUIRE: DAEMON FILESYSTEMS +# BEFORE: LOGIN # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:23:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F420597; Sun, 1 Mar 2015 21:23:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7B07E7; Sun, 1 Mar 2015 21:23:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LNPAE085412; Sun, 1 Mar 2015 21:23:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LNOBg085410; Sun, 1 Mar 2015 21:23:24 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503012123.t21LNOBg085410@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 1 Mar 2015 21:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279498 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:23:25 -0000 Author: nwhitehorn Date: Sun Mar 1 21:23:23 2015 New Revision: 279498 URL: https://svnweb.freebsd.org/changeset/base/279498 Log: Initialize NX stack capabilities and direct map status in pmap like on AIM. Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sun Mar 1 21:22:34 2015 (r279497) +++ head/sys/powerpc/booke/machdep.c Sun Mar 1 21:23:23 2015 (r279498) @@ -226,9 +226,6 @@ cpu_booke_startup(void *dummy) /* Set up buffers, so they can be used to read disk labels. */ bufinit(); vm_pager_bufferinit(); - - /* Cpu supports execution permissions on the pages. */ - elf32_nxstack = 1; } static char * @@ -454,7 +451,6 @@ booke_init(uint32_t arg1, uint32_t arg2) /* Initialise virtual memory. */ pmap_mmu_install(MMU_TYPE_BOOKE, 0); pmap_bootstrap((uintptr_t)kernel_text, end); - pmap_bootstrapped = 1; debugf("MSR = 0x%08x\n", mfmsr()); #if defined(BOOKE_E500) //tlb1_print_entries(); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Mar 1 21:22:34 2015 (r279497) +++ head/sys/powerpc/booke/pmap.c Sun Mar 1 21:23:23 2015 (r279498) @@ -1014,6 +1014,10 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: entered\n"); + /* Set interesting system properties */ + hw_direct_map = 0; + elf32_nxstack = 1; + /* Initialize invalidation mutex */ mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN); @@ -1315,6 +1319,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset kstack0 += PAGE_SIZE; kstack0_phys += PAGE_SIZE; } + + pmap_bootstrapped = 1; debugf("virtual_avail = %08x\n", virtual_avail); debugf("virtual_end = %08x\n", virtual_end); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:24:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17C496DD; Sun, 1 Mar 2015 21:24:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01DB17F6; Sun, 1 Mar 2015 21:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LOKSm085571; Sun, 1 Mar 2015 21:24:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LOKmP085569; Sun, 1 Mar 2015 21:24:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503012124.t21LOKmP085569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 1 Mar 2015 21:24:20 +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: r279499 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:24:21 -0000 Author: ngie Date: Sun Mar 1 21:24:19 2015 New Revision: 279499 URL: https://svnweb.freebsd.org/changeset/base/279499 Log: MFC r278704: Unbreak rcorder when MK_UNBOUND == no by moving local_unbound from REQUIRE: in NETWORKING to BEFORE: in the script Modified: stable/10/etc/rc.d/NETWORKING stable/10/etc/rc.d/local_unbound Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/NETWORKING ============================================================================== --- stable/10/etc/rc.d/NETWORKING Sun Mar 1 21:23:23 2015 (r279498) +++ stable/10/etc/rc.d/NETWORKING Sun Mar 1 21:24:19 2015 (r279499) @@ -6,7 +6,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netoptions routing ppp ipfw stf faith # REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge -# REQUIRE: static_arp static_ndp local_unbound +# REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking # to be operational before starting. Modified: stable/10/etc/rc.d/local_unbound ============================================================================== --- stable/10/etc/rc.d/local_unbound Sun Mar 1 21:23:23 2015 (r279498) +++ stable/10/etc/rc.d/local_unbound Sun Mar 1 21:24:19 2015 (r279499) @@ -5,6 +5,7 @@ # PROVIDE: local_unbound # REQUIRE: FILESYSTEMS netif resolv +# BEFORE: NETWORKING # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:41:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A20FB73; Sun, 1 Mar 2015 21:41:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E903C9A2; Sun, 1 Mar 2015 21:41:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LfXEe093246; Sun, 1 Mar 2015 21:41:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LfXvv093245; Sun, 1 Mar 2015 21:41:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503012141.t21LfXvv093245@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2015 21:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279500 - head/sys/dev/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:41:34 -0000 Author: imp Date: Sun Mar 1 21:41:33 2015 New Revision: 279500 URL: https://svnweb.freebsd.org/changeset/base/279500 Log: Unlock the main lock before returning rather than after to eliminate dead code that shouldn't have been dead. Reported by: Maxime Villard Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Sun Mar 1 21:24:19 2015 (r279499) +++ head/sys/dev/ed/if_ed_pccard.c Sun Mar 1 21:41:33 2015 (r279500) @@ -1172,8 +1172,8 @@ ed_ifmedia_sts(struct ifnet *ifp, struct sc = ifp->if_softc; ED_LOCK(sc); if (sc->miibus == NULL) { - return; ED_UNLOCK(sc); + return; } mii = device_get_softc(sc->miibus); From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:41:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A041C46; Sun, 1 Mar 2015 21:41:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 053AE9A3; Sun, 1 Mar 2015 21:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LfZvD093295; Sun, 1 Mar 2015 21:41:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LfZrs093294; Sun, 1 Mar 2015 21:41:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503012141.t21LfZrs093294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2015 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279501 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:41:36 -0000 Author: imp Date: Sun Mar 1 21:41:35 2015 New Revision: 279501 URL: https://svnweb.freebsd.org/changeset/base/279501 Log: Don't leak 'used' in a few error cases. Reported by: Maxime Villard Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 21:41:33 2015 (r279500) +++ head/sys/dev/pci/pci.c Sun Mar 1 21:41:35 2015 (r279501) @@ -1702,12 +1702,16 @@ pci_remap_msix_method(device_t dev, devi for (i = 0; i < msix->msix_table_len; i++) { if (msix->msix_table[i].mte_vector == 0) continue; - if (msix->msix_table[i].mte_handlers > 0) + if (msix->msix_table[i].mte_handlers > 0) { + free(used, M_DEVBUF); return (EBUSY); + } rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, i + 1); KASSERT(rle != NULL, ("missing resource")); - if (rle->res != NULL) + if (rle->res != NULL) { + free(used, M_DEVBUF); return (EBUSY); + } } /* Free the existing resource list entries. */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:41:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED54BD7A; Sun, 1 Mar 2015 21:41:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D87F69A4; Sun, 1 Mar 2015 21:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LfbDP093342; Sun, 1 Mar 2015 21:41:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21Lfb3N093341; Sun, 1 Mar 2015 21:41:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503012141.t21Lfb3N093341@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2015 21:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279502 - head/sys/fs/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:41:38 -0000 Author: imp Date: Sun Mar 1 21:41:37 2015 New Revision: 279502 URL: https://svnweb.freebsd.org/changeset/base/279502 Log: nandfs_meta_bread() calls bread() which can set bp to NULL in some error cases. Calling brelse() with a NULL pointer is not allowed, so only call brelse() when the bp is non-NULL. Reported by: Maxime Villard (reported as uninitialized variable) Modified: head/sys/fs/nandfs/bmap.c Modified: head/sys/fs/nandfs/bmap.c ============================================================================== --- head/sys/fs/nandfs/bmap.c Sun Mar 1 21:41:35 2015 (r279501) +++ head/sys/fs/nandfs/bmap.c Sun Mar 1 21:41:37 2015 (r279502) @@ -317,7 +317,8 @@ bmap_truncate_indirect(struct nandfs_nod error = nandfs_bread_meta(node, lbn, NOCRED, 0, &bp); if (error) { - brelse(bp); + if (bp != NULL) + brelse(bp); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:46:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9FEFF78; Sun, 1 Mar 2015 21:46:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A393D9CF; Sun, 1 Mar 2015 21:46:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LkvJt095612; Sun, 1 Mar 2015 21:46:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LktwP095601; Sun, 1 Mar 2015 21:46:55 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503012146.t21LktwP095601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 1 Mar 2015 21:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279503 - in head: bin/kill bin/sh bin/sh/bltin usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:46:57 -0000 Author: jilles Date: Sun Mar 1 21:46:55 2015 New Revision: 279503 URL: https://svnweb.freebsd.org/changeset/base/279503 Log: sh: Fix compiler warnings related to duplicate or missing declarations. Modified: head/bin/kill/kill.c head/bin/sh/arith_yacc.h head/bin/sh/arith_yylex.c head/bin/sh/bltin/bltin.h head/bin/sh/mktokens head/bin/sh/options.h head/usr.bin/printf/printf.c Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Sun Mar 1 21:41:37 2015 (r279502) +++ head/bin/kill/kill.c Sun Mar 1 21:46:55 2015 (r279503) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #ifdef SHELL #define main killcmd #include "bltin/bltin.h" -#include "error.h" #endif static void nosig(const char *); Modified: head/bin/sh/arith_yacc.h ============================================================================== --- head/bin/sh/arith_yacc.h Sun Mar 1 21:41:37 2015 (r279502) +++ head/bin/sh/arith_yacc.h Sun Mar 1 21:46:55 2015 (r279503) @@ -81,6 +81,8 @@ #define ARITH_QMARK 37 #define ARITH_COLON 38 +extern const char *arith_buf; + union yystype { arith_t val; char *name; Modified: head/bin/sh/arith_yylex.c ============================================================================== --- head/bin/sh/arith_yylex.c Sun Mar 1 21:41:37 2015 (r279502) +++ head/bin/sh/arith_yylex.c Sun Mar 1 21:46:55 2015 (r279503) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #error Arithmetic tokens are out of order. #endif -extern const char *arith_buf; - int yylex(void) { Modified: head/bin/sh/bltin/bltin.h ============================================================================== --- head/bin/sh/bltin/bltin.h Sun Mar 1 21:41:37 2015 (r279502) +++ head/bin/sh/bltin/bltin.h Sun Mar 1 21:46:55 2015 (r279503) @@ -42,6 +42,7 @@ #include "../shell.h" #include "../mystring.h" #ifdef SHELL +#include "../error.h" #include "../output.h" #include "builtins.h" #define FILE struct output @@ -73,7 +74,6 @@ #include pointer stalloc(int); -void error(const char *, ...) __printf0like(1, 2); int killjob(const char *, int); extern char *commandname; Modified: head/bin/sh/mktokens ============================================================================== --- head/bin/sh/mktokens Sun Mar 1 21:41:37 2015 (r279502) +++ head/bin/sh/mktokens Sun Mar 1 21:46:55 2015 (r279503) @@ -74,11 +74,11 @@ exec > token.h awk '{print "#define " $1 " " NR-1}' $temp echo ' /* Array indicating which tokens mark the end of a list */ -const char tokendlist[] = {' +static const char tokendlist[] = {' awk '{print "\t" $2 ","}' $temp echo '}; -const char *const tokname[] = {' +static const char *const tokname[] = {' sed -e 's/"/\\"/g' \ -e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \ $temp Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Sun Mar 1 21:41:37 2015 (r279502) +++ head/bin/sh/options.h Sun Mar 1 21:46:55 2015 (r279503) @@ -73,6 +73,7 @@ struct optent { char val; }; +extern struct optent optlist[NOPTS]; #ifdef DEFINE_OPTIONS struct optent optlist[NOPTS] = { { "errexit", 'e', 0 }, @@ -95,8 +96,6 @@ struct optent optlist[NOPTS] = { { "physical", 'P', 0 }, { "trackall", 'h', 0 }, }; -#else -extern struct optent optlist[NOPTS]; #endif Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Sun Mar 1 21:41:37 2015 (r279502) +++ head/usr.bin/printf/printf.c Sun Mar 1 21:46:55 2015 (r279503) @@ -66,7 +66,6 @@ static const char rcsid[] = #ifdef SHELL #define main printfcmd #include "bltin/bltin.h" -#include "error.h" #include "options.h" #endif From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:47:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10C081AD; Sun, 1 Mar 2015 21:47:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFE09E1; Sun, 1 Mar 2015 21:47:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LldwF095754; Sun, 1 Mar 2015 21:47:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LldqI095752; Sun, 1 Mar 2015 21:47:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503012147.t21LldqI095752@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 1 Mar 2015 21:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279504 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 21:47:40 -0000 Author: nwhitehorn Date: Sun Mar 1 21:47:38 2015 New Revision: 279504 URL: https://svnweb.freebsd.org/changeset/base/279504 Log: Missed local diff. Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sun Mar 1 21:46:55 2015 (r279503) +++ head/sys/powerpc/booke/machdep.c Sun Mar 1 21:47:38 2015 (r279504) @@ -188,8 +188,6 @@ void print_kernel_section_addr(void); void print_kenv(void); u_int booke_init(uint32_t, uint32_t); -extern int elf32_nxstack; - static void cpu_booke_startup(void *dummy) { Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Mar 1 21:46:55 2015 (r279503) +++ head/sys/powerpc/booke/pmap.c Sun Mar 1 21:47:38 2015 (r279504) @@ -160,6 +160,7 @@ unsigned int kernel_ptbls; /* Number of ((pmap) != kernel_pmap && (pmap)->pm_stats.resident_count == 0) extern void tid_flush(tlbtid_t); +extern int elf32_nxstack; /**************************************************************************/ /* TLB and TID handling */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 22:03:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 844D9595; Sun, 1 Mar 2015 22:03:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CBDDBCA; Sun, 1 Mar 2015 22:03:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21M3vxF004843; Sun, 1 Mar 2015 22:03:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21M3rwL004826; Sun, 1 Mar 2015 22:03:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503012203.t21M3rwL004826@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 1 Mar 2015 22:03:53 +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: r279505 - in stable/10: etc libexec share/mk tools/build/options usr.bin usr.sbin X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 22:03:57 -0000 Author: ngie Date: Sun Mar 1 22:03:52 2015 New Revision: 279505 URL: https://svnweb.freebsd.org/changeset/base/279505 Log: MFC r278192: Add the following options to enable/disable several features in the base system WITHOUT_BOOTPARAMD - bootparamd WITHOUT_BOOTPD - bootpd WITHOUT_FINGER - finger, fingerd WITHOUT_FTP - ftp, ftpd WITHOUT_INETD - inetd WITHOUT_RBOOTD - rbootd WITHOUT_TCP_WRAPPERS - tcpd, et al WITHOUT_TFTP - tftp, tftp-server WITHOUT_TIMED - timed Sponsored by: EMC / Isilon Storage Division Added: stable/10/tools/build/options/WITHOUT_BOOTPARAMD - copied unchanged from r278192, head/tools/build/options/WITHOUT_BOOTPARAMD stable/10/tools/build/options/WITHOUT_BOOTPD - copied unchanged from r278192, head/tools/build/options/WITHOUT_BOOTPD stable/10/tools/build/options/WITHOUT_FINGER - copied unchanged from r278192, head/tools/build/options/WITHOUT_FINGER stable/10/tools/build/options/WITHOUT_FTP - copied unchanged from r278192, head/tools/build/options/WITHOUT_FTP stable/10/tools/build/options/WITHOUT_INETD - copied unchanged from r278192, head/tools/build/options/WITHOUT_INETD stable/10/tools/build/options/WITHOUT_RBOOTD - copied unchanged from r278192, head/tools/build/options/WITHOUT_RBOOTD stable/10/tools/build/options/WITHOUT_TCP_WRAPPERS - copied unchanged from r278192, head/tools/build/options/WITHOUT_TCP_WRAPPERS stable/10/tools/build/options/WITHOUT_TFTP - copied unchanged from r278192, head/tools/build/options/WITHOUT_TFTP stable/10/tools/build/options/WITHOUT_TIMED - copied unchanged from r278192, head/tools/build/options/WITHOUT_TIMED Modified: stable/10/etc/Makefile stable/10/libexec/Makefile stable/10/share/mk/bsd.own.mk stable/10/usr.bin/Makefile stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Sun Mar 1 21:47:38 2015 (r279504) +++ stable/10/etc/Makefile Sun Mar 1 22:03:52 2015 (r279505) @@ -21,13 +21,11 @@ BIN1= crontab \ dhclient.conf \ disktab \ fbtab \ - ftpusers \ gettytab \ group \ hosts \ hosts.allow \ hosts.equiv \ - inetd.conf \ libalias.conf \ libmap.conf \ login.access \ @@ -101,6 +99,14 @@ BIN1+= snmpd.config BIN1+= freebsd-update.conf .endif +.if ${MK_FTP} != "no" +BIN1+= ftpusers +.endif + +.if ${MK_INETD} != "no" +BIN1+= inetd.conf +.endif + .if ${MK_LOCATE} != "no" BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc .endif Modified: stable/10/libexec/Makefile ============================================================================== --- stable/10/libexec/Makefile Sun Mar 1 21:47:38 2015 (r279504) +++ stable/10/libexec/Makefile Sun Mar 1 22:03:52 2015 (r279505) @@ -5,16 +5,12 @@ SUBDIR= ${_atf} \ ${_atrun} \ - bootpd \ ${_comsat} \ - fingerd \ - ftpd \ getty \ ${_hyperv} \ ${_mail.local} \ ${_mknetid} \ ${_pppoed} \ - rbootd \ revnetgroup \ ${_rlogind} \ rpc.rquotad \ @@ -26,10 +22,8 @@ SUBDIR= ${_atf} \ ${_rtld-elf} \ save-entropy \ ${_smrsh} \ - tcpd \ ${_telnetd} \ ${_tests} \ - tftpd \ ${_tftp-proxy} \ ulog-helper \ ${_ypxfr} @@ -38,6 +32,18 @@ SUBDIR= ${_atf} \ _atrun= atrun .endif +.if ${MK_BOOTPD} != "no" +SUBDIR+= bootpd +.endif + +.if ${MK_FINGER} != "no" +SUBDIR+= fingerd +.endif + +.if ${MK_FTP} != "no" +SUBDIR+= ftpd +.endif + .if ${MK_MAIL} != "no" _comsat= comsat .endif @@ -63,6 +69,10 @@ _tftp-proxy= tftp-proxy _rtld-elf= rtld-elf .endif +.if ${MK_RBOOTD} != "no" +SUBDIR+= rbootd +.endif + .if ${MK_RCMDS} != "no" _rlogind= rlogind _rshd= rshd @@ -77,10 +87,18 @@ _smrsh= smrsh SUBDIR+= talkd .endif +.if ${MK_TCP_WRAPPERS} != "no" +SUBDIR+= tcpd +.endif + .if ${MK_TELNET} != "no" _telnetd= telnetd .endif +.if ${MK_TFTP} != "no" +SUBDIR+= tftpd +.endif + .if ${MK_TESTS} != "no" _atf= atf _tests= tests Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sun Mar 1 21:47:38 2015 (r279504) +++ stable/10/share/mk/bsd.own.mk Sun Mar 1 22:03:52 2015 (r279505) @@ -260,6 +260,8 @@ __DEFAULT_YES_OPTIONS = \ BLUETOOTH \ BMAKE \ BOOT \ + BOOTPARAMD \ + BOOTPD \ BSD_CPIO \ BSDINSTALL \ BSNMP \ @@ -278,12 +280,14 @@ __DEFAULT_YES_OPTIONS = \ ED_CRYPTO \ EE \ EXAMPLES \ + FINGER \ FLOPPY \ FMTREE \ FORMAT_EXTENSIONS \ FORTH \ FP_LIBC \ FREEBSD_UPDATE \ + FTP \ GAMES \ GCOV \ GDB \ @@ -297,6 +301,7 @@ __DEFAULT_YES_OPTIONS = \ ICONV \ INET \ INET6 \ + INETD \ INFO \ INSTALLLIB \ IPFILTER \ @@ -344,6 +349,7 @@ __DEFAULT_YES_OPTIONS = \ PROFILE \ QUOTAS \ RADIUS_SUPPORT \ + RBOOTD \ RCMDS \ RCS \ RESCUE \ @@ -361,8 +367,11 @@ __DEFAULT_YES_OPTIONS = \ SYSINSTALL \ TALK \ TCSH \ + TCP_WRAPPERS \ TELNET \ TEXTPROC \ + TFTP \ + TIMED \ TOOLCHAIN \ UNBOUND \ USB \ Copied: stable/10/tools/build/options/WITHOUT_BOOTPARAMD (from r278192, head/tools/build/options/WITHOUT_BOOTPARAMD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_BOOTPARAMD Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_BOOTPARAMD) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr bootparamd 8 . Copied: stable/10/tools/build/options/WITHOUT_BOOTPD (from r278192, head/tools/build/options/WITHOUT_BOOTPD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_BOOTPD Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_BOOTPD) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr bootpd 8 . Copied: stable/10/tools/build/options/WITHOUT_FINGER (from r278192, head/tools/build/options/WITHOUT_FINGER) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_FINGER Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_FINGER) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr finger 1 +and +.Xr fingerd 8 . Copied: stable/10/tools/build/options/WITHOUT_FTP (from r278192, head/tools/build/options/WITHOUT_FTP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_FTP Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_FTP) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr ftp 1 +and +.Xr ftpd 8 . Copied: stable/10/tools/build/options/WITHOUT_INETD (from r278192, head/tools/build/options/WITHOUT_INETD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_INETD Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_INETD) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build +.Xr inetd 8 . Copied: stable/10/tools/build/options/WITHOUT_RBOOTD (from r278192, head/tools/build/options/WITHOUT_RBOOTD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_RBOOTD Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_RBOOTD) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr rbootd 8 . Copied: stable/10/tools/build/options/WITHOUT_TCP_WRAPPERS (from r278192, head/tools/build/options/WITHOUT_TCP_WRAPPERS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_TCP_WRAPPERS Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_TCP_WRAPPERS) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr tcpd 8 , +and related utilities. Copied: stable/10/tools/build/options/WITHOUT_TFTP (from r278192, head/tools/build/options/WITHOUT_TFTP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_TFTP Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_TFTP) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr tftp 1 +and +.Xr tftpd 8 . Copied: stable/10/tools/build/options/WITHOUT_TIMED (from r278192, head/tools/build/options/WITHOUT_TIMED) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_TIMED Sun Mar 1 22:03:52 2015 (r279505, copy of r278192, head/tools/build/options/WITHOUT_TIMED) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr timed 8 . Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Sun Mar 1 21:47:38 2015 (r279504) +++ stable/10/usr.bin/Makefile Sun Mar 1 22:03:52 2015 (r279505) @@ -47,12 +47,10 @@ SUBDIR= alias \ fetch \ file \ find \ - finger \ fmt \ fold \ fstat \ fsync \ - ftp \ gcore \ gencat \ getconf \ @@ -159,7 +157,6 @@ SUBDIR= alias \ tcopy \ tee \ ${_tests} \ - tftp \ time \ tip \ top \ @@ -233,6 +230,14 @@ _clang= clang SUBDIR+= ee .endif +.if ${MK_FINGER} != "no" +SUBDIR+= finger +.endif + +.if ${MK_FTP} != "no" +SUBDIR+= ftp +.endif + .if ${MK_GPL_DTC} != "yes" SUBDIR+= dtc .endif @@ -353,6 +358,10 @@ SUBDIR+= colcrt SUBDIR+= ul .endif +.if ${MK_TFTP} != "no" +SUBDIR+= tftp +.endif + .if ${MK_TOOLCHAIN} != "no" SUBDIR+= ar SUBDIR+= c89 Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Sun Mar 1 21:47:38 2015 (r279504) +++ stable/10/usr.sbin/Makefile Sun Mar 1 22:03:52 2015 (r279505) @@ -6,7 +6,6 @@ SUBDIR= adduser \ arp \ binmiscctl \ - bootparamd \ bsdconfig \ cdcontrol \ chkgrp \ @@ -35,7 +34,6 @@ SUBDIR= adduser \ gstat \ i2c \ ifmcstat \ - inetd \ iostat \ kldxref \ mailwrapper \ @@ -83,11 +81,8 @@ SUBDIR= adduser \ spray \ syslogd \ sysrc \ - tcpdchk \ - tcpdmatch \ tcpdrop \ tcpdump \ - timed \ traceroute \ trpt \ tzsetup \ @@ -131,6 +126,10 @@ SUBDIR+= autofs SUBDIR+= bluetooth .endif +.if ${MK_BOOTPARAMD} != "no" +SUBDIR+= bootparamd +.endif + .if ${MK_BSDINSTALL} != "no" SUBDIR+= bsdinstall .endif @@ -180,6 +179,10 @@ SUBDIR+= rtsold SUBDIR+= traceroute6 .endif +.if ${MK_INETD} != "no" +SUBDIR+= inetd +.endif + .if ${MK_IPFW} != "no" SUBDIR+= ipfwpcap .endif @@ -304,10 +307,19 @@ SUBDIR+= praliases SUBDIR+= sendmail .endif +.if ${MK_TCP_WRAPPERS} != "no" +SUBDIR+= tcpdchk +SUBDIR+= tcpdmatch +.endif + .if ${MK_TESTS} != "no" SUBDIR+= tests .endif +.if ${MK_TIMED} != "no" +SUBDIR+= timed +.endif + .if ${MK_TOOLCHAIN} != "no" SUBDIR+= config SUBDIR+= crunch From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 22:07:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E9A1914; Sun, 1 Mar 2015 22:07:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED9FC00; Sun, 1 Mar 2015 22:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21M7uC0005549; Sun, 1 Mar 2015 22:07:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21M7tvx005545; Sun, 1 Mar 2015 22:07:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503012207.t21M7tvx005545@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 1 Mar 2015 22:07:55 +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: r279506 - in stable/10: lib share/mk tools/build/options usr.bin X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 22:07:56 -0000 Author: ngie Date: Sun Mar 1 22:07:54 2015 New Revision: 279506 URL: https://svnweb.freebsd.org/changeset/base/279506 Log: MFC r278193: Add MK_FILE to control whether or not to build file(1), libmagic(3), etc Sponsored by: EMC / Isilon Storage Division Added: stable/10/tools/build/options/WITHOUT_FILE - copied unchanged from r278193, head/tools/build/options/WITHOUT_FILE Modified: stable/10/lib/Makefile stable/10/share/mk/bsd.own.mk stable/10/usr.bin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Sun Mar 1 22:03:52 2015 (r279505) +++ stable/10/lib/Makefile Sun Mar 1 22:07:54 2015 (r279506) @@ -59,7 +59,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libkvm \ ${_libldns} \ liblzma \ - libmagic \ + ${_libmagic} \ libmandoc \ libmemstat \ libmd \ @@ -171,6 +171,10 @@ _libbsnmp= libbsnmp _clang= clang .endif +.if ${MK_FILE} != "no" +_libmagic= libmagic +.endif + .if ${MK_GPIB} != "no" _libgpib= libgpib .endif Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sun Mar 1 22:03:52 2015 (r279505) +++ stable/10/share/mk/bsd.own.mk Sun Mar 1 22:07:54 2015 (r279506) @@ -280,6 +280,7 @@ __DEFAULT_YES_OPTIONS = \ ED_CRYPTO \ EE \ EXAMPLES \ + FILE \ FINGER \ FLOPPY \ FMTREE \ Copied: stable/10/tools/build/options/WITHOUT_FILE (from r278193, head/tools/build/options/WITHOUT_FILE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_FILE Sun Mar 1 22:07:54 2015 (r279506, copy of r278193, head/tools/build/options/WITHOUT_FILE) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr file 1 +and related programs. Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Sun Mar 1 22:03:52 2015 (r279505) +++ stable/10/usr.bin/Makefile Sun Mar 1 22:07:54 2015 (r279506) @@ -45,7 +45,6 @@ SUBDIR= alias \ expand \ false \ fetch \ - file \ find \ fmt \ fold \ @@ -230,6 +229,10 @@ _clang= clang SUBDIR+= ee .endif +.if ${MK_FILE} != "no" +SUBDIR+= file +.endif + .if ${MK_FINGER} != "no" SUBDIR+= finger .endif From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 22:12:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1AA0A74; Sun, 1 Mar 2015 22:12:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 815D1CB0; Sun, 1 Mar 2015 22:12:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21MCP5W009626; Sun, 1 Mar 2015 22:12:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21MCPBl009625; Sun, 1 Mar 2015 22:12:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503012212.t21MCPBl009625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 1 Mar 2015 22:12:25 +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: r279507 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 22:12:25 -0000 Author: ngie Date: Sun Mar 1 22:12:24 2015 New Revision: 279507 URL: https://svnweb.freebsd.org/changeset/base/279507 Log: Regen src.conf(5) Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Sun Mar 1 22:07:54 2015 (r279506) +++ stable/10/share/man/man5/src.conf.5 Sun Mar 1 22:12:24 2015 (r279507) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des +.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd February 13, 2015 +.Dd March 1, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -159,6 +159,14 @@ This option will be removed in due time. .It Va WITHOUT_BOOT .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. +.It Va WITHOUT_BOOTPARAMD +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BOOTPARAMD 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr bootparamd 8 . +.It Va WITHOUT_BOOTPD +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BOOTPD 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr bootpd 8 . .It Va WITHOUT_BSDINSTALL .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BSDINSTALL 278713 2015-02-13 21:24:32Z ngie Set to not build @@ -388,6 +396,17 @@ This includes the device tree compiler ( .Pp It is a default setting on arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. +.It Va WITHOUT_FILE +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FILE 279506 2015-03-01 22:07:54Z ngie +Set to not build +.Xr file 1 +and related programs. +.It Va WITHOUT_FINGER +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FINGER 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr finger 1 +and +.Xr fingerd 8 . .It Va WITHOUT_FLOPPY .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs @@ -414,6 +433,12 @@ without floating-point support. .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr freebsd-update 8 . +.It Va WITHOUT_FTP +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FTP 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr ftp 1 +and +.Xr ftpd 8 . .It Va WITHOUT_GAMES .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru Set to not build games. @@ -540,6 +565,10 @@ When set, it also enforces the following .It Va WITHOUT_INET6_SUPPORT .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build libraries, programs, and kernel modules without IPv6 support. +.It Va WITHOUT_INETD +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INETD 279505 2015-03-01 22:03:52Z ngie +Set to not build +.Xr inetd 8 . .It Va WITHOUT_INET_SUPPORT .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. @@ -946,6 +975,10 @@ Set to not build radius support into var .Xr pam_radius 8 and .Xr ppp 8 . +.It Va WITHOUT_RBOOTD +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RBOOTD 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr rbootd 8 . .It Va WITHOUT_RCMDS .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RCMDS 156932 2006-03-21 07:50:50Z ru Disable building of the @@ -1041,6 +1074,11 @@ Set to not build or install .Xr talk 1 and .Xr talkd 8 . +.It Va WITHOUT_TCP_WRAPPERS +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TCP_WRAPPERS 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr tcpd 8 , +and related utilities. .It Va WITHOUT_TCSH .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TCSH 156932 2006-03-21 07:50:50Z ru Set to not build and install @@ -1070,6 +1108,16 @@ When set, it also enforces the following .It .Va WITHOUT_GROFF .El +.It Va WITHOUT_TFTP +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TFTP 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr tftp 1 +and +.Xr tftpd 8 . +.It Va WITHOUT_TIMED +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TIMED 279505 2015-03-01 22:03:52Z ngie +Set to not build or install +.Xr timed 8 . .It Va WITHOUT_TOOLCHAIN .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TOOLCHAIN 174550 2007-12-12 16:43:17Z ru Set to not install From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 22:32:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14D04FCB; Sun, 1 Mar 2015 22:32:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F35D1E73; Sun, 1 Mar 2015 22:32:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21MWP01019388; Sun, 1 Mar 2015 22:32:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21MWO3P019379; Sun, 1 Mar 2015 22:32:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503012232.t21MWO3P019379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 1 Mar 2015 22:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279508 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2015 22:32:26 -0000 Author: jilles Date: Sun Mar 1 22:32:23 2015 New Revision: 279508 URL: https://svnweb.freebsd.org/changeset/base/279508 Log: sh: Fix more compiler warnings. Modified: head/bin/sh/eval.c head/bin/sh/eval.h head/bin/sh/histedit.c head/bin/sh/jobs.c head/bin/sh/options.c head/bin/sh/var.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Mar 1 22:12:24 2015 (r279507) +++ head/bin/sh/eval.c Sun Mar 1 22:32:23 2015 (r279508) @@ -149,7 +149,7 @@ evalcmd(int argc, char **argv) */ void -evalstring(char *s, int flags) +evalstring(const char *s, int flags) { union node *n; struct stackmark smark; Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Sun Mar 1 22:12:24 2015 (r279507) +++ head/bin/sh/eval.h Sun Mar 1 22:32:23 2015 (r279508) @@ -53,7 +53,7 @@ void reseteval(void); #define EV_TESTED 02 /* exit status is checked; ignore -e flag */ #define EV_BACKCMD 04 /* command executing within back quotes */ -void evalstring(char *, int); +void evalstring(const char *, int); union node; /* BLETCH for ansi C */ void evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Sun Mar 1 22:12:24 2015 (r279507) +++ head/bin/sh/histedit.c Sun Mar 1 22:32:23 2015 (r279508) @@ -338,8 +338,8 @@ histcmd(int argc, char **argv __unused) out1fmt("%5d ", he.num); out1str(he.str); } else { - char *s = pat ? - fc_replace(he.str, pat, repl) : (char *)he.str; + const char *s = pat ? + fc_replace(he.str, pat, repl) : he.str; if (sflg) { if (displayhist) { @@ -477,7 +477,7 @@ bindcmd(int argc, char **argv) if (el == NULL) error("line editing is disabled"); - return (el_parse(el, argc, (const char **)argv)); + return (el_parse(el, argc, __DECONST(const char **, argv))); } #else Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Mar 1 22:12:24 2015 (r279507) +++ head/bin/sh/jobs.c Sun Mar 1 22:32:23 2015 (r279508) @@ -232,7 +232,7 @@ fgcmd(int argc __unused, char **argv __u int -bgcmd(int argc, char **argv) +bgcmd(int argc __unused, char **argv __unused) { struct job *jp; Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sun Mar 1 22:12:24 2015 (r279507) +++ head/bin/sh/options.c Sun Mar 1 22:32:23 2015 (r279508) @@ -465,7 +465,7 @@ getopts(char *optstr, char *optvar, char int ind = 0; int err = 0; char s[10]; - const char *optarg = NULL; + const char *newoptarg = NULL; if ((p = *optptr) == NULL || *p == '\0') { /* Current word is done, advance */ @@ -491,7 +491,7 @@ atend: if (optstr[0] == ':') { s[0] = c; s[1] = '\0'; - optarg = s; + newoptarg = s; } else out2fmt_flush("Illegal option -%c\n", c); @@ -507,7 +507,7 @@ atend: if (optstr[0] == ':') { s[0] = c; s[1] = '\0'; - optarg = s; + newoptarg = s; c = ':'; } else { @@ -519,7 +519,7 @@ atend: if (p == **optnext) (*optnext)++; - optarg = p; + newoptarg = p; p = NULL; } @@ -527,8 +527,8 @@ out: if (*optnext != NULL) ind = *optnext - optfirst + 1; *optptr = p; - if (optarg != NULL) - err |= setvarsafe("OPTARG", optarg, 0); + if (newoptarg != NULL) + err |= setvarsafe("OPTARG", newoptarg, 0); else { INTOFF; err |= unsetvar("OPTARG"); Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun Mar 1 22:12:24 2015 (r279507) +++ head/bin/sh/var.c Sun Mar 1 22:32:23 2015 (r279508) @@ -141,6 +141,7 @@ static const int locale_categories[7] = static int varequal(const char *, const char *); static struct var *find_var(const char *, struct var ***, int *); static int localevar(const char *); +static void setvareq_const(const char *s, int flags); extern char **environ; @@ -183,7 +184,7 @@ initvar(void) setvareq(*envp, VEXPORT|VTEXTFIXED); } } - setvareq("OPTIND=1", VTEXTFIXED); + setvareq_const("OPTIND=1", 0); } /* @@ -389,6 +390,12 @@ setvareq(char *s, int flags) } +static void +setvareq_const(const char *s, int flags) +{ + setvareq(__DECONST(char *, s), flags | VTEXTFIXED); +} + /* * Process a linked list of variable assignments. From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 01:24:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DAEF492; Mon, 2 Mar 2015 01:24:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19717E7; Mon, 2 Mar 2015 01:24:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t221NxCx000283; Mon, 2 Mar 2015 01:23:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t221NxI4000282; Mon, 2 Mar 2015 01:23:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503020123.t221NxI4000282@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 Mar 2015 01:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279509 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 01:24:00 -0000 Author: adrian Date: Mon Mar 2 01:23:59 2015 New Revision: 279509 URL: https://svnweb.freebsd.org/changeset/base/279509 Log: Add a MII mode for SGMII. This appears on the AR934x and later chips, although it's not something that's programmed via the arge0/arge1 register space. It's just cosmetic. Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Sun Mar 1 22:32:23 2015 (r279508) +++ head/sys/mips/atheros/ar71xxreg.h Mon Mar 2 01:23:59 2015 (r279509) @@ -273,6 +273,7 @@ typedef enum { AR71XX_MII_MODE_MII, AR71XX_MII_MODE_RGMII, AR71XX_MII_MODE_RMII, + AR71XX_MII_MODE_SGMII /* not hardware defined, though! */ } ar71xx_mii_mode; /* From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 01:53:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95B5EBA1; Mon, 2 Mar 2015 01:53:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67D896C6; Mon, 2 Mar 2015 01:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t221rlCc014165; Mon, 2 Mar 2015 01:53:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t221rl8u014164; Mon, 2 Mar 2015 01:53:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503020153.t221rl8u014164@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 Mar 2015 01:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279510 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 01:53:48 -0000 Author: adrian Date: Mon Mar 2 01:53:47 2015 New Revision: 279510 URL: https://svnweb.freebsd.org/changeset/base/279510 Log: Add initial QCA955x support to if_arge.c. Tested: * AP135 development board, QCA9558 SoC. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Mon Mar 2 01:23:59 2015 (r279509) +++ head/sys/mips/atheros/if_arge.c Mon Mar 2 01:53:47 2015 (r279510) @@ -92,6 +92,7 @@ MODULE_VERSION(arge, 1); #include #include /* XXX tsk! */ +#include /* XXX tsk! */ #include #include #include @@ -111,7 +112,8 @@ static const char * arge_miicfg_str[] = "GMII", "MII", "RGMII", - "RMII" + "RMII", + "SGMII" }; #ifdef ARGE_DEBUG @@ -319,6 +321,7 @@ arge_reset_mac(struct arge_softc *sc) /* * AR934x (and later) also needs the MDIO block reset. + * XXX should methodize this! */ if (ar71xx_soc == AR71XX_SOC_AR9341 || ar71xx_soc == AR71XX_SOC_AR9342 || @@ -329,6 +332,15 @@ arge_reset_mac(struct arge_softc *sc) reset_reg |= AR934X_RESET_GE1_MDIO; } } + + if (ar71xx_soc == AR71XX_SOC_QCA9556 || + ar71xx_soc == AR71XX_SOC_QCA9558) { + if (sc->arge_mac_unit == 0) { + reset_reg |= QCA955X_RESET_GE0_MDIO; + } else { + reset_reg |= QCA955X_RESET_GE1_MDIO; + } + } ar71xx_device_stop(reset_reg); DELAY(100); ar71xx_device_start(reset_reg); @@ -400,6 +412,8 @@ arge_mdio_get_divider(struct arge_softc case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: + case AR71XX_SOC_QCA9556: + case AR71XX_SOC_QCA9558: table = ar933x_mdio_div_table; ndivs = nitems(ar933x_mdio_div_table); break; @@ -489,6 +503,8 @@ arge_fetch_mdiobus_clock_rate(struct arg case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: + case AR71XX_SOC_QCA9556: + case AR71XX_SOC_QCA9558: return (MAC_MII_CFG_CLOCK_DIV_58); break; default: @@ -793,6 +809,8 @@ arge_attach(device_t dev) case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: + case AR71XX_SOC_QCA9556: + case AR71XX_SOC_QCA9558: ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG1, 0x0010ffff); ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG2, 0x015500aa); break; @@ -1126,6 +1144,8 @@ arge_set_pll(struct arge_softc *sc, int case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: + case AR71XX_SOC_QCA9556: + case AR71XX_SOC_QCA9558: fifo_tx = 0x01f00140; break; case AR71XX_SOC_AR9130: From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 02:08:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ADDAF0C; Mon, 2 Mar 2015 02:08:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86119818; Mon, 2 Mar 2015 02:08:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2228ihe019462; Mon, 2 Mar 2015 02:08:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2228iNr019461; Mon, 2 Mar 2015 02:08:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503020208.t2228iNr019461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 Mar 2015 02:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279511 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 02:08:44 -0000 Author: adrian Date: Mon Mar 2 02:08:43 2015 New Revision: 279511 URL: https://svnweb.freebsd.org/changeset/base/279511 Log: [QCA955x] make the USB EHCI interrupts shareable. There's two EHCI controllers in the QCA955x SoCs - they have different interrupts available via various demux registers, but they both tie to IP3. So for now, allow them to be sharable so they can hang off of IP3. Modified: head/sys/mips/atheros/ar71xx_ehci.c Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Mon Mar 2 01:53:47 2015 (r279510) +++ head/sys/mips/atheros/ar71xx_ehci.c Mon Mar 2 02:08:43 2015 (r279511) @@ -119,7 +119,7 @@ ar71xx_ehci_attach(device_t self) rid = 0; sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq_res == NULL) { device_printf(self, "Could not allocate irq\n"); goto error; From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 02:14:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 021E8FB; Mon, 2 Mar 2015 02:14:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8B188C4; Mon, 2 Mar 2015 02:14:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t222EjRd023668; Mon, 2 Mar 2015 02:14:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t222Ej8J023667; Mon, 2 Mar 2015 02:14:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503020214.t222Ej8J023667@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 Mar 2015 02:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279512 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 02:14:46 -0000 Author: adrian Date: Mon Mar 2 02:14:44 2015 New Revision: 279512 URL: https://svnweb.freebsd.org/changeset/base/279512 Log: Lay some groundwork for having this stuff hang off of AHB rather than the CPU nexus. * Add ahb as a possible bus attachment * Lay a comment down to remind me or whoever else ends up trying to debug why the EEPROM isn't mapped in as to what's going on. Modified: head/sys/dev/ath/if_ath_ahb.c Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Mon Mar 2 02:08:43 2015 (r279511) +++ head/sys/dev/ath/if_ath_ahb.c Mon Mar 2 02:14:44 2015 (r279512) @@ -153,12 +153,24 @@ ath_ahb_attach(device_t dev) eepromsize = ATH_EEPROM_DATA_SIZE * 2; } - rid = 0; device_printf(sc->sc_dev, "eeprom @ %p (%d bytes)\n", (void *) eepromaddr, eepromsize); - psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, (uintptr_t) eepromaddr, - (uintptr_t) eepromaddr + (uintptr_t) (eepromsize - 1), 0, RF_ACTIVE); + /* + * XXX this assumes that the parent device is the nexus + * and will just pass through requests for all of memory. + * + * Later on, when this has to attach off of the actual + * AHB, this won't work. + * + * Ideally this would be done in machdep code in mips/atheros/ + * and it'd expose the EEPROM via the firmware interface, + * so the ath/ath_ahb drivers can be loaded as modules + * after boot-time. + */ + psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, + &rid, (uintptr_t) eepromaddr, + (uintptr_t) eepromaddr + (uintptr_t) (eepromsize - 1), 0, RF_ACTIVE); if (psc->sc_eeprom == NULL) { device_printf(dev, "cannot map eeprom space\n"); goto bad0; @@ -349,6 +361,7 @@ static driver_t ath_ahb_driver = { }; static devclass_t ath_devclass; DRIVER_MODULE(ath, nexus, ath_ahb_driver, ath_devclass, 0, 0); +DRIVER_MODULE(ath, apb, ath_ahb_driver, ath_devclass, 0, 0); MODULE_VERSION(ath, 1); MODULE_DEPEND(ath, wlan, 1, 1, 1); /* 802.11 media layer */ MODULE_DEPEND(ath, if_ath, 1, 1, 1); /* if_ath driver */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 02:24:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2316F2B6; Mon, 2 Mar 2015 02:24:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04611988; Mon, 2 Mar 2015 02:24:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t222Ok9p028358; Mon, 2 Mar 2015 02:24:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t222OkwP028356; Mon, 2 Mar 2015 02:24:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503020224.t222OkwP028356@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 Mar 2015 02:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279513 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 02:24:47 -0000 Author: adrian Date: Mon Mar 2 02:24:46 2015 New Revision: 279513 URL: https://svnweb.freebsd.org/changeset/base/279513 Log: Bring over the initial QCA955x SoC support framework. This is enough to bring up the basic SoC support. What works thus far: * The mips74k core, pll setup, and UART (or else well, stuff would be really difficult..) * both USB 2.0 EHCI controllers * on-board 2GHz 3x3 wifi (the other variant has 2GHz/5GHz wifi on-chip); * arge0 - not yet sure why arge1 isn't firing off interrupts and thus handling traffic, but I will soon figure it out and fix it here. Tested: * AP135 reference design, QCA9558 SoC, pretending to be an 11n 2GHz AP. TODO: * There's an interrupt mux hooking up devices to IP2 and IP3 - but it's not a read-and-clear or write-to-clear register. So, trying to use it naively like I have been ends up with massive interrupt storms. For now the things that share those interrupts can just take them as shared interrupts and try to play nice. * There's two PCIe root complexes /and/ one of them can actually be a PCIe device endpoint. Yes, you heard right. I have to teach the AR724x PCIe bridge code to handle multiple instances with multiple memory/irq regions, and then there'll be RC support, but EP support isn't on my TODO list. * I'm not sure why arge1 isn't up and running. I'll go figure that out soon and fix it here. Thankyou to Qualcomm Atheros for providing me with hardware and an abundance of documentation about these things. Added: head/sys/mips/conf/QCA955X_BASE (contents, props changed) head/sys/mips/conf/QCA955X_BASE.hints (contents, props changed) Added: head/sys/mips/conf/QCA955X_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/QCA955X_BASE Mon Mar 2 02:24:46 2015 (r279513) @@ -0,0 +1,147 @@ +# +# QCA955X_BASE -- Kernel configuration base file for the Qualcomm Atheros +# QCA955x SoC. +# +# This file (and the hints file accompanying it) are not designed to be +# used by themselves. Instead, users of this file should create a kernel +# config file which includes this file (which gets the basic hints), then +# override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) +# +# $FreeBSD$ +# + +machine mips mips +ident QCA955X_BASE +cpu CPU_MIPS74KC +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 + +options BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER + +# options BOOTVERBOSE=10 + +files "../atheros/files.ar71xx" +hints "QCA955X_BASE.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +# makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB +options ALQ + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #InterNETworking +#options NFSCL #Network Filesystem Client +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# Limit IO size +options NBUF=128 + +# Limit UMTX hash size +# options UMTX_NUM_CHAINS=64 + +# PMC +#options HWPMC_HOOKS +#device hwpmc +#device hwpmc_mips24k + +# options NFS_LEGACYRPC +# Debugging for use in -current +#options INVARIANTS +#options INVARIANT_SUPPORT +#options WITNESS +#options WITNESS_SKIPSPIN +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +options NO_FFS_SNAPSHOT # We don't require snapshot support + +# Wireless NIC cards +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +options IEEE80211_SUPPORT_SUPERG +options IEEE80211_ALQ # 802.11 ALQ logging support +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_xauth # 802.11 hostap support + +# ath(4) +device ath # Atheros network device +device ath_rate_sample +device ath_ahb # Atheros host bus glue +options ATH_DEBUG +options ATH_DIAGAPI +option ATH_ENABLE_11N +option AH_DEBUG_ALQ + +#device ath_hal +device ath_ar9300 # AR9330 HAL; no need for the others +option AH_DEBUG +option AH_SUPPORT_AR5416 # 11n HAL support +option AH_SUPPORT_QCA9550 # Chipset support +option AH_DEBUG_ALQ +option AH_AR5416_INTERRUPT_MITIGATION + +device mii +device arge +options ARGE_DEBUG + +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this +device ehci + +device pci +# XXX TODO: need to write a qca955x_pci bridge +# .. since it now handles >1 PCIe bus and the reset +# registers may have changed a bit. +# device ar724x_pci + +device scbus +device umass +device da + +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +device uart +device uart_ar71xx + +device ar71xx_apb +# Until some better interrupt handling is shoehorned into qca955x_apb, +# we'll have to stick to shared interrupts for IP2/IP3 demux. +# device qca955x_apb + +device loop +device ether +device md +device bpf +device random +device if_bridge +device gpio +device gpioled + +#options KTR +#options KTR_MASK=(KTR_INTR) +#options KTR_COMPILE=(KTR_INTR) +#options KTR_VERBOSE Added: head/sys/mips/conf/QCA955X_BASE.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/QCA955X_BASE.hints Mon Mar 2 02:24:46 2015 (r279513) @@ -0,0 +1,79 @@ +# This file (and the kernel config file accompanying it) are not designed +# to be used by themselves. Instead, users of this file should create a +# kernel config file which includes this file (which gets the basic hints), +# then override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) + +# $FreeBSD$ + +hint.apb.0.at="nexus0" +# The default APB is on IP6 (irq4); we need to add +# the two new ones (IP2, IP3) to this and extend +# the irq ranges appropriately. +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# NB: This isn't an ns8250 UART +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +# ehci - on IP3 +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000100 +hint.ehci.0.msize=0x00001000 +hint.ehci.0.irq=1 + +hint.ehci.1.at="nexus0" +hint.ehci.1.maddr=0x1b400100 +hint.ehci.1.msize=0x00001000 +hint.ehci.1.irq=1 + +# PCIe 1: qca955x_int0 (IP2) + +# pci - XXX no maddr/msize, grr! +hint.pcib.0.at="nexus0" +hint.pcib.0.irq=0 + +# XXX TODO: PCIe 1: qca955x_int1 (IP3) + +# IP4 +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 + +# IP5 +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 + +# ath0 - connected via IP2 mux +hint.ath.0.at="nexus0" +hint.ath.0.maddr=0x18100000 +hint.ath.0.msize=0x20000 +hint.ath.0.irq=0 +hint.ath.0.vendor_id=0x168c +hint.ath.0.device_id=0x0039 +# Set this to define where the ath calibration data +# should be fetched from in physical memory. +# hint.ath.0.eepromaddr=0x1fff1000 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" + +# The GPIO function and pin mask is configured per-board +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x18040000 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 02:27:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3EDD3F7; Mon, 2 Mar 2015 02:27:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6177993; Mon, 2 Mar 2015 02:27:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t222RQv5028753; Mon, 2 Mar 2015 02:27:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t222RQTj028751; Mon, 2 Mar 2015 02:27:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503020227.t222RQTj028751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 Mar 2015 02:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279514 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 02:27:27 -0000 Author: adrian Date: Mon Mar 2 02:27:25 2015 New Revision: 279514 URL: https://svnweb.freebsd.org/changeset/base/279514 Log: Add support for the AP135 2.0 reference platform. This is a QCA9558 SoC (2ghz 3x3) with an atheros 11ac PCIe 5GHz 3x3 NIC and an AR8327 gigabit ethernet switch. TODO: * The AR8327 gigabit switch support bugfixes are forthcoming. * 11ac support and 11ac NIC support Added: head/sys/mips/conf/AP135 (contents, props changed) head/sys/mips/conf/AP135.hints (contents, props changed) Added: head/sys/mips/conf/AP135 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP135 Mon Mar 2 02:27:25 2015 (r279514) @@ -0,0 +1,60 @@ +# +# AP135 - the QCA955x SoC reference design +# +# This contains a QCA9558 MIPS74k SoC with on-board 3x3 2GHz wifi, +# 128MiB RAM, an AR8327 5-port gigabit ethernet switch and +# a QCA 11ac 5GHz AP NIC. +# +# The to things not currently support are the QCA 11ac NIC and +# PCIe host controllers - there's two of them, and the existing +# PCIe code here doesn't support that just yet. +# +# $FreeBSD$ +# + +# Include the default QCA955x parameters +include "QCA955X_BASE" + +ident AP135 + +# Override hints with board values +hints "AP135.hints" + +# Force the board memory - the base AP135 has 128MB RAM +options AR71XX_REALMEM=(128*1024*1024) + +# i2c GPIO bus +#device gpioiic +#device iicbb +#device iicbus +#device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +#options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# yes, this board has a PCI connected atheros device +device ath_pci +options AR71XX_ATH_EEPROM +device firmware # Used by the above +options ATH_EEPROM_FIRMWARE + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" Added: head/sys/mips/conf/AP135.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP135.hints Mon Mar 2 02:27:25 2015 (r279514) @@ -0,0 +1,166 @@ +# This is a placeholder until the hardware support is complete. + +# I'm assuming this is an AP135-020. The AP136-010 in openwrt has +# the ethernet ports wired up to the switch in the reverse way. + +# $FreeBSD$ + +# QCA955X_ETH_CFG_RGMII_EN (1 << 0) +hint.qca955x_gmac.0.gmac_cfg=0x1 + +# mdiobus0 on arge0 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# AR8327 - connected via mdiobus0 on arge0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 # definitely not the internal switch! +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 # all ports are PHYs +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=0 # not needed +hint.arswitch.0.is_gmii=0 # not needed + +# This is where it gets a bit odd. port 0 and port 6 are CPU ports. +# The current code only supports one CPU port. So hm, what should +# we do to hook PAD6 up to be RGMII but a PHY, not a MAC? + +# The other trick - how do we get arge1 (hooked up to GMAC0) to work? +# That's currently supposed to be hooked up to CPU port 0. + +# Other AR8327 configuration parameters + +# AP136-020 parameters + +# GMAC0 AR8327 -> GMAC1 (arge1) SoC, SGMII + +# AR8327_PAD_MAC_SGMII +hint.arswitch.0.pad.0.mode=3 +#hint.arswitch.0.pad.0.rxclk_delay_sel=0 +hint.arswitch.0.pad.0.sgmii_delay_en=1 + +# GMAC6 AR8327 -> GMAC0 (arge0) SoC, RGMII + +# AR8327_PAD_MAC_RGMII +# XXX I think this hooks it up to the internal MAC6 +hint.arswitch.0.pad.6.mode=6 +hint.arswitch.0.pad.6.txclk_delay_en=1 +hint.arswitch.0.pad.6.rxclk_delay_en=1 +# AR8327_CLK_DELAY_SEL1 +hint.arswitch.0.pad.6.txclk_delay_sel=1 +# AR8327_CLK_DELAY_SEL2 +hint.arswitch.0.pad.6.rxclk_delay_sel=2 + +# XXX there's no LED management just yet! +hint.arswitch.0.led.ctrl0=0x00000000 +hint.arswitch.0.led.ctrl1=0xc737c737 +hint.arswitch.0.led.ctrl2=0x00000000 +hint.arswitch.0.led.ctrl3=0x00c30c00 +hint.arswitch.0.led.open_drain=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.0.force_link=1 +hint.arswitch.0.port.0.speed=1000 +hint.arswitch.0.port.0.duplex=1 +hint.arswitch.0.port.0.txpause=1 +hint.arswitch.0.port.0.rxpause=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.6.force_link=1 +hint.arswitch.0.port.6.speed=1000 +hint.arswitch.0.port.6.duplex=1 +hint.arswitch.0.port.6.txpause=1 +hint.arswitch.0.port.6.rxpause=1 + +# arge0 - hooked up to AR8327 GMAC6, RGMII +hint.arge.0.phymask=0x10 +hint.arge.0.miimode=3 # RGMII +hint.arge.0.pll_1000=0x56000000 + +# MAC for arge0 is the first 6 bytes of the ART +hint.arge.0.eeprommac=0x1fff0000 + +# arge1 - lock up to 1000/full +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 +hint.arge.1.miimode=5 # SGMII +hint.arge.1.pll_1000=0x03000101 + +# MAC for arge1 is the second 6 bytes of the ART +hint.arge.1.eeprommac=0x1fff0006 + +# ath0: Where the ART is - last 64k in the flash +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# ath1: it's different; it's a PCIe attached device, so +# we instead need to teach the PCIe bridge code about it +# (ie, the 'early pci fixup' stuff that programs the PCIe +# host registers on the NIC) and then we teach ath where +# to find it. + +# ath1 hint - pcie slot 0 +hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff4000 +hint.pcib.0.bus.0.0.0.ath_fixup_size=16384 + +# ath0 - eeprom comes from here +hint.ath.1.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + +# flash layout: +# +# bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),8256k(mib0),64k(ART) + + +# 256KiB u-boot +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00040000 # 256k u-boot +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +# 64KiB u-boot-env +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 # 64k u-boot-env +hint.map.1.name="u-boot-env" +hint.map.1.readonly=1 + +# 6336KiB rootfs +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00050000 +hint.map.2.end=0x00680000 # 6336k rootfs +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +# 1344KiB uImage +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00680000 +hint.map.3.end=0x007d0000 # 1408k uImage, 64k off the end.. +hint.map.3.name="uImage" +hint.map.3.readonly=1 + +# 64KiB cfg +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007d0000 +hint.map.4.end=0x007e0000 +hint.map.4.name="cfg" +hint.map.4.readonly=0 + +# 8256 KiB mib0 +hint.map.5.at="flash/spi0" +hint.map.5.start=0x007e0000 +hint.map.5.end=0x00ff0000 # 64k mib0 +hint.map.5.name="mib0" +hint.map.5.readonly=1 + +# 64KiB ART +hint.map.6.at="flash/spi0" +hint.map.6.start=0x007f0000 +hint.map.6.end=0x01000000 # 64k ART +hint.map.6.name="ART" +hint.map.6.readonly=1 From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 07:51:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B563E471; Mon, 2 Mar 2015 07:51:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86A9EB41; Mon, 2 Mar 2015 07:51:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t227pFLW095882; Mon, 2 Mar 2015 07:51:15 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t227pF66095881; Mon, 2 Mar 2015 07:51:15 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503020751.t227pF66095881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 2 Mar 2015 07:51:15 +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: r279516 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 07:51:15 -0000 Author: ae Date: Mon Mar 2 07:51:14 2015 New Revision: 279516 URL: https://svnweb.freebsd.org/changeset/base/279516 Log: MFC r279206: In some cases soreceive_dgram() can return no data, but has control message. This can happen when application is sending packets too big for the path MTU and recvmsg() will return zero (indicating no data) but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU. Remove KASSERT() which does NULL pointer dereference in such case. Also call m_freem() only when m isn't NULL. MFC r279209: soreceive_generic() still has similar KASSERT(), therefore instead of remove KASSERT(), change it to check mbuf isn't NULL. PR: 197882 Sponsored by: Yandex LLC Modified: stable/10/sys/kern/uipc_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_socket.c ============================================================================== --- stable/10/sys/kern/uipc_socket.c Mon Mar 2 07:37:01 2015 (r279515) +++ stable/10/sys/kern/uipc_socket.c Mon Mar 2 07:51:14 2015 (r279516) @@ -2189,7 +2189,8 @@ soreceive_dgram(struct socket *so, struc * Process one or more MT_CONTROL mbufs present before any data mbufs * in the first mbuf chain on the socket buffer. We call into the * protocol to perform externalization (or freeing if controlp == - * NULL). + * NULL). In some cases there can be only MT_CONTROL mbufs without + * MT_DATA mbufs. */ if (m->m_type == MT_CONTROL) { struct mbuf *cm = NULL, *cmn; @@ -2219,8 +2220,8 @@ soreceive_dgram(struct socket *so, struc cm = cmn; } } - KASSERT(m->m_type == MT_DATA, ("soreceive_dgram: !data")); - + KASSERT(m == NULL || m->m_type == MT_DATA, + ("soreceive_dgram: !data")); while (m != NULL && uio->uio_resid > 0) { len = uio->uio_resid; if (len > m->m_len) @@ -2237,9 +2238,10 @@ soreceive_dgram(struct socket *so, struc m->m_len -= len; } } - if (m != NULL) + if (m != NULL) { flags |= MSG_TRUNC; - m_freem(m); + m_freem(m); + } if (flagsp != NULL) *flagsp |= flags; return (0); From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 08:00:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3F89633; Mon, 2 Mar 2015 08:00:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C568EC12; Mon, 2 Mar 2015 08:00:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22800BI098249; Mon, 2 Mar 2015 08:00:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2280008098248; Mon, 2 Mar 2015 08:00:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503020800.t2280008098248@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 2 Mar 2015 08:00:00 +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: r279517 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 08:00:01 -0000 Author: ae Date: Mon Mar 2 08:00:00 2015 New Revision: 279517 URL: https://svnweb.freebsd.org/changeset/base/279517 Log: MFC r279206: In some cases soreceive_dgram() can return no data, but has control message. This can happen when application is sending packets too big for the path MTU and recvmsg() will return zero (indicating no data) but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU. Remove KASSERT() which does NULL pointer dereference in such case. Also call m_freem() only when m isn't NULL. MFC r279209: soreceive_generic() still has similar KASSERT(), therefore instead of remove KASSERT(), change it to check mbuf isn't NULL. PR: 197882 Sponsored by: Yandex LLC Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Mon Mar 2 07:51:14 2015 (r279516) +++ stable/9/sys/kern/uipc_socket.c Mon Mar 2 08:00:00 2015 (r279517) @@ -2311,7 +2311,8 @@ soreceive_dgram(struct socket *so, struc * Process one or more MT_CONTROL mbufs present before any data mbufs * in the first mbuf chain on the socket buffer. We call into the * protocol to perform externalization (or freeing if controlp == - * NULL). + * NULL). In some cases there can be only MT_CONTROL mbufs without + * MT_DATA mbufs. */ if (m->m_type == MT_CONTROL) { struct mbuf *cm = NULL, *cmn; @@ -2341,8 +2342,8 @@ soreceive_dgram(struct socket *so, struc cm = cmn; } } - KASSERT(m->m_type == MT_DATA, ("soreceive_dgram: !data")); - + KASSERT(m == NULL || m->m_type == MT_DATA, + ("soreceive_dgram: !data")); while (m != NULL && uio->uio_resid > 0) { len = uio->uio_resid; if (len > m->m_len) @@ -2359,9 +2360,10 @@ soreceive_dgram(struct socket *so, struc m->m_len -= len; } } - if (m != NULL) + if (m != NULL) { flags |= MSG_TRUNC; - m_freem(m); + m_freem(m); + } if (flagsp != NULL) *flagsp |= flags; return (0); From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 09:02:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D0E0165; Mon, 2 Mar 2015 09:02:37 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC25283; Mon, 2 Mar 2015 09:02:36 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t2292ZsY003205 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 2 Mar 2015 01:02:36 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54F42726.3000602@freebsd.org> Date: Mon, 02 Mar 2015 01:02:30 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r279361 - in head: sys/kern sys/sys usr.sbin/jail References: <201502271628.t1RGSurE067472@svn.freebsd.org> In-Reply-To: <201502271628.t1RGSurE067472@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 09:02:37 -0000 On 2/27/15 8:28 AM, Ian Lepore wrote: > > Log: > Allow the kern.osrelease and kern.osreldate sysctl values to be set in a > jail's creation parameters. This allows the kernel version to be reliably > spoofed within the jail whether examined directly with sysctl or > indirectly with the uname -r and -K options. > [..] > There is no sanity or range checking, other than disallowing an empty > release string or a zero release date, by design. The system > administrator is trusted to set sane values. Setting values that are > newer than the actual running kernel will likely cause compatibility > problems. > I would think that you could at set time ensure that only older releases were allowed.. I'm not sure what the rule would be with sub-sub-jails.. older than parent, or older than base system..? From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 09:15:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 004A5689; Mon, 2 Mar 2015 09:15:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFC5A3FF; Mon, 2 Mar 2015 09:15:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t229FpiX041489; Mon, 2 Mar 2015 09:15:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t229Fpxo041488; Mon, 2 Mar 2015 09:15:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503020915.t229Fpxo041488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 2 Mar 2015 09:15:51 +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: r279518 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 09:15:52 -0000 Author: kib Date: Mon Mar 2 09:15:50 2015 New Revision: 279518 URL: https://svnweb.freebsd.org/changeset/base/279518 Log: MFC r279367: Fix typo. Modified: stable/10/lib/libc/gen/_spinlock_stub.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/_spinlock_stub.c ============================================================================== --- stable/10/lib/libc/gen/_spinlock_stub.c Mon Mar 2 08:00:00 2015 (r279517) +++ stable/10/lib/libc/gen/_spinlock_stub.c Mon Mar 2 09:15:50 2015 (r279518) @@ -59,7 +59,7 @@ _spinlock(spinlock_t *lck) } -#pragma weak _spinlock +#pragma weak _spinunlock void _spinunlock(spinlock_t *lck) { From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 11:48:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EF259DB; Mon, 2 Mar 2015 11:48:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68EC2915; Mon, 2 Mar 2015 11:48:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22Bm16Z011803; Mon, 2 Mar 2015 11:48:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22Bm1ED011800; Mon, 2 Mar 2015 11:48:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021148.t22Bm1ED011800@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 11:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279519 - in head/contrib: diff/doc gperf/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 11:48:01 -0000 Author: bapt Date: Mon Mar 2 11:48:00 2015 New Revision: 279519 URL: https://svnweb.freebsd.org/changeset/base/279519 Log: Convert texinfo to mdoc(7) using texi2mdoc Added: head/contrib/diff/doc/diff.7 (contents, props changed) head/contrib/gperf/doc/gperf.7 (contents, props changed) Added: head/contrib/diff/doc/diff.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/diff/doc/diff.7 Mon Mar 2 11:48:00 2015 (r279519) @@ -0,0 +1,6287 @@ +.Dd 2015-03-02 +.Dt DIFF 7 +.Os +.Sh NAME +.Nm diff +.Nd Comparing and Merging Files +.Sh Comparing and Merging Files +.Sh Overview +Computer users often find occasion to ask how two files differ. Perhaps one +file is a newer version of the other file. Or maybe the two files started +out as identical copies but were changed by different people. +.Pp +You can use the +.Xr diff +command to show differences between two files, or each corresponding file +in two directories. +.Xr diff +outputs differences between files line by line in any of several formats, +selectable by command line options. This set of differences is often called +a +.Em diff +or +.Em patch . +For files that are identical, +.Xr diff +normally produces no output; for binary (non-text) files, +.Xr diff +normally reports only that they are different. +.Pp +You can use the +.Xr cmp +command to show the byte and line numbers where two files differ. +.Xr cmp +can also show all the bytes that differ between the two files, side by side. +A way to compare two files character by character is the Emacs command +.Li M-x compare-windows . +See Section.Dq Other Window , +for more information on that command. +.Pp +You can use the +.Xr diff3 +command to show differences among three files. When two people have made independent +changes to a common original, +.Xr diff3 +can report the differences between the original and the two changed versions, +and can produce a merged file that contains both persons' changes together +with warnings about conflicts. +.Pp +You can use the +.Xr sdiff +command to merge two files interactively. +.Pp +You can use the set of differences produced by +.Xr diff +to distribute updates to text files (such as program source code) to other +people. This method is especially useful when the differences are small compared +to the complete files. Given +.Xr diff +output, you can use the +.Xr patch +program to update, or +.Em patch , +a copy of the file. If you think of +.Xr diff +as subtracting one file from another to produce their difference, you can +think of +.Xr patch +as adding the difference to one file to reproduce the other. +.Pp +This manual first concentrates on making diffs, and later shows how to use +diffs to update files. +.Pp +GNU +.Xr diff +was written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and +Len Tower. Wayne Davison designed and implemented the unified output format. +The basic algorithm is described by Eugene W. Myers in \(lqAn O(ND) Difference +Algorithm and its Variations\(rq, +.Em Algorithmica +Vol. 1 No. 2, 1986, pp. 251--266; and in \(lqA File Comparison Program\(rq, Webb Miller +and Eugene W. Myers, +.Em Software---Practice and Experience +Vol. 15 No. 11, 1985, pp. 1025--1040. The algorithm was independently discovered +as described by E. Ukkonen in \(lqAlgorithms for Approximate String Matching\(rq, +.Em Information and Control +Vol. 64, 1985, pp. 100--118. Unless the +.Op --minimal +option is used, +.Xr diff +uses a heuristic by Paul Eggert that limits the cost to O(N^1.5 log N) at +the price of producing suboptimal output for large inputs with many differences. +Related algorithms are surveyed by Alfred V. Aho in section 6.3 of \(lqAlgorithms +for Finding Patterns in Strings\(rq, +.Em Handbook of Theoretical Computer Science +(Jan Van Leeuwen, ed.), Vol. A, +.Em Algorithms and Complexity , +Elsevier/MIT Press, 1990, pp. 255--300. +.Pp +GNU +.Xr diff3 +was written by Randy Smith. GNU +.Xr sdiff +was written by Thomas Lord. GNU +.Xr cmp +was written by Torbj\(:orn Granlund and David MacKenzie. +.Pp +GNU +.Xr patch +was written mainly by Larry Wall and Paul Eggert; several GNU enhancements +were contributed by Wayne Davison and David MacKenzie. Parts of this manual +are adapted from a manual page written by Larry Wall, with his permission. +.Pp +.Sh What Comparison Means +There are several ways to think about the differences between two files. One +way to think of the differences is as a series of lines that were deleted +from, inserted in, or changed in one file to produce the other file. +.Xr diff +compares two files line by line, finds groups of lines that differ, and reports +each group of differing lines. It can report the differing lines in several +formats, which have different purposes. +.Pp +GNU +.Xr diff +can show whether files are different without detailing the differences. It +also provides ways to suppress certain kinds of differences that are not important +to you. Most commonly, such differences are changes in the amount of white +space between words or lines. +.Xr diff +also provides ways to suppress differences in alphabetic case or in lines +that match a regular expression that you provide. These options can accumulate; +for example, you can ignore changes in both white space and alphabetic case. +.Pp +Another way to think of the differences between two files is as a sequence +of pairs of bytes that can be either identical or different. +.Xr cmp +reports the differences between two files byte by byte, instead of line by +line. As a result, it is often more useful than +.Xr diff +for comparing binary files. For text files, +.Xr cmp +is useful mainly when you want to know only whether two files are identical, +or whether one file is a prefix of the other. +.Pp +To illustrate the effect that considering changes byte by byte can have compared +with considering them line by line, think of what happens if a single newline +character is added to the beginning of a file. If that file is then compared +with an otherwise identical file that lacks the newline at the beginning, +.Xr diff +will report that a blank line has been added to the file, while +.Xr cmp +will report that almost every byte of the two files differs. +.Pp +.Xr diff3 +normally compares three input files line by line, finds groups of lines that +differ, and reports each group of differing lines. Its output is designed +to make it easy to inspect two different sets of changes to the same file. +.Pp +.Ss Hunks +When comparing two files, +.Xr diff +finds sequences of lines common to both files, interspersed with groups of +differing lines called +.Em hunks . +Comparing two identical files yields one sequence of common lines and no hunks, +because no lines differ. Comparing two entirely different files yields no +common lines and one large hunk that contains all lines of both files. In +general, there are many ways to match up lines between two given files. +.Xr diff +tries to minimize the total hunk size by finding large sequences of common +lines interspersed with small hunks of differing lines. +.Pp +For example, suppose the file +.Pa F +contains the three lines +.Li a , +.Li b , +.Li c , +and the file +.Pa G +contains the same three lines in reverse order +.Li c , +.Li b , +.Li a . +If +.Xr diff +finds the line +.Li c +as common, then the command +.Li diff F G +produces this output: +.Pp +.Bd -literal -offset indent +1,2d0 +< a +< b +3a2,3 +> b +> a +.Ed +.Pp +But if +.Xr diff +notices the common line +.Li b +instead, it produces this output: +.Pp +.Bd -literal -offset indent +1c1 +< a +--- +> c +3c3 +< c +--- +> a +.Ed +.Pp +It is also possible to find +.Li a +as the common line. +.Xr diff +does not always find an optimal matching between the files; it takes shortcuts +to run faster. But its output is usually close to the shortest possible. You +can adjust this tradeoff with the +.Op -d +or +.Op --minimal +option (see Section +.Dq diff Performance ) . +.Pp +.Ss Suppressing Differences in Blank and Tab Spacing +The +.Op -E +or +.Op --ignore-tab-expansion +option ignores the distinction between tabs and spaces on input. A tab is +considered to be equivalent to the number of spaces to the next tab stop (see Section +.Dq Tabs ) . +.Pp +The +.Op -b +or +.Op --ignore-space-change +option is stronger. It ignores white space at line end, and considers all +other sequences of one or more white space characters within a line to be +equivalent. With this option, +.Xr diff +considers the following two lines to be equivalent, where +.Li $ +denotes the line end: +.Pp +.Bd -literal -offset indent +Here lyeth muche rychnesse in lytell space. -- John Heywood$ +Here lyeth muche rychnesse in lytell space. -- John Heywood $ +.Ed +.Pp +The +.Op -w +or +.Op --ignore-all-space +option is stronger still. It ignores differences even if one line has white +space where the other line has none. +.Em White space +characters include tab, newline, vertical tab, form feed, carriage return, +and space; some locales may define additional characters to be white space. +With this option, +.Xr diff +considers the following two lines to be equivalent, where +.Li $ +denotes the line end and +.Li ^M +denotes a carriage return: +.Pp +.Bd -literal -offset indent +Here lyeth muche rychnesse in lytell space.-- John Heywood$ + He relyeth much erychnes seinly tells pace. --John Heywood ^M$ +.Ed +.Pp +.Ss Suppressing Differences Whose Lines Are All Blank +The +.Op -B +or +.Op --ignore-blank-lines +option ignores changes that consist entirely of blank lines. With this option, +for example, a file containing +.Bd -literal -offset indent +1. A point is that which has no part. + +2. A line is breadthless length. +-- Euclid, The Elements, I +.Ed +is considered identical to a file containing +.Bd -literal -offset indent +1. A point is that which has no part. +2. A line is breadthless length. + + +-- Euclid, The Elements, I +.Ed +.Pp +Normally this option affects only lines that are completely empty, but if +you also specify the +.Op -b +or +.Op --ignore-space-change +option, or the +.Op -w +or +.Op --ignore-all-space +option, lines are also affected if they look empty but contain white space. +In other words, +.Op -B +is equivalent to +.Li -I '^$' +by default, but it is equivalent to +.Op -I '^[[:space:]]*$' +if +.Op -b +or +.Op -w +is also specified. +.Pp +.Ss Suppressing Differences Whose Lines All Match a Regular Expression +To ignore insertions and deletions of lines that match a +.Xr grep +-style regular expression, use the +.Op -I Va regexp +or +.Op --ignore-matching-lines= Va regexp +option. You should escape regular expressions that contain shell metacharacters +to prevent the shell from expanding them. For example, +.Li diff -I '^[[:digit:]]' +ignores all changes to lines beginning with a digit. +.Pp +However, +.Op -I +only ignores the insertion or deletion of lines that contain the regular expression +if every changed line in the hunk---every insertion and every deletion---matches +the regular expression. In other words, for each nonignorable change, +.Xr diff +prints the complete set of changes in its vicinity, including the ignorable +ones. +.Pp +You can specify more than one regular expression for lines to ignore by using +more than one +.Op -I +option. +.Xr diff +tries to match each line against each regular expression. +.Pp +.Ss Suppressing Case Differences +GNU +.Xr diff +can treat lower case letters as equivalent to their upper case counterparts, +so that, for example, it considers +.Li Funky Stuff , +.Li funky STUFF , +and +.Li fUNKy stuFf +to all be the same. To request this, use the +.Op -i +or +.Op --ignore-case +option. +.Pp +.Ss Summarizing Which Files Differ +When you only want to find out whether files are different, and you don't +care what the differences are, you can use the summary output format. In this +format, instead of showing the differences between the files, +.Xr diff +simply reports whether files differ. The +.Op -q +or +.Op --brief +option selects this output format. +.Pp +This format is especially useful when comparing the contents of two directories. +It is also much faster than doing the normal line by line comparisons, because +.Xr diff +can stop analyzing the files as soon as it knows that there are any differences. +.Pp +You can also get a brief indication of whether two files differ by using +.Xr cmp . +For files that are identical, +.Xr cmp +produces no output. When the files differ, by default, +.Xr cmp +outputs the byte and line number where the first difference occurs, or reports +that one file is a prefix of the other. You can use the +.Op -s , +.Op --quiet , +or +.Op --silent +option to suppress that information, so that +.Xr cmp +produces no output and reports whether the files differ using only its exit +status (see Section +.Dq Invoking cmp ) . +.Pp +Unlike +.Xr diff , +.Xr cmp +cannot compare directories; it can only compare two files. +.Pp +.Ss Binary Files and Forcing Text Comparisons +If +.Xr diff +thinks that either of the two files it is comparing is binary (a non-text +file), it normally treats that pair of files much as if the summary output +format had been selected (see Section +.Dq Brief ) , +and reports only that the binary files are different. This is because line +by line comparisons are usually not meaningful for binary files. +.Pp +.Xr diff +determines whether a file is text or binary by checking the first few bytes +in the file; the exact number of bytes is system dependent, but it is typically +several thousand. If every byte in that part of the file is non-null, +.Xr diff +considers the file to be text; otherwise it considers the file to be binary. +.Pp +Sometimes you might want to force +.Xr diff +to consider files to be text. For example, you might be comparing text files +that contain null characters; +.Xr diff +would erroneously decide that those are non-text files. Or you might be comparing +documents that are in a format used by a word processing system that uses +null characters to indicate special formatting. You can force +.Xr diff +to consider all files to be text files, and compare them line by line, by +using the +.Op -a +or +.Op --text +option. If the files you compare using this option do not in fact contain +text, they will probably contain few newline characters, and the +.Xr diff +output will consist of hunks showing differences between long lines of whatever +characters the files contain. +.Pp +You can also force +.Xr diff +to report only whether files differ (but not how). Use the +.Op -q +or +.Op --brief +option for this. +.Pp +Normally, differing binary files count as trouble because the resulting +.Xr diff +output does not capture all the differences. This trouble causes +.Xr diff +to exit with status 2. However, this trouble cannot occur with the +.Op -a +or +.Op --text +option, or with the +.Op -q +or +.Op --brief +option, as these options both cause +.Xr diff +to generate a form of output that represents differences as requested. +.Pp +In operating systems that distinguish between text and binary files, +.Xr diff +normally reads and writes all data as text. Use the +.Op --binary +option to force +.Xr diff +to read and write binary data instead. This option has no effect on a POSIX-compliant +system like GNU or traditional Unix. However, many personal computer operating +systems represent the end of a line with a carriage return followed by a newline. +On such systems, +.Xr diff +normally ignores these carriage returns on input and generates them at the +end of each output line, but with the +.Op --binary +option +.Xr diff +treats each carriage return as just another input character, and does not +generate a carriage return at the end of each output line. This can be useful +when dealing with non-text files that are meant to be interchanged with POSIX-compliant +systems. +.Pp +The +.Op --strip-trailing-cr +causes +.Xr diff +to treat input lines that end in carriage return followed by newline as if +they end in plain newline. This can be useful when comparing text that is +imperfectly imported from many personal computer operating systems. This option +affects how lines are read, which in turn affects how they are compared and +output. +.Pp +If you want to compare two files byte by byte, you can use the +.Xr cmp +program with the +.Op -l +or +.Op --verbose +option to show the values of each differing byte in the two files. With GNU +.Xr cmp , +you can also use the +.Op -b +or +.Op --print-bytes +option to show the ASCII representation of those bytes.See Section +.Dq Invoking cmp , +for more information. +.Pp +If +.Xr diff3 +thinks that any of the files it is comparing is binary (a non-text file), +it normally reports an error, because such comparisons are usually not useful. +.Xr diff3 +uses the same test as +.Xr diff +to decide whether a file is binary. As with +.Xr diff , +if the input files contain a few non-text bytes but otherwise are like text +files, you can force +.Xr diff3 +to consider all files to be text files and compare them line by line by using +the +.Op -a +or +.Op --text +option. +.Pp +.Sh Xr diff Output Formats +.Xr diff +has several mutually exclusive options for output format. The following sections +describe each format, illustrating how +.Xr diff +reports the differences between two sample input files. +.Pp +.Ss Two Sample Input Files +Here are two sample files that we will use in numerous examples to illustrate +the output of +.Xr diff +and how various options can change it. +.Pp +This is the file +.Pa lao : +.Pp +.Bd -literal -offset indent +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +The Nameless is the origin of Heaven and Earth; +The Named is the mother of all things. +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. +.Ed +.Pp +This is the file +.Pa tzu : +.Pp +.Bd -literal -offset indent +The Nameless is the origin of Heaven and Earth; +The named is the mother of all things. + +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +.Ed +.Pp +In this example, the first hunk contains just the first two lines of +.Pa lao , +the second hunk contains the fourth line of +.Pa lao +opposing the second and third lines of +.Pa tzu , +and the last hunk contains just the last three lines of +.Pa tzu . +.Pp +.Ss Showing Differences in Their Context +Usually, when you are looking at the differences between files, you will also +want to see the parts of the files near the lines that differ, to help you +understand exactly what has changed. These nearby parts of the files are called +the +.Em context . +.Pp +GNU +.Xr diff +provides two output formats that show context around the differing lines: +.Em context format +and +.Em unified format . +It can optionally show in which function or section of the file the differing +lines are found. +.Pp +If you are distributing new versions of files to other people in the form +of +.Xr diff +output, you should use one of the output formats that show context so that +they can apply the diffs even if they have made small changes of their own +to the files. +.Xr patch +can apply the diffs in this case by searching in the files for the lines of +context around the differing lines; if those lines are actually a few lines +away from where the diff says they are, +.Xr patch +can adjust the line numbers accordingly and still apply the diff correctly.See Section +.Dq Imperfect , +for more information on using +.Xr patch +to apply imperfect diffs. +.Pp +.Em Context Format +.Pp +The context output format shows several lines of context around the lines +that differ. It is the standard format for distributing updates to source +code. +.Pp +To select this output format, use the +.Op -C Va lines , +.Op --context[= Va lines] , +or +.Op -c +option. The argument +.Va lines +that some of these options take is the number of lines of context to show. +If you do not specify +.Va lines , +it defaults to three. For proper operation, +.Xr patch +typically needs at least two lines of context. +.Pp +.No An Example of Context Format +.Pp +Here is the output of +.Li diff -c lao tzu +(see Section +.Dq Sample diff Input , +for the complete contents of the two files). Notice that up to three lines +that are not different are shown around each line that is different; they +are the context lines. Also notice that the first two hunks have run together, +because their contents overlap. +.Pp +.Bd -literal -offset indent +*** lao 2002-02-21 23:30:39.942229878 -0800 +--- tzu 2002-02-21 23:30:50.442260588 -0800 +*************** +*** 1,7 **** +- The Way that can be told of is not the eternal Way; +- The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +! The Named is the mother of all things. + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +--- 1,6 ---- + The Nameless is the origin of Heaven and Earth; +! The named is the mother of all things. +! + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +*************** +*** 9,11 **** +--- 8,13 ---- + The two are the same, + But after they are produced, + they have different names. ++ They both may be called deep and profound. ++ Deeper and more profound, ++ The door of all subtleties! +.Ed +.Pp +.No An Example of Context Format with Less Context +.Pp +Here is the output of +.Li diff -C 1 lao tzu +(see Section +.Dq Sample diff Input , +for the complete contents of the two files). Notice that at most one context +line is reported here. +.Pp +.Bd -literal -offset indent +*** lao 2002-02-21 23:30:39.942229878 -0800 +--- tzu 2002-02-21 23:30:50.442260588 -0800 +*************** +*** 1,5 **** +- The Way that can be told of is not the eternal Way; +- The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +! The Named is the mother of all things. + Therefore let there always be non-being, +--- 1,4 ---- + The Nameless is the origin of Heaven and Earth; +! The named is the mother of all things. +! + Therefore let there always be non-being, +*************** +*** 11 **** +--- 10,13 ---- + they have different names. ++ They both may be called deep and profound. ++ Deeper and more profound, ++ The door of all subtleties! +.Ed +.Pp +.No Detailed Description of Context Format +.Pp +The context output format starts with a two-line header, which looks like +this: +.Pp +.Bd -literal -offset indent +*** from-file from-file-modification-time +--- to-file to-file-modification time +.Ed +.Pp +The time stamp normally looks like +.Li 2002-02-21 23:30:39.942229878 -0800 +to indicate the date, time with fractional seconds, and time zone in +.Lk ftp://ftp.isi.edu/in-notes/rfc2822.txt . +(The fractional seconds are omitted on hosts that do not support fractional +time stamps.) However, a traditional time stamp like +.Li Thu Feb 21 23:30:39 2002 +is used if the +.Ev LC_TIME +locale category is either +.Li C +or +.Li POSIX . +.Pp +You can change the header's content with the +.Op --label= Va label +option; see Alternate Names. +.Pp +Next come one or more hunks of differences; each hunk shows one area where +the files differ. Context format hunks look like this: +.Pp +.Bd -literal -offset indent +*************** +*** from-file-line-numbers **** + from-file-line + from-file-line... +--- to-file-line-numbers ---- + to-file-line + to-file-line... +.Ed +.Pp +If a hunk contains two or more lines, its line numbers look like +.Li Va start, Va end . +Otherwise only its end line number appears. An empty hunk is considered to +end at the line that precedes the hunk. +.Pp +The lines of context around the lines that differ start with two space characters. +The lines that differ between the two files start with one of the following +indicator characters, followed by a space character: +.Pp +.Bl -tag -width Ds +.It ! +A line that is part of a group of one or more lines that changed between the +two files. There is a corresponding group of lines marked with +.Li ! +in the part of this hunk for the other file. +.Pp +.It + +An \(lqinserted\(rq line in the second file that corresponds to nothing in the first +file. +.Pp +.It - +A \(lqdeleted\(rq line in the first file that corresponds to nothing in the second +file. +.El +.Pp +If all of the changes in a hunk are insertions, the lines of +.Va from-file +are omitted. If all of the changes are deletions, the lines of +.Va to-file +are omitted. +.Pp +.Em Unified Format +.Pp +The unified output format is a variation on the context format that is more +compact because it omits redundant context lines. To select this output format, +use the +.Op -U Va lines , +.Op --unified[= Va lines] , +or +.Op -u +option. The argument +.Va lines +is the number of lines of context to show. When it is not given, it defaults +to three. +.Pp +At present, only GNU +.Xr diff +can produce this format and only GNU +.Xr patch +can automatically apply diffs in this format. For proper operation, +.Xr patch +typically needs at least three lines of context. +.Pp +.No An Example of Unified Format +.Pp +Here is the output of the command +.Li diff -u lao tzu +(see Section +.Dq Sample diff Input , +for the complete contents of the two files): +.Pp +.Bd -literal -offset indent +--- lao 2002-02-21 23:30:39.942229878 -0800 ++++ tzu 2002-02-21 23:30:50.442260588 -0800 +@@ -1,7 +1,6 @@ +-The Way that can be told of is not the eternal Way; +-The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +-The Named is the mother of all things. ++The named is the mother of all things. ++ + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +@@ -9,3 +8,6 @@ + The two are the same, + But after they are produced, + they have different names. ++They both may be called deep and profound. ++Deeper and more profound, ++The door of all subtleties! +.Ed +.Pp +.No Detailed Description of Unified Format +.Pp +The unified output format starts with a two-line header, which looks like +this: +.Pp +.Bd -literal -offset indent +--- from-file from-file-modification-time ++++ to-file to-file-modification-time +.Ed +.Pp +The time stamp looks like +.Li 2002-02-21 23:30:39.942229878 -0800 +to indicate the date, time with fractional seconds, and time zone. The fractional +seconds are omitted on hosts that do not support fractional time stamps. +.Pp +You can change the header's content with the +.Op --label= Va label +option; seeSee Section +.Dq Alternate Names . +.Pp +Next come one or more hunks of differences; each hunk shows one area where +the files differ. Unified format hunks look like this: +.Pp +.Bd -literal -offset indent +@@ from-file-line-numbers to-file-line-numbers @@ + line-from-either-file + line-from-either-file... +.Ed +.Pp +If a hunk contains just one line, only its start line number appears. Otherwise +its line numbers look like +.Li Va start, Va count . +An empty hunk is considered to start at the line that follows the hunk. +.Pp +If a hunk and its context contain two or more lines, its line numbers look +like +.Li Va start, Va count . +Otherwise only its end line number appears. An empty hunk is considered to +end at the line that precedes the hunk. +.Pp +The lines common to both files begin with a space character. The lines that +actually differ between the two files have one of the following indicator +characters in the left print column: +.Pp +.Bl -tag -width Ds +.It + +A line was added here to the first file. +.Pp +.It - +A line was removed here from the first file. +.El +.Pp +.Em Showing Which Sections Differences Are in +.Pp +Sometimes you might want to know which part of the files each change falls +in. If the files are source code, this could mean which function was changed. +If the files are documents, it could mean which chapter or appendix was changed. +GNU +.Xr diff +can show this by displaying the nearest section heading line that precedes +the differing lines. Which lines are \(lqsection headings\(rq is determined by a regular +expression. +.Pp +.No Showing Lines That Match Regular Expressions +.Pp +To show in which sections differences occur for files that are not source +code for C or similar languages, use the +.Op -F Va regexp +or +.Op --show-function-line= Va regexp +option. +.Xr diff +considers lines that match the +.Xr grep +-style regular expression +.Va regexp +to be the beginning of a section of the file. Here are suggested regular expressions +for some common languages: +.Pp +.Bl -tag -width Ds +.It ^[[:alpha:]$_] +C, C++, Prolog +.It ^( +Lisp +.It ^@node +Texinfo +.El +.Pp +This option does not automatically select an output format; in order to use +it, you must select the context format (see Section +.Dq Context Format ) +or unified format (see Section +.Dq Unified Format ) . +In other output formats it has no effect. +.Pp +The +.Op -F +or +.Op --show-function-line +option finds the nearest unchanged line that precedes each hunk of differences +and matches the given regular expression. Then it adds that line to the end +of the line of asterisks in the context format, or to the +.Li @@ +line in unified format. If no matching line exists, this option leaves the +output for that hunk unchanged. If that line is more than 40 characters long, +it outputs only the first 40 characters. You can specify more than one regular +expression for such lines; +.Xr diff +tries to match each line against each regular expression, starting with the +last one given. This means that you can use +.Op -p +and +.Op -F +together, if you wish. +.Pp +.No Showing C Function Headings +.Pp +To show in which functions differences occur for C and similar languages, +you can use the +.Op -p +or +.Op --show-c-function +option. This option automatically defaults to the context output format (see Section +.Dq Context Format ) , +with the default number of lines of context. You can override that number +with +.Op -C Va lines +elsewhere in the command line. You can override both the format and the number +with +.Op -U Va lines +elsewhere in the command line. +.Pp +The +.Op -p +or +.Op --show-c-function +option is equivalent to +.Op -F '^[[:alpha:]$_]' +if the unified format is specified, otherwise +.Op -c -F '^[[:alpha:]$_]' +(see Section +.Dq Specified Headings ) . +GNU +.Xr diff +provides this option for the sake of convenience. +.Pp +.Em Showing Alternate File Names +.Pp +If you are comparing two files that have meaningless or uninformative names, +you might want +.Xr diff +to show alternate names in the header of the context and unified output formats. +To do this, use the +.Op --label= Va label +option. The first time you give this option, its argument replaces the name +and date of the first file in the header; the second time, its argument replaces +the name and date of the second file. If you give this option more than twice, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 11:49:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F705B25; Mon, 2 Mar 2015 11:49:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B98C920; Mon, 2 Mar 2015 11:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22Bn1B9011970; Mon, 2 Mar 2015 11:49:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22Bn1jj011967; Mon, 2 Mar 2015 11:49:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021149.t22Bn1jj011967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 11:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279520 - in head/gnu/usr.bin: diff gperf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 11:49:02 -0000 Author: bapt Date: Mon Mar 2 11:49:01 2015 New Revision: 279520 URL: https://svnweb.freebsd.org/changeset/base/279520 Log: Install old texinfo pages in the form of mdoc(7) pages Modified: head/gnu/usr.bin/diff/Makefile head/gnu/usr.bin/gperf/Makefile Modified: head/gnu/usr.bin/diff/Makefile ============================================================================== --- head/gnu/usr.bin/diff/Makefile Mon Mar 2 11:48:00 2015 (r279519) +++ head/gnu/usr.bin/diff/Makefile Mon Mar 2 11:49:01 2015 (r279520) @@ -5,7 +5,8 @@ DIFFSRC=${.CURDIR}/../../../contrib/diff/src .PATH: ${DIFFSRC} \ ${.CURDIR}/../../../contrib/diff/lib \ - ${.CURDIR}/../../../contrib/diff/man + ${.CURDIR}/../../../contrib/diff/man \ + ${.CURDIR}/../../../contrib/diff/doc PROG= diff SRCS= analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \ @@ -24,6 +25,8 @@ CFLAGS+=-I${.CURDIR}/../../../contrib/di CFLAGS+=-I${.CURDIR}/../../../contrib/diff/lib CFLAGS+=-I${DESTDIR}/usr/include/gnu +MAN= diff.1 diff.7 + LIBADD+= gnuregex .if ${MK_TESTS} != "no" Modified: head/gnu/usr.bin/gperf/Makefile ============================================================================== --- head/gnu/usr.bin/gperf/Makefile Mon Mar 2 11:48:00 2015 (r279519) +++ head/gnu/usr.bin/gperf/Makefile Mon Mar 2 11:49:01 2015 (r279520) @@ -10,6 +10,7 @@ SRCS= bool-array.cc hash-table.cc input. main.cc options.cc output.cc positions.cc search.cc version.cc \ getline.cc hash.cc WARNS= 1 +MAN= gperf.1 gperf.7 CXXFLAGS+= -I${GPERFDIR}/lib -I${.CURDIR} From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 14:49:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21E4E144 for ; Mon, 2 Mar 2015 14:49:03 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BB39D2 for ; Mon, 2 Mar 2015 14:48:57 +0000 (UTC) Received: (qmail 83189 invoked by uid 89); 2 Mar 2015 14:48:05 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 2 Mar 2015 14:48:05 -0000 Received: (qmail 69724 invoked by uid 89); 1 Mar 2015 19:39:22 -0000 Received: by simscan 1.3.1 ppid: 69716, pid: 69720, t: 0.0037s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 1 Mar 2015 19:39:22 -0000 Received: (qmail 11148 invoked by uid 89); 1 Mar 2015 19:39:44 -0000 Received: by simscan 1.4.0 ppid: 11094, pid: 11138, t: 1.7131s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 1 Mar 2015 19:39:42 -0000 From: Jan Beich To: Jean-Sebastien Pedron Subject: Re: svn commit: r279487 - head/sys/dev/pci References: <201503011247.t21Clb2p035966@svn.freebsd.org> Date: Sun, 01 Mar 2015 20:39:30 +0100 In-Reply-To: <201503011247.t21Clb2p035966@svn.freebsd.org> (Jean-Sebastien Pedron's message of "Sun, 1 Mar 2015 12:47:37 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 14:49:03 -0000 --=-=-= Content-Type: text/plain Jean-Sebastien Pedron writes: > Modified: head/sys/dev/pci/vga_pci.c [...] > +int > +vga_pci_repost(device_t dev) > +{ > +#if defined(__amd64__) || defined(__i386__) > + x86regs_t regs; > + > + if (!vga_pci_is_boot_display(dev)) > + return (EINVAL); > + > + if (x86bios_get_orm(VGA_PCI_BIOS_SHADOW_ADDR) == NULL) > + return (ENOTSUP); > + > + x86bios_init_regs(®s); [...] This breaks build for a kernel without VESA or X86BIOS. Also, x86bios maybe loaded later as a module. $ make buildkernel --- kernel.debug --- linking kernel.debug vga_pci.o: In function `vga_pci_repost': /usr/src/sys/dev/pci/vga_pci.c:208: undefined reference to `x86bios_get_orm' /usr/src/sys/dev/pci/vga_pci.c:211: undefined reference to `x86bios_init_regs' /usr/src/sys/dev/pci/vga_pci.c:218: undefined reference to `x86bios_call' /usr/src/sys/dev/pci/vga_pci.c:221: undefined reference to `x86bios_get_intr' *** [kernel.debug] Error code 1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJU82ryXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3b6UYH/0TN2yhOCM+PvgWf6Xhi2yYa +JcEXTMum5UZnwrrXtJKLxg/joDlXb9Af+ESpwmg3wYP+Ku3YQ8C20+VSf627JEI Zad4diaRFMO1wK2Tpcjq9lm3u96x1qQTe7z2yuKooGjX1yjT/B64CDwjteM2uraO TJq5R7dvk1r9UiwXQNUgW8pmyN9yQwbcfUpxYK4FOVnYOjg29MTVk/qifJVz6fyo oq1KsbiJNQMY5Q6sLZpo9+E+lSi+vjOvMZ3TBpwhStU/YOB+pQL39YhZQSpdMPv7 dzifISK5W6GboI1zHlCCFk3pxxfxfyD2af+xz3J9en+h4wJSOiRYYY3K+haoO5E= =EZyo -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 15:06:27 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42628A7E for ; Mon, 2 Mar 2015 15:06:27 +0000 (UTC) Received: from nm35-vm0.bullet.mail.bf1.yahoo.com (nm35-vm0.bullet.mail.bf1.yahoo.com [72.30.238.72]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBBD3367 for ; Mon, 2 Mar 2015 15:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1425308411; bh=cYDvQhxI7kZmO3ILqllzSuPLPXE/f7c3+fO+quMD4J4=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=AdC36JxqgF/U1Nl+sQ5Lozab+5jSZo4jdfRckKL5PetqvL5Q48fNVogukoNQ8LgHUTk2+Q3pJfIfO9UA0/5EQ6lji9orT3ZWIMMylbudRcD98agUicD/rMw2LY1EZ/rZQwqwd/oIvq/Xyks4VS+bRHfxKwtldFOyPm+W/IcU23tjXXXDQA7N6UZiYIqv6Jp4M5BGvJTCWb9430y6azR25pueeM7q4l8CJoQt+6nsv45aee+W37Q1k4yelE9E4z4tvW9H79XIXSBVfOfOkuRqSbQXT2VYH0+HcieV2reanblZewkynbnPMuRSlAFakmM4pFFBDC40abTkbEbnKtnFuw== Received: from [98.139.215.140] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 02 Mar 2015 15:00:11 -0000 Received: from [98.139.211.205] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 02 Mar 2015 15:00:11 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 02 Mar 2015 15:00:11 -0000 X-Yahoo-Newman-Id: 935235.33859.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: HB12mIUVM1nJSQfhdPqH6LlL_ze0RfJWxz4LEjtfYg7SI3Q j.hYR27nlfdlbgsv9qFjkFC8Utl54bkyWwGEdBwQV6yeaqhAf6AsF0UEa6mZ duz_Myh.KIKzvm9djm8bICf8_H68QDSC66vGx3zxplOTkcOmvy0F6uTVUHl7 dW8Hvqmws218Ys7WaZ_C_WkDw3ZFpn9EtR1MAe6lHhD_DfVLR8W2jJAHpWtS WL75Wty4sh2CpOcd7uwBm0e7EslHrCMMX6sXYBTYEW.ZUz8Wg8oYLOmwGmoy YcAIfAe4VqFf9SegZUshiDy3Pq_6IrIeb.A6ZqRGxEcmNu5R6X207vyCGbIS _cssLKQ6SgD0WbhO6vv3qJoghkqAKTfEHRiLveXJZFfTTxkmYlfZjSiBS1Ow SPngCuMLJSCljjwTR7asxDj65M9Mlnx0Jl8HgGiZag_fQuiDs4AYaBJojiEv 6J6iMGLcsH82G9d3bbVyGa42ppn9ODxt4Iy5kTCUMyzhZuXF3TMraQ3mjNa. IycH8sTwOAkIKGUN6WIj_znbOHhBFtSXhWdQvjYNadFX_Gy3._E.x2xeU_nP UpUb5YfC2ShCSb45SycuhyCI6yuz2TfCd9Wjj7trFrG7aNA39MK8w6NBeYPg uUs_jnZg- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54F47AFB.3070709@FreeBSD.org> Date: Mon, 02 Mar 2015 10:00:11 -0500 From: Pedro Giffuni Organization: FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r279491 - head/lib/msun/src References: <201503012026.t21KQ4Sr056850@svn.freebsd.org> In-Reply-To: <201503012026.t21KQ4Sr056850@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 15:06:27 -0000 On 01/03/2015 03:26 p.m., Steve Kargl wrote: > Author: kargl > Date: Sun Mar 1 20:26:03 2015 > New Revision: 279491 > URL: https://svnweb.freebsd.org/changeset/base/279491 > > Log: > When j0() and j1() were converted to j0f() and j1f(), the threshold > values for the different invervals were not converted correctly. > Adjust the threshold values to values, which should agree with the > comments. > > Reported by: cognet (j1f only) > Discussed with: pfg, bde > Reviewed by: bde > > Modified: > head/lib/msun/src/e_j0f.c > head/lib/msun/src/e_j1f.c > Not that the bessel functions are very popular but this does fix some long standing errors. Thanks! Pedro. From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 15:14:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E59CDBE; Mon, 2 Mar 2015 15:14:57 +0000 (UTC) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2E68651; Mon, 2 Mar 2015 15:14:56 +0000 (UTC) Received: from 2a02-8428-011b-e000-0290-f5ff-fe9d-b78c.rev.sfr.net ([2a02:8428:11b:e000:290:f5ff:fe9d:b78c] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1YSS3b-0005Qu-14; Mon, 02 Mar 2015 16:14:55 +0100 Message-ID: <54F47E69.7020707@FreeBSD.org> Date: Mon, 02 Mar 2015 16:14:49 +0100 From: =?windows-1252?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jan Beich Subject: Re: svn commit: r279487 - head/sys/dev/pci References: <201503011247.t21Clb2p035966@svn.freebsd.org> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="thh8mAEDlfNKxlfwGik3QkoXF0b1G4Wef" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 15:14:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --thh8mAEDlfNKxlfwGik3QkoXF0b1G4Wef Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 01.03.2015 20:39, Jan Beich wrote: > This breaks build for a kernel without VESA or X86BIOS. Also, x86bios > maybe loaded later as a module. Doesn't r279494 fix the problem? --=20 Jean-S=E9bastien P=E9dron --thh8mAEDlfNKxlfwGik3QkoXF0b1G4Wef Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJU9H5pXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMFaMQALl7+Oow7uaxnEJLbsUvXU4t KY+SqkvQD3DN9EQGGPlmKpcf1Ph5G4xtgRVnMfzoJcxovkScA68WVtllRBQrI2gc 0Xs4CDDhVuSgvFbWcc83KMOD2YiAC6XrforH86FKQw16COwFzdgjuuvW4PY4Md/o 4ExPMKHMZwZggmzbgaMlanyPi/9PA85Bq0zatQOu4SgQCYKZk1CRkEdD+c0E/+Db EfVWPZlug8ZlZDmqZmr2A42/drY/0EmqasqwOB0f5SnnQRl50DAhJaA4obqFGEEe h+v8N2Y835O9VoQO1/Su7b1DNBnTjxsaVd4JHwW2JDo7WpagL0w71QCAiOhLfM/w Xc5gA7K2mmwTI01Un+xflKPIWe+nukSvSPvp1P0ZR/7u9IxpDY2+gGJNxiwYmcwJ qkE2NVW/6cemhJs+kaO36owaoPJXrMTdt3l6RydaZotu0KcVclIC+hlpFmYgIUSu oHtP0jiZGw6tm2lomQ+o9EjzcB6T/fyavMlvnpU+9BbNaoBjQH6+6ZAlHqkBDD7Q 5k/OZfVxJfurDmWKNSDOjfFEc9r+1bRBE53uISr5oVWbtT7wIyaYeR5xhnY9tzXK zjSDIXPPfsCvii6yr01CV7Tn9/iX1BE4mUJSzZQFhZq65FACBK2Y1sQSXnnxXtu7 BJenRk3TvbkrWD2TWP5E =4AwC -----END PGP SIGNATURE----- --thh8mAEDlfNKxlfwGik3QkoXF0b1G4Wef-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 16:45:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E24ADAE; Mon, 2 Mar 2015 16:45:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0716B96; Mon, 2 Mar 2015 16:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22GjjCM054498; Mon, 2 Mar 2015 16:45:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22GjfGO054473; Mon, 2 Mar 2015 16:45:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021645.t22GjfGO054473@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 16:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279524 - vendor/mdocml/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 16:45:46 -0000 Author: bapt Date: Mon Mar 2 16:45:41 2015 New Revision: 279524 URL: https://svnweb.freebsd.org/changeset/base/279524 Log: Import CVS snapshot of mandoc as of 20150302 Added: vendor/mdocml/dist/Makefile.local (contents, props changed) vendor/mdocml/dist/compat_strtonum.c (contents, props changed) vendor/mdocml/dist/test-strtonum.c (contents, props changed) Modified: vendor/mdocml/dist/LICENSE vendor/mdocml/dist/Makefile vendor/mdocml/dist/Makefile.depend vendor/mdocml/dist/TODO vendor/mdocml/dist/apropos.1 vendor/mdocml/dist/cgi.c vendor/mdocml/dist/chars.c vendor/mdocml/dist/chars.in vendor/mdocml/dist/compat_fts.c vendor/mdocml/dist/configure vendor/mdocml/dist/configure.local.example vendor/mdocml/dist/demandoc.c vendor/mdocml/dist/eqn.7 vendor/mdocml/dist/eqn.c vendor/mdocml/dist/eqn_term.c vendor/mdocml/dist/example.style.css vendor/mdocml/dist/gmdiff vendor/mdocml/dist/html.c vendor/mdocml/dist/libman.h vendor/mdocml/dist/libmandoc.h vendor/mdocml/dist/libmdoc.h vendor/mdocml/dist/libroff.h vendor/mdocml/dist/main.c vendor/mdocml/dist/main.h vendor/mdocml/dist/man-cgi.css vendor/mdocml/dist/man.1 vendor/mdocml/dist/man.7 vendor/mdocml/dist/man.c vendor/mdocml/dist/man.h vendor/mdocml/dist/man_html.c vendor/mdocml/dist/man_macro.c vendor/mdocml/dist/man_term.c vendor/mdocml/dist/man_validate.c vendor/mdocml/dist/mandoc.1 vendor/mdocml/dist/mandoc.3 vendor/mdocml/dist/mandoc.c vendor/mdocml/dist/mandoc.db.5 vendor/mdocml/dist/mandoc.h vendor/mdocml/dist/mandoc_char.7 vendor/mdocml/dist/mandoc_escape.3 vendor/mdocml/dist/mandoc_headers.3 vendor/mdocml/dist/mandocdb.c vendor/mdocml/dist/manpage.c vendor/mdocml/dist/mansearch.c vendor/mdocml/dist/mdoc.7 vendor/mdocml/dist/mdoc.c vendor/mdocml/dist/mdoc.h vendor/mdocml/dist/mdoc_argv.c vendor/mdocml/dist/mdoc_html.c vendor/mdocml/dist/mdoc_macro.c vendor/mdocml/dist/mdoc_man.c vendor/mdocml/dist/mdoc_term.c vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/dist/msec.c vendor/mdocml/dist/out.c vendor/mdocml/dist/preconv.c vendor/mdocml/dist/read.c vendor/mdocml/dist/roff.7 vendor/mdocml/dist/roff.c vendor/mdocml/dist/st.in vendor/mdocml/dist/style.css vendor/mdocml/dist/tbl.3 vendor/mdocml/dist/tbl.7 vendor/mdocml/dist/tbl.c vendor/mdocml/dist/tbl_data.c vendor/mdocml/dist/tbl_html.c vendor/mdocml/dist/tbl_layout.c vendor/mdocml/dist/tbl_opts.c vendor/mdocml/dist/tbl_term.c vendor/mdocml/dist/term.c vendor/mdocml/dist/term.h vendor/mdocml/dist/term_ascii.c vendor/mdocml/dist/term_ps.c vendor/mdocml/dist/tree.c Modified: vendor/mdocml/dist/LICENSE ============================================================================== --- vendor/mdocml/dist/LICENSE Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/LICENSE Mon Mar 2 16:45:41 2015 (r279524) @@ -1,16 +1,17 @@ -$Id: LICENSE,v 1.5 2014/12/11 07:56:24 schwarze Exp $ +$Id: LICENSE,v 1.7 2015/02/16 14:56:22 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright of the following developers: Copyright (c) 2008-2012, 2014 Kristaps Dzonsons -Copyright (c) 2010, 2011, 2012, 2013, 2014 Ingo Schwarze +Copyright (c) 2010-2015 Ingo Schwarze Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger Copyright (c) 2013 Franco Fichtner Copyright (c) 1999, 2004 Marc Espie -Copyright (c) 1998, 2010 Todd C. Miller +Copyright (c) 1998, 2004, 2010 Todd C. Miller Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2004 Ted Unangst Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre See the individual source files for information about who contributed Modified: vendor/mdocml/dist/Makefile ============================================================================== --- vendor/mdocml/dist/Makefile Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/Makefile Mon Mar 2 16:45:41 2015 (r279524) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.453 2014/12/09 09:14:33 schwarze Exp $ +# $Id: Makefile,v 1.456 2015/02/16 16:23:54 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014 Ingo Schwarze @@ -15,6 +15,8 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +VERSION = 1.13.2 + # === LIST OF FILES ==================================================== TESTSRCS = test-dirent-namlen.c \ @@ -31,6 +33,7 @@ TESTSRCS = test-dirent-namlen.c \ test-strlcpy.c \ test-strptime.c \ test-strsep.c \ + test-strtonum.c \ test-wchar.c SRCS = att.c \ @@ -46,6 +49,7 @@ SRCS = att.c \ compat_strlcat.c \ compat_strlcpy.c \ compat_strsep.c \ + compat_strtonum.c \ demandoc.c \ eqn.c \ eqn_html.c \ @@ -189,7 +193,8 @@ COMPAT_OBJS = compat_fgetln.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ - compat_strsep.o + compat_strsep.o \ + compat_strtonum.o MANDOC_HTML_OBJS = eqn_html.o \ html.o \ @@ -211,6 +216,7 @@ BASE_OBJS = $(MANDOC_HTML_OBJS) \ $(MANDOC_MAN_OBJS) \ $(MANDOC_TERM_OBJS) \ main.o \ + manpath.o \ out.o \ tree.o @@ -218,8 +224,7 @@ MAIN_OBJS = $(BASE_OBJS) DB_OBJS = mandocdb.o \ mansearch.o \ - mansearch_const.o \ - manpath.o + mansearch_const.o CGI_OBJS = $(MANDOC_HTML_OBJS) \ cgi.o \ @@ -308,10 +313,12 @@ base-install: base-build mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man7 $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ $(DESTDIR)$(INCLUDEDIR) $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 @@ -330,12 +337,10 @@ db-install: base-build mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man8 ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) - ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) ln -f $(DESTDIR)$(BINDIR)/mandoc \ $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 - $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 @@ -377,7 +382,7 @@ demandoc: $(DEMANDOC_OBJS) libmandoc.a www-install: www mkdir -p $(HTDOCDIR)/snapshots - $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR)/man + $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR) $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots $(INSTALL_DATA) mdocml.tar.gz \ $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz Modified: vendor/mdocml/dist/Makefile.depend ============================================================================== --- vendor/mdocml/dist/Makefile.depend Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/Makefile.depend Mon Mar 2 16:45:41 2015 (r279524) @@ -11,6 +11,7 @@ compat_strcasestr.o: compat_strcasestr.c compat_strlcat.o: compat_strlcat.c config.h compat_strlcpy.o: compat_strlcpy.c config.h compat_strsep.o: compat_strsep.c config.h +compat_strtonum.o: compat_strtonum.c config.h demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h @@ -39,7 +40,7 @@ mdoc_macro.o: mdoc_macro.c config.h mdoc mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h -msec.o: msec.c config.h libmandoc.h msec.in +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h preconv.o: preconv.c config.h mandoc.h libmandoc.h read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h @@ -69,4 +70,5 @@ test-strlcat.o: test-strlcat.c test-strlcpy.o: test-strlcpy.c test-strptime.o: test-strptime.c test-strsep.o: test-strsep.c +test-strtonum.o: test-strtonum.c test-wchar.o: test-wchar.c Added: vendor/mdocml/dist/Makefile.local ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/dist/Makefile.local Mon Mar 2 16:45:41 2015 (r279524) @@ -0,0 +1,30 @@ +BUILD_TARGETS = base-build +INSTALL_TARGETS = base-install db-install +CFLAGS = -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -I/usr/local/include +DBLIB = -L/usr/local/lib -lsqlite3 +STATIC = -static +PREFIX = /usr/local +BINDIR = /usr/local/bin +SBINDIR = /usr/local/sbin +INCLUDEDIR = /usr/local/include/mandoc +LIBDIR = /usr/local/lib/mandoc +MANDIR = /usr/local/man +EXAMPLEDIR = /usr/local/share/examples/mandoc +WWWPREFIX = /var/www +HTDOCDIR = /var/www/htdocs +CGIBINDIR = /var/www/cgi-bin +BINM_APROPOS = apropos +BINM_MAN = man +BINM_WHATIS = whatis +BINM_MAKEWHATIS = makewhatis +MANM_MAN = man +MANM_MDOC = mdoc +MANM_ROFF = roff +MANM_EQN = eqn +MANM_TBL = tbl +INSTALL = install +INSTALL_PROGRAM = install -m 0555 +INSTALL_LIB = install -m 0444 +INSTALL_MAN = install -m 0444 +INSTALL_DATA = install -m 0444 +MAIN_OBJS = $(BASE_OBJS) $(DB_OBJS) Modified: vendor/mdocml/dist/TODO ============================================================================== --- vendor/mdocml/dist/TODO Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/TODO Mon Mar 2 16:45:41 2015 (r279524) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.195 2014/12/13 13:14:39 schwarze Exp $ +* $Id: TODO,v 1.201 2015/02/20 13:47:28 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -60,7 +60,7 @@ are mere guesses, and some may be wrong. - .fc (field control) found by naddy@ in xloadimage(1) loc ** exist *** algo * size * imp * - + - .nr third argument (auto-increment step size, requires \n+) found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 loc * exist * algo * size * imp ** @@ -69,31 +69,37 @@ are mere guesses, and some may be wrong. reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 loc *** exist *** algo *** size ** imp * -- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) - reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 +- .ta (tab settings) + #1 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + ircbug(1) gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 also posix2time(3) Carsten Kunze Mon, 1 Dec 2014 13:03:10 +0100 loc ** exist *** algo ** size ** imp *** - .ti (temporary indent) - found by naddy@ in xloadimage(1) + found by naddy@ in xloadimage(1) [devel/libvstr] vstr(3) found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600 loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) -- .while and .shift +- .while and .shift found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 loc * exist ** algo ** size ** imp ** - \h horizontal move - found in cclive(1) and nasm(1) asciidoc/DocBook output + #2 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + found in cclive(1) nasm(1) bogofilter(1) asciidoc/DocBook output bentley@ on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 naddy@ Thu, 4 Dec 2014 16:26:41 +0100 - loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) + loc ** exist ** algo ** size * imp *** (parser reorg helps a lot) - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 loc * exist * algo * size * imp ** +- \n(.$ macro argument count number register; ocserv(8) by autogen + found by sthen@ Thu, 19 Feb 2015 22:03:01 +0000 + loc * exist ** algo * size * imp ** + - \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 @@ -105,10 +111,6 @@ are mere guesses, and some may be wrong. --- missing mdoc features ---------------------------------------------- -- fix bad block nesting involving multiple identical explicit blocks - see the OpenBSD mdoc_macro.c 1.47 commit message - loc * exist *** algo *** size * imp ** - - .Bl -column .Xo support is missing ultimate goal: restore .Xr and .Dv to @@ -255,6 +257,10 @@ are mere guesses, and some may be wrong. --- compatibility checks ----------------------------------------------- +- write a configure check for [[:<:]] support and provide some + fallback for whatis(1) when it doesn't work; + Svyatoslav Mishyn Wed, 17 Dec 2014 11:07:10 +0200 + - is .Bk implemented correctly in modern groff? sobrado@ Tue, 19 Apr 2011 22:12:55 +0200 @@ -347,6 +353,10 @@ are mere guesses, and some may be wrong. reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 loc * exist ** algo *** size * imp *** +- a line starting with "\fB something" counts as starting with whitespace + and triggers a line break; found in audio/normalize-mp3(1) + loc ** exist * algo ** size * imp ** + - formatting /usr/local/man/man1/latex2man.1 with groff and mandoc reveals lots of bugs both in groff and mandoc... reported by bentley@ Wed, 22 May 2013 23:49:30 -0600 @@ -457,7 +467,7 @@ are mere guesses, and some may be wrong. loc * exist * algo * size * imp * - trailing whitespace must be ignored even when followed by a font escape, - see for example + see for example makes \fBdig \fR operate in batch mode @@ -531,7 +541,7 @@ are mere guesses, and some may be wrong. How does SQLITE_CONFIG_PAGECACHE actually work? Document it! from kristaps@ Sat, 09 Aug 2014 13:51:36 +0200 -Several areas can be cleaned up to make mandoc even faster. These are +Several areas can be cleaned up to make mandoc even faster. These are - improve hashing mechanism for macros (quite important: performance) @@ -540,7 +550,7 @@ Several areas can be cleaned up to make - the PDF file is HUGE: this can be reduced by using relative offsets - instead of re-initialising the roff predefined-strings set before each - parse, create a read-only version the first time and copy it + parse, create a read-only version the first time and copy it loc * exist ** algo ** size * imp ** ************************************************************************ @@ -556,7 +566,7 @@ Several areas can be cleaned up to make - Find better ways to prevent endless loops in roff(7) macro and string expansion. - + - Finish cleanup of date handling. Decide which formats should be recognized where. Update both mdoc(7) and man(7) documentation. Modified: vendor/mdocml/dist/apropos.1 ============================================================================== --- vendor/mdocml/dist/apropos.1 Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/apropos.1 Mon Mar 2 16:45:41 2015 (r279524) @@ -1,4 +1,4 @@ -.\" $Id: apropos.1,v 1.36 2014/10/25 01:03:52 schwarze Exp $ +.\" $Id: apropos.1,v 1.37 2015/02/16 16:23:54 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons .\" Copyright (c) 2011, 2012, 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 25 2014 $ +.Dd $Mdocdate: February 16 2015 $ .Dt APROPOS 1 .Os .Sh NAME @@ -24,7 +24,7 @@ .Nd search manual page databases .Sh SYNOPSIS .Nm -.Op Fl acfhklVw +.Op Fl acfhklw .Op Fl C Ar file .Op Fl M Ar path .Op Fl m Ar path @@ -162,8 +162,6 @@ By default, pages from all sections are See .Xr man 1 for a listing of sections. -.It Fl V -Print version and exit. .It Fl w Instead of showing title lines, show the pathnames of the matching manual pages, just like Modified: vendor/mdocml/dist/cgi.c ============================================================================== --- vendor/mdocml/dist/cgi.c Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/cgi.c Mon Mar 2 16:45:41 2015 (r279524) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.102 2014/11/26 17:55:27 schwarze Exp $ */ +/* $Id: cgi.c,v 1.104 2015/02/10 08:05:30 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -58,10 +58,10 @@ static void catman(const struct req *, static void format(const struct req *, const char *); static void html_print(const char *); static void html_putchar(char); -static int http_decode(char *); +static int http_decode(char *); static void http_parse(struct req *, const char *); static void http_print(const char *); -static void http_putchar(char); +static void http_putchar(char); static void http_printquery(const struct req *, const char *); static void pathgen(struct req *); static void pg_error_badrequest(const char *); @@ -186,7 +186,7 @@ http_print(const char *p) static void html_print(const char *p) { - + if (NULL == p) return; while ('\0' != *p) @@ -621,7 +621,7 @@ pg_searchres(const struct req *req, stru for (i = 0; i < sz; i++) { printf("\n" "\n" - "q.manpath, r[i].file); http_printquery(req, "&"); printf("\">"); @@ -701,7 +701,7 @@ catman(const struct req *req, const char while (NULL != (p = fgetln(f, &len))) { bold = italic = 0; for (i = 0; i < (int)len - 1; i++) { - /* + /* * This means that the catpage is out of state. * Ignore it and keep going (although the * catpage is bogus). @@ -742,7 +742,7 @@ catman(const struct req *req, const char continue; } - /* + /* * Handle funny behaviour troff-isms. * These grok'd from the original man2html.c. */ @@ -780,7 +780,7 @@ catman(const struct req *req, const char } /* Bold mode. */ - + if (italic) printf(""); if ( ! bold) @@ -791,9 +791,9 @@ catman(const struct req *req, const char html_putchar(p[i]); } - /* + /* * Clean up the last character. - * We can get to a newline; don't print that. + * We can get to a newline; don't print that. */ if (italic) @@ -822,7 +822,6 @@ format(const struct req *req, const char struct man *man; void *vp; char *opts; - enum mandoclevel rc; int fd; int usepath; @@ -832,18 +831,11 @@ format(const struct req *req, const char } mchars = mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, + mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, mchars, req->q.manpath); - rc = mparse_readfd(mp, fd, file); + mparse_readfd(mp, fd, file); close(fd); - if (rc >= MANDOCLEVEL_FATAL) { - fprintf(stderr, "fatal mandoc error: %s/%s\n", - req->q.manpath, file); - pg_error_internal(); - return; - } - usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&opts, "fragment,man=%s?query=%%N&sec=%%S%s%s%s%s", @@ -899,7 +891,7 @@ pg_show(struct req *req, const char *ful pg_error_badrequest( "You did not specify a page to show."); return; - } + } manpath = mandoc_strndup(fullpath, file - fullpath); file++; @@ -1064,7 +1056,7 @@ main(void) MAN_DIR, strerror(errno)); pg_error_internal(); return(EXIT_FAILURE); - } + } memset(&req, 0, sizeof(struct req)); pathgen(&req); Modified: vendor/mdocml/dist/chars.c ============================================================================== --- vendor/mdocml/dist/chars.c Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/chars.c Mon Mar 2 16:45:41 2015 (r279524) @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.65 2014/10/29 00:17:43 schwarze Exp $ */ +/* $Id: chars.c,v 1.66 2015/02/17 20:37:16 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014 Ingo Schwarze @@ -38,7 +38,7 @@ struct ln { int unicode; }; -#define LINES_MAX 330 +#define LINES_MAX 332 #define CHAR(in, ch, code) \ { NULL, (in), (ch), (code) }, Modified: vendor/mdocml/dist/chars.in ============================================================================== --- vendor/mdocml/dist/chars.in Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/chars.in Mon Mar 2 16:45:41 2015 (r279524) @@ -1,4 +1,4 @@ -/* $Id: chars.in,v 1.49 2014/11/06 22:28:36 schwarze Exp $ */ +/* $Id: chars.in,v 1.52 2015/02/17 20:37:16 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -70,8 +70,10 @@ CHAR("ti", "~", 126) /* Quotes. */ CHAR("Bq", ",,", 8222) CHAR("bq", ",", 8218) -CHAR("lq", "``", 8220) -CHAR("rq", "\'\'", 8221) +CHAR("lq", "\"", 8220) +CHAR("rq", "\"", 8221) +CHAR("Lq", "``", 8220) +CHAR("Rq", "''", 8221) CHAR("oq", "`", 8216) CHAR("cq", "\'", 8217) CHAR("aq", "\'", 39) @@ -91,30 +93,30 @@ CHAR("ra", ">", 10217) CHAR("bv", "|", 9130) CHAR("braceex", "|", 9130) CHAR("bracketlefttp", "|", 9121) -CHAR("bracketleftbp", "|", 9123) +CHAR("bracketleftbt", "|", 9123) CHAR("bracketleftex", "|", 9122) CHAR("bracketrighttp", "|", 9124) -CHAR("bracketrightbp", "|", 9126) +CHAR("bracketrightbt", "|", 9126) CHAR("bracketrightex", "|", 9125) CHAR("lt", ",-", 9127) CHAR("bracelefttp", ",-", 9127) CHAR("lk", "{", 9128) CHAR("braceleftmid", "{", 9128) CHAR("lb", "`-", 9129) -CHAR("braceleftbp", "`-", 9129) +CHAR("braceleftbt", "`-", 9129) CHAR("braceleftex", "|", 9130) CHAR("rt", "-.", 9131) CHAR("bracerighttp", "-.", 9131) CHAR("rk", "}", 9132) CHAR("bracerightmid", "}", 9132) CHAR("rb", "-\'", 9133) -CHAR("bracerightbp", "-\'", 9133) +CHAR("bracerightbt", "-\'", 9133) CHAR("bracerightex", "|", 9130) CHAR("parenlefttp", "/", 9115) -CHAR("parenleftbp", "\\", 9117) +CHAR("parenleftbt", "\\", 9117) CHAR("parenleftex", "|", 9116) CHAR("parenrighttp", "\\", 9118) -CHAR("parenrightbp", "/", 9120) +CHAR("parenrightbt", "/", 9120) CHAR("parenrightex", "|", 9119) /* Greek characters. */ @@ -281,10 +283,10 @@ CHAR("!=", "!=", 8800) CHAR("==", "==", 8801) CHAR("ne", "!==", 8802) CHAR("=~", "=~", 8773) -CHAR("-~", "-~", 8771) +CHAR("|=", "-~", 8771) CHAR("ap", "~", 8764) CHAR("~~", "~~", 8776) -CHAR("~=", "~=", 8780) +CHAR("~=", "~=", 8776) CHAR("pt", "oc", 8733) CHAR("es", "{}", 8709) CHAR("mo", "E", 8712) @@ -357,7 +359,7 @@ CHAR("Fn", ",\bf", 402) CHAR("ba", "|", 124) CHAR("br", "|", 9474) CHAR("ul", "_", 95) -CHAR("rl", "-", 8254) +CHAR("rn", "-", 8254) CHAR("bb", "|", 166) CHAR("sl", "/", 47) CHAR("rs", "\\", 92) Modified: vendor/mdocml/dist/compat_fts.c ============================================================================== --- vendor/mdocml/dist/compat_fts.c Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/compat_fts.c Mon Mar 2 16:45:41 2015 (r279524) @@ -6,8 +6,8 @@ int dummy; #else -/* $Id: compat_fts.c,v 1.6 2014/12/11 18:20:07 schwarze Exp $ */ -/* $OpenBSD: fts.c,v 1.49 2014/11/23 00:14:22 guenther Exp $ */ +/* $Id: compat_fts.c,v 1.8 2015/02/07 07:53:01 schwarze Exp $ */ +/* $OpenBSD: fts.c,v 1.50 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -38,7 +38,6 @@ int dummy; * SUCH DAMAGE. */ -#include #include #include @@ -51,6 +50,8 @@ int dummy; #include #include "compat_fts.h" +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + static FTSENT *fts_alloc(FTS *, const char *, size_t); static FTSENT *fts_build(FTS *); static void fts_lfree(FTSENT *); @@ -62,10 +63,12 @@ static unsigned short fts_stat(FTS *, F static int fts_safe_changedir(FTS *, FTSENT *, int, const char *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) -#define MAX(a,b) (((a)>(b))?(a):(b)) #ifndef O_DIRECTORY #define O_DIRECTORY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif #define CLR(opt) (sp->fts_options &= ~(opt)) #define ISSET(opt) (sp->fts_options & (opt)) @@ -97,7 +100,7 @@ fts_open(char * const *argv, int options * Start out with 1K of path space, and enough, in any case, * to hold the user's paths. */ - if (fts_palloc(sp, MAX(fts_maxarglen(argv), PATH_MAX))) + if (fts_palloc(sp, MAXIMUM(fts_maxarglen(argv), PATH_MAX))) goto mem1; /* Allocate/initialize root's parent. */ Added: vendor/mdocml/dist/compat_strtonum.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/dist/compat_strtonum.c Mon Mar 2 16:45:41 2015 (r279524) @@ -0,0 +1,76 @@ +#include "config.h" + +#if HAVE_STRTONUM + +int dummy; + +#else + +/* $Id: compat_strtonum.c,v 1.1 2015/02/16 14:56:22 schwarze Exp $ */ +/* $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */ + +/* + * Copyright (c) 2004 Ted Unangst and Todd Miller + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 + +long long +strtonum(const char *numstr, long long minval, long long maxval, + const char **errstrp) +{ + long long ll = 0; + int error = 0; + char *ep; + struct errval { + const char *errstr; + int err; + } ev[4] = { + { NULL, 0 }, + { "invalid", EINVAL }, + { "too small", ERANGE }, + { "too large", ERANGE }, + }; + + ev[0].err = errno; + errno = 0; + if (minval > maxval) { + error = INVALID; + } else { + ll = strtoll(numstr, &ep, 10); + if (numstr == ep || *ep != '\0') + error = INVALID; + else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + error = TOOSMALL; + else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) + error = TOOLARGE; + } + if (errstrp != NULL) + *errstrp = ev[error].errstr; + errno = ev[error].err; + if (error) + ll = 0; + + return (ll); +} + +#endif /* !HAVE_STRTONUM */ Modified: vendor/mdocml/dist/configure ============================================================================== --- vendor/mdocml/dist/configure Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/configure Mon Mar 2 16:45:41 2015 (r279524) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2014 Ingo Schwarze +# Copyright (c) 2014, 2015 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -31,10 +31,6 @@ echo "config.log: writing..." # Initialize all variables here, # such that nothing can leak in from the environment. -VERSION="1.13.2" -echo "VERSION=\"${VERSION}\"" 1>&2 -echo "VERSION=\"${VERSION}\"" 1>&3 - OSNAME= CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -` @@ -56,6 +52,7 @@ HAVE_STRLCAT= HAVE_STRLCPY= HAVE_STRPTIME= HAVE_STRSEP= +HAVE_STRTONUM= HAVE_WCHAR= HAVE_SQLITE3= @@ -70,6 +67,7 @@ INCLUDEDIR= LIBDIR= MANDIR= EXAMPLEDIR= +HOMEBREWDIR= WWWPREFIX="/var/www" HTDOCDIR= @@ -176,6 +174,7 @@ runtest strlcat STRLCAT || true runtest strlcpy STRLCPY || true runtest strptime STRPTIME || true runtest strsep STRSEP || true +runtest strtonum STRTONUM || true runtest wchar WCHAR || true # --- sqlite3 --- @@ -274,8 +273,8 @@ __HEREDOC__ [ ${HAVE_FGETLN} -eq 0 ] && echo "#include " echo -echo "#define VERSION \"${VERSION}\"" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" +[ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\"" cat << __HEREDOC__ #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN} @@ -289,6 +288,7 @@ cat << __HEREDOC__ #define HAVE_STRLCPY ${HAVE_STRLCPY} #define HAVE_STRPTIME ${HAVE_STRPTIME} #define HAVE_STRSEP ${HAVE_STRSEP} +#define HAVE_STRTONUM ${HAVE_STRTONUM} #define HAVE_WCHAR ${HAVE_WCHAR} #define HAVE_SQLITE3 ${HAVE_SQLITE3} #define HAVE_SQLITE3_ERRSTR ${HAVE_SQLITE3_ERRSTR} @@ -341,6 +341,9 @@ __HEREDOC__ [ ${HAVE_STRSEP} -eq 0 ] && \ echo "extern char *strsep(char **, const char *);" +[ ${HAVE_STRTONUM} -eq 0 ] && \ + echo "extern long long strtonum(const char *, long long, long long, const char **);" + echo echo "#endif /* MANDOC_CONFIG_H */" @@ -379,7 +382,6 @@ INSTALL_TARGETS="base-install" [ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install" cat << __HEREDOC__ -VERSION = ${VERSION} BUILD_TARGETS = ${BUILD_TARGETS} INSTALL_TARGETS = ${INSTALL_TARGETS} CFLAGS = ${CFLAGS} Modified: vendor/mdocml/dist/configure.local.example ============================================================================== --- vendor/mdocml/dist/configure.local.example Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/configure.local.example Mon Mar 2 16:45:41 2015 (r279524) @@ -1,6 +1,6 @@ -# $Id: configure.local.example,v 1.2 2014/12/09 09:14:33 schwarze Exp $ +# $Id: configure.local.example,v 1.6 2015/02/16 14:56:22 schwarze Exp $ # -# Copyright (c) 2014 Ingo Schwarze +# Copyright (c) 2014, 2015 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -74,6 +74,21 @@ LIBDIR="${PREFIX}/lib/mandoc" MANDIR="${PREFIX}/man" EXAMPLEDIR="${PREFIX}/share/examples/mandoc" +# The man(1) utility needs to know where the manuals reside. +# We know of two ways to tell it: via manpath(1) or man.conf(5). +# The latter is used by OpenBSD and NetBSD, the former by most +# other systems. + +# Force usage of manpath(1). +# If it is not installed or not operational, +# man(1), makewhatis(8), and apropos(1) will not work properly. +HAVE_MANPATH=1 + +# Force usage of man.conf(5). +# If it does not exist or contains no valid configuration, +# man(1), makewhatis(8), and apropos(1) will not work properly. +HAVE_MANPATH=0 + # Some distributions may want to avoid naming conflicts among manuals. # If you want to change the names of installed section 7 manual pages, # the following alternative names are suggested. @@ -87,6 +102,15 @@ MANM_ROFF="mandoc_roff" # default is "r MANM_EQN="mandoc_eqn" # default is "eqn" MANM_TBL="mandoc_tbl" # default is "tbl" +# Some distributions may want to avoid naming conflicts +# with another man(1) utility. +# If you want to change the name of the binary program, +# the following alternative name is suggested. +# Using a different name is possible as well. +# This changes the name of the installed section 1 manual page as well. + +BINM_MAN=mman # default is "man" + # It is possible to change the utility program used for installation # and the modes files are installed with. The defaults are: @@ -121,38 +145,29 @@ DBLIB="-L/usr/local/lib -lsqlite3" CFLAGS="${CFLAGS} -I/usr/local/include" -# The man(1) utility needs to know where the manuals reside. -# We know of two ways to tell it: via manpath(1) or man.conf(5). -# The latter is used by OpenBSD and NetBSD, the former by most -# other systems. - -# Force usage of manpath(1). -# If it is not installed or not operational, -# makewhatis(8) and apropos(1) will not work properly. - -HAVE_MANPATH=1 - -# Force usage of man.conf(5). -# If it does not exist or contains no valid configuration, -# makewhatis(8) and apropos(1) will not work properly. - -HAVE_MANPATH=0 - # Some distributions may want to avoid naming conflicts -# with groff, man-db, or other tools. -# If you want to change the names of binary programs, +# with another implementation of apropos(1) and makewhatis(8). +# If you want to change the names of the binary programs, # the following alternative names are suggested. # Using other names is possible as well. # This changes the names of the installed section 1 and section 8 # manual pages as well. -# It is possible to set only one or a few of these variables, +# It is possible to set only one or two of these variables, # there is no need to copy the whole block. BINM_APROPOS=mapropos # default is "apropos" -BINM_MAN=mman # default is "man" BINM_WHATIS=mwhatis # default is "whatis" BINM_MAKEWHATIS=mandocdb # default is "makewhatis" +# When using the "homebrew" package manager on Mac OS X, the actual +# manuals are located in a so-called "cellar" and only symlinked +# into the manual trees. To allow mandoc to follow such symlinks, +# you have to specify the physical location of the cellar as returned +# by realpath(3), for example: + +PREFIX="/usr/local" +HOMEBREWDIR="${PREFIX}/Cellar" + # --- user settings related man.cgi ------------------------------------ # By default, building man.cgi(8) is disabled. To enable it, copy @@ -211,6 +226,7 @@ HAVE_STRLCAT=0 HAVE_STRLCPY=0 HAVE_STRPTIME=0 HAVE_STRSEP=0 +HAVE_STRTONUM=0 HAVE_SQLITE3=0 HAVE_SQLITE3_ERRSTR=0 Modified: vendor/mdocml/dist/demandoc.c ============================================================================== --- vendor/mdocml/dist/demandoc.c Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/demandoc.c Mon Mar 2 16:45:41 2015 (r279524) @@ -1,4 +1,4 @@ -/* $Id: demandoc.c,v 1.12 2014/10/28 17:36:19 schwarze Exp $ */ +/* $Id: demandoc.c,v 1.15 2015/02/10 08:05:30 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -44,11 +44,12 @@ main(int argc, char *argv[]) { struct mparse *mp; struct mchars *mchars; - int ch, i, list; + int ch, fd, i, list; extern int optind; - progname = strrchr(argv[0], '/'); - if (progname == NULL) + if (argc < 1) + progname = "demandoc"; + else if ((progname = strrchr(argv[0], '/')) == NULL) progname = argv[0]; else ++progname; @@ -78,15 +79,19 @@ main(int argc, char *argv[]) argv += optind; mchars = mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, mchars, NULL); + mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, mchars, NULL); assert(mp); - if (0 == argc) + if (argc < 1) pmandoc(mp, STDIN_FILENO, "", list); for (i = 0; i < argc; i++) { mparse_reset(mp); - pmandoc(mp, -1, argv[i], list); + if (mparse_open(mp, &fd, argv[i]) != MANDOCLEVEL_OK) { + perror(argv[i]); + continue; + } + pmandoc(mp, fd, argv[i], list); } mparse_free(mp); @@ -108,16 +113,12 @@ pmandoc(struct mparse *mp, int fd, const struct man *man; int line, col; - if (mparse_readfd(mp, fd, fn) >= MANDOCLEVEL_FATAL) { - fprintf(stderr, "%s: Parse failure\n", fn); - return; - } - + mparse_readfd(mp, fd, fn); mparse_result(mp, &mdoc, &man, NULL); line = 1; col = 0; - if (mdoc) + if (mdoc) pmdoc(mdoc_node(mdoc), &line, &col, list); else if (man) pman(man_node(man), &line, &col, list); @@ -167,7 +168,7 @@ again: end = p - 1; while (end > start) - if ('.' == *end || ',' == *end || + if ('.' == *end || ',' == *end || '\'' == *end || '"' == *end || ')' == *end || '!' == *end || '?' == *end || ':' == *end || @@ -199,7 +200,7 @@ again: /* * Print the input word, skipping any special characters. */ - while ('\0' != *p) + while ('\0' != *p) if ('\\' == *p) { p++; esc = mandoc_escape(&p, NULL, NULL); @@ -220,7 +221,7 @@ pline(int line, int *linep, int *col, in /* * Print out as many lines as needed to reach parity with the - * original input. + * original input. */ while (*linep < line) { @@ -240,7 +241,7 @@ pmdoc(const struct mdoc_node *p, int *li pline(p->line, line, col, list); if (MDOC_TEXT == p->type) pstring(p->string, p->pos, col, list); - if (p->child) + if (p->child) pmdoc(p->child, line, col, list); } } @@ -254,7 +255,7 @@ pman(const struct man_node *p, int *line pline(p->line, line, col, list); if (MAN_TEXT == p->type) pstring(p->string, p->pos, col, list); - if (p->child) + if (p->child) pman(p->child, line, col, list); } } Modified: vendor/mdocml/dist/eqn.7 ============================================================================== --- vendor/mdocml/dist/eqn.7 Mon Mar 2 15:03:08 2015 (r279523) +++ vendor/mdocml/dist/eqn.7 Mon Mar 2 16:45:41 2015 (r279524) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 16:48:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86A9BE7; Mon, 2 Mar 2015 16:48:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56403C6; Mon, 2 Mar 2015 16:48:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22Gm1qL054804; Mon, 2 Mar 2015 16:48:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22Gm1NY054803; Mon, 2 Mar 2015 16:48:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021648.t22Gm1NY054803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 16:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279525 - vendor/mdocml/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 16:48:01 -0000 Author: bapt Date: Mon Mar 2 16:48:00 2015 New Revision: 279525 URL: https://svnweb.freebsd.org/changeset/base/279525 Log: Remove WIP code Modified: vendor/mdocml/dist/roff.c Modified: vendor/mdocml/dist/roff.c ============================================================================== --- vendor/mdocml/dist/roff.c Mon Mar 2 16:45:41 2015 (r279524) +++ vendor/mdocml/dist/roff.c Mon Mar 2 16:48:00 2015 (r279525) @@ -418,7 +418,6 @@ static enum rofft roff_parse(struct rof static enum rofferr roff_parsetext(struct buf *, int, int *); static enum rofferr roff_res(struct roff *, struct buf *, int, int); static enum rofferr roff_rm(ROFF_ARGS); -static enum rofferr roff_rn(ROFF_ARGS); static enum rofferr roff_rr(ROFF_ARGS); static void roff_setstr(struct roff *, const char *, const char *, int); @@ -625,7 +624,7 @@ static struct roffmac roffs[ROFF_MAX] = { "rhang", roff_line_ignore, NULL, NULL, 0, NULL }, { "rj", roff_line_ignore, NULL, NULL, 0, NULL }, { "rm", roff_rm, NULL, NULL, 0, NULL }, - { "rn", roff_rn, NULL, NULL, 0, NULL }, + { "rn", roff_unsupp, NULL, NULL, 0, NULL }, { "rnn", roff_unsupp, NULL, NULL, 0, NULL }, { "rr", roff_rr, NULL, NULL, 0, NULL }, { "rs", roff_line_ignore, NULL, NULL, 0, NULL }, @@ -2326,35 +2325,6 @@ roff_rm(ROFF_ARGS) } static enum rofferr -roff_rn(ROFF_ARGS) -{ - struct roffkv *n; - char *newname; - const char *name; - size_t namesz; - - name = newname = buf->buf + pos; - if (*name == '\0') - return(ROFF_IGN); - - namesz = roff_getname(r, &newname, ln, pos); - if (name[namesz] == '\\') - return(ROFF_IGN); - - - for (n = r->strtab; n; n = n->next) - if (0 == strncmp(name, n->key.p, namesz) && - '\0' == n->key.p[(int)namesz]) { - free(n->key.p); - fprintf(stderr, "From %s to %s\n", n->key.p, newname); - n->key.p = mandoc_strdup(newname); - n->key.sz = strlen(n->key.p); - } - - return(ROFF_IGN); -} - -static enum rofferr roff_it(ROFF_ARGS) { int iv; From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 16:49:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6387621B; Mon, 2 Mar 2015 16:49:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B24BD2; Mon, 2 Mar 2015 16:49:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22GnlhE055044; Mon, 2 Mar 2015 16:49:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22GnkMM055037; Mon, 2 Mar 2015 16:49:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021649.t22GnkMM055037@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 16:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279526 - vendor/mdocml/20150302 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 16:49:47 -0000 Author: bapt Date: Mon Mar 2 16:49:45 2015 New Revision: 279526 URL: https://svnweb.freebsd.org/changeset/base/279526 Log: Tag import of mandoc 20150302 Added: vendor/mdocml/20150302/ - copied from r279523, vendor/mdocml/dist/ vendor/mdocml/20150302/Makefile.local - copied unchanged from r279524, vendor/mdocml/dist/Makefile.local vendor/mdocml/20150302/compat_strtonum.c - copied unchanged from r279524, vendor/mdocml/dist/compat_strtonum.c vendor/mdocml/20150302/test-strtonum.c - copied unchanged from r279524, vendor/mdocml/dist/test-strtonum.c Replaced: vendor/mdocml/20150302/LICENSE - copied unchanged from r279524, vendor/mdocml/dist/LICENSE vendor/mdocml/20150302/Makefile - copied unchanged from r279524, vendor/mdocml/dist/Makefile vendor/mdocml/20150302/Makefile.depend - copied unchanged from r279524, vendor/mdocml/dist/Makefile.depend vendor/mdocml/20150302/TODO - copied unchanged from r279524, vendor/mdocml/dist/TODO vendor/mdocml/20150302/apropos.1 - copied unchanged from r279524, vendor/mdocml/dist/apropos.1 vendor/mdocml/20150302/cgi.c - copied unchanged from r279524, vendor/mdocml/dist/cgi.c vendor/mdocml/20150302/chars.c - copied unchanged from r279524, vendor/mdocml/dist/chars.c vendor/mdocml/20150302/chars.in - copied unchanged from r279524, vendor/mdocml/dist/chars.in vendor/mdocml/20150302/compat_fts.c - copied unchanged from r279524, vendor/mdocml/dist/compat_fts.c vendor/mdocml/20150302/configure - copied unchanged from r279524, vendor/mdocml/dist/configure vendor/mdocml/20150302/configure.local.example - copied unchanged from r279524, vendor/mdocml/dist/configure.local.example vendor/mdocml/20150302/demandoc.c - copied unchanged from r279524, vendor/mdocml/dist/demandoc.c vendor/mdocml/20150302/eqn.7 - copied unchanged from r279524, vendor/mdocml/dist/eqn.7 vendor/mdocml/20150302/eqn.c - copied unchanged from r279524, vendor/mdocml/dist/eqn.c vendor/mdocml/20150302/eqn_term.c - copied unchanged from r279524, vendor/mdocml/dist/eqn_term.c vendor/mdocml/20150302/example.style.css - copied unchanged from r279524, vendor/mdocml/dist/example.style.css vendor/mdocml/20150302/gmdiff - copied unchanged from r279524, vendor/mdocml/dist/gmdiff vendor/mdocml/20150302/html.c - copied unchanged from r279524, vendor/mdocml/dist/html.c vendor/mdocml/20150302/libman.h - copied unchanged from r279524, vendor/mdocml/dist/libman.h vendor/mdocml/20150302/libmandoc.h - copied unchanged from r279524, vendor/mdocml/dist/libmandoc.h vendor/mdocml/20150302/libmdoc.h - copied unchanged from r279524, vendor/mdocml/dist/libmdoc.h vendor/mdocml/20150302/libroff.h - copied unchanged from r279524, vendor/mdocml/dist/libroff.h vendor/mdocml/20150302/main.c - copied unchanged from r279524, vendor/mdocml/dist/main.c vendor/mdocml/20150302/main.h - copied unchanged from r279524, vendor/mdocml/dist/main.h vendor/mdocml/20150302/man-cgi.css - copied unchanged from r279524, vendor/mdocml/dist/man-cgi.css vendor/mdocml/20150302/man.1 - copied unchanged from r279524, vendor/mdocml/dist/man.1 vendor/mdocml/20150302/man.7 - copied unchanged from r279524, vendor/mdocml/dist/man.7 vendor/mdocml/20150302/man.c - copied unchanged from r279524, vendor/mdocml/dist/man.c vendor/mdocml/20150302/man.h - copied unchanged from r279524, vendor/mdocml/dist/man.h vendor/mdocml/20150302/man_html.c - copied unchanged from r279524, vendor/mdocml/dist/man_html.c vendor/mdocml/20150302/man_macro.c - copied unchanged from r279524, vendor/mdocml/dist/man_macro.c vendor/mdocml/20150302/man_term.c - copied unchanged from r279524, vendor/mdocml/dist/man_term.c vendor/mdocml/20150302/man_validate.c - copied unchanged from r279524, vendor/mdocml/dist/man_validate.c vendor/mdocml/20150302/mandoc.1 - copied unchanged from r279524, vendor/mdocml/dist/mandoc.1 vendor/mdocml/20150302/mandoc.3 - copied unchanged from r279524, vendor/mdocml/dist/mandoc.3 vendor/mdocml/20150302/mandoc.c - copied unchanged from r279524, vendor/mdocml/dist/mandoc.c vendor/mdocml/20150302/mandoc.db.5 - copied unchanged from r279524, vendor/mdocml/dist/mandoc.db.5 vendor/mdocml/20150302/mandoc.h - copied unchanged from r279524, vendor/mdocml/dist/mandoc.h vendor/mdocml/20150302/mandoc_char.7 - copied unchanged from r279524, vendor/mdocml/dist/mandoc_char.7 vendor/mdocml/20150302/mandoc_escape.3 - copied unchanged from r279524, vendor/mdocml/dist/mandoc_escape.3 vendor/mdocml/20150302/mandoc_headers.3 - copied unchanged from r279524, vendor/mdocml/dist/mandoc_headers.3 vendor/mdocml/20150302/mandocdb.c - copied unchanged from r279524, vendor/mdocml/dist/mandocdb.c vendor/mdocml/20150302/manpage.c - copied unchanged from r279524, vendor/mdocml/dist/manpage.c vendor/mdocml/20150302/mansearch.c - copied unchanged from r279524, vendor/mdocml/dist/mansearch.c vendor/mdocml/20150302/mdoc.7 - copied unchanged from r279524, vendor/mdocml/dist/mdoc.7 vendor/mdocml/20150302/mdoc.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc.c vendor/mdocml/20150302/mdoc.h - copied unchanged from r279524, vendor/mdocml/dist/mdoc.h vendor/mdocml/20150302/mdoc_argv.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc_argv.c vendor/mdocml/20150302/mdoc_html.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc_html.c vendor/mdocml/20150302/mdoc_macro.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc_macro.c vendor/mdocml/20150302/mdoc_man.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc_man.c vendor/mdocml/20150302/mdoc_term.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc_term.c vendor/mdocml/20150302/mdoc_validate.c - copied unchanged from r279524, vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/20150302/msec.c - copied unchanged from r279524, vendor/mdocml/dist/msec.c vendor/mdocml/20150302/out.c - copied unchanged from r279524, vendor/mdocml/dist/out.c vendor/mdocml/20150302/preconv.c - copied unchanged from r279524, vendor/mdocml/dist/preconv.c vendor/mdocml/20150302/read.c - copied unchanged from r279524, vendor/mdocml/dist/read.c vendor/mdocml/20150302/roff.7 - copied unchanged from r279524, vendor/mdocml/dist/roff.7 vendor/mdocml/20150302/roff.c - copied unchanged from r279525, vendor/mdocml/dist/roff.c vendor/mdocml/20150302/st.in - copied unchanged from r279524, vendor/mdocml/dist/st.in vendor/mdocml/20150302/style.css - copied unchanged from r279524, vendor/mdocml/dist/style.css vendor/mdocml/20150302/tbl.3 - copied unchanged from r279524, vendor/mdocml/dist/tbl.3 vendor/mdocml/20150302/tbl.7 - copied unchanged from r279524, vendor/mdocml/dist/tbl.7 vendor/mdocml/20150302/tbl.c - copied unchanged from r279524, vendor/mdocml/dist/tbl.c vendor/mdocml/20150302/tbl_data.c - copied unchanged from r279524, vendor/mdocml/dist/tbl_data.c vendor/mdocml/20150302/tbl_html.c - copied unchanged from r279524, vendor/mdocml/dist/tbl_html.c vendor/mdocml/20150302/tbl_layout.c - copied unchanged from r279524, vendor/mdocml/dist/tbl_layout.c vendor/mdocml/20150302/tbl_opts.c - copied unchanged from r279524, vendor/mdocml/dist/tbl_opts.c vendor/mdocml/20150302/tbl_term.c - copied unchanged from r279524, vendor/mdocml/dist/tbl_term.c vendor/mdocml/20150302/term.c - copied unchanged from r279524, vendor/mdocml/dist/term.c vendor/mdocml/20150302/term.h - copied unchanged from r279524, vendor/mdocml/dist/term.h vendor/mdocml/20150302/term_ascii.c - copied unchanged from r279524, vendor/mdocml/dist/term_ascii.c vendor/mdocml/20150302/term_ps.c - copied unchanged from r279524, vendor/mdocml/dist/term_ps.c vendor/mdocml/20150302/tree.c - copied unchanged from r279524, vendor/mdocml/dist/tree.c Copied: vendor/mdocml/20150302/LICENSE (from r279524, vendor/mdocml/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20150302/LICENSE Mon Mar 2 16:49:45 2015 (r279526, copy of r279524, vendor/mdocml/dist/LICENSE) @@ -0,0 +1,47 @@ +$Id: LICENSE,v 1.7 2015/02/16 14:56:22 schwarze Exp $ + +With the exceptions noted below, all code and documentation +contained in the mdocml toolkit is protected by the Copyright +of the following developers: + +Copyright (c) 2008-2012, 2014 Kristaps Dzonsons +Copyright (c) 2010-2015 Ingo Schwarze +Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger +Copyright (c) 2013 Franco Fichtner +Copyright (c) 1999, 2004 Marc Espie +Copyright (c) 1998, 2004, 2010 Todd C. Miller +Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2004 Ted Unangst +Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre + +See the individual source files for information about who contributed +to which file during which years. + + +The mdocml distribution as a whole is distributed by its developers +under the following license: + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +The following files included from outside sources are protected by +other people's Copyright and are distributed under a 3-clause BSD +license; see these individual files for details. + +compat_fts.c, compat_fts.h, +compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, +man.1: +Copyright (c) 1989,1990,1993,1994 The Regents of the University of California + +compat_fgetln.c: +Copyright (c) 1998 The NetBSD Foundation, Inc. Copied: vendor/mdocml/20150302/Makefile (from r279524, vendor/mdocml/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20150302/Makefile Mon Mar 2 16:49:45 2015 (r279526, copy of r279524, vendor/mdocml/dist/Makefile) @@ -0,0 +1,419 @@ +# $Id: Makefile,v 1.456 2015/02/16 16:23:54 schwarze Exp $ +# +# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons +# Copyright (c) 2011, 2013, 2014 Ingo Schwarze +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +VERSION = 1.13.2 + +# === LIST OF FILES ==================================================== + +TESTSRCS = test-dirent-namlen.c \ + test-fgetln.c \ + test-fts.c \ + test-getsubopt.c \ + test-mmap.c \ + test-ohash.c \ + test-reallocarray.c \ + test-sqlite3.c \ + test-sqlite3_errstr.c \ + test-strcasestr.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + test-strsep.c \ + test-strtonum.c \ + test-wchar.c + +SRCS = att.c \ + cgi.c \ + chars.c \ + compat_fgetln.c \ + compat_fts.c \ + compat_getsubopt.c \ + compat_ohash.c \ + compat_reallocarray.c \ + compat_sqlite3_errstr.c \ + compat_strcasestr.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + compat_strsep.c \ + compat_strtonum.c \ + demandoc.c \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + html.c \ + lib.c \ + main.c \ + man.c \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.c \ + mandoc_aux.c \ + mandocdb.c \ + manpage.c \ + manpath.c \ + mansearch.c \ + mansearch_const.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + out.c \ + preconv.c \ + read.c \ + roff.c \ + st.c \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term_ascii.c \ + term_ps.c \ + tree.c \ + $(TESTSRCS) + +DISTFILES = INSTALL \ + LICENSE \ + Makefile \ + Makefile.depend \ + NEWS \ + TODO \ + apropos.1 \ + cgi.h.example \ + chars.in \ + compat_fts.h \ + compat_ohash.h \ + configure \ + configure.local.example \ + demandoc.1 \ + eqn.7 \ + example.style.css \ + gmdiff \ + html.h \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.h \ + makewhatis.8 \ + man-cgi.css \ + man.1 \ + man.7 \ + man.cgi.8 \ + man.h \ + mandoc.1 \ + mandoc.3 \ + mandoc.db.5 \ + mandoc.h \ + mandoc_aux.h \ + mandoc_char.7 \ + mandoc_escape.3 \ + mandoc_headers.3 \ + mandoc_html.3 \ + mandoc_malloc.3 \ + manpath.h \ + mansearch.3 \ + mansearch.h \ + mchars_alloc.3 \ + mdoc.7 \ + mdoc.h \ + msec.in \ + out.h \ + predefs.in \ + roff.7 \ + st.in \ + style.css \ + tbl.3 \ + tbl.7 \ + term.h \ + $(SRCS) + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o + +LIBMDOC_OBJS = att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + mandoc_aux.o \ + msec.o \ + preconv.o \ + read.o + +COMPAT_OBJS = compat_fgetln.o \ + compat_fts.o \ + compat_getsubopt.o \ + compat_ohash.o \ + compat_reallocarray.o \ + compat_sqlite3_errstr.o \ + compat_strcasestr.o \ + compat_strlcat.o \ + compat_strlcpy.o \ + compat_strsep.o \ + compat_strtonum.o + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o + +MANDOC_MAN_OBJS = mdoc_man.o + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o + +BASE_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + manpath.o \ + out.o \ + tree.o + +MAIN_OBJS = $(BASE_OBJS) + +DB_OBJS = mandocdb.o \ + mansearch.o \ + mansearch_const.o + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + cgi.o \ + mansearch.o \ + mansearch_const.o \ + out.o + +MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o + +DEMANDOC_OBJS = demandoc.o + +WWW_MANS = apropos.1.html \ + demandoc.1.html \ + man.1.html \ + mandoc.1.html \ + mandoc.3.html \ + mandoc_escape.3.html \ + mandoc_headers.3.html \ + mandoc_html.3.html \ + mandoc_malloc.3.html \ + mansearch.3.html \ + mchars_alloc.3.html \ + tbl.3.html \ + mandoc.db.5.html \ + eqn.7.html \ + man.7.html \ + mandoc_char.7.html \ + mdoc.7.html \ + roff.7.html \ + tbl.7.html \ + makewhatis.8.html \ + man.cgi.8.html \ + man.h.html \ + mandoc.h.html \ + mandoc_aux.h.html \ + manpath.h.html \ + mansearch.h.html \ + mdoc.h.html + +WWW_OBJS = mdocml.tar.gz \ + mdocml.sha256 + +# === USER CONFIGURATION =============================================== + +include Makefile.local + +# === DEPENDENCY HANDLING ============================================== + +all: base-build $(BUILD_TARGETS) Makefile.local + +base-build: mandoc demandoc + +cgi-build: man.cgi + +install: base-install $(INSTALL_TARGETS) + +www: $(WWW_OBJS) $(WWW_MANS) + +$(WWW_MANS): mandoc + +.PHONY: base-install cgi-install db-install install www-install +.PHONY: clean distclean depend + +include Makefile.depend + +# === TARGETS CONTAINING SHELL COMMANDS ================================ + +distclean: clean + rm -f Makefile.local config.h config.h.old config.log config.log.old + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) + rm -f mandoc $(BASE_OBJS) $(DB_OBJS) + rm -f man.cgi $(CGI_OBJS) + rm -f manpage $(MANPAGE_OBJS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f $(WWW_MANS) $(WWW_OBJS) + rm -rf *.dSYM + +base-install: base-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ + $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 + $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ + mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 + $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7 + $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7 + $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7 + $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7 + $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +db-install: base-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(SBINDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man5 + mkdir -p $(DESTDIR)$(MANDIR)/man8 + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) + ln -f $(DESTDIR)$(BINDIR)/mandoc \ + $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 + ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ + $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 + $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 + $(INSTALL_MAN) makewhatis.8 \ + $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 + +cgi-install: cgi-build + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1 + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8 + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/ + $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/ + +Makefile.local config.h: configure ${TESTSRCS} + @echo "$@ is out of date; please run ./configure" + @exit 1 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +mandoc: $(MAIN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MAIN_OBJS) libmandoc.a $(DBLIB) + +manpage: $(MANPAGE_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB) + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +# --- maintainer targets --- + +www-install: www + mkdir -p $(HTDOCDIR)/snapshots + $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR) + $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots + $(INSTALL_DATA) mdocml.tar.gz \ + $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.sha256 \ + $(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 + +depend: config.h + mkdep -f Makefile.depend $(CFLAGS) $(SRCS) + perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ + s|\\\n||g; s| +| |g; s| $$||mg; print;' \ + Makefile.depend > Makefile.tmp + mv Makefile.tmp Makefile.depend + +mdocml.sha256: mdocml.tar.gz + sha256 mdocml.tar.gz > $@ + +mdocml.tar.gz: $(DISTFILES) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION) + chmod 755 .dist/mdocml-$(VERSION)/configure + ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) + rm -rf .dist/ + +# === SUFFIX RULES ===================================================== + +.SUFFIXES: .1 .3 .5 .7 .8 .h +.SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html + +.h.h.html: + highlight -I $< > $@ + +.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc + ./mandoc -Thtml -Wall,stop \ + -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@ Copied: vendor/mdocml/20150302/Makefile.depend (from r279524, vendor/mdocml/dist/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20150302/Makefile.depend Mon Mar 2 16:49:45 2015 (r279526, copy of r279524, vendor/mdocml/dist/Makefile.depend) @@ -0,0 +1,74 @@ +att.o: att.c config.h mdoc.h libmdoc.h +cgi.o: cgi.c config.h mandoc.h mandoc_aux.h main.h manpath.h mansearch.h cgi.h +chars.o: chars.c config.h mandoc.h mandoc_aux.h libmandoc.h chars.in +compat_fgetln.o: compat_fgetln.c config.h +compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strsep.o: compat_strsep.c config.h +compat_strtonum.o: compat_strtonum.c config.h +demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h +eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h +eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h +html.o: html.c config.h mandoc.h mandoc_aux.h out.h html.h main.h +lib.o: lib.c config.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h manpath.h mansearch.h +man.o: man.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h +man_hash.o: man_hash.c config.h man.h libman.h +man_html.o: man_html.c config.h mandoc_aux.h man.h out.h html.h main.h +man_macro.o: man_macro.c config.h man.h mandoc.h libmandoc.h libman.h +man_term.o: man_term.c config.h mandoc.h mandoc_aux.h out.h man.h term.h main.h +man_validate.o: man_validate.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h +mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h +mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h +mandocdb.o: mandocdb.c config.h compat_fts.h compat_ohash.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h +manpage.o: manpage.c config.h manpath.h mansearch.h +manpath.o: manpath.c config.h mandoc_aux.h manpath.h +mansearch.o: mansearch.c config.h compat_ohash.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mansearch_const.o: mansearch_const.c config.h mansearch.h +mdoc.o: mdoc.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +mdoc_argv.o: mdoc_argv.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +mdoc_hash.o: mdoc_hash.c config.h mdoc.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mdoc.h out.h html.h main.h +mdoc_macro.o: mdoc_macro.c config.h mdoc.h mandoc.h libmdoc.h libmandoc.h +mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h +mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h +mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in +out.o: out.c config.h mandoc_aux.h mandoc.h out.h +preconv.o: preconv.c config.h mandoc.h libmandoc.h +read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h +roff.o: roff.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h predefs.in +st.o: st.c config.h mdoc.h libmdoc.h st.in +tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h +tbl_layout.o: tbl_layout.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h +tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h +term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h main.h +tree.o: tree.c config.h mandoc.h mdoc.h man.h main.h +test-dirent-namlen.o: test-dirent-namlen.c +test-fgetln.o: test-fgetln.c +test-fts.o: test-fts.c +test-getsubopt.o: test-getsubopt.c +test-mmap.o: test-mmap.c +test-ohash.o: test-ohash.c +test-reallocarray.o: test-reallocarray.c +test-sqlite3.o: test-sqlite3.c +test-sqlite3_errstr.o: test-sqlite3_errstr.c +test-strcasestr.o: test-strcasestr.c +test-strlcat.o: test-strlcat.c +test-strlcpy.o: test-strlcpy.c +test-strptime.o: test-strptime.c +test-strsep.o: test-strsep.c +test-strtonum.o: test-strtonum.c +test-wchar.o: test-wchar.c Copied: vendor/mdocml/20150302/Makefile.local (from r279524, vendor/mdocml/dist/Makefile.local) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20150302/Makefile.local Mon Mar 2 16:49:45 2015 (r279526, copy of r279524, vendor/mdocml/dist/Makefile.local) @@ -0,0 +1,30 @@ +BUILD_TARGETS = base-build +INSTALL_TARGETS = base-install db-install +CFLAGS = -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -I/usr/local/include +DBLIB = -L/usr/local/lib -lsqlite3 +STATIC = -static +PREFIX = /usr/local +BINDIR = /usr/local/bin +SBINDIR = /usr/local/sbin +INCLUDEDIR = /usr/local/include/mandoc +LIBDIR = /usr/local/lib/mandoc +MANDIR = /usr/local/man +EXAMPLEDIR = /usr/local/share/examples/mandoc +WWWPREFIX = /var/www +HTDOCDIR = /var/www/htdocs +CGIBINDIR = /var/www/cgi-bin +BINM_APROPOS = apropos +BINM_MAN = man +BINM_WHATIS = whatis +BINM_MAKEWHATIS = makewhatis +MANM_MAN = man +MANM_MDOC = mdoc +MANM_ROFF = roff +MANM_EQN = eqn +MANM_TBL = tbl +INSTALL = install +INSTALL_PROGRAM = install -m 0555 +INSTALL_LIB = install -m 0444 +INSTALL_MAN = install -m 0444 +INSTALL_DATA = install -m 0444 +MAIN_OBJS = $(BASE_OBJS) $(DB_OBJS) Copied: vendor/mdocml/20150302/TODO (from r279524, vendor/mdocml/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20150302/TODO Mon Mar 2 16:49:45 2015 (r279526, copy of r279524, vendor/mdocml/dist/TODO) @@ -0,0 +1,602 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.201 2015/02/20 13:47:28 schwarze Exp $ +************************************************************************ + +Many issues are annotated for difficulty as follows: + + - loc = locality of the issue + * single file issue, affects file only, or very few + ** single module issue, affects several files of one module + *** cross-module issue, significantly impacts multiple modules + and may require substantial changes to internal interfaces + - exist = difficulty of the existing code in this area + * affected code is straightforward and easy to read and change + ** affected code is somewhat complex, but once you understand + the design, not particularly difficult to understand + *** affected code uses a special, exceptionally tricky design + - algo = difficulty of the new algorithm to be written + * the required logic and code is straightforward + ** the required logic is somewhat complex and needs a careful design + *** the required logic is exceptionally tricky, + maybe an approach to solve that is not even known yet + - size = the amount of code to be written or changed + * a small number of lines (at most 100, usually much less) + ** a considerable amount of code (several dozen to a few hundred) + *** a large amount of code (many hundreds, maybe thousands) + - imp = importance of the issue + * mostly for completeness + ** would be nice to have + *** issue causes considerable inconvenience + +Obviously, as the issues have not been solved yet, these annotations +are mere guesses, and some may be wrong. + +************************************************************************ +* crashes +************************************************************************ + +- The abort() in bufcat(), html.c, can be triggered via buffmt_includes() + by running -Thtml -Oincludes on a file containing a long .In argument. + Fixing this will probably require reworking the whole bufcat() concept. + loc ** exist * algo * size ** imp ** + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .na -- temporarily disable adjustment without changing the mode + .ad -- re-enable adjustment without changing the mode + Adjustment mode is ignored while in no-fill mode (.nf). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- .fc (field control) + found by naddy@ in xloadimage(1) + loc ** exist *** algo * size * imp * + +- .nr third argument (auto-increment step size, requires \n+) + found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + loc *** exist *** algo *** size ** imp * + +- .ta (tab settings) + #1 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + ircbug(1) gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + also posix2time(3) Carsten Kunze Mon, 1 Dec 2014 13:03:10 +0100 + loc ** exist *** algo ** size ** imp *** + +- .ti (temporary indent) + found by naddy@ in xloadimage(1) [devel/libvstr] vstr(3) + found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600 + loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) + +- .while and .shift + found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 + loc * exist ** algo ** size ** imp ** + +- \h horizontal move + #2 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + found in cclive(1) nasm(1) bogofilter(1) asciidoc/DocBook output + bentley@ on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 + naddy@ Thu, 4 Dec 2014 16:26:41 +0100 + loc ** exist ** algo ** size * imp *** (parser reorg helps a lot) + +- \n+ and \n- numerical register increment and decrement + found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** + +- \n(.$ macro argument count number register; ocserv(8) by autogen + found by sthen@ Thu, 19 Feb 2015 22:03:01 +0000 + loc * exist ** algo * size * imp ** + +- \w'' improve width measurements + would not be very useful without an expression parser, see below + needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo *** size * imp *** + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + loc * exist * algo * size * imp * + +--- missing mdoc features ---------------------------------------------- + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + loc * exist *** algo *** size * imp ** + +- edge case: decide how to deal with blk_full bad nesting, e.g. + .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1) + from jmc@ Wed, 14 Jul 2010 18:10:32 +0100 + loc * exist *** algo *** size ** imp ** + +- .Bd -centered implies -filled, not -unfilled, which is not + easy to implement; it requires code similar to .ce, which + we don't have either. + Besides, groff has bug causing text right *before* .Bd -centered + to be centered as well. + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- .Bd -filled should not be the same as .Bd -ragged, but align both + the left and right margin. In groff, it is implemented in terms + of .ad b, which we don't have either. Found in cksum(1). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + loc * exist *** algo *** size * imp * + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + loc * exist * algo * size * imp ** + +- In .Bl -column .It, the end of the line probably has to be regarded + as an implicit .Ta, if there could be one, see the following mildly + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + loc * exist *** algo ** size * imp ** + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- check whether it is correct that `D1' uses INDENT+1; + does it need its own constant? + loc * exist ** algo ** size * imp ** + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- support translated section names + e.g. x11/scrotwm scrotwm_es.1:21:2: error: NAME section must be first + that one uses NOMBRE because it is spanish... + deraadt tends to think that section-dependent macro behaviour + is a bad idea in the first place, so this may be irrelevant + loc ** exist ** algo ** size * imp ** + +- When there is free text in the SYNOPSIS and that free text contains + the .Nm macro, groff somehow understands to treat the .Nm as an in-line + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + loc * exist ** algo *** size * imp ** + +--- missing man features ----------------------------------------------- + +- -T[x]html doesn't stipulate non-collapsing spaces in literal mode + +--- missing tbl features ----------------------------------------------- + +- look at the POSIX manuals in the books/man-pages-posix port, + they use some unsupported tbl(7) features. + loc * exist ** algo ** size ** imp *** + +- use Unicode U+2500 to U+256C for table borders + in tbl(7) -Tutf-8 output + suggested by bentley@ Tue, 14 Oct 2014 04:10:55 -0600 + loc * exist ** algo * size * imp ** + +- allow standalone `.' to be interpreted as an end-of-layout + delimiter instead of being thrown away as a no-op roff line + reported by Yuri Pankov, Wed 18 May 2011 11:34:59 CEST + loc ** exist ** algo ** size * imp ** + +--- missing eqn features ----------------------------------------------- + +- The "size" keyword is parsed, but ignored by the formatter. + loc * exist * algo * size * imp * + +- The spacing characters `~', `^', and tab are currently ignored, + see User's Guide (Second Edition) page 2 section 4. + loc * exist * algo ** size * imp ** + +- Mark and lineup are parsed and ignored, + see User's Guide (Second Edition) page 5 section 15. + loc ** exist ** algo ** size ** imp ** + +--- missing misc features ---------------------------------------------- + +- italic correction (\/) in PostScript mode + Werner LEMBERG on groff at gnu dot org Sun, 10 Nov 2013 12:47:46 + loc ** exist ** algo * size * imp * + +- When makewhatis(8) encounters a FATAL parse error, + it silently treats the file as formatted, which makes no sense + at all for paths like man1/foo.1 - and which also contradicts + what the manual says at the end of the description. + The end result will be ENOENT for file names returned + by mansearch() in manpage.file. + loc * exist * algo * size * imp ** + +- makewhatis(8) for preformatted pages: + parse the section number from the header line + and compare to the section number from the directory name + loc * exist * algo * size * imp ** + +- Does makewhatis(8) detect missing NAME sections, missing names, + and missing descriptions in all the file formats? + loc * exist * algo * size * imp *** + +- clean up escape sequence handling, creating three classes: + (1) fully implemented, or parsed and ignored without loss of content + (2) unimplemented, potentially causing loss of content + or serious mangling of formatting (e.g. \n) -> ERROR + see textproc/mgdiff(1) for nice examples + (3) undefined, just output the character -> perhaps WARNING + loc *** exist ** algo ** size ** imp *** (parser reorg helps) + +- kettenis wants base roff, ms, and me Fri, 1 Jan 2010 22:13:15 +0100 (CET) + loc ** exist ** algo ** size *** imp * + +--- compatibility checks ----------------------------------------------- + +- write a configure check for [[:<:]] support and provide some + fallback for whatis(1) when it doesn't work; + Svyatoslav Mishyn Wed, 17 Dec 2014 11:07:10 +0200 + +- is .Bk implemented correctly in modern groff? + sobrado@ Tue, 19 Apr 2011 22:12:55 +0200 + +- compare output to Heirloom roff, Solaris roff, and + http://repo.or.cz/w/neatroff.git http://litcave.rudi.ir/ + +- look at AT&T DWB http://www2.research.att.com/sw/download + Carsten Kunze has patches + Mon, 4 Aug 2014 17:01:28 +0200 + +- look at pages generated from reStructeredText, e.g. devel/mercurial hg(1) + These are a weird mixture of man(7) and custom autogenerated low-level + roff stuff. Figure out to what extent we can cope. + For details, see http://docutils.sourceforge.net/rst.html + noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200 + reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100 + +- look at pages generated from ronn(1) github.com/rtomayko/ronn + (based on markdown) + +- look at pages generated from Texinfo source by yat2m, e.g. security/gnupg + First impression is not that bad. + +- look at pages generated by pandoc; see + https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Writers/Man.hs + porting planned by kili@ Thu, 19 Jun 2014 19:46:28 +0200 + +- check compatibility with Plan9: + http://swtch.com/usr/local/plan9/tmac/tmac.an + http://swtch.com/plan9port/man/man7/man.html + "Anthony J. Bentley" 28 Dec 2010 21:58:40 -0700 + +- check compatibility with the man(7) formatter + https://raw.githubusercontent.com/rofl0r/hardcore-utils/master/man.c + +- check compatibility with + http://ikiwiki.info/plugins/contrib/mandoc/ + https://github.com/schmonz/ikiwiki/compare/mandoc + Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + +************************************************************************ +* formatting issues: ugly output +************************************************************************ + +- revisit empty in-line macros + look at the difference between "Em x Em ." and "Sq x Em ." + Carsten Kunze Fri, 12 Dec 2014 00:15:41 +0100 + loc *** exist *** algo *** size * imp ** + +- a column list with blank `Ta' cells triggers a spurious + start-with-whitespace printing of a newline + +- In .Bl -column, .It a"bc" + shows the quotes in groff, but not in mandoc + loc * exist *** algo ** size * imp ** + +- In .Bl -column, + .It Em AuthenticationKey Length + ought to render "Key Length" with emphasis, too, + see OpenBSD iked.conf(5). + reported again Nicolas Joly via wiz@ Wed, 12 Oct 2011 00:20:00 +0200 + loc * exist *** algo *** size ** imp *** + +- empty phrases in .Bl column produce too few blanks + try e.g. .Bl -column It Ta Ta + reported by millert Fri, 02 Apr 2010 16:13:46 -0400 + loc * exist *** algo *** size * imp ** + +- .%T can have trailing punctuation. Currently, it puts the trailing + punctuation into a trailing MDOC_TEXT element inside its own scope. + That element should rather be outside its scope, such that the + punctuation does not get underlines. This is not trivial to + implement because .%T then needs some features of in_line_eoln() - + slurp all arguments into one single text element - and one feature + of in_line() - put trailing punctuation out of scope. + Found in mount_nfs(8) and exports(5), search for "Appendix". + loc ** exist ** algo *** size * imp ** + +- Trailing punctuation after .%T triggers EOS spacing, at least + outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not + the right solution, it sends mandoc into an endless loop. + reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + loc * exist ** algo ** size * imp ** + +- global variables in the SYNOPSIS of section 3 pages + .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... + from kristaps@ Tue, 08 Jun 2010 11:13:32 +0200 + +- in enclosures, mandoc sometimes fancies a bogus end of sentence + reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 + loc * exist ** algo *** size * imp *** + +- a line starting with "\fB something" counts as starting with whitespace + and triggers a line break; found in audio/normalize-mp3(1) + loc ** exist * algo ** size * imp ** + +- formatting /usr/local/man/man1/latex2man.1 with groff and mandoc + reveals lots of bugs both in groff and mandoc... + reported by bentley@ Wed, 22 May 2013 23:49:30 -0600 + +--- PDF issues --------------------------------------------------------- + +- PDF output doesn't use a monospaced font for .Bd -literal + Example: "mandoc -Tpdf afterboot.8 > output.pdf && pdfviewer output.pdf". + Search the text "Routing tables". + Also check what PostScript mode does when fixing this. + reported by juanfra@ Wed, 04 Jun 2014 21:44:58 +0200 + instructions from juanfra@ Wed, 11 Jun 2014 02:21:01 +0200 + add a new <> block to the PDF files with /BaseFont /Courier + and change the /Name from /F0 to the new font (/F5 (?)). + loc * exist ** algo ** size * imp ** + +--- HTML issues -------------------------------------------------------- + +-
formatting is ugly + hints are easy to find on the web, e.g. + http://stackoverflow.com/questions/1713048/ + see also matthew@ Fri, 18 Jul 2014 19:25:12 -0700 + loc * exist * algo ** size * imp *** + +- jsg on icb, Nov 3, 2014: + try to guess Xr in man(7) for hyperlinking + +- The tables used to render the three-part page headers actually force + the width of the to the max-width given for . + Not yet sure how to fix that... + Observed by an Anonymous Coward on undeadly.org: + http://undeadly.org/cgi?action=article&sid=20140925064244&pid=1 + loc * exist * algo ** size * imp *** + +- consider whether can be used for Ar Dv Er Ev Fa Va. + from bentley@ Wed, 13 Aug 2014 09:17:55 -0600 + +- check https://github.com/trentm/mdocml + +************************************************************************ +* formatting issues: gratuitous differences +************************************************************************ + +- .Fn reopens a new scope after punctuation in mandoc, + but closes its scope for good in groff. + Do we want to change mandoc or groff? + Steffen Nurpmeso Sat, 08 Nov 2014 13:34:59 +0100 + loc * exist ** algo ** size * imp ** + +- In .Bl -enum -width 0n, groff continues one the same line after + the number, mandoc breaks the line. + mail to kristaps@ Mon, 20 Jul 2009 02:21:39 +0200 + loc * exist ** algo ** size * imp ** + +- .Pp between two .It in .Bl -column should produce one, + not two blank lines, see e.g. login.conf(5). *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 16:59:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D02F4E2; Mon, 2 Mar 2015 16:59:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9B1E1DA; Mon, 2 Mar 2015 16:59:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22Gx2kw059646; Mon, 2 Mar 2015 16:59:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22GwwPU059598; Mon, 2 Mar 2015 16:58:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021658.t22GwwPU059598@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 16:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279527 - in head: contrib/mdocml usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 16:59:03 -0000 Author: bapt Date: Mon Mar 2 16:58:57 2015 New Revision: 279527 URL: https://svnweb.freebsd.org/changeset/base/279527 Log: Update mandoc to cvs snaphot from 20150302 Use the new unsupp warning level to detect the unsupported manpages in man(1) Added: head/contrib/mdocml/Makefile.local - copied unchanged from r279526, vendor/mdocml/dist/Makefile.local head/contrib/mdocml/compat_strtonum.c - copied unchanged from r279526, vendor/mdocml/dist/compat_strtonum.c head/contrib/mdocml/test-strtonum.c - copied unchanged from r279526, vendor/mdocml/dist/test-strtonum.c Modified: head/contrib/mdocml/LICENSE head/contrib/mdocml/Makefile head/contrib/mdocml/Makefile.depend head/contrib/mdocml/TODO head/contrib/mdocml/apropos.1 head/contrib/mdocml/cgi.c head/contrib/mdocml/chars.c head/contrib/mdocml/chars.in head/contrib/mdocml/compat_fts.c head/contrib/mdocml/config.h head/contrib/mdocml/configure head/contrib/mdocml/configure.local.example head/contrib/mdocml/demandoc.c head/contrib/mdocml/eqn.7 head/contrib/mdocml/eqn.c head/contrib/mdocml/eqn_term.c head/contrib/mdocml/example.style.css head/contrib/mdocml/gmdiff head/contrib/mdocml/html.c head/contrib/mdocml/libman.h head/contrib/mdocml/libmandoc.h head/contrib/mdocml/libmdoc.h head/contrib/mdocml/libroff.h head/contrib/mdocml/main.c head/contrib/mdocml/main.h head/contrib/mdocml/man-cgi.css head/contrib/mdocml/man.1 head/contrib/mdocml/man.7 head/contrib/mdocml/man.c head/contrib/mdocml/man.h head/contrib/mdocml/man_html.c head/contrib/mdocml/man_macro.c head/contrib/mdocml/man_term.c head/contrib/mdocml/man_validate.c head/contrib/mdocml/mandoc.1 head/contrib/mdocml/mandoc.3 head/contrib/mdocml/mandoc.c head/contrib/mdocml/mandoc.db.5 head/contrib/mdocml/mandoc.h head/contrib/mdocml/mandoc_char.7 head/contrib/mdocml/mandoc_escape.3 head/contrib/mdocml/mandoc_headers.3 head/contrib/mdocml/mandocdb.c head/contrib/mdocml/manpage.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mdoc.7 head/contrib/mdocml/mdoc.c head/contrib/mdocml/mdoc.h head/contrib/mdocml/mdoc_argv.c head/contrib/mdocml/mdoc_html.c head/contrib/mdocml/mdoc_macro.c head/contrib/mdocml/mdoc_man.c head/contrib/mdocml/mdoc_term.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/msec.c head/contrib/mdocml/out.c head/contrib/mdocml/preconv.c head/contrib/mdocml/read.c head/contrib/mdocml/roff.7 head/contrib/mdocml/roff.c head/contrib/mdocml/st.in head/contrib/mdocml/style.css head/contrib/mdocml/tbl.3 head/contrib/mdocml/tbl.7 head/contrib/mdocml/tbl.c head/contrib/mdocml/tbl_data.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_layout.c head/contrib/mdocml/tbl_opts.c head/contrib/mdocml/tbl_term.c head/contrib/mdocml/term.c head/contrib/mdocml/term.h head/contrib/mdocml/term_ascii.c head/contrib/mdocml/term_ps.c head/contrib/mdocml/tree.c head/usr.bin/man/man.sh Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/contrib/mdocml/LICENSE ============================================================================== --- head/contrib/mdocml/LICENSE Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/LICENSE Mon Mar 2 16:58:57 2015 (r279527) @@ -1,16 +1,17 @@ -$Id: LICENSE,v 1.5 2014/12/11 07:56:24 schwarze Exp $ +$Id: LICENSE,v 1.7 2015/02/16 14:56:22 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright of the following developers: Copyright (c) 2008-2012, 2014 Kristaps Dzonsons -Copyright (c) 2010, 2011, 2012, 2013, 2014 Ingo Schwarze +Copyright (c) 2010-2015 Ingo Schwarze Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger Copyright (c) 2013 Franco Fichtner Copyright (c) 1999, 2004 Marc Espie -Copyright (c) 1998, 2010 Todd C. Miller +Copyright (c) 1998, 2004, 2010 Todd C. Miller Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2004 Ted Unangst Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre See the individual source files for information about who contributed Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/Makefile Mon Mar 2 16:58:57 2015 (r279527) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.453 2014/12/09 09:14:33 schwarze Exp $ +# $Id: Makefile,v 1.456 2015/02/16 16:23:54 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014 Ingo Schwarze @@ -15,6 +15,8 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +VERSION = 1.13.2 + # === LIST OF FILES ==================================================== TESTSRCS = test-dirent-namlen.c \ @@ -31,6 +33,7 @@ TESTSRCS = test-dirent-namlen.c \ test-strlcpy.c \ test-strptime.c \ test-strsep.c \ + test-strtonum.c \ test-wchar.c SRCS = att.c \ @@ -46,6 +49,7 @@ SRCS = att.c \ compat_strlcat.c \ compat_strlcpy.c \ compat_strsep.c \ + compat_strtonum.c \ demandoc.c \ eqn.c \ eqn_html.c \ @@ -189,7 +193,8 @@ COMPAT_OBJS = compat_fgetln.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ - compat_strsep.o + compat_strsep.o \ + compat_strtonum.o MANDOC_HTML_OBJS = eqn_html.o \ html.o \ @@ -211,6 +216,7 @@ BASE_OBJS = $(MANDOC_HTML_OBJS) \ $(MANDOC_MAN_OBJS) \ $(MANDOC_TERM_OBJS) \ main.o \ + manpath.o \ out.o \ tree.o @@ -218,8 +224,7 @@ MAIN_OBJS = $(BASE_OBJS) DB_OBJS = mandocdb.o \ mansearch.o \ - mansearch_const.o \ - manpath.o + mansearch_const.o CGI_OBJS = $(MANDOC_HTML_OBJS) \ cgi.o \ @@ -308,10 +313,12 @@ base-install: base-build mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man7 $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ $(DESTDIR)$(INCLUDEDIR) $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 @@ -330,12 +337,10 @@ db-install: base-build mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man8 ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) - ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) ln -f $(DESTDIR)$(BINDIR)/mandoc \ $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 - $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 @@ -377,7 +382,7 @@ demandoc: $(DEMANDOC_OBJS) libmandoc.a www-install: www mkdir -p $(HTDOCDIR)/snapshots - $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR)/man + $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR) $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots $(INSTALL_DATA) mdocml.tar.gz \ $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz Modified: head/contrib/mdocml/Makefile.depend ============================================================================== --- head/contrib/mdocml/Makefile.depend Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/Makefile.depend Mon Mar 2 16:58:57 2015 (r279527) @@ -11,6 +11,7 @@ compat_strcasestr.o: compat_strcasestr.c compat_strlcat.o: compat_strlcat.c config.h compat_strlcpy.o: compat_strlcpy.c config.h compat_strsep.o: compat_strsep.c config.h +compat_strtonum.o: compat_strtonum.c config.h demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h @@ -39,7 +40,7 @@ mdoc_macro.o: mdoc_macro.c config.h mdoc mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h -msec.o: msec.c config.h libmandoc.h msec.in +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h preconv.o: preconv.c config.h mandoc.h libmandoc.h read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h @@ -69,4 +70,5 @@ test-strlcat.o: test-strlcat.c test-strlcpy.o: test-strlcpy.c test-strptime.o: test-strptime.c test-strsep.o: test-strsep.c +test-strtonum.o: test-strtonum.c test-wchar.o: test-wchar.c Copied: head/contrib/mdocml/Makefile.local (from r279526, vendor/mdocml/dist/Makefile.local) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/Makefile.local Mon Mar 2 16:58:57 2015 (r279527, copy of r279526, vendor/mdocml/dist/Makefile.local) @@ -0,0 +1,30 @@ +BUILD_TARGETS = base-build +INSTALL_TARGETS = base-install db-install +CFLAGS = -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -I/usr/local/include +DBLIB = -L/usr/local/lib -lsqlite3 +STATIC = -static +PREFIX = /usr/local +BINDIR = /usr/local/bin +SBINDIR = /usr/local/sbin +INCLUDEDIR = /usr/local/include/mandoc +LIBDIR = /usr/local/lib/mandoc +MANDIR = /usr/local/man +EXAMPLEDIR = /usr/local/share/examples/mandoc +WWWPREFIX = /var/www +HTDOCDIR = /var/www/htdocs +CGIBINDIR = /var/www/cgi-bin +BINM_APROPOS = apropos +BINM_MAN = man +BINM_WHATIS = whatis +BINM_MAKEWHATIS = makewhatis +MANM_MAN = man +MANM_MDOC = mdoc +MANM_ROFF = roff +MANM_EQN = eqn +MANM_TBL = tbl +INSTALL = install +INSTALL_PROGRAM = install -m 0555 +INSTALL_LIB = install -m 0444 +INSTALL_MAN = install -m 0444 +INSTALL_DATA = install -m 0444 +MAIN_OBJS = $(BASE_OBJS) $(DB_OBJS) Modified: head/contrib/mdocml/TODO ============================================================================== --- head/contrib/mdocml/TODO Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/TODO Mon Mar 2 16:58:57 2015 (r279527) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.195 2014/12/13 13:14:39 schwarze Exp $ +* $Id: TODO,v 1.201 2015/02/20 13:47:28 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -60,7 +60,7 @@ are mere guesses, and some may be wrong. - .fc (field control) found by naddy@ in xloadimage(1) loc ** exist *** algo * size * imp * - + - .nr third argument (auto-increment step size, requires \n+) found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 loc * exist * algo * size * imp ** @@ -69,31 +69,37 @@ are mere guesses, and some may be wrong. reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 loc *** exist *** algo *** size ** imp * -- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) - reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 +- .ta (tab settings) + #1 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + ircbug(1) gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 also posix2time(3) Carsten Kunze Mon, 1 Dec 2014 13:03:10 +0100 loc ** exist *** algo ** size ** imp *** - .ti (temporary indent) - found by naddy@ in xloadimage(1) + found by naddy@ in xloadimage(1) [devel/libvstr] vstr(3) found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600 loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) -- .while and .shift +- .while and .shift found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 loc * exist ** algo ** size ** imp ** - \h horizontal move - found in cclive(1) and nasm(1) asciidoc/DocBook output + #2 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + found in cclive(1) nasm(1) bogofilter(1) asciidoc/DocBook output bentley@ on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 naddy@ Thu, 4 Dec 2014 16:26:41 +0100 - loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) + loc ** exist ** algo ** size * imp *** (parser reorg helps a lot) - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 loc * exist * algo * size * imp ** +- \n(.$ macro argument count number register; ocserv(8) by autogen + found by sthen@ Thu, 19 Feb 2015 22:03:01 +0000 + loc * exist ** algo * size * imp ** + - \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 @@ -105,10 +111,6 @@ are mere guesses, and some may be wrong. --- missing mdoc features ---------------------------------------------- -- fix bad block nesting involving multiple identical explicit blocks - see the OpenBSD mdoc_macro.c 1.47 commit message - loc * exist *** algo *** size * imp ** - - .Bl -column .Xo support is missing ultimate goal: restore .Xr and .Dv to @@ -255,6 +257,10 @@ are mere guesses, and some may be wrong. --- compatibility checks ----------------------------------------------- +- write a configure check for [[:<:]] support and provide some + fallback for whatis(1) when it doesn't work; + Svyatoslav Mishyn Wed, 17 Dec 2014 11:07:10 +0200 + - is .Bk implemented correctly in modern groff? sobrado@ Tue, 19 Apr 2011 22:12:55 +0200 @@ -347,6 +353,10 @@ are mere guesses, and some may be wrong. reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 loc * exist ** algo *** size * imp *** +- a line starting with "\fB something" counts as starting with whitespace + and triggers a line break; found in audio/normalize-mp3(1) + loc ** exist * algo ** size * imp ** + - formatting /usr/local/man/man1/latex2man.1 with groff and mandoc reveals lots of bugs both in groff and mandoc... reported by bentley@ Wed, 22 May 2013 23:49:30 -0600 @@ -457,7 +467,7 @@ are mere guesses, and some may be wrong. loc * exist * algo * size * imp * - trailing whitespace must be ignored even when followed by a font escape, - see for example + see for example makes \fBdig \fR operate in batch mode @@ -531,7 +541,7 @@ are mere guesses, and some may be wrong. How does SQLITE_CONFIG_PAGECACHE actually work? Document it! from kristaps@ Sat, 09 Aug 2014 13:51:36 +0200 -Several areas can be cleaned up to make mandoc even faster. These are +Several areas can be cleaned up to make mandoc even faster. These are - improve hashing mechanism for macros (quite important: performance) @@ -540,7 +550,7 @@ Several areas can be cleaned up to make - the PDF file is HUGE: this can be reduced by using relative offsets - instead of re-initialising the roff predefined-strings set before each - parse, create a read-only version the first time and copy it + parse, create a read-only version the first time and copy it loc * exist ** algo ** size * imp ** ************************************************************************ @@ -556,7 +566,7 @@ Several areas can be cleaned up to make - Find better ways to prevent endless loops in roff(7) macro and string expansion. - + - Finish cleanup of date handling. Decide which formats should be recognized where. Update both mdoc(7) and man(7) documentation. Modified: head/contrib/mdocml/apropos.1 ============================================================================== --- head/contrib/mdocml/apropos.1 Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/apropos.1 Mon Mar 2 16:58:57 2015 (r279527) @@ -1,4 +1,4 @@ -.\" $Id: apropos.1,v 1.36 2014/10/25 01:03:52 schwarze Exp $ +.\" $Id: apropos.1,v 1.37 2015/02/16 16:23:54 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons .\" Copyright (c) 2011, 2012, 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 25 2014 $ +.Dd $Mdocdate: February 16 2015 $ .Dt APROPOS 1 .Os .Sh NAME @@ -24,7 +24,7 @@ .Nd search manual page databases .Sh SYNOPSIS .Nm -.Op Fl acfhklVw +.Op Fl acfhklw .Op Fl C Ar file .Op Fl M Ar path .Op Fl m Ar path @@ -162,8 +162,6 @@ By default, pages from all sections are See .Xr man 1 for a listing of sections. -.It Fl V -Print version and exit. .It Fl w Instead of showing title lines, show the pathnames of the matching manual pages, just like Modified: head/contrib/mdocml/cgi.c ============================================================================== --- head/contrib/mdocml/cgi.c Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/cgi.c Mon Mar 2 16:58:57 2015 (r279527) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.102 2014/11/26 17:55:27 schwarze Exp $ */ +/* $Id: cgi.c,v 1.104 2015/02/10 08:05:30 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -58,10 +58,10 @@ static void catman(const struct req *, static void format(const struct req *, const char *); static void html_print(const char *); static void html_putchar(char); -static int http_decode(char *); +static int http_decode(char *); static void http_parse(struct req *, const char *); static void http_print(const char *); -static void http_putchar(char); +static void http_putchar(char); static void http_printquery(const struct req *, const char *); static void pathgen(struct req *); static void pg_error_badrequest(const char *); @@ -186,7 +186,7 @@ http_print(const char *p) static void html_print(const char *p) { - + if (NULL == p) return; while ('\0' != *p) @@ -621,7 +621,7 @@ pg_searchres(const struct req *req, stru for (i = 0; i < sz; i++) { printf("\n" "\n" - "q.manpath, r[i].file); http_printquery(req, "&"); printf("\">"); @@ -701,7 +701,7 @@ catman(const struct req *req, const char while (NULL != (p = fgetln(f, &len))) { bold = italic = 0; for (i = 0; i < (int)len - 1; i++) { - /* + /* * This means that the catpage is out of state. * Ignore it and keep going (although the * catpage is bogus). @@ -742,7 +742,7 @@ catman(const struct req *req, const char continue; } - /* + /* * Handle funny behaviour troff-isms. * These grok'd from the original man2html.c. */ @@ -780,7 +780,7 @@ catman(const struct req *req, const char } /* Bold mode. */ - + if (italic) printf(""); if ( ! bold) @@ -791,9 +791,9 @@ catman(const struct req *req, const char html_putchar(p[i]); } - /* + /* * Clean up the last character. - * We can get to a newline; don't print that. + * We can get to a newline; don't print that. */ if (italic) @@ -822,7 +822,6 @@ format(const struct req *req, const char struct man *man; void *vp; char *opts; - enum mandoclevel rc; int fd; int usepath; @@ -832,18 +831,11 @@ format(const struct req *req, const char } mchars = mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, + mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, mchars, req->q.manpath); - rc = mparse_readfd(mp, fd, file); + mparse_readfd(mp, fd, file); close(fd); - if (rc >= MANDOCLEVEL_FATAL) { - fprintf(stderr, "fatal mandoc error: %s/%s\n", - req->q.manpath, file); - pg_error_internal(); - return; - } - usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&opts, "fragment,man=%s?query=%%N&sec=%%S%s%s%s%s", @@ -899,7 +891,7 @@ pg_show(struct req *req, const char *ful pg_error_badrequest( "You did not specify a page to show."); return; - } + } manpath = mandoc_strndup(fullpath, file - fullpath); file++; @@ -1064,7 +1056,7 @@ main(void) MAN_DIR, strerror(errno)); pg_error_internal(); return(EXIT_FAILURE); - } + } memset(&req, 0, sizeof(struct req)); pathgen(&req); Modified: head/contrib/mdocml/chars.c ============================================================================== --- head/contrib/mdocml/chars.c Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/chars.c Mon Mar 2 16:58:57 2015 (r279527) @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.65 2014/10/29 00:17:43 schwarze Exp $ */ +/* $Id: chars.c,v 1.66 2015/02/17 20:37:16 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014 Ingo Schwarze @@ -38,7 +38,7 @@ struct ln { int unicode; }; -#define LINES_MAX 330 +#define LINES_MAX 332 #define CHAR(in, ch, code) \ { NULL, (in), (ch), (code) }, Modified: head/contrib/mdocml/chars.in ============================================================================== --- head/contrib/mdocml/chars.in Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/chars.in Mon Mar 2 16:58:57 2015 (r279527) @@ -1,4 +1,4 @@ -/* $Id: chars.in,v 1.49 2014/11/06 22:28:36 schwarze Exp $ */ +/* $Id: chars.in,v 1.52 2015/02/17 20:37:16 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -70,8 +70,10 @@ CHAR("ti", "~", 126) /* Quotes. */ CHAR("Bq", ",,", 8222) CHAR("bq", ",", 8218) -CHAR("lq", "``", 8220) -CHAR("rq", "\'\'", 8221) +CHAR("lq", "\"", 8220) +CHAR("rq", "\"", 8221) +CHAR("Lq", "``", 8220) +CHAR("Rq", "''", 8221) CHAR("oq", "`", 8216) CHAR("cq", "\'", 8217) CHAR("aq", "\'", 39) @@ -91,30 +93,30 @@ CHAR("ra", ">", 10217) CHAR("bv", "|", 9130) CHAR("braceex", "|", 9130) CHAR("bracketlefttp", "|", 9121) -CHAR("bracketleftbp", "|", 9123) +CHAR("bracketleftbt", "|", 9123) CHAR("bracketleftex", "|", 9122) CHAR("bracketrighttp", "|", 9124) -CHAR("bracketrightbp", "|", 9126) +CHAR("bracketrightbt", "|", 9126) CHAR("bracketrightex", "|", 9125) CHAR("lt", ",-", 9127) CHAR("bracelefttp", ",-", 9127) CHAR("lk", "{", 9128) CHAR("braceleftmid", "{", 9128) CHAR("lb", "`-", 9129) -CHAR("braceleftbp", "`-", 9129) +CHAR("braceleftbt", "`-", 9129) CHAR("braceleftex", "|", 9130) CHAR("rt", "-.", 9131) CHAR("bracerighttp", "-.", 9131) CHAR("rk", "}", 9132) CHAR("bracerightmid", "}", 9132) CHAR("rb", "-\'", 9133) -CHAR("bracerightbp", "-\'", 9133) +CHAR("bracerightbt", "-\'", 9133) CHAR("bracerightex", "|", 9130) CHAR("parenlefttp", "/", 9115) -CHAR("parenleftbp", "\\", 9117) +CHAR("parenleftbt", "\\", 9117) CHAR("parenleftex", "|", 9116) CHAR("parenrighttp", "\\", 9118) -CHAR("parenrightbp", "/", 9120) +CHAR("parenrightbt", "/", 9120) CHAR("parenrightex", "|", 9119) /* Greek characters. */ @@ -281,10 +283,10 @@ CHAR("!=", "!=", 8800) CHAR("==", "==", 8801) CHAR("ne", "!==", 8802) CHAR("=~", "=~", 8773) -CHAR("-~", "-~", 8771) +CHAR("|=", "-~", 8771) CHAR("ap", "~", 8764) CHAR("~~", "~~", 8776) -CHAR("~=", "~=", 8780) +CHAR("~=", "~=", 8776) CHAR("pt", "oc", 8733) CHAR("es", "{}", 8709) CHAR("mo", "E", 8712) @@ -357,7 +359,7 @@ CHAR("Fn", ",\bf", 402) CHAR("ba", "|", 124) CHAR("br", "|", 9474) CHAR("ul", "_", 95) -CHAR("rl", "-", 8254) +CHAR("rn", "-", 8254) CHAR("bb", "|", 166) CHAR("sl", "/", 47) CHAR("rs", "\\", 92) Modified: head/contrib/mdocml/compat_fts.c ============================================================================== --- head/contrib/mdocml/compat_fts.c Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/compat_fts.c Mon Mar 2 16:58:57 2015 (r279527) @@ -6,8 +6,8 @@ int dummy; #else -/* $Id: compat_fts.c,v 1.6 2014/12/11 18:20:07 schwarze Exp $ */ -/* $OpenBSD: fts.c,v 1.49 2014/11/23 00:14:22 guenther Exp $ */ +/* $Id: compat_fts.c,v 1.8 2015/02/07 07:53:01 schwarze Exp $ */ +/* $OpenBSD: fts.c,v 1.50 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -38,7 +38,6 @@ int dummy; * SUCH DAMAGE. */ -#include #include #include @@ -51,6 +50,8 @@ int dummy; #include #include "compat_fts.h" +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + static FTSENT *fts_alloc(FTS *, const char *, size_t); static FTSENT *fts_build(FTS *); static void fts_lfree(FTSENT *); @@ -62,10 +63,12 @@ static unsigned short fts_stat(FTS *, F static int fts_safe_changedir(FTS *, FTSENT *, int, const char *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) -#define MAX(a,b) (((a)>(b))?(a):(b)) #ifndef O_DIRECTORY #define O_DIRECTORY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif #define CLR(opt) (sp->fts_options &= ~(opt)) #define ISSET(opt) (sp->fts_options & (opt)) @@ -97,7 +100,7 @@ fts_open(char * const *argv, int options * Start out with 1K of path space, and enough, in any case, * to hold the user's paths. */ - if (fts_palloc(sp, MAX(fts_maxarglen(argv), PATH_MAX))) + if (fts_palloc(sp, MAXIMUM(fts_maxarglen(argv), PATH_MAX))) goto mem1; /* Allocate/initialize root's parent. */ Copied: head/contrib/mdocml/compat_strtonum.c (from r279526, vendor/mdocml/dist/compat_strtonum.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/compat_strtonum.c Mon Mar 2 16:58:57 2015 (r279527, copy of r279526, vendor/mdocml/dist/compat_strtonum.c) @@ -0,0 +1,76 @@ +#include "config.h" + +#if HAVE_STRTONUM + +int dummy; + +#else + +/* $Id: compat_strtonum.c,v 1.1 2015/02/16 14:56:22 schwarze Exp $ */ +/* $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */ + +/* + * Copyright (c) 2004 Ted Unangst and Todd Miller + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 + +long long +strtonum(const char *numstr, long long minval, long long maxval, + const char **errstrp) +{ + long long ll = 0; + int error = 0; + char *ep; + struct errval { + const char *errstr; + int err; + } ev[4] = { + { NULL, 0 }, + { "invalid", EINVAL }, + { "too small", ERANGE }, + { "too large", ERANGE }, + }; + + ev[0].err = errno; + errno = 0; + if (minval > maxval) { + error = INVALID; + } else { + ll = strtoll(numstr, &ep, 10); + if (numstr == ep || *ep != '\0') + error = INVALID; + else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + error = TOOSMALL; + else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) + error = TOOLARGE; + } + if (errstrp != NULL) + *errstrp = ev[error].errstr; + errno = ev[error].err; + if (error) + ll = 0; + + return (ll); +} + +#endif /* !HAVE_STRTONUM */ Modified: head/contrib/mdocml/config.h ============================================================================== --- head/contrib/mdocml/config.h Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/config.h Mon Mar 2 16:58:57 2015 (r279527) @@ -19,6 +19,7 @@ #define HAVE_STRLCPY 1 #define HAVE_STRPTIME 1 #define HAVE_STRSEP 1 +#define HAVE_STRTONUM 1 #define HAVE_WCHAR 1 #define HAVE_SQLITE3 1 #define HAVE_SQLITE3_ERRSTR 0 Modified: head/contrib/mdocml/configure ============================================================================== --- head/contrib/mdocml/configure Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/configure Mon Mar 2 16:58:57 2015 (r279527) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2014 Ingo Schwarze +# Copyright (c) 2014, 2015 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -31,10 +31,6 @@ echo "config.log: writing..." # Initialize all variables here, # such that nothing can leak in from the environment. -VERSION="1.13.2" -echo "VERSION=\"${VERSION}\"" 1>&2 -echo "VERSION=\"${VERSION}\"" 1>&3 - OSNAME= CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -` @@ -56,6 +52,7 @@ HAVE_STRLCAT= HAVE_STRLCPY= HAVE_STRPTIME= HAVE_STRSEP= +HAVE_STRTONUM= HAVE_WCHAR= HAVE_SQLITE3= @@ -70,6 +67,7 @@ INCLUDEDIR= LIBDIR= MANDIR= EXAMPLEDIR= +HOMEBREWDIR= WWWPREFIX="/var/www" HTDOCDIR= @@ -176,6 +174,7 @@ runtest strlcat STRLCAT || true runtest strlcpy STRLCPY || true runtest strptime STRPTIME || true runtest strsep STRSEP || true +runtest strtonum STRTONUM || true runtest wchar WCHAR || true # --- sqlite3 --- @@ -274,8 +273,8 @@ __HEREDOC__ [ ${HAVE_FGETLN} -eq 0 ] && echo "#include " echo -echo "#define VERSION \"${VERSION}\"" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" +[ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\"" cat << __HEREDOC__ #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN} @@ -289,6 +288,7 @@ cat << __HEREDOC__ #define HAVE_STRLCPY ${HAVE_STRLCPY} #define HAVE_STRPTIME ${HAVE_STRPTIME} #define HAVE_STRSEP ${HAVE_STRSEP} +#define HAVE_STRTONUM ${HAVE_STRTONUM} #define HAVE_WCHAR ${HAVE_WCHAR} #define HAVE_SQLITE3 ${HAVE_SQLITE3} #define HAVE_SQLITE3_ERRSTR ${HAVE_SQLITE3_ERRSTR} @@ -341,6 +341,9 @@ __HEREDOC__ [ ${HAVE_STRSEP} -eq 0 ] && \ echo "extern char *strsep(char **, const char *);" +[ ${HAVE_STRTONUM} -eq 0 ] && \ + echo "extern long long strtonum(const char *, long long, long long, const char **);" + echo echo "#endif /* MANDOC_CONFIG_H */" @@ -379,7 +382,6 @@ INSTALL_TARGETS="base-install" [ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install" cat << __HEREDOC__ -VERSION = ${VERSION} BUILD_TARGETS = ${BUILD_TARGETS} INSTALL_TARGETS = ${INSTALL_TARGETS} CFLAGS = ${CFLAGS} Modified: head/contrib/mdocml/configure.local.example ============================================================================== --- head/contrib/mdocml/configure.local.example Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/configure.local.example Mon Mar 2 16:58:57 2015 (r279527) @@ -1,6 +1,6 @@ -# $Id: configure.local.example,v 1.2 2014/12/09 09:14:33 schwarze Exp $ +# $Id: configure.local.example,v 1.6 2015/02/16 14:56:22 schwarze Exp $ # -# Copyright (c) 2014 Ingo Schwarze +# Copyright (c) 2014, 2015 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -74,6 +74,21 @@ LIBDIR="${PREFIX}/lib/mandoc" MANDIR="${PREFIX}/man" EXAMPLEDIR="${PREFIX}/share/examples/mandoc" +# The man(1) utility needs to know where the manuals reside. +# We know of two ways to tell it: via manpath(1) or man.conf(5). +# The latter is used by OpenBSD and NetBSD, the former by most +# other systems. + +# Force usage of manpath(1). +# If it is not installed or not operational, +# man(1), makewhatis(8), and apropos(1) will not work properly. +HAVE_MANPATH=1 + +# Force usage of man.conf(5). +# If it does not exist or contains no valid configuration, +# man(1), makewhatis(8), and apropos(1) will not work properly. +HAVE_MANPATH=0 + # Some distributions may want to avoid naming conflicts among manuals. # If you want to change the names of installed section 7 manual pages, # the following alternative names are suggested. @@ -87,6 +102,15 @@ MANM_ROFF="mandoc_roff" # default is "r MANM_EQN="mandoc_eqn" # default is "eqn" MANM_TBL="mandoc_tbl" # default is "tbl" +# Some distributions may want to avoid naming conflicts +# with another man(1) utility. +# If you want to change the name of the binary program, +# the following alternative name is suggested. +# Using a different name is possible as well. +# This changes the name of the installed section 1 manual page as well. + +BINM_MAN=mman # default is "man" + # It is possible to change the utility program used for installation # and the modes files are installed with. The defaults are: @@ -121,38 +145,29 @@ DBLIB="-L/usr/local/lib -lsqlite3" CFLAGS="${CFLAGS} -I/usr/local/include" -# The man(1) utility needs to know where the manuals reside. -# We know of two ways to tell it: via manpath(1) or man.conf(5). -# The latter is used by OpenBSD and NetBSD, the former by most -# other systems. - -# Force usage of manpath(1). -# If it is not installed or not operational, -# makewhatis(8) and apropos(1) will not work properly. - -HAVE_MANPATH=1 - -# Force usage of man.conf(5). -# If it does not exist or contains no valid configuration, -# makewhatis(8) and apropos(1) will not work properly. - -HAVE_MANPATH=0 - # Some distributions may want to avoid naming conflicts -# with groff, man-db, or other tools. -# If you want to change the names of binary programs, +# with another implementation of apropos(1) and makewhatis(8). +# If you want to change the names of the binary programs, # the following alternative names are suggested. # Using other names is possible as well. # This changes the names of the installed section 1 and section 8 # manual pages as well. -# It is possible to set only one or a few of these variables, +# It is possible to set only one or two of these variables, # there is no need to copy the whole block. BINM_APROPOS=mapropos # default is "apropos" -BINM_MAN=mman # default is "man" BINM_WHATIS=mwhatis # default is "whatis" BINM_MAKEWHATIS=mandocdb # default is "makewhatis" +# When using the "homebrew" package manager on Mac OS X, the actual +# manuals are located in a so-called "cellar" and only symlinked +# into the manual trees. To allow mandoc to follow such symlinks, +# you have to specify the physical location of the cellar as returned +# by realpath(3), for example: + +PREFIX="/usr/local" +HOMEBREWDIR="${PREFIX}/Cellar" + # --- user settings related man.cgi ------------------------------------ # By default, building man.cgi(8) is disabled. To enable it, copy @@ -211,6 +226,7 @@ HAVE_STRLCAT=0 HAVE_STRLCPY=0 HAVE_STRPTIME=0 HAVE_STRSEP=0 +HAVE_STRTONUM=0 HAVE_SQLITE3=0 HAVE_SQLITE3_ERRSTR=0 Modified: head/contrib/mdocml/demandoc.c ============================================================================== --- head/contrib/mdocml/demandoc.c Mon Mar 2 16:49:45 2015 (r279526) +++ head/contrib/mdocml/demandoc.c Mon Mar 2 16:58:57 2015 (r279527) @@ -1,4 +1,4 @@ -/* $Id: demandoc.c,v 1.12 2014/10/28 17:36:19 schwarze Exp $ */ +/* $Id: demandoc.c,v 1.15 2015/02/10 08:05:30 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -44,11 +44,12 @@ main(int argc, char *argv[]) { struct mparse *mp; struct mchars *mchars; - int ch, i, list; + int ch, fd, i, list; extern int optind; - progname = strrchr(argv[0], '/'); - if (progname == NULL) + if (argc < 1) + progname = "demandoc"; + else if ((progname = strrchr(argv[0], '/')) == NULL) progname = argv[0]; else ++progname; @@ -78,15 +79,19 @@ main(int argc, char *argv[]) argv += optind; mchars = mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, mchars, NULL); + mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, mchars, NULL); assert(mp); - if (0 == argc) + if (argc < 1) pmandoc(mp, STDIN_FILENO, "", list); for (i = 0; i < argc; i++) { mparse_reset(mp); - pmandoc(mp, -1, argv[i], list); + if (mparse_open(mp, &fd, argv[i]) != MANDOCLEVEL_OK) { + perror(argv[i]); + continue; + } + pmandoc(mp, fd, argv[i], list); } mparse_free(mp); @@ -108,16 +113,12 @@ pmandoc(struct mparse *mp, int fd, const struct man *man; int line, col; - if (mparse_readfd(mp, fd, fn) >= MANDOCLEVEL_FATAL) { - fprintf(stderr, "%s: Parse failure\n", fn); - return; - } - + mparse_readfd(mp, fd, fn); mparse_result(mp, &mdoc, &man, NULL); line = 1; col = 0; - if (mdoc) + if (mdoc) pmdoc(mdoc_node(mdoc), &line, &col, list); else if (man) pman(man_node(man), &line, &col, list); @@ -167,7 +168,7 @@ again: end = p - 1; while (end > start) - if ('.' == *end || ',' == *end || + if ('.' == *end || ',' == *end || '\'' == *end || '"' == *end || ')' == *end || '!' == *end || '?' == *end || ':' == *end || @@ -199,7 +200,7 @@ again: /* * Print the input word, skipping any special characters. */ - while ('\0' != *p) + while ('\0' != *p) if ('\\' == *p) { p++; esc = mandoc_escape(&p, NULL, NULL); @@ -220,7 +221,7 @@ pline(int line, int *linep, int *col, in /* * Print out as many lines as needed to reach parity with the - * original input. + * original input. */ while (*linep < line) { @@ -240,7 +241,7 @@ pmdoc(const struct mdoc_node *p, int *li pline(p->line, line, col, list); if (MDOC_TEXT == p->type) pstring(p->string, p->pos, col, list); - if (p->child) + if (p->child) pmdoc(p->child, line, col, list); } } @@ -254,7 +255,7 @@ pman(const struct man_node *p, int *line *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 17:20:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27C8FC7C; Mon, 2 Mar 2015 17:20:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1028C6CF; Mon, 2 Mar 2015 17:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22HKZQZ070206; Mon, 2 Mar 2015 17:20:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22HKZUC070203; Mon, 2 Mar 2015 17:20:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021720.t22HKZUC070203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279528 - in head/contrib/binutils: binutils/doc gas/doc ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 17:20:35 -0000 Author: bapt Date: Mon Mar 2 17:20:34 2015 New Revision: 279528 URL: https://svnweb.freebsd.org/changeset/base/279528 Log: Generate manpage out of the texinfo files using texi2mdoc Added: head/contrib/binutils/binutils/doc/binutils.7 (contents, props changed) head/contrib/binutils/gas/doc/as.7 (contents, props changed) head/contrib/binutils/ld/ld.7 (contents, props changed) head/contrib/binutils/ld/ldint.7 (contents, props changed) Added: head/contrib/binutils/binutils/doc/binutils.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/binutils/binutils/doc/binutils.7 Mon Mar 2 17:20:34 2015 (r279528) @@ -0,0 +1,4917 @@ +.Dd 2015-03-02 +.Dt BINUTILS 7 +.Os +.Sh NAME +.Nm binutils +.Nd GNU Binary Utilities +.Sh Introduction +This brief manual contains documentation for the GNU binary utilities version "2.17.50 +[FreeBSD] 2007-07-03": +.Pp +This document is distributed under the terms of the GNU Free Documentation +License. A copy of the license is included in the section entitled "GNU Free +Documentation License". +.Pp +.Sh ar +.Bd -literal -offset indent +ar [-]p[mod [relpos] [count]] archive [member...] +ar -M [ ) , +and continues executing even after errors. If you redirect standard input +to a script file, no prompts are issued, and +.Xr ar +abandons execution (with a nonzero exit code) on any error. +.Pp +The +.Xr ar +command language is +.Em not +designed to be equivalent to the command-line options; in fact, it provides +somewhat less control over archives. The only purpose of the command language +is to ease the transition to GNU +.Xr ar +for developers who already have scripts written for the MRI \(lqlibrarian\(rq program. +.Pp +The syntax for the +.Xr ar +command language is straightforward: +.Bl -bullet +.It +commands are recognized in upper or lower case; for example, +.Li LIST +is the same as +.Li list . +In the following descriptions, commands are shown in upper case for clarity. +.Pp +.It +a single command may appear on each line; it is the first word on the line. +.Pp +.It +empty lines are allowed, and have no effect. +.Pp +.It +comments are allowed; text after either of the characters +.Li * +or +.Li ; +is ignored. +.Pp +.It +Whenever you use a list of names as part of the argument to an +.Xr ar +command, you can separate the individual names with either commas or blanks. +Commas are shown in the explanations below, for clarity. +.Pp +.It +.Li + +is used as a line continuation character; if +.Li + +appears at the end of a line, the text on the following line is considered +part of the current command. +.El +.Pp +Here are the commands you can use in +.Xr ar +scripts, or when using +.Xr ar +interactively. Three of them have special significance: +.Pp +.Li OPEN +or +.Li CREATE +specify a +.Em current archive , +which is a temporary file required for most of the other commands. +.Pp +.Li SAVE +commits the changes so far specified by the script. Prior to +.Li SAVE , +commands affect only the temporary copy of the current archive. +.Pp +.Bl -tag -width Ds +.It ADDLIB Va archive +.It ADDLIB Va archive ( Va module, Va module, ... Va module) +Add all the contents of +.Va archive +(or, if specified, each named +.Va module +from +.Va archive ) +to the current archive. +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.It ADDMOD Va member, Va member, ... Va member +Add each named +.Va member +as a module in the current archive. +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.It CLEAR +Discard the contents of the current archive, canceling the effect of any operations +since the last +.Li SAVE . +May be executed (with no effect) even if no current archive is specified. +.Pp +.It CREATE Va archive +Creates an archive, and makes it the current archive (required for many other +commands). The new archive is created with a temporary name; it is not actually +saved as +.Va archive +until you use +.Li SAVE . +You can overwrite existing archives; similarly, the contents of any existing +file named +.Va archive +will not be destroyed until +.Li SAVE . +.Pp +.It DELETE Va module, Va module, ... Va module +Delete each listed +.Va module +from the current archive; equivalent to +.Li ar -d Va archive Va module ... Va module . +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.It DIRECTORY Va archive ( Va module, ... Va module) +.It DIRECTORY Va archive ( Va module, ... Va module) Va outputfile +List each named +.Va module +present in +.Va archive . +The separate command +.Li VERBOSE +specifies the form of the output: when verbose output is off, output is like +that of +.Li ar -t Va archive Va module... . +When verbose output is on, the listing is like +.Li ar -tv Va archive Va module... . +.Pp +Output normally goes to the standard output stream; however, if you specify +.Va outputfile +as a final argument, +.Xr ar +directs the output to that file. +.Pp +.It END +Exit from +.Xr ar , +with a +.Li 0 +exit code to indicate successful completion. This command does not save the +output file; if you have changed the current archive since the last +.Li SAVE +command, those changes are lost. +.Pp +.It EXTRACT Va module, Va module, ... Va module +Extract each named +.Va module +from the current archive, writing them into the current directory as separate +files. Equivalent to +.Li ar -x Va archive Va module... . +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.It LIST +Display full contents of the current archive, in \(lqverbose\(rq style regardless +of the state of +.Li VERBOSE . +The effect is like +.Li ar tv Va archive . +(This single command is a GNU +.Xr ar +enhancement, rather than present for MRI compatibility.) +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.It OPEN Va archive +Opens an existing archive for use as the current archive (required for many +other commands). Any changes as the result of subsequent commands will not +actually affect +.Va archive +until you next use +.Li SAVE . +.Pp +.It REPLACE Va module, Va module, ... Va module +In the current archive, replace each existing +.Va module +(named in the +.Li REPLACE +arguments) from files in the current working directory. To execute this command +without errors, both the file, and the module in the current archive, must +exist. +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.It VERBOSE +Toggle an internal flag governing the output from +.Li DIRECTORY . +When the flag is on, +.Li DIRECTORY +output matches output from +.Li ar -tv +\&...\&. +.Pp +.It SAVE +Commit your changes to the current archive, and actually save it as a file +with the name specified in the last +.Li CREATE +or +.Li OPEN +command. +.Pp +Requires prior use of +.Li OPEN +or +.Li CREATE . +.Pp +.El +.Sh nm +.Bd -literal -offset indent +nm [-a|--debug-syms] [-g|--extern-only] + [-B] [-C|--demangle[=style]] [-D|--dynamic] + [-S|--print-size] [-s|--print-armap] + [-A|-o|--print-file-name][--special-syms] + [-n|-v|--numeric-sort] [-p|--no-sort] + [-r|--reverse-sort] [--size-sort] [-u|--undefined-only] + [-t radix|--radix=radix] [-P|--portability] + [--target=bfdname] [-fformat|--format=format] + [--defined-only] [-l|--line-numbers] [--no-demangle] + [-V|--version] [-X 32_64] [--help] [objfile...] +.Ed +.Pp +GNU +.Xr nm +lists the symbols from object files +.Va objfile +\&...\&. If no object files are listed as arguments, +.Xr nm +assumes the file +.Pa a.out . +.Pp +For each symbol, +.Xr nm +shows: +.Pp +.Bl -bullet +.It +The symbol value, in the radix selected by options (see below), or hexadecimal +by default. +.Pp +.It +The symbol type. At least the following types are used; others are, as well, +depending on the object file format. If lowercase, the symbol is local; if +uppercase, the symbol is global (external). +.Pp +.Bl -tag -width Ds +.It A +The symbol's value is absolute, and will not be changed by further linking. +.Pp +.It B +The symbol is in the uninitialized data section (known as BSS). +.Pp +.It C +The symbol is common. Common symbols are uninitialized data. When linking, +multiple common symbols may appear with the same name. If the symbol is defined +anywhere, the common symbols are treated as undefined references. For more +details on common symbols, see the discussion of --warn-common in Options,,Linker +options,ld.info,The GNU linker. +.Pp +.It D +The symbol is in the initialized data section. +.Pp +.It G +The symbol is in an initialized data section for small objects. Some object +file formats permit more efficient access to small data objects, such as a +global int variable as opposed to a large global array. +.Pp +.It I +The symbol is an indirect reference to another symbol. This is a GNU extension +to the a.out object file format which is rarely used. +.Pp +.It N +The symbol is a debugging symbol. +.Pp +.It R +The symbol is in a read only data section. +.Pp +.It S +The symbol is in an uninitialized data section for small objects. +.Pp +.It T +The symbol is in the text (code) section. +.Pp +.It U +The symbol is undefined. +.Pp +.It V +The symbol is a weak object. When a weak defined symbol is linked with a normal +defined symbol, the normal defined symbol is used with no error. When a weak +undefined symbol is linked and the symbol is not defined, the value of the +weak symbol becomes zero with no error. +.Pp +.It W +The symbol is a weak symbol that has not been specifically tagged as a weak +object symbol. When a weak defined symbol is linked with a normal defined +symbol, the normal defined symbol is used with no error. When a weak undefined +symbol is linked and the symbol is not defined, the value of the symbol is +determined in a system-specific manner without error. On some systems, uppercase +indicates that a default value has been specified. +.Pp +.It - +The symbol is a stabs symbol in an a.out object file. In this case, the next +values printed are the stabs other field, the stabs desc field, and the stab +type. Stabs symbols are used to hold debugging information. For more information, +see Top,Stabs,Stabs Overview,stabs.info, The \(lqstabs\(rq debug format. +.Pp +.It ? +The symbol type is unknown, or object file format specific. +.El +.Pp +.It +The symbol name. +.El +.Pp +The long and short forms of options, shown here as alternatives, are equivalent. +.Pp +.Bl -tag -width Ds +.It -A +.It -o +.It --print-file-name +Precede each symbol by the name of the input file (or archive member) in which +it was found, rather than identifying the input file once only, before all +of its symbols. +.Pp +.It -a +.It --debug-syms +Display all symbols, even debugger-only symbols; normally these are not listed. +.Pp +.It -B +The same as +.Op --format=bsd +(for compatibility with the MIPS +.Xr nm ) . +.Pp +.It -C +.It --demangle[= Va style] +Decode ( +.Em demangle ) +low-level symbol names into user-level names. Besides removing any initial +underscore prepended by the system, this makes C++ function names readable. +Different compilers have different mangling styles. The optional demangling +style argument can be used to choose an appropriate demangling style for your +compiler.See Section +.Dq c++filt , +for more information on demangling. +.Pp +.It --no-demangle +Do not demangle low-level symbol names. This is the default. +.Pp +.It -D +.It --dynamic +Display the dynamic symbols rather than the normal symbols. This is only meaningful +for dynamic objects, such as certain types of shared libraries. +.Pp +.It -f Va format +.It --format= Va format +Use the output format +.Va format , +which can be +.Li bsd , +.Li sysv , +or +.Li posix . +The default is +.Li bsd . +Only the first character of +.Va format +is significant; it can be either upper or lower case. +.Pp +.It -g +.It --extern-only +Display only external symbols. +.Pp +.It -l +.It --line-numbers +For each symbol, use debugging information to try to find a filename and line +number. For a defined symbol, look for the line number of the address of the +symbol. For an undefined symbol, look for the line number of a relocation +entry which refers to the symbol. If line number information can be found, +print it after the other symbol information. +.Pp +.It -n +.It -v +.It --numeric-sort +Sort symbols numerically by their addresses, rather than alphabetically by +their names. +.Pp +.It -p +.It --no-sort +Do not bother to sort the symbols in any order; print them in the order encountered. +.Pp +.It -P +.It --portability +Use the POSIX.2 standard output format instead of the default format. Equivalent +to +.Li -f posix . +.Pp +.It -S +.It --print-size +Print size, not the value, of defined symbols for the +.Li bsd +output format. +.Pp +.It -s +.It --print-armap +When listing symbols from archive members, include the index: a mapping (stored +in the archive by +.Xr ar +or +.Xr ranlib ) +of which modules contain definitions for which names. +.Pp +.It -r +.It --reverse-sort +Reverse the order of the sort (whether numeric or alphabetic); let the last +come first. +.Pp +.It --size-sort +Sort symbols by size. The size is computed as the difference between the value +of the symbol and the value of the symbol with the next higher value. If the +.Li bsd +output format is used the size of the symbol is printed, rather than the value, +and +.Li -S +must be used in order both size and value to be printed. +.Pp +.It --special-syms +Display symbols which have a target-specific special meaning. These symbols +are usually used by the target for some special processing and are not normally +helpful when included included in the normal symbol lists. For example for +ARM targets this option would skip the mapping symbols used to mark transitions +between ARM code, THUMB code and data. +.Pp +.It -t Va radix +.It --radix= Va radix +Use +.Va radix +as the radix for printing the symbol values. It must be +.Li d +for decimal, +.Li o +for octal, or +.Li x +for hexadecimal. +.Pp +.It --target= Va bfdname +Specify an object code format other than your system's default format.See Section +.Dq Target Selection , +for more information. +.Pp +.It -u +.It --undefined-only +Display only undefined symbols (those external to each object file). +.Pp +.It --defined-only +Display only defined symbols for each object file. +.Pp +.It -V +.It --version +Show the version number of +.Xr nm +and exit. +.Pp +.It -X +This option is ignored for compatibility with the AIX version of +.Xr nm . +It takes one parameter which must be the string +.Op 32_64 . +The default mode of AIX +.Xr nm +corresponds to +.Op -X 32 , +which is not supported by GNU +.Xr nm . +.Pp +.It --help +Show a summary of the options to +.Xr nm +and exit. +.El +.Pp +.Sh objcopy +.Bd -literal -offset indent +objcopy [-F bfdname|--target=bfdname] + [-I bfdname|--input-target=bfdname] + [-O bfdname|--output-target=bfdname] + [-B bfdarch|--binary-architecture=bfdarch] + [-S|--strip-all] + [-g|--strip-debug] + [-K symbolname|--keep-symbol=symbolname] + [-N symbolname|--strip-symbol=symbolname] + [--strip-unneeded-symbol=symbolname] + [-G symbolname|--keep-global-symbol=symbolname] + [--localize-hidden] + [-L symbolname|--localize-symbol=symbolname] + [--globalize-symbol=symbolname] + [-W symbolname|--weaken-symbol=symbolname] + [-w|--wildcard] + [-x|--discard-all] + [-X|--discard-locals] + [-b byte|--byte=byte] + [-i interleave|--interleave=interleave] + [-j sectionname|--only-section=sectionname] + [-R sectionname|--remove-section=sectionname] + [-p|--preserve-dates] + [--debugging] + [--gap-fill=val] + [--pad-to=address] + [--set-start=val] + [--adjust-start=incr] + [--change-addresses=incr] + [--change-section-address section{=,+,-}val] + [--change-section-lma section{=,+,-}val] + [--change-section-vma section{=,+,-}val] + [--change-warnings] [--no-change-warnings] + [--set-section-flags section=flags] + [--add-section sectionname=filename] + [--rename-section oldname=newname[,flags]] + [--change-leading-char] [--remove-leading-char] + [--reverse-bytes=num] + [--srec-len=ival] [--srec-forceS3] + [--redefine-sym old=new] + [--redefine-syms=filename] + [--weaken] + [--keep-symbols=filename] + [--strip-symbols=filename] + [--strip-unneeded-symbols=filename] + [--keep-global-symbols=filename] + [--localize-symbols=filename] + [--globalize-symbols=filename] + [--weaken-symbols=filename] + [--alt-machine-code=index] + [--prefix-symbols=string] + [--prefix-sections=string] + [--prefix-alloc-sections=string] + [--add-GNU-debuglink=path-to-file] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 17:24:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15CB8E97; Mon, 2 Mar 2015 17:24:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA45276A; Mon, 2 Mar 2015 17:24:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22HO5tN073631; Mon, 2 Mar 2015 17:24:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22HO4mc073626; Mon, 2 Mar 2015 17:24:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021724.t22HO4mc073626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 17:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279529 - in head: . etc/mtree gnu/usr.bin/binutils/doc tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 17:24:06 -0000 Author: bapt Date: Mon Mar 2 17:24:04 2015 New Revision: 279529 URL: https://svnweb.freebsd.org/changeset/base/279529 Log: Install manpage version of texinfo documentation for binutils Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist head/gnu/usr.bin/binutils/doc/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Mar 2 17:20:34 2015 (r279528) +++ head/ObsoleteFiles.inc Mon Mar 2 17:24:04 2015 (r279529) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20150302: binutils documentation distributed as a manpage +OLD_FILES+=usr/share/doc/binutils/as.txt +OLD_FILES+=usr/share/doc/binutils/ld.txt +OLD_DIRS+=usr/share/doc/binutils # 20150222: Removed bcd(6) and ppt(6) OLD_FILES+=usr/bin/bcd OLD_FILES+=usr/bin/ppt Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon Mar 2 17:20:34 2015 (r279528) +++ head/etc/mtree/BSD.usr.dist Mon Mar 2 17:24:04 2015 (r279529) @@ -181,8 +181,6 @@ .. atm .. - binutils - .. legal intel_ipw .. Modified: head/gnu/usr.bin/binutils/doc/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/doc/Makefile Mon Mar 2 17:20:34 2015 (r279528) +++ head/gnu/usr.bin/binutils/doc/Makefile Mon Mar 2 17:24:04 2015 (r279529) @@ -2,11 +2,10 @@ .include "../Makefile.inc0" -.PATH: ${SRCDIR}/gas/doc ${SRCDIR}/ld +.PATH: ${SRCDIR}/gas/doc \ + ${SRCDIR}/ld \ + ${SRCDIR}/binutils/doc -FILESGROUPS= TOP - -TOPDIR= ${SHAREDIR}/doc/binutils -TOP= as.txt ld.txt +MAN= ld.7 ldint.7 as.7 binutils.7 .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 2 17:20:34 2015 (r279528) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 2 17:24:04 2015 (r279529) @@ -200,13 +200,15 @@ OLD_FILES+=usr/libdata/ldscripts/elf_x86 OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xsw OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xu OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xw -OLD_FILES+=usr/share/doc/binutils/as.txt -OLD_FILES+=usr/share/doc/binutils/ld.txt OLD_FILES+=usr/share/man/man1/as.1.gz OLD_FILES+=usr/share/man/man1/ld.1.gz OLD_FILES+=usr/share/man/man1/objcopy.1.gz OLD_FILES+=usr/share/man/man1/objdump.1.gz OLD_FILES+=usr/share/man/man1/readelf.1.gz +OLD_FILES+=usr/share/man/man7/as.7.gz +OLD_FILES+=usr/share/man/man7/ld.7.gz +OLD_FILES+=usr/share/man/man7/ldint.7.gz +OLD_FILES+=usr/share/man/man7/binutils.7.gz .endif .if ${MK_BLUETOOTH} == no From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 17:25:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59512FEC; Mon, 2 Mar 2015 17:25:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2B977C; Mon, 2 Mar 2015 17:25:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22HP3LV073809; Mon, 2 Mar 2015 17:25:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22HP33F073808; Mon, 2 Mar 2015 17:25:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503021725.t22HP33F073808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 17:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279530 - in head/contrib/binutils: gas/doc ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 17:25:04 -0000 Author: bapt Date: Mon Mar 2 17:25:03 2015 New Revision: 279530 URL: https://svnweb.freebsd.org/changeset/base/279530 Log: Remove pregenerated text version of the texinfo documentation Deleted: head/contrib/binutils/gas/doc/as.txt head/contrib/binutils/ld/ld.txt From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 17:30:27 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBA55480; Mon, 2 Mar 2015 17:30:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D56907DB; Mon, 2 Mar 2015 17:30:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22HURji074555; Mon, 2 Mar 2015 17:30:27 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22HUQGq074551; Mon, 2 Mar 2015 17:30:26 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201503021730.t22HUQGq074551@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 2 Mar 2015 17:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279531 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 17:30:28 -0000 Author: hrs Date: Mon Mar 2 17:30:26 2015 New Revision: 279531 URL: https://svnweb.freebsd.org/changeset/base/279531 Log: Implement Enhanced DAD algorithm for IPv6 described in draft-ietf-6man-enhanced-dad-13. This basically adds a random nonce option (RFC 3971) to NS messages for DAD probe to detect a looped back packet. This looped back packet prevented DAD on some pseudo-interfaces which aggregates multiple L2 links such as lagg(4). The length of the nonce is set to 6 bytes. This algorithm can be disabled by setting net.inet6.ip6.dad_enhanced sysctl to 0 in a per-vnet basis. Reported by: hiren Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D1835 Modified: head/sys/netinet/icmp6.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Mon Mar 2 17:25:03 2015 (r279530) +++ head/sys/netinet/icmp6.h Mon Mar 2 17:30:26 2015 (r279531) @@ -297,9 +297,11 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 +#define ND_OPT_NONCE 14 /* RFC 3971 */ #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ #define ND_OPT_RDNSS 25 /* RFC 6106 */ #define ND_OPT_DNSSL 31 /* RFC 6106 */ +#define ND_OPT_MAX 31 struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; @@ -330,6 +332,16 @@ struct nd_opt_mtu { /* MTU option */ u_int32_t nd_opt_mtu_mtu; } __packed; +#define ND_OPT_NONCE_LEN ((1 * 8) - 2) +#if ((ND_OPT_NONCE_LEN + 2) % 8) != 0 +#error "(ND_OPT_NONCE_LEN + 2) must be a multiple of 8." +#endif +struct nd_opt_nonce { /* nonce option */ + u_int8_t nd_opt_nonce_type; + u_int8_t nd_opt_nonce_len; + u_int8_t nd_opt_nonce[ND_OPT_NONCE_LEN]; +} __packed; + struct nd_opt_route_info { /* route info */ u_int8_t nd_opt_rti_type; u_int8_t nd_opt_rti_len; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Mar 2 17:25:03 2015 (r279530) +++ head/sys/netinet6/nd6.c Mon Mar 2 17:30:26 2015 (r279531) @@ -372,6 +372,7 @@ nd6_options(union nd_opts *ndopts) case ND_OPT_TARGET_LINKADDR: case ND_OPT_MTU: case ND_OPT_REDIRECTED_HEADER: + case ND_OPT_NONCE: if (ndopts->nd_opt_array[nd_opt->nd_opt_type]) { nd6log((LOG_INFO, "duplicated ND6 option found (type=%d)\n", @@ -526,7 +527,7 @@ nd6_llinfo_timer(void *arg) ln->la_asked++; nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); LLE_WUNLOCK(ln); - nd6_ns_output(ifp, NULL, dst, ln, 0); + nd6_ns_output(ifp, NULL, dst, ln, NULL); LLE_WLOCK(ln); } else { struct mbuf *m = ln->la_hold; @@ -573,7 +574,7 @@ nd6_llinfo_timer(void *arg) ln->ln_state = ND6_LLINFO_PROBE; nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); LLE_WUNLOCK(ln); - nd6_ns_output(ifp, dst, dst, ln, 0); + nd6_ns_output(ifp, dst, dst, ln, NULL); LLE_WLOCK(ln); } else { ln->ln_state = ND6_LLINFO_STALE; /* XXX */ @@ -585,7 +586,7 @@ nd6_llinfo_timer(void *arg) ln->la_asked++; nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); LLE_WUNLOCK(ln); - nd6_ns_output(ifp, dst, dst, ln, 0); + nd6_ns_output(ifp, dst, dst, ln, NULL); LLE_WLOCK(ln); } else { EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); @@ -2084,7 +2085,7 @@ nd6_output_lle(struct ifnet *ifp, struct nd6_llinfo_settimer_locked(lle, (long)ND_IFINFO(ifp)->retrans * hz / 1000); LLE_WUNLOCK(lle); - nd6_ns_output(ifp, NULL, &dst->sin6_addr, lle, 0); + nd6_ns_output(ifp, NULL, &dst->sin6_addr, lle, NULL); } else { /* We did the lookup so we need to do the unlock here. */ LLE_WUNLOCK(lle); Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Mon Mar 2 17:25:03 2015 (r279530) +++ head/sys/netinet6/nd6.h Mon Mar 2 17:30:26 2015 (r279531) @@ -359,7 +359,7 @@ VNET_DECLARE(int, ip6_temp_regen_advance #define V_ip6_temp_regen_advance VNET(ip6_temp_regen_advance) union nd_opts { - struct nd_opt_hdr *nd_opt_array[8]; /* max = target address list */ + struct nd_opt_hdr *nd_opt_array[16]; /* max = ND_OPT_NONCE */ struct { struct nd_opt_hdr *zero; struct nd_opt_hdr *src_lladdr; @@ -367,6 +367,16 @@ union nd_opts { struct nd_opt_prefix_info *pi_beg; /* multiple opts, start */ struct nd_opt_rd_hdr *rh; struct nd_opt_mtu *mtu; + struct nd_opt_hdr *__res6; + struct nd_opt_hdr *__res7; + struct nd_opt_hdr *__res8; + struct nd_opt_hdr *__res9; + struct nd_opt_hdr *__res10; + struct nd_opt_hdr *__res11; + struct nd_opt_hdr *__res12; + struct nd_opt_hdr *__res13; + struct nd_opt_nonce *nonce; + struct nd_opt_hdr *__res15; struct nd_opt_hdr *search; /* multiple opts */ struct nd_opt_hdr *last; /* multiple opts */ int done; @@ -379,6 +389,7 @@ union nd_opts { #define nd_opts_pi_end nd_opt_each.pi_end #define nd_opts_rh nd_opt_each.rh #define nd_opts_mtu nd_opt_each.mtu +#define nd_opts_nonce nd_opt_each.nonce #define nd_opts_search nd_opt_each.search #define nd_opts_last nd_opt_each.last #define nd_opts_done nd_opt_each.done @@ -425,7 +436,7 @@ void nd6_na_output(struct ifnet *, const const struct in6_addr *, u_long, int, struct sockaddr *); void nd6_ns_input(struct mbuf *, int, int); void nd6_ns_output(struct ifnet *, const struct in6_addr *, - const struct in6_addr *, struct llentry *, int); + const struct in6_addr *, struct llentry *, uint8_t *); caddr_t nd6_ifptomac(struct ifnet *); void nd6_dad_init(void); void nd6_dad_start(struct ifaddr *, int); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Mar 2 17:25:03 2015 (r279530) +++ head/sys/netinet6/nd6_nbr.c Mon Mar 2 17:30:26 2015 (r279531) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -61,6 +63,7 @@ __FBSDID("$FreeBSD$"); #ifdef RADIX_MPATH #include #endif +#include #include #include @@ -79,7 +82,7 @@ __FBSDID("$FreeBSD$"); #define SDL(s) ((struct sockaddr_dl *)s) struct dadq; -static struct dadq *nd6_dad_find(struct ifaddr *); +static struct dadq *nd6_dad_find(struct ifaddr *, struct nd_opt_nonce *); static void nd6_dad_add(struct dadq *dp); static void nd6_dad_del(struct dadq *dp); static void nd6_dad_rele(struct dadq *); @@ -88,16 +91,21 @@ static void nd6_dad_stoptimer(struct dad static void nd6_dad_timer(struct dadq *); static void nd6_dad_duplicated(struct ifaddr *, struct dadq *); static void nd6_dad_ns_output(struct dadq *, struct ifaddr *); -static void nd6_dad_ns_input(struct ifaddr *); +static void nd6_dad_ns_input(struct ifaddr *, struct nd_opt_nonce *); static void nd6_dad_na_input(struct ifaddr *); static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_long, int, struct sockaddr *, u_int); -static VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD - - specwise incorrect */ +static VNET_DEFINE(int, dad_enhanced) = 1; +#define V_dad_enhanced VNET(dad_enhanced) + +SYSCTL_DECL(_net_inet6_ip6); +SYSCTL_INT(_net_inet6_ip6, OID_AUTO, dad_enhanced, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(dad_enhanced), 0, + "Enable Enhanced DAD, which adds a random nonce to NS messages for DAD."); + static VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to transmit DAD packet */ -#define V_dad_ignore_ns VNET(dad_ignore_ns) #define V_dad_maxtry VNET(dad_maxtry) /* @@ -321,7 +329,7 @@ nd6_ns_input(struct mbuf *m, int off, in * silently ignore it. */ if (IN6_IS_ADDR_UNSPECIFIED(&saddr6)) - nd6_dad_ns_input(ifa); + nd6_dad_ns_input(ifa, ndopts.nd_opts_nonce); goto freeit; } @@ -382,12 +390,13 @@ nd6_ns_input(struct mbuf *m, int off, in * Based on RFC 2461 * Based on RFC 2462 (duplicate address detection) * - * ln - for source address determination - * dad - duplicate address detection + * ln - for source address determination + * nonce - If non-NULL, NS is used for duplicate address detection and + * the value (length is ND_OPT_NONCE_LEN) is used as a random nonce. */ void nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, - const struct in6_addr *taddr6, struct llentry *ln, int dad) + const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce) { struct mbuf *m; struct m_tag *mtag; @@ -453,7 +462,7 @@ nd6_ns_output(struct ifnet *ifp, const s if (in6_setscope(&ip6->ip6_dst, ifp, NULL) != 0) goto bad; } - if (!dad) { + if (nonce == NULL) { struct ifaddr *ifa; /* @@ -550,7 +559,7 @@ nd6_ns_output(struct ifnet *ifp, const s * Multicast NS MUST add one add the option * Unicast NS SHOULD add one add the option */ - if (!dad && (mac = nd6_ifptomac(ifp))) { + if (nonce == NULL && (mac = nd6_ifptomac(ifp))) { int optlen = sizeof(struct nd_opt_hdr) + ifp->if_addrlen; struct nd_opt_hdr *nd_opt = (struct nd_opt_hdr *)(nd_ns + 1); /* 8 byte alignments... */ @@ -564,7 +573,26 @@ nd6_ns_output(struct ifnet *ifp, const s nd_opt->nd_opt_len = optlen >> 3; bcopy(mac, (caddr_t)(nd_opt + 1), ifp->if_addrlen); } + /* + * Add a Nonce option (RFC 3971) to detect looped back NS messages. + * This behavior is documented as Enhanced Duplicate Address + * Detection in draft-ietf-6man-enhanced-dad-13. + * net.inet6.ip6.dad_enhanced=0 disables this. + */ + if (V_dad_enhanced != 0 && nonce != NULL) { + int optlen = sizeof(struct nd_opt_hdr) + ND_OPT_NONCE_LEN; + struct nd_opt_hdr *nd_opt = (struct nd_opt_hdr *)(nd_ns + 1); + /* 8-byte alignment is required. */ + optlen = (optlen + 7) & ~7; + m->m_pkthdr.len += optlen; + m->m_len += optlen; + icmp6len += optlen; + bzero((caddr_t)nd_opt, optlen); + nd_opt->nd_opt_type = ND_OPT_NONCE; + nd_opt->nd_opt_len = optlen >> 3; + bcopy(nonce, (caddr_t)(nd_opt + 1), ND_OPT_NONCE_LEN); + } ip6->ip6_plen = htons((u_short)icmp6len); nd_ns->nd_ns_cksum = 0; nd_ns->nd_ns_cksum = @@ -579,7 +607,8 @@ nd6_ns_output(struct ifnet *ifp, const s m_tag_prepend(m, mtag); } - ip6_output(m, NULL, &ro, dad ? IPV6_UNSPECSRC : 0, &im6o, NULL, NULL); + ip6_output(m, NULL, &ro, (nonce != NULL) ? IPV6_UNSPECSRC : 0, + &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_SOLICIT]); @@ -1139,9 +1168,13 @@ struct dadq { int dad_ns_ocount; /* NS sent so far */ int dad_ns_icount; int dad_na_icount; + int dad_ns_lcount; /* looped back NS */ struct callout dad_timer_ch; struct vnet *dad_vnet; u_int dad_refcnt; +#define ND_OPT_NONCE_LEN32 \ + ((ND_OPT_NONCE_LEN + sizeof(uint32_t) - 1)/sizeof(uint32_t)) + uint32_t dad_nonce[ND_OPT_NONCE_LEN32]; }; static VNET_DEFINE(TAILQ_HEAD(, dadq), dadq); @@ -1174,16 +1207,34 @@ nd6_dad_del(struct dadq *dp) } static struct dadq * -nd6_dad_find(struct ifaddr *ifa) +nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *n) { struct dadq *dp; + char ip6buf[INET6_ADDRSTRLEN]; DADQ_RLOCK(); - TAILQ_FOREACH(dp, &V_dadq, dad_list) - if (dp->dad_ifa == ifa) { - refcount_acquire(&dp->dad_refcnt); - break; + TAILQ_FOREACH(dp, &V_dadq, dad_list) { + if (dp->dad_ifa != ifa) + continue; + /* + * Skip if the nonce matches the received one. + * +2 in the length is required because of type and + * length fields are included in a header. + */ + if (n != NULL && + n->nd_opt_nonce_len == (ND_OPT_NONCE_LEN + 2) / 8 && + memcmp(&n->nd_opt_nonce[0], &dp->dad_nonce[0], + ND_OPT_NONCE_LEN) == 0) { + log(LOG_ERR, "%s: a looped back NS message is " + "detected during DAD for %s.\n", + if_name(ifa->ifa_ifp), + ip6_sprintf(ip6buf, IFA_IN6(ifa))); + dp->dad_ns_lcount++; + continue; } + refcount_acquire(&dp->dad_refcnt); + break; + } DADQ_RUNLOCK(); return (dp); @@ -1261,7 +1312,7 @@ nd6_dad_start(struct ifaddr *ifa, int de } if (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED) return; - if ((dp = nd6_dad_find(ifa)) != NULL) { + if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* DAD already in progress */ nd6_dad_rele(dp); return; @@ -1293,6 +1344,7 @@ nd6_dad_start(struct ifaddr *ifa, int de dp->dad_count = V_ip6_dad_count; dp->dad_ns_icount = dp->dad_na_icount = 0; dp->dad_ns_ocount = dp->dad_ns_tcount = 0; + dp->dad_ns_lcount = 0; refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); if (delay == 0) { @@ -1312,7 +1364,7 @@ nd6_dad_stop(struct ifaddr *ifa) { struct dadq *dp; - dp = nd6_dad_find(ifa); + dp = nd6_dad_find(ifa, NULL); if (!dp) { /* DAD wasn't started yet */ return; @@ -1325,7 +1377,7 @@ nd6_dad_stop(struct ifaddr *ifa) * we were waiting for it to stop, so re-do the lookup. */ nd6_dad_rele(dp); - if (nd6_dad_find(ifa) == NULL) + if (nd6_dad_find(ifa, NULL) == NULL) return; nd6_dad_del(dp); @@ -1421,9 +1473,10 @@ nd6_dad_duplicated(struct ifaddr *ifa, s char ip6buf[INET6_ADDRSTRLEN]; log(LOG_ERR, "%s: DAD detected duplicate IPv6 address %s: " - "NS in/out=%d/%d, NA in=%d\n", + "NS in/out/loopback=%d/%d/%d, NA in=%d\n", if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), - dp->dad_ns_icount, dp->dad_ns_ocount, dp->dad_na_icount); + dp->dad_ns_icount, dp->dad_ns_ocount, dp->dad_ns_lcount, + dp->dad_na_icount); ia->ia6_flags &= ~IN6_IFF_TENTATIVE; ia->ia6_flags |= IN6_IFF_DUPLICATED; @@ -1475,6 +1528,8 @@ nd6_dad_ns_output(struct dadq *dp, struc { struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct ifnet *ifp = ifa->ifa_ifp; + uint8_t *nonce; + int i; dp->dad_ns_tcount++; if ((ifp->if_flags & IFF_UP) == 0) { @@ -1485,11 +1540,25 @@ nd6_dad_ns_output(struct dadq *dp, struc } dp->dad_ns_ocount++; - nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, 1); + if (V_dad_enhanced != 0) { + for (i = 0; i < ND_OPT_NONCE_LEN32; i++) + dp->dad_nonce[i] = arc4random(); + nonce = (uint8_t *)&dp->dad_nonce[0]; + /* + * XXXHRS: Note that in the case that + * DupAddrDetectTransmits > 1, multiple NS messages with + * different nonces can be looped back in an unexpected + * order. The current implementation recognizes only + * the latest nonce on the sender side. Practically it + * should work well in almost all cases. + */ + } else + nonce = NULL; + nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, nonce); } static void -nd6_dad_ns_input(struct ifaddr *ifa) +nd6_dad_ns_input(struct ifaddr *ifa, struct nd_opt_nonce *ndopt_nonce) { struct in6_ifaddr *ia; struct ifnet *ifp; @@ -1502,22 +1571,13 @@ nd6_dad_ns_input(struct ifaddr *ifa) ia = (struct in6_ifaddr *)ifa; ifp = ifa->ifa_ifp; taddr6 = &ia->ia_addr.sin6_addr; - dp = nd6_dad_find(ifa); + /* Ignore Nonce option when Enhanced DAD is disabled. */ + if (V_dad_enhanced == 0) + ndopt_nonce = NULL; + dp = nd6_dad_find(ifa, ndopt_nonce); if (dp == NULL) return; - /* Quickhack - completely ignore DAD NS packets */ - if (V_dad_ignore_ns) { - char ip6buf[INET6_ADDRSTRLEN]; - nd6log((LOG_INFO, - "nd6_dad_ns_input: ignoring DAD NS packet for " - "address %s(%s)\n", ip6_sprintf(ip6buf, taddr6), - if_name(ifa->ifa_ifp))); - return; - } - - /* XXX more checks for loopback situation - see nd6_dad_timer too */ - dp->dad_ns_icount++; nd6_dad_rele(dp); } @@ -1530,7 +1590,7 @@ nd6_dad_na_input(struct ifaddr *ifa) if (ifa == NULL) panic("ifa == NULL in nd6_dad_na_input"); - dp = nd6_dad_find(ifa); + dp = nd6_dad_find(ifa, NULL); if (dp != NULL) { dp->dad_na_icount++; nd6_dad_rele(dp); From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 18:04:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F80F128; Mon, 2 Mar 2015 18:04:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A86BC70; Mon, 2 Mar 2015 18:04:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22I4wWS094244; Mon, 2 Mar 2015 18:04:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22I4w3a094243; Mon, 2 Mar 2015 18:04:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503021804.t22I4w3a094243@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 2 Mar 2015 18:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279532 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 18:04:58 -0000 Author: gjb Date: Mon Mar 2 18:04:57 2015 New Revision: 279532 URL: https://svnweb.freebsd.org/changeset/base/279532 Log: Use xz(1) to compress FreeBSD/arm images. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Mon Mar 2 17:30:26 2015 (r279531) +++ head/release/arm/release.sh Mon Mar 2 18:04:57 2015 (r279532) @@ -99,6 +99,7 @@ main() { BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) UNAME_r=${REVISION}-${BRANCH} export UNAME_r + export XZ_CMD=$(make -C /usr/src/release -V XZ_CMD) # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ @@ -146,9 +147,9 @@ main() { -c /tmp/external/${XDEV}/crochet-${KERNEL}.conf mkdir -p ${CHROOTDIR}/R/ cp -p ${CHROOTDIR}/usr/obj/*.img ${CHROOTDIR}/R/ - bzip2 ${CHROOTDIR}/R/FreeBSD*.img - cd ${CHROOTDIR}/R/ && sha256 FreeBSD*.img.bz2 > CHECKSUM.SHA256 - cd ${CHROOTDIR}/R/ && md5 FreeBSD*.img.bz2 > CHECKSUM.MD5 + ${XZ_CMD} ${CHROOTDIR}/R/FreeBSD*.img + cd ${CHROOTDIR}/R/ && sha256 FreeBSD*.img.xz > CHECKSUM.SHA256 + cd ${CHROOTDIR}/R/ && md5 FreeBSD*.img.xz > CHECKSUM.MD5 } main "$@" From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 18:08:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 358F92AD; Mon, 2 Mar 2015 18:08:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 201F1CA2; Mon, 2 Mar 2015 18:08:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22I8d7W095094; Mon, 2 Mar 2015 18:08:39 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22I8dvX095093; Mon, 2 Mar 2015 18:08:39 GMT (envelope-from br@FreeBSD.org) Message-Id: <201503021808.t22I8dvX095093@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 2 Mar 2015 18:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279533 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 18:08:40 -0000 Author: br Date: Mon Mar 2 18:08:39 2015 New Revision: 279533 URL: https://svnweb.freebsd.org/changeset/base/279533 Log: o Add more room for EFI boot blocks o Specify the filename as argument Differential Revision: https://reviews.freebsd.org/D1999 Reviewed by: emaste@ Modified: head/sys/boot/amd64/boot1.efi/generate-fat.sh Modified: head/sys/boot/amd64/boot1.efi/generate-fat.sh ============================================================================== --- head/sys/boot/amd64/boot1.efi/generate-fat.sh Mon Mar 2 18:04:57 2015 (r279532) +++ head/sys/boot/amd64/boot1.efi/generate-fat.sh Mon Mar 2 18:08:39 2015 (r279533) @@ -13,7 +13,19 @@ FAT_SIZE=1600 #Size in 512-byte blocks of the produced image -BOOT1_SIZE=64k +BOOT1_SIZE=128k + +# +# Known filenames +# amd64: BOOTx64.efi +# arm64: BOOTaa64.efi +# +if [ -z "$1" ]; then + echo "Usage: $0 filename" + exit 1 +fi + +FILENAME=$1 # Generate 800K FAT image OUTPUT_FILE=fat.tmpl @@ -28,7 +40,7 @@ mount -t msdosfs /dev/$DEVICE stub mkdir -p stub/efi/boot # Make a dummy file for boot1 -echo 'Boot1 START' | dd of=stub/efi/boot/BOOTx64.efi cbs=$BOOT1_SIZE count=1 conv=block +echo 'Boot1 START' | dd of=stub/efi/boot/$FILENAME cbs=$BOOT1_SIZE count=1 conv=block umount stub mdconfig -d -u $DEVICE From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 18:09:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BD8C406; Mon, 2 Mar 2015 18:09:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76622CBB; Mon, 2 Mar 2015 18:09:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22I9oBI095373; Mon, 2 Mar 2015 18:09:50 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22I9oIC095372; Mon, 2 Mar 2015 18:09:50 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503021809.t22I9oIC095372@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 2 Mar 2015 18:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279534 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 18:09:50 -0000 Author: ken Date: Mon Mar 2 18:09:49 2015 New Revision: 279534 URL: https://svnweb.freebsd.org/changeset/base/279534 Log: Change the sa(4) driver to check for long position support on SCSI-2 devices. Some older tape devices claim to be SCSI-2, but actually do support long position information. (Long position information includes the current file mark.) For example, the COMPAQ SuperDLT1. So we now only disable the check on SCSI-1 and older devices. sys/cam/scsi/scsi_sa.c: In saregister(), only disable fetching long position information on SCSI-1 and older drives. Update the comment to explain why. Confirmed by: dvl Sponsored by: Spectra Logic MFC after: 3 weeks Modified: head/sys/cam/scsi/scsi_sa.c Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Mon Mar 2 18:08:39 2015 (r279533) +++ head/sys/cam/scsi/scsi_sa.c Mon Mar 2 18:09:49 2015 (r279534) @@ -2396,9 +2396,13 @@ saregister(struct cam_periph *periph, vo * Long format data for READ POSITION was introduced in SSC, which * was after SCSI-2. (Roughly equivalent to SCSI-3.) If the drive * reports that it is SCSI-2 or older, it is unlikely to support - * long position data. + * long position data, but it might. Some drives from that era + * claim to be SCSI-2, but do support long position information. + * So, instead of immediately disabling long position information + * for SCSI-2 devices, we'll try one pass through sagetpos(), and + * then disable long position information if we get an error. */ - if (cgd->inq_data.version <= SCSI_REV_2) + if (cgd->inq_data.version <= SCSI_REV_CCS) softc->quirks |= SA_QUIRK_NO_LONG_POS; if (cgd->inq_data.spc3_flags & SPC3_SID_PROTECT) { From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 18:10:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E80F7577; Mon, 2 Mar 2015 18:10:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2F3ED68; Mon, 2 Mar 2015 18:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22IAxUP096646; Mon, 2 Mar 2015 18:10:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22IAxTF096645; Mon, 2 Mar 2015 18:10:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503021810.t22IAxTF096645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 2 Mar 2015 18:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279535 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 18:11:00 -0000 Author: gjb Date: Mon Mar 2 18:10:58 2015 New Revision: 279535 URL: https://svnweb.freebsd.org/changeset/base/279535 Log: Properly evaluate XZ_CMD from the chroot. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Mon Mar 2 18:09:49 2015 (r279534) +++ head/release/arm/release.sh Mon Mar 2 18:10:58 2015 (r279535) @@ -99,7 +99,7 @@ main() { BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) UNAME_r=${REVISION}-${BRANCH} export UNAME_r - export XZ_CMD=$(make -C /usr/src/release -V XZ_CMD) + export XZ_CMD=$(chroot ${CHROOTDIR} make -C /usr/src/release -V XZ_CMD) # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 19:04:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 815669C9; Mon, 2 Mar 2015 19:04:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 613A15F7; Mon, 2 Mar 2015 19:04:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22J4TAp028672; Mon, 2 Mar 2015 19:04:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22J4Spi028669; Mon, 2 Mar 2015 19:04:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503021904.t22J4Spi028669@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Mar 2015 19:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279536 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 19:04:29 -0000 Author: trasz Date: Mon Mar 2 19:04:27 2015 New Revision: 279536 URL: https://svnweb.freebsd.org/changeset/base/279536 Log: Make fuse(4) respect FOPEN_DIRECT_IO. This is required for correct operation of GlusterFS. PR: 192701 Submitted by: harsha at harshavardhana.net Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Mon Mar 2 18:10:58 2015 (r279535) +++ head/sys/fs/fuse/fuse_node.c Mon Mar 2 19:04:27 2015 (r279536) @@ -273,8 +273,26 @@ fuse_vnode_open(struct vnode *vp, int32_ * Funcation is called for every vnode open. * Merge fuse_open_flags it may be 0 * - * XXXIP: Handle FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE + * XXXIP: Handle FOPEN_KEEP_CACHE */ + /* + * Ideally speaking, direct io should be enabled on + * fd's but do not see of any way of providing that + * this implementation. + + * Also cannot think of a reason why would two + * different fd's on same vnode would like + * have DIRECT_IO turned on and off. But linux + * based implementation works on an fd not an + * inode and provides such a feature. + * + * XXXIP: Handle fd based DIRECT_IO + */ + if (fuse_open_flags & FOPEN_DIRECT_IO) { + VTOFUD(vp)->flag |= FN_DIRECTIO; + } else { + VTOFUD(vp)->flag &= ~FN_DIRECTIO; + } if (vnode_vtype(vp) == VREG) { /* XXXIP prevent getattr, by using cached node size */ Modified: head/sys/fs/fuse/fuse_node.h ============================================================================== --- head/sys/fs/fuse/fuse_node.h Mon Mar 2 18:10:58 2015 (r279535) +++ head/sys/fs/fuse/fuse_node.h Mon Mar 2 19:04:27 2015 (r279536) @@ -67,6 +67,7 @@ #define FN_FLUSHINPROG 0x00000040 #define FN_FLUSHWANT 0x00000080 #define FN_SIZECHANGE 0x00000100 +#define FN_DIRECTIO 0x00000200 struct fuse_vnode_data { /** self **/ Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Mon Mar 2 18:10:58 2015 (r279535) +++ head/sys/fs/fuse/fuse_vnops.c Mon Mar 2 19:04:27 2015 (r279536) @@ -1173,6 +1173,11 @@ fuse_vnop_read(struct vop_read_args *ap) if (fuse_isdeadfs(vp)) { return ENXIO; } + + if (VTOFUD(vp)->flag & FN_DIRECTIO) { + ioflag |= IO_DIRECT; + } + return fuse_io_dispatch(vp, uio, ioflag, cred); } @@ -1712,6 +1717,10 @@ fuse_vnop_write(struct vop_write_args *a } fuse_vnode_refreshsize(vp, cred); + if (VTOFUD(vp)->flag & FN_DIRECTIO) { + ioflag |= IO_DIRECT; + } + return fuse_io_dispatch(vp, uio, ioflag, cred); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 19:14:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2264F07; Mon, 2 Mar 2015 19:14:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BDFB7A8; Mon, 2 Mar 2015 19:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22JExB0034348; Mon, 2 Mar 2015 19:14:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22JExve034347; Mon, 2 Mar 2015 19:14:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201503021914.t22JExve034347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 2 Mar 2015 19:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279537 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 19:14:59 -0000 Author: jkim Date: Mon Mar 2 19:14:58 2015 New Revision: 279537 URL: https://svnweb.freebsd.org/changeset/base/279537 Log: Fix white spaces. Modified: head/sys/fs/fuse/fuse_node.c Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Mon Mar 2 19:04:27 2015 (r279536) +++ head/sys/fs/fuse/fuse_node.c Mon Mar 2 19:14:58 2015 (r279537) @@ -270,24 +270,24 @@ void fuse_vnode_open(struct vnode *vp, int32_t fuse_open_flags, struct thread *td) { /* - * Funcation is called for every vnode open. - * Merge fuse_open_flags it may be 0 - * - * XXXIP: Handle FOPEN_KEEP_CACHE - */ - /* - * Ideally speaking, direct io should be enabled on - * fd's but do not see of any way of providing that - * this implementation. - - * Also cannot think of a reason why would two - * different fd's on same vnode would like - * have DIRECT_IO turned on and off. But linux - * based implementation works on an fd not an - * inode and provides such a feature. - * - * XXXIP: Handle fd based DIRECT_IO - */ + * Funcation is called for every vnode open. + * Merge fuse_open_flags it may be 0 + * + * XXXIP: Handle FOPEN_KEEP_CACHE + */ + /* + * Ideally speaking, direct io should be enabled on + * fd's but do not see of any way of providing that + * this implementation. + * + * Also cannot think of a reason why would two + * different fd's on same vnode would like + * have DIRECT_IO turned on and off. But linux + * based implementation works on an fd not an + * inode and provides such a feature. + * + * XXXIP: Handle fd based DIRECT_IO + */ if (fuse_open_flags & FOPEN_DIRECT_IO) { VTOFUD(vp)->flag |= FN_DIRECTIO; } else { From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:00:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACE4E148; Mon, 2 Mar 2015 20:00:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 972A1CDD; Mon, 2 Mar 2015 20:00:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22K04Hg057978; Mon, 2 Mar 2015 20:00:04 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22K03sY057966; Mon, 2 Mar 2015 20:00:03 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201503022000.t22K03sY057966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 2 Mar 2015 20:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279538 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:00:04 -0000 Author: hrs Date: Mon Mar 2 20:00:03 2015 New Revision: 279538 URL: https://svnweb.freebsd.org/changeset/base/279538 Log: Fix group membership of cloned interfaces when one is moved by if_vmove(). In if_vmove(), if_detach_internal() and if_attach_internal() were called in series to detach and reattach the interface. When detaching, if_delgroup() was called and the interface leaves all of the group membership. And then upon attachment, if_addgroup(ifp, IFG_ALL) was called and it joined only "all" group again. This had a problem. Normally, a cloned interface automatically joins a group whose name is ifc_name of the cloner in addition to "all" upon creation. However, if_vmove() removed the membership and did not restore upon attachment. Differential Revision: https://reviews.freebsd.org/D1859 Modified: head/sys/net/if.c head/sys/net/if_clone.c head/sys/net/if_clone.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Mar 2 19:14:58 2015 (r279537) +++ head/sys/net/if.c Mon Mar 2 20:00:03 2015 (r279538) @@ -172,8 +172,8 @@ static void do_link_state_change(void *, static int if_getgroup(struct ifgroupreq *, struct ifnet *); static int if_getgroupmembers(struct ifgroupreq *); static void if_delgroups(struct ifnet *); -static void if_attach_internal(struct ifnet *, int); -static void if_detach_internal(struct ifnet *, int); +static void if_attach_internal(struct ifnet *, int, struct if_clone *); +static void if_detach_internal(struct ifnet *, int, struct if_clone **); #ifdef INET6 /* @@ -558,6 +558,15 @@ ifq_delete(struct ifaltq *ifq) * tasks, given that we are moving from one vnet to another an ifnet which * has already been fully initialized. * + * Note that if_detach_internal() removes group membership unconditionally + * even when vmove flag is set, and if_attach_internal() adds only IFG_ALL. + * Thus, when if_vmove() is applied to a cloned interface, group membership + * is lost while a cloned one always joins a group whose name is + * ifc->ifc_name. To recover this after if_detach_internal() and + * if_attach_internal(), the cloner should be specified to + * if_attach_internal() via ifc. If it is non-NULL, if_attach_internal() + * attempts to join a group whose name is ifc->ifc_name. + * * XXX: * - The decision to return void and thus require this function to * succeed is questionable. @@ -568,7 +577,7 @@ void if_attach(struct ifnet *ifp) { - if_attach_internal(ifp, 0); + if_attach_internal(ifp, 0, NULL); } /* @@ -623,7 +632,7 @@ if_hw_tsomax_update(if_t ifp, struct ifn } static void -if_attach_internal(struct ifnet *ifp, int vmove) +if_attach_internal(struct ifnet *ifp, int vmove, struct if_clone *ifc) { unsigned socksize, ifasize; int namelen, masklen; @@ -642,6 +651,10 @@ if_attach_internal(struct ifnet *ifp, in if_addgroup(ifp, IFG_ALL); + /* Restore group membership for cloned interfaces. */ + if (vmove && ifc != NULL) + if_clone_addgroup(ifp, ifc); + getmicrotime(&ifp->if_lastchange); ifp->if_epoch = time_uptime; @@ -860,12 +873,12 @@ if_detach(struct ifnet *ifp) { CURVNET_SET_QUIET(ifp->if_vnet); - if_detach_internal(ifp, 0); + if_detach_internal(ifp, 0, NULL); CURVNET_RESTORE(); } static void -if_detach_internal(struct ifnet *ifp, int vmove) +if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) { struct ifaddr *ifa; struct radix_node_head *rnh; @@ -894,6 +907,10 @@ if_detach_internal(struct ifnet *ifp, in return; /* XXX this should panic as well? */ } + /* Check if this is a cloned interface or not. */ + if (vmove && ifcp != NULL) + *ifcp = if_clone_findifc(ifp); + /* * Remove/wait for pending events. */ @@ -999,12 +1016,13 @@ if_detach_internal(struct ifnet *ifp, in void if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { + struct if_clone *ifc; /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. */ - if_detach_internal(ifp, 1); + if_detach_internal(ifp, 1, &ifc); /* * Unlink the ifnet from ifindex_table[] in current vnet, and shrink @@ -1034,7 +1052,7 @@ if_vmove(struct ifnet *ifp, struct vnet ifnet_setbyindex_locked(ifp->if_index, ifp); IFNET_WUNLOCK(); - if_attach_internal(ifp, 1); + if_attach_internal(ifp, 1, ifc); CURVNET_RESTORE(); } Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Mon Mar 2 19:14:58 2015 (r279537) +++ head/sys/net/if_clone.c Mon Mar 2 20:00:03 2015 (r279538) @@ -518,6 +518,49 @@ done: } /* + * if_clone_findifc() looks up ifnet from the current + * cloner list, and returns ifc if found. Note that ifc_refcnt + * is incremented. + */ +struct if_clone * +if_clone_findifc(struct ifnet *ifp) +{ + struct if_clone *ifc, *ifc0; + struct ifnet *ifcifp; + + ifc0 = NULL; + IF_CLONERS_LOCK(); + LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { + IF_CLONE_LOCK(ifc); + LIST_FOREACH(ifcifp, &ifc->ifc_iflist, if_clones) { + if (ifp == ifcifp) { + ifc0 = ifc; + IF_CLONE_ADDREF_LOCKED(ifc); + break; + } + } + IF_CLONE_UNLOCK(ifc); + if (ifc0 != NULL) + break; + } + IF_CLONERS_UNLOCK(); + + return (ifc0); +} + +/* + * if_clone_addgroup() decrements ifc_refcnt because it is called after + * if_clone_findifc(). + */ +void +if_clone_addgroup(struct ifnet *ifp, struct if_clone *ifc) +{ + + if_addgroup(ifp, ifc->ifc_name); + IF_CLONE_REMREF(ifc); +} + +/* * A utility function to extract unit numbers from interface names of * the form name###. * Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Mon Mar 2 19:14:58 2015 (r279537) +++ head/sys/net/if_clone.h Mon Mar 2 20:00:03 2015 (r279538) @@ -69,6 +69,8 @@ void vnet_if_clone_init(void); int if_clone_create(char *, size_t, caddr_t); int if_clone_destroy(const char *); int if_clone_list(struct if_clonereq *); +struct if_clone *if_clone_findifc(struct ifnet *); +void if_clone_addgroup(struct ifnet *, struct if_clone *); /* The below interface used only by epair(4). */ int if_clone_destroyif(struct if_clone *, struct ifnet *); From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:05:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9525A696; Mon, 2 Mar 2015 20:05:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FEFFDD6; Mon, 2 Mar 2015 20:05:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22K5HBq062908; Mon, 2 Mar 2015 20:05:17 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22K5HTL062907; Mon, 2 Mar 2015 20:05:17 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201503022005.t22K5HTL062907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 2 Mar 2015 20:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279539 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:05:17 -0000 Author: jmg Date: Mon Mar 2 20:05:16 2015 New Revision: 279539 URL: https://svnweb.freebsd.org/changeset/base/279539 Log: give others fair warning that _SPARE2 isn't just cxgb, but used by large number of other subsystems, so you probably don't want _SPARE2.. ktr needs an overhaul to really only compile in the ones you want, we've long passed the 31 bits it provides.. Sponsored by: transip.nl Modified: head/sys/sys/ktr_class.h Modified: head/sys/sys/ktr_class.h ============================================================================== --- head/sys/sys/ktr_class.h Mon Mar 2 20:00:03 2015 (r279538) +++ head/sys/sys/ktr_class.h Mon Mar 2 20:05:16 2015 (r279539) @@ -51,12 +51,12 @@ #define KTR_TRAP 0x00000100 /* Trap processing */ #define KTR_INTR 0x00000200 /* Interrupt tracing */ #define KTR_SIG 0x00000400 /* Signal processing */ -#define KTR_SPARE2 0x00000800 /* XXX Used by cxgb */ +#define KTR_SPARE2 0x00000800 /* cxgb, amd64, xen, clk, &c */ #define KTR_PROC 0x00001000 /* Process scheduling */ #define KTR_SYSC 0x00002000 /* System call */ #define KTR_INIT 0x00004000 /* System initialization */ -#define KTR_SPARE3 0x00008000 /* XXX Used by cxgb */ -#define KTR_SPARE4 0x00010000 /* XXX Used by cxgb */ +#define KTR_SPARE3 0x00008000 /* cxgb, drm2, ntb */ +#define KTR_SPARE4 0x00010000 /* geom_sched */ #define KTR_EVH 0x00020000 /* Eventhandler */ #define KTR_VFS 0x00040000 /* VFS events */ #define KTR_VOP 0x00080000 /* Auto-generated vop events */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:13:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E39BDA60; Mon, 2 Mar 2015 20:13:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4EC2ECA; Mon, 2 Mar 2015 20:13:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22KDov5068515; Mon, 2 Mar 2015 20:13:50 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22KDoGK068513; Mon, 2 Mar 2015 20:13:50 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201503022013.t22KDoGK068513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Mon, 2 Mar 2015 20:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279540 - head/sys/amd64/vmm/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:13:51 -0000 Author: neel Date: Mon Mar 2 20:13:49 2015 New Revision: 279540 URL: https://svnweb.freebsd.org/changeset/base/279540 Log: Fix warnings/errors when building vmm.ko with gcc: - fix warning about comparison of 'uint8_t v_tpr >= 0' always being true. - fix error triggered by an empty clobber list in the inline assembly for "clgi" and "stgi" - fix error when compiling "vmload %rax", "vmrun %rax" and "vmsave %rax". The gcc assembler does not like the explicit operand "%rax" while the clang assembler requires specifying the operand "%rax". Fix this by encoding the instructions using the ".byte" directive. Reported by: julian MFC after: 1 week Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/amd/svm_support.S Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Mon Mar 2 20:05:16 2015 (r279539) +++ head/sys/amd64/vmm/amd/svm.c Mon Mar 2 20:13:49 2015 (r279540) @@ -1641,7 +1641,7 @@ done: * VMRUN. */ v_tpr = vlapic_get_cr8(vlapic); - KASSERT(v_tpr >= 0 && v_tpr <= 15, ("invalid v_tpr %#x", v_tpr)); + KASSERT(v_tpr <= 15, ("invalid v_tpr %#x", v_tpr)); if (ctrl->v_tpr != v_tpr) { VCPU_CTR2(sc->vm, vcpu, "VMCB V_TPR changed from %#x to %#x", ctrl->v_tpr, v_tpr); @@ -1808,14 +1808,14 @@ static __inline void disable_gintr(void) { - __asm __volatile("clgi" : : :); + __asm __volatile("clgi"); } static __inline void enable_gintr(void) { - __asm __volatile("stgi" : : :); + __asm __volatile("stgi"); } /* Modified: head/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- head/sys/amd64/vmm/amd/svm_support.S Mon Mar 2 20:05:16 2015 (r279539) +++ head/sys/amd64/vmm/amd/svm_support.S Mon Mar 2 20:13:49 2015 (r279540) @@ -22,6 +22,8 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ #include @@ -35,6 +37,10 @@ #define VENTER push %rbp ; mov %rsp,%rbp #define VLEAVE pop %rbp +#define VMLOAD .byte 0x0f, 0x01, 0xda +#define VMRUN .byte 0x0f, 0x01, 0xd8 +#define VMSAVE .byte 0x0f, 0x01, 0xdb + /* * svm_launch(uint64_t vmcb, struct svm_regctx *gctx) * %rdi: physical address of VMCB @@ -79,9 +85,9 @@ ENTRY(svm_launch) movq SCTX_RDI(%rsi), %rdi movq SCTX_RSI(%rsi), %rsi /* %rsi must be restored last */ - vmload %rax - vmrun %rax - vmsave %rax + VMLOAD + VMRUN + VMSAVE pop %rax /* pop guest context pointer from the stack */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:23:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5694E78; Mon, 2 Mar 2015 20:23:22 +0000 (UTC) Received: from pmta2.delivery3.ore.mailhop.org (pmta2.delivery3.ore.mailhop.org [54.213.22.21]) by mx1.freebsd.org (Postfix) with ESMTP id A27EFFB9; Mon, 2 Mar 2015 20:23:22 +0000 (UTC) Received: from smtp7.ore.mailhop.org (172.31.18.134) by pmta2.delivery1.ore.mailhop.org id huj3cq20u50g; Mon, 2 Mar 2015 20:23:40 +0000 (envelope-from ) Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp7.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YSWs6-0004CX-DH; Mon, 02 Mar 2015 20:23:22 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t22KNKAC092074; Mon, 2 Mar 2015 13:23:20 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+SfXqRMdwvH1BFZxsQJTip Message-ID: <1425327800.1287.7.camel@freebsd.org> Subject: Re: svn commit: r279361 - in head: sys/kern sys/sys usr.sbin/jail From: Ian Lepore To: Julian Elischer Date: Mon, 02 Mar 2015 13:23:20 -0700 In-Reply-To: <54F42726.3000602@freebsd.org> References: <201502271628.t1RGSurE067472@svn.freebsd.org> <54F42726.3000602@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:23:22 -0000 On Mon, 2015-03-02 at 01:02 -0800, Julian Elischer wrote: > On 2/27/15 8:28 AM, Ian Lepore wrote: > > > > > Log: > > Allow the kern.osrelease and kern.osreldate sysctl values to be set in a > > jail's creation parameters. This allows the kernel version to be reliably > > spoofed within the jail whether examined directly with sysctl or > > indirectly with the uname -r and -K options. > > [..] > > > There is no sanity or range checking, other than disallowing an empty > > release string or a zero release date, by design. The system > > administrator is trusted to set sane values. Setting values that are > > newer than the actual running kernel will likely cause compatibility > > problems. > > > I would think that you could at set time ensure that only older > releases were allowed.. > I'm not sure what the rule would be with sub-sub-jails.. older than > parent, or older than base system..? > > I am a really really strong believer in giving administrators complete control of their systems. If they want to do "something stupid" because it works for them, I'm not going to stop them. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:26:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D594715A; Mon, 2 Mar 2015 20:26:49 +0000 (UTC) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70600FE6; Mon, 2 Mar 2015 20:26:49 +0000 (UTC) Received: by labgf13 with SMTP id gf13so8407083lab.5; Mon, 02 Mar 2015 12:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ASF1EvRI43QmiiaEwjolveP57Jthahpy9ofQ6+CCV3k=; b=TfnIsfpGSJmYMcGyupX5E/kYChOx+YHpRWwJ2n+my73MKbZ5p9NnpMb+Kl+ID2OWrd uaUMrt2vZNTfhnbRx4QbjpKIGingfIb5B9E2TFJAfh5rpkbZjJF8iGJep8ctMXgDee5P ZK2aR2S1OgKjl3SI4p2g2/UbpKvDxFG76osQjg1Jc+y3/ZZx9/bgBY6Ejtten1eqS8j+ 9xRjvxanKxkQMiRtc4dVnvRdm11LVYzdpQQyGc5C50Olbvts/E1gGGm3YuCdmMCJcVxw WXvPe3gBiXbegmvE+e9MGHwiZKY5I2frhJ65H+Zo8V+LzqW20ncCSvtcR6s6K0PpoNIR V7XA== MIME-Version: 1.0 X-Received: by 10.112.224.3 with SMTP id qy3mr3421904lbc.36.1425328007028; Mon, 02 Mar 2015 12:26:47 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.25.217.8 with HTTP; Mon, 2 Mar 2015 12:26:46 -0800 (PST) In-Reply-To: <201503022005.t22K5HTL062907@svn.freebsd.org> References: <201503022005.t22K5HTL062907@svn.freebsd.org> Date: Mon, 2 Mar 2015 12:26:46 -0800 X-Google-Sender-Auth: 6gXxLJJJR_hhUEZZVYU6Um0Xwgg Message-ID: Subject: Re: svn commit: r279539 - head/sys/sys From: Davide Italiano To: John-Mark Gurney Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:26:50 -0000 On Mon, Mar 2, 2015 at 12:05 PM, John-Mark Gurney wrote: > Author: jmg > Date: Mon Mar 2 20:05:16 2015 > New Revision: 279539 > URL: https://svnweb.freebsd.org/changeset/base/279539 > > Log: > give others fair warning that _SPARE2 isn't just cxgb, but used by large > number of other subsystems, so you probably don't want _SPARE2.. > > ktr needs an overhaul to really only compile in the ones you want, > we've long passed the 31 bits it provides.. > If you really want to do the overhaul (which would be honestly great), I might consider revamping my work for per-cpu KTR buffer and include that in the change. Originally it was just an exercise, but then it evolved and I've been sitting with it in my local tree for a while. I never had the chutzpah to upstream it because it involves fundamental changes and breaks compatibility with the old ktrdump(1) format. A rather outdated (and maybe not completely functional) version of the patch can be found here: http://people.freebsd.org/~davide/locking/ktr_percpu.4.diff , which should give you an high level view of the change. I can update it to the last version and bring up for review, if somebody think it might be a sane idea avoiding synchronization on a single buffer for KTR. -- Davide From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:38:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49FBA432; Mon, 2 Mar 2015 20:38:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33FBE196; Mon, 2 Mar 2015 20:38:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22KcHoP081057; Mon, 2 Mar 2015 20:38:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22KcH6D081056; Mon, 2 Mar 2015 20:38:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503022038.t22KcH6D081056@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Mar 2015 20:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279542 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:38:18 -0000 Author: hselasky Date: Mon Mar 2 20:38:17 2015 New Revision: 279542 URL: https://svnweb.freebsd.org/changeset/base/279542 Log: Update Exynos5 XHCI attach code after r276717. MFC after: 3 days Modified: head/sys/arm/samsung/exynos/exynos5_xhci.c Modified: head/sys/arm/samsung/exynos/exynos5_xhci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_xhci.c Mon Mar 2 20:14:56 2015 (r279541) +++ head/sys/arm/samsung/exynos/exynos5_xhci.c Mon Mar 2 20:38:17 2015 (r279542) @@ -89,9 +89,9 @@ __FBSDID("$FreeBSD$"); #define GUSB3PIPECTL_SUSPHY (1 << 17) /* Forward declarations */ -static int exynos_xhci_attach(device_t dev); -static int exynos_xhci_detach(device_t dev); -static int exynos_xhci_probe(device_t dev); +static device_attach_t exynos_xhci_attach; +static device_detach_t exynos_xhci_detach; +static device_probe_t exynos_xhci_probe; struct exynos_xhci_softc { device_t dev; @@ -152,13 +152,10 @@ exynos_xhci_probe(device_t dev) static int dwc3_init(struct exynos_xhci_softc *esc) { - struct xhci_softc *sc; int hwparams1; int rev; int reg; - sc = &esc->base; - rev = READ4(esc, GSNPSID); if ((rev & GSNPSID_MASK) != 0x55330000) { printf("It is not DWC3 controller\n"); @@ -210,32 +207,21 @@ dwc3_init(struct exynos_xhci_softc *esc) static int exynos_xhci_attach(device_t dev) { - struct exynos_xhci_softc *esc; - struct xhci_softc *sc; + struct exynos_xhci_softc *esc = device_get_softc(dev); bus_space_handle_t bsh; int err; - esc = device_get_softc(dev); esc->dev = dev; - sc = &esc->base; - - if (xhci_init(sc, dev)) { - device_printf(dev, "Could not initialize softc\n"); - return (ENXIO); - } - if (bus_alloc_resources(dev, exynos_xhci_spec, esc->res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); } - usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); - /* XHCI registers */ - sc->sc_io_tag = rman_get_bustag(esc->res[0]); + esc->base.sc_io_tag = rman_get_bustag(esc->res[0]); bsh = rman_get_bushandle(esc->res[0]); - sc->sc_io_size = rman_get_size(esc->res[0]); + esc->base.sc_io_size = rman_get_size(esc->res[0]); /* DWC3 ctrl registers */ esc->bst = rman_get_bustag(esc->res[1]); @@ -245,95 +231,89 @@ exynos_xhci_attach(device_t dev) * Set handle to USB related registers subregion used by * generic XHCI driver. */ - err = bus_space_subregion(sc->sc_io_tag, bsh, 0x0, - sc->sc_io_size, &sc->sc_io_hdl); - if (err != 0) + err = bus_space_subregion(esc->base.sc_io_tag, bsh, 0x0, + esc->base.sc_io_size, &esc->base.sc_io_hdl); + if (err != 0) { + device_printf(dev, "Subregion failed\n"); + bus_release_resources(dev, exynos_xhci_spec, esc->res); return (ENXIO); + } + + if (xhci_init(&esc->base, dev)) { + device_printf(dev, "Could not initialize softc\n"); + bus_release_resources(dev, exynos_xhci_spec, esc->res); + return (ENXIO); + } /* Setup interrupt handler */ err = bus_setup_intr(dev, esc->res[2], INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)xhci_interrupt, sc, - &sc->sc_intr_hdl); + NULL, (driver_intr_t *)xhci_interrupt, &esc->base, + &esc->base.sc_intr_hdl); if (err) { device_printf(dev, "Could not setup irq, %d\n", err); - return (1); + esc->base.sc_intr_hdl = NULL; + goto error; } /* Add USB device */ - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (!sc->sc_bus.bdev) { + esc->base.sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (esc->base.sc_bus.bdev == NULL) { device_printf(dev, "Could not add USB device\n"); - err = bus_teardown_intr(dev, esc->res[2], - sc->sc_intr_hdl); - if (err) - device_printf(dev, "Could not tear down irq," - " %d\n", err); - return (1); + goto error; } - device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - strlcpy(sc->sc_vendor, "Samsung", sizeof(sc->sc_vendor)); + device_set_ivars(esc->base.sc_bus.bdev, &esc->base.sc_bus); + strlcpy(esc->base.sc_vendor, "Samsung", sizeof(esc->base.sc_vendor)); dwc3_init(esc); - err = xhci_halt_controller(sc); + err = xhci_halt_controller(&esc->base); if (err == 0) { device_printf(dev, "Starting controller\n"); - err = xhci_start_controller(sc); + err = xhci_start_controller(&esc->base); } - if (err == 0) { device_printf(dev, "Controller started\n"); - err = device_probe_and_attach(sc->sc_bus.bdev); - } - - if (err == 0) { - device_printf(dev, "Attached success\n"); - } else { - device_printf(dev, "USB 3.0 init failed err=%d\n", err); - - device_delete_child(dev, sc->sc_bus.bdev); - sc->sc_bus.bdev = NULL; - - err = bus_teardown_intr(dev, esc->res[2], - sc->sc_intr_hdl); - if (err) - device_printf(dev, "Could not tear down irq," - " %d\n", err); - return (1); + err = device_probe_and_attach(esc->base.sc_bus.bdev); } + if (err != 0) + goto error; return (0); + +error: + exynos_xhci_detach(dev); + return (ENXIO); } static int exynos_xhci_detach(device_t dev) { - struct exynos_xhci_softc *esc; - struct xhci_softc *sc; + struct exynos_xhci_softc *esc = device_get_softc(dev); + device_t bdev; int err; - esc = device_get_softc(dev); - sc = &esc->base; + if (esc->base.sc_bus.bdev != NULL) { + bdev = esc->base.sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + /* During module unload there are lots of children leftover */ + device_delete_children(dev); - if (esc->res[2] && sc->sc_intr_hdl) { + xhci_halt_controller(&esc->base); + + if (esc->res[2] && esc->base.sc_intr_hdl) { err = bus_teardown_intr(dev, esc->res[2], - sc->sc_intr_hdl); + esc->base.sc_intr_hdl); if (err) { - device_printf(dev, "Could not tear down irq," + device_printf(dev, "Could not tear down IRQ," " %d\n", err); return (err); } - sc->sc_intr_hdl = NULL; - } - - if (sc->sc_bus.bdev) { - device_delete_child(dev, sc->sc_bus.bdev); - sc->sc_bus.bdev = NULL; } - /* During module unload there are lots of children leftover */ - device_delete_children(dev); - bus_release_resources(dev, exynos_xhci_spec, esc->res); + xhci_uninit(&esc->base); + return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:40:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 619605AC; Mon, 2 Mar 2015 20:40:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA1F1BB; Mon, 2 Mar 2015 20:40:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22KeQSo082073; Mon, 2 Mar 2015 20:40:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22KeQfY082072; Mon, 2 Mar 2015 20:40:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503022040.t22KeQfY082072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Mar 2015 20:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279543 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:40:26 -0000 Author: ian Date: Mon Mar 2 20:40:25 2015 New Revision: 279543 URL: https://svnweb.freebsd.org/changeset/base/279543 Log: Revert r279338. The casts are apparently bogus, despite the fact that they've been working in i386 (where this change came from). Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Mon Mar 2 20:38:17 2015 (r279542) +++ head/sys/arm/include/atomic.h Mon Mar 2 20:40:25 2015 (r279543) @@ -1103,23 +1103,13 @@ atomic_store_long(volatile u_long *dst, *dst = src; } -#define atomic_clear_ptr(p, v) \ - atomic_clear_32((volatile uint32_t *)(p), (uint32_t)(v)) -#define atomic_set_ptr(p, v) \ - atomic_set_32((volatile uint32_t *)(p), (uint32_t)(v)) -#define atomic_cmpset_ptr(p, cmpval, newval) \ - atomic_cmpset_32((volatile u_int32_t *)(p), (u_int32_t)(cmpval), \ - (u_int32_t)(newval)) -#define atomic_cmpset_rel_ptr(p, cmpval, newval) \ - atomic_cmpset_rel_32((volatile u_int32_t *)(p), (u_int32_t)(cmpval), \ - (u_int32_t)(newval)) -#define atomic_cmpset_acq_ptr(p, cmpval, newval) \ - atomic_cmpset_acq_32((volatile u_int32_t *)(p), (u_int32_t)(cmpval), \ - (u_int32_t)(newval)) -#define atomic_store_ptr(p, v) \ - atomic_store_32((volatile uint32_t *)(p), (uint32_t)(v)) -#define atomic_store_rel_ptr(p, v) \ - atomic_store_rel_32((volatile uint32_t *)(p), (uint32_t)(v)) +#define atomic_clear_ptr atomic_clear_32 +#define atomic_set_ptr atomic_set_32 +#define atomic_cmpset_ptr atomic_cmpset_32 +#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 +#define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 +#define atomic_store_ptr atomic_store_32 +#define atomic_store_rel_ptr atomic_store_rel_32 #define atomic_add_int atomic_add_32 #define atomic_add_acq_int atomic_add_acq_32 From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 20:42:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB2C771C; Mon, 2 Mar 2015 20:42:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9537C26F; Mon, 2 Mar 2015 20:42:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22Kg8ek085426; Mon, 2 Mar 2015 20:42:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22Kg7eA085420; Mon, 2 Mar 2015 20:42:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503022042.t22Kg7eA085420@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Mar 2015 20:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279544 - in head/sys: arm/samsung/exynos dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:42:08 -0000 Author: hselasky Date: Mon Mar 2 20:42:06 2015 New Revision: 279544 URL: https://svnweb.freebsd.org/changeset/base/279544 Log: Add quirk to disable 64-bit XHCI DMA after r276717. Requested by: Gary Jennejohn MFC after: 3 days Modified: head/sys/arm/samsung/exynos/exynos5_xhci.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/arm/samsung/exynos/exynos5_xhci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_xhci.c Mon Mar 2 20:40:25 2015 (r279543) +++ head/sys/arm/samsung/exynos/exynos5_xhci.c Mon Mar 2 20:42:06 2015 (r279544) @@ -239,7 +239,7 @@ exynos_xhci_attach(device_t dev) return (ENXIO); } - if (xhci_init(&esc->base, dev)) { + if (xhci_init(&esc->base, dev, 0)) { device_printf(dev, "Could not initialize softc\n"); bus_release_resources(dev, exynos_xhci_spec, esc->res); return (ENXIO); Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Mar 2 20:40:25 2015 (r279543) +++ head/sys/dev/usb/controller/xhci.c Mon Mar 2 20:42:06 2015 (r279544) @@ -97,15 +97,19 @@ SYSCTL_INT(_hw_usb_xhci, OID_AUTO, strea static int xhcidebug; static int xhciroute; static int xhcipolling; +static int xhcidma32; SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RWTUN, &xhcidebug, 0, "Debug level"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RWTUN, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI controller"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RWTUN, - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI controller"); + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI controller"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); #else #define xhciroute 0 +#define xhcidma32 0 #endif #define XHCI_INTR_ENDPT 1 @@ -576,7 +580,7 @@ xhci_halt_controller(struct xhci_softc * } usb_error_t -xhci_init(struct xhci_softc *sc, device_t self) +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) { uint32_t temp; @@ -623,7 +627,8 @@ xhci_init(struct xhci_softc *sc, device_ } /* get DMA bits */ - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Mon Mar 2 20:40:25 2015 (r279543) +++ head/sys/dev/usb/controller/xhci.h Mon Mar 2 20:42:06 2015 (r279544) @@ -522,7 +522,7 @@ struct xhci_softc { uint8_t xhci_use_polling(void); usb_error_t xhci_halt_controller(struct xhci_softc *); -usb_error_t xhci_init(struct xhci_softc *, device_t); +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Mon Mar 2 20:40:25 2015 (r279543) +++ head/sys/dev/usb/controller/xhci_pci.c Mon Mar 2 20:42:06 2015 (r279544) @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self)) { + if (xhci_init(sc, self, 0)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:00:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A4F2E05; Mon, 2 Mar 2015 21:00:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1A6619; Mon, 2 Mar 2015 21:00:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22L0sin094746; Mon, 2 Mar 2015 21:00:54 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22L0sv4094745; Mon, 2 Mar 2015 21:00:54 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503022100.t22L0sv4094745@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 2 Mar 2015 21:00: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: r279545 - stable/10/lib/libdevstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:00:55 -0000 Author: ken Date: Mon Mar 2 21:00:54 2015 New Revision: 279545 URL: https://svnweb.freebsd.org/changeset/base/279545 Log: MFC r279346: ------------------------------------------------------------------------ r279346 | ken | 2015-02-26 19:44:12 -0700 (Thu, 26 Feb 2015) | 13 lines Remove an obsolete comment in devstat(3) about the accuracy of the milliseconds per transaction (DSM_MS_PER_TRANSACTION) calculation. The comment was accurate many years ago when the kernel didn't record I/O times on a per-I/O basis, but now that we do collect that information in most areas, it isn't correct. The milliseconds per transaction values are correct, assuming the I/O duration has been recorded. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/lib/libdevstat/devstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdevstat/devstat.c ============================================================================== --- stable/10/lib/libdevstat/devstat.c Mon Mar 2 20:42:06 2015 (r279544) +++ stable/10/lib/libdevstat/devstat.c Mon Mar 2 21:00:54 2015 (r279545) @@ -1480,22 +1480,9 @@ devstat_compute_statistics(struct devsta *destld = 0.0; break; /* - * This calculation is somewhat bogus. It simply divides - * the elapsed time by the total number of transactions - * completed. While that does give the caller a good - * picture of the average rate of transaction completion, - * it doesn't necessarily give the caller a good view of - * how long transactions took to complete on average. - * Those two numbers will be different for a device that - * can handle more than one transaction at a time. e.g. - * SCSI disks doing tagged queueing. - * - * The only way to accurately determine the real average - * time per transaction would be to compute and store the - * time on a per-transaction basis. That currently isn't - * done in the kernel, and would only be desireable if it - * could be implemented in a somewhat non-intrusive and high - * performance way. + * Some devstat callers update the duration and some don't. + * So this will only be accurate if they provide the + * duration. */ case DSM_MS_PER_TRANSACTION: if (totaltransfers > 0) { @@ -1505,11 +1492,6 @@ devstat_compute_statistics(struct devsta } else *destld = 0.0; break; - /* - * As above, these next two really only give the average - * rate of completion for read and write transactions, not - * the average time the transaction took to complete. - */ case DSM_MS_PER_TRANSACTION_READ: if (totaltransfersread > 0) { *destld = totaldurationread; From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:31:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 416AB8FE; Mon, 2 Mar 2015 21:31:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16212A82; Mon, 2 Mar 2015 21:31:48 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 09FACB999; Mon, 2 Mar 2015 16:31:47 -0500 (EST) From: John Baldwin To: Ryan Stone Subject: Re: svn commit: r279444 - in head/sys/amd64/vmm: . io Date: Mon, 02 Mar 2015 13:57:58 -0500 Message-ID: <1732134.mIfMuHJmix@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201503010039.t210dm23090086@svn.freebsd.org> References: <201503010039.t210dm23090086@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 02 Mar 2015 16:31:47 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:31:48 -0000 On Sunday, March 01, 2015 12:39:48 AM Ryan Stone wrote: > Author: rstone > Date: Sun Mar 1 00:39:48 2015 > New Revision: 279444 > URL: https://svnweb.freebsd.org/changeset/base/279444 > > Log: > Allow passthrough devices to be hinted. > > Allow the ppt driver to attach to devices that were hinted to be > passthrough devices by the PCI code creating them with a driver > name of "ppt". > > Add a tunable that allows the IOMMU to be forced to be used. With > SR-IOV passthrough devices the VFs may be created after vmm.ko is > loaded. The current code will not initialize the IOMMU in that > case, meaning that the passthrough devices can't actually be used. > > Differential Revision: https://reviews.freebsd.org/D73 > Reviewed by: neel > MFC after: 1 month > Sponsored by: Sandvine Inc. Ah, hopefully this also fixes the case of doing 'devctl set driver foo0 ppt' which currently doesn't work due to the hints thing (if so, this means you can decide to convert an existing device to pass through after boot time). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:35:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9389CA2; Mon, 2 Mar 2015 21:35:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A184DAB7; Mon, 2 Mar 2015 21:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22LZZOe014847; Mon, 2 Mar 2015 21:35:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22LZWo1014824; Mon, 2 Mar 2015 21:35:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503022135.t22LZWo1014824@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 21:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279546 - in vendor/libucl/dist: . cmake doc include klib m4 src tests tests/basic uthash X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:35:35 -0000 Author: bapt Date: Mon Mar 2 21:35:31 2015 New Revision: 279546 URL: https://svnweb.freebsd.org/changeset/base/279546 Log: Update libucl to git version 8d3b186 Added: vendor/libucl/dist/klib/ vendor/libucl/dist/klib/khash.h (contents, props changed) vendor/libucl/dist/klib/kvec.h (contents, props changed) vendor/libucl/dist/tests/basic/14.in (contents, props changed) vendor/libucl/dist/tests/basic/14.res Deleted: vendor/libucl/dist/m4/ Modified: vendor/libucl/dist/ChangeLog.md vendor/libucl/dist/Makefile.am vendor/libucl/dist/README.md vendor/libucl/dist/cmake/CMakeLists.txt vendor/libucl/dist/configure.ac vendor/libucl/dist/doc/Makefile.am vendor/libucl/dist/doc/api.md vendor/libucl/dist/doc/libucl.3 vendor/libucl/dist/doc/pandoc.template vendor/libucl/dist/include/ucl.h vendor/libucl/dist/src/Makefile.am vendor/libucl/dist/src/ucl_emitter.c vendor/libucl/dist/src/ucl_emitter_utils.c vendor/libucl/dist/src/ucl_hash.c vendor/libucl/dist/src/ucl_hash.h vendor/libucl/dist/src/ucl_internal.h vendor/libucl/dist/src/ucl_parser.c vendor/libucl/dist/src/ucl_schema.c vendor/libucl/dist/src/ucl_util.c vendor/libucl/dist/tests/schema.test vendor/libucl/dist/tests/test_generate.c vendor/libucl/dist/tests/test_schema.c vendor/libucl/dist/uthash/utstring.h Modified: vendor/libucl/dist/ChangeLog.md ============================================================================== --- vendor/libucl/dist/ChangeLog.md Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/ChangeLog.md Mon Mar 2 21:35:31 2015 (r279546) @@ -20,3 +20,15 @@ ### Libucl 0.6.1 - Various utilities fixes + +### Libucl 0.7.0 + +- Move to klib library from uthash to reduce memory overhead and increase performance + +### Libucl 0.7.1 + +- Added safe iterators API + +### Libucl 0.7.2 + +- Fixed serious bugs in schema and arrays iteration Modified: vendor/libucl/dist/Makefile.am ============================================================================== --- vendor/libucl/dist/Makefile.am Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/Makefile.am Mon Mar 2 21:35:31 2015 (r279546) @@ -1,5 +1,5 @@ ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = uthash README.md +EXTRA_DIST = uthash klib README.md pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libucl.pc Modified: vendor/libucl/dist/README.md ============================================================================== --- vendor/libucl/dist/README.md Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/README.md Mon Mar 2 21:35:31 2015 (r279546) @@ -1,6 +1,6 @@ # LIBUCL -[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* @@ -156,10 +156,10 @@ is converted to the following object: ```nginx section { blah { - key = value; + key = value; } foo { - key = value; + key = value; } } ``` @@ -177,9 +177,9 @@ is presented as: ```nginx section { blah { - foo { - key = value; - } + foo { + key = value; + } } } ``` @@ -219,8 +219,8 @@ UCL supports external macros both multil ```nginx .macro "sometext"; .macro { - Some long text - .... + Some long text + .... }; ``` Modified: vendor/libucl/dist/cmake/CMakeLists.txt ============================================================================== --- vendor/libucl/dist/cmake/CMakeLists.txt Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/cmake/CMakeLists.txt Mon Mar 2 21:35:31 2015 (r279546) @@ -82,6 +82,7 @@ ENDIF(ENABLE_URL_SIGN MATCHES "ON") INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../src") INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../include") INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../uthash") +INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../klib") SET(UCLSRC ../src/ucl_util.c ../src/ucl_parser.c Modified: vendor/libucl/dist/configure.ac ============================================================================== --- vendor/libucl/dist/configure.ac Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/configure.ac Mon Mar 2 21:35:31 2015 (r279546) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [6]) -m4_define([min_ver], [1]) -m4_define([so_version], [3:0:1]) +m4_define([med_ver], [7]) +m4_define([min_ver], [2]) +m4_define([so_version], [5:0:1]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) Modified: vendor/libucl/dist/doc/Makefile.am ============================================================================== --- vendor/libucl/dist/doc/Makefile.am Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/doc/Makefile.am Mon Mar 2 21:35:31 2015 (r279546) @@ -4,5 +4,6 @@ dist_man_MANS = libucl.3 gen-man: @PANDOC@ tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ - cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \ + -e "s/%%date%%/$$(LANG=C date +'%d %B, %Y')/" | \ @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file Modified: vendor/libucl/dist/doc/api.md ============================================================================== --- vendor/libucl/dist/doc/api.md Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/doc/api.md Mon Mar 2 21:35:31 2015 (r279546) @@ -377,7 +377,9 @@ If parsing operations fail then the resu # Iteration functions -Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. +Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). +There are two types of iterators API: old and unsafe one via `ucl_iterate_object` and the proposed interface of safe iterators. + ## ucl_iterate_object ~~~C @@ -402,6 +404,60 @@ while ((obj = ucl_iterate_object (top, & } ~~~ +## Safe iterators API + +Safe iterators are defined to clarify iterating over UCL objects and simplify flattening of UCL objects in non-trivial cases. +For example, if there is an implicit array that contains another array and a boolean value it is extremely unclear how to iterate over +such an object. Safe iterators are desinged to define two sorts of iteration: + +1. Iteration over complex objects with expanding all values +2. Iteration over complex objects without expanding of values + +The following example demonstrates the difference between these two types of iteration: + +~~~ +key = 1; +key = [2, 3, 4]; + +Iteration with expansion: + +1, 2, 3, 4 + +Iteration without expansion: + +1, [2, 3, 4] +~~~ + +UCL defines the following functions to manage safe iterators: + +- `ucl_object_iterate_new` - creates new safe iterator +- `ucl_object_iterate_reset` - resets iterator to a new object +- `ucl_object_iterate_safe` - safely iterate the object inside iterator +- `ucl_object_iterate_free` - free memory associated with the safe iterator + +Please note that unlike unsafe iterators, safe iterators *must* be explicitly initialized and freed. +An assert is likely generated if you use uninitialized or `NULL` iterator in all safe iterators functions. + +~~~C +ucl_object_iter_t it; +const ucl_object_t *cur; + +it = ucl_object_iterate_new (obj); + +while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { + /* Do something */ +} + +/* Switch to another object */ +it = ucl_object_iterate_reset (it, another_obj); + +while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { + /* Do something else */ +} + +ucl_object_iterate_free (it); +~~~ + # Validation functions Currently, there is only one validation function called `ucl_object_validate`. It performs validation of object using the specified schema. This function is defined as following: Modified: vendor/libucl/dist/doc/libucl.3 ============================================================================== --- vendor/libucl/dist/doc/libucl.3 Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/doc/libucl.3 Mon Mar 2 21:35:31 2015 (r279546) @@ -1,4 +1,4 @@ -.TH "LIBUCL" "3" "July 26, 2014" "Libucl manual" "" +.TH "LIBUCL" "3" "27 December, 2014" "Libucl manual" "" .SH NAME .PP \f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[], @@ -528,8 +528,9 @@ Iteration are used to iterate over UCL c objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). -To iterate over an object, an array or a key with multiple values there -is a function \f[C]ucl_iterate_object\f[]. +There are two types of iterators API: old and unsafe one via +\f[C]ucl_iterate_object\f[] and the proposed interface of safe +iterators. .SS ucl_iterate_object .IP .nf @@ -578,6 +579,75 @@ while\ ((obj\ =\ ucl_iterate_object\ (to } \f[] .fi +.SS Safe iterators API +.PP +Safe iterators are defined to clarify iterating over UCL objects and +simplify flattening of UCL objects in non\-trivial cases. +For example, if there is an implicit array that contains another array +and a boolean value it is extremely unclear how to iterate over such an +object. +Safe iterators are desinged to define two sorts of iteration: +.IP "1." 3 +Iteration over complex objects with expanding all values +.IP "2." 3 +Iteration over complex objects without expanding of values +.PP +The following example demonstrates the difference between these two +types of iteration: +.IP +.nf +\f[C] +key\ =\ 1; +key\ =\ [2,\ 3,\ 4]; + +Iteration\ with\ expansion: + +1,\ 2,\ 3,\ 4 + +Iteration\ without\ expansion: + +1,\ [2,\ 3,\ 4] +\f[] +.fi +.PP +UCL defines the following functions to manage safe iterators: +.IP \[bu] 2 +\f[C]ucl_object_iterate_new\f[] \- creates new safe iterator +.IP \[bu] 2 +\f[C]ucl_object_iterate_reset\f[] \- resets iterator to a new object +.IP \[bu] 2 +\f[C]ucl_object_iterate_safe\f[] \- safely iterate the object inside +iterator +.IP \[bu] 2 +\f[C]ucl_object_iterate_free\f[] \- free memory associated with the safe +iterator +.PP +Please note that unlike unsafe iterators, safe iterators \f[I]must\f[] +be explicitly initialized and freed. +An assert is likely generated if you use uninitialized or \f[C]NULL\f[] +iterator in all safe iterators functions. +.IP +.nf +\f[C] +ucl_object_iter_t\ it; +const\ ucl_object_t\ *cur; + +it\ =\ ucl_object_iterate_new\ (obj); + +while\ ((cur\ =\ ucl_object_iterate_safe\ (it,\ true))\ !=\ NULL)\ { +\ \ \ \ /*\ Do\ something\ */ +} + +/*\ Switch\ to\ another\ object\ */ +it\ =\ ucl_object_iterate_reset\ (it,\ another_obj); + +while\ ((cur\ =\ ucl_object_iterate_safe\ (it,\ true))\ !=\ NULL)\ { +\ \ \ \ /*\ Do\ something\ else\ */ +} + +ucl_object_iterate_free\ (it); +\f[] +.fi .SH VALIDATION FUNCTIONS .PP Currently, there is only one validation function called Modified: vendor/libucl/dist/doc/pandoc.template ============================================================================== --- vendor/libucl/dist/doc/pandoc.template Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/doc/pandoc.template Mon Mar 2 21:35:31 2015 (r279546) @@ -1,6 +1,6 @@ % LIBUCL(3) Libucl manual % Vsevolod Stakhov -% July 26, 2014 +% %%date%% # Name Modified: vendor/libucl/dist/include/ucl.h ============================================================================== --- vendor/libucl/dist/include/ucl.h Mon Mar 2 21:00:54 2015 (r279545) +++ vendor/libucl/dist/include/ucl.h Mon Mar 2 21:35:31 2015 (r279546) @@ -192,7 +192,7 @@ typedef struct ucl_object_s { int64_t iv; /**< Int value of an object */ const char *sv; /**< String value of an object */ double dv; /**< Double value of an object */ - struct ucl_object_s *av; /**< Array */ + void *av; /**< Array */ void *ov; /**< Object */ void* ud; /**< Opaque user data */ } value; @@ -715,6 +715,37 @@ typedef void* ucl_object_iter_t; */ UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); + +/** + * Create new safe iterator for the specified object + * @param obj object to iterate + * @return new iterator object that should be used with safe iterators API only + */ +UCL_EXTERN ucl_object_iter_t ucl_object_iterate_new (const ucl_object_t *obj) + UCL_WARN_UNUSED_RESULT; +/** + * Reset initialized iterator to a new object + * @param obj new object to iterate + * @return modified iterator object + */ +UCL_EXTERN ucl_object_iter_t ucl_object_iterate_reset (ucl_object_iter_t it, + const ucl_object_t *obj); + +/** + * Get the next object from the `obj`. This fucntion iterates over arrays, objects + * and implicit arrays + * @param iter safe iterator + * @return the next object in sequence + */ +UCL_EXTERN const ucl_object_t* ucl_object_iterate_safe (ucl_object_iter_t iter, + bool expand_values); + +/** + * Free memory associated with the safe iterator + * @param it safe iterator object + */ +UCL_EXTERN void ucl_object_iterate_free (ucl_object_iter_t it); + /** @} */ @@ -854,6 +885,13 @@ UCL_EXTERN ucl_object_t* ucl_parser_get_ * @param parser parser object */ UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); + +/** + * Clear the error in the parser + * @param parser parser object + */ +UCL_EXTERN void ucl_parser_clear_error(struct ucl_parser *parser); + /** * Free ucl parser object * @param parser parser object Added: vendor/libucl/dist/klib/khash.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/klib/khash.h Mon Mar 2 21:35:31 2015 (r279546) @@ -0,0 +1,627 @@ +/* The MIT License + + Copyright (c) 2008, 2009, 2011 by Attractive Chaos + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +/* + An example: + +#include "khash.h" +KHASH_MAP_INIT_INT(32, char) +int main() { + int ret, is_missing; + khiter_t k; + khash_t(32) *h = kh_init(32); + k = kh_put(32, h, 5, &ret); + kh_value(h, k) = 10; + k = kh_get(32, h, 10); + is_missing = (k == kh_end(h)); + k = kh_get(32, h, 5); + kh_del(32, h, k); + for (k = kh_begin(h); k != kh_end(h); ++k) + if (kh_exist(h, k)) kh_value(h, k) = 1; + kh_destroy(32, h); + return 0; +} +*/ + +/* + 2013-05-02 (0.2.8): + + * Use quadratic probing. When the capacity is power of 2, stepping function + i*(i+1)/2 guarantees to traverse each bucket. It is better than double + hashing on cache performance and is more robust than linear probing. + + In theory, double hashing should be more robust than quadratic probing. + However, my implementation is probably not for large hash tables, because + the second hash function is closely tied to the first hash function, + which reduce the effectiveness of double hashing. + + Reference: http://research.cs.vt.edu/AVresearch/hashing/quadratic.php + + 2011-12-29 (0.2.7): + + * Minor code clean up; no actual effect. + + 2011-09-16 (0.2.6): + + * The capacity is a power of 2. This seems to dramatically improve the + speed for simple keys. Thank Zilong Tan for the suggestion. Reference: + + - http://code.google.com/p/ulib/ + - http://nothings.org/computer/judy/ + + * Allow to optionally use linear probing which usually has better + performance for random input. Double hashing is still the default as it + is more robust to certain non-random input. + + * Added Wang's integer hash function (not used by default). This hash + function is more robust to certain non-random input. + + 2011-02-14 (0.2.5): + + * Allow to declare global functions. + + 2009-09-26 (0.2.4): + + * Improve portability + + 2008-09-19 (0.2.3): + + * Corrected the example + * Improved interfaces + + 2008-09-11 (0.2.2): + + * Improved speed a little in kh_put() + + 2008-09-10 (0.2.1): + + * Added kh_clear() + * Fixed a compiling error + + 2008-09-02 (0.2.0): + + * Changed to token concatenation which increases flexibility. + + 2008-08-31 (0.1.2): + + * Fixed a bug in kh_get(), which has not been tested previously. + + 2008-08-31 (0.1.1): + + * Added destructor +*/ + + +#ifndef __AC_KHASH_H +#define __AC_KHASH_H + +/*! + @header + + Generic hash table library. + */ + +#define AC_VERSION_KHASH_H "0.2.8" + +#include +#include +#include + +/* compiler specific configuration */ + +#if UINT_MAX == 0xffffffffu +typedef unsigned int khint32_t; +#elif ULONG_MAX == 0xffffffffu +typedef unsigned long khint32_t; +#endif + +#if ULONG_MAX == ULLONG_MAX +typedef unsigned long khint64_t; +#else +typedef unsigned long long khint64_t; +#endif + +#ifndef kh_inline +#ifdef _MSC_VER +#define kh_inline __inline +#else +#define kh_inline inline +#endif +#endif /* kh_inline */ + +#ifndef kh_unused +# ifdef __GNUC__ +# define kh_unused(x) __attribute__((__unused__)) x +# else +# define kh_unused(x) x +# endif +#endif + +typedef khint32_t khint_t; +typedef khint_t khiter_t; + +#define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2) +#define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1) +#define __ac_iseither(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&3) +#define __ac_set_isdel_false(flag, i) (flag[i>>4]&=~(1ul<<((i&0xfU)<<1))) +#define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2ul<<((i&0xfU)<<1))) +#define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1))) +#define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1)) + +#define __ac_fsize(m) ((m) < 16? 1 : (m)>>4) + +#ifndef kroundup32 +#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) +#endif + +#ifndef kcalloc +#define kcalloc(N,Z) calloc(N,Z) +#endif +#ifndef kmalloc +#define kmalloc(Z) malloc(Z) +#endif +#ifndef krealloc +#define krealloc(P,Z) realloc(P,Z) +#endif +#ifndef kfree +#define kfree(P) free(P) +#endif + +static const double __ac_HASH_UPPER = 0.77; + +#define __KHASH_TYPE(name, khkey_t, khval_t) \ + typedef struct kh_##name##_s { \ + khint_t n_buckets, size, n_occupied, upper_bound; \ + khint32_t *flags; \ + khkey_t *keys; \ + khval_t *vals; \ + } kh_##name##_t; + +#define __KHASH_PROTOTYPES(name, khkey_t, khval_t) \ + extern kh_##name##_t * kh_init_##name(void); \ + extern void kh_destroy_##name(kh_##name##_t *h); \ + extern void kh_clear_##name(kh_##name##_t *h); \ + extern khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ + extern int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ + extern khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ + extern void kh_del_##name(kh_##name##_t *h, khint_t x); + +#define __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + SCOPE kh_##name##_t *kh_init_##name(void) { \ + return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t)); \ + } \ + SCOPE void kh_destroy_##name(kh_##name##_t *h) \ + { \ + if (h) { \ + kfree((void *)h->keys); kfree(h->flags); \ + kfree((void *)h->vals); \ + kfree(h); \ + } \ + } \ + SCOPE void kh_unused(kh_clear_##name)(kh_##name##_t *h) \ + { \ + if (h && h->flags) { \ + memset(h->flags, 0xaa, __ac_fsize(h->n_buckets) * sizeof(khint32_t)); \ + h->size = h->n_occupied = 0; \ + } \ + } \ + SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \ + { \ + if (h->n_buckets) { \ + khint_t k, i, last, mask, step = 0; \ + mask = h->n_buckets - 1; \ + k = __hash_func(key); i = k & mask; \ + last = i; \ + while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ + i = (i + (++step)) & mask; \ + if (i == last) return h->n_buckets; \ + } \ + return __ac_iseither(h->flags, i)? h->n_buckets : i; \ + } else return 0; \ + } \ + SCOPE int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \ + { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \ + khint32_t *new_flags = 0; \ + khint_t j = 1; \ + { \ + kroundup32(new_n_buckets); \ + if (new_n_buckets < 4) new_n_buckets = 4; \ + if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 0; /* requested size is too small */ \ + else { /* hash table size to be changed (shrink or expand); rehash */ \ + new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t)); \ + if (!new_flags) return -1; \ + memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \ + if (h->n_buckets < new_n_buckets) { /* expand */ \ + khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \ + if (!new_keys) { kfree(new_flags); return -1; } \ + h->keys = new_keys; \ + if (kh_is_map) { \ + khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \ + if (!new_vals) { kfree(new_flags); return -1; } \ + h->vals = new_vals; \ + } \ + } /* otherwise shrink */ \ + } \ + } \ + if (j) { /* rehashing is needed */ \ + for (j = 0; j != h->n_buckets; ++j) { \ + if (__ac_iseither(h->flags, j) == 0) { \ + khkey_t key = h->keys[j]; \ + khval_t val; \ + khint_t new_mask; \ + new_mask = new_n_buckets - 1; \ + if (kh_is_map) val = h->vals[j]; \ + __ac_set_isdel_true(h->flags, j); \ + while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \ + khint_t k, i, step = 0; \ + k = __hash_func(key); \ + i = k & new_mask; \ + while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \ + __ac_set_isempty_false(new_flags, i); \ + if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \ + { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \ + if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \ + __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \ + } else { /* write the element and jump out of the loop */ \ + h->keys[i] = key; \ + if (kh_is_map) h->vals[i] = val; \ + break; \ + } \ + } \ + } \ + } \ + if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \ + h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \ + if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \ + } \ + kfree(h->flags); /* free the working space */ \ + h->flags = new_flags; \ + h->n_buckets = new_n_buckets; \ + h->n_occupied = h->size; \ + h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \ + } \ + return 0; \ + } \ + SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \ + { \ + khint_t x; \ + if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \ + if (h->n_buckets > (h->size<<1)) { \ + if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \ + *ret = -1; return h->n_buckets; \ + } \ + } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \ + *ret = -1; return h->n_buckets; \ + } \ + } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \ + { \ + khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \ + x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \ + if (__ac_isempty(h->flags, i)) x = i; /* for speed up */ \ + else { \ + last = i; \ + while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ + if (__ac_isdel(h->flags, i)) site = i; \ + i = (i + (++step)) & mask; \ + if (i == last) { x = site; break; } \ + } \ + if (x == h->n_buckets) { \ + if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site; \ + else x = i; \ + } \ + } \ + } \ + if (__ac_isempty(h->flags, x)) { /* not present at all */ \ + h->keys[x] = key; \ + __ac_set_isboth_false(h->flags, x); \ + ++h->size; ++h->n_occupied; \ + *ret = 1; \ + } else if (__ac_isdel(h->flags, x)) { /* deleted */ \ + h->keys[x] = key; \ + __ac_set_isboth_false(h->flags, x); \ + ++h->size; \ + *ret = 2; \ + } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \ + return x; \ + } \ + SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \ + { \ + if (x != h->n_buckets && !__ac_iseither(h->flags, x)) { \ + __ac_set_isdel_true(h->flags, x); \ + --h->size; \ + } \ + } + +#define KHASH_DECLARE(name, khkey_t, khval_t) \ + __KHASH_TYPE(name, khkey_t, khval_t) \ + __KHASH_PROTOTYPES(name, khkey_t, khval_t) + +#define KHASH_INIT2(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + __KHASH_TYPE(name, khkey_t, khval_t) \ + __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) + +#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + KHASH_INIT2(name, static kh_inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) + +/* --- BEGIN OF HASH FUNCTIONS --- */ + +/*! @function + @abstract Integer hash function + @param key The integer [khint32_t] + @return The hash value [khint_t] + */ +#define kh_int_hash_func(key) (khint32_t)(key) +/*! @function + @abstract Integer comparison function + */ +#define kh_int_hash_equal(a, b) ((a) == (b)) +/*! @function + @abstract 64-bit integer hash function + @param key The integer [khint64_t] + @return The hash value [khint_t] + */ +#define kh_int64_hash_func(key) (khint32_t)((key)>>33^(key)^(key)<<11) +/*! @function + @abstract 64-bit integer comparison function + */ +#define kh_int64_hash_equal(a, b) ((a) == (b)) +/*! @function + @abstract const char* hash function + @param s Pointer to a null terminated string + @return The hash value + */ +static kh_inline khint_t __ac_X31_hash_string(const char *s) +{ + khint_t h = (khint_t)*s; + if (h) for (++s ; *s; ++s) h = (h << 5) - h + (khint_t)*s; + return h; +} +/*! @function + @abstract Another interface to const char* hash function + @param key Pointer to a null terminated string [const char*] + @return The hash value [khint_t] + */ +#define kh_str_hash_func(key) __ac_X31_hash_string(key) +/*! @function + @abstract Const char* comparison function + */ +#define kh_str_hash_equal(a, b) (strcmp(a, b) == 0) + +static kh_inline khint_t __ac_Wang_hash(khint_t key) +{ + key += ~(key << 15); + key ^= (key >> 10); + key += (key << 3); + key ^= (key >> 6); + key += ~(key << 11); + key ^= (key >> 16); + return key; +} +#define kh_int_hash_func2(k) __ac_Wang_hash((khint_t)key) + +/* --- END OF HASH FUNCTIONS --- */ + +/* Other convenient macros... */ + +/*! + @abstract Type of the hash table. + @param name Name of the hash table [symbol] + */ +#define khash_t(name) kh_##name##_t + +/*! @function + @abstract Initiate a hash table. + @param name Name of the hash table [symbol] + @return Pointer to the hash table [khash_t(name)*] + */ +#define kh_init(name) kh_init_##name() + +/*! @function + @abstract Destroy a hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + */ +#define kh_destroy(name, h) kh_destroy_##name(h) + +/*! @function + @abstract Reset a hash table without deallocating memory. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + */ +#define kh_clear(name, h) kh_clear_##name(h) + +/*! @function + @abstract Resize a hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param s New size [khint_t] + */ +#define kh_resize(name, h, s) kh_resize_##name(h, s) + +/*! @function + @abstract Insert a key to the hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Key [type of keys] + @param r Extra return code: -1 if the operation failed; + 0 if the key is present in the hash table; + 1 if the bucket is empty (never used); 2 if the element in + the bucket has been deleted [int*] + @return Iterator to the inserted element [khint_t] + */ +#define kh_put(name, h, k, r) kh_put_##name(h, k, r) + +/*! @function + @abstract Retrieve a key from the hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Key [type of keys] + @return Iterator to the found element, or kh_end(h) if the element is absent [khint_t] + */ +#define kh_get(name, h, k) kh_get_##name(h, k) + +/*! @function + @abstract Remove a key from the hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Iterator to the element to be deleted [khint_t] + */ +#define kh_del(name, h, k) kh_del_##name(h, k) + +/*! @function + @abstract Test whether a bucket contains data. + @param h Pointer to the hash table [khash_t(name)*] + @param x Iterator to the bucket [khint_t] + @return 1 if containing data; 0 otherwise [int] + */ +#define kh_exist(h, x) (!__ac_iseither((h)->flags, (x))) + +/*! @function + @abstract Get key given an iterator + @param h Pointer to the hash table [khash_t(name)*] + @param x Iterator to the bucket [khint_t] + @return Key [type of keys] + */ +#define kh_key(h, x) ((h)->keys[x]) + +/*! @function + @abstract Get value given an iterator + @param h Pointer to the hash table [khash_t(name)*] + @param x Iterator to the bucket [khint_t] + @return Value [type of values] + @discussion For hash sets, calling this results in segfault. + */ +#define kh_val(h, x) ((h)->vals[x]) + +/*! @function + @abstract Alias of kh_val() + */ +#define kh_value(h, x) ((h)->vals[x]) + +/*! @function + @abstract Get the start iterator + @param h Pointer to the hash table [khash_t(name)*] + @return The start iterator [khint_t] + */ +#define kh_begin(h) (khint_t)(0) + +/*! @function + @abstract Get the end iterator + @param h Pointer to the hash table [khash_t(name)*] + @return The end iterator [khint_t] + */ +#define kh_end(h) ((h)->n_buckets) + +/*! @function + @abstract Get the number of elements in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @return Number of elements in the hash table [khint_t] + */ +#define kh_size(h) ((h)->size) + +/*! @function + @abstract Get the number of buckets in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @return Number of buckets in the hash table [khint_t] + */ +#define kh_n_buckets(h) ((h)->n_buckets) + +/*! @function + @abstract Iterate over the entries in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param kvar Variable to which key will be assigned + @param vvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach(h, kvar, vvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (kvar) = kh_key(h,__i); \ + (vvar) = kh_val(h,__i); \ + code; \ + } } + +/*! @function + @abstract Iterate over the values in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param vvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach_value(h, vvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (vvar) = kh_val(h,__i); \ + code; \ + } } + +/* More conenient interfaces */ + +/*! @function + @abstract Instantiate a hash set containing integer keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_INT(name) \ + KHASH_INIT(name, khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing integer keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_INT(name, khval_t) \ + KHASH_INIT(name, khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing 64-bit integer keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_INT64(name) \ + KHASH_INIT(name, khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing 64-bit integer keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_INT64(name, khval_t) \ + KHASH_INIT(name, khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal) + +typedef const char *kh_cstr_t; +/*! @function + @abstract Instantiate a hash map containing const char* keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_STR(name) \ + KHASH_INIT(name, kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing const char* keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_STR(name, khval_t) \ + KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal) + +#endif /* __AC_KHASH_H */ Added: vendor/libucl/dist/klib/kvec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/klib/kvec.h Mon Mar 2 21:35:31 2015 (r279546) @@ -0,0 +1,103 @@ +/* The MIT License + + Copyright (c) 2008, by Attractive Chaos + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:36:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC3E5DE5; Mon, 2 Mar 2015 21:36:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D751DAD3; Mon, 2 Mar 2015 21:36:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22LajJD015158; Mon, 2 Mar 2015 21:36:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22Laj9L015157; Mon, 2 Mar 2015 21:36:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503022136.t22Laj9L015157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 21:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279547 - vendor/libucl/dist/utils X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:36:46 -0000 Author: bapt Date: Mon Mar 2 21:36:45 2015 New Revision: 279547 URL: https://svnweb.freebsd.org/changeset/base/279547 Log: Really update to 8d3b186 Modified: vendor/libucl/dist/utils/objdump.c Modified: vendor/libucl/dist/utils/objdump.c ============================================================================== --- vendor/libucl/dist/utils/objdump.c Mon Mar 2 21:35:31 2015 (r279546) +++ vendor/libucl/dist/utils/objdump.c Mon Mar 2 21:36:45 2015 (r279547) @@ -46,7 +46,7 @@ ucl_obj_dump (const ucl_object_t *obj, u if (obj->key != NULL) { printf ("%skey: \"%s\"\n", pre, ucl_object_key (obj)); } - printf ("%sref: %hd\n", pre, obj->ref); + printf ("%sref: %u\n", pre, obj->ref); printf ("%slen: %u\n", pre, obj->len); printf ("%sprev: %p\n", pre, obj->prev); printf ("%snext: %p\n", pre, obj->next); @@ -61,7 +61,10 @@ ucl_obj_dump (const ucl_object_t *obj, u else if (obj->type == UCL_ARRAY) { printf ("%stype: UCL_ARRAY\n", pre); printf ("%svalue: %p\n", pre, obj->value.av); - ucl_obj_dump (obj->value.av, shift + 2); + it_obj = NULL; + while ((cur = ucl_iterate_object (obj, &it_obj, true))) { + ucl_obj_dump (cur, shift + 2); + } } else if (obj->type == UCL_INT) { printf ("%stype: UCL_INT\n", pre); @@ -96,7 +99,7 @@ int main(int argc, char **argv) { const char *fn = NULL; - char inbuf[8192]; + unsigned char inbuf[8192]; struct ucl_parser *parser; int k, ret = 0, r = 0; ucl_object_t *obj = NULL; From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:37:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CC2AF; Mon, 2 Mar 2015 21:37:20 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62658AEF; Mon, 2 Mar 2015 21:37:20 +0000 (UTC) Received: by iebtr6 with SMTP id tr6so51727057ieb.7; Mon, 02 Mar 2015 13:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AFZZpiBZRd5nmfTzwY/D0jaW0NSX+B/8rO9TRZSy8YM=; b=BbHpOUQBfnUjuXhp2AlUM3VNhO8V6bDNHKGpZ0MFIflQPBxd2Knyl0nvUvQCv4kbH5 F6UH/xAmCl8DwuThs18wqfidboV/MJ33lp94go1CTImr2Jf6DxTQzt/Jo1SV4qgAVKB3 XqnO84MB+hpo9HHc/oMXBE2k2Iz7olo75X69Jz7xsSxg40ZTpEXf0Rh4agLtc5x8QDoq tHCMQNra/w5qE2k2Psvyvx5gKiashrctDL8HbveH2HzxIYRDTi8FJZYFu9BIZCus6yYj mKszgc/aXB5mc9xcO//kN9Zv8xqgjy75CnMTJsSZx8mwjJg2sOxOaVNh7xr1tlb8JXdv /bVA== MIME-Version: 1.0 X-Received: by 10.43.150.10 with SMTP id km10mr33172151icc.83.1425332239837; Mon, 02 Mar 2015 13:37:19 -0800 (PST) Received: by 10.107.156.75 with HTTP; Mon, 2 Mar 2015 13:37:19 -0800 (PST) In-Reply-To: <1732134.mIfMuHJmix@ralph.baldwin.cx> References: <201503010039.t210dm23090086@svn.freebsd.org> <1732134.mIfMuHJmix@ralph.baldwin.cx> Date: Mon, 2 Mar 2015 16:37:19 -0500 Message-ID: Subject: Re: svn commit: r279444 - in head/sys/amd64/vmm: . io From: Ryan Stone To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:37:20 -0000 Yes, I expect that it will, although you will have to set the new tunable before loading vmm.ko From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:37:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D2EC1CE; Mon, 2 Mar 2015 21:37:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C12B38; Mon, 2 Mar 2015 21:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22LbvFv015586; Mon, 2 Mar 2015 21:37:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22Lbu9T015573; Mon, 2 Mar 2015 21:37:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503022137.t22Lbu9T015573@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 21:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279548 - in vendor/libucl/20150302: . cmake doc include klib m4 src tests tests/basic uthash utils X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:37:58 -0000 Author: bapt Date: Mon Mar 2 21:37:55 2015 New Revision: 279548 URL: https://svnweb.freebsd.org/changeset/base/279548 Log: Tag import of libucl from git as of 20150302 Added: vendor/libucl/20150302/ - copied from r279545, vendor/libucl/dist/ vendor/libucl/20150302/klib/ - copied from r279546, vendor/libucl/dist/klib/ vendor/libucl/20150302/tests/basic/14.in - copied unchanged from r279546, vendor/libucl/dist/tests/basic/14.in vendor/libucl/20150302/tests/basic/14.res - copied unchanged from r279546, vendor/libucl/dist/tests/basic/14.res Replaced: vendor/libucl/20150302/ChangeLog.md - copied unchanged from r279546, vendor/libucl/dist/ChangeLog.md vendor/libucl/20150302/Makefile.am - copied unchanged from r279546, vendor/libucl/dist/Makefile.am vendor/libucl/20150302/README.md - copied unchanged from r279546, vendor/libucl/dist/README.md vendor/libucl/20150302/cmake/CMakeLists.txt - copied unchanged from r279546, vendor/libucl/dist/cmake/CMakeLists.txt vendor/libucl/20150302/configure.ac - copied unchanged from r279546, vendor/libucl/dist/configure.ac vendor/libucl/20150302/doc/Makefile.am - copied unchanged from r279546, vendor/libucl/dist/doc/Makefile.am vendor/libucl/20150302/doc/api.md - copied unchanged from r279546, vendor/libucl/dist/doc/api.md vendor/libucl/20150302/doc/libucl.3 - copied unchanged from r279546, vendor/libucl/dist/doc/libucl.3 vendor/libucl/20150302/doc/pandoc.template - copied unchanged from r279546, vendor/libucl/dist/doc/pandoc.template vendor/libucl/20150302/include/ucl.h - copied unchanged from r279546, vendor/libucl/dist/include/ucl.h vendor/libucl/20150302/src/Makefile.am - copied unchanged from r279546, vendor/libucl/dist/src/Makefile.am vendor/libucl/20150302/src/ucl_emitter.c - copied unchanged from r279546, vendor/libucl/dist/src/ucl_emitter.c vendor/libucl/20150302/src/ucl_emitter_utils.c - copied unchanged from r279546, vendor/libucl/dist/src/ucl_emitter_utils.c vendor/libucl/20150302/src/ucl_hash.c - copied unchanged from r279546, vendor/libucl/dist/src/ucl_hash.c vendor/libucl/20150302/src/ucl_hash.h - copied unchanged from r279546, vendor/libucl/dist/src/ucl_hash.h vendor/libucl/20150302/src/ucl_internal.h - copied unchanged from r279546, vendor/libucl/dist/src/ucl_internal.h vendor/libucl/20150302/src/ucl_parser.c - copied unchanged from r279546, vendor/libucl/dist/src/ucl_parser.c vendor/libucl/20150302/src/ucl_schema.c - copied unchanged from r279546, vendor/libucl/dist/src/ucl_schema.c vendor/libucl/20150302/src/ucl_util.c - copied unchanged from r279546, vendor/libucl/dist/src/ucl_util.c vendor/libucl/20150302/tests/schema.test - copied unchanged from r279546, vendor/libucl/dist/tests/schema.test vendor/libucl/20150302/tests/test_generate.c - copied unchanged from r279546, vendor/libucl/dist/tests/test_generate.c vendor/libucl/20150302/tests/test_schema.c - copied unchanged from r279546, vendor/libucl/dist/tests/test_schema.c vendor/libucl/20150302/uthash/utstring.h - copied unchanged from r279546, vendor/libucl/dist/uthash/utstring.h vendor/libucl/20150302/utils/objdump.c - copied unchanged from r279547, vendor/libucl/dist/utils/objdump.c Deleted: vendor/libucl/20150302/m4/ Copied: vendor/libucl/20150302/ChangeLog.md (from r279546, vendor/libucl/dist/ChangeLog.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/20150302/ChangeLog.md Mon Mar 2 21:37:55 2015 (r279548, copy of r279546, vendor/libucl/dist/ChangeLog.md) @@ -0,0 +1,34 @@ +# Version history + +## Libucl 0.5 + +- Streamline emitter has been added, so it is now possible to output partial `ucl` objects +- Emitter now is more flexible due to emitter_context structure + +### 0.5.1 +- Fixed number of bugs and memory leaks + +### 0.5.2 + +- Allow userdata objects to be emitted and destructed +- Use userdata objects to store lua function references + +### Libucl 0.6 + +- Reworked macro interface + +### Libucl 0.6.1 + +- Various utilities fixes + +### Libucl 0.7.0 + +- Move to klib library from uthash to reduce memory overhead and increase performance + +### Libucl 0.7.1 + +- Added safe iterators API + +### Libucl 0.7.2 + +- Fixed serious bugs in schema and arrays iteration Copied: vendor/libucl/20150302/Makefile.am (from r279546, vendor/libucl/dist/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/20150302/Makefile.am Mon Mar 2 21:37:55 2015 (r279548, copy of r279546, vendor/libucl/dist/Makefile.am) @@ -0,0 +1,11 @@ +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = uthash klib README.md + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libucl.pc + +if LUA_SUB + LUA_SUBDIR = lua +endif + +SUBDIRS = src tests utils doc $(LUA_SUBDIR) \ No newline at end of file Copied: vendor/libucl/20150302/README.md (from r279546, vendor/libucl/dist/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/20150302/README.md Mon Mar 2 21:37:55 2015 (r279548, copy of r279546, vendor/libucl/dist/README.md) @@ -0,0 +1,369 @@ +# LIBUCL + +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Introduction](#introduction) +- [Basic structure](#basic-structure) +- [Improvements to the json notation](#improvements-to-the-json-notation) + - [General syntax sugar](#general-syntax-sugar) + - [Automatic arrays creation](#automatic-arrays-creation) + - [Named keys hierarchy](#named-keys-hierarchy) + - [Convenient numbers and booleans](#convenient-numbers-and-booleans) +- [General improvements](#general-improvements) + - [Commments](#commments) + - [Macros support](#macros-support) + - [Variables support](#variables-support) + - [Multiline strings](#multiline-strings) +- [Emitter](#emitter) +- [Validation](#validation) +- [Performance](#performance) +- [Conclusion](#conclusion) + +## Introduction + +This document describes the main features and principles of the configuration +language called `UCL` - universal configuration language. + +If you are looking for the libucl API documentation you can find it at [this page](doc/api.md). + +## Basic structure + +UCL is heavily infused by `nginx` configuration as the example of a convenient configuration +system. However, UCL is fully compatible with `JSON` format and is able to parse json files. +For example, you can write the same configuration in the following ways: + +* in nginx like: + +```nginx +param = value; +section { + param = value; + param1 = value1; + flag = true; + number = 10k; + time = 0.2s; + string = "something"; + subsection { + host = { + host = "hostname"; + port = 900; + } + host = { + host = "hostname"; + port = 901; + } + } +} +``` + +* or in JSON: + +```json +{ + "param": "value", + "param1": "value1", + "flag": true, + "subsection": { + "host": [ + { + "host": "hostname", + "port": 900 + }, + { + "host": "hostname", + "port": 901 + } + ] + } +} +``` + +## Improvements to the json notation. + +There are various things that make ucl configuration more convenient for editing than strict json: + +### General syntax sugar + +* Braces are not necessary to enclose a top object: it is automatically treated as an object: + +```json +"key": "value" +``` +is equal to: +```json +{"key": "value"} +``` + +* There is no requirement of quotes for strings and keys, moreover, `:` may be replaced `=` or even be skipped for objects: + +```nginx +key = value; +section { + key = value; +} +``` +is equal to: +```json +{ + "key": "value", + "section": { + "key": "value" + } +} +``` + +* No commas mess: you can safely place a comma or semicolon for the last element in an array or an object: + +```json +{ + "key1": "value", + "key2": "value", +} +``` +### Automatic arrays creation + +* Non-unique keys in an object are allowed and are automatically converted to the arrays internally: + +```json +{ + "key": "value1", + "key": "value2" +} +``` +is converted to: +```json +{ + "key": ["value1", "value2"] +} +``` + +### Named keys hierarchy + +UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process: +```nginx +section "blah" { + key = value; +} +section foo { + key = value; +} +``` + +is converted to the following object: + +```nginx +section { + blah { + key = value; + } + foo { + key = value; + } +} +``` + +Plain definitions may be more complex and contain more than a single level of nested objects: + +```nginx +section "blah" "foo" { + key = value; +} +``` + +is presented as: + +```nginx +section { + blah { + foo { + key = value; + } + } +} +``` + +### Convenient numbers and booleans + +* Numbers can have suffixes to specify standard multipliers: + + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) + + `[kKmMgG]b` - 2 power multipliers (so `1kb` is translated to 1024) + + `[s|min|d|w|y]` - time multipliers, all time values are translated to float number of seconds, for example `10min` is translated to 600.0 and `10ms` is translated to 0.01 +* Hexadecimal integers can be used by `0x` prefix, for example `key = 0xff`. However, floating point values can use decimal base only. +* Booleans can be specified as `true` or `yes` or `on` and `false` or `no` or `off`. +* It is still possible to treat numbers and booleans as strings by enclosing them in double quotes. + +## General improvements + +### Commments + +UCL supports different style of comments: + +* single line: `#` +* multiline: `/* ... */` + +Multiline comments may be nested: +```c +# Sample single line comment +/* + some comment + /* nested comment */ + end of comment +*/ +``` + +### Macros support + +UCL supports external macros both multiline and single line ones: +```nginx +.macro "sometext"; +.macro { + Some long text + .... +}; +``` + +Moreover, each macro can accept an optional list of arguments in braces. These +arguments themselves are the UCL object that is parsed and passed to a macro as +options: + +```nginx +.macro(param=value) "something"; +.macro(param={key=value}) "something"; +.macro(.include "params.conf") "something"; +.macro(#this is multiline macro +param = [value1, value2]) "something"; +.macro(key="()") "something"; +``` + +UCL also provide a convenient `include` macro to load content from another files +to the current UCL object. This macro accepts either path to file: + +```nginx +.include "/full/path.conf" +.include "./relative/path.conf" +.include "${CURDIR}/path.conf" +``` + +or URL (if ucl is built with url support provided by either `libcurl` or `libfetch`): + + .include "http://example.com/file.conf" + +`.include` macro supports a set of options: + +* `try` (default: **false**) - if this option is `true` than UCL treats errors on loading of +this file as non-fatal. For example, such a file can be absent but it won't stop the parsing +of the top-level document. +* `sign` (default: **false**) - if this option is `true` UCL loads and checks the signature for +a file from path named `.sig`. Trusted public keys should be provided for UCL API after +parser is created but before any configurations are parsed. +* `glob` (default: **false**) - if this option is `true` UCL treats the filename as GLOB pattern and load +all files that matches the specified pattern (normally the format of patterns is defined in `glob` manual page +for your operating system). This option is meaningless for URL includes. +* `url` (default: **true**) - allow URL includes. +* `priority` (default: 0) - specify priority for the include (see below). + +Priorities are used by UCL parser to manage the policy of objects rewriting during including other files +as following: + +* If we have two objects with the same priority then we form an implicit array +* If a new object has bigger priority then we overwrite an old one +* If a new object has lower priority then we ignore it + +By default, the priority of top-level object is set to zero (lowest priority). Currently, +you can define up to 16 priorities (from 0 to 15). Includes with bigger priorities will +rewrite keys from the objects with lower priorities as specified by the policy. + +### Variables support + +UCL supports variables in input. Variables are registered by a user of the UCL parser and can be presented in the following forms: + +* `${VARIABLE}` +* `$VARIABLE` + +UCL currently does not support nested variables. To escape variables one could use double dollar signs: + +* `$${VARIABLE}` is converted to `${VARIABLE}` +* `$$VARIABLE` is converted to `$VARIABLE` + +However, if no valid variables are found in a string, no expansion will be performed (and `$$` thus remains unchanged). This may be a subject +to change in future libucl releases. + +### Multiline strings + +UCL can handle multiline strings as well as single line ones. It uses shell/perl like notation for such objects: +``` +key = <@]), [], + [enable_urls=no]) +AC_ARG_ENABLE([regex], AS_HELP_STRING([--enable-regex], + [Enable regex checking for schema @<:@default=yes@:>@]), [], + [enable_regex=yes]) +AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures], + [Enable signatures check (requires openssl) @<:@default=no@:>@]), [], + [enable_signatures=no]) +AC_ARG_ENABLE([lua], AS_HELP_STRING([--enable-lua], + [Enable lua API build (requires lua libraries and headers) @<:@default=no@:>@]), [], + [enable_lua=no]) +AC_ARG_ENABLE([utils], + AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]), + [case "${enableval}" in + yes) utils=true ;; + no) utils=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-utils]) ;; + esac],[utils=false]) +AM_CONDITIONAL([UTILS], [test x$utils = xtrue]) + +AS_IF([test "x$enable_signatures" = "xyes"], [ + AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [ + AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).]) + LIBCRYPTO_LIB="-lcrypto" + LIBS_EXTRA="${LIBS_EXTRA} -lcrypto" + ], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])]) +]) +AC_SUBST(LIBCRYPTO_LIB) +AC_PATH_PROG(PANDOC, pandoc, [/non/existent]) + +AC_SEARCH_LIBS([clock_gettime], [rt], [], [ + AC_CHECK_HEADER([mach/mach_time.h], [ + AC_DEFINE(HAVE_MACH_MACH_TIME_H, 1, [Define to 1 on Darwin]) + ], [AC_MSG_ERROR([unable to find clock_gettime or mach_absolute_time])]) +]) +AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])]) + +AS_IF([test "x$enable_regex" = "xyes"], [ + AC_CHECK_HEADER([regex.h], [ + AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) + AC_SEARCH_LIBS([regexec], [regex], [ + AS_IF([test "x$ac_cv_search_regexec" = "x-lregex"], [ + LIBREGEX_LIB="-lregex" + LIBS_EXTRA="${LIBS_EXTRA} -lregex" + ] + )], + [AC_MSG_ERROR([unable to find the regexec() function])])], + [AC_MSG_ERROR([unable to find the regex.h header]) + ], + [#include ]) +]) +AC_SUBST(LIBREGEX_LIB) + +AS_IF([test "x$enable_lua" = "xyes"], [ + AX_PROG_LUA([5.1], [], [ + AX_LUA_HEADERS([ + AX_LUA_LIBS([ + AC_DEFINE(HAVE_LUA, 1, [Define to 1 for lua support.]) + with_lua="yes" + ], [AC_MSG_ERROR([unable to find the lua libraries]) + ]) + ], [AC_MSG_ERROR([unable to find the lua header files]) + ]) + ], [AC_MSG_ERROR([unable to find the lua interpreter])]) +], [with_lua="no"]) + +AM_CONDITIONAL([LUA_SUB], [test "$with_lua" = "yes"]) + +AS_IF([test "x$enable_urls" = "xyes"], [ + AC_CHECK_HEADER([fetch.h], [ + AC_DEFINE(HAVE_FETCH_H, 1, [Define to 1 if you have the header file.]) + AC_CHECK_LIB(fetch, fetchXGet, [ + AC_DEFINE(HAVE_LIBFETCH, 1, [Define to 1 if you have the 'fetch' library (-lfetch).]) + LIBFETCH_LIBS="-lfetch" + have_libfetch="yes" + LIBS_EXTRA="${LIBS_EXTRA} -lfetch" + ]) + ], [],[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]) + AC_SUBST(LIBFETCH_LIBS) + + AS_IF([ test "x$have_libfetch" != "xyes"], [ + dnl Fallback to libcurl + PKG_CHECK_MODULES([CURL], [libcurl], [ + AC_DEFINE(CURL_FOUND, 1, [Use libcurl]) + LIBS_EXTRA="${LIBS_EXTRA} -lcurl"], + [AC_MSG_ERROR([unable to find neither libfetch nor libcurl])]) + ]) + AC_SUBST(CURL_FOUND) + AC_SUBST(CURL_LIBS) + AC_SUBST(CURL_CFLAGS) +]) + +AC_SUBST(LIBS_EXTRA) + +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + int main() { + volatile unsigned long val = 1; + __sync_synchronize(); + __sync_val_compare_and_swap(&val, 1, 0); + __sync_add_and_fetch(&val, 1); + __sync_sub_and_fetch(&val, 1); + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [0], [Has gcc/MSVC atomic intrinsics]) + AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) +]) + +AC_CONFIG_FILES(Makefile \ + src/Makefile \ + lua/Makefile + tests/Makefile \ + utils/Makefile \ + doc/Makefile \ + lua/libucl.rockspec \ + libucl.pc) +AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) +AC_OUTPUT Copied: vendor/libucl/20150302/doc/Makefile.am (from r279546, vendor/libucl/dist/doc/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/20150302/doc/Makefile.am Mon Mar 2 21:37:55 2015 (r279548, copy of r279546, vendor/libucl/dist/doc/Makefile.am) @@ -0,0 +1,9 @@ +EXTRA_DIST = api.md + +dist_man_MANS = libucl.3 + +gen-man: @PANDOC@ + tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \ + -e "s/%%date%%/$$(LANG=C date +'%d %B, %Y')/" | \ + @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file Copied: vendor/libucl/20150302/doc/api.md (from r279546, vendor/libucl/dist/doc/api.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/20150302/doc/api.md Mon Mar 2 21:37:55 2015 (r279548, copy of r279546, vendor/libucl/dist/doc/api.md) @@ -0,0 +1,495 @@ +# API documentation + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Synopsis](#synopsis) +- [Description](#description) + - [Parser functions](#parser-functions) + - [Emitting functions](#emitting-functions) + - [Conversion functions](#conversion-functions) + - [Generation functions](#generation-functions) + - [Iteration functions](#iteration-functions) + - [Validation functions](#validation-functions) + - [Utility functions](#utility-functions) +- [Parser functions](#parser-functions-1) + - [ucl_parser_new](#ucl_parser_new) + - [ucl_parser_register_macro](#ucl_parser_register_macro) + - [ucl_parser_register_variable](#ucl_parser_register_variable) + - [ucl_parser_add_chunk](#ucl_parser_add_chunk) + - [ucl_parser_add_string](#ucl_parser_add_string) + - [ucl_parser_add_file](#ucl_parser_add_file) + - [ucl_parser_get_object](#ucl_parser_get_object) + - [ucl_parser_get_error](#ucl_parser_get_error) + - [ucl_parser_free](#ucl_parser_free) + - [ucl_pubkey_add](#ucl_pubkey_add) + - [ucl_parser_set_filevars](#ucl_parser_set_filevars) + - [Parser usage example](#parser-usage-example) +- [Emitting functions](#emitting-functions-1) + - [ucl_object_emit](#ucl_object_emit) + - [ucl_object_emit_full](#ucl_object_emit_full) +- [Conversion functions](#conversion-functions-1) +- [Generation functions](#generation-functions-1) + - [ucl_object_new](#ucl_object_new) + - [ucl_object_typed_new](#ucl_object_typed_new) + - [Primitive objects generation](#primitive-objects-generation) + - [ucl_object_fromstring_common](#ucl_object_fromstring_common) +- [Iteration functions](#iteration-functions-1) + - [ucl_iterate_object](#ucl_iterate_object) +- [Validation functions](#validation-functions-1) + - [ucl_object_validate](#ucl_object_validate) + +# Synopsis + +`#include ` + +# Description + +Libucl is a parser and `C` API to parse and generate `ucl` objects. Libucl consist of several groups of functions: + +### Parser functions +Used to parse `ucl` files and provide interface to extract `ucl` object. Currently, `libucl` can parse only full `ucl` documents, for instance, it is impossible to parse a part of document and therefore it is impossible to use `libucl` as a streaming parser. In future, this limitation can be removed. + +### Emitting functions +Convert `ucl` objects to some textual or binary representation. Currently, libucl supports the following exports: + +- `JSON` - valid json format (can possibly lose some original data, such as implicit arrays) +- `Config` - human-readable configuration format (lossless) +- `YAML` - embedded yaml format (has the same limitations as `json` output) + +### Conversion functions +Help to convert `ucl` objects to C types. These functions are used to convert `ucl_object_t` to C primitive types, such as numbers, strings or boolean values. + +### Generation functions +Allow creation of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. + +### Iteration functions +Iterate over `ucl` complex objects or over a chain of values, for example when a key in an object has multiple values (that can be treated as implicit array or implicit consolidation). + +### Validation functions +Validation functions are used to validate some object `obj` using json-schema compatible object `schema`. Both input and schema must be UCL objects to perform validation. + +### Utility functions +Provide basic utilities to manage `ucl` objects: creating, removing, retaining and releasing reference count and so on. + +# Parser functions + +Parser functions operates with `struct ucl_parser`. + +### ucl_parser_new + +~~~C +struct ucl_parser* ucl_parser_new (int flags); +~~~ + +Creates new parser with the specified flags: + +- `UCL_PARSER_KEY_LOWERCASE` - lowercase keys parsed +- `UCL_PARSER_ZEROCOPY` - try to use zero-copy mode when reading files (in zero-copy mode text chunk being parsed without copying strings so it should exist till any object parsed is used) +- `UCL_PARSER_NO_TIME` - treat time values as strings without parsing them as floats + +### ucl_parser_register_macro + +~~~C +void ucl_parser_register_macro (struct ucl_parser *parser, + const char *macro, ucl_macro_handler handler, void* ud); +~~~ + +Register new macro with name .`macro` parsed by handler `handler` that accepts opaque data pointer `ud`. Macro handler should be of the following type: + +~~~C +bool (*ucl_macro_handler) (const unsigned char *data, + size_t len, void* ud);` +~~~ + +Handler function accepts macro text `data` of length `len` and the opaque pointer `ud`. If macro is parsed successfully the handler should return `true`. `false` indicates parsing failure and the parser can be terminated. + +### ucl_parser_register_variable + +~~~C +void ucl_parser_register_variable (struct ucl_parser *parser, + const char *var, const char *value); +~~~ + +Register new variable $`var` that should be replaced by the parser to the `value` string. + +### ucl_parser_add_chunk + +~~~C +bool ucl_parser_add_chunk (struct ucl_parser *parser, + const unsigned char *data, size_t len); +~~~ + +Add new text chunk with `data` of length `len` to the parser. At the moment, `libucl` parser is not a streamlined parser and chunk *must* contain the *valid* ucl object. For example, this object should be valid: + +~~~json +{ "var": "value" } +~~~ + +while this one won't be parsed correctly: + +~~~json +{ "var": +~~~ + +This limitation may possible be removed in future. + +### ucl_parser_add_string +~~~C +bool ucl_parser_add_string (struct ucl_parser *parser, + const char *data, size_t len); +~~~ + +This function acts exactly like `ucl_parser_add_chunk` does but if `len` argument is zero, then the string `data` must be zero-terminated and the actual length is calculated up to `\0` character. + +### ucl_parser_add_file + +~~~C +bool ucl_parser_add_file (struct ucl_parser *parser, + const char *filename); +~~~ + +Load file `filename` and parse it with the specified `parser`. This function uses `mmap` call to load file, therefore, it should not be `shrunk` during parsing. Otherwise, `libucl` can cause memory corruption and terminate the calling application. This function is also used by the internal handler of `include` macro, hence, this macro has the same limitation. + +### ucl_parser_get_object + +~~~C +ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); +~~~ + +If the `ucl` data has been parsed correctly this function returns the top object for the parser. Otherwise, this function returns the `NULL` pointer. The reference count for `ucl` object returned is increased by one, therefore, a caller should decrease reference by using `ucl_object_unref` to free object after usage. + +### ucl_parser_get_error + +~~~C +const char *ucl_parser_get_error(struct ucl_parser *parser); +~~~ + +Returns the constant error string for the parser object. If no error occurred during parsing a `NULL` object is returned. A caller should not try to free or modify this string. + +### ucl_parser_free + +~~~C +void ucl_parser_free (struct ucl_parser *parser); +~~~ + +Frees memory occupied by the parser object. The reference count for top object is decreased as well, however if the function `ucl_parser_get_object` was called previously then the top object won't be freed. + +### ucl_pubkey_add + +~~~C +bool ucl_pubkey_add (struct ucl_parser *parser, + const unsigned char *key, size_t len); +~~~ + +This function adds a public key from text blob `key` of length `len` to the `parser` object. This public key should be in the `PEM` format and can be used by `.includes` macro for checking signatures of files included. `Openssl` support should be enabled to make this function working. If a key cannot be added (e.g. due to format error) or `openssl` was not linked to `libucl` then this function returns `false`. + +### ucl_parser_set_filevars + +~~~C +bool ucl_parser_set_filevars (struct ucl_parser *parser, + const char *filename, bool need_expand); +~~~ + +Add the standard file variables to the `parser` based on the `filename` specified: + +- `$FILENAME` - a filename of `ucl` input +- `$CURDIR` - a current directory of the input + +For example, if a `filename` param is `../something.conf` then the variables will have the following values: + +- `$FILENAME` - "../something.conf" +- `$CURDIR` - ".." + +if `need_expand` parameter is `true` then all relative paths are expanded using `realpath` call. In this example if `..` is `/etc/dir` then variables will have these values: + +- `$FILENAME` - "/etc/something.conf" +- `$CURDIR` - "/etc" + +## Parser usage example + +The following example loads, parses and extracts `ucl` object from stdin using `libucl` parser functions (the length of input is limited to 8K): + +~~~C +char inbuf[8192]; +struct ucl_parser *parser = NULL; +int ret = 0, r = 0; +ucl_object_t *obj = NULL; +FILE *in; + +in = stdin; +parser = ucl_parser_new (0); +while (!feof (in) && r < (int)sizeof (inbuf)) { + r += fread (inbuf + r, 1, sizeof (inbuf) - r, in); +} +ucl_parser_add_chunk (parser, inbuf, r); +fclose (in); + +if (ucl_parser_get_error (parser)) { + printf ("Error occurred: %s\n", ucl_parser_get_error (parser)); + ret = 1; +} +else { + obj = ucl_parser_get_object (parser); +} + +if (parser != NULL) { + ucl_parser_free (parser); +} +if (obj != NULL) { + ucl_object_unref (obj); +} +return ret; +~~~ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:41:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7BBD33B; Mon, 2 Mar 2015 21:41:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEFA8BF4; Mon, 2 Mar 2015 21:41:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22LfF9E018905; Mon, 2 Mar 2015 21:41:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22LfA3r018873; Mon, 2 Mar 2015 21:41:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503022141.t22LfA3r018873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 21:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279549 - in head: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/include contrib/libucl/klib contrib/libucl/m4 contrib/libucl/src contrib/libucl/tests contrib/li... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:41:16 -0000 Author: bapt Date: Mon Mar 2 21:41:09 2015 New Revision: 279549 URL: https://svnweb.freebsd.org/changeset/base/279549 Log: Update libucl to git version 8d3b186 Added: head/contrib/libucl/klib/ - copied from r279548, vendor/libucl/dist/klib/ head/contrib/libucl/tests/basic/14.in - copied unchanged from r279548, vendor/libucl/dist/tests/basic/14.in head/contrib/libucl/tests/basic/14.res - copied unchanged from r279548, vendor/libucl/dist/tests/basic/14.res Deleted: head/contrib/libucl/m4/ Modified: head/contrib/libucl/ChangeLog.md head/contrib/libucl/Makefile.am head/contrib/libucl/README.md head/contrib/libucl/cmake/CMakeLists.txt head/contrib/libucl/configure.ac head/contrib/libucl/doc/Makefile.am head/contrib/libucl/doc/api.md head/contrib/libucl/doc/libucl.3 head/contrib/libucl/doc/pandoc.template head/contrib/libucl/include/ucl.h head/contrib/libucl/src/Makefile.am head/contrib/libucl/src/ucl_emitter.c head/contrib/libucl/src/ucl_emitter_utils.c head/contrib/libucl/src/ucl_hash.c head/contrib/libucl/src/ucl_hash.h head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_schema.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/tests/schema.test head/contrib/libucl/tests/test_generate.c head/contrib/libucl/tests/test_schema.c head/contrib/libucl/uthash/utstring.h head/contrib/libucl/utils/objdump.c head/lib/libucl/Makefile Directory Properties: head/contrib/libucl/ (props changed) Modified: head/contrib/libucl/ChangeLog.md ============================================================================== --- head/contrib/libucl/ChangeLog.md Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/ChangeLog.md Mon Mar 2 21:41:09 2015 (r279549) @@ -20,3 +20,15 @@ ### Libucl 0.6.1 - Various utilities fixes + +### Libucl 0.7.0 + +- Move to klib library from uthash to reduce memory overhead and increase performance + +### Libucl 0.7.1 + +- Added safe iterators API + +### Libucl 0.7.2 + +- Fixed serious bugs in schema and arrays iteration Modified: head/contrib/libucl/Makefile.am ============================================================================== --- head/contrib/libucl/Makefile.am Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/Makefile.am Mon Mar 2 21:41:09 2015 (r279549) @@ -1,5 +1,5 @@ ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = uthash README.md +EXTRA_DIST = uthash klib README.md pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libucl.pc Modified: head/contrib/libucl/README.md ============================================================================== --- head/contrib/libucl/README.md Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/README.md Mon Mar 2 21:41:09 2015 (r279549) @@ -1,6 +1,6 @@ # LIBUCL -[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* @@ -156,10 +156,10 @@ is converted to the following object: ```nginx section { blah { - key = value; + key = value; } foo { - key = value; + key = value; } } ``` @@ -177,9 +177,9 @@ is presented as: ```nginx section { blah { - foo { - key = value; - } + foo { + key = value; + } } } ``` @@ -219,8 +219,8 @@ UCL supports external macros both multil ```nginx .macro "sometext"; .macro { - Some long text - .... + Some long text + .... }; ``` Modified: head/contrib/libucl/cmake/CMakeLists.txt ============================================================================== --- head/contrib/libucl/cmake/CMakeLists.txt Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/cmake/CMakeLists.txt Mon Mar 2 21:41:09 2015 (r279549) @@ -82,6 +82,7 @@ ENDIF(ENABLE_URL_SIGN MATCHES "ON") INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../src") INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../include") INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../uthash") +INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../klib") SET(UCLSRC ../src/ucl_util.c ../src/ucl_parser.c Modified: head/contrib/libucl/configure.ac ============================================================================== --- head/contrib/libucl/configure.ac Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/configure.ac Mon Mar 2 21:41:09 2015 (r279549) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [6]) -m4_define([min_ver], [1]) -m4_define([so_version], [3:0:1]) +m4_define([med_ver], [7]) +m4_define([min_ver], [2]) +m4_define([so_version], [5:0:1]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) Modified: head/contrib/libucl/doc/Makefile.am ============================================================================== --- head/contrib/libucl/doc/Makefile.am Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/doc/Makefile.am Mon Mar 2 21:41:09 2015 (r279549) @@ -4,5 +4,6 @@ dist_man_MANS = libucl.3 gen-man: @PANDOC@ tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ - cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \ + -e "s/%%date%%/$$(LANG=C date +'%d %B, %Y')/" | \ @PANDOC@ -s -f markdown -t man -o libucl.3 Modified: head/contrib/libucl/doc/api.md ============================================================================== --- head/contrib/libucl/doc/api.md Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/doc/api.md Mon Mar 2 21:41:09 2015 (r279549) @@ -377,7 +377,9 @@ If parsing operations fail then the resu # Iteration functions -Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. +Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). +There are two types of iterators API: old and unsafe one via `ucl_iterate_object` and the proposed interface of safe iterators. + ## ucl_iterate_object ~~~C @@ -402,6 +404,60 @@ while ((obj = ucl_iterate_object (top, & } ~~~ +## Safe iterators API + +Safe iterators are defined to clarify iterating over UCL objects and simplify flattening of UCL objects in non-trivial cases. +For example, if there is an implicit array that contains another array and a boolean value it is extremely unclear how to iterate over +such an object. Safe iterators are desinged to define two sorts of iteration: + +1. Iteration over complex objects with expanding all values +2. Iteration over complex objects without expanding of values + +The following example demonstrates the difference between these two types of iteration: + +~~~ +key = 1; +key = [2, 3, 4]; + +Iteration with expansion: + +1, 2, 3, 4 + +Iteration without expansion: + +1, [2, 3, 4] +~~~ + +UCL defines the following functions to manage safe iterators: + +- `ucl_object_iterate_new` - creates new safe iterator +- `ucl_object_iterate_reset` - resets iterator to a new object +- `ucl_object_iterate_safe` - safely iterate the object inside iterator +- `ucl_object_iterate_free` - free memory associated with the safe iterator + +Please note that unlike unsafe iterators, safe iterators *must* be explicitly initialized and freed. +An assert is likely generated if you use uninitialized or `NULL` iterator in all safe iterators functions. + +~~~C +ucl_object_iter_t it; +const ucl_object_t *cur; + +it = ucl_object_iterate_new (obj); + +while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { + /* Do something */ +} + +/* Switch to another object */ +it = ucl_object_iterate_reset (it, another_obj); + +while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { + /* Do something else */ +} + +ucl_object_iterate_free (it); +~~~ + # Validation functions Currently, there is only one validation function called `ucl_object_validate`. It performs validation of object using the specified schema. This function is defined as following: Modified: head/contrib/libucl/doc/libucl.3 ============================================================================== --- head/contrib/libucl/doc/libucl.3 Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/doc/libucl.3 Mon Mar 2 21:41:09 2015 (r279549) @@ -1,4 +1,4 @@ -.TH "LIBUCL" "3" "July 26, 2014" "Libucl manual" "" +.TH "LIBUCL" "3" "27 December, 2014" "Libucl manual" "" .SH NAME .PP \f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[], @@ -528,8 +528,9 @@ Iteration are used to iterate over UCL c objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). -To iterate over an object, an array or a key with multiple values there -is a function \f[C]ucl_iterate_object\f[]. +There are two types of iterators API: old and unsafe one via +\f[C]ucl_iterate_object\f[] and the proposed interface of safe +iterators. .SS ucl_iterate_object .IP .nf @@ -578,6 +579,75 @@ while\ ((obj\ =\ ucl_iterate_object\ (to } \f[] .fi +.SS Safe iterators API +.PP +Safe iterators are defined to clarify iterating over UCL objects and +simplify flattening of UCL objects in non\-trivial cases. +For example, if there is an implicit array that contains another array +and a boolean value it is extremely unclear how to iterate over such an +object. +Safe iterators are desinged to define two sorts of iteration: +.IP "1." 3 +Iteration over complex objects with expanding all values +.IP "2." 3 +Iteration over complex objects without expanding of values +.PP +The following example demonstrates the difference between these two +types of iteration: +.IP +.nf +\f[C] +key\ =\ 1; +key\ =\ [2,\ 3,\ 4]; + +Iteration\ with\ expansion: + +1,\ 2,\ 3,\ 4 + +Iteration\ without\ expansion: + +1,\ [2,\ 3,\ 4] +\f[] +.fi +.PP +UCL defines the following functions to manage safe iterators: +.IP \[bu] 2 +\f[C]ucl_object_iterate_new\f[] \- creates new safe iterator +.IP \[bu] 2 +\f[C]ucl_object_iterate_reset\f[] \- resets iterator to a new object +.IP \[bu] 2 +\f[C]ucl_object_iterate_safe\f[] \- safely iterate the object inside +iterator +.IP \[bu] 2 +\f[C]ucl_object_iterate_free\f[] \- free memory associated with the safe +iterator +.PP +Please note that unlike unsafe iterators, safe iterators \f[I]must\f[] +be explicitly initialized and freed. +An assert is likely generated if you use uninitialized or \f[C]NULL\f[] +iterator in all safe iterators functions. +.IP +.nf +\f[C] +ucl_object_iter_t\ it; +const\ ucl_object_t\ *cur; + +it\ =\ ucl_object_iterate_new\ (obj); + +while\ ((cur\ =\ ucl_object_iterate_safe\ (it,\ true))\ !=\ NULL)\ { +\ \ \ \ /*\ Do\ something\ */ +} + +/*\ Switch\ to\ another\ object\ */ +it\ =\ ucl_object_iterate_reset\ (it,\ another_obj); + +while\ ((cur\ =\ ucl_object_iterate_safe\ (it,\ true))\ !=\ NULL)\ { +\ \ \ \ /*\ Do\ something\ else\ */ +} + +ucl_object_iterate_free\ (it); +\f[] +.fi .SH VALIDATION FUNCTIONS .PP Currently, there is only one validation function called Modified: head/contrib/libucl/doc/pandoc.template ============================================================================== --- head/contrib/libucl/doc/pandoc.template Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/doc/pandoc.template Mon Mar 2 21:41:09 2015 (r279549) @@ -1,6 +1,6 @@ % LIBUCL(3) Libucl manual % Vsevolod Stakhov -% July 26, 2014 +% %%date%% # Name Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/include/ucl.h Mon Mar 2 21:41:09 2015 (r279549) @@ -192,7 +192,7 @@ typedef struct ucl_object_s { int64_t iv; /**< Int value of an object */ const char *sv; /**< String value of an object */ double dv; /**< Double value of an object */ - struct ucl_object_s *av; /**< Array */ + void *av; /**< Array */ void *ov; /**< Object */ void* ud; /**< Opaque user data */ } value; @@ -715,6 +715,37 @@ typedef void* ucl_object_iter_t; */ UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); + +/** + * Create new safe iterator for the specified object + * @param obj object to iterate + * @return new iterator object that should be used with safe iterators API only + */ +UCL_EXTERN ucl_object_iter_t ucl_object_iterate_new (const ucl_object_t *obj) + UCL_WARN_UNUSED_RESULT; +/** + * Reset initialized iterator to a new object + * @param obj new object to iterate + * @return modified iterator object + */ +UCL_EXTERN ucl_object_iter_t ucl_object_iterate_reset (ucl_object_iter_t it, + const ucl_object_t *obj); + +/** + * Get the next object from the `obj`. This fucntion iterates over arrays, objects + * and implicit arrays + * @param iter safe iterator + * @return the next object in sequence + */ +UCL_EXTERN const ucl_object_t* ucl_object_iterate_safe (ucl_object_iter_t iter, + bool expand_values); + +/** + * Free memory associated with the safe iterator + * @param it safe iterator object + */ +UCL_EXTERN void ucl_object_iterate_free (ucl_object_iter_t it); + /** @} */ @@ -854,6 +885,13 @@ UCL_EXTERN ucl_object_t* ucl_parser_get_ * @param parser parser object */ UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); + +/** + * Clear the error in the parser + * @param parser parser object + */ +UCL_EXTERN void ucl_parser_clear_error(struct ucl_parser *parser); + /** * Free ucl parser object * @param parser parser object Modified: head/contrib/libucl/src/Makefile.am ============================================================================== --- head/contrib/libucl/src/Makefile.am Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/Makefile.am Mon Mar 2 21:41:09 2015 (r279549) @@ -1,6 +1,7 @@ libucl_common_cflags= -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ -I$(top_srcdir)/uthash \ + -I$(top_srcdir)/klib \ -Wall -W -Wno-unused-parameter -Wno-pointer-sign lib_LTLIBRARIES= libucl.la libucl_la_SOURCES= ucl_emitter.c \ Modified: head/contrib/libucl/src/ucl_emitter.c ============================================================================== --- head/contrib/libucl/src/ucl_emitter.c Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_emitter.c Mon Mar 2 21:41:09 2015 (r279549) @@ -250,6 +250,7 @@ ucl_emitter_common_start_array (struct u const ucl_object_t *obj, bool print_key, bool compact) { const ucl_object_t *cur; + ucl_object_iter_t iter = NULL; const struct ucl_emitter_functions *func = ctx->func; bool first = true; @@ -266,18 +267,22 @@ ucl_emitter_common_start_array (struct u if (obj->type == UCL_ARRAY) { /* explicit array */ - cur = obj->value.av; + while ((cur = ucl_iterate_object (obj, &iter, true)) != NULL) { + ucl_emitter_common_elt (ctx, cur, first, false, compact); + first = false; + } } else { /* implicit array */ cur = obj; + while (cur) { + ucl_emitter_common_elt (ctx, cur, first, false, compact); + first = false; + cur = cur->next; + } } - while (cur) { - ucl_emitter_common_elt (ctx, cur, first, false, compact); - first = false; - cur = cur->next; - } + } /** Modified: head/contrib/libucl/src/ucl_emitter_utils.c ============================================================================== --- head/contrib/libucl/src/ucl_emitter_utils.c Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_emitter_utils.c Mon Mar 2 21:41:09 2015 (r279549) @@ -289,6 +289,7 @@ ucl_fd_append_character (unsigned char c else { memset (buf, c, len); if (write (fd, buf, len) == -1) { + free(buf); return -1; } free (buf); Modified: head/contrib/libucl/src/ucl_hash.c ============================================================================== --- head/contrib/libucl/src/ucl_hash.c Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_hash.c Mon Mar 2 21:41:09 2015 (r279549) @@ -23,119 +23,331 @@ #include "ucl_internal.h" #include "ucl_hash.h" -#include "utlist.h" +#include "khash.h" +#include "kvec.h" + +struct ucl_hash_elt { + const ucl_object_t *obj; + size_t ar_idx; +}; + +struct ucl_hash_struct { + void *hash; + kvec_t(const ucl_object_t *) ar; + bool caseless; +}; + +static inline uint32_t +ucl_hash_func (const ucl_object_t *o) +{ + return XXH32 (o->key, o->keylen, 0xdeadbeef); +} + +static inline int +ucl_hash_equal (const ucl_object_t *k1, const ucl_object_t *k2) +{ + if (k1->keylen == k2->keylen) { + return strncmp (k1->key, k2->key, k1->keylen) == 0; + } + + return 0; +} + +KHASH_INIT (ucl_hash_node, const ucl_object_t *, struct ucl_hash_elt, 1, + ucl_hash_func, ucl_hash_equal) + +static inline uint32_t +ucl_hash_caseless_func (const ucl_object_t *o) +{ + void *xxh = XXH32_init (0xdeadbeef); + char hash_buf[64], *c; + const char *p; + ssize_t remain = o->keylen; + + p = o->key; + c = &hash_buf[0]; + + while (remain > 0) { + *c++ = tolower (*p++); + + if (c - &hash_buf[0] == sizeof (hash_buf)) { + XXH32_update (xxh, hash_buf, sizeof (hash_buf)); + c = &hash_buf[0]; + } + remain --; + } + + if (c - &hash_buf[0] != 0) { + XXH32_update (xxh, hash_buf, c - &hash_buf[0]); + } + + return XXH32_digest (xxh); +} + +static inline int +ucl_hash_caseless_equal (const ucl_object_t *k1, const ucl_object_t *k2) +{ + if (k1->keylen == k2->keylen) { + return strncasecmp (k1->key, k2->key, k1->keylen) == 0; + } + + return 0; +} + +KHASH_INIT (ucl_hash_caseless_node, const ucl_object_t *, struct ucl_hash_elt, 1, + ucl_hash_caseless_func, ucl_hash_caseless_equal) ucl_hash_t* -ucl_hash_create (void) +ucl_hash_create (bool ignore_case) { ucl_hash_t *new; new = UCL_ALLOC (sizeof (ucl_hash_t)); if (new != NULL) { - new->buckets = NULL; + kv_init (new->ar); + + new->caseless = ignore_case; + if (ignore_case) { + khash_t(ucl_hash_caseless_node) *h = kh_init (ucl_hash_caseless_node); + new->hash = (void *)h; + } + else { + khash_t(ucl_hash_node) *h = kh_init (ucl_hash_node); + new->hash = (void *)h; + } } return new; } void ucl_hash_destroy (ucl_hash_t* hashlin, ucl_hash_free_func *func) { - ucl_hash_node_t *elt, *tmp; - const ucl_object_t *cur, *otmp; + const ucl_object_t *cur, *tmp; + + if (hashlin == NULL) { + return; + } - HASH_ITER (hh, hashlin->buckets, elt, tmp) { - HASH_DELETE (hh, hashlin->buckets, elt); - if (func) { - DL_FOREACH_SAFE (elt->data, cur, otmp) { - /* Need to deconst here */ - func (__DECONST (ucl_object_t *, cur)); + if (func != NULL) { + /* Iterate over the hash first */ + khash_t(ucl_hash_node) *h = (khash_t(ucl_hash_node) *) + hashlin->hash; + khiter_t k; + + for (k = kh_begin (h); k != kh_end (h); ++k) { + if (kh_exist (h, k)) { + cur = (kh_value (h, k)).obj; + while (cur != NULL) { + tmp = cur->next; + func (__DECONST (ucl_object_t *, cur)); + cur = tmp; + } } } - UCL_FREE (sizeof (ucl_hash_node_t), elt); } - UCL_FREE (sizeof (ucl_hash_t), hashlin); + + if (hashlin->caseless) { + khash_t(ucl_hash_caseless_node) *h = (khash_t(ucl_hash_caseless_node) *) + hashlin->hash; + kh_destroy (ucl_hash_caseless_node, h); + } + else { + khash_t(ucl_hash_node) *h = (khash_t(ucl_hash_node) *) + hashlin->hash; + kh_destroy (ucl_hash_node, h); + } + + kv_destroy (hashlin->ar); + UCL_FREE (sizeof (*hashlin), hashlin); } void ucl_hash_insert (ucl_hash_t* hashlin, const ucl_object_t *obj, const char *key, unsigned keylen) { - ucl_hash_node_t *node; + khiter_t k; + int ret; + struct ucl_hash_elt *elt; - node = UCL_ALLOC (sizeof (ucl_hash_node_t)); - node->data = obj; - HASH_ADD_KEYPTR (hh, hashlin->buckets, key, keylen, node); + if (hashlin == NULL) { + return; + } + + if (hashlin->caseless) { + khash_t(ucl_hash_caseless_node) *h = (khash_t(ucl_hash_caseless_node) *) + hashlin->hash; + k = kh_put (ucl_hash_caseless_node, h, obj, &ret); + if (ret > 0) { + elt = &kh_value (h, k); + kv_push (const ucl_object_t *, hashlin->ar, obj); + elt->obj = obj; + elt->ar_idx = kv_size (hashlin->ar) - 1; + } + } + else { + khash_t(ucl_hash_node) *h = (khash_t(ucl_hash_node) *) + hashlin->hash; + k = kh_put (ucl_hash_node, h, obj, &ret); + if (ret > 0) { + elt = &kh_value (h, k); + kv_push (const ucl_object_t *, hashlin->ar, obj); + elt->obj = obj; + elt->ar_idx = kv_size (hashlin->ar) - 1; + } + } } void ucl_hash_replace (ucl_hash_t* hashlin, const ucl_object_t *old, const ucl_object_t *new) { - ucl_hash_node_t *node; + khiter_t k; + int ret; + struct ucl_hash_elt elt, *pelt; - HASH_FIND (hh, hashlin->buckets, old->key, old->keylen, node); - if (node != NULL) { - /* Direct replacement */ - node->data = new; - node->hh.key = new->key; - node->hh.keylen = new->keylen; + if (hashlin == NULL) { + return; + } + + if (hashlin->caseless) { + khash_t(ucl_hash_caseless_node) *h = (khash_t(ucl_hash_caseless_node) *) + hashlin->hash; + k = kh_put (ucl_hash_caseless_node, h, old, &ret); + if (ret == 0) { + elt = kh_value (h, k); + kh_del (ucl_hash_caseless_node, h, k); + k = kh_put (ucl_hash_caseless_node, h, new, &ret); + pelt = &kh_value (h, k); + pelt->obj = new; + pelt->ar_idx = elt.ar_idx; + kv_A (hashlin->ar, elt.ar_idx) = new; + } + } + else { + khash_t(ucl_hash_node) *h = (khash_t(ucl_hash_node) *) + hashlin->hash; + k = kh_put (ucl_hash_node, h, old, &ret); + if (ret == 0) { + elt = kh_value (h, k); + kh_del (ucl_hash_node, h, k); + k = kh_put (ucl_hash_node, h, new, &ret); + pelt = &kh_value (h, k); + pelt->obj = new; + pelt->ar_idx = elt.ar_idx; + kv_A (hashlin->ar, elt.ar_idx) = new; + } } } +struct ucl_hash_real_iter { + const ucl_object_t **cur; + const ucl_object_t **end; +}; + const void* ucl_hash_iterate (ucl_hash_t *hashlin, ucl_hash_iter_t *iter) { - ucl_hash_node_t *elt = *iter; + struct ucl_hash_real_iter *it = (struct ucl_hash_real_iter *)(*iter); + const ucl_object_t *ret = NULL; - if (elt == NULL) { - if (hashlin == NULL || hashlin->buckets == NULL) { - return NULL; - } - elt = hashlin->buckets; - if (elt == NULL) { - return NULL; - } + if (hashlin == NULL) { + return NULL; + } + + if (it == NULL) { + it = UCL_ALLOC (sizeof (*it)); + it->cur = &hashlin->ar.a[0]; + it->end = it->cur + hashlin->ar.n; + } + + if (it->cur < it->end) { + ret = *it->cur++; } - else if (elt == hashlin->buckets) { + else { + UCL_FREE (sizeof (*it), it); + *iter = NULL; return NULL; } - *iter = elt->hh.next ? elt->hh.next : hashlin->buckets; - return elt->data; + *iter = it; + + return ret; } bool -ucl_hash_iter_has_next (ucl_hash_iter_t iter) +ucl_hash_iter_has_next (ucl_hash_t *hashlin, ucl_hash_iter_t iter) { - ucl_hash_node_t *elt = iter; + struct ucl_hash_real_iter *it = (struct ucl_hash_real_iter *)(iter); - return (elt == NULL || elt->hh.prev != NULL); + return it->cur < it->end - 1; } const ucl_object_t* ucl_hash_search (ucl_hash_t* hashlin, const char *key, unsigned keylen) { - ucl_hash_node_t *found; + khiter_t k; + const ucl_object_t *ret = NULL; + ucl_object_t search; + struct ucl_hash_elt *elt; + + search.key = key; + search.keylen = keylen; if (hashlin == NULL) { return NULL; } - HASH_FIND (hh, hashlin->buckets, key, keylen, found); - if (found) { - return found->data; + if (hashlin->caseless) { + khash_t(ucl_hash_caseless_node) *h = (khash_t(ucl_hash_caseless_node) *) + hashlin->hash; + + k = kh_get (ucl_hash_caseless_node, h, &search); + if (k != kh_end (h)) { + elt = &kh_value (h, k); + ret = elt->obj; + } } - return NULL; + else { + khash_t(ucl_hash_node) *h = (khash_t(ucl_hash_node) *) + hashlin->hash; + k = kh_get (ucl_hash_node, h, &search); + if (k != kh_end (h)) { + elt = &kh_value (h, k); + ret = elt->obj; + } + } + + return ret; } void ucl_hash_delete (ucl_hash_t* hashlin, const ucl_object_t *obj) { - ucl_hash_node_t *found; + khiter_t k; + struct ucl_hash_elt *elt; - HASH_FIND (hh, hashlin->buckets, obj->key, obj->keylen, found); + if (hashlin == NULL) { + return; + } - if (found) { - HASH_DELETE (hh, hashlin->buckets, found); - UCL_FREE (sizeof (ucl_hash_node_t), found); + if (hashlin->caseless) { + khash_t(ucl_hash_caseless_node) *h = (khash_t(ucl_hash_caseless_node) *) + hashlin->hash; + + k = kh_get (ucl_hash_caseless_node, h, obj); + if (k != kh_end (h)) { + elt = &kh_value (h, k); + kv_A (hashlin->ar, elt->ar_idx) = NULL; + kh_del (ucl_hash_caseless_node, h, k); + } + } + else { + khash_t(ucl_hash_node) *h = (khash_t(ucl_hash_node) *) + hashlin->hash; + k = kh_get (ucl_hash_node, h, obj); + if (k != kh_end (h)) { + elt = &kh_value (h, k); + kv_A (hashlin->ar, elt->ar_idx) = NULL; + kh_del (ucl_hash_node, h, k); + } } } Modified: head/contrib/libucl/src/ucl_hash.h ============================================================================== --- head/contrib/libucl/src/ucl_hash.h Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_hash.h Mon Mar 2 21:41:09 2015 (r279549) @@ -25,15 +25,11 @@ #define __UCL_HASH_H #include "ucl.h" -#include "uthash.h" /******************************************************************************/ -typedef struct ucl_hash_node_s -{ - const ucl_object_t *data; - UT_hash_handle hh; -} ucl_hash_node_t; +struct ucl_hash_node_s; +typedef struct ucl_hash_node_s ucl_hash_node_t; typedef int ucl_hash_cmp_func (const void* void_a, const void* void_b); typedef void ucl_hash_free_func (void *ptr); @@ -43,16 +39,14 @@ typedef void* ucl_hash_iter_t; /** * Linear chained hashtable. */ -typedef struct ucl_hash_struct -{ - ucl_hash_node_t *buckets; /**< array of hash buckets. One list for each hash modulus. */ -} ucl_hash_t; +struct ucl_hash_struct; +typedef struct ucl_hash_struct ucl_hash_t; /** * Initializes the hashtable. */ -ucl_hash_t* ucl_hash_create (void); +ucl_hash_t* ucl_hash_create (bool ignore_case); /** * Deinitializes the hashtable. @@ -94,6 +88,6 @@ const void* ucl_hash_iterate (ucl_hash_t /** * Check whether an iterator has next element */ -bool ucl_hash_iter_has_next (ucl_hash_iter_t iter); +bool ucl_hash_iter_has_next (ucl_hash_t *hashlin, ucl_hash_iter_t iter); #endif Modified: head/contrib/libucl/src/ucl_internal.h ============================================================================== --- head/contrib/libucl/src/ucl_internal.h Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_internal.h Mon Mar 2 21:41:09 2015 (r279549) @@ -339,14 +339,17 @@ ucl_hash_search_obj (ucl_hash_t* hashlin return (const ucl_object_t *)ucl_hash_search (hashlin, obj->key, obj->keylen); } -static inline ucl_hash_t * -ucl_hash_insert_object (ucl_hash_t *hashlin, const ucl_object_t *obj) UCL_WARN_UNUSED_RESULT; +static inline ucl_hash_t * ucl_hash_insert_object (ucl_hash_t *hashlin, + const ucl_object_t *obj, + bool ignore_case) UCL_WARN_UNUSED_RESULT; static inline ucl_hash_t * -ucl_hash_insert_object (ucl_hash_t *hashlin, const ucl_object_t *obj) +ucl_hash_insert_object (ucl_hash_t *hashlin, + const ucl_object_t *obj, + bool ignore_case) { if (hashlin == NULL) { - hashlin = ucl_hash_create (); + hashlin = ucl_hash_create (ignore_case); } ucl_hash_insert (hashlin, obj, obj->key, obj->keylen); Modified: head/contrib/libucl/src/ucl_parser.c ============================================================================== --- head/contrib/libucl/src/ucl_parser.c Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_parser.c Mon Mar 2 21:41:09 2015 (r279549) @@ -570,7 +570,7 @@ ucl_add_parser_stack (ucl_object_t *obj, else { obj->type = UCL_OBJECT; } - obj->value.ov = ucl_hash_create (); + obj->value.ov = ucl_hash_create (parser->flags & UCL_PARSER_KEY_LOWERCASE); parser->state = UCL_STATE_KEY; } else { @@ -975,7 +975,7 @@ ucl_parser_append_elt (struct ucl_parser else { if ((top->flags & UCL_OBJECT_MULTIVALUE) != 0) { /* Just add to the explicit array */ - DL_APPEND (top->value.av, elt); + ucl_array_append (top, elt); } else { /* Convert to an array */ @@ -984,8 +984,8 @@ ucl_parser_append_elt (struct ucl_parser nobj->key = top->key; nobj->keylen = top->keylen; nobj->flags |= UCL_OBJECT_MULTIVALUE; - DL_APPEND (nobj->value.av, top); - DL_APPEND (nobj->value.av, elt); + ucl_array_append (nobj, top); + ucl_array_append (nobj, elt); ucl_hash_insert (cont, nobj, nobj->key, nobj->keylen); } } @@ -1016,6 +1016,7 @@ ucl_parse_key (struct ucl_parser *parser ucl_chunk_skipc (chunk, p); parser->prev_state = parser->state; parser->state = UCL_STATE_MACRO_NAME; + *end_of_object = false; return true; } while (p < chunk->end) { @@ -1195,7 +1196,8 @@ ucl_parse_key (struct ucl_parser *parser nobj->keylen = keylen; tobj = __DECONST (ucl_object_t *, ucl_hash_search_obj (container, nobj)); if (tobj == NULL) { - container = ucl_hash_insert_object (container, nobj); + container = ucl_hash_insert_object (container, nobj, + parser->flags & UCL_PARSER_KEY_LOWERCASE); nobj->prev = nobj; nobj->next = NULL; parser->stack->obj->len ++; @@ -1363,14 +1365,16 @@ ucl_get_value_object (struct ucl_parser { ucl_object_t *t, *obj = NULL; + if (parser == NULL || parser->stack == NULL || parser->stack->obj == NULL) { + return NULL; + } + if (parser->stack->obj->type == UCL_ARRAY) { /* Object must be allocated */ obj = ucl_object_new_full (UCL_NULL, parser->chunks->priority); - t = parser->stack->obj->value.av; - DL_APPEND (t, obj); + t = parser->stack->obj; + ucl_array_append (t, obj); parser->cur_obj = obj; - parser->stack->obj->value.av = t; - parser->stack->obj->len ++; } else { /* Object has been already allocated */ Modified: head/contrib/libucl/src/ucl_schema.c ============================================================================== --- head/contrib/libucl/src/ucl_schema.c Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_schema.c Mon Mar 2 21:41:09 2015 (r279549) @@ -525,15 +525,16 @@ ucl_schema_validate_array (const ucl_obj ucl_object_iter_t iter = NULL, piter = NULL; bool ret = true, allow_additional = true, need_unique = false; int64_t minmax; + unsigned int idx = 0; while (ret && (elt = ucl_iterate_object (schema, &iter, true)) != NULL) { if (strcmp (ucl_object_key (elt), "items") == 0) { if (elt->type == UCL_ARRAY) { - found = obj->value.av; + found = ucl_array_head (obj); while (ret && (it = ucl_iterate_object (elt, &piter, true)) != NULL) { if (found) { ret = ucl_schema_validate (it, found, false, err, root); - found = found->next; + found = ucl_array_find_index (obj, ++idx); } } if (found != NULL) { @@ -608,14 +609,14 @@ ucl_schema_validate_array (const ucl_obj ret = false; } else if (additional_schema != NULL) { - elt = first_unvalidated; + elt = ucl_array_find_index (obj, idx); while (elt) { if (!ucl_schema_validate (additional_schema, elt, false, err, root)) { ret = false; break; } - elt = elt->next; + elt = ucl_array_find_index (obj, idx ++); } } } @@ -741,7 +742,7 @@ ucl_schema_resolve_ref_component (const "reference %s is invalid, invalid item number", refc); return NULL; } - res = cur->value.av; + res = ucl_array_head (cur); i = 0; while (res != NULL) { if (i == num) { Modified: head/contrib/libucl/src/ucl_util.c ============================================================================== --- head/contrib/libucl/src/ucl_util.c Mon Mar 2 21:37:55 2015 (r279548) +++ head/contrib/libucl/src/ucl_util.c Mon Mar 2 21:41:09 2015 (r279549) @@ -24,13 +24,21 @@ #include "ucl.h" #include "ucl_internal.h" #include "ucl_chartable.h" +#include "kvec.h" +#ifndef _WIN32 #include +#endif #ifdef HAVE_LIBGEN_H #include /* For dirname */ #endif +typedef kvec_t(ucl_object_t *) ucl_array_t; + +#define UCL_ARRAY_GET(ar, obj) ucl_array_t *ar = \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 21:44:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7372B6EE; Mon, 2 Mar 2015 21:44:24 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47D43C40; Mon, 2 Mar 2015 21:44:24 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 42773B915; Mon, 2 Mar 2015 16:44:23 -0500 (EST) From: John Baldwin To: Davide Italiano Subject: Re: svn commit: r279539 - head/sys/sys Date: Mon, 02 Mar 2015 16:43:13 -0500 Message-ID: <6289045.RUKNCQ1AEg@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: References: <201503022005.t22K5HTL062907@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 02 Mar 2015 16:44:23 -0500 (EST) Cc: John-Mark Gurney , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 21:44:24 -0000 On Monday, March 02, 2015 12:26:46 PM Davide Italiano wrote: > On Mon, Mar 2, 2015 at 12:05 PM, John-Mark Gurney wrote: > > Author: jmg > > Date: Mon Mar 2 20:05:16 2015 > > New Revision: 279539 > > URL: https://svnweb.freebsd.org/changeset/base/279539 > > > > Log: > > give others fair warning that _SPARE2 isn't just cxgb, but used by large > > number of other subsystems, so you probably don't want _SPARE2.. > > > > ktr needs an overhaul to really only compile in the ones you want, > > we've long passed the 31 bits it provides.. > > If you really want to do the overhaul (which would be honestly great), > I might consider revamping my work for per-cpu KTR buffer and include > that in the change. Originally it was just an exercise, but then it > evolved and I've been sitting with it in my local tree for a while. I > never had the chutzpah to upstream it because it involves fundamental > changes and breaks compatibility with the old ktrdump(1) format. > A rather outdated (and maybe not completely functional) version of the > patch can be found here: > http://people.freebsd.org/~davide/locking/ktr_percpu.4.diff , which > should give you an high level view of the change. > I can update it to the last version and bring up for review, if > somebody think it might be a sane idea avoiding synchronization on a > single buffer for KTR. The only issue with that is that often when I use KTR I want to see the "true" order of operations between CPUs. I realize it is a tradeoff between the extra synchrony in KTR "fixing" some races while you are debugging vs having misleading traces that don't let you line up events to know what occurred when. For replacing the mask field, I've kicked around in my head a replacement for ktr_mask that would use per-type integers, so you would have debug.ktr.proc tunables and sysctls. There are some downsides to this though. In the past I've used hacks where I would clear ktr_mask when certain events happen so that I could reliably get a trace of events leading up to a specific event that wasn't itself a crash. Having N different integers is not conducive to that, though could perhaps have a global "ktr_enabled" to give that. What I was stuck on before was getting the cpp macro glue nice so that one could ideally use the existing CTRx() macros without having to redo all of them. Was thinking of having something like 'KTR_DECLARE(KTR_PROC)' and 'KTR_DEFINE(KTR_PROC, "some description")', etc. You might end up with ktr_type_## type variables and CTRx() would check those. However, that doesn't support KTR_COMPILE at all (and I hadn't worked out a way to do that cleanly, though we could also just punt and always compile in all traces). It also doesn't easily support CTRx(KTR_FOO | KTR_BAR, ...) which does occur a few places in the tree, though we could possibly just replace those with duplicates. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 22:12:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5F46FE4; Mon, 2 Mar 2015 22:12:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 912F4F66; Mon, 2 Mar 2015 22:12:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22MCvES036494; Mon, 2 Mar 2015 22:12:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22MCvp0036492; Mon, 2 Mar 2015 22:12:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503022212.t22MCvp0036492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Mar 2015 22:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279551 - in head/sys: arm/conf modules/dtb/imx6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 22:12:57 -0000 Author: ian Date: Mon Mar 2 22:12:56 2015 New Revision: 279551 URL: https://svnweb.freebsd.org/changeset/base/279551 Log: Add a "module" to build the dtb files for all supported imx6 systems. Added: head/sys/modules/dtb/imx6/ head/sys/modules/dtb/imx6/Makefile (contents, props changed) Modified: head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Mon Mar 2 22:03:13 2015 (r279550) +++ head/sys/arm/conf/IMX6 Mon Mar 2 22:12:56 2015 (r279551) @@ -153,6 +153,7 @@ device u3g # USB modems # Flattened Device Tree options FDT # Configure using FDT/DTB data +makeoptions MODULES_EXTRA=dtb/imx6 # SoC-specific devices device ffec # Freescale Fast Ethernet Controller Added: head/sys/modules/dtb/imx6/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtb/imx6/Makefile Mon Mar 2 22:12:56 2015 (r279551) @@ -0,0 +1,12 @@ +# $FreeBSD$ +# All the dts files for imx6 systems we support. +DTS= \ + imx6dl-cubox-i.dts \ + imx6q-cubox-i.dts \ + imx6dl-hummingboard.dts \ + imx6q-hummingboard.dts \ + imx6q-wandboard.dts \ + imx6dl-wandboard.dts \ + imx6s-wandboard.dts + +.include From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 22:13:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 837F31AA; Mon, 2 Mar 2015 22:13:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EFCAF6E; Mon, 2 Mar 2015 22:13:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22MDYYq036627; Mon, 2 Mar 2015 22:13:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22MDYSu036626; Mon, 2 Mar 2015 22:13:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503022213.t22MDYSu036626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 2 Mar 2015 22:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279552 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 22:13:34 -0000 Author: bapt Date: Mon Mar 2 22:13:33 2015 New Revision: 279552 URL: https://svnweb.freebsd.org/changeset/base/279552 Log: Remove gperf(7) if gperf is not installed Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 2 22:12:56 2015 (r279551) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 2 22:13:33 2015 (r279552) @@ -958,6 +958,7 @@ OLD_FILES+=usr/libexec/cc1plus OLD_FILES+=usr/bin/gperf OLD_FILES+=usr/share/info/gperf.info.gz OLD_FILES+=usr/share/man/man1/gperf.1.gz +OLD_FILES+=usr/share/man/man1/gperf.7.gz .endif .endif From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 22:28:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ABE74BA; Mon, 2 Mar 2015 22:28:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15CED123; Mon, 2 Mar 2015 22:28:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22MSm3j042036; Mon, 2 Mar 2015 22:28:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22MSmJZ042031; Mon, 2 Mar 2015 22:28:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503022228.t22MSmJZ042031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 2 Mar 2015 22:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279553 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 22:28:49 -0000 Author: loos Date: Mon Mar 2 22:28:47 2015 New Revision: 279553 URL: https://svnweb.freebsd.org/changeset/base/279553 Log: Move duplicate code to a new public function. This new function can be used by other drivers to reserve the use of GPIO pins. Anyway, the use of ofw_gpiobus_parse_gpios() is preferred when possible. Requested by: Michal Meloun Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Mon Mar 2 22:13:33 2015 (r279552) +++ head/sys/dev/gpio/gpiobus.c Mon Mar 2 22:28:47 2015 (r279553) @@ -228,6 +228,29 @@ gpiobus_free_ivars(struct gpiobus_ivar * } } +int +gpiobus_map_pin(device_t bus, device_t child, uint32_t pin) +{ + struct gpiobus_softc *sc; + + sc = device_get_softc(bus); + /* Consistency check. */ + if (pin >= sc->sc_npins) { + device_printf(child, + "invalid pin %d, max: %d\n", pin, sc->sc_npins - 1); + return (-1); + } + /* Mark pin as mapped and give warning if it's already mapped. */ + if (sc->sc_pins_mapped[pin]) { + device_printf(child, + "warning: pin %d is already mapped\n", pin); + return (-1); + } + sc->sc_pins_mapped[pin] = 1; + + return (0); +} + static int gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) { @@ -252,24 +275,12 @@ gpiobus_parse_pins(struct gpiobus_softc for (i = 0; i < 32; i++) { if ((mask & (1 << i)) == 0) continue; - if (i >= sc->sc_npins) { - device_printf(child, - "invalid pin %d, max: %d\n", i, sc->sc_npins - 1); + /* Reserve the GPIO pin. */ + if (gpiobus_map_pin(sc->sc_busdev, child, i) != 0) { gpiobus_free_ivars(devi); return (EINVAL); } - devi->pins[npins++] = i; - /* - * Mark pin as mapped and give warning if it's already mapped - */ - if (sc->sc_pins_mapped[i]) { - device_printf(child, - "warning: pin %d is already mapped\n", i); - gpiobus_free_ivars(devi); - return (EINVAL); - } - sc->sc_pins_mapped[i] = 1; } return (0); Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Mon Mar 2 22:13:33 2015 (r279552) +++ head/sys/dev/gpio/gpiobusvar.h Mon Mar 2 22:28:47 2015 (r279553) @@ -110,6 +110,7 @@ int gpiobus_detach_bus(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); +int gpiobus_map_pin(device_t, device_t, uint32_t); extern driver_t gpiobus_driver; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Mon Mar 2 22:13:33 2015 (r279552) +++ head/sys/dev/gpio/ofw_gpiobus.c Mon Mar 2 22:28:47 2015 (r279553) @@ -272,22 +272,10 @@ ofw_gpiobus_parse_gpios_impl(device_t co "cannot map the gpios specifier.\n"); goto fail; } - /* Consistency check. */ - if ((*pins)[j].pin >= bussc->sc_npins) { - device_printf(consumer, "invalid pin %d, max: %d\n", - (*pins)[j].pin, bussc->sc_npins - 1); + /* Reserve the GPIO pin. */ + if (gpiobus_map_pin(bussc->sc_busdev, consumer, + (*pins)[j].pin) != 0) goto fail; - } - /* - * Mark pin as mapped and give warning if it's already mapped. - */ - if (bussc->sc_pins_mapped[(*pins)[j].pin]) { - device_printf(consumer, - "warning: pin %d is already mapped\n", - pins[j]->pin); - goto fail; - } - bussc->sc_pins_mapped[(*pins)[j].pin] = 1; j++; i += gpiocells + 1; } From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 22:48:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DA097AD; Mon, 2 Mar 2015 22:48:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F0C3310; Mon, 2 Mar 2015 22:48:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22MmClX051579; Mon, 2 Mar 2015 22:48:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22MmC1N051577; Mon, 2 Mar 2015 22:48:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503022248.t22MmC1N051577@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Mar 2015 22:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279554 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 22:48:13 -0000 Author: trasz Date: Mon Mar 2 22:48:11 2015 New Revision: 279554 URL: https://svnweb.freebsd.org/changeset/base/279554 Log: Make periphdriver_register() take XPT lock when modifying the periph_drivers array. This fixes a panic that sometimes occured when kldloading ctl.ko. Reviewed by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Mon Mar 2 22:28:47 2015 (r279553) +++ head/sys/cam/cam_periph.c Mon Mar 2 22:48:11 2015 (r279554) @@ -108,9 +108,19 @@ periphdriver_register(void *data) struct periph_driver **newdrivers, **old; int ndrivers; +again: ndrivers = nperiph_drivers + 2; newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_CAMPERIPH, M_WAITOK); + xpt_lock_buses(); + if (ndrivers != nperiph_drivers + 2) { + /* + * Lost race against itself; go around. + */ + xpt_unlock_buses(); + free(newdrivers, M_CAMPERIPH); + goto again; + } if (periph_drivers) bcopy(periph_drivers, newdrivers, sizeof(*newdrivers) * nperiph_drivers); @@ -118,9 +128,10 @@ periphdriver_register(void *data) newdrivers[nperiph_drivers + 1] = NULL; old = periph_drivers; periph_drivers = newdrivers; + nperiph_drivers++; + xpt_unlock_buses(); if (old) free(old, M_CAMPERIPH); - nperiph_drivers++; /* If driver marked as early or it is late now, initialize it. */ if (((drv->flags & CAM_PERIPH_DRV_EARLY) != 0 && initialized > 0) || initialized > 1) Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Mar 2 22:28:47 2015 (r279553) +++ head/sys/cam/cam_xpt.c Mon Mar 2 22:48:11 2015 (r279554) @@ -151,6 +151,8 @@ typedef int xpt_pdrvfunc_t (struct perip /* Transport layer configuration information */ static struct xpt_softc xsoftc; +MTX_SYSINIT(xpt_topo_init, &xsoftc.xpt_topo_lock, "XPT topology lock", MTX_DEF); + SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); SYSCTL_UINT(_kern_cam, OID_AUTO, xpt_generation, CTLFLAG_RD, @@ -850,7 +852,6 @@ xpt_init(void *dummy) mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_highpower_lock, "XPT highpower lock", NULL, MTX_DEF); - mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF); xsoftc.xpt_taskq = taskqueue_create("CAM XPT task", M_WAITOK, taskqueue_thread_enqueue, /*context*/&xsoftc.xpt_taskq); From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 23:17:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98DC03A6; Mon, 2 Mar 2015 23:17:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83198845; Mon, 2 Mar 2015 23:17:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t22NHIXc067962; Mon, 2 Mar 2015 23:17:18 GMT (envelope-from thomas@FreeBSD.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t22NHIOB067961; Mon, 2 Mar 2015 23:17:18 GMT (envelope-from thomas@FreeBSD.org) Message-Id: <201503022317.t22NHIOB067961@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: thomas set sender to thomas@FreeBSD.org using -f From: Thomas Quinot Date: Mon, 2 Mar 2015 23:17:18 +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: r279556 - stable/10/usr.sbin/freebsd-update X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 23:17:18 -0000 Author: thomas Date: Mon Mar 2 23:17:17 2015 New Revision: 279556 URL: https://svnweb.freebsd.org/changeset/base/279556 Log: MFC rev. 278728: (backup_kernel_finddir, backup_kernel, install_files): Add missing references to $BASEDIR, in order to allow correct operation when updating a system mounted at another location than / (e.g. when updating an alternate Boot Environment). Reviewed by: cperciva Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/10/usr.sbin/freebsd-update/freebsd-update.sh Mon Mar 2 23:03:53 2015 (r279555) +++ stable/10/usr.sbin/freebsd-update/freebsd-update.sh Mon Mar 2 23:17:17 2015 (r279556) @@ -2626,14 +2626,14 @@ backup_kernel_finddir () { while true ; do # Pathname does not exist, so it is OK use that name # for backup directory. - if [ ! -e $BACKUPKERNELDIR ]; then + if [ ! -e $BASEDIR/$BACKUPKERNELDIR ]; then return 0 fi # If directory do exist, we only use if it has our # marker file. - if [ -d $BACKUPKERNELDIR -a \ - -e $BACKUPKERNELDIR/.freebsd-update ]; then + if [ -d $BASEDIR/$BACKUPKERNELDIR -a \ + -e $BASEDIR/$BACKUPKERNELDIR/.freebsd-update ]; then return 0 fi @@ -2641,7 +2641,7 @@ backup_kernel_finddir () { # the end and try again. CNT=$((CNT + 1)) if [ $CNT -gt 9 ]; then - echo "Could not find valid backup dir ($BACKUPKERNELDIR)" + echo "Could not find valid backup dir ($BASEDIR/$BACKUPKERNELDIR)" exit 1 fi BACKUPKERNELDIR="`echo $BACKUPKERNELDIR | sed -Ee 's/[0-9]\$//'`" @@ -2668,17 +2668,17 @@ backup_kernel () { # Remove old kernel backup files. If $BACKUPKERNELDIR was # "not ours", backup_kernel_finddir would have exited, so # deleting the directory content is as safe as we can make it. - if [ -d $BACKUPKERNELDIR ]; then - rm -fr $BACKUPKERNELDIR + if [ -d $BASEDIR/$BACKUPKERNELDIR ]; then + rm -fr $BASEDIR/$BACKUPKERNELDIR fi # Create directories for backup. - mkdir -p $BACKUPKERNELDIR - mtree -cdn -p "${KERNELDIR}" | \ - mtree -Ue -p "${BACKUPKERNELDIR}" > /dev/null + mkdir -p $BASEDIR/$BACKUPKERNELDIR + mtree -cdn -p "${BASEDIR}/${KERNELDIR}" | \ + mtree -Ue -p "${BASEDIR}/${BACKUPKERNELDIR}" > /dev/null # Mark the directory as having been created by freebsd-update. - touch $BACKUPKERNELDIR/.freebsd-update + touch $BASEDIR/$BACKUPKERNELDIR/.freebsd-update if [ $? -ne 0 ]; then echo "Could not create kernel backup directory" exit 1 @@ -2696,8 +2696,8 @@ backup_kernel () { fi # Backup all the kernel files using hardlinks. - (cd $KERNELDIR && find . -type f $FINDFILTER -exec \ - cp -pl '{}' ${BACKUPKERNELDIR}/'{}' \;) + (cd ${BASEDIR}/${KERNELDIR} && find . -type f $FINDFILTER -exec \ + cp -pl '{}' ${BASEDIR}/${BACKUPKERNELDIR}/'{}' \;) # Re-enable patchname expansion. set +f @@ -2795,7 +2795,7 @@ install_files () { # Update linker.hints if necessary if [ -s INDEX-OLD -o -s INDEX-NEW ]; then - kldxref -R /boot/ 2>/dev/null + kldxref -R ${BASEDIR}/boot/ 2>/dev/null fi # We've finished updating the kernel. @@ -2846,14 +2846,14 @@ Kernel updates have been installed. Ple install_delete INDEX-OLD INDEX-NEW || return 1 # Rebuild /etc/spwd.db and /etc/pwd.db if necessary. - if [ /etc/master.passwd -nt /etc/spwd.db ] || - [ /etc/master.passwd -nt /etc/pwd.db ]; then - pwd_mkdb /etc/master.passwd + if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] || + [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ]; then + pwd_mkdb -d ${BASEDIR}/etc ${BASEDIR}/etc/master.passwd fi # Rebuild /etc/login.conf.db if necessary. - if [ /etc/login.conf -nt /etc/login.conf.db ]; then - cap_mkdb /etc/login.conf + if [ ${BASEDIR}/etc/login.conf -nt ${BASEDIR}/etc/login.conf.db ]; then + cap_mkdb ${BASEDIR}/etc/login.conf fi # We've finished installing the world and deleting old files From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 00:55:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7ECDFBE2; Tue, 3 Mar 2015 00:55:39 +0000 (UTC) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22CBA31A; Tue, 3 Mar 2015 00:55:39 +0000 (UTC) Received: by wevm14 with SMTP id m14so36733510wev.13; Mon, 02 Mar 2015 16:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eVfG1bomC++IAiBBgS39sgQhg3iFXL6vkz9CUFE06uo=; b=Bzn10kAA6mW2sg3VurXboFvLoroPEZdt/zK4fvUaD+6AziBrWOgBlje1ZT+xE8wFrR uGXSXjcnKVXfX5+Ca4HJqzhUiKyRpoT116699r17UAofKV2lZ1E1btpbLpnFelPSu+E3 GTHerY05TycM9M8YMcXCJ4x+ayBc7DdZyILNbxznUqwYbvM2nP74/dlSf/fWyi3rlVLF gAla5SJRt0zmYDf/uTzMr503jV6A0ogOX91D+OR00T5EX/7q7p1O6g999lAtvTGn6Xlk ehkdNT019zR2P3CnrJ+UhDo2lWa7MLDuIxpd+T5DG5rOv4IYr45u0vTpUNPOcs7mH9UZ MYRA== MIME-Version: 1.0 X-Received: by 10.194.94.1 with SMTP id cy1mr62327157wjb.127.1425344137633; Mon, 02 Mar 2015 16:55:37 -0800 (PST) Received: by 10.27.91.79 with HTTP; Mon, 2 Mar 2015 16:55:37 -0800 (PST) In-Reply-To: References: <201503022005.t22K5HTL062907@svn.freebsd.org> Date: Mon, 2 Mar 2015 16:55:37 -0800 Message-ID: Subject: Re: svn commit: r279539 - head/sys/sys From: Neel Natu To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: John-Mark Gurney , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 00:55:39 -0000 Hi Davide, On Mon, Mar 2, 2015 at 12:26 PM, Davide Italiano wrote: > On Mon, Mar 2, 2015 at 12:05 PM, John-Mark Gurney wrote: >> Author: jmg >> Date: Mon Mar 2 20:05:16 2015 >> New Revision: 279539 >> URL: https://svnweb.freebsd.org/changeset/base/279539 >> >> Log: >> give others fair warning that _SPARE2 isn't just cxgb, but used by large >> number of other subsystems, so you probably don't want _SPARE2.. >> >> ktr needs an overhaul to really only compile in the ones you want, >> we've long passed the 31 bits it provides.. >> > > If you really want to do the overhaul (which would be honestly great), > I might consider revamping my work for per-cpu KTR buffer and include > that in the change. Originally it was just an exercise, but then it > evolved and I've been sitting with it in my local tree for a while. I > never had the chutzpah to upstream it because it involves fundamental > changes and breaks compatibility with the old ktrdump(1) format. > A rather outdated (and maybe not completely functional) version of the > patch can be found here: > http://people.freebsd.org/~davide/locking/ktr_percpu.4.diff , which > should give you an high level view of the change. > I can update it to the last version and bring up for review, if > somebody think it might be a sane idea avoiding synchronization on a > single buffer for KTR. > This would be a very welcome improvement. best Neel > -- > Davide > From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 02:08:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF000B01; Tue, 3 Mar 2015 02:08:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9A7CC25; Tue, 3 Mar 2015 02:08:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2328IBE058419; Tue, 3 Mar 2015 02:08:18 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2328I0k058418; Tue, 3 Mar 2015 02:08:18 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201503030208.t2328I0k058418@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 3 Mar 2015 02:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279557 - head/sys/dev/flash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 02:08:18 -0000 Author: kevlo Date: Tue Mar 3 02:08:17 2015 New Revision: 279557 URL: https://svnweb.freebsd.org/changeset/base/279557 Log: Check the return value of config_intrhook_establish(). Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Mon Mar 2 23:17:17 2015 (r279556) +++ head/sys/dev/flash/at45d.c Tue Mar 3 02:08:17 2015 (r279557) @@ -197,8 +197,10 @@ at45d_attach(device_t dev) /* We'll see what kind of flash we have later... */ sc->config_intrhook.ich_func = at45d_delayed_attach; sc->config_intrhook.ich_arg = sc; - if (config_intrhook_establish(&sc->config_intrhook) != 0) + if (config_intrhook_establish(&sc->config_intrhook) != 0) { device_printf(dev, "config_intrhook_establish failed\n"); + return (ENOMEM); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 02:47:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD8D6FE3; Tue, 3 Mar 2015 02:47:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7BD0F62; Tue, 3 Mar 2015 02:47:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t232l0Lo076651; Tue, 3 Mar 2015 02:47:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t232kxsE076640; Tue, 3 Mar 2015 02:46:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503030246.t232kxsE076640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 3 Mar 2015 02:46:59 +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: r279558 - in stable/10/release: . tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 02:47:01 -0000 Author: gjb Date: Tue Mar 3 02:46:59 2015 New Revision: 279558 URL: https://svnweb.freebsd.org/changeset/base/279558 Log: MFC r279249, r279250, r279257: r279249: Add 'cloudware-install' target to handle copying cloud disk images to a directory within DESTDIR. Add CLOUDINSTALL variable to automatically generate the actual list of install targets. While here, rename the cloud-specific names from 'vm-' to 'cw-' to avoid naming collisions. Add AZURE_DISK, GCE_DISK, and OPENSTACK_DISK output file variables. Add 'cloudware-install' to the 'install' target. r279250: Remove a stale comment. r279257: Add a CLOUDPACKAGE variable to contain a list of targets for post-install packaging cloud provider images. Add a 'gce-package.sh' script to generate the final output image ready for upload to the GCE platform. Right now, this is the only image that has a specific output format (GNU-tar), and this implementation is expected to be temporary. This is not directly connected to the other release targets. Sponsored by: The FreeBSD Foundation Added: stable/10/release/tools/gce-package.sh - copied unchanged from r279257, head/release/tools/gce-package.sh Modified: stable/10/release/Makefile stable/10/release/Makefile.vm Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Tue Mar 3 02:08:17 2015 (r279557) +++ stable/10/release/Makefile Tue Mar 3 02:46:59 2015 (r279558) @@ -319,7 +319,7 @@ real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} -install: release-install vm-install +install: release-install vm-install cloudware-install release-install: .if defined(DESTDIR) && !empty(DESTDIR) Modified: stable/10/release/Makefile.vm ============================================================================== --- stable/10/release/Makefile.vm Tue Mar 3 02:08:17 2015 (r279557) +++ stable/10/release/Makefile.vm Tue Mar 3 02:46:59 2015 (r279558) @@ -20,24 +20,30 @@ CLOUDWARE?= AZURE \ OPENSTACK AZURE_FORMAT= vhdf AZURE_DESC= Microsoft Azure platform image +AZURE_DISK= ${OSRELEASE}.${AZURE_FORMAT} GCE_FORMAT= raw GCE_DESC= Google Compute Engine image +GCE_DISK= disk.${GCE_FORMAT} OPENSTACK_FORMAT=qcow2 OPENSTACK_DESC= OpenStack platform image +OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT} .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) . for _CW in ${CLOUDWARE} -CLOUDTARGETS+= vm-${_CW:tl} -CLEANDIRS+= vm-${_CW:tl} +CLOUDTARGETS+= cw-${_CW:tl} +CLEANDIRS+= cw-${_CW:tl} CLEANFILES+= ${_CW:tl}.img \ ${_CW:tl}.${${_CW:tu}_FORMAT} \ - ${_CW:tl}.${${_CW:tu}_FORMAT}.raw + ${_CW:tl}.${${_CW:tu}_FORMAT}.raw \ + cw${_CW:tl}-package +CLOUDINSTALL+= cw${_CW:tl}-install +CLOUDPACKAGE+= cw${_CW:tl}-package ${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT} . if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF) ${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf . endif -vm-${_CW:tl}: +cw-${_CW:tl}: mkdir -p ${.OBJDIR}/${.TARGET} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ ${.CURDIR}/scripts/mk-vmimage.sh \ @@ -45,6 +51,26 @@ vm-${_CW:tl}: -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \ -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF} touch ${.TARGET} + +cw${_CW:tl}-install: + mkdir -p ${DESTDIR}/${_CW:tl} + cp -p ${${_CW}IMAGE} \ + ${DESTDIR}/${_CW:tl}/${${_CW}_DISK} + cd ${DESTDIR}/${_CW:tl} && sha256 ${${_CW}_DISK}* > \ + ${DESTDIR}/${_CW:tl}/CHECKSUM.SHA256 + cd ${DESTDIR}/${_CW:tl} && md5 ${${_CW}_DISK}* > \ + ${DESTDIR}/${_CW:tl}/CHECKSUM.MD5 + +cw${_CW:tl}-package: + @# Special target to handle packaging cloud images in the formats + @# specific to each hosting provider. +.if exists(${.CURDIR}/tools/${_CW:tl}-package.sh) + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + ${.CURDIR}/tools/${_CW:tl}-package.sh \ + -D ${DESTDIR} -I ${${_CW}_DISK} -S ${WORLDDIR} +.endif + touch ${.TARGET} + . endfor .endif @@ -97,8 +123,6 @@ vm-install: ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} . endfor . if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) -# This is very time consuming, so defer it after the images are moved to -# the DESTDIR. . for FORMAT in ${VMFORMATS} # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} @@ -119,3 +143,8 @@ cloudware-release: .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} .endif + +cloudware-install: +.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL} +.endif Copied: stable/10/release/tools/gce-package.sh (from r279257, head/release/tools/gce-package.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/tools/gce-package.sh Tue Mar 3 02:46:59 2015 (r279558, copy of r279257, head/release/tools/gce-package.sh) @@ -0,0 +1,47 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Script to handle packaging cloud images for GCE. +# +# XXX: +# This script only exists to help in automating image creation, +# and reimplementing this is intended (in other words, this is +# temporary). + +usage() { + echo "Usage:" + echo "$(basename ${0}) -D -I -S " + exit 1 +} + +main() { + while getopts "D:I:W:" opt; do + case ${opt} in + D) + DESTDIR="${OPTARG}" + ;; + I) + INFILE="${OPTARG}" + ;; + S) + WORLDDIR="${OPTARG}" + ;; + *) + usage + ;; + esac + done + shift $(( ${OPTIND} - 1 )) + + if [ -z "${DESTDIR}" -o -z "${INFILE}" -o -z "${WORLDDIR}" ]; then + usage + fi + + OUTFILE="$(make -C ${WORLDDIR}/release -V OSRELEASE).tar.gz" + + cd ${DESTDIR} && tar --format=gnutar -zcf ${OUTFILE} ${INFILE} +} + +main "$@" From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 04:28:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52B19979; Tue, 3 Mar 2015 04:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E1A119D9; Tue, 3 Mar 2015 04:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t234SKMo026033; Tue, 3 Mar 2015 04:28:20 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t234SKbi026032; Tue, 3 Mar 2015 04:28:20 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201503030428.t234SKbi026032@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Tue, 3 Mar 2015 04:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279559 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 04:28:20 -0000 Author: hrs Date: Tue Mar 3 04:28:19 2015 New Revision: 279559 URL: https://svnweb.freebsd.org/changeset/base/279559 Log: Nonce has to be non-NULL for DAD even if net.inet6.ip6.dad_enhanced=0. Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Tue Mar 3 02:46:59 2015 (r279558) +++ head/sys/netinet6/nd6_nbr.c Tue Mar 3 04:28:19 2015 (r279559) @@ -1528,7 +1528,6 @@ nd6_dad_ns_output(struct dadq *dp, struc { struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct ifnet *ifp = ifa->ifa_ifp; - uint8_t *nonce; int i; dp->dad_ns_tcount++; @@ -1543,7 +1542,6 @@ nd6_dad_ns_output(struct dadq *dp, struc if (V_dad_enhanced != 0) { for (i = 0; i < ND_OPT_NONCE_LEN32; i++) dp->dad_nonce[i] = arc4random(); - nonce = (uint8_t *)&dp->dad_nonce[0]; /* * XXXHRS: Note that in the case that * DupAddrDetectTransmits > 1, multiple NS messages with @@ -1552,9 +1550,9 @@ nd6_dad_ns_output(struct dadq *dp, struc * the latest nonce on the sender side. Practically it * should work well in almost all cases. */ - } else - nonce = NULL; - nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, nonce); + } + nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, + (uint8_t *)&dp->dad_nonce[0]); } static void From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 05:44:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15DF068E; Tue, 3 Mar 2015 05:44:59 +0000 (UTC) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5314126; Tue, 3 Mar 2015 05:44:58 +0000 (UTC) Received: by padbj1 with SMTP id bj1so24563650pad.11; Mon, 02 Mar 2015 21:44:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=ZM5aREVqs6JKOfmbgeBDvZcrEpC16QB2g8BztNXxdAY=; b=y/tMbglN+jLDUwntyOtSHuha+j+3HWT1zCHrfq0QIGvylkuutrvaQnmEKSD7+mb0gg nqWeqiLZdSQUUO2xhXvmwvqi5nzaljcQZYXUZ7KifG1+ydLZVcPRlE3szk8z+5EKINE6 B+RPhuWanskCg2FURggXLdFMXFWtBLCh+eQjnA6MUu9EKVnG8BHhG6epXWC4HlWkbsbg /NxJ0A/SiACYGiR25sai58o2t8kNjuNF1hwAQiKvmSN4xorCXsvS2VntYr0idRnet/je YaQhSq2vVEVQJUtG5R9G69n3ePfwtmKGqC1X9sjfRMd1+xQLqqDrZRuUixAnZiEIZBh4 jePw== X-Received: by 10.66.118.198 with SMTP id ko6mr53422210pab.16.1425361498182; Mon, 02 Mar 2015 21:44:58 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:2426:9dcb:5097:e221? ([2601:8:ab80:7d6:2426:9dcb:5097:e221]) by mx.google.com with ESMTPSA id f3sm13629608pdn.89.2015.03.02.21.44.56 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Mar 2015 21:44:57 -0800 (PST) References: <201502271628.t1RGSurE067472@svn.freebsd.org> <54F42726.3000602@freebsd.org> <1425327800.1287.7.camel@freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <1425327800.1287.7.camel@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <33AC77F5-8D04-475C-B14A-D7B94733E8AC@gmail.com> X-Mailer: iPhone Mail (12B466) From: Garrett Cooper Subject: Re: svn commit: r279361 - in head: sys/kern sys/sys usr.sbin/jail Date: Mon, 2 Mar 2015 21:44:55 -0800 To: Ian Lepore Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 05:44:59 -0000 > On Mar 2, 2015, at 12:23, Ian Lepore wrote: >=20 >> On Mon, 2015-03-02 at 01:02 -0800, Julian Elischer wrote: >>> On 2/27/15 8:28 AM, Ian Lepore wrote: >>>=20 >>>=20 >>> Log: >>> Allow the kern.osrelease and kern.osreldate sysctl values to be set in= a >>> jail's creation parameters. This allows the kernel version to be reli= ably >>> spoofed within the jail whether examined directly with sysctl or >>> indirectly with the uname -r and -K options. >>> [..] >>=20 >>> There is no sanity or range checking, other than disallowing an empty >>> release string or a zero release date, by design. The system >>> administrator is trusted to set sane values. Setting values that are >>> newer than the actual running kernel will likely cause compatibility >>> problems. >> I would think that you could at set time ensure that only older=20 >> releases were allowed.. >> I'm not sure what the rule would be with sub-sub-jails.. older than=20 >> parent, or older than base system..? >=20 > I am a really really strong believer in giving administrators complete > control of their systems. If they want to do "something stupid" because > it works for them, I'm not going to stop them. Printing out a warning helps folks who are debugging issues though :)..= From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 07:51:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4F1D728; Tue, 3 Mar 2015 07:51:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9126FF1A; Tue, 3 Mar 2015 07:51:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t237pbUH023211; Tue, 3 Mar 2015 07:51:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t237pbWD023210; Tue, 3 Mar 2015 07:51:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503030751.t237pbWD023210@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 3 Mar 2015 07:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279560 - head/lib/libucl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 07:51:37 -0000 Author: bapt Date: Tue Mar 3 07:51:36 2015 New Revision: 279560 URL: https://svnweb.freebsd.org/changeset/base/279560 Log: Lower warnings to please gcc 4.2 Modified: head/lib/libucl/Makefile Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Tue Mar 3 04:28:19 2015 (r279559) +++ head/lib/libucl/Makefile Tue Mar 3 07:51:36 2015 (r279560) @@ -18,7 +18,7 @@ SRCS= ucl_emitter_streamline.c \ LIBADD= m -WARNS= 2 +WARNS= 1 CFLAGS+= -I${LIBUCL}/include \ -I${LIBUCL}/src \ -I${LIBUCL}/uthash \ From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 09:20:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D32A2F1E; Tue, 3 Mar 2015 09:20:13 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA03A54; Tue, 3 Mar 2015 09:20:13 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t239KB89010654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 3 Mar 2015 01:20:12 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54F57CC6.9050109@freebsd.org> Date: Tue, 03 Mar 2015 01:20:06 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Neel Natu , Davide Italiano Subject: Re: svn commit: r279539 - head/sys/sys References: <201503022005.t22K5HTL062907@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: John-Mark Gurney , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 09:20:13 -0000 On 3/2/15 4:55 PM, Neel Natu wrote: > Hi Davide, > > On Mon, Mar 2, 2015 at 12:26 PM, Davide Italiano wrote: >> On Mon, Mar 2, 2015 at 12:05 PM, John-Mark Gurney wrote: >>> Author: jmg >>> Date: Mon Mar 2 20:05:16 2015 >>> New Revision: 279539 >>> URL: https://svnweb.freebsd.org/changeset/base/279539 >>> >>> Log: >>> give others fair warning that _SPARE2 isn't just cxgb, but used by large >>> number of other subsystems, so you probably don't want _SPARE2.. >>> >>> ktr needs an overhaul to really only compile in the ones you want, >>> we've long passed the 31 bits it provides.. >>> >> If you really want to do the overhaul (which would be honestly great), >> I might consider revamping my work for per-cpu KTR buffer and include >> that in the change. Originally it was just an exercise, but then it >> evolved and I've been sitting with it in my local tree for a while. I >> never had the chutzpah to upstream it because it involves fundamental >> changes and breaks compatibility with the old ktrdump(1) format. >> A rather outdated (and maybe not completely functional) version of the >> patch can be found here: >> http://people.freebsd.org/~davide/locking/ktr_percpu.4.diff , which >> should give you an high level view of the change. >> I can update it to the last version and bring up for review, if >> somebody think it might be a sane idea avoiding synchronization on a >> single buffer for KTR. I think it would be a problem... one of the truely useful things about ktr is that it does use a single buffer. this means that you get the true interaction between CPUS. Schedgraph relies on this (as one example). > This would be a very welcome improvement. > > best > Neel > >> -- >> Davide >> > > From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 09:48:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6E7E794; Tue, 3 Mar 2015 09:48:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C260ADE4; Tue, 3 Mar 2015 09:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t239mKTO075838; Tue, 3 Mar 2015 09:48:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t239mKvK075837; Tue, 3 Mar 2015 09:48:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503030948.t239mKvK075837@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 3 Mar 2015 09:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279561 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 09:48:20 -0000 Author: andrew Date: Tue Mar 3 09:48:19 2015 New Revision: 279561 URL: https://svnweb.freebsd.org/changeset/base/279561 Log: Fix the pl011 driver to work when the uart will write in zero cycles. This is the case, depending on the options, in some of the ARM hardware simulators. In these cases we don't get an interrupt so will need to schedule the task to write more data to the uart. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Tue Mar 3 07:51:36 2015 (r279560) +++ head/sys/dev/uart/uart_dev_pl011.c Tue Mar 3 09:48:19 2015 (r279561) @@ -452,15 +452,23 @@ uart_pl011_bus_transmit(struct uart_soft __uart_setreg(bas, UART_DR, sc->sc_txbuf[i]); uart_barrier(bas); } - sc->sc_txbusy = 1; - /* Enable TX interrupt */ - reg = __uart_getreg(bas, UART_IMSC); - reg |= (UART_TXEMPTY); - __uart_setreg(bas, UART_IMSC, reg); + /* If not empty wait until it is */ + if ((__uart_getreg(bas, UART_FR) & FR_TXFE) != FR_TXFE) { + sc->sc_txbusy = 1; + + /* Enable TX interrupt */ + reg = __uart_getreg(bas, UART_IMSC); + reg |= (UART_TXEMPTY); + __uart_setreg(bas, UART_IMSC, reg); + } uart_unlock(sc->sc_hwmtx); + /* No interrupt expected, schedule the next fifo write */ + if (!sc->sc_txbusy) + uart_sched_softih(sc, SER_INT_TXIDLE); + return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 10:11:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAB32D0; Tue, 3 Mar 2015 10:11:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA981B5; Tue, 3 Mar 2015 10:11:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23ABxTi089260; Tue, 3 Mar 2015 10:11:59 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23ABxPG089259; Tue, 3 Mar 2015 10:11:59 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201503031011.t23ABxPG089259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 3 Mar 2015 10:11:59 +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: r279562 - stable/10/sys/xen/xenstore X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 10:11:59 -0000 Author: royger Date: Tue Mar 3 10:11:58 2015 New Revision: 279562 URL: https://svnweb.freebsd.org/changeset/base/279562 Log: MFC r278844: xen: fix xenstore dev Modified: stable/10/sys/xen/xenstore/xenstore_dev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/xen/xenstore/xenstore_dev.c ============================================================================== --- stable/10/sys/xen/xenstore/xenstore_dev.c Tue Mar 3 09:48:19 2015 (r279561) +++ stable/10/sys/xen/xenstore/xenstore_dev.c Tue Mar 3 10:11:58 2015 (r279562) @@ -76,7 +76,11 @@ static int xs_dev_read(struct cdev *dev, struct uio *uio, int ioflag) { int error; - struct xs_dev_data *u = dev->si_drv1; + struct xs_dev_data *u; + + error = devfs_get_cdevpriv((void **)&u); + if (error != 0) + return (error); while (u->read_prod == u->read_cons) { error = tsleep(u, PCATCH, "xsdread", hz/10); @@ -114,11 +118,15 @@ static int xs_dev_write(struct cdev *dev, struct uio *uio, int ioflag) { int error; - struct xs_dev_data *u = dev->si_drv1; + struct xs_dev_data *u; struct xs_dev_transaction *trans; void *reply; int len = uio->uio_resid; + error = devfs_get_cdevpriv((void **)&u); + if (error != 0) + return (error); + if ((len + u->len) > sizeof(u->u.buffer)) return (EINVAL); @@ -176,25 +184,10 @@ xs_dev_write(struct cdev *dev, struct ui return (error); } -static int -xs_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - struct xs_dev_data *u; - -#if 0 /* XXX figure out if equiv needed */ - nonseekable_open(inode, filp); -#endif - u = malloc(sizeof(*u), M_XENSTORE, M_WAITOK|M_ZERO); - LIST_INIT(&u->transactions); - dev->si_drv1 = u; - - return (0); -} - -static int -xs_dev_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +static void +xs_dev_dtor(void *arg) { - struct xs_dev_data *u = dev->si_drv1; + struct xs_dev_data *u = arg; struct xs_dev_transaction *trans, *tmp; LIST_FOREACH_SAFE(trans, &u->transactions, list, tmp) { @@ -204,7 +197,21 @@ xs_dev_close(struct cdev *dev, int fflag } free(u, M_XENSTORE); - return (0); +} + +static int +xs_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct xs_dev_data *u; + int error; + + u = malloc(sizeof(*u), M_XENSTORE, M_WAITOK|M_ZERO); + LIST_INIT(&u->transactions); + error = devfs_set_cdevpriv(u, xs_dev_dtor); + if (error != 0) + free(u, M_XENSTORE); + + return (error); } static struct cdevsw xs_dev_cdevsw = { @@ -212,13 +219,13 @@ static struct cdevsw xs_dev_cdevsw = { .d_read = xs_dev_read, .d_write = xs_dev_write, .d_open = xs_dev_open, - .d_close = xs_dev_close, .d_name = "xs_dev", }; void xs_dev_init() { - make_dev(&xs_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, - "xen/xenstore"); + + make_dev_credf(MAKEDEV_ETERNAL, &xs_dev_cdevsw, 0, NULL, + UID_ROOT, GID_WHEEL, 0400, "xen/xenstore"); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 10:21:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46E113DA; Tue, 3 Mar 2015 10:21:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31F4F2DB; Tue, 3 Mar 2015 10:21:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23ALtpI094083; Tue, 3 Mar 2015 10:21:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23ALtIK094082; Tue, 3 Mar 2015 10:21:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503031021.t23ALtIK094082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Mar 2015 10:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279563 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 10:21:55 -0000 Author: hselasky Date: Tue Mar 3 10:21:54 2015 New Revision: 279563 URL: https://svnweb.freebsd.org/changeset/base/279563 Log: Add quirk for USB 3.0 controllers which don't support 64-bit DMA. MFC after: 3 days Submitted by: Gary Jennejohn Modified: head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Tue Mar 3 10:11:58 2015 (r279562) +++ head/sys/dev/usb/controller/xhci_pci.c Tue Mar 3 10:21:54 2015 (r279563) @@ -180,6 +180,7 @@ xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); int count, err, rid; + uint8_t usedma32; rid = PCI_XHCI_CBMEM; sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, @@ -192,7 +193,17 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self, 0)) { + /* check for USB 3.0 controllers which don't support 64-bit DMA */ + switch (pci_get_devid(self)) { + case 0x01941033: /* NEC uPD720200 USB 3.0 controller */ + usedma32 = 1; + break; + default: + usedma32 = 0; + break; + } + + if (xhci_init(sc, self, usedma32)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 10:50:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 999268CE; Tue, 3 Mar 2015 10:50:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A5B9767; Tue, 3 Mar 2015 10:50:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23Ao4AC004632; Tue, 3 Mar 2015 10:50:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23Ao4sQ004631; Tue, 3 Mar 2015 10:50:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503031050.t23Ao4sQ004631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 3 Mar 2015 10:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279564 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 10:50:04 -0000 Author: ae Date: Tue Mar 3 10:50:03 2015 New Revision: 279564 URL: https://svnweb.freebsd.org/changeset/base/279564 Log: Create nd6_ns_output_fib() function with extra argument fibnum. Use it to initialize mbuf's fibnum. Uninitialized fibnum value can lead to panic in the routing code. Currently we use only RT_DEFAULT_FIB value for initialization. Differential Revision: https://reviews.freebsd.org/D1998 Reviewed by: hrs (previous version) Sponsored by: Yandex LLC Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Tue Mar 3 10:21:54 2015 (r279563) +++ head/sys/netinet6/nd6_nbr.c Tue Mar 3 10:50:03 2015 (r279564) @@ -95,6 +95,8 @@ static void nd6_dad_ns_input(struct ifad static void nd6_dad_na_input(struct ifaddr *); static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_long, int, struct sockaddr *, u_int); +static void nd6_ns_output_fib(struct ifnet *, const struct in6_addr *, + const struct in6_addr *, struct llentry *, uint8_t *, u_int); static VNET_DEFINE(int, dad_enhanced) = 1; #define V_dad_enhanced VNET(dad_enhanced) @@ -394,9 +396,10 @@ nd6_ns_input(struct mbuf *m, int off, in * nonce - If non-NULL, NS is used for duplicate address detection and * the value (length is ND_OPT_NONCE_LEN) is used as a random nonce. */ -void -nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, - const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce) +static void +nd6_ns_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6, + const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce, + u_int fibnum) { struct mbuf *m; struct m_tag *mtag; @@ -416,8 +419,9 @@ nd6_ns_output(struct ifnet *ifp, const s maxlen += (sizeof(struct nd_opt_hdr) + ifp->if_addrlen + 7) & ~7; if (max_linkhdr + maxlen >= MCLBYTES) { #ifdef DIAGNOSTIC - printf("nd6_ns_output: max_linkhdr + maxlen >= MCLBYTES " - "(%d + %d > %d)\n", max_linkhdr, maxlen, MCLBYTES); + printf("%s: max_linkhdr + maxlen >= MCLBYTES " + "(%d + %d > %d)\n", __func__, max_linkhdr, maxlen, + MCLBYTES); #endif return; } @@ -428,6 +432,7 @@ nd6_ns_output(struct ifnet *ifp, const s m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; + M_SETFIB(m, fibnum); bzero(&ro, sizeof(ro)); @@ -521,9 +526,8 @@ nd6_ns_output(struct ifnet *ifp, const s NULL, &ro, NULL, &oifp, &src_in); if (error) { char ip6buf[INET6_ADDRSTRLEN]; - nd6log((LOG_DEBUG, - "nd6_ns_output: source can't be " - "determined: dst=%s, error=%d\n", + nd6log((LOG_DEBUG, "%s: source can't be " + "determined: dst=%s, error=%d\n", __func__, ip6_sprintf(ip6buf, &dst_sa.sin6_addr), error)); goto bad; @@ -626,6 +630,15 @@ nd6_ns_output(struct ifnet *ifp, const s return; } +#ifndef BURN_BRIDGES +void +nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, + const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce) +{ + + nd6_ns_output_fib(ifp, daddr6, taddr6, ln, nonce, RT_DEFAULT_FIB); +} +#endif /* * Neighbor advertisement input handling. * From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 11:01:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95684BA8; Tue, 3 Mar 2015 11:01:15 +0000 (UTC) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9888A6; Tue, 3 Mar 2015 11:01:14 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.9/8.14.9/ALCHEMY.FRANKEN.DE) with ESMTP id t23B15Jo006759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Mar 2015 12:01:05 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.9/8.14.9/Submit) id t23B14fH006758; Tue, 3 Mar 2015 12:01:04 +0100 (CET) (envelope-from marius) Date: Tue, 3 Mar 2015 12:01:04 +0100 From: Marius Strobl To: Hans Petter Selasky Subject: Re: svn commit: r279563 - head/sys/dev/usb/controller Message-ID: <20150303110104.GA65391@alchemy.franken.de> References: <201503031021.t23ALtIK094082@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503031021.t23ALtIK094082@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Tue, 03 Mar 2015 12:01:05 +0100 (CET) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 11:01:15 -0000 On Tue, Mar 03, 2015 at 10:21:55AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Mar 3 10:21:54 2015 > New Revision: 279563 > URL: https://svnweb.freebsd.org/changeset/base/279563 > > Log: > Add quirk for USB 3.0 controllers which don't support 64-bit DMA. > Hrm, this is strange; I checked Linux sources when adding 64-bit DMA support and while they handle tons of quirks for USB controllers (which FreeBSD doesn't), they don't have a single such exception for 64-bit DMA. Are you sure using 64-bit DMA doesn't just reveal another problem? F. e., Linux issues an extra doorbell ring for XHCI_NEC_HOST and generally reads back the doorbell register in order to flush PCI writes. Marius From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 11:22:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38BBD29F; Tue, 3 Mar 2015 11:22:54 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA154B82; Tue, 3 Mar 2015 11:22:53 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8849B1FE022; Tue, 3 Mar 2015 12:22:51 +0100 (CET) Message-ID: <54F599BA.5060708@freebsd.org> Date: Tue, 03 Mar 2015 12:23:38 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Marius Strobl Subject: Re: svn commit: r279563 - head/sys/dev/usb/controller References: <201503031021.t23ALtIK094082@svn.freebsd.org> <20150303110104.GA65391@alchemy.franken.de> In-Reply-To: <20150303110104.GA65391@alchemy.franken.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 11:22:54 -0000 On 03/03/15 12:01, Marius Strobl wrote: > On Tue, Mar 03, 2015 at 10:21:55AM +0000, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Mar 3 10:21:54 2015 >> New Revision: 279563 >> URL: https://svnweb.freebsd.org/changeset/base/279563 >> >> Log: >> Add quirk for USB 3.0 controllers which don't support 64-bit DMA. >> > > Hrm, this is strange; I checked Linux sources when adding 64-bit DMA > support and while they handle tons of quirks for USB controllers > (which FreeBSD doesn't), they don't have a single such exception for > 64-bit DMA. Are you sure using 64-bit DMA doesn't just reveal another > problem? F. e., Linux issues an extra doorbell ring for XHCI_NEC_HOST > and generally reads back the doorbell register in order to flush PCI > writes. > > Marius > > I'll check with Gary if he can test a patch for flushing posted PCI writes. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 12:00:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C63C8C5; Tue, 3 Mar 2015 12:00:13 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF1E5E57; Tue, 3 Mar 2015 12:00:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t23BtSxC029372; Tue, 3 Mar 2015 14:56:28 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 3 Mar 2015 14:55:28 +0300 (MSK) From: Dmitry Morozovsky To: Ian Lepore Subject: Re: svn commit: r279361 - in head: sys/kern sys/sys usr.sbin/jail In-Reply-To: <1425327800.1287.7.camel@freebsd.org> Message-ID: References: <201502271628.t1RGSurE067472@svn.freebsd.org> <54F42726.3000602@freebsd.org> <1425327800.1287.7.camel@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 03 Mar 2015 14:56:28 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 12:00:13 -0000 On Mon, 2 Mar 2015, Ian Lepore wrote: > > > Log: > > > Allow the kern.osrelease and kern.osreldate sysctl values to be set in a > > > jail's creation parameters. This allows the kernel version to be reliably > > > spoofed within the jail whether examined directly with sysctl or > > > indirectly with the uname -r and -K options. > > > [..] > > > > > There is no sanity or range checking, other than disallowing an empty > > > release string or a zero release date, by design. The system > > > administrator is trusted to set sane values. Setting values that are > > > newer than the actual running kernel will likely cause compatibility > > > problems. > > > > > I would think that you could at set time ensure that only older > > releases were allowed.. > > I'm not sure what the rule would be with sub-sub-jails.. older than > > parent, or older than base system..? > > > > > > I am a really really strong believer in giving administrators complete > control of their systems. If they want to do "something stupid" because > it works for them, I'm not going to stop them. Well, what about giving them a hinting warning in such case? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 12:44:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75059295 for ; Tue, 3 Mar 2015 12:44:17 +0000 (UTC) Received: from mail1207.opentransfer.com (mail1207.opentransfer.com [98.130.1.227]) by mx1.freebsd.org (Postfix) with ESMTP id 28FF6601 for ; Tue, 3 Mar 2015 12:44:16 +0000 (UTC) Received: (qmail 12795 invoked by uid 399); 3 Mar 2015 12:37:34 -0000 Received: from unknown (HELO qtonixPC) (adamgibbs20@oragnictraffic.com@180.87.253.177) by mail1207.opentransfer.com with ESMTPAMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM; 3 Mar 2015 12:37:34 -0000 X-Originating-IP: 180.87.253.177 From: "Adam Gibbs" To: Subject: Get more business from your website Date: Tue, 3 Mar 2015 18:05:43 +0530 Message-ID: <092001d055ae$d3ec17c0$7bc44740$@com> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdBVroXAhKgBDeiRTGOSIjiwtkysYA== Content-Language: en-us Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 12:44:17 -0000 Hi gcu.info Team, Hope you are doing well. I thought you might like to know some of the reasons why you are not getting enough organic & social media traffic for your website. I would like to update you that, your website is still not ranked on the top pages of Google SERPs for your popular keywords (Products). Your loss is your competitor's gain i.e. the traffic which could have generated quality sales for you goes to your competitors as they rank well in the Search Engine Result Pages (SERPs) organically. Reasons: 1. HTML and other on-page errors are present on your website. 2. Your home page rank is 4 out of 10. 3. Duplicate or low quality contents present in your website without any regular update. 4. Need to update fresh contents on your website and blogs as per the latest Google guideline. 5. Social media profile needs to be updated regularly. Long gone are the days when Google used to give priority to websites with huge number of links. Now Google counts each and every detail to verify if your website is relevant to the keywords you are promoting for. A single un-wanted link or a duplicate content can lead your website to be penalized by Google. To brief you about the company: We do SEO, SMO and reputation management for our clients. Our team of dedicated Google Analytic and Adwords certified professionals excel in promoting and increasing the visibility of a website in various search engines (including the latest Google Panda and Penguin updates), which will directly help in increasing traffics for your website. Unlike other SEO companies we do not believe in talking rather we believe in delivering what we promise to our clients. We provide guaranteed services or money back-guarantee to all our clients who consider working with us. This email just tells you the fraction of things we do, our optimization process involves many other technical factors which can be sent to you on your request. If you would like to know more about our services then please write us. If you are getting rigid by paying a huge amount in PPC then Organic listing by using white hat technique will be definitely a right choice for you. Feel free to email us or alternatively you can provide your best time and phone number to call you. P.S: - This is our marketing strategy that we use the Gmail account. Once you reply us back, the next communication I will do is from my corporate email ID. Let me know your thoughts and looking forward to work together. Best Regards, Adam Gibbs| Senior SEO Advisor Skype: adamgibbs9 ---------------------------------------------------------------------------- -------------- Note: 1: This is a onetime email and you may ask us to "REMOVE". 2: If you are interested I will send more details on our "corporate identity", "company profile", "why you should choose us?", "Price list", "money back" etc. in my next mail. From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 17:03:42 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA5858B2; Tue, 3 Mar 2015 17:03:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B50898FB; Tue, 3 Mar 2015 17:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23H3gnw083465; Tue, 3 Mar 2015 17:03:42 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23H3gB9083464; Tue, 3 Mar 2015 17:03:42 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503031703.t23H3gB9083464@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 3 Mar 2015 17:03:42 +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: r279565 - stable/10/sys/boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 17:03:42 -0000 Author: loos Date: Tue Mar 3 17:03:41 2015 New Revision: 279565 URL: https://svnweb.freebsd.org/changeset/base/279565 Log: MFC r278915: Set the #address-cells and #size-cells properties on I2C controllers of Raspberry-pi. This fixes the issues on dtc(1) while compiling I2C addresses set with "reg" property. Modified: stable/10/sys/boot/fdt/dts/arm/bcm2835.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/bcm2835.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/bcm2835.dtsi Tue Mar 3 10:50:03 2015 (r279564) +++ stable/10/sys/boot/fdt/dts/arm/bcm2835.dtsi Tue Mar 3 17:03:41 2015 (r279565) @@ -397,6 +397,8 @@ }; bsc0 { + #address-cells = <1>; + #size-cells = <0>; compatible = "broadcom,bcm2835-bsc", "broadcom,bcm2708-bsc"; reg = <0x205000 0x20>; @@ -405,6 +407,8 @@ }; bsc1 { + #address-cells = <1>; + #size-cells = <0>; compatible = "broadcom,bcm2835-bsc", "broadcom,bcm2708-bsc"; reg = <0x804000 0x20>; From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 17:20:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DCFBF2E; Tue, 3 Mar 2015 17:20:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490F5A96; Tue, 3 Mar 2015 17:20:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23HKKDG090188; Tue, 3 Mar 2015 17:20:20 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23HKKqZ090187; Tue, 3 Mar 2015 17:20:20 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503031720.t23HKKqZ090187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 3 Mar 2015 17:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279566 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 17:20:20 -0000 Author: loos Date: Tue Mar 3 17:20:19 2015 New Revision: 279566 URL: https://svnweb.freebsd.org/changeset/base/279566 Log: Sort and remove unnecessary headers. Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Tue Mar 3 17:03:41 2015 (r279565) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Tue Mar 3 17:20:19 2015 (r279566) @@ -26,27 +26,17 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include -#include -#include #include -#include #include -#include -#include -#include #include -#include -#include -#include -#include +#include +#include #include -#include +#include +#include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 17:27:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57AAD1FF; Tue, 3 Mar 2015 17:27:47 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DFB2BF7; Tue, 3 Mar 2015 17:27:46 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t23HRk86063043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Mar 2015 09:27:46 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t23HRjmJ063042; Tue, 3 Mar 2015 09:27:45 -0800 (PST) (envelope-from jmg) Date: Tue, 3 Mar 2015 09:27:45 -0800 From: John-Mark Gurney To: Julian Elischer Subject: Re: svn commit: r279539 - head/sys/sys Message-ID: <20150303172745.GO32329@funkthat.com> References: <201503022005.t22K5HTL062907@svn.freebsd.org> <54F57CC6.9050109@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F57CC6.9050109@freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 03 Mar 2015 09:27:46 -0800 (PST) Cc: Davide Italiano , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 17:27:47 -0000 Julian Elischer wrote this message on Tue, Mar 03, 2015 at 01:20 -0800: > On 3/2/15 4:55 PM, Neel Natu wrote: > > Hi Davide, > > > > On Mon, Mar 2, 2015 at 12:26 PM, Davide Italiano wrote: > >> On Mon, Mar 2, 2015 at 12:05 PM, John-Mark Gurney wrote: > >>> Author: jmg > >>> Date: Mon Mar 2 20:05:16 2015 > >>> New Revision: 279539 > >>> URL: https://svnweb.freebsd.org/changeset/base/279539 > >>> > >>> Log: > >>> give others fair warning that _SPARE2 isn't just cxgb, but used by large > >>> number of other subsystems, so you probably don't want _SPARE2.. > >>> > >>> ktr needs an overhaul to really only compile in the ones you want, > >>> we've long passed the 31 bits it provides.. > >>> > >> If you really want to do the overhaul (which would be honestly great), > >> I might consider revamping my work for per-cpu KTR buffer and include > >> that in the change. Originally it was just an exercise, but then it > >> evolved and I've been sitting with it in my local tree for a while. I > >> never had the chutzpah to upstream it because it involves fundamental > >> changes and breaks compatibility with the old ktrdump(1) format. > >> A rather outdated (and maybe not completely functional) version of the > >> patch can be found here: > >> http://people.freebsd.org/~davide/locking/ktr_percpu.4.diff , which > >> should give you an high level view of the change. > >> I can update it to the last version and bring up for review, if > >> somebody think it might be a sane idea avoiding synchronization on a > >> single buffer for KTR. > I think it would be a problem... > one of the truely useful things about ktr is that it does use a single > buffer. > this means that you get the true interaction between CPUS. > Schedgraph relies on this (as one example). Don't some systems provide a syncronized P-state invariant TSC? If so, we can use the TSC clock to tell ordering between cores.. I could definately seeing it be a tunable that lets people force either single buffer, or PCPU buffer KTR... Where we know TSC is syncronized, we default to PCPU and others a single buffer... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 17:41:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8931658C; Tue, 3 Mar 2015 17:41:44 +0000 (UTC) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02D6ADBF; Tue, 3 Mar 2015 17:41:44 +0000 (UTC) Received: by lbiz12 with SMTP id z12so15861593lbi.5; Tue, 03 Mar 2015 09:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yNp99YyyUSJzWs0JBQjz6CXE/EcYtuf+f5gZbpXNRXk=; b=f8BbTSL14kuCAlRiL+lVgpWS7uPImh7/AJYYcQpNUk7qUDYKdGUV6/PiBSb/Noqjf+ Dmkf67YfSUeJmpT/m9LsiUgGv1+F6W152S1zEEBZNTPRM/fV8uHOxddzL5xf8hoEnpTw TBsqfBeEQMgPPSWOP5c6o+/DqSoeoPYiIR6OPmYcWSjwbYkOr87mcgPORmLXt+f/tpol upwizK7nti/pOIUTSafZ6d82KR803gLoAiS+Z0hDofp7/69nlMKEOKRSp5Ilsz93xoYe N17GywESTZaYEyMqXlMlW0sjUWVzNHyXSsS2YEeDOdw3k9r4ma9h8PbRYQm65iWs9yw7 JnNg== MIME-Version: 1.0 X-Received: by 10.152.197.34 with SMTP id ir2mr62823lac.36.1425404501991; Tue, 03 Mar 2015 09:41:41 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.25.217.8 with HTTP; Tue, 3 Mar 2015 09:41:41 -0800 (PST) Received: by 10.25.217.8 with HTTP; Tue, 3 Mar 2015 09:41:41 -0800 (PST) In-Reply-To: <20150303172745.GO32329@funkthat.com> References: <201503022005.t22K5HTL062907@svn.freebsd.org> <54F57CC6.9050109@freebsd.org> <20150303172745.GO32329@funkthat.com> Date: Tue, 3 Mar 2015 09:41:41 -0800 X-Google-Sender-Auth: NcYLQVMLFCGdh4GcXGA5eBw01io Message-ID: Subject: Re: svn commit: r279539 - head/sys/sys From: Davide Italiano To: John-Mark Gurney Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@freebsd.org" , Julian Elischer , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 17:41:44 -0000 On Mar 3, 2015 9:27 AM, "John-Mark Gurney" wrote: > > Julian Elischer wrote this message on Tue, Mar 03, 2015 at 01:20 -0800: > > On 3/2/15 4:55 PM, Neel Natu wrote: > > > Hi Davide, > > > > > > On Mon, Mar 2, 2015 at 12:26 PM, Davide Italiano wrote: > > >> On Mon, Mar 2, 2015 at 12:05 PM, John-Mark Gurney wrote: > > >>> Author: jmg > > >>> Date: Mon Mar 2 20:05:16 2015 > > >>> New Revision: 279539 > > >>> URL: https://svnweb.freebsd.org/changeset/base/279539 > > >>> > > >>> Log: > > >>> give others fair warning that _SPARE2 isn't just cxgb, but used by large > > >>> number of other subsystems, so you probably don't want _SPARE2.. > > >>> > > >>> ktr needs an overhaul to really only compile in the ones you want, > > >>> we've long passed the 31 bits it provides.. > > >>> > > >> If you really want to do the overhaul (which would be honestly great), > > >> I might consider revamping my work for per-cpu KTR buffer and include > > >> that in the change. Originally it was just an exercise, but then it > > >> evolved and I've been sitting with it in my local tree for a while. I > > >> never had the chutzpah to upstream it because it involves fundamental > > >> changes and breaks compatibility with the old ktrdump(1) format. > > >> A rather outdated (and maybe not completely functional) version of the > > >> patch can be found here: > > >> http://people.freebsd.org/~davide/locking/ktr_percpu.4.diff , which > > >> should give you an high level view of the change. > > >> I can update it to the last version and bring up for review, if > > >> somebody think it might be a sane idea avoiding synchronization on a > > >> single buffer for KTR. > > I think it would be a problem... > > one of the truely useful things about ktr is that it does use a single > > buffer. > > this means that you get the true interaction between CPUS. > > Schedgraph relies on this (as one example). > > Don't some systems provide a syncronized P-state invariant TSC? If so, > we can use the TSC clock to tell ordering between cores.. > > I could definately seeing it be a tunable that lets people force either > single buffer, or PCPU buffer KTR... Where we know TSC is syncronized, > we default to PCPU and others a single buffer... > I can't talk about schedgraph because I'm not familiar with the implementation. Can you please elaborate how things will break with a per-CPU buf? I know that everything after Nehalem has a synchronized TSC.Also I've just noticed Matt Dillon introduced a change similar to mine in Dragonfly about 10 years ago. The way they cope with TSC skew is that of resynchronizing the timers periodically, e.g. 1 msec. This is exposed via a SYSCTL that can be disabled on modern processors. Anyhow, I tend to agree this kind of change might be kind of risky as is, and I havent evaluated that on !IA32, which makes the proposal even more problematic. About the double implementation, I think it's not worth our time duplicating the code + the burden of maintaining it. Either single or per-CPU buffer. Given the initial opposition I'm inclined to leave the code as is. -- Davide From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 20:08:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A6A5932; Tue, 3 Mar 2015 20:08:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B45F130; Tue, 3 Mar 2015 20:08:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23K80wb068491; Tue, 3 Mar 2015 20:08:00 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23K803f068483; Tue, 3 Mar 2015 20:08:00 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201503032008.t23K803f068483@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 3 Mar 2015 20:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279567 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 20:08:00 -0000 Author: rpaulo Date: Tue Mar 3 20:07:59 2015 New Revision: 279567 URL: https://svnweb.freebsd.org/changeset/base/279567 Log: Add and document an option to cause syslogd to run in the foreground. This allows a separate process to monitor when and how syslogd exits. That process can then restart syslogd if needed. Differential Revision: https://reviews.freebsd.org/D1985 Submitted by: Ravi Pokala Reviewed by: allanjude (man page) Modified: head/usr.sbin/syslogd/syslogd.8 head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Tue Mar 3 17:20:19 2015 (r279566) +++ head/usr.sbin/syslogd/syslogd.8 Tue Mar 3 20:07:59 2015 (r279567) @@ -36,7 +36,7 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl 468ACcdkNnosTuv +.Op Fl 468ACcdFkNnosTuv .Op Fl a Ar allowed_peer .Op Fl b Ar bind_address .Op Fl f Ar config_file @@ -213,6 +213,17 @@ This is probably only of use to develope Specify the pathname of an alternate configuration file; the default is .Pa /etc/syslog.conf . +.It Fl F +Run +.Nm +in the foreground, rather than going into daemon mode. This is useful if +some other process uses +.Xr fork 2 +and +.Xr exec 3 +to run +.Nm , +and wants to monitor when and how it exits. .It Fl k Disable the translation of messages received with facility Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Tue Mar 3 17:20:19 2015 (r279566) +++ head/usr.sbin/syslogd/syslogd.c Tue Mar 3 20:07:59 2015 (r279567) @@ -271,6 +271,7 @@ static struct filed *Files; /* Log files static struct filed consfile; /* Console */ static int Debug; /* debug flag */ +static int Foreground = 0; /* Run in foreground, instead of daemonizing */ static int resolve = 1; /* resolve hostname */ static char LocalHostName[MAXHOSTNAMELEN]; /* our hostname */ static const char *LocalDomain; /* our local domain name */ @@ -360,7 +361,7 @@ main(int argc, char *argv[]) dprintf("madvise() failed: %s\n", strerror(errno)); bindhostname = NULL; - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv")) + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv")) != -1) switch (ch) { case '4': @@ -396,6 +397,9 @@ main(int argc, char *argv[]) case 'f': /* configuration file */ ConfFile = optarg; break; + case 'F': /* run in foreground instead of daemon */ + Foreground++; + break; case 'k': /* keep remote kern fac */ KeepKernFac = 1; break; @@ -487,14 +491,14 @@ main(int argc, char *argv[]) warn("cannot open pid file"); } - if (!Debug) { + if ((!Foreground) && (!Debug)) { ppid = waitdaemon(0, 0, 30); if (ppid < 0) { warn("could not become daemon"); pidfile_remove(pfh); exit(1); } - } else { + } else if (Debug) { setlinebuf(stdout); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 20:24:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0A461F0; Tue, 3 Mar 2015 20:24:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 893013A7; Tue, 3 Mar 2015 20:24:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23KO0aA077615; Tue, 3 Mar 2015 20:24:00 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23KO0tN077608; Tue, 3 Mar 2015 20:24:00 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201503032024.t23KO0tN077608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 3 Mar 2015 20:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279568 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 20:24:00 -0000 Author: pluknet Date: Tue Mar 3 20:23:59 2015 New Revision: 279568 URL: https://svnweb.freebsd.org/changeset/base/279568 Log: Update .Dd, sync usage() for -F. Missed in previous change. Modified: head/usr.sbin/syslogd/syslogd.8 head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Tue Mar 3 20:07:59 2015 (r279567) +++ head/usr.sbin/syslogd/syslogd.8 Tue Mar 3 20:23:59 2015 (r279568) @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 13, 2008 +.Dd March 3, 2015 .Dt SYSLOGD 8 .Os .Sh NAME Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Tue Mar 3 20:07:59 2015 (r279567) +++ head/usr.sbin/syslogd/syslogd.c Tue Mar 3 20:23:59 2015 (r279568) @@ -718,7 +718,7 @@ usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: syslogd [-468ACcdknosTuv] [-a allowed_peer]", + "usage: syslogd [-468ACcdFknosTuv] [-a allowed_peer]", " [-b bind_address] [-f config_file]", " [-l [mode:]path] [-m mark_interval]", " [-P pid_file] [-p log_socket]"); From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 20:53:14 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7F1EE6B; Tue, 3 Mar 2015 20:53:14 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AD76975; Tue, 3 Mar 2015 20:53:14 +0000 (UTC) Received: from [10.60.0.53] (209-23-203-214-Illinois.hfc.comcastbusiness.net [209.23.203.214]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NKN005U4M00YN40@st11p02mm-asmtp002.mac.com>; Tue, 03 Mar 2015 20:52:50 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-03_07:2015-03-03,2015-03-03,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1503030221 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279568 - head/usr.sbin/syslogd From: Rui Paulo In-reply-to: <201503032024.t23KO0tN077608@svn.freebsd.org> Date: Tue, 03 Mar 2015 12:52:47 -0800 Content-transfer-encoding: 7bit Message-id: <549B98F2-24F2-4B34-ABB6-6B622E8BD9DE@me.com> References: <201503032024.t23KO0tN077608@svn.freebsd.org> To: Sergey Kandaurov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 20:53:14 -0000 On 3 Mar 2015, at 12:24, Sergey Kandaurov wrote: > > Author: pluknet > Date: Tue Mar 3 20:23:59 2015 > New Revision: 279568 > URL: https://svnweb.freebsd.org/changeset/base/279568 > > Log: > Update .Dd, sync usage() for -F. Missed in previous change. That was fast... thanks :-) -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 21:21:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B5FF537; Tue, 3 Mar 2015 21:21:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCA4CAF; Tue, 3 Mar 2015 21:21:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23LLilf004671; Tue, 3 Mar 2015 21:21:44 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23LLhlq004666; Tue, 3 Mar 2015 21:21:43 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503032121.t23LLhlq004666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 3 Mar 2015 21:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279569 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 21:21:45 -0000 Author: jilles Date: Tue Mar 3 21:21:43 2015 New Revision: 279569 URL: https://svnweb.freebsd.org/changeset/base/279569 Log: sh: Fix more compiler warnings related to variable declarations. Modified: head/bin/sh/error.c head/bin/sh/mknodes.c head/bin/sh/mksyntax.c head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/error.c ============================================================================== --- head/bin/sh/error.c Tue Mar 3 20:23:59 2015 (r279568) +++ head/bin/sh/error.c Tue Mar 3 21:21:43 2015 (r279569) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ #include "shell.h" +#include "eval.h" #include "main.h" #include "options.h" #include "output.h" @@ -64,7 +65,6 @@ struct jmploc *handler; volatile sig_atomic_t exception; volatile sig_atomic_t suppressint; volatile sig_atomic_t intpending; -char *commandname; static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; Modified: head/bin/sh/mknodes.c ============================================================================== --- head/bin/sh/mknodes.c Tue Mar 3 20:23:59 2015 (r279568) +++ head/bin/sh/mknodes.c Tue Mar 3 21:21:43 2015 (r279569) @@ -204,7 +204,7 @@ parsefield(void) } -char writer[] = "\ +static const char writer[] = "\ /*\n\ * This file was generated by the mknodes program.\n\ */\n\ Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Tue Mar 3 20:23:59 2015 (r279568) +++ head/bin/sh/mksyntax.c Tue Mar 3 21:21:43 2015 (r279569) @@ -60,7 +60,7 @@ struct synclass { }; /* Syntax classes */ -struct synclass synclass[] = { +static const struct synclass synclass[] = { { "CWORD", "character is nothing special" }, { "CNL", "newline character" }, { "CBACK", "a backslash character" }, @@ -85,7 +85,7 @@ struct synclass synclass[] = { * Syntax classes for is_ functions. Warning: if you add new classes * you may have to change the definition of the is_in_name macro. */ -struct synclass is_entry[] = { +static const struct synclass is_entry[] = { { "ISDIGIT", "a digit" }, { "ISUPPER", "an upper case letter" }, { "ISLOWER", "a lower case letter" }, @@ -94,7 +94,7 @@ struct synclass is_entry[] = { { NULL, NULL } }; -static char writer[] = "\ +static const char writer[] = "\ /*\n\ * This file was generated by the mksyntax program.\n\ */\n\ Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Tue Mar 3 20:23:59 2015 (r279568) +++ head/bin/sh/var.c Tue Mar 3 21:21:43 2015 (r279569) @@ -94,6 +94,7 @@ struct var vps4; static struct var voptind; struct var vdisvfork; +struct localvar *localvars; int forcelocal; static const struct varinit varinit[] = { Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Tue Mar 3 20:23:59 2015 (r279568) +++ head/bin/sh/var.h Tue Mar 3 21:21:43 2015 (r279569) @@ -68,7 +68,7 @@ struct localvar { }; -struct localvar *localvars; +extern struct localvar *localvars; extern int forcelocal; extern struct var vifs; From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 22:49:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99A1770B; Tue, 3 Mar 2015 22:49:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83D977B3; Tue, 3 Mar 2015 22:49:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23Mn8Lx044963; Tue, 3 Mar 2015 22:49:08 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23Mn8qs044961; Tue, 3 Mar 2015 22:49:08 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503032249.t23Mn8qs044961@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 3 Mar 2015 22:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279570 - in head: lib/libmt usr.bin/mt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 22:49:08 -0000 Author: ken Date: Tue Mar 3 22:49:07 2015 New Revision: 279570 URL: https://svnweb.freebsd.org/changeset/base/279570 Log: Add density code for DAT-72, and notes on DAT-160. As it turns out, the density code for DAT-160 (0x48) is the same as for SDLT220. Since the SDLT values are already in the table, we will leave them in place. Thanks to Harald Schmalzbauer for confirming the DAT-72 density code. lib/libmt/mtlib.c: Add DAT-72 density code, and commented out DAT-160 density code. Explain why DAT-160 is commented out. Add notes explaining where the bpi values for these formats came from. usr.bin/mt/mt.1: Add DAT-72 density code, and add a note explaining that the SDLTTapeI(110) density code (0x48) is the same as DAT-160. Sponsored by: Spectra Logic MFC after: 3 weeks Modified: head/lib/libmt/mtlib.c head/usr.bin/mt/mt.1 Modified: head/lib/libmt/mtlib.c ============================================================================== --- head/lib/libmt/mtlib.c Tue Mar 3 21:21:43 2015 (r279569) +++ head/lib/libmt/mtlib.c Tue Mar 3 22:49:07 2015 (r279570) @@ -568,6 +568,15 @@ static struct densities { * * IBM 3592 definitions obtained from second edition of the IBM * System Storage Tape Drive 3592 SCSI Reference (May 25, 2012). + * + * DAT-72 and DAT-160 bpi values taken from "HP StorageWorks DAT160 + * tape drive white paper", dated June 2007. + * + * DAT-160 / SDLT220 density code (0x48) conflict information + * found here: + * + * http://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c01065117&sp4ts.oid=429311 + * (Document ID c01065117) */ /*Num. bpmm bpi Reference */ { 0x1, 32, 800, "X3.22-1983" }, @@ -613,6 +622,14 @@ static struct densities { { 0x42, 7398, 187909, "LTO-2" }, { 0x44, 9638, 244805, "LTO-3" }, { 0x46, 12725, 323215, "LTO-4" }, + { 0x47, 6417, 163000, "DAT-72" }, + /* + * XXX KDM note that 0x48 is also the density code for DAT-160. + * For some reason they used overlapping density codes. + */ +#if 0 + { 0x48, 6870, 174500, "DAT-160" }, +#endif { 0x48, 5236, 133000, "SDLTapeI(110)" }, { 0x49, 7598, 193000, "SDLTapeI(160)" }, { 0x4a, 0, 0, "T10000A" }, Modified: head/usr.bin/mt/mt.1 ============================================================================== --- head/usr.bin/mt/mt.1 Tue Mar 3 21:21:43 2015 (r279569) +++ head/usr.bin/mt/mt.1 Tue Mar 3 22:49:07 2015 (r279570) @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 12, 2014 +.Dd March 3, 2014 .Dt MT 1 .Os .Sh NAME @@ -503,7 +503,8 @@ Value Width Tracks Density 0x42 12.7 (0.5) 512 7,398 (187,909) C LTO-2 0x44 12.7 (0.5) 704 9,638 (244,805) C LTO-3 0x46 12.7 (0.5) 896 12,725 (323,215) C LTO-4 -0x48 12.7 (0.5) 448 5,236 (133,000) PRML C SDLTapeI(110) 6,8 +0x47 3.81 (0.25) ? 6,417 (163,000) CS DAT-72 +0x48 12.7 (0.5) 448 5,236 (133,000) PRML C SDLTapeI(110) 6,8,13 0x49 12.7 (0.5) 448 7,598 (193,000) PRML C SDLTapeI(160) 6,8 0x4A 12.7 (0.5) 768 ? C T10000A 10 0x4B 12.7 (0.5) 1152 ? C T10000B 10 @@ -556,6 +557,7 @@ NOTES density code is 0x90. 12. This is Exabyte 8500 uncompressed format. The compressed format density code is 0x8c. +13. This density code (0x48) was also used for DAT-160. .Ed .Sh ENVIRONMENT .Bl -tag -width ".Ev TAPE" From owner-svn-src-all@FreeBSD.ORG Tue Mar 3 23:20:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B69F1DFD; Tue, 3 Mar 2015 23:20:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 975E7AAE; Tue, 3 Mar 2015 23:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t23NKJBm059791; Tue, 3 Mar 2015 23:20:19 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t23NKJjC059788; Tue, 3 Mar 2015 23:20:19 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201503032320.t23NKJjC059788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 3 Mar 2015 23:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279571 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 23:20:19 -0000 Author: allanjude (doc committer) Date: Tue Mar 3 23:20:18 2015 New Revision: 279571 URL: https://svnweb.freebsd.org/changeset/base/279571 Log: Add a new safetly belt to freebsd-update to prevent a user doing a minor update (-pX) while having an unfinished major upgrade (9.x to 9.y) Safetly belt can be disabled with the -F flag Additionally, add the --not-running-from-cron flag they bypasses the TTY requirement, and allows freebsd-update to be invoked by orchestration frameworks, scripts, or otherwise. PR: 196760 Differential Revision: https://reviews.freebsd.org/D1550 Reviewed by: cperciva, delphij Approved by: bcr (mentor), rodrigc (src) MFC after: 1 month Relnotes: yes Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Mar 3 22:49:07 2015 (r279570) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Mar 3 23:20:18 2015 (r279571) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2010 +.Dd March 2, 2015 .Dt FREEBSD-UPDATE 8 .Os FreeBSD .Sh NAME @@ -36,10 +36,12 @@ .Op Fl b Ar basedir .Op Fl d Ar workdir .Op Fl f Ar conffile +.Op Fl F .Op Fl k Ar KEY .Op Fl r Ar newrelease .Op Fl s Ar server .Op Fl t Ar address +.Op Fl -not-running-from-cron .Cm command ... .Sh DESCRIPTION The @@ -54,16 +56,16 @@ by the .Fx Release Engineering Team, e.g., .Fx -7.3-RELEASE and +9.3-RELEASE and .Fx -8.0-RELEASE, but not +10.1-RELEASE, but not .Fx -6.3-STABLE or +9.3-STABLE or .Fx -9.0-CURRENT. +11-CURRENT. .Sh OPTIONS The following options are supported: -.Bl -tag -width "-f conffile" +.Bl -tag -width "-r newrelease" .It Fl b Ar basedir Operate on a system mounted at .Ar basedir . @@ -81,6 +83,10 @@ Read configuration options from .Ar conffile . (default: .Pa /etc/freebsd-update.conf ) +.It Fl F +Force +.Nm Cm fetch +to proceed where it normally would not, such as an unfinished upgrade .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . @@ -98,12 +104,21 @@ Mail output of command, if any, to .Ar address . (default: root, or as given in the configuration file.) +.It Fl -not-running-from-cron +Force +.Nm Cm fetch +to proceed when there is no controlling tty. +This is for use by automated scripts and orchestration tools. +Please do not run +.Nm Cm fetch +from crontab or similar using this flag, see: +.Nm Cm cron .El .Sh COMMANDS The .Cm command can be any one of the following: -.Bl -tag -width "-f conffile" +.Bl -tag -width "rollback" .It Cm fetch Based on the currently installed world and the configuration options set, fetch all available binary updates. Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Mar 3 22:49:07 2015 (r279570) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Mar 3 23:20:18 2015 (r279571) @@ -43,12 +43,15 @@ Options: (default: /var/db/freebsd-update/) -f conffile -- Read configuration options from conffile (default: /etc/freebsd-update.conf) + -F -- Force a fetch operation to proceed -k KEY -- Trust an RSA key with SHA256 hash of KEY -r release -- Target for upgrade (e.g., 6.2-RELEASE) -s server -- Server from which to fetch updates (default: update.FreeBSD.org) -t address -- Mail output of cron command, if any, to address (default: root) + --not-running-from-cron + -- Run without a tty, for use by automated tools Commands: fetch -- Fetch updates from server cron -- Sleep rand(3600) seconds, fetch updates, and send an @@ -399,6 +402,12 @@ init_params () { # No commands specified yet COMMANDS="" + + # Force fetch to proceed + FORCEFETCH=0 + + # Run without a TTY + NOTTYOK=0 } # Parse the command line @@ -411,6 +420,12 @@ parse_cmdline () { if [ ! -z "${CONFFILE}" ]; then usage; fi shift; CONFFILE="$1" ;; + -F) + FORCEFETCH=1 + ;; + --not-running-from-cron) + NOTTYOK=1 + ;; # Configuration file equivalents -b) @@ -673,6 +688,14 @@ fetch_check_params () { echo "(Did you mean 'upgrade' instead?)" exit 1 fi + + # Check that we have updates ready to install + if [ -f ${BDHASH}-install/kerneldone && $FORCEFETCH -eq 0 ]; then + echo "You have a partially completed upgrade pending" + echo "Run '$0 install' first." + echo "Run '$0 fetch -F' to proceed anyway." + exit 1 + fi } # Perform sanity checks etc. before fetching upgrades. @@ -3197,7 +3220,7 @@ get_params () { # Fetch command. Make sure that we're being called # interactively, then run fetch_check_params and fetch_run cmd_fetch () { - if [ ! -t 0 ]; then + if [ ! -t 0 && $NOTTYOK -eq 0 ]; then echo -n "`basename $0` fetch should not " echo "be run non-interactively." echo "Run `basename $0` cron instead." From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 01:10:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BFCEEBA; Wed, 4 Mar 2015 01:10:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2663187C; Wed, 4 Mar 2015 01:10:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t241A9Hf012455; Wed, 4 Mar 2015 01:10:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t241A92T012454; Wed, 4 Mar 2015 01:10:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503040110.t241A92T012454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Mar 2015 01:10:09 +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: r279572 - stable/10/contrib/binutils/bfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 01:10:10 -0000 Author: emaste Date: Wed Mar 4 01:10:09 2015 New Revision: 279572 URL: https://svnweb.freebsd.org/changeset/base/279572 Log: MFC r279301: GNU nm: Avoid NULL dereference bfd_dwarf2_find_line() calls find_line() with NULL functionname_ptr, which resulted in a crash on certain ELF objects. This change was implemented independently from upstream binutils, but I have checked that the crash does not happen there. Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/binutils/bfd/dwarf2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/bfd/dwarf2.c ============================================================================== --- stable/10/contrib/binutils/bfd/dwarf2.c Tue Mar 3 23:20:18 2015 (r279571) +++ stable/10/contrib/binutils/bfd/dwarf2.c Wed Mar 4 01:10:09 2015 (r279572) @@ -2382,7 +2382,8 @@ find_line (bfd *abfd, else addr += section->vma; *filename_ptr = NULL; - *functionname_ptr = NULL; + if (!do_line) + *functionname_ptr = NULL; *linenumber_ptr = 0; if (! *pinfo) From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 02:17:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EC626EE; Wed, 4 Mar 2015 02:17:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A861EB4; Wed, 4 Mar 2015 02:17:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t242Hb3W044392; Wed, 4 Mar 2015 02:17:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t242Hbgv044391; Wed, 4 Mar 2015 02:17:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503040217.t242Hbgv044391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Mar 2015 02:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279573 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 02:17:38 -0000 Author: emaste Date: Wed Mar 4 02:17:36 2015 New Revision: 279573 URL: https://svnweb.freebsd.org/changeset/base/279573 Log: Update ThunderX SATA quirk Add quirk to ThunderX AHCI forcing only 1 MSI-X interrupt. Shorten Thunder quirk description to avoid printing 'SATA' twice. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Wed Mar 4 01:10:09 2015 (r279572) +++ head/sys/dev/ahci/ahci_pci.c Wed Mar 4 02:17:36 2015 (r279573) @@ -292,7 +292,7 @@ static const struct { {0x11841039, 0x00, "SiS 966", 0}, {0x11851039, 0x00, "SiS 968", 0}, {0x01861039, 0x00, "SiS 968", 0}, - {0xa01c177d, 0x00, "ThunderX SATA", AHCI_Q_ABAR0}, + {0xa01c177d, 0x00, "ThunderX", AHCI_Q_ABAR0|AHCI_Q_1MSI}, {0x00000000, 0x00, NULL, 0} }; From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 02:56:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 255ECC50; Wed, 4 Mar 2015 02:56:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1087127B; Wed, 4 Mar 2015 02:56:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t242uWUl062956; Wed, 4 Mar 2015 02:56:32 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t242uWYL062955; Wed, 4 Mar 2015 02:56:32 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201503040256.t242uWYL062955@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 4 Mar 2015 02:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279576 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 02:56:33 -0000 Author: marcel Date: Wed Mar 4 02:56:32 2015 New Revision: 279576 URL: https://svnweb.freebsd.org/changeset/base/279576 Log: Fix typo in dropped-packets attribute (missing s). Pointed-out by: allanjude (excellent catch!) Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Wed Mar 4 02:47:13 2015 (r279575) +++ head/usr.bin/netstat/if.c Wed Mar 4 02:56:32 2015 (r279576) @@ -422,7 +422,7 @@ intpr(int interval, void (*pfunc)(char * show_stat("lu", 8, "received-packets", IFA_STAT(ipackets), link|network); show_stat("lu", 5, "received-errors", IFA_STAT(ierrors), link); - show_stat("lu", 5, "dropped-packet", IFA_STAT(iqdrops), link); + show_stat("lu", 5, "dropped-packets", IFA_STAT(iqdrops), link); if (bflag) show_stat("lu", 10, "received-bytes", IFA_STAT(ibytes), link|network); From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 03:48:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 814829DC; Wed, 4 Mar 2015 03:48:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5297FB64; Wed, 4 Mar 2015 03:48:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t243mCdm088105; Wed, 4 Mar 2015 03:48:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t243mCHA088103; Wed, 4 Mar 2015 03:48:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503040348.t243mCHA088103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 Mar 2015 03:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279577 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 03:48:12 -0000 Author: adrian Date: Wed Mar 4 03:48:11 2015 New Revision: 279577 URL: https://svnweb.freebsd.org/changeset/base/279577 Log: Fix both arge0 and arge1 to work correctly on the AP135. * Force the arge0 interface to not use a PHY for speed negotiation for now. It'd be nice to do it, but right now the RGMII interface to the switch needs to stay at 1000/full in order to match what the switch side of the port is programmed as. So until that's all sorted out, disconnect arge0 from the PHY and leave it at fixed at 1000/full. I noticed this when I tried using a busted ethernet cable that forced the PHY to negotiate 100/full. The switch was fine and it negotiated to 100/full, but then arge0 saw the link update and set the speed to 100/full when the switch side of that hook up was set to 1000/full. Tsk. * When using argemdio, the mdio device resets and initialises the MAC, /not/ the arge_attach (or, as I discovered, arge_init.) So arge1 wasn't being fully initialised and thus no traffic would ever flow. So until I tidy up that mess, just create an argemdio bus for arge1. It's totally fine; it won't do anything or find anything attached to it. Tested: * AP135 reference board - both arge0 and arge1 now work. Modified: head/sys/mips/conf/AP135.hints Modified: head/sys/mips/conf/AP135.hints ============================================================================== --- head/sys/mips/conf/AP135.hints Wed Mar 4 02:56:32 2015 (r279576) +++ head/sys/mips/conf/AP135.hints Wed Mar 4 03:48:11 2015 (r279577) @@ -14,6 +14,12 @@ hint.argemdio.0.maddr=0x19000000 hint.argemdio.0.msize=0x1000 hint.argemdio.0.order=0 +# mdiobus1 on arge1 - required to bring up arge1? +hint.argemdio.1.at="nexus0" +hint.argemdio.1.maddr=0x1a000000 +hint.argemdio.1.msize=0x1000 +hint.argemdio.1.order=0 + # AR8327 - connected via mdiobus0 on arge0 hint.arswitch.0.at="mdio0" hint.arswitch.0.is_7240=0 # definitely not the internal switch! @@ -77,8 +83,10 @@ hint.arswitch.0.port.6.txpause=1 hint.arswitch.0.port.6.rxpause=1 # arge0 - hooked up to AR8327 GMAC6, RGMII -hint.arge.0.phymask=0x10 +hint.arge.0.phymask=0x0 hint.arge.0.miimode=3 # RGMII +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 hint.arge.0.pll_1000=0x56000000 # MAC for arge0 is the first 6 bytes of the ART From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 03:51:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5A99B98; Wed, 4 Mar 2015 03:51:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A13F2C22; Wed, 4 Mar 2015 03:51:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t243ptBa091545; Wed, 4 Mar 2015 03:51:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t243ptau091544; Wed, 4 Mar 2015 03:51:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503040351.t243ptau091544@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 Mar 2015 03:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279578 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 03:51:55 -0000 Author: adrian Date: Wed Mar 4 03:51:54 2015 New Revision: 279578 URL: https://svnweb.freebsd.org/changeset/base/279578 Log: Add DDR flush registers for QCA955x. Modified: head/sys/mips/atheros/qca955xreg.h Modified: head/sys/mips/atheros/qca955xreg.h ============================================================================== --- head/sys/mips/atheros/qca955xreg.h Wed Mar 4 03:48:11 2015 (r279577) +++ head/sys/mips/atheros/qca955xreg.h Wed Mar 4 03:51:54 2015 (r279578) @@ -198,4 +198,11 @@ #define QCA955X_PLL_VAL_100 0x00000101 #define QCA955X_PLL_VAL_10 0x00001616 +/* DDR block */ +#define QCA955X_DDR_REG_FLUSH_GE0 (AR71XX_APB_BASE + 0x9c) +#define QCA955X_DDR_REG_FLUSH_GE1 (AR71XX_APB_BASE + 0xa0) +#define QCA955X_DDR_REG_FLUSH_USB (AR71XX_APB_BASE + 0xa4) +#define QCA955X_DDR_REG_FLUSH_PCIE (AR71XX_APB_BASE + 0xa8) +#define QCA955X_DDR_REG_FLUSH_WMAC (AR71XX_APB_BASE + 0xac) + #endif /* __QCA955XREG_H__ */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 03:52:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31E89CFD; Wed, 4 Mar 2015 03:52:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D3D8C40; Wed, 4 Mar 2015 03:52:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t243qo1o092182; Wed, 4 Mar 2015 03:52:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t243qoUJ092181; Wed, 4 Mar 2015 03:52:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503040352.t243qoUJ092181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 Mar 2015 03:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279579 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 03:52:51 -0000 Author: adrian Date: Wed Mar 4 03:52:50 2015 New Revision: 279579 URL: https://svnweb.freebsd.org/changeset/base/279579 Log: Add ethernet MAC DDR flush hookups for QCA955x. Tested: * AP135 Modified: head/sys/mips/atheros/qca955x_chip.c Modified: head/sys/mips/atheros/qca955x_chip.c ============================================================================== --- head/sys/mips/atheros/qca955x_chip.c Wed Mar 4 03:51:54 2015 (r279578) +++ head/sys/mips/atheros/qca955x_chip.c Wed Mar 4 03:52:50 2015 (r279579) @@ -209,22 +209,23 @@ qca955x_chip_set_pll_ge(int unit, int sp static void qca955x_chip_ddr_flush_ge(int unit) { -#if 0 + switch (unit) { case 0: - ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE0); + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_GE0); break; case 1: - ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE1); + ar71xx_ddr_flush(QCA955X_DDR_REG_FLUSH_GE1); break; default: printf("%s: invalid DDR flush for arge unit: %d\n", __func__, unit); return; } -#endif } +/* XXX TODO: USB flush, PCIe flush, wmac flush */ + static void qca955x_chip_ddr_flush_ip2(void) { From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 04:47:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00E68416; Wed, 4 Mar 2015 04:47:58 +0000 (UTC) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CB4B14E; Wed, 4 Mar 2015 04:47:58 +0000 (UTC) Received: by lams18 with SMTP id s18so42046077lam.13; Tue, 03 Mar 2015 20:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7H9qCsZ7e3gEputJrJW+vPgjqrkEDftVwOyI0/o/3M0=; b=mNg4zamfx4DAVSrWPXX/cWb8dEOc+giiIQ952aW6PBVfpRHD+0UkVZQVvxTMU6BgLy quZb9XKA9vqpZH0Imnv+D5E1BmeSOdtEb5Da7zQJwJ210F0tAZY7l5G7K0dEpAb+qkd2 WRfUdAioeentSDy5WxLrvbnG3QKvTufrZEN7O3XgZt6FMxE92vr9oVqIRE0Jn7uNssTu mjc/eNmX5YBekb2ja7R0kWvShRpSgxiaD3/eFBKGPzFV85AjE4WG1Vwa5+ytf8ax8C3q ZlX6a6Y4+pF2fDWT6DOPW8idiyD47sGC1pm5zWbbUNYvj5/Kf5Mqw5JvBlGJlYqR7VHW Cecg== MIME-Version: 1.0 X-Received: by 10.152.1.170 with SMTP id 10mr1658892lan.89.1425444476253; Tue, 03 Mar 2015 20:47:56 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.82.164 with HTTP; Tue, 3 Mar 2015 20:47:56 -0800 (PST) In-Reply-To: <201503032320.t23NKJjC059788@svn.freebsd.org> References: <201503032320.t23NKJjC059788@svn.freebsd.org> Date: Tue, 3 Mar 2015 20:47:56 -0800 X-Google-Sender-Auth: sqNXMrKYThe63f33vc-dU0owgzk Message-ID: Subject: Re: svn commit: r279571 - head/usr.sbin/freebsd-update From: Craig Rodrigues To: Allan Jude , Ahmed Kamal Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 04:47:59 -0000 Allan, Ahmed Kamal is working on helping with devops automation of some of the config management associated with the jenkins.freebsd.org cluster. Ahmed pointed out to me that this enhancement to freebsd-update would facilitate using freebsd-update in an automation environment. Allan, thanks for working on this and taking it to completion! Ahmed, thanks for working on this stuff and pointing out where FreeBSD can be improved to help in automation environments! -- Craig On Tue, Mar 3, 2015 at 3:20 PM, Allan Jude wrote: > Author: allanjude (doc committer) > Date: Tue Mar 3 23:20:18 2015 > New Revision: 279571 > URL: https://svnweb.freebsd.org/changeset/base/279571 > > Log: > Add a new safetly belt to freebsd-update to prevent a user doing a minor > update (-pX) while having an unfinished major upgrade (9.x to 9.y) > Safetly belt can be disabled with the -F flag > > Additionally, add the --not-running-from-cron flag they bypasses the TTY > requirement, and allows freebsd-update to be invoked by orchestration > frameworks, scripts, or otherwise. > > PR: 196760 > Differential Revision: https://reviews.freebsd.org/D1550 > Reviewed by: cperciva, delphij > Approved by: bcr (mentor), rodrigc (src) > MFC after: 1 month > Relnotes: yes > Sponsored by: ScaleEngine Inc. > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.8 > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.8 > > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Mar 3 > 22:49:07 2015 (r279570) > +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Mar 3 > 23:20:18 2015 (r279571) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 14, 2010 > +.Dd March 2, 2015 > .Dt FREEBSD-UPDATE 8 > .Os FreeBSD > .Sh NAME > @@ -36,10 +36,12 @@ > .Op Fl b Ar basedir > .Op Fl d Ar workdir > .Op Fl f Ar conffile > +.Op Fl F > .Op Fl k Ar KEY > .Op Fl r Ar newrelease > .Op Fl s Ar server > .Op Fl t Ar address > +.Op Fl -not-running-from-cron > .Cm command ... > .Sh DESCRIPTION > The > @@ -54,16 +56,16 @@ by the > .Fx > Release Engineering Team, e.g., > .Fx > -7.3-RELEASE and > +9.3-RELEASE and > .Fx > -8.0-RELEASE, but not > +10.1-RELEASE, but not > .Fx > -6.3-STABLE or > +9.3-STABLE or > .Fx > -9.0-CURRENT. > +11-CURRENT. > .Sh OPTIONS > The following options are supported: > -.Bl -tag -width "-f conffile" > +.Bl -tag -width "-r newrelease" > .It Fl b Ar basedir > Operate on a system mounted at > .Ar basedir . > @@ -81,6 +83,10 @@ Read configuration options from > .Ar conffile . > (default: > .Pa /etc/freebsd-update.conf ) > +.It Fl F > +Force > +.Nm Cm fetch > +to proceed where it normally would not, such as an unfinished upgrade > .It Fl k Ar KEY > Trust an RSA key with SHA256 of > .Ar KEY . > @@ -98,12 +104,21 @@ Mail output of > command, if any, to > .Ar address . > (default: root, or as given in the configuration file.) > +.It Fl -not-running-from-cron > +Force > +.Nm Cm fetch > +to proceed when there is no controlling tty. > +This is for use by automated scripts and orchestration tools. > +Please do not run > +.Nm Cm fetch > +from crontab or similar using this flag, see: > +.Nm Cm cron > .El > .Sh COMMANDS > The > .Cm command > can be any one of the following: > -.Bl -tag -width "-f conffile" > +.Bl -tag -width "rollback" > .It Cm fetch > Based on the currently installed world and the configuration > options set, fetch all available binary updates. > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Mar 3 > 22:49:07 2015 (r279570) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Mar 3 > 23:20:18 2015 (r279571) > @@ -43,12 +43,15 @@ Options: > (default: /var/db/freebsd-update/) > -f conffile -- Read configuration options from conffile > (default: /etc/freebsd-update.conf) > + -F -- Force a fetch operation to proceed > -k KEY -- Trust an RSA key with SHA256 hash of KEY > -r release -- Target for upgrade (e.g., 6.2-RELEASE) > -s server -- Server from which to fetch updates > (default: update.FreeBSD.org) > -t address -- Mail output of cron command, if any, to address > (default: root) > + --not-running-from-cron > + -- Run without a tty, for use by automated tools > Commands: > fetch -- Fetch updates from server > cron -- Sleep rand(3600) seconds, fetch updates, and send an > @@ -399,6 +402,12 @@ init_params () { > > # No commands specified yet > COMMANDS="" > + > + # Force fetch to proceed > + FORCEFETCH=0 > + > + # Run without a TTY > + NOTTYOK=0 > } > > # Parse the command line > @@ -411,6 +420,12 @@ parse_cmdline () { > if [ ! -z "${CONFFILE}" ]; then usage; fi > shift; CONFFILE="$1" > ;; > + -F) > + FORCEFETCH=1 > + ;; > + --not-running-from-cron) > + NOTTYOK=1 > + ;; > > # Configuration file equivalents > -b) > @@ -673,6 +688,14 @@ fetch_check_params () { > echo "(Did you mean 'upgrade' instead?)" > exit 1 > fi > + > + # Check that we have updates ready to install > + if [ -f ${BDHASH}-install/kerneldone && $FORCEFETCH -eq 0 ]; then > + echo "You have a partially completed upgrade pending" > + echo "Run '$0 install' first." > + echo "Run '$0 fetch -F' to proceed anyway." > + exit 1 > + fi > } > > # Perform sanity checks etc. before fetching upgrades. > @@ -3197,7 +3220,7 @@ get_params () { > # Fetch command. Make sure that we're being called > # interactively, then run fetch_check_params and fetch_run > cmd_fetch () { > - if [ ! -t 0 ]; then > + if [ ! -t 0 && $NOTTYOK -eq 0 ]; then > echo -n "`basename $0` fetch should not " > echo "be run non-interactively." > echo "Run `basename $0` cron instead." > > From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:05:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B965279; Wed, 4 Mar 2015 09:05:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17B3AFA8; Wed, 4 Mar 2015 09:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2495Kpg038456; Wed, 4 Mar 2015 09:05:20 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2495Kei038455; Wed, 4 Mar 2015 09:05:20 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201503040905.t2495Kei038455@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Wed, 4 Mar 2015 09:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279581 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:05:21 -0000 Author: whu Date: Wed Mar 4 09:05:20 2015 New Revision: 279581 URL: https://svnweb.freebsd.org/changeset/base/279581 Log: Add myself (whu) to committers-src.dot. Approved by: royger (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Mar 4 06:03:25 2015 (r279580) +++ head/share/misc/committers-src.dot Wed Mar 4 09:05:20 2015 (r279581) @@ -300,6 +300,7 @@ vanhu [label="Yvan Vanhullebus\nvanhu@Fr versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] wes [label="Wes Peters\nwes@FreeBSD.org\n1998/11/25"] +whu [label="Wei Hu\nwhu@FreeBSD.org\n2015/02/11"] wkoszek [label="Wojciech A. Koszek\nwkoszek@FreeBSD.org\n2006/02/21"] wollman [label="Garrett Wollman\nwollman@FreeBSD.org\n????/??/??"] wsalamon [label="Wayne Salamon\nwsalamon@FreeBSD.org\n2005/06/25"] @@ -430,6 +431,7 @@ gavin -> versus gibbs -> mjacob gibbs -> njl gibbs -> royger +gibbs -> whu glebius -> mav @@ -631,6 +633,8 @@ rgrimes -> markm rmacklem -> jwd +royger -> whu + rpaulo -> avg rpaulo -> bschmidt rpaulo -> dim From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:17:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A4BC5E7; Wed, 4 Mar 2015 09:17:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46243146; Wed, 4 Mar 2015 09:17:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t249H41D043357; Wed, 4 Mar 2015 09:17:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t249H4jl043356; Wed, 4 Mar 2015 09:17:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503040917.t249H4jl043356@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Mar 2015 09:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279582 - head/sys/modules/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:17:04 -0000 Author: hselasky Date: Wed Mar 4 09:17:03 2015 New Revision: 279582 URL: https://svnweb.freebsd.org/changeset/base/279582 Log: Allow USB modules to be built in parallel. Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Wed Mar 4 09:05:20 2015 (r279581) +++ head/sys/modules/usb/Makefile Wed Mar 4 09:17:03 2015 (r279582) @@ -29,6 +29,11 @@ SYSDIR?=${.CURDIR}/../.. .include "${SYSDIR}/conf/kern.opts.mk" # +# Allow USB modules to be built in parallel +# +SUBDIR_PARALLEL= + +# # Check for common USB debug flags to pass when building the USB # modules in this directory: # From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:29:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6FECA82; Wed, 4 Mar 2015 09:29:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 989442B9; Wed, 4 Mar 2015 09:29:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t249TQSf048287; Wed, 4 Mar 2015 09:29:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t249TQvT048286; Wed, 4 Mar 2015 09:29:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503040929.t249TQvT048286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Mar 2015 09:29:26 +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: r279583 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:29:26 -0000 Author: kib Date: Wed Mar 4 09:29:25 2015 New Revision: 279583 URL: https://svnweb.freebsd.org/changeset/base/279583 Log: MFC r279282: When unlocking a contested PI pthread mutex, if the queue of waiters is empty, look up the umtx_pi and disown it if the current thread owns it. Modified: stable/10/sys/kern/kern_umtx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_umtx.c ============================================================================== --- stable/10/sys/kern/kern_umtx.c Wed Mar 4 09:17:03 2015 (r279582) +++ stable/10/sys/kern/kern_umtx.c Wed Mar 4 09:29:25 2015 (r279583) @@ -1810,6 +1810,19 @@ umtx_pi_setowner(struct umtx_pi *pi, str TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link); } + +/* + * Disown a PI mutex, and remove it from the owned list. + */ +static void +umtx_pi_disown(struct umtx_pi *pi) +{ + + mtx_assert(&umtx_lock, MA_OWNED); + TAILQ_REMOVE(&pi->pi_owner->td_umtxq->uq_pi_contested, pi, pi_link); + pi->pi_owner = NULL; +} + /* * Claim ownership of a PI mutex. */ @@ -2226,8 +2239,7 @@ do_unlock_pi(struct thread *td, struct u return (EPERM); } uq_me = curthread->td_umtxq; - pi->pi_owner = NULL; - TAILQ_REMOVE(&uq_me->uq_pi_contested, pi, pi_link); + umtx_pi_disown(pi); /* get highest priority thread which is still sleeping. */ uq_first = TAILQ_FIRST(&pi->pi_blocked); while (uq_first != NULL && @@ -2248,6 +2260,25 @@ do_unlock_pi(struct thread *td, struct u mtx_unlock_spin(&umtx_lock); if (uq_first) umtxq_signal_thread(uq_first); + } else { + pi = umtx_pi_lookup(&key); + /* + * A umtx_pi can exist if a signal or timeout removed the + * last waiter from the umtxq, but there is still + * a thread in do_lock_pi() holding the umtx_pi. + */ + if (pi != NULL) { + /* + * The umtx_pi can be unowned, such as when a thread + * has just entered do_lock_pi(), allocated the + * umtx_pi, and unlocked the umtxq. + * If the current thread owns it, it must disown it. + */ + mtx_lock_spin(&umtx_lock); + if (pi->pi_owner == td) + umtx_pi_disown(pi); + mtx_unlock_spin(&umtx_lock); + } } umtxq_unlock(&key); From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:30:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC4E8C05; Wed, 4 Mar 2015 09:30:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C67042F5; Wed, 4 Mar 2015 09:30:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t249U6iV048558; Wed, 4 Mar 2015 09:30:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t249U4Vs048533; Wed, 4 Mar 2015 09:30:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503040930.t249U4Vs048533@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Mar 2015 09:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279584 - in head/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:30:07 -0000 Author: hselasky Date: Wed Mar 4 09:30:03 2015 New Revision: 279584 URL: https://svnweb.freebsd.org/changeset/base/279584 Log: Updates for the Mellanox ethernet driver > List of fixes: * use correct format for GID printouts * double array indexing * spelling in printouts * void pointer arithmetic * allow more receive rings * correct maximum number of transmit rings * use "const" instead of "static" for constants * check for invalid VLAN tags * check for lack of IRQ resources > Added more hardware specific defines > Added more verbose printouts of firmware status codes Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/ofed/drivers/net/mlx4/cmd.c head/sys/ofed/drivers/net/mlx4/en_main.c head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/ofed/drivers/net/mlx4/main.c head/sys/ofed/drivers/net/mlx4/mcg.c head/sys/ofed/drivers/net/mlx4/mlx4_en.h head/sys/ofed/include/linux/mlx4/device.h head/sys/ofed/include/linux/mlx4/qp.h Modified: head/sys/ofed/drivers/net/mlx4/cmd.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/cmd.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/cmd.c Wed Mar 4 09:30:03 2015 (r279584) @@ -757,6 +757,19 @@ static int mlx4_cmd_wait(struct mlx4_dev "in_mod=0x%x, op_mod=0x%x, fw status = 0x%x\n", cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, op_modifier, context->fw_status); + + switch(context->fw_status) { + case CMD_STAT_BAD_PARAM: + mlx4_err(dev, "Parameter is not supported, " + "parameter is out of range\n"); + break; + case CMD_STAT_EXCEED_LIM: + mlx4_err(dev, "Required capability exceeded " + "device limits\n"); + break; + default: + break; + } goto out; } Modified: head/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_main.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/en_main.c Wed Mar 4 09:30:03 2015 (r279584) @@ -241,8 +241,8 @@ static void *mlx4_en_add(struct mlx4_dev DEF_RX_RINGS))); } else { mdev->profile.prof[i].rx_ring_num = rounddown_pow_of_two( - min_t(int, dev->caps.comp_pool/ - dev->caps.num_ports - 1 , MAX_MSIX_P_PORT - 1)); + min_t(int, dev->caps.comp_pool / + dev->caps.num_ports, MAX_MSIX_P_PORT)); } } Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Wed Mar 4 09:30:03 2015 (r279584) @@ -1305,7 +1305,7 @@ int mlx4_en_start_port(struct net_device cq = priv->tx_cq[i]; err = mlx4_en_activate_cq(priv, cq, i); if (err) { - en_err(priv, "Failed allocating Tx CQ\n"); + en_err(priv, "Failed activating Tx CQ\n"); goto tx_err; } err = mlx4_en_set_cq_moder(priv, cq); @@ -1323,7 +1323,7 @@ int mlx4_en_start_port(struct net_device err = mlx4_en_activate_tx_ring(priv, tx_ring, cq->mcq.cqn, i / priv->num_tx_rings_p_up); if (err) { - en_err(priv, "Failed allocating Tx ring\n"); + en_err(priv, "Failed activating Tx ring %d\n", i); mlx4_en_deactivate_cq(priv, cq); goto tx_err; } @@ -2189,6 +2189,7 @@ out: mlx4_en_destroy_netdev(dev); return err; } + static int mlx4_en_set_ring_size(struct net_device *dev, int rx_size, int tx_size) { @@ -2409,7 +2410,6 @@ static void mlx4_en_sysctl_conf(struct m "Enable adaptive rx coalescing"); } - static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) { struct net_device *dev; Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Wed Mar 4 09:30:03 2015 (r279584) @@ -500,7 +500,7 @@ static int mlx4_en_complete_rx_desc(stru goto fail; /* Unmap buffer */ - pci_unmap_single(mdev->pdev, dma, frag_info[nr].frag_size, + pci_unmap_single(mdev->pdev, dma, frag_info->frag_size, PCI_DMA_FROMDEVICE); } /* Adjust size of last fragment to match actual length */ Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Wed Mar 4 09:30:03 2015 (r279584) @@ -710,16 +710,16 @@ u16 mlx4_en_select_queue(struct net_devi { struct mlx4_en_priv *priv = netdev_priv(dev); u32 rings_p_up = priv->num_tx_rings_p_up; - u32 vlan_tag = 0; u32 up = 0; u32 queue_index; +#if (MLX4_EN_NUM_UP > 1) /* Obtain VLAN information if present */ if (mb->m_flags & M_VLANTAG) { - vlan_tag = mb->m_pkthdr.ether_vtag; - up = (vlan_tag >> 13); + u32 vlan_tag = mb->m_pkthdr.ether_vtag; + up = (vlan_tag >> 13) % MLX4_EN_NUM_UP; } - +#endif /* check if flowid is set */ if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE) queue_index = mb->m_pkthdr.flowid; Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/main.c Wed Mar 4 09:30:03 2015 (r279584) @@ -1303,8 +1303,9 @@ static ssize_t show_port_ib_mtu(struct d port_mtu_attr); struct mlx4_dev *mdev = info->dev; + /* When port type is eth, port mtu value isn't used. */ if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) - mlx4_warn(mdev, "port level mtu is only used for IB ports\n"); + return -EINVAL; sprintf(buf, "%d\n", ibta_mtu_to_int(mdev->caps.port_ib_mtu[info->port])); @@ -2899,6 +2900,12 @@ static void mlx4_enable_msi_x(struct mlx goto retry; } kfree(entries); + /* if error, or can't alloc even 1 IRQ */ + if (err < 0) { + mlx4_err(dev, "No IRQs left, device can't " + "be started.\n"); + goto no_irq; + } goto no_msi; } @@ -2926,6 +2933,10 @@ no_msi: for (i = 0; i < 2; ++i) priv->eq_table.eq[i].irq = dev->pdev->irq; + return; +no_irq: + dev->caps.num_comp_vectors = 0; + dev->caps.comp_pool = 0; } static int mlx4_init_port_info(struct mlx4_dev *dev, int port) @@ -3301,6 +3312,13 @@ slave_start: mutex_init(&priv->msix_ctl.pool_lock); mlx4_enable_msi_x(dev); + + /* no MSIX and no shared IRQ */ + if (!dev->caps.num_comp_vectors && !dev->caps.comp_pool) { + err = -ENOSPC; + goto err_free_eq; + } + if ((mlx4_is_mfunc(dev)) && !(dev->flags & MLX4_FLAG_MSI_X)) { err = -ENOSYS; Modified: head/sys/ofed/drivers/net/mlx4/mcg.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mcg.c Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/mcg.c Wed Mar 4 09:30:03 2015 (r279584) @@ -36,6 +36,7 @@ #include #include +#include #include "mlx4.h" @@ -690,8 +691,10 @@ static int find_entry(struct mlx4_dev *d if (err) return err; - if (0) - mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, hash); + if (0) { + mlx4_dbg(dev, "Hash for "GID_PRINT_FMT" is %04x\n", + GID_PRINT_ARGS(gid), hash); + } *index = hash; *prev = -1; @@ -912,10 +915,11 @@ static void mlx4_err_rule(struct mlx4_de case MLX4_NET_TRANS_RULE_ID_IB: len += snprintf(buf + len, BUF_SIZE - len, - "dst-gid = %pI6\n", cur->ib.dst_gid); + "dst-gid = "GID_PRINT_FMT"\n", + GID_PRINT_ARGS(cur->ib.dst_gid)); len += snprintf(buf + len, BUF_SIZE - len, - "dst-gid-mask = %pI6\n", - cur->ib.dst_gid_msk); + "dst-gid-mask = "GID_PRINT_FMT"\n", + GID_PRINT_ARGS(cur->ib.dst_gid_msk)); break; case MLX4_NET_TRANS_RULE_ID_IPV6: @@ -1135,7 +1139,8 @@ int mlx4_qp_detach_common(struct mlx4_de goto out; if (index == -1) { - mlx4_err(dev, "MGID %pI6 not found\n", gid); + mlx4_err(dev, "MGID "GID_PRINT_FMT" not found\n", + GID_PRINT_ARGS(gid)); err = -EINVAL; goto out; } Modified: head/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mlx4_en.h Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/drivers/net/mlx4/mlx4_en.h Wed Mar 4 09:30:03 2015 (r279584) @@ -154,7 +154,7 @@ enum { #define MLX4_EN_NUM_UP 1 #define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \ - (MLX4_EN_NUM_UP + 1)) + MLX4_EN_NUM_UP) #define MLX4_EN_DEF_TX_RING_SIZE 1024 #define MLX4_EN_DEF_RX_RING_SIZE 1024 @@ -358,11 +358,7 @@ struct mlx4_en_rx_ring { static inline int mlx4_en_can_lro(__be16 status) { - static __be16 status_all; - static __be16 status_ipv4_ipok_tcp; - static __be16 status_ipv6_ipok_tcp; - - status_all = cpu_to_be16( + const __be16 status_all = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPV4F | MLX4_CQE_STATUS_IPV6 | @@ -370,11 +366,11 @@ static inline int mlx4_en_can_lro(__be16 MLX4_CQE_STATUS_TCP | MLX4_CQE_STATUS_UDP | MLX4_CQE_STATUS_IPOK); - status_ipv4_ipok_tcp = cpu_to_be16( + const __be16 status_ipv4_ipok_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPOK | MLX4_CQE_STATUS_TCP); - status_ipv6_ipok_tcp = cpu_to_be16( + const __be16 status_ipv6_ipok_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | MLX4_CQE_STATUS_IPOK | MLX4_CQE_STATUS_TCP); @@ -384,7 +380,6 @@ static inline int mlx4_en_can_lro(__be16 status == status_ipv6_ipok_tcp); } - struct mlx4_en_cq { struct mlx4_cq mcq; struct mlx4_hwq_resources wqres; Modified: head/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- head/sys/ofed/include/linux/mlx4/device.h Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/include/linux/mlx4/device.h Wed Mar 4 09:30:03 2015 (r279584) @@ -186,8 +186,19 @@ enum { MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 10, MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 11, MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 12, - MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, - MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14 + MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, + MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14, + MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 15, + MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 16, + MLX4_DEV_CAP_FLAG2_FS_EN_NCSI = 1LL << 17, + MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, + MLX4_DEV_CAP_FLAG2_DMFS_TAG_MODE = 1LL << 19, + MLX4_DEV_CAP_FLAG2_ROCEV2 = 1LL << 20, + MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 21, + MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 22, + MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 23, + MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1LL << 24, + MLX4_DEV_CAP_FLAG2_RX_CSUM_MODE = 1LL << 25, }; /* bit enums for an 8-bit flags field indicating special use @@ -948,9 +959,9 @@ void mlx4_buf_free(struct mlx4_dev *dev, static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) { if (BITS_PER_LONG == 64 || buf->nbufs == 1) - return buf->direct.buf + offset; + return (u8 *)buf->direct.buf + offset; else - return buf->page_list[offset >> PAGE_SHIFT].buf + + return (u8 *)buf->page_list[offset >> PAGE_SHIFT].buf + (offset & (PAGE_SIZE - 1)); } Modified: head/sys/ofed/include/linux/mlx4/qp.h ============================================================================== --- head/sys/ofed/include/linux/mlx4/qp.h Wed Mar 4 09:29:25 2015 (r279583) +++ head/sys/ofed/include/linux/mlx4/qp.h Wed Mar 4 09:30:03 2015 (r279584) @@ -253,6 +253,8 @@ enum { MLX4_UPD_QP_PATH_MASK_SCHED_QUEUE = 14 + 32, MLX4_UPD_QP_PATH_MASK_IF_COUNTER_INDEX = 15 + 32, MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32, + MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_UC_LB = 18 + 32, + MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB = 19 + 32, }; enum { /* param3 */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:31:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70AFAD50; Wed, 4 Mar 2015 09:31:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD1C391; Wed, 4 Mar 2015 09:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t249VBnT048743; Wed, 4 Mar 2015 09:31:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t249VBHl048742; Wed, 4 Mar 2015 09:31:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503040931.t249VBHl048742@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Mar 2015 09:31: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: r279585 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:31:11 -0000 Author: kib Date: Wed Mar 4 09:31:10 2015 New Revision: 279585 URL: https://svnweb.freebsd.org/changeset/base/279585 Log: MFC r279283: When failing to claim ownership of a umtx_pi, restore the umutex owner to its previous, unowned state. Modified: stable/10/sys/kern/kern_umtx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_umtx.c ============================================================================== --- stable/10/sys/kern/kern_umtx.c Wed Mar 4 09:30:03 2015 (r279584) +++ stable/10/sys/kern/kern_umtx.c Wed Mar 4 09:31:10 2015 (r279585) @@ -2106,6 +2106,17 @@ do_lock_pi(struct thread *td, struct umu error = umtx_pi_claim(pi, td); umtxq_unbusy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + if (error != 0) { + /* + * Since we're going to return an + * error, restore the m_owner to its + * previous, unowned state to avoid + * compounding the problem. + */ + (void)casuword32(&m->m_owner, + id | UMUTEX_CONTESTED, + UMUTEX_CONTESTED); + } break; } From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:33:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E0EBF42; Wed, 4 Mar 2015 09:33:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 899105DF; Wed, 4 Mar 2015 09:33:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t249X0ra052438; Wed, 4 Mar 2015 09:33:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t249X0K3052437; Wed, 4 Mar 2015 09:33:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503040933.t249X0K3052437@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Mar 2015 09:33: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: r279586 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:33:00 -0000 Author: kib Date: Wed Mar 4 09:32:59 2015 New Revision: 279586 URL: https://svnweb.freebsd.org/changeset/base/279586 Log: MFC r279284: Propagate errors from _thr_umutex_unlock2 through mutex_unlock_common. Modified: stable/10/lib/libthr/thread/thr_mutex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_mutex.c ============================================================================== --- stable/10/lib/libthr/thread/thr_mutex.c Wed Mar 4 09:31:10 2015 (r279585) +++ stable/10/lib/libthr/thread/thr_mutex.c Wed Mar 4 09:32:59 2015 (r279586) @@ -633,7 +633,7 @@ mutex_unlock_common(struct pthread_mutex { struct pthread *curthread = _get_curthread(); uint32_t id; - int defered; + int defered, error; if (__predict_false(m <= THR_MUTEX_DESTROYED)) { if (m == THR_MUTEX_DESTROYED) @@ -647,6 +647,7 @@ mutex_unlock_common(struct pthread_mutex if (__predict_false(m->m_owner != curthread)) return (EPERM); + error = 0; id = TID(curthread); if (__predict_false( PMUTEX_TYPE(m->m_flags) == PTHREAD_MUTEX_RECURSIVE && @@ -660,7 +661,7 @@ mutex_unlock_common(struct pthread_mutex defered = 0; DEQUEUE_MUTEX(curthread, m); - _thr_umutex_unlock2(&m->m_lock, id, mtx_defer); + error = _thr_umutex_unlock2(&m->m_lock, id, mtx_defer); if (mtx_defer == NULL && defered) { _thr_wake_all(curthread->defer_waiters, @@ -670,7 +671,7 @@ mutex_unlock_common(struct pthread_mutex } if (!cv && m->m_flags & PMUTEX_FLAG_PRIVATE) THR_CRITICAL_LEAVE(curthread); - return (0); + return (error); } int From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 09:58:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C73A84F; Wed, 4 Mar 2015 09:58:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 879CB8B9; Wed, 4 Mar 2015 09:58:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t249we8S062703; Wed, 4 Mar 2015 09:58:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t249wepT062702; Wed, 4 Mar 2015 09:58:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503040958.t249wepT062702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Mar 2015 09:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279587 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 09:58:40 -0000 Author: hselasky Date: Wed Mar 4 09:58:39 2015 New Revision: 279587 URL: https://svnweb.freebsd.org/changeset/base/279587 Log: Define PTR_ALIGN() macro which will be needed coming Mellanox driver releases. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/ofed/include/linux/kernel.h Modified: head/sys/ofed/include/linux/kernel.h ============================================================================== --- head/sys/ofed/include/linux/kernel.h Wed Mar 4 09:32:59 2015 (r279586) +++ head/sys/ofed/include/linux/kernel.h Wed Mar 4 09:58:39 2015 (r279587) @@ -67,6 +67,8 @@ #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) +#undef PTR_ALIGN +#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define DIV_ROUND_UP howmany #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 11:20:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4F0DF3A; Wed, 4 Mar 2015 11:20:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8651F0; Wed, 4 Mar 2015 11:20:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24BK3FT000718; Wed, 4 Mar 2015 11:20:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24BK2SG000709; Wed, 4 Mar 2015 11:20:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503041120.t24BK2SG000709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 4 Mar 2015 11:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279588 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 11:20:03 -0000 Author: ae Date: Wed Mar 4 11:20:01 2015 New Revision: 279588 URL: https://svnweb.freebsd.org/changeset/base/279588 Log: Fix deadlock in IPv6 PCB code. When several threads are trying to send datagram to the same destination, but fragmentation is disabled and datagram size exceeds link MTU, ip6_output() calls pfctlinput2(PRC_MSGSIZE). It does notify all sockets wanted to know MTU to this destination. And since all threads hold PCB lock while sending, taking the lock for each PCB in the in6_pcbnotify() leads to deadlock. RFC 3542 p.11.3 suggests notify all application wanted to receive IPV6_PATHMTU ancillary data for each ICMPv6 packet too big message. But it doesn't require this, when we don't receive ICMPv6 message. Change ip6_notify_pmtu() function to be able use it directly from ip6_output() to notify only one socket, and to notify all sockets when ICMPv6 packet too big message received. PR: 197059 Differential Revision: https://reviews.freebsd.org/D1949 Reviewed by: no objection from #network Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Wed Mar 4 09:58:39 2015 (r279587) +++ head/sys/netinet6/in6_pcb.c Wed Mar 4 11:20:01 2015 (r279588) @@ -642,18 +642,12 @@ in6_pcbnotify(struct inpcbinfo *pcbinfo, /* * If the error designates a new path MTU for a destination * and the application (associated with this socket) wanted to - * know the value, notify. Note that we notify for all - * disconnected sockets if the corresponding application - * wanted. This is because some UDP applications keep sending - * sockets disconnected. + * know the value, notify. * XXX: should we avoid to notify the value to TCP sockets? */ - if (cmd == PRC_MSGSIZE && (inp->inp_flags & IN6P_MTU) != 0 && - (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) || - IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, &sa6_dst->sin6_addr))) { + if (cmd == PRC_MSGSIZE) ip6_notify_pmtu(inp, (struct sockaddr_in6 *)dst, - (u_int32_t *)cmdarg); - } + *(u_int32_t *)cmdarg); /* * Detect if we should notify the error. If no source and Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Wed Mar 4 09:58:39 2015 (r279587) +++ head/sys/netinet6/ip6_input.c Wed Mar 4 11:20:01 2015 (r279588) @@ -1343,24 +1343,28 @@ ip6_savecontrol(struct inpcb *in6p, stru #undef IS2292 void -ip6_notify_pmtu(struct inpcb *in6p, struct sockaddr_in6 *dst, u_int32_t *mtu) +ip6_notify_pmtu(struct inpcb *inp, struct sockaddr_in6 *dst, u_int32_t mtu) { struct socket *so; struct mbuf *m_mtu; struct ip6_mtuinfo mtuctl; - so = in6p->inp_socket; - - if (mtu == NULL) + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + /* + * Notify the error by sending IPV6_PATHMTU ancillary data if + * application wanted to know the MTU value. + * NOTE: we notify disconnected sockets, because some udp + * applications keep sending sockets disconnected. + * NOTE: our implementation doesn't notify connected sockets that has + * foreign address that is different than given destination addresses + * (this is permitted by RFC 3542). + */ + if ((inp->inp_flags & IN6P_MTU) == 0 || ( + !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) && + !IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, &dst->sin6_addr))) return; -#ifdef DIAGNOSTIC - if (so == NULL) /* I believe this is impossible */ - panic("ip6_notify_pmtu: socket is NULL"); -#endif - - bzero(&mtuctl, sizeof(mtuctl)); /* zero-clear for safety */ - mtuctl.ip6m_mtu = *mtu; + mtuctl.ip6m_mtu = mtu; mtuctl.ip6m_addr = *dst; if (sa6_recoverscope(&mtuctl.ip6m_addr)) return; @@ -1369,14 +1373,13 @@ ip6_notify_pmtu(struct inpcb *in6p, stru IPV6_PATHMTU, IPPROTO_IPV6)) == NULL) return; + so = inp->inp_socket; if (sbappendaddr(&so->so_rcv, (struct sockaddr *)dst, NULL, m_mtu) == 0) { m_freem(m_mtu); /* XXX: should count statistics */ } else sorwakeup(so); - - return; } #ifdef PULLDOWN_TEST Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Mar 4 09:58:39 2015 (r279587) +++ head/sys/netinet6/ip6_output.c Wed Mar 4 11:20:01 2015 (r279588) @@ -910,19 +910,12 @@ passout: * Even if the DONTFRAG option is specified, we cannot send the * packet when the data length is larger than the MTU of the * outgoing interface. - * Notify the error by sending IPV6_PATHMTU ancillary data as - * well as returning an error code (the latter is not described - * in the API spec.) + * Notify the error by sending IPV6_PATHMTU ancillary data if + * application wanted to know the MTU value. Also return an + * error code (this is not described in the API spec). */ - u_int32_t mtu32; - struct ip6ctlparam ip6cp; - - mtu32 = (u_int32_t)mtu; - bzero(&ip6cp, sizeof(ip6cp)); - ip6cp.ip6c_cmdarg = (void *)&mtu32; - pfctlinput2(PRC_MSGSIZE, (struct sockaddr *)&ro_pmtu->ro_dst, - (void *)&ip6cp); - + if (inp != NULL) + ip6_notify_pmtu(inp, &dst_sa, (u_int32_t)mtu); error = EMSGSIZE; goto bad; } Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Wed Mar 4 09:58:39 2015 (r279587) +++ head/sys/netinet6/ip6_var.h Wed Mar 4 11:20:01 2015 (r279588) @@ -368,8 +368,7 @@ int ip6_process_hopopts(struct mbuf *, u struct mbuf **ip6_savecontrol_v4(struct inpcb *, struct mbuf *, struct mbuf **, int *); void ip6_savecontrol(struct inpcb *, struct mbuf *, struct mbuf **); -void ip6_notify_pmtu(struct inpcb *, struct sockaddr_in6 *, - u_int32_t *); +void ip6_notify_pmtu(struct inpcb *, struct sockaddr_in6 *, u_int32_t); int ip6_sysctl(int *, u_int, void *, size_t *, void *, size_t); void ip6_forward(struct mbuf *, int); From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 12:12:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A4C0EF; Wed, 4 Mar 2015 12:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45A19A49; Wed, 4 Mar 2015 12:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24CClYW028315; Wed, 4 Mar 2015 12:12:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24CClL4028314; Wed, 4 Mar 2015 12:12:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503041212.t24CClL4028314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 4 Mar 2015 12:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279589 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 12:12:47 -0000 Author: mav Date: Wed Mar 4 12:12:46 2015 New Revision: 279589 URL: https://svnweb.freebsd.org/changeset/base/279589 Log: Fix handling of queued text and logout requests. While it may have little sense, text and logout requests can be queued. If they are, they consume cmdsn, so we should increment our conn_cmdsn. MFC after: 1 week Modified: head/usr.sbin/ctld/discovery.c Modified: head/usr.sbin/ctld/discovery.c ============================================================================== --- head/usr.sbin/ctld/discovery.c Wed Mar 4 11:20:01 2015 (r279588) +++ head/usr.sbin/ctld/discovery.c Wed Mar 4 12:12:46 2015 (r279589) @@ -75,6 +75,8 @@ text_receive(struct connection *conn) conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhstr->bhstr_cmdsn); + if ((bhstr->bhstr_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) + conn->conn_cmdsn++; return (request); } @@ -131,6 +133,8 @@ logout_receive(struct connection *conn) conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhslr->bhslr_cmdsn); + if ((bhslr->bhslr_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) + conn->conn_cmdsn++; return (request); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 14:12:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2F647A3; Wed, 4 Mar 2015 14:12:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE12F99A; Wed, 4 Mar 2015 14:12:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24ECdJY084263; Wed, 4 Mar 2015 14:12:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24ECdPD084262; Wed, 4 Mar 2015 14:12:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503041412.t24ECdPD084262@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 4 Mar 2015 14:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279590 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 14:12:39 -0000 Author: mav Date: Wed Mar 4 14:12:38 2015 New Revision: 279590 URL: https://svnweb.freebsd.org/changeset/base/279590 Log: If target name starts with "naa.", set it as WWNN for CTL port. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Wed Mar 4 12:12:46 2015 (r279589) +++ head/usr.sbin/ctld/kernel.c Wed Mar 4 14:12:38 2015 (r279590) @@ -935,9 +935,21 @@ kernel_port_add(struct port *port) req.status); return (1); } - } else if (port->p_pport) + } else if (port->p_pport) { port->p_ctl_port = port->p_pport->pp_ctl_port; + if (strncmp(targ->t_name, "naa.", 4) == 0 && + strlen(targ->t_name) == 20) { + bzero(&entry, sizeof(entry)); + entry.port_type = CTL_PORT_NONE; + entry.targ_port = port->p_ctl_port; + entry.flags |= CTL_PORT_WWNN_VALID; + entry.wwnn = strtoull(targ->t_name + 4, NULL, 16); + if (ioctl(ctl_fd, CTL_SET_PORT_WWNS, &entry) == -1) + log_warn("CTL_SET_PORT_WWNS ioctl failed"); + } + } + /* Explicitly enable mapping to block any access except allowed. */ lm.port = port->p_ctl_port; lm.plun = UINT32_MAX; From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 14:30:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0634AD70; Wed, 4 Mar 2015 14:30:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A8DB67; Wed, 4 Mar 2015 14:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24EU9HX090627; Wed, 4 Mar 2015 14:30:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24EU90L090626; Wed, 4 Mar 2015 14:30:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503041430.t24EU90L090626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 4 Mar 2015 14:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279591 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 14:30:10 -0000 Author: mav Date: Wed Mar 4 14:30:09 2015 New Revision: 279591 URL: https://svnweb.freebsd.org/changeset/base/279591 Log: Add example configuration for FibreChannel ports. MFC after: 1 week Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Wed Mar 4 14:12:38 2015 (r279590) +++ head/usr.sbin/ctld/ctl.conf.5 Wed Mar 4 14:30:09 2015 (r279591) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2015 +.Dd March 4, 2015 .Dt CTL.CONF 5 .Os .Sh NAME @@ -413,14 +413,10 @@ target iqn.2012-06.com.example:target0 { lun example_1 { path /dev/zvol/tank/example_1 + option naa 0x50015178f369f093 } target iqn.2012-06.com.example:target1 { - chap chapuser chapsecret - lun 0 example_1 -} - -target iqn.2012-06.com.example:target2 { auth-group ag0 portal-group pg0 lun 0 example_1 @@ -429,6 +425,12 @@ target iqn.2012-06.com.example:target2 { option foo bar } } + +target naa.50015178f369f092 { + port isp0 + port isp1 + lun 0 example_1 +} .Ed .Sh SEE ALSO .Xr ctl 4 , From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 14:59:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FDCB605; Wed, 4 Mar 2015 14:59:28 +0000 (UTC) Received: from aslan.scsiguy.com (aslan.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37857EB9; Wed, 4 Mar 2015 14:59:27 +0000 (UTC) Received: from [192.168.0.61] (jt-mbp.home.scsiguy.org [192.168.0.61]) (authenticated bits=0) by aslan.scsiguy.com (8.14.9/8.14.9) with ESMTP id t24ExQOf054620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Mar 2015 07:59:26 -0700 (MST) (envelope-from gibbs@scsiguy.com) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279571 - head/usr.sbin/freebsd-update From: "Justin T. Gibbs" In-Reply-To: <201503032320.t23NKJjC059788@svn.freebsd.org> Date: Wed, 4 Mar 2015 07:59:25 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <7DB9A593-74D4-4513-9BF7-8DB76A7DB684@scsiguy.com> References: <201503032320.t23NKJjC059788@svn.freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 14:59:28 -0000 On Mar 3, 2015, at 4:20 PM, Allan Jude wrote: >=20 > Author: allanjude (doc committer) > Date: Tue Mar 3 23:20:18 2015 > New Revision: 279571 > URL: https://svnweb.freebsd.org/changeset/base/279571 >=20 > Log: > Add a new safetly belt to freebsd-update to prevent a user doing a = minor update (-pX) while having an unfinished major upgrade (9.x to 9.y) > Safetly belt can be disabled with the -F flag >=20 > Additionally, add the --not-running-from-cron flag they bypasses the = TTY requirement, and allows freebsd-update to be invoked by = orchestration frameworks, scripts, or otherwise. Would "=E2=80=94non-interactive" be a better name for this option? Or = maybe there is a standard option name used by other utilities to disable = the TTY check? =E2=80=94 Justin From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 15:00:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE656746; Wed, 4 Mar 2015 15:00:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF356EC4; Wed, 4 Mar 2015 15:00:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24F0Llu005097; Wed, 4 Mar 2015 15:00:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24F0LGu005096; Wed, 4 Mar 2015 15:00:21 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503041500.t24F0LGu005096@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 4 Mar 2015 15:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279592 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 15:00:22 -0000 Author: glebius Date: Wed Mar 4 15:00:20 2015 New Revision: 279592 URL: https://svnweb.freebsd.org/changeset/base/279592 Log: Optimize SIOCGIFMEDIA handling removing malloc(9) and double traversal of the list. Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/net/if_media.c Modified: head/sys/net/if_media.c ============================================================================== --- head/sys/net/if_media.c Wed Mar 4 14:30:09 2015 (r279591) +++ head/sys/net/if_media.c Wed Mar 4 15:00:20 2015 (r279592) @@ -204,7 +204,7 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) { struct ifmedia_entry *match; struct ifmediareq *ifmr = (struct ifmediareq *) ifr; - int error = 0, sticky; + int error = 0; if (ifp == NULL || ifr == NULL || ifm == NULL) return(EINVAL); @@ -273,10 +273,10 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) case SIOCGIFMEDIA: { struct ifmedia_entry *ep; - int *kptr, count; - int usermax; /* user requested max */ + int i; - kptr = NULL; /* XXX gcc */ + if (ifmr->ifm_count < 0) + return (EINVAL); ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ? ifm->ifm_cur->ifm_media : IFM_NONE; @@ -284,67 +284,23 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) ifmr->ifm_status = 0; (*ifm->ifm_status)(ifp, ifmr); - count = 0; - usermax = 0; - /* * If there are more interfaces on the list, count * them. This allows the caller to set ifmr->ifm_count * to 0 on the first call to know how much space to * allocate. */ + i = 0; LIST_FOREACH(ep, &ifm->ifm_list, ifm_list) - usermax++; - - /* - * Don't allow the user to ask for too many - * or a negative number. - */ - if (ifmr->ifm_count > usermax) - ifmr->ifm_count = usermax; - else if (ifmr->ifm_count < 0) - return (EINVAL); - - if (ifmr->ifm_count != 0) { - kptr = (int *)malloc(ifmr->ifm_count * sizeof(int), - M_TEMP, M_NOWAIT); - - if (kptr == NULL) - return (ENOMEM); - /* - * Get the media words from the interface's list. - */ - ep = LIST_FIRST(&ifm->ifm_list); - for (; ep != NULL && count < ifmr->ifm_count; - ep = LIST_NEXT(ep, ifm_list), count++) - kptr[count] = ep->ifm_media; - - if (ep != NULL) - error = E2BIG; /* oops! */ - } else { - count = usermax; - } - - /* - * We do the copyout on E2BIG, because that's - * just our way of telling userland that there - * are more. This is the behavior I've observed - * under BSD/OS 3.0 - */ - sticky = error; - if ((error == 0 || error == E2BIG) && ifmr->ifm_count != 0) { - error = copyout((caddr_t)kptr, - (caddr_t)ifmr->ifm_ulist, - ifmr->ifm_count * sizeof(int)); - } - - if (error == 0) - error = sticky; - - if (ifmr->ifm_count != 0) - free(kptr, M_TEMP); - - ifmr->ifm_count = count; + if (i++ < ifmr->ifm_count) { + error = copyout(&ep->ifm_media, + ifmr->ifm_ulist + i - 1, sizeof(int)); + if (error) + break; + } + if (error == 0 && i > ifmr->ifm_count) + error = ifmr->ifm_count ? E2BIG : 0; + ifmr->ifm_count = i; break; } From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:01:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E5286D3; Wed, 4 Mar 2015 16:01:21 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FB178DE; Wed, 4 Mar 2015 16:01:20 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8BAE425D37C7; Wed, 4 Mar 2015 16:01:10 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D0805C77111; Wed, 4 Mar 2015 16:01:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Mi6YKlpJDZ2j; Wed, 4 Mar 2015 16:01:08 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 31568C77045; Wed, 4 Mar 2015 16:01:08 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279551 - in head/sys: arm/conf modules/dtb/imx6 From: "Bjoern A. Zeeb" In-Reply-To: <201503022212.t22MCvp0036492@svn.freebsd.org> Date: Wed, 4 Mar 2015 16:01:06 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5357A8D1-559C-4D3D-BA6E-4A3181306435@FreeBSD.org> References: <201503022212.t22MCvp0036492@svn.freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:01:21 -0000 > On 02 Mar 2015, at 22:12 , Ian Lepore wrote: >=20 > Author: ian > Date: Mon Mar 2 22:12:56 2015 > New Revision: 279551 > URL: https://svnweb.freebsd.org/changeset/base/279551 >=20 > Log: > Add a "module" to build the dtb files for all supported imx6 systems. >=20 > Added: > head/sys/modules/dtb/imx6/ > head/sys/modules/dtb/imx6/Makefile (contents, props changed) > Modified: > head/sys/arm/conf/IMX6 >=20 > Modified: head/sys/arm/conf/IMX6 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/arm/conf/IMX6 Mon Mar 2 22:03:13 2015 = (r279550) > +++ head/sys/arm/conf/IMX6 Mon Mar 2 22:12:56 2015 = (r279551) > @@ -153,6 +153,7 @@ device u3g # USB = modems >=20 > # Flattened Device Tree > options FDT # Configure using FDT/DTB data > +makeoptions MODULES_EXTRA=3Ddtb/imx6 >=20 > # SoC-specific devices > device ffec # Freescale Fast = Ethernet Controller >=20 > Added: head/sys/modules/dtb/imx6/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/modules/dtb/imx6/Makefile Mon Mar 2 22:12:56 2015 = (r279551) > @@ -0,0 +1,12 @@ > +# $FreeBSD$ > +# All the dts files for imx6 systems we support. > +DTS=3D \ > + imx6dl-cubox-i.dts \ > + imx6q-cubox-i.dts \ > + imx6dl-hummingboard.dts \ > + imx6q-hummingboard.dts \ > + imx6q-wandboard.dts \ > + imx6dl-wandboard.dts \ > + imx6s-wandboard.dts > + There is no imx6s-wandboard.dts in the tree it seems and thus IMX6 = kernel builds are failing. =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:14:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1330A6B; Wed, 4 Mar 2015 16:14:39 +0000 (UTC) Received: from mx1.scaleengine.net (beauharnois2.bhs1.scaleengine.net [142.4.218.15]) by mx1.freebsd.org (Postfix) with ESMTP id E3F67A10; Wed, 4 Mar 2015 16:14:38 +0000 (UTC) Received: from [192.168.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 640729ADE9; Wed, 4 Mar 2015 16:14:37 +0000 (UTC) Message-ID: <54F72F7B.9000708@freebsd.org> Date: Wed, 04 Mar 2015 11:14:51 -0500 From: Allan Jude User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "Justin T. Gibbs" Subject: Re: svn commit: r279571 - head/usr.sbin/freebsd-update References: <201503032320.t23NKJjC059788@svn.freebsd.org> <7DB9A593-74D4-4513-9BF7-8DB76A7DB684@scsiguy.com> In-Reply-To: <7DB9A593-74D4-4513-9BF7-8DB76A7DB684@scsiguy.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3od7OGUNhJk70Cb4dK7rDsho5FUkS4uHr" Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:14:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3od7OGUNhJk70Cb4dK7rDsho5FUkS4uHr Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015-03-04 09:59, Justin T. Gibbs wrote: > On Mar 3, 2015, at 4:20 PM, Allan Jude wrote: >> >> Author: allanjude (doc committer) >> Date: Tue Mar 3 23:20:18 2015 >> New Revision: 279571 >> URL: https://svnweb.freebsd.org/changeset/base/279571 >> >> Log: >> Add a new safetly belt to freebsd-update to prevent a user doing a mi= nor update (-pX) while having an unfinished major upgrade (9.x to 9.y) >> Safetly belt can be disabled with the -F flag >> >> Additionally, add the --not-running-from-cron flag they bypasses the = TTY requirement, and allows freebsd-update to be invoked by orchestration= frameworks, scripts, or otherwise. >=20 > Would "=E2=80=94non-interactive" be a better name for this option? Or = maybe there is a standard option name used by other utilities to disable = the TTY check? >=20 > =E2=80=94 > Justin >=20 I had originally had it as part of the -F (force) flag, but Colin Percival asked for that name specifically. --=20 Allan Jude --3od7OGUNhJk70Cb4dK7rDsho5FUkS4uHr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJU9y9+AAoJEJrBFpNRJZKfV+oP/RMDVWA5pBVLFFvEKvHbXN0M 6arcZdPAF34D1RRCXNFvFULM6J++VOA/fkHyiHvC844cqyF0lSV/9jGBaX0F2sft OjOw3dhXn4OzH0nk7qDZfVG01Vjr6uMe2NTkufobvDUdAEY9x1FIpnRx034/6YOs JsYwVt01T7EdMNKaszdzMPpgdWB9Tz9SYp1dy2UTdgb6JoqFzhlnbwp72MO6xJdp TXpVm265vweMn723NSP5GZTp/6A0vi6xJ6qfcc1DfyXehaWC1d2lYwJT2BLndk25 c5tnG0fEBmkhZSOtW0j1MfX3VrrDQ5I6repV+wV72UoWZlAiB8oAqDmmYNsIqGr/ hB/u1w7+qi22u/YVQw84Iq1TtQpn3qoLy7UWIHRALEX6+2zSuwB35DHemNtl/jqx uoyeImYl2REcYWgfJasuK+cq13dfuJ/fe1IXQy/pfYoqTA+JWf2O5470M+R99JiA pRVejVYKTKcWbBIGQxbXVWe66/UUaQ4cQVaZrc/l0v3CBePvvsxB3Zq1h0KdFsp5 Oaw7VZPs6D+hdc3ueGr51VMFSsW6A5Y90qmoFjZwfXHAX0MRBEQf+sVT5AgPcNeN 2ZDUTpLyZj9lEhgJCAJJMiqx7fXwyQAhLKJtpeOtnxrWTze6PrAEQsd2kxHgstSX ysXy490aYhQu9vBA2HEd =TfgE -----END PGP SIGNATURE----- --3od7OGUNhJk70Cb4dK7rDsho5FUkS4uHr-- From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:19:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0599FC57; Wed, 4 Mar 2015 16:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5B29A7F; Wed, 4 Mar 2015 16:19:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24GJZjt042593; Wed, 4 Mar 2015 16:19:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24GJZT3042592; Wed, 4 Mar 2015 16:19:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503041619.t24GJZT3042592@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 4 Mar 2015 16:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279593 - head/sys/modules/dtb/imx6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:19:36 -0000 Author: ian Date: Wed Mar 4 16:19:34 2015 New Revision: 279593 URL: https://svnweb.freebsd.org/changeset/base/279593 Log: Remove imx6s-wandboard.dts, there is no such file. Also imx6q-wandboard to follow imx6dl-wandboard (so that the entries are sorted by board name first, then by soc type). Modified: head/sys/modules/dtb/imx6/Makefile Modified: head/sys/modules/dtb/imx6/Makefile ============================================================================== --- head/sys/modules/dtb/imx6/Makefile Wed Mar 4 15:00:20 2015 (r279592) +++ head/sys/modules/dtb/imx6/Makefile Wed Mar 4 16:19:34 2015 (r279593) @@ -5,8 +5,7 @@ DTS= \ imx6q-cubox-i.dts \ imx6dl-hummingboard.dts \ imx6q-hummingboard.dts \ - imx6q-wandboard.dts \ imx6dl-wandboard.dts \ - imx6s-wandboard.dts + imx6q-wandboard.dts .include From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:20:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64209DDB; Wed, 4 Mar 2015 16:20:07 +0000 (UTC) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9B5DA8E; Wed, 4 Mar 2015 16:20:06 +0000 (UTC) Received: by labgm9 with SMTP id gm9so5958267lab.8; Wed, 04 Mar 2015 08:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=6Zh/7cgtPjezL5E018gaY59nIRt9Rnc6dCgLrLzBJJk=; b=ziL3uBxzaw6/j8gkylDvEeO+xXWmn2JCPft4ePa6dxLTqRGyviTFAqzsome+rY7rQi 0DHRRq2SpxwXJlf0+hKCo0CUG9tTVtpA/cU6rz0ySrWGRA1ZdiV2R+qMU7MD+91cvC+2 MM2H7iDwesuyhiC7uIV+KiuyrhlxtxpiD6Jk0cqn/o4MFB/6jCZFdoCxxD8ZqhFdmEwX C4fS9mZu+rC6GPfwxehjDrDqy/PTHvsa7wSNai6N7ufJaS9vq8OEBmNLUhqVwhe0cfkt oTrsavETN0MN5kOk5P3TgxARH9OTHhYn/IRUSG5K0vFVgG4itM4tCl3nmMu3r4EAHIQT 8sRA== MIME-Version: 1.0 X-Received: by 10.112.204.197 with SMTP id la5mr4090394lbc.29.1425486004878; Wed, 04 Mar 2015 08:20:04 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.82.164 with HTTP; Wed, 4 Mar 2015 08:20:03 -0800 (PST) Received: by 10.112.82.164 with HTTP; Wed, 4 Mar 2015 08:20:03 -0800 (PST) In-Reply-To: <7DB9A593-74D4-4513-9BF7-8DB76A7DB684@scsiguy.com> References: <201503032320.t23NKJjC059788@svn.freebsd.org> <7DB9A593-74D4-4513-9BF7-8DB76A7DB684@scsiguy.com> Date: Wed, 4 Mar 2015 08:20:03 -0800 X-Google-Sender-Auth: bRFMFcqEAiLFLlEJu1FNxBQOoLE Message-ID: Subject: Re: svn commit: r279571 - head/usr.sbin/freebsd-update From: Craig Rodrigues To: "Justin T. Gibbs" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Allan Jude X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:20:07 -0000 On Mar 4, 2015 6:59 AM, "Justin T. Gibbs" wrote: > > Would "--non-interactive" be a better name for this option? Or maybe there is a standard option name used by other utilities to disable the TTY check? cperciva@ had a few reasons for recommending the flag name: https://reviews.freebsd.org/D1550#15 so Allan implemented this. -- Craig From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:45:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7695BE70; Wed, 4 Mar 2015 16:45:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60E18EA5; Wed, 4 Mar 2015 16:45:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24GjWWX056458; Wed, 4 Mar 2015 16:45:32 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24GjVOv056452; Wed, 4 Mar 2015 16:45:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503041645.t24GjVOv056452@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 4 Mar 2015 16:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279594 - in head/sys/powerpc: aim booke powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:45:33 -0000 Author: nwhitehorn Date: Wed Mar 4 16:45:31 2015 New Revision: 279594 URL: https://svnweb.freebsd.org/changeset/base/279594 Log: Move Book-E/AIM dependent bits for setting user PMAP during thread switch out of cpu_switch() and into pmap_activate() where they belong. This also removes all the #ifdef from cpu_switch(). Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/swtch32.S head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed Mar 4 16:19:34 2015 (r279593) +++ head/sys/powerpc/aim/mmu_oea.c Wed Mar 4 16:45:31 2015 (r279594) @@ -986,6 +986,8 @@ moea_activate(mmu_t mmu, struct thread * CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(curpmap, pmr); + + mtsrin(USER_SR << ADDR_SR_SHFT, td->td_pcb->pcb_cpu.aim.usr_vsid); } void Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Mar 4 16:19:34 2015 (r279593) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Mar 4 16:45:31 2015 (r279594) @@ -991,8 +991,11 @@ moea64_activate(mmu_t mmu, struct thread #ifdef __powerpc64__ PCPU_SET(userslb, pm->pm_slb); + __asm __volatile("slbmte %0, %1; isync" :: + "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE)); #else PCPU_SET(curpmap, pm->pmap_phys); + mtsrin(USER_SR << ADDR_SR_SHFT, td->td_pcb->pcb_cpu.aim.usr_vsid); #endif } @@ -1001,6 +1004,8 @@ moea64_deactivate(mmu_t mmu, struct thre { pmap_t pm; + __asm __volatile("isync; slbie %0" :: "r"(USER_ADDR)); + pm = &td->td_proc->p_vmspace->vm_pmap; CPU_CLR(PCPU_GET(cpuid), &pm->pm_active); #ifdef __powerpc64__ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Mar 4 16:19:34 2015 (r279593) +++ head/sys/powerpc/booke/pmap.c Wed Mar 4 16:45:31 2015 (r279594) @@ -1946,6 +1946,8 @@ mmu_booke_activate(mmu_t mmu, struct thr mtspr(SPR_PID0, pmap->pm_tid[cpuid]); __asm __volatile("isync"); + mtspr(SPR_DBCR0, td->td_pcb->pcb_cpu.booke.dbcr0); + sched_unpin(); CTR3(KTR_PMAP, "%s: e (tid = %d for '%s')", __func__, @@ -1965,6 +1967,8 @@ mmu_booke_deactivate(mmu_t mmu, struct t CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%08x", __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); + td->td_pcb->pcb_cpu.booke.dbcr0 = mfspr(SPR_DBCR0); + CPU_CLR_ATOMIC(PCPU_GET(cpuid), &pmap->pm_active); PCPU_SET(curpmap, NULL); } Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Wed Mar 4 16:19:34 2015 (r279593) +++ head/sys/powerpc/powerpc/swtch32.S Wed Mar 4 16:45:31 2015 (r279594) @@ -91,10 +91,6 @@ ENTRY(cpu_switch) stw %r16,PCB_CR(%r6) mflr %r16 /* Save the link register */ stw %r16,PCB_LR(%r6) -#ifdef BOOKE - mfspr %r16,SPR_DBCR0 - stw %r16,PCB_BOOKE_DBCR0(%r6) -#endif stw %r1,PCB_SP(%r6) /* Save the stack pointer */ mr %r14,%r3 /* Copy the old thread ptr... */ @@ -173,16 +169,6 @@ blocked_loop: mtcr %r5 lwz %r5,PCB_LR(%r3) /* Load the link register */ mtlr %r5 -#ifdef AIM - lwz %r5,PCB_AIM_USR_VSID(%r3) /* Load the USER_SR segment reg */ - isync - mtsr USER_SR,%r5 - isync -#endif -#ifdef BOOKE - lwz %r5,PCB_BOOKE_DBCR0(%r3) - mtspr SPR_DBCR0,%r5 -#endif lwz %r1,PCB_SP(%r3) /* Load the stack pointer */ /* * Perform a dummy stwcx. to clear any reservations we may have Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Wed Mar 4 16:19:34 2015 (r279593) +++ head/sys/powerpc/powerpc/swtch64.S Wed Mar 4 16:45:31 2015 (r279594) @@ -218,21 +218,6 @@ blocked_loop: ld %r1,PCB_SP(%r3) /* Load the stack pointer */ ld %r2,PCB_TOC(%r3) /* Load the TOC pointer */ - lis %r5,USER_ADDR@highesta /* Load the copyin/out segment reg */ - ori %r5,%r5,USER_ADDR@highera - sldi %r5,%r5,32 - oris %r5,%r5,USER_ADDR@ha - isync - slbie %r5 - lis %r6,USER_SLB_SLBE@highesta - ori %r6,%r6,USER_SLB_SLBE@highera - sldi %r6,%r6,32 - oris %r6,%r6,USER_SLB_SLBE@ha - ori %r6,%r6,USER_SLB_SLBE@l - ld %r5,PCB_AIM_USR_VSID(%r3) - slbmte %r5,%r6 - isync - /* * Perform a dummy stdcx. to clear any reservations we may have * inherited from the previous thread. It doesn't matter if the From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:50:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F8DA2FC; Wed, 4 Mar 2015 16:50:41 +0000 (UTC) Received: from aslan.scsiguy.com (aslan.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28CCFF95; Wed, 4 Mar 2015 16:50:40 +0000 (UTC) Received: from [192.168.0.61] (jt-mbp.home.scsiguy.org [192.168.0.61]) (authenticated bits=0) by aslan.scsiguy.com (8.14.9/8.14.9) with ESMTP id t24Goc8Q056647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Mar 2015 09:50:39 -0700 (MST) (envelope-from gibbs@scsiguy.com) Subject: Re: svn commit: r279571 - head/usr.sbin/freebsd-update Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_8EEB5A97-3693-4687-B06D-8B6266625AC3"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b5 From: "Justin T. Gibbs" In-Reply-To: <54F72F7B.9000708@freebsd.org> Date: Wed, 4 Mar 2015 09:50:38 -0700 Message-Id: <92149782-299E-4DCC-B7A7-82C6D66E95AD@scsiguy.com> References: <201503032320.t23NKJjC059788@svn.freebsd.org> <7DB9A593-74D4-4513-9BF7-8DB76A7DB684@scsiguy.com> <54F72F7B.9000708@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:50:41 -0000 --Apple-Mail=_8EEB5A97-3693-4687-B06D-8B6266625AC3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Mar 4, 2015, at 9:14 AM, Allan Jude wrote: >=20 > On 2015-03-04 09:59, Justin T. Gibbs wrote: >> On Mar 3, 2015, at 4:20 PM, Allan Jude wrote: >>>=20 >>> Author: allanjude (doc committer) >>> Date: Tue Mar 3 23:20:18 2015 >>> New Revision: 279571 >>> URL: https://svnweb.freebsd.org/changeset/base/279571 >>>=20 >>> Log: >>> Add a new safetly belt to freebsd-update to prevent a user doing a = minor update (-pX) while having an unfinished major upgrade (9.x to 9.y) >>> Safetly belt can be disabled with the -F flag >>>=20 >>> Additionally, add the --not-running-from-cron flag they bypasses the = TTY requirement, and allows freebsd-update to be invoked by = orchestration frameworks, scripts, or otherwise. >>=20 >> Would "=E2=80=94non-interactive" be a better name for this option? = Or maybe there is a standard option name used by other utilities to = disable the TTY check? >>=20 >> =E2=80=94 >> Justin >>=20 >=20 > I had originally had it as part of the -F (force) flag, but Colin > Percival asked for that name specifically. It just seems like a poor choice for the flag name since it implies = you=E2=80=99d want to use it in interactive settings too, since cron = isn=E2=80=99t involved. =E2=80=94 Justin --Apple-Mail=_8EEB5A97-3693-4687-B06D-8B6266625AC3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJU9zfeAAoJED9n8CuvaSf4OyAH/00gzNPOYh8cRwr0pTGpZUVm fE16fuVAdybopqFs0HBjI2XwYQr4eFTlCr6+ZTv81cICyxl5xTP4OKtms0yE0tJO Q+RGnb2IvCdl727kMSEjszdKjULUJC6/1Mr8FETsG0f/TTu6RcBL6wW/FA/2/c45 8l6cB3kEgUBniznQ2kYTtSeVdZdZj5uGh2GZ3Q6ON/hUcixbsNGm7sCm50rPCU+k etcteNUb1XjW/oULCdIpfDft2K/TX7+ixkBtgE3rbdXEYilo8TmU0Fz25NAjOoVr NTEjPuM+aqpLylhaP4bTfe2WZeKJv1VMgIhDobVT3pUU21QvamfqqmsoC0Oygl8= =Q0xU -----END PGP SIGNATURE----- --Apple-Mail=_8EEB5A97-3693-4687-B06D-8B6266625AC3-- From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 16:51:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C38C0429; Wed, 4 Mar 2015 16:51:11 +0000 (UTC) Received: from pmta1.delivery4.ore.mailhop.org (pmta1.delivery4.ore.mailhop.org [54.191.151.194]) by mx1.freebsd.org (Postfix) with ESMTP id A0BCDFA5; Wed, 4 Mar 2015 16:51:11 +0000 (UTC) Received: from smtp4.ore.mailhop.org (172.31.36.112) by pmta1.delivery1.ore.mailhop.org id husruu20r84t; Wed, 4 Mar 2015 16:20:44 +0000 (envelope-from ) Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp4.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YTC2d-0001b1-K0; Wed, 04 Mar 2015 16:20:59 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t24GKvpe096398; Wed, 4 Mar 2015 09:20:57 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19F1AmBxnoM5ZHqL53PBi86 Message-ID: <1425486057.31275.5.camel@freebsd.org> Subject: Re: svn commit: r279551 - in head/sys: arm/conf modules/dtb/imx6 From: Ian Lepore To: "Bjoern A. Zeeb" Date: Wed, 04 Mar 2015 09:20:57 -0700 In-Reply-To: <5357A8D1-559C-4D3D-BA6E-4A3181306435@FreeBSD.org> References: <201503022212.t22MCvp0036492@svn.freebsd.org> <5357A8D1-559C-4D3D-BA6E-4A3181306435@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 16:51:11 -0000 On Wed, 2015-03-04 at 16:01 +0000, Bjoern A. Zeeb wrote: > > On 02 Mar 2015, at 22:12 , Ian Lepore wrote: > > > > Author: ian > > Date: Mon Mar 2 22:12:56 2015 > > New Revision: 279551 > > URL: https://svnweb.freebsd.org/changeset/base/279551 > > > > Log: > > Add a "module" to build the dtb files for all supported imx6 systems. > > > > Added: > > head/sys/modules/dtb/imx6/ > > head/sys/modules/dtb/imx6/Makefile (contents, props changed) > > Modified: > > head/sys/arm/conf/IMX6 > > > > Modified: head/sys/arm/conf/IMX6 > > ============================================================================== > > --- head/sys/arm/conf/IMX6 Mon Mar 2 22:03:13 2015 (r279550) > > +++ head/sys/arm/conf/IMX6 Mon Mar 2 22:12:56 2015 (r279551) > > @@ -153,6 +153,7 @@ device u3g # USB modems > > > > # Flattened Device Tree > > options FDT # Configure using FDT/DTB data > > +makeoptions MODULES_EXTRA=dtb/imx6 > > > > # SoC-specific devices > > device ffec # Freescale Fast Ethernet Controller > > > > Added: head/sys/modules/dtb/imx6/Makefile > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/modules/dtb/imx6/Makefile Mon Mar 2 22:12:56 2015 (r279551) > > @@ -0,0 +1,12 @@ > > +# $FreeBSD$ > > +# All the dts files for imx6 systems we support. > > +DTS= \ > > + imx6dl-cubox-i.dts \ > > + imx6q-cubox-i.dts \ > > + imx6dl-hummingboard.dts \ > > + imx6q-hummingboard.dts \ > > + imx6q-wandboard.dts \ > > + imx6dl-wandboard.dts \ > > + imx6s-wandboard.dts > > + > > There is no imx6s-wandboard.dts in the tree it seems and thus IMX6 kernel builds are failing. Indeed. Except there was one (uncommitted, left over from long ago) on my system so I didn't see the build failure. Fixed now, sorry about that. -- Ian From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 17:04:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8D71948; Wed, 4 Mar 2015 17:04:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3A6A175; Wed, 4 Mar 2015 17:04:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24H4NgX065737; Wed, 4 Mar 2015 17:04:23 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24H4NcN065736; Wed, 4 Mar 2015 17:04:23 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503041704.t24H4NcN065736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 4 Mar 2015 17:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279595 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 17:04:23 -0000 Author: nwhitehorn Date: Wed Mar 4 17:04:22 2015 New Revision: 279595 URL: https://svnweb.freebsd.org/changeset/base/279595 Log: Garbage collect old function prototypes. Modified: head/sys/powerpc/include/pte.h Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Wed Mar 4 16:45:31 2015 (r279594) +++ head/sys/powerpc/include/pte.h Wed Mar 4 17:04:22 2015 (r279595) @@ -158,12 +158,6 @@ typedef struct lpte lpte_t; #define ISSRR1_PROTECT 0x08000000 #define ISSRR1_SEGMENT 0x00200000 -#ifdef _KERNEL -#ifndef LOCORE -extern u_int dsisr(void); -#endif /* _KERNEL */ -#endif /* LOCORE */ - #else /* BOOKE */ #include From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 18:24:53 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF75BAC5; Wed, 4 Mar 2015 18:24:53 +0000 (UTC) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A41FDCA3; Wed, 4 Mar 2015 18:24:53 +0000 (UTC) Received: by igdh15 with SMTP id h15so38850338igd.4; Wed, 04 Mar 2015 10:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rGNZzVsUWQPVZK7QyqlwuHdIBZjJ1FUtja8nXhu52aM=; b=bwpvyfMlaOPzWZl/ikWcAiBm03r/+0jUGQOzxAP9XSDg8s0ivV1Y931Qbls+oyD8o1 V5v4FMpK5r399hIEBA6SmvWgctQIft+LaEOs+IqeL4BvtCvV8V8IpdUxLMHuyeXHe5Av 7H23idxkQwIVxN4NRcsBXAjRIOOnlAIKmQ030HcxgOIoNkD8IKDaacGheSkzQ86qS+SB 40m2injyIuyl/VIymtVgqeIInrTekZftjY6VTD9iZamedqsfWod5aV9SaM39QLw9VjNK 8JNgT9xNIp0mkvUzxDGka6WA2SegRJEqXuDYF0729nsHsp9fa6uc/TYRPUWOLQJPr/oP t1Bg== MIME-Version: 1.0 X-Received: by 10.107.8.213 with SMTP id h82mr13150263ioi.89.1425493492907; Wed, 04 Mar 2015 10:24:52 -0800 (PST) Received: by 10.107.156.75 with HTTP; Wed, 4 Mar 2015 10:24:52 -0800 (PST) In-Reply-To: <201502040826.t148Qi8W096721@svn.freebsd.org> References: <201502040826.t148Qi8W096721@svn.freebsd.org> Date: Wed, 4 Mar 2015 13:24:52 -0500 Message-ID: Subject: Re: svn commit: r278183 - in head/sys: amd64/include conf dev/xen/timer i386/include i386/xen x86/include x86/x86 From: Ryan Stone To: Bryan Venteicher Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 18:24:54 -0000 On Wed, Feb 4, 2015 at 3:26 AM, Bryan Venteicher wrote: > +static void > +pvclock_read_time_info(struct pvclock_vcpu_time_info *ti, > + uint64_t *cycles, uint8_t *flags) > +{ > + uint32_t version; > + > + do { > + version = ti->version; > + rmb(); > + *cycles = ti->system_time + pvclock_get_nsec_offset(ti); > + *flags = ti->flags; > + rmb(); > + } while ((ti->version & 1) != 0 || ti->version != version); > +} The Linux implementation of this does a "rdtsc_barrier();" in place of the rmb(), and in some situations that appears to result in a full mfence, not just an lfence (the code is macro soup so it's difficult to understand what's happening). Are you sure that the rmb() is enough? I believe that the concern is whether the rdtsc() itself is allowed to be re-ordered around an lfence. This stack overflow answer seems to indicate the a full mfence is necessary on AMD processors: http://stackoverflow.com/questions/12631856/difference-between-rdtscp-rdtsc-memory-and-cpuid-rdtsc From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 19:24:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 883E18D9; Wed, 4 Mar 2015 19:24:28 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9EF33B2; Wed, 4 Mar 2015 19:24:27 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t24JOM6q005233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Mar 2015 21:24:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t24JOM6q005233 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t24JOMSC005232; Wed, 4 Mar 2015 21:24:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 4 Mar 2015 21:24:22 +0200 From: Konstantin Belousov To: Ryan Stone Subject: Re: svn commit: r278183 - in head/sys: amd64/include conf dev/xen/timer i386/include i386/xen x86/include x86/x86 Message-ID: <20150304192421.GL2379@kib.kiev.ua> References: <201502040826.t148Qi8W096721@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , Bryan Venteicher , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 19:24:28 -0000 On Wed, Mar 04, 2015 at 01:24:52PM -0500, Ryan Stone wrote: > On Wed, Feb 4, 2015 at 3:26 AM, Bryan Venteicher wrote: > > +static void > > +pvclock_read_time_info(struct pvclock_vcpu_time_info *ti, > > + uint64_t *cycles, uint8_t *flags) > > +{ > > + uint32_t version; > > + > > + do { > > + version = ti->version; > > + rmb(); > > + *cycles = ti->system_time + pvclock_get_nsec_offset(ti); > > + *flags = ti->flags; > > + rmb(); > > + } while ((ti->version & 1) != 0 || ti->version != version); > > +} > > The Linux implementation of this does a "rdtsc_barrier();" in place of > the rmb(), and in some situations that appears to result in a full > mfence, not just an lfence (the code is macro soup so it's difficult > to understand what's happening). Are you sure that the rmb() is > enough? I believe that the concern is whether the rdtsc() itself is > allowed to be re-ordered around an lfence. > > This stack overflow answer seems to indicate the a full mfence is > necessary on AMD processors: > > http://stackoverflow.com/questions/12631856/difference-between-rdtscp-rdtsc-memory-and-cpuid-rdtsc Yes, Intel declares that lfence is enough, but for AMD the mfence should be used. See r238973/r238975 and sys/x86/x86/tsc.c. From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 20:04:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AB3522D; Wed, 4 Mar 2015 20:04:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AFD49F3; Wed, 4 Mar 2015 20:04:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24K4O0e053928; Wed, 4 Mar 2015 20:04:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24K4NUQ053921; Wed, 4 Mar 2015 20:04:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503042004.t24K4NUQ053921@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 4 Mar 2015 20:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279597 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 20:04:24 -0000 Author: bapt Date: Wed Mar 4 20:04:23 2015 New Revision: 279597 URL: https://svnweb.freebsd.org/changeset/base/279597 Log: Rework calendar(1) parser Support includes surrounded by '"' or '<' '>' Print warnings about bad syntax Correctly navigate through include directories to find calendar files Correctly support multiple includes Tested by: gjb MFC after: 1 week Deleted: head/usr.bin/calendar/calcpp.c Modified: head/usr.bin/calendar/Makefile head/usr.bin/calendar/calendar.h head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Wed Mar 4 19:47:33 2015 (r279596) +++ head/usr.bin/calendar/Makefile Wed Mar 4 20:04:23 2015 (r279597) @@ -5,7 +5,7 @@ PROG= calendar SRCS= calendar.c locale.c events.c dates.c parsedata.c io.c day.c \ - ostern.c paskha.c pom.c sunpos.c calcpp.c + ostern.c paskha.c pom.c sunpos.c LIBADD= m INTER= de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_FR.ISO8859-1 \ hr_HR.ISO8859-2 hu_HU.ISO8859-2 pt_BR.ISO8859-1 \ Modified: head/usr.bin/calendar/calendar.h ============================================================================== --- head/usr.bin/calendar/calendar.h Wed Mar 4 19:47:33 2015 (r279596) +++ head/usr.bin/calendar/calendar.h Wed Mar 4 20:04:23 2015 (r279597) @@ -168,10 +168,6 @@ void closecal(FILE *); FILE *opencalin(void); FILE *opencalout(void); -/* calcpp.c */ -void initcpp(void); -FILE *fincludegets(char *buf, int size, FILE *fp); - /* ostern.c / paskha.c */ int paskha(int); int easter(int); Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Wed Mar 4 19:47:33 2015 (r279596) +++ head/usr.bin/calendar/io.c Wed Mar 4 20:04:23 2015 (r279597) @@ -51,14 +51,23 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#define _WITH_GETLINE #include #include #include +#include #include #include "pathnames.h" #include "calendar.h" +enum { + T_OK = 0, + T_ERR, + T_PROCESS, +}; + const char *calendarFile = "calendar"; /* default calendar file */ static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ @@ -68,6 +77,147 @@ static char path[MAXPATHLEN]; struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon; struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; +static int cal_parse(FILE *in, FILE *out); + +static StringList *definitions = NULL; +static struct event *events[MAXCOUNT]; +static char *extradata[MAXCOUNT]; + +static void +trimlr(char **buf) +{ + char *walk = *buf; + + while (isspace(*walk)) + walk++; + while (isspace(walk[strlen(walk) -1])) + walk[strlen(walk) -1] = '\0'; + + *buf = walk; +} + +static FILE * +cal_fopen(const char *file) +{ + FILE *fp; + char *home = getenv("HOME"); + unsigned int i; + + if (home == NULL || *home == '\0') { + warnx("Cannot get home directory"); + return (NULL); + } + + if (chdir(home) != 0) { + warnx("Cannot enter home directory"); + return (NULL); + } + + for (i = 0; i < sizeof(calendarHomes)/sizeof(calendarHomes[0]) ; i++) { + if (chdir(calendarHomes[i]) != 0) + continue; + + if ((fp = fopen(file, "r")) != NULL) + return (fp); + } + + warnx("can't open calendar file \"%s\"", file); + + return (NULL); +} + +static int +token(char *line, FILE *out, bool *skip) +{ + char *walk, c, a; + + if (strncmp(line, "endif", 5) == 0) { + *skip = false; + return (T_OK); + } + + if (*skip) + return (T_OK); + + if (strncmp(line, "include", 7) == 0) { + walk = line + 7; + + trimlr(&walk); + + if (*walk == '\0') { + warnx("Expecting arguments after #include"); + return (T_ERR); + } + + if (*walk != '<' && *walk != '\"') { + warnx("Excecting '<' or '\"' after #include"); + return (T_ERR); + } + + a = *walk; + walk++; + c = walk[strlen(walk) - 1]; + + switch(c) { + case '>': + if (a != '<') { + warnx("Unterminated include expecting '\"'"); + return (T_ERR); + } + break; + case '\"': + if (a != '\"') { + warnx("Unterminated include expecting '>'"); + return (T_ERR); + } + break; + default: + warnx("Unterminated include expecting '%c'", + a == '<' ? '>' : '\"' ); + return (T_ERR); + } + walk[strlen(walk) - 1] = '\0'; + + if (cal_parse(cal_fopen(walk), out)) + return (T_ERR); + + return (T_OK); + } + + if (strncmp(line, "define", 6) == 0) { + if (definitions == NULL) + definitions = sl_init(); + walk = line + 6; + trimlr(&walk); + + if (*walk == '\0') { + warnx("Expecting arguments after #define"); + return (T_ERR); + } + + sl_add(definitions, strdup(walk)); + return (T_OK); + } + + if (strncmp(line, "ifndef", 6) == 0) { + walk = line + 6; + trimlr(&walk); + + if (*walk == '\0') { + warnx("Expecting arguments after #ifndef"); + return (T_ERR); + } + + if (definitions != NULL && sl_find(definitions, walk) != NULL) + *skip = true; + + return (T_OK); + } + + return (T_PROCESS); + +} + #define REPLACE(string, slen, struct_) \ if (strncasecmp(buf, (string), (slen)) == 0 && buf[(slen)]) { \ if (struct_.name != NULL) \ @@ -77,30 +227,25 @@ struct fixs nmarequinox, nsepequinox, nj struct_.len = strlen(buf + (slen)); \ continue; \ } -void -cal(void) +static int +cal_parse(FILE *in, FILE *out) { - char *pp, p; - FILE *fpin; - FILE *fpout; - int l; - int count, i; + char *line = NULL; + char *buf; + size_t linecap = 0; + ssize_t linelen; + ssize_t l; + static int d_first = -1; + static int count = 0; + int i; int month[MAXCOUNT]; int day[MAXCOUNT]; int year[MAXCOUNT]; - char **extradata; /* strings of 20 length */ - int flags; - static int d_first = -1; - char buf[2048 + 1]; - struct event *events[MAXCOUNT]; - struct tm tm; + bool skip = false; char dbuf[80]; - - initcpp(); - extradata = (char **)calloc(MAXCOUNT, sizeof(char *)); - for (i = 0; i < MAXCOUNT; i++) { - extradata[i] = (char *)calloc(1, 20); - } + char *pp, p; + struct tm tm; + int flags; /* Unused */ tm.tm_sec = 0; @@ -108,20 +253,32 @@ cal(void) tm.tm_hour = 0; tm.tm_wday = 0; - count = 0; - if ((fpin = opencalin()) == NULL) { - free(extradata); - return; - } - if ((fpout = opencalout()) == NULL) { - fclose(fpin); - free(extradata); - return; - } - while ((fpin = fincludegets(buf, sizeof(buf), fpin)) != NULL) { - if (*buf == '\0') + if (in == NULL) + return (1); + + while ((linelen = getline(&line, &linecap, in)) > 0) { + if (linelen == 0) + continue; + + if (*line == '#') { + switch (token(line+1, out, &skip)) { + case T_ERR: + free(line); + return (1); + case T_OK: + continue; + case T_PROCESS: + break; + default: + break; + } + } + + if (skip) continue; - for (l = strlen(buf); + + buf = line; + for (l = linelen; l > 0 && isspace((unsigned char)buf[l - 1]); l--) ; @@ -208,16 +365,41 @@ cal(void) } } + free(line); + fclose(in); + + return (0); +} + +void +cal(void) +{ + FILE *fpin; + FILE *fpout; + int i; + + for (i = 0; i < MAXCOUNT; i++) + extradata[i] = (char *)calloc(1, 20); + + + if ((fpin = opencalin()) == NULL) + return; + + if ((fpout = opencalout()) == NULL) { + fclose(fpin); + return; + } + + if (cal_parse(fpin, fpout)) + return; + event_print_all(fpout); closecal(fpout); - free(extradata); } FILE * opencalin(void) { - size_t i; - int found; struct stat sbuf; FILE *fpin; @@ -231,22 +413,7 @@ opencalin(void) if ((fpin = fopen(calendarFile, "r")) == NULL) return (NULL); } else { - char *home = getenv("HOME"); - if (home == NULL || *home == '\0') - errx(1, "cannot get home directory"); - if (chdir(home) != 0) - errx(1, "cannot enter home directory"); - for (found = i = 0; i < sizeof(calendarHomes) / - sizeof(calendarHomes[0]); i++) - if (chdir(calendarHomes[i]) == 0 && - (fpin = fopen(calendarFile, "r")) != NULL) { - found = 1; - break; - } - if (!found) - errx(1, - "can't open calendar file \"%s\": %s (%d)", - calendarFile, strerror(errno), errno); + fpin = cal_fopen(calendarFile); } } return (fpin); From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 20:33:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B769B7DE; Wed, 4 Mar 2015 20:33:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1C41CFC; Wed, 4 Mar 2015 20:33:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24KXGpS067958; Wed, 4 Mar 2015 20:33:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24KXGX9067956; Wed, 4 Mar 2015 20:33:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503042033.t24KXGX9067956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 4 Mar 2015 20:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279598 - in head/sys/boot: i386/boot2 pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 20:33:16 -0000 Author: dim Date: Wed Mar 4 20:33:15 2015 New Revision: 279598 URL: https://svnweb.freebsd.org/changeset/base/279598 Log: When compiling boot2 with gcc on i386 and pc98, only use the custom flag -mno-align-long-strings when compiling with base gcc. This is checked by comparing the version number against 4.2.1, which is not exactly right, but good enough. (There is no other way to check whether we are using the non-standard gcc in base, as far as I know.) Reported by: rodrigc MFC after: 3 days Modified: head/sys/boot/i386/boot2/Makefile head/sys/boot/pc98/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Wed Mar 4 20:04:23 2015 (r279597) +++ head/sys/boot/i386/boot2/Makefile Wed Mar 4 20:33:15 2015 (r279598) @@ -41,8 +41,10 @@ CFLAGS= -fomit-frame-pointer \ CFLAGS.gcc+= -Os \ -fno-guess-branch-probability \ -fno-unit-at-a-time \ - -mno-align-long-strings \ --param max-inline-insns-single=100 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 +CFLAGS.gcc+= -mno-align-long-strings +.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Wed Mar 4 20:04:23 2015 (r279597) +++ head/sys/boot/pc98/boot2/Makefile Wed Mar 4 20:33:15 2015 (r279598) @@ -39,8 +39,10 @@ CFLAGS= -fomit-frame-pointer \ CFLAGS.gcc+= -Os \ -fno-guess-branch-probability \ -fno-unit-at-a-time \ - -mno-align-long-strings \ --param max-inline-insns-single=100 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 +CFLAGS.gcc+= -mno-align-long-strings +.endif # Set machine type to PC98_SYSTEM_PARAMETER #CFLAGS+= -DSET_MACHINE_TYPE From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 20:43:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F1FCA21; Wed, 4 Mar 2015 20:43:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09119DEF; Wed, 4 Mar 2015 20:43:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24Khkpa072646; Wed, 4 Mar 2015 20:43:46 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24KhkMM072645; Wed, 4 Mar 2015 20:43:46 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201503042043.t24KhkMM072645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Wed, 4 Mar 2015 20:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279599 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 20:43:47 -0000 Author: dumbbell Date: Wed Mar 4 20:43:46 2015 New Revision: 279599 URL: https://svnweb.freebsd.org/changeset/base/279599 Log: drm: Import Linux commit b7ea85a4fed37835eec78a7be3039c8dc22b8178 Author: Huacai Chen Date: Tue May 21 06:23:43 2013 +0000 drm: fix a use-after-free when GPU acceleration disabled When GPU acceleration is disabled, drm_vblank_cleanup() will free the vblank-related data, such as vblank_refcount, vblank_inmodeset, etc. But we found that drm_vblank_post_modeset() may be called after the cleanup, which use vblank_refcount and vblank_inmodeset. And this will cause a kernel panic. Fix this by return immediately if dev->num_crtcs is zero. This is the same thing that drm_vblank_pre_modeset() does. Call trace of a drm_vblank_post_modeset() after drm_vblank_cleanup(): [ 62.628906] [] drm_vblank_post_modeset+0x34/0xb4 [ 62.628906] [] atombios_crtc_dpms+0xb4/0x174 [ 62.628906] [] atombios_crtc_commit+0x18/0x38 [ 62.628906] [] drm_crtc_helper_set_mode+0x304/0x3cc [ 62.628906] [] drm_crtc_helper_set_config+0x6d8/0x988 [ 62.628906] [] drm_fb_helper_set_par+0x94/0x104 [ 62.628906] [] fbcon_init+0x424/0x57c [ 62.628906] [] visual_init+0xb8/0x118 [ 62.628906] [] take_over_console+0x238/0x384 [ 62.628906] [] fbcon_takeover+0x7c/0xdc [ 62.628906] [] notifier_call_chain+0x44/0x94 [ 62.628906] [] __blocking_notifier_call_chain+0x48/0x68 [ 62.628906] [] register_framebuffer+0x228/0x260 [ 62.628906] [] drm_fb_helper_single_fb_probe+0x260/0x314 [ 62.628906] [] drm_fb_helper_initial_config+0x200/0x234 [ 62.628906] [] radeon_fbdev_init+0xd4/0xf4 [ 62.628906] [] radeon_modeset_init+0x9bc/0xa18 [ 62.628906] [] radeon_driver_load_kms+0xdc/0x12c [ 62.628906] [] drm_get_pci_dev+0x148/0x238 [ 62.628906] [] local_pci_probe+0x5c/0xd0 [ 62.628906] [] work_for_cpu_fn+0x1c/0x30 [ 62.628906] [] process_one_work+0x274/0x3bc [ 62.628906] [] process_scheduled_works+0x24/0x44 [ 62.628906] [] worker_thread+0x31c/0x3f4 [ 62.628906] [] kthread+0x88/0x90 [ 62.628906] [] kernel_thread_helper+0x10/0x18 Signed-off-by: Huacai Chen Signed-off-by: Binbin Zhou Cc: Reviewed-by: Michel Dänzer Acked-by: Paul Menzel Signed-off-by: Dave Airlie Reported by: J.R. Oldroyd MFC after: 2 weeks Modified: head/sys/dev/drm2/drm_irq.c Modified: head/sys/dev/drm2/drm_irq.c ============================================================================== --- head/sys/dev/drm2/drm_irq.c Wed Mar 4 20:33:15 2015 (r279598) +++ head/sys/dev/drm2/drm_irq.c Wed Mar 4 20:43:46 2015 (r279599) @@ -883,7 +883,7 @@ void drm_vblank_off(struct drm_device *d */ void drm_vblank_pre_modeset(struct drm_device *dev, int crtc) { - /* vblank is not initialized (IRQ not installed ?) */ + /* vblank is not initialized (IRQ not installed ?), or has been freed */ if (!dev->num_crtcs) return; /* @@ -902,6 +902,9 @@ void drm_vblank_pre_modeset(struct drm_d void drm_vblank_post_modeset(struct drm_device *dev, int crtc) { + /* vblank is not initialized (IRQ not installed ?), or has been freed */ + if (!dev->num_crtcs) + return; if (dev->vblank_inmodeset[crtc]) { mtx_lock(&dev->vbl_lock); From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 20:47:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D21ECBEA; Wed, 4 Mar 2015 20:47:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC75BE2A; Wed, 4 Mar 2015 20:47:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24Klint073216; Wed, 4 Mar 2015 20:47:44 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24KliCt073214; Wed, 4 Mar 2015 20:47:44 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201503042047.t24KliCt073214@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Wed, 4 Mar 2015 20:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279600 - in head/sys/modules/drm2: . radeonkmsfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 20:47:44 -0000 Author: dumbbell Date: Wed Mar 4 20:47:43 2015 New Revision: 279600 URL: https://svnweb.freebsd.org/changeset/base/279600 Log: drm: Allow parallel builds of drivers and firmwares Submitted by: hps@ MFC after: 2 weeks Modified: head/sys/modules/drm2/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile Modified: head/sys/modules/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/Makefile Wed Mar 4 20:43:46 2015 (r279599) +++ head/sys/modules/drm2/Makefile Wed Mar 4 20:47:43 2015 (r279600) @@ -3,6 +3,8 @@ SYSDIR?=${.CURDIR}/../.. .include "${SYSDIR}/conf/kern.opts.mk" +SUBDIR_PARALLEL= + .if ${MACHINE_CPUARCH} == "amd64" _i915kms= i915kms _radeonkms= radeonkms Modified: head/sys/modules/drm2/radeonkmsfw/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkmsfw/Makefile Wed Mar 4 20:43:46 2015 (r279599) +++ head/sys/modules/drm2/radeonkmsfw/Makefile Wed Mar 4 20:47:43 2015 (r279600) @@ -1,5 +1,7 @@ # $FreeBSD$ +SUBDIR_PARALLEL= + SUBDIR= \ ARUBA_me \ ARUBA_pfp \ From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 21:07:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9175510B; Wed, 4 Mar 2015 21:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71A75D7; Wed, 4 Mar 2015 21:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24L70HK082536; Wed, 4 Mar 2015 21:07:00 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24L6wXR082524; Wed, 4 Mar 2015 21:06:58 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503042106.t24L6wXR082524@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 4 Mar 2015 21:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279601 - in head/sys/powerpc: aim booke include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 21:07:00 -0000 Author: nwhitehorn Date: Wed Mar 4 21:06:57 2015 New Revision: 279601 URL: https://svnweb.freebsd.org/changeset/base/279601 Log: The AIM DAR (data access fault address register) and Book-E DEAR registers have the same meaning and occupy the same memory address in the trapframe courtesy of union. Avoid some pointless #ifdef by spelling them both 'DAR' in the trapframe. Modified: head/sys/powerpc/aim/trap.c head/sys/powerpc/booke/interrupt.c head/sys/powerpc/booke/trap.c head/sys/powerpc/include/frame.h head/sys/powerpc/powerpc/db_trace.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/aim/trap.c Wed Mar 4 21:06:57 2015 (r279601) @@ -201,8 +201,7 @@ trap(struct trapframe *frame) case EXC_ISE: case EXC_DSE: if (handle_user_slb_spill(&p->p_vmspace->vm_pmap, - (type == EXC_ISE) ? frame->srr0 : - frame->cpu.aim.dar) != 0) { + (type == EXC_ISE) ? frame->srr0 : frame->dar) != 0){ sig = SIGSEGV; ucode = SEGV_MAPERR; } @@ -326,7 +325,7 @@ trap(struct trapframe *frame) #endif #ifdef __powerpc64__ case EXC_DSE: - if ((frame->cpu.aim.dar & SEGMENT_MASK) == USER_ADDR) { + if ((frame->dar & SEGMENT_MASK) == USER_ADDR) { __asm __volatile ("slbmte %0, %1" :: "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE)); @@ -387,8 +386,7 @@ printtrap(u_int vector, struct trapframe switch (vector) { case EXC_DSE: case EXC_DSI: - printf(" virtual address = 0x%" PRIxPTR "\n", - frame->cpu.aim.dar); + printf(" virtual address = 0x%" PRIxPTR "\n", frame->dar); printf(" dsisr = 0x%" PRIxPTR "\n", frame->cpu.aim.dsisr); break; @@ -642,7 +640,7 @@ trap_pfault(struct trapframe *frame, int if (frame->srr1 & SRR1_ISI_PFAULT) ftype |= VM_PROT_READ; } else { - eva = frame->cpu.aim.dar; + eva = frame->dar; if (frame->cpu.aim.dsisr & DSISR_STORE) ftype = VM_PROT_WRITE; else @@ -736,12 +734,12 @@ fix_unaligned(struct thread *td, struct save_fpu(td); if (indicator == EXC_ALI_LFD) { - if (copyin((void *)frame->cpu.aim.dar, fpr, + if (copyin((void *)frame->dar, fpr, sizeof(double)) != 0) return -1; enable_fpu(td); } else { - if (copyout(fpr, (void *)frame->cpu.aim.dar, + if (copyout(fpr, (void *)frame->dar, sizeof(double)) != 0) return -1; } Modified: head/sys/powerpc/booke/interrupt.c ============================================================================== --- head/sys/powerpc/booke/interrupt.c Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/booke/interrupt.c Wed Mar 4 21:06:57 2015 (r279601) @@ -79,7 +79,7 @@ dump_frame(struct trapframe *frame) printf(" exc = 0x%x\n", frame->exc); printf(" srr0 = 0x%08x\n", frame->srr0); printf(" srr1 = 0x%08x\n", frame->srr1); - printf(" dear = 0x%08x\n", frame->cpu.booke.dear); + printf(" dear = 0x%08x\n", frame->dar); printf(" esr = 0x%08x\n", frame->cpu.booke.esr); printf(" lr = 0x%08x\n", frame->lr); printf(" cr = 0x%08x\n", frame->cr); Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/booke/trap.c Wed Mar 4 21:06:57 2015 (r279601) @@ -263,7 +263,7 @@ printtrap(u_int vector, struct trapframe switch (vector) { case EXC_DTMISS: case EXC_DSI: - va = frame->cpu.booke.dear; + va = frame->dar; break; case EXC_ITMISS: @@ -400,7 +400,7 @@ trap_pfault(struct trapframe *frame, int ftype = VM_PROT_READ | VM_PROT_EXECUTE; } else { - eva = frame->cpu.booke.dear; + eva = frame->dar; if (frame->cpu.booke.esr & ESR_ST) ftype = VM_PROT_WRITE; else Modified: head/sys/powerpc/include/frame.h ============================================================================== --- head/sys/powerpc/include/frame.h Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/include/frame.h Wed Mar 4 21:06:57 2015 (r279601) @@ -56,14 +56,13 @@ struct trapframe { register_t srr0; register_t srr1; register_t exc; + register_t dar; /* DAR/DEAR filled in on DSI traps */ union { struct { - /* dar & dsisr are only filled on a DSI trap */ - register_t dar; + /* dsisr only filled on a DSI trap */ register_t dsisr; } aim; struct { - register_t dear; register_t esr; register_t dbcr0; } booke; Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/powerpc/db_trace.c Wed Mar 4 21:06:57 2015 (r279601) @@ -98,12 +98,11 @@ struct db_variable db_regs[] = { { "ctr", DB_OFFSET(ctr), db_frame }, { "cr", DB_OFFSET(cr), db_frame }, { "xer", DB_OFFSET(xer), db_frame }, + { "dar", DB_OFFSET(dar), db_frame }, #ifdef AIM - { "dar", DB_OFFSET(cpu.aim.dar), db_frame }, { "dsisr", DB_OFFSET(cpu.aim.dsisr), db_frame }, #endif #if defined(BOOKE) - { "dear", DB_OFFSET(cpu.booke.dear), db_frame }, { "esr", DB_OFFSET(cpu.booke.esr), db_frame }, #endif }; @@ -218,18 +217,16 @@ db_backtrace(struct thread *td, db_addr_ /* XXX take advantage of the union. */ db_printf("DSI %s trap @ %#zx by ", (tf->cpu.aim.dsisr & DSISR_STORE) ? "write" - : "read", tf->cpu.aim.dar); + : "read", tf->dar); goto print_trap; case EXC_ALI: /* XXX take advantage of the union. */ db_printf("ALI trap @ %#zx (xSR %#x) ", - tf->cpu.aim.dar, - (uint32_t)tf->cpu.aim.dsisr); + tf->dar, (uint32_t)tf->cpu.aim.dsisr); goto print_trap; #ifdef __powerpc64__ case EXC_DSE: - db_printf("DSE trap @ %#zx by ", - tf->cpu.aim.dar); + db_printf("DSE trap @ %#zx by ", tf->dar); goto print_trap; case EXC_ISE: db_printf("ISE trap @ %#zx by ", tf->srr0); Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/powerpc/exec_machdep.c Wed Mar 4 21:06:57 2015 (r279601) @@ -152,13 +152,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, * Fill siginfo structure. */ ksi->ksi_info.si_signo = ksi->ksi_signo; - #ifdef AIM ksi->ksi_info.si_addr = (void *)((tf->exc == EXC_DSI) ? - tf->cpu.aim.dar : tf->srr0); - #else - ksi->ksi_info.si_addr = (void *)((tf->exc == EXC_DSI) ? - tf->cpu.booke.dear : tf->srr0); - #endif + tf->dar : tf->srr0); #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(p, SV_ILP32)) { @@ -284,13 +279,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } else { /* Old FreeBSD-style arguments. */ tf->fixreg[FIRSTARG+1] = code; - #ifdef AIM tf->fixreg[FIRSTARG+3] = (tf->exc == EXC_DSI) ? - tf->cpu.aim.dar : tf->srr0; - #else - tf->fixreg[FIRSTARG+3] = (tf->exc == EXC_DSI) ? - tf->cpu.booke.dear : tf->srr0; - #endif + tf->dar : tf->srr0; } mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Wed Mar 4 20:47:43 2015 (r279600) +++ head/sys/powerpc/powerpc/genassym.c Wed Mar 4 21:06:57 2015 (r279601) @@ -171,9 +171,9 @@ ASSYM(FRAME_XER, offsetof(struct trapfra ASSYM(FRAME_SRR0, offsetof(struct trapframe, srr0)); ASSYM(FRAME_SRR1, offsetof(struct trapframe, srr1)); ASSYM(FRAME_EXC, offsetof(struct trapframe, exc)); -ASSYM(FRAME_AIM_DAR, offsetof(struct trapframe, cpu.aim.dar)); +ASSYM(FRAME_AIM_DAR, offsetof(struct trapframe, dar)); ASSYM(FRAME_AIM_DSISR, offsetof(struct trapframe, cpu.aim.dsisr)); -ASSYM(FRAME_BOOKE_DEAR, offsetof(struct trapframe, cpu.booke.dear)); +ASSYM(FRAME_BOOKE_DEAR, offsetof(struct trapframe, dar)); ASSYM(FRAME_BOOKE_ESR, offsetof(struct trapframe, cpu.booke.esr)); ASSYM(FRAME_BOOKE_DBCR0, offsetof(struct trapframe, cpu.booke.dbcr0)); From owner-svn-src-all@FreeBSD.ORG Wed Mar 4 22:01:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 435DFDE1; Wed, 4 Mar 2015 22:01:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E33296A; Wed, 4 Mar 2015 22:01:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t24M1ja0009281; Wed, 4 Mar 2015 22:01:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t24M1jDG009278; Wed, 4 Mar 2015 22:01:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503042201.t24M1jDG009278@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 4 Mar 2015 22:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 22:01:46 -0000 Author: bapt Date: Wed Mar 4 22:01:44 2015 New Revision: 279603 URL: https://svnweb.freebsd.org/changeset/base/279603 Log: r* commands are not precious anymore Modified: head/bin/rcp/Makefile head/usr.bin/rlogin/Makefile head/usr.bin/rsh/Makefile Modified: head/bin/rcp/Makefile ============================================================================== --- head/bin/rcp/Makefile Wed Mar 4 21:33:08 2015 (r279602) +++ head/bin/rcp/Makefile Wed Mar 4 22:01:44 2015 (r279603) @@ -7,6 +7,5 @@ CFLAGS+=-DBINDIR=${BINDIR} BINOWN= root BINMODE=4555 -PRECIOUSPROG= .include Modified: head/usr.bin/rlogin/Makefile ============================================================================== --- head/usr.bin/rlogin/Makefile Wed Mar 4 21:33:08 2015 (r279602) +++ head/usr.bin/rlogin/Makefile Wed Mar 4 22:01:44 2015 (r279603) @@ -5,6 +5,5 @@ PROG= rlogin BINOWN= root BINMODE=4555 -PRECIOUSPROG= .include Modified: head/usr.bin/rsh/Makefile ============================================================================== --- head/usr.bin/rsh/Makefile Wed Mar 4 21:33:08 2015 (r279602) +++ head/usr.bin/rsh/Makefile Wed Mar 4 22:01:44 2015 (r279603) @@ -8,6 +8,5 @@ WARNS?= 2 BINOWN= root BINMODE=4555 -PRECIOUSPROG= .include From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:30:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0733F846; Thu, 5 Mar 2015 00:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAF62B5A; Thu, 5 Mar 2015 00:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250Tx0H081414; Thu, 5 Mar 2015 00:29:59 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250TxUq081409; Thu, 5 Mar 2015 00:29:59 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050029.t250TxUq081409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:29: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: r279609 - in stable/10/usr.sbin/bsdconfig: includes share share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:30:00 -0000 Author: dteske Date: Thu Mar 5 00:29:58 2015 New Revision: 279609 URL: https://svnweb.freebsd.org/changeset/base/279609 Log: MFC r273067: Fix awk(1) asorti() implementation to work when called in a loop. Modified: stable/10/usr.sbin/bsdconfig/includes/includes stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/packages/index.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/includes/includes ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/includes Thu Mar 5 00:18:32 2015 (r279608) +++ stable/10/usr.sbin/bsdconfig/includes/includes Thu Mar 5 00:29:58 2015 (r279609) @@ -71,8 +71,10 @@ show_include() -v show_desc=${SHOW_DESC:-0} ' function asorti(src, dest) { + k = nitems = 0; + # Copy src indices to dest and calculate array length - nitems = 0; for (i in src) dest[++nitems] = i + for (i in src) dest[++nitems] = i # Sort the array of indices (dest) using insertion sort method for (i = 1; i <= nitems; k = i++) Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Thu Mar 5 00:18:32 2015 (r279608) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Thu Mar 5 00:29:58 2015 (r279609) @@ -1118,6 +1118,7 @@ f_device_sort_by_awk=' # -v prop="property" function asorti(src, dest) { + k = nitems = 0 for (i in src) dest[++nitems] = i for (i = 1; i <= nitems; k = i++) { idx = dest[i] Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Mar 5 00:18:32 2015 (r279608) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Mar 5 00:29:58 2015 (r279609) @@ -243,8 +243,10 @@ f_index_read() eval "$( debug= f_getvar "$var_to_get" | awk -F'|' ' function asorti(src, dest) { + k = nitems = 0 + # Copy src indices to dest and calculate array length - nitems = 0; for (i in src) dest[++nitems] = i + for (i in src) dest[++nitems] = i # Sort the array of indices (dest) using insertion sort method for (i = 1; i <= nitems; k = i++) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:32:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 313249AF; Thu, 5 Mar 2015 00:32:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11B49C08; Thu, 5 Mar 2015 00:32:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250WtPs085438; Thu, 5 Mar 2015 00:32:55 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250WtWS085435; Thu, 5 Mar 2015 00:32:55 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050032.t250WtWS085435@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:32:55 +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: r279610 - in stable/10/usr.sbin/bsdconfig: includes share share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:32:56 -0000 Author: dteske Date: Thu Mar 5 00:32:54 2015 New Revision: 279610 URL: https://svnweb.freebsd.org/changeset/base/279610 Log: MFC r273068: Rename awk(1) implementation of GNU awk's built-in asorti() function to prevent fatal conflict should one-true-awk ever be replaced -- e.g., in an appliance -- with GNU awk. NB: Renamed my implementation to _asorti() Modified: stable/10/usr.sbin/bsdconfig/includes/includes stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/packages/index.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/includes/includes ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/includes Thu Mar 5 00:29:58 2015 (r279609) +++ stable/10/usr.sbin/bsdconfig/includes/includes Thu Mar 5 00:32:54 2015 (r279610) @@ -69,7 +69,7 @@ show_include() -v use_color=${USE_COLOR:-0} \ -v re="$pattern" \ -v show_desc=${SHOW_DESC:-0} ' - function asorti(src, dest) + function _asorti(src, dest) { k = nitems = 0; @@ -120,7 +120,7 @@ show_include() } } END { - n = asorti(syntax, sorted_indices) + n = _asorti(syntax, sorted_indices) for (i = 1; i <= n; i++) printf "%s", syntax[sorted_indices[i]] }' "$file" ) Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Thu Mar 5 00:29:58 2015 (r279609) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Thu Mar 5 00:32:54 2015 (r279610) @@ -1116,7 +1116,7 @@ f_device_shutdown() f_device_sort_by_awk=' # Variables that should be defined on the invocation line: # -v prop="property" -function asorti(src, dest) +function _asorti(src, dest) { k = nitems = 0 for (i in src) dest[++nitems] = i @@ -1137,7 +1137,7 @@ function asorti(src, dest) } } END { - nitems = asorti(devices, devices_sorted) + nitems = _asorti(devices, devices_sorted) for (i = 1; i <= nitems; i++) print devices[devices_sorted[i]] } ' Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Mar 5 00:29:58 2015 (r279609) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Mar 5 00:32:54 2015 (r279610) @@ -241,7 +241,7 @@ f_index_read() export msg_packages eval "$( debug= f_getvar "$var_to_get" | awk -F'|' ' - function asorti(src, dest) + function _asorti(src, dest) { k = nitems = 0 @@ -292,7 +292,7 @@ f_index_read() END { print "_npkgs=" tpkgs # For convenience, total package count - n = asorti(categories, categories_sorted) + n = _asorti(categories, categories_sorted) # Produce package counts for each category for (i = 1; i <= n; i++) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:34:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA1C4AF9; Thu, 5 Mar 2015 00:34:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0D2EC19; Thu, 5 Mar 2015 00:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250Yi7d085789; Thu, 5 Mar 2015 00:34:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250YXPg085736; Thu, 5 Mar 2015 00:34:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050034.t250YXPg085736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:34: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: r279611 - in stable/10/usr.sbin/bsdconfig: . console console/include diskmgmt diskmgmt/include docsinstall docsinstall/include dot dot/include examples include includes includes/include... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:34:45 -0000 Author: dteske Date: Thu Mar 5 00:34:33 2015 New Revision: 279611 URL: https://svnweb.freebsd.org/changeset/base/279611 Log: MFC r274073: Follow-up to r255036; remove beforeinstall directives from bsdconfig(8) Makefile's, fixing concurrent installworld (`make -j17 installworld'). Reviewed by: delphij Thanks to: delphij, emaste Modified: stable/10/usr.sbin/bsdconfig/Makefile stable/10/usr.sbin/bsdconfig/console/Makefile stable/10/usr.sbin/bsdconfig/console/include/Makefile stable/10/usr.sbin/bsdconfig/diskmgmt/Makefile stable/10/usr.sbin/bsdconfig/diskmgmt/include/Makefile stable/10/usr.sbin/bsdconfig/docsinstall/Makefile stable/10/usr.sbin/bsdconfig/docsinstall/include/Makefile stable/10/usr.sbin/bsdconfig/dot/Makefile stable/10/usr.sbin/bsdconfig/dot/include/Makefile stable/10/usr.sbin/bsdconfig/examples/Makefile stable/10/usr.sbin/bsdconfig/include/Makefile stable/10/usr.sbin/bsdconfig/includes/Makefile stable/10/usr.sbin/bsdconfig/includes/include/Makefile stable/10/usr.sbin/bsdconfig/mouse/Makefile stable/10/usr.sbin/bsdconfig/mouse/include/Makefile stable/10/usr.sbin/bsdconfig/networking/Makefile stable/10/usr.sbin/bsdconfig/networking/include/Makefile stable/10/usr.sbin/bsdconfig/networking/share/Makefile stable/10/usr.sbin/bsdconfig/packages/Makefile stable/10/usr.sbin/bsdconfig/packages/include/Makefile stable/10/usr.sbin/bsdconfig/password/Makefile stable/10/usr.sbin/bsdconfig/password/include/Makefile stable/10/usr.sbin/bsdconfig/password/share/Makefile stable/10/usr.sbin/bsdconfig/security/Makefile stable/10/usr.sbin/bsdconfig/security/include/Makefile stable/10/usr.sbin/bsdconfig/share/Makefile stable/10/usr.sbin/bsdconfig/share/media/Makefile stable/10/usr.sbin/bsdconfig/share/packages/Makefile stable/10/usr.sbin/bsdconfig/startup/Makefile stable/10/usr.sbin/bsdconfig/startup/include/Makefile stable/10/usr.sbin/bsdconfig/startup/share/Makefile stable/10/usr.sbin/bsdconfig/timezone/Makefile stable/10/usr.sbin/bsdconfig/timezone/include/Makefile stable/10/usr.sbin/bsdconfig/timezone/share/Makefile stable/10/usr.sbin/bsdconfig/ttys/Makefile stable/10/usr.sbin/bsdconfig/ttys/include/Makefile stable/10/usr.sbin/bsdconfig/usermgmt/Makefile stable/10/usr.sbin/bsdconfig/usermgmt/include/Makefile stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -25,9 +25,4 @@ SCRIPTS= bsdconfig MAN= bsdconfig.8 -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - mkdir -p ${DESTDIR}${SCRIPTSDIR} - mkdir -p ${DESTDIR}${MANDIR}8 - .include Modified: stable/10/usr.sbin/bsdconfig/console/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/console/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/console/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= console font keymap repeat saver screenmap ttys -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/console/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/console/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/console/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/diskmgmt/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/diskmgmt/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/diskmgmt/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= diskmgmt -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/diskmgmt/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/diskmgmt/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/diskmgmt/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/050.diskmgmt/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/docsinstall/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/docsinstall/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/docsinstall/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= docsinstall -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/docsinstall/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/docsinstall/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/docsinstall/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/020.docsinstall/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/dot/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/dot/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/dot/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= dot -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/dot/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/dot/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/dot/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/dot/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/examples/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/examples/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -6,7 +6,4 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/includ FILES= bsdconfig.hlp media.hlp messages.subr network_device.hlp \ options.hlp tcp.hlp usage.hlp -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/includes/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/includes/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= includes -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/includes/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/includes/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/includes/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/mouse/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/mouse/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/mouse/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= disable enable flags mouse port type -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/mouse/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/mouse/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/mouse/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/110.mouse/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/networking/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/networking/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/networking/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= defaultrouter devices hostname nameservers networking -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/networking/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/networking/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/networking/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/networking/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/networking/share/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/networking/share/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -6,7 +6,4 @@ FILESDIR= ${SHAREDIR}/bsdconfig/networki FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ netmask.subr resolv.subr routing.subr services.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/packages/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/packages/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/packages/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= packages -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/packages/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/packages/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/packages/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/password/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/password/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/password/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= password -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/password/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/password/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/password/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/password/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/password/share/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/password/share/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/password FILES= password.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/security/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/security/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/security/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= kern_securelevel security -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/security/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/security/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/security/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/130.security/include FILES= messages.subr securelevel.hlp -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/share/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -9,7 +9,4 @@ FILES= common.subr device.subr dialog.s mustberoot.subr script.subr strings.subr struct.subr \ sysrc.subr variable.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/share/media/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/share/media/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -7,7 +7,4 @@ FILES= any.subr cdrom.subr common.subr floppy.subr ftp.subr http.subr httpproxy.subr network.subr \ nfs.subr options.subr tcpip.subr ufs.subr usb.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/share/packages/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/share/packages/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/packages FILES= categories.subr index.subr musthavepkg.subr packages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/startup/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/startup/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/startup/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= misc rcadd rcconf rcdelete rcedit rcvar startup -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/startup/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/startup/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/startup/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/140.startup/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/startup/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/startup/share/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/startup/share/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/startup FILES= rcconf.subr rcedit.subr rcvar.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/timezone/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/timezone/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= timezone -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/timezone/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/timezone/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/090.timezone/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/timezone/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/share/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/timezone/share/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -6,7 +6,4 @@ FILESDIR= ${SHAREDIR}/bsdconfig/timezone FILES= continents.subr countries.subr iso3166.subr menus.subr \ zones.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/ttys/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/ttys/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/ttys/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= ttys -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/ttys/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/ttys/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/ttys/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/150.ttys/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/usermgmt/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/usermgmt/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= groupadd groupdel groupedit useradd userdel useredit usermgmt -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/usermgmt/include/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/include/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/usermgmt/include/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/070.usermgmt/include FILES= messages.subr usermgmt.hlp -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile Thu Mar 5 00:32:54 2015 (r279610) +++ stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile Thu Mar 5 00:34:33 2015 (r279611) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt FILES= group.subr group_input.subr user.subr user_input.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:37:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9E16D41; Thu, 5 Mar 2015 00:37:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94450C42; Thu, 5 Mar 2015 00:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250bt2W086418; Thu, 5 Mar 2015 00:37:55 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250bt0l086417; Thu, 5 Mar 2015 00:37:55 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050037.t250bt0l086417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:37:55 +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: r279612 - stable/10/usr.sbin/bsdconfig/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:37:55 -0000 Author: dteske Date: Thu Mar 5 00:37:54 2015 New Revision: 279612 URL: https://svnweb.freebsd.org/changeset/base/279612 Log: MFC r278467: Replace the only instance of sed(1) in bsdconfig(8) with awk(1). Modified: stable/10/usr.sbin/bsdconfig/share/keymap.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/keymap.subr Thu Mar 5 00:34:33 2015 (r279611) +++ stable/10/usr.sbin/bsdconfig/share/keymap.subr Thu Mar 5 00:37:54 2015 (r279612) @@ -219,7 +219,7 @@ f_keymap_get_all() echo -n "$k " # NOTE: Translate '8x8' to '8x08' before sending to # sort(1) so that things work out as we might expect. - debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' + debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1' done | sort -k2 | awk '{ printf "%s%s", (started ? " " : ""), $1; started = 1 }' From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:39:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9EB0E81; Thu, 5 Mar 2015 00:39:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E7FC51; Thu, 5 Mar 2015 00:39:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250dGGL086656; Thu, 5 Mar 2015 00:39:16 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250dGwd086655; Thu, 5 Mar 2015 00:39:16 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050039.t250dGwd086655@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:39:16 +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: r279613 - stable/10/usr.sbin/bsdconfig/includes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:39:16 -0000 Author: dteske Date: Thu Mar 5 00:39:15 2015 New Revision: 279613 URL: https://svnweb.freebsd.org/changeset/base/279613 Log: MFC r278470: Add new alias "bsdconfig api" (same as "bsdconfig includes") NB: My fingers like typing "api" a lot more than "includes" Modified: stable/10/usr.sbin/bsdconfig/includes/INDEX Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/INDEX Thu Mar 5 00:37:54 2015 (r279612) +++ stable/10/usr.sbin/bsdconfig/includes/INDEX Thu Mar 5 00:39:15 2015 (r279613) @@ -45,6 +45,7 @@ menu_help="" # can be i18n'ed but `command' is the name of a script. # menu_selection="includes|includes" +menu_selection="api|includes" # # ------------ Items below this line do NOT need i18n translation ------------ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:40:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38B46FBE; Thu, 5 Mar 2015 00:40:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 229E0C5D; Thu, 5 Mar 2015 00:40:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250eKsJ087381; Thu, 5 Mar 2015 00:40:20 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250eK9e087380; Thu, 5 Mar 2015 00:40:20 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050040.t250eK9e087380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:40:19 +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: r279614 - stable/10/usr.sbin/bsdconfig/networking/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:40:20 -0000 Author: dteske Date: Thu Mar 5 00:40:19 2015 New Revision: 279614 URL: https://svnweb.freebsd.org/changeset/base/279614 Log: MFC r278483: Comments. Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/networking/share/device.subr Thu Mar 5 00:39:15 2015 (r279613) +++ stable/10/usr.sbin/bsdconfig/networking/share/device.subr Thu Mar 5 00:40:19 2015 (r279614) @@ -207,7 +207,7 @@ f_dialog_menu_netdev_edit() '3 $msg_ipaddr4' '$ipaddr' '4 $msg_netmask' '$netmask' '5 $msg_options' '$options' - " + " # END-QUOTE eval f_dialog_menu_size height width rows \ \"\$DIALOG_TITLE\" \ \"\$DIALOG_BACKTITLE\" \ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:41:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BEB817E; Thu, 5 Mar 2015 00:41:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75D3ACF8; Thu, 5 Mar 2015 00:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250f4XP089861; Thu, 5 Mar 2015 00:41:04 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250f4iN089860; Thu, 5 Mar 2015 00:41:04 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050041.t250f4iN089860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:41:04 +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: r279615 - stable/10/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:41:04 -0000 Author: dteske Date: Thu Mar 5 00:41:03 2015 New Revision: 279615 URL: https://svnweb.freebsd.org/changeset/base/279615 Log: MFC r278488: Whitespace. Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr Thu Mar 5 00:40:19 2015 (r279614) +++ stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr Thu Mar 5 00:41:03 2015 (r279615) @@ -830,8 +830,7 @@ f_user_delete() f_eval_catch $funcname \ pw '%s -H 0' "$cmd" else - f_eval_catch $funcname \ - pw '%s -h -' "$cmd" + f_eval_catch $funcname pw '%s -h -' "$cmd" fi fi fi From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:42:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53B342BC; Thu, 5 Mar 2015 00:42:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D44CD07; Thu, 5 Mar 2015 00:42:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250g8th090677; Thu, 5 Mar 2015 00:42:08 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250g7AA090671; Thu, 5 Mar 2015 00:42:07 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050042.t250g7AA090671@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:42: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: r279616 - in stable/10/usr.sbin/bsdconfig/timezone: . share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:42:08 -0000 Author: dteske Date: Thu Mar 5 00:42:06 2015 New Revision: 279616 URL: https://svnweb.freebsd.org/changeset/base/279616 Log: MFC r278489: Eliminate sub-shells where possible for performance. Modified: stable/10/usr.sbin/bsdconfig/timezone/share/continents.subr stable/10/usr.sbin/bsdconfig/timezone/share/countries.subr stable/10/usr.sbin/bsdconfig/timezone/timezone Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/timezone/share/continents.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/share/continents.subr Thu Mar 5 00:41:03 2015 (r279615) +++ stable/10/usr.sbin/bsdconfig/timezone/share/continents.subr Thu Mar 5 00:42:06 2015 (r279616) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1 # -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ export continent_utc_title ############################################################ FUNCTIONS -# f_continent $cont $property +# f_continent $cont $property [$var_to_set] # # Returns a single property of a given continent. Available properties are: # @@ -102,37 +102,60 @@ export continent_utc_title # (which appears after continent selection). # menu_list Menu-list of regions for this continent. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_continent() { - local cont="$1" property="$2" - eval echo \"\${continent_${cont}_$property}\" + f_getvar "continent_${1}_$2" $3 } -# f_find_continent $title +# f_find_continent $title [$var_to_set] # # Returns continent identifier given continent title. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_find_continent() { - local cont - for cont in $CONTINENTS; do - if [ "$1" = "$( f_continent $cont title )" ]; then - echo "$cont" + local __cont __title + for __cont in $CONTINENTS; do + f_continent $__cont title __title + if [ "$1" = "$__title" ]; then + if [ "$2" ]; then + setvar "$2" $__cont + else + echo "$__cont" + fi return $SUCCESS fi done return $FAILURE } -# f_OCEANP $cont +# f_OCEANP $cont [$var_to_set] # # Returns "1" if the first argument is an ocean, otherwise NULL. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_OCEANP() { case "$1" in arctic|atlantic|indian|pacific) - echo 1 + if [ "$2" ]; then + setvar "$2" 1 + else + echo 1 + fi + ;; + *) + [ "$2" ] && setvar "$2" "" esac } Modified: stable/10/usr.sbin/bsdconfig/timezone/share/countries.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/share/countries.subr Thu Mar 5 00:41:03 2015 (r279615) +++ stable/10/usr.sbin/bsdconfig/timezone/share/countries.subr Thu Mar 5 00:42:06 2015 (r279616) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1 # -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,8 +25,10 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ FUNCTIONS -# f_country $code $property +# f_country $code $property [$var_to_set] # # Returns a single property of a given country. Available properties are: # @@ -44,10 +46,13 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # descr_N Like name, but for the Nth zone when the country has # multiple zones (nzones > 0) # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_country() { - local code="$1" property="$2" - eval echo \"\${country_${code}_$property}\" + f_getvar "country_${1}_$2" $3 } # f_sort_countries @@ -59,22 +64,42 @@ f_country() # afterward is the sh(1) function which utilizes the below awk script. # f_sort_countries_awk=' +function _asorti(src, dest) { - split($0, array, /[[:space:]]+/) + k = nitems = 0 + for (i in src) dest[++nitems] = i + for (i = 1; i <= nitems; k = i++) { + idx = dest[i] + while ((k > 0) && (dest[k] > idx)) { + dest[k+1] = dest[k]; k-- + } + dest[k+1] = idx + } + return nitems +} +BEGIN { + split(ENVIRON["COUNTRIES"], array, /[[:space:]]+/) for (item in array) { tlc = array[item] - print ENVIRON["country_" tlc "_name"] " " tlc + name = ENVIRON["country_" tlc "_name"] + countries[name] = tlc } + n = _asorti(countries, sorted_countries) + for (i = 1; i <= n; i++) + print countries[sorted_countries[i]] + exit } ' f_sort_countries() { - COUNTRIES=$( echo "$COUNTRIES" | awk "$f_sort_countries_awk" | - sort | awk '{print $NF}' ) - export COUNTRIES + export COUNTRIES # for awk(1) ENVIRON[] visibility + COUNTRIES=$( awk "$f_sort_countries_awk" ) + export COUNTRIES # Pedantic } +############################################################ MAIN + f_dprintf "%s: Successfully loaded." timezone/countries.subr fi # ! $_TIMEZONE_COUNTRIES_SUBR Modified: stable/10/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/timezone Thu Mar 5 00:41:03 2015 (r279615) +++ stable/10/usr.sbin/bsdconfig/timezone/timezone Thu Mar 5 00:42:06 2015 (r279616) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2011-2013 Devin Teske +# Copyright (c) 2011-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -277,8 +277,8 @@ f_make_menus # creates $continen # # Launch application main menu # -defaultctry="" -defaultzone="" +defaultctry= +defaultzone= NEED_CONTINENT=1 NEED_COUNTRY=1 while :; do @@ -296,10 +296,10 @@ while :; do continent=$( eval f_dialog_menutag2item \"\$mtag\" \ $continent_menu_list ) - cont=$( f_find_continent "$continent" ) - cont_title=$( f_continent $cont title ) - nitems=$( f_continent $cont nitems ) - isocean=$( f_OCEANP $cont ) + f_find_continent "$continent" cont + f_continent $cont title cont_title + f_continent $cont nitems nitems + f_OCEANP $cont isocean fi if [ "$NEED_COUNTRY" ]; then @@ -342,7 +342,7 @@ while :; do # # Calculate size of menu # - menu_list=$( f_continent $cont menu_list ) + f_continent $cont menu_list menu_list eval f_dialog_menu_size height width rows \ \"\$title\" \ \"\$btitle\" \ @@ -375,7 +375,7 @@ while :; do fi # Get the country code from the user's selection - tlc=$( f_continent $cont tlc_$tag ) + f_continent $cont tlc_$tag tlc NEED_COUNTRY= fi @@ -384,12 +384,12 @@ while :; do # If the selection has only one zone (nzones == -1), # just set it. # - nzones=$( f_country $tlc nzones ) + f_country $tlc nzones nzones if [ $nzones -lt 0 ]; then - real_cont=$( f_country $tlc cont ) - real_continent=$( f_continent $real_cont name ) - name=$( f_country $tlc name ) - filename=$( f_country $tlc filename ) + f_country $tlc cont real_cont + f_continent $real_cont name real_continent + f_country $tlc name name + f_country $tlc filename filename if ! f_confirm_zone "$real_continent/$filename"; then [ $nitems -eq 1 ] && NEED_CONTINENT=1 @@ -397,13 +397,13 @@ while :; do continue fi else - f_sprintf title "$msg_country_time_zones" \ - "$( f_country $tlc name )" + f_country $tlc name name + f_sprintf title "$msg_country_time_zones" "$name" f_dialog_title "$title" title="$DIALOG_TITLE" btitle="$DIALOG_BACKTITLE" f_dialog_title_restore prompt="$msg_select_zone" - menu_list=$( f_country $tlc menu_list ) + f_country $tlc menu_list menu_list eval f_dialog_menu_size height width rows \ \"\$title\" \"\$btitle\" \"\$prompt\" \"\" $menu_list @@ -432,10 +432,10 @@ while :; do continue fi - real_cont=$( f_country $tlc cont_$n ) - real_continent=$( f_continent $real_cont name ) - name=$( f_country $tlc name ) - filename=$( f_country $tlc filename_$n ) + f_country $tlc cont_$n real_cont + f_continent $real_cont name real_continent + f_country $tlc name name + f_country $tlc filename_$n filename f_confirm_zone "$real_continent/$filename" || continue fi From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:42:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B6833F4; Thu, 5 Mar 2015 00:42:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B808D12; Thu, 5 Mar 2015 00:42:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250gxS7090836; Thu, 5 Mar 2015 00:42:59 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250gxoe090835; Thu, 5 Mar 2015 00:42:59 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050042.t250gxoe090835@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:42:59 +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: r279617 - stable/10/usr.sbin/bsdconfig/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:42:59 -0000 Author: dteske Date: Thu Mar 5 00:42:58 2015 New Revision: 279617 URL: https://svnweb.freebsd.org/changeset/base/279617 Log: MFC r278490: Add bsdconfig api functions f_dialog_pause()/f_dialog_pause_no_cancel() Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Mar 5 00:42:06 2015 (r279616) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Mar 5 00:42:58 2015 (r279617) @@ -1580,6 +1580,56 @@ f_xdialog_info() -1 # timeout of -1 means abort when EOF on stdin } +############################################################ PAUSE FUNCTIONS + +# f_dialog_pause $msg_text $duration [$hline] +# +# Display a message in a widget with a progress bar that runs backward for +# $duration seconds. +# +f_dialog_pause() +{ + local pause_text="$1" duration="$2" hline="$3" height width + f_isinteger "$duration" || return $FAILURE + f_dialog_buttonbox_size height width \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$pause_text" "$hline" + if [ "$USE_XDIALOG" ]; then + $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --ok-label "$msg_skip" \ + --cancel-label "$msg_cancel" \ + ${noCancel:+--no-cancel} \ + --timeout "$duration" \ + --yesno "$pause_text" \ + $height $width + else + [ $duration -gt 0 ] && duration=$(( $duration - 1 )) + [ $duration -gt 1 ] && duration=$(( $duration - 1 )) + height=$(( $height + 3 )) # Add height for progress bar + $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_skip" \ + --cancel-label "$msg_cancel" \ + ${noCancel:+--no-cancel} \ + --pause "$pause_text" \ + $height $width "$duration" + fi +} + +# f_dialog_pause_no_cancel $msg_text $duration [$hline] +# +# Display a message in a widget with a progress bar that runs backward for +# $duration seconds. No cancel button is provided. Always returns success. +# +f_dialog_pause_no_cancel() +{ + noCancel=1 f_dialog_pause "$@" + return $SUCCESS +} + ############################################################ MSGBOX FUNCTIONS # f_dialog_msgbox $msg_text [$hline] From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:43:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFD1B564; Thu, 5 Mar 2015 00:43:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9C6BD1F; Thu, 5 Mar 2015 00:43:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250hpVu091018; Thu, 5 Mar 2015 00:43:51 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250hpFP091017; Thu, 5 Mar 2015 00:43:51 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050043.t250hpFP091017@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:43:51 +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: r279618 - stable/10/usr.sbin/bsdconfig/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:43:52 -0000 Author: dteske Date: Thu Mar 5 00:43:50 2015 New Revision: 279618 URL: https://svnweb.freebsd.org/changeset/base/279618 Log: MFC r278491: Add bsdconfig api function f_dialog_menutag2help() Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Mar 5 00:42:58 2015 (r279617) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Mar 5 00:43:50 2015 (r279618) @@ -2116,6 +2116,39 @@ f_dialog_menutag2index_with_help() return $FAILURE } +# f_dialog_menutag2help $tag_chosen $tag1 $item1 $help1 $tag2 $item2 $help2 ... +# +# To use the `--menu' option of dialog(1) with the `--item-help' option, you +# must pass an ordered list of tag/item/help triplets on the command-line. When +# the user selects a menu option the tag for that item is printed to stderr. +# +# This function allows you to dereference the tag chosen by the user back into +# the help associated with said tag (item is discarded/ignored). +# +# Pass the tag chosen by the user as the first argument, followed by the +# ordered list of tag/item/help triplets (HINT: use the same tag/item/help list +# as was passed to dialog(1) for consistency). +# +# If the tag cannot be found, NULL is returned. +# +f_dialog_menutag2help() +{ + local tag="$1" tagn help + shift 1 # tag + + while [ $# -gt 0 ]; do + tagn="$1" + help="$3" + shift 3 # tagn/item/help + + if [ "$tag" = "$tagn" ]; then + echo "$help" + return $SUCCESS + fi + done + return $FAILURE +} + ############################################################ INIT FUNCTIONS # f_dialog_init From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:44:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76D93699; Thu, 5 Mar 2015 00:44:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F546D29; Thu, 5 Mar 2015 00:44:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250iqSL091255; Thu, 5 Mar 2015 00:44:52 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250iond091243; Thu, 5 Mar 2015 00:44:50 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050044.t250iond091243@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:44: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: r279619 - in stable/10/usr.sbin/bsdconfig: console includes networking/share share usermgmt/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:44:52 -0000 Author: dteske Date: Thu Mar 5 00:44:50 2015 New Revision: 279619 URL: https://svnweb.freebsd.org/changeset/base/279619 Log: MFC r278493: Update copyrights. Modified: stable/10/usr.sbin/bsdconfig/console/INDEX stable/10/usr.sbin/bsdconfig/includes/INDEX stable/10/usr.sbin/bsdconfig/networking/share/device.subr stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/keymap.subr stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- stable/10/usr.sbin/bsdconfig/console/INDEX Thu Mar 5 00:43:50 2015 (r279618) +++ stable/10/usr.sbin/bsdconfig/console/INDEX Thu Mar 5 00:44:50 2015 (r279619) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: stable/10/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/INDEX Thu Mar 5 00:43:50 2015 (r279618) +++ stable/10/usr.sbin/bsdconfig/includes/INDEX Thu Mar 5 00:44:50 2015 (r279619) @@ -1,4 +1,4 @@ -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/networking/share/device.subr Thu Mar 5 00:43:50 2015 (r279618) +++ stable/10/usr.sbin/bsdconfig/networking/share/device.subr Thu Mar 5 00:44:50 2015 (r279619) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1 # -# Copyright (c) 2006-2013 Devin Teske +# Copyright (c) 2006-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Mar 5 00:43:50 2015 (r279618) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Mar 5 00:44:50 2015 (r279619) @@ -1,6 +1,6 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 # -# Copyright (c) 2006-2014 Devin Teske +# Copyright (c) 2006-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: stable/10/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/keymap.subr Thu Mar 5 00:43:50 2015 (r279618) +++ stable/10/usr.sbin/bsdconfig/share/keymap.subr Thu Mar 5 00:44:50 2015 (r279619) @@ -1,6 +1,6 @@ if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1 # -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr Thu Mar 5 00:43:50 2015 (r279618) +++ stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr Thu Mar 5 00:44:50 2015 (r279619) @@ -1,7 +1,7 @@ if [ ! "$_USERMGMT_USER_SUBR" ]; then _USERMGMT_USER_SUBR=1 # # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2014 Devin Teske +# Copyright (c) 2012-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 01:49:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 427EEE1B; Thu, 5 Mar 2015 01:49:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11B352EF; Thu, 5 Mar 2015 01:49:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t251nw0d020098; Thu, 5 Mar 2015 01:49:58 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t251nwGQ020097; Thu, 5 Mar 2015 01:49:58 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503050149.t251nwGQ020097@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 5 Mar 2015 01:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279620 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 01:49:59 -0000 Author: loos Date: Thu Mar 5 01:49:58 2015 New Revision: 279620 URL: https://svnweb.freebsd.org/changeset/base/279620 Log: Add a bus_probe_nomatch() method for gpiobus/ofw_gpiobus. This prints a warning when your system have a hinted child or a FDT child node for which you don't have a matching driver: gpiobus0: at pin(s) 24 irq 24 Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Mar 5 00:44:50 2015 (r279619) +++ head/sys/dev/gpio/gpiobus.c Thu Mar 5 01:49:58 2015 (r279620) @@ -53,6 +53,7 @@ static int gpiobus_attach(device_t); static int gpiobus_detach(device_t); static int gpiobus_suspend(device_t); static int gpiobus_resume(device_t); +static void gpiobus_probe_nomatch(device_t, device_t); static int gpiobus_print_child(device_t, device_t); static int gpiobus_child_location_str(device_t, device_t, char *, size_t); static int gpiobus_child_pnpinfo_str(device_t, device_t, char *, size_t); @@ -363,6 +364,20 @@ gpiobus_resume(device_t dev) return (bus_generic_resume(dev)); } +static void +gpiobus_probe_nomatch(device_t dev, device_t child) +{ + char pins[128]; + struct gpiobus_ivar *devi; + + devi = GPIOBUS_IVAR(child); + memset(pins, 0, sizeof(pins)); + gpiobus_print_pins(devi, pins, sizeof(pins)); + device_printf(dev, " at pin(s) %s", pins); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + printf("\n"); +} + static int gpiobus_print_child(device_t dev, device_t child) { @@ -670,6 +685,7 @@ static device_method_t gpiobus_methods[] DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), DEVMETHOD(bus_add_child, gpiobus_add_child), + DEVMETHOD(bus_probe_nomatch, gpiobus_probe_nomatch), DEVMETHOD(bus_print_child, gpiobus_print_child), DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, gpiobus_child_location_str), From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 02:54:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 628D0866; Thu, 5 Mar 2015 02:54:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4373ABA4; Thu, 5 Mar 2015 02:54:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t252sVcC051885; Thu, 5 Mar 2015 02:54:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t252sVwp051883; Thu, 5 Mar 2015 02:54:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503050254.t252sVwp051883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 5 Mar 2015 02:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279621 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 02:54:31 -0000 Author: loos Date: Thu Mar 5 02:54:30 2015 New Revision: 279621 URL: https://svnweb.freebsd.org/changeset/base/279621 Log: Change ofw_gpiobus_destroy_devinfo() to unmap the GPIO pins and then rework the code a little bit to use this function consistently to cleanup all the changes made as part of the probe phase. This fixes an issue where a FDT child node without a matching driver could leave the GPIO pins mapped and prevent the further use of them. Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu Mar 5 01:49:58 2015 (r279620) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu Mar 5 02:54:30 2015 (r279621) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_gpiobus_devinfo *ofw_gpiobus_setup_devinfo(device_t, device_t, phandle_t); -static void ofw_gpiobus_destroy_devinfo(struct ofw_gpiobus_devinfo *); +static void ofw_gpiobus_destroy_devinfo(device_t, struct ofw_gpiobus_devinfo *); static int ofw_gpiobus_parse_gpios_impl(device_t, phandle_t, char *, struct gpiobus_softc *, struct gpiobus_pin **); @@ -63,7 +63,7 @@ ofw_gpiobus_add_fdt_child(device_t bus, return (NULL); } if (device_probe_and_attach(childdev) != 0) { - ofw_gpiobus_destroy_devinfo(dinfo); + ofw_gpiobus_destroy_devinfo(bus, dinfo); device_delete_child(bus, childdev); return (NULL); } @@ -117,41 +117,50 @@ ofw_gpiobus_setup_devinfo(device_t bus, } /* Parse the gpios property for the child. */ npins = ofw_gpiobus_parse_gpios_impl(child, node, "gpios", sc, &pins); - if (npins <= 0) - goto fail; + if (npins <= 0) { + ofw_bus_gen_destroy_devinfo(&dinfo->opd_obdinfo); + free(dinfo, M_DEVBUF); + return (NULL); + } + /* Initialize the irq resource list. */ + resource_list_init(&dinfo->opd_dinfo.rl); + /* Allocate the child ivars and copy the parsed pin data. */ devi = &dinfo->opd_dinfo; devi->npins = (uint32_t)npins; if (gpiobus_alloc_ivars(devi) != 0) { free(pins, M_DEVBUF); - goto fail; + ofw_gpiobus_destroy_devinfo(bus, dinfo); + return (NULL); } for (i = 0; i < devi->npins; i++) { devi->flags[i] = pins[i].flags; devi->pins[i] = pins[i].pin; } free(pins, M_DEVBUF); - /* And now the interrupt resources. */ - resource_list_init(&dinfo->opd_dinfo.rl); + /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl) != 0) { - gpiobus_free_ivars(devi); - goto fail; + ofw_gpiobus_destroy_devinfo(bus, dinfo); + return (NULL); } device_set_ivars(child, dinfo); return (dinfo); - -fail: - ofw_bus_gen_destroy_devinfo(&dinfo->opd_obdinfo); - free(dinfo, M_DEVBUF); - return (NULL); } static void -ofw_gpiobus_destroy_devinfo(struct ofw_gpiobus_devinfo *dinfo) +ofw_gpiobus_destroy_devinfo(device_t bus, struct ofw_gpiobus_devinfo *dinfo) { + int i; struct gpiobus_ivar *devi; + struct gpiobus_softc *sc; + sc = device_get_softc(bus); devi = &dinfo->opd_dinfo; + for (i = 0; i < devi->npins; i++) { + if (devi->pins[i] > sc->sc_npins) + continue; + sc->sc_pins_mapped[devi->pins[i]] = 0; + } gpiobus_free_ivars(devi); resource_list_free(&dinfo->opd_dinfo.rl); ofw_bus_gen_destroy_devinfo(&dinfo->opd_obdinfo); From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 03:11:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2037B5; Thu, 5 Mar 2015 03:11:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C33C9E9A; Thu, 5 Mar 2015 03:11:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t253Bmve061775; Thu, 5 Mar 2015 03:11:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t253BmSG061772; Thu, 5 Mar 2015 03:11:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503050311.t253BmSG061772@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 5 Mar 2015 03:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279622 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 03:11:49 -0000 Author: loos Date: Thu Mar 5 03:11:47 2015 New Revision: 279622 URL: https://svnweb.freebsd.org/changeset/base/279622 Log: Use the child device name here is lame because at the point that this happens, the child device is not yet specified. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Mar 5 02:54:30 2015 (r279621) +++ head/sys/dev/gpio/gpiobus.c Thu Mar 5 03:11:47 2015 (r279622) @@ -230,21 +230,20 @@ gpiobus_free_ivars(struct gpiobus_ivar * } int -gpiobus_map_pin(device_t bus, device_t child, uint32_t pin) +gpiobus_map_pin(device_t bus, uint32_t pin) { struct gpiobus_softc *sc; sc = device_get_softc(bus); /* Consistency check. */ if (pin >= sc->sc_npins) { - device_printf(child, + device_printf(bus, "invalid pin %d, max: %d\n", pin, sc->sc_npins - 1); return (-1); } /* Mark pin as mapped and give warning if it's already mapped. */ if (sc->sc_pins_mapped[pin]) { - device_printf(child, - "warning: pin %d is already mapped\n", pin); + device_printf(bus, "warning: pin %d is already mapped\n", pin); return (-1); } sc->sc_pins_mapped[pin] = 1; @@ -277,7 +276,7 @@ gpiobus_parse_pins(struct gpiobus_softc if ((mask & (1 << i)) == 0) continue; /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(sc->sc_busdev, child, i) != 0) { + if (gpiobus_map_pin(sc->sc_busdev, i) != 0) { gpiobus_free_ivars(devi); return (EINVAL); } Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu Mar 5 02:54:30 2015 (r279621) +++ head/sys/dev/gpio/gpiobusvar.h Thu Mar 5 03:11:47 2015 (r279622) @@ -110,7 +110,7 @@ int gpiobus_detach_bus(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); -int gpiobus_map_pin(device_t, device_t, uint32_t); +int gpiobus_map_pin(device_t, uint32_t); extern driver_t gpiobus_driver; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu Mar 5 02:54:30 2015 (r279621) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu Mar 5 03:11:47 2015 (r279622) @@ -282,8 +282,7 @@ ofw_gpiobus_parse_gpios_impl(device_t co goto fail; } /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(bussc->sc_busdev, consumer, - (*pins)[j].pin) != 0) + if (gpiobus_map_pin(bussc->sc_busdev, (*pins)[j].pin) != 0) goto fail; j++; i += gpiocells + 1; From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 05:53:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0742D1E0; Thu, 5 Mar 2015 05:53:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5B00F71; Thu, 5 Mar 2015 05:53:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t255r987037293; Thu, 5 Mar 2015 05:53:09 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t255r8RV037291; Thu, 5 Mar 2015 05:53:08 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503050553.t255r8RV037291@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 5 Mar 2015 05:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279623 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 05:53:10 -0000 Author: nwhitehorn Date: Thu Mar 5 05:53:08 2015 New Revision: 279623 URL: https://svnweb.freebsd.org/changeset/base/279623 Log: Move IVOR setup from assembler to C, decreasing required assumptions about address formats for trap handlers. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/machdep.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Thu Mar 5 03:11:47 2015 (r279622) +++ head/sys/powerpc/booke/locore.S Thu Mar 5 05:53:08 2015 (r279623) @@ -536,42 +536,6 @@ __boot_page_padding: /* locore subroutines */ /************************************************************************/ -ivor_setup: - /* Set base address of interrupt handler routines */ - lis %r3, interrupt_vector_base@h - mtspr SPR_IVPR, %r3 - - /* Assign interrupt handler routines offsets */ - li %r3, int_critical_input@l - mtspr SPR_IVOR0, %r3 - li %r3, int_machine_check@l - mtspr SPR_IVOR1, %r3 - li %r3, int_data_storage@l - mtspr SPR_IVOR2, %r3 - li %r3, int_instr_storage@l - mtspr SPR_IVOR3, %r3 - li %r3, int_external_input@l - mtspr SPR_IVOR4, %r3 - li %r3, int_alignment@l - mtspr SPR_IVOR5, %r3 - li %r3, int_program@l - mtspr SPR_IVOR6, %r3 - li %r3, int_syscall@l - mtspr SPR_IVOR8, %r3 - li %r3, int_decrementer@l - mtspr SPR_IVOR10, %r3 - li %r3, int_fixed_interval_timer@l - mtspr SPR_IVOR11, %r3 - li %r3, int_watchdog@l - mtspr SPR_IVOR12, %r3 - li %r3, int_data_tlb_error@l - mtspr SPR_IVOR13, %r3 - li %r3, int_inst_tlb_error@l - mtspr SPR_IVOR14, %r3 - li %r3, int_debug@l - mtspr SPR_IVOR15, %r3 - blr - /* * void tid_flush(tlbtid_t tid); * Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Thu Mar 5 03:11:47 2015 (r279622) +++ head/sys/powerpc/booke/machdep.c Thu Mar 5 05:53:08 2015 (r279623) @@ -187,6 +187,51 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, void print_kernel_section_addr(void); void print_kenv(void); u_int booke_init(uint32_t, uint32_t); +void ivor_setup(void); + +extern void *interrupt_vector_base; +extern void *int_critical_input; +extern void *int_machine_check; +extern void *int_data_storage; +extern void *int_instr_storage; +extern void *int_external_input; +extern void *int_alignment; +extern void *int_program; +extern void *int_syscall; +extern void *int_decrementer; +extern void *int_fixed_interval_timer; +extern void *int_watchdog; +extern void *int_data_tlb_error; +extern void *int_inst_tlb_error; +extern void *int_debug; + +#define SET_TRAP(ivor, handler) \ + KASSERT(((uintptr_t)(&handler) & ~0xffffUL) == \ + ((uintptr_t)(&interrupt_vector_base) & ~0xffffUL), \ + ("Handler " #handler " too far from interrupt vector base")); \ + mtspr(ivor, (uintptr_t)(&handler) & 0xffffUL); + +void +ivor_setup(void) +{ + + mtspr(SPR_IVPR, ((uintptr_t)&interrupt_vector_base) & 0xffff0000); + + SET_TRAP(SPR_IVOR0, int_critical_input); + SET_TRAP(SPR_IVOR1, int_machine_check); + SET_TRAP(SPR_IVOR2, int_data_storage); + SET_TRAP(SPR_IVOR3, int_instr_storage); + SET_TRAP(SPR_IVOR4, int_external_input); + SET_TRAP(SPR_IVOR5, int_alignment); + SET_TRAP(SPR_IVOR6, int_program); + SET_TRAP(SPR_IVOR8, int_syscall); + SET_TRAP(SPR_IVOR10, int_decrementer); + SET_TRAP(SPR_IVOR11, int_fixed_interval_timer); + SET_TRAP(SPR_IVOR12, int_watchdog); + SET_TRAP(SPR_IVOR13, int_data_tlb_error); + SET_TRAP(SPR_IVOR14, int_inst_tlb_error); + SET_TRAP(SPR_IVOR15, int_debug); +} static void cpu_booke_startup(void *dummy) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 05:54:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2C79336; Thu, 5 Mar 2015 05:54:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3959F8A; Thu, 5 Mar 2015 05:54:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t255sZqZ037497; Thu, 5 Mar 2015 05:54:35 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t255sZnx037495; Thu, 5 Mar 2015 05:54:35 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050554.t255sZnx037495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 05:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279624 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 05:54:36 -0000 Author: dteske Date: Thu Mar 5 05:54:34 2015 New Revision: 279624 URL: https://svnweb.freebsd.org/changeset/base/279624 Log: sysrc(8): Add `key-=remove' and improve `key+=append' syntax MFC after: 3 days X-MFC-to: stable/10 stable/9 Modified: head/usr.sbin/sysrc/sysrc head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Thu Mar 5 05:53:08 2015 (r279623) +++ head/usr.sbin/sysrc/sysrc Thu Mar 5 05:54:34 2015 (r279624) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2014 Devin Teske +# Copyright (c) 2010-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.2 Nov-3,2014" +SYSRC_VERSION="6.3 Mar-4,2015" # # Options @@ -94,7 +94,7 @@ help() local optfmt="\t%-11s%s\n" local envfmt="\t%-17s%s\n" - f_err "Usage: %s [OPTIONS] name[[+]=value] ...\n" "$pgm" + f_err "Usage: %s [OPTIONS] name[[+|-]=value] ...\n" "$pgm" f_err "OPTIONS:\n" f_err "$optfmt" "-a" \ @@ -531,6 +531,7 @@ while [ $# -gt 0 ]; do case "$NAME" in *+) mode=APPEND NAME="${NAME%+}" ;; + *-) mode=REMOVE NAME="${NAME%-}" ;; *) mode=ASSIGN esac @@ -594,29 +595,70 @@ while [ $# -gt 0 ]; do fi # - # If `-N' is passed, simplify the output + # Determine both `before' value and appropriate `new' value # - if [ ! "$SHOW_VALUE" ]; then - echo "$NAME" - case "$mode" in - APPEND) - before=$( f_sysrc_get "$NAME" ) - f_sysrc_set "$NAME" "$before${1#*=}" - ;; - *) - f_sysrc_set "$NAME" "${1#*=}" + case "$mode" in + APPEND) + before=$( f_sysrc_get "$NAME" ) + add="${1#*=}" + delim="${add%"${add#?}"}" # first character + oldIFS="$IFS" + case "$delim" in + ""|[$IFS]|[a-zA-Z0-9]) delim=" " ;; + *) IFS="$delim" esac - else + new="$before" + for a in $add; do + [ "$a" ] || continue + skip= + for b in $before; do + [ "$b" = "$a" ] && skip=1 break + done + [ "$skip" ] || new="$new$delim$a" + done + new="${new#"$delim"}" IFS="$oldIFS" + unset add delim oldIFS a skip b + [ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" ) + ;; + REMOVE) + before=$( f_sysrc_get "$NAME" ) + remove="${1#*=}" + delim="${remove%"${remove#?}"}" # first character + oldIFS="$IFS" + case "$delim" in + ""|[$IFS]|[a-zA-Z0-9]) delim=" " ;; + *) IFS="$delim" + esac + new= + for b in $before; do + [ "$b" ] || continue + add=1 + for r in $remove; do + [ "$r" = "$b" ] && add= break + done + [ "$add" ] && new="$new$delim$b" + done + new="${new#"$delim"}" IFS="$oldIFS" + unset remove delim oldIFS b add r + [ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" ) + ;; + *) if [ "$SHOW_FILE" ]; then before=$( f_sysrc_find "$NAME" ) else before=$( f_sysrc_get "$NAME" ) fi - if case "$mode" in - APPEND) f_sysrc_set "$NAME" "$before${1#*=}" ;; - *) f_sysrc_set "$NAME" "${1#*=}" - esac - then + new="${1#*=}" + esac + + # + # If `-N' is passed, simplify the output + # + if [ ! "$SHOW_VALUE" ]; then + echo "$NAME" + f_sysrc_set "$NAME" "$new" + else + if f_sysrc_set "$NAME" "$new"; then if [ "$SHOW_FILE" ]; then after=$( f_sysrc_find "$NAME" ) else Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Thu Mar 5 05:53:08 2015 (r279623) +++ head/usr.sbin/sysrc/sysrc.8 Thu Mar 5 05:54:34 2015 (r279624) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2014 Devin Teske +.\" Copyright (c) 2011-2015 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2014 +.Dd March 4, 2015 .Dt SYSRC 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Op Fl cdDeFhinNqvx .Op Fl f Ar file .Op Fl j Ar jail | Fl R Ar dir -.Ar name Ns Op Ns Oo + Oc Ns = Ns Ar value +.Ar name Ns Op Ns Oo +|- Oc Ns = Ns Ar value .Ar ... .Nm .Op Fl cdDeFhinNqvx @@ -136,9 +136,14 @@ and also has the same .Ql name[=value] syntax for making queries/assignments. In addition -.Pq unlike Xr sysctl 8 , +.Pq but unlike Xr sysctl 8 , .Ql name+=value -is supported for appending values. +is supported for adding items to values +.Pq see APPENDING VALUES +and +.Ql name-=value +is supported for removing items from values +.Pq see SUBTRACTING VALUES . .Pp However, while .Xr sysctl 8 @@ -187,6 +192,115 @@ modifying these integral files (yet taki grow unwieldy should .Nm be called repeatedly). +.Sh APPENDING VALUES +When using the +.Ql key+=value +syntax to add items to existing values, +the first character of the value is taken as the delimiter separating items +.Pq usually Qo \ Qc or Qo , Qc . +For example, in the following statement: +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces+=" gif0" +.El +.Pp +the first character is a space, informing +.Nm +that existing values are to be considered separated by whitespace. +If +.Ql gif0 +is not found in the existing value for +.Va cloned_interfaces , +it is added +.Pq with delimiter only if existing value is non-NULL . +.Pp +For convenience, if the first character is alpha-numeric +.Pq letters A-Z, a-z, or numbers 0-9 , +.Nm +uses the default setting of whitespace as separator. +For example, the above and below statements are equivalent since +.Dq gif0 +starts with an alpha-numeric character +.Pq the letter Li g : +.Pp +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces+=gif0 +.El +.Pp +Take the following sequence for example: +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces= # start with NULL +.It \ +.Nm +cloned_interfaces+=gif0 +.Dl # NULL -> `gif0' Pq NB: no preceding delimiter +.It \ +.Nm +cloned_interfaces+=gif0 # no change +.It \ +.Nm +cloned_interfaces+="tun0 gif0" +.Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication +.El +.Pp +.Nm +prevents the same value from being added if already there. +.Sh SUBTRACTING VALUES +When using the +.Ql key-=value +syntax to remove items from existing values, +the first character of the value is taken as the delimiter separating items +.Pq usually Qo \ Qc or Qo , Qc . +For example, in the following statement: +.Pp +.Dl Nm cloned_interfaces-=" gif0" +.Pp +the first character is a space, informing +.Nm +that existing values are to be considered separated by whitespace. +If +.Ql gif0 +is found in the existing value for +.Va cloned_interfaces , +it is removed +.Pq extra delimiters removed . +.Pp +For convenience, if the first character is alpha-numeric +.Pq letters A-Z, a-z, or numbers 0-9 , +.Nm +uses the default setting of whitespace as separator. +For example, the above and below statements are equivalent since +.Dq gif0 +starts with an alpha-numeric character +.Pq the letter Li g : +.Pp +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces-=gif0 +.El +.Pp +Take the following sequence for example: +.Bl -tag -width indent+ +.It \ +.Nm +foo="bar baz" # start +.It \ +.Nm +foo-=bar # `bar baz' -> `baz' +.It \ +.Nm +foo-=baz # `baz' -> NULL +.El +.Pp +.Nm +removes all occurrences of all items provided +and collapses extra delimiters between items. .Sh ENVIRONMENT The following environment variables are referenced by .Nm : @@ -250,8 +364,12 @@ Working on other files, such as Appending to existing values: .Pp .Nm -\&cloned_interfaces+=" gif0" -.Dl appends Qo \ gif0 Qc to $cloned_interfaces . +\&cloned_interfaces+=gif0 +.Dl appends Qo gif0 Qc to $cloned_interfaces Pq see APPENDING VALUES . +.Pp +.Nm +\&cloned_interfaces-=gif0 +.Dl removes Qo gif0 Qc from $cloned_interfaces Pq see SUBTRACTING VALUES . .Pp In addition to the above syntax, .Nm From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 07:40:42 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8340AD50; Thu, 5 Mar 2015 07:40:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E9D4AF2; Thu, 5 Mar 2015 07:40:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t257eg4L087206; Thu, 5 Mar 2015 07:40:42 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t257eg2E087205; Thu, 5 Mar 2015 07:40:42 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201503050740.t257eg2E087205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Thu, 5 Mar 2015 07:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279626 - head/sys/cddl/dev/fbt/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 07:40:42 -0000 Author: rwatson Date: Thu Mar 5 07:40:41 2015 New Revision: 279626 URL: https://svnweb.freebsd.org/changeset/base/279626 Log: Don't all DTrace's FBT on ARM to instrument undefinedinstruction(), as this would lead to DTrace reentrance. Sponsored by: DARPA, AFRL Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Thu Mar 5 07:30:48 2015 (r279625) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Thu Mar 5 07:40:41 2015 (r279626) @@ -105,6 +105,13 @@ fbt_provide_module_function(linker_file_ if (name[0] == '_' && name[1] == '_') return (0); + /* + * Architecture-specific exclusion list, largely to do with FBT trap + * processing, to prevent reentrance. + */ + if (strcmp(name, "undefinedinstruction") == 0) + return (0); + instr = (uint32_t *)symval->value; limit = (uint32_t *)(symval->value + symval->size); From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:00:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A2FF90A; Thu, 5 Mar 2015 09:00:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25D2F2E4; Thu, 5 Mar 2015 09:00:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2590RFa024626; Thu, 5 Mar 2015 09:00:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2590R8p024625; Thu, 5 Mar 2015 09:00:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503050900.t2590R8p024625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Mar 2015 09:00:27 +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: r279631 - stable/10/lib/libstdthreads X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:00:28 -0000 Author: kib Date: Thu Mar 5 09:00:27 2015 New Revision: 279631 URL: https://svnweb.freebsd.org/changeset/base/279631 Log: MFC r279318: Check that the pointer to the thread return value is not NULL before dereferencing. NULL is allowed by C11 and must be handled. Modified: stable/10/lib/libstdthreads/thrd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstdthreads/thrd.c ============================================================================== --- stable/10/lib/libstdthreads/thrd.c Thu Mar 5 08:53:10 2015 (r279630) +++ stable/10/lib/libstdthreads/thrd.c Thu Mar 5 09:00:27 2015 (r279631) @@ -108,7 +108,8 @@ thrd_join(thrd_t thr, int *res) if (pthread_join(thr, &value_ptr) != 0) return (thrd_error); - *res = (intptr_t)value_ptr; + if (res != NULL) + *res = (intptr_t)value_ptr; return (thrd_success); } From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:01:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEB1AB42; Thu, 5 Mar 2015 09:01:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC3F393; Thu, 5 Mar 2015 09:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2591lhx025941; Thu, 5 Mar 2015 09:01:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2591lqb025940; Thu, 5 Mar 2015 09:01:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503050901.t2591lqb025940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Mar 2015 09:01:47 +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: r279632 - stable/10/lib/libstdthreads X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:01:47 -0000 Author: kib Date: Thu Mar 5 09:01:46 2015 New Revision: 279632 URL: https://svnweb.freebsd.org/changeset/base/279632 Log: MFC r279326: Use pthread_mutex_trylock(3) to implement mtx_trylock(3). Modified: stable/10/lib/libstdthreads/mtx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstdthreads/mtx.c ============================================================================== --- stable/10/lib/libstdthreads/mtx.c Thu Mar 5 09:00:27 2015 (r279631) +++ stable/10/lib/libstdthreads/mtx.c Thu Mar 5 09:01:46 2015 (r279632) @@ -96,7 +96,7 @@ int mtx_trylock(mtx_t *mtx) { - switch (pthread_mutex_lock(mtx)) { + switch (pthread_mutex_trylock(mtx)) { case 0: return (thrd_success); case EBUSY: From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:23:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF282FF2; Thu, 5 Mar 2015 09:23:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7BD7F7; Thu, 5 Mar 2015 09:23:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259NiQl035640; Thu, 5 Mar 2015 09:23:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259NiRq035639; Thu, 5 Mar 2015 09:23:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050923.t259NiRq035639@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:23: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: r279633 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:23:44 -0000 Author: hselasky Date: Thu Mar 5 09:23:43 2015 New Revision: 279633 URL: https://svnweb.freebsd.org/changeset/base/279633 Log: MFC r279241 and r279242: Fix debugging macros. Modified: stable/10/sys/sys/queue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/queue.h ============================================================================== --- stable/10/sys/sys/queue.h Thu Mar 5 09:01:46 2015 (r279632) +++ stable/10/sys/sys/queue.h Thu Mar 5 09:23:43 2015 (r279633) @@ -116,7 +116,7 @@ struct qm_trace { }; #define TRACEBUF struct qm_trace trace; -#define TRACEBUF_INITIALIZER { __FILE__, __LINE__, NULL, 0 } , +#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } , #define TRASHIT(x) do {(x) = (void *)-1;} while (0) #define QMD_SAVELINK(name, link) void **name = (void *)&(link) @@ -612,7 +612,7 @@ struct { \ TAILQ_NEXT((listelm), field) = (elm); \ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ @@ -622,7 +622,7 @@ struct { \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:27:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A55D91E8; Thu, 5 Mar 2015 09:27:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90C0681E; Thu, 5 Mar 2015 09:27:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259ReTp036174; Thu, 5 Mar 2015 09:27:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259RehA036173; Thu, 5 Mar 2015 09:27:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050927.t259RehA036173@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:27:40 +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: r279634 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:27:40 -0000 Author: hselasky Date: Thu Mar 5 09:27:39 2015 New Revision: 279634 URL: https://svnweb.freebsd.org/changeset/base/279634 Log: MFC r279241 and r279242: Fix debugging macros. Modified: stable/9/sys/sys/queue.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/queue.h ============================================================================== --- stable/9/sys/sys/queue.h Thu Mar 5 09:23:43 2015 (r279633) +++ stable/9/sys/sys/queue.h Thu Mar 5 09:27:39 2015 (r279634) @@ -610,7 +610,7 @@ struct { \ TAILQ_NEXT((listelm), field) = (elm); \ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ @@ -620,7 +620,7 @@ struct { \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:29:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AB3C31D; Thu, 5 Mar 2015 09:29:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6627F829; Thu, 5 Mar 2015 09:29:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259T6Pu036649; Thu, 5 Mar 2015 09:29:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259T6VH036648; Thu, 5 Mar 2015 09:29:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050929.t259T6VH036648@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r279635 - stable/8/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:29:06 -0000 Author: hselasky Date: Thu Mar 5 09:29:05 2015 New Revision: 279635 URL: https://svnweb.freebsd.org/changeset/base/279635 Log: MFC r279242: Fix debugging macros. Modified: stable/8/sys/sys/queue.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/sys/queue.h ============================================================================== --- stable/8/sys/sys/queue.h Thu Mar 5 09:27:39 2015 (r279634) +++ stable/8/sys/sys/queue.h Thu Mar 5 09:29:05 2015 (r279635) @@ -608,7 +608,7 @@ struct { \ TAILQ_NEXT((listelm), field) = (elm); \ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ @@ -618,7 +618,7 @@ struct { \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:31:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E99E473; Thu, 5 Mar 2015 09:31:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5CD8CE; Thu, 5 Mar 2015 09:31:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259Vb7h040482; Thu, 5 Mar 2015 09:31:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259Vbxe040481; Thu, 5 Mar 2015 09:31:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050931.t259Vbxe040481@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:31:37 +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: r279636 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:31:37 -0000 Author: hselasky Date: Thu Mar 5 09:31:36 2015 New Revision: 279636 URL: https://svnweb.freebsd.org/changeset/base/279636 Log: MFC r279270: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 Modified: stable/10/sys/dev/usb/usb_hub.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Thu Mar 5 09:29:05 2015 (r279635) +++ stable/10/sys/dev/usb/usb_hub.c Thu Mar 5 09:31:36 2015 (r279636) @@ -1694,11 +1694,19 @@ uhub_child_location_string(device_t pare } goto done; } - snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u", - device_get_unit(res.udev->bus->bdev), - (res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index : 0, - res.portno, - res.udev->device_index, res.iface_index); + snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u" + " interface=%u" +#if USB_HAVE_UGEN + " ugen=%s" +#endif + , device_get_unit(res.udev->bus->bdev) + , (res.udev->parent_hub != NULL) ? + res.udev->parent_hub->device_index : 0 + , res.portno, res.udev->device_index, res.iface_index +#if USB_HAVE_UGEN + , res.udev->ugen_name +#endif + ); done: mtx_unlock(&Giant); @@ -1740,7 +1748,7 @@ uhub_child_pnpinfo_string(device_t paren "release=0x%04x " "mode=%s " "intclass=0x%02x intsubclass=0x%02x " - "intprotocol=0x%02x " "%s%s", + "intprotocol=0x%02x" "%s%s", UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:35:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1AB369B; Thu, 5 Mar 2015 09:35:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD8C1905; Thu, 5 Mar 2015 09:35:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259ZG5N041059; Thu, 5 Mar 2015 09:35:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259ZGqS041058; Thu, 5 Mar 2015 09:35:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050935.t259ZGqS041058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:35:16 +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: r279637 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:35:16 -0000 Author: hselasky Date: Thu Mar 5 09:35:15 2015 New Revision: 279637 URL: https://svnweb.freebsd.org/changeset/base/279637 Log: MFC r279270: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 Modified: stable/9/sys/dev/usb/usb_hub.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Thu Mar 5 09:31:36 2015 (r279636) +++ stable/9/sys/dev/usb/usb_hub.c Thu Mar 5 09:35:15 2015 (r279637) @@ -1611,10 +1611,11 @@ uhub_child_location_string(device_t pare } goto done; } - snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u", + snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u" + " ugen=%s", (res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index : 0, res.portno, device_get_unit(res.udev->bus->bdev), - res.udev->device_index, res.iface_index); + res.udev->device_index, res.iface_index, res.udev->ugen_name); done: mtx_unlock(&Giant); @@ -1656,7 +1657,7 @@ uhub_child_pnpinfo_string(device_t paren "release=0x%04x " "mode=%s " "intclass=0x%02x intsubclass=0x%02x " - "intprotocol=0x%02x " "%s%s", + "intprotocol=0x%02x" "%s%s", UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:37:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA227A15; Thu, 5 Mar 2015 09:37:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5B4893E; Thu, 5 Mar 2015 09:37:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259bSIT041420; Thu, 5 Mar 2015 09:37:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259bSXI041419; Thu, 5 Mar 2015 09:37:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050937.t259bSXI041419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r279638 - stable/8/sys/dev/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:37:28 -0000 Author: hselasky Date: Thu Mar 5 09:37:27 2015 New Revision: 279638 URL: https://svnweb.freebsd.org/changeset/base/279638 Log: MFC r279270: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 Modified: stable/8/sys/dev/usb/usb_hub.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Thu Mar 5 09:35:15 2015 (r279637) +++ stable/8/sys/dev/usb/usb_hub.c Thu Mar 5 09:37:27 2015 (r279638) @@ -1610,10 +1610,11 @@ uhub_child_location_string(device_t pare } goto done; } - snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u", + snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u" + " ugen=%s", (res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index : 0, res.portno, device_get_unit(res.udev->bus->bdev), - res.udev->device_index, res.iface_index); + res.udev->device_index, res.iface_index, res.udev->ugen_name); done: mtx_unlock(&Giant); @@ -1655,7 +1656,7 @@ uhub_child_pnpinfo_string(device_t paren "release=0x%04x " "mode=%s " "intclass=0x%02x intsubclass=0x%02x " - "intprotocol=0x%02x " "%s%s", + "intprotocol=0x%02x" "%s%s", UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:39:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7BDBBCC; Thu, 5 Mar 2015 09:39:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91E9C95E; Thu, 5 Mar 2015 09:39:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259dUAZ041750; Thu, 5 Mar 2015 09:39:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259dUKu041747; Thu, 5 Mar 2015 09:39:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050939.t259dUKu041747@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:39:30 +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: r279639 - stable/10/usr.bin/unifdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:39:30 -0000 Author: hselasky Date: Thu Mar 5 09:39:29 2015 New Revision: 279639 URL: https://svnweb.freebsd.org/changeset/base/279639 Log: MFC r279297: Update to upstream version 2.10 The most notable new feature is support for definition files. Obtained from: http://dotat.at/prog/unifdef Modified: stable/10/usr.bin/unifdef/unifdef.1 stable/10/usr.bin/unifdef/unifdef.c stable/10/usr.bin/unifdef/unifdef.h stable/10/usr.bin/unifdef/unifdefall.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/10/usr.bin/unifdef/unifdef.1 Thu Mar 5 09:37:27 2015 (r279638) +++ stable/10/usr.bin/unifdef/unifdef.1 Thu Mar 5 09:39:29 2015 (r279639) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2012 +.Dd January 7, 2014 .Dt UNIFDEF 1 PRM .Os " " .Sh NAME @@ -44,6 +44,7 @@ .Op Fl [i]D Ns Ar sym Ns Op = Ns Ar val .Op Fl [i]U Ns Ar sym .Ar ... +.Op Fl f Ar defile .Op Fl x Bro Ar 012 Brc .Op Fl M Ar backext .Op Fl o Ar outfile @@ -70,11 +71,17 @@ utility acts on .Ic #elif , #else , and .Ic #endif -lines. -A directive is only processed -if the symbols specified on the command line are sufficient to allow -.Nm -to get a definite value for its control expression. +lines, +using macros specified in +.Fl D +and +.Fl U +command line options or in +.Fl f +definitions files. +A directive is processed +if the macro specifications are sufficient to provide +a definite value for its control expression. If the result is false, the directive and the following lines under its control are removed. If the result is true, @@ -84,7 +91,7 @@ An or .Ic #ifndef directive is passed through unchanged -if its controlling symbol is not specified on the command line. +if its controlling macro is not specified. Any .Ic #if or @@ -110,7 +117,7 @@ and .Ic #elif lines: integer constants, -integer values of symbols defined on the command line, +integer values of macros defined on the command line, the .Fn defined operator, @@ -131,16 +138,42 @@ if either operand of .Ic || is definitely true then the result is true. .Pp -In most cases, the +When evaluating an expression, .Nm -utility does not distinguish between object-like macros -(without arguments) and function-like arguments (with arguments). -If a macro is not explicitly defined, or is defined with the +does not expand macros first. +The value of a macro must be a simple number, +not an expression. +A limited form of indirection is allowed, +where one macro's value is the name of another. +.Pp +In most cases, +.Nm +does not distinguish between object-like macros +(without arguments) and function-like macros (with arguments). +A function-like macro invocation can appear in +.Ic #if +and +.Ic #elif +control expressions. +If the macro is not explicitly defined, +or is defined with the .Fl D -flag on the command-line, its arguments are ignored. +flag on the command-line, +or with +.Ic #define +in a +.Fl f +definitions file, +its arguments are ignored. If a macro is explicitly undefined on the command line with the .Fl U -flag, it may not have any arguments since this leads to a syntax error. +flag, +or with +.Ic #undef +in a +.Fl f +definitions file, +it may not have any arguments since this leads to a syntax error. .Pp The .Nm @@ -161,7 +194,7 @@ It uses .Nm Fl s and .Nm cpp Fl dM -to get lists of all the controlling symbols +to get lists of all the controlling macros and their definitions (or lack thereof), then invokes .Nm @@ -169,19 +202,15 @@ with appropriate arguments to process th .Sh OPTIONS .Bl -tag -width indent -compact .It Fl D Ns Ar sym Ns = Ns Ar val -Specify that a symbol is defined to a given value -which is used when evaluating -.Ic #if -and -.Ic #elif -control expressions. +Specify that a macro is defined to a given value. .Pp .It Fl D Ns Ar sym -Specify that a symbol is defined to the value 1. +Specify that a macro is defined to the value 1. .Pp .It Fl U Ns Ar sym -Specify that a symbol is undefined. -If the same symbol appears in more than one argument, +Specify that a macro is undefined. +.Pp +If the same macro appears in more than one argument, the last occurrence dominates. .Pp .It Fl iD Ns Ar sym Ns Op = Ns Ar val @@ -193,9 +222,37 @@ are ignored within and .Ic #ifndef blocks -controlled by symbols +controlled by macros specified with these options. .Pp +.It Fl f Ar defile +The file +.Ar defile +contains +.Ic #define +and +.Ic #undef +preprocessor directives, +which have the same effect as the corresponding +.Fl D +and +.Fl U +command-line arguments. +You can have multiple +.Fl f +arguments and mix them with +.Fl D +and +.Fl U +arguments; +later options override earlier ones. +.Pp +Each directive must be on a single line. +Object-like macro definitions (without arguments) +are set to the given value. +Function-like macro definitions (with arguments) +are treated as if they are set to 1. +.Pp .It Fl b Replace removed lines with blank lines instead of deleting them. @@ -291,24 +348,15 @@ instead of the standard output when proc Instead of processing an input file as usual, this option causes .Nm -to produce a list of symbols that appear in expressions -that -.Nm -understands. -It is useful in conjunction with the -.Fl dM -option of -.Xr cpp 1 -for creating -.Nm -command lines. +to produce a list of macros that are used in +preprocessor directive controlling expressions. .Pp .It Fl S Like the .Fl s -option, but the nesting depth of each symbol is also printed. +option, but the nesting depth of each macro is also printed. This is useful for working out the number of possible combinations -of interdependent defined/undefined symbols. +of interdependent defined/undefined macros. .Pp .It Fl t Disables parsing for C strings, comments, @@ -406,6 +454,9 @@ in comment. .Sh SEE ALSO .Xr cpp 1 , .Xr diff 1 +.Pp +The unifdef home page is +.Pa http://dotat.at/prog/unifdef .Sh HISTORY The .Nm @@ -430,7 +481,7 @@ cannot be handled in every situation. .Pp Trigraphs are not recognized. .Pp -There is no support for symbols with different definitions at +There is no support for macros with different definitions at different points in the source file. .Pp The text-mode and ignore functionality does not correspond to modern Modified: stable/10/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/10/usr.bin/unifdef/unifdef.c Thu Mar 5 09:37:27 2015 (r279638) +++ stable/10/usr.bin/unifdef/unifdef.c Thu Mar 5 09:39:29 2015 (r279639) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2013 Tony Finch + * Copyright (c) 2002 - 2014 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,7 +46,7 @@ #include "unifdef.h" static const char copyright[] = - "@(#) $Version: unifdef-2.7 $\n" + "@(#) $Version: unifdef-2.10 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" "@(#) $URL: http://dotat.at/prog/unifdef $\n" @@ -138,7 +138,7 @@ static char const * const linestate_name */ #define MAXDEPTH 64 /* maximum #if nesting */ #define MAXLINE 4096 /* maximum length of line */ -#define MAXSYMS 4096 /* maximum number of symbols */ +#define MAXSYMS 16384 /* maximum number of symbols */ /* * Sometimes when editing a keyword the replacement text is longer, so @@ -180,6 +180,15 @@ static char *tempname; /* av static char tline[MAXLINE+EDITSLOP];/* input buffer plus space */ static char *keyword; /* used for editing #elif's */ +/* + * When processing a file, the output's newline style will match the + * input's, and unifdef correctly handles CRLF or LF endings whatever + * the platform's native style. The stdio streams are opened in binary + * mode to accommodate platforms whose native newline style is CRLF. + * When the output isn't a processed input file (when it is error / + * debug / diagnostic messages) then unifdef uses native line endings. + */ + static const char *newline; /* input file format */ static const char newline_unix[] = "\n"; static const char newline_crlf[] = "\r\n"; @@ -200,33 +209,41 @@ static bool firstsym; /* di static int exitmode; /* exit status mode */ static int exitstat; /* program exit status */ -static void addsym(bool, bool, char *); +static void addsym1(bool, bool, char *); +static void addsym2(bool, const char *, const char *); static char *astrcat(const char *, const char *); static void cleantemp(void); -static void closeout(void); +static void closeio(void); static void debug(const char *, ...); +static void debugsym(const char *, int); +static bool defundef(void); +static void defundefile(const char *); static void done(void); static void error(const char *); -static int findsym(const char *); +static int findsym(const char **); static void flushline(bool); static void hashline(void); static void help(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); +static void indirectsym(void); static void keywordedit(const char *); +static const char *matchsym(const char *, const char *); static void nest(void); static Linetype parseline(void); static void process(void); static void processinout(const char *, const char *); static const char *skipargs(const char *); static const char *skipcomment(const char *); +static const char *skiphash(void); +static const char *skipline(const char *); static const char *skipsym(const char *); static void state(Ifstate); -static int strlcmp(const char *, const char *, size_t); static void unnest(void); static void usage(void); static void version(void); +static const char *xstrdup(const char *, const char *); #define endsym(c) (!isalnum((unsigned char)c) && c != '_') @@ -238,7 +255,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:M:o:x:bBcdehKklmnsStV")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:f:I:M:o:x:bBcdehKklmnsStV")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -248,17 +265,17 @@ main(int argc, char *argv[]) */ opt = *optarg++; if (opt == 'D') - addsym(true, true, optarg); + addsym1(true, true, optarg); else if (opt == 'U') - addsym(true, false, optarg); + addsym1(true, false, optarg); else usage(); break; case 'D': /* define a symbol */ - addsym(false, true, optarg); + addsym1(false, true, optarg); break; case 'U': /* undef a symbol */ - addsym(false, false, optarg); + addsym1(false, false, optarg); break; case 'I': /* no-op for compatibility with cpp */ break; @@ -278,6 +295,9 @@ main(int argc, char *argv[]) case 'e': /* fewer errors from dodgy lines */ iocccok = true; break; + case 'f': /* definitions file */ + defundefile(optarg); + break; case 'h': help(); break; @@ -334,6 +354,7 @@ main(int argc, char *argv[]) argc = 1; if (argc == 1 && !inplace && ofilename == NULL) ofilename = "-"; + indirectsym(); atexit(cleantemp); if (ofilename != NULL) @@ -392,10 +413,10 @@ processinout(const char *ifn, const char if (backext != NULL) { char *backname = astrcat(ofn, backext); if (rename(ofn, backname) < 0) - err(2, "can't rename \"%s\" to \"%s%s\"", ofn, ofn, backext); + err(2, "can't rename \"%s\" to \"%s\"", ofn, backname); free(backname); } - if (rename(tempname, ofn) < 0) + if (replace(tempname, ofn) < 0) err(2, "can't rename \"%s\" to \"%s\"", tempname, ofn); free(tempname); tempname = NULL; @@ -434,7 +455,7 @@ synopsis(FILE *fp) { fprintf(fp, "usage: unifdef [-bBcdehKkmnsStV] [-x{012}] [-Mext] [-opath] \\\n" - " [-[i]Dsym[=val]] [-[i]Usym] ... [file] ...\n"); + " [-[i]Dsym[=val]] [-[i]Usym] [-fpath] ... [file] ...\n"); } static void @@ -455,6 +476,7 @@ help(void) " -iDsym=val \\ ignore C strings and comments\n" " -iDsym ) in sections controlled by these\n" " -iUsym / preprocessor symbols\n" + " -fpath file containing #define and #undef directives\n" " -b blank lines instead of deleting them\n" " -B compress blank lines around deleted section\n" " -c complement (invert) keep vs. delete\n" @@ -650,12 +672,12 @@ done(void) { if (incomment) error("EOF in comment"); - closeout(); + closeio(); } /* * Write a line to the output or not, according to command line options. - * If writing fails, closeout() will print the error and exit. + * If writing fails, closeio() will print the error and exit. */ static void flushline(bool keep) @@ -671,19 +693,19 @@ flushline(bool keep) if (lnnum && delcount > 0) hashline(); if (fputs(tline, output) == EOF) - closeout(); + closeio(); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { if (lnblank && fputs(newline, output) == EOF) - closeout(); + closeio(); exitstat = 1; delcount += 1; blankcount = 0; } if (debugging && fflush(output) == EOF) - closeout(); + closeio(); } /* @@ -700,20 +722,21 @@ hashline(void) e = fprintf(output, "#line %d \"%s\"%s", linenum, linefile, newline); if (e < 0) - closeout(); + closeio(); } /* * Flush the output and handle errors. */ static void -closeout(void) +closeio(void) { /* Tidy up after findsym(). */ if (symdepth && !zerosyms) printf("\n"); - if (ferror(output) || fclose(output) == EOF) - err(2, "%s: can't write to output", filename); + if (output != NULL && (ferror(output) || fclose(output) == EOF)) + err(2, "%s: can't write to output", filename); + fclose(input); } /* @@ -727,6 +750,8 @@ process(void) is preceded by a large number of blank lines. */ blankmax = blankcount = 1000; zerosyms = true; + newline = NULL; + linenum = 0; while (lineval != LT_EOF) { lineval = parseline(); trans_table[ifstate[depth]][lineval](); @@ -746,105 +771,86 @@ parseline(void) { const char *cp; int cursym; - int kwlen; Linetype retval; Comment_state wascomment; - linenum++; - if (fgets(tline, MAXLINE, input) == NULL) { - if (ferror(input)) - err(2, "can't read %s", filename); - else - return (LT_EOF); - } + wascomment = incomment; + cp = skiphash(); + if (cp == NULL) + return (LT_EOF); if (newline == NULL) { if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) newline = newline_crlf; else newline = newline_unix; } - retval = LT_PLAIN; - wascomment = incomment; - cp = skipcomment(tline); - if (linestate == LS_START) { - if (*cp == '#') { - linestate = LS_HASH; - firstsym = true; - cp = skipcomment(cp + 1); - } else if (*cp != '\0') - linestate = LS_DIRTY; - } - if (!incomment && linestate == LS_HASH) { - keyword = tline + (cp - tline); - cp = skipsym(cp); - kwlen = cp - keyword; + if (*cp == '\0') { + retval = LT_PLAIN; + goto done; + } + keyword = tline + (cp - tline); + if ((cp = matchsym("ifdef", keyword)) != NULL || + (cp = matchsym("ifndef", keyword)) != NULL) { + cp = skipcomment(cp); + if ((cursym = findsym(&cp)) < 0) + retval = LT_IF; + else { + retval = (keyword[2] == 'n') + ? LT_FALSE : LT_TRUE; + if (value[cursym] == NULL) + retval = (retval == LT_TRUE) + ? LT_FALSE : LT_TRUE; + if (ignore[cursym]) + retval = (retval == LT_TRUE) + ? LT_TRUEI : LT_FALSEI; + } + } else if ((cp = matchsym("if", keyword)) != NULL) + retval = ifeval(&cp); + else if ((cp = matchsym("elif", keyword)) != NULL) + retval = linetype_if2elif(ifeval(&cp)); + else if ((cp = matchsym("else", keyword)) != NULL) + retval = LT_ELSE; + else if ((cp = matchsym("endif", keyword)) != NULL) + retval = LT_ENDIF; + else { + cp = skipsym(keyword); /* no way can we deal with a continuation inside a keyword */ if (strncmp(cp, "\\\r\n", 3) == 0 || strncmp(cp, "\\\n", 2) == 0) Eioccc(); - if (strlcmp("ifdef", keyword, kwlen) == 0 || - strlcmp("ifndef", keyword, kwlen) == 0) { - cp = skipcomment(cp); - if ((cursym = findsym(cp)) < 0) - retval = LT_IF; - else { - retval = (keyword[2] == 'n') - ? LT_FALSE : LT_TRUE; - if (value[cursym] == NULL) - retval = (retval == LT_TRUE) - ? LT_FALSE : LT_TRUE; - if (ignore[cursym]) - retval = (retval == LT_TRUE) - ? LT_TRUEI : LT_FALSEI; - } - cp = skipsym(cp); - } else if (strlcmp("if", keyword, kwlen) == 0) - retval = ifeval(&cp); - else if (strlcmp("elif", keyword, kwlen) == 0) - retval = linetype_if2elif(ifeval(&cp)); - else if (strlcmp("else", keyword, kwlen) == 0) - retval = LT_ELSE; - else if (strlcmp("endif", keyword, kwlen) == 0) - retval = LT_ENDIF; - else { - linestate = LS_DIRTY; - retval = LT_PLAIN; - } - cp = skipcomment(cp); - if (*cp != '\0') { + cp = skipline(cp); + retval = LT_PLAIN; + goto done; + } + cp = skipcomment(cp); + if (*cp != '\0') { + cp = skipline(cp); + if (retval == LT_TRUE || retval == LT_FALSE || + retval == LT_TRUEI || retval == LT_FALSEI) + retval = LT_IF; + if (retval == LT_ELTRUE || retval == LT_ELFALSE) + retval = LT_ELIF; + } + /* the following can happen if the last line of the file lacks a + newline or if there is too much whitespace in a directive */ + if (linestate == LS_HASH) { + long len = cp - tline; + if (fgets(tline + len, MAXLINE - len, input) == NULL) { + if (ferror(input)) + err(2, "can't read %s", filename); + /* append the missing newline at eof */ + strcpy(tline + len, newline); + cp += strlen(newline); + linestate = LS_START; + } else { linestate = LS_DIRTY; - if (retval == LT_TRUE || retval == LT_FALSE || - retval == LT_TRUEI || retval == LT_FALSEI) - retval = LT_IF; - if (retval == LT_ELTRUE || retval == LT_ELFALSE) - retval = LT_ELIF; - } - if (retval != LT_PLAIN && (wascomment || incomment)) { - retval = linetype_2dodgy(retval); - if (incomment) - linestate = LS_DIRTY; - } - /* skipcomment normally changes the state, except - if the last line of the file lacks a newline, or - if there is too much whitespace in a directive */ - if (linestate == LS_HASH) { - size_t len = cp - tline; - if (fgets(tline + len, MAXLINE - len, input) == NULL) { - if (ferror(input)) - err(2, "can't read %s", filename); - /* append the missing newline at eof */ - strcpy(tline + len, newline); - cp += strlen(newline); - linestate = LS_START; - } else { - linestate = LS_DIRTY; - } } } - if (linestate == LS_DIRTY) { - while (*cp != '\0') - cp = skipcomment(cp + 1); + if (retval != LT_PLAIN && (wascomment || linestate != LS_START)) { + retval = linetype_2dodgy(retval); + linestate = LS_DIRTY; } +done: debug("parser line %d state %s comment %s line", linenum, comment_name[incomment], linestate_name[linestate]); return (retval); @@ -854,34 +860,34 @@ parseline(void) * These are the binary operators that are supported by the expression * evaluator. */ -static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { +static Linetype op_strict(long *p, long v, Linetype at, Linetype bt) { if(at == LT_IF || bt == LT_IF) return (LT_IF); return (*p = v, v ? LT_TRUE : LT_FALSE); } -static Linetype op_lt(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_lt(long *p, Linetype at, long a, Linetype bt, long b) { return op_strict(p, a < b, at, bt); } -static Linetype op_gt(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_gt(long *p, Linetype at, long a, Linetype bt, long b) { return op_strict(p, a > b, at, bt); } -static Linetype op_le(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_le(long *p, Linetype at, long a, Linetype bt, long b) { return op_strict(p, a <= b, at, bt); } -static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_ge(long *p, Linetype at, long a, Linetype bt, long b) { return op_strict(p, a >= b, at, bt); } -static Linetype op_eq(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_eq(long *p, Linetype at, long a, Linetype bt, long b) { return op_strict(p, a == b, at, bt); } -static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_ne(long *p, Linetype at, long a, Linetype bt, long b) { return op_strict(p, a != b, at, bt); } -static Linetype op_or(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_or(long *p, Linetype at, long a, Linetype bt, long b) { if (!strictlogic && (at == LT_TRUE || bt == LT_TRUE)) return (*p = 1, LT_TRUE); return op_strict(p, a || b, at, bt); } -static Linetype op_and(int *p, Linetype at, int a, Linetype bt, int b) { +static Linetype op_and(long *p, Linetype at, long a, Linetype bt, long b) { if (!strictlogic && (at == LT_FALSE || bt == LT_FALSE)) return (*p = 0, LT_FALSE); return op_strict(p, a && b, at, bt); @@ -899,7 +905,7 @@ static Linetype op_and(int *p, Linetype */ struct ops; -typedef Linetype eval_fn(const struct ops *, int *, const char **); +typedef Linetype eval_fn(const struct ops *, long *, const char **); static eval_fn eval_table, eval_unary; @@ -912,7 +918,7 @@ static eval_fn eval_table, eval_unary; */ struct op { const char *str; - Linetype (*fn)(int *, Linetype, int, Linetype, int); + Linetype (*fn)(long *, Linetype, long, Linetype, long); }; struct ops { eval_fn *inner; @@ -930,7 +936,7 @@ static const struct ops eval_ops[] = { }; /* Current operator precedence level */ -static int prec(const struct ops *ops) +static long prec(const struct ops *ops) { return (ops - eval_ops); } @@ -941,7 +947,7 @@ static int prec(const struct ops *ops) * We reset the constexpr flag in the last two cases. */ static Linetype -eval_unary(const struct ops *ops, int *valp, const char **cpp) +eval_unary(const struct ops *ops, long *valp, const char **cpp) { const char *cp; char *ep; @@ -975,32 +981,33 @@ eval_unary(const struct ops *ops, int *v if (ep == cp) return (LT_ERROR); lt = *valp ? LT_TRUE : LT_FALSE; - cp = skipsym(cp); - } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { + cp = ep; + } else if (matchsym("defined", cp) != NULL) { cp = skipcomment(cp+7); - debug("eval%d defined", prec(ops)); if (*cp == '(') { cp = skipcomment(cp+1); defparen = true; } else { defparen = false; } - sym = findsym(cp); + sym = findsym(&cp); + cp = skipcomment(cp); + if (defparen && *cp++ != ')') { + debug("eval%d defined missing ')'", prec(ops)); + return (LT_ERROR); + } if (sym < 0) { + debug("eval%d defined unknown", prec(ops)); lt = LT_IF; } else { + debug("eval%d defined %s", prec(ops), symname[sym]); *valp = (value[sym] != NULL); lt = *valp ? LT_TRUE : LT_FALSE; } - cp = skipsym(cp); - cp = skipcomment(cp); - if (defparen && *cp++ != ')') - return (LT_ERROR); constexpr = false; } else if (!endsym(*cp)) { debug("eval%d symbol", prec(ops)); - sym = findsym(cp); - cp = skipsym(cp); + sym = findsym(&cp); if (sym < 0) { lt = LT_IF; cp = skipargs(cp); @@ -1029,11 +1036,11 @@ eval_unary(const struct ops *ops, int *v * Table-driven evaluation of binary operators. */ static Linetype -eval_table(const struct ops *ops, int *valp, const char **cpp) +eval_table(const struct ops *ops, long *valp, const char **cpp) { const struct op *op; const char *cp; - int val; + long val; Linetype lt, rt; debug("eval%d", prec(ops)); @@ -1071,7 +1078,7 @@ static Linetype ifeval(const char **cpp) { Linetype ret; - int val = 0; + long val = 0; debug("eval %s", *cpp); constexpr = killconsts ? false : true; @@ -1081,6 +1088,49 @@ ifeval(const char **cpp) } /* + * Read a line and examine its initial part to determine if it is a + * preprocessor directive. Returns NULL on EOF, or a pointer to a + * preprocessor directive name, or a pointer to the zero byte at the + * end of the line. + */ +static const char * +skiphash(void) +{ + const char *cp; + + linenum++; + if (fgets(tline, MAXLINE, input) == NULL) { + if (ferror(input)) + err(2, "can't read %s", filename); + else + return (NULL); + } + cp = skipcomment(tline); + if (linestate == LS_START && *cp == '#') { + linestate = LS_HASH; + return (skipcomment(cp + 1)); + } else if (*cp == '\0') { + return (cp); + } else { + return (skipline(cp)); + } +} + +/* + * Mark a line dirty and consume the rest of it, keeping track of the + * lexical state. + */ +static const char * +skipline(const char *cp) +{ + if (*cp != '\0') + linestate = LS_DIRTY; + while (*cp != '\0') + cp = skipcomment(cp + 1); + return (cp); +} + +/* * Skip over comments, strings, and character literals and stop at the * next character position that is not whitespace. Between calls we keep * the comment state in the global variable incomment, and we also adjust @@ -1233,33 +1283,69 @@ skipsym(const char *cp) } /* + * Skip whitespace and take a copy of any following identifier. + */ +static const char * +getsym(const char **cpp) +{ + const char *cp = *cpp, *sym; + + cp = skipcomment(cp); + cp = skipsym(sym = cp); + if (cp == sym) + return NULL; + *cpp = cp; + return (xstrdup(sym, cp)); +} + +/* + * Check that s (a symbol) matches the start of t, and that the + * following character in t is not a symbol character. Returns a + * pointer to the following character in t if there is a match, + * otherwise NULL. + */ +static const char * +matchsym(const char *s, const char *t) +{ + while (*s != '\0' && *t != '\0') + if (*s != *t) + return (NULL); + else + ++s, ++t; + if (*s == '\0' && endsym(*t)) + return(t); + else + return(NULL); +} + +/* * Look for the symbol in the symbol table. If it is found, we return * the symbol table index, else we return -1. */ static int -findsym(const char *str) +findsym(const char **strp) { - const char *cp; + const char *str; int symind; - cp = skipsym(str); - if (cp == str) - return (-1); + str = *strp; + *strp = skipsym(str); if (symlist) { + if (*strp == str) + return (-1); if (symdepth && firstsym) printf("%s%3d", zerosyms ? "" : "\n", depth); firstsym = zerosyms = false; printf("%s%.*s%s", - symdepth ? " " : "", - (int)(cp-str), str, - symdepth ? "" : "\n"); + symdepth ? " " : "", + (int)(*strp-str), str, + symdepth ? "" : "\n"); /* we don't care about the value of the symbol */ return (0); } for (symind = 0; symind < nsyms; ++symind) { - if (strlcmp(symname[symind], str, cp-str) == 0) { - debug("findsym %s %s", symname[symind], - value[symind] ? value[symind] : ""); + if (matchsym(symname[symind], str) != NULL) { + debugsym("findsym", symind); return (symind); } } @@ -1267,53 +1353,155 @@ findsym(const char *str) } /* + * Resolve indirect symbol values to their final definitions. + */ +static void +indirectsym(void) +{ + const char *cp; + int changed, sym, ind; + + do { + changed = 0; + for (sym = 0; sym < nsyms; ++sym) { + if (value[sym] == NULL) + continue; + cp = value[sym]; + ind = findsym(&cp); + if (ind == -1 || ind == sym || + *cp != '\0' || + value[ind] == NULL || + value[ind] == value[sym]) + continue; + debugsym("indir...", sym); + value[sym] = value[ind]; + debugsym("...ectsym", sym); + changed++; + } + } while (changed); +} + +/* + * Add a symbol to the symbol table, specified with the format sym=val + */ +static void +addsym1(bool ignorethis, bool definethis, char *symval) +{ + const char *sym, *val; + + sym = symval; + val = skipsym(sym); + if (definethis && *val == '=') { + symval[val - sym] = '\0'; + val = val + 1; + } else if (*val == '\0') { + val = definethis ? "1" : NULL; + } else { + usage(); + } + addsym2(ignorethis, sym, val); +} + +/* * Add a symbol to the symbol table. */ static void -addsym(bool ignorethis, bool definethis, char *sym) +addsym2(bool ignorethis, const char *sym, const char *val) { + const char *cp = sym; int symind; - char *val; - symind = findsym(sym); + symind = findsym(&cp); if (symind < 0) { if (nsyms >= MAXSYMS) errx(2, "too many symbols"); symind = nsyms++; } - symname[symind] = sym; ignore[symind] = ignorethis; - val = sym + (skipsym(sym) - sym); - if (definethis) { - if (*val == '=') { - value[symind] = val+1; - *val = '\0'; - } else if (*val == '\0') - value[symind] = "1"; - else - usage(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:52:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 407A23EF; Thu, 5 Mar 2015 09:52:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CAEFB4F; Thu, 5 Mar 2015 09:52:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259q0rZ050700; Thu, 5 Mar 2015 09:52:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259q0Cb050695; Thu, 5 Mar 2015 09:52:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503050952.t259q0Cb050695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 09:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279642 - head/sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:52:00 -0000 Author: mav Date: Thu Mar 5 09:51:59 2015 New Revision: 279642 URL: https://svnweb.freebsd.org/changeset/base/279642 Log: Reenable VIRTIO_BLK_F_TOPOLOGY feature. MFC after: 2 weeks Modified: head/sys/dev/virtio/block/virtio_blk.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Thu Mar 5 09:46:59 2015 (r279641) +++ head/sys/dev/virtio/block/virtio_blk.c Thu Mar 5 09:51:59 2015 (r279642) @@ -205,6 +205,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", VIRTIO_BLK_F_RO | \ VIRTIO_BLK_F_BLK_SIZE | \ VIRTIO_BLK_F_WCE | \ + VIRTIO_BLK_F_TOPOLOGY | \ VIRTIO_BLK_F_CONFIG_WCE | \ VIRTIO_RING_F_INDIRECT_DESC) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 09:55:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4172E55D; Thu, 5 Mar 2015 09:55:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A551B70; Thu, 5 Mar 2015 09:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t259tcea051242; Thu, 5 Mar 2015 09:55:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t259tacH051234; Thu, 5 Mar 2015 09:55:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503050955.t259tacH051234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 09:55:36 +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: r279643 - in stable/9/usr.bin: find indent jot setchannel tr unifdef vgrind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:55:38 -0000 Author: hselasky Date: Thu Mar 5 09:55:35 2015 New Revision: 279643 URL: https://svnweb.freebsd.org/changeset/base/279643 Log: MFC r227243, r233456, r248258, r248849 and r279297: Update to upstream version 2.10 The most notable new feature is support for definition files. The most notable new feature is support for processing multiple files in one invocation. There is also support for more make-friendly exit statuses. The most notable bug fix is #line directives now include the input file name. Obtained from: http://dotat.at/prog/unifdef Added: stable/9/usr.bin/unifdef/unifdef.h - copied, changed from r248849, head/usr.bin/unifdef/unifdef.h Modified: stable/9/usr.bin/find/find.1 stable/9/usr.bin/indent/indent.1 stable/9/usr.bin/jot/jot.1 stable/9/usr.bin/setchannel/setchannel.1 stable/9/usr.bin/tr/tr.1 stable/9/usr.bin/unifdef/unifdef.1 stable/9/usr.bin/unifdef/unifdef.c stable/9/usr.bin/unifdef/unifdefall.sh stable/9/usr.bin/vgrind/vgrindefs.5 Directory Properties: stable/9/usr.bin/ (props changed) stable/9/usr.bin/calendar/ (props changed) stable/9/usr.bin/find/ (props changed) stable/9/usr.bin/indent/ (props changed) Modified: stable/9/usr.bin/find/find.1 ============================================================================== --- stable/9/usr.bin/find/find.1 Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/find/find.1 Thu Mar 5 09:55:35 2015 (r279643) @@ -156,7 +156,6 @@ This option is equivalent to the depreca primary. .El .Sh PRIMARIES -.Pp All primaries which take a numeric argument allow the number to be preceded by a plus sign .Pq Dq Li + Modified: stable/9/usr.bin/indent/indent.1 ============================================================================== --- stable/9/usr.bin/indent/indent.1 Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/indent/indent.1 Thu Mar 5 09:55:35 2015 (r279643) @@ -488,7 +488,6 @@ The utility fits as many words (separated by blanks, tabs, or newlines) on a line as possible. Blank lines break paragraphs. -.Pp .Ss Comment indentation If a comment is on a line with code it is started in the `comment column', which is set by the @@ -504,7 +503,6 @@ command line parameter. If the code on a line extends past the comment column, the comment starts further to the right, and the right margin may be automatically extended in extreme cases. -.Pp .Ss Preprocessor lines In general, .Nm @@ -519,7 +517,6 @@ is recognized and .Nm attempts to correctly compensate for the syntactic peculiarities introduced. -.Pp .Ss C syntax The .Nm Modified: stable/9/usr.bin/jot/jot.1 ============================================================================== --- stable/9/usr.bin/jot/jot.1 Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/jot/jot.1 Thu Mar 5 09:55:35 2015 (r279643) @@ -242,7 +242,6 @@ specifying an integer format: .Bd -literal -offset indent $ jot -w %d 6 1 10 0.5 .Ed -.Pp .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Modified: stable/9/usr.bin/setchannel/setchannel.1 ============================================================================== --- stable/9/usr.bin/setchannel/setchannel.1 Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/setchannel/setchannel.1 Thu Mar 5 09:55:35 2015 (r279643) @@ -33,7 +33,6 @@ .Nd Hauppage PVR250/350 channel selector .Sh SYNOPSIS .Cd pvr250-setchannel [-a {on | off}] [-c | -r | -s | -t] [-g geom] [-m channel_set] [channel | freq] -.Pp .Sh DESCRIPTION .Nm provides support for selecting channels on Hauppauge WinTV cards, Modified: stable/9/usr.bin/tr/tr.1 ============================================================================== --- stable/9/usr.bin/tr/tr.1 Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/tr/tr.1 Thu Mar 5 09:55:35 2015 (r279643) @@ -145,7 +145,6 @@ the octal sequence to the full 3 octal d .It \echaracter A backslash followed by certain special characters maps to special values. -.Pp .Bl -column "\ea" .It "\ea .It "\eb @@ -177,7 +176,6 @@ previous implementations. .It [:class:] Represents all characters belonging to the defined character class. Class names are: -.Pp .Bl -column "phonogram" .It "alnum .It "alpha Modified: stable/9/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/9/usr.bin/unifdef/unifdef.1 Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/unifdef/unifdef.1 Thu Mar 5 09:55:35 2015 (r279643) @@ -1,6 +1,6 @@ .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" Copyright (c) 2002 - 2010 Tony Finch . All rights reserved. +.\" Copyright (c) 2002 - 2013 Tony Finch . All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. @@ -31,23 +31,24 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2010 -.Dt UNIFDEF 1 -.Os +.Dd January 7, 2014 +.Dt UNIFDEF 1 PRM +.Os " " .Sh NAME .Nm unifdef , unifdefall .Nd remove preprocessor conditionals from code .Sh SYNOPSIS .Nm -.Op Fl bBcdeKknsStV +.Op Fl bBcdehKkmnsStV .Op Fl I Ns Ar path -.Op Fl D Ns Ar sym Ns Op = Ns Ar val -.Op Fl U Ns Ar sym -.Op Fl iD Ns Ar sym Ns Op = Ns Ar val -.Op Fl iU Ns Ar sym +.Op Fl [i]D Ns Ar sym Ns Op = Ns Ar val +.Op Fl [i]U Ns Ar sym .Ar ... +.Op Fl f Ar defile +.Op Fl x Bro Ar 012 Brc +.Op Fl M Ar backext .Op Fl o Ar outfile -.Op Ar infile +.Op Ar infile ... .Nm unifdefall .Op Fl I Ns Ar path .Ar ... @@ -66,14 +67,21 @@ while otherwise leaving the file alone. The .Nm utility acts on -.Ic #if , #ifdef , #ifndef , #elif , #else , +.Ic #if , #ifdef , #ifndef , +.Ic #elif , #else , and .Ic #endif -lines. -A directive is only processed -if the symbols specified on the command line are sufficient to allow -.Nm -to get a definite value for its control expression. +lines, +using macros specified in +.Fl D +and +.Fl U +command line options or in +.Fl f +definitions files. +A directive is processed +if the macro specifications are sufficient to provide +a definite value for its control expression. If the result is false, the directive and the following lines under its control are removed. If the result is true, @@ -83,7 +91,7 @@ An or .Ic #ifndef directive is passed through unchanged -if its controlling symbol is not specified on the command line. +if its controlling macro is not specified. Any .Ic #if or @@ -109,12 +117,14 @@ and .Ic #elif lines: integer constants, -integer values of symbols defined on the command line, +integer values of macros defined on the command line, the .Fn defined operator, the operators -.Ic \&! , < , > , <= , >= , == , != , && , || , +.Ic \&! , < , > , +.Ic <= , >= , == , != , +.Ic && , || , and parenthesized expressions. A kind of .Dq "short circuit" @@ -128,16 +138,42 @@ if either operand of .Ic || is definitely true then the result is true. .Pp -In most cases, the +When evaluating an expression, .Nm -utility does not distinguish between object-like macros -(without arguments) and function-like arguments (with arguments). -If a macro is not explicitly defined, or is defined with the +does not expand macros first. +The value of a macro must be a simple number, +not an expression. +A limited form of indirection is allowed, +where one macro's value is the name of another. +.Pp +In most cases, +.Nm +does not distinguish between object-like macros +(without arguments) and function-like macros (with arguments). +A function-like macro invocation can appear in +.Ic #if +and +.Ic #elif +control expressions. +If the macro is not explicitly defined, +or is defined with the .Fl D -flag on the command-line, its arguments are ignored. +flag on the command-line, +or with +.Ic #define +in a +.Fl f +definitions file, +its arguments are ignored. If a macro is explicitly undefined on the command line with the .Fl U -flag, it may not have any arguments since this leads to a syntax error. +flag, +or with +.Ic #undef +in a +.Fl f +definitions file, +it may not have any arguments since this leads to a syntax error. .Pp The .Nm @@ -158,30 +194,65 @@ It uses .Nm Fl s and .Nm cpp Fl dM -to get lists of all the controlling symbols +to get lists of all the controlling macros and their definitions (or lack thereof), then invokes .Nm with appropriate arguments to process the file. .Sh OPTIONS -.Pp .Bl -tag -width indent -compact .It Fl D Ns Ar sym Ns = Ns Ar val -Specify that a symbol is defined to a given value -which is used when evaluating -.Ic #if -and -.Ic #elif -control expressions. +Specify that a macro is defined to a given value. .Pp .It Fl D Ns Ar sym -Specify that a symbol is defined to the value 1. +Specify that a macro is defined to the value 1. .Pp .It Fl U Ns Ar sym -Specify that a symbol is undefined. -If the same symbol appears in more than one argument, +Specify that a macro is undefined. +.Pp +If the same macro appears in more than one argument, the last occurrence dominates. .Pp +.It Fl iD Ns Ar sym Ns Op = Ns Ar val +.It Fl iU Ns Ar sym +C strings, comments, +and line continuations +are ignored within +.Ic #ifdef +and +.Ic #ifndef +blocks +controlled by macros +specified with these options. +.Pp +.It Fl f Ar defile +The file +.Ar defile +contains +.Ic #define +and +.Ic #undef +preprocessor directives, +which have the same effect as the corresponding +.Fl D +and +.Fl U +command-line arguments. +You can have multiple +.Fl f +arguments and mix them with +.Fl D +and +.Fl U +arguments; +later options override earlier ones. +.Pp +Each directive must be on a single line. +Object-like macro definitions (without arguments) +are set to the given value. +Function-like macro definitions (with arguments) +are treated as if they are set to 1. +.Pp .It Fl b Replace removed lines with blank lines instead of deleting them. @@ -196,35 +267,39 @@ Mutually exclusive with the option. .Pp .It Fl c -If the -.Fl c -flag is specified, -then the operation of -.Nm -is complemented, -i.e., the lines that would have been removed or blanked +Complement, +i.e., lines that would have been removed or blanked are retained and vice versa. .Pp .It Fl d Turn on printing of debugging messages. .Pp .It Fl e -Because -.Nm -processes its input one line at a time, -it cannot remove preprocessor directives that span more than one line. -The most common example of this is a directive with a multi-line -comment hanging off its right hand end. By default, -if .Nm -has to process such a directive, -it will complain that the line is too obfuscated. +will report an error if it needs to remove +a preprocessor directive that spans more than one line, +for example, if it has a multi-line +comment hanging off its right hand end. The .Fl e -option changes the behaviour so that, -where possible, -such lines are left unprocessed instead of reporting an error. +flag makes it ignore the line instead. +.Pp +.It Fl h +Print help. +.Pp +.It Fl I Ns Ar path +Specifies to +.Nm unifdefall +an additional place to look for +.Ic #include +files. +This option is ignored by +.Nm +for compatibility with +.Xr cpp 1 +and to simplify the implementation of +.Nm unifdefall . .Pp .It Fl K Always treat the result of @@ -248,6 +323,15 @@ because they typically start and are used as a kind of comment to sketch out future or past development. It would be rude to strip them out, just as it would be for normal comments. .Pp +.It Fl m +Modify one or more input files in place. +.Pp +.It Fl M Ar backext +Modify input files in place, and keep backups of the original files by +appending the +.Ar backext +to the input filenames. +.Pp .It Fl n Add .Li #line @@ -258,96 +342,57 @@ line numbers in the input file. .It Fl o Ar outfile Write output to the file .Ar outfile -instead of the standard output. -If -.Ar outfile -is the same as the input file, -the output is written to a temporary file -which is renamed into place when -.Nm -completes successfully. +instead of the standard output when processing a single file. .Pp .It Fl s -Instead of processing the input file as usual, +Instead of processing an input file as usual, this option causes .Nm -to produce a list of symbols that appear in expressions -that -.Nm -understands. -It is useful in conjunction with the -.Fl dM -option of -.Xr cpp 1 -for creating -.Nm -command lines. +to produce a list of macros that are used in +preprocessor directive controlling expressions. .Pp .It Fl S Like the .Fl s -option, but the nesting depth of each symbol is also printed. +option, but the nesting depth of each macro is also printed. This is useful for working out the number of possible combinations -of interdependent defined/undefined symbols. +of interdependent defined/undefined macros. .Pp .It Fl t -Disables parsing for C comments +Disables parsing for C strings, comments, and line continuations, which is useful for plain text. -.Pp -.It Fl iD Ns Ar sym Ns Op = Ns Ar val -.It Fl iU Ns Ar sym -Ignore -.Ic #ifdef Ns s . -If your C code uses -.Ic #ifdef Ns s -to delimit non-C lines, -such as comments -or code which is under construction, -then you must tell -.Nm -which symbols are used for that purpose so that it will not try to parse -comments -and line continuations -inside those -.Ic #ifdef Ns s . -You can specify ignored symbols with -.Fl iD Ns Ar sym Ns Oo = Ns Ar val Oc -and -.Fl iU Ns Ar sym -similar to -.Fl D Ns Ar sym Ns Op = Ns Ar val +This is a blanket version of the +.Fl iD and -.Fl U Ns Ar sym -above. -.Pp -.It Fl I Ns Ar path -Specifies to -.Nm unifdefall -an additional place to look for -.Ic #include -files. -This option is ignored by -.Nm -for compatibility with -.Xr cpp 1 -and to simplify the implementation of -.Nm unifdefall . +.Fl iU +flags. .Pp .It Fl V Print version details. +.Pp +.It Fl x Bro Ar 012 Brc +Set exit status mode to zero, one, or two. +See the +.Sx EXIT STATUS +section below for details. .El .Pp The .Nm -utility copies its output to -.Em stdout -and will take its input from +utility takes its input from .Em stdin -if no +if there are no .Ar file -argument is given. +arguments. +You must use the +.Fl m +or +.Fl M +options if there are multiple input files. +You can specify inut from stdin or output to stdout with +.Ql - . .Pp The .Nm @@ -356,10 +401,35 @@ utility works nicely with the option of .Xr diff 1 . .Sh EXIT STATUS -The +In normal usage the +.Nm +utility's exit status depends on the mode set using the +.Fl x +option. +.Pp +If the exit mode is zero (the default) then +.Nm +exits with status 0 if the output is an exact copy of the input, +or with status 1 if the output differs. +.Pp +If the exit mode is one, +.Nm +exits with status 1 if the output is unmodified +or 0 if it differs. +.Pp +If the exit mode is two, .Nm -utility exits 0 if the output is an exact copy of the input, -1 if not, and 2 if in trouble. +exits with status zero in both cases. +.Pp +In all exit modes, +.Nm +exits with status 2 if there is an error. +.Pp +The exit status is 0 if the +.Fl h +or +.Fl V +command line options are given. .Sh DIAGNOSTICS .Bl -item .It @@ -384,6 +454,9 @@ in comment. .Sh SEE ALSO .Xr cpp 1 , .Xr diff 1 +.Pp +The unifdef home page is +.Pa http://dotat.at/prog/unifdef .Sh HISTORY The .Nm @@ -401,13 +474,14 @@ rewrote it to support .Sh BUGS Expression evaluation is very limited. .Pp -Preprocessor control lines split across more than one physical line +Handling one line at a time means +preprocessor directives split across more than one physical line (because of comments or backslash-newline) cannot be handled in every situation. .Pp Trigraphs are not recognized. .Pp -There is no support for symbols with different definitions at +There is no support for macros with different definitions at different points in the source file. .Pp The text-mode and ignore functionality does not correspond to modern Modified: stable/9/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/9/usr.bin/unifdef/unifdef.c Thu Mar 5 09:51:59 2015 (r279642) +++ stable/9/usr.bin/unifdef/unifdef.c Thu Mar 5 09:55:35 2015 (r279643) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2011 Tony Finch + * Copyright (c) 2002 - 2014 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,21 +43,10 @@ * it possible to handle all "dodgy" directives correctly. */ -#include -#include +#include "unifdef.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const char copyright[] = - "@(#) $Version: unifdef-2.5.6.21f1388 $\n" +static const char copyright[] = + "@(#) $Version: unifdef-2.10 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" "@(#) $URL: http://dotat.at/prog/unifdef $\n" @@ -93,6 +82,9 @@ static char const * const linetype_name[ "PLAIN", "EOF", "ERROR" }; +#define linetype_if2elif(lt) ((Linetype)(lt - LT_IF + LT_ELIF)) +#define linetype_2dodgy(lt) ((Linetype)(lt + LT_DODGY)) + /* state of #if processing */ typedef enum { IS_OUTSIDE, @@ -146,7 +138,7 @@ static char const * const linestate_name */ #define MAXDEPTH 64 /* maximum #if nesting */ #define MAXLINE 4096 /* maximum length of line */ -#define MAXSYMS 4096 /* maximum number of symbols */ +#define MAXSYMS 16384 /* maximum number of symbols */ /* * Sometimes when editing a keyword the replacement text is longer, so @@ -155,11 +147,6 @@ static char const * const linestate_name #define EDITSLOP 10 /* - * For temporary filenames - */ -#define TEMPLATE "unifdef.XXXXXX" - -/* * Globals. */ @@ -167,6 +154,7 @@ static bool compblank; /* - static bool lnblank; /* -b: blank deleted lines */ static bool complement; /* -c: do the complement */ static bool debugging; /* -d: debugging reports */ +static bool inplace; /* -m: modify in place */ static bool iocccok; /* -e: fewer IOCCC errors */ static bool strictlogic; /* -K: keep ambiguous #ifs */ static bool killconsts; /* -k: eval constant #ifs */ @@ -183,14 +171,24 @@ static int nsyms; /* numb static FILE *input; /* input file pointer */ static const char *filename; /* input file name */ static int linenum; /* current line number */ +static const char *linefile; /* file name for #line */ static FILE *output; /* output file pointer */ static const char *ofilename; /* output file name */ -static bool overwriting; /* output overwrites input */ -static char tempname[FILENAME_MAX]; /* used when overwriting */ +static const char *backext; /* backup extension */ +static char *tempname; /* avoid splatting input */ static char tline[MAXLINE+EDITSLOP];/* input buffer plus space */ static char *keyword; /* used for editing #elif's */ +/* + * When processing a file, the output's newline style will match the + * input's, and unifdef correctly handles CRLF or LF endings whatever + * the platform's native style. The stdio streams are opened in binary + * mode to accommodate platforms whose native newline style is CRLF. + * When the output isn't a processed input file (when it is error / + * debug / diagnostic messages) then unifdef uses native line endings. + */ + static const char *newline; /* input file format */ static const char newline_unix[] = "\n"; static const char newline_crlf[] = "\r\n"; @@ -205,33 +203,47 @@ static int delcount; /* co static unsigned blankcount; /* count of blank lines */ static unsigned blankmax; /* maximum recent blankcount */ static bool constexpr; /* constant #if expression */ -static bool zerosyms = true; /* to format symdepth output */ +static bool zerosyms; /* to format symdepth output */ static bool firstsym; /* ditto */ +static int exitmode; /* exit status mode */ static int exitstat; /* program exit status */ -static void addsym(bool, bool, char *); -static void closeout(void); +static void addsym1(bool, bool, char *); +static void addsym2(bool, const char *, const char *); +static char *astrcat(const char *, const char *); +static void cleantemp(void); +static void closeio(void); static void debug(const char *, ...); +static void debugsym(const char *, int); +static bool defundef(void); +static void defundefile(const char *); static void done(void); static void error(const char *); -static int findsym(const char *); +static int findsym(const char **); static void flushline(bool); -static Linetype parseline(void); +static void hashline(void); +static void help(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); +static void indirectsym(void); static void keywordedit(const char *); +static const char *matchsym(const char *, const char *); static void nest(void); +static Linetype parseline(void); static void process(void); +static void processinout(const char *, const char *); static const char *skipargs(const char *); static const char *skipcomment(const char *); +static const char *skiphash(void); +static const char *skipline(const char *); static const char *skipsym(const char *); static void state(Ifstate); -static int strlcmp(const char *, const char *, size_t); static void unnest(void); static void usage(void); static void version(void); +static const char *xstrdup(const char *, const char *); #define endsym(c) (!isalnum((unsigned char)c) && c != '_') @@ -243,7 +255,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:o:bBcdeKklnsStV")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:f:I:M:o:x:bBcdehKklmnsStV")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -253,17 +265,17 @@ main(int argc, char *argv[]) */ opt = *optarg++; if (opt == 'D') - addsym(true, true, optarg); + addsym1(true, true, optarg); else if (opt == 'U') - addsym(true, false, optarg); + addsym1(true, false, optarg); else usage(); break; case 'D': /* define a symbol */ - addsym(false, true, optarg); + addsym1(false, true, optarg); break; case 'U': /* undef a symbol */ - addsym(false, false, optarg); + addsym1(false, false, optarg); break; case 'I': /* no-op for compatibility with cpp */ break; @@ -283,12 +295,25 @@ main(int argc, char *argv[]) case 'e': /* fewer errors from dodgy lines */ iocccok = true; break; + case 'f': /* definitions file */ + defundefile(optarg); + break; + case 'h': + help(); + break; case 'K': /* keep ambiguous #ifs */ strictlogic = true; break; case 'k': /* process constant #ifs */ killconsts = true; break; + case 'm': /* modify in place */ + inplace = true; + break; + case 'M': /* modify in place and keep backup */ + inplace = true; + backext = optarg; + break; case 'n': /* add #line directive after deleted lines */ lnnum = true; break; @@ -304,8 +329,14 @@ main(int argc, char *argv[]) case 't': /* don't parse C comments */ text = true; break; - case 'V': /* print version */ + case 'V': version(); + break; + case 'x': + exitmode = atoi(optarg); + if(exitmode < 0 || exitmode > 2) + usage(); + break; default: usage(); } @@ -313,54 +344,98 @@ main(int argc, char *argv[]) argv += optind; if (compblank && lnblank) errx(2, "-B and -b are mutually exclusive"); - if (argc > 1) { - errx(2, "can only do one file"); - } else if (argc == 1 && strcmp(*argv, "-") != 0) { - filename = *argv; - input = fopen(filename, "rb"); - if (input == NULL) - err(2, "can't open %s", filename); - } else { - filename = "[stdin]"; - input = stdin; + if (symlist && (ofilename != NULL || inplace || argc > 1)) + errx(2, "-s only works with one input file"); + if (argc > 1 && ofilename != NULL) + errx(2, "-o cannot be used with multiple input files"); + if (argc > 1 && !inplace) + errx(2, "multiple input files require -m or -M"); + if (argc == 0) + argc = 1; + if (argc == 1 && !inplace && ofilename == NULL) + ofilename = "-"; + indirectsym(); + + atexit(cleantemp); + if (ofilename != NULL) + processinout(*argv, ofilename); + else while (argc-- > 0) { + processinout(*argv, *argv); + argv++; } - if (ofilename == NULL) { - ofilename = "[stdout]"; - output = stdout; + switch(exitmode) { + case(0): exit(exitstat); + case(1): exit(!exitstat); + case(2): exit(0); + default: abort(); /* bug */ + } +} + +/* + * File logistics. + */ +static void +processinout(const char *ifn, const char *ofn) +{ + struct stat st; + + if (ifn == NULL || strcmp(ifn, "-") == 0) { + filename = "[stdin]"; + linefile = NULL; + input = fbinmode(stdin); } else { - struct stat ist, ost; - if (stat(ofilename, &ost) == 0 && - fstat(fileno(input), &ist) == 0) - overwriting = (ist.st_dev == ost.st_dev - && ist.st_ino == ost.st_ino); - if (overwriting) { - const char *dirsep; - int ofd; - - dirsep = strrchr(ofilename, '/'); - if (dirsep != NULL) - snprintf(tempname, sizeof(tempname), - "%.*s/" TEMPLATE, - (int)(dirsep - ofilename), ofilename); - else - snprintf(tempname, sizeof(tempname), - TEMPLATE); - ofd = mkstemp(tempname); - if (ofd != -1) - output = fdopen(ofd, "wb+"); - if (output == NULL) - err(2, "can't create temporary file"); - fchmod(ofd, ist.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)); - } else { - output = fopen(ofilename, "wb"); - if (output == NULL) - err(2, "can't open %s", ofilename); - } + filename = ifn; + linefile = ifn; + input = fopen(ifn, "rb"); + if (input == NULL) + err(2, "can't open %s", ifn); + } + if (strcmp(ofn, "-") == 0) { + output = fbinmode(stdout); + process(); + return; } + if (stat(ofn, &st) < 0) { + output = fopen(ofn, "wb"); + if (output == NULL) + err(2, "can't create %s", ofn); + process(); + return; + } + + tempname = astrcat(ofn, ".XXXXXX"); + output = mktempmode(tempname, st.st_mode); + if (output == NULL) + err(2, "can't create %s", tempname); + process(); - abort(); /* bug */ + + if (backext != NULL) { + char *backname = astrcat(ofn, backext); + if (rename(ofn, backname) < 0) + err(2, "can't rename \"%s\" to \"%s\"", ofn, backname); + free(backname); + } + if (replace(tempname, ofn) < 0) + err(2, "can't rename \"%s\" to \"%s\"", tempname, ofn); + free(tempname); + tempname = NULL; } +/* + * For cleaning up if there is an error. + */ +static void +cleantemp(void) +{ + if (tempname != NULL) + remove(tempname); +} + +/* + * Self-identification functions. + */ + static void version(void) { @@ -376,13 +451,54 @@ version(void) } static void +synopsis(FILE *fp) +{ + fprintf(fp, + "usage: unifdef [-bBcdehKkmnsStV] [-x{012}] [-Mext] [-opath] \\\n" + " [-[i]Dsym[=val]] [-[i]Usym] [-fpath] ... [file] ...\n"); +} + +static void usage(void) { - fprintf(stderr, "usage: unifdef [-bBcdeKknsStV] [-Ipath]" - " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); + synopsis(stderr); exit(2); } +static void +help(void) +{ + synopsis(stdout); + printf( + " -Dsym=val define preprocessor symbol with given value\n" + " -Dsym define preprocessor symbol with value 1\n" + " -Usym preprocessor symbol is undefined\n" + " -iDsym=val \\ ignore C strings and comments\n" + " -iDsym ) in sections controlled by these\n" + " -iUsym / preprocessor symbols\n" + " -fpath file containing #define and #undef directives\n" + " -b blank lines instead of deleting them\n" + " -B compress blank lines around deleted section\n" + " -c complement (invert) keep vs. delete\n" + " -d debugging mode\n" + " -e ignore multiline preprocessor directives\n" + " -h print help\n" + " -Ipath extra include file path (ignored)\n" + " -K disable && and || short-circuiting\n" + " -k process constant #if expressions\n" + " -Mext modify in place and keep backups\n" + " -m modify input files in place\n" + " -n add #line directives to output\n" + " -opath output file name\n" + " -S list #if control symbols with nesting\n" + " -s list #if control symbols\n" + " -t ignore C strings and comments\n" + " -V print version\n" + " -x{012} exit status mode\n" + ); + exit(0); +} + /* * A state transition function alters the global #if processing state * in a particular way. The table below is indexed by the current @@ -396,7 +512,7 @@ usage(void) * When we have processed a group that starts off with a known-false * #if/#elif sequence (which has therefore been deleted) followed by a * #elif that we don't understand and therefore must keep, we edit the - * latter into a #if to keep the nesting correct. We use strncpy() to + * latter into a #if to keep the nesting correct. We use memcpy() to * overwrite the 4 byte token "elif" with "if " without a '\0' byte. * * When we find a true #elif in a group, the following block will @@ -451,7 +567,7 @@ static void Idrop (void) { Fdrop(); ign static void Itrue (void) { Ftrue(); ignoreon(); } static void Ifalse(void) { Ffalse(); ignoreon(); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:04:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD1207A6; Thu, 5 Mar 2015 10:04:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BED4CC56; Thu, 5 Mar 2015 10:04:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25A4ZTU055892; Thu, 5 Mar 2015 10:04:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25A4ZwB055888; Thu, 5 Mar 2015 10:04:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503051004.t25A4ZwB055888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 10:04:35 +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: r279644 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:04:36 -0000 Author: hselasky Date: Thu Mar 5 10:04:34 2015 New Revision: 279644 URL: https://svnweb.freebsd.org/changeset/base/279644 Log: MFC r279210: Add support for the DWC OTG v2 chipset found in the STM32F4 series of processors. Make sure we pullup the data lines in device mode when we power on the port. Modified: stable/10/sys/dev/usb/controller/dwc_otg.c stable/10/sys/dev/usb/controller/dwc_otgreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/dwc_otg.c Thu Mar 5 09:55:35 2015 (r279643) +++ stable/10/sys/dev/usb/controller/dwc_otg.c Thu Mar 5 10:04:34 2015 (r279644) @@ -108,13 +108,20 @@ GINTSTS_WKUPINT | GINTSTS_USBSUSP | GINTMSK_OTGINTMSK | \ GINTSTS_SESSREQINT) -static int dwc_otg_use_hsic; +#define DWC_OTG_PHY_ULPI 0 +#define DWC_OTG_PHY_HSIC 1 +#define DWC_OTG_PHY_INTERNAL 2 -static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); +#ifndef DWC_OTG_PHY_DEFAULT +#define DWC_OTG_PHY_DEFAULT DWC_OTG_PHY_ULPI +#endif + +static int dwc_otg_phy_type = DWC_OTG_PHY_DEFAULT; -SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RD | CTLFLAG_TUN, - &dwc_otg_use_hsic, 0, "DWC OTG uses HSIC interface"); -TUNABLE_INT("hw.usb.dwc_otg.use_hsic", &dwc_otg_use_hsic); +static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, phy_type, CTLFLAG_RDTUN, + &dwc_otg_phy_type, 0, "DWC OTG PHY TYPE - 0/1/2 - ULPI/HSIC/INTERNAL"); +TUNABLE_INT("hw.usb.dwc_otg.phy_type", &dwc_otg_phy_type); #ifdef USB_DEBUG static int dwc_otg_debug; @@ -3762,8 +3769,9 @@ dwc_otg_init(struct dwc_otg_softc *sc) break; } - /* select HSIC or non-HSIC mode */ - if (dwc_otg_use_hsic) { + /* select HSIC, ULPI or internal PHY mode */ + switch (dwc_otg_phy_type) { + case DWC_OTG_PHY_HSIC: DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, GUSBCFG_PHYIF | GUSBCFG_TRD_TIM_SET(5) | temp); @@ -3775,7 +3783,8 @@ dwc_otg_init(struct dwc_otg_softc *sc) temp & ~GLPMCFG_HSIC_CONN); DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, temp | GLPMCFG_HSIC_CONN); - } else { + break; + case DWC_OTG_PHY_ULPI: DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, GUSBCFG_ULPI_UTMI_SEL | GUSBCFG_TRD_TIM_SET(5) | temp); @@ -3784,6 +3793,25 @@ dwc_otg_init(struct dwc_otg_softc *sc) temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, temp & ~GLPMCFG_HSIC_CONN); + break; + case DWC_OTG_PHY_INTERNAL: + DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, + GUSBCFG_PHYSEL | + GUSBCFG_TRD_TIM_SET(5) | temp); + DWC_OTG_WRITE_4(sc, DOTG_GOTGCTL, 0); + + temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp & ~GLPMCFG_HSIC_CONN); + + temp = DWC_OTG_READ_4(sc, DOTG_GGPIO); + temp &= ~(DOTG_GGPIO_NOVBUSSENS | DOTG_GGPIO_I2CPADEN); + temp |= (DOTG_GGPIO_VBUSASEN | DOTG_GGPIO_VBUSBSEN | + DOTG_GGPIO_PWRDWN); + DWC_OTG_WRITE_4(sc, DOTG_GGPIO, temp); + break; + default: + break; } /* clear global nak */ @@ -3803,9 +3831,6 @@ dwc_otg_init(struct dwc_otg_softc *sc) /* wait 10ms */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); - /* pull up D+ */ - dwc_otg_pull_up(sc); - temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG3); sc->sc_fifo_size = 4 * GHWCFG3_DFIFODEPTH_GET(temp); @@ -4544,11 +4569,15 @@ tr_handle_set_port_feature: /* nops */ break; case UHF_PORT_POWER: + sc->sc_flags.port_powered = 1; if (sc->sc_mode == DWC_MODE_HOST || sc->sc_mode == DWC_MODE_OTG) { sc->sc_hprt_val |= HPRT_PRTPWR; DWC_OTG_WRITE_4(sc, DOTG_HPRT, sc->sc_hprt_val); } - sc->sc_flags.port_powered = 1; + if (sc->sc_mode == DWC_MODE_DEVICE || sc->sc_mode == DWC_MODE_OTG) { + /* pull up D+, if any */ + dwc_otg_pull_up(sc); + } break; default: err = USB_ERR_IOERROR; Modified: stable/10/sys/dev/usb/controller/dwc_otgreg.h ============================================================================== --- stable/10/sys/dev/usb/controller/dwc_otgreg.h Thu Mar 5 09:55:35 2015 (r279643) +++ stable/10/sys/dev/usb/controller/dwc_otgreg.h Thu Mar 5 10:04:34 2015 (r279644) @@ -196,6 +196,14 @@ #define GUSBCFG_TOUTCAL_MASK 0x00000007 #define GUSBCFG_TOUTCAL_SHIFT 0 +/* STM32F4 */ +#define DOTG_GGPIO_NOVBUSSENS (1 << 21) +#define DOTG_GGPIO_SOFOUTEN (1 << 20) +#define DOTG_GGPIO_VBUSBSEN (1 << 19) +#define DOTG_GGPIO_VBUSASEN (1 << 18) +#define DOTG_GGPIO_I2CPADEN (1 << 17) +#define DOTG_GGPIO_PWRDWN (1 << 16) + #define GRSTCTL_AHBIDLE (1<<31) #define GRSTCTL_DMAREQ (1<<30) #define GRSTCTL_TXFNUM_MASK 0x000007c0 From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:07:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A473F8F8; Thu, 5 Mar 2015 10:07:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC00C75; Thu, 5 Mar 2015 10:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25A7A5c056309; Thu, 5 Mar 2015 10:07:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25A7AaL056308; Thu, 5 Mar 2015 10:07:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503051007.t25A7AaL056308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 5 Mar 2015 10:07: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: r279645 - stable/9/sbin/geom/class/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:07:10 -0000 Author: ae Date: Thu Mar 5 10:07:09 2015 New Revision: 279645 URL: https://svnweb.freebsd.org/changeset/base/279645 Log: MFC r279324: When gpart(8) is trying automatically determine the first available block of free space after existing partition, take into account provider's stripeoffset, since the result will be adjusted to this value. PR: 197989 Modified: stable/9/sbin/geom/class/part/geom_part.c Directory Properties: stable/9/sbin/geom/class/part/ (props changed) Modified: stable/9/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/9/sbin/geom/class/part/geom_part.c Thu Mar 5 10:04:34 2015 (r279644) +++ stable/9/sbin/geom/class/part/geom_part.c Thu Mar 5 10:07:09 2015 (r279645) @@ -550,7 +550,7 @@ gpart_autofill(struct gctl_req *req) s = find_provcfg(pp, "end"); first = (off_t)strtoimax(s, NULL, 0) + 1; - if (first > a_first) + if (first + offset > a_first) a_first = ALIGNUP(first + offset, alignment); } if (a_first <= last) { From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:08:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3C75A50; Thu, 5 Mar 2015 10:08:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF851C8A; Thu, 5 Mar 2015 10:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25A8bx6056555; Thu, 5 Mar 2015 10:08:37 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25A8bID056554; Thu, 5 Mar 2015 10:08:37 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503051008.t25A8bID056554@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 5 Mar 2015 10:08:37 +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: r279646 - stable/10/sbin/geom/class/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:08:38 -0000 Author: ae Date: Thu Mar 5 10:08:37 2015 New Revision: 279646 URL: https://svnweb.freebsd.org/changeset/base/279646 Log: MFC r279324: When gpart(8) is trying automatically determine the first available block of free space after existing partition, take into account provider's stripeoffset, since the result will be adjusted to this value. PR: 197989 Modified: stable/10/sbin/geom/class/part/geom_part.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/10/sbin/geom/class/part/geom_part.c Thu Mar 5 10:07:09 2015 (r279645) +++ stable/10/sbin/geom/class/part/geom_part.c Thu Mar 5 10:08:37 2015 (r279646) @@ -550,7 +550,7 @@ gpart_autofill(struct gctl_req *req) s = find_provcfg(pp, "end"); first = (off_t)strtoimax(s, NULL, 0) + 1; - if (first > a_first) + if (first + offset > a_first) a_first = ALIGNUP(first + offset, alignment); } if (a_first <= last) { From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:12:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2368ABE4; Thu, 5 Mar 2015 10:12:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2F2D54; Thu, 5 Mar 2015 10:12:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25ACS4W060564; Thu, 5 Mar 2015 10:12:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25ACSpl060563; Thu, 5 Mar 2015 10:12:28 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503051012.t25ACSpl060563@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 5 Mar 2015 10:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r279647 - stable/8/sbin/geom/class/part X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:12:29 -0000 Author: ae Date: Thu Mar 5 10:12:28 2015 New Revision: 279647 URL: https://svnweb.freebsd.org/changeset/base/279647 Log: MFC r279324: When gpart(8) is trying automatically determine the first available block of free space after existing partition, take into account provider's stripeoffset, since the result will be adjusted to this value. PR: 197989 Modified: stable/8/sbin/geom/class/part/geom_part.c Directory Properties: stable/8/sbin/geom/class/part/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Thu Mar 5 10:08:37 2015 (r279646) +++ stable/8/sbin/geom/class/part/geom_part.c Thu Mar 5 10:12:28 2015 (r279647) @@ -565,7 +565,7 @@ gpart_autofill(struct gctl_req *req) (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else first = (off_t)strtoimax(s, NULL, 0) + 1; - if (first > a_first) + if (first + offset > a_first) a_first = ALIGNUP(first + offset, alignment); } if (a_first <= last) { From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:18:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D415DD73; Thu, 5 Mar 2015 10:18:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF293D8D; Thu, 5 Mar 2015 10:18:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25AI4bL061311; Thu, 5 Mar 2015 10:18:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25AI40Q061306; Thu, 5 Mar 2015 10:18:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503051018.t25AI40Q061306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 10:18:04 +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: r279648 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:18:05 -0000 Author: hselasky Date: Thu Mar 5 10:18:03 2015 New Revision: 279648 URL: https://svnweb.freebsd.org/changeset/base/279648 Log: MFC r279544: Add quirk to disable 64-bit XHCI DMA after r276717. Requested by: Gary Jennejohn Modified: stable/10/sys/dev/usb/controller/xhci.c stable/10/sys/dev/usb/controller/xhci.h stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Thu Mar 5 10:12:28 2015 (r279647) +++ stable/10/sys/dev/usb/controller/xhci.c Thu Mar 5 10:18:03 2015 (r279648) @@ -98,18 +98,23 @@ TUNABLE_INT("hw.usb.xhci.streams", &xhci static int xhcidebug; static int xhciroute; static int xhcipolling; +static int xhcidma32; SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI controller"); + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI controller"); TUNABLE_INT("hw.usb.xhci.use_polling", &xhcipolling); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); +TUNABLE_INT("hw.usb.xhci.dma32", &xhcidma32); #else #define xhciroute 0 +#define xhcidma32 0 #endif #define XHCI_INTR_ENDPT 1 @@ -580,7 +585,7 @@ xhci_halt_controller(struct xhci_softc * } usb_error_t -xhci_init(struct xhci_softc *sc, device_t self) +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) { uint32_t temp; @@ -627,7 +632,8 @@ xhci_init(struct xhci_softc *sc, device_ } /* get DMA bits */ - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); Modified: stable/10/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.h Thu Mar 5 10:12:28 2015 (r279647) +++ stable/10/sys/dev/usb/controller/xhci.h Thu Mar 5 10:18:03 2015 (r279648) @@ -522,7 +522,7 @@ struct xhci_softc { uint8_t xhci_use_polling(void); usb_error_t xhci_halt_controller(struct xhci_softc *); -usb_error_t xhci_init(struct xhci_softc *, device_t); +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:12:28 2015 (r279647) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:18:03 2015 (r279648) @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self)) { + if (xhci_init(sc, self, 0)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:23:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29CBAFEA; Thu, 5 Mar 2015 10:23:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14BE5E56; Thu, 5 Mar 2015 10:23:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25ANd3x065536; Thu, 5 Mar 2015 10:23:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25ANdZw065531; Thu, 5 Mar 2015 10:23:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503051023.t25ANdZw065531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 10:23:39 +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: r279650 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:23:40 -0000 Author: hselasky Date: Thu Mar 5 10:23:38 2015 New Revision: 279650 URL: https://svnweb.freebsd.org/changeset/base/279650 Log: MFC r279544: Add quirk to disable 64-bit XHCI DMA after r276717. Requested by: Gary Jennejohn Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Mar 5 10:22:59 2015 (r279649) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Mar 5 10:23:38 2015 (r279650) @@ -87,19 +87,24 @@ __FBSDID("$FreeBSD$"); static int xhcidebug; static int xhciroute; static int xhcipolling; +static int xhcidma32; static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI controller"); + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI controller"); TUNABLE_INT("hw.usb.xhci.use_polling", &xhcipolling); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); +TUNABLE_INT("hw.usb.xhci.dma32", &xhcidma32); #else #define xhciroute 0 +#define xhcidma32 0 #endif #define XHCI_INTR_ENDPT 1 @@ -569,7 +574,7 @@ xhci_halt_controller(struct xhci_softc * } usb_error_t -xhci_init(struct xhci_softc *sc, device_t self) +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) { uint32_t temp; @@ -616,7 +621,8 @@ xhci_init(struct xhci_softc *sc, device_ } /* get DMA bits */ - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); Modified: stable/9/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.h Thu Mar 5 10:22:59 2015 (r279649) +++ stable/9/sys/dev/usb/controller/xhci.h Thu Mar 5 10:23:38 2015 (r279650) @@ -513,7 +513,7 @@ struct xhci_softc { uint8_t xhci_use_polling(void); usb_error_t xhci_halt_controller(struct xhci_softc *); -usb_error_t xhci_init(struct xhci_softc *, device_t); +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:22:59 2015 (r279649) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:23:38 2015 (r279650) @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self)) { + if (xhci_init(sc, self, 0)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:29:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96EA3221; Thu, 5 Mar 2015 10:29:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 836A8E9D; Thu, 5 Mar 2015 10:29:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25ATl3H066288; Thu, 5 Mar 2015 10:29:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25ATlEP066287; Thu, 5 Mar 2015 10:29:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503051029.t25ATlEP066287@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 10:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279651 - head/sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:29:47 -0000 Author: mav Date: Thu Mar 5 10:29:46 2015 New Revision: 279651 URL: https://svnweb.freebsd.org/changeset/base/279651 Log: Size of opt_io_size field is 32 bit. MFC after: 2 weeks Modified: head/sys/dev/virtio/block/virtio_blk.h Modified: head/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.h Thu Mar 5 10:23:38 2015 (r279650) +++ head/sys/dev/virtio/block/virtio_blk.h Thu Mar 5 10:29:46 2015 (r279651) @@ -67,7 +67,7 @@ struct virtio_blk_config { uint8_t physical_block_exp; uint8_t alignment_offset; uint16_t min_io_size; - uint16_t opt_io_size; + uint32_t opt_io_size; } topology; /* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 10:40:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B08415; Thu, 5 Mar 2015 10:40:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 309D0F83; Thu, 5 Mar 2015 10:40:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25AejOt072346; Thu, 5 Mar 2015 10:40:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25AejWe072345; Thu, 5 Mar 2015 10:40:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503051040.t25AejWe072345@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 10:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279652 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:40:46 -0000 Author: mav Date: Thu Mar 5 10:40:45 2015 New Revision: 279652 URL: https://svnweb.freebsd.org/changeset/base/279652 Log: Add support for TOPOLOGY feature of virtio block device. Passing through physical block size/offset from underlying storage allows guest to manage proper data and I/O alignment to improve performance. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 10:29:46 2015 (r279651) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 10:40:45 2015 (r279652) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); /* Capability bits */ #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ -#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ +#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ +#define VTBLK_F_TOPOLOGY (1 << 10) /* Optimal I/O alignment */ /* * Host capabilities @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_S_HOSTCAPS \ ( VTBLK_F_SEG_MAX | \ VTBLK_F_BLK_SIZE | \ + VTBLK_F_TOPOLOGY | \ VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ /* @@ -81,11 +83,19 @@ struct vtblk_config { uint64_t vbc_capacity; uint32_t vbc_size_max; uint32_t vbc_seg_max; - uint16_t vbc_geom_c; - uint8_t vbc_geom_h; - uint8_t vbc_geom_s; + struct { + uint16_t cylinders; + uint8_t heads; + uint8_t sectors; + } vbc_geometry; uint32_t vbc_blk_size; - uint32_t vbc_sectors_max; + struct { + uint8_t physical_block_exp; + uint8_t alignment_offset; + uint16_t min_io_size; + uint32_t opt_io_size; + } vbc_topology; + uint8_t vbc_writeback; } __packed; /* @@ -262,7 +272,7 @@ pci_vtblk_init(struct vmctx *ctx, struct MD5_CTX mdctx; u_char digest[16]; struct pci_vtblk_softc *sc; - off_t size; + off_t size, sts, sto; int fd; int sectsz; @@ -291,6 +301,7 @@ pci_vtblk_init(struct vmctx *ctx, struct */ size = sbuf.st_size; sectsz = DEV_BSIZE; + sts = sto = 0; if (S_ISCHR(sbuf.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || ioctl(fd, DIOCGSECTORSIZE, §sz)) { @@ -300,7 +311,10 @@ pci_vtblk_init(struct vmctx *ctx, struct } assert(size != 0); assert(sectsz != 0); - } + if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0) + ioctl(fd, DIOCGSTRIPEOFFSET, &sto); + } else + sts = sbuf.st_blksize; sc = calloc(1, sizeof(struct pci_vtblk_softc)); @@ -328,13 +342,19 @@ pci_vtblk_init(struct vmctx *ctx, struct /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ + sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; + sc->vbsc_cfg.vbc_geometry.cylinders = 0; /* no geometry */ + sc->vbsc_cfg.vbc_geometry.heads = 0; + sc->vbsc_cfg.vbc_geometry.sectors = 0; sc->vbsc_cfg.vbc_blk_size = sectsz; - sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ - sc->vbsc_cfg.vbc_geom_c = 0; /* no geometry */ - sc->vbsc_cfg.vbc_geom_h = 0; - sc->vbsc_cfg.vbc_geom_s = 0; - sc->vbsc_cfg.vbc_sectors_max = 0; + sc->vbsc_cfg.vbc_topology.physical_block_exp = + (sts > sectsz) ? (ffsll(sts / sectsz) - 1) : 0; + sc->vbsc_cfg.vbc_topology.alignment_offset = + (sto != 0) ? ((sts - sto) / sectsz) : 0; + sc->vbsc_cfg.vbc_topology.min_io_size = 0; + sc->vbsc_cfg.vbc_topology.opt_io_size = 0; + sc->vbsc_cfg.vbc_writeback = 0; /* * Should we move some of this into virtio.c? Could From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 11:48:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63A782CD; Thu, 5 Mar 2015 11:48:39 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7593E94F; Thu, 5 Mar 2015 11:48:38 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t25BmTnQ078533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Mar 2015 14:48:29 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t25BmTfx078532; Thu, 5 Mar 2015 14:48:29 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 5 Mar 2015 14:48:29 +0300 From: Gleb Smirnoff To: Baptiste Daroussin Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305114828.GK17947@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503042201.t24M1jDG009278@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 11:48:39 -0000 On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: B> Author: bapt B> Date: Wed Mar 4 22:01:44 2015 B> New Revision: 279603 B> URL: https://svnweb.freebsd.org/changeset/base/279603 B> B> Log: B> r* commands are not precious anymore B> B> Modified: B> head/bin/rcp/Makefile B> head/usr.bin/rlogin/Makefile I guess when they are going to be not precious enough to be removed? :) In modern world of ssh and https, does any OS require them in base? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:12:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 893AFA4B for ; Thu, 5 Mar 2015 12:12:39 +0000 (UTC) Received: from mail-pd0-x232.google.com (mail-pd0-x232.google.com [IPv6:2607:f8b0:400e:c02::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 563F5C93 for ; Thu, 5 Mar 2015 12:12:39 +0000 (UTC) Received: by pdbfp1 with SMTP id fp1so28730077pdb.7 for ; Thu, 05 Mar 2015 04:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=igxpQN96A3EBEkxeGMn93kZfG2a7C0l9RDsl5I53J7M=; b=sM2oRFla9SjsWNzMnc+2ZULRXAQm508m3Cq9R2NOOH38Kav47CqJPO/J0xwryXMAjC f/VutbAzDIbo7dRpuIR7PDxZiRdH4RvMuCVt7/Q++AYFzp+DF1isIbWTtZ0uxtvd9Lgb tobqxFDcjhIiPgYhb3WAQiYqIAhKfuiM0fR5bfojZt3DYSisV6U1oAV8+1rpfip1f2zq Aj9TznylgDPUYu+EL7cOR3QhYbnWvPW8BYtdZJZEFRm4pjERkvLN1qDNoPuI3igxLOfr p9p4fRV9gl3CDUgpLoTA5dVzvAK4RkCeRrW2MYZRNYf2zgbj13YMNkNrteuBsUPRm9fS c2vg== MIME-Version: 1.0 X-Received: by 10.70.103.101 with SMTP id fv5mr15142179pdb.5.1425557558715; Thu, 05 Mar 2015 04:12:38 -0800 (PST) Received: by 10.67.4.165 with HTTP; Thu, 5 Mar 2015 04:12:38 -0800 (PST) In-Reply-To: References: Date: Thu, 5 Mar 2015 17:42:38 +0530 Message-ID: Subject: Re: svn-src-all Digest, Vol 133, Issue 5 From: Supriya Paul To: svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:12:39 -0000 Hello, I don't understand this language. Please send information in English Thankyou, Supriya Paul On 3/5/15, svn-src-all-request@freebsd.org wrote: > Send svn-src-all mailing list submissions to > svn-src-all@freebsd.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.freebsd.org/mailman/listinfo/svn-src-all > or, via email, send a message with subject or body 'help' to > svn-src-all-request@freebsd.org > > You can reach the person managing the list at > svn-src-all-owner@freebsd.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of svn-src-all digest..." > > > Today's Topics: > > 1. svn commit: r279642 - head/sys/dev/virtio/block (Alexander Motin) > 2. svn commit: r279643 - in stable/9/usr.bin: find indent jot > setchannel tr unifdef vgrind (Hans Petter Selasky) > 3. svn commit: r279644 - stable/10/sys/dev/usb/controller > (Hans Petter Selasky) > 4. svn commit: r279645 - stable/9/sbin/geom/class/part > (Andrey V. Elsukov) > 5. svn commit: r279646 - stable/10/sbin/geom/class/part > (Andrey V. Elsukov) > 6. svn commit: r279647 - stable/8/sbin/geom/class/part > (Andrey V. Elsukov) > 7. svn commit: r279648 - stable/10/sys/dev/usb/controller > (Hans Petter Selasky) > 8. svn commit: r279650 - stable/9/sys/dev/usb/controller > (Hans Petter Selasky) > 9. svn commit: r279651 - head/sys/dev/virtio/block (Alexander Motin) > 10. svn commit: r279652 - head/usr.sbin/bhyve (Alexander Motin) > 11. Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin > usr.bin/rsh (Gleb Smirnoff) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 5 Mar 2015 09:52:00 +0000 (UTC) > From: Alexander Motin > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: svn commit: r279642 - head/sys/dev/virtio/block > Message-ID: <201503050952.t259q0Cb050695@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: mav > Date: Thu Mar 5 09:51:59 2015 > New Revision: 279642 > URL: https://svnweb.freebsd.org/changeset/base/279642 > > Log: > Reenable VIRTIO_BLK_F_TOPOLOGY feature. > > MFC after: 2 weeks > > Modified: > head/sys/dev/virtio/block/virtio_blk.c > > Modified: head/sys/dev/virtio/block/virtio_blk.c > ============================================================================== > --- head/sys/dev/virtio/block/virtio_blk.c Thu Mar 5 09:46:59 > 2015 (r279641) > +++ head/sys/dev/virtio/block/virtio_blk.c Thu Mar 5 09:51:59 > 2015 (r279642) > @@ -205,6 +205,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", > VIRTIO_BLK_F_RO | \ > VIRTIO_BLK_F_BLK_SIZE | \ > VIRTIO_BLK_F_WCE | \ > + VIRTIO_BLK_F_TOPOLOGY | \ > VIRTIO_BLK_F_CONFIG_WCE | \ > VIRTIO_RING_F_INDIRECT_DESC) > > > > ------------------------------ > > Message: 2 > Date: Thu, 5 Mar 2015 09:55:36 +0000 (UTC) > From: Hans Petter Selasky > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org > Subject: svn commit: r279643 - in stable/9/usr.bin: find indent jot > setchannel tr unifdef vgrind > Message-ID: <201503050955.t259tacH051234@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: hselasky > Date: Thu Mar 5 09:55:35 2015 > New Revision: 279643 > URL: https://svnweb.freebsd.org/changeset/base/279643 > > Log: > MFC r227243, r233456, r248258, r248849 and r279297: > > Update to upstream version 2.10 > > The most notable new feature is support for definition files. > > The most notable new feature is support for processing multiple > files in one invocation. There is also support for more make-friendly > exit statuses. > > The most notable bug fix is #line directives now include the input > file name. > > Obtained from: http://dotat.at/prog/unifdef > > Added: > stable/9/usr.bin/unifdef/unifdef.h > - copied, changed from r248849, head/usr.bin/unifdef/unifdef.h > Modified: > stable/9/usr.bin/find/find.1 > stable/9/usr.bin/indent/indent.1 > stable/9/usr.bin/jot/jot.1 > stable/9/usr.bin/setchannel/setchannel.1 > stable/9/usr.bin/tr/tr.1 > stable/9/usr.bin/unifdef/unifdef.1 > stable/9/usr.bin/unifdef/unifdef.c > stable/9/usr.bin/unifdef/unifdefall.sh > stable/9/usr.bin/vgrind/vgrindefs.5 > Directory Properties: > stable/9/usr.bin/ (props changed) > stable/9/usr.bin/calendar/ (props changed) > stable/9/usr.bin/find/ (props changed) > stable/9/usr.bin/indent/ (props changed) > > Modified: stable/9/usr.bin/find/find.1 > ============================================================================== > --- stable/9/usr.bin/find/find.1 Thu Mar 5 09:51:59 2015 (r279642) > +++ stable/9/usr.bin/find/find.1 Thu Mar 5 09:55:35 2015 (r279643) > @@ -156,7 +156,6 @@ This option is equivalent to the depreca > primary. > .El > .Sh PRIMARIES > -.Pp > All primaries which take a numeric argument allow the number to be > preceded by a plus sign > .Pq Dq Li + > > Modified: stable/9/usr.bin/indent/indent.1 > ============================================================================== > --- stable/9/usr.bin/indent/indent.1 Thu Mar 5 09:51:59 2015 (r279642) > +++ stable/9/usr.bin/indent/indent.1 Thu Mar 5 09:55:35 2015 (r279643) > @@ -488,7 +488,6 @@ The > utility fits as many words (separated by blanks, tabs, or newlines) on a > line as possible. > Blank lines break paragraphs. > -.Pp > .Ss Comment indentation > If a comment is on a line with code it is started in the `comment column', > which is set by the > @@ -504,7 +503,6 @@ command line parameter. > If the code on a line extends past the comment > column, the comment starts further to the right, and the right margin may > be > automatically extended in extreme cases. > -.Pp > .Ss Preprocessor lines > In general, > .Nm > @@ -519,7 +517,6 @@ is recognized and > .Nm > attempts to correctly > compensate for the syntactic peculiarities introduced. > -.Pp > .Ss C syntax > The > .Nm > > Modified: stable/9/usr.bin/jot/jot.1 > ============================================================================== > --- stable/9/usr.bin/jot/jot.1 Thu Mar 5 09:51:59 2015 (r279642) > +++ stable/9/usr.bin/jot/jot.1 Thu Mar 5 09:55:35 2015 (r279643) > @@ -242,7 +242,6 @@ specifying an integer format: > .Bd -literal -offset indent > $ jot -w %d 6 1 10 0.5 > .Ed > -.Pp > .Sh EXIT STATUS > .Ex -std > .Sh EXAMPLES > > Modified: stable/9/usr.bin/setchannel/setchannel.1 > ============================================================================== > --- stable/9/usr.bin/setchannel/setchannel.1 Thu Mar 5 09:51:59 > 2015 (r279642) > +++ stable/9/usr.bin/setchannel/setchannel.1 Thu Mar 5 09:55:35 > 2015 (r279643) > @@ -33,7 +33,6 @@ > .Nd Hauppage PVR250/350 channel selector > .Sh SYNOPSIS > .Cd pvr250-setchannel [-a {on | off}] [-c | -r | -s | -t] [-g geom] [-m > channel_set] [channel | freq] > -.Pp > .Sh DESCRIPTION > .Nm > provides support for selecting channels on Hauppauge WinTV cards, > > Modified: stable/9/usr.bin/tr/tr.1 > ============================================================================== > --- stable/9/usr.bin/tr/tr.1 Thu Mar 5 09:51:59 2015 (r279642) > +++ stable/9/usr.bin/tr/tr.1 Thu Mar 5 09:55:35 2015 (r279643) > @@ -145,7 +145,6 @@ the octal sequence to the full 3 octal d > .It \echaracter > A backslash followed by certain special characters maps to special > values. > -.Pp > .Bl -column "\ea" > .It "\ea > .It "\eb > @@ -177,7 +176,6 @@ previous implementations. > .It [:class:] > Represents all characters belonging to the defined character class. > Class names are: > -.Pp > .Bl -column "phonogram" > .It "alnum > .It "alpha > > Modified: stable/9/usr.bin/unifdef/unifdef.1 > ============================================================================== > --- stable/9/usr.bin/unifdef/unifdef.1 Thu Mar 5 09:51:59 2015 (r279642) > +++ stable/9/usr.bin/unifdef/unifdef.1 Thu Mar 5 09:55:35 2015 (r279643) > @@ -1,6 +1,6 @@ > .\" Copyright (c) 1985, 1991, 1993 > .\" The Regents of the University of California. All rights reserved. > -.\" Copyright (c) 2002 - 2010 Tony Finch . All rights > reserved. > +.\" Copyright (c) 2002 - 2013 Tony Finch . All rights > reserved. > .\" > .\" This code is derived from software contributed to Berkeley by > .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. > @@ -31,23 +31,24 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 11, 2010 > -.Dt UNIFDEF 1 > -.Os > +.Dd January 7, 2014 > +.Dt UNIFDEF 1 PRM > +.Os " " > .Sh NAME > .Nm unifdef , unifdefall > .Nd remove preprocessor conditionals from code > .Sh SYNOPSIS > .Nm > -.Op Fl bBcdeKknsStV > +.Op Fl bBcdehKkmnsStV > .Op Fl I Ns Ar path > -.Op Fl D Ns Ar sym Ns Op = Ns Ar val > -.Op Fl U Ns Ar sym > -.Op Fl iD Ns Ar sym Ns Op = Ns Ar val > -.Op Fl iU Ns Ar sym > +.Op Fl [i]D Ns Ar sym Ns Op = Ns Ar val > +.Op Fl [i]U Ns Ar sym > .Ar ... > +.Op Fl f Ar defile > +.Op Fl x Bro Ar 012 Brc > +.Op Fl M Ar backext > .Op Fl o Ar outfile > -.Op Ar infile > +.Op Ar infile ... > .Nm unifdefall > .Op Fl I Ns Ar path > .Ar ... > @@ -66,14 +67,21 @@ while otherwise leaving the file alone. > The > .Nm > utility acts on > -.Ic #if , #ifdef , #ifndef , #elif , #else , > +.Ic #if , #ifdef , #ifndef , > +.Ic #elif , #else , > and > .Ic #endif > -lines. > -A directive is only processed > -if the symbols specified on the command line are sufficient to allow > -.Nm > -to get a definite value for its control expression. > +lines, > +using macros specified in > +.Fl D > +and > +.Fl U > +command line options or in > +.Fl f > +definitions files. > +A directive is processed > +if the macro specifications are sufficient to provide > +a definite value for its control expression. > If the result is false, > the directive and the following lines under its control are removed. > If the result is true, > @@ -83,7 +91,7 @@ An > or > .Ic #ifndef > directive is passed through unchanged > -if its controlling symbol is not specified on the command line. > +if its controlling macro is not specified. > Any > .Ic #if > or > @@ -109,12 +117,14 @@ and > .Ic #elif > lines: > integer constants, > -integer values of symbols defined on the command line, > +integer values of macros defined on the command line, > the > .Fn defined > operator, > the operators > -.Ic \&! , < , > , <= , >= , == , != , && , || , > +.Ic \&! , < , > , > +.Ic <= , >= , == , != , > +.Ic && , || , > and parenthesized expressions. > A kind of > .Dq "short circuit" > @@ -128,16 +138,42 @@ if either operand of > .Ic || > is definitely true then the result is true. > .Pp > -In most cases, the > +When evaluating an expression, > .Nm > -utility does not distinguish between object-like macros > -(without arguments) and function-like arguments (with arguments). > -If a macro is not explicitly defined, or is defined with the > +does not expand macros first. > +The value of a macro must be a simple number, > +not an expression. > +A limited form of indirection is allowed, > +where one macro's value is the name of another. > +.Pp > +In most cases, > +.Nm > +does not distinguish between object-like macros > +(without arguments) and function-like macros (with arguments). > +A function-like macro invocation can appear in > +.Ic #if > +and > +.Ic #elif > +control expressions. > +If the macro is not explicitly defined, > +or is defined with the > .Fl D > -flag on the command-line, its arguments are ignored. > +flag on the command-line, > +or with > +.Ic #define > +in a > +.Fl f > +definitions file, > +its arguments are ignored. > If a macro is explicitly undefined on the command line with the > .Fl U > -flag, it may not have any arguments since this leads to a syntax error. > +flag, > +or with > +.Ic #undef > +in a > +.Fl f > +definitions file, > +it may not have any arguments since this leads to a syntax error. > .Pp > The > .Nm > @@ -158,30 +194,65 @@ It uses > .Nm Fl s > and > .Nm cpp Fl dM > -to get lists of all the controlling symbols > +to get lists of all the controlling macros > and their definitions (or lack thereof), > then invokes > .Nm > with appropriate arguments to process the file. > .Sh OPTIONS > -.Pp > .Bl -tag -width indent -compact > .It Fl D Ns Ar sym Ns = Ns Ar val > -Specify that a symbol is defined to a given value > -which is used when evaluating > -.Ic #if > -and > -.Ic #elif > -control expressions. > +Specify that a macro is defined to a given value. > .Pp > .It Fl D Ns Ar sym > -Specify that a symbol is defined to the value 1. > +Specify that a macro is defined to the value 1. > .Pp > .It Fl U Ns Ar sym > -Specify that a symbol is undefined. > -If the same symbol appears in more than one argument, > +Specify that a macro is undefined. > +.Pp > +If the same macro appears in more than one argument, > the last occurrence dominates. > .Pp > +.It Fl iD Ns Ar sym Ns Op = Ns Ar val > +.It Fl iU Ns Ar sym > +C strings, comments, > +and line continuations > +are ignored within > +.Ic #ifdef > +and > +.Ic #ifndef > +blocks > +controlled by macros > +specified with these options. > +.Pp > +.It Fl f Ar defile > +The file > +.Ar defile > +contains > +.Ic #define > +and > +.Ic #undef > +preprocessor directives, > +which have the same effect as the corresponding > +.Fl D > +and > +.Fl U > +command-line arguments. > +You can have multiple > +.Fl f > +arguments and mix them with > +.Fl D > +and > +.Fl U > +arguments; > +later options override earlier ones. > +.Pp > +Each directive must be on a single line. > +Object-like macro definitions (without arguments) > +are set to the given value. > +Function-like macro definitions (with arguments) > +are treated as if they are set to 1. > +.Pp > .It Fl b > Replace removed lines with blank lines > instead of deleting them. > @@ -196,35 +267,39 @@ Mutually exclusive with the > option. > .Pp > .It Fl c > -If the > -.Fl c > -flag is specified, > -then the operation of > -.Nm > -is complemented, > -i.e., the lines that would have been removed or blanked > +Complement, > +i.e., lines that would have been removed or blanked > are retained and vice versa. > .Pp > .It Fl d > Turn on printing of debugging messages. > .Pp > .It Fl e > -Because > -.Nm > -processes its input one line at a time, > -it cannot remove preprocessor directives that span more than one line. > -The most common example of this is a directive with a multi-line > -comment hanging off its right hand end. > By default, > -if > .Nm > -has to process such a directive, > -it will complain that the line is too obfuscated. > +will report an error if it needs to remove > +a preprocessor directive that spans more than one line, > +for example, if it has a multi-line > +comment hanging off its right hand end. > The > .Fl e > -option changes the behaviour so that, > -where possible, > -such lines are left unprocessed instead of reporting an error. > +flag makes it ignore the line instead. > +.Pp > +.It Fl h > +Print help. > +.Pp > +.It Fl I Ns Ar path > +Specifies to > +.Nm unifdefall > +an additional place to look for > +.Ic #include > +files. > +This option is ignored by > +.Nm > +for compatibility with > +.Xr cpp 1 > +and to simplify the implementation of > +.Nm unifdefall . > .Pp > .It Fl K > Always treat the result of > @@ -248,6 +323,15 @@ because they typically start > and are used as a kind of comment to sketch out future or past > development. > It would be rude to strip them out, just as it would be for normal > comments. > .Pp > +.It Fl m > +Modify one or more input files in place. > +.Pp > +.It Fl M Ar backext > +Modify input files in place, and keep backups of the original files by > +appending the > +.Ar backext > +to the input filenames. > +.Pp > .It Fl n > Add > .Li #line > @@ -258,96 +342,57 @@ line numbers in the input file. > .It Fl o Ar outfile > Write output to the file > .Ar outfile > -instead of the standard output. > -If > -.Ar outfile > -is the same as the input file, > -the output is written to a temporary file > -which is renamed into place when > -.Nm > -completes successfully. > +instead of the standard output when processing a single file. > .Pp > .It Fl s > -Instead of processing the input file as usual, > +Instead of processing an input file as usual, > this option causes > .Nm > -to produce a list of symbols that appear in expressions > -that > -.Nm > -understands. > -It is useful in conjunction with the > -.Fl dM > -option of > -.Xr cpp 1 > -for creating > -.Nm > -command lines. > +to produce a list of macros that are used in > +preprocessor directive controlling expressions. > .Pp > .It Fl S > Like the > .Fl s > -option, but the nesting depth of each symbol is also printed. > +option, but the nesting depth of each macro is also printed. > This is useful for working out the number of possible combinations > -of interdependent defined/undefined symbols. > +of interdependent defined/undefined macros. > .Pp > .It Fl t > -Disables parsing for C comments > +Disables parsing for C strings, comments, > and line continuations, > which is useful > for plain text. > -.Pp > -.It Fl iD Ns Ar sym Ns Op = Ns Ar val > -.It Fl iU Ns Ar sym > -Ignore > -.Ic #ifdef Ns s . > -If your C code uses > -.Ic #ifdef Ns s > -to delimit non-C lines, > -such as comments > -or code which is under construction, > -then you must tell > -.Nm > -which symbols are used for that purpose so that it will not try to parse > -comments > -and line continuations > -inside those > -.Ic #ifdef Ns s . > -You can specify ignored symbols with > -.Fl iD Ns Ar sym Ns Oo = Ns Ar val Oc > -and > -.Fl iU Ns Ar sym > -similar to > -.Fl D Ns Ar sym Ns Op = Ns Ar val > +This is a blanket version of the > +.Fl iD > and > -.Fl U Ns Ar sym > -above. > -.Pp > -.It Fl I Ns Ar path > -Specifies to > -.Nm unifdefall > -an additional place to look for > -.Ic #include > -files. > -This option is ignored by > -.Nm > -for compatibility with > -.Xr cpp 1 > -and to simplify the implementation of > -.Nm unifdefall . > +.Fl iU > +flags. > .Pp > .It Fl V > Print version details. > +.Pp > +.It Fl x Bro Ar 012 Brc > +Set exit status mode to zero, one, or two. > +See the > +.Sx EXIT STATUS > +section below for details. > .El > .Pp > The > .Nm > -utility copies its output to > -.Em stdout > -and will take its input from > +utility takes its input from > .Em stdin > -if no > +if there are no > .Ar file > -argument is given. > +arguments. > +You must use the > +.Fl m > +or > +.Fl M > +options if there are multiple input files. > +You can specify inut from stdin or output to stdout with > +.Ql - . > .Pp > The > .Nm > @@ -356,10 +401,35 @@ utility works nicely with the > option of > .Xr diff 1 . > .Sh EXIT STATUS > -The > +In normal usage the > +.Nm > +utility's exit status depends on the mode set using the > +.Fl x > +option. > +.Pp > +If the exit mode is zero (the default) then > +.Nm > +exits with status 0 if the output is an exact copy of the input, > +or with status 1 if the output differs. > +.Pp > +If the exit mode is one, > +.Nm > +exits with status 1 if the output is unmodified > +or 0 if it differs. > +.Pp > +If the exit mode is two, > .Nm > -utility exits 0 if the output is an exact copy of the input, > -1 if not, and 2 if in trouble. > +exits with status zero in both cases. > +.Pp > +In all exit modes, > +.Nm > +exits with status 2 if there is an error. > +.Pp > +The exit status is 0 if the > +.Fl h > +or > +.Fl V > +command line options are given. > .Sh DIAGNOSTICS > .Bl -item > .It > @@ -384,6 +454,9 @@ in comment. > .Sh SEE ALSO > .Xr cpp 1 , > .Xr diff 1 > +.Pp > +The unifdef home page is > +.Pa http://dotat.at/prog/unifdef > .Sh HISTORY > The > .Nm > @@ -401,13 +474,14 @@ rewrote it to support > .Sh BUGS > Expression evaluation is very limited. > .Pp > -Preprocessor control lines split across more than one physical line > +Handling one line at a time means > +preprocessor directives split across more than one physical line > (because of comments or backslash-newline) > cannot be handled in every situation. > .Pp > Trigraphs are not recognized. > .Pp > -There is no support for symbols with different definitions at > +There is no support for macros with different definitions at > different points in the source file. > .Pp > The text-mode and ignore functionality does not correspond to modern > > Modified: stable/9/usr.bin/unifdef/unifdef.c > ============================================================================== > --- stable/9/usr.bin/unifdef/unifdef.c Thu Mar 5 09:51:59 2015 (r279642) > +++ stable/9/usr.bin/unifdef/unifdef.c Thu Mar 5 09:55:35 2015 (r279643) > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002 - 2011 Tony Finch > + * Copyright (c) 2002 - 2014 Tony Finch > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -43,21 +43,10 @@ > * it possible to handle all "dodgy" directives correctly. > */ > > -#include > -#include > +#include "unifdef.h" > > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -const char copyright[] = > - "@(#) $Version: unifdef-2.5.6.21f1388 $\n" > +static const char copyright[] = > + "@(#) $Version: unifdef-2.10 $\n" > "@(#) $FreeBSD$\n" > "@(#) $Author: Tony Finch (dot@dotat.at) $\n" > "@(#) $URL: http://dotat.at/prog/unifdef $\n" > @@ -93,6 +82,9 @@ static char const * const linetype_name[ > "PLAIN", "EOF", "ERROR" > }; > > +#define linetype_if2elif(lt) ((Linetype)(lt - LT_IF + LT_ELIF)) > +#define linetype_2dodgy(lt) ((Linetype)(lt + LT_DODGY)) > + > /* state of #if processing */ > typedef enum { > IS_OUTSIDE, > @@ -146,7 +138,7 @@ static char const * const linestate_name > */ > #define MAXDEPTH 64 /* maximum #if nesting */ > #define MAXLINE 4096 /* maximum length of line */ > -#define MAXSYMS 4096 /* maximum number of symbols */ > +#define MAXSYMS 16384 /* maximum number of symbols */ > > /* > * Sometimes when editing a keyword the replacement text is longer, so > @@ -155,11 +147,6 @@ static char const * const linestate_name > #define EDITSLOP 10 > > /* > - * For temporary filenames > - */ > -#define TEMPLATE "unifdef.XXXXXX" > - > -/* > * Globals. > */ > > @@ -167,6 +154,7 @@ static bool compblank; /* - > static bool lnblank; /* -b: blank deleted lines */ > static bool complement; /* -c: do the complement */ > static bool debugging; /* -d: debugging reports */ > +static bool inplace; /* -m: modify in place */ > static bool iocccok; /* -e: fewer IOCCC errors */ > static bool strictlogic; /* -K: keep ambiguous #ifs */ > static bool killconsts; /* -k: eval constant #ifs */ > @@ -183,14 +171,24 @@ static int nsyms; /* numb > static FILE *input; /* input file pointer */ > static const char *filename; /* input file name */ > static int linenum; /* current line number */ > +static const char *linefile; /* file name for #line */ > static FILE *output; /* output file pointer */ > static const char *ofilename; /* output file name */ > -static bool overwriting; /* output overwrites input */ > -static char tempname[FILENAME_MAX]; /* used when overwriting > */ > +static const char *backext; /* backup extension */ > +static char *tempname; /* avoid splatting input */ > > static char tline[MAXLINE+EDITSLOP];/* input buffer plus space > */ > static char *keyword; /* used for editing #elif's */ > > +/* > + * When processing a file, the output's newline style will match the > + * input's, and unifdef correctly handles CRLF or LF endings whatever > + * the platform's native style. The stdio streams are opened in binary > + * mode to accommodate platforms whose native newline style is CRLF. > + * When the output isn't a processed input file (when it is error / > + * debug / diagnostic messages) then unifdef uses native line endings. > + */ > + > static const char *newline; /* input file format */ > static const char newline_unix[] = "\n"; > static const char newline_crlf[] = "\r\n"; > @@ -205,33 +203,47 @@ static int delcount; /* co > static unsigned blankcount; /* count of blank lines */ > static unsigned blankmax; /* maximum recent blankcount */ > static bool constexpr; /* constant #if expression */ > -static bool zerosyms = true; /* to format symdepth output */ > +static bool zerosyms; /* to format symdepth output */ > static bool firstsym; /* ditto */ > > +static int exitmode; /* exit status mode */ > static int exitstat; /* program exit status */ > > -static void addsym(bool, bool, char *); > -static void closeout(void); > +static void addsym1(bool, bool, char *); > +static void addsym2(bool, const char *, const char *); > +static char *astrcat(const char *, const char *); > +static void cleantemp(void); > +static void closeio(void); > static void debug(const char *, ...); > +static void debugsym(const char *, int); > +static bool defundef(void); > +static void defundefile(const char *); > static void done(void); > static void error(const char *); > -static int findsym(const char *); > +static int findsym(const char **); > static void flushline(bool); > -static Linetype parseline(void); > +static void hashline(void); > +static void help(void); > static Linetype ifeval(const char **); > static void ignoreoff(void); > static void ignoreon(void); > +static void indirectsym(void); > static void keywordedit(const char *); > +static const char *matchsym(const char *, const char *); > static void nest(void); > +static Linetype parseline(void); > static void process(void); > +static void processinout(const char *, const char *); > static const char *skipargs(const char *); > static const char *skipcomment(const char *); > +static const char *skiphash(void); > +static const char *skipline(const char *); > static const char *skipsym(const char *); > static void state(Ifstate); > -static int strlcmp(const char *, const char *, size_t); > static void unnest(void); > static void usage(void); > static void version(void); > +static const char *xstrdup(const char *, const char *); > > #define endsym(c) (!isalnum((unsigned char)c) && c != '_') > > @@ -243,7 +255,7 @@ main(int argc, char *argv[]) > { > int opt; > > - while ((opt = getopt(argc, argv, "i:D:U:I:o:bBcdeKklnsStV")) != -1) > + while ((opt = getopt(argc, argv, "i:D:U:f:I:M:o:x:bBcdehKklmnsStV")) != > -1) > switch (opt) { > case 'i': /* treat stuff controlled by these symbols as text */ > /* > @@ -253,17 +265,17 @@ main(int argc, char *argv[]) > */ > opt = *optarg++; > if (opt == 'D') > - addsym(true, true, optarg); > + addsym1(true, true, optarg); > else if (opt == 'U') > - addsym(true, false, optarg); > + addsym1(true, false, optarg); > else > usage(); > break; > case 'D': /* define a symbol */ > - addsym(false, true, optarg); > + addsym1(false, true, optarg); > break; > case 'U': /* undef a symbol */ > - addsym(false, false, optarg); > + addsym1(false, false, optarg); > break; > case 'I': /* no-op for compatibility with cpp */ > break; > @@ -283,12 +295,25 @@ main(int argc, char *argv[]) > case 'e': /* fewer errors from dodgy lines */ > iocccok = true; > break; > + case 'f': /* definitions file */ > + defundefile(optarg); > + break; > + case 'h': > + help(); > + break; > case 'K': /* keep ambiguous #ifs */ > strictlogic = true; > break; > case 'k': /* process constant #ifs */ > killconsts = true; > break; > + case 'm': /* modify in place */ > + inplace = true; > + break; > + case 'M': /* modify in place and keep backup */ > + inplace = true; > + backext = optarg; > + break; > case 'n': /* add #line directive after deleted lines */ > lnnum = true; > break; > @@ -304,8 +329,14 @@ main(int argc, char *argv[]) > case 't': /* don't parse C comments */ > text = true; > break; > - case 'V': /* print version */ > + case 'V': > version(); > + break; > + case 'x': > + exitmode = atoi(optarg); > + if(exitmode < 0 || exitmode > 2) > + usage(); > + break; > default: > usage(); > } > @@ -313,54 +344,98 @@ main(int argc, char *argv[]) > argv += optind; > if (compblank && lnblank) > errx(2, "-B and -b are mutually exclusive"); > - if (argc > 1) { > - errx(2, "can only do one file"); > - } else if (argc == 1 && strcmp(*argv, "-") != 0) { > - filename = *argv; > - input = fopen(filename, "rb"); > - if (input == NULL) > - err(2, "can't open %s", filename); > - } else { > - filename = "[stdin]"; > - input = stdin; > + if (symlist && (ofilename != NULL || inplace || argc > 1)) > + errx(2, "-s only works with one input file"); > + if (argc > 1 && ofilename != NULL) > + errx(2, "-o cannot be used with multiple input files"); > + if (argc > 1 && !inplace) > + errx(2, "multiple input files require -m or -M"); > + if (argc == 0) > + argc = 1; > + if (argc == 1 && !inplace && ofilename == NULL) > + ofilename = "-"; > + indirectsym(); > + > + atexit(cleantemp); > + if (ofilename != NULL) > + processinout(*argv, ofilename); > + else while (argc-- > 0) { > + processinout(*argv, *argv); > + argv++; > } > - if (ofilename == NULL) { > - ofilename = "[stdout]"; > - output = stdout; > + switch(exitmode) { > + case(0): exit(exitstat); > + case(1): exit(!exitstat); > + case(2): exit(0); > + default: abort(); /* bug */ > + } > +} > + > +/* > + * File logistics. > + */ > +static void > +processinout(const char *ifn, const char *ofn) > +{ > + struct stat st; > + > + if (ifn == NULL || strcmp(ifn, "-") == 0) { > + filename = "[stdin]"; > + linefile = NULL; > + input = fbinmode(stdin); > } else { > - struct stat ist, ost; > - if (stat(ofilename, &ost) == 0 && > - fstat(fileno(input), &ist) == 0) > - overwriting = (ist.st_dev == ost.st_dev > - && ist.st_ino == ost.st_ino); > - if (overwriting) { > - const char *dirsep; > - int ofd; > - > - dirsep = strrchr(ofilename, '/'); > - if (dirsep != NULL) > - snprintf(tempname, sizeof(tempname), > - "%.*s/" TEMPLATE, > - (int)(dirsep - ofilename), ofilename); > - else > - snprintf(tempname, sizeof(tempname), > - TEMPLATE); > - ofd = mkstemp(tempname); > - if (ofd != -1) > - output = fdopen(ofd, "wb+"); > - if (output == NULL) > - err(2, "can't create temporary file"); > - fchmod(ofd, ist.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)); > - } else { > - output = fopen(ofilename, "wb"); > - if (output == NULL) > - err(2, "can't open %s", ofilename); > - } > + filename = ifn; > + linefile = ifn; > + input = fopen(ifn, "rb"); > + if (input == NULL) > + err(2, "can't open %s", ifn); > + } > + if (strcmp(ofn, "-") == 0) { > + output = fbinmode(stdout); > + process(); > + return; > } > + if (stat(ofn, &st) < 0) { > + output = fopen(ofn, "wb"); > + if (output == NULL) > + err(2, "can't create %s", ofn); > + process(); > + return; > + } > + > + tempname = astrcat(ofn, ".XXXXXX"); > + output = mktempmode(tempname, st.st_mode); > + if (output == NULL) > + err(2, "can't create %s", tempname); > + > process(); > - abort(); /* bug */ > + > + if (backext != NULL) { > + char *backname = astrcat(ofn, backext); > + if (rename(ofn, backname) < 0) > + err(2, "can't rename \"%s\" to \"%s\"", ofn, backname); > + free(backname); > + } > + if (replace(tempname, ofn) < 0) > + err(2, "can't rename \"%s\" to \"%s\"", tempname, ofn); > + free(tempname); > + tempname = NULL; > } > > +/* > + * For cleaning up if there is an error. > + */ > +static void > +cleantemp(void) > +{ > + if (tempname != NULL) > + remove(tempname); > +} > + > +/* > + * Self-identification functions. > + */ > + > static void > version(void) > { > @@ -376,13 +451,54 @@ version(void) > } > > static void > +synopsis(FILE *fp) > +{ > + fprintf(fp, > + "usage: unifdef [-bBcdehKkmnsStV] [-x{012}] [-Mext] [-opath] \\\n" > + " [-[i]Dsym[=val]] [-[i]Usym] [-fpath] ... [file] ...\n"); > +} > + > +static void > usage(void) > { > - fprintf(stderr, "usage: unifdef [-bBcdeKknsStV] [-Ipath]" > - " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); > + synopsis(stderr); > exit(2); > } > > +static void > +help(void) > +{ > + synopsis(stdout); > + printf( > + " -Dsym=val define preprocessor symbol with given value\n" > + " -Dsym define preprocessor symbol with value 1\n" > + " -Usym preprocessor symbol is undefined\n" > + " -iDsym=val \\ ignore C strings and comments\n" > + " -iDsym ) in sections controlled by these\n" > + " -iUsym / preprocessor symbols\n" > + " -fpath file containing #define and #undef directives\n" > + " -b blank lines instead of deleting them\n" > + " -B compress blank lines around deleted section\n" > + " -c complement (invert) keep vs. delete\n" > + " -d debugging mode\n" > + " -e ignore multiline preprocessor directives\n" > + " -h print help\n" > + " -Ipath extra include file path (ignored)\n" > + " -K disable && and || short-circuiting\n" > + " -k process constant #if expressions\n" > + " -Mext modify in place and keep backups\n" > + " -m modify input files in place\n" > + " -n add #line directives to output\n" > + " -opath output file name\n" > + " -S list #if control symbols with nesting\n" > + " -s list #if control symbols\n" > + " -t ignore C strings and comments\n" > + " -V print version\n" > + " -x{012} exit status mode\n" > + ); > + exit(0); > +} > + > /* > * A state transition function alters the global #if processing state > * in a particular way. The table below is indexed by the current > @@ -396,7 +512,7 @@ usage(void) > * When we have processed a group that starts off with a known-false > * #if/#elif sequence (which has therefore been deleted) followed by a > * #elif that we don't understand and therefore must keep, we edit the > - * latter into a #if to keep the nesting correct. We use strncpy() to > + * latter into a #if to keep the nesting correct. We use memcpy() to > * overwrite the 4 byte token "elif" with "if " without a '\0' byte. > * > * When we find a true #elif in a group, the following block will > @@ -451,7 +567,7 @@ static void Idrop (void) { Fdrop(); ign > static void Itrue (void) { Ftrue(); ignoreon(); } > static void Ifalse(void) { Ffalse(); ignoreon(); } > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > ------------------------------ > > Message: 3 > Date: Thu, 5 Mar 2015 10:04:35 +0000 (UTC) > From: Hans Petter Selasky > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org > Subject: svn commit: r279644 - stable/10/sys/dev/usb/controller > Message-ID: <201503051004.t25A4ZwB055888@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: hselasky > Date: Thu Mar 5 10:04:34 2015 > New Revision: 279644 > URL: https://svnweb.freebsd.org/changeset/base/279644 > > Log: > MFC r279210: > Add support for the DWC OTG v2 chipset found in the STM32F4 series of > processors. Make sure we pullup the data lines in device mode when we > power on the port. > > Modified: > stable/10/sys/dev/usb/controller/dwc_otg.c > stable/10/sys/dev/usb/controller/dwc_otgreg.h > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/dev/usb/controller/dwc_otg.c > ============================================================================== > --- stable/10/sys/dev/usb/controller/dwc_otg.c Thu Mar 5 09:55:35 > 2015 (r279643) > +++ stable/10/sys/dev/usb/controller/dwc_otg.c Thu Mar 5 10:04:34 > 2015 (r279644) > @@ -108,13 +108,20 @@ > GINTSTS_WKUPINT | GINTSTS_USBSUSP | GINTMSK_OTGINTMSK | \ > GINTSTS_SESSREQINT) > > -static int dwc_otg_use_hsic; > +#define DWC_OTG_PHY_ULPI 0 > +#define DWC_OTG_PHY_HSIC 1 > +#define DWC_OTG_PHY_INTERNAL 2 > > -static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC > OTG"); > +#ifndef DWC_OTG_PHY_DEFAULT > +#define DWC_OTG_PHY_DEFAULT DWC_OTG_PHY_ULPI > +#endif > + > +static int dwc_otg_phy_type = DWC_OTG_PHY_DEFAULT; > > -SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RD | CTLFLAG_TUN, > - &dwc_otg_use_hsic, 0, "DWC OTG uses HSIC interface"); > -TUNABLE_INT("hw.usb.dwc_otg.use_hsic", &dwc_otg_use_hsic); > +static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC > OTG"); > +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, phy_type, CTLFLAG_RDTUN, > + &dwc_otg_phy_type, 0, "DWC OTG PHY TYPE - 0/1/2 - > ULPI/HSIC/INTERNAL"); > +TUNABLE_INT("hw.usb.dwc_otg.phy_type", &dwc_otg_phy_type); > > #ifdef USB_DEBUG > static int dwc_otg_debug; > @@ -3762,8 +3769,9 @@ dwc_otg_init(struct dwc_otg_softc *sc) > break; > } > > - /* select HSIC or non-HSIC mode */ > - if (dwc_otg_use_hsic) { > + /* select HSIC, ULPI or internal PHY mode */ > + switch (dwc_otg_phy_type) { > + case DWC_OTG_PHY_HSIC: > DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, > GUSBCFG_PHYIF | > GUSBCFG_TRD_TIM_SET(5) | temp); > @@ -3775,7 +3783,8 @@ dwc_otg_init(struct dwc_otg_softc *sc) > temp & ~GLPMCFG_HSIC_CONN); > DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, > temp | GLPMCFG_HSIC_CONN); > - } else { > + break; > + case DWC_OTG_PHY_ULPI: > DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, > GUSBCFG_ULPI_UTMI_SEL | > GUSBCFG_TRD_TIM_SET(5) | temp); > @@ -3784,6 +3793,25 @@ dwc_otg_init(struct dwc_otg_softc *sc) > temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); > DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, > temp & ~GLPMCFG_HSIC_CONN); > + break; > + case DWC_OTG_PHY_INTERNAL: > + DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, > + GUSBCFG_PHYSEL | > + GUSBCFG_TRD_TIM_SET(5) | temp); > + DWC_OTG_WRITE_4(sc, DOTG_GOTGCTL, 0); > + > + temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); > + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, > + temp & ~GLPMCFG_HSIC_CONN); > + > + temp = DWC_OTG_READ_4(sc, DOTG_GGPIO); > + temp &= ~(DOTG_GGPIO_NOVBUSSENS | DOTG_GGPIO_I2CPADEN); > + temp |= (DOTG_GGPIO_VBUSASEN | DOTG_GGPIO_VBUSBSEN | > + DOTG_GGPIO_PWRDWN); > + DWC_OTG_WRITE_4(sc, DOTG_GGPIO, temp); > + break; > + default: > + break; > } > > /* clear global nak */ > @@ -3803,9 +3831,6 @@ dwc_otg_init(struct dwc_otg_softc *sc) > /* wait 10ms */ > usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); > > - /* pull up D+ */ > - dwc_otg_pull_up(sc); > - > temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG3); > > sc->sc_fifo_size = 4 * GHWCFG3_DFIFODEPTH_GET(temp); > @@ -4544,11 +4569,15 @@ tr_handle_set_port_feature: > /* nops */ > break; > case UHF_PORT_POWER: > + sc->sc_flags.port_powered = 1; > if (sc->sc_mode == DWC_MODE_HOST || sc->sc_mode == DWC_MODE_OTG) { > sc->sc_hprt_val |= HPRT_PRTPWR; > DWC_OTG_WRITE_4(sc, DOTG_HPRT, sc->sc_hprt_val); > } > - sc->sc_flags.port_powered = 1; > + if (sc->sc_mode == DWC_MODE_DEVICE || sc->sc_mode == DWC_MODE_OTG) { > + /* pull up D+, if any */ > + dwc_otg_pull_up(sc); > + } > break; > default: > err = USB_ERR_IOERROR; > > Modified: stable/10/sys/dev/usb/controller/dwc_otgreg.h > ============================================================================== > --- stable/10/sys/dev/usb/controller/dwc_otgreg.h Thu Mar 5 09:55:35 > 2015 (r279643) > +++ stable/10/sys/dev/usb/controller/dwc_otgreg.h Thu Mar 5 10:04:34 > 2015 (r279644) > @@ -196,6 +196,14 @@ > #define GUSBCFG_TOUTCAL_MASK 0x00000007 > #define GUSBCFG_TOUTCAL_SHIFT 0 > > +/* STM32F4 */ > +#define DOTG_GGPIO_NOVBUSSENS (1 << 21) > +#define DOTG_GGPIO_SOFOUTEN (1 << 20) > +#define DOTG_GGPIO_VBUSBSEN (1 << 19) > +#define DOTG_GGPIO_VBUSASEN (1 << 18) > +#define DOTG_GGPIO_I2CPADEN (1 << 17) > +#define DOTG_GGPIO_PWRDWN (1 << 16) > + > #define GRSTCTL_AHBIDLE (1<<31) > #define GRSTCTL_DMAREQ (1<<30) > #define GRSTCTL_TXFNUM_MASK 0x000007c0 > > > ------------------------------ > > Message: 4 > Date: Thu, 5 Mar 2015 10:07:10 +0000 (UTC) > From: "Andrey V. Elsukov" > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org > Subject: svn commit: r279645 - stable/9/sbin/geom/class/part > Message-ID: <201503051007.t25A7AaL056308@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: ae > Date: Thu Mar 5 10:07:09 2015 > New Revision: 279645 > URL: https://svnweb.freebsd.org/changeset/base/279645 > > Log: > MFC r279324: > When gpart(8) is trying automatically determine the first available > block of free space after existing partition, take into account > provider's stripeoffset, since the result will be adjusted to this > value. > > PR: 197989 > > Modified: > stable/9/sbin/geom/class/part/geom_part.c > Directory Properties: > stable/9/sbin/geom/class/part/ (props changed) > > Modified: stable/9/sbin/geom/class/part/geom_part.c > ============================================================================== > --- stable/9/sbin/geom/class/part/geom_part.c Thu Mar 5 10:04:34 > 2015 (r279644) > +++ stable/9/sbin/geom/class/part/geom_part.c Thu Mar 5 10:07:09 > 2015 (r279645) > @@ -550,7 +550,7 @@ gpart_autofill(struct gctl_req *req) > > s = find_provcfg(pp, "end"); > first = (off_t)strtoimax(s, NULL, 0) + 1; > - if (first > a_first) > + if (first + offset > a_first) > a_first = ALIGNUP(first + offset, alignment); > } > if (a_first <= last) { > > > ------------------------------ > > Message: 5 > Date: Thu, 5 Mar 2015 10:08:37 +0000 (UTC) > From: "Andrey V. Elsukov" > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org > Subject: svn commit: r279646 - stable/10/sbin/geom/class/part > Message-ID: <201503051008.t25A8bID056554@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: ae > Date: Thu Mar 5 10:08:37 2015 > New Revision: 279646 > URL: https://svnweb.freebsd.org/changeset/base/279646 > > Log: > MFC r279324: > When gpart(8) is trying automatically determine the first available > block of free space after existing partition, take into account > provider's stripeoffset, since the result will be adjusted to this > value. > > PR: 197989 > > Modified: > stable/10/sbin/geom/class/part/geom_part.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/geom/class/part/geom_part.c > ============================================================================== > --- stable/10/sbin/geom/class/part/geom_part.c Thu Mar 5 10:07:09 > 2015 (r279645) > +++ stable/10/sbin/geom/class/part/geom_part.c Thu Mar 5 10:08:37 > 2015 (r279646) > @@ -550,7 +550,7 @@ gpart_autofill(struct gctl_req *req) > > s = find_provcfg(pp, "end"); > first = (off_t)strtoimax(s, NULL, 0) + 1; > - if (first > a_first) > + if (first + offset > a_first) > a_first = ALIGNUP(first + offset, alignment); > } > if (a_first <= last) { > > > ------------------------------ > > Message: 6 > Date: Thu, 5 Mar 2015 10:12:28 +0000 (UTC) > From: "Andrey V. Elsukov" > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org > Subject: svn commit: r279647 - stable/8/sbin/geom/class/part > Message-ID: <201503051012.t25ACSpl060563@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: ae > Date: Thu Mar 5 10:12:28 2015 > New Revision: 279647 > URL: https://svnweb.freebsd.org/changeset/base/279647 > > Log: > MFC r279324: > When gpart(8) is trying automatically determine the first available > block of free space after existing partition, take into account > provider's stripeoffset, since the result will be adjusted to this > value. > > PR: 197989 > > Modified: > stable/8/sbin/geom/class/part/geom_part.c > Directory Properties: > stable/8/sbin/geom/class/part/ (props changed) > > Modified: stable/8/sbin/geom/class/part/geom_part.c > ============================================================================== > --- stable/8/sbin/geom/class/part/geom_part.c Thu Mar 5 10:08:37 > 2015 (r279646) > +++ stable/8/sbin/geom/class/part/geom_part.c Thu Mar 5 10:12:28 > 2015 (r279647) > @@ -565,7 +565,7 @@ gpart_autofill(struct gctl_req *req) > (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; > } else > first = (off_t)strtoimax(s, NULL, 0) + 1; > - if (first > a_first) > + if (first + offset > a_first) > a_first = ALIGNUP(first + offset, alignment); > } > if (a_first <= last) { > > > ------------------------------ > > Message: 7 > Date: Thu, 5 Mar 2015 10:18:04 +0000 (UTC) > From: Hans Petter Selasky > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org > Subject: svn commit: r279648 - stable/10/sys/dev/usb/controller > Message-ID: <201503051018.t25AI40Q061306@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: hselasky > Date: Thu Mar 5 10:18:03 2015 > New Revision: 279648 > URL: https://svnweb.freebsd.org/changeset/base/279648 > > Log: > MFC r279544: > Add quirk to disable 64-bit XHCI DMA after r276717. > > Requested by: Gary Jennejohn > > Modified: > stable/10/sys/dev/usb/controller/xhci.c > stable/10/sys/dev/usb/controller/xhci.h > stable/10/sys/dev/usb/controller/xhci_pci.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/dev/usb/controller/xhci.c > ============================================================================== > --- stable/10/sys/dev/usb/controller/xhci.c Thu Mar 5 10:12:28 > 2015 (r279647) > +++ stable/10/sys/dev/usb/controller/xhci.c Thu Mar 5 10:18:03 > 2015 (r279648) > @@ -98,18 +98,23 @@ TUNABLE_INT("hw.usb.xhci.streams", &xhci > static int xhcidebug; > static int xhciroute; > static int xhcipolling; > +static int xhcidma32; > > SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, > &xhcidebug, 0, "Debug level"); > TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); > SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | > CTLFLAG_TUN, > - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI > controller"); > + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI > controller"); > TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); > SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, > - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI > controller"); > + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI > controller"); > TUNABLE_INT("hw.usb.xhci.use_polling", &xhcipolling); > +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, > + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); > +TUNABLE_INT("hw.usb.xhci.dma32", &xhcidma32); > #else > #define xhciroute 0 > +#define xhcidma32 0 > #endif > > #define XHCI_INTR_ENDPT 1 > @@ -580,7 +585,7 @@ xhci_halt_controller(struct xhci_softc * > } > > usb_error_t > -xhci_init(struct xhci_softc *sc, device_t self) > +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) > { > uint32_t temp; > > @@ -627,7 +632,8 @@ xhci_init(struct xhci_softc *sc, device_ > } > > /* get DMA bits */ > - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; > + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && > + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; > > device_printf(self, "%d bytes context size, %d-bit DMA\n", > sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); > > Modified: stable/10/sys/dev/usb/controller/xhci.h > ============================================================================== > --- stable/10/sys/dev/usb/controller/xhci.h Thu Mar 5 10:12:28 > 2015 (r279647) > +++ stable/10/sys/dev/usb/controller/xhci.h Thu Mar 5 10:18:03 > 2015 (r279648) > @@ -522,7 +522,7 @@ struct xhci_softc { > > uint8_t xhci_use_polling(void); > usb_error_t xhci_halt_controller(struct xhci_softc *); > -usb_error_t xhci_init(struct xhci_softc *, device_t); > +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); > usb_error_t xhci_start_controller(struct xhci_softc *); > void xhci_interrupt(struct xhci_softc *); > void xhci_uninit(struct xhci_softc *); > > Modified: stable/10/sys/dev/usb/controller/xhci_pci.c > ============================================================================== > --- stable/10/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:12:28 > 2015 (r279647) > +++ stable/10/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:18:03 > 2015 (r279648) > @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) > sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); > sc->sc_io_size = rman_get_size(sc->sc_io_res); > > - if (xhci_init(sc, self)) { > + if (xhci_init(sc, self, 0)) { > device_printf(self, "Could not initialize softc\n"); > bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, > sc->sc_io_res); > > > ------------------------------ > > Message: 8 > Date: Thu, 5 Mar 2015 10:23:39 +0000 (UTC) > From: Hans Petter Selasky > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org > Subject: svn commit: r279650 - stable/9/sys/dev/usb/controller > Message-ID: <201503051023.t25ANdZw065531@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: hselasky > Date: Thu Mar 5 10:23:38 2015 > New Revision: 279650 > URL: https://svnweb.freebsd.org/changeset/base/279650 > > Log: > MFC r279544: > Add quirk to disable 64-bit XHCI DMA after r276717. > > Requested by: Gary Jennejohn > > Modified: > stable/9/sys/dev/usb/controller/xhci.c > stable/9/sys/dev/usb/controller/xhci.h > stable/9/sys/dev/usb/controller/xhci_pci.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) > > Modified: stable/9/sys/dev/usb/controller/xhci.c > ============================================================================== > --- stable/9/sys/dev/usb/controller/xhci.c Thu Mar 5 10:22:59 > 2015 (r279649) > +++ stable/9/sys/dev/usb/controller/xhci.c Thu Mar 5 10:23:38 > 2015 (r279650) > @@ -87,19 +87,24 @@ __FBSDID("$FreeBSD$"); > static int xhcidebug; > static int xhciroute; > static int xhcipolling; > +static int xhcidma32; > > static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); > SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, > &xhcidebug, 0, "Debug level"); > TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); > SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | > CTLFLAG_TUN, > - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI > controller"); > + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI > controller"); > TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); > SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, > - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI > controller"); > + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI > controller"); > TUNABLE_INT("hw.usb.xhci.use_polling", &xhcipolling); > +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, > + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); > +TUNABLE_INT("hw.usb.xhci.dma32", &xhcidma32); > #else > #define xhciroute 0 > +#define xhcidma32 0 > #endif > > #define XHCI_INTR_ENDPT 1 > @@ -569,7 +574,7 @@ xhci_halt_controller(struct xhci_softc * > } > > usb_error_t > -xhci_init(struct xhci_softc *sc, device_t self) > +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) > { > uint32_t temp; > > @@ -616,7 +621,8 @@ xhci_init(struct xhci_softc *sc, device_ > } > > /* get DMA bits */ > - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; > + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && > + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; > > device_printf(self, "%d bytes context size, %d-bit DMA\n", > sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); > > Modified: stable/9/sys/dev/usb/controller/xhci.h > ============================================================================== > --- stable/9/sys/dev/usb/controller/xhci.h Thu Mar 5 10:22:59 > 2015 (r279649) > +++ stable/9/sys/dev/usb/controller/xhci.h Thu Mar 5 10:23:38 > 2015 (r279650) > @@ -513,7 +513,7 @@ struct xhci_softc { > > uint8_t xhci_use_polling(void); > usb_error_t xhci_halt_controller(struct xhci_softc *); > -usb_error_t xhci_init(struct xhci_softc *, device_t); > +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); > usb_error_t xhci_start_controller(struct xhci_softc *); > void xhci_interrupt(struct xhci_softc *); > void xhci_uninit(struct xhci_softc *); > > Modified: stable/9/sys/dev/usb/controller/xhci_pci.c > ============================================================================== > --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:22:59 > 2015 (r279649) > +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:23:38 > 2015 (r279650) > @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) > sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); > sc->sc_io_size = rman_get_size(sc->sc_io_res); > > - if (xhci_init(sc, self)) { > + if (xhci_init(sc, self, 0)) { > device_printf(self, "Could not initialize softc\n"); > bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, > sc->sc_io_res); > > > ------------------------------ > > Message: 9 > Date: Thu, 5 Mar 2015 10:29:47 +0000 (UTC) > From: Alexander Motin > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: svn commit: r279651 - head/sys/dev/virtio/block > Message-ID: <201503051029.t25ATlEP066287@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: mav > Date: Thu Mar 5 10:29:46 2015 > New Revision: 279651 > URL: https://svnweb.freebsd.org/changeset/base/279651 > > Log: > Size of opt_io_size field is 32 bit. > > MFC after: 2 weeks > > Modified: > head/sys/dev/virtio/block/virtio_blk.h > > Modified: head/sys/dev/virtio/block/virtio_blk.h > ============================================================================== > --- head/sys/dev/virtio/block/virtio_blk.h Thu Mar 5 10:23:38 > 2015 (r279650) > +++ head/sys/dev/virtio/block/virtio_blk.h Thu Mar 5 10:29:46 > 2015 (r279651) > @@ -67,7 +67,7 @@ struct virtio_blk_config { > uint8_t physical_block_exp; > uint8_t alignment_offset; > uint16_t min_io_size; > - uint16_t opt_io_size; > + uint32_t opt_io_size; > } topology; > > /* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ > > > ------------------------------ > > Message: 10 > Date: Thu, 5 Mar 2015 10:40:45 +0000 (UTC) > From: Alexander Motin > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: svn commit: r279652 - head/usr.sbin/bhyve > Message-ID: <201503051040.t25AejWe072345@svn.freebsd.org> > Content-Type: text/plain; charset=UTF-8 > > Author: mav > Date: Thu Mar 5 10:40:45 2015 > New Revision: 279652 > URL: https://svnweb.freebsd.org/changeset/base/279652 > > Log: > Add support for TOPOLOGY feature of virtio block device. > > Passing through physical block size/offset from underlying storage allows > guest to manage proper data and I/O alignment to improve performance. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/bhyve/pci_virtio_block.c > > Modified: head/usr.sbin/bhyve/pci_virtio_block.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 10:29:46 > 2015 (r279651) > +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 10:40:45 > 2015 (r279652) > @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); > > /* Capability bits */ > #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ > -#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ > +#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ > +#define VTBLK_F_TOPOLOGY (1 << 10) /* Optimal I/O alignment */ > > /* > * Host capabilities > @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); > #define VTBLK_S_HOSTCAPS \ > ( VTBLK_F_SEG_MAX | \ > VTBLK_F_BLK_SIZE | \ > + VTBLK_F_TOPOLOGY | \ > VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ > > /* > @@ -81,11 +83,19 @@ struct vtblk_config { > uint64_t vbc_capacity; > uint32_t vbc_size_max; > uint32_t vbc_seg_max; > - uint16_t vbc_geom_c; > - uint8_t vbc_geom_h; > - uint8_t vbc_geom_s; > + struct { > + uint16_t cylinders; > + uint8_t heads; > + uint8_t sectors; > + } vbc_geometry; > uint32_t vbc_blk_size; > - uint32_t vbc_sectors_max; > + struct { > + uint8_t physical_block_exp; > + uint8_t alignment_offset; > + uint16_t min_io_size; > + uint32_t opt_io_size; > + } vbc_topology; > + uint8_t vbc_writeback; > } __packed; > > /* > @@ -262,7 +272,7 @@ pci_vtblk_init(struct vmctx *ctx, struct > MD5_CTX mdctx; > u_char digest[16]; > struct pci_vtblk_softc *sc; > - off_t size; > + off_t size, sts, sto; > int fd; > int sectsz; > > @@ -291,6 +301,7 @@ pci_vtblk_init(struct vmctx *ctx, struct > */ > size = sbuf.st_size; > sectsz = DEV_BSIZE; > + sts = sto = 0; > if (S_ISCHR(sbuf.st_mode)) { > if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || > ioctl(fd, DIOCGSECTORSIZE, §sz)) { > @@ -300,7 +311,10 @@ pci_vtblk_init(struct vmctx *ctx, struct > } > assert(size != 0); > assert(sectsz != 0); > - } > + if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0) > + ioctl(fd, DIOCGSTRIPEOFFSET, &sto); > + } else > + sts = sbuf.st_blksize; > > sc = calloc(1, sizeof(struct pci_vtblk_softc)); > > @@ -328,13 +342,19 @@ pci_vtblk_init(struct vmctx *ctx, struct > > /* setup virtio block config space */ > sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ > + sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ > sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; > + sc->vbsc_cfg.vbc_geometry.cylinders = 0; /* no geometry */ > + sc->vbsc_cfg.vbc_geometry.heads = 0; > + sc->vbsc_cfg.vbc_geometry.sectors = 0; > sc->vbsc_cfg.vbc_blk_size = sectsz; > - sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ > - sc->vbsc_cfg.vbc_geom_c = 0; /* no geometry */ > - sc->vbsc_cfg.vbc_geom_h = 0; > - sc->vbsc_cfg.vbc_geom_s = 0; > - sc->vbsc_cfg.vbc_sectors_max = 0; > + sc->vbsc_cfg.vbc_topology.physical_block_exp = > + (sts > sectsz) ? (ffsll(sts / sectsz) - 1) : 0; > + sc->vbsc_cfg.vbc_topology.alignment_offset = > + (sto != 0) ? ((sts - sto) / sectsz) : 0; > + sc->vbsc_cfg.vbc_topology.min_io_size = 0; > + sc->vbsc_cfg.vbc_topology.opt_io_size = 0; > + sc->vbsc_cfg.vbc_writeback = 0; > > /* > * Should we move some of this into virtio.c? Could > > > ------------------------------ > > Message: 11 > Date: Thu, 5 Mar 2015 14:48:29 +0300 > From: Gleb Smirnoff > To: Baptiste Daroussin > Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, > src-committers@freebsd.org > Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin > usr.bin/rsh > Message-ID: <20150305114828.GK17947@FreeBSD.org> > Content-Type: text/plain; charset=us-ascii > > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > B> Author: bapt > B> Date: Wed Mar 4 22:01:44 2015 > B> New Revision: 279603 > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > B> > B> Log: > B> r* commands are not precious anymore > B> > B> Modified: > B> head/bin/rcp/Makefile > B> head/usr.bin/rlogin/Makefile > > I guess when they are going to be not precious enough to be removed? :) > > In modern world of ssh and https, does any OS require them in base? > > -- > Totus tuus, Glebius. > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > ------------------------------ > > End of svn-src-all Digest, Vol 133, Issue 5 > ******************************************* > From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:21:14 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28CD2B89; Thu, 5 Mar 2015 12:21:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13F13D06; Thu, 5 Mar 2015 12:21:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25CLDi6018994; Thu, 5 Mar 2015 12:21:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25CLDht018989; Thu, 5 Mar 2015 12:21:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503051221.t25CLDht018989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 12:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279654 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:21:14 -0000 Author: mav Date: Thu Mar 5 12:21:12 2015 New Revision: 279654 URL: https://svnweb.freebsd.org/changeset/base/279654 Log: Report logical/physical sector sizes for virtual SATA disk. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/block_if.h head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Thu Mar 5 11:43:12 2015 (r279653) +++ head/usr.sbin/bhyve/block_if.c Thu Mar 5 12:21:12 2015 (r279654) @@ -83,6 +83,8 @@ struct blockif_ctxt { int bc_rdonly; off_t bc_size; int bc_sectsz; + int bc_psectsz; + int bc_psectoff; pthread_t bc_btid; pthread_mutex_t bc_mtx; pthread_cond_t bc_cond; @@ -268,7 +270,7 @@ blockif_open(const char *optstr, const c char *nopt, *xopts; struct blockif_ctxt *bc; struct stat sbuf; - off_t size; + off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro; @@ -323,6 +325,7 @@ blockif_open(const char *optstr, const c */ size = sbuf.st_size; sectsz = DEV_BSIZE; + psectsz = psectoff = 0; if (S_ISCHR(sbuf.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || ioctl(fd, DIOCGSECTORSIZE, §sz)) { @@ -332,7 +335,10 @@ blockif_open(const char *optstr, const c } assert(size != 0); assert(sectsz != 0); - } + if (ioctl(fd, DIOCGSTRIPESIZE, &psectsz) == 0 && psectsz > 0) + ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff); + } else + psectsz = sbuf.st_blksize; bc = calloc(1, sizeof(struct blockif_ctxt)); if (bc == NULL) { @@ -345,6 +351,8 @@ blockif_open(const char *optstr, const c bc->bc_rdonly = ro; bc->bc_size = size; bc->bc_sectsz = sectsz; + bc->bc_psectsz = psectsz; + bc->bc_psectoff = psectoff; pthread_mutex_init(&bc->bc_mtx, NULL); pthread_cond_init(&bc->bc_cond, NULL); TAILQ_INIT(&bc->bc_freeq); @@ -595,6 +603,15 @@ blockif_sectsz(struct blockif_ctxt *bc) return (bc->bc_sectsz); } +void +blockif_psectsz(struct blockif_ctxt *bc, int *size, int *off) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + *size = bc->bc_psectsz; + *off = bc->bc_psectoff; +} + int blockif_queuesz(struct blockif_ctxt *bc) { Modified: head/usr.sbin/bhyve/block_if.h ============================================================================== --- head/usr.sbin/bhyve/block_if.h Thu Mar 5 11:43:12 2015 (r279653) +++ head/usr.sbin/bhyve/block_if.h Thu Mar 5 12:21:12 2015 (r279654) @@ -55,6 +55,7 @@ off_t blockif_size(struct blockif_ctxt * void blockif_chs(struct blockif_ctxt *bc, uint16_t *c, uint8_t *h, uint8_t *s); int blockif_sectsz(struct blockif_ctxt *bc); +void blockif_psectsz(struct blockif_ctxt *bc, int *size, int *off); int blockif_queuesz(struct blockif_ctxt *bc); int blockif_is_ro(struct blockif_ctxt *bc); int blockif_read(struct blockif_ctxt *bc, struct blockif_req *breq); Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Thu Mar 5 11:43:12 2015 (r279653) +++ head/usr.sbin/bhyve/pci_ahci.c Thu Mar 5 12:21:12 2015 (r279654) @@ -684,11 +684,14 @@ handle_identify(struct ahci_port *p, int } else { uint16_t buf[256]; uint64_t sectors; + int sectsz, psectsz, psectoff; uint16_t cyl; uint8_t sech, heads; - sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); + sectsz = blockif_sectsz(p->bctx); + sectors = blockif_size(p->bctx) / sectsz; blockif_chs(p->bctx, &cyl, &heads, &sech); + blockif_psectsz(p->bctx, &psectsz, &psectoff); memset(buf, 0, sizeof(buf)); buf[0] = 0x0040; buf[1] = cyl; @@ -733,6 +736,18 @@ handle_identify(struct ahci_port *p, int buf[101] = (sectors >> 16); buf[102] = (sectors >> 32); buf[103] = (sectors >> 48); + buf[106] = 0x4000; + buf[209] = 0x4000; + if (psectsz > sectsz) { + buf[106] |= 0x2000; + buf[106] |= ffsl(psectsz / sectsz) - 1; + buf[209] |= (psectoff / sectsz); + } + if (sectsz > 512) { + buf[106] |= 0x1000; + buf[117] = sectsz / 2; + buf[118] = ((sectsz / 2) >> 16); + } ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); p->tfd = ATA_S_DSC | ATA_S_READY; From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:21:14 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF010B8A; Thu, 5 Mar 2015 12:21:14 +0000 (UTC) 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 6E266D07; Thu, 5 Mar 2015 12:21:14 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTUlz-000NxR-50; Thu, 05 Mar 2015 15:21:03 +0300 Date: Thu, 5 Mar 2015 15:21:03 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305122103.GA90978@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305114828.GK17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:21:14 -0000 On Thu, Mar 05, 2015 at 02:48:29PM +0300, Gleb Smirnoff wrote: > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > B> Author: bapt > B> Date: Wed Mar 4 22:01:44 2015 > B> New Revision: 279603 > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > B> > B> Log: > B> r* commands are not precious anymore > B> > B> Modified: > B> head/bin/rcp/Makefile > B> head/usr.bin/rlogin/Makefile > > I guess when they are going to be not precious enough to be removed? :) > > In modern world of ssh and https, does any OS require them in base? yes. Some telecom equipment require rlogin. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:24:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B025E3E; Thu, 5 Mar 2015 12:24:03 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 51DA0DB0; Thu, 5 Mar 2015 12:24:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t25CNxGR078782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Mar 2015 15:23:59 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t25CNxsD078781; Thu, 5 Mar 2015 15:23:59 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 5 Mar 2015 15:23:59 +0300 From: Gleb Smirnoff To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305122359.GM17947@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305122103.GA90978@zxy.spb.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:24:03 -0000 On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: S> > B> Author: bapt S> > B> Date: Wed Mar 4 22:01:44 2015 S> > B> New Revision: 279603 S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 S> > B> S> > B> Log: S> > B> r* commands are not precious anymore S> > B> S> > B> Modified: S> > B> head/bin/rcp/Makefile S> > B> head/usr.bin/rlogin/Makefile S> > S> > I guess when they are going to be not precious enough to be removed? :) S> > S> > In modern world of ssh and https, does any OS require them in base? S> S> yes. S> Some telecom equipment require rlogin. Other telecom equipment require a JRE and special .jar to configure them. Does that mean operating systems must ship them? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:28:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DAC9FE5; Thu, 5 Mar 2015 12:28:41 +0000 (UTC) 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 7A21DDE6; Thu, 5 Mar 2015 12:28:40 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTUtJ-000O6N-ON; Thu, 05 Mar 2015 15:28:37 +0300 Date: Thu, 5 Mar 2015 15:28:37 +0300 From: Slawa Olhovchenkov To: David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305122837.GN48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <0969203E-A391-4528-8CA3-ABF96D5E5ED6@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0969203E-A391-4528-8CA3-ABF96D5E5ED6@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:28:41 -0000 On Thu, Mar 05, 2015 at 12:24:05PM +0000, David Chisnall wrote: > On 5 Mar 2015, at 12:21, Slawa Olhovchenkov wrote: > > > >> I guess when they are going to be not precious enough to be removed? :) > >> > >> In modern world of ssh and https, does any OS require them in base? > > > > yes. > > Some telecom equipment require rlogin. > > 'Some relatively obscure use case needs them' is not usually the > requirement for keeping something in the base system. Presumably > people who interact with telecoms equipment are capable of > installing packages... And install from package ssh, inetd, systemd, binutils... From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:30:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 856191C5; Thu, 5 Mar 2015 12:30:19 +0000 (UTC) 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 31DCFDFB; Thu, 5 Mar 2015 12:30:19 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTUuu-000O8L-SW; Thu, 05 Mar 2015 15:30:16 +0300 Date: Thu, 5 Mar 2015 15:30:16 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305123016.GO48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305122359.GM17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:30:19 -0000 On Thu, Mar 05, 2015 at 03:23:59PM +0300, Gleb Smirnoff wrote: > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > S> > B> Author: bapt > S> > B> Date: Wed Mar 4 22:01:44 2015 > S> > B> New Revision: 279603 > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > S> > B> > S> > B> Log: > S> > B> r* commands are not precious anymore > S> > B> > S> > B> Modified: > S> > B> head/bin/rcp/Makefile > S> > B> head/usr.bin/rlogin/Makefile > S> > > S> > I guess when they are going to be not precious enough to be removed? :) > S> > > S> > In modern world of ssh and https, does any OS require them in base? > S> > S> yes. > S> Some telecom equipment require rlogin. > > Other telecom equipment require a JRE and special .jar to > configure them. Does that mean operating systems must ship > them? Yes, if ships before (don't break if working). Some Linux distro remove telnet from default install. Do you like to remove telnet also? From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:30:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F29173D7; Thu, 5 Mar 2015 12:30:56 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E30E5E07; Thu, 5 Mar 2015 12:30:55 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t25CUr54078827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Mar 2015 15:30:53 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t25CUrgd078826; Thu, 5 Mar 2015 15:30:53 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 5 Mar 2015 15:30:53 +0300 From: Gleb Smirnoff To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305123053.GN17947@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305123016.GO48476@zxy.spb.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:30:57 -0000 On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov wrote: S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: S> > S> > B> Author: bapt S> > S> > B> Date: Wed Mar 4 22:01:44 2015 S> > S> > B> New Revision: 279603 S> > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 S> > S> > B> S> > S> > B> Log: S> > S> > B> r* commands are not precious anymore S> > S> > B> S> > S> > B> Modified: S> > S> > B> head/bin/rcp/Makefile S> > S> > B> head/usr.bin/rlogin/Makefile S> > S> > S> > S> > I guess when they are going to be not precious enough to be removed? :) S> > S> > S> > S> > In modern world of ssh and https, does any OS require them in base? S> > S> S> > S> yes. S> > S> Some telecom equipment require rlogin. S> > S> > Other telecom equipment require a JRE and special .jar to S> > configure them. Does that mean operating systems must ship S> > them? S> S> Yes, if ships before (don't break if working). S> Some Linux distro remove telnet from default install. S> Do you like to remove telnet also? Yes. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:32:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DC77540; Thu, 5 Mar 2015 12:32:23 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 108C3EBE; Thu, 5 Mar 2015 12:32:22 +0000 (UTC) Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t25CWJF0049823 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Mar 2015 12:32:20 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <20150305123016.GO48476@zxy.spb.ru> Date: Thu, 5 Mar 2015 12:32:14 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <2F612758-2E34-4745-A4DA-21BF36D16934@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:32:23 -0000 On 5 Mar 2015, at 12:30, Slawa Olhovchenkov wrote: >=20 > Yes, if ships before (don't break if working). > Some Linux distro remove telnet from default install. > Do you like to remove telnet also? Absolutely, now that netcat is part of the default install. For = anything that a sane user might consider telnet for in 2015, netcat is a = better option. For insane users, there's always pkg add. David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:33:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82AE37B1; Thu, 5 Mar 2015 12:33:52 +0000 (UTC) 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 32659ED8; Thu, 5 Mar 2015 12:33:52 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTUyM-000OD0-3R; Thu, 05 Mar 2015 15:33:50 +0300 Date: Thu, 5 Mar 2015 15:33:50 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305123349.GP48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305123053.GN17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:33:52 -0000 On Thu, Mar 05, 2015 at 03:30:53PM +0300, Gleb Smirnoff wrote: > On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov wrote: > S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: > S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > S> > S> > B> Author: bapt > S> > S> > B> Date: Wed Mar 4 22:01:44 2015 > S> > S> > B> New Revision: 279603 > S> > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > S> > S> > B> > S> > S> > B> Log: > S> > S> > B> r* commands are not precious anymore > S> > S> > B> > S> > S> > B> Modified: > S> > S> > B> head/bin/rcp/Makefile > S> > S> > B> head/usr.bin/rlogin/Makefile > S> > S> > > S> > S> > I guess when they are going to be not precious enough to be removed? :) > S> > S> > > S> > S> > In modern world of ssh and https, does any OS require them in base? > S> > S> > S> > S> yes. > S> > S> Some telecom equipment require rlogin. > S> > > S> > Other telecom equipment require a JRE and special .jar to > S> > configure them. Does that mean operating systems must ship > S> > them? > S> > S> Yes, if ships before (don't break if working). > S> Some Linux distro remove telnet from default install. > S> Do you like to remove telnet also? > > Yes. And how to test open/listing ports/sockets?! How to connect to mpd control socket?! From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:35:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 246BF90A; Thu, 5 Mar 2015 12:35:02 +0000 (UTC) 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 CD4AEEE9; Thu, 5 Mar 2015 12:35:01 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTUzT-000OE9-PW; Thu, 05 Mar 2015 15:34:59 +0300 Date: Thu, 5 Mar 2015 15:34:59 +0300 From: Slawa Olhovchenkov To: David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305123459.GQ48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <2F612758-2E34-4745-A4DA-21BF36D16934@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2F612758-2E34-4745-A4DA-21BF36D16934@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:35:02 -0000 On Thu, Mar 05, 2015 at 12:32:14PM +0000, David Chisnall wrote: > On 5 Mar 2015, at 12:30, Slawa Olhovchenkov wrote: > > > > Yes, if ships before (don't break if working). > > Some Linux distro remove telnet from default install. > > Do you like to remove telnet also? > > Absolutely, now that netcat is part of the default install. For > anything that a sane user might consider telnet for in 2015, netcat > is a better option. For insane users, there's always pkg add. Are you putting me on? From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:35:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89939A5C; Thu, 5 Mar 2015 12:35:51 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9815BEF3; Thu, 5 Mar 2015 12:35:50 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t25CZm1O078904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Mar 2015 15:35:48 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t25CZmre078903; Thu, 5 Mar 2015 15:35:48 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 5 Mar 2015 15:35:48 +0300 From: Gleb Smirnoff To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305123548.GO17947@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305123349.GP48476@zxy.spb.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:35:51 -0000 On Thu, Mar 05, 2015 at 03:33:50PM +0300, Slawa Olhovchenkov wrote: S> > On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov wrote: S> > S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: S> > S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: S> > S> > S> > B> Author: bapt S> > S> > S> > B> Date: Wed Mar 4 22:01:44 2015 S> > S> > S> > B> New Revision: 279603 S> > S> > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 S> > S> > S> > B> S> > S> > S> > B> Log: S> > S> > S> > B> r* commands are not precious anymore S> > S> > S> > B> S> > S> > S> > B> Modified: S> > S> > S> > B> head/bin/rcp/Makefile S> > S> > S> > B> head/usr.bin/rlogin/Makefile S> > S> > S> > S> > S> > S> > I guess when they are going to be not precious enough to be removed? :) S> > S> > S> > S> > S> > S> > In modern world of ssh and https, does any OS require them in base? S> > S> > S> S> > S> > S> yes. S> > S> > S> Some telecom equipment require rlogin. S> > S> > S> > S> > Other telecom equipment require a JRE and special .jar to S> > S> > configure them. Does that mean operating systems must ship S> > S> > them? S> > S> S> > S> Yes, if ships before (don't break if working). S> > S> Some Linux distro remove telnet from default install. S> > S> Do you like to remove telnet also? S> > S> > Yes. S> S> And how to test open/listing ports/sockets?! nc(1), which is a pure socket testing tool. For telnet(1) this capability is a side effect. S> How to connect to mpd control socket?! pkg install mpd5 telnet -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:36:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7F79B9D; Thu, 5 Mar 2015 12:36:12 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6426DF00; Thu, 5 Mar 2015 12:36:12 +0000 (UTC) Received: by wibbs8 with SMTP id bs8so6696294wib.0; Thu, 05 Mar 2015 04:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a105Vf1ovaH7ZiNrr1C2KIdysrpFKIZqhmHUty5aPkc=; b=dCzNqbnpGTdCVq3cXB9zWOslHO5NHvMSHriiYuuOSOSo3x88/mnNV5iYMDt73Zyw2j xrXBFDXZpnEToyqFVz334ERZ+aqzbLGB0WJ5DQzMtQLCMbC/MNpyzAu03TyLjmz01zfp u8I1pCpNorLFAJGlbMYYk2SpsbSBod+7fVfp9XnP8IT6HEDj0qGySutqGLXsQVOJR9YJ X73u1vSekYnIbKOHjlFWPPeoTv7EArdyVPoV+KsfETJMRTY680LZf5znsAEGtlYXhWaX zlVW5ue8koJQBzMYs8iirkd9QlmDlhtSIHwQy3odW8EoK3PREkeN34dFW+LFalLl3UO3 zCfA== X-Received: by 10.180.14.66 with SMTP id n2mr63800953wic.50.1425558970446; Thu, 05 Mar 2015 04:36:10 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id j9sm10342989wjy.18.2015.03.05.04.36.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 04:36:09 -0800 (PST) Sender: Baptiste Daroussin Date: Thu, 5 Mar 2015 13:36:07 +0100 From: Baptiste Daroussin To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305123606.GH1460@ivaldir.etoilebsd.net> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtJ+CqYNzKB4ukR4" Content-Disposition: inline In-Reply-To: <20150305114828.GK17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:36:13 -0000 --vtJ+CqYNzKB4ukR4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 05, 2015 at 02:48:29PM +0300, Gleb Smirnoff wrote: > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > B> Author: bapt > B> Date: Wed Mar 4 22:01:44 2015 > B> New Revision: 279603 > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > B>=20 > B> Log: > B> r* commands are not precious anymore > B> > B> Modified: > B> head/bin/rcp/Makefile > B> head/usr.bin/rlogin/Makefile >=20 > I guess when they are going to be not precious enough to be removed? :) >=20 I have no plans in that direction for now :) Bapt --vtJ+CqYNzKB4ukR4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlT4TbYACgkQ8kTtMUmk6EwJ8ACggAj1qEaDJHIfHhdhGCcgs5ul X5IAnRFSXbVjRFZJ8ZPMy1cSkQURps8J =arY7 -----END PGP SIGNATURE----- --vtJ+CqYNzKB4ukR4-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:37:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22CAAD3C; Thu, 5 Mar 2015 12:37:11 +0000 (UTC) Received: from ppsw-52.csi.cam.ac.uk (ppsw-52.csi.cam.ac.uk [131.111.8.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D317BF12; Thu, 5 Mar 2015 12:37:10 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk ([172.17.156.6]:49505) by ppsw-52.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:25) with esmtpsa (PLAIN:dc552) (TLSv1:DHE-RSA-AES256-SHA:256) id 1YTV1W-0006X2-FB (Exim 4.82_3-c0e5623) (return-path ); Thu, 05 Mar 2015 12:37:06 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <20150305123349.GP48476@zxy.spb.ru> Date: Thu, 5 Mar 2015 12:37:06 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2070.6) Sender: "Dr D. Chisnall" Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:37:11 -0000 On 5 Mar 2015, at 12:33, Slawa Olhovchenkov wrote: >=20 > And how to test open/listing ports/sockets?! netcat - nc(1) - which can also work in the other direction and is = designed specifically for this purpose. > How to connect to mpd control socket?! mpdcon from the command line, MPDroid from my mobile, or nc if you're a = masochist. David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:40:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21682FE8; Thu, 5 Mar 2015 12:40:40 +0000 (UTC) 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 CA67EF3B; Thu, 5 Mar 2015 12:40:39 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTV4v-000OKv-Ki; Thu, 05 Mar 2015 15:40:37 +0300 Date: Thu, 5 Mar 2015 15:40:37 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305124037.GR48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305123548.GO17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:40:40 -0000 On Thu, Mar 05, 2015 at 03:35:48PM +0300, Gleb Smirnoff wrote: > On Thu, Mar 05, 2015 at 03:33:50PM +0300, Slawa Olhovchenkov wrote: > S> > On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov wrote: > S> > S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: > S> > S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > S> > S> > S> > B> Author: bapt > S> > S> > S> > B> Date: Wed Mar 4 22:01:44 2015 > S> > S> > S> > B> New Revision: 279603 > S> > S> > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > S> > S> > S> > B> > S> > S> > S> > B> Log: > S> > S> > S> > B> r* commands are not precious anymore > S> > S> > S> > B> > S> > S> > S> > B> Modified: > S> > S> > S> > B> head/bin/rcp/Makefile > S> > S> > S> > B> head/usr.bin/rlogin/Makefile > S> > S> > S> > > S> > S> > S> > I guess when they are going to be not precious enough to be removed? :) > S> > S> > S> > > S> > S> > S> > In modern world of ssh and https, does any OS require them in base? > S> > S> > S> > S> > S> > S> yes. > S> > S> > S> Some telecom equipment require rlogin. > S> > S> > > S> > S> > Other telecom equipment require a JRE and special .jar to > S> > S> > configure them. Does that mean operating systems must ship > S> > S> > them? > S> > S> > S> > S> Yes, if ships before (don't break if working). > S> > S> Some Linux distro remove telnet from default install. > S> > S> Do you like to remove telnet also? > S> > > S> > Yes. > S> > S> And how to test open/listing ports/sockets?! > > nc(1), which is a pure socket testing tool. For telnet(1) this > capability is a side effect. You don't try this in practice. % nc zxy.spb.ru 81 % % telnet zxy.spb.ru 81 Trying 195.70.199.98... telnet: connect to address 195.70.199.98: Connection refused telnet: Unable to connect to remote host nc is not usable. > S> How to connect to mpd control socket?! > > pkg install mpd5 telnet Nice w/o internet connection. Nice. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:42:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E368D2E7; Thu, 5 Mar 2015 12:42:48 +0000 (UTC) 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 97013FF6; Thu, 5 Mar 2015 12:42:48 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTV70-000ONG-NY; Thu, 05 Mar 2015 15:42:46 +0300 Date: Thu, 5 Mar 2015 15:42:46 +0300 From: Slawa Olhovchenkov To: David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305124246.GS48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:42:49 -0000 On Thu, Mar 05, 2015 at 12:37:06PM +0000, David Chisnall wrote: > On 5 Mar 2015, at 12:33, Slawa Olhovchenkov wrote: > > > > And how to test open/listing ports/sockets?! > > netcat - nc(1) - which can also work in the other direction and is designed specifically for this purpose. nc(1) don't correctly work. nc don't work with unix socket. > > How to connect to mpd control socket?! > > mpdcon from the command line, MPDroid from my mobile, or nc if you're a masochist. MPDroid?! wut? Or you just don't know about mpd? From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:45:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D72B555; Thu, 5 Mar 2015 12:45:34 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E5115AD; Thu, 5 Mar 2015 12:45:33 +0000 (UTC) Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t25COA9D049761 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Mar 2015 12:24:13 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <20150305122103.GA90978@zxy.spb.ru> Date: Thu, 5 Mar 2015 12:24:05 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <0969203E-A391-4528-8CA3-ABF96D5E5ED6@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:45:34 -0000 On 5 Mar 2015, at 12:21, Slawa Olhovchenkov wrote: >=20 >> I guess when they are going to be not precious enough to be removed? = :) >>=20 >> In modern world of ssh and https, does any OS require them in base? >=20 > yes. > Some telecom equipment require rlogin. 'Some relatively obscure use case needs them' is not usually the = requirement for keeping something in the base system. Presumably people = who interact with telecoms equipment are capable of installing = packages... David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:49:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A72736BC; Thu, 5 Mar 2015 12:49:40 +0000 (UTC) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32217C9; Thu, 5 Mar 2015 12:49:40 +0000 (UTC) Received: by wesu56 with SMTP id u56so9252897wes.6; Thu, 05 Mar 2015 04:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=GayG1Z4AQJKUO7OczmKatgiD2Db8NnoI/ot3cgChtEM=; b=oxwBrD+VahBdeqQd1wKucwaERkdHhH9BaH0ZNlGNy281abYF6JOgbcR/RrLwYpxBWj tK76d1dV4UOU3bBpKzI6PWI71YUFuvwKvOjhoRgsfuzBHNx0gX5QwlL30shJLzP95H6P uJqrN026LLzXk/L+hHVSD8KcU0Q1NIbnDmrr9kIRFuhP81rSkmZ7cSQzE3XM8evFg8qo 2DOVlqRm76QTaaNKxfhdRJ63jHkXp8YNf3B3EOJGvm2BRXO9Zmo7LtaHjFjAz+ORT9UC +ch5XKtyqQnPxv2+Eegmx5W2lQiimR0cIdgC/aYyJ4P6uofhCHco/q/Q2pF5lviEISs4 1AYQ== X-Received: by 10.194.80.193 with SMTP id t1mr18942838wjx.8.1425559778611; Thu, 05 Mar 2015 04:49:38 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id i10sm8821653wja.40.2015.03.05.04.49.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Mar 2015 04:49:37 -0800 (PST) Date: Thu, 5 Mar 2015 13:49:33 +0100 From: Mateusz Guzik To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305124933.GA11164@dft-labs.eu> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150305124037.GR48476@zxy.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:49:40 -0000 On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 03:35:48PM +0300, Gleb Smirnoff wrote: > > nc(1), which is a pure socket testing tool. For telnet(1) this > > capability is a side effect. > > You don't try this in practice. > % nc zxy.spb.ru 81 > % > % telnet zxy.spb.ru 81 > Trying 195.70.199.98... > telnet: connect to address 195.70.199.98: Connection refused > telnet: Unable to connect to remote host > > nc is not usable. > # nc -v localhost 81 nc: connect to localhost port 81 (tcp) failed: Connection refused -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:50:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1DDB81D; Thu, 5 Mar 2015 12:50:51 +0000 (UTC) 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 65AC5E2; Thu, 5 Mar 2015 12:50:51 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTVEn-000OWe-Ha; Thu, 05 Mar 2015 15:50:49 +0300 Date: Thu, 5 Mar 2015 15:50:49 +0300 From: Slawa Olhovchenkov To: Mateusz Guzik Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305125049.GT48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> <20150305124933.GA11164@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305124933.GA11164@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:50:51 -0000 On Thu, Mar 05, 2015 at 01:49:33PM +0100, Mateusz Guzik wrote: > On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: > > On Thu, Mar 05, 2015 at 03:35:48PM +0300, Gleb Smirnoff wrote: > > > nc(1), which is a pure socket testing tool. For telnet(1) this > > > capability is a side effect. > > > > You don't try this in practice. > > % nc zxy.spb.ru 81 > > % > > % telnet zxy.spb.ru 81 > > Trying 195.70.199.98... > > telnet: connect to address 195.70.199.98: Connection refused > > telnet: Unable to connect to remote host > > > > nc is not usable. > > > > # nc -v localhost 81 > nc: connect to localhost port 81 (tcp) failed: Connection refused Try for remote host. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:53:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13E62993; Thu, 5 Mar 2015 12:53:37 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93A3119C; Thu, 5 Mar 2015 12:53:36 +0000 (UTC) Received: by wiwh11 with SMTP id h11so38085019wiw.1; Thu, 05 Mar 2015 04:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=fyTi7nVLY/V++gnAWT2YIA30T47f0CsSqKEOocKBzRs=; b=W5IA0KthHPjKSkGaUN+T2SifrQdyOaqUWAhC/Sr9PyVpGdBveCq4HKIDn3BYeSuS5Z 3TmhHoi9XIfYGIjMgO8lBtlGWpNNES9tSap6qmAc1GZZcxVG4Jifa5FBW/Qeh/bppvte Cpag1z/z1aikcfDMG4TpihcYrBTSPEgv1/8weM8W7DaOfgxCIpk/YouNq6K+hfHc+1Wq lM/AGB3BYNiosUYxpVAPRfSvjdu+sR+qsxwvwam+trWJagk/6ArzVDwwjI51xtBuoYt/ yEju0xKvX3y/1iumqw2AmNUJ5YiSgEMZKYzYh1i35Dhemv5vXNf7pVThnp3Gg9wOyNRl LTNg== X-Received: by 10.180.86.35 with SMTP id m3mr22557140wiz.83.1425560015060; Thu, 05 Mar 2015 04:53:35 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id u18sm10391790wjq.42.2015.03.05.04.53.33 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Mar 2015 04:53:34 -0800 (PST) Date: Thu, 5 Mar 2015 13:53:31 +0100 From: Mateusz Guzik To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305125331.GB11164@dft-labs.eu> References: <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> <20150305124933.GA11164@dft-labs.eu> <20150305125049.GT48476@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150305125049.GT48476@zxy.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:53:37 -0000 On Thu, Mar 05, 2015 at 03:50:49PM +0300, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 01:49:33PM +0100, Mateusz Guzik wrote: > > > On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: > > > On Thu, Mar 05, 2015 at 03:35:48PM +0300, Gleb Smirnoff wrote: > > > > nc(1), which is a pure socket testing tool. For telnet(1) this > > > > capability is a side effect. > > > > > > You don't try this in practice. > > > % nc zxy.spb.ru 81 > > > % > > > % telnet zxy.spb.ru 81 > > > Trying 195.70.199.98... > > > telnet: connect to address 195.70.199.98: Connection refused > > > telnet: Unable to connect to remote host > > > > > > nc is not usable. > > > > > > > # nc -v localhost 81 > > nc: connect to localhost port 81 (tcp) failed: Connection refused > > Try for remote host. # nc -v zxy.spb.ru 81 nc: connect to zxy.spb.ru port 81 (tcp) failed: Connection refused How exactly does it fail for you? -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 12:55:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAC2EADD; Thu, 5 Mar 2015 12:55:04 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F3AE31A9; Thu, 5 Mar 2015 12:55:03 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t25Ct1DY079098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Mar 2015 15:55:01 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t25Ct1gg079097; Thu, 5 Mar 2015 15:55:01 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 5 Mar 2015 15:55:01 +0300 From: Gleb Smirnoff To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305125501.GP17947@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305124037.GR48476@zxy.spb.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 12:55:04 -0000 On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: S> > nc(1), which is a pure socket testing tool. For telnet(1) this S> > capability is a side effect. S> S> You don't try this in practice. S> % nc zxy.spb.ru 81 S> % S> % telnet zxy.spb.ru 81 S> Trying 195.70.199.98... S> telnet: connect to address 195.70.199.98: Connection refused S> telnet: Unable to connect to remote host S> S> nc is not usable. Yes, this how unix way works. Command has return value, or you can use '-v', of you want it to be chatty. S> > S> How to connect to mpd control socket?! S> > S> > pkg install mpd5 telnet S> S> Nice w/o internet connection. Nice. Did you bring mpd5 on discette? Why do you want to run mpd5 at all, if you don't have internet connection? Sorry, the argument on absence of internet connection is a complete bullshit, and just shows that you want argue just to keep arguing. I'm outta this discussion. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:01:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CBA1D2B; Thu, 5 Mar 2015 13:01:06 +0000 (UTC) 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 D4F982B6; Thu, 5 Mar 2015 13:01:05 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTVOh-000P4H-Go; Thu, 05 Mar 2015 16:01:03 +0300 Date: Thu, 5 Mar 2015 16:01:03 +0300 From: Slawa Olhovchenkov To: Mateusz Guzik Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305130103.GU48476@zxy.spb.ru> References: <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> <20150305124933.GA11164@dft-labs.eu> <20150305125049.GT48476@zxy.spb.ru> <20150305125331.GB11164@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305125331.GB11164@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:01:06 -0000 On Thu, Mar 05, 2015 at 01:53:31PM +0100, Mateusz Guzik wrote: > On Thu, Mar 05, 2015 at 03:50:49PM +0300, Slawa Olhovchenkov wrote: > > On Thu, Mar 05, 2015 at 01:49:33PM +0100, Mateusz Guzik wrote: > > > > > On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: > > > > On Thu, Mar 05, 2015 at 03:35:48PM +0300, Gleb Smirnoff wrote: > > > > > nc(1), which is a pure socket testing tool. For telnet(1) this > > > > > capability is a side effect. > > > > > > > > You don't try this in practice. > > > > % nc zxy.spb.ru 81 > > > > % > > > > % telnet zxy.spb.ru 81 > > > > Trying 195.70.199.98... > > > > telnet: connect to address 195.70.199.98: Connection refused > > > > telnet: Unable to connect to remote host > > > > > > > > nc is not usable. > > > > > > > > > > # nc -v localhost 81 > > > nc: connect to localhost port 81 (tcp) failed: Connection refused > > > > Try for remote host. > > # nc -v zxy.spb.ru 81 > nc: connect to zxy.spb.ru port 81 (tcp) failed: Connection refused > > How exactly does it fail for you? Hmm. From office lan, with cisco nat. 10.1 15:59:00.175388 IP 10.200.0.19.11393 > 195.70.199.98.81: Flags [S], seq 218161015, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 391119939 ecr 0], length 0 15:59:00.178748 IP 195.70.199.98.81 > 10.200.0.19.11393: Flags [R.], seq 0, ack 218161016, win 0, length 0 this is nc zxy.spb.ru 81 15:59:42.800700 IP 10.200.0.19.45815 > 195.70.199.98.81: Flags [S], seq 2445745499, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 391162565 ecr 0], length 0 15:59:42.803927 IP 195.70.199.98.81 > 10.200.0.19.45815: Flags [R.], seq 0, ack 2445745500, win 0, length 0 this is telnet zxy.spb.ru 81 FreeBSD slw.office.acropolis.ru 10.1-RELEASE-p5 FreeBSD 10.1-RELEASE-p5 #0: Tue Jan 27 08:55:07 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 run as user (not root). No any firewall. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:03:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 082B4113; Thu, 5 Mar 2015 13:03:51 +0000 (UTC) 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 AFB40300; Thu, 5 Mar 2015 13:03:50 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTVRM-000P6n-Pz; Thu, 05 Mar 2015 16:03:48 +0300 Date: Thu, 5 Mar 2015 16:03:48 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305130348.GV48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> <20150305125501.GP17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305125501.GP17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:03:51 -0000 On Thu, Mar 05, 2015 at 03:55:01PM +0300, Gleb Smirnoff wrote: > On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: > S> > nc(1), which is a pure socket testing tool. For telnet(1) this > S> > capability is a side effect. > S> > S> You don't try this in practice. > S> % nc zxy.spb.ru 81 > S> % > S> % telnet zxy.spb.ru 81 > S> Trying 195.70.199.98... > S> telnet: connect to address 195.70.199.98: Connection refused > S> telnet: Unable to connect to remote host > S> > S> nc is not usable. > > Yes, this how unix way works. Command has return value, or > you can use '-v', of you want it to be chatty. > S> > S> How to connect to mpd control socket?! > S> > > S> > pkg install mpd5 telnet > S> > S> Nice w/o internet connection. Nice. > > Did you bring mpd5 on discette? Why do you want to run mpd5 at all, > if you don't have internet connection? Sorry, the argument on absence > of internet connection is a complete bullshit, and just shows that > you want argue just to keep arguing. I'm outta this discussion. I don't have _working_ internet connection. For repair internet connection I am need to connect to mpd5 control socket. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:06:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E161D2AF; Thu, 5 Mar 2015 13:06:54 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 884C332A; Thu, 5 Mar 2015 13:06:53 +0000 (UTC) Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t25D6nLo050088 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Mar 2015 13:06:50 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <20150305124246.GS48476@zxy.spb.ru> Date: Thu, 5 Mar 2015 13:06:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> <20150305124246.GS48476@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:06:55 -0000 > On 5 Mar 2015, at 12:42, Slawa Olhovchenkov wrote: >=20 >> netcat - nc(1) - which can also work in the other direction and is = designed specifically for this purpose. >=20 > nc(1) don't correctly work. It works for me for everything that I used to use telnet for (connection = testing, checking plain-text protocols, although increasingly I have to = use openssl s_client because few things speak TCP without SSL), what = cases does it not work for you? > nc don't work with unix socket. Okay, now you're changing your requirements - you first spoke of remote = equipment and network testing. However, UNIX domain sockets appear as = files in the filesystem, and we have a host of utilities that are = capable of interacting with files (unless they're message-oriented, but = then telnet doesn't help either). >>> How to connect to mpd control socket?! >>=20 >> mpdcon from the command line, MPDroid from my mobile, or nc if you're = a masochist. >=20 > MPDroid?! wut? Or you just don't know about mpd? The one that I'm familiar with is the music player daemon. The other = common use of the initalism is multiple personality disorder. If you = mean something else, then you should probably say what it is, rather = than rely on other people understanding some obscure term (hint: you're = not doing yourself any favours in justifying that this is a widespread = requirement if people reading your post can't even tell what the = requirement is). =20 If you meant the mpd5 package then... well, if you're installing one = thing from packages then installing another is not really likely to be = an issue. =20 Anyway, from your follow up to Gleb, it seems that your requirement is a = network testing tool for computers that are not connected to a network? = That seems like a sufficiently niche use that you don't need to have = things in the base system. =20 David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:14:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5539A4C3; Thu, 5 Mar 2015 13:14:51 +0000 (UTC) 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 072275F3; Thu, 5 Mar 2015 13:14:51 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTVc1-000PI4-25; Thu, 05 Mar 2015 16:14:49 +0300 Date: Thu, 5 Mar 2015 16:14:49 +0300 From: Slawa Olhovchenkov To: David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305131448.GW48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> <20150305124246.GS48476@zxy.spb.ru> <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:14:51 -0000 On Thu, Mar 05, 2015 at 01:06:44PM +0000, David Chisnall wrote: > > > On 5 Mar 2015, at 12:42, Slawa Olhovchenkov wrote: > > > >> netcat - nc(1) - which can also work in the other direction and is designed specifically for this purpose. > > > > nc(1) don't correctly work. > > It works for me for everything that I used to use telnet for > (connection testing, checking plain-text protocols, although > increasingly I have to use openssl s_client because few things speak > TCP without SSL), what cases does it not work for you? In previos message -- silently return when telnet speak about used IP address and diagnostic messages. One simple command do many diagnostic information. > > nc don't work with unix socket. > > Okay, now you're changing your requirements - you first spoke of > remote equipment and network testing. However, UNIX domain sockets > appear as files in the filesystem, and we have a host of utilities > that are capable of interacting with files (unless they're > message-oriented, but then telnet doesn't help either). I am know only about telnet can connect to unix socket. > >>> How to connect to mpd control socket?! > >> > >> mpdcon from the command line, MPDroid from my mobile, or nc if you're a masochist. > > > > MPDroid?! wut? Or you just don't know about mpd? > > The one that I'm familiar with is the music player daemon. The other common use of the initalism is multiple personality disorder. If you mean something else, then you should probably say what it is, rather than rely on other people understanding some obscure term (hint: you're not doing yourself any favours in justifying that this is a widespread requirement if people reading your post can't even tell what the requirement is). > If you meant the mpd5 package then... well, if you're installing one thing from packages then installing another is not really likely to be an issue. yes, mpd5. package can be already installed (time ago). and now connection broken. for diagnostic i am use telnet to mpd5 control socket. > Anyway, from your follow up to Gleb, it seems that your requirement > is a network testing tool for computers that are not connected to a > network? That seems like a sufficiently niche use that you don't > need to have things in the base system. Why not? And why before this is will be ok? From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:23:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 591DA99C; Thu, 5 Mar 2015 13:23:59 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1344756; Thu, 5 Mar 2015 13:23:58 +0000 (UTC) Received: by wggy19 with SMTP id y19so53263421wgg.13; Thu, 05 Mar 2015 05:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=eAdRnAmdZezbLitglY7BZJGwef+/GtEN7QAVqVDJp78=; b=j/Mv4js1UsnCRgPvgKgOifnqTCCV6SYPUbFv77YCFv2lpiitVNJmo+nv8z/2E8di24 RuBfmAYjhNt76IKLZyAyYJcsPNDUZ0Kjr27Po57P0TJc57+dvx8xi6+riRMwb5EYsxO3 iDM445o5NHnE47FvY+XlTmz+Cp61jgUmncWvCazOfv/B2zWmGJDUGYk+jNl9WtPS/Z0M ce0hYViNw4A1ENjs9yziCp5nO+1moKFD62Fcd7/WI/L81vFRNLLkt76KhdVVZofbGY3C VzzD60S6gSvZ1SDF1TwId9iGfjDHtER6ouI+Ns8NtNuWIGXf273lhITO3IoOhrb/+ADv X1qw== X-Received: by 10.195.12.71 with SMTP id eo7mr18800717wjd.3.1425561837228; Thu, 05 Mar 2015 05:23:57 -0800 (PST) Received: from brick.home (dgo34.neoplus.adsl.tpnet.pl. [83.23.170.34]) by mx.google.com with ESMTPSA id hv5sm10521604wjb.16.2015.03.05.05.23.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 05:23:56 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 5 Mar 2015 13:49:59 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305124959.GF10733@brick.home> Mail-Followup-To: Gleb Smirnoff , Slawa Olhovchenkov , Baptiste Daroussin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> <20150305125501.GP17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150305125501.GP17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Slawa Olhovchenkov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:23:59 -0000 On 0305T1555, Gleb Smirnoff wrote: > On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: > S> > nc(1), which is a pure socket testing tool. For telnet(1) this > S> > capability is a side effect. > S> > S> You don't try this in practice. > S> % nc zxy.spb.ru 81 > S> % > S> % telnet zxy.spb.ru 81 > S> Trying 195.70.199.98... > S> telnet: connect to address 195.70.199.98: Connection refused > S> telnet: Unable to connect to remote host > S> > S> nc is not usable. > > Yes, this how unix way works. Command has return value, or > you can use '-v', of you want it to be chatty. Actually, not giving error message on error by default seems quite broken to me. Standard UNIX utilities don't fail silently: % cat /bin/nope cat: /bin/nope: No such file or directory From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:27:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72854B9A; Thu, 5 Mar 2015 13:27:31 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F79078F; Thu, 5 Mar 2015 13:27:30 +0000 (UTC) Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t25DRNZ9050221 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Mar 2015 13:27:28 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <20150305131448.GW48476@zxy.spb.ru> Date: Thu, 5 Mar 2015 13:27:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <08E91A87-E3FA-47AE-ABDC-C23CA1A55B4C@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> <20150305124246.GS48476@zxy.spb.ru> <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> <20150305131448.GW48476@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:27:31 -0000 On 5 Mar 2015, at 13:14, Slawa Olhovchenkov wrote: >=20 > In previos message -- silently return when telnet speak about used IP > address and diagnostic messages. One simple command do many diagnostic > information. Okay, so check the return code. Or pass -v if you want more verbose = information: $ nc -v foo.example.com 80 nc: getaddrinfo: nodename nor servname provided, or not known $ nc -v localhost 80 nc: connectx to localhost port 80 (tcp) failed: Connection refused nc: connectx to localhost port 80 (tcp) failed: Connection refused nc: connectx to localhost port 80 (tcp) failed: Connection refused Or even alias nc -v to telnet if you like typing more... Or add -D, if you want more debugging information. > I am know only about telnet can connect to unix socket. So can cat... Actually, so can nc if you read the man page (which, of = course, you did before deciding that it couldn't do what you needed). = With -U, it will connect to a UNIX domain socket. Oh, and it can also = create UNIX sockets for listening to: $ nc -l -U tmp=20 $ # in another terminal: $ nc -U tmp And now you have two nc instances talking to each other via a UNIX = socket. > Why not? And why before this is will be ok? Telnet is in the base system because, back in the 4BSD days, telnet was = the recommended way that you logged into remote computers. Now it = isn't. For most network diagnostic and simple socket operations, nc is = a far more useful tool. Including things that want to talk to UNIX = sockets. David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:52:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9774401; Thu, 5 Mar 2015 13:52:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3FD6AAF; Thu, 5 Mar 2015 13:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25DqVEm064870; Thu, 5 Mar 2015 13:52:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25DqVTd064869; Thu, 5 Mar 2015 13:52:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503051352.t25DqVTd064869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 13:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279657 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:52:31 -0000 Author: mav Date: Thu Mar 5 13:52:30 2015 New Revision: 279657 URL: https://svnweb.freebsd.org/changeset/base/279657 Log: Add check for absent stripe size to r279652. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 12:40:59 2015 (r279656) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 13:52:30 2015 (r279657) @@ -311,7 +311,7 @@ pci_vtblk_init(struct vmctx *ctx, struct } assert(size != 0); assert(sectsz != 0); - if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0) + if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0 && sts > 0) ioctl(fd, DIOCGSTRIPEOFFSET, &sto); } else sts = sbuf.st_blksize; From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:53:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2600353E; Thu, 5 Mar 2015 13:53:16 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 0DAB3AB6; Thu, 5 Mar 2015 13:53:16 +0000 (UTC) Received: from AlfredMacbookAir.local (unknown [12.167.51.131]) by elvis.mu.org (Postfix) with ESMTPSA id B48CC341F867; Thu, 5 Mar 2015 05:53:15 -0800 (PST) Message-ID: <54F860B5.1060606@freebsd.org> Date: Thu, 05 Mar 2015 05:57:09 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gleb Smirnoff , Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> In-Reply-To: <20150305123053.GN17947@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:53:16 -0000 On 3/5/15 4:30 AM, Gleb Smirnoff wrote: > On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov wrote: > S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: > S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > S> > S> > B> Author: bapt > S> > S> > B> Date: Wed Mar 4 22:01:44 2015 > S> > S> > B> New Revision: 279603 > S> > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > S> > S> > B> > S> > S> > B> Log: > S> > S> > B> r* commands are not precious anymore > S> > S> > B> > S> > S> > B> Modified: > S> > S> > B> head/bin/rcp/Makefile > S> > S> > B> head/usr.bin/rlogin/Makefile > S> > S> > > S> > S> > I guess when they are going to be not precious enough to be removed? :) > S> > S> > > S> > S> > In modern world of ssh and https, does any OS require them in base? > S> > S> > S> > S> yes. > S> > S> Some telecom equipment require rlogin. > S> > > S> > Other telecom equipment require a JRE and special .jar to > S> > configure them. Does that mean operating systems must ship > S> > them? > S> > S> Yes, if ships before (don't break if working). > S> Some Linux distro remove telnet from default install. > S> Do you like to remove telnet also? > > Yes. > +1 :) (well at least not have it in source tree as-is) :) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:54:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79DFC6D1; Thu, 5 Mar 2015 13:54:57 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 5F75CAD0; Thu, 5 Mar 2015 13:54:57 +0000 (UTC) Received: from AlfredMacbookAir.local (unknown [12.167.51.131]) by elvis.mu.org (Postfix) with ESMTPSA id 32852341F867; Thu, 5 Mar 2015 05:54:57 -0800 (PST) Message-ID: <54F8611B.8070901@freebsd.org> Date: Thu, 05 Mar 2015 05:58:51 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gleb Smirnoff , Slawa Olhovchenkov , Baptiste Daroussin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <20150305124037.GR48476@zxy.spb.ru> <20150305125501.GP17947@FreeBSD.org> <20150305124959.GF10733@brick.home> In-Reply-To: <20150305124959.GF10733@brick.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:54:57 -0000 On 3/5/15 4:49 AM, Edward Tomasz NapieraÅ‚a wrote: > On 0305T1555, Gleb Smirnoff wrote: >> On Thu, Mar 05, 2015 at 03:40:37PM +0300, Slawa Olhovchenkov wrote: >> S> > nc(1), which is a pure socket testing tool. For telnet(1) this >> S> > capability is a side effect. >> S> >> S> You don't try this in practice. >> S> % nc zxy.spb.ru 81 >> S> % >> S> % telnet zxy.spb.ru 81 >> S> Trying 195.70.199.98... >> S> telnet: connect to address 195.70.199.98: Connection refused >> S> telnet: Unable to connect to remote host >> S> >> S> nc is not usable. >> >> Yes, this how unix way works. Command has return value, or >> you can use '-v', of you want it to be chatty. > > Actually, not giving error message on error by default seems quite > broken to me. Standard UNIX utilities don't fail silently: > You need to read unix hater's handbook. :) -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:56:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81340816; Thu, 5 Mar 2015 13:56:04 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1EFADE; Thu, 5 Mar 2015 13:56:04 +0000 (UTC) Received: from AlfredMacbookAir.local (unknown [12.167.51.131]) by elvis.mu.org (Postfix) with ESMTPSA id A010F341F861; Thu, 5 Mar 2015 05:55:58 -0800 (PST) Message-ID: <54F86158.7060808@freebsd.org> Date: Thu, 05 Mar 2015 05:59:52 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: David Chisnall , Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> <20150305124246.GS48476@zxy.spb.ru> <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> In-Reply-To: <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:56:04 -0000 On 3/5/15 5:06 AM, David Chisnall wrote: > >> On 5 Mar 2015, at 12:42, Slawa Olhovchenkov wrote: >> >> nc don't work with unix socket. > > Okay, now you're changing your requirements - you first spoke of remote equipment and network testing. However, UNIX domain sockets appear as files in the filesystem, and we have a host of utilities that are capable of interacting with files (unless they're message-oriented, but then telnet doesn't help either). nc -U ? -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 13:57:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 570EDA4D; Thu, 5 Mar 2015 13:57:22 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 11957B3D; Thu, 5 Mar 2015 13:57:22 +0000 (UTC) Received: from AlfredMacbookAir.local (unknown [12.167.51.131]) by elvis.mu.org (Postfix) with ESMTPSA id 8A203341F866; Thu, 5 Mar 2015 05:57:21 -0800 (PST) Message-ID: <54F861AB.1020404@freebsd.org> Date: Thu, 05 Mar 2015 06:01:15 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Slawa Olhovchenkov , David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <0969203E-A391-4528-8CA3-ABF96D5E5ED6@FreeBSD.org> <20150305122837.GN48476@zxy.spb.ru> In-Reply-To: <20150305122837.GN48476@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Baptiste Daroussin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 13:57:22 -0000 On 3/5/15 4:28 AM, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 12:24:05PM +0000, David Chisnall wrote: > >> On 5 Mar 2015, at 12:21, Slawa Olhovchenkov wrote: >>> >>>> I guess when they are going to be not precious enough to be removed? :) >>>> >>>> In modern world of ssh and https, does any OS require them in base? >>> >>> yes. >>> Some telecom equipment require rlogin. >> >> 'Some relatively obscure use case needs them' is not usually the >> requirement for keeping something in the base system. Presumably >> people who interact with telecoms equipment are capable of >> installing packages... > > And install from package ssh, inetd, systemd, binutils... > How does one patch systemd under FreeBSD? -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 14:04:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B280FD27; Thu, 5 Mar 2015 14:04:09 +0000 (UTC) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29542C45; Thu, 5 Mar 2015 14:04:09 +0000 (UTC) Received: by labgd6 with SMTP id gd6so4549173lab.6; Thu, 05 Mar 2015 06:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2X6kihoLcVtJ2n+Z3RPMe6IdYEB8dwf0Y/89wk2gLIo=; b=Sw0pfR4Jrui3J/QS7BHUnhUkgjwd2nyAA3ioo4AU9n0SqUaFEWyDTENNTiDJLYrUoc jJb5I52JIV9OXBAD/6LTlTCQelo+oF8fhBUfLQ+/0aVlAvqPeZK6Z29/IS5gZMyFN9g5 wVPDsGTAdo0mn4gp9WhvbE25nhpNtaHG1XxhNHhNgGKWEqVwHClXIOM2JLFy1BVjA/xG P9q4Hnl1+ZMUT6xgp5IQnbtbVIh6B59pdfIhr5DED4bRltxfTQrSEmgpPHYl6DPTsKcu 7+OyTyGuzwdDXkDZLQvqVUzW8EvphrbWe74k1mVPK0yl0f8KQ2gNBVfbDBClCw0gEjb+ kpUw== X-Received: by 10.112.225.137 with SMTP id rk9mr7750493lbc.11.1425564247188; Thu, 05 Mar 2015 06:04:07 -0800 (PST) Received: from [10.0.1.7] (broadband-5-228-253-252.nationalcablenetworks.ru. [5.228.253.252]) by mx.google.com with ESMTPSA id yu8sm1294504lbb.26.2015.03.05.06.04.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 06:04:05 -0800 (PST) Sender: Dmitry Sivachenko Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Dmitry Sivachenko In-Reply-To: <20150305123548.GO17947@FreeBSD.org> Date: Thu, 5 Mar 2015 17:04:02 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Slawa Olhovchenkov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 14:04:09 -0000 > On 5 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., at 15:35, Gleb = Smirnoff wrote: >=20 > On Thu, Mar 05, 2015 at 03:33:50PM +0300, Slawa Olhovchenkov wrote: > S> > On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov = wrote: > S> > S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov = wrote: > S> > S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste = Daroussin wrote: > S> > S> > S> > B> Author: bapt > S> > S> > S> > B> Date: Wed Mar 4 22:01:44 2015 > S> > S> > S> > B> New Revision: 279603 > S> > S> > S> > B> URL: = https://svnweb.freebsd.org/changeset/base/279603 > S> > S> > S> > B>=20 > S> > S> > S> > B> Log: > S> > S> > S> > B> r* commands are not precious anymore > S> > S> > S> > B> > S> > S> > S> > B> Modified: > S> > S> > S> > B> head/bin/rcp/Makefile > S> > S> > S> > B> head/usr.bin/rlogin/Makefile > S> > S> > S> >=20 > S> > S> > S> > I guess when they are going to be not precious enough = to be removed? :) > S> > S> > S> >=20 > S> > S> > S> > In modern world of ssh and https, does any OS require = them in base? > S> > S> > S>=20 > S> > S> > S> yes. > S> > S> > S> Some telecom equipment require rlogin. > S> > S> >=20 > S> > S> > Other telecom equipment require a JRE and special .jar to > S> > S> > configure them. Does that mean operating systems must ship > S> > S> > them? > S> > S>=20 > S> > S> Yes, if ships before (don't break if working). > S> > S> Some Linux distro remove telnet from default install. > S> > S> Do you like to remove telnet also? > S> >=20 > S> > Yes. > S>=20 > S> And how to test open/listing ports/sockets?! >=20 > nc(1), which is a pure socket testing tool. For telnet(1) this > capability is a side effect. >=20 > S> How to connect to mpd control socket?! >=20 > pkg install mpd5 telnet >=20 OMG, please do not make nightmare one have on Linux or Solaris. = Everything can be installed form packages but it is so inconvenient! It is so nice to have most useful stuff out of the box. Does it hurt = you? Having all these things in base is so cool, please do not make = Lego constructor everyone must use. Disks are so large and cheap these days. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 14:09:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 694ECF65; Thu, 5 Mar 2015 14:09:51 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 07A94C97; Thu, 5 Mar 2015 14:09:50 +0000 (UTC) Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t25E9h2t050510 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Mar 2015 14:09:45 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> Date: Thu, 5 Mar 2015 14:09:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> To: Dmitry Sivachenko X-Mailer: Apple Mail (2.2070.6) Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 14:09:51 -0000 On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: > It is so nice to have most useful stuff out of the box. The question is whether a tool for logging into remote machines without = encryption is 'the most useful stuff'. The tool is also [ab]used for = network testing, but we already provide a better tool for that in the = form of nc(1). David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 14:13:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31A861C2; Thu, 5 Mar 2015 14:13:37 +0000 (UTC) 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 D4E43D52; Thu, 5 Mar 2015 14:13:36 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTWWs-0000Op-Ui; Thu, 05 Mar 2015 17:13:34 +0300 Date: Thu, 5 Mar 2015 17:13:34 +0300 From: Slawa Olhovchenkov To: David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305141334.GX48476@zxy.spb.ru> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , svn-src-head@freebsd.org, Dmitry Sivachenko X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 14:13:37 -0000 On Thu, Mar 05, 2015 at 02:09:38PM +0000, David Chisnall wrote: > On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: > > > It is so nice to have most useful stuff out of the box. > > The question is whether a tool for logging into remote machines > without encryption is 'the most useful stuff'. The tool is also > [ab]used for network testing, but we already provide a better tool > for that in the form of nc(1). Not better, no. telnet more verbose (and by default and more). And what about 'tools, not policy'? From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 14:21:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31670505; Thu, 5 Mar 2015 14:21:09 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E0069E44; Thu, 5 Mar 2015 14:21:08 +0000 (UTC) Received: from dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t25EL4pu050590 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Mar 2015 14:21:06 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host global-1-26.nat.csx.cam.ac.uk [131.111.184.26] claimed to be dhcp-172-17-156-6.eduroam.wireless.private.cam.ac.uk Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: David Chisnall In-Reply-To: <20150305141334.GX48476@zxy.spb.ru> Date: Thu, 5 Mar 2015 14:20:59 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2070.6) Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , svn-src-head@freebsd.org, Dmitry Sivachenko X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 14:21:09 -0000 On 5 Mar 2015, at 14:13, Slawa Olhovchenkov wrote: >=20 > Not better, no. Does telnet support creating server sockets? No. =20 Does telnet support IPsec? No. Does telnet let you specify the tcp window size? No. Does telnet come with a massive selection of options for insecure login = / authentication? Yes. Telnet is a tool for insecure remote access. nc is a tool for creating = and debugging socket connections. > telnet more verbose (and by default and more). 'nc -v' is less to type than 'telnet' and provides *more* debugging = support via -D. > And what about 'tools, not policy'? What about it? We provide a tool that *is designed for creating and = debugging sockets*. You instead want a tool for insecure remote login = that happens to sort-of work for creating and debugging sockets and your = justification for wanting it is that you can use it for debugging = sockets. =46rom your previous posts, you've clearly not read the nc man page and = have absolutely no idea what it is capable of. Why not spent five = minutes learning about the tool that we provide that is *designed = specifically for your requirements* and then suggest places where it = could be improved for your needs, rather than insisting that we provide = you with a hammer so that you can keep bashing screws into walls? David From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 14:38:53 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90B1AEC7; Thu, 5 Mar 2015 14:38:53 +0000 (UTC) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 041EEFC3; Thu, 5 Mar 2015 14:38:53 +0000 (UTC) Received: by labhs14 with SMTP id hs14so51854365lab.4; Thu, 05 Mar 2015 06:38:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Mz2Sp8Nyp84GcVQTj+YkfvQzJtzJO3Is2Ulp0YaKP8E=; b=ORStiI8RNzJ/vgKkbdPHNmXtzRjwL+RHh/W2HiduPSEPIooOEISZJK7qy1spSv3YzR sznDR0fMW6vwkIukUveKaFB9bMSK1yryR/0p/dP0STKmaajuQO5DTF/w8F3zlQYD5KTv K610P65OPglM7AC5JeEnmw+Evl98xvLXcXLDog0xlfOSVpkxu73Hix9U/7enIcIsLnqh +0iagL//O74M8QPe/VI5egOlWOcFwD17MUbzNgCs1lqNQnaBu77/RfcOh6SiQGtqQcjM e3SPaOavpdMQ0i21xMdDybGzNwtnYd2MJsreeb5qHEUTjqQ05kGhg/h8Y2QrSLTem2Ol ZeuQ== X-Received: by 10.112.170.132 with SMTP id am4mr8097699lbc.89.1425566331148; Thu, 05 Mar 2015 06:38:51 -0800 (PST) Received: from [10.0.1.7] (broadband-5-228-253-252.nationalcablenetworks.ru. [5.228.253.252]) by mx.google.com with ESMTPSA id zr10sm1304840lbb.38.2015.03.05.06.38.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 06:38:49 -0800 (PST) Sender: Dmitry Sivachenko Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Dmitry Sivachenko In-Reply-To: Date: Thu, 5 Mar 2015 17:38:48 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.2070.6) Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 14:38:53 -0000 > On 5 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., at 17:09, David = Chisnall wrote: >=20 > On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: >=20 >> It is so nice to have most useful stuff out of the box. >=20 > The question is whether a tool for logging into remote machines = without encryption is 'the most useful stuff'. The tool is also = [ab]used for network testing, but we already provide a better tool for = that in the form of nc(1). >=20 Well. Speaking of telnet, it does provide encryption AFAIK. Speaking of what is "better" and what is not, there is such a thing like = "habit". If it does not require much effort to maintain it, better = leave it as is. I personally often use telnet to connect to TCP-based services to test = things, I need no encryption at all and I see no reason to switch to = another tool (even if it is "better" in some sense). From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 14:40:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62450E6; Thu, 5 Mar 2015 14:40:59 +0000 (UTC) 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 13012FE3; Thu, 5 Mar 2015 14:40:59 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTWxN-0000qA-3z; Thu, 05 Mar 2015 17:40:57 +0300 Date: Thu, 5 Mar 2015 17:40:57 +0300 From: Slawa Olhovchenkov To: David Chisnall Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305144056.GY48476@zxy.spb.ru> References: <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , svn-src-head@freebsd.org, Dmitry Sivachenko X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 14:40:59 -0000 On Thu, Mar 05, 2015 at 02:20:59PM +0000, David Chisnall wrote: > On 5 Mar 2015, at 14:13, Slawa Olhovchenkov wrote: > > > > Not better, no. > > Does telnet support creating server sockets? No. don't need for me. > Does telnet support IPsec? No. Let me guess, only from root and only when kernel with IPsec? And this is equalent to setkey? > Does telnet let you specify the tcp window size? No. tcp window size? not see in manual. Do you talk about "-I length Specifies the size of the TCP receive buffer."? This is not tcp window size. And for TCP you can't specify the tcp window size -- this is dynamic value. > Does telnet come with a massive selection of options for insecure login / authentication? Yes. This is may right to use or not to use secure or not secure login / authentication. Also, I am use telnet login for check kerberos authentication (ssh kerberos authentication (SSO) broken 10 years ago. nobody care). > Telnet is a tool for insecure remote access. nc is a tool for creating and debugging socket connections. > > > telnet more verbose (and by default and more). > > 'nc -v' is less to type than 'telnet' and provides *more* debugging support via -D. % nc -v -D zxy.spb.ru 81 nc: connect to zxy.spb.ru port 81 (tcp) failed: Connection refused % telnet zxy.spb.ru 81 Trying 195.70.199.98... telnet: connect to address 195.70.199.98: Connection refused telnet: Unable to connect to remote host telnet talk about used IP address. nc -D don't talk any additional info. > > And what about 'tools, not policy'? > > What about it? We provide a tool that *is designed for creating and > debugging sockets*. You instead want a tool for insecure remote > login that happens to sort-of work for creating and debugging > sockets and your justification for wanting it is that you can use it > for debugging sockets. I am can use one tool for insecure login, for secure login and for test network sockets. Why not? > From your previous posts, you've clearly not read the nc man page > and have absolutely no idea what it is capable of. Why not spent I am use telnet more 20+ years. I am don't need change telnet to nc for my purpose. > five minutes learning about the tool that we provide that is > *designed specifically for your requirements* and then suggest > places where it could be improved for your needs, rather than > insisting that we provide you with a hammer so that you can keep > bashing screws into walls? You are sell me tools that I am don't need. I can use telnet in any condition, I am reflexive use telnet. When I am need to use nc -- I will use nc. Don't force me to use nc, please! From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 15:11:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A36B995C; Thu, 5 Mar 2015 15:11:46 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5EB3F3; Thu, 5 Mar 2015 15:11:46 +0000 (UTC) Received: by widem10 with SMTP id em10so36873182wid.0; Thu, 05 Mar 2015 07:11:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gVTTTFBL/f3iUo3jCm3xx9+8EbwTcJGg0l7sDb5yF2w=; b=FJ03lVWM5wd2NC5YzgnFCHl3o+zCOEueSWIWhm0SLkPpUGkJlW/uHRfbtU7qVQyIk7 bX/RzMtoAeAWK57TWhEm6ZgcjYW0hv5/NeoIKkuNWI0gGwTEjccSnz8Uxfa4NFZHHwha Igw8UjBouywUBLJDi5Sw1gt9gw+DXglxReMDJrxj/HJV+iTmEKMgJ3A7MHhhuDczmkqS VxFgeAz8qILHhz89tIAIVEz10GjiCyeRr1qknkQM9XH0HqvFSnRTaeTfHkNkbRescKBz ATHMYpSffWShgHBf+B/oNDMroNeo0P6Rh2MBNtb2mp9C3caEXII1hpmaJhmj7PxZMEkg x4dg== MIME-Version: 1.0 X-Received: by 10.194.234.40 with SMTP id ub8mr19919361wjc.100.1425568303648; Thu, 05 Mar 2015 07:11:43 -0800 (PST) Received: by 10.27.77.215 with HTTP; Thu, 5 Mar 2015 07:11:43 -0800 (PST) In-Reply-To: <20150305144056.GY48476@zxy.spb.ru> References: <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> <20150305144056.GY48476@zxy.spb.ru> Date: Thu, 5 Mar 2015 10:11:43 -0500 Message-ID: Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Benjamin Kaduk To: Slawa Olhovchenkov Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 15:11:46 -0000 On Thu, Mar 5, 2015 at 9:40 AM, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 02:20:59PM +0000, David Chisnall wrote: > > > Does telnet come with a massive selection of options for insecure login > / authentication? Yes. > > This is may right to use or not to use secure or not secure login / > authentication. > Also, I am use telnet login for check kerberos authentication (ssh > kerberos authentication (SSO) broken 10 years ago. nobody care). > Other people are covering the rest of the issues, so I will cover just this one point. telnet with kerberos authentication was broken 15 years ago, by the EFF's Deep Crack and its successors. Kerberized telnet supports only DES, which has not been secure for a long time. The last I heard, $50 would buy you a DES key brute-force with a day turnaround. Speaking as an upstream maintainer: don't use kerberized telnet. I use kerberized ssh all the time; please tell me more about how it is broken (a new thread would be best). -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 15:17:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70975B9F; Thu, 5 Mar 2015 15:17:36 +0000 (UTC) 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 215F76D1; Thu, 5 Mar 2015 15:17:36 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YTXWm-00025w-FG; Thu, 05 Mar 2015 18:17:32 +0300 Date: Thu, 5 Mar 2015 18:17:32 +0300 From: Slawa Olhovchenkov To: Benjamin Kaduk Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305151732.GA48476@zxy.spb.ru> References: <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> <20150305144056.GY48476@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 15:17:36 -0000 On Thu, Mar 05, 2015 at 10:11:43AM -0500, Benjamin Kaduk wrote: > On Thu, Mar 5, 2015 at 9:40 AM, Slawa Olhovchenkov wrote: > > > On Thu, Mar 05, 2015 at 02:20:59PM +0000, David Chisnall wrote: > > > > > Does telnet come with a massive selection of options for insecure login > > / authentication? Yes. > > > > This is may right to use or not to use secure or not secure login / > > authentication. > > Also, I am use telnet login for check kerberos authentication (ssh > > kerberos authentication (SSO) broken 10 years ago. nobody care). > > > > Other people are covering the rest of the issues, so I will cover just this > one point. > > telnet with kerberos authentication was broken 15 years ago, by the EFF's > Deep Crack and its successors. Kerberized telnet supports only DES, which > has not been secure for a long time. The last I heard, $50 would buy you a > DES key brute-force with a day turnaround. > > Speaking as an upstream maintainer: don't use kerberized telnet. I am use this for test kerberos setup (check all setup correctly). > I use kerberized ssh all the time; please tell me more about how it is > broken (a new thread would be best). kerberized ssh broken in SSO mode: you can't do ssh login to kerberized host (from outside world), input kerberos password and use kerberos ticket. This is issuse between PAM and ssh thread emulation. From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 15:29:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AACC3B0; Thu, 5 Mar 2015 15:29:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CB65875; Thu, 5 Mar 2015 15:29:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25FTJWm009545; Thu, 5 Mar 2015 15:29:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25FTJDb009541; Thu, 5 Mar 2015 15:29:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503051529.t25FTJDb009541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 15:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279658 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 15:29:20 -0000 Author: mav Date: Thu Mar 5 15:29:18 2015 New Revision: 279658 URL: https://svnweb.freebsd.org/changeset/base/279658 Log: Implement cache flush for ahci-hd and for virtio-blk over device. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Thu Mar 5 13:52:30 2015 (r279657) +++ head/usr.sbin/bhyve/block_if.c Thu Mar 5 15:29:18 2015 (r279658) @@ -80,6 +80,7 @@ struct blockif_elem { struct blockif_ctxt { int bc_magic; int bc_fd; + int bc_ischr; int bc_rdonly; off_t bc_size; int bc_sectsz; @@ -190,6 +191,11 @@ blockif_proc(struct blockif_ctxt *bc, st err = errno; break; case BOP_FLUSH: + if (bc->bc_ischr) { + if (ioctl(bc->bc_fd, DIOCGFLUSH)) + err = errno; + } else if (fsync(bc->bc_fd)) + err = errno; break; default: err = EINVAL; @@ -348,6 +354,7 @@ blockif_open(const char *optstr, const c bc->bc_magic = BLOCKIF_SIG; bc->bc_fd = fd; + bc->bc_ischr = S_ISCHR(sbuf.st_mode); bc->bc_rdonly = ro; bc->bc_size = size; bc->bc_sectsz = sectsz; Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 13:52:30 2015 (r279657) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 15:29:18 2015 (r279658) @@ -128,6 +128,7 @@ struct pci_vtblk_softc { pthread_mutex_t vsc_mtx; struct vqueue_info vbsc_vq; int vbsc_fd; + int vbsc_ischr; struct vtblk_config vbsc_cfg; char vbsc_ident[VTBLK_BLK_ID_BYTES]; }; @@ -218,10 +219,12 @@ pci_vtblk_proc(struct pci_vtblk_softc *s switch (type) { case VBH_OP_WRITE: - err = pwritev(sc->vbsc_fd, iov + 1, i - 1, offset); + if (pwritev(sc->vbsc_fd, iov + 1, i - 1, offset) < 0) + err = errno; break; case VBH_OP_READ: - err = preadv(sc->vbsc_fd, iov + 1, i - 1, offset); + if (preadv(sc->vbsc_fd, iov + 1, i - 1, offset) < 0) + err = errno; break; case VBH_OP_IDENT: /* Assume a single buffer */ @@ -231,7 +234,11 @@ pci_vtblk_proc(struct pci_vtblk_softc *s break; case VBH_OP_FLUSH: case VBH_OP_FLUSH_OUT: - err = fsync(sc->vbsc_fd); + if (sc->vbsc_ischr) { + if (ioctl(sc->vbsc_fd, DIOCGFLUSH)) + err = errno; + } else if (fsync(sc->vbsc_fd)) + err = errno; break; default: err = -ENOSYS; @@ -320,6 +327,7 @@ pci_vtblk_init(struct vmctx *ctx, struct /* record fd of storage device/file */ sc->vbsc_fd = fd; + sc->vbsc_ischr = S_ISCHR(sbuf.st_mode); pthread_mutex_init(&sc->vsc_mtx, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 16:25:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FFEC5C5; Thu, 5 Mar 2015 16:25:04 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E3A5D2; Thu, 5 Mar 2015 16:25:04 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t25GP0dZ013105 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 5 Mar 2015 08:25:01 -0800 Message-ID: <54F8835C.4020605@freebsd.org> Date: Thu, 05 Mar 2015 08:25:00 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Dmitry Sivachenko , Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> In-Reply-To: <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYzOmSobV+HeTU/RRZL8Wws5ybFFU57Olwgf4TLsy3Gjp33mQWDsJYGgM3hgxn28ISp1fpc9yMfWaOJrnvgtiveIrgah7hmCgg= X-Sonic-ID: C;fM7CK1TD5BGLe+8Jj30JFw== M;BEY7LFTD5BGLe+8Jj30JFw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Slawa Olhovchenkov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 16:25:04 -0000 On 03/05/15 06:04, Dmitry Sivachenko wrote: > > > S> How to connect to mpd control socket?! > > pkg install mpd5 telnet > > OMG, please do not make nightmare one have on Linux or Solaris. Everything can be installed form packages but it is so inconvenient! > > It is so nice to have most useful stuff out of the box. Does it hurt you? Having all these things in base is so cool, please do not make Lego constructor everyone must use. > Disks are so large and cheap these days. Most important, there are many scripts that do this. One of the wonderful things about FreeBSD is that you can write scripts that target 'FreeBSD' and not have a dependency nightmare. Removing things from base breaks those scripts and makes this harder to do. In the case of telnet, the gain that balances this is 50K of space on the install media. I'm not sure anyone is seriously proposing to do this, but, just in case, having a stable and monolithic base system is one of FreeBSD's best features. Please don't destroy that. -Nathan From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:00:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3955EE4F; Thu, 5 Mar 2015 17:00:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A6F4773; Thu, 5 Mar 2015 17:00:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25H0dXp052062; Thu, 5 Mar 2015 17:00:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25H0dcx052061; Thu, 5 Mar 2015 17:00:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503051700.t25H0dcx052061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 5 Mar 2015 17:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279663 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:00:40 -0000 Author: pfg Date: Thu Mar 5 17:00:39 2015 New Revision: 279663 URL: https://svnweb.freebsd.org/changeset/base/279663 Log: qsort(3): enhance to handle 32-bit aligned data on 64-bit systems Implement a small enhancement to the original qsort implementation: If the data is 32 bit aligned we can side-step the long type version and use int instead. The change brings a modest but significant improvement in 32 bit workloads. Relnotes: yes PR: 135718 Taken from: ache Modified: head/lib/libc/stdlib/qsort.c Modified: head/lib/libc/stdlib/qsort.c ============================================================================== --- head/lib/libc/stdlib/qsort.c Thu Mar 5 16:49:52 2015 (r279662) +++ head/lib/libc/stdlib/qsort.c Thu Mar 5 17:00:39 2015 (r279663) @@ -41,7 +41,7 @@ typedef int cmp_t(void *, const void * typedef int cmp_t(const void *, const void *); #endif static inline char *med3(char *, char *, char *, cmp_t *, void *); -static inline void swapfunc(char *, char *, int, int); +static inline void swapfunc(char *, char *, int, int, int); #define min(a, b) (a) < (b) ? a : b @@ -59,29 +59,37 @@ static inline void swapfunc(char *, cha } while (--i > 0); \ } -#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ - es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; +#define SWAPINIT(TYPE, a, es) swaptype_ ## TYPE = \ + ((char *)a - (char *)0) % sizeof(TYPE) || \ + es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1; static inline void -swapfunc(a, b, n, swaptype) +swapfunc(a, b, n, swaptype_long, swaptype_int) char *a, *b; - int n, swaptype; + int n, swaptype_long, swaptype_int; { - if(swaptype <= 1) + if (swaptype_long <= 1) swapcode(long, a, b, n) + else if (swaptype_int <= 1) + swapcode(int, a, b, n) else swapcode(char, a, b, n) } -#define swap(a, b) \ - if (swaptype == 0) { \ +#define swap(a, b) \ + if (swaptype_long == 0) { \ long t = *(long *)(a); \ *(long *)(a) = *(long *)(b); \ *(long *)(b) = t; \ + } else if (swaptype_int == 0) { \ + int t = *(int *)(a); \ + *(int *)(a) = *(int *)(b); \ + *(int *)(b) = t; \ } else \ - swapfunc(a, b, es, swaptype) + swapfunc(a, b, es, swaptype_long, swaptype_int) -#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) +#define vecswap(a, b, n) \ + if ((n) > 0) swapfunc(a, b, n, swaptype_long, swaptype_int) #ifdef I_AM_QSORT_R #define CMP(t, x, y) (cmp((t), (x), (y))) @@ -113,9 +121,10 @@ qsort(void *a, size_t n, size_t es, cmp_ char *pa, *pb, *pc, *pd, *pl, *pm, *pn; size_t d, r; int cmp_result; - int swaptype, swap_cnt; + int swaptype_long, swaptype_int, swap_cnt; -loop: SWAPINIT(a, es); +loop: SWAPINIT(long, a, es); + SWAPINIT(int, a, es); swap_cnt = 0; if (n < 7) { for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:02:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA151ED; Thu, 5 Mar 2015 17:02:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58D377AB; Thu, 5 Mar 2015 17:02:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25H2N5p055800; Thu, 5 Mar 2015 17:02:23 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25H2N5b055799; Thu, 5 Mar 2015 17:02:23 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503051702.t25H2N5b055799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 5 Mar 2015 17:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279665 - head/sys/cddl/dev/dtrace/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:02:23 -0000 Author: nwhitehorn Date: Thu Mar 5 17:02:22 2015 New Revision: 279665 URL: https://svnweb.freebsd.org/changeset/base/279665 Log: Fix build after unifying DAR/DEAR storage in trap frame. Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Thu Mar 5 17:01:30 2015 (r279664) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Thu Mar 5 17:02:22 2015 (r279665) @@ -285,7 +285,7 @@ dtrace_trap(struct trapframe *frame, u_i case EXC_DSE: /* Flag a bad address. */ cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; - cpu_core[curcpu].cpuc_dtrace_illval = frame->cpu.aim.dar; + cpu_core[curcpu].cpuc_dtrace_illval = frame->dar; /* * Offset the instruction pointer to the instruction From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:05:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B1643DC; Thu, 5 Mar 2015 17:05:25 +0000 (UTC) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 087047DF; Thu, 5 Mar 2015 17:05:25 +0000 (UTC) Received: by iery20 with SMTP id y20so24730003ier.13; Thu, 05 Mar 2015 09:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=M7Iw4M6VdsPY3jadC5eCttsDQicziZVLqT6VfKnfgS0=; b=K+zCRZSt4UoB8MV5QEhwHA7pAUeSSeOOninZ64MXAEi701JKAr+aGp7DQq3GE2z3HE lHKx8GsUcWzCMn4tOB9ssPWcd6xmNeeP2RmxfQFgKBKrBdTpw+e3SF2DVsWbUGJ+2FNh +OBE7fcDlrvt0S41egmrxbnpYKgVn/m1Q0/MKfnItqdyLOS4Ov0b6XDNYrNUzVRPxBmD WUhrn+uekIjgBiTW4v99A8/W7hQa4MT7nkMX0gijQt99Pitk1GJcd9yq2CtLcMHqyqp1 aOuOGPVwlhgsboc7Ca7urPuFr5K0EMWbVBhHXCXADq/cOek98BSgAPIRrh+4YKRrQs4y Sjsw== X-Received: by 10.50.32.71 with SMTP id g7mr36297342igi.4.1425575124315; Thu, 05 Mar 2015 09:05:24 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:8ce1:ce42:755f:1365? ([2601:8:ab80:7d6:8ce1:ce42:755f:1365]) by mx.google.com with ESMTPSA id o76sm5316277ioi.20.2015.03.05.09.05.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 09:05:23 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_65FB3FC7-9AB1-4443-B336-A3A9DE76E75D"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Garrett Cooper In-Reply-To: <20150305114828.GK17947@FreeBSD.org> Date: Thu, 5 Mar 2015 09:05:21 -0800 Message-Id: <6F1D9F33-2744-4AF7-917D-7292CEDEEE7E@gmail.com> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:05:25 -0000 --Apple-Mail=_65FB3FC7-9AB1-4443-B336-A3A9DE76E75D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Mar 5, 2015, at 3:48, Gleb Smirnoff wrote: > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > B> Author: bapt > B> Date: Wed Mar 4 22:01:44 2015 > B> New Revision: 279603 > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > B>=20 > B> Log: > B> r* commands are not precious anymore > B> > B> Modified: > B> head/bin/rcp/Makefile > B> head/usr.bin/rlogin/Makefile >=20 > I guess when they are going to be not precious enough to be removed? = :) >=20 > In modern world of ssh and https, does any OS require them in base? It might have been mentioned elsewhere in the email thread, but RCS is = required by etcupdate. Cheers, --Apple-Mail=_65FB3FC7-9AB1-4443-B336-A3A9DE76E75D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU+IzRAAoJEMZr5QU6S73e6IAIALJh8ZoWjEtwZ7fQi8J35/Gw 7oYlxbRieQQ9ERtpQ9TBUQLVNmOvUrjV8hfVkb62r4ZO+F+bcpPC8VeGdOu6PNbT 2e/OPvGkvOyKDqUsSANvKmTHwW50EBTX1nAAmz1iAti9OxiSkhqcQsfb88xotn9m EwbwWv1IzyTQo5kGV0HIm6HUp1Hp+rGeoLp7oQ8QWta4lcQiCNpiVJJFc6A4jOGR Ba5jTz+Fv8kyL8xDr2m0RW8YqcokotredzMsOuYg8B2RV0KP7hSzPxHrx9VgWH6Y Yup0qqIKjRNeUIiOLa6nwZM5hqOKdn22/KktaEEla7MNamggT0eCMvk4VmlI5lY= =hKUT -----END PGP SIGNATURE----- --Apple-Mail=_65FB3FC7-9AB1-4443-B336-A3A9DE76E75D-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:17:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4423A91D; Thu, 5 Mar 2015 17:17:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1621E919; Thu, 5 Mar 2015 17:17:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25HHBqW061072; Thu, 5 Mar 2015 17:17:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25HHB7f061071; Thu, 5 Mar 2015 17:17:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503051717.t25HHB7f061071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 5 Mar 2015 17:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279666 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:17:12 -0000 Author: pfg Date: Thu Mar 5 17:17:11 2015 New Revision: 279666 URL: https://svnweb.freebsd.org/changeset/base/279666 Log: qsort(3): small style(9) cleanups. Basically spaces vs. tabs. No functional change. Modified: head/lib/libc/stdlib/qsort.c Modified: head/lib/libc/stdlib/qsort.c ============================================================================== --- head/lib/libc/stdlib/qsort.c Thu Mar 5 17:02:22 2015 (r279665) +++ head/lib/libc/stdlib/qsort.c Thu Mar 5 17:17:11 2015 (r279666) @@ -43,20 +43,20 @@ typedef int cmp_t(const void *, const static inline char *med3(char *, char *, char *, cmp_t *, void *); static inline void swapfunc(char *, char *, int, int, int); -#define min(a, b) (a) < (b) ? a : b +#define MIN(a, b) ((a) < (b) ? a : b) /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". */ -#define swapcode(TYPE, parmi, parmj, n) { \ - long i = (n) / sizeof (TYPE); \ - TYPE *pi = (TYPE *) (parmi); \ - TYPE *pj = (TYPE *) (parmj); \ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ do { \ TYPE t = *pi; \ *pi++ = *pj; \ *pj++ = t; \ - } while (--i > 0); \ + } while (--i > 0); \ } #define SWAPINIT(TYPE, a, es) swaptype_ ## TYPE = \ @@ -106,14 +106,14 @@ __unused { return CMP(thunk, a, b) < 0 ? (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a )) - :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); + :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); } #ifdef I_AM_QSORT_R void qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) #else -#define thunk NULL +#define thunk NULL void qsort(void *a, size_t n, size_t es, cmp_t *cmp) #endif @@ -184,9 +184,9 @@ loop: SWAPINIT(long, a, es); } pn = (char *)a + n * es; - r = min(pa - (char *)a, pb - pa); + r = MIN(pa - (char *)a, pb - pa); vecswap(a, pb - r, r); - r = min(pd - pc, pn - pd - es); + r = MIN(pd - pc, pn - pd - es); vecswap(pb, pn - r, r); if ((r = pb - pa) > es) #ifdef I_AM_QSORT_R From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:26:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9894BBB1; Thu, 5 Mar 2015 17:26:38 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36C6EA4B; Thu, 5 Mar 2015 17:26:38 +0000 (UTC) Received: by wiwh11 with SMTP id h11so40069701wiw.1; Thu, 05 Mar 2015 09:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UzstXpqT5PTYMApMwHXZHibemrQ/wwS08kweeUX3wdE=; b=b37t+FRRmczwUTzYbHxyiOy8rfdzC1NPpNsbrbTlnYbQJvwTwuq8zbstQC3R6DCQYd 77hybIamx0MOU7AH//DC+mh0gXAmgDKpbKxGuQOHIaEZTSR67xfQaigo17OHYPYUitIl gk0p+3L1cFXdHOmICxbULdcnWtcm5LvjLnnZAhx6MHunytAuZt2K//N77+wFOBWarZ1Y D59sw+/92qPUm+QQhkAXeFR3R2TyXIRxukHogWtK46dvWlKQsnzaT5jS4huZ/FxkCec0 6GR/fOKm1iPu9HhAYSx5gJJzzUclAq+McEN5nXwxwk9GPSxzcWwAfKX4zPJOim5+skIh qK6Q== X-Received: by 10.194.81.104 with SMTP id z8mr20136528wjx.45.1425576396535; Thu, 05 Mar 2015 09:26:36 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id n3sm11383744wja.36.2015.03.05.09.26.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 09:26:35 -0800 (PST) Sender: Baptiste Daroussin Date: Thu, 5 Mar 2015 18:26:33 +0100 From: Baptiste Daroussin To: Garrett Cooper Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150305172633.GJ1460@ivaldir.etoilebsd.net> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <6F1D9F33-2744-4AF7-917D-7292CEDEEE7E@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="07FIeBX8hApXX6Bi" Content-Disposition: inline In-Reply-To: <6F1D9F33-2744-4AF7-917D-7292CEDEEE7E@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:26:38 -0000 --07FIeBX8hApXX6Bi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 05, 2015 at 09:05:21AM -0800, Garrett Cooper wrote: > On Mar 5, 2015, at 3:48, Gleb Smirnoff wrote: >=20 > > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: > > B> Author: bapt > > B> Date: Wed Mar 4 22:01:44 2015 > > B> New Revision: 279603 > > B> URL: https://svnweb.freebsd.org/changeset/base/279603 > > B>=20 > > B> Log: > > B> r* commands are not precious anymore > > B> > > B> Modified: > > B> head/bin/rcp/Makefile > > B> head/usr.bin/rlogin/Makefile > >=20 > > I guess when they are going to be not precious enough to be removed? :) > >=20 > > In modern world of ssh and https, does any OS require them in base? >=20 > It might have been mentioned elsewhere in the email thread, but RCS is re= quired by etcupdate. > Cheers, Noone talked about RCS here :) we are talking about r commands such as rsh, rlogin, rcp Bapt --07FIeBX8hApXX6Bi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlT4kckACgkQ8kTtMUmk6EyCSACfRxn8EDmqtKmDurajNRqw3/ky vGAAn31p7Mr04lmZ2ATmyqCzkqJa3q67 =whBW -----END PGP SIGNATURE----- --07FIeBX8hApXX6Bi-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:27:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 108BC7E7; Thu, 5 Mar 2015 17:27:47 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C892DA8A; Thu, 5 Mar 2015 17:27:46 +0000 (UTC) Received: by pdno5 with SMTP id o5so21429851pdn.12; Thu, 05 Mar 2015 09:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=YxaiR8mJTO070bT0Cjmzru9Mz6lC8b2bAlMbr1wCHTs=; b=1Db+TEuURz6L1q67dJ4DrbX8P0pJDrL90xi3zLORL3YxxsZN2ftLXbPfzp7elZpj4o BareOmLtylzByJ5XlARYbf/sb75GdKO7s1iqX9+Ak7Qb+JQK1lGuKCT7O7cOPnqwM/eP lUHKyqxObH021LgQESSeY2f0ONRuCxYAy/G+vSsOPQzPo0X8Fci3lTbVJqH9L199i7tz WbwXCOpdwJqwttP8zMNufMQDx9Q892DcfE+BPYUYB5l55Dwi/HUF42VouZ/woJhrViYp gDsgl14tYltm2ugu3SNq0p2bIwmYrbcT5kDKDIDhXZNP6f8K6/RyxjCjeRTZZ5Qy7lHl uL5g== X-Received: by 10.66.66.230 with SMTP id i6mr17645810pat.108.1425576466394; Thu, 05 Mar 2015 09:27:46 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:8ce1:ce42:755f:1365? ([2601:8:ab80:7d6:8ce1:ce42:755f:1365]) by mx.google.com with ESMTPSA id u1sm7516281pbs.7.2015.03.05.09.27.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 09:27:45 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_92F3C509-B4E9-43A9-A74F-BF4534632B9A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Garrett Cooper In-Reply-To: <20150305172633.GJ1460@ivaldir.etoilebsd.net> Date: Thu, 5 Mar 2015 09:27:33 -0800 Message-Id: <313D6DD1-CD0F-481F-A64C-E6703A32F967@gmail.com> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <6F1D9F33-2744-4AF7-917D-7292CEDEEE7E@gmail.com> <20150305172633.GJ1460@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:27:47 -0000 --Apple-Mail=_92F3C509-B4E9-43A9-A74F-BF4534632B9A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Mar 5, 2015, at 9:26, Baptiste Daroussin wrote: > On Thu, Mar 05, 2015 at 09:05:21AM -0800, Garrett Cooper wrote: >> On Mar 5, 2015, at 3:48, Gleb Smirnoff wrote: >>=20 >>> On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: >>> B> Author: bapt >>> B> Date: Wed Mar 4 22:01:44 2015 >>> B> New Revision: 279603 >>> B> URL: https://svnweb.freebsd.org/changeset/base/279603 >>> B>=20 >>> B> Log: >>> B> r* commands are not precious anymore >>> B> >>> B> Modified: >>> B> head/bin/rcp/Makefile >>> B> head/usr.bin/rlogin/Makefile >>>=20 >>> I guess when they are going to be not precious enough to be removed? = :) >>>=20 >>> In modern world of ssh and https, does any OS require them in base? >>=20 >> It might have been mentioned elsewhere in the email thread, but RCS = is required by etcupdate. >> Cheers, >=20 > Noone talked about RCS here :) >=20 > we are talking about r commands such as rsh, rlogin, rcp Ugh. Still not fully awake=85 ok, carry on... --Apple-Mail=_92F3C509-B4E9-43A9-A74F-BF4534632B9A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU+JIFAAoJEMZr5QU6S73e7pYIAJ+Rbnli6BKmH50nq37qpriJ 04mMWZF/RVCVttPJh6KTpimtRchiGwM9oYPxESJQCHeFv8GLNRHOFv8ep7R1mmQd aEtHFXxqKMCyS0nG3714ABpAY+XlVz+P2hVSFqBAVoU/K3BEWfKsQkrihM38/Z8m vh+6v/rhwJJ/q+bg8Wh+LHTiLARho5Vg4fILFBN+xlR0QuHSkmcpoP2/bLyls0hy ZPRt1/0eBS1ztRnAC7HJi/+4CIcSBuCb9It3hmX3iHZ6ZdpJEaGmDib0ox6q/Eg6 uOYLkcRmtOsO//Tcao08s1YLF919Q/tD2HW4J1Oflh/8zbKPKamrDpuRhhZ/Yoc= =oP5B -----END PGP SIGNATURE----- --Apple-Mail=_92F3C509-B4E9-43A9-A74F-BF4534632B9A-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 17:55:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 825B3354; Thu, 5 Mar 2015 17:55:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C2F3E18; Thu, 5 Mar 2015 17:55:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25HtXWN084196; Thu, 5 Mar 2015 17:55:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25HtVtg084188; Thu, 5 Mar 2015 17:55:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503051755.t25HtVtg084188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 5 Mar 2015 17:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279667 - in head/sys: arm/arm cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace/arm cddl/dev/fbt/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:55:33 -0000 Author: andrew Date: Thu Mar 5 17:55:31 2015 New Revision: 279667 URL: https://svnweb.freebsd.org/changeset/base/279667 Log: Add the MD parts of dtrace needed to use fbt on ARM. For this we need to emulate the instructions used in function entry and exit. For function entry ARM will use a push instruction to push up to 16 registers to the stack. While we don't expect all 16 to be used we need to handle any combination the compiler may generate, even if it doesn't make sense (e.g. pushing the program counter). On function return we will either have a pop or branch instruction. The former is similar to the push instruction, but with care to make sure we update the stack pointer and program counter correctly in the cases they are either in the list of registers or not. For branch we need to take the 24-bit offset, sign-extend it, and add that number of 4-byte words to the program counter. Care needs to be taken as, due to historical reasons, the address the branch is relative to is not the current instruction, but 8 bytes later. This allows us to use the following probes on ARM boards: dtrace -n 'fbt::malloc:entry { stack() }' and dtrace -n 'fbt::free:return { stack() }' Differential Revision: https://reviews.freebsd.org/D2007 Reviewed by: gnn, rpaulo Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/db_trace.c head/sys/arm/arm/exception.S head/sys/arm/arm/undefined.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/dtrace/arm/dtrace_subr.c head/sys/cddl/dev/fbt/arm/fbt_isa.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Thu Mar 5 17:17:11 2015 (r279666) +++ head/sys/arm/arm/db_trace.c Thu Mar 5 17:55:31 2015 (r279667) @@ -66,7 +66,7 @@ db_stack_trace_cmd(struct unwind_state * finished = false; while (!finished) { - finished = unwind_stack_one(state, 0); + finished = unwind_stack_one(state, 1); /* Print the frame details */ sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Thu Mar 5 17:17:11 2015 (r279666) +++ head/sys/arm/arm/exception.S Thu Mar 5 17:55:31 2015 (r279667) @@ -57,11 +57,6 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS .bss .align 4 - .global _C_LABEL(dtrace_invop_jump_addr) -_C_LABEL(dtrace_invop_jump_addr): - .word 0 - .word 0 - .global _C_LABEL(dtrace_invop_calltrap_addr) _C_LABEL(dtrace_invop_calltrap_addr): .word 0 @@ -162,7 +157,8 @@ _C_LABEL(dtrace_invop_calltrap_addr): msr cpsr_c, r2; /* Punch into SVC mode */ \ mov r2, sp; /* Save SVC sp */ \ bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ - sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ + sub sp, sp, #(4 * 17); /* Pad trapframe to keep alignment */ \ + /* and for dtrace to emulate push/pop */ \ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ @@ -199,7 +195,8 @@ _C_LABEL(dtrace_invop_calltrap_addr): msr cpsr_c, r2; /* Punch into SVC mode */ \ mov r2, sp; /* Save SVC sp */ \ bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ - sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ + sub sp, sp, #(4 * 17); /* Pad trapframe to keep alignment */ \ + /* and for dtrace to emulate push/pop */ \ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ Modified: head/sys/arm/arm/undefined.c ============================================================================== --- head/sys/arm/arm/undefined.c Thu Mar 5 17:17:11 2015 (r279666) +++ head/sys/arm/arm/undefined.c Thu Mar 5 17:55:31 2015 (r279667) @@ -86,6 +86,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef KDTRACE_HOOKS +int (*dtrace_invop_jump_addr)(struct trapframe *); +#endif + static int gdb_trapper(u_int, u_int, struct trapframe *, int); LIST_HEAD(, undefined_handler) undefined_handlers[MAX_COPROCS]; @@ -286,7 +290,14 @@ undefinedinstruction(struct trapframe *f printf("No debugger in kernel.\n"); #endif return; - } else + } +#ifdef KDTRACE_HOOKS + else if (dtrace_invop_jump_addr != 0) { + dtrace_invop_jump_addr(frame); + return; + } +#endif + else panic("Undefined instruction in kernel.\n"); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Thu Mar 5 17:17:11 2015 (r279666) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Thu Mar 5 17:55:31 2015 (r279667) @@ -2436,6 +2436,10 @@ extern void dtrace_helpers_destroy(proc_ #elif defined(__arm__) +#define DTRACE_INVOP_SHIFT 4 +#define DTRACE_INVOP_MASK ((1 << DTRACE_INVOP_SHIFT) - 1) +#define DTRACE_INVOP_DATA(x) ((x) >> DTRACE_INVOP_SHIFT) + #define DTRACE_INVOP_PUSHM 1 #define DTRACE_INVOP_POPM 2 #define DTRACE_INVOP_B 3 Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Mar 5 17:17:11 2015 (r279666) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Mar 5 17:55:31 2015 (r279667) @@ -46,7 +46,11 @@ __FBSDID("$FreeBSD$"); #include #define DELAYBRANCH(x) ((int)(x) < 0) - + +#define BIT_PC 15 +#define BIT_LR 14 +#define BIT_SP 13 + extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; extern dtrace_id_t dtrace_probeid_error; @@ -231,16 +235,97 @@ dtrace_probe_error(dtrace_state_t *state static int dtrace_invop_start(struct trapframe *frame) { - printf("IMPLEMENT ME: %s\n", __func__); - switch (dtrace_invop(frame->tf_pc, (uintptr_t *)frame, frame->tf_pc)) { + register_t *r0, *sp; + int data, invop, reg, update_sp; + + invop = dtrace_invop(frame->tf_pc, (uintptr_t *)frame, frame->tf_pc); + switch (invop & DTRACE_INVOP_MASK) { case DTRACE_INVOP_PUSHM: - // TODO: + sp = (register_t *)frame->tf_svc_sp; + r0 = &frame->tf_r0; + data = DTRACE_INVOP_DATA(invop); + + /* + * Store the pc, lr, and sp. These have their own + * entries in the struct. + */ + if (data & (1 << BIT_PC)) { + sp--; + *sp = frame->tf_pc; + } + if (data & (1 << BIT_LR)) { + sp--; + *sp = frame->tf_svc_lr; + } + if (data & (1 << BIT_SP)) { + sp--; + *sp = frame->tf_svc_sp; + } + + /* Store the general registers */ + for (reg = 12; reg >= 0; reg--) { + if (data & (1 << reg)) { + sp--; + *sp = r0[reg]; + } + } + + /* Update the stack pointer and program counter to continue */ + frame->tf_svc_sp = (register_t)sp; + frame->tf_pc += 4; break; case DTRACE_INVOP_POPM: - // TODO: + sp = (register_t *)frame->tf_svc_sp; + r0 = &frame->tf_r0; + data = DTRACE_INVOP_DATA(invop); + + /* Read the general registers */ + for (reg = 0; reg <= 12; reg++) { + if (data & (1 << reg)) { + r0[reg] = *sp; + sp++; + } + } + + /* + * Set the stack pointer. If we don't update it here we will + * need to update it at the end as the instruction would do + */ + update_sp = 1; + if (data & (1 << BIT_SP)) { + frame->tf_svc_sp = *sp; + *sp++; + update_sp = 0; + } + + /* Update the link register, we need to use the correct copy */ + if (data & (1 << BIT_LR)) { + frame->tf_svc_lr = *sp; + *sp++; + } + /* + * And the program counter. If it's not in the list skip over + * it when we return so to not hit this again. + */ + if (data & (1 << BIT_PC)) { + frame->tf_pc = *sp; + *sp++; + } else + frame->tf_pc += 4; + + /* Update the stack pointer if we haven't already done so */ + if (update_sp) + frame->tf_svc_sp = (register_t)sp; break; case DTRACE_INVOP_B: - // TODO + data = DTRACE_INVOP_DATA(invop) & 0x00ffffff; + /* Sign extend the data */ + if ((data & (1 << 23)) != 0) + data |= 0xff000000; + /* The data is the number of 4-byte words to change the pc */ + data *= 4; + data += 8; + frame->tf_pc += data; break; default: return (-1); Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Thu Mar 5 17:17:11 2015 (r279666) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Thu Mar 5 17:55:31 2015 (r279667) @@ -38,7 +38,7 @@ #include "fbt.h" -#define FBT_PATCHVAL 0xe06a0cfe /* illegal instruction */ +#define FBT_PATCHVAL 0xe7f000f0 /* Specified undefined instruction */ #define FBT_PUSHM 0xe92d0000 #define FBT_POPM 0xe8bd0000 @@ -66,7 +66,7 @@ fbt_invop(uintptr_t addr, uintptr_t *sta cpu->cpu_dtrace_caller = 0; - return (fbt->fbtp_rval); + return (fbt->fbtp_rval | (fbt->fbtp_savedval << DTRACE_INVOP_SHIFT)); } } From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 18:03:43 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40A71747; Thu, 5 Mar 2015 18:03:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C318F88; Thu, 5 Mar 2015 18:03:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25I3h0p089004; Thu, 5 Mar 2015 18:03:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25I3hCE089003; Thu, 5 Mar 2015 18:03:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503051803.t25I3hCE089003@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 5 Mar 2015 18:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279669 - head/sys/cddl/dev/dtrace/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 18:03:43 -0000 Author: andrew Date: Thu Mar 5 18:03:42 2015 New Revision: 279669 URL: https://svnweb.freebsd.org/changeset/base/279669 Log: dtrace_cas32 and dtrace_casptr should retrn the data loaded from target not the new value. Sponsored by: ABT Systems Ltd Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Thu Mar 5 17:56:02 2015 (r279668) +++ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Thu Mar 5 18:03:42 2015 (r279669) @@ -208,12 +208,10 @@ EENTRY(dtrace_casptr) 1: ldrex r3, [r0] /* Load target */ cmp r3, r1 /* Check if *target == cmp */ bne 2f /* No, return */ - strex r3, r2, [r0] /* Store new to target */ - cmp r3, #0 /* Did the store succeed? */ + strex ip, r2, [r0] /* Store new to target */ + cmp ip, #0 /* Did the store succeed? */ bne 1b /* No, try again */ - mov r0, r2 /* Return the new value of the store */ -2: movne r0, r3 /* The first compare failed, return */ - /* the value loaded from memory */ +2: mov r0, r3 /* Return the value loaded from target */ RET EEND(dtrace_casptr) END(dtrace_cas32) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 18:21:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DC6DC63; Thu, 5 Mar 2015 18:21:17 +0000 (UTC) Received: from testsoekris.hotsoft.nl (unknown [IPv6:2001:888:1227:0:200:24ff:fec9:5934]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA2E426E; Thu, 5 Mar 2015 18:21:16 +0000 (UTC) Received: from beastie.hotsoft.nl (beastie.hotsoft.nl [IPv6:2001:888:1227:0:219:d1ff:fee8:91eb]) by testsoekris.hotsoft.nl (8.14.7/8.14.7) with ESMTP id t25ILBq9034717; Thu, 5 Mar 2015 19:21:11 +0100 (CET) (envelope-from hans@beastielabs.net) Message-ID: <54F89E97.9040203@beastielabs.net> Date: Thu, 05 Mar 2015 19:21:11 +0100 From: Hans Ottevanger User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Slawa Olhovchenkov , Gleb Smirnoff Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> In-Reply-To: <20150305122103.GA90978@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 18:21:17 -0000 On 03/05/15 13:21, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 02:48:29PM +0300, Gleb Smirnoff wrote: > >> On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: >> B> Author: bapt >> B> Date: Wed Mar 4 22:01:44 2015 >> B> New Revision: 279603 >> B> URL: https://svnweb.freebsd.org/changeset/base/279603 >> B> >> B> Log: >> B> r* commands are not precious anymore >> B> >> B> Modified: >> B> head/bin/rcp/Makefile >> B> head/usr.bin/rlogin/Makefile >> >> I guess when they are going to be not precious enough to be removed? :) >> >> In modern world of ssh and https, does any OS require them in base? > > yes. > Some telecom equipment require rlogin. > _______________________________________________ Considering that the r-commands are not particularly large and also not really a maintenance nightmare, a would just keep them. They are (still) more or less part of the standard Unix toolbox, as perceived by end-users, and you had better not make life too difficult for them. The same is true for telnet. I see these tools in use regularly, e.g. to control measurement equipment programmatically. Due to the price tag of those instruments, that won't change overnight. The usage is limited to a LAN however, nobody I know uses these tools over the public Internet anymore. As far as I know only OpenBSD got rid of these tools up to now. Most other Unix(-like) systems still have them. And if they absolutely have to go, what happens to the corresponding daemons in /usr/libexec (rshd and rlogind)? Regards, Hans From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 18:47:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C57C7621; Thu, 5 Mar 2015 18:47:41 +0000 (UTC) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 885B7759; Thu, 5 Mar 2015 18:47:41 +0000 (UTC) Received: by padfa1 with SMTP id fa1so44621377pad.9; Thu, 05 Mar 2015 10:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=19mgt8x7Pg1AQFP2u2O8F6C70N2bVsLOHxYN6y9L4lE=; b=foE6TZtFNhICLtrwW46r1ha5zNZQTPmbcWS56XR8lIFq5uwDTMYsZi/vBeZdubeT2Z wTm/FwjrkQqiYa6527BqcMJPJjmKqEuXFE5Z7igNI4ZX5S4zAFEQHOu8U/VuQYIChK5F SG9fGujQgOybRUtJvhvE8XTeV1qNJ0H0FzOhGWmRyiqm0gv2BOFCx/4p8R9HN8TYzsr7 KP7DgxIHW483jUXQb8aiOHEQY6d9w4I4pmTpl0Hmn4MunqfTWPGqB1kIF0pVJZP/X2+q CCLbga0wJY2Iikq8RCiyYDDgBDHTEa/qSBrmrSMBwFjtjcVTgV4lnB9KMGjm7W1Ar2Q2 1ksw== X-Received: by 10.68.68.167 with SMTP id x7mr18737547pbt.23.1425581261034; Thu, 05 Mar 2015 10:47:41 -0800 (PST) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id mv6sm7623748pdb.29.2015.03.05.10.47.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 10:47:40 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_C8223896-AF52-4E89-9AD7-4912CD2A65A9"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Garrett Cooper In-Reply-To: <54F89E97.9040203@beastielabs.net> Date: Thu, 5 Mar 2015 10:47:38 -0800 Message-Id: References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <54F89E97.9040203@beastielabs.net> To: Hans Ottevanger X-Mailer: Apple Mail (2.1878.6) Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 18:47:42 -0000 --Apple-Mail=_C8223896-AF52-4E89-9AD7-4912CD2A65A9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Mar 5, 2015, at 10:21, Hans Ottevanger wrote: > On 03/05/15 13:21, Slawa Olhovchenkov wrote: >> On Thu, Mar 05, 2015 at 02:48:29PM +0300, Gleb Smirnoff wrote: >>=20 >>> On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: >>> B> Author: bapt >>> B> Date: Wed Mar 4 22:01:44 2015 >>> B> New Revision: 279603 >>> B> URL: https://svnweb.freebsd.org/changeset/base/279603 >>> B> >>> B> Log: >>> B> r* commands are not precious anymore >>> B> >>> B> Modified: >>> B> head/bin/rcp/Makefile >>> B> head/usr.bin/rlogin/Makefile >>>=20 >>> I guess when they are going to be not precious enough to be removed? = :) >>>=20 >>> In modern world of ssh and https, does any OS require them in base? >>=20 >> yes. >> Some telecom equipment require rlogin. >> _______________________________________________ >=20 > Considering that the r-commands are not particularly large and also = not really a maintenance nightmare, a would just keep them. They are = (still) more or less part of the standard Unix toolbox, as perceived by = end-users, and you had better not make life too difficult for them. The = same is true for telnet. >=20 > I see these tools in use regularly, e.g. to control measurement = equipment programmatically. Due to the price tag of those instruments, = that won't change overnight. The usage is limited to a LAN however, = nobody I know uses these tools over the public Internet anymore. >=20 > As far as I know only OpenBSD got rid of these tools up to now. Most = other Unix(-like) systems still have them. >=20 > And if they absolutely have to go, what happens to the corresponding = daemons in /usr/libexec (rshd and rlogind)? Why not just move them to ports so the people that need them can have = them=85? --Apple-Mail=_C8223896-AF52-4E89-9AD7-4912CD2A65A9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU+KTKAAoJEMZr5QU6S73ed4AIAJBkPKAWm+yLk5dCV7cfP/hY tm1nQ9Xjy3FsJZI1fsTb8Z9e4bD9Asm3EZS+tX5MCULsQDrOZ6PWQAwt4cyvROfo UxsE1F2q/09MHnhGppQpi63nTp5wAjMwHEtY0SaMU/Pi4nHTQg4ArVJC8dL/JL4j CxbBQspW6ASZXlAys3RK3h/XQA751aTgKjsQxQDhV3DL+oB+aFA2jdMxBj1/0Uhc GpXmn8H17sGO790qZYp7yOCiAfOH3EHPVyN6yuRftb+JjyJ86zzAe901Ej4l/hZA T2kVv4t8o1kvuL2UeCO+JvXEhNATxrrVU/BiJaPOxsxqkYorrnqP/7/SIcSTZ1s= =3nyH -----END PGP SIGNATURE----- --Apple-Mail=_C8223896-AF52-4E89-9AD7-4912CD2A65A9-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 18:52:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8AF4A8E; Thu, 5 Mar 2015 18:52:15 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95A39842; Thu, 5 Mar 2015 18:52:15 +0000 (UTC) Received: from [24.246.110.93] (port=22002 helo=[172.16.19.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1YTasQ-0005WT-3z; Thu, 05 Mar 2015 13:52:06 -0500 From: "George Neville-Neil" To: "Garrett Cooper" Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Date: Thu, 05 Mar 2015 13:51:56 -0500 Message-ID: In-Reply-To: References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <54F89E97.9040203@beastielabs.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_2AF35507-7691-400A-8D2B-E83F1C86FF51_="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Mailer: MailMate (1.9r5066) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, Hans Ottevanger , Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 18:52:16 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_2AF35507-7691-400A-8D2B-E83F1C86FF51_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5 Mar 2015, at 13:47, Garrett Cooper wrote: > On Mar 5, 2015, at 10:21, Hans Ottevanger wrote:= > >> On 03/05/15 13:21, Slawa Olhovchenkov wrote: >>> On Thu, Mar 05, 2015 at 02:48:29PM +0300, Gleb Smirnoff wrote: >>> >>>> On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: >>>> B> Author: bapt >>>> B> Date: Wed Mar 4 22:01:44 2015 >>>> B> New Revision: 279603 >>>> B> URL: https://svnweb.freebsd.org/changeset/base/279603 >>>> B> >>>> B> Log: >>>> B> r* commands are not precious anymore >>>> B> >>>> B> Modified: >>>> B> head/bin/rcp/Makefile >>>> B> head/usr.bin/rlogin/Makefile >>>> >>>> I guess when they are going to be not precious enough to be removed?= :) >>>> >>>> In modern world of ssh and https, does any OS require them in base? >>> >>> yes. >>> Some telecom equipment require rlogin. >>> _______________________________________________ >> >> Considering that the r-commands are not particularly large and also no= t really a maintenance nightmare, a would just keep them. They are (still= ) more or less part of the standard Unix toolbox, as perceived by end-use= rs, and you had better not make life too difficult for them. The same is = true for telnet. >> >> I see these tools in use regularly, e.g. to control measurement equipm= ent programmatically. Due to the price tag of those instruments, that won= 't change overnight. The usage is limited to a LAN however, nobody I know= uses these tools over the public Internet anymore. >> >> As far as I know only OpenBSD got rid of these tools up to now. Most o= ther Unix(-like) systems still have them. >> >> And if they absolutely have to go, what happens to the corresponding d= aemons in /usr/libexec (rshd and rlogind)? > > Why not just move them to ports so the people that need them can have t= hem=E2=80=A6? OK, telnet, used by every single person who even configures a network swi= tch. It's in their muscle memory and, for now, we should leave it in the base system. The r* programs are less used though, as someone points out, from time to= time used with telco equipment. Let's do this by stages. Move the r* stuff to a port/package and leave t= elnet alone for now. I know of no network admin who ever touches nc. Let's make sure we're providing for what people actually use day to day. Best, George --=_MailMate_2AF35507-7691-400A-8D2B-E83F1C86FF51_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlT4pcwACgkQYdh2wUQKM9J6cQCdEry6xa/5UmfRbzrGq5858NsY pC8An2aLmZPe9vCz3GMYJgLTPDXvqMm2 =AFDU -----END PGP SIGNATURE----- --=_MailMate_2AF35507-7691-400A-8D2B-E83F1C86FF51_=-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 19:18:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C571EAE; Thu, 5 Mar 2015 19:18:13 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 60FCEA86; Thu, 5 Mar 2015 19:18:13 +0000 (UTC) Received: from u10-2-32-133.office.norse-data.com (unknown [50.204.88.51]) by elvis.mu.org (Postfix) with ESMTPSA id 5CE29341F867; Thu, 5 Mar 2015 11:18:12 -0800 (PST) Message-ID: <54F8ACDF.70305@freebsd.org> Date: Thu, 05 Mar 2015 11:22:07 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: David Chisnall , Dmitry Sivachenko Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 19:18:13 -0000 On 3/5/15 6:09 AM, David Chisnall wrote: > On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: > >> It is so nice to have most useful stuff out of the box. > The question is whether a tool for logging into remote machines without encryption is 'the most useful stuff'. The tool is also [ab]used for network testing, but we already provide a better tool for that in the form of nc(1). > > David > > Agree. Moving it out of base +1000. It's time we made FreeBSD into an actual distro which is what is happening anyhow. This is a great time! From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 19:51:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A60F1775; Thu, 5 Mar 2015 19:51:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 914FBDE5; Thu, 5 Mar 2015 19:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25JpcGX040642; Thu, 5 Mar 2015 19:51:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25JpcU0040641; Thu, 5 Mar 2015 19:51:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503051951.t25JpcU0040641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 5 Mar 2015 19:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279671 - head/usr.bin/rlogin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 19:51:38 -0000 Author: pfg Date: Thu Mar 5 19:51:37 2015 New Revision: 279671 URL: https://svnweb.freebsd.org/changeset/base/279671 Log: rlogin(1): initialize term variable. CID: 1011522 Obtained from: NetBSD (CVS 1.18, partial) Modified: head/usr.bin/rlogin/rlogin.c Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Thu Mar 5 18:22:20 2015 (r279670) +++ head/usr.bin/rlogin/rlogin.c Thu Mar 5 19:51:37 2015 (r279671) @@ -131,7 +131,7 @@ main(int argc, char *argv[]) long omask; int argoff, ch, dflag, Dflag, one; uid_t uid; - char *host, *localname, *p, *user, term[1024]; + char *host, *localname, *p, *user, term[1024] = "network"; speed_t ospeed; struct sockaddr_storage ss; socklen_t sslen; From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 20:24:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0E8C331; Thu, 5 Mar 2015 20:24:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC0D027A; Thu, 5 Mar 2015 20:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25KOYwl055794; Thu, 5 Mar 2015 20:24:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25KOY5r055793; Thu, 5 Mar 2015 20:24:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503052024.t25KOY5r055793@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 20:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279673 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 20:24:35 -0000 Author: mav Date: Thu Mar 5 20:24:34 2015 New Revision: 279673 URL: https://svnweb.freebsd.org/changeset/base/279673 Log: Fix error translation broken in r279658. Reported by: grehan MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 20:22:28 2015 (r279672) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 20:24:34 2015 (r279673) @@ -246,12 +246,11 @@ pci_vtblk_proc(struct pci_vtblk_softc *s } /* convert errno into a virtio block error return */ - if (err < 0) { - if (err == -ENOSYS) - *status = VTBLK_S_UNSUPP; - else - *status = VTBLK_S_IOERR; - } else + if (err == -ENOSYS) + *status = VTBLK_S_UNSUPP; + else if (err != 0) + *status = VTBLK_S_IOERR; + else *status = VTBLK_S_OK; /* From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 20:29:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E79B5A2; Thu, 5 Mar 2015 20:29:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 099972C5; Thu, 5 Mar 2015 20:29:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25KTIoH056521; Thu, 5 Mar 2015 20:29:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25KTIsU056520; Thu, 5 Mar 2015 20:29:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503052029.t25KTIsU056520@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 5 Mar 2015 20:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279675 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 20:29:19 -0000 Author: mav Date: Thu Mar 5 20:29:18 2015 New Revision: 279675 URL: https://svnweb.freebsd.org/changeset/base/279675 Log: Add variable initialization missed by me and clang. Reported by: grehan MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 20:25:09 2015 (r279674) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu Mar 5 20:29:18 2015 (r279675) @@ -217,6 +217,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s DPRINTF(("virtio-block: %s op, %d bytes, %d segs, offset %ld\n\r", writeop ? "write" : "read/ident", iolen, i - 1, offset)); + err = 0; switch (type) { case VBH_OP_WRITE: if (pwritev(sc->vbsc_fd, iov + 1, i - 1, offset) < 0) From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 21:27:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFF5752D; Thu, 5 Mar 2015 21:27:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A092AB59; Thu, 5 Mar 2015 21:27:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25LRpvn085445; Thu, 5 Mar 2015 21:27:51 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25LRnoO085432; Thu, 5 Mar 2015 21:27:49 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201503052127.t25LRnoO085432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 5 Mar 2015 21:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279676 - in head: sbin/ifconfig sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 21:27:51 -0000 Author: hrs Date: Thu Mar 5 21:27:49 2015 New Revision: 279676 URL: https://svnweb.freebsd.org/changeset/base/279676 Log: - Implement loopback probing state in enhanced DAD algorithm. - Add no_dad and ignoreloop per-IF knob. no_dad disables DAD completely, and ignoreloop is to prevent infinite loop in loopback probing state when loopback is permanently expected. Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c head/sbin/ifconfig/ifconfig.8 head/sys/netinet6/in6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Thu Mar 5 20:29:18 2015 (r279675) +++ head/sbin/ifconfig/af_inet6.c Thu Mar 5 21:27:49 2015 (r279676) @@ -485,6 +485,10 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD("no_prefer_iface",ND6_IFF_NO_PREFER_IFACE,setnd6flags), DEF_CMD("-no_prefer_iface",-ND6_IFF_NO_PREFER_IFACE,setnd6flags), + DEF_CMD("no_dad", ND6_IFF_NO_DAD, setnd6flags), + DEF_CMD("-no_dad", -ND6_IFF_NO_DAD, setnd6flags), + DEF_CMD("ignoreloop", ND6_IFF_IGNORELOOP, setnd6flags), + DEF_CMD("-ignoreloop", -ND6_IFF_IGNORELOOP, setnd6flags), DEF_CMD_ARG("pltime", setip6pltime), DEF_CMD_ARG("vltime", setip6vltime), DEF_CMD("eui64", 0, setip6eui64), Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Thu Mar 5 20:29:18 2015 (r279675) +++ head/sbin/ifconfig/af_nd6.c Thu Mar 5 21:27:49 2015 (r279676) @@ -58,7 +58,8 @@ static const char rcsid[] = #define MAX_SYSCTL_TRY 5 #define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ - "\007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF" + "\007NO_RADR\010NO_PREFER_IFACE\011IGNORELOOP\012NO_DAD" \ + "\020DEFAULTIF" static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Thu Mar 5 20:29:18 2015 (r279675) +++ head/sbin/ifconfig/ifconfig.8 Thu Mar 5 21:27:49 2015 (r279676) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd December 16, 2014 +.Dd March 6, 2015 .Dt IFCONFIG 8 .Os .Sh NAME @@ -687,6 +687,20 @@ policy table, configurable with .It Cm -no_prefer_iface Clear a flag .Cm no_prefer_iface . +.It Cm no_dad +Set a flag to disable Duplicate Address Detection. +.It Cm -no_dad +Clear a flag +.Cm no_dad . +.It Cm ignoreloop +Set a flag to disable loopback detection in Enhanced Duplicate Address +Detection Algorithm. +When this flag is set, +Duplicate Address Detection will stop in a finite number of probings +even if a loopback configuration is detected. +.It Cm -ignoreloop +Clear a flag +.Cm ignoreloop . .El .Pp The following parameters are specific for IPv6 addresses. Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Thu Mar 5 20:29:18 2015 (r279675) +++ head/sys/netinet6/in6.c Thu Mar 5 21:27:49 2015 (r279676) @@ -1910,7 +1910,8 @@ in6if_do_dad(struct ifnet *ifp) if ((ifp->if_flags & IFF_LOOPBACK) != 0) return (0); - if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) || + (ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD)) return (0); /* Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Mar 5 20:29:18 2015 (r279675) +++ head/sys/netinet6/nd6.h Thu Mar 5 21:27:49 2015 (r279676) @@ -87,6 +87,8 @@ struct nd_ifinfo { #define ND6_IFF_AUTO_LINKLOCAL 0x20 #define ND6_IFF_NO_RADR 0x40 #define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */ +#define ND6_IFF_IGNORELOOP 0x100 +#define ND6_IFF_NO_DAD 0x200 #define ND6_CREATE LLE_CREATE #define ND6_EXCLUSIVE LLE_EXCLUSIVE Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Mar 5 20:29:18 2015 (r279675) +++ head/sys/netinet6/nd6_nbr.c Thu Mar 5 21:27:49 2015 (r279676) @@ -1182,6 +1182,7 @@ struct dadq { int dad_ns_icount; int dad_na_icount; int dad_ns_lcount; /* looped back NS */ + int dad_loopbackprobe; /* probing state for loopback detection */ struct callout dad_timer_ch; struct vnet *dad_vnet; u_int dad_refcnt; @@ -1223,7 +1224,6 @@ static struct dadq * nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *n) { struct dadq *dp; - char ip6buf[INET6_ADDRSTRLEN]; DADQ_RLOCK(); TAILQ_FOREACH(dp, &V_dadq, dad_list) { @@ -1238,10 +1238,6 @@ nd6_dad_find(struct ifaddr *ifa, struct n->nd_opt_nonce_len == (ND_OPT_NONCE_LEN + 2) / 8 && memcmp(&n->nd_opt_nonce[0], &dp->dad_nonce[0], ND_OPT_NONCE_LEN) == 0) { - log(LOG_ERR, "%s: a looped back NS message is " - "detected during DAD for %s.\n", - if_name(ifa->ifa_ifp), - ip6_sprintf(ip6buf, IFA_IN6(ifa))); dp->dad_ns_lcount++; continue; } @@ -1357,7 +1353,7 @@ nd6_dad_start(struct ifaddr *ifa, int de dp->dad_count = V_ip6_dad_count; dp->dad_ns_icount = dp->dad_na_icount = 0; dp->dad_ns_ocount = dp->dad_ns_tcount = 0; - dp->dad_ns_lcount = 0; + dp->dad_ns_lcount = dp->dad_loopbackprobe = 0; refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); if (delay == 0) { @@ -1432,8 +1428,10 @@ nd6_dad_timer(struct dadq *dp) goto err; } - /* timeouted with IFF_{RUNNING,UP} check */ - if (dp->dad_ns_tcount > V_dad_maxtry) { + /* Stop DAD if the interface is down even after dad_maxtry attempts. */ + if ((dp->dad_ns_tcount > V_dad_maxtry) && + (((ifp->if_flags & IFF_UP) == 0) || + ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0))) { nd6log((LOG_INFO, "%s: could not run DAD, driver problem?\n", if_name(ifa->ifa_ifp))); goto err; @@ -1456,7 +1454,42 @@ nd6_dad_timer(struct dadq *dp) if (dp->dad_ns_icount > 0 || dp->dad_na_icount > 0) /* We've seen NS or NA, means DAD has failed. */ nd6_dad_duplicated(ifa, dp); - else { + else if (V_dad_enhanced != 0 && + dp->dad_ns_lcount > 0 && + dp->dad_ns_lcount > dp->dad_loopbackprobe) { + /* + * A looped back probe is detected, + * Sec. 4.1 in draft-ietf-6man-enhanced-dad-13 + * requires transmission of additional probes until + * the loopback condition becomes clear. + */ + log(LOG_ERR, "%s: a looped back NS message is " + "detected during DAD for %s. " + "Another DAD probes are being sent.\n", + if_name(ifa->ifa_ifp), + ip6_sprintf(ip6buf, IFA_IN6(ifa))); + dp->dad_loopbackprobe = dp->dad_ns_lcount; + /* + * An interface with IGNORELOOP is one which a + * loopback is permanently expected while regular + * traffic works. In that case, stop DAD after + * MAX_MULTICAST_SOLICIT number of NS messages + * regardless of the number of received loopback NS + * by increasing dad_loopbackprobe in advance. + */ + if (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IGNORELOOP) + dp->dad_loopbackprobe += V_nd6_mmaxtries; + /* + * Send an NS immediately and increase dad_count by + * V_nd6_mmaxtries - 1. + */ + nd6_dad_ns_output(dp, ifa); + dp->dad_count = + dp->dad_ns_ocount + V_nd6_mmaxtries - 1; + nd6_dad_starttimer(dp, + (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000); + goto done; + } else { /* * We are done with DAD. No NA came, no NS came. * No duplicate address found. Check IFDISABLED flag @@ -1470,6 +1503,12 @@ nd6_dad_timer(struct dadq *dp) "%s: DAD complete for %s - no duplicates found\n", if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); + if (dp->dad_ns_lcount > 0) + log(LOG_ERR, "%s: DAD completed while " + "a looped back NS message is detected " + "during DAD for %s.\n", + if_name(ifa->ifa_ifp), + ip6_sprintf(ip6buf, IFA_IN6(ifa))); } } err: From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 21:42:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 551E9888; Thu, 5 Mar 2015 21:42:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EBE8CF9; Thu, 5 Mar 2015 21:42:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25Lg0Do094248; Thu, 5 Mar 2015 21:42:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25Lfx3O094238; Thu, 5 Mar 2015 21:41:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201503052141.t25Lfx3O094238@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 5 Mar 2015 21:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279677 - head/sys/arm/xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 21:42:00 -0000 Author: gonzo Date: Thu Mar 5 21:41:58 2015 New Revision: 279677 URL: https://svnweb.freebsd.org/changeset/base/279677 Log: Add sysctls to control PS-PL level shifters and FCLK settings. PL (programmable logic) uses FCLK0..FCLK3 as a clock sources. Normally they're configured by first stage boot loader (FSBL) and normal user never has to touch them. These sysctls may come useful for hardware developers hw.fpga.fclk.N.source: clock source (IO, DDR, ARM) hw.fpga.fclk.N.freq: requested frequency in Hz hw.fpga.fclk.N.actual_freq: actual frequency in Hz (R/O) hw.fgpa.level_shifters: 0/1 to enable/disable PS-PL level shifters, normally they're enabled either by FSBL or after programming FPGA through devcfg(4) Modified: head/sys/arm/xilinx/zy7_devcfg.c head/sys/arm/xilinx/zy7_slcr.c head/sys/arm/xilinx/zy7_slcr.h Modified: head/sys/arm/xilinx/zy7_devcfg.c ============================================================================== --- head/sys/arm/xilinx/zy7_devcfg.c Thu Mar 5 21:27:49 2015 (r279676) +++ head/sys/arm/xilinx/zy7_devcfg.c Thu Mar 5 21:41:58 2015 (r279677) @@ -72,10 +72,23 @@ struct zy7_devcfg_softc { bus_dmamap_t dma_map; int is_open; + + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; }; static struct zy7_devcfg_softc *zy7_devcfg_softc_p; +#define FCLK_NUM 4 + +struct zy7_fclk_config { + int source; + int frequency; + int actual_frequency; +}; + +static struct zy7_fclk_config fclk_configs[FCLK_NUM]; + #define DEVCFG_SC_LOCK(sc) mtx_lock(&(sc)->sc_mtx) #define DEVCFG_SC_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define DEVCFG_SC_LOCK_INIT(sc) \ @@ -103,13 +116,17 @@ static int zy7_ps_vers = 0; SYSCTL_INT(_hw, OID_AUTO, ps_vers, CTLFLAG_RD, &zy7_ps_vers, 0, "Zynq-7000 PS version"); +static int zy7_devcfg_fclk_sysctl_level_shifters(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_hw_fpga, OID_AUTO, level_shifters, + CTLFLAG_RW | CTLTYPE_INT, + NULL, 0, zy7_devcfg_fclk_sysctl_level_shifters, + "I", "Enable/disable level shifters"); /* cdev entry points. */ static int zy7_devcfg_open(struct cdev *, int, int, struct thread *); static int zy7_devcfg_write(struct cdev *, struct uio *, int); static int zy7_devcfg_close(struct cdev *, int, int, struct thread *); - struct cdevsw zy7_devcfg_cdevsw = { .d_version = D_VERSION, .d_open = zy7_devcfg_open, @@ -230,6 +247,151 @@ struct cdevsw zy7_devcfg_cdevsw = { #define ZY7_DEVCFG_XADCIF_RD_FIFO 0x114 #define ZY7_DEVCFG_XADCIF_MCTL 0x118 +static int +zy7_devcfg_fclk_sysctl_source(SYSCTL_HANDLER_ARGS) +{ + char buf[4]; + struct zy7_fclk_config *cfg; + int unit; + int error; + + cfg = arg1; + unit = arg2; + + switch (cfg->source) { + case ZY7_PL_FCLK_SRC_IO: + case ZY7_PL_FCLK_SRC_IO_ALT: + strncpy(buf, "IO", sizeof(buf)); + break; + case ZY7_PL_FCLK_SRC_DDR: + strncpy(buf, "DDR", sizeof(buf)); + break; + case ZY7_PL_FCLK_SRC_ARM: + strncpy(buf, "ARM", sizeof(buf)); + break; + default: + strncpy(buf, "???", sizeof(buf)); + break; + } + + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (strcasecmp(buf, "io") == 0) + cfg->source = ZY7_PL_FCLK_SRC_IO; + else if (strcasecmp(buf, "ddr") == 0) + cfg->source = ZY7_PL_FCLK_SRC_DDR; + else if (strcasecmp(buf, "arm") == 0) + cfg->source = ZY7_PL_FCLK_SRC_ARM; + else + return (EINVAL); + + zy7_pl_fclk_set_source(unit, cfg->source); + if (cfg->frequency > 0) + cfg->actual_frequency = zy7_pl_fclk_get_freq(unit); + + return (0); +} + +static int +zy7_devcfg_fclk_sysctl_freq(SYSCTL_HANDLER_ARGS) +{ + struct zy7_fclk_config *cfg; + int unit; + int error; + int freq; + int new_actual_freq; + + cfg = arg1; + unit = arg2; + + freq = cfg->frequency; + + error = sysctl_handle_int(oidp, &freq, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (freq > 0) { + new_actual_freq = zy7_pl_fclk_set_freq(unit, freq); + if (new_actual_freq < 0) + return (EINVAL); + if (!zy7_pl_fclk_enabled(unit)) + zy7_pl_fclk_enable(unit); + } + else { + zy7_pl_fclk_disable(unit); + new_actual_freq = 0; + } + + cfg->frequency = freq; + cfg->actual_frequency = new_actual_freq; + + return (0); +} + +static int +zy7_devcfg_fclk_sysctl_level_shifters(SYSCTL_HANDLER_ARGS) +{ + int error, enabled; + + enabled = zy7_pl_level_shifters_enabled(); + + error = sysctl_handle_int(oidp, &enabled, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (enabled) + zy7_pl_level_shifters_enable(); + else + zy7_pl_level_shifters_disable(); + + return (0); +} + +static int +zy7_devcfg_init_fclk_sysctl(struct zy7_devcfg_softc *sc) +{ + struct sysctl_oid *fclk_node; + char fclk_num[4]; + int i; + + sysctl_ctx_init(&sc->sysctl_tree); + sc->sysctl_tree_top = SYSCTL_ADD_NODE(&sc->sysctl_tree, + SYSCTL_STATIC_CHILDREN(_hw_fpga), OID_AUTO, "fclk", + CTLFLAG_RD, 0, ""); + if (sc->sysctl_tree_top == NULL) { + sysctl_ctx_free(&sc->sysctl_tree); + return (-1); + } + + for (i = 0; i < FCLK_NUM; i++) { + snprintf(fclk_num, sizeof(fclk_num), "%d", i); + fclk_node = SYSCTL_ADD_NODE(&sc->sysctl_tree, + SYSCTL_CHILDREN(sc->sysctl_tree_top), OID_AUTO, fclk_num, + CTLFLAG_RD, 0, ""); + + SYSCTL_ADD_INT(&sc->sysctl_tree, + SYSCTL_CHILDREN(fclk_node), OID_AUTO, + "actual_freq", CTLFLAG_RD, + &fclk_configs[i].actual_frequency, i, + "Actual frequency"); + SYSCTL_ADD_PROC(&sc->sysctl_tree, + SYSCTL_CHILDREN(fclk_node), OID_AUTO, + "freq", CTLFLAG_RW | CTLTYPE_INT, + &fclk_configs[i], i, + zy7_devcfg_fclk_sysctl_freq, + "I", "Configured frequency"); + SYSCTL_ADD_PROC(&sc->sysctl_tree, + SYSCTL_CHILDREN(fclk_node), OID_AUTO, + "source", CTLFLAG_RW | CTLTYPE_STRING, + &fclk_configs[i], i, + zy7_devcfg_fclk_sysctl_source, + "A", "Clock source"); + } + + return (0); +} /* Enable programming the PL through PCAP. */ static void @@ -334,7 +496,6 @@ zy7_dma_cb2(void *arg, bus_dma_segment_t *(bus_addr_t *)arg = seg[0].ds_addr; } - static int zy7_devcfg_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { @@ -474,10 +635,11 @@ zy7_devcfg_close(struct cdev *dev, int f bus_dma_tag_destroy(sc->dma_tag); DEVCFG_SC_UNLOCK(sc); + zy7_slcr_postload_pl(zy7_en_level_shifters); + return (0); } - static void zy7_devcfg_intr(void *arg) { @@ -549,6 +711,7 @@ static int zy7_devcfg_attach(device_t dev) { struct zy7_devcfg_softc *sc = device_get_softc(dev); + int i; int rid, err; /* Allow only one attach. */ @@ -612,6 +775,17 @@ zy7_devcfg_attach(device_t dev) ZY7_DEVCFG_MCTRL_PS_VERS_MASK) >> ZY7_DEVCFG_MCTRL_PS_VERS_SHIFT; + for (i = 0; i < FCLK_NUM; i++) { + fclk_configs[i].source = zy7_pl_fclk_get_source(i); + fclk_configs[i].actual_frequency = + zy7_pl_fclk_enabled(i) ? zy7_pl_fclk_get_freq(i) : 0; + /* Initially assume actual frequency is the configure one */ + fclk_configs[i].frequency = fclk_configs[i].actual_frequency; + } + + if (zy7_devcfg_init_fclk_sysctl(sc) < 0) + device_printf(dev, "failed to initialized sysctl tree\n"); + return (0); } @@ -620,6 +794,11 @@ zy7_devcfg_detach(device_t dev) { struct zy7_devcfg_softc *sc = device_get_softc(dev); + if (sc->sysctl_tree_top != NULL) { + sysctl_ctx_free(&sc->sysctl_tree); + sc->sysctl_tree_top = NULL; + } + if (device_is_attached(dev)) bus_generic_detach(dev); Modified: head/sys/arm/xilinx/zy7_slcr.c ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.c Thu Mar 5 21:27:49 2015 (r279676) +++ head/sys/arm/xilinx/zy7_slcr.c Thu Mar 5 21:41:58 2015 (r279677) @@ -79,7 +79,6 @@ extern void (*zynq7_cpu_reset); #define ZYNQ_DEFAULT_PS_CLK_FREQUENCY 33333333 /* 33.3 Mhz */ - SYSCTL_NODE(_hw, OID_AUTO, zynq, CTLFLAG_RD, 0, "Xilinx Zynq-7000"); static char zynq_bootmode[64]; @@ -126,7 +125,6 @@ zy7_slcr_lock(struct zy7_slcr_softc *sc) WR4(sc, ZY7_SLCR_LOCK, ZY7_SLCR_LOCK_MAGIC); } - static void zy7_slcr_cpu_reset(void) { @@ -255,6 +253,296 @@ cgem_set_ref_clk(int unit, int frequency return (0); } +/* + * PL clocks management function + */ +int +zy7_pl_fclk_set_source(int unit, int source) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + uint32_t reg; + + if (!sc) + return (-1); + + ZSLCR_LOCK(sc); + + /* Unlock SLCR registers. */ + zy7_slcr_unlock(sc); + + /* Modify FPGAx source. */ + reg = RD4(sc, ZY7_SLCR_FPGA_CLK_CTRL(unit)); + reg &= ~(ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK); + reg |= (source << ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT); + WR4(sc, ZY7_SLCR_FPGA_CLK_CTRL(unit), reg); + + /* Lock SLCR registers. */ + zy7_slcr_lock(sc); + + ZSLCR_UNLOCK(sc); + + return (0); +} + +int +zy7_pl_fclk_get_source(int unit) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + uint32_t reg; + int source; + + if (!sc) + return (-1); + + ZSLCR_LOCK(sc); + + /* Modify GEM reference clock. */ + reg = RD4(sc, ZY7_SLCR_FPGA_CLK_CTRL(unit)); + source = (reg & ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK) >> + ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT; + + /* ZY7_PL_FCLK_SRC_IO is actually b0x */ + if ((source & 2) == 0) + source = ZY7_PL_FCLK_SRC_IO; + + ZSLCR_UNLOCK(sc); + + return (source); +} + +int +zy7_pl_fclk_set_freq(int unit, int frequency) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + int div0, div1; + int base_frequency; + uint32_t reg; + int source; + + if (!sc) + return (-1); + + source = zy7_pl_fclk_get_source(unit); + switch (source) { + case ZY7_PL_FCLK_SRC_IO: + base_frequency = io_pll_frequency; + break; + + case ZY7_PL_FCLK_SRC_ARM: + base_frequency = arm_pll_frequency; + break; + + case ZY7_PL_FCLK_SRC_DDR: + base_frequency = ddr_pll_frequency; + break; + + default: + return (-1); + } + + /* Find suitable divisor pairs. Round result to nearest khz + * to test for match. + */ + for (div1 = 1; div1 <= ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX; div1++) { + div0 = (base_frequency + div1 * frequency / 2) / + div1 / frequency; + if (div0 > 0 && div0 <= ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX && + ((base_frequency / div0 / div1) + 500) / 1000 == + (frequency + 500) / 1000) + break; + } + + if (div1 > ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX) + return (-1); + + ZSLCR_LOCK(sc); + + /* Unlock SLCR registers. */ + zy7_slcr_unlock(sc); + + /* Modify FPGAx reference clock. */ + reg = RD4(sc, ZY7_SLCR_FPGA_CLK_CTRL(unit)); + reg &= ~(ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK | + ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK); + reg |= (div1 << ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT) | + (div0 << ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT); + WR4(sc, ZY7_SLCR_FPGA_CLK_CTRL(unit), reg); + + /* Lock SLCR registers. */ + zy7_slcr_lock(sc); + + ZSLCR_UNLOCK(sc); + + return (base_frequency / div0 / div1); +} + +int +zy7_pl_fclk_get_freq(int unit) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + int div0, div1; + int base_frequency; + int frequency; + uint32_t reg; + int source; + + if (!sc) + return (-1); + + source = zy7_pl_fclk_get_source(unit); + switch (source) { + case ZY7_PL_FCLK_SRC_IO: + base_frequency = io_pll_frequency; + break; + + case ZY7_PL_FCLK_SRC_ARM: + base_frequency = arm_pll_frequency; + break; + + case ZY7_PL_FCLK_SRC_DDR: + base_frequency = ddr_pll_frequency; + break; + + default: + return (-1); + } + + ZSLCR_LOCK(sc); + + /* Modify FPGAx reference clock. */ + reg = RD4(sc, ZY7_SLCR_FPGA_CLK_CTRL(unit)); + div1 = (reg & ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK) >> + ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT; + div0 = (reg & ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK) >> + ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT; + + ZSLCR_UNLOCK(sc); + + if (div0 == 0) + div0 = 1; + + if (div1 == 0) + div1 = 1; + + frequency = (base_frequency / div0 / div1); + /* Round to KHz */ + frequency = (frequency + 500) / 1000; + frequency = frequency * 1000; + + return (frequency); +} + +int +zy7_pl_fclk_enable(int unit) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + + if (!sc) + return (-1); + + ZSLCR_LOCK(sc); + + /* Unlock SLCR registers. */ + zy7_slcr_unlock(sc); + + WR4(sc, ZY7_SLCR_FPGA_THR_CTRL(unit), 0); + WR4(sc, ZY7_SLCR_FPGA_THR_CNT(unit), 0); + + /* Lock SLCR registers. */ + zy7_slcr_lock(sc); + + ZSLCR_UNLOCK(sc); + + return (0); +} + +int +zy7_pl_fclk_disable(int unit) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + + if (!sc) + return (-1); + + ZSLCR_LOCK(sc); + + /* Unlock SLCR registers. */ + zy7_slcr_unlock(sc); + + WR4(sc, ZY7_SLCR_FPGA_THR_CTRL(unit), 0); + WR4(sc, ZY7_SLCR_FPGA_THR_CNT(unit), 1); + + /* Lock SLCR registers. */ + zy7_slcr_lock(sc); + + ZSLCR_UNLOCK(sc); + + return (0); +} + +int +zy7_pl_fclk_enabled(int unit) +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + uint32_t reg; + + if (!sc) + return (-1); + + ZSLCR_LOCK(sc); + reg = RD4(sc, ZY7_SLCR_FPGA_THR_CNT(unit)); + ZSLCR_UNLOCK(sc); + + return !(reg & 1); +} + +int +zy7_pl_level_shifters_enabled() +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + + uint32_t reg; + + if (!sc) + return (-1); + + ZSLCR_LOCK(sc); + reg = RD4(sc, ZY7_SLCR_LVL_SHFTR_EN); + ZSLCR_UNLOCK(sc); + + return (reg == ZY7_SLCR_LVL_SHFTR_EN_ALL); +} + +void +zy7_pl_level_shifters_enable() +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + + if (!sc) + return; + + ZSLCR_LOCK(sc); + zy7_slcr_unlock(sc); + WR4(sc, ZY7_SLCR_LVL_SHFTR_EN, ZY7_SLCR_LVL_SHFTR_EN_ALL); + zy7_slcr_lock(sc); + ZSLCR_UNLOCK(sc); +} + +void +zy7_pl_level_shifters_disable() +{ + struct zy7_slcr_softc *sc = zy7_slcr_softc_p; + + if (!sc) + return; + + ZSLCR_LOCK(sc); + zy7_slcr_unlock(sc); + WR4(sc, ZY7_SLCR_LVL_SHFTR_EN, 0); + zy7_slcr_lock(sc); + ZSLCR_UNLOCK(sc); +} + static int zy7_slcr_probe(device_t dev) { Modified: head/sys/arm/xilinx/zy7_slcr.h ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.h Thu Mar 5 21:27:49 2015 (r279676) +++ head/sys/arm/xilinx/zy7_slcr.h Thu Mar 5 21:41:58 2015 (r279677) @@ -37,7 +37,6 @@ * are in appendix B.28. */ - #ifndef _ZY7_SLCR_H_ #define _ZY7_SLCR_H_ @@ -148,10 +147,19 @@ #define ZY7_SLCR_DBG_CLK_CTRL 0x0164 #define ZY7_SLCR_PCAP_CLK_CTRL 0x0168 #define ZY7_SLCR_TOPSW_CLK_CTRL 0x016c /* central intercnn clk ctrl */ -#define ZY7_SLCR_FPGA0_CLK_CTRL 0x0170 -#define ZY7_SLCR_FPGA1_CLK_CTRL 0x0180 -#define ZY7_SLCR_FPGA2_CLK_CTRL 0x0190 -#define ZY7_SLCR_FPGA3_CLK_CTRL 0x01a0 +#define ZY7_SLCR_FPGA_CLK_CTRL(unit) (0x0170 + 0x10*(unit)) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT 20 +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT 8 +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX 0x3f +#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT 4 +#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK (3 << 4) +#define ZY7_SLCR_FPGA_THR_CTRL(unit) (0x0174 + 0x10*(unit)) +#define ZY7_SLCR_FPGA_THR_CTRL_CNT_RST (1 << 1) +#define ZY7_SLCR_FPGA_THR_CTRL_CPU_START (1 << 0) +#define ZY7_SLCR_FPGA_THR_CNT(unit) (0x0178 + 0x10*(unit)) +#define ZY7_SLCR_FPGA_THR_STA(unit) (0x017c + 0x10*(unit)) #define ZY7_SLCR_CLK_621_TRUE 0x01c4 /* cpu clock ratio mode */ /* Reset controls. */ @@ -288,5 +296,23 @@ extern void zy7_slcr_preload_pl(void); extern void zy7_slcr_postload_pl(int en_level_shifters); extern int cgem_set_ref_clk(int unit, int frequency); + +/* Should be consistent with SRCSEL field of FPGAx_CLK_CTRL */ +#define ZY7_PL_FCLK_SRC_IO 0 +#define ZY7_PL_FCLK_SRC_IO_ALT 1 /* ZY7_PL_FCLK_SRC_IO is b0x */ +#define ZY7_PL_FCLK_SRC_ARM 2 +#define ZY7_PL_FCLK_SRC_DDR 3 + +int zy7_pl_fclk_set_source(int unit, int source); +int zy7_pl_fclk_get_source(int unit); +int zy7_pl_fclk_set_freq(int unit, int freq); +int zy7_pl_fclk_get_freq(int unit); +int zy7_pl_fclk_enable(int unit); +int zy7_pl_fclk_disable(int unit); +int zy7_pl_fclk_enabled(int unit); +int zy7_pl_level_shifters_enabled(void); +void zy7_pl_level_shifters_enable(void); +void zy7_pl_level_shifters_disable(void); + #endif #endif /* _ZY7_SLCR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 22:17:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4D7D345; Thu, 5 Mar 2015 22:17:24 +0000 (UTC) Received: from mail-out.smeets.im (mail-out.smeets.im [IPv6:2a01:4f8:160:918a::25:11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 716349C; Thu, 5 Mar 2015 22:17:24 +0000 (UTC) Received: from mail.smeets.im (mail.smeets.im [IPv6:2a01:4f8:160:918a::25:3]) by mail-out.smeets.im (Postfix) with ESMTP id 14B84103C; Thu, 5 Mar 2015 23:17:21 +0100 (CET) Received: from amavis.smeets.im (amavis.smeets.im [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.im (Postfix) with ESMTP id 63958892BC; Thu, 5 Mar 2015 23:17:21 +0100 (CET) X-Virus-Scanned: amavisd-new at smeets.im Received: from mail.smeets.im ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.im (amavis.smeets.im [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id 2qv2UULc5XGd; Thu, 5 Mar 2015 23:17:21 +0100 (CET) Received: from nibbler-wlan.home.lan (unknown [85.22.115.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.smeets.im (Postfix) with ESMTPSA id 62735892AF; Thu, 5 Mar 2015 23:17:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=smeets.im; s=default; t=1425593840; bh=FEaN/9izl9S/esAQy1m0UxPa0w4B0W0KgVuKZ6RCAWY=; h=Subject:To:references:From:Date:in-reply-to; b=rTounzWD8SGqZz6BMJRNb4Y0mFStd8Hokq02ZhHKqHyL4Ig9gSVMlwR08iSgkyDfh PLILZ7LYCOtnIGlcswIj7ajo2cNDSXdAx7K7quJtdwbvCAU2UgjQYfNg83VwhKQBha g5UvJBChdlcPbmw4YNemWFyz46FHrtMjuzMDLmKI= Subject: Re: svn commit: r279588 - head/sys/netinet6 To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org references: <201503041120.t24BK2SG000709@svn.freebsd.org> From: Florian Smeets message-id: <54F8D5EC.8030800@smeets.im> Date: Thu, 5 Mar 2015 23:17:16 +0100 user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0a2 mime-version: 1.0 in-reply-to: <201503041120.t24BK2SG000709@svn.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QkPH8RHrE0JG75jXw33tsMMoV2WFBfCCB" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 22:17:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QkPH8RHrE0JG75jXw33tsMMoV2WFBfCCB Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 04.03.15 12:20, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Mar 4 11:20:01 2015 > New Revision: 279588 > URL: https://svnweb.freebsd.org/changeset/base/279588 >=20 > Log: > Fix deadlock in IPv6 PCB code. > =20 Hi, everything I'm going to mention is running world/kernel @r279675. I have a host running a couple of IPv6 only bhyves. It looks like I can e= asily panic them when trying to ssh into them. With my limited understand= ing I'd say the stack trace points to this commit. All the tap interfaces used by the bhyves are connected to one bridge int= erface. Every bhyve has its own IPv6 address configured on vtnet0. The br= idge interface on the host has an IPv6 address which is the default gatew= ay in all the bhyves. Let me know if you need anything else. It seems to be quite easy to repro= duce. Fatal trap 12: page fault while in kernel mode cpuid =3D 6; apic id =3D 06 fault virtual address =3D 0x0 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff80bda224 stack pointer =3D 0x28:0xfffffe01efbfd330 frame pointer =3D 0x28:0xfffffe01efbfd3d0 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 12 (irq265: virtio_pci0) [ thread pid 12 tid 100036 ] Stopped at in6_pcbnotify+0x254: movl (%rax),%edx db> where Tracing pid 12 tid 100036 td 0xfffff800063d0000 in6_pcbnotify() at in6_pcbnotify+0x254/frame 0xfffffe01efbfd3d0 tcp6_ctlinput() at tcp6_ctlinput+0xf0/frame 0xfffffe01efbfd470 icmp6_input() at icmp6_input+0x18d4/frame 0xfffffe01efbfd660 ip6_input() at ip6_input+0x488/frame 0xfffffe01efbfd740 netisr_dispatch_src() at netisr_dispatch_src+0x61/frame 0xfffffe01efbfd7b= 0 ether_demux() at ether_demux+0x15d/frame 0xfffffe01efbfd7e0 ether_nh_input() at ether_nh_input+0x377/frame 0xfffffe01efbfd840 netisr_dispatch_src() at netisr_dispatch_src+0x61/frame 0xfffffe01efbfd8b= 0 ether_input() at ether_input+0x26/frame 0xfffffe01efbfd8d0 vtnet_rxq_eof() at vtnet_rxq_eof+0x7ab/frame 0xfffffe01efbfd9a0 vtnet_rx_vq_intr() at vtnet_rx_vq_intr+0x94/frame 0xfffffe01efbfd9e0 intr_event_execute_handlers() at intr_event_execute_handlers+0x1d8/frame = 0xfffffe01efbfda20 ithread_loop() at ithread_loop+0x9c/frame 0xfffffe01efbfda70 fork_exit() at fork_exit+0x9a/frame 0xfffffe01efbfdab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01efbfdab0 --- trap 0, rip =3D 0, rsp =3D 0xfffffe01efbfdb70, rbp =3D 0 --- (kgdb) list *0xffffffff80bda224 0xffffffff80bda224 is in in6_pcbnotify (/usr/src/sys/netinet6/in6_pcb.c:6= 49). 644 * and the application (associated with this sock= et) wanted to 645 * know the value, notify. 646 * XXX: should we avoid to notify the value to TC= P sockets? 647 */ 648 if (cmd =3D=3D PRC_MSGSIZE) 649 ip6_notify_pmtu(inp, (struct sockaddr_in6= *)dst, 650 *(u_int32_t *)cmdarg); 651 652 /* 653 * Detect if we should notify the error. If no so= urce and (kgdb) print dst $5 =3D (struct sockaddr *) 0xfffffe01efbfd590 (kgdb) print notify $6 =3D (struct inpcb *(*)(struct inpcb *, int)) 0xffffffff80bb5220 Florian --QkPH8RHrE0JG75jXw33tsMMoV2WFBfCCB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2 iQJ8BAEBCgBmBQJU+NXvXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNzAxMDMyMDNCQ0FCNDRBOThGRUM4NDRF NzA1M0RGOUZGODZGMDc2AAoJEOcFPfn/hvB2sWMP/2piGQjkX0lH7L4sA8PdRugU Mh/8AEGx5/oYClQEOu6ZlVi7q8ftKc55JgEXqGLXWDfQXGlR/ZJqjcntqGym/D0L n0V6F+FbnkwTRN0Dw2bONYHdyfZnt6iDJM7MOme2AumOTZ0AQvvvqJvcTWz5Zv8j XYZVJ2YqO9x+Buh/1012nWvG8K3+bseaBodRKQVfOXSd9MkxgSZ3d5oeAMTeYhME enOuaD5s+LSbJogz1KzwOwmPu3weg8ew/KOrLBov9qZtyl8qqWidFRb98biJgOEK ekHDRnsZSjx/kSR3liPUH11ydGcBsP2ZjHhrTHzCjXhYb9AqCWFJgd3ld6jkyyS5 EUhP3K2u6bsoL6GCmeJzdZds6rUQUBzTGhN1xwpq8bEX0ibiGH3OnJxP1LKAKoBP xMC8QCuOdPJo614PVgGT3xyy/7GzDTMN4LHMjGCZR9A/MMJseiSkw3QZHQlicJBo opMpu4b4Osc7WR+PHlx/ZpDatFicjSd7LhiWLOEV35n1BE4GVSmn1mxuRnzEpwk+ QwLTyyM1v34RyWs8eb924NVbOTFfwTcYj/kSVhkYaoy+HdAXT9+XIazgYXWp7Vvx Hb6Nk7PH/uabpFrnxg0Q31mD9ibiDxLkMNPjbZfUCW0egfft0dhthho5sx0bAYOc 89wc7iXq569qA+93KEOn =jKqm -----END PGP SIGNATURE----- --QkPH8RHrE0JG75jXw33tsMMoV2WFBfCCB-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 01:15:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 066BAF1A; Fri, 6 Mar 2015 01:15:13 +0000 (UTC) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2A661D; Fri, 6 Mar 2015 01:15:12 +0000 (UTC) X-AuditID: 1209190c-f79696d000005933-97-54f8ff985499 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 84.23.22835.89FF8F45; Thu, 5 Mar 2015 20:15:04 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id t261F3lf032013; Thu, 5 Mar 2015 20:15:03 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id t261F0Tj027426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 5 Mar 2015 20:15:01 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id t261Ex84016617; Thu, 5 Mar 2015 20:14:59 -0500 (EST) Date: Thu, 5 Mar 2015 20:14:59 -0500 (EST) From: Benjamin Kaduk To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh In-Reply-To: <20150305151732.GA48476@zxy.spb.ru> Message-ID: References: <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> <20150305144056.GY48476@zxy.spb.ru> <20150305151732.GA48476@zxy.spb.ru> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPIsWRmVeSWpSXmKPExsUixG6nrjvj/48Qg1OThC2OPTzKbjHhdbTF n/YpLBZ/Ni1ktWj6soDJgdVjxqf5LB47Z91l9/h5WiiAOYrLJiU1J7MstUjfLoErY+mN96wF vUIVX2Y+Z21g3M7XxcjBISFgIrF+vmYXIyeQKSZx4d56NhBbSGAxk8SjM8ldjFxA9gZGiZ9n d7NBOAeZJJr+9zFCVNVLvHt3mAnEZhHQknjx5jRYN5uAisTMNxvBbBEBdYm1X2+DNTMLvGCU aDo8D6xZWCBA4sHyPrBmTgEDia3LdrKA2LwCDhI9ixqgtr1klvhz9RzYJFEBHYnV+6dAFQlK nJz5BMxmBtq8fPo2lgmMgrOQpGYhSS1gZFrFKJuSW6Wbm5iZU5yarFucnJiXl1qka6iXm1mi l5pSuokRFM6ckjw7GN8cVDrEKMDBqMTDO2Pj9xAh1sSy4srcQ4ySHExKoryyv36ECPEl5adU ZiQWZ8QXleakFh9ilOBgVhLhTfsClONNSaysSi3Kh0lJc7AoifNu+sEXIiSQnliSmp2aWpBa BJOV4eBQkuBV/gfUKFiUmp5akZaZU4KQZuLgBBnOAzS8BKSGt7ggMbc4Mx0if4pRUUqctxMk IQCSyCjNg+uFpZtXjOJArwjzfgCp4gGmKrjuV0CDmYAGa4mBDS5JREhJNTAWMHJ/4RUUvMgS XyO5dcfS3kP1/PEllXLTEk8s/7ue9+pkHT2nsFAGrfOWwpOET55O6jPPfrS08S8f12mZYz2X l77/8m2f8bPkvccWrpbfY2p6s/PiNoU7bhbnSv/s/MJY5uhuoNCSGhcQ/uf9x8chOYuUdgX8 a7cxmf8mSuba0l8vcj8XWE9WYinOSDTUYi4qTgQAnLNskhIDAAA= Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 01:15:13 -0000 On Thu, 5 Mar 2015, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 10:11:43AM -0500, Benjamin Kaduk wrote: > > > On Thu, Mar 5, 2015 at 9:40 AM, Slawa Olhovchenkov wrote: > > > > Speaking as an upstream maintainer: don't use kerberized telnet. > > I am use this for test kerberos setup (check all setup correctly). I use ssh to test kerberos setups (I think sshd has better error message, for one). The problem with using telnet to test the kerberos setup is that if your kerberos setup works with telnet, you have the DES enctypes (weak cryptography) enabled. This means that the whole setup, even things other than telnet, are suffering from the vulnerabilities of weak crypto. Kerberos distributions have disabled DES by default for many years, now -- Apple has even completely removed the code for them from recent releases of OS X! Please see RFC 6649. > > I use kerberized ssh all the time; please tell me more about how it is > > broken (a new thread would be best). > > kerberized ssh broken in SSO mode: you can't do ssh login to I have a very different idea of what "SSO mode" means: I run kinit on my local machine and then use kerberos to authenticate to remote services. I should never type my password at something which is not a trusted local binary. > kerberized host (from outside world), input kerberos password and use > kerberos ticket. "input kerberos password and use kerberos ticket" doesn't make sense -- you are not using your kerberos ticket; you are using your password. PAM is going off and getting a ticket, sure (and hopefully validating it against the host keytab to avoid the Zanarotti attack!), but it is starting with your password. That is completely at odds with how Kerberos is intended to be used. > This is issuse between PAM and ssh thread emulation. It does seem likely that this sort of thing would be an issue with PAM, yes. I am not particularly motivated to look into it, though. I do recall some issue where sshd in capsicum mode was not allowed to read the keytab in order to verify the supplied Kerberos credentials, which required using UsePrivilegeSeparation=yes instead of the default value (sandbox). Perhaps that would affect the password mode of operation as well. -Ben From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 02:05:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E93061D; Fri, 6 Mar 2015 02:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F0AAD8; Fri, 6 Mar 2015 02:05:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2625jCl024687; Fri, 6 Mar 2015 02:05:45 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2625jSG024686; Fri, 6 Mar 2015 02:05:45 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201503060205.t2625jSG024686@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Fri, 6 Mar 2015 02:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279683 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 02:05:46 -0000 Author: tychon Date: Fri Mar 6 02:05:45 2015 New Revision: 279683 URL: https://svnweb.freebsd.org/changeset/base/279683 Log: When ICW1 is issued the edge sense circuit is reset which means that following an initialization a low-to-high transistion is necesary to generate an interrupt. Reviewed by: neel Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Fri Mar 6 00:24:21 2015 (r279682) +++ head/sys/amd64/vmm/io/vatpic.c Fri Mar 6 02:05:45 2015 (r279683) @@ -275,6 +275,7 @@ vatpic_icw1(struct vatpic *vatpic, struc atpic->ready = false; atpic->icw_num = 1; + atpic->request = 0; atpic->mask = 0; atpic->lowprio = 7; atpic->rd_cmd_reg = 0; From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 05:50:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4BCC27A; Fri, 6 Mar 2015 05:50:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A087A1DE; Fri, 6 Mar 2015 05:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t265oeZr030385; Fri, 6 Mar 2015 05:50:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t265oexx030384; Fri, 6 Mar 2015 05:50:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503060550.t265oexx030384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 6 Mar 2015 05:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279684 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 05:50:40 -0000 Author: ae Date: Fri Mar 6 05:50:39 2015 New Revision: 279684 URL: https://svnweb.freebsd.org/changeset/base/279684 Log: tcp6_ctlinput() doesn't pass MTU value to in6_pcbnotify(). Check cmdarg isn't NULL before dereference, this check was in the ip6_notify_pmtu() before r279588. Reported by: Florian Smeets MFC after: 1 week Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Fri Mar 6 02:05:45 2015 (r279683) +++ head/sys/netinet6/in6_pcb.c Fri Mar 6 05:50:39 2015 (r279684) @@ -645,7 +645,7 @@ in6_pcbnotify(struct inpcbinfo *pcbinfo, * know the value, notify. * XXX: should we avoid to notify the value to TCP sockets? */ - if (cmd == PRC_MSGSIZE) + if (cmd == PRC_MSGSIZE && cmdarg != NULL) ip6_notify_pmtu(inp, (struct sockaddr_in6 *)dst, *(u_int32_t *)cmdarg); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 07:29:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB7DAC29; Fri, 6 Mar 2015 07:29:50 +0000 (UTC) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31D31C98; Fri, 6 Mar 2015 07:29:49 +0000 (UTC) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id t267TVHV027661; Fri, 6 Mar 2015 08:29:31 +0100 (CET) (envelope-from h.schmalzbauer@omnilan.de) Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net [IPv6:2001:a60:f0bb:1::3:1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id AE6EAE17; Fri, 6 Mar 2015 08:29:30 +0100 (CET) Message-ID: <54F95751.1060303@omnilan.de> Date: Fri, 06 Mar 2015 08:29:21 +0100 From: Harald Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <54F89E97.9040203@beastielabs.net> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8EF7417D0A0A2A9C417223CD" X-Greylist: ACL 119 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 06 Mar 2015 08:29:31 +0100 (CET) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, Hans Ottevanger , Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 07:29:50 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8EF7417D0A0A2A9C417223CD Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Bez=FCglich Garrett Cooper's Nachricht vom 05.03.2015 19:47 (localtime):= > On Mar 5, 2015, at 10:21, Hans Ottevanger wrote:= > >> On 03/05/15 13:21, Slawa Olhovchenkov wrote: >>> On Thu, Mar 05, 2015 at 02:48:29PM +0300, Gleb Smirnoff wrote: >>> >>>> On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: >>>> B> Author: bapt >>>> B> Date: Wed Mar 4 22:01:44 2015 >>>> B> New Revision: 279603 >>>> B> URL: https://svnweb.freebsd.org/changeset/base/279603 >>>> B> >>>> B> Log: >>>> B> r* commands are not precious anymore >>>> B> >>>> B> Modified: >>>> B> head/bin/rcp/Makefile >>>> B> head/usr.bin/rlogin/Makefile >>>> >>>> I guess when they are going to be not precious enough to be removed?= :) >>>> >>>> In modern world of ssh and https, does any OS require them in base? >>> yes. >>> Some telecom equipment require rlogin. >>> _______________________________________________ >> Considering that the r-commands are not particularly large and also no= t really a maintenance nightmare, a would just keep them. They are (still= ) more or less part of the standard Unix toolbox, as perceived by end-use= rs, and you had better not make life too difficult for them. The same is = true for telnet. >> >> I see these tools in use regularly, e.g. to control measurement equipm= ent programmatically. Due to the price tag of those instruments, that won= 't change overnight. The usage is limited to a LAN however, nobody I know= uses these tools over the public Internet anymore. >> >> As far as I know only OpenBSD got rid of these tools up to now. Most o= ther Unix(-like) systems still have them. >> >> And if they absolutely have to go, what happens to the corresponding d= aemons in /usr/libexec (rshd and rlogind)? > Why not just move them to ports so the people that need them can have t= hem=85? Installing ports on non-internet-connected machines, where you have your self-brew pakcgae carried to the destination machine via scp or disk or UFD, is a nightmare. We do not have pkg(8) in base. pkg(8) has circular dependency on itself and every once in a while I have hassels with my build hosts because ports infrastructre inists on a different pkg(8) version :-( Before pkg(8) is in base, moving any thing from base to ports is no option IMHO. I use rsh(1) for zfs management over LAN (most times dedicated SAN VLAN). rsh(1) makes great zfs-snapshot-based backup-push methods easily deployable! rlogin/telnet is nice to have for novices, reading ancient Unix/FreeBSD/nameit books and getting in first contact, IMHO. I need, rsh(1) please don't touch, we have "WITHOUT_RCMDS" for src.conf(5), which I also use, but for completely different setups. Regarding telnet(1) vs. nc(1): I can't second that nc(1) isn't _the_ appropriate tool for network connection testings. telnet(1) is often absued for such tests, but that's not what it's intended for, nc(1) does the job! Nevertheless, I vote for keeping telnet(1) in base. Thanks, -Harry --------------enig8EF7417D0A0A2A9C417223CD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAlT5V1YACgkQLDqVQ9VXb8jEvgCdGZ0uHDOD8uJOf4YYZ6ISFfBp bs0AoMpUIjUVZ1FJaa/cz+4qzrMuIMbg =IimJ -----END PGP SIGNATURE----- --------------enig8EF7417D0A0A2A9C417223CD-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 08:09:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62A48175 for ; Fri, 6 Mar 2015 08:09:50 +0000 (UTC) Received: from server1.xenet.de (server1.xenet.de [213.221.94.201]) by mx1.freebsd.org (Postfix) with ESMTP id CC0999F for ; Fri, 6 Mar 2015 08:09:49 +0000 (UTC) Received: from [10.0.0.32] (intern.xenet.de [213.221.94.50]) (authenticated bits=0) by server1.xenet.de (8.12.5/8.12.5) with ESMTP id t268171h054446 for ; Fri, 6 Mar 2015 09:01:10 +0100 (CET) (envelope-from meyser@xenet.de) Message-ID: <54F960B9.8090508@xenet.de> Date: Fri, 06 Mar 2015 09:09:29 +0100 From: Matthias Meyser Organization: XeNET GmbH, Clausthal-Zellerfeld User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> In-Reply-To: <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.38 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 08:09:50 -0000 Am 05.03.2015 um 15:04 schrieb Dmitry Sivachenko: > >> On 5 марта 2015 г., at 15:35, Gleb Smirnoff wrote: >> >> On Thu, Mar 05, 2015 at 03:33:50PM +0300, Slawa Olhovchenkov wrote: >> S> > On Thu, Mar 05, 2015 at 03:30:16PM +0300, Slawa Olhovchenkov wrote: >> S> > S> > On Thu, Mar 05, 2015 at 03:21:03PM +0300, Slawa Olhovchenkov wrote: >> S> > S> > S> > On Wed, Mar 04, 2015 at 10:01:45PM +0000, Baptiste Daroussin wrote: >> S> > S> > S> > B> Author: bapt >> S> > S> > S> > B> Date: Wed Mar 4 22:01:44 2015 >> S> > S> > S> > B> New Revision: 279603 >> S> > S> > S> > B> URL: https://svnweb.freebsd.org/changeset/base/279603 >> S> > S> > S> > B> >> S> > S> > S> > B> Log: >> S> > S> > S> > B> r* commands are not precious anymore >> S> > S> > S> > B> >> S> > S> > S> > B> Modified: >> S> > S> > S> > B> head/bin/rcp/Makefile >> S> > S> > S> > B> head/usr.bin/rlogin/Makefile >> S> > S> > S> > >> S> > S> > S> > I guess when they are going to be not precious enough to be removed? :) >> S> > S> > S> > >> S> > S> > S> > In modern world of ssh and https, does any OS require them in base? >> S> > S> > S> >> S> > S> > S> yes. >> S> > S> > S> Some telecom equipment require rlogin. >> S> > S> > >> S> > S> > Other telecom equipment require a JRE and special .jar to >> S> > S> > configure them. Does that mean operating systems must ship >> S> > S> > them? >> S> > S> >> S> > S> Yes, if ships before (don't break if working). >> S> > S> Some Linux distro remove telnet from default install. >> S> > S> Do you like to remove telnet also? >> S> > >> S> > Yes. >> S> >> S> And how to test open/listing ports/sockets?! >> >> nc(1), which is a pure socket testing tool. For telnet(1) this >> capability is a side effect. >> >> S> How to connect to mpd control socket?! >> >> pkg install mpd5 telnet >> > > OMG, please do not make nightmare one have on Linux or Solaris. Everything can be installed form packages but it is so inconvenient! > > It is so nice to have most useful stuff out of the box. Does it hurt you? Having all these things in base is so cool, please do not make Lego constructor everyone must use. > Disks are so large and cheap these days. +1 Most important reason NOT to swicth to Linux. - Matthias -- Matthias Meyser | XeNET GmbH Tel.: +49-5323-9489050 | 38678 Clausthal-Zellerfeld, Marktstrasse 40 Fax: +49-5323-9489059 | Registergericht: Amtsgericht Braunschweig HRB 110823 Email: Meyser@xenet.de | Geschaeftsfuehrer: Matthias Meyser From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 08:37:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E35C681D for ; Fri, 6 Mar 2015 08:37:56 +0000 (UTC) Received: from server1.xenet.de (server1.xenet.de [213.221.94.201]) by mx1.freebsd.org (Postfix) with ESMTP id 63D9E3C7 for ; Fri, 6 Mar 2015 08:37:55 +0000 (UTC) Received: from [10.0.0.32] (intern.xenet.de [213.221.94.50]) (authenticated bits=0) by server1.xenet.de (8.12.5/8.12.5) with ESMTP id t268TI1h055838 for ; Fri, 6 Mar 2015 09:29:22 +0100 (CET) (envelope-from meyser@xenet.de) Message-ID: <54F96753.50002@xenet.de> Date: Fri, 06 Mar 2015 09:37:39 +0100 From: Matthias Meyser Organization: XeNET GmbH, Clausthal-Zellerfeld User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <54F8ACDF.70305@freebsd.org> In-Reply-To: <54F8ACDF.70305@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.38 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 08:37:57 -0000 Am 05.03.2015 um 20:22 schrieb Alfred Perlstein: > > > On 3/5/15 6:09 AM, David Chisnall wrote: >> On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: >> >>> It is so nice to have most useful stuff out of the box. >> The question is whether a tool for logging into remote machines without >> encryption is 'the most useful stuff'. The tool is also [ab]used for >> network testing, but we already provide a better tool for that in the form >> of nc(1). >> >> David >> >> > Agree. > > Moving it out of base +1000. > > It's time we made FreeBSD into an actual distro which is what is happening > anyhow. > > This is a great time! If Freebsd ever happens to mutate into something like the normal Linux Distro dependency hell (Lego Constructor) then I would really considering switching to one of that Linux Distros. One compelling reason to stay on Freebsd is the "most complete" base system. When this goes away there is only left: Better hardware support on Linux. Bigger Community, more support for Linux. That would be an easy decision. - matthias -- Matthias Meyser | XeNET GmbH Tel.: +49-5323-9489050 | 38678 Clausthal-Zellerfeld, Marktstrasse 40 Fax: +49-5323-9489059 | Registergericht: Amtsgericht Braunschweig HRB 110823 Email: Meyser@xenet.de | Geschaeftsfuehrer: Matthias Meyser From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 09:05:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F27B1D59; Fri, 6 Mar 2015 09:05:29 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67AAE8C6; Fri, 6 Mar 2015 09:05:29 +0000 (UTC) Received: by labgq15 with SMTP id gq15so2342886lab.13; Fri, 06 Mar 2015 01:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Ax5DA/MvEu0pwjSEQkdyQb3ieERu6Ep4B0o1OJEYeBQ=; b=kewiYfQFTp/nsmy/iXJFRgsJRsA3z4lUWraXyRq8fPYiT1hAAv3B1OZMhvmvrogQSR 4zqS8RLdJwXkeA2wzas6ojHD1NhtWdMG9ThnxDx0zumUryL1lEpRvXbXzmZg23usoXxe 8h9HO4dL7DXqvXJ9st4B6mzaRADwQeZXm+cEooUub1ulCnpR81PDfCbNDzyyJnfeV1x+ c2e7tmJqtOh1CNvrOVTtsVZrwL+YtgR7N2wiquU/iut+oj4pw4EX6BgmdkryWa8Mf5gT v3YuGCnDO1/hxr5Zw7QuM9EOxEMk03gaKulU9NdDY1ZpFq4G38ZO5gZ+ReRdIOvPdFE/ my4g== X-Received: by 10.112.198.66 with SMTP id ja2mr11637790lbc.39.1425632727240; Fri, 06 Mar 2015 01:05:27 -0800 (PST) Received: from [10.0.1.7] (broadband-5-228-253-252.nationalcablenetworks.ru. [5.228.253.252]) by mx.google.com with ESMTPSA id k3sm1692690lah.40.2015.03.06.01.05.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Mar 2015 01:05:25 -0800 (PST) Sender: Dmitry Sivachenko Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh From: Dmitry Sivachenko In-Reply-To: <54F8ACDF.70305@freebsd.org> Date: Fri, 6 Mar 2015 12:05:23 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <1735F6FC-02CD-48FC-BE88-47CB68748988@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <54F8ACDF.70305@freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.2070.6) Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 09:05:30 -0000 > On 5 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., at 22:22, Alfred = Perlstein wrote: >=20 >=20 >=20 > On 3/5/15 6:09 AM, David Chisnall wrote: >> On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: >>=20 >>> It is so nice to have most useful stuff out of the box. >> The question is whether a tool for logging into remote machines = without encryption is 'the most useful stuff'. The tool is also = [ab]used for network testing, but we already provide a better tool for = that in the form of nc(1). >>=20 >> David >>=20 >>=20 > Agree. >=20 > Moving it out of base +1000. >=20 > It's time we made FreeBSD into an actual distro which is what is = happening anyhow. >=20 > This is a great time! This would become a new fool's day, really. Don't act like a monkey copying other's bad decisions. Having rich base system always were one of FreeBSD's strength, please = don't break it. From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 09:22:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5ADEB174; Fri, 6 Mar 2015 09:22:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C359A94; Fri, 6 Mar 2015 09:22:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t269M7F2027803; Fri, 6 Mar 2015 09:22:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t269M6x3027800; Fri, 6 Mar 2015 09:22:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503060922.t269M6x3027800@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Mar 2015 09:22:06 +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: r279685 - in stable/10/sys: fs/devfs kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 09:22:07 -0000 Author: kib Date: Fri Mar 6 09:22:05 2015 New Revision: 279685 URL: https://svnweb.freebsd.org/changeset/base/279685 Log: MFC r279362: The VNASSERT in vflush() FORCECLOSE case is trying to panic early to prevent errors from yanking devices out from under filesystems. Only care about special vnodes on devfs, special nodes on other kinds of filesystems do not have special properties. Modified: stable/10/sys/fs/devfs/devfs_vnops.c stable/10/sys/kern/vfs_subr.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Fri Mar 6 05:50:39 2015 (r279684) +++ stable/10/sys/fs/devfs/devfs_vnops.c Fri Mar 6 09:22:05 2015 (r279685) @@ -63,7 +63,6 @@ #include static struct vop_vector devfs_vnodeops; -static struct vop_vector devfs_specops; static struct fileops devfs_ops_f; #include @@ -1737,7 +1736,7 @@ static struct vop_vector devfs_vnodeops .vop_vptocnp = devfs_vptocnp, }; -static struct vop_vector devfs_specops = { +struct vop_vector devfs_specops = { .vop_default = &default_vnodeops, .vop_access = devfs_access, Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Fri Mar 6 05:50:39 2015 (r279684) +++ stable/10/sys/kern/vfs_subr.c Fri Mar 6 09:22:05 2015 (r279685) @@ -2624,6 +2624,7 @@ loop: */ if (vp->v_usecount == 0 || (flags & FORCECLOSE)) { VNASSERT(vp->v_usecount == 0 || + vp->v_op != &devfs_specops || (vp->v_type != VCHR && vp->v_type != VBLK), vp, ("device VNODE %p is FORCECLOSED", vp)); vgonel(vp); Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Fri Mar 6 05:50:39 2015 (r279684) +++ stable/10/sys/sys/vnode.h Fri Mar 6 09:22:05 2015 (r279685) @@ -819,6 +819,7 @@ void vnode_destroy_vobject(struct vnode extern struct vop_vector fifo_specops; extern struct vop_vector dead_vnodeops; extern struct vop_vector default_vnodeops; +extern struct vop_vector devfs_specops; #define VOP_PANIC ((void*)(uintptr_t)vop_panic) #define VOP_NULL ((void*)(uintptr_t)vop_null) From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 11:25:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7761969; Fri, 6 Mar 2015 11:25:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 785F3A78; Fri, 6 Mar 2015 11:25:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26BPAv3084716; Fri, 6 Mar 2015 11:25:10 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26BPAYW084715; Fri, 6 Mar 2015 11:25:10 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503061125.t26BPAYW084715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 6 Mar 2015 11:25:10 +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: r279686 - stable/10/share/man/man4/man4.powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 11:25:11 -0000 Author: brueffer Date: Fri Mar 6 11:25:10 2015 New Revision: 279686 URL: https://svnweb.freebsd.org/changeset/base/279686 Log: MFH: r279050 Apply mdoc style. Modified: stable/10/share/man/man4/man4.powerpc/tsec.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/man4.powerpc/tsec.4 ============================================================================== --- stable/10/share/man/man4/man4.powerpc/tsec.4 Fri Mar 6 09:22:05 2015 (r279685) +++ stable/10/share/man/man4/man4.powerpc/tsec.4 Fri Mar 6 11:25:10 2015 (r279686) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2009 +.Dd February 20, 2015 .Dt TSEC 4 .Os .Sh NAME @@ -91,18 +91,23 @@ The driver supports interrupts coalescing (IC) so that raising a transmit/receive frame interrupt is delayed, if possible, until a threshold-defined period of time has elapsed, or a threshold-defined frame counter has been reached -(whichever occurs first). The following sysctls regulate this behaviour: +(whichever occurs first). +The following sysctls regulate this behaviour: .Bl -tag -width indent .It Va dev.tsec.X.int_coal.rx_time .It Va dev.tsec.X.int_coal.rx_count .It Va dev.tsec.X.int_coal.tx_time .It Va dev.tsec.X.int_coal.tx_count .Pp -Value of 0 for either time or count disables IC on the given path. Time value +Value of 0 for either time or count disables IC on the given path. +Time value 1-65535 corresponds to a real time period and is expressed in units equivalent -to 64 ticks of the TSEC clock. Count 1-255 represents the number of frames -(note that value of 1 is equivalent to IC disabled). User provided values -larger than supported will be trimmed to the maximum supported. More details +to 64 ticks of the TSEC clock. +Count 1-255 represents the number of frames +(note that value of 1 is equivalent to IC disabled). +User provided values +larger than supported will be trimmed to the maximum supported. +More details are available in the reference manual of the device. .El .Sh HARDWARE @@ -144,9 +149,9 @@ device driver first appeared in The base version of .Nm device driver was written by -.An Piotr Kruszynski. +.An Piotr Kruszynski . It has been extended with polling and interrupt coalescing support by -.An Rafal Jaworowski. +.An Rafal Jaworowski . It has been further enhanced with multicast, h/w checksum calculation and vlan support by .An Piotr Ziecik . From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 11:27:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D39E3B33; Fri, 6 Mar 2015 11:27:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A41F8AA2; Fri, 6 Mar 2015 11:27:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26BRxdS085069; Fri, 6 Mar 2015 11:27:59 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26BRxGo085068; Fri, 6 Mar 2015 11:27:59 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503061127.t26BRxGo085068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 6 Mar 2015 11:27:59 +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: r279687 - stable/9/share/man/man4/man4.powerpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 11:27:59 -0000 Author: brueffer Date: Fri Mar 6 11:27:58 2015 New Revision: 279687 URL: https://svnweb.freebsd.org/changeset/base/279687 Log: MFH: r279050 Apply mdoc style. Modified: stable/9/share/man/man4/man4.powerpc/tsec.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/man4.powerpc/tsec.4 ============================================================================== --- stable/9/share/man/man4/man4.powerpc/tsec.4 Fri Mar 6 11:25:10 2015 (r279686) +++ stable/9/share/man/man4/man4.powerpc/tsec.4 Fri Mar 6 11:27:58 2015 (r279687) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2009 +.Dd February 20, 2015 .Dt TSEC 4 .Os .Sh NAME @@ -91,18 +91,23 @@ The driver supports interrupts coalescing (IC) so that raising a transmit/receive frame interrupt is delayed, if possible, until a threshold-defined period of time has elapsed, or a threshold-defined frame counter has been reached -(whichever occurs first). The following sysctls regulate this behaviour: +(whichever occurs first). +The following sysctls regulate this behaviour: .Bl -tag -width indent .It Va dev.tsec.X.int_coal.rx_time .It Va dev.tsec.X.int_coal.rx_count .It Va dev.tsec.X.int_coal.tx_time .It Va dev.tsec.X.int_coal.tx_count .Pp -Value of 0 for either time or count disables IC on the given path. Time value +Value of 0 for either time or count disables IC on the given path. +Time value 1-65535 corresponds to a real time period and is expressed in units equivalent -to 64 ticks of the TSEC clock. Count 1-255 represents the number of frames -(note that value of 1 is equivalent to IC disabled). User provided values -larger than supported will be trimmed to the maximum supported. More details +to 64 ticks of the TSEC clock. +Count 1-255 represents the number of frames +(note that value of 1 is equivalent to IC disabled). +User provided values +larger than supported will be trimmed to the maximum supported. +More details are available in the reference manual of the device. .El .Sh HARDWARE @@ -144,9 +149,9 @@ device driver first appeared in The base version of .Nm device driver was written by -.An Piotr Kruszynski. +.An Piotr Kruszynski . It has been extended with polling and interrupt coalescing support by -.An Rafal Jaworowski. +.An Rafal Jaworowski . It has been further enhanced with multicast, h/w checksum calculation and vlan support by .An Piotr Ziecik . From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 13:09:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA76B67B; Fri, 6 Mar 2015 13:09:00 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6031A771; Fri, 6 Mar 2015 13:09:00 +0000 (UTC) Received: by wghk14 with SMTP id k14so16150914wgh.7; Fri, 06 Mar 2015 05:08:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-type:content-transfer-encoding; bh=jLEYjqj3yVKizdSLJjRZqofXbwXZjaugv8aocC1yua0=; b=gM6b6yYeek49A6pwLFQ+mbPO881nuB+esc1ityvvTMhMUAVb+hzM72mg4gKmNWpMLJ V/sXRnAxcGL5ae9xlOrE1SqG3co1jBsfasd9x4c/UfzwsWfeP5K/mGy6/vsjHisfMA6O oA9IUt7CqdZgpO/CAJuY6Sr0ZfMDIAEzQmDFmZysmaxeazXNr3G6HFdO66rmQLsBZa8H L5XnonIsfQyVt1UMrufZkKCEnKT01qtqVlZcLqhRNerXz/ynpGwCo9M1YVuvN14ovgHR pMRbmgxRvO62j7OCkV9W3jwZOZMrMgSF6sttpTozG2eJoxQ7FWPA4hYQOXvWpyW2JGyB PIzw== X-Received: by 10.180.189.35 with SMTP id gf3mr32479285wic.5.1425647338776; Fri, 06 Mar 2015 05:08:58 -0800 (PST) Received: from ernst.home (p4FCA7C11.dip0.t-ipconnect.de. [79.202.124.17]) by mx.google.com with ESMTPSA id cn10sm2183927wib.15.2015.03.06.05.08.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 05:08:56 -0800 (PST) Date: Fri, 6 Mar 2015 14:08:54 +0100 From: Gary Jennejohn To: Dmitry Sivachenko Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150306140854.29889622@ernst.home> In-Reply-To: <1735F6FC-02CD-48FC-BE88-47CB68748988@FreeBSD.org> References: <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <54F8ACDF.70305@freebsd.org> <1735F6FC-02CD-48FC-BE88-47CB68748988@FreeBSD.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , David Chisnall , Gleb Smirnoff , Slawa Olhovchenkov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 13:09:01 -0000 On Fri, 6 Mar 2015 12:05:23 +0300 Dmitry Sivachenko wrote: > > > On 5 __________ 2015 __., at 22:22, Alfred Perlstein wrote: > > > > > > > > On 3/5/15 6:09 AM, David Chisnall wrote: > >> On 5 Mar 2015, at 14:04, Dmitry Sivachenko wrote: > >> > >>> It is so nice to have most useful stuff out of the box. > >> The question is whether a tool for logging into remote machines without encryption is 'the most useful stuff'. The tool is also [ab]used for network testing, but we already provide a better tool for that in the form of nc(1). > >> > >> David > >> > >> > > Agree. > > > > Moving it out of base +1000. > > > > It's time we made FreeBSD into an actual distro which is what is happening anyhow. > > > > This is a great time! > > > This would become a new fool's day, really. > Don't act like a monkey copying other's bad decisions. > > Having rich base system always were one of FreeBSD's strength, please don't break it. > Exactly. If I have to screw around installing utilities which should be part of the base system (and have been there for the last 30+ years) then I might as well move to Linux, as a previous poster noted. I want BSD, not some bastardized Linux. -- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 14:15:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C252847C; Fri, 6 Mar 2015 14:15:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2D54E41; Fri, 6 Mar 2015 14:15:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26EFVCT066102; Fri, 6 Mar 2015 14:15:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26EFUUM066099; Fri, 6 Mar 2015 14:15:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503061415.t26EFUUM066099@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 6 Mar 2015 14:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279688 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 14:15:31 -0000 Author: glebius Date: Fri Mar 6 14:15:30 2015 New Revision: 279688 URL: https://svnweb.freebsd.org/changeset/base/279688 Log: - In vnode_pager_generic_getpages() use different free counters for synchronous and asynchronous requests. The latter can saturate the I/O and we do not want them to affect regular paging. - Allocate the pbuf at the very beginning of the function, so that if we are low on certain kind of pbufs don't even proceed to BMAP, but sleep. Reviewed by: kib Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/sys/buf.h head/sys/vm/vm_pager.c head/sys/vm/vnode_pager.c Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Mar 6 11:27:58 2015 (r279687) +++ head/sys/sys/buf.h Fri Mar 6 14:15:30 2015 (r279688) @@ -475,6 +475,8 @@ extern struct buf *swbuf; /* Swap I/O b extern int nswbuf; /* Number of swap I/O buffer headers. */ extern int cluster_pbuf_freecnt; /* Number of pbufs for clusters */ extern int vnode_pbuf_freecnt; /* Number of pbufs for vnode pager */ +extern int vnode_async_pbuf_freecnt; /* Number of pbufs for vnode pager, + asynchronous reads */ extern caddr_t unmapped_buf; void runningbufwakeup(struct buf *); Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Fri Mar 6 11:27:58 2015 (r279687) +++ head/sys/vm/vm_pager.c Fri Mar 6 14:15:30 2015 (r279688) @@ -215,6 +215,7 @@ vm_pager_bufferinit() cluster_pbuf_freecnt = nswbuf / 2; vnode_pbuf_freecnt = nswbuf / 2 + 1; + vnode_async_pbuf_freecnt = nswbuf / 2; } /* Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Fri Mar 6 11:27:58 2015 (r279687) +++ head/sys/vm/vnode_pager.c Fri Mar 6 14:15:30 2015 (r279688) @@ -104,6 +104,7 @@ struct pagerops vnodepagerops = { }; int vnode_pbuf_freecnt; +int vnode_async_pbuf_freecnt; /* Create the VM system backing object for this vnode */ int @@ -751,7 +752,7 @@ vnode_pager_generic_getpages(struct vnod { vm_object_t object; off_t foff; - int i, j, size, bsize, first; + int i, j, size, bsize, first, *freecnt; daddr_t firstaddr, reqblock; struct bufobj *bo; int runpg; @@ -771,6 +772,10 @@ vnode_pager_generic_getpages(struct vnod bsize = vp->v_mount->mnt_stat.f_iosize; foff = IDX_TO_OFF(m[reqpage]->pindex); + freecnt = iodone != NULL ? + &vnode_async_pbuf_freecnt : &vnode_pbuf_freecnt; + bp = getpbuf(freecnt); + /* * Get the underlying device blocks for the file with VOP_BMAP(). * If the file system doesn't support VOP_BMAP, use old way of @@ -778,8 +783,8 @@ vnode_pager_generic_getpages(struct vnod */ error = VOP_BMAP(vp, foff / bsize, &bo, &reqblock, NULL, NULL); if (error == EOPNOTSUPP) { + relpbuf(bp, freecnt); VM_OBJECT_WLOCK(object); - for (i = 0; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); @@ -792,6 +797,7 @@ vnode_pager_generic_getpages(struct vnod VM_OBJECT_WUNLOCK(object); return (error); } else if (error != 0) { + relpbuf(bp, freecnt); vm_pager_free_nonreq(object, m, reqpage, count); return (VM_PAGER_ERROR); @@ -802,6 +808,7 @@ vnode_pager_generic_getpages(struct vnod */ } else if ((PAGE_SIZE / bsize) > 1 && (vp->v_mount->mnt_stat.f_type != nfs_mount_type)) { + relpbuf(bp, freecnt); vm_pager_free_nonreq(object, m, reqpage, count); PCPU_INC(cnt.v_vnodein); PCPU_INC(cnt.v_vnodepgsin); @@ -820,9 +827,11 @@ vnode_pager_generic_getpages(struct vnod * media. */ if (m[reqpage]->valid == VM_PAGE_BITS_ALL) { + relpbuf(bp, freecnt); vm_pager_free_nonreq(object, m, reqpage, count); return (VM_PAGER_OK); } else if (reqblock == -1) { + relpbuf(bp, freecnt); pmap_zero_page(m[reqpage]); KASSERT(m[reqpage]->dirty == 0, ("vnode_pager_generic_getpages: page %p is dirty", m)); @@ -853,6 +862,7 @@ vnode_pager_generic_getpages(struct vnod for (first = 0, i = 0; i < count; i = runend) { if (vnode_pager_addr(vp, IDX_TO_OFF(m[i]->pindex), &firstaddr, &runpg) != 0) { + relpbuf(bp, freecnt); VM_OBJECT_WLOCK(object); for (; i < count; i++) if (i != reqpage) { @@ -941,7 +951,6 @@ vnode_pager_generic_getpages(struct vnod size = (size + secmask) & ~secmask; } - bp = getpbuf(&vnode_pbuf_freecnt); bp->b_kvaalloc = bp->b_data; /* @@ -1016,7 +1025,7 @@ vnode_pager_generic_getpages_done_async( bp->b_pages[i] = NULL; bp->b_vp = NULL; pbrelbo(bp); - relpbuf(bp, &vnode_pbuf_freecnt); + relpbuf(bp, &vnode_async_pbuf_freecnt); } static int From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:05:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FCB3CC9; Fri, 6 Mar 2015 16:05:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A867C6A; Fri, 6 Mar 2015 16:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26G5Lb8020144; Fri, 6 Mar 2015 16:05:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26G5Lj4020143; Fri, 6 Mar 2015 16:05:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201503061605.t26G5Lj4020143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 6 Mar 2015 16:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279691 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:05:21 -0000 Author: np Date: Fri Mar 6 16:05:20 2015 New Revision: 279691 URL: https://svnweb.freebsd.org/changeset/base/279691 Log: cxgbe(4): provide the correct size of freelists associated with netmap rx queues to the chip. This will fix many problems with native netmap rx on ncxl/ncxgbe interfaces. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Mar 6 15:19:16 2015 (r279690) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Mar 6 16:05:20 2015 (r279691) @@ -279,7 +279,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, s c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); - c.fl0size = htobe16(na->num_rx_desc + spg_len / EQ_ESIZE); + c.fl0size = htobe16(na->num_rx_desc / 8 + spg_len / EQ_ESIZE); c.fl0addr = htobe64(nm_rxq->fl_ba); rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:08:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE68EE2D; Fri, 6 Mar 2015 16:08:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9220C83; Fri, 6 Mar 2015 16:08:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26G83ju020544; Fri, 6 Mar 2015 16:08:03 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26G83u3020543; Fri, 6 Mar 2015 16:08:03 GMT (envelope-from br@FreeBSD.org) Message-Id: <201503061608.t26G83u3020543@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 6 Mar 2015 16:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279692 - head/sys/modules/dtrace/dtraceall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:08:04 -0000 Author: br Date: Fri Mar 6 16:08:03 2015 New Revision: 279692 URL: https://svnweb.freebsd.org/changeset/base/279692 Log: Set a dependancy on fbt module for ARM. Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Fri Mar 6 16:05:20 2015 (r279691) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Fri Mar 6 16:08:03 2015 (r279692) @@ -69,7 +69,7 @@ MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, #if defined(NFSCL) MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); #endif -#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) +#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) || defined(__arm__) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #endif #if defined(__amd64__) || defined(__i386__) From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:08:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F9B1F62; Fri, 6 Mar 2015 16:08:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8963CC86; Fri, 6 Mar 2015 16:08:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26G8Bhh020602; Fri, 6 Mar 2015 16:08:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26G8Bhb020601; Fri, 6 Mar 2015 16:08:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503061608.t26G8Bhb020601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 6 Mar 2015 16:08: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: r279693 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:08:11 -0000 Author: hselasky Date: Fri Mar 6 16:08:10 2015 New Revision: 279693 URL: https://svnweb.freebsd.org/changeset/base/279693 Log: MFC r279563: Add quirk for USB 3.0 controllers which don't support 64-bit DMA. Modified: stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Fri Mar 6 16:08:03 2015 (r279692) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Fri Mar 6 16:08:10 2015 (r279693) @@ -180,6 +180,7 @@ xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); int count, err, rid; + uint8_t usedma32; rid = PCI_XHCI_CBMEM; sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, @@ -192,7 +193,17 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self, 0)) { + /* check for USB 3.0 controllers which don't support 64-bit DMA */ + switch (pci_get_devid(self)) { + case 0x01941033: /* NEC uPD720200 USB 3.0 controller */ + usedma32 = 1; + break; + default: + usedma32 = 0; + break; + } + + if (xhci_init(sc, self, usedma32)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:09:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81172142; Fri, 6 Mar 2015 16:09:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB74C9A; Fri, 6 Mar 2015 16:09:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26G9YJI020846; Fri, 6 Mar 2015 16:09:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26G9YLo020845; Fri, 6 Mar 2015 16:09:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503061609.t26G9YLo020845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 6 Mar 2015 16:09:34 +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: r279694 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:09:34 -0000 Author: hselasky Date: Fri Mar 6 16:09:33 2015 New Revision: 279694 URL: https://svnweb.freebsd.org/changeset/base/279694 Log: MFC r279563: Add quirk for USB 3.0 controllers which don't support 64-bit DMA. Modified: stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Fri Mar 6 16:08:10 2015 (r279693) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Fri Mar 6 16:09:33 2015 (r279694) @@ -180,6 +180,7 @@ xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); int count, err, rid; + uint8_t usedma32; rid = PCI_XHCI_CBMEM; sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, @@ -192,7 +193,17 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self, 0)) { + /* check for USB 3.0 controllers which don't support 64-bit DMA */ + switch (pci_get_devid(self)) { + case 0x01941033: /* NEC uPD720200 USB 3.0 controller */ + usedma32 = 1; + break; + default: + usedma32 = 0; + break; + } + + if (xhci_init(sc, self, usedma32)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:17:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 978445C5; Fri, 6 Mar 2015 16:17:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 826B1D9F; Fri, 6 Mar 2015 16:17:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26GH9g5025451; Fri, 6 Mar 2015 16:17:09 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26GH9F6025450; Fri, 6 Mar 2015 16:17:09 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201503061617.t26GH9F6025450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Fri, 6 Mar 2015 16:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279695 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:17:09 -0000 Author: slm Date: Fri Mar 6 16:17:08 2015 New Revision: 279695 URL: https://svnweb.freebsd.org/changeset/base/279695 Log: This setting of stop_at_shutdown should have been removed with r279253 Approved by: ken MFC after: 1 week Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Mar 6 16:09:33 2015 (r279694) +++ head/sys/dev/mps/mps_sas.c Fri Mar 6 16:17:08 2015 (r279695) @@ -3406,19 +3406,6 @@ mpssas_check_eedp(struct mps_softc *sc, xpt_path_string(local_path, path_str, sizeof(path_str)); - /* - * If this is a SATA direct-access end device, - * mark it so that a SCSI StartStopUnit command - * will be sent to it when the driver is being - * shutdown. - */ - if ((cgd.inq_data.device == T_DIRECT) && - (target->devinfo & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) && - ((target->devinfo & MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE) == - MPI2_SAS_DEVICE_INFO_END_DEVICE)) { - lun->stop_at_shutdown = TRUE; - } - mps_dprint(sc, MPS_INFO, "Sending read cap: path %s handle %d\n", path_str, target->handle); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:23:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 758519C0; Fri, 6 Mar 2015 16:23:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FC3BE8E; Fri, 6 Mar 2015 16:23:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26GNVfG030019; Fri, 6 Mar 2015 16:23:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26GNVIK030018; Fri, 6 Mar 2015 16:23:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201503061623.t26GNVIK030018@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 6 Mar 2015 16:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279696 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:23:31 -0000 Author: br Date: Fri Mar 6 16:23:30 2015 New Revision: 279696 URL: https://svnweb.freebsd.org/changeset/base/279696 Log: Fix style. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Fri Mar 6 16:17:08 2015 (r279695) +++ head/sys/arm/conf/BEAGLEBONE Fri Mar 6 16:23:30 2015 (r279696) @@ -28,10 +28,10 @@ include "../ti/am335x/std.am335x" makeoptions WITHOUT_MODULES="ahc" # DTrace support -options KDTRACE_HOOKS # Kernel DTrace hooks -options DDB_CTF # all architectures - kernel ELF linker loads CTF data -makeoptions WITH_CTF=1 -makeoptions MODULES_OVERRIDE="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # all architectures - kernel ELF linker loads CTF data +makeoptions WITH_CTF=1 +makeoptions MODULES_OVERRIDE="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" options HZ=100 options SCHED_4BSD # 4BSD scheduler From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:43:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8530398; Fri, 6 Mar 2015 16:43:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A37CF136; Fri, 6 Mar 2015 16:43:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26GhtLl041613; Fri, 6 Mar 2015 16:43:55 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26GhtK6041612; Fri, 6 Mar 2015 16:43:55 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201503061643.t26GhtK6041612@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 6 Mar 2015 16:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279698 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:43:55 -0000 Author: ed Date: Fri Mar 6 16:43:54 2015 New Revision: 279698 URL: https://svnweb.freebsd.org/changeset/base/279698 Log: Update the ELFOSABI_* constants. Two new operating systems have been added in the meantime. ELFOSABI_FENIXOS that uses value 16 (published in the latest draft) and ELFOSABI_CLOUDABI that uses value 17 (to be published in the next draft). Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Mar 6 16:31:08 2015 (r279697) +++ head/sys/sys/elf_common.h Fri Mar 6 16:43:54 2015 (r279698) @@ -169,6 +169,8 @@ typedef struct { #define ELFOSABI_OPENVMS 13 /* Open VMS */ #define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ #define ELFOSABI_AROS 15 /* Amiga Research OS */ +#define ELFOSABI_FENIXOS 16 /* FenixOS */ +#define ELFOSABI_CLOUDABI 17 /* Nuxi CloudABI */ #define ELFOSABI_ARM 97 /* ARM */ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 16:53:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE7FE653; Fri, 6 Mar 2015 16:53:19 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 9A04723F; Fri, 6 Mar 2015 16:53:18 +0000 (UTC) Received: from bender (c112.sec.cl.cam.ac.uk [128.232.18.112]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 676FFD79EC; Fri, 6 Mar 2015 16:53:16 +0000 (UTC) Date: Fri, 6 Mar 2015 16:53:12 +0000 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r279692 - head/sys/modules/dtrace/dtraceall Message-ID: <20150306165312.1cf7a969@bender> In-Reply-To: <201503061608.t26G83u3020543@svn.freebsd.org> References: <201503061608.t26G83u3020543@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 16:53:19 -0000 On Fri, 6 Mar 2015 16:08:03 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Fri Mar 6 16:08:03 2015 > New Revision: 279692 > URL: https://svnweb.freebsd.org/changeset/base/279692 > > Log: > Set a dependancy on fbt module for ARM. > > Modified: > head/sys/modules/dtrace/dtraceall/dtraceall.c > > Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c > ============================================================================== > --- head/sys/modules/dtrace/dtraceall/dtraceall.c Fri Mar 6 > 16:05:20 2015 (r279691) +++ > head/sys/modules/dtrace/dtraceall/dtraceall.c Fri Mar 6 > 16:08:03 2015 (r279692) @@ -69,7 +69,7 @@ > MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, #if defined(NFSCL) > MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); #endif > -#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) > +#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) > || defined(__arm__) These should be in alphabetical order. The line is also too long so should be split. Andrew From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 20:34:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 462FE587; Fri, 6 Mar 2015 20:34:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31693E47; Fri, 6 Mar 2015 20:34:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26KYT9L063977; Fri, 6 Mar 2015 20:34:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26KYSP2063973; Fri, 6 Mar 2015 20:34:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503062034.t26KYSP2063973@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Mar 2015 20:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 20:34:29 -0000 Author: jhb Date: Fri Mar 6 20:34:28 2015 New Revision: 279699 URL: https://svnweb.freebsd.org/changeset/base/279699 Log: Only schedule interrupts on a single hyperthread of a modern Intel CPU core by default. Previously we used a single hyperthread on Pentium4-era cores but used both hyperthreads on more recent CPUs. MFC after: 2 weeks Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) continue; /* Don't let hyperthreads service interrupts. */ - if (hyperthreading_cpus > 1 && - apic_id % hyperthreading_cpus != 0) + if (cpu_logical > 1 && + apic_id % cpu_logical != 0) continue; intr_add_cpu(i); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) continue; /* Don't let hyperthreads service interrupts. */ - if (hyperthreading_cpus > 1 && - apic_id % hyperthreading_cpus != 0) + if (cpu_logical > 1 && + apic_id % cpu_logical != 0) continue; intr_add_cpu(i); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 20:39:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B124723; Fri, 6 Mar 2015 20:39:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85F86E82; Fri, 6 Mar 2015 20:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26KdKTk064629; Fri, 6 Mar 2015 20:39:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26KdKPB064628; Fri, 6 Mar 2015 20:39:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201503062039.t26KdKPB064628@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 6 Mar 2015 20:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279700 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 20:39:20 -0000 Author: np Date: Fri Mar 6 20:39:19 2015 New Revision: 279700 URL: https://svnweb.freebsd.org/changeset/base/279700 Log: cxgbe(4): knobs to experiment with the interrupt coalescing timer for netmap rx queues, and the "batchiness" of rx updates sent to the chip. These knobs will probably become per-rxq in the near future and will be documented only after their final form is decided. MFC after: 1 month Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Mar 6 20:34:28 2015 (r279699) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Mar 6 20:39:19 2015 (r279700) @@ -58,6 +58,16 @@ extern int fl_pad; /* XXXNM */ extern int spg_len; /* XXXNM */ extern int fl_pktshift; /* XXXNM */ +SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, "cxgbe netmap parameters"); + +int rx_ndesc = 256; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_rx_ndesc, CTLFLAG_RWTUN, + &rx_ndesc, 0, "# of rx descriptors after which the hw cidx is updated."); + +int holdoff_tmr_idx = 2; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CTLFLAG_RWTUN, + &holdoff_tmr_idx, 0, "Holdoff timer index for netmap rx queues."); + /* netmap ifnet routines */ static void cxgbe_nm_init(void *); static int cxgbe_nm_ioctl(struct ifnet *, unsigned long, caddr_t); @@ -344,8 +354,8 @@ alloc_nm_rxq_hwq(struct port_info *pi, s } t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), - V_SEINTARM(V_QINTR_TIMER_IDX(1)) | - V_INGRESSQID(nm_rxq->iq_cntxt_id)); + V_INGRESSQID(nm_rxq->iq_cntxt_id) | + V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx))); return (rc); } @@ -491,13 +501,14 @@ cxgbe_netmap_on(struct adapter *sc, stru /* We deal with 8 bufs at a time */ MPASS((na->num_rx_desc & 7) == 0); MPASS(na->num_rx_desc == nm_rxq->fl_sidx); - for (j = 0; j < nm_rxq->fl_sidx - 8; j++) { + for (j = 0; j < nm_rxq->fl_sidx; j++) { uint64_t ba; PNMB(na, &slot[j], &ba); + MPASS(ba != 0); nm_rxq->fl_desc[j] = htobe64(ba | hwidx); } - nm_rxq->fl_pidx = j; + j = nm_rxq->fl_pidx = nm_rxq->fl_sidx - 8; MPASS((j & 7) == 0); j /= 8; /* driver pidx to hardware pidx */ wmb(); @@ -708,6 +719,7 @@ cxgbe_nm_tx(struct adapter *sc, struct s for (i = 0; i < n; i++) { slot = &ring->slot[kring->nr_hwcur]; PNMB(kring->na, slot, &ba); + MPASS(ba != 0); cpl->ctrl0 = nm_txq->cpl_ctrl0; cpl->pack = 0; @@ -933,6 +945,7 @@ cxgbe_netmap_rxsync(struct netmap_kring while (n > 0) { for (i = 0; i < 8; i++, fl_pidx++, slot++) { PNMB(na, slot, &ba); + MPASS(ba != 0); nm_rxq->fl_desc[fl_pidx] = htobe64(ba | hwidx); slot->flags &= ~NS_BUF_CHANGED; MPASS(fl_pidx <= nm_rxq->fl_sidx); @@ -1107,8 +1120,7 @@ t4_nm_intr(void *arg) struct netmap_ring *ring = kring->ring; struct iq_desc *d = &nm_rxq->iq_desc[nm_rxq->iq_cidx]; uint32_t lq; - u_int n = 0; - int processed = 0; + u_int n = 0, work = 0; uint8_t opcode; uint32_t fl_cidx = atomic_load_acq_32(&nm_rxq->fl_cidx); @@ -1164,7 +1176,10 @@ t4_nm_intr(void *arg) nm_rxq->iq_gen ^= F_RSPD_GEN; } - if (__predict_false(++n == 64)) { /* XXXNM: tune */ + if (__predict_false(++n == rx_ndesc)) { + atomic_store_rel_32(&nm_rxq->fl_cidx, fl_cidx); + netmap_rx_irq(ifp, nm_rxq->nid, &work); + MPASS(work != 0); t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(n) | V_INGRESSQID(nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); @@ -1173,10 +1188,10 @@ t4_nm_intr(void *arg) } if (fl_cidx != nm_rxq->fl_cidx) { atomic_store_rel_32(&nm_rxq->fl_cidx, fl_cidx); - netmap_rx_irq(ifp, nm_rxq->nid, &processed); + netmap_rx_irq(ifp, nm_rxq->nid, &work); } t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(n) | V_INGRESSQID((u32)nm_rxq->iq_cntxt_id) | - V_SEINTARM(V_QINTR_TIMER_IDX(1))); + V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx))); } #endif From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 20:41:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0D95894; Fri, 6 Mar 2015 20:41:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBD07EA1; Fri, 6 Mar 2015 20:41:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26KfTOK066065; Fri, 6 Mar 2015 20:41:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26KfTSe066064; Fri, 6 Mar 2015 20:41:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <201503062041.t26KfTSe066064@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 6 Mar 2015 20:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279701 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 20:41:30 -0000 Author: np Date: Fri Mar 6 20:41:28 2015 New Revision: 279701 URL: https://svnweb.freebsd.org/changeset/base/279701 Log: cxgbe(4): experimental rx packet sink for netmap queues. This is not intended for general use. MFC after: 1 month Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Mar 6 20:39:19 2015 (r279700) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Mar 6 20:41:28 2015 (r279701) @@ -60,6 +60,15 @@ extern int fl_pktshift; /* XXXNM */ SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, "cxgbe netmap parameters"); +/* + * 0 = normal netmap rx + * 1 = black hole + * 2 = supermassive black hole (buffer packing enabled) + */ +int black_hole = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_black_hole, CTLFLAG_RDTUN, &black_hole, 0, + "Sink incoming packets."); + int rx_ndesc = 256; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_rx_ndesc, CTLFLAG_RWTUN, &rx_ndesc, 0, "# of rx descriptors after which the hw cidx is updated."); @@ -285,7 +294,8 @@ alloc_nm_rxq_hwq(struct port_info *pi, s c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | F_FW_IQ_CMD_FL0FETCHRO | F_FW_IQ_CMD_FL0DATARO | - (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0)); + (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) | + (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); @@ -916,6 +926,9 @@ cxgbe_netmap_rxsync(struct netmap_kring u_int n; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; + if (black_hole) + return (0); /* No updates ever. */ + if (netmap_no_pendintr || force_update) { kring->nr_hwtail = atomic_load_acq_32(&nm_rxq->fl_cidx); kring->nr_kflags &= ~NKR_PENDINTR; @@ -1123,6 +1136,7 @@ t4_nm_intr(void *arg) u_int n = 0, work = 0; uint8_t opcode; uint32_t fl_cidx = atomic_load_acq_32(&nm_rxq->fl_cidx); + u_int fl_credits = fl_cidx & 7; while ((d->rsp.u.type_gen & F_RSPD_GEN) == nm_rxq->iq_gen) { @@ -1133,8 +1147,10 @@ t4_nm_intr(void *arg) switch (G_RSPD_TYPE(d->rsp.u.type_gen)) { case X_RSPD_TYPE_FLBUF: - /* No buffer packing so new buf every time */ - MPASS(lq & F_RSPD_NEWBUF); + if (black_hole != 2) { + /* No buffer packing so new buf every time */ + MPASS(lq & F_RSPD_NEWBUF); + } /* fall through */ @@ -1150,7 +1166,9 @@ t4_nm_intr(void *arg) case CPL_RX_PKT: ring->slot[fl_cidx].len = G_RSPD_LEN(lq) - fl_pktshift; ring->slot[fl_cidx].flags = kring->nkr_slot_flags; - if (__predict_false(++fl_cidx == nm_rxq->fl_sidx)) + fl_cidx += (lq & F_RSPD_NEWBUF) ? 1 : 0; + fl_credits += (lq & F_RSPD_NEWBUF) ? 1 : 0; + if (__predict_false(fl_cidx == nm_rxq->fl_sidx)) fl_cidx = 0; break; default: @@ -1178,18 +1196,33 @@ t4_nm_intr(void *arg) if (__predict_false(++n == rx_ndesc)) { atomic_store_rel_32(&nm_rxq->fl_cidx, fl_cidx); - netmap_rx_irq(ifp, nm_rxq->nid, &work); - MPASS(work != 0); + if (black_hole && fl_credits >= 8) { + fl_credits /= 8; + IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, + nm_rxq->fl_sidx); + t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + nm_rxq->fl_db_val | V_PIDX(fl_credits)); + fl_credits = fl_cidx & 7; + } else if (!black_hole) { + netmap_rx_irq(ifp, nm_rxq->nid, &work); + MPASS(work != 0); + } t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(n) | V_INGRESSQID(nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); n = 0; } } - if (fl_cidx != nm_rxq->fl_cidx) { - atomic_store_rel_32(&nm_rxq->fl_cidx, fl_cidx); + + atomic_store_rel_32(&nm_rxq->fl_cidx, fl_cidx); + if (black_hole) { + fl_credits /= 8; + IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, nm_rxq->fl_sidx); + t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + nm_rxq->fl_db_val | V_PIDX(fl_credits)); + } else netmap_rx_irq(ifp, nm_rxq->nid, &work); - } + t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(n) | V_INGRESSQID((u32)nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx))); From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 20:52:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22687F01; Fri, 6 Mar 2015 20:52:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9FAC5; Fri, 6 Mar 2015 20:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26Kq5mH073451; Fri, 6 Mar 2015 20:52:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26Kq5Oq073450; Fri, 6 Mar 2015 20:52:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503062052.t26Kq5Oq073450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 6 Mar 2015 20:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279702 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 20:52:06 -0000 Author: ian Date: Fri Mar 6 20:52:05 2015 New Revision: 279702 URL: https://svnweb.freebsd.org/changeset/base/279702 Log: Update a comment that had drifted out of date with the last changes. Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Fri Mar 6 20:41:28 2015 (r279701) +++ head/sys/arm/arm/physmem.c Fri Mar 6 20:52:05 2015 (r279702) @@ -153,7 +153,7 @@ arm_physmem_print_tables() * Walk the list of hardware regions, processing it against the list of * exclusions that contain the given exflags, and generating an "avail list". * - * Updates the kernel global 'realmem' with the sum of all pages in hw regions. + * Updates the value at *pavail with the sum of all pages in all hw regions. * * Returns the number of pages of non-excluded memory added to the avail list. */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 20:53:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70887E0; Fri, 6 Mar 2015 20:53:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA26D7; Fri, 6 Mar 2015 20:53:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26KrvFK073708; Fri, 6 Mar 2015 20:53:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26Krv24073707; Fri, 6 Mar 2015 20:53:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503062053.t26Krv24073707@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Mar 2015 20:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279703 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 20:53:57 -0000 Author: jhb Date: Fri Mar 6 20:53:56 2015 New Revision: 279703 URL: https://svnweb.freebsd.org/changeset/base/279703 Log: Fix a typo. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Mar 6 20:52:05 2015 (r279702) +++ head/sys/dev/acpica/acpi.c Fri Mar 6 20:53:56 2015 (r279703) @@ -1071,7 +1071,7 @@ acpi_hint_device_unit(device_t acdev, de } /* - * Fech the NUMA domain for the given device. + * Fetch the NUMA domain for the given device. * * If a device has a _PXM method, map that to a NUMA domain. * From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 21:41:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85168C5; Fri, 6 Mar 2015 21:41:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ED01836; Fri, 6 Mar 2015 21:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26LfdKI097214; Fri, 6 Mar 2015 21:41:39 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26LfamG097200; Fri, 6 Mar 2015 21:41:36 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062141.t26LfamG097200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 21:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279704 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 21:41:39 -0000 Author: edwin Date: Fri Mar 6 21:41:35 2015 New Revision: 279704 URL: https://svnweb.freebsd.org/changeset/base/279704 Log: Vendor import of tzdata2015a: hanges affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: vendor/tzdata/dist/antarctica vendor/tzdata/dist/asia vendor/tzdata/dist/backward vendor/tzdata/dist/europe vendor/tzdata/dist/leap-seconds.list vendor/tzdata/dist/northamerica vendor/tzdata/dist/southamerica vendor/tzdata/dist/zone.tab vendor/tzdata/dist/zone1970.tab Modified: vendor/tzdata/dist/antarctica ============================================================================== --- vendor/tzdata/dist/antarctica Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/antarctica Fri Mar 6 21:41:35 2015 (r279704) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/asia Fri Mar 6 21:41:35 2015 (r279704) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: vendor/tzdata/dist/backward ============================================================================== --- vendor/tzdata/dist/backward Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/backward Fri Mar 6 21:41:35 2015 (r279704) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: vendor/tzdata/dist/europe ============================================================================== --- vendor/tzdata/dist/europe Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/europe Fri Mar 6 21:41:35 2015 (r279704) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: vendor/tzdata/dist/leap-seconds.list ============================================================================== --- vendor/tzdata/dist/leap-seconds.list Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/leap-seconds.list Fri Mar 6 21:41:35 2015 (r279704) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/northamerica Fri Mar 6 21:41:35 2015 (r279704) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: vendor/tzdata/dist/southamerica ============================================================================== --- vendor/tzdata/dist/southamerica Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/southamerica Fri Mar 6 21:41:35 2015 (r279704) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: vendor/tzdata/dist/zone.tab ============================================================================== --- vendor/tzdata/dist/zone.tab Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/zone.tab Fri Mar 6 21:41:35 2015 (r279704) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: vendor/tzdata/dist/zone1970.tab ============================================================================== --- vendor/tzdata/dist/zone1970.tab Fri Mar 6 20:53:56 2015 (r279703) +++ vendor/tzdata/dist/zone1970.tab Fri Mar 6 21:41:35 2015 (r279704) @@ -233,7 +233,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 21:43:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A70E020B; Fri, 6 Mar 2015 21:43:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7873F84E; Fri, 6 Mar 2015 21:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26Lhf2o097952; Fri, 6 Mar 2015 21:43:41 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26LhfRh097951; Fri, 6 Mar 2015 21:43:41 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062143.t26LhfRh097951@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 21:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279705 - vendor/tzdata/tzdata2015a X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 21:43:41 -0000 Author: edwin Date: Fri Mar 6 21:43:40 2015 New Revision: 279705 URL: https://svnweb.freebsd.org/changeset/base/279705 Log: Tag of tzdata 2015a Added: vendor/tzdata/tzdata2015a/ - copied from r279704, vendor/tzdata/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 21:45:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C83CD356; Fri, 6 Mar 2015 21:45:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1DE8864; Fri, 6 Mar 2015 21:45:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26Ljcxd098342; Fri, 6 Mar 2015 21:45:38 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26Ljaa1098332; Fri, 6 Mar 2015 21:45:36 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062145.t26Ljaa1098332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 21:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279706 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 21:45:39 -0000 Author: edwin Date: Fri Mar 6 21:45:35 2015 New Revision: 279706 URL: https://svnweb.freebsd.org/changeset/base/279706 Log: MFV of 279704,tzdata{2015a} Release 2015a - 2015-01-29 Changes affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/backward head/contrib/tzdata/europe head/contrib/tzdata/leap-seconds.list head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/antarctica Fri Mar 6 21:45:35 2015 (r279706) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/asia Fri Mar 6 21:45:35 2015 (r279706) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: head/contrib/tzdata/backward ============================================================================== --- head/contrib/tzdata/backward Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/backward Fri Mar 6 21:45:35 2015 (r279706) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/europe Fri Mar 6 21:45:35 2015 (r279706) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: head/contrib/tzdata/leap-seconds.list ============================================================================== --- head/contrib/tzdata/leap-seconds.list Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/leap-seconds.list Fri Mar 6 21:45:35 2015 (r279706) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/northamerica Fri Mar 6 21:45:35 2015 (r279706) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/southamerica Fri Mar 6 21:45:35 2015 (r279706) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: head/contrib/tzdata/zone.tab ============================================================================== --- head/contrib/tzdata/zone.tab Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/zone.tab Fri Mar 6 21:45:35 2015 (r279706) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: head/contrib/tzdata/zone1970.tab ============================================================================== --- head/contrib/tzdata/zone1970.tab Fri Mar 6 21:43:40 2015 (r279705) +++ head/contrib/tzdata/zone1970.tab Fri Mar 6 21:45:35 2015 (r279706) @@ -234,7 +234,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 21:55:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 575025CC; Fri, 6 Mar 2015 21:55:08 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD5DD947; Fri, 6 Mar 2015 21:55:07 +0000 (UTC) Received: by wggx13 with SMTP id x13so22616635wgg.4; Fri, 06 Mar 2015 13:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=cu5cPXZu3AzP0cGFtjnC7uqWdJZJ1ja8us8FWMQNuKc=; b=iQzGUX9QBi3SRxJf9esl65LoP+sZVmKow2d1LdhDkntgqmNtTxU+dSa7/42j/94xn1 T0j27pAjiPUGNgEpGK0N5tFmrUMErqpC93m+U3jXyOnHHwtScadV5OdaGrrdNd47hN3w SAH7vyMiFWI7ON9lgd8aJULUbUt9jjpcDPPJGDoQCv9IKrGKejWePiT+qClQ4knr5LTd dPH4cRykui4avDjJgJOhr7RFVZeXkQFWUcsmlhRS5+d7UqxrH2iDZTnGk7N5ZdkT5KOt N+hGwz856l+zASjHPRcAzIIVxKmW/q+77staQDfOtT4LYfAXu0M7neLvbgfSKcm9Xtx8 VE1Q== MIME-Version: 1.0 X-Received: by 10.194.61.161 with SMTP id q1mr34479640wjr.132.1425678906249; Fri, 06 Mar 2015 13:55:06 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.27.84.132 with HTTP; Fri, 6 Mar 2015 13:55:06 -0800 (PST) In-Reply-To: <201503062034.t26KYSP2063973@svn.freebsd.org> References: <201503062034.t26KYSP2063973@svn.freebsd.org> Date: Sat, 7 Mar 2015 00:55:06 +0300 X-Google-Sender-Auth: PBHKCojuoWSlaU4-bAomLItNHlo Message-ID: Subject: Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 21:55:08 -0000 On 6 March 2015 at 23:34, John Baldwin wrote: > Author: jhb > Date: Fri Mar 6 20:34:28 2015 > New Revision: 279699 > URL: https://svnweb.freebsd.org/changeset/base/279699 > > Log: > Only schedule interrupts on a single hyperthread of a modern Intel CPU core > by default. Previously we used a single hyperthread on Pentium4-era > cores but used both hyperthreads on more recent CPUs. > > MFC after: 2 weeks > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/i386/i386/mp_machdep.c > > Modified: head/sys/amd64/amd64/mp_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) > +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) > @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) > continue; > > /* Don't let hyperthreads service interrupts. */ > - if (hyperthreading_cpus > 1 && > - apic_id % hyperthreading_cpus != 0) > + if (cpu_logical > 1 && > + apic_id % cpu_logical != 0) > continue; > > intr_add_cpu(i); > > Modified: head/sys/i386/i386/mp_machdep.c > ============================================================================== > --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) > +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) > @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) > continue; > > /* Don't let hyperthreads service interrupts. */ > - if (hyperthreading_cpus > 1 && > - apic_id % hyperthreading_cpus != 0) > + if (cpu_logical > 1 && > + apic_id % cpu_logical != 0) > continue; > > intr_add_cpu(i); > There are another two similar cases at sys/i386/xen/mp_machdep.c Both look like a no-op: static global never gets written data, the condition is never satisfied. I guess these variables can be safely reduced for clarity there: hyperthreading_cpus, hyperthreading_cpus_mask under i386/xen. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 21:56:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FB2271F; Fri, 6 Mar 2015 21:56:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED415959; Fri, 6 Mar 2015 21:56:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26LulpN003411; Fri, 6 Mar 2015 21:56:47 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26LujoL003399; Fri, 6 Mar 2015 21:56:45 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062156.t26LujoL003399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 21:56:45 +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: r279707 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 21:56:48 -0000 Author: edwin Date: Fri Mar 6 21:56:44 2015 New Revision: 279707 URL: https://svnweb.freebsd.org/changeset/base/279707 Log: MFC of 279706,tzdata10: Release 2015a - 2015-01-29 Changes affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: stable/10/contrib/tzdata/antarctica stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/backward stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/leap-seconds.list stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/southamerica stable/10/contrib/tzdata/zone.tab stable/10/contrib/tzdata/zone1970.tab Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/antarctica ============================================================================== --- stable/10/contrib/tzdata/antarctica Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/antarctica Fri Mar 6 21:56:44 2015 (r279707) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/asia Fri Mar 6 21:56:44 2015 (r279707) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: stable/10/contrib/tzdata/backward ============================================================================== --- stable/10/contrib/tzdata/backward Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/backward Fri Mar 6 21:56:44 2015 (r279707) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/europe Fri Mar 6 21:56:44 2015 (r279707) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: stable/10/contrib/tzdata/leap-seconds.list ============================================================================== --- stable/10/contrib/tzdata/leap-seconds.list Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/leap-seconds.list Fri Mar 6 21:56:44 2015 (r279707) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/northamerica Fri Mar 6 21:56:44 2015 (r279707) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: stable/10/contrib/tzdata/southamerica ============================================================================== --- stable/10/contrib/tzdata/southamerica Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/southamerica Fri Mar 6 21:56:44 2015 (r279707) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: stable/10/contrib/tzdata/zone.tab ============================================================================== --- stable/10/contrib/tzdata/zone.tab Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/zone.tab Fri Mar 6 21:56:44 2015 (r279707) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: stable/10/contrib/tzdata/zone1970.tab ============================================================================== --- stable/10/contrib/tzdata/zone1970.tab Fri Mar 6 21:45:35 2015 (r279706) +++ stable/10/contrib/tzdata/zone1970.tab Fri Mar 6 21:56:44 2015 (r279707) @@ -234,7 +234,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:08:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99C3BE01; Fri, 6 Mar 2015 22:08:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82FD2A73; Fri, 6 Mar 2015 22:08:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26M8oEI009070; Fri, 6 Mar 2015 22:08:50 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26M8llB009054; Fri, 6 Mar 2015 22:08:47 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062208.t26M8llB009054@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 22:08:47 +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: r279708 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:08:50 -0000 Author: edwin Date: Fri Mar 6 22:08:47 2015 New Revision: 279708 URL: https://svnweb.freebsd.org/changeset/base/279708 Log: MFC of 279706,tzdata9: Release 2015a - 2015-01-29 Changes affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: stable/9/contrib/tzdata/antarctica stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/backward stable/9/contrib/tzdata/europe stable/9/contrib/tzdata/leap-seconds.list stable/9/contrib/tzdata/northamerica stable/9/contrib/tzdata/southamerica stable/9/contrib/tzdata/zone.tab stable/9/contrib/tzdata/zone1970.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/antarctica ============================================================================== --- stable/9/contrib/tzdata/antarctica Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/antarctica Fri Mar 6 22:08:47 2015 (r279708) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/asia Fri Mar 6 22:08:47 2015 (r279708) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: stable/9/contrib/tzdata/backward ============================================================================== --- stable/9/contrib/tzdata/backward Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/backward Fri Mar 6 22:08:47 2015 (r279708) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: stable/9/contrib/tzdata/europe ============================================================================== --- stable/9/contrib/tzdata/europe Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/europe Fri Mar 6 22:08:47 2015 (r279708) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: stable/9/contrib/tzdata/leap-seconds.list ============================================================================== --- stable/9/contrib/tzdata/leap-seconds.list Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/leap-seconds.list Fri Mar 6 22:08:47 2015 (r279708) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/northamerica Fri Mar 6 22:08:47 2015 (r279708) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: stable/9/contrib/tzdata/southamerica ============================================================================== --- stable/9/contrib/tzdata/southamerica Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/southamerica Fri Mar 6 22:08:47 2015 (r279708) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: stable/9/contrib/tzdata/zone.tab ============================================================================== --- stable/9/contrib/tzdata/zone.tab Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/zone.tab Fri Mar 6 22:08:47 2015 (r279708) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: stable/9/contrib/tzdata/zone1970.tab ============================================================================== --- stable/9/contrib/tzdata/zone1970.tab Fri Mar 6 21:56:44 2015 (r279707) +++ stable/9/contrib/tzdata/zone1970.tab Fri Mar 6 22:08:47 2015 (r279708) @@ -234,7 +234,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:09:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0BD9F42; Fri, 6 Mar 2015 22:09:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9FD6A82; Fri, 6 Mar 2015 22:09:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26M9lXn009281; Fri, 6 Mar 2015 22:09:47 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26M9jO9009270; Fri, 6 Mar 2015 22:09:45 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062209.t26M9jO9009270@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 22:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r279709 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:09:48 -0000 Author: edwin Date: Fri Mar 6 22:09:44 2015 New Revision: 279709 URL: https://svnweb.freebsd.org/changeset/base/279709 Log: MFC of 279706,tzdata8: Release 2015a - 2015-01-29 Changes affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: stable/8/share/zoneinfo/antarctica stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/backward stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/leap-seconds.list stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/southamerica stable/8/share/zoneinfo/zone.tab stable/8/share/zoneinfo/zone1970.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/antarctica ============================================================================== --- stable/8/share/zoneinfo/antarctica Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/antarctica Fri Mar 6 22:09:44 2015 (r279709) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/asia Fri Mar 6 22:09:44 2015 (r279709) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: stable/8/share/zoneinfo/backward ============================================================================== --- stable/8/share/zoneinfo/backward Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/backward Fri Mar 6 22:09:44 2015 (r279709) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/europe Fri Mar 6 22:09:44 2015 (r279709) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: stable/8/share/zoneinfo/leap-seconds.list ============================================================================== --- stable/8/share/zoneinfo/leap-seconds.list Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/leap-seconds.list Fri Mar 6 22:09:44 2015 (r279709) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/northamerica Fri Mar 6 22:09:44 2015 (r279709) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: stable/8/share/zoneinfo/southamerica ============================================================================== --- stable/8/share/zoneinfo/southamerica Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/southamerica Fri Mar 6 22:09:44 2015 (r279709) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: stable/8/share/zoneinfo/zone.tab ============================================================================== --- stable/8/share/zoneinfo/zone.tab Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/zone.tab Fri Mar 6 22:09:44 2015 (r279709) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: stable/8/share/zoneinfo/zone1970.tab ============================================================================== --- stable/8/share/zoneinfo/zone1970.tab Fri Mar 6 22:08:47 2015 (r279708) +++ stable/8/share/zoneinfo/zone1970.tab Fri Mar 6 22:09:44 2015 (r279709) @@ -234,7 +234,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:10:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C42AF7; Fri, 6 Mar 2015 22:10:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8582CB60; Fri, 6 Mar 2015 22:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26MAGNX009509; Fri, 6 Mar 2015 22:10:16 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26MAE3h009496; Fri, 6 Mar 2015 22:10:14 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062210.t26MAE3h009496@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 22:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r279710 - stable/7/share/zoneinfo X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:10:16 -0000 Author: edwin Date: Fri Mar 6 22:10:13 2015 New Revision: 279710 URL: https://svnweb.freebsd.org/changeset/base/279710 Log: MFC of 279706,tzdata7: Release 2015a - 2015-01-29 Changes affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: stable/7/share/zoneinfo/antarctica stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/backward stable/7/share/zoneinfo/europe stable/7/share/zoneinfo/leap-seconds.list stable/7/share/zoneinfo/northamerica stable/7/share/zoneinfo/southamerica stable/7/share/zoneinfo/zone.tab stable/7/share/zoneinfo/zone1970.tab Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/antarctica ============================================================================== --- stable/7/share/zoneinfo/antarctica Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/antarctica Fri Mar 6 22:10:13 2015 (r279710) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/asia Fri Mar 6 22:10:13 2015 (r279710) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: stable/7/share/zoneinfo/backward ============================================================================== --- stable/7/share/zoneinfo/backward Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/backward Fri Mar 6 22:10:13 2015 (r279710) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: stable/7/share/zoneinfo/europe ============================================================================== --- stable/7/share/zoneinfo/europe Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/europe Fri Mar 6 22:10:13 2015 (r279710) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: stable/7/share/zoneinfo/leap-seconds.list ============================================================================== --- stable/7/share/zoneinfo/leap-seconds.list Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/leap-seconds.list Fri Mar 6 22:10:13 2015 (r279710) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: stable/7/share/zoneinfo/northamerica ============================================================================== --- stable/7/share/zoneinfo/northamerica Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/northamerica Fri Mar 6 22:10:13 2015 (r279710) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: stable/7/share/zoneinfo/southamerica ============================================================================== --- stable/7/share/zoneinfo/southamerica Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/southamerica Fri Mar 6 22:10:13 2015 (r279710) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: stable/7/share/zoneinfo/zone.tab ============================================================================== --- stable/7/share/zoneinfo/zone.tab Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/zone.tab Fri Mar 6 22:10:13 2015 (r279710) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: stable/7/share/zoneinfo/zone1970.tab ============================================================================== --- stable/7/share/zoneinfo/zone1970.tab Fri Mar 6 22:09:44 2015 (r279709) +++ stable/7/share/zoneinfo/zone1970.tab Fri Mar 6 22:10:13 2015 (r279710) @@ -234,7 +234,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:10:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C13A8225; Fri, 6 Mar 2015 22:10:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAADDB69; Fri, 6 Mar 2015 22:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26MAji3010136; Fri, 6 Mar 2015 22:10:45 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26MAhOf010127; Fri, 6 Mar 2015 22:10:43 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503062210.t26MAhOf010127@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Fri, 6 Mar 2015 22:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r279711 - stable/6/share/zoneinfo X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:10:46 -0000 Author: edwin Date: Fri Mar 6 22:10:42 2015 New Revision: 279711 URL: https://svnweb.freebsd.org/changeset/base/279711 Log: MFC of 279706,tzdata6: Release 2015a - 2015-01-29 Changes affecting future time stamps The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.) Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.) New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49. (Thanks to Tim Parenti.) Changes affecting past time stamps Iceland observed DST in 1919 and 1921, and its 1939 fallback transition was Oct. 29, not Nov. 29. Remove incorrect data from Shanks about time in Iceland between 1837 and 1908. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. Modified: stable/6/share/zoneinfo/antarctica stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/backward stable/6/share/zoneinfo/europe stable/6/share/zoneinfo/leap-seconds.list stable/6/share/zoneinfo/northamerica stable/6/share/zoneinfo/southamerica stable/6/share/zoneinfo/zone.tab stable/6/share/zoneinfo/zone1970.tab Directory Properties: stable/6/share/zoneinfo/ (props changed) Modified: stable/6/share/zoneinfo/antarctica ============================================================================== --- stable/6/share/zoneinfo/antarctica Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/antarctica Fri Mar 6 22:10:42 2015 (r279711) @@ -47,8 +47,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -354,9 +354,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 + -4:00 ArgAQ AR%sT 1969 Oct 5 -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT + -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u + -3:00 - CLT # # # McMurdo Station, Ross Island, since 1955-12 Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/asia Fri Mar 6 22:10:42 2015 (r279711) @@ -145,10 +145,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 4:00 Azer AZ%sT # Bahrain -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah - 4:00 - GST 1972 Jun - 3:00 - AST +# See Asia/Qatar. # Bangladesh # From Alexander Krivenyshev (2009-05-13): @@ -1731,9 +1728,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A ############################################################################### # Kuwait -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kuwait 3:11:56 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. # Laos # See Asia/Bangkok. @@ -1954,12 +1949,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman - -# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:24 - LMT 1920 - 4:00 - GST +# See Asia/Dubai. # Pakistan @@ -2453,6 +2443,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 De Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha 4:00 - GST 1972 Jun 3:00 - AST +Link Asia/Qatar Asia/Bahrain # Saudi Arabia # @@ -2479,6 +2470,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 3:00 - AST +Link Asia/Riyadh Asia/Aden # Yemen +Link Asia/Riyadh Asia/Kuwait # Singapore # taken from Mok Ly Yng (2003-10-30) @@ -2767,6 +2760,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 Ma # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dubai 3:41:12 - LMT 1920 4:00 - GST +Link Asia/Dubai Asia/Muscat # Oman # Uzbekistan # Byalokoz 1919 says Uzbekistan was 4:27:53. @@ -2851,10 +2845,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen - -# Milne says 2:59:54 was the meridian of the saluting battery at Aden, -# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 2:59:54 - LMT 1950 - 3:00 - AST +# See Asia/Riyadh. Modified: stable/6/share/zoneinfo/backward ============================================================================== --- stable/6/share/zoneinfo/backward Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/backward Fri Mar 6 22:10:42 2015 (r279711) @@ -5,7 +5,7 @@ # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME -Link Africa/Asmara Africa/Asmera +Link Africa/Nairobi Africa/Asmera Link Africa/Abidjan Africa/Timbuktu Link America/Argentina/Catamarca America/Argentina/ComodRivadavia Link America/Adak America/Atka Modified: stable/6/share/zoneinfo/europe ============================================================================== --- stable/6/share/zoneinfo/europe Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/europe Fri Mar 6 22:10:42 2015 (r279711) @@ -1407,35 +1407,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 # might be a reference to the Julian calendar as opposed to Gregorian, or it # might mean something else (???). # -# From Paul Eggert (2006-03-22): -# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points. -# We go with the Almanak, except for one claim from Shanks & Pottenger, namely -# that Reykavik was 21W57 from 1837 to 1908, local mean time before that. +# From Paul Eggert (2014-11-22): +# The information below is taken from the 1988 Almanak; see +# http://www.almanak.hi.is/klukkan.html # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S +Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S Rule Iceland 1917 only - Oct 21 1:00 0 - -Rule Iceland 1918 only - Nov 16 1:00 0 - +Rule Iceland 1918 1919 - Nov 16 1:00 0 - +Rule Iceland 1921 only - Mar 19 23:00 1:00 S +Rule Iceland 1921 only - Jun 23 1:00 0 - Rule Iceland 1939 only - Apr 29 23:00 1:00 S -Rule Iceland 1939 only - Nov 29 2:00 0 - +Rule Iceland 1939 only - Oct 29 2:00 0 - Rule Iceland 1940 only - Feb 25 2:00 1:00 S -Rule Iceland 1940 only - Nov 3 2:00 0 - -Rule Iceland 1941 only - Mar 2 1:00s 1:00 S -Rule Iceland 1941 only - Nov 2 1:00s 0 - -Rule Iceland 1942 only - Mar 8 1:00s 1:00 S -Rule Iceland 1942 only - Oct 25 1:00s 0 - +Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 - +Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S # 1943-1946 - first Sunday in March until first Sunday in winter Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S -Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 - +Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 - # 1947-1967 - first Sunday in April until first Sunday in winter Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S -# 1949 Oct transition delayed by 1 week +# 1949 and 1967 Oct transitions delayed by 1 week Rule Iceland 1949 only - Oct 30 1:00s 0 - Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 - Rule Iceland 1967 only - Oct 29 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 - -1:27:48 - RMT 1908 # Reykjavik Mean Time? +Zone Atlantic/Reykjavik -1:28 - LMT 1908 -1:00 Iceland IS%sT 1968 Apr 7 1:00s 0:00 - GMT Modified: stable/6/share/zoneinfo/leap-seconds.list ============================================================================== --- stable/6/share/zoneinfo/leap-seconds.list Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/leap-seconds.list Fri Mar 6 22:10:42 2015 (r279711) @@ -47,7 +47,7 @@ # 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 definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different @@ -127,6 +127,15 @@ # 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 +# defintion of UTC. +# # Questions or comments to: # Judah Levine # Time and Frequency Division @@ -134,7 +143,7 @@ # Boulder, Colorado # Judah.Levine@nist.gov # -# Last Update of leap second values: 11 January 2012 +# Last Update of leap second values: 5 January 2015 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -142,7 +151,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3535228800 +#$ 3629404800 # # 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 @@ -190,10 +199,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C48 -# File expires on: 28 June 2015 +# Updated through IERS Bulletin C49 +# File expires on: 28 December 2015 # -#@ 3644438400 +#@ 3660249600 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -221,6 +230,7 @@ 3345062400 33 # 1 Jan 2006 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 # # the following special comment contains the # hash value of the data in this file computed @@ -236,4 +246,4 @@ # the hash line is also ignored in the # computation. # -#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e +#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c Modified: stable/6/share/zoneinfo/northamerica ============================================================================== --- stable/6/share/zoneinfo/northamerica Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/northamerica Fri Mar 6 22:10:42 2015 (r279711) @@ -124,7 +124,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:0 Rule US 1918 1919 - Oct lastSun 2:00 0 S Rule US 1942 only - Feb 9 2:00 1:00 W # War Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace -Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1945 only - Sep lastSun 2:00 0 S Rule US 1967 2006 - Oct lastSun 2:00 0 S Rule US 1967 1973 - Apr lastSun 2:00 1:00 D Rule US 1974 only - Jan 6 2:00 1:00 D @@ -2124,11 +2124,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 # Mexico -# From Paul Eggert (2001-03-05): +# From Paul Eggert (2014-12-07): # The Investigation and Analysis Service of the # Mexican Library of Congress (MLoC) has published a # history of Mexican local time (in Spanish) -# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/ +# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm # # Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC. # (In all cases we go with the MLoC.) @@ -2297,6 +2297,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # efecto desde las dos horas del segundo domingo de marzo y concluirá a # las dos horas del primer domingo de noviembre. +# From Steffen Thorsen (2014-12-08), translated by Gwillim Law: +# The Mexican state of Quintana Roo will likely change to EST in 2015. +# +# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo +# "With this change, the time conflict that has existed between the municipios +# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an +# end. The latter declared itself in rebellion 15 years ago when a time change +# was initiated in Mexico, and since then it has refused to change its time +# zone along with the rest of the country." +# +# From Steffen Thorsen (2015-01-14), translated by Gwillim Law: +# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html +# "...the new time zone will come into effect at two o'clock on the first Sunday +# of February, when we will have to advance the clock one hour from its current +# time..." +# +# Also, the new zone will not use DST. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2317,7 +2335,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56 -6:00 - CST 1981 Dec 23 -5:00 Mexico E%sT 1998 Aug 2 2:00 - -6:00 Mexico C%sT + -6:00 Mexico C%sT 2015 Feb 1 2:00 + -5:00 - EST # Campeche, Yucatán; represented by Mérida Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 Modified: stable/6/share/zoneinfo/southamerica ============================================================================== --- stable/6/share/zoneinfo/southamerica Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/southamerica Fri Mar 6 22:10:42 2015 (r279711) @@ -1206,6 +1206,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf +# From Juan Correa (2015-01-28): +# ... today the Ministry of Energy announced that Chile will drop DST, will keep +# "summer time" (UTC -3 / UTC -5) all year round.... +# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1247,8 +1252,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S +Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1259,11 +1264,13 @@ Zone America/Santiago -4:42:46 - LMT 189 -4:00 - CLT 1919 Jul 1 # Chile Time -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time -5:00 Chile CL%sT 1947 May 22 # Chile Time - -4:00 Chile CL%sT + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time - -6:00 Chile EAS%sT + -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -6:00 Chile EAS%sT 2015 Apr 26 3:00u + -5:00 - EAST # # Salas y Gómez Island is uninhabited. # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, Modified: stable/6/share/zoneinfo/zone.tab ============================================================================== --- stable/6/share/zoneinfo/zone.tab Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/zone.tab Fri Mar 6 22:10:42 2015 (r279711) @@ -274,7 +274,7 @@ MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border Modified: stable/6/share/zoneinfo/zone1970.tab ============================================================================== --- stable/6/share/zoneinfo/zone1970.tab Fri Mar 6 22:10:13 2015 (r279710) +++ stable/6/share/zoneinfo/zone1970.tab Fri Mar 6 22:10:42 2015 (r279711) @@ -234,7 +234,7 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MX +1924-09909 America/Mexico_City Central Time - most locations -MX +2105-08646 America/Cancun Central Time - Quintana Roo +MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatán MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:22:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF7C64A; Fri, 6 Mar 2015 22:22:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25BB2C90; Fri, 6 Mar 2015 22:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26MMv5t018270; Fri, 6 Mar 2015 22:22:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26MMvv5018269; Fri, 6 Mar 2015 22:22:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503062222.t26MMvv5018269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 Mar 2015 22:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279712 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:22:58 -0000 Author: pfg Date: Fri Mar 6 22:22:57 2015 New Revision: 279712 URL: https://svnweb.freebsd.org/changeset/base/279712 Log: compat_passwd(): yet another uninitialized access to stayopen. CID: 1018731 Modified: head/lib/libc/gen/getpwent.c Modified: head/lib/libc/gen/getpwent.c ============================================================================== --- head/lib/libc/gen/getpwent.c Fri Mar 6 22:10:42 2015 (r279711) +++ head/lib/libc/gen/getpwent.c Fri Mar 6 22:22:57 2015 (r279712) @@ -1942,7 +1942,7 @@ docompat: break; } fin: - if (!stayopen && st->db != NULL) { + if (st->db != NULL && !stayopen) { (void)st->db->close(st->db); st->db = NULL; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:31:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D96CE9E4; Fri, 6 Mar 2015 22:31:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3D7ED7C; Fri, 6 Mar 2015 22:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26MVZfn022742; Fri, 6 Mar 2015 22:31:35 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26MVZe6022741; Fri, 6 Mar 2015 22:31:35 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201503062231.t26MVZe6022741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 6 Mar 2015 22:31:35 +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: r279713 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:31:36 -0000 Author: jkim Date: Fri Mar 6 22:31:35 2015 New Revision: 279713 URL: https://svnweb.freebsd.org/changeset/base/279713 Log: MFC: r279364 Use realpath(3) to properly expand $ORIGIN to its absolute path. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Mar 6 22:22:57 2015 (r279712) +++ stable/10/libexec/rtld-elf/rtld.c Fri Mar 6 22:31:35 2015 (r279713) @@ -3420,17 +3420,16 @@ rtld_dirname(const char *path, char *bna static int rtld_dirname_abs(const char *path, char *base) { - char base_rel[PATH_MAX]; + char *last; - if (rtld_dirname(path, base) == -1) + if (realpath(path, base) == NULL) return (-1); - if (base[0] == '/') - return (0); - if (getcwd(base_rel, sizeof(base_rel)) == NULL || - strlcat(base_rel, "/", sizeof(base_rel)) >= sizeof(base_rel) || - strlcat(base_rel, base, sizeof(base_rel)) >= sizeof(base_rel)) + dbg("%s -> %s", path, base); + last = strrchr(base, '/'); + if (last == NULL) return (-1); - strcpy(base, base_rel); + if (last != base) + *last = '\0'; return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:34:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19E15B4B; Fri, 6 Mar 2015 22:34:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 042A3D9B; Fri, 6 Mar 2015 22:34:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26MY9FB023412; Fri, 6 Mar 2015 22:34:09 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26MY9xR023411; Fri, 6 Mar 2015 22:34:09 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201503062234.t26MY9xR023411@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 6 Mar 2015 22:34:09 +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: r279714 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:34:10 -0000 Author: jkim Date: Fri Mar 6 22:34:09 2015 New Revision: 279714 URL: https://svnweb.freebsd.org/changeset/base/279714 Log: MFC: r279713 Use realpath(3) to properly expand $ORIGIN to its absolute path. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Fri Mar 6 22:31:35 2015 (r279713) +++ stable/9/libexec/rtld-elf/rtld.c Fri Mar 6 22:34:09 2015 (r279714) @@ -3415,17 +3415,16 @@ rtld_dirname(const char *path, char *bna static int rtld_dirname_abs(const char *path, char *base) { - char base_rel[PATH_MAX]; + char *last; - if (rtld_dirname(path, base) == -1) + if (realpath(path, base) == NULL) return (-1); - if (base[0] == '/') - return (0); - if (getcwd(base_rel, sizeof(base_rel)) == NULL || - strlcat(base_rel, "/", sizeof(base_rel)) >= sizeof(base_rel) || - strlcat(base_rel, base, sizeof(base_rel)) >= sizeof(base_rel)) + dbg("%s -> %s", path, base); + last = strrchr(base, '/'); + if (last == NULL) return (-1); - strcpy(base, base_rel); + if (last != base) + *last = '\0'; return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:35:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A2E6C85; Fri, 6 Mar 2015 22:35:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E91EDDA6; Fri, 6 Mar 2015 22:35:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26MZ12g023605; Fri, 6 Mar 2015 22:35:01 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26MZ1WQ023604; Fri, 6 Mar 2015 22:35:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201503062235.t26MZ1WQ023604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 6 Mar 2015 22:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r279715 - stable/8/libexec/rtld-elf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:35:02 -0000 Author: jkim Date: Fri Mar 6 22:35:01 2015 New Revision: 279715 URL: https://svnweb.freebsd.org/changeset/base/279715 Log: MFC: r279364 Use realpath(3) to properly expand $ORIGIN to its absolute path. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Fri Mar 6 22:34:09 2015 (r279714) +++ stable/8/libexec/rtld-elf/rtld.c Fri Mar 6 22:35:01 2015 (r279715) @@ -2563,17 +2563,16 @@ rtld_dirname(const char *path, char *bna static int rtld_dirname_abs(const char *path, char *base) { - char base_rel[PATH_MAX]; + char *last; - if (rtld_dirname(path, base) == -1) + if (realpath(path, base) == NULL) return (-1); - if (base[0] == '/') - return (0); - if (getcwd(base_rel, sizeof(base_rel)) == NULL || - strlcat(base_rel, "/", sizeof(base_rel)) >= sizeof(base_rel) || - strlcat(base_rel, base, sizeof(base_rel)) >= sizeof(base_rel)) + dbg("%s -> %s", path, base); + last = strrchr(base, '/'); + if (last == NULL) return (-1); - strcpy(base, base_rel); + if (last != base) + *last = '\0'; return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 22:40:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC7E0C81; Fri, 6 Mar 2015 22:40:10 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 729C5116E; Fri, 6 Mar 2015 22:40:10 +0000 (UTC) Message-ID: <54FA2CC9.3030002@FreeBSD.org> Date: Fri, 06 Mar 2015 17:40:09 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r279714 - stable/9/libexec/rtld-elf References: <201503062234.t26MY9xR023411@svn.freebsd.org> In-Reply-To: <201503062234.t26MY9xR023411@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 22:40:11 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 03/06/2015 17:34, Jung-uk Kim wrote: > Author: jkim Date: Fri Mar 6 22:34:09 2015 New Revision: 279714 > URL: https://svnweb.freebsd.org/changeset/base/279714 > > Log: MFC: r279713 > > Use realpath(3) to properly expand $ORIGIN to its absolute path. ... I meant to write: MFC: r279364 Sorry for the copy-and-pasto. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU+izBAAoJEHyflib82/FGt6AH/jXGQ+augiSYk33BNYWQ32a/ 93tw00QUQ2TLaXtuadBUmuXIGznJiT7ZXMzJPxutJmi3L7gq4lqfoUAu5c/oLEKI nNy37szC7dxujwzCXysKLyom9fpAWYJ+lEoL13Bz0t9YRae+lgvRgyZTG62she3Y h5Q4ZDpiGj9UNdRZNpa3E4SidLn40oLIV3iqFB3jCMe95g9zoKTppCvmlHlNZKpb cIrrHPzI9KbuV6aw2geFcZG1DgYJD/xH/wr/yk/a/oZSOnZqYsOOdxfvA7g9ZOg3 A2O+w9qGkWDM03Ps1VvvlltXNfJkCk49j8mH12QD6FVG4ziW6TIkWzat4kDDI/I= =NTRb -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 23:17:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA64AA1B; Fri, 6 Mar 2015 23:17:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5B662E3; Fri, 6 Mar 2015 23:17:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t26NHIbm045803; Fri, 6 Mar 2015 23:17:18 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t26NHIuN045802; Fri, 6 Mar 2015 23:17:18 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201503062317.t26NHIuN045802@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 6 Mar 2015 23:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279716 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 23:17:19 -0000 Author: jmg Date: Fri Mar 6 23:17:18 2015 New Revision: 279716 URL: https://svnweb.freebsd.org/changeset/base/279716 Log: make things a bit more clear.. we worked together on language.. Submitted by: Justin Cormack Modified: head/lib/libc/sys/cap_ioctls_limit.2 Modified: head/lib/libc/sys/cap_ioctls_limit.2 ============================================================================== --- head/lib/libc/sys/cap_ioctls_limit.2 Fri Mar 6 22:35:01 2015 (r279715) +++ head/lib/libc/sys/cap_ioctls_limit.2 Fri Mar 6 23:17:18 2015 (r279716) @@ -61,6 +61,8 @@ argument specifies the number of element There can be up to .Va 256 elements in the array. +Including an element that has been previously revoked will generate an error. +After a successful call only those listed in the array may be used. .Pp The list of allowed ioctl commands for a given file descriptor can be obtained with the From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 01:42:05 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA5882C5; Sat, 7 Mar 2015 01:42:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5DF8303; Sat, 7 Mar 2015 01:42:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t271g5SP016543; Sat, 7 Mar 2015 01:42:05 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t271g5cJ016541; Sat, 7 Mar 2015 01:42:05 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503070142.t271g5cJ016541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 7 Mar 2015 01:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279718 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 01:42:06 -0000 Author: loos Date: Sat Mar 7 01:42:04 2015 New Revision: 279718 URL: https://svnweb.freebsd.org/changeset/base/279718 Log: Bump .Dd to current date (which I should have done as part of initial commit). Connect ds3231.4 to the build. Modified: head/share/man/man4/Makefile head/share/man/man4/ds3231.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Mar 6 23:55:36 2015 (r279717) +++ head/share/man/man4/Makefile Sat Mar 7 01:42:04 2015 (r279718) @@ -119,6 +119,7 @@ MAN= aac.4 \ divert.4 \ ${_dpms.4} \ dpt.4 \ + ds3231.4 \ dummynet.4 \ ed.4 \ edsc.4 \ Modified: head/share/man/man4/ds3231.4 ============================================================================== --- head/share/man/man4/ds3231.4 Fri Mar 6 23:55:36 2015 (r279717) +++ head/share/man/man4/ds3231.4 Sat Mar 7 01:42:04 2015 (r279718) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2014 +.Dd March 6, 2015 .Dt DS3231 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 03:48:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F609A10; Sat, 7 Mar 2015 03:48:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B05ED8; Sat, 7 Mar 2015 03:48:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t273mXkx075150; Sat, 7 Mar 2015 03:48:33 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t273mXYF075149; Sat, 7 Mar 2015 03:48:33 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201503070348.t273mXYF075149@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sat, 7 Mar 2015 03:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279719 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 03:48:33 -0000 Author: jmg Date: Sat Mar 7 03:48:32 2015 New Revision: 279719 URL: https://svnweb.freebsd.org/changeset/base/279719 Log: forgot to bump date, and replace contraction (igor)... Modified: head/lib/libc/sys/cap_ioctls_limit.2 Modified: head/lib/libc/sys/cap_ioctls_limit.2 ============================================================================== --- head/lib/libc/sys/cap_ioctls_limit.2 Sat Mar 7 01:42:04 2015 (r279718) +++ head/lib/libc/sys/cap_ioctls_limit.2 Sat Mar 7 03:48:32 2015 (r279719) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd March 6, 2015 .Dt CAP_IOCTLS_LIMIT 2 .Os .Sh NAME @@ -94,7 +94,7 @@ system call was never called for this fi .Fn cap_ioctls_get system call will return .Dv CAP_IOCTLS_ALL -and won't modify the buffer pointed to by the +and will not modify the buffer pointed to by the .Fa cmds argument. .Sh RETURN VALUES From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 04:18:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34BA8195; Sat, 7 Mar 2015 04:18:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20A25665; Sat, 7 Mar 2015 04:18:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t274IesX089693; Sat, 7 Mar 2015 04:18:40 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t274Iejv089692; Sat, 7 Mar 2015 04:18:40 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201503070418.t274Iejv089692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 7 Mar 2015 04:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279720 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 04:18:41 -0000 Author: alc Date: Sat Mar 7 04:18:40 2015 New Revision: 279720 URL: https://svnweb.freebsd.org/changeset/base/279720 Log: Correct a typo in vm_object_backing_scan() that originated in r254141. Specifically, change a lock acquire into a lock release. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Mar 7 03:48:32 2015 (r279719) +++ head/sys/vm/vm_object.c Sat Mar 7 04:18:40 2015 (r279720) @@ -1626,7 +1626,7 @@ vm_object_backing_scan(vm_object_t objec p = next; continue; } - VM_OBJECT_WLOCK(backing_object); + VM_OBJECT_WUNLOCK(backing_object); VM_OBJECT_WUNLOCK(object); VM_WAIT; VM_OBJECT_WLOCK(object); From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 04:38:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 435E74C1; Sat, 7 Mar 2015 04:38:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9348A9; Sat, 7 Mar 2015 04:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t274cQdA098921; Sat, 7 Mar 2015 04:38:26 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t274cQLf098920; Sat, 7 Mar 2015 04:38:26 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503070438.t274cQLf098920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 7 Mar 2015 04:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279721 - head/sys/cddl/dev/dtrace/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 04:38:26 -0000 Author: gnn Date: Sat Mar 7 04:38:25 2015 New Revision: 279721 URL: https://svnweb.freebsd.org/changeset/base/279721 Log: Add support for walltimestamp to DTrace on ARM. Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Sat Mar 7 04:18:40 2015 (r279720) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Sat Mar 7 04:38:25 2015 (r279721) @@ -55,6 +55,7 @@ extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); +extern void dtrace_getnanotime(struct timespec *tsp); int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); void dtrace_invop_init(void); @@ -173,11 +174,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - struct timespec curtime; + struct timespec current_time; - getnanotime(&curtime); + dtrace_getnanotime(¤t_time); - return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + return (current_time.tv_sec * 1000000000UL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 13:54:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DB1189; Sat, 7 Mar 2015 13:54:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA09AF; Sat, 7 Mar 2015 13:54:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Dsj9d058888; Sat, 7 Mar 2015 13:54:45 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27DsjLq058887; Sat, 7 Mar 2015 13:54:45 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503071354.t27DsjLq058887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 7 Mar 2015 13:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279722 - head/tools/regression/usr.bin/env X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 13:54:45 -0000 Author: jilles Date: Sat Mar 7 13:54:44 2015 New Revision: 279722 URL: https://svnweb.freebsd.org/changeset/base/279722 Log: env: Fix testsuite for additional variables set by sh. MFC after: 1 week Modified: head/tools/regression/usr.bin/env/regress-env.rgdata Modified: head/tools/regression/usr.bin/env/regress-env.rgdata ============================================================================== --- head/tools/regression/usr.bin/env/regress-env.rgdata Sat Mar 7 04:38:25 2015 (r279721) +++ head/tools/regression/usr.bin/env/regress-env.rgdata Sat Mar 7 13:54:44 2015 (r279722) @@ -235,9 +235,9 @@ gblenv=OUTSIDEVAR=OutsideValue script:/bin/echo "=== set ===" script:# drop some environment variables that 'sh' itself sets, and script:# then have 'set' print out all remaining environment variables. - script:# (can't unset OPTIND, so we use grep to get rid of that) - script:unset -v IFS PS1 PS2 PPID - script:set | grep -v '^OPTIND=' | sort + script:# (can't unset OPTIND/PWD, so we use grep to get rid of those) + script:unset -v IFS PS1 PS2 PS4 PPID + script:set | grep -Ev '^(OPTIND|PWD)=' | sort stdout:=== set === stdout:PATH=/bin:/usr/bin:/Not stdout:TESTVAR=SbValue From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 15:18:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09C08F78; Sat, 7 Mar 2015 15:18:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE665C50; Sat, 7 Mar 2015 15:18:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27FIwoE097300; Sat, 7 Mar 2015 15:18:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27FIvUf097296; Sat, 7 Mar 2015 15:18:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503071518.t27FIvUf097296@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Mar 2015 15:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279723 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 15:18:59 -0000 Author: ian Date: Sat Mar 7 15:18:57 2015 New Revision: 279723 URL: https://svnweb.freebsd.org/changeset/base/279723 Log: Define new linker set, UART_FDT_CLASS_AND_DEVICE, for registering full (class and device) FDT UART. Define second one, UART_FDT_CLASS, for UART class only. This paves the way for declaring uart_class data and ofw/fdt compat data with a uart implementation, rather than needing a big global table of compat data and weak-symbol declarations of every existing implementation. Differential Revision: https://reviews.freebsd.org/D1992 Submitted by: Michal Meloun Added: head/sys/dev/uart/uart_cpu_fdt.h (contents, props changed) Modified: head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Sat Mar 7 13:54:44 2015 (r279722) +++ head/sys/dev/uart/uart.h Sat Mar 7 15:18:57 2015 (r279723) @@ -80,10 +80,6 @@ extern struct uart_class uart_vybrid_cla extern struct uart_class at91_usart_class __attribute__((weak)); extern struct uart_class uart_exynos4210_class __attribute__((weak)); -#ifdef FDT -struct ofw_compat_data; -extern const struct ofw_compat_data *uart_fdt_compat_data; -#endif #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sat Mar 7 13:54:44 2015 (r279722) +++ head/sys/dev/uart/uart_bus_fdt.c Sat Mar 7 15:18:57 2015 (r279723) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int uart_fdt_probe(device_t); @@ -91,7 +92,7 @@ static struct ofw_compat_data compat_dat }; /* Export the compat_data table for use by the uart_cpu_fdt.c probe routine. */ -const struct ofw_compat_data *uart_fdt_compat_data = compat_data; +UART_FDT_CLASS_AND_DEVICE(compat_data); static int uart_fdt_get_clock(phandle_t node, pcell_t *cell) @@ -127,6 +128,20 @@ uart_fdt_get_shift(phandle_t node, pcell return (0); } +static uintptr_t +uart_fdt_find_device(device_t dev) +{ + struct ofw_compat_data **cd; + const struct ofw_compat_data *ocd; + + SET_FOREACH(cd, uart_fdt_class_and_device_set) { + ocd = ofw_bus_search_compatible(dev, *cd); + if (ocd->ocd_data != 0) + return (ocd->ocd_data); + } + return (0); +} + static int uart_fdt_probe(device_t dev) { @@ -134,19 +149,16 @@ uart_fdt_probe(device_t dev) phandle_t node; pcell_t clock, shift; int err; - const struct ofw_compat_data * cd; sc = device_get_softc(dev); if (!ofw_bus_status_okay(dev)) return (ENXIO); - cd = ofw_bus_search_compatible(dev, compat_data); - if (cd->ocd_data == (uintptr_t)NULL) + sc->sc_class = (struct uart_class *)uart_fdt_find_device(dev); + if (sc->sc_class == NULL) return (ENXIO); - sc->sc_class = (struct uart_class *)cd->ocd_data; - node = ofw_bus_get_node(dev); if ((err = uart_fdt_get_clock(node, &clock)) != 0) Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Mar 7 13:54:44 2015 (r279722) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Mar 7 15:18:57 2015 (r279723) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * UART console routines. @@ -115,13 +116,46 @@ phandle_chosen_propdev(phandle_t chosen, return (0); } +static const struct ofw_compat_data * +uart_fdt_find_compatible(phandle_t node, const struct ofw_compat_data *cd) +{ + const struct ofw_compat_data *ocd; + + for (ocd = cd; ocd->ocd_str != NULL; ocd++) { + if (fdt_is_compatible(node, ocd->ocd_str)) + return (ocd); + } + return (NULL); +} + +static uintptr_t +uart_fdt_find_by_node(phandle_t node, int class_list) +{ + struct ofw_compat_data **cd; + const struct ofw_compat_data *ocd; + + if (class_list) { + SET_FOREACH(cd, uart_fdt_class_set) { + ocd = uart_fdt_find_compatible(node, *cd); + if ((ocd != NULL) && (ocd->ocd_data != 0)) + return (ocd->ocd_data); + } + } else { + SET_FOREACH(cd, uart_fdt_class_and_device_set) { + ocd = uart_fdt_find_compatible(node, *cd); + if ((ocd != NULL) && (ocd->ocd_data != 0)) + return (ocd->ocd_data); + } + } + return (0); +} + int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", "stdin-path", "stdin", NULL}; const char **name; - const struct ofw_compat_data *cd; struct uart_class *class; phandle_t node, chosen; pcell_t shift, br, rclk; @@ -160,24 +194,32 @@ uart_cpu_getdev(int devtype, struct uart * Retrieve serial attributes. */ uart_fdt_get_shift(node, &shift); - if (OF_getprop(node, "current-speed", &br, sizeof(br)) <= 0) br = 0; - br = fdt32_to_cpu(br); + else + br = fdt32_to_cpu(br); - if ((err = uart_fdt_get_clock(node, &rclk)) != 0) - return (err); /* - * Finalize configuration. + * Check old style of UART definition first. Unfortunately, the common + * FDT processing is not possible if we have clock, power domains and + * pinmux stuff. */ - for (cd = uart_fdt_compat_data; cd->ocd_str != NULL; ++cd) { - if (fdt_is_compatible(node, cd->ocd_str)) - break; + class = (struct uart_class *)uart_fdt_find_by_node(node, 0); + if (class != NULL) { + if ((err = uart_fdt_get_clock(node, &rclk)) != 0) + return (err); + } else { + /* Check class only linker set */ + class = + (struct uart_class *)uart_fdt_find_by_node(node, 1); + if (class == NULL) + return (ENXIO); + rclk = 0; } - if (cd->ocd_str == NULL) - return (ENXIO); - class = (struct uart_class *)cd->ocd_data; + /* + * Finalize configuration. + */ di->bas.chan = 0; di->bas.regshft = (u_int)shift; di->baudrate = br; Added: head/sys/dev/uart/uart_cpu_fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_cpu_fdt.h Sat Mar 7 15:18:57 2015 (r279723) @@ -0,0 +1,54 @@ +/*- + * Copyright 2015 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_UART_CPU_FDT_H_ +#define _DEV_UART_CPU_FDT_H_ + +#include + +#include + +/* + * If your UART driver implements only uart_class and uses uart_cpu_fdt.c + * for device instantiation, then use UART_FDT_CLASS_AND_DEVICE for its + * declaration + */ +SET_DECLARE(uart_fdt_class_and_device_set, struct ofw_compat_data ); +#define UART_FDT_CLASS_AND_DEVICE(data) \ + DATA_SET(uart_fdt_class_and_device_set, data) + +/* + * If your UART driver implements uart_class and custom device layer, + * then use UART_FDT_CLASS for its declaration + */ +SET_DECLARE(uart_fdt_class_set, struct ofw_compat_data ); +#define UART_FDT_CLASS(data) \ + DATA_SET(uart_fdt_class_set, data) + + +#endif /* _DEV_UART_CPU_FDT_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 15:24:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DBDE872; Sat, 7 Mar 2015 15:24:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27159D83; Sat, 7 Mar 2015 15:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27FOLCM001805; Sat, 7 Mar 2015 15:24:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27FOG14001780; Sat, 7 Mar 2015 15:24:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503071524.t27FOG14001780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Mar 2015 15:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279724 - in head/sys: arm/at91 arm/freescale/vybrid arm/samsung/exynos arm/samsung/s3c2xx0 arm/xilinx dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 15:24:21 -0000 Author: ian Date: Sat Mar 7 15:24:15 2015 New Revision: 279724 URL: https://svnweb.freebsd.org/changeset/base/279724 Log: Move the uart_class definitions and fdt compat data into the individual uart implementations, and export them using the new linker-set mechanism. Differential Revision: https://reviews.freebsd.org/D1993 Submitted by: Michal Meloun Modified: head/sys/arm/at91/uart_bus_at91usart.c head/sys/arm/at91/uart_cpu_at91usart.c head/sys/arm/at91/uart_dev_at91usart.c head/sys/arm/freescale/vybrid/vf_uart.c head/sys/arm/samsung/exynos/exynos_uart.c head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c head/sys/arm/xilinx/uart_dev_cdnc.c head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_dev_imx.c head/sys/dev/uart/uart_dev_lpc.c head/sys/dev/uart/uart_dev_msm.c head/sys/dev/uart/uart_dev_ns8250.c head/sys/dev/uart/uart_dev_pl011.c head/sys/dev/uart/uart_dev_ti8250.c head/sys/dev/uart/uart_subr.c Modified: head/sys/arm/at91/uart_bus_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_bus_at91usart.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/at91/uart_bus_at91usart.c Sat Mar 7 15:24:15 2015 (r279724) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "uart_if.h" +extern struct uart_class at91_usart_class; static int usart_at91_probe(device_t dev); static device_method_t usart_at91_methods[] = { Modified: head/sys/arm/at91/uart_cpu_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_cpu_at91usart.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/at91/uart_cpu_at91usart.c Sat Mar 7 15:24:15 2015 (r279724) @@ -51,6 +51,7 @@ bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; extern struct bus_space at91_bs_tag; +extern struct uart_class at91_usart_class; int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Mar 7 15:24:15 2015 (r279724) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#endif #include #include #include @@ -865,3 +868,12 @@ struct uart_class at91_usart_class = { .uc_ops = &at91_usart_ops, .uc_range = 8 }; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {"atmel,at91rm9200-usart",(uintptr_t)&at91_usart_class}, + {"atmel,at91sam9260-usart",(uintptr_t)&at91_usart_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); +#endif Modified: head/sys/arm/freescale/vybrid/vf_uart.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_uart.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/freescale/vybrid/vf_uart.c Sat Mar 7 15:24:15 2015 (r279724) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "uart_if.h" @@ -270,7 +271,7 @@ static kobj_method_t vf_uart_methods[] = { 0, 0 } }; -struct uart_class uart_vybrid_class = { +static struct uart_class uart_vybrid_class = { "vybrid", vf_uart_methods, sizeof(struct vf_uart_softc), @@ -279,6 +280,12 @@ struct uart_class uart_vybrid_class = { .uc_rclk = 24000000 /* TODO: get value from CCM */ }; +static struct ofw_compat_data compat_data[] = { + {"fsl,mvf600-uart", (uintptr_t)&uart_vybrid_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); + static int vf_uart_bus_attach(struct uart_softc *sc) { Modified: head/sys/arm/samsung/exynos/exynos_uart.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos_uart.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/samsung/exynos/exynos_uart.c Sat Mar 7 15:24:15 2015 (r279724) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -372,7 +373,7 @@ exynos4210_bus_ioctl(struct uart_softc * return (EINVAL); } -struct uart_class uart_exynos4210_class = { +static struct uart_class uart_exynos4210_class = { "exynos4210 class", exynos4210_methods, 1, @@ -380,3 +381,9 @@ struct uart_class uart_exynos4210_class .uc_range = 8, .uc_rclk = 0, }; + +static struct ofw_compat_data compat_data[] = { + {"exynos", (uintptr_t)&uart_exynos4210_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); Modified: head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c ============================================================================== --- head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c Sat Mar 7 15:24:15 2015 (r279724) @@ -19,6 +19,8 @@ __FBSDID("$FreeBSD$"); #include "uart_if.h" +extern struct uart_class uart_s3c2410_class; + static int uart_s3c2410_probe(device_t dev); static device_method_t uart_s3c2410_methods[] = { Modified: head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c ============================================================================== --- head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c Sat Mar 7 15:24:15 2015 (r279724) @@ -39,11 +39,11 @@ __FBSDID("$FreeBSD$"); #include +extern struct uart_class uart_s3c2410_class; + bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; -extern struct uart_ops uart_s3c2410_ops; - vm_offset_t s3c2410_uart_vaddr; unsigned int s3c2410_pclk; Modified: head/sys/arm/xilinx/uart_dev_cdnc.c ============================================================================== --- head/sys/arm/xilinx/uart_dev_cdnc.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/arm/xilinx/uart_dev_cdnc.c Sat Mar 7 15:24:15 2015 (r279724) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "uart_if.h" @@ -698,10 +699,16 @@ cdnc_uart_bus_ungrab(struct uart_softc * CDNC_UART_INT_DMSI); } -struct uart_class uart_cdnc_class = { +static struct uart_class uart_cdnc_class = { "cdnc_uart", cdnc_uart_bus_methods, sizeof(struct uart_softc), .uc_ops = &cdnc_uart_ops, .uc_range = 8 }; + +static struct ofw_compat_data compat_data[] = { + {"cadence,uart", (uintptr_t)&uart_cdnc_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart.h Sat Mar 7 15:24:15 2015 (r279724) @@ -64,22 +64,12 @@ struct uart_bas { */ struct uart_class; -extern struct uart_class uart_imx_class __attribute__((weak)); -extern struct uart_class uart_msm_class __attribute__((weak)); extern struct uart_class uart_ns8250_class __attribute__((weak)); extern struct uart_class uart_quicc_class __attribute__((weak)); extern struct uart_class uart_s3c2410_class __attribute__((weak)); extern struct uart_class uart_sab82532_class __attribute__((weak)); extern struct uart_class uart_sbbc_class __attribute__((weak)); extern struct uart_class uart_z8530_class __attribute__((weak)); -extern struct uart_class uart_lpc_class __attribute__((weak)); -extern struct uart_class uart_pl011_class __attribute__((weak)); -extern struct uart_class uart_cdnc_class __attribute__((weak)); -extern struct uart_class uart_ti8250_class __attribute__((weak)); -extern struct uart_class uart_vybrid_class __attribute__((weak)); -extern struct uart_class at91_usart_class __attribute__((weak)); -extern struct uart_class uart_exynos4210_class __attribute__((weak)); - #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_bus_fdt.c Sat Mar 7 15:24:15 2015 (r279724) @@ -63,37 +63,6 @@ static driver_t uart_fdt_driver = { sizeof(struct uart_softc), }; -/* - * Compatible devices. Keep this sorted in most- to least-specific order first, - * alphabetical second. That is, "zwie,ns16550" should appear before "ns16550" - * on the theory that the zwie driver knows how to make better use of the - * hardware than the generic driver. Likewise with chips within a family, the - * highest-numbers / most recent models should probably appear earlier. - */ -static struct ofw_compat_data compat_data[] = { - {"arm,pl011", (uintptr_t)&uart_pl011_class}, - {"atmel,at91rm9200-usart",(uintptr_t)&at91_usart_class}, - {"atmel,at91sam9260-usart",(uintptr_t)&at91_usart_class}, - {"cadence,uart", (uintptr_t)&uart_cdnc_class}, - {"exynos", (uintptr_t)&uart_exynos4210_class}, - {"fsl,imx6q-uart", (uintptr_t)&uart_imx_class}, - {"fsl,imx53-uart", (uintptr_t)&uart_imx_class}, - {"fsl,imx51-uart", (uintptr_t)&uart_imx_class}, - {"fsl,imx31-uart", (uintptr_t)&uart_imx_class}, - {"fsl,imx27-uart", (uintptr_t)&uart_imx_class}, - {"fsl,imx25-uart", (uintptr_t)&uart_imx_class}, - {"fsl,imx21-uart", (uintptr_t)&uart_imx_class}, - {"fsl,mvf600-uart", (uintptr_t)&uart_vybrid_class}, - {"lpc,uart", (uintptr_t)&uart_lpc_class}, - {"qcom,msm-uartdm", (uintptr_t)&uart_msm_class}, - {"ti,ns16550", (uintptr_t)&uart_ti8250_class}, - {"ns16550", (uintptr_t)&uart_ns8250_class}, - {NULL, (uintptr_t)NULL}, -}; - -/* Export the compat_data table for use by the uart_cpu_fdt.c probe routine. */ -UART_FDT_CLASS_AND_DEVICE(compat_data); - static int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_dev_imx.c Sat Mar 7 15:24:15 2015 (r279724) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include "uart_if.h" @@ -291,7 +292,7 @@ static kobj_method_t imx_uart_methods[] { 0, 0 } }; -struct uart_class uart_imx_class = { +static struct uart_class uart_imx_class = { "imx", imx_uart_methods, sizeof(struct imx_uart_softc), @@ -300,6 +301,18 @@ struct uart_class uart_imx_class = { .uc_rclk = 24000000 /* TODO: get value from CCM */ }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx53-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx51-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx31-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx27-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx25-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx21-uart", (uintptr_t)&uart_imx_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); + #define SIGCHG(c, i, s, d) \ if (c) { \ i |= (i & s) ? s : s | d; \ Modified: head/sys/dev/uart/uart_dev_lpc.c ============================================================================== --- head/sys/dev/uart/uart_dev_lpc.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_dev_lpc.c Sat Mar 7 15:24:15 2015 (r279724) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -421,7 +422,7 @@ static kobj_method_t lpc_ns8250_methods[ { 0, 0 } }; -struct uart_class uart_lpc_class = { +static struct uart_class uart_lpc_class = { "lpc_ns8250", lpc_ns8250_methods, sizeof(struct lpc_ns8250_softc), @@ -430,6 +431,12 @@ struct uart_class uart_lpc_class = { .uc_rclk = DEFAULT_RCLK }; +static struct ofw_compat_data compat_data[] = { + {"lpc,uart", (uintptr_t)&uart_lpc_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); + #define SIGCHG(c, i, s, d) \ if (c) { \ i |= (i & s) ? s : s | d; \ Modified: head/sys/dev/uart/uart_dev_msm.c ============================================================================== --- head/sys/dev/uart/uart_dev_msm.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_dev_msm.c Sat Mar 7 15:24:15 2015 (r279724) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -558,7 +559,7 @@ msm_bus_ungrab(struct uart_softc *sc) uart_unlock(sc->sc_hwmtx); } -struct uart_class uart_msm_class = { +static struct uart_class uart_msm_class = { "msm", msm_methods, sizeof(struct msm_uart_softc), @@ -566,3 +567,9 @@ struct uart_class uart_msm_class = { .uc_range = 8, .uc_rclk = DEF_CLK, }; + +static struct ofw_compat_data compat_data[] = { + {"qcom,msm-uartdm", (uintptr_t)&uart_msm_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_dev_ns8250.c Sat Mar 7 15:24:15 2015 (r279724) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#endif #include #include @@ -378,6 +381,14 @@ struct uart_class uart_ns8250_class = { .uc_rclk = DEFAULT_RCLK }; +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {"ns16550", (uintptr_t)&uart_ns8250_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); +#endif + #define SIGCHG(c, i, s, d) \ if (c) { \ i |= (i & s) ? s : s | d; \ Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_dev_pl011.c Sat Mar 7 15:24:15 2015 (r279724) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "uart_if.h" @@ -266,7 +267,7 @@ static kobj_method_t uart_pl011_methods[ { 0, 0 } }; -struct uart_class uart_pl011_class = { +static struct uart_class uart_pl011_class = { "uart_pl011", uart_pl011_methods, sizeof(struct uart_pl011_softc), @@ -275,6 +276,12 @@ struct uart_class uart_pl011_class = { .uc_rclk = 0 }; +static struct ofw_compat_data compat_data[] = { + {"arm,pl011", (uintptr_t)&uart_pl011_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); + static int uart_pl011_bus_attach(struct uart_softc *sc) { Modified: head/sys/dev/uart/uart_dev_ti8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ti8250.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_dev_ti8250.c Sat Mar 7 15:24:15 2015 (r279724) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -130,7 +131,7 @@ static kobj_method_t ti8250_methods[] = KOBJMETHOD_END }; -struct uart_class uart_ti8250_class = { +static struct uart_class uart_ti8250_class = { "ti8250", ti8250_methods, sizeof(struct ti8250_softc), @@ -138,4 +139,8 @@ struct uart_class uart_ti8250_class = { .uc_range = 0x88, .uc_rclk = 48000000 }; - +static struct ofw_compat_data compat_data[] = { + {"ti,ns16550", (uintptr_t)&uart_ti8250_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Sat Mar 7 15:18:57 2015 (r279723) +++ head/sys/dev/uart/uart_subr.c Sat Mar 7 15:24:15 2015 (r279724) @@ -53,7 +53,6 @@ static struct uart_class *uart_classes[] &uart_sab82532_class, &uart_z8530_class, #if defined(__arm__) - &uart_lpc_class, &uart_s3c2410_class, #endif }; From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 16:17:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABFEA88B; Sat, 7 Mar 2015 16:17:20 +0000 (UTC) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BED8309; Sat, 7 Mar 2015 16:17:20 +0000 (UTC) Received: by igal13 with SMTP id l13so11056838iga.5; Sat, 07 Mar 2015 08:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=9VcoxUtIix/O5xh/Sab0C/h80Fv6Xc0n5qlJdn4TDwM=; b=gl3ns/kaAHQwAJuTlxi+Z9RFyIlCjE6SH1AxT78sc3WIIC4NuktdYewQtCeV7EgCJD MLgnxwRkOEsm92amMKI6UCcmbbeQ3Hn31PF0qAhQCGNICbAd1UFLoiW+GBUf8PU5yZst OtfPHIaJ/kIg9hDVm22VbVRmtNuOFRAdTVsL0oI/aXlI1/DnaJBASkX+69sEDCy5dcdI pgj9Ygxj4ANNP34GgdkESI4zv7oYj4EuiG1LlHx39OguGhmdrFLF27MruoEhRpAKhdVL JPDJwV4AjYJDkColO+955FsJtBbvkz2ymeeUBh79s3WAzi5Y8jNdp4aQflXoHJbd1Kl/ 1XEg== MIME-Version: 1.0 X-Received: by 10.50.43.201 with SMTP id y9mr35200059igl.6.1425745039744; Sat, 07 Mar 2015 08:17:19 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Sat, 7 Mar 2015 08:17:19 -0800 (PST) In-Reply-To: References: <201502282037.t1SKbdTI072217@svn.freebsd.org> Date: Sat, 7 Mar 2015 08:17:19 -0800 X-Google-Sender-Auth: qn1sUN-C0Yw5o8JZc0G8mS5rSS4 Message-ID: Subject: Re: svn commit: r279406 - in head/sys: amd64/amd64 i386/i386 From: Adrian Chadd To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 16:17:20 -0000 Ugh, sorry to bring this up again, but I just updated to -HEAD and it started hanging again at the same spot. :( -adrian On 28 February 2015 at 14:08, Adrian Chadd wrote: > Thanks for promptly finding/fixing this! > > For the record, the CPU I have in this zenbook: > > CPU: Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz (1596.41-MHz K8-class CPU) > > > > On 28 February 2015 at 12:37, Konstantin Belousov wrote: >> Author: kib >> Date: Sat Feb 28 20:37:38 2015 >> New Revision: 279406 >> URL: https://svnweb.freebsd.org/changeset/base/279406 >> >> Log: >> Supposed fix for some SandyBridge mobile CPUs hang on AP startup when >> x2APIC mode is detected and enabled. Current theory is that switching >> the APIC mode while an IPI is in flight might be the issue. >> >> Postpone switching to x2APIC mode until we are guaranteed that all >> starting IPIs are already send and aknowledged. Use aps_ready signal >> as an indication that the BSP is done with us. >> >> Tested by: adrian >> Sponsored by: The FreeBSD Foundation >> MFC after: 2 months >> >> Modified: >> head/sys/amd64/amd64/mp_machdep.c >> head/sys/i386/i386/mp_machdep.c >> >> Modified: head/sys/amd64/amd64/mp_machdep.c >> ============================================================================== >> --- head/sys/amd64/amd64/mp_machdep.c Sat Feb 28 20:30:29 2015 (r279405) >> +++ head/sys/amd64/amd64/mp_machdep.c Sat Feb 28 20:37:38 2015 (r279406) >> @@ -705,12 +705,6 @@ init_secondary(void) >> wrmsr(MSR_STAR, msr); >> wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); >> >> - /* >> - * On real hardware, switch to x2apic mode if possible. >> - * Disable local APIC until BSP directed APs to run. >> - */ >> - lapic_xapic_mode(); >> - >> /* signal our startup to the BSP. */ >> mp_naps++; >> >> @@ -718,6 +712,14 @@ init_secondary(void) >> while (!aps_ready) >> ia32_pause(); >> >> + /* >> + * On real hardware, switch to x2apic mode if possible. Do it >> + * after aps_ready was signalled, to avoid manipulating the >> + * mode while BSP might still want to send some IPI to us >> + * (second startup IPI is ignored on modern hardware etc). >> + */ >> + lapic_xapic_mode(); >> + >> /* Initialize the PAT MSR. */ >> pmap_init_pat(); >> >> >> Modified: head/sys/i386/i386/mp_machdep.c >> ============================================================================== >> --- head/sys/i386/i386/mp_machdep.c Sat Feb 28 20:30:29 2015 (r279405) >> +++ head/sys/i386/i386/mp_machdep.c Sat Feb 28 20:37:38 2015 (r279406) >> @@ -719,12 +719,6 @@ init_secondary(void) >> load_cr0(cr0); >> CHECK_WRITE(0x38, 5); >> >> - /* >> - * On real hardware, switch to x2apic mode if possible. >> - * Disable local APIC until BSP directed APs to run. >> - */ >> - lapic_xapic_mode(); >> - >> /* signal our startup to the BSP. */ >> mp_naps++; >> CHECK_WRITE(0x39, 6); >> @@ -742,6 +736,14 @@ init_secondary(void) >> lidt(&r_idt); >> #endif >> >> + /* >> + * On real hardware, switch to x2apic mode if possible. Do it >> + * after aps_ready was signalled, to avoid manipulating the >> + * mode while BSP might still want to send some IPI to us >> + * (second startup IPI is ignored on modern hardware etc). >> + */ >> + lapic_xapic_mode(); >> + >> /* Initialize the PAT MSR if present. */ >> pmap_init_pat(); >> >> From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 17:11:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 409407CE; Sat, 7 Mar 2015 17:11:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11CDFA9D; Sat, 7 Mar 2015 17:11:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27HB8VL052637; Sat, 7 Mar 2015 17:11:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27HB8C8052629; Sat, 7 Mar 2015 17:11:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071711.t27HB8C8052629@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 17:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279725 - in head/sys/dev/usb: . quirk serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 17:11:09 -0000 Author: hselasky Date: Sat Mar 7 17:11:07 2015 New Revision: 279725 URL: https://svnweb.freebsd.org/changeset/base/279725 Log: Add more USB IDs. PR: 197753 MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sat Mar 7 15:24:15 2015 (r279724) +++ head/sys/dev/usb/quirk/usb_quirk.c Sat Mar 7 17:11:07 2015 (r279725) @@ -483,7 +483,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(TOSHIBA, TRANSMEMORY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), - + USB_QUIRK(QUALCOMMINC, ZTE_MF730M, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, + UQ_MSC_NO_INQUIRY, UQ_CFG_INDEX_0), /* Non-standard USB MIDI devices */ USB_QUIRK(ROLAND, UM1, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SC8850, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sat Mar 7 15:24:15 2015 (r279724) +++ head/sys/dev/usb/serial/u3g.c Sat Mar 7 17:11:07 2015 (r279725) @@ -482,6 +482,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), + /* the following is a RNDIS device, no modem features */ + U3G_DEV(QUALCOMMINC, ZTE_MF730M, U3GINIT_SCSIEJECT), U3G_DEV(QUANTA, GKE, 0), U3G_DEV(QUANTA, GLE, 0), U3G_DEV(QUANTA, GLX, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Mar 7 15:24:15 2015 (r279724) +++ head/sys/dev/usb/usbdevs Sat Mar 7 17:11:07 2015 (r279725) @@ -3674,6 +3674,7 @@ product QUALCOMMINC E0086 0x0086 3G mode product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z +product QUALCOMMINC ZTE_MF730M 0x1420 3G modem product QUALCOMMINC MF195E_INIT 0x1514 MF195E initial product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 17:18:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A6F0A74; Sat, 7 Mar 2015 17:18:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65EA2B34; Sat, 7 Mar 2015 17:18:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27HI7Da054757; Sat, 7 Mar 2015 17:18:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27HI7cU054756; Sat, 7 Mar 2015 17:18:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071718.t27HI7cU054756@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 17:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279726 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 17:18:07 -0000 Author: hselasky Date: Sat Mar 7 17:18:06 2015 New Revision: 279726 URL: https://svnweb.freebsd.org/changeset/base/279726 Log: Add DA_Q_NO_RC16 quirk for USB mass storage device. PR: 194062 MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Mar 7 17:11:07 2015 (r279725) +++ head/sys/cam/scsi/scsi_da.c Sat Mar 7 17:18:06 2015 (r279726) @@ -1175,6 +1175,13 @@ static struct da_quirk_entry da_quirk_ta { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SG9XCS2D*", "*" }, /*quirks*/DA_Q_4K }, + { + /* + * Hama Innostor USB-Stick + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, + /*quirks*/DA_Q_NO_RC16 + }, }; static disk_strategy_t dastrategy; From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:17:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D22CB9CF; Sat, 7 Mar 2015 18:17:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A38C4122; Sat, 7 Mar 2015 18:17:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IHG2v082988; Sat, 7 Mar 2015 18:17:16 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IHGgE082985; Sat, 7 Mar 2015 18:17:16 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503071817.t27IHGgE082985@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 7 Mar 2015 18:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279727 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:17:16 -0000 Author: gnn Date: Sat Mar 7 18:17:15 2015 New Revision: 279727 URL: https://svnweb.freebsd.org/changeset/base/279727 Log: Add a TCP state tracking script based on FreeBSD TCP SDTs Added: head/share/dtrace/tcpstate (contents, props changed) Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Sat Mar 7 17:18:06 2015 (r279726) +++ head/share/dtrace/Makefile Sat Mar 7 18:17:15 2015 (r279727) @@ -15,7 +15,8 @@ _toolkit= toolkit SCRIPTS= disklatency \ disklatencycmd \ hotopen \ - nfsclienttime + nfsclienttime \ + tcpstate SCRIPTSDIR= ${SHAREDIR}/dtrace Added: head/share/dtrace/tcpstate ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/tcpstate Sat Mar 7 18:17:15 2015 (r279727) @@ -0,0 +1,46 @@ +#!/usr/sbin/dtrace -s +/* + * Copyright (c) 2015 George V. Neville-Neil + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + * The tcpstate D script shows TCP sockets transitioning between states. + * + * Usage: tcpstate + */ + +#pragma D option quiet +BEGIN +{ + printf("Old State\t\tNew State\n"); +} + +tcp:kernel::state-change +{ + newstate = args[3]->tcps_state; + oldstate = args[5]->tcps_state; + printf("%s\t\t%s\n", tcp_state_string[oldstate], + tcp_state_string[newstate]); +} From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:23:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F49FF26; Sat, 7 Mar 2015 18:23:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F9B71F5; Sat, 7 Mar 2015 18:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27INYWA087222; Sat, 7 Mar 2015 18:23:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27INXST087219; Sat, 7 Mar 2015 18:23:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071823.t27INXST087219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279728 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:23:34 -0000 Author: hselasky Date: Sat Mar 7 18:23:32 2015 New Revision: 279728 URL: https://svnweb.freebsd.org/changeset/base/279728 Log: Add mutex support to the pps_ioctl() API in the kernel. Bump kernel version to reflect structure change. PR: 196897 MFC after: 1 week Modified: head/sys/kern/kern_tc.c head/sys/sys/param.h head/sys/sys/timepps.h Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Mar 7 18:17:15 2015 (r279727) +++ head/sys/kern/kern_tc.c Sat Mar 7 18:23:32 2015 (r279728) @@ -23,10 +23,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef FFCLOCK #include #include -#endif #include #include #include @@ -1498,7 +1496,10 @@ pps_fetch(struct pps_fetch_args *fapi, s cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - err = tsleep(pps, PCATCH, "ppsfch", timo); + if (pps->mtx != NULL) + err = msleep(pps, pps->mtx, PCATCH, "ppsfch", timo); + else + err = tsleep(pps, PCATCH, "ppsfch", timo); if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Mar 7 18:17:15 2015 (r279727) +++ head/sys/sys/param.h Sat Mar 7 18:23:32 2015 (r279728) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100062 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100063 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/timepps.h ============================================================================== --- head/sys/sys/timepps.h Sat Mar 7 18:17:15 2015 (r279727) +++ head/sys/sys/timepps.h Sat Mar 7 18:23:32 2015 (r279728) @@ -133,6 +133,8 @@ struct pps_kcbind_args { #ifdef _KERNEL +struct mtx; + struct pps_state { /* Capture information. */ struct timehands *capth; @@ -140,6 +142,9 @@ struct pps_state { unsigned capgen; unsigned capcount; + /* pointer to mutex protecting this state, if any */ + struct mtx *mtx; + /* State information. */ pps_params_t ppsparam; pps_info_t ppsinfo; From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:26:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E290F1A0; Sat, 7 Mar 2015 18:25:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD32D21D; Sat, 7 Mar 2015 18:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IPxhd087600; Sat, 7 Mar 2015 18:25:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IPxXZ087596; Sat, 7 Mar 2015 18:25:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071825.t27IPxXZ087596@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279729 - in head/sys: dev/usb/serial sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:26:00 -0000 Author: hselasky Date: Sat Mar 7 18:25:58 2015 New Revision: 279729 URL: https://svnweb.freebsd.org/changeset/base/279729 Log: Add PPS support to USB serial drivers. Bump kernel version to reflect structure change. PR: 196897 MFC after: 1 week Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/sys/param.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Sat Mar 7 18:23:32 2015 (r279728) +++ head/sys/dev/usb/serial/usb_serial.c Sat Mar 7 18:25:58 2015 (r279729) @@ -96,6 +96,11 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom"); +static int ucom_pps_mode; + +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_RWTUN, + &ucom_pps_mode, 0, "pulse capturing mode - 0/1/2 - disabled/CTS/DCD"); + #ifdef USB_DEBUG static int ucom_debug = 0; @@ -409,6 +414,10 @@ ucom_attach_tty(struct ucom_super_softc sc->sc_tty = tp; + sc->sc_pps.ppscap = PPS_CAPTUREBOTH; + sc->sc_pps.mtx = sc->sc_mtx; + pps_init(&sc->sc_pps); + DPRINTF("ttycreate: %s\n", buf); /* Check if this device should be a console */ @@ -858,6 +867,8 @@ ucom_ioctl(struct tty *tp, u_long cmd, c } else { error = ENOIOCTL; } + if (error == ENOIOCTL) + error = pps_ioctl(cmd, data, &sc->sc_pps); break; } return (error); @@ -1061,7 +1072,7 @@ ucom_cfg_status_change(struct usb_proc_m struct tty *tp; uint8_t new_msr; uint8_t new_lsr; - uint8_t onoff; + uint8_t msr_delta; uint8_t lsr_delta; tp = sc->sc_tty; @@ -1085,15 +1096,37 @@ ucom_cfg_status_change(struct usb_proc_m /* TTY device closed */ return; } - onoff = ((sc->sc_msr ^ new_msr) & SER_DCD); + msr_delta = (sc->sc_msr ^ new_msr); lsr_delta = (sc->sc_lsr ^ new_lsr); sc->sc_msr = new_msr; sc->sc_lsr = new_lsr; - if (onoff) { + /* time pulse counting support */ + switch(ucom_pps_mode) { + case 1: + if ((sc->sc_pps.ppscap & PPS_CAPTUREBOTH) && + (msr_delta & SER_CTS)) { + pps_capture(&sc->sc_pps); + pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ? + PPS_CAPTUREASSERT : PPS_CAPTURECLEAR); + } + break; + case 2: + if ((sc->sc_pps.ppscap & PPS_CAPTUREBOTH) && + (msr_delta & SER_DCD)) { + pps_capture(&sc->sc_pps); + pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ? + PPS_CAPTUREASSERT : PPS_CAPTURECLEAR); + } + break; + default: + break; + } + + if (msr_delta & SER_DCD) { - onoff = (sc->sc_msr & SER_DCD) ? 1 : 0; + int onoff = (sc->sc_msr & SER_DCD) ? 1 : 0; DPRINTF("DCD changed to %d\n", onoff); Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Sat Mar 7 18:23:32 2015 (r279728) +++ head/sys/dev/usb/serial/usb_serial.h Sat Mar 7 18:25:58 2015 (r279729) @@ -64,6 +64,7 @@ #include #include #include +#include /* Module interface related macros */ #define UCOM_MODVER 1 @@ -155,6 +156,8 @@ struct ucom_softc { struct ucom_cfg_task sc_line_state_task[2]; struct ucom_cfg_task sc_status_task[2]; struct ucom_param_task sc_param_task[2]; + /* pulse capturing support, PPS */ + struct pps_state sc_pps; /* Used to set "UCOM_FLAG_GP_DATA" flag: */ struct usb_proc_msg *sc_last_start_xfer; const struct ucom_callback *sc_callback; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Mar 7 18:23:32 2015 (r279728) +++ head/sys/sys/param.h Sat Mar 7 18:25:58 2015 (r279729) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100063 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100064 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:33:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A76F3C8; Sat, 7 Mar 2015 18:33:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85E4E322; Sat, 7 Mar 2015 18:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IX9h1092014; Sat, 7 Mar 2015 18:33:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IX9ec092013; Sat, 7 Mar 2015 18:33:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503071833.t27IX9ec092013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 7 Mar 2015 18:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279730 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:33:09 -0000 Author: ae Date: Sat Mar 7 18:33:08 2015 New Revision: 279730 URL: https://svnweb.freebsd.org/changeset/base/279730 Log: lla_lookup() can directly call llentry_free() for static entries and the last one requires to hold afdata's wlock. PR: 197096 MFC after: 1 week Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Mar 7 18:25:58 2015 (r279729) +++ head/sys/netinet/if_ether.c Sat Mar 7 18:33:08 2015 (r279730) @@ -149,10 +149,10 @@ arp_ifscrub(struct ifnet *ifp, uint32_t addr4.sin_len = sizeof(addr4); addr4.sin_family = AF_INET; addr4.sin_addr.s_addr = addr; - IF_AFDATA_RLOCK(ifp); + IF_AFDATA_WLOCK(ifp); lla_lookup(LLTABLE(ifp), (LLE_DELETE | LLE_IFADDR), (struct sockaddr *)&addr4); - IF_AFDATA_RUNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); } #endif From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:33:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A076F610; Sat, 7 Mar 2015 18:33:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892AD32B; Sat, 7 Mar 2015 18:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IXVxF092522; Sat, 7 Mar 2015 18:33:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IXSGB092501; Sat, 7 Mar 2015 18:33:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071833.t27IXSGB092501@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:33: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: r279731 - in stable/10/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:33:31 -0000 Author: hselasky Date: Sat Mar 7 18:33:28 2015 New Revision: 279731 URL: https://svnweb.freebsd.org/changeset/base/279731 Log: MFC r279584: Updates for the Mellanox ethernet driver > List of fixes: * use correct format for GID printouts * double array indexing * spelling in printouts * void pointer arithmetic * allow more receive rings * correct maximum number of transmit rings * use "const" instead of "static" for constants * check for invalid VLAN tags * check for lack of IRQ resources > Added more hardware specific defines > Added more verbose printouts of firmware status codes Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/cmd.c stable/10/sys/ofed/drivers/net/mlx4/en_main.c stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/ofed/drivers/net/mlx4/en_rx.c stable/10/sys/ofed/drivers/net/mlx4/en_tx.c stable/10/sys/ofed/drivers/net/mlx4/main.c stable/10/sys/ofed/drivers/net/mlx4/mcg.c stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/10/sys/ofed/include/linux/mlx4/device.h stable/10/sys/ofed/include/linux/mlx4/qp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/cmd.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/cmd.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/cmd.c Sat Mar 7 18:33:28 2015 (r279731) @@ -757,6 +757,19 @@ static int mlx4_cmd_wait(struct mlx4_dev "in_mod=0x%x, op_mod=0x%x, fw status = 0x%x\n", cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, op_modifier, context->fw_status); + + switch(context->fw_status) { + case CMD_STAT_BAD_PARAM: + mlx4_err(dev, "Parameter is not supported, " + "parameter is out of range\n"); + break; + case CMD_STAT_EXCEED_LIM: + mlx4_err(dev, "Required capability exceeded " + "device limits\n"); + break; + default: + break; + } goto out; } Modified: stable/10/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_main.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/en_main.c Sat Mar 7 18:33:28 2015 (r279731) @@ -239,8 +239,8 @@ static void *mlx4_en_add(struct mlx4_dev DEF_RX_RINGS))); } else { mdev->profile.prof[i].rx_ring_num = rounddown_pow_of_two( - min_t(int, dev->caps.comp_pool/ - dev->caps.num_ports - 1 , MAX_MSIX_P_PORT - 1)); + min_t(int, dev->caps.comp_pool / + dev->caps.num_ports, MAX_MSIX_P_PORT)); } } Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Mar 7 18:33:28 2015 (r279731) @@ -1305,7 +1305,7 @@ int mlx4_en_start_port(struct net_device cq = priv->tx_cq[i]; err = mlx4_en_activate_cq(priv, cq, i); if (err) { - en_err(priv, "Failed allocating Tx CQ\n"); + en_err(priv, "Failed activating Tx CQ\n"); goto tx_err; } err = mlx4_en_set_cq_moder(priv, cq); @@ -1323,7 +1323,7 @@ int mlx4_en_start_port(struct net_device err = mlx4_en_activate_tx_ring(priv, tx_ring, cq->mcq.cqn, i / priv->num_tx_rings_p_up); if (err) { - en_err(priv, "Failed allocating Tx ring\n"); + en_err(priv, "Failed activating Tx ring %d\n", i); mlx4_en_deactivate_cq(priv, cq); goto tx_err; } @@ -2189,6 +2189,7 @@ out: mlx4_en_destroy_netdev(dev); return err; } + static int mlx4_en_set_ring_size(struct net_device *dev, int rx_size, int tx_size) { @@ -2409,7 +2410,6 @@ static void mlx4_en_sysctl_conf(struct m "Enable adaptive rx coalescing"); } - static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) { struct net_device *dev; Modified: stable/10/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Sat Mar 7 18:33:28 2015 (r279731) @@ -500,7 +500,7 @@ static int mlx4_en_complete_rx_desc(stru goto fail; /* Unmap buffer */ - pci_unmap_single(mdev->pdev, dma, frag_info[nr].frag_size, + pci_unmap_single(mdev->pdev, dma, frag_info->frag_size, PCI_DMA_FROMDEVICE); } /* Adjust size of last fragment to match actual length */ Modified: stable/10/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_tx.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/en_tx.c Sat Mar 7 18:33:28 2015 (r279731) @@ -710,16 +710,16 @@ u16 mlx4_en_select_queue(struct net_devi { struct mlx4_en_priv *priv = netdev_priv(dev); u32 rings_p_up = priv->num_tx_rings_p_up; - u32 vlan_tag = 0; u32 up = 0; u32 queue_index; +#if (MLX4_EN_NUM_UP > 1) /* Obtain VLAN information if present */ if (mb->m_flags & M_VLANTAG) { - vlan_tag = mb->m_pkthdr.ether_vtag; - up = (vlan_tag >> 13); + u32 vlan_tag = mb->m_pkthdr.ether_vtag; + up = (vlan_tag >> 13) % MLX4_EN_NUM_UP; } - +#endif /* hash mbuf */ queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom); Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/main.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/main.c Sat Mar 7 18:33:28 2015 (r279731) @@ -1307,8 +1307,9 @@ static ssize_t show_port_ib_mtu(struct d port_mtu_attr); struct mlx4_dev *mdev = info->dev; + /* When port type is eth, port mtu value isn't used. */ if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) - mlx4_warn(mdev, "port level mtu is only used for IB ports\n"); + return -EINVAL; sprintf(buf, "%d\n", ibta_mtu_to_int(mdev->caps.port_ib_mtu[info->port])); @@ -2903,6 +2904,12 @@ static void mlx4_enable_msi_x(struct mlx goto retry; } kfree(entries); + /* if error, or can't alloc even 1 IRQ */ + if (err < 0) { + mlx4_err(dev, "No IRQs left, device can't " + "be started.\n"); + goto no_irq; + } goto no_msi; } @@ -2930,6 +2937,10 @@ no_msi: for (i = 0; i < 2; ++i) priv->eq_table.eq[i].irq = dev->pdev->irq; + return; +no_irq: + dev->caps.num_comp_vectors = 0; + dev->caps.comp_pool = 0; } static int mlx4_init_port_info(struct mlx4_dev *dev, int port) @@ -3305,6 +3316,13 @@ slave_start: mutex_init(&priv->msix_ctl.pool_lock); mlx4_enable_msi_x(dev); + + /* no MSIX and no shared IRQ */ + if (!dev->caps.num_comp_vectors && !dev->caps.comp_pool) { + err = -ENOSPC; + goto err_free_eq; + } + if ((mlx4_is_mfunc(dev)) && !(dev->flags & MLX4_FLAG_MSI_X)) { err = -ENOSYS; Modified: stable/10/sys/ofed/drivers/net/mlx4/mcg.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/mcg.c Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/mcg.c Sat Mar 7 18:33:28 2015 (r279731) @@ -36,6 +36,7 @@ #include #include +#include #include "mlx4.h" @@ -690,8 +691,10 @@ static int find_entry(struct mlx4_dev *d if (err) return err; - if (0) - mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, hash); + if (0) { + mlx4_dbg(dev, "Hash for "GID_PRINT_FMT" is %04x\n", + GID_PRINT_ARGS(gid), hash); + } *index = hash; *prev = -1; @@ -912,10 +915,11 @@ static void mlx4_err_rule(struct mlx4_de case MLX4_NET_TRANS_RULE_ID_IB: len += snprintf(buf + len, BUF_SIZE - len, - "dst-gid = %pI6\n", cur->ib.dst_gid); + "dst-gid = "GID_PRINT_FMT"\n", + GID_PRINT_ARGS(cur->ib.dst_gid)); len += snprintf(buf + len, BUF_SIZE - len, - "dst-gid-mask = %pI6\n", - cur->ib.dst_gid_msk); + "dst-gid-mask = "GID_PRINT_FMT"\n", + GID_PRINT_ARGS(cur->ib.dst_gid_msk)); break; case MLX4_NET_TRANS_RULE_ID_IPV6: @@ -1135,7 +1139,8 @@ int mlx4_qp_detach_common(struct mlx4_de goto out; if (index == -1) { - mlx4_err(dev, "MGID %pI6 not found\n", gid); + mlx4_err(dev, "MGID "GID_PRINT_FMT" not found\n", + GID_PRINT_ARGS(gid)); err = -EINVAL; goto out; } Modified: stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Sat Mar 7 18:33:28 2015 (r279731) @@ -154,7 +154,7 @@ enum { #define MLX4_EN_NUM_UP 1 #define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \ - (MLX4_EN_NUM_UP + 1)) + MLX4_EN_NUM_UP) #define MLX4_EN_DEF_TX_RING_SIZE 1024 #define MLX4_EN_DEF_RX_RING_SIZE 1024 @@ -358,11 +358,7 @@ struct mlx4_en_rx_ring { static inline int mlx4_en_can_lro(__be16 status) { - static __be16 status_all; - static __be16 status_ipv4_ipok_tcp; - static __be16 status_ipv6_ipok_tcp; - - status_all = cpu_to_be16( + const __be16 status_all = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPV4F | MLX4_CQE_STATUS_IPV6 | @@ -370,11 +366,11 @@ static inline int mlx4_en_can_lro(__be16 MLX4_CQE_STATUS_TCP | MLX4_CQE_STATUS_UDP | MLX4_CQE_STATUS_IPOK); - status_ipv4_ipok_tcp = cpu_to_be16( + const __be16 status_ipv4_ipok_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPOK | MLX4_CQE_STATUS_TCP); - status_ipv6_ipok_tcp = cpu_to_be16( + const __be16 status_ipv6_ipok_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | MLX4_CQE_STATUS_IPOK | MLX4_CQE_STATUS_TCP); @@ -384,7 +380,6 @@ static inline int mlx4_en_can_lro(__be16 status == status_ipv6_ipok_tcp); } - struct mlx4_en_cq { struct mlx4_cq mcq; struct mlx4_hwq_resources wqres; Modified: stable/10/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/10/sys/ofed/include/linux/mlx4/device.h Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/include/linux/mlx4/device.h Sat Mar 7 18:33:28 2015 (r279731) @@ -186,8 +186,19 @@ enum { MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 10, MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 11, MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 12, - MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, - MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14 + MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, + MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14, + MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 15, + MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 16, + MLX4_DEV_CAP_FLAG2_FS_EN_NCSI = 1LL << 17, + MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, + MLX4_DEV_CAP_FLAG2_DMFS_TAG_MODE = 1LL << 19, + MLX4_DEV_CAP_FLAG2_ROCEV2 = 1LL << 20, + MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 21, + MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 22, + MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 23, + MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1LL << 24, + MLX4_DEV_CAP_FLAG2_RX_CSUM_MODE = 1LL << 25, }; /* bit enums for an 8-bit flags field indicating special use @@ -948,9 +959,9 @@ void mlx4_buf_free(struct mlx4_dev *dev, static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) { if (BITS_PER_LONG == 64 || buf->nbufs == 1) - return buf->direct.buf + offset; + return (u8 *)buf->direct.buf + offset; else - return buf->page_list[offset >> PAGE_SHIFT].buf + + return (u8 *)buf->page_list[offset >> PAGE_SHIFT].buf + (offset & (PAGE_SIZE - 1)); } Modified: stable/10/sys/ofed/include/linux/mlx4/qp.h ============================================================================== --- stable/10/sys/ofed/include/linux/mlx4/qp.h Sat Mar 7 18:33:08 2015 (r279730) +++ stable/10/sys/ofed/include/linux/mlx4/qp.h Sat Mar 7 18:33:28 2015 (r279731) @@ -253,6 +253,8 @@ enum { MLX4_UPD_QP_PATH_MASK_SCHED_QUEUE = 14 + 32, MLX4_UPD_QP_PATH_MASK_IF_COUNTER_INDEX = 15 + 32, MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32, + MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_UC_LB = 18 + 32, + MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB = 19 + 32, }; enum { /* param3 */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:39:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7349787; Sat, 7 Mar 2015 18:39:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7854335E; Sat, 7 Mar 2015 18:39:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IdFuV093325; Sat, 7 Mar 2015 18:39:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IdFT0093324; Sat, 7 Mar 2015 18:39:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071839.t27IdFT0093324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:39:15 +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: r279732 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:39:16 -0000 Author: hselasky Date: Sat Mar 7 18:39:15 2015 New Revision: 279732 URL: https://svnweb.freebsd.org/changeset/base/279732 Log: MFC r278866: Define standard formatting strings to print GIDs in a separate header file. Sponsored by: Mellanox Technologies Added: stable/10/sys/ofed/include/linux/printk.h - copied unchanged from r278866, head/sys/ofed/include/linux/printk.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/ofed/include/linux/printk.h (from r278866, head/sys/ofed/include/linux/printk.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/ofed/include/linux/printk.h Sat Mar 7 18:39:15 2015 (r279732, copy of r278866, head/sys/ofed/include/linux/printk.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _FBSD_PRINTK_H_ +#define _FBSD_PRINTK_H_ + +/* GID printing macros */ +#define GID_PRINT_FMT "%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x" +#define GID_PRINT_ARGS(gid_raw) htons(((u16 *)gid_raw)[0]), htons(((u16 *)gid_raw)[1]),\ + htons(((u16 *)gid_raw)[2]), htons(((u16 *)gid_raw)[3]),\ + htons(((u16 *)gid_raw)[4]), htons(((u16 *)gid_raw)[5]),\ + htons(((u16 *)gid_raw)[6]), htons(((u16 *)gid_raw)[7]) + +#endif /* _FBSD_PRINTK_H */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:42:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 907298DA; Sat, 7 Mar 2015 18:42:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 606A35FE; Sat, 7 Mar 2015 18:42:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Igcsx097223; Sat, 7 Mar 2015 18:42:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IgcoB097222; Sat, 7 Mar 2015 18:42:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071842.t27IgcoB097222@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:42:38 +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: r279733 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:42:38 -0000 Author: hselasky Date: Sat Mar 7 18:42:37 2015 New Revision: 279733 URL: https://svnweb.freebsd.org/changeset/base/279733 Log: MFC r278866: Define standard formatting strings to print GIDs in a separate header file. Sponsored by: Mellanox Technologies Added: stable/9/sys/ofed/include/linux/printk.h - copied unchanged from r278866, head/sys/ofed/include/linux/printk.h Modified: Directory Properties: stable/9/sys/ (props changed) Copied: stable/9/sys/ofed/include/linux/printk.h (from r278866, head/sys/ofed/include/linux/printk.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/ofed/include/linux/printk.h Sat Mar 7 18:42:37 2015 (r279733, copy of r278866, head/sys/ofed/include/linux/printk.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _FBSD_PRINTK_H_ +#define _FBSD_PRINTK_H_ + +/* GID printing macros */ +#define GID_PRINT_FMT "%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x" +#define GID_PRINT_ARGS(gid_raw) htons(((u16 *)gid_raw)[0]), htons(((u16 *)gid_raw)[1]),\ + htons(((u16 *)gid_raw)[2]), htons(((u16 *)gid_raw)[3]),\ + htons(((u16 *)gid_raw)[4]), htons(((u16 *)gid_raw)[5]),\ + htons(((u16 *)gid_raw)[6]), htons(((u16 *)gid_raw)[7]) + +#endif /* _FBSD_PRINTK_H */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:44:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B178CA1F; Sat, 7 Mar 2015 18:44:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99E2A60D; Sat, 7 Mar 2015 18:44:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Iij6Q097601; Sat, 7 Mar 2015 18:44:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IigHe097589; Sat, 7 Mar 2015 18:44:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071844.t27IigHe097589@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:44:42 +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: r279734 - in stable/9/sys/ofed: drivers/net/mlx4 include/linux/mlx4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:44:45 -0000 Author: hselasky Date: Sat Mar 7 18:44:42 2015 New Revision: 279734 URL: https://svnweb.freebsd.org/changeset/base/279734 Log: MFC r279584: Updates for the Mellanox ethernet driver > List of fixes: * use correct format for GID printouts * double array indexing * spelling in printouts * void pointer arithmetic * allow more receive rings * correct maximum number of transmit rings * use "const" instead of "static" for constants * check for invalid VLAN tags * check for lack of IRQ resources > Added more hardware specific defines > Added more verbose printouts of firmware status codes Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/net/mlx4/cmd.c stable/9/sys/ofed/drivers/net/mlx4/en_main.c stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/en_rx.c stable/9/sys/ofed/drivers/net/mlx4/en_tx.c stable/9/sys/ofed/drivers/net/mlx4/main.c stable/9/sys/ofed/drivers/net/mlx4/mcg.c stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/9/sys/ofed/include/linux/mlx4/device.h stable/9/sys/ofed/include/linux/mlx4/qp.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/net/mlx4/cmd.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/cmd.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/cmd.c Sat Mar 7 18:44:42 2015 (r279734) @@ -757,6 +757,19 @@ static int mlx4_cmd_wait(struct mlx4_dev "in_mod=0x%x, op_mod=0x%x, fw status = 0x%x\n", cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, op_modifier, context->fw_status); + + switch(context->fw_status) { + case CMD_STAT_BAD_PARAM: + mlx4_err(dev, "Parameter is not supported, " + "parameter is out of range\n"); + break; + case CMD_STAT_EXCEED_LIM: + mlx4_err(dev, "Required capability exceeded " + "device limits\n"); + break; + default: + break; + } goto out; } Modified: stable/9/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_main.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/en_main.c Sat Mar 7 18:44:42 2015 (r279734) @@ -239,8 +239,8 @@ static void *mlx4_en_add(struct mlx4_dev DEF_RX_RINGS))); } else { mdev->profile.prof[i].rx_ring_num = rounddown_pow_of_two( - min_t(int, dev->caps.comp_pool/ - dev->caps.num_ports - 1 , MAX_MSIX_P_PORT - 1)); + min_t(int, dev->caps.comp_pool / + dev->caps.num_ports, MAX_MSIX_P_PORT)); } } Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Mar 7 18:44:42 2015 (r279734) @@ -1305,7 +1305,7 @@ int mlx4_en_start_port(struct net_device cq = priv->tx_cq[i]; err = mlx4_en_activate_cq(priv, cq, i); if (err) { - en_err(priv, "Failed allocating Tx CQ\n"); + en_err(priv, "Failed activating Tx CQ\n"); goto tx_err; } err = mlx4_en_set_cq_moder(priv, cq); @@ -1323,7 +1323,7 @@ int mlx4_en_start_port(struct net_device err = mlx4_en_activate_tx_ring(priv, tx_ring, cq->mcq.cqn, i / priv->num_tx_rings_p_up); if (err) { - en_err(priv, "Failed allocating Tx ring\n"); + en_err(priv, "Failed activating Tx ring %d\n", i); mlx4_en_deactivate_cq(priv, cq); goto tx_err; } @@ -2189,6 +2189,7 @@ out: mlx4_en_destroy_netdev(dev); return err; } + static int mlx4_en_set_ring_size(struct net_device *dev, int rx_size, int tx_size) { @@ -2409,7 +2410,6 @@ static void mlx4_en_sysctl_conf(struct m "Enable adaptive rx coalescing"); } - static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) { struct net_device *dev; Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Sat Mar 7 18:44:42 2015 (r279734) @@ -500,7 +500,7 @@ static int mlx4_en_complete_rx_desc(stru goto fail; /* Unmap buffer */ - pci_unmap_single(mdev->pdev, dma, frag_info[nr].frag_size, + pci_unmap_single(mdev->pdev, dma, frag_info->frag_size, PCI_DMA_FROMDEVICE); } /* Adjust size of last fragment to match actual length */ Modified: stable/9/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Sat Mar 7 18:44:42 2015 (r279734) @@ -710,16 +710,16 @@ u16 mlx4_en_select_queue(struct net_devi { struct mlx4_en_priv *priv = netdev_priv(dev); u32 rings_p_up = priv->num_tx_rings_p_up; - u32 vlan_tag = 0; u32 up = 0; u32 queue_index; +#if (MLX4_EN_NUM_UP > 1) /* Obtain VLAN information if present */ if (mb->m_flags & M_VLANTAG) { - vlan_tag = mb->m_pkthdr.ether_vtag; - up = (vlan_tag >> 13); + u32 vlan_tag = mb->m_pkthdr.ether_vtag; + up = (vlan_tag >> 13) % MLX4_EN_NUM_UP; } - +#endif /* hash mbuf */ queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom); Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/main.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/main.c Sat Mar 7 18:44:42 2015 (r279734) @@ -1307,8 +1307,9 @@ static ssize_t show_port_ib_mtu(struct d port_mtu_attr); struct mlx4_dev *mdev = info->dev; + /* When port type is eth, port mtu value isn't used. */ if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) - mlx4_warn(mdev, "port level mtu is only used for IB ports\n"); + return -EINVAL; sprintf(buf, "%d\n", ibta_mtu_to_int(mdev->caps.port_ib_mtu[info->port])); @@ -2903,6 +2904,12 @@ static void mlx4_enable_msi_x(struct mlx goto retry; } kfree(entries); + /* if error, or can't alloc even 1 IRQ */ + if (err < 0) { + mlx4_err(dev, "No IRQs left, device can't " + "be started.\n"); + goto no_irq; + } goto no_msi; } @@ -2930,6 +2937,10 @@ no_msi: for (i = 0; i < 2; ++i) priv->eq_table.eq[i].irq = dev->pdev->irq; + return; +no_irq: + dev->caps.num_comp_vectors = 0; + dev->caps.comp_pool = 0; } static int mlx4_init_port_info(struct mlx4_dev *dev, int port) @@ -3305,6 +3316,13 @@ slave_start: mutex_init(&priv->msix_ctl.pool_lock); mlx4_enable_msi_x(dev); + + /* no MSIX and no shared IRQ */ + if (!dev->caps.num_comp_vectors && !dev->caps.comp_pool) { + err = -ENOSPC; + goto err_free_eq; + } + if ((mlx4_is_mfunc(dev)) && !(dev->flags & MLX4_FLAG_MSI_X)) { err = -ENOSYS; Modified: stable/9/sys/ofed/drivers/net/mlx4/mcg.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/mcg.c Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/mcg.c Sat Mar 7 18:44:42 2015 (r279734) @@ -36,6 +36,7 @@ #include #include +#include #include "mlx4.h" @@ -690,8 +691,10 @@ static int find_entry(struct mlx4_dev *d if (err) return err; - if (0) - mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, hash); + if (0) { + mlx4_dbg(dev, "Hash for "GID_PRINT_FMT" is %04x\n", + GID_PRINT_ARGS(gid), hash); + } *index = hash; *prev = -1; @@ -912,10 +915,11 @@ static void mlx4_err_rule(struct mlx4_de case MLX4_NET_TRANS_RULE_ID_IB: len += snprintf(buf + len, BUF_SIZE - len, - "dst-gid = %pI6\n", cur->ib.dst_gid); + "dst-gid = "GID_PRINT_FMT"\n", + GID_PRINT_ARGS(cur->ib.dst_gid)); len += snprintf(buf + len, BUF_SIZE - len, - "dst-gid-mask = %pI6\n", - cur->ib.dst_gid_msk); + "dst-gid-mask = "GID_PRINT_FMT"\n", + GID_PRINT_ARGS(cur->ib.dst_gid_msk)); break; case MLX4_NET_TRANS_RULE_ID_IPV6: @@ -1135,7 +1139,8 @@ int mlx4_qp_detach_common(struct mlx4_de goto out; if (index == -1) { - mlx4_err(dev, "MGID %pI6 not found\n", gid); + mlx4_err(dev, "MGID "GID_PRINT_FMT" not found\n", + GID_PRINT_ARGS(gid)); err = -EINVAL; goto out; } Modified: stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h Sat Mar 7 18:44:42 2015 (r279734) @@ -154,7 +154,7 @@ enum { #define MLX4_EN_NUM_UP 1 #define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \ - (MLX4_EN_NUM_UP + 1)) + MLX4_EN_NUM_UP) #define MLX4_EN_DEF_TX_RING_SIZE 1024 #define MLX4_EN_DEF_RX_RING_SIZE 1024 @@ -358,11 +358,7 @@ struct mlx4_en_rx_ring { static inline int mlx4_en_can_lro(__be16 status) { - static __be16 status_all; - static __be16 status_ipv4_ipok_tcp; - static __be16 status_ipv6_ipok_tcp; - - status_all = cpu_to_be16( + const __be16 status_all = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPV4F | MLX4_CQE_STATUS_IPV6 | @@ -370,11 +366,11 @@ static inline int mlx4_en_can_lro(__be16 MLX4_CQE_STATUS_TCP | MLX4_CQE_STATUS_UDP | MLX4_CQE_STATUS_IPOK); - status_ipv4_ipok_tcp = cpu_to_be16( + const __be16 status_ipv4_ipok_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPOK | MLX4_CQE_STATUS_TCP); - status_ipv6_ipok_tcp = cpu_to_be16( + const __be16 status_ipv6_ipok_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | MLX4_CQE_STATUS_IPOK | MLX4_CQE_STATUS_TCP); @@ -384,7 +380,6 @@ static inline int mlx4_en_can_lro(__be16 status == status_ipv6_ipok_tcp); } - struct mlx4_en_cq { struct mlx4_cq mcq; struct mlx4_hwq_resources wqres; Modified: stable/9/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/9/sys/ofed/include/linux/mlx4/device.h Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/include/linux/mlx4/device.h Sat Mar 7 18:44:42 2015 (r279734) @@ -186,8 +186,19 @@ enum { MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 10, MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 11, MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 12, - MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, - MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14 + MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, + MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14, + MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 15, + MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 16, + MLX4_DEV_CAP_FLAG2_FS_EN_NCSI = 1LL << 17, + MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, + MLX4_DEV_CAP_FLAG2_DMFS_TAG_MODE = 1LL << 19, + MLX4_DEV_CAP_FLAG2_ROCEV2 = 1LL << 20, + MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 21, + MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 22, + MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 23, + MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1LL << 24, + MLX4_DEV_CAP_FLAG2_RX_CSUM_MODE = 1LL << 25, }; /* bit enums for an 8-bit flags field indicating special use @@ -948,9 +959,9 @@ void mlx4_buf_free(struct mlx4_dev *dev, static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) { if (BITS_PER_LONG == 64 || buf->nbufs == 1) - return buf->direct.buf + offset; + return (u8 *)buf->direct.buf + offset; else - return buf->page_list[offset >> PAGE_SHIFT].buf + + return (u8 *)buf->page_list[offset >> PAGE_SHIFT].buf + (offset & (PAGE_SIZE - 1)); } Modified: stable/9/sys/ofed/include/linux/mlx4/qp.h ============================================================================== --- stable/9/sys/ofed/include/linux/mlx4/qp.h Sat Mar 7 18:42:37 2015 (r279733) +++ stable/9/sys/ofed/include/linux/mlx4/qp.h Sat Mar 7 18:44:42 2015 (r279734) @@ -253,6 +253,8 @@ enum { MLX4_UPD_QP_PATH_MASK_SCHED_QUEUE = 14 + 32, MLX4_UPD_QP_PATH_MASK_IF_COUNTER_INDEX = 15 + 32, MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32, + MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_UC_LB = 18 + 32, + MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB = 19 + 32, }; enum { /* param3 */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:44:53 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6938CB4A; Sat, 7 Mar 2015 18:44:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54904610; Sat, 7 Mar 2015 18:44:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IirRi097665; Sat, 7 Mar 2015 18:44:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IirBF097663; Sat, 7 Mar 2015 18:44:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503071844.t27IirBF097663@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 7 Mar 2015 18:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279735 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:44:53 -0000 Author: ae Date: Sat Mar 7 18:44:52 2015 New Revision: 279735 URL: https://svnweb.freebsd.org/changeset/base/279735 Log: Remove extra '&'. sin6 is already a pointer. PR: 195011 MFC after: 1 week Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sat Mar 7 18:44:42 2015 (r279734) +++ head/sys/netipsec/key.c Sat Mar 7 18:44:52 2015 (r279735) @@ -3870,7 +3870,7 @@ key_ismyaddr6(struct sockaddr_in6 *sin6) IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - if (key_sockaddrcmp((struct sockaddr *)&sin6, + if (key_sockaddrcmp((struct sockaddr *)sin6, (struct sockaddr *)&ia->ia_addr, 0) == 0) { IN6_IFADDR_RUNLOCK(); return 1; From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:46:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC85CCAC; Sat, 7 Mar 2015 18:46:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B712B62D; Sat, 7 Mar 2015 18:46:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27IkMhA097987; Sat, 7 Mar 2015 18:46:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27IkMKQ097986; Sat, 7 Mar 2015 18:46:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071846.t27IkMKQ097986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:46:22 +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: r279736 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:46:22 -0000 Author: hselasky Date: Sat Mar 7 18:46:21 2015 New Revision: 279736 URL: https://svnweb.freebsd.org/changeset/base/279736 Log: MFC r279587: Define PTR_ALIGN() macro which will be needed coming Mellanox driver releases. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/include/linux/kernel.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/kernel.h ============================================================================== --- stable/9/sys/ofed/include/linux/kernel.h Sat Mar 7 18:44:52 2015 (r279735) +++ stable/9/sys/ofed/include/linux/kernel.h Sat Mar 7 18:46:21 2015 (r279736) @@ -63,6 +63,8 @@ #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) +#undef PTR_ALIGN +#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define DIV_ROUND_UP howmany #define printk(X...) printf(X) From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:48:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72C7FDF7; Sat, 7 Mar 2015 18:48:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CFCB640; Sat, 7 Mar 2015 18:48:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Im1Hw098238; Sat, 7 Mar 2015 18:48:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27Im1mS098237; Sat, 7 Mar 2015 18:48:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071848.t27Im1mS098237@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:48:01 +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: r279737 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:48:01 -0000 Author: hselasky Date: Sat Mar 7 18:48:00 2015 New Revision: 279737 URL: https://svnweb.freebsd.org/changeset/base/279737 Log: MFC r279587: Define PTR_ALIGN() macro which will be needed coming Mellanox driver releases. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/kernel.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/kernel.h ============================================================================== --- stable/10/sys/ofed/include/linux/kernel.h Sat Mar 7 18:46:21 2015 (r279736) +++ stable/10/sys/ofed/include/linux/kernel.h Sat Mar 7 18:48:00 2015 (r279737) @@ -63,6 +63,8 @@ #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) +#undef PTR_ALIGN +#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define DIV_ROUND_UP howmany #define printk(X...) printf(X) From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:14:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B5A6334; Sat, 7 Mar 2015 19:14:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05F02915; Sat, 7 Mar 2015 19:14:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JE2FF011998; Sat, 7 Mar 2015 19:14:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JE2xr011997; Sat, 7 Mar 2015 19:14:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071914.t27JE2xr011997@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279738 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:14:03 -0000 Author: trasz Date: Sat Mar 7 19:14:01 2015 New Revision: 279738 URL: https://svnweb.freebsd.org/changeset/base/279738 Log: Add error reporting (but not actual handling yet, apart from reporting them) for EFI calls to boot1.efi. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/amd64/boot1.efi/boot1.c Modified: head/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- head/sys/boot/amd64/boot1.efi/boot1.c Sat Mar 7 18:48:00 2015 (r279737) +++ head/sys/boot/amd64/boot1.efi/boot1.c Sat Mar 7 19:14:01 2015 (r279738) @@ -307,12 +307,19 @@ load(const char *fname) /* XXX: For secure boot, we need our own loader here */ status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, bufsize, &loaderhandle); + if (EFI_ERROR(status)) + printf("LoadImage failed with error %d\n", status); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); + if (EFI_ERROR(status)) + printf("HandleProtocol failed with error %d\n", status); + loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); + if (EFI_ERROR(status)) + printf("StartImage failed with error %d\n", status); } static void From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:16:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13D37488; Sat, 7 Mar 2015 19:16:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0C6192A; Sat, 7 Mar 2015 19:16:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JGAtX012352; Sat, 7 Mar 2015 19:16:10 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JGA63012349; Sat, 7 Mar 2015 19:16:10 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503071916.t27JGA63012349@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 7 Mar 2015 19:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279739 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:16:11 -0000 Author: gnn Date: Sat Mar 7 19:16:09 2015 New Revision: 279739 URL: https://svnweb.freebsd.org/changeset/base/279739 Log: Add a more complex TCP tracking script, which shows connections and accepts as well as state transitions. Added: head/share/dtrace/tcptrack (contents, props changed) Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Sat Mar 7 19:14:01 2015 (r279738) +++ head/share/dtrace/Makefile Sat Mar 7 19:16:09 2015 (r279739) @@ -16,7 +16,8 @@ SCRIPTS= disklatency \ disklatencycmd \ hotopen \ nfsclienttime \ - tcpstate + tcpstate \ + tcptrack SCRIPTSDIR= ${SHAREDIR}/dtrace Added: head/share/dtrace/tcptrack ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/tcptrack Sat Mar 7 19:16:09 2015 (r279739) @@ -0,0 +1,83 @@ +#!/usr/sbin/dtrace -s +/* + * Copyright (c) 2015 George V. Neville-Neil + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + * The tcptrack D script shows various information about TCP + * connections including acceptance and refusal of inbound and + * outbound connections as well as state changes. + * + * Usage: tcptrack + */ + +#pragma D option quiet +tcp:kernel::accept-established +{ + printf("Accept connection from %s:%d\tto %s:%d\n", + args[2]->ip_saddr, + args[4]->tcp_sport, + args[2]->ip_daddr, + args[4]->tcp_dport); + +} + +tcp:kernel::accept-refused +{ + printf("Refused connection from %s:%d\tto %s:%d\n", + args[2]->ip_daddr, + args[4]->tcp_dport, + args[2]->ip_saddr, + args[4]->tcp_sport); + +} + +tcp:kernel::connect-established +{ + printf("Connection established to %s:%d from %s:%d\n", + args[2]->ip_saddr, + args[4]->tcp_sport, + args[2]->ip_daddr, + args[4]->tcp_dport); + +} + +tcp:kernel::connect-refused +{ + printf("Connection refused by %s:%d from %s:%d\n", + args[2]->ip_saddr, + args[4]->tcp_sport, + args[2]->ip_daddr, + args[4]->tcp_dport); +} + +tcp:kernel::state-change +{ + newstate = args[3]->tcps_state; + oldstate = args[5]->tcps_state; + printf("State changed from %s\t\t%s\n", tcp_state_string[oldstate], + tcp_state_string[newstate]); +} + From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:29:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A727AB00; Sat, 7 Mar 2015 19:29:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 779EFA37; Sat, 7 Mar 2015 19:29:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JTsgC017408; Sat, 7 Mar 2015 19:29:54 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JTrSa017406; Sat, 7 Mar 2015 19:29:53 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503071929.t27JTrSa017406@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 7 Mar 2015 19:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279740 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:29:54 -0000 Author: gnn Date: Sat Mar 7 19:29:53 2015 New Revision: 279740 URL: https://svnweb.freebsd.org/changeset/base/279740 Log: TCP connection tracker that uses aggregations to show where connections originate from. Added: head/share/dtrace/tcpconn (contents, props changed) Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Sat Mar 7 19:16:09 2015 (r279739) +++ head/share/dtrace/Makefile Sat Mar 7 19:29:53 2015 (r279740) @@ -17,7 +17,8 @@ SCRIPTS= disklatency \ hotopen \ nfsclienttime \ tcpstate \ - tcptrack + tcptrack \ + tcpconn SCRIPTSDIR= ${SHAREDIR}/dtrace Added: head/share/dtrace/tcpconn ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/tcpconn Sat Mar 7 19:29:53 2015 (r279740) @@ -0,0 +1,47 @@ +#!/usr/sbin/dtrace -s +/* + * Copyright (c) 2015 George V. Neville-Neil + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + * The tcpconn D script shows histograms of the source of TCP connections + * + * Usage: tcpconn + */ + +#pragma D option quiet +BEGIN +{ + printf("Press Ctrl-C for output\n"); + printf("Source IP"); +} +tcp:kernel::accept-established +{ + @sources[args[2]->ip_daddr] = count(); +} +tcp:kernel::accept-refused +{ + @sources[args[2]->ip_daddr] = count(); +} From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:32:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D73DC6A; Sat, 7 Mar 2015 19:32:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA251AE1; Sat, 7 Mar 2015 19:32:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JWLE0021265; Sat, 7 Mar 2015 19:32:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JWK26021258; Sat, 7 Mar 2015 19:32:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071932.t27JWK26021258@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:32:20 +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: r279741 - in stable/10: sys/fs/autofs usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:32:22 -0000 Author: trasz Date: Sat Mar 7 19:32:19 2015 New Revision: 279741 URL: https://svnweb.freebsd.org/changeset/base/279741 Log: MFC r273127: Make automountd(8) inform autofs(4) whether directory being handled can have wildcards. This makes it possible for autofs(4) to avoid requesting automountd(8) action on access to nonexistent nodes - unless wildcards are actually used. Note that this change breaks ABI for automountd(8). MFC r278521: Restore ABI compatibility, broken in r273127. Note that while this fixes ABI with 10.1, it breaks ABI for 11-CURRENT, so rebuild of automountd(8) is neccessary. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_ioctl.h stable/10/usr.sbin/autofs/automountd.c stable/10/usr.sbin/autofs/common.c stable/10/usr.sbin/autofs/common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Sat Mar 7 19:29:53 2015 (r279740) +++ stable/10/sys/fs/autofs/autofs.c Sat Mar 7 19:32:19 2015 (r279741) @@ -274,6 +274,7 @@ autofs_task(void *context, int pending) * XXX: EIO perhaps? */ ar->ar_error = ETIMEDOUT; + ar->ar_wildcards = true; ar->ar_done = true; ar->ar_in_progress = false; cv_broadcast(&autofs_softc->sc_cv); @@ -291,12 +292,13 @@ autofs_cached(struct autofs_node *anp, c AUTOFS_ASSERT_UNLOCKED(amp); /* - * For top-level nodes we need to request automountd(8) - * assistance even if the node is marked as cached, - * but the requested subdirectory does not exist. This - * is necessary for wildcard indirect map keys to work. + * For root node we need to request automountd(8) assistance even + * if the node is marked as cached, but the requested top-level + * directory does not exist. This is necessary for wildcard indirect + * map keys to work. We don't do this if we know that there are + * no wildcards. */ - if (anp->an_parent == NULL && componentlen != 0) { + if (anp->an_parent == NULL && componentlen != 0 && anp->an_wildcards) { AUTOFS_SLOCK(amp); error = autofs_node_find(anp, component, componentlen, NULL); AUTOFS_SUNLOCK(amp); @@ -366,6 +368,7 @@ autofs_trigger_one(struct autofs_node *a struct autofs_request *ar; char *key, *path; int error = 0, request_error, last; + bool wildcards; amp = anp->an_mount; @@ -455,6 +458,8 @@ autofs_trigger_one(struct autofs_node *a ar->ar_path, request_error); } + wildcards = ar->ar_wildcards; + last = refcount_release(&ar->ar_refcount); if (last) { TAILQ_REMOVE(&autofs_softc->sc_requests, ar, ar_next); @@ -475,6 +480,7 @@ autofs_trigger_one(struct autofs_node *a */ if (error == 0 && request_error == 0 && autofs_cache > 0) { anp->an_cached = true; + anp->an_wildcards = wildcards; callout_reset(&anp->an_callout, autofs_cache * hz, autofs_cache_callout, anp); } @@ -577,6 +583,34 @@ autofs_ioctl_request(struct autofs_daemo } static int +autofs_ioctl_done_101(struct autofs_daemon_done_101 *add) +{ + struct autofs_request *ar; + + sx_xlock(&autofs_softc->sc_lock); + TAILQ_FOREACH(ar, &autofs_softc->sc_requests, ar_next) { + if (ar->ar_id == add->add_id) + break; + } + + if (ar == NULL) { + sx_xunlock(&autofs_softc->sc_lock); + AUTOFS_DEBUG("id %d not found", add->add_id); + return (ESRCH); + } + + ar->ar_error = add->add_error; + ar->ar_wildcards = true; + ar->ar_done = true; + ar->ar_in_progress = false; + cv_broadcast(&autofs_softc->sc_cv); + + sx_xunlock(&autofs_softc->sc_lock); + + return (0); +} + +static int autofs_ioctl_done(struct autofs_daemon_done *add) { struct autofs_request *ar; @@ -594,6 +628,7 @@ autofs_ioctl_done(struct autofs_daemon_d } ar->ar_error = add->add_error; + ar->ar_wildcards = add->add_wildcards; ar->ar_done = true; ar->ar_in_progress = false; cv_broadcast(&autofs_softc->sc_cv); @@ -650,6 +685,9 @@ autofs_ioctl(struct cdev *dev, u_long cm case AUTOFSREQUEST: return (autofs_ioctl_request( (struct autofs_daemon_request *)arg)); + case AUTOFSDONE101: + return (autofs_ioctl_done_101( + (struct autofs_daemon_done_101 *)arg)); case AUTOFSDONE: return (autofs_ioctl_done( (struct autofs_daemon_done *)arg)); Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Sat Mar 7 19:29:53 2015 (r279740) +++ stable/10/sys/fs/autofs/autofs.h Sat Mar 7 19:32:19 2015 (r279741) @@ -74,6 +74,7 @@ struct autofs_node { struct vnode *an_vnode; struct sx an_vnode_lock; bool an_cached; + bool an_wildcards; struct callout an_callout; int an_retries; struct timespec an_ctime; @@ -97,6 +98,7 @@ struct autofs_request { int ar_id; bool ar_done; int ar_error; + bool ar_wildcards; bool ar_in_progress; char ar_from[MAXPATHLEN]; char ar_path[MAXPATHLEN]; Modified: stable/10/sys/fs/autofs/autofs_ioctl.h ============================================================================== --- stable/10/sys/fs/autofs/autofs_ioctl.h Sat Mar 7 19:29:53 2015 (r279740) +++ stable/10/sys/fs/autofs/autofs_ioctl.h Sat Mar 7 19:32:19 2015 (r279741) @@ -71,6 +71,21 @@ struct autofs_daemon_request { char adr_options[MAXPATHLEN]; }; +/* + * Compatibility with 10.1-RELEASE automountd(8). + */ +struct autofs_daemon_done_101 { + /* + * Identifier, copied from adr_id. + */ + int add_id; + + /* + * Error number, possibly returned to userland. + */ + int add_error; +}; + struct autofs_daemon_done { /* * Identifier, copied from adr_id. @@ -78,12 +93,24 @@ struct autofs_daemon_done { int add_id; /* + * Set to 1 if the map may contain wildcard entries; + * otherwise autofs will do negative caching. + */ + int add_wildcards; + + /* * Error number, possibly returned to userland. */ int add_error; + + /* + * Reserved for future use. + */ + int add_spare[7]; }; #define AUTOFSREQUEST _IOR('I', 0x01, struct autofs_daemon_request) -#define AUTOFSDONE _IOW('I', 0x02, struct autofs_daemon_done) +#define AUTOFSDONE101 _IOW('I', 0x02, struct autofs_daemon_done_101) +#define AUTOFSDONE _IOW('I', 0x03, struct autofs_daemon_done) #endif /* !AUTOFS_IOCTL_H */ Modified: stable/10/usr.sbin/autofs/automountd.c ============================================================================== --- stable/10/usr.sbin/autofs/automountd.c Sat Mar 7 19:29:53 2015 (r279740) +++ stable/10/usr.sbin/autofs/automountd.c Sat Mar 7 19:32:19 2015 (r279741) @@ -68,13 +68,14 @@ static int autofs_fd; static int request_id; static void -done(int request_error) +done(int request_error, bool wildcards) { struct autofs_daemon_done add; int error; memset(&add, 0, sizeof(add)); add.add_id = request_id; + add.add_wildcards = wildcards; add.add_error = request_error; log_debugx("completing request %d with error %d", @@ -172,7 +173,7 @@ static void exit_callback(void) { - done(EIO); + done(EIO, true); } static void @@ -184,6 +185,7 @@ handle_request(const struct autofs_daemo FILE *f; char *options, *fstype, *nobrowse, *retrycnt, *tmp; int error; + bool wildcards; log_debugx("got request %d: from %s, path %s, prefix \"%s\", " "key \"%s\", options \"%s\"", adr->adr_id, adr->adr_from, @@ -209,9 +211,26 @@ handle_request(const struct autofs_daemo checked_strdup(adr->adr_options), checked_strdup(map), checked_strdup("[kernel request]"), lineno); } - parse_map(parent, map, adr->adr_key[0] != '\0' ? adr->adr_key : NULL); + + /* + * "Wildcards" here actually means "make autofs(4) request + * automountd(8) action if the node being looked up does not + * exist, even though the parent is marked as cached". This + * needs to be done for maps with wildcard entries, but also + * for special and executable maps. + */ + parse_map(parent, map, adr->adr_key[0] != '\0' ? adr->adr_key : NULL, + &wildcards); + if (!wildcards) + wildcards = node_has_wildcards(parent); + if (wildcards) + log_debugx("map may contain wildcard entries"); + else + log_debugx("map does not contain wildcard entries"); + if (adr->adr_key[0] != '\0') node_expand_wildcard(root, adr->adr_key); + node = node_find(root, adr->adr_path); if (node == NULL) { log_errx(1, "map %s does not contain key for \"%s\"; " @@ -236,7 +255,7 @@ handle_request(const struct autofs_daemo if (nobrowse != NULL && adr->adr_key[0] == '\0') { log_debugx("skipping map %s due to \"nobrowse\" " "option; exiting", map); - done(0); + done(0, true); /* * Exit without calling exit_callback(). @@ -263,7 +282,7 @@ handle_request(const struct autofs_daemo } log_debugx("nothing to mount; exiting"); - done(0); + done(0, wildcards); /* * Exit without calling exit_callback(). @@ -337,7 +356,7 @@ handle_request(const struct autofs_daemo log_errx(1, "mount failed"); log_debugx("mount done; exiting"); - done(0); + done(0, wildcards); /* * Exit without calling exit_callback(). Modified: stable/10/usr.sbin/autofs/common.c ============================================================================== --- stable/10/usr.sbin/autofs/common.c Sat Mar 7 19:29:53 2015 (r279740) +++ stable/10/usr.sbin/autofs/common.c Sat Mar 7 19:32:19 2015 (r279741) @@ -498,6 +498,19 @@ node_is_direct_map(const struct node *n) return (true); } +bool +node_has_wildcards(const struct node *n) +{ + const struct node *child; + + TAILQ_FOREACH(child, &n->n_children, n_next) { + if (strcmp(child->n_key, "*") == 0) + return (true); + } + + return (false); +} + static void node_expand_maps(struct node *n, bool indirect) { @@ -526,7 +539,7 @@ node_expand_maps(struct node *n, bool in log_debugx("map \"%s\" is a direct map, parsing", child->n_map); } - parse_map(child, child->n_map, NULL); + parse_map(child, child->n_map, NULL, NULL); } } @@ -996,7 +1009,8 @@ parse_included_map(struct node *parent, } void -parse_map(struct node *parent, const char *map, const char *key) +parse_map(struct node *parent, const char *map, const char *key, + bool *wildcards) { char *path = NULL; int error, ret; @@ -1007,8 +1021,14 @@ parse_map(struct node *parent, const cha log_debugx("parsing map \"%s\"", map); - if (map[0] == '-') + if (wildcards != NULL) + *wildcards = false; + + if (map[0] == '-') { + if (wildcards != NULL) + *wildcards = true; return (parse_special_map(parent, map, key)); + } if (map[0] == '/') { path = checked_strdup(map); @@ -1035,6 +1055,9 @@ parse_map(struct node *parent, const cha if (executable) { log_debugx("map \"%s\" is executable", map); + if (wildcards != NULL) + *wildcards = true; + if (key != NULL) { yyin = auto_popen(path, key, NULL); } else { Modified: stable/10/usr.sbin/autofs/common.h ============================================================================== --- stable/10/usr.sbin/autofs/common.h Sat Mar 7 19:29:53 2015 (r279740) +++ stable/10/usr.sbin/autofs/common.h Sat Mar 7 19:32:19 2015 (r279741) @@ -80,6 +80,7 @@ struct node *node_new_map(struct node *p char *map, const char *config_file, int config_line); struct node *node_find(struct node *root, const char *mountpoint); bool node_is_direct_map(const struct node *n); +bool node_has_wildcards(const struct node *n); char *node_path(const struct node *n); char *node_options(const struct node *n); void node_expand_ampersand(struct node *root, const char *key); @@ -88,7 +89,8 @@ int node_expand_defined(struct node *roo void node_expand_indirect_maps(struct node *n); void node_print(const struct node *n); void parse_master(struct node *root, const char *path); -void parse_map(struct node *parent, const char *map, const char *args); +void parse_map(struct node *parent, const char *map, const char *args, + bool *wildcards); char *defined_expand(const char *string); void defined_init(void); void defined_parse_and_add(char *def); From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:36:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B006DF5; Sat, 7 Mar 2015 19:36:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44089B3F; Sat, 7 Mar 2015 19:36:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Ja8eB021827; Sat, 7 Mar 2015 19:36:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27Ja6rD021820; Sat, 7 Mar 2015 19:36:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071936.t27Ja6rD021820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:36:06 +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: r279742 - in stable/10: sys/fs/autofs usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:36:08 -0000 Author: trasz Date: Sat Mar 7 19:36:06 2015 New Revision: 279742 URL: https://svnweb.freebsd.org/changeset/base/279742 Log: MFC r274859: Implement "automount -c". Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/usr.sbin/autofs/automount.8 stable/10/usr.sbin/autofs/automount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Sat Mar 7 19:32:19 2015 (r279741) +++ stable/10/sys/fs/autofs/autofs.c Sat Mar 7 19:36:06 2015 (r279742) @@ -318,6 +318,18 @@ autofs_cache_callout(void *context) anp->an_cached = false; } +void +autofs_flush(struct autofs_mount *amp) +{ + + /* + * XXX: This will do for now, but ideally we should iterate + * over all the nodes. + */ + amp->am_root->an_cached = false; + AUTOFS_DEBUG("%s flushed", amp->am_mountpoint); +} + /* * The set/restore sigmask functions are used to (temporarily) overwrite * the thread td_sigmask during triggering. Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Sat Mar 7 19:32:19 2015 (r279741) +++ stable/10/sys/fs/autofs/autofs.h Sat Mar 7 19:36:06 2015 (r279742) @@ -133,6 +133,7 @@ int autofs_trigger(struct autofs_node *a int componentlen); bool autofs_cached(struct autofs_node *anp, const char *component, int componentlen); +void autofs_flush(struct autofs_mount *amp); bool autofs_ignore_thread(const struct thread *td); int autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp, const char *name, int namelen, struct autofs_node **anpp); Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Sat Mar 7 19:32:19 2015 (r279741) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Sat Mar 7 19:36:06 2015 (r279742) @@ -61,8 +61,10 @@ autofs_mount(struct mount *mp) if (vfs_filteropt(mp->mnt_optnew, autofs_opts)) return (EINVAL); - if (mp->mnt_flag & MNT_UPDATE) + if (mp->mnt_flag & MNT_UPDATE) { + autofs_flush(VFSTOAUTOFS(mp)); return (0); + } if (vfs_getopt(mp->mnt_optnew, "from", (void **)&from, NULL)) return (EINVAL); Modified: stable/10/usr.sbin/autofs/automount.8 ============================================================================== --- stable/10/usr.sbin/autofs/automount.8 Sat Mar 7 19:32:19 2015 (r279741) +++ stable/10/usr.sbin/autofs/automount.8 Sat Mar 7 19:36:06 2015 (r279742) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2014 +.Dd November 22, 2014 .Dt AUTOMOUNT 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nm .Op Fl D Ar name=value .Op Fl L +.Op Fl c .Op Fl f .Op Fl o Ar options .Op Fl v @@ -64,6 +65,9 @@ and any direct maps, then print them to When specified more than once, all the maps, including indirect ones, will be parsed and shown. This is useful when debugging configuration problems. +.It Fl c +Flush caches, discarding possibly stale information obtained from maps +and directory services. .It Fl f Force unmount, to be used with .Fl u . Modified: stable/10/usr.sbin/autofs/automount.c ============================================================================== --- stable/10/usr.sbin/autofs/automount.c Sat Mar 7 19:32:19 2015 (r279741) +++ stable/10/usr.sbin/autofs/automount.c Sat Mar 7 19:36:06 2015 (r279742) @@ -230,6 +230,57 @@ mount_unmount(struct node *root) } static void +flush_autofs(const char *fspath) +{ + struct iovec *iov = NULL; + char errmsg[255]; + int error, iovlen = 0; + + log_debugx("flushing %s", fspath); + memset(errmsg, 0, sizeof(errmsg)); + + build_iovec(&iov, &iovlen, "fstype", + __DECONST(void *, "autofs"), (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", + __DECONST(void *, fspath), (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", + errmsg, sizeof(errmsg)); + + error = nmount(iov, iovlen, MNT_UPDATE); + if (error != 0) { + if (*errmsg != '\0') { + log_err(1, "cannot flush %s: %s", + fspath, errmsg); + } else { + log_err(1, "cannot flush %s", fspath); + } + } +} + +static void +flush_caches(void) +{ + struct statfs *mntbuf; + int i, nitems; + + nitems = getmntinfo(&mntbuf, MNT_WAIT); + if (nitems <= 0) + log_err(1, "getmntinfo"); + + log_debugx("flushing autofs caches"); + + for (i = 0; i < nitems; i++) { + if (strcmp(mntbuf[i].f_fstypename, "autofs") != 0) { + log_debugx("skipping %s, filesystem type is not autofs", + mntbuf[i].f_mntonname); + continue; + } + + flush_autofs(mntbuf[i].f_mntonname); + } +} + +static void unmount_automounted(bool force) { struct statfs *mntbuf; @@ -262,7 +313,7 @@ static void usage_automount(void) { - fprintf(stderr, "usage: automount [-D name=value][-o opts][-Lfuv]\n"); + fprintf(stderr, "usage: automount [-D name=value][-o opts][-Lcfuv]\n"); exit(1); } @@ -272,7 +323,7 @@ main_automount(int argc, char **argv) struct node *root; int ch, debug = 0, show_maps = 0; char *options = NULL; - bool do_unmount = false, force_unmount = false; + bool do_unmount = false, force_unmount = false, flush = false; /* * Note that in automount(8), the only purpose of variable @@ -280,7 +331,7 @@ main_automount(int argc, char **argv) */ defined_init(); - while ((ch = getopt(argc, argv, "D:Lfo:uv")) != -1) { + while ((ch = getopt(argc, argv, "D:Lfco:uv")) != -1) { switch (ch) { case 'D': defined_parse_and_add(optarg); @@ -288,6 +339,9 @@ main_automount(int argc, char **argv) case 'L': show_maps++; break; + case 'c': + flush = true; + break; case 'f': force_unmount = true; break; @@ -319,6 +373,11 @@ main_automount(int argc, char **argv) log_init(debug); + if (flush) { + flush_caches(); + return (0); + } + if (do_unmount) { unmount_automounted(force_unmount); return (0); From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:39:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E594DF5F; Sat, 7 Mar 2015 19:39:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFA3AB69; Sat, 7 Mar 2015 19:39:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JdHBR022224; Sat, 7 Mar 2015 19:39:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JdHNk022223; Sat, 7 Mar 2015 19:39:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071939.t27JdHNk022223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:39:17 +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: r279743 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:39:18 -0000 Author: trasz Date: Sat Mar 7 19:39:16 2015 New Revision: 279743 URL: https://svnweb.freebsd.org/changeset/base/279743 Log: MFC r275755: Fix spurious "child process X terminated with exit status 1" messages from automountd(8). Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automountd.c ============================================================================== --- stable/10/usr.sbin/autofs/automountd.c Sat Mar 7 19:36:06 2015 (r279742) +++ stable/10/usr.sbin/autofs/automountd.c Sat Mar 7 19:39:16 2015 (r279743) @@ -82,14 +82,8 @@ done(int request_error, bool wildcards) request_id, request_error); error = ioctl(autofs_fd, AUTOFSDONE, &add); - if (error != 0) { - /* - * Do this instead of log_err() to avoid calling - * done() again with error, from atexit handler. - */ + if (error != 0) log_warn("AUTOFSDONE"); - } - quick_exit(1); } /* From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:41:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0E8C208; Sat, 7 Mar 2015 19:41:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB75C09; Sat, 7 Mar 2015 19:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Jfw05026179; Sat, 7 Mar 2015 19:41:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JfwK5026178; Sat, 7 Mar 2015 19:41:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071941.t27JfwK5026178@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:41: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: r279744 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:41:59 -0000 Author: trasz Date: Sat Mar 7 19:41:58 2015 New Revision: 279744 URL: https://svnweb.freebsd.org/changeset/base/279744 Log: MFC r275756: Fix bug that made automount(8) never unmount stale autofs(5) mounts, ie mounts for entries that were there in auto_master(5), and then got removed. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c ============================================================================== --- stable/10/usr.sbin/autofs/common.c Sat Mar 7 19:39:16 2015 (r279743) +++ stable/10/usr.sbin/autofs/common.c Sat Mar 7 19:41:58 2015 (r279744) @@ -676,8 +676,8 @@ node_print(const struct node *n) node_print_indent(child, 0); } -struct node * -node_find(struct node *node, const char *path) +static struct node * +node_find_x(struct node *node, const char *path) { struct node *child, *found; char *tmp; @@ -702,7 +702,7 @@ node_find(struct node *node, const char free(tmp); TAILQ_FOREACH(child, &node->n_children, n_next) { - found = node_find(child, path); + found = node_find_x(child, path); if (found != NULL) return (found); } @@ -710,6 +710,17 @@ node_find(struct node *node, const char return (node); } +struct node * +node_find(struct node *root, const char *path) +{ + struct node *node; + + node = node_find_x(root, path); + if (node == root) + return (NULL); + return (node); +} + /* * Canonical form of a map entry looks like this: * From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:45:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF21834D; Sat, 7 Mar 2015 19:45:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EFE8C21; Sat, 7 Mar 2015 19:45:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Jj8L1026687; Sat, 7 Mar 2015 19:45:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27Jj81b026686; Sat, 7 Mar 2015 19:45:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071945.t27Jj81b026686@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:45:08 +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: r279745 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:45:08 -0000 Author: trasz Date: Sat Mar 7 19:45:07 2015 New Revision: 279745 URL: https://svnweb.freebsd.org/changeset/base/279745 Log: MFC r277834: When there are no automounted filesystems, autounmountd(8) should wait for filesystem event, instead of looping on a timeout. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/autounmountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/autounmountd.c ============================================================================== --- stable/10/usr.sbin/autofs/autounmountd.c Sat Mar 7 19:41:58 2015 (r279744) +++ stable/10/usr.sbin/autofs/autounmountd.c Sat Mar 7 19:45:07 2015 (r279745) @@ -182,7 +182,7 @@ expire_automounted(double expiration_tim { struct automounted_fs *af, *tmpaf; time_t now; - double mounted_for, mounted_max = 0; + double mounted_for, mounted_max = -1.0; int error; now = time(NULL); @@ -231,21 +231,28 @@ do_wait(int kq, double sleep_time) { struct timespec timeout; struct kevent unused; - int error; - - assert(sleep_time > 0); - timeout.tv_sec = sleep_time; - timeout.tv_nsec = 0; + int nevents; - log_debugx("waiting for filesystem event for %.0f seconds", sleep_time); - error = kevent(kq, NULL, 0, &unused, 1, &timeout); - if (error < 0) + if (sleep_time != -1.0) { + assert(sleep_time > 0.0); + timeout.tv_sec = sleep_time; + timeout.tv_nsec = 0; + + log_debugx("waiting for filesystem event for %.0f seconds", sleep_time); + nevents = kevent(kq, NULL, 0, &unused, 1, &timeout); + } else { + log_debugx("waiting for filesystem event"); + nevents = kevent(kq, NULL, 0, &unused, 1, NULL); + } + if (nevents < 0) log_err(1, "kevent"); - if (error == 0) + if (nevents == 0) { log_debugx("timeout reached"); - else + assert(sleep_time > 0.0); + } else { log_debugx("got filesystem event"); + } } int @@ -324,7 +331,10 @@ main_autounmountd(int argc, char **argv) for (;;) { refresh_automounted(); mounted_max = expire_automounted(expiration_time); - if (mounted_max < expiration_time) { + if (mounted_max == -1.0) { + sleep_time = mounted_max; + log_debugx("no filesystems to expire"); + } else if (mounted_max < expiration_time) { sleep_time = difftime(expiration_time, mounted_max); log_debugx("some filesystems expire in %.0f seconds", sleep_time); From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:46:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D1CE485; Sat, 7 Mar 2015 19:46:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26F8FC2F; Sat, 7 Mar 2015 19:46:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JkmB1026935; Sat, 7 Mar 2015 19:46:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27Jkmjn026934; Sat, 7 Mar 2015 19:46:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071946.t27Jkmjn026934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:46: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: r279746 - stable/10/sbin/geom/class/mountver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:46:48 -0000 Author: trasz Date: Sat Mar 7 19:46:47 2015 New Revision: 279746 URL: https://svnweb.freebsd.org/changeset/base/279746 Log: MFC r277799: Fix sysctl name. Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/geom/class/mountver/gmountver.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/mountver/gmountver.8 ============================================================================== --- stable/10/sbin/geom/class/mountver/gmountver.8 Sat Mar 7 19:45:07 2015 (r279745) +++ stable/10/sbin/geom/class/mountver/gmountver.8 Sat Mar 7 19:46:47 2015 (r279746) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2010 +.Dd January 27, 2015 .Dt GMOUNTVER 8 .Os .Sh NAME @@ -110,7 +110,7 @@ GEOM class. This can be set to a number between 0 and 3 inclusive. If set to 0 minimal debug information is printed, and if set to 3 the maximum amount of debug information is printed. -.It Va kern.geom.mountver.check.check_ident : No 1 +.It Va kern.geom.mountver.check_ident : No 1 This can be set to 0 or 1. If set to 0, .Nm From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:49:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3F1C5D1; Sat, 7 Mar 2015 19:49:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADE95C42; Sat, 7 Mar 2015 19:49:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27Jn3Sa027270; Sat, 7 Mar 2015 19:49:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27Jn3fj027269; Sat, 7 Mar 2015 19:49:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071949.t27Jn3fj027269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:49: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: r279747 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:49:03 -0000 Author: trasz Date: Sat Mar 7 19:49:02 2015 New Revision: 279747 URL: https://svnweb.freebsd.org/changeset/base/279747 Log: MFC r277175: Mention /net in hier(7). Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man7/hier.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Sat Mar 7 19:46:47 2015 (r279746) +++ stable/10/share/man/man7/hier.7 Sat Mar 7 19:49:02 2015 (r279747) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd January 14, 2015 .Dt HIER 7 .Os .Sh NAME @@ -163,6 +163,10 @@ floppy disks .It Pa /mnt/ empty directory commonly used by system administrators as a temporary mount point +.It Pa /net/ +automounted NFS shares; +see +.Xr auto_master 5 .It Pa /proc/ process file system; see From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 19:52:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 506A3721; Sat, 7 Mar 2015 19:52:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A920CED; Sat, 7 Mar 2015 19:52:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27JqE2T031149; Sat, 7 Mar 2015 19:52:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27JqEJE031148; Sat, 7 Mar 2015 19:52:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503071952.t27JqEJE031148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:52:14 +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: r279748 - stable/10/usr.sbin/fstyp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 19:52:15 -0000 Author: trasz Date: Sat Mar 7 19:52:14 2015 New Revision: 279748 URL: https://svnweb.freebsd.org/changeset/base/279748 Log: MFC r277172: Improve wording. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/fstyp/fstyp.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/fstyp/fstyp.8 ============================================================================== --- stable/10/usr.sbin/fstyp/fstyp.8 Sat Mar 7 19:49:02 2015 (r279747) +++ stable/10/usr.sbin/fstyp/fstyp.8 Sat Mar 7 19:52:14 2015 (r279748) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2014 +.Dd January 14, 2015 .Dt FSTYP 8 .Os .Sh NAME @@ -58,9 +58,9 @@ is built specifically to detect filesyst .Xr file 1 in several ways. The output is machine-parsable, filesystem labels are supported, -and only filesystems are identified. -Security is improved with -.Xr capsicum 4 . +the utility runs sandboxed using +.Xr capsicum 4 , +and does not try to recognize any file format other than filesystems. .Pp These options are available: .Bl -tag -width ".Fl l" From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 20:00:27 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4069D8CB; Sat, 7 Mar 2015 20:00:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA81D15; Sat, 7 Mar 2015 20:00:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27K0Rgq032382; Sat, 7 Mar 2015 20:00:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27K0RAr032381; Sat, 7 Mar 2015 20:00:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503072000.t27K0RAr032381@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 20:00:27 +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: r279749 - stable/10/sys/fs/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 20:00:27 -0000 Author: trasz Date: Sat Mar 7 20:00:26 2015 New Revision: 279749 URL: https://svnweb.freebsd.org/changeset/base/279749 Log: MFC r271927: Turns out -1 is a perfectly valid error number, ERESTART. Remove useless code written under assumption that it wasn't. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Sat Mar 7 19:52:14 2015 (r279748) +++ stable/10/sys/fs/autofs/autofs.c Sat Mar 7 20:00:26 2015 (r279749) @@ -450,11 +450,6 @@ autofs_trigger_one(struct autofs_node *a &autofs_softc->sc_lock); autofs_restore_sigmask(&oldset); if (error != 0) { - /* - * XXX: For some reson this returns -1 - * instead of EINTR, wtf?! - */ - error = EINTR; AUTOFS_WARN("cv_wait_sig for %s failed " "with error %d", ar->ar_path, error); break; @@ -520,7 +515,7 @@ autofs_trigger(struct autofs_node *anp, anp->an_retries = 0; return (0); } - if (error == EINTR) { + if (error == EINTR || error == ERESTART) { AUTOFS_DEBUG("trigger interrupted by signal, " "not retrying"); anp->an_retries = 0; @@ -566,11 +561,6 @@ autofs_ioctl_request(struct autofs_daemo error = cv_wait_sig(&autofs_softc->sc_cv, &autofs_softc->sc_lock); if (error != 0) { - /* - * XXX: For some reson this returns -1 instead - * of EINTR, wtf?! - */ - error = EINTR; sx_xunlock(&autofs_softc->sc_lock); AUTOFS_DEBUG("failed with error %d", error); return (error); From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 20:14:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E060BBA0; Sat, 7 Mar 2015 20:14:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C88FAEAC; Sat, 7 Mar 2015 20:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27KEoVX041079; Sat, 7 Mar 2015 20:14:50 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27KElV5041056; Sat, 7 Mar 2015 20:14:47 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503072014.t27KElV5041056@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 7 Mar 2015 20:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279750 - in head: . sys/conf sys/kern sys/powerpc/aim sys/powerpc/booke sys/powerpc/ofw sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 20:14:51 -0000 Author: nwhitehorn Date: Sat Mar 7 20:14:46 2015 New Revision: 279750 URL: https://svnweb.freebsd.org/changeset/base/279750 Log: Make 32-bit PowerPC kernels, like 64-bit PowerPC kernels, position-independent executables. The goal here, not yet accomplished, is to let the e500 kernel run under QEMU by setting KERNBASE to something that fits in low memory and then having the kernel relocate itself at runtime. Modified: head/UPDATING head/sys/conf/Makefile.powerpc head/sys/kern/link_elf.c head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/ofw/ofwcall32.S head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/swtch32.S Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Mar 7 20:00:26 2015 (r279749) +++ head/UPDATING Sat Mar 7 20:14:46 2015 (r279750) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150307: + The 32-bit PowerPC kernel has been changed to a position-independent + executable. This can only be booted with a version of loader(8) + newer than January 31, 2015, so make sure to update both world and + kernel before rebooting. + 20150217: If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014), but before r278950, the RNG was not seeded properly. Immediately Modified: head/sys/conf/Makefile.powerpc ============================================================================== --- head/sys/conf/Makefile.powerpc Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/conf/Makefile.powerpc Sat Mar 7 20:14:46 2015 (r279750) @@ -37,10 +37,9 @@ INCLUDES+= -I$S/contrib/libfdt CFLAGS+= -msoft-float -Wa,-many -.if ${MACHINE_ARCH} == "powerpc64" +# Build position-independent kernel CFLAGS+= -fPIC LDFLAGS+= -pie -.endif .if !empty(DDB_ENABLED) CFLAGS+= -fno-omit-frame-pointer Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/kern/link_elf.c Sat Mar 7 20:14:46 2015 (r279750) @@ -411,7 +411,7 @@ link_elf_init(void* arg) ef = (elf_file_t) linker_kernel_file; ef->preloaded = 1; -#ifdef __powerpc64__ +#ifdef __powerpc__ ef->address = (caddr_t) (__startkernel - KERNBASE); #else ef->address = 0; Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/aim/locore32.S Sat Mar 7 20:14:46 2015 (r279750) @@ -108,36 +108,47 @@ kernel_text: .text .globl __start __start: - li 8,0 - li 9,0x100 - mtctr 9 -1: - dcbf 0,8 - icbi 0,8 - addi 8,8,0x20 - bdnz 1b - sync - isync - - /* Zero bss, in case we were started by something unhelpful */ - li 0,0 - lis 8,_edata@ha - addi 8,8,_edata@l - lis 9,_end@ha - addi 9,9,_end@l -2: stw 0,0(8) - addi 8,8,4 - cmplw 8,9 - blt 2b + /* Figure out where we are */ + bl 1f + .long _DYNAMIC-. + .long _GLOBAL_OFFSET_TABLE_-. + .long tmpstk-. +1: mflr %r30 + + /* Set up temporary stack pointer */ + lwz %r1,8(%r30) + add %r1,%r1,%r30 + addi %r1,%r1,(8+TMPSTKSZ-32) + + /* Relocate self */ + stw %r3,16(%r1) + stw %r4,20(%r1) + stw %r5,24(%r1) + stw %r6,28(%r1) + + lwz %r3,0(%r30) /* _DYNAMIC in %r3 */ + add %r3,%r3,%r30 + lwz %r4,4(%r30) /* GOT pointer */ + add %r4,%r4,%r30 + lwz %r4,4(%r4) /* got[0] is _DYNAMIC link addr */ + subf %r4,%r4,%r3 /* subtract to calculate relocbase */ + bl elf_reloc_self - lis 1,(tmpstk+TMPSTKSZ-16)@ha - addi 1,1,(tmpstk+TMPSTKSZ-16)@l + lwz %r3,16(%r1) + lwz %r4,20(%r1) + lwz %r5,24(%r1) + lwz %r6,28(%r1) + /* MD setup */ bl powerpc_init + + /* Set stack pointer to new value and branch to mi_startup */ mr %r1, %r3 li %r3, 0 stw %r3, 0(%r1) bl mi_startup + + /* If mi_startup somehow returns, exit. This would be bad. */ b OF_exit /* Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/aim/machdep.c Sat Mar 7 20:14:46 2015 (r279750) @@ -235,10 +235,13 @@ extern void *testppc64, *testppc64size; extern void *restorebridge, *restorebridgesize; extern void *rfid_patch, *rfi_patch1, *rfi_patch2; extern void *trapcode64; + +extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; #endif extern void *rstcode, *rstcodeend; -extern void *trapcode, *trapcodeend, *trapcode2; +extern void *trapcode, *trapcodeend; +extern void *generictrap, *generictrap64; extern void *slbtrap, *slbtrapend; extern void *alitrap, *aliend; extern void *dsitrap, *dsiend; @@ -254,7 +257,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_ { struct pcpu *pc; vm_offset_t startkernel, endkernel; - void *generictrap; size_t trap_offset, trapsize; vm_offset_t trap; void *kmdp; @@ -467,20 +469,9 @@ powerpc_init(vm_offset_t fdt, vm_offset_ /* rfi_patch2 is at the end of dbleave */ bcopy(&rfid_patch,&rfi_patch2,4); #endif - - /* - * Set the common trap entry point to the one that - * knows to restore 32-bit operation on execution. - */ - - generictrap = &trapcode64; - } else { - generictrap = &trapcode; } - #else /* powerpc64 */ cpu_features |= PPC_FEATURE_64; - generictrap = &trapcode; #endif trapsize = (size_t)&trapcodeend - (size_t)&trapcode; @@ -490,7 +481,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ * different ones in a minute. */ for (trap = EXC_RST; trap < EXC_LAST; trap += 0x20) - bcopy(generictrap, (void *)trap, trapsize); + bcopy(&trapcode, (void *)trap, trapsize); #ifndef __powerpc64__ if (cpu_features & PPC_FEATURE_64) { @@ -530,12 +521,19 @@ powerpc_init(vm_offset_t fdt, vm_offset_ #ifdef __powerpc64__ /* Set TOC base so that the interrupt code can get at it */ - *((void **)TRAP_GENTRAP) = &trapcode2; + *((void **)TRAP_GENTRAP) = &generictrap; *((register_t *)TRAP_TOCBASE) = toc; bcopy(&slbtrap, (void *)EXC_DSE,(size_t)&slbtrapend - (size_t)&slbtrap); bcopy(&slbtrap, (void *)EXC_ISE,(size_t)&slbtrapend - (size_t)&slbtrap); #else + /* Set branch address for trap code */ + if (cpu_features & PPC_FEATURE_64) + *((void **)TRAP_GENTRAP) = &generictrap64; + else + *((void **)TRAP_GENTRAP) = &generictrap; + *((void **)TRAP_TOCBASE) = _GLOBAL_OFFSET_TABLE_; + /* G2-specific TLB miss helper handlers */ bcopy(&imisstrap, (void *)EXC_IMISS, (size_t)&imisssize); bcopy(&dlmisstrap, (void *)EXC_DLMISS, (size_t)&dlmisssize); Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/aim/trap_subr32.S Sat Mar 7 20:14:46 2015 (r279750) @@ -74,8 +74,9 @@ * Kernel SRs are loaded directly from kernel_pmap_ */ #define RESTORE_KERN_SRS(pmap,sr) \ - lis pmap,CNAME(kernel_pmap_store)@ha; \ - lwzu sr,CNAME(kernel_pmap_store)+PM_SR@l(pmap); \ + lwz pmap,TRAP_TOCBASE(0); \ + lwz pmap,CNAME(kernel_pmap_store)@got(pmap); \ + lwzu sr,PM_SR(pmap); \ RESTORE_SRS(pmap,sr) /* @@ -301,7 +302,12 @@ CNAME(restorebridgesize) = .-CNAME(resto */ .globl CNAME(rstcode), CNAME(rstcodeend) CNAME(rstcode): - ba cpu_reset + bl 1f + .long cpu_reset +1: mflr %r31 + lwz %r31,0(%r31) + mtlr %r31 + blrl CNAME(rstcodeend): cpu_reset: @@ -313,12 +319,12 @@ cpu_reset: mflr %r1 addi %r1,%r1,(124-16)@l - bla CNAME(cpudep_ap_early_bootstrap) + bl CNAME(cpudep_ap_early_bootstrap) lis %r3,1@l - bla CNAME(pmap_cpu_bootstrap) - bla CNAME(cpudep_ap_bootstrap) + bl CNAME(pmap_cpu_bootstrap) + bl CNAME(cpudep_ap_bootstrap) mr %r1,%r3 - bla CNAME(cpudep_ap_setup) + bl CNAME(cpudep_ap_setup) GET_CPUINFO(%r5) lwz %r3,(PC_RESTORE)(%r5) cmplwi %cr0,%r3,0 @@ -327,7 +333,7 @@ cpu_reset: b CNAME(longjmp) 2: #ifdef SMP - bla CNAME(machdep_ap_bootstrap) + bl CNAME(machdep_ap_bootstrap) #endif /* Should not be reached */ @@ -344,22 +350,13 @@ CNAME(trapcode): mtsprg1 %r1 /* save SP */ mflr %r1 /* Save the old LR in r1 */ mtsprg2 %r1 /* And then in SPRG2 */ - li %r1, 0x20 /* How to get the vector from LR */ - bla generictrap /* LR & SPRG3 is exception # */ + lwz %r1, TRAP_GENTRAP(0) /* Get branch address */ + mtlr %r1 + li %r1, 0xe0 /* How to get the vector from LR */ + blrl /* LR & (0xff00 | r1) is exception # */ CNAME(trapcodeend): /* - * 64-bit version of trapcode. Identical, except it calls generictrap64. - */ - .globl CNAME(trapcode64) -CNAME(trapcode64): - mtsprg1 %r1 /* save SP */ - mflr %r1 /* Save the old LR in r1 */ - mtsprg2 %r1 /* And then in SPRG2 */ - li %r1, 0x20 /* How to get the vector from LR */ - bla generictrap64 /* LR & SPRG3 is exception # */ - -/* * For ALI: has to save DSISR and DAR */ .globl CNAME(alitrap),CNAME(aliend) @@ -385,7 +382,14 @@ CNAME(alitrap): /* Test whether we already had PR set */ mfsrr1 %r31 mtcr %r31 - bla s_trap + + /* Jump to s_trap */ + bl 1f + .long s_trap +1: mflr %r31 + lwz %r31,0(%r31) + mtlr %r31 + blrl CNAME(aliend): /* @@ -449,7 +453,7 @@ isi1: xoris %r0, %r0, 0x2 /* flip the msr bit */ mtcrf 0x80, %r3 /* restore CR0 */ mtmsr %r0 /* flip back to the native gprs */ - ba EXC_ISI /* go to instr. access interrupt */ + ba EXC_ISI /* go to instr. access interrupt */ CNAME(imisssize) = .-CNAME(imisstrap) @@ -613,13 +617,15 @@ CNAME(dsitrap): rlwinm %r31,%r31,7,25,28 /* get segment * 8 */ /* get batu */ - addis %r31,%r31,CNAME(battable)@ha - lwz %r30,CNAME(battable)@l(31) + lwz %r30,TRAP_TOCBASE(0) + lwz %r30,CNAME(battable)@got(%r30) + add %r31,%r30,%r31 + lwz %r30,0(%r31) mtcr %r30 bf 30,1f /* branch if supervisor valid is false */ /* get batl */ - lwz %r31,CNAME(battable)+4@l(31) + lwz %r31,4(%r31) /* We randomly use the highest two bat registers here */ mftb %r28 andi. %r28,%r28,1 @@ -644,7 +650,14 @@ CNAME(dsitrap): rfi /* return to trapped code */ 1: mflr %r28 /* save LR (SP already saved) */ - bla disitrap + + /* Jump to disitrap */ + bl 4f + .long disitrap +4: mflr %r1 + lwz %r1,0(%r1) + mtlr %r1 + blrl CNAME(dsiend): /* @@ -711,7 +724,7 @@ realtrap: GET_CPUINFO(%r1) lwz %r1,PC_CURPCB(%r1) RESTORE_KERN_SRS(%r30,%r31) /* enable kernel mapping */ - ba s_trap + b s_trap /* * generictrap does some standard setup for trap handling to minimize @@ -723,6 +736,7 @@ realtrap: * SPRG2 - Original LR */ + .globl CNAME(generictrap64) generictrap64: mtsprg3 %r31 mfmsr %r31 @@ -731,6 +745,7 @@ generictrap64: mfsprg3 %r31 isync + .globl CNAME(generictrap) generictrap: /* Save R1 for computing the exception vector */ mtsprg3 %r1 @@ -848,8 +863,9 @@ dbtrap: andi. %r1,%r1,0xff00 mtsprg3 %r1 - lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */ - addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l + lwz %r1,TRAP_TOCBASE(0) /* get new SP */ + lwz %r1,tmpstk@got(%r1) + addi %r1,%r1,TMPSTKSZ-16 FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ @@ -896,9 +912,11 @@ CNAME(dblow): mfsprg2 %r29 /* ... and r29 */ mflr %r1 /* save LR */ mtsprg2 %r1 /* And then in SPRG2 */ - li %r1, 0 /* How to get the vector from LR */ - bla generictrap /* and we look like a generic trap */ + lwz %r1, TRAP_GENTRAP(0) /* Get branch address */ + mtlr %r1 + li %r1, 0 /* How to get the vector from LR */ + blrl /* LR & (0xff00 | r1) is exception # */ 1: /* Privileged, so drop to KDB */ GET_CPUINFO(%r1) @@ -908,6 +926,13 @@ CNAME(dblow): stw %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ stw %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ - bla dbtrap + + /* Jump to dbtrap */ + bl 2f + .long dbtrap +2: mflr %r1 + lwz %r1,0(%r1) + mtlr %r1 + blrl CNAME(dbend): #endif /* KDB */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/aim/trap_subr64.S Sat Mar 7 20:14:46 2015 (r279750) @@ -673,8 +673,7 @@ realtrap: * SPRG2 - Original LR */ - .globl CNAME(trapcode2) -trapcode2: + .globl CNAME(generictrap) generictrap: /* Save R1 for computing the exception vector */ mtsprg3 %r1 Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/booke/locore.S Sat Mar 7 20:14:46 2015 (r279750) @@ -205,11 +205,29 @@ done_mapping: /* * Setup a temporary stack */ - lis %r1, tmpstack@ha - addi %r1, %r1, tmpstack@l + bl 1f + .long tmpstack-. +1: mflr %r1 + lwz %r2,0(%r1) + add %r1,%r1,%r2 addi %r1, %r1, (TMPSTACKSZ - 16) /* + * Relocate kernel + */ + bl 1f + .long _DYNAMIC-. + .long _GLOBAL_OFFSET_TABLE_-. +1: mflr %r5 + lwz %r3,0(%r5) /* _DYNAMIC in %r3 */ + add %r3,%r3,%r5 + lwz %r4,4(%r5) /* GOT pointer */ + add %r4,%r4,%r5 + lwz %r4,4(%r4) /* got[0] is _DYNAMIC link addr */ + subf %r4,%r4,%r3 /* subtract to calculate relocbase */ + bl elf_reloc_self + +/* * Initialise exception vector offsets */ bl ivor_setup @@ -338,10 +356,13 @@ bp_tlb1_end: blt 4b /* Switch to the final mapping */ - lis %r5, __boot_page@ha - ori %r5, %r5, __boot_page@l bl 5f -5: mflr %r3 + .long __boot_page-. +5: mflr %r5 + lwz %r3,0(%r3) + add %r5,%r5,%r3 /* __boot_page in r5 */ + bl 6f +6: mflr %r3 rlwinm %r3, %r3, 0, 0xfff /* Offset from boot page start */ add %r3, %r3, %r5 /* Make this virtual address */ addi %r3, %r3, 32 @@ -365,8 +386,11 @@ bp_tlb1_end: /* * Setup a temporary stack */ - lis %r1, tmpstack@ha - addi %r1, %r1, tmpstack@l + bl 1f + .long tmpstack-. +1: mflr %r1 + lwz %r2,0(%r1) + add %r1,%r1,%r2 addi %r1, %r1, (TMPSTACKSZ - 16) /* @@ -377,8 +401,11 @@ bp_tlb1_end: /* * Assign our pcpu instance */ - lis %r3, ap_pcpu@h - ori %r3, %r3, ap_pcpu@l + bl 1f + .long ap_pcpu-. +1: mflr %r4 + lwz %r3, 0(%r4) + add %r3, %r3, %r4 lwz %r3, 0(%r3) mtsprg0 %r3 @@ -543,24 +570,14 @@ __boot_page_padding: * dedicated for cases when invalidation(s) should NOT be propagated to other * CPUs. * - * Global vars tlb0_ways, tlb0_entries_per_way are assumed to have been set up - * correctly (by tlb0_get_tlbconf()). + * void tid_flush(tlbtid_t tid, int tlb0_ways, int tlb0_entries_per_way); * + * XXX: why isn't this in C? */ ENTRY(tid_flush) cmpwi %r3, TID_KERNEL beq tid_flush_end /* don't evict kernel translations */ - /* Number of TLB0 ways */ - lis %r4, tlb0_ways@h - ori %r4, %r4, tlb0_ways@l - lwz %r4, 0(%r4) - - /* Number of entries / way */ - lis %r5, tlb0_entries_per_way@h - ori %r5, %r5, tlb0_entries_per_way@l - lwz %r5, 0(%r5) - /* Disable interrupts */ mfmsr %r10 wrteei 0 @@ -718,6 +735,11 @@ setfault: /* Data section */ /************************************************************************/ .data + .align 3 +GLOBAL(__startkernel) + .long begin +GLOBAL(__endkernel) + .long end .align 4 tmpstack: .space TMPSTACKSZ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/booke/pmap.c Sat Mar 7 20:14:46 2015 (r279750) @@ -159,7 +159,7 @@ unsigned int kernel_ptbls; /* Number of #define PMAP_REMOVE_DONE(pmap) \ ((pmap) != kernel_pmap && (pmap)->pm_stats.resident_count == 0) -extern void tid_flush(tlbtid_t); +extern void tid_flush(tlbtid_t tid, int tlb0_ways, int tlb0_entries_per_way); extern int elf32_nxstack; /**************************************************************************/ @@ -2818,7 +2818,7 @@ tid_alloc(pmap_t pmap) tidbusy[thiscpu][tid]->pm_tid[thiscpu] = TID_NONE; /* Flush all entries from TLB0 matching this TID. */ - tid_flush(tid); + tid_flush(tid, tlb0_ways, tlb0_entries_per_way); } tidbusy[thiscpu][tid] = pmap; Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/booke/trap_subr.S Sat Mar 7 20:14:46 2015 (r279750) @@ -542,8 +542,11 @@ INTERRUPT(int_data_tlb_error) search_kernel_pmap: /* Load r26 with kernel_pmap address */ - lis %r26, kernel_pmap_store@h - ori %r26, %r26, kernel_pmap_store@l + bl 1f + .long kernel_pmap_store-. +1: mflr %r21 + lwz %r26, 0(%r21) + add %r26, %r21, %r26 /* kernel_pmap_store in r26 */ /* Force kernel tid, set TID to 0 in MAS1. */ li %r21, 0 @@ -737,12 +740,17 @@ INTERRUPT(int_debug) FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG) GET_CPUINFO(%r3) lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0)(%r3) - lis %r4, interrupt_vector_base@ha - addi %r4, %r4, interrupt_vector_base@l + bl 0f + .long interrupt_vector_base-. + .long interrupt_vector_top-. +0: mflr %r5 + lwz %r4,0(%r5) /* interrupt_vector_base in r4 */ + add %r4,%r4,%r5 cmplw cr0, %r3, %r4 blt 1f - lis %r4, interrupt_vector_top@ha - addi %r4, %r4, interrupt_vector_top@l + lwz %r4,4(%r5) /* interrupt_vector_top in r4 */ + add %r4,%r4,%r5 + addi %r4,%r4,4 cmplw cr0, %r3, %r4 bge 1f /* Disable single-stepping for the interrupt handlers. */ Modified: head/sys/powerpc/ofw/ofwcall32.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall32.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/ofw/ofwcall32.S Sat Mar 7 20:14:46 2015 (r279750) @@ -66,17 +66,21 @@ ASENTRY(ofwcall) /* Record the old MSR */ mfmsr %r6 + /* GOT pointer in r7 */ + bl _GLOBAL_OFFSET_TABLE_@local-4 + mflr %r7 + /* read client interface handler */ - lis %r4,openfirmware_entry@ha - lwz %r4,openfirmware_entry@l(%r4) + lwz %r4,openfirmware_entry@got(%r7) + lwz %r4,0(%r4) /* * Set the MSR to the OF value. This has the side effect of disabling * exceptions, which prevents preemption later. */ - lis %r5,ofmsr@ha - lwz %r5,ofmsr@l(%r5) + lwz %r5,ofmsr@got(%r7) + lwz %r5,0(%r5) mtmsr %r5 isync @@ -87,8 +91,8 @@ ASENTRY(ofwcall) * later. */ mr %r5,%r1 - lis %r1,(ofwstk+OFWSTKSZ-32)@ha - addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l + lwz %r1,ofwstk@got(%r7) + addi %r1,%r1,(OFWSTKSZ-32) stw %r5,20(%r1) /* Save real stack pointer */ stw %r2,24(%r1) /* Save curthread */ stw %r6,28(%r1) /* Save old MSR */ @@ -124,18 +128,22 @@ ASENTRY(rtascall) mflr %r0 stw %r0,4(%r1) + /* GOT pointer in r7 */ + bl _GLOBAL_OFFSET_TABLE_@local-4 + mflr %r7 + /* Record the old MSR to real-mode-accessible area */ mfmsr %r0 - lis %r5,rtas_regsave@ha - stw %r0,rtas_regsave@l(%r5) + lwz %r5,rtas_regsave@got(%r7) + stw %r0,0(%r5) /* read client interface handler */ - lis %r5,rtas_entry@ha - lwz %r5,rtas_entry@l(%r5) + lwz %r5,rtas_entry@got(%r7) + lwz %r5,0(%r5) /* Set the MSR to the RTAS value */ - lis %r6,rtasmsr@ha - lwz %r6,rtasmsr@l(%r6) + lwz %r6,rtasmsr@got(%r7) + lwz %r6,0(%r6) mtmsr %r6 isync @@ -143,9 +151,13 @@ ASENTRY(rtascall) mtctr %r5 bctrl + /* GOT pointer in r7 */ + bl _GLOBAL_OFFSET_TABLE_@local-4 + mflr %r7 + /* Now set the MSR back */ - lis %r6,rtas_regsave@ha - lwz %r6,rtas_regsave@l(%r6) + lwz %r6,rtas_regsave@got(%r7) + lwz %r6,0(%r6) mtmsr %r6 isync Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/powerpc/elf32_machdep.c Sat Mar 7 20:14:46 2015 (r279750) @@ -147,6 +147,8 @@ SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_AN (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_oinfo); +void elf_reloc_self(Elf_Dyn *dynp, Elf_Addr relocbase); + void elf32_dump_thread(struct thread *td, void *dst, size_t *off) { @@ -252,6 +254,39 @@ elf_reloc_internal(linker_file_t lf, Elf return(0); } +void +elf_reloc_self(Elf_Dyn *dynp, Elf_Addr relocbase) +{ + Elf_Rela *rela = 0, *relalim; + Elf_Addr relasz = 0; + Elf_Addr *where; + + /* + * Extract the rela/relasz values from the dynamic section + */ + for (; dynp->d_tag != DT_NULL; dynp++) { + switch (dynp->d_tag) { + case DT_RELA: + rela = (Elf_Rela *)(relocbase+dynp->d_un.d_ptr); + break; + case DT_RELASZ: + relasz = dynp->d_un.d_val; + break; + } + } + + /* + * Relocate these values + */ + relalim = (Elf_Rela *)((caddr_t)rela + relasz); + for (; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) != R_PPC_RELATIVE) + continue; + where = (Elf_Addr *)(relocbase + rela->r_offset); + *where = (Elf_Addr)(relocbase + rela->r_addend); + } +} + int elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup) Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Sat Mar 7 20:00:26 2015 (r279749) +++ head/sys/powerpc/powerpc/swtch32.S Sat Mar 7 20:14:46 2015 (r279750) @@ -121,8 +121,9 @@ ENTRY(cpu_switch) cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) /* Wait for the new thread to become unblocked */ - lis %r6,blocked_lock@ha - addi %r6,%r6,blocked_lock@l + bl _GLOBAL_OFFSET_TABLE_@local-4 + mflr %r6 + lwz %r6,blocked_lock@got(%r6) blocked_loop: lwz %r7,TD_LOCK(%r2) cmpw %r6,%r7 From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 20:27:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04D6AF1E; Sat, 7 Mar 2015 20:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9B40FC0; Sat, 7 Mar 2015 20:27:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27KR1KV046088; Sat, 7 Mar 2015 20:27:01 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27KR11H046087; Sat, 7 Mar 2015 20:27:01 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503072027.t27KR11H046087@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 7 Mar 2015 20:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279751 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 20:27:02 -0000 Author: nwhitehorn Date: Sat Mar 7 20:27:00 2015 New Revision: 279751 URL: https://svnweb.freebsd.org/changeset/base/279751 Log: Make assembly slightly more idiomatic (and able to be handled by clang's integrated assembler). Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sat Mar 7 20:14:46 2015 (r279750) +++ head/sys/powerpc/aim/trap_subr64.S Sat Mar 7 20:27:00 2015 (r279751) @@ -62,7 +62,7 @@ restore_usersrs: clrrdi %r31,%r31,28 slbie %r31 1: ld %r31, 0(%r28) /* Load SLB entry pointer */ - cmpli 0, %r31, 0 /* If NULL, stop */ + cmpdi %r31, 0 /* If NULL, stop */ beqlr ld %r30, 0(%r31) /* Load SLBV */ @@ -86,18 +86,18 @@ restore_kernsrs: slbmfee %r31,%r29 clrrdi %r31,%r31,28 slbie %r31 -1: cmpli 0, %r29, USER_SLB_SLOT /* Skip the user slot */ +1: cmpdi %r29, USER_SLB_SLOT /* Skip the user slot */ beq- 2f ld %r31, 8(%r28) /* Load SLBE */ - cmpli 0, %r31, 0 /* If SLBE is not valid, stop */ + cmpdi %r31, 0 /* If SLBE is not valid, stop */ beqlr ld %r30, 0(%r28) /* Load SLBV */ slbmte %r30, %r31 /* Install SLB entry */ 2: addi %r28, %r28, 16 /* Advance pointer */ addi %r29, %r29, 1 - cmpli 0, %r29, 64 /* Repeat if we are not at the end */ + cmpdi %r29, 64 /* Repeat if we are not at the end */ blt 1b blr @@ -356,8 +356,7 @@ CNAME(trapcode): mtsprg1 %r1 /* save SP */ mflr %r1 /* Save the old LR in r1 */ mtsprg2 %r1 /* And then in SPRG2 */ - li %r1,TRAP_GENTRAP - ld %r1,0(%r1) + ld %r1,TRAP_GENTRAP(0) mtlr %r1 li %r1, 0xe0 /* How to get the vector from LR */ blrl /* Branch to generictrap */ @@ -791,8 +790,7 @@ dbtrap: andi. %r1,%r1,0xff00 mtsprg3 %r1 - li %r1,TRAP_TOCBASE /* get new SP */ - ld %r1,0(%r1) + ld %r1,TRAP_TOCBASE(0) /* get new SP */ ld %r1,TOC_REF(tmpstk)(%r1) addi %r1,%r1,(TMPSTKSZ-48) From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 20:45:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 152EB452; Sat, 7 Mar 2015 20:45:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F309E217; Sat, 7 Mar 2015 20:45:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27KjGTq055522; Sat, 7 Mar 2015 20:45:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27KjGtF055518; Sat, 7 Mar 2015 20:45:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503072045.t27KjGtF055518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 20:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279752 - in head/sys: dev/fb dev/vt/hw/fb powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 20:45:17 -0000 Author: hselasky Date: Sat Mar 7 20:45:15 2015 New Revision: 279752 URL: https://svnweb.freebsd.org/changeset/base/279752 Log: Add support for USB display link adapters to the FB and VT drivers. The vtophys() function is used to get the physical page address for the virtually allocated frame buffers when a physically continuous memory area is not available. This change also allows removing the masking of the FB_FLAG_NOMMAP flag in the PS3 syscons driver. The FB and VT drivers were tested using X.org/xf86-video-scfb and syscons. Modified: head/sys/dev/fb/fbd.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Sat Mar 7 20:27:00 2015 (r279751) +++ head/sys/dev/fb/fbd.c Sat Mar 7 20:45:15 2015 (r279752) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "fb_if.h" LIST_HEAD(fb_list_head_t, fb_list_entry) fb_list_head = @@ -167,11 +170,14 @@ fb_mmap(struct cdev *dev, vm_ooffset_t o info = dev->si_drv1; - if ((info->fb_flags & FB_FLAG_NOMMAP) || info->fb_pbase == 0) + if (info->fb_flags & FB_FLAG_NOMMAP) return (ENODEV); - if (offset < info->fb_size) { - *paddr = info->fb_pbase + offset; + if (offset >= 0 && offset < info->fb_size) { + if (info->fb_pbase == 0) + *paddr = vtophys((uint8_t *)info->fb_vbase + offset); + else + *paddr = info->fb_pbase + offset; return (0); } return (EINVAL); @@ -356,5 +362,6 @@ devclass_t fbd_devclass; DRIVER_MODULE(fbd, fb, fbd_driver, fbd_devclass, 0, 0); DRIVER_MODULE(fbd, drmn, fbd_driver, fbd_devclass, 0, 0); +DRIVER_MODULE(fbd, udl, fbd_driver, fbd_devclass, 0, 0); MODULE_VERSION(fbd, 1); Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Sat Mar 7 20:27:00 2015 (r279751) +++ head/sys/dev/vt/hw/fb/vt_fb.c Sat Mar 7 20:45:15 2015 (r279752) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static struct vt_driver vt_fb_driver = { .vd_name = "fb", .vd_init = vt_fb_init, @@ -136,10 +139,14 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff return (ENODEV); if (offset >= 0 && offset < info->fb_size) { - *paddr = info->fb_pbase + offset; - #ifdef VM_MEMATTR_WRITE_COMBINING - *memattr = VM_MEMATTR_WRITE_COMBINING; - #endif + if (info->fb_pbase == 0) { + *paddr = vtophys((uint8_t *)info->fb_vbase + offset); + } else { + *paddr = info->fb_pbase + offset; +#ifdef VM_MEMATTR_WRITE_COMBINING + *memattr = VM_MEMATTR_WRITE_COMBINING; +#endif + } return (0); } @@ -425,7 +432,7 @@ vt_fb_init(struct vt_device *vd) if (info->fb_size == 0) return (CN_DEAD); - if (info->fb_pbase == 0) + if (info->fb_pbase == 0 && info->fb_vbase == 0) info->fb_flags |= FB_FLAG_NOMMAP; if (info->fb_cmsize <= 0) { Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Sat Mar 7 20:27:00 2015 (r279751) +++ head/sys/powerpc/ps3/ps3_syscons.c Sat Mar 7 20:45:15 2015 (r279752) @@ -191,7 +191,6 @@ ps3fb_init(struct vt_device *vd) L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); vt_fb_init(vd); - sc->fb_info.fb_flags &= ~FB_FLAG_NOMMAP; /* Set wrongly by vt_fb_init */ return (CN_INTERNAL); } From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 20:49:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E07F55BE; Sat, 7 Mar 2015 20:49:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B120F23D; Sat, 7 Mar 2015 20:49:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27KnXsH056064; Sat, 7 Mar 2015 20:49:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27KnXBf056063; Sat, 7 Mar 2015 20:49:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503072049.t27KnXBf056063@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 20:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279753 - head/sys/dev/usb/video X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 20:49:34 -0000 Author: hselasky Date: Sat Mar 7 20:49:32 2015 New Revision: 279753 URL: https://svnweb.freebsd.org/changeset/base/279753 Log: Allow the UDL screen refresh rate to be runtime configurable through a sysctl. Increase the default frame rate to 25 FPS. Add a comment about memory constraints. Modified: head/sys/dev/usb/video/udl.c Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Sat Mar 7 20:45:15 2015 (r279752) +++ head/sys/dev/usb/video/udl.c Sat Mar 7 20:49:32 2015 (r279753) @@ -60,15 +60,22 @@ #define USB_DEBUG_VAR udl_debug #include +static SYSCTL_NODE(_hw_usb, OID_AUTO, udl, CTLFLAG_RW, 0, "USB UDL"); + #ifdef USB_DEBUG static int udl_debug = 0; -static SYSCTL_NODE(_hw_usb, OID_AUTO, udl, CTLFLAG_RW, 0, "USB UDL"); - SYSCTL_INT(_hw_usb_udl, OID_AUTO, debug, CTLFLAG_RWTUN, &udl_debug, 0, "Debug level"); #endif +#define UDL_FPS_MAX 60 +#define UDL_FPS_MIN 1 + +static int udl_fps = 25; +SYSCTL_INT(_hw_usb_udl, OID_AUTO, fps, CTLFLAG_RWTUN, + &udl_fps, 0, "Frames Per Second, 1-60"); + /* * Prototypes. */ @@ -206,14 +213,25 @@ udl_callout(void *arg) { struct udl_softc *sc = arg; const uint32_t max = udl_get_fb_size(sc); + int fps; if (sc->sc_power_save == 0) { + fps = udl_fps; + + /* figure out number of frames per second */ + if (fps < UDL_FPS_MIN) + fps = UDL_FPS_MIN; + else if (fps > UDL_FPS_MAX) + fps = UDL_FPS_MAX; + if (sc->sc_sync_off >= max) sc->sc_sync_off = 0; usbd_transfer_start(sc->sc_xfer[UDL_BULK_WRITE_0]); usbd_transfer_start(sc->sc_xfer[UDL_BULK_WRITE_1]); + } else { + fps = 1; } - callout_reset(&sc->sc_callout, hz / 5, &udl_callout, sc); + callout_reset(&sc->sc_callout, hz / fps, &udl_callout, sc); } static int @@ -765,6 +783,10 @@ udl_fbmem_alloc(struct udl_softc *sc) size = udl_get_fb_size(sc); size = round_page(size); + /* + * It is assumed that allocations above PAGE_SIZE bytes will + * be PAGE_SIZE aligned for use with mmap() + */ sc->sc_fb_addr = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_fb_copy = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_fb_size = size; From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 21:28:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF59BF8E; Sat, 7 Mar 2015 21:28:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABC7841; Sat, 7 Mar 2015 21:28:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27LScRx075057; Sat, 7 Mar 2015 21:28:38 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27LScDl075056; Sat, 7 Mar 2015 21:28:38 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503072128.t27LScDl075056@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 7 Mar 2015 21:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279754 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 21:28:38 -0000 Author: gnn Date: Sat Mar 7 21:28:37 2015 New Revision: 279754 URL: https://svnweb.freebsd.org/changeset/base/279754 Log: Add execute bits to tcpstate script. Modified: head/share/dtrace/tcpstate Modified: head/share/dtrace/tcpstate ============================================================================== --- head/share/dtrace/tcpstate Sat Mar 7 20:49:32 2015 (r279753) +++ head/share/dtrace/tcpstate Sat Mar 7 21:28:37 2015 (r279754) @@ -41,6 +41,6 @@ tcp:kernel::state-change { newstate = args[3]->tcps_state; oldstate = args[5]->tcps_state; - printf("%s\t\t%s\n", tcp_state_string[oldstate], + printf("%d %s\t\t%s\n", args[1]->pid, tcp_state_string[oldstate], tcp_state_string[newstate]); } From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 21:31:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E04E160; Sat, 7 Mar 2015 21:31:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 202AA852; Sat, 7 Mar 2015 21:31:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27LVbVg076663; Sat, 7 Mar 2015 21:31:37 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27LVbCP076662; Sat, 7 Mar 2015 21:31:37 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503072131.t27LVbCP076662@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 7 Mar 2015 21:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279755 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 21:31:38 -0000 Author: gnn Date: Sat Mar 7 21:31:37 2015 New Revision: 279755 URL: https://svnweb.freebsd.org/changeset/base/279755 Log: Set the property to executable. Modified: Directory Properties: head/share/dtrace/tcpstate (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 22:46:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DAC5C6E; Sat, 7 Mar 2015 22:46:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18275F28; Sat, 7 Mar 2015 22:46:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27MkZuS013154; Sat, 7 Mar 2015 22:46:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27MkZrW013153; Sat, 7 Mar 2015 22:46:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503072246.t27MkZrW013153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 22:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279756 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 22:46:36 -0000 Author: hselasky Date: Sat Mar 7 22:46:35 2015 New Revision: 279756 URL: https://svnweb.freebsd.org/changeset/base/279756 Log: Use correct mode variable for PPS support. PR: 196897 Submitted by: ian @ MFC after: 1 week Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Sat Mar 7 21:31:37 2015 (r279755) +++ head/sys/dev/usb/serial/usb_serial.c Sat Mar 7 22:46:35 2015 (r279756) @@ -1105,7 +1105,7 @@ ucom_cfg_status_change(struct usb_proc_m /* time pulse counting support */ switch(ucom_pps_mode) { case 1: - if ((sc->sc_pps.ppscap & PPS_CAPTUREBOTH) && + if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && (msr_delta & SER_CTS)) { pps_capture(&sc->sc_pps); pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ? @@ -1113,7 +1113,7 @@ ucom_cfg_status_change(struct usb_proc_m } break; case 2: - if ((sc->sc_pps.ppscap & PPS_CAPTUREBOTH) && + if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && (msr_delta & SER_DCD)) { pps_capture(&sc->sc_pps); pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ? From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 22:53:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BF94EC5; Sat, 7 Mar 2015 22:53:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D18841000; Sat, 7 Mar 2015 22:53:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27MrGaT017452; Sat, 7 Mar 2015 22:53:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27MrGNh017450; Sat, 7 Mar 2015 22:53:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503072253.t27MrGNh017450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 7 Mar 2015 22:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279757 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 22:53:17 -0000 Author: dim Date: Sat Mar 7 22:53:15 2015 New Revision: 279757 URL: https://svnweb.freebsd.org/changeset/base/279757 Log: Pull in r228344 from upstream libc++ trunk (by Eric Fiselier): Get tests running with warnings. Fix warnings in headers and tests This fixes a number of -Wunused-local-typedef warnings in libc++ headers. MFC after: 3 days Modified: head/contrib/libc++/include/__bit_reference head/contrib/libc++/include/algorithm Modified: head/contrib/libc++/include/__bit_reference ============================================================================== --- head/contrib/libc++/include/__bit_reference Sat Mar 7 22:46:35 2015 (r279756) +++ head/contrib/libc++/include/__bit_reference Sat Mar 7 22:53:15 2015 (r279757) @@ -906,7 +906,6 @@ rotate(__bit_iterator<_Cp, false> __firs { typedef __bit_iterator<_Cp, false> _I1; typedef typename _I1::difference_type difference_type; - typedef typename _I1::__storage_type __storage_type; difference_type __d1 = __middle - __first; difference_type __d2 = __last - __middle; _I1 __r = __first + __d2; Modified: head/contrib/libc++/include/algorithm ============================================================================== --- head/contrib/libc++/include/algorithm Sat Mar 7 22:46:35 2015 (r279756) +++ head/contrib/libc++/include/algorithm Sat Mar 7 22:53:15 2015 (r279757) @@ -4365,8 +4365,6 @@ __buffered_inplace_merge(_BidirectionalI typename iterator_traits<_BidirectionalIterator>::value_type* __buff) { typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; - typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; - typedef typename iterator_traits<_BidirectionalIterator>::pointer pointer; __destruct_n __d(0); unique_ptr __h2(__buff, __d); if (__len1 <= __len2) @@ -4400,7 +4398,6 @@ __inplace_merge(_BidirectionalIterator _ typename iterator_traits<_BidirectionalIterator>::difference_type __len2, typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size) { - typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; while (true) { @@ -4799,7 +4796,6 @@ void __sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, typename iterator_traits<_RandomAccessIterator>::difference_type __len) { - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; if (__len > 1) { From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 22:55:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4E57126; Sat, 7 Mar 2015 22:55:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFEE4A8; Sat, 7 Mar 2015 22:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27MtW7t017822; Sat, 7 Mar 2015 22:55:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27MtWGO017821; Sat, 7 Mar 2015 22:55:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503072255.t27MtWGO017821@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 7 Mar 2015 22:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279758 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 22:55:32 -0000 Author: dim Date: Sat Mar 7 22:55:31 2015 New Revision: 279758 URL: https://svnweb.freebsd.org/changeset/base/279758 Log: Fix another -Wunused-local-typedef warning in libc++, in include/__tree. MFC after: 3 days Modified: head/contrib/libc++/include/__tree Modified: head/contrib/libc++/include/__tree ============================================================================== --- head/contrib/libc++/include/__tree Sat Mar 7 22:53:15 2015 (r279757) +++ head/contrib/libc++/include/__tree Sat Mar 7 22:55:31 2015 (r279758) @@ -2069,7 +2069,6 @@ template typename __tree<_Tp, _Compare, _Allocator>::size_type __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const { - typedef pair _Pp; __node_const_pointer __result = __end_node(); __node_const_pointer __rt = __root(); while (__rt != nullptr)